summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2018-07-28 11:09:23 +0000
commitf73363f1dd94996356cefbf24388f561891acf0b (patch)
treee3c31248bdb36eaec5fd833490d4278162dba2a0
parent160ee69dd7ae18978f4068116777639ea98dc951 (diff)
downloadsrc-test2-f73363f1dd94996356cefbf24388f561891acf0b.tar.gz
src-test2-f73363f1dd94996356cefbf24388f561891acf0b.zip
Notes
-rw-r--r--.gitignore6
-rw-r--r--CMakeLists.txt109
-rw-r--r--CODE_OWNERS.txt2
-rw-r--r--cmake/modules/AddLLDB.cmake39
-rw-r--r--cmake/modules/FindLibEdit.cmake62
-rw-r--r--cmake/modules/LLDBConfig.cmake39
-rw-r--r--cmake/modules/LLDBFramework.cmake44
-rw-r--r--cmake/modules/LLDBGenerateConfig.cmake29
-rw-r--r--cmake/modules/LLDBStandalone.cmake5
-rw-r--r--docs/code-signing.txt11
-rw-r--r--docs/doxygen.cfg.in4
-rw-r--r--docs/lldb-gdb-remote.txt2
-rw-r--r--docs/testsuite/a-detailed-walkthrough.txt24
-rw-r--r--examples/darwin/heap_find/heap/heap_find.cpp4
-rwxr-xr-xexamples/python/bsd.py481
-rw-r--r--examples/python/cmdtemplate.py131
-rw-r--r--include/lldb/API/SBAddress.h12
-rw-r--r--include/lldb/API/SBBroadcaster.h14
-rw-r--r--include/lldb/API/SBCommandInterpreter.h50
-rw-r--r--include/lldb/API/SBCommandReturnObject.h3
-rw-r--r--include/lldb/API/SBData.h14
-rw-r--r--include/lldb/API/SBDebugger.h2
-rw-r--r--include/lldb/API/SBExpressionOptions.h6
-rw-r--r--include/lldb/API/SBFrame.h8
-rw-r--r--include/lldb/API/SBInstruction.h5
-rw-r--r--include/lldb/API/SBInstructionList.h4
-rw-r--r--include/lldb/API/SBLaunchInfo.h9
-rw-r--r--include/lldb/API/SBModule.h15
-rw-r--r--include/lldb/API/SBProcess.h42
-rw-r--r--include/lldb/API/SBStream.h13
-rw-r--r--include/lldb/API/SBStructuredData.h1
-rw-r--r--include/lldb/API/SBSymbol.h4
-rw-r--r--include/lldb/API/SBTarget.h29
-rw-r--r--include/lldb/API/SBThread.h16
-rw-r--r--include/lldb/API/SBValue.h3
-rw-r--r--include/lldb/API/SBValueList.h4
-rw-r--r--include/lldb/Breakpoint/Breakpoint.h175
-rw-r--r--include/lldb/Breakpoint/BreakpointID.h2
-rw-r--r--include/lldb/Breakpoint/BreakpointIDList.h2
-rw-r--r--include/lldb/Breakpoint/BreakpointList.h21
-rw-r--r--include/lldb/Breakpoint/BreakpointLocation.h73
-rw-r--r--include/lldb/Breakpoint/BreakpointLocationCollection.h4
-rw-r--r--include/lldb/Breakpoint/BreakpointLocationList.h73
-rw-r--r--include/lldb/Breakpoint/BreakpointName.h4
-rw-r--r--include/lldb/Breakpoint/BreakpointOptions.h59
-rw-r--r--include/lldb/Breakpoint/BreakpointResolver.h64
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverAddress.h10
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverFileLine.h9
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverFileRegex.h5
-rw-r--r--include/lldb/Breakpoint/BreakpointResolverName.h10
-rw-r--r--include/lldb/Breakpoint/BreakpointSite.h71
-rw-r--r--include/lldb/Breakpoint/BreakpointSiteList.h21
-rw-r--r--include/lldb/Breakpoint/StoppointCallbackContext.h11
-rw-r--r--include/lldb/Breakpoint/StoppointLocation.h4
-rw-r--r--include/lldb/Breakpoint/Watchpoint.h12
-rw-r--r--include/lldb/Breakpoint/WatchpointList.h28
-rw-r--r--include/lldb/Breakpoint/WatchpointOptions.h31
-rw-r--r--include/lldb/Core/Address.h202
-rw-r--r--include/lldb/Core/AddressRange.h54
-rw-r--r--include/lldb/Core/AddressResolver.h14
-rw-r--r--include/lldb/Core/AddressResolverFileLine.h7
-rw-r--r--include/lldb/Core/AddressResolverName.h10
-rw-r--r--include/lldb/Core/Architecture.h36
-rw-r--r--include/lldb/Core/Broadcaster.h83
-rw-r--r--include/lldb/Core/Communication.h163
-rw-r--r--include/lldb/Core/Debugger.h35
-rw-r--r--include/lldb/Core/Disassembler.h59
-rw-r--r--include/lldb/Core/DumpRegisterValue.h31
-rw-r--r--include/lldb/Core/EmulateInstruction.h104
-rw-r--r--include/lldb/Core/Event.h6
-rw-r--r--include/lldb/Core/FileLineResolver.h5
-rw-r--r--include/lldb/Core/FileSpecList.h37
-rw-r--r--include/lldb/Core/FormatEntity.h13
-rw-r--r--include/lldb/Core/IOHandler.h30
-rw-r--r--include/lldb/Core/LoadedModuleInfoList.h4
-rw-r--r--include/lldb/Core/Mangled.h56
-rw-r--r--include/lldb/Core/MappedHash.h219
-rw-r--r--include/lldb/Core/Module.h402
-rw-r--r--include/lldb/Core/ModuleChild.h2
-rw-r--r--include/lldb/Core/ModuleList.h92
-rw-r--r--include/lldb/Core/ModuleSpec.h8
-rw-r--r--include/lldb/Core/PluginManager.h10
-rw-r--r--include/lldb/Core/RangeMap.h75
-rw-r--r--include/lldb/Core/RegisterValue.h23
-rw-r--r--include/lldb/Core/STLUtils.h4
-rw-r--r--include/lldb/Core/Scalar.h58
-rw-r--r--include/lldb/Core/SearchFilter.h55
-rw-r--r--include/lldb/Core/Section.h9
-rw-r--r--include/lldb/Core/SourceManager.h5
-rw-r--r--include/lldb/Core/StreamBuffer.h5
-rw-r--r--include/lldb/Core/ThreadSafeDenseSet.h2
-rw-r--r--include/lldb/Core/ThreadSafeValue.h1
-rw-r--r--include/lldb/Core/UniqueCStringMap.h73
-rw-r--r--include/lldb/Core/UserSettingsController.h19
-rw-r--r--include/lldb/Core/Value.h10
-rw-r--r--include/lldb/Core/ValueObject.h74
-rw-r--r--include/lldb/Core/ValueObjectSyntheticFilter.h6
-rw-r--r--include/lldb/DataFormatters/DataVisualization.h11
-rw-r--r--include/lldb/DataFormatters/FormatClasses.h4
-rw-r--r--include/lldb/DataFormatters/FormatManager.h47
-rw-r--r--include/lldb/DataFormatters/FormattersContainer.h10
-rw-r--r--include/lldb/DataFormatters/StringPrinter.h3
-rw-r--r--include/lldb/DataFormatters/TypeFormat.h7
-rw-r--r--include/lldb/DataFormatters/TypeSummary.h11
-rw-r--r--include/lldb/DataFormatters/TypeSynthetic.h50
-rw-r--r--include/lldb/DataFormatters/TypeValidator.h7
-rw-r--r--include/lldb/DataFormatters/ValueObjectPrinter.h8
-rw-r--r--include/lldb/DataFormatters/VectorIterator.h1
-rw-r--r--include/lldb/Expression/DWARFExpression.h81
-rw-r--r--include/lldb/Expression/Expression.h29
-rw-r--r--include/lldb/Expression/ExpressionParser.h16
-rw-r--r--include/lldb/Expression/ExpressionSourceCode.h5
-rw-r--r--include/lldb/Expression/ExpressionTypeSystemHelper.h6
-rw-r--r--include/lldb/Expression/ExpressionVariable.h24
-rw-r--r--include/lldb/Expression/FunctionCaller.h27
-rw-r--r--include/lldb/Expression/IRDynamicChecks.h33
-rw-r--r--include/lldb/Expression/IRExecutionUnit.h62
-rw-r--r--include/lldb/Expression/IRInterpreter.h8
-rw-r--r--include/lldb/Expression/IRMemoryMap.h22
-rw-r--r--include/lldb/Expression/LLVMUserExpression.h23
-rw-r--r--include/lldb/Expression/UserExpression.h27
-rw-r--r--include/lldb/Expression/UtilityFunction.h37
-rw-r--r--include/lldb/Host/Config.h4
-rw-r--r--include/lldb/Host/Config.h.cmake8
-rw-r--r--include/lldb/Host/Debug.h10
-rw-r--r--include/lldb/Host/Editline.h27
-rw-r--r--include/lldb/Host/File.h81
-rw-r--r--include/lldb/Host/Host.h77
-rw-r--r--include/lldb/Host/HostInfo.h21
-rw-r--r--include/lldb/Host/HostInfoBase.h53
-rw-r--r--include/lldb/Host/HostProcess.h14
-rw-r--r--include/lldb/Host/HostThread.h2
-rw-r--r--include/lldb/Host/MainLoop.h26
-rw-r--r--include/lldb/Host/MainLoopBase.h21
-rw-r--r--include/lldb/Host/MonitoringProcessLauncher.h3
-rw-r--r--include/lldb/Host/PosixApi.h5
-rw-r--r--include/lldb/Host/Predicate.h350
-rw-r--r--include/lldb/Host/ProcessRunLock.h6
-rw-r--r--include/lldb/Host/PseudoTerminal.h106
-rw-r--r--include/lldb/Host/Socket.h6
-rw-r--r--include/lldb/Host/SocketAddress.h28
-rw-r--r--include/lldb/Host/StringConvert.h2
-rw-r--r--include/lldb/Host/Symbols.h16
-rw-r--r--include/lldb/Host/TaskPool.h31
-rw-r--r--include/lldb/Host/Terminal.h21
-rw-r--r--include/lldb/Host/XML.h22
-rw-r--r--include/lldb/Host/common/GetOptInc.h4
-rw-r--r--include/lldb/Host/common/NativeBreakpoint.h4
-rw-r--r--include/lldb/Host/common/NativeProcessProtocol.h36
-rw-r--r--include/lldb/Host/common/NativeRegisterContext.h17
-rw-r--r--include/lldb/Host/common/NativeThreadProtocol.h8
-rw-r--r--include/lldb/Host/freebsd/HostInfoFreeBSD.h3
-rw-r--r--include/lldb/Host/linux/HostInfoLinux.h4
-rw-r--r--include/lldb/Host/macosx/HostInfoMacOSX.h5
-rw-r--r--include/lldb/Host/netbsd/HostInfoNetBSD.h3
-rw-r--r--include/lldb/Host/posix/ConnectionFileDescriptorPosix.h6
-rw-r--r--include/lldb/Host/posix/HostInfoPosix.h7
-rw-r--r--include/lldb/Host/posix/PipePosix.h2
-rw-r--r--include/lldb/Host/windows/HostInfoWindows.h6
-rw-r--r--include/lldb/Host/windows/PipeWindows.h2
-rw-r--r--include/lldb/Host/windows/PosixApi.h2
-rw-r--r--include/lldb/Interpreter/CommandAlias.h21
-rw-r--r--include/lldb/Interpreter/CommandCompletions.h99
-rw-r--r--include/lldb/Interpreter/CommandInterpreter.h85
-rw-r--r--include/lldb/Interpreter/CommandObject.h148
-rw-r--r--include/lldb/Interpreter/CommandObjectMultiword.h26
-rw-r--r--include/lldb/Interpreter/CommandObjectRegexCommand.h8
-rw-r--r--include/lldb/Interpreter/OptionArgParser.h43
-rw-r--r--include/lldb/Interpreter/OptionGroupBoolean.h6
-rw-r--r--include/lldb/Interpreter/OptionGroupPlatform.h7
-rw-r--r--include/lldb/Interpreter/OptionValue.h26
-rw-r--r--include/lldb/Interpreter/OptionValueArch.h6
-rw-r--r--include/lldb/Interpreter/OptionValueArray.h12
-rw-r--r--include/lldb/Interpreter/OptionValueBoolean.h5
-rw-r--r--include/lldb/Interpreter/OptionValueEnumeration.h5
-rw-r--r--include/lldb/Interpreter/OptionValueFileSpec.h5
-rw-r--r--include/lldb/Interpreter/OptionValueFormatEntity.h5
-rw-r--r--include/lldb/Interpreter/OptionValueProperties.h10
-rw-r--r--include/lldb/Interpreter/OptionValueUInt64.h6
-rw-r--r--include/lldb/Interpreter/OptionValueUUID.h5
-rw-r--r--include/lldb/Interpreter/Options.h265
-rw-r--r--include/lldb/Interpreter/ScriptInterpreter.h17
-rw-r--r--include/lldb/Symbol/Block.h53
-rw-r--r--include/lldb/Symbol/ClangASTContext.h29
-rw-r--r--include/lldb/Symbol/ClangASTImporter.h11
-rw-r--r--include/lldb/Symbol/ClangExternalASTSourceCallbacks.h12
-rw-r--r--include/lldb/Symbol/CompactUnwindInfo.h33
-rw-r--r--include/lldb/Symbol/CompileUnit.h114
-rw-r--r--include/lldb/Symbol/CompilerType.h72
-rw-r--r--include/lldb/Symbol/DWARFCallFrameInfo.h44
-rw-r--r--include/lldb/Symbol/DeclVendor.h5
-rw-r--r--include/lldb/Symbol/Declaration.h23
-rw-r--r--include/lldb/Symbol/FuncUnwinders.h45
-rw-r--r--include/lldb/Symbol/Function.h110
-rw-r--r--include/lldb/Symbol/GoASTContext.h11
-rw-r--r--include/lldb/Symbol/LineEntry.h42
-rw-r--r--include/lldb/Symbol/LineTable.h23
-rw-r--r--include/lldb/Symbol/ObjectContainer.h65
-rw-r--r--include/lldb/Symbol/ObjectFile.h409
-rw-r--r--include/lldb/Symbol/Symbol.h70
-rw-r--r--include/lldb/Symbol/SymbolContext.h123
-rw-r--r--include/lldb/Symbol/SymbolContextScope.h51
-rw-r--r--include/lldb/Symbol/SymbolFile.h14
-rw-r--r--include/lldb/Symbol/SymbolVendor.h19
-rw-r--r--include/lldb/Symbol/Type.h38
-rw-r--r--include/lldb/Symbol/TypeSystem.h50
-rw-r--r--include/lldb/Symbol/UnwindPlan.h47
-rw-r--r--include/lldb/Symbol/UnwindTable.h21
-rw-r--r--include/lldb/Symbol/Variable.h14
-rw-r--r--include/lldb/Symbol/VariableList.h11
-rw-r--r--include/lldb/Target/ABI.h15
-rw-r--r--include/lldb/Target/DynamicLoader.h143
-rw-r--r--include/lldb/Target/ExecutionContext.h395
-rw-r--r--include/lldb/Target/ExecutionContextScope.h29
-rw-r--r--include/lldb/Target/JITLoader.h28
-rw-r--r--include/lldb/Target/Language.h19
-rw-r--r--include/lldb/Target/LanguageRuntime.h31
-rw-r--r--include/lldb/Target/Memory.h4
-rw-r--r--include/lldb/Target/MemoryRegionInfo.h20
-rw-r--r--include/lldb/Target/ModuleCache.h9
-rw-r--r--include/lldb/Target/ObjCLanguageRuntime.h27
-rw-r--r--include/lldb/Target/OperatingSystem.h11
-rw-r--r--include/lldb/Target/PathMappingList.h2
-rw-r--r--include/lldb/Target/Platform.h349
-rw-r--r--include/lldb/Target/Process.h934
-rw-r--r--include/lldb/Target/ProcessInfo.h21
-rw-r--r--include/lldb/Target/ProcessLaunchInfo.h13
-rw-r--r--include/lldb/Target/ProcessStructReader.h1
-rw-r--r--include/lldb/Target/Queue.h13
-rw-r--r--include/lldb/Target/QueueItem.h11
-rw-r--r--include/lldb/Target/QueueList.h9
-rw-r--r--include/lldb/Target/RegisterCheckpoint.h15
-rw-r--r--include/lldb/Target/RegisterContext.h18
-rw-r--r--include/lldb/Target/RegisterNumber.h4
-rw-r--r--include/lldb/Target/SectionLoadHistory.h16
-rw-r--r--include/lldb/Target/SectionLoadList.h12
-rw-r--r--include/lldb/Target/StackFrame.h80
-rw-r--r--include/lldb/Target/StackID.h18
-rw-r--r--include/lldb/Target/StopInfo.h52
-rw-r--r--include/lldb/Target/SystemRuntime.h136
-rw-r--r--include/lldb/Target/Target.h166
-rw-r--r--include/lldb/Target/Thread.h138
-rw-r--r--include/lldb/Target/ThreadCollection.h6
-rw-r--r--include/lldb/Target/ThreadList.h13
-rw-r--r--include/lldb/Target/ThreadPlan.h62
-rw-r--r--include/lldb/Target/ThreadPlanCallFunction.h39
-rw-r--r--include/lldb/Target/ThreadPlanCallFunctionUsingABI.h8
-rw-r--r--include/lldb/Target/ThreadPlanShouldStopHere.h28
-rw-r--r--include/lldb/Target/ThreadPlanStepOverBreakpoint.h1
-rw-r--r--include/lldb/Target/ThreadPlanStepRange.h7
-rw-r--r--include/lldb/Target/UnixSignals.h35
-rw-r--r--include/lldb/Utility/AnsiTerminal.h11
-rw-r--r--include/lldb/Utility/ArchSpec.h146
-rw-r--r--include/lldb/Utility/Args.h (renamed from include/lldb/Interpreter/Args.h)321
-rw-r--r--include/lldb/Utility/Baton.h10
-rw-r--r--include/lldb/Utility/CleanUp.h252
-rw-r--r--include/lldb/Utility/CompletionRequest.h120
-rw-r--r--include/lldb/Utility/Connection.h32
-rw-r--r--include/lldb/Utility/ConstString.h176
-rw-r--r--include/lldb/Utility/DataBuffer.h39
-rw-r--r--include/lldb/Utility/DataBufferHeap.h29
-rw-r--r--include/lldb/Utility/DataBufferLLVM.h4
-rw-r--r--include/lldb/Utility/DataEncoder.h102
-rw-r--r--include/lldb/Utility/DataExtractor.h356
-rw-r--r--include/lldb/Utility/Environment.h96
-rw-r--r--include/lldb/Utility/FileSpec.h169
-rw-r--r--include/lldb/Utility/Flags.h16
-rw-r--r--include/lldb/Utility/History.h136
-rw-r--r--include/lldb/Utility/JSON.h5
-rw-r--r--include/lldb/Utility/Log.h47
-rw-r--r--include/lldb/Utility/RegularExpression.h41
-rw-r--r--include/lldb/Utility/SafeMachO.h17
-rw-r--r--include/lldb/Utility/SelectHelper.h31
-rw-r--r--include/lldb/Utility/SharedCluster.h8
-rw-r--r--include/lldb/Utility/SharingPtr.h6
-rw-r--r--include/lldb/Utility/Status.h80
-rw-r--r--include/lldb/Utility/Stream.h64
-rw-r--r--include/lldb/Utility/StreamTee.h21
-rw-r--r--include/lldb/Utility/StringExtractor.h10
-rw-r--r--include/lldb/Utility/StringExtractorGDBRemote.h (renamed from source/Utility/StringExtractorGDBRemote.h)10
-rw-r--r--include/lldb/Utility/StringList.h17
-rw-r--r--include/lldb/Utility/StructuredData.h18
-rw-r--r--include/lldb/Utility/TildeExpressionResolver.h8
-rw-r--r--include/lldb/Utility/Timeout.h6
-rw-r--r--include/lldb/Utility/Timer.h2
-rw-r--r--include/lldb/Utility/UUID.h101
-rw-r--r--include/lldb/Utility/UserID.h18
-rw-r--r--include/lldb/lldb-defines.h4
-rw-r--r--include/lldb/lldb-enumerations.h165
-rw-r--r--include/lldb/lldb-forward.h1
-rw-r--r--include/lldb/lldb-private-defines.h2
-rw-r--r--include/lldb/lldb-private-enumerations.h58
-rw-r--r--include/lldb/lldb-private-forward.h7
-rw-r--r--include/lldb/lldb-private-types.h35
-rw-r--r--include/lldb/lldb-types.h4
-rw-r--r--include/lldb/lldb-versioning.h4
-rw-r--r--include/lldb/module.modulemap139
-rw-r--r--lit/Breakpoint/Inputs/case-sensitive.c4
-rw-r--r--lit/Breakpoint/Inputs/ppc64-localentry.s55
-rw-r--r--lit/Breakpoint/case-insensitive.test46
-rw-r--r--lit/Breakpoint/case-sensitive.test46
-rw-r--r--lit/Breakpoint/lit.local.cfg1
-rw-r--r--lit/Breakpoint/ppc64-localentry.test12
-rw-r--r--lit/CMakeLists.txt87
-rw-r--r--lit/Expr/Inputs/anonymous-struct.cpp26
-rw-r--r--lit/Expr/Inputs/ir-memory-map-basic25
-rw-r--r--lit/Expr/Inputs/ir-memory-map-mix-malloc-free272
-rw-r--r--lit/Expr/Inputs/ir-memory-map-overlap110
-rw-r--r--lit/Expr/TestCallStdStringFunction.test14
-rw-r--r--lit/Expr/TestCallStopAndContinue.test12
-rw-r--r--lit/Expr/TestCallUserAnonTypedef.test11
-rw-r--r--lit/Expr/TestCallUserDefinedFunction.test20
-rw-r--r--lit/Expr/TestIRMemoryMap.test12
-rw-r--r--lit/Expr/TestTypeOfDeclTypeExpr.test13
-rw-r--r--lit/Modules/build-id-case.yaml43
-rw-r--r--lit/Modules/compressed-sections.yaml4
-rw-r--r--lit/Modules/elf-duplicate-section.yaml42
-rw-r--r--lit/Modules/elf-many-sections.s72
-rw-r--r--lit/Modules/elf-section-types.yaml62
-rw-r--r--lit/Modules/lc_version_min.yaml205
-rw-r--r--lit/Modules/lit.local.cfg2
-rw-r--r--lit/Modules/short-build-id.yaml26
-rw-r--r--lit/Quit/TestQuitExitCode-30.test3
-rw-r--r--lit/Quit/TestQuitExitCode0.test3
-rw-r--r--lit/Quit/TestQuitExitCode30.test3
-rw-r--r--lit/Quit/TestQuitExitCodeHex0.test3
-rw-r--r--lit/Quit/TestQuitExitCodeHexA.test3
-rw-r--r--lit/Quit/TestQuitExitCodeImplicit0.test3
-rw-r--r--lit/Quit/TestQuitExitCodeNonInt.test4
-rw-r--r--lit/Quit/TestQuitExitCodeTooManyArgs.test4
-rwxr-xr-xlit/Quit/expect_exit_code.py16
-rw-r--r--lit/Quit/lit.local.cfg1
-rw-r--r--lit/Suite/lit.cfg37
-rw-r--r--lit/Suite/lit.site.cfg.in37
-rw-r--r--lit/Suite/lldbtest.py70
-rw-r--r--lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp3
-rw-r--r--lit/SymbolFile/DWARF/apple-index-is-used.cpp8
-rw-r--r--lit/SymbolFile/DWARF/debug-names-compressed.cpp14
-rw-r--r--lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp13
-rw-r--r--lit/SymbolFile/DWARF/dwarf5-partial-index.cpp23
-rw-r--r--lit/SymbolFile/DWARF/find-basic-function.cpp106
-rw-r--r--lit/SymbolFile/DWARF/find-basic-namespace.cpp46
-rw-r--r--lit/SymbolFile/DWARF/find-basic-type.cpp55
-rw-r--r--lit/SymbolFile/DWARF/find-basic-variable.cpp76
-rw-r--r--lit/SymbolFile/DWARF/find-function-regex.cpp26
-rw-r--r--lit/SymbolFile/DWARF/find-inline-method.s152
-rw-r--r--lit/SymbolFile/DWARF/find-method-local-struct.cpp19
-rw-r--r--lit/SymbolFile/DWARF/find-method.cpp31
-rw-r--r--lit/SymbolFile/DWARF/find-qualified-variable.cpp15
-rw-r--r--lit/SymbolFile/DWARF/find-type-in-function.cpp24
-rw-r--r--lit/SymbolFile/DWARF/find-variable-dwo.cpp25
-rw-r--r--lit/SymbolFile/DWARF/find-variable-file.cpp28
-rw-r--r--lit/SymbolFile/DWARF/lit.local.cfg1
-rw-r--r--lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp3
-rw-r--r--lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp16
-rw-r--r--lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp59
-rw-r--r--lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp9
-rw-r--r--lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h12
-rw-r--r--lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord4
-rw-r--r--lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp8
-rw-r--r--lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp49
-rw-r--r--lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp46
-rw-r--r--lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp15
-rw-r--r--lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script16
-rw-r--r--lit/SymbolFile/PDB/Inputs/VariablesTest.cpp50
-rw-r--r--lit/SymbolFile/PDB/compilands.test9
-rw-r--r--lit/SymbolFile/PDB/enums-layout.test45
-rw-r--r--lit/SymbolFile/PDB/func-symbols.test48
-rw-r--r--lit/SymbolFile/PDB/function-level-linking.test4
-rw-r--r--lit/SymbolFile/PDB/function-nested-block.test7
-rw-r--r--lit/SymbolFile/PDB/lit.local.cfg1
-rw-r--r--lit/SymbolFile/PDB/type-quals.test39
-rw-r--r--lit/SymbolFile/PDB/typedefs.test59
-rw-r--r--lit/SymbolFile/PDB/variables-locations.test14
-rw-r--r--lit/SymbolFile/PDB/variables.test58
-rw-r--r--lit/lit-lldb-init2
-rw-r--r--lit/lit.cfg24
-rw-r--r--lit/lit.site.cfg.in11
-rw-r--r--lit/tools/lldb-mi/breakpoint/break-insert.test18
-rw-r--r--lit/tools/lldb-mi/breakpoint/inputs/break-insert.c7
-rw-r--r--lit/tools/lldb-mi/breakpoint/lit.local.cfg1
-rw-r--r--lit/tools/lldb-mi/data/data-info-line.test36
-rw-r--r--lit/tools/lldb-mi/data/inputs/data-info-line.c4
-rw-r--r--lit/tools/lldb-mi/data/lit.local.cfg1
-rw-r--r--lit/tools/lldb-mi/exec/exec-continue.test20
-rw-r--r--lit/tools/lldb-mi/exec/exec-finish.test33
-rw-r--r--lit/tools/lldb-mi/exec/exec-interrupt.test20
-rw-r--r--lit/tools/lldb-mi/exec/exec-next-instruction.test30
-rw-r--r--lit/tools/lldb-mi/exec/exec-next.test30
-rw-r--r--lit/tools/lldb-mi/exec/exec-run-wrong-binary.test6
-rw-r--r--lit/tools/lldb-mi/exec/exec-step-instruction.test30
-rw-r--r--lit/tools/lldb-mi/exec/exec-step.test30
-rw-r--r--lit/tools/lldb-mi/exec/inputs/main.c9
-rw-r--r--lit/tools/lldb-mi/exec/lit.local.cfg1
-rw-r--r--lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c3
-rw-r--r--lit/tools/lldb-mi/symbol/inputs/list-lines-helper.h1
-rw-r--r--lit/tools/lldb-mi/symbol/inputs/main.c6
-rw-r--r--lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.c6
-rw-r--r--lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.h1
-rw-r--r--lit/tools/lldb-mi/symbol/lit.local.cfg1
-rw-r--r--lit/tools/lldb-mi/symbol/symbol-list-lines.test20
-rw-r--r--lldb.xcodeproj/project.pbxproj5421
-rw-r--r--lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme24
-rw-r--r--packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py2
-rw-r--r--packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py13
-rw-r--r--packages/Python/lldbsuite/test/api/listeners/TestListener.py4
-rw-r--r--packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py16
-rw-r--r--packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py2
-rw-r--r--packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py14
-rw-r--r--packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py4
-rw-r--r--packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py35
-rw-r--r--packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/main.c8
-rw-r--r--packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py6
-rw-r--r--packages/Python/lldbsuite/test/bench-history206
-rw-r--r--packages/Python/lldbsuite/test/bench.py2
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py3
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py2
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py4
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py3
-rw-r--r--packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py3
-rw-r--r--packages/Python/lldbsuite/test/concurrent_base.py9
-rw-r--r--packages/Python/lldbsuite/test/configuration.py41
-rw-r--r--packages/Python/lldbsuite/test/crashinfo.c64
-rw-r--r--packages/Python/lldbsuite/test/darwin_log.py6
-rw-r--r--packages/Python/lldbsuite/test/decorators.py123
-rw-r--r--packages/Python/lldbsuite/test/dosep.py101
-rw-r--r--packages/Python/lldbsuite/test/dotest.py69
-rw-r--r--packages/Python/lldbsuite/test/dotest_args.py13
-rw-r--r--packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py6
-rw-r--r--packages/Python/lldbsuite/test/example/TestSequenceFunctions.py34
-rw-r--r--packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-overridden-method/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-overridden-method/TestCallOverriddenMethod.py49
-rw-r--r--packages/Python/lldbsuite/test/expression_command/call-overridden-method/main.cpp16
-rw-r--r--packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py1
-rw-r--r--packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py10
-rw-r--r--packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/pr35310/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py40
-rw-r--r--packages/Python/lldbsuite/test/expression_command/pr35310/main.cpp19
-rw-r--r--packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/rdar42038760/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/expression_command/rdar42038760/TestScalarURem.py4
-rw-r--r--packages/Python/lldbsuite/test/expression_command/rdar42038760/main.c19
-rw-r--r--packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py32
-rw-r--r--packages/Python/lldbsuite/test/expression_command/test/TestExprs.py6
-rw-r--r--packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py39
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/Makefile4
-rw-r--r--packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py2
-rw-r--r--packages/Python/lldbsuite/test/expression_command/xvalue/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/expression_command/xvalue/TestXValuePrinting.py37
-rw-r--r--packages/Python/lldbsuite/test/expression_command/xvalue/main.cpp12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py129
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py140
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py28
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/side_effect.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py27
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py25
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py19
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp90
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/decorated.py35
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script/py_import1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py215
-rw-r--r--packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py39
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py80
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py78
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py113
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp24
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/TestDataFormatterInvalidStdUniquePtr.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/main.cpp11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py62
-rw-r--r--packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/disassembly/main.cpp4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/TestExec.py110
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/main.cpp50
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/secondprog.cpp5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/fat_archives/Makefile10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/format/TestFormats.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-language/Makefile4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py39
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py80
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestRestartBug.py62
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py124
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestThreadSelectionBug.py50
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/a.yaml34
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py477
-rw-r--r--packages/Python/lldbsuite/test/functionalities/gdb_remote_client/operating_system.py45
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/Makefile15
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py114
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/a.mk10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/b.mk2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/c.mk2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/d.mk2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/.categories1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py143
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/d.cpp21
-rw-r--r--packages/Python/lldbsuite/test/functionalities/load_using_paths/main.cpp (renamed from packages/Python/lldbsuite/test/tools/lldb-mi/symbol/main.cpp)14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py12
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py100
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py69
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py45
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml853
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py109
-rw-r--r--packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py50
-rw-r--r--packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/entitlements.plist8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py107
-rw-r--r--packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py11
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py126
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c108
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py19
-rw-r--r--packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py32
-rw-r--r--packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py91
-rw-r--r--packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py44
-rw-r--r--packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py41
-rw-r--r--packages/Python/lldbsuite/test/functionalities/source-map/a.yaml396
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats/TestStats.py5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats/main.c18
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats_api/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py28
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stats_api/main.c3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py22
-rwxr-xr-xpackages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/Makefile (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/Makefile)4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointDelayBreakpointOneSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayWatch.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalNWatchNBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatchBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneDelaySignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneSignal.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py (renamed from packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py)0
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py9
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py8
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py16
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py59
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py3
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c14
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py95
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp76
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py7
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py6
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py10
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py2
-rw-r--r--packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py4
-rw-r--r--packages/Python/lldbsuite/test/functionalities/wrong_commands/.categories1
-rw-r--r--packages/Python/lldbsuite/test/functionalities/wrong_commands/TestWrongCommands.py39
-rw-r--r--packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile10
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py30
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py19
-rw-r--r--packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py35
-rw-r--r--packages/Python/lldbsuite/test/lang/c/global_variables/main.c3
-rw-r--r--packages/Python/lldbsuite/test/lang/c/inlines/main.c1
-rw-r--r--packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/register_variables/test.c2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile1
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile1
-rw-r--r--packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py7
-rw-r--r--packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile1
-rw-r--r--packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unicode/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py20
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unicode/main.c5
-rw-r--r--packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py52
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py14
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/Makefile (renamed from packages/Python/lldbsuite/test/macosx/debug-info/apple_types/Makefile)3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py66
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/main.cpp32
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py11
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp9
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap11
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py29
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py32
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py9
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py16
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp18
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h36
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp34
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp14
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/operator-overload/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/operator-overload/TestOperatorOverload.py22
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/operator-overload/a.cpp9
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/operator-overload/b.cpp10
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py11
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py31
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/template/main.cpp7
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/trivial_abi/Makefile (renamed from packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile)3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py74
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/trivial_abi/main.cpp35
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py94
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp67
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp17
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime2
-rw-r--r--packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile39
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk10
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk10
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py21
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py10
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py12
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py20
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py41
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h1
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py15
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/main.m12
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/minmax.h2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/module.map5
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h9
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.m12
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/TestNSDictionary0.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/main.m7
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py4
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/orderedset/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/orderedset/TestOrderedSet.py18
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/orderedset/main.m8
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py3
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py10
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py2
-rw-r--r--packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile7
-rw-r--r--packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/TestNameClash.py6
-rw-r--r--packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/main.mm21
-rw-r--r--packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm7
-rw-r--r--packages/Python/lldbsuite/test/linux/add-symbols/Makefile9
-rw-r--r--packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py7
-rw-r--r--packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py2
-rw-r--r--packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/Makefile10
-rw-r--r--packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py46
-rw-r--r--packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/a.c3
-rw-r--r--packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/b.c11
-rw-r--r--packages/Python/lldbsuite/test/linux/sepdebugsymlink/Makefile20
-rw-r--r--packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py23
-rw-r--r--packages/Python/lldbsuite/test/linux/sepdebugsymlink/main.c3
-rw-r--r--packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py2
-rw-r--r--packages/Python/lldbsuite/test/lldbinline.py92
-rw-r--r--packages/Python/lldbsuite/test/lldbplatformutil.py4
-rw-r--r--packages/Python/lldbsuite/test/lldbtest.py363
-rw-r--r--packages/Python/lldbsuite/test/lldbtest_config.py3
-rw-r--r--packages/Python/lldbsuite/test/lldbutil.py125
-rw-r--r--packages/Python/lldbsuite/test/logging/TestLogging.py55
-rw-r--r--packages/Python/lldbsuite/test/macosx/add-dsym/Makefile4
-rw-r--r--packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py7
-rw-r--r--packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py71
-rw-r--r--packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c27
-rw-r--r--packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile22
-rw-r--r--packages/Python/lldbsuite/test/macosx/duplicate-archive-members/TestDuplicateMembers.py55
-rw-r--r--packages/Python/lldbsuite/test/macosx/duplicate-archive-members/a.c14
-rw-r--r--packages/Python/lldbsuite/test/macosx/duplicate-archive-members/main.c17
-rw-r--r--packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c14
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/Makefile21
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Info.plist30
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/MacOS/.empty (renamed from packages/Python/lldbsuite/test/functionalities/process_launch/my_working_dir/.keep)0
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Resources/.empty (renamed from packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/path with '09/.keep)0
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py66
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-app-in-bundle/main.c9
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile6
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py4
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py5
-rw-r--r--packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c9
-rw-r--r--packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile28
-rw-r--r--packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py6
-rw-r--r--packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py15
-rw-r--r--packages/Python/lldbsuite/test/macosx/order/Makefile2
-rw-r--r--packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py4
-rw-r--r--packages/Python/lldbsuite/test/macosx/queues/Makefile29
-rw-r--r--packages/Python/lldbsuite/test/macosx/queues/TestQueues.py4
-rw-r--r--packages/Python/lldbsuite/test/macosx/safe-to-func-call/Makefile29
-rw-r--r--packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py2
-rw-r--r--packages/Python/lldbsuite/test/macosx/thread-names/Makefile29
-rw-r--r--packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py2
-rw-r--r--packages/Python/lldbsuite/test/macosx/universal/Makefile12
-rw-r--r--packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py6
-rw-r--r--packages/Python/lldbsuite/test/make/Android.rules16
-rw-r--r--packages/Python/lldbsuite/test/make/Makefile.rules72
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_base.py75
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_darwin.py14
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_freebsd.py2
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_linux.py2
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_netbsd.py2
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_openbsd.py10
-rw-r--r--packages/Python/lldbsuite/test/plugins/builder_win32.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py4
-rw-r--r--packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/event/TestEvents.py7
-rw-r--r--packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py9
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/TestFrames.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py36
-rw-r--r--packages/Python/lldbsuite/test/python_api/hello_world/main.c6
-rw-r--r--packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py32
-rw-r--r--packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py3
-rw-r--r--packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py12
-rw-r--r--packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py15
-rw-r--r--packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py12
-rw-r--r--packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py4
-rw-r--r--packages/Python/lldbsuite/test/python_api/sblaunchinfo/TestSBLaunchInfo.py31
-rw-r--r--packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py12
-rw-r--r--packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py6
-rw-r--r--packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py67
-rw-r--r--packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py11
-rw-r--r--packages/Python/lldbsuite/test/python_api/type/TestTypeList.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py18
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py12
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py2
-rw-r--r--packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py4
-rw-r--r--packages/Python/lldbsuite/test/quit/TestQuit.py32
-rw-r--r--packages/Python/lldbsuite/test/settings/TestSettings.py130
-rw-r--r--packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py18
-rw-r--r--packages/Python/lldbsuite/test/settings/quoting/main.c4
-rw-r--r--packages/Python/lldbsuite/test/source-manager/Makefile10
-rw-r--r--packages/Python/lldbsuite/test/source-manager/TestSourceManager.py72
-rw-r--r--packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py59
-rw-r--r--packages/Python/lldbsuite/test/test_categories.py3
-rw-r--r--packages/Python/lldbsuite/test/test_result.py7
-rw-r--r--packages/Python/lldbsuite/test/test_runner/process_control.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py94
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py7
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py260
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py5
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py371
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py65
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py20
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py66
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py18
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py46
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/Makefile5
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py104
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp39
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h24
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp38
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py29
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py12
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py75
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py7
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py112
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExitCode.py (renamed from packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py)0
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py40
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py2
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py9
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile8
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp355
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py34
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/main.cpp16
-rw-r--r--packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py15
-rw-r--r--packages/Python/lldbsuite/test/types/AbstractBase.py11
-rw-r--r--packages/Python/lldbsuite/test/types/TestRecursiveTypes.py2
-rw-r--r--packages/Python/lldbsuite/test/types/basic_type.cpp6
-rw-r--r--packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py32
-rw-r--r--packages/Python/lldbsuite/test_event/formatter/xunit.py4
-rw-r--r--resources/LLDB-Info.plist2
-rw-r--r--resources/debugserver-macosx-entitlements.plist8
-rw-r--r--scripts/CMakeLists.txt6
-rw-r--r--scripts/Python/modules/readline/CMakeLists.txt8
-rw-r--r--scripts/Python/python-extensions.swig27
-rw-r--r--scripts/interface/SBAddress.i6
-rw-r--r--scripts/interface/SBCommandInterpreter.i9
-rw-r--r--scripts/interface/SBDebugger.i2
-rw-r--r--scripts/interface/SBInstruction.i2
-rw-r--r--scripts/interface/SBModule.i17
-rw-r--r--scripts/interface/SBProcess.i13
-rw-r--r--scripts/interface/SBSymbolContext.i2
-rw-r--r--scripts/interface/SBTarget.i151
-rw-r--r--scripts/interface/SBThread.i36
-rw-r--r--scripts/interface/SBValue.i66
-rwxr-xr-xscripts/macos-setup-codesign.sh57
-rwxr-xr-xscripts/sort-pbxproj.rb251
-rw-r--r--scripts/utilsOsType.py3
-rw-r--r--source/API/CMakeLists.txt74
-rw-r--r--source/API/SBAddress.cpp18
-rw-r--r--source/API/SBAttachInfo.cpp9
-rw-r--r--source/API/SBBreakpointName.cpp10
-rw-r--r--source/API/SBCommandInterpreter.cpp21
-rw-r--r--source/API/SBDebugger.cpp70
-rw-r--r--source/API/SBEvent.cpp4
-rw-r--r--source/API/SBFrame.cpp2
-rw-r--r--source/API/SBHostOS.cpp53
-rw-r--r--source/API/SBInstruction.cpp30
-rw-r--r--source/API/SBInstructionList.cpp4
-rw-r--r--source/API/SBLaunchInfo.cpp51
-rw-r--r--source/API/SBModule.cpp63
-rw-r--r--source/API/SBModuleSpec.cpp13
-rw-r--r--source/API/SBPlatform.cpp61
-rw-r--r--source/API/SBProcess.cpp58
-rw-r--r--source/API/SBQueueItem.cpp3
-rw-r--r--source/API/SBStream.cpp9
-rw-r--r--source/API/SBTarget.cpp96
-rw-r--r--source/API/SBThread.cpp252
-rw-r--r--source/API/SBThreadPlan.cpp3
-rw-r--r--source/API/SBType.cpp6
-rw-r--r--source/API/SBTypeCategory.cpp12
-rw-r--r--source/API/SBValue.cpp43
-rw-r--r--source/API/SystemInitializerFull.cpp49
-rw-r--r--source/API/SystemInitializerFull.h (renamed from include/lldb/API/SystemInitializerFull.h)0
-rw-r--r--source/Breakpoint/Breakpoint.cpp133
-rw-r--r--source/Breakpoint/BreakpointID.cpp7
-rw-r--r--source/Breakpoint/BreakpointIDList.cpp23
-rw-r--r--source/Breakpoint/BreakpointList.cpp12
-rw-r--r--source/Breakpoint/BreakpointLocation.cpp38
-rw-r--r--source/Breakpoint/BreakpointLocationList.cpp33
-rw-r--r--source/Breakpoint/BreakpointOptions.cpp30
-rw-r--r--source/Breakpoint/BreakpointResolver.cpp10
-rw-r--r--source/Breakpoint/BreakpointResolverAddress.cpp15
-rw-r--r--source/Breakpoint/BreakpointResolverFileLine.cpp69
-rw-r--r--source/Breakpoint/BreakpointResolverName.cpp17
-rw-r--r--source/Breakpoint/BreakpointSiteList.cpp17
-rw-r--r--source/Breakpoint/Watchpoint.cpp16
-rw-r--r--source/Breakpoint/WatchpointList.cpp6
-rw-r--r--source/Breakpoint/WatchpointOptions.cpp3
-rw-r--r--source/Commands/CMakeLists.txt3
-rw-r--r--source/Commands/CommandCompletions.cpp204
-rw-r--r--source/Commands/CommandObjectApropos.cpp6
-rw-r--r--source/Commands/CommandObjectArgs.cpp234
-rw-r--r--source/Commands/CommandObjectArgs.h52
-rw-r--r--source/Commands/CommandObjectBreakpoint.cpp77
-rw-r--r--source/Commands/CommandObjectBreakpointCommand.cpp35
-rw-r--r--source/Commands/CommandObjectCommands.cpp117
-rw-r--r--source/Commands/CommandObjectDisassemble.cpp33
-rw-r--r--source/Commands/CommandObjectExpression.cpp205
-rw-r--r--source/Commands/CommandObjectExpression.h4
-rw-r--r--source/Commands/CommandObjectFrame.cpp57
-rw-r--r--source/Commands/CommandObjectHelp.cpp39
-rw-r--r--source/Commands/CommandObjectHelp.h5
-rw-r--r--source/Commands/CommandObjectLog.cpp7
-rw-r--r--source/Commands/CommandObjectMemory.cpp51
-rw-r--r--source/Commands/CommandObjectMultiword.cpp70
-rw-r--r--source/Commands/CommandObjectPlatform.cpp115
-rw-r--r--source/Commands/CommandObjectPlugin.cpp17
-rw-r--r--source/Commands/CommandObjectProcess.cpp99
-rw-r--r--source/Commands/CommandObjectQuit.cpp45
-rw-r--r--source/Commands/CommandObjectRegister.cpp29
-rw-r--r--source/Commands/CommandObjectSettings.cpp212
-rw-r--r--source/Commands/CommandObjectSource.cpp132
-rw-r--r--source/Commands/CommandObjectStats.cpp107
-rw-r--r--source/Commands/CommandObjectStats.h25
-rw-r--r--source/Commands/CommandObjectSyntax.cpp103
-rw-r--r--source/Commands/CommandObjectSyntax.h37
-rw-r--r--source/Commands/CommandObjectTarget.cpp245
-rw-r--r--source/Commands/CommandObjectThread.cpp83
-rw-r--r--source/Commands/CommandObjectType.cpp87
-rw-r--r--source/Commands/CommandObjectWatchpoint.cpp72
-rw-r--r--source/Commands/CommandObjectWatchpointCommand.cpp36
-rw-r--r--source/Core/Address.cpp103
-rw-r--r--source/Core/AddressResolverName.cpp5
-rw-r--r--source/Core/Broadcaster.cpp5
-rw-r--r--source/Core/CMakeLists.txt2
-rw-r--r--source/Core/Communication.cpp23
-rw-r--r--source/Core/Debugger.cpp196
-rw-r--r--source/Core/Disassembler.cpp102
-rw-r--r--source/Core/DumpDataExtractor.cpp24
-rw-r--r--source/Core/DumpRegisterValue.cpp79
-rw-r--r--source/Core/DynamicLoader.cpp21
-rw-r--r--source/Core/EmulateInstruction.cpp3
-rw-r--r--source/Core/Event.cpp16
-rw-r--r--source/Core/FileLineResolver.cpp4
-rw-r--r--source/Core/FileSpecList.cpp36
-rw-r--r--source/Core/FormatEntity.cpp99
-rw-r--r--source/Core/IOHandler.cpp175
-rw-r--r--source/Core/Listener.cpp12
-rw-r--r--source/Core/Mangled.cpp118
-rw-r--r--source/Core/Module.cpp239
-rw-r--r--source/Core/ModuleList.cpp131
-rw-r--r--source/Core/Opcode.cpp4
-rw-r--r--source/Core/PluginManager.cpp38
-rw-r--r--source/Core/RegisterValue.cpp77
-rw-r--r--source/Core/Scalar.cpp499
-rw-r--r--source/Core/Section.cpp30
-rw-r--r--source/Core/SourceManager.cpp29
-rw-r--r--source/Core/Value.cpp51
-rw-r--r--source/Core/ValueObject.cpp230
-rw-r--r--source/Core/ValueObjectCast.cpp6
-rw-r--r--source/Core/ValueObjectChild.cpp4
-rw-r--r--source/Core/ValueObjectDynamicValue.cpp45
-rw-r--r--source/Core/ValueObjectList.cpp4
-rw-r--r--source/Core/ValueObjectMemory.cpp27
-rw-r--r--source/Core/ValueObjectSyntheticFilter.cpp21
-rw-r--r--source/Core/ValueObjectVariable.cpp85
-rw-r--r--source/DataFormatters/FormatManager.cpp7
-rw-r--r--source/DataFormatters/StringPrinter.cpp26
-rw-r--r--source/DataFormatters/TypeFormat.cpp12
-rw-r--r--source/DataFormatters/ValueObjectPrinter.cpp52
-rw-r--r--source/DataFormatters/VectorType.cpp5
-rw-r--r--source/Expression/CMakeLists.txt1
-rw-r--r--source/Expression/DWARFExpression.cpp376
-rw-r--r--source/Expression/DiagnosticManager.cpp5
-rw-r--r--source/Expression/ExpressionSourceCode.cpp8
-rw-r--r--source/Expression/ExpressionVariable.cpp15
-rw-r--r--source/Expression/FunctionCaller.cpp20
-rw-r--r--source/Expression/IRDynamicChecks.cpp26
-rw-r--r--source/Expression/IRExecutionUnit.cpp74
-rw-r--r--source/Expression/IRInterpreter.cpp12
-rw-r--r--source/Expression/IRMemoryMap.cpp49
-rw-r--r--source/Expression/LLVMUserExpression.cpp5
-rw-r--r--source/Expression/Materializer.cpp21
-rw-r--r--source/Expression/REPL.cpp28
-rw-r--r--source/Expression/UserExpression.cpp11
-rw-r--r--source/Host/CMakeLists.txt54
-rw-r--r--source/Host/android/HostInfoAndroid.cpp11
-rw-r--r--source/Host/common/Editline.cpp118
-rw-r--r--source/Host/common/File.cpp14
-rw-r--r--source/Host/common/Host.cpp42
-rw-r--r--source/Host/common/HostInfoBase.cpp261
-rw-r--r--source/Host/common/MainLoop.cpp21
-rw-r--r--source/Host/common/MonitoringProcessLauncher.cpp52
-rw-r--r--source/Host/common/NativeBreakpointList.cpp4
-rw-r--r--source/Host/common/NativeProcessProtocol.cpp97
-rw-r--r--source/Host/common/NativeRegisterContext.cpp14
-rw-r--r--source/Host/common/NativeThreadProtocol.cpp33
-rw-r--r--source/Host/common/PseudoTerminal.cpp101
-rw-r--r--source/Host/common/Socket.cpp24
-rw-r--r--source/Host/common/SoftwareBreakpoint.cpp17
-rw-r--r--source/Host/common/Symbols.cpp42
-rw-r--r--source/Host/common/TCPSocket.cpp4
-rw-r--r--source/Host/common/TaskPool.cpp9
-rw-r--r--source/Host/common/Terminal.cpp26
-rw-r--r--source/Host/common/UDPSocket.cpp4
-rw-r--r--source/Host/common/XML.cpp16
-rw-r--r--source/Host/freebsd/Host.cpp23
-rw-r--r--source/Host/freebsd/HostInfoFreeBSD.cpp15
-rw-r--r--source/Host/linux/Host.cpp69
-rw-r--r--source/Host/linux/HostInfoLinux.cpp56
-rw-r--r--source/Host/macosx/Symbols.cpp188
-rw-r--r--source/Host/macosx/cfcpp/CFCMutableDictionary.cpp20
-rw-r--r--source/Host/macosx/cfcpp/CFCString.cpp11
-rw-r--r--source/Host/macosx/objcxx/CMakeLists.txt20
-rw-r--r--source/Host/macosx/objcxx/Host.mm (renamed from source/Host/macosx/Host.mm)366
-rw-r--r--source/Host/macosx/objcxx/HostInfoMacOSX.mm (renamed from source/Host/macosx/HostInfoMacOSX.mm)97
-rw-r--r--source/Host/macosx/objcxx/HostThreadMacOSX.mm (renamed from source/Host/macosx/HostThreadMacOSX.mm)0
-rw-r--r--source/Host/netbsd/Host.cpp20
-rw-r--r--source/Host/netbsd/HostInfoNetBSD.cpp20
-rw-r--r--source/Host/openbsd/Host.cpp13
-rw-r--r--source/Host/posix/ConnectionFileDescriptorPosix.cpp91
-rw-r--r--source/Host/posix/FileSystem.cpp7
-rw-r--r--source/Host/posix/HostInfoPosix.cpp64
-rw-r--r--source/Host/posix/HostThreadPosix.cpp5
-rw-r--r--source/Host/posix/PipePosix.cpp14
-rw-r--r--source/Host/posix/ProcessLauncherPosixFork.cpp54
-rw-r--r--source/Host/windows/ConnectionGenericFileWindows.cpp44
-rw-r--r--source/Host/windows/EditLineWin.cpp8
-rw-r--r--source/Host/windows/FileSystem.cpp2
-rw-r--r--source/Host/windows/Host.cpp36
-rw-r--r--source/Host/windows/HostInfoWindows.cpp51
-rw-r--r--source/Host/windows/HostProcessWindows.cpp6
-rw-r--r--source/Host/windows/PipeWindows.cpp27
-rw-r--r--source/Host/windows/ProcessLauncherWindows.cpp21
-rw-r--r--source/Initialization/CMakeLists.txt6
-rw-r--r--source/Initialization/SystemInitializerCommon.cpp20
-rw-r--r--source/Interpreter/Args.cpp1500
-rw-r--r--source/Interpreter/CMakeLists.txt2
-rw-r--r--source/Interpreter/CommandAlias.cpp41
-rw-r--r--source/Interpreter/CommandInterpreter.cpp401
-rw-r--r--source/Interpreter/CommandObject.cpp123
-rw-r--r--source/Interpreter/CommandObjectRegexCommand.cpp91
-rw-r--r--source/Interpreter/CommandObjectScript.cpp6
-rw-r--r--source/Interpreter/CommandObjectScript.h2
-rw-r--r--source/Interpreter/CommandReturnObject.cpp8
-rw-r--r--source/Interpreter/OptionArgParser.cpp253
-rw-r--r--source/Interpreter/OptionGroupBoolean.cpp4
-rw-r--r--source/Interpreter/OptionGroupFormat.cpp21
-rw-r--r--source/Interpreter/OptionGroupPlatform.cpp30
-rw-r--r--source/Interpreter/OptionGroupValueObjectDisplay.cpp9
-rw-r--r--source/Interpreter/OptionGroupVariable.cpp8
-rw-r--r--source/Interpreter/OptionGroupWatchpoint.cpp6
-rw-r--r--source/Interpreter/OptionValue.cpp19
-rw-r--r--source/Interpreter/OptionValueArch.cpp16
-rw-r--r--source/Interpreter/OptionValueArgs.cpp2
-rw-r--r--source/Interpreter/OptionValueArray.cpp2
-rw-r--r--source/Interpreter/OptionValueBoolean.cpp21
-rw-r--r--source/Interpreter/OptionValueChar.cpp4
-rw-r--r--source/Interpreter/OptionValueDictionary.cpp10
-rw-r--r--source/Interpreter/OptionValueEnumeration.cpp20
-rw-r--r--source/Interpreter/OptionValueFileSpec.cpp29
-rw-r--r--source/Interpreter/OptionValueFileSpecLIst.cpp2
-rw-r--r--source/Interpreter/OptionValueFormat.cpp4
-rw-r--r--source/Interpreter/OptionValueFormatEntity.cpp18
-rw-r--r--source/Interpreter/OptionValueLanguage.cpp2
-rw-r--r--source/Interpreter/OptionValuePathMappings.cpp2
-rw-r--r--source/Interpreter/OptionValueProperties.cpp46
-rw-r--r--source/Interpreter/OptionValueSInt64.cpp3
-rw-r--r--source/Interpreter/OptionValueString.cpp2
-rw-r--r--source/Interpreter/OptionValueUUID.cpp36
-rw-r--r--source/Interpreter/Options.cpp686
-rw-r--r--source/Interpreter/Property.cpp55
-rw-r--r--source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp16
-rw-r--r--source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp21
-rw-r--r--source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp21
-rw-r--r--source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp4
-rw-r--r--source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp29
-rw-r--r--source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp4
-rw-r--r--source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp51
-rw-r--r--source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp8
-rw-r--r--source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp33
-rw-r--r--source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp45
-rw-r--r--source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp1217
-rw-r--r--source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h2
-rw-r--r--source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp21
-rw-r--r--source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp54
-rw-r--r--source/Plugins/Architecture/Arm/ArchitectureArm.cpp69
-rw-r--r--source/Plugins/Architecture/Arm/ArchitectureArm.h2
-rw-r--r--source/Plugins/Architecture/CMakeLists.txt1
-rw-r--r--source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp69
-rw-r--r--source/Plugins/Architecture/PPC64/ArchitecturePPC64.h44
-rw-r--r--source/Plugins/Architecture/PPC64/CMakeLists.txt11
-rw-r--r--source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp312
-rw-r--r--source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h60
-rw-r--r--source/Plugins/DynamicLoader/CMakeLists.txt5
-rw-r--r--source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp296
-rw-r--r--source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h6
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp38
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp20
-rw-r--r--source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h19
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp173
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp62
-rw-r--r--source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp220
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h13
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp36
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h17
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp204
-rw-r--r--source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h19
-rw-r--r--source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp18
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp12
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h31
-rw-r--r--source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h25
-rw-r--r--source/Plugins/ExpressionParser/Clang/CMakeLists.txt2
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp62
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangASTSource.h66
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp97
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h81
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp82
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h16
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h42
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp6
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h12
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangHost.cpp142
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangHost.h26
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp38
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp9
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h18
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp164
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUserExpression.h22
-rw-r--r--source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h12
-rw-r--r--source/Plugins/ExpressionParser/Clang/IRForTarget.cpp62
-rw-r--r--source/Plugins/ExpressionParser/Clang/IRForTarget.h105
-rw-r--r--source/Plugins/ExpressionParser/Go/GoParser.cpp10
-rw-r--r--source/Plugins/ExpressionParser/Go/GoUserExpression.cpp20
-rw-r--r--source/Plugins/ExpressionParser/Go/GoUserExpression.h14
-rw-r--r--source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp566
-rw-r--r--source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp28
-rw-r--r--source/Plugins/Instruction/CMakeLists.txt1
-rw-r--r--source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp23
-rw-r--r--source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp11
-rw-r--r--source/Plugins/Instruction/PPC64/CMakeLists.txt11
-rw-r--r--source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp406
-rw-r--r--source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h97
-rw-r--r--source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp4
-rw-r--r--source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp7
-rw-r--r--source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp4
-rw-r--r--source/Plugins/JITLoader/GDB/CMakeLists.txt2
-rw-r--r--source/Plugins/Language/CPlusPlus/BlockPointer.cpp5
-rw-r--r--source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp46
-rw-r--r--source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp36
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxx.cpp14
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxList.cpp8
-rw-r--r--source/Plugins/Language/CPlusPlus/LibCxxMap.cpp4
-rw-r--r--source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp29
-rw-r--r--source/Plugins/Language/ObjC/Cocoa.cpp119
-rw-r--r--source/Plugins/Language/ObjC/Cocoa.h3
-rw-r--r--source/Plugins/Language/ObjC/NSDictionary.cpp24
-rw-r--r--source/Plugins/Language/ObjC/NSError.cpp11
-rw-r--r--source/Plugins/Language/ObjC/NSException.cpp11
-rw-r--r--source/Plugins/Language/ObjC/NSSet.cpp33
-rw-r--r--source/Plugins/Language/ObjC/NSString.cpp7
-rw-r--r--source/Plugins/Language/ObjC/ObjCLanguage.cpp23
-rw-r--r--source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp78
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp3
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp38
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp16
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h2
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp198
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h3
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp545
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp54
-rw-r--r--source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp14
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp34
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp207
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp2
-rw-r--r--source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp68
-rw-r--r--source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp45
-rw-r--r--source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp11
-rw-r--r--source/Plugins/ObjectFile/ELF/ELFHeader.cpp7
-rw-r--r--source/Plugins/ObjectFile/ELF/ELFHeader.h39
-rw-r--r--source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp560
-rw-r--r--source/Plugins/ObjectFile/ELF/ObjectFileELF.h21
-rw-r--r--source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp13
-rw-r--r--source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp1988
-rw-r--r--source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h25
-rw-r--r--source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp18
-rw-r--r--source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp7
-rw-r--r--source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp90
-rw-r--r--source/Plugins/Platform/Android/AdbClient.cpp4
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroid.cpp29
-rw-r--r--source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp13
-rw-r--r--source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp37
-rw-r--r--source/Plugins/Platform/Linux/PlatformLinux.cpp35
-rw-r--r--source/Plugins/Platform/MacOSX/CMakeLists.txt4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp16
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp33
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp33
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwin.cpp299
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwin.h9
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp154
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp19
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp8
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp107
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp4
-rw-r--r--source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp41
-rw-r--r--source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt17
-rw-r--r--source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h (renamed from source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h)2
-rw-r--r--source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm (renamed from source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm)25
-rw-r--r--source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp136
-rw-r--r--source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp20
-rw-r--r--source/Plugins/Platform/POSIX/PlatformPOSIX.cpp489
-rw-r--r--source/Plugins/Platform/POSIX/PlatformPOSIX.h13
-rw-r--r--source/Plugins/Platform/Windows/PlatformWindows.cpp76
-rw-r--r--source/Plugins/Platform/Windows/PlatformWindows.h2
-rw-r--r--source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp45
-rw-r--r--source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h5
-rw-r--r--source/Plugins/Process/CMakeLists.txt2
-rw-r--r--source/Plugins/Process/Darwin/CFString.cpp11
-rw-r--r--source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp58
-rw-r--r--source/Plugins/Process/Darwin/MachException.cpp35
-rw-r--r--source/Plugins/Process/Darwin/NativeProcessDarwin.cpp163
-rw-r--r--source/Plugins/Process/Darwin/NativeProcessDarwin.h22
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadDarwin.cpp54
-rw-r--r--source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp69
-rw-r--r--source/Plugins/Process/FreeBSD/CMakeLists.txt4
-rw-r--r--source/Plugins/Process/FreeBSD/FreeBSDThread.cpp69
-rw-r--r--source/Plugins/Process/FreeBSD/FreeBSDThread.h2
-rw-r--r--source/Plugins/Process/FreeBSD/POSIXStopInfo.h6
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp35
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessMonitor.cpp138
-rw-r--r--source/Plugins/Process/FreeBSD/ProcessMonitor.h23
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h4
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp2
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp8
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp6
-rw-r--r--source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp32
-rw-r--r--source/Plugins/Process/Linux/CMakeLists.txt4
-rw-r--r--source/Plugins/Process/Linux/NativeProcessLinux.cpp384
-rw-r--r--source/Plugins/Process/Linux/NativeProcessLinux.h20
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp44
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h4
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp21
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h4
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp9
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp17
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h4
-rw-r--r--source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp10
-rwxr-xr-xsource/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp42
-rw-r--r--source/Plugins/Process/Linux/NativeThreadLinux.cpp8
-rw-r--r--source/Plugins/Process/Linux/ProcessorTrace.h2
-rw-r--r--source/Plugins/Process/Linux/SingleStepCheck.cpp6
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp67
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp57
-rw-r--r--source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp18
-rw-r--r--source/Plugins/Process/NetBSD/CMakeLists.txt4
-rw-r--r--source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp61
-rw-r--r--source/Plugins/Process/NetBSD/NativeProcessNetBSD.h6
-rw-r--r--source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp17
-rw-r--r--source/Plugins/Process/POSIX/CMakeLists.txt3
-rw-r--r--source/Plugins/Process/POSIX/CrashReason.cpp3
-rw-r--r--source/Plugins/Process/Utility/CMakeLists.txt3
-rw-r--r--source/Plugins/Process/Utility/DynamicRegisterInfo.cpp94
-rw-r--r--source/Plugins/Process/Utility/DynamicRegisterInfo.h23
-rw-r--r--source/Plugins/Process/Utility/HistoryThread.h6
-rw-r--r--source/Plugins/Process/Utility/InstructionUtils.h3
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwinConstants.h26
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp21
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp25
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp24
-rw-r--r--source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp12
-rw-r--r--source/Plugins/Process/Utility/RegisterContextLLDB.cpp329
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp14
-rw-r--r--source/Plugins/Process/Utility/RegisterContextMemory.cpp6
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp15
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp15
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp17
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp15
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp14
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp4
-rw-r--r--source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp8
-rw-r--r--source/Plugins/Process/Utility/RegisterInfoInterface.h2
-rw-r--r--source/Plugins/Process/Utility/RegisterInfos_ppc64.h331
-rw-r--r--source/Plugins/Process/Utility/StopInfoMachException.cpp57
-rw-r--r--source/Plugins/Process/Utility/ThreadMemory.cpp2
-rw-r--r--source/Plugins/Process/Utility/UnwindLLDB.cpp147
-rw-r--r--source/Plugins/Process/Utility/UnwindLLDB.h1
-rw-r--r--source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp8
-rw-r--r--source/Plugins/Process/Utility/lldb-ppc64-register-enums.h139
-rw-r--r--source/Plugins/Process/Windows/Common/CMakeLists.txt3
-rw-r--r--source/Plugins/Process/Windows/Common/DebuggerThread.cpp62
-rw-r--r--source/Plugins/Process/Windows/Common/ProcessWindows.cpp196
-rw-r--r--source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp76
-rw-r--r--source/Plugins/Process/Windows/Common/TargetThreadWindows.h7
-rw-r--r--source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp61
-rw-r--r--source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp29
-rw-r--r--source/Plugins/Process/elf-core/CMakeLists.txt2
-rw-r--r--source/Plugins/Process/elf-core/ProcessElfCore.cpp55
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp2
-rw-r--r--source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp4
-rw-r--r--source/Plugins/Process/elf-core/ThreadElfCore.cpp31
-rw-r--r--source/Plugins/Process/elf-core/ThreadElfCore.h2
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp59
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h5
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp203
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h9
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp322
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h21
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp2
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h4
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp85
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp116
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp55
-rw-r--r--source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp140
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp784
-rw-r--r--source/Plugins/Process/gdb-remote/ProcessGDBRemote.h17
-rw-r--r--source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp46
-rw-r--r--source/Plugins/Process/mach-core/CMakeLists.txt2
-rw-r--r--source/Plugins/Process/mach-core/ProcessMachCore.cpp136
-rw-r--r--source/Plugins/Process/mach-core/ThreadMachCore.cpp12
-rw-r--r--source/Plugins/Process/minidump/CMakeLists.txt2
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.cpp206
-rw-r--r--source/Plugins/Process/minidump/MinidumpParser.h14
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.cpp46
-rw-r--r--source/Plugins/Process/minidump/MinidumpTypes.h15
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.cpp102
-rw-r--r--source/Plugins/Process/minidump/ProcessMinidump.h2
-rw-r--r--source/Plugins/ScriptInterpreter/CMakeLists.txt4
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp2
-rw-r--r--source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h2
-rw-r--r--source/Plugins/ScriptInterpreter/Python/CMakeLists.txt13
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp124
-rw-r--r--source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp31
-rw-r--r--source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp569
-rw-r--r--source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h25
-rw-r--r--source/Plugins/ScriptInterpreter/Python/lldb-python.h5
-rw-r--r--source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp291
-rw-r--r--source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp177
-rw-r--r--source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h64
-rw-r--r--source/Plugins/SymbolFile/DWARF/CMakeLists.txt8
-rw-r--r--source/Plugins/SymbolFile/DWARF/DIERef.cpp11
-rw-r--r--source/Plugins/SymbolFile/DWARF/DIERef.h12
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp911
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp55
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp7
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp3
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h1
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp1
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h2
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp9
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFAttribute.h8
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp193
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h157
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp1058
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h227
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp205
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDIE.h173
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp2
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h2
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp10
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp57
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp4
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp300
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h25
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp266
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h70
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp245
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h5
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp255
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h40
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp146
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h95
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp4
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp4
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp10
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFDefines.h2
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp20
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFFormValue.h12
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp68
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFIndex.h69
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp755
-rw-r--r--source/Plugins/SymbolFile/DWARF/DWARFUnit.h252
-rw-r--r--source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp272
-rw-r--r--source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h83
-rw-r--r--source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp116
-rw-r--r--source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h26
-rw-r--r--source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp488
-rw-r--r--source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h75
-rw-r--r--source/Plugins/SymbolFile/DWARF/NameToDIE.cpp1
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp1442
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h89
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp149
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h10
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp12
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h14
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp4
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h2
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp2
-rw-r--r--source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h2
-rw-r--r--source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp5
-rw-r--r--source/Plugins/SymbolFile/PDB/CMakeLists.txt1
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBASTParser.cpp341
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBASTParser.h10
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp585
-rw-r--r--source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h45
-rw-r--r--source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp1277
-rw-r--r--source/Plugins/SymbolFile/PDB/SymbolFilePDB.h65
-rw-r--r--source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp30
-rw-r--r--source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp16
-rw-r--r--source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp83
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp27
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp22
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp27
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp24
-rw-r--r--source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp73
-rw-r--r--source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp67
-rw-r--r--source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp29
-rw-r--r--source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp126
-rw-r--r--source/Symbol/ArmUnwindInfo.cpp15
-rw-r--r--source/Symbol/Block.cpp3
-rw-r--r--source/Symbol/CMakeLists.txt1
-rw-r--r--source/Symbol/ClangASTContext.cpp418
-rw-r--r--source/Symbol/ClangASTImporter.cpp12
-rw-r--r--source/Symbol/CompactUnwindInfo.cpp92
-rw-r--r--source/Symbol/CompileUnit.cpp95
-rw-r--r--source/Symbol/CompilerType.cpp27
-rw-r--r--source/Symbol/DWARFCallFrameInfo.cpp207
-rw-r--r--source/Symbol/Declaration.cpp2
-rw-r--r--source/Symbol/FuncUnwinders.cpp36
-rw-r--r--source/Symbol/Function.cpp25
-rw-r--r--source/Symbol/GoASTContext.cpp21
-rw-r--r--source/Symbol/LineEntry.cpp22
-rw-r--r--source/Symbol/LineTable.cpp76
-rw-r--r--source/Symbol/ObjectFile.cpp195
-rw-r--r--source/Symbol/Symbol.cpp59
-rw-r--r--source/Symbol/SymbolContext.cpp92
-rw-r--r--source/Symbol/SymbolFile.cpp24
-rw-r--r--source/Symbol/SymbolVendor.cpp44
-rw-r--r--source/Symbol/Symtab.cpp117
-rw-r--r--source/Symbol/Type.cpp49
-rw-r--r--source/Symbol/TypeList.cpp37
-rw-r--r--source/Symbol/TypeMap.cpp36
-rw-r--r--source/Symbol/UnwindPlan.cpp6
-rw-r--r--source/Symbol/UnwindTable.cpp17
-rw-r--r--source/Symbol/Variable.cpp37
-rw-r--r--source/Target/ABI.cpp21
-rw-r--r--source/Target/CMakeLists.txt2
-rw-r--r--source/Target/ExecutionContext.cpp20
-rw-r--r--source/Target/Memory.cpp36
-rw-r--r--source/Target/ModuleCache.cpp5
-rw-r--r--source/Target/ObjCLanguageRuntime.cpp16
-rw-r--r--source/Target/PathMappingList.cpp101
-rw-r--r--source/Target/Platform.cpp222
-rw-r--r--source/Target/Process.cpp894
-rw-r--r--source/Target/ProcessInfo.cpp21
-rw-r--r--source/Target/ProcessLaunchInfo.cpp42
-rw-r--r--source/Target/RegisterContext.cpp24
-rw-r--r--source/Target/SectionLoadHistory.cpp17
-rw-r--r--source/Target/SectionLoadList.cpp16
-rw-r--r--source/Target/StackFrame.cpp154
-rw-r--r--source/Target/StackFrameList.cpp138
-rw-r--r--source/Target/StackID.cpp11
-rw-r--r--source/Target/StopInfo.cpp169
-rw-r--r--source/Target/Target.cpp334
-rw-r--r--source/Target/TargetList.cpp45
-rw-r--r--source/Target/Thread.cpp204
-rw-r--r--source/Target/ThreadList.cpp162
-rw-r--r--source/Target/ThreadPlan.cpp4
-rw-r--r--source/Target/ThreadPlanBase.cpp37
-rw-r--r--source/Target/ThreadPlanCallFunction.cpp52
-rw-r--r--source/Target/ThreadPlanCallOnFunctionExit.cpp29
-rw-r--r--source/Target/ThreadPlanCallUserExpression.cpp4
-rw-r--r--source/Target/ThreadPlanPython.cpp3
-rw-r--r--source/Target/ThreadPlanRunToAddress.cpp3
-rw-r--r--source/Target/ThreadPlanShouldStopHere.cpp12
-rw-r--r--source/Target/ThreadPlanStepInRange.cpp86
-rw-r--r--source/Target/ThreadPlanStepInstruction.cpp24
-rw-r--r--source/Target/ThreadPlanStepOut.cpp55
-rw-r--r--source/Target/ThreadPlanStepOverBreakpoint.cpp93
-rw-r--r--source/Target/ThreadPlanStepOverRange.cpp107
-rw-r--r--source/Target/ThreadPlanStepRange.cpp47
-rw-r--r--source/Target/ThreadPlanStepThrough.cpp32
-rw-r--r--source/Target/ThreadPlanStepUntil.cpp44
-rw-r--r--source/Target/ThreadPlanTracer.cpp4
-rw-r--r--source/Target/UnixSignals.cpp9
-rw-r--r--source/Utility/ArchSpec.cpp101
-rw-r--r--source/Utility/Args.cpp726
-rw-r--r--source/Utility/CMakeLists.txt4
-rw-r--r--source/Utility/CompletionRequest.cpp59
-rw-r--r--source/Utility/ConstString.cpp32
-rw-r--r--source/Utility/DataBufferHeap.cpp21
-rw-r--r--source/Utility/DataEncoder.cpp78
-rw-r--r--source/Utility/DataExtractor.cpp268
-rw-r--r--source/Utility/Environment.cpp50
-rw-r--r--source/Utility/FastDemangle.cpp126
-rw-r--r--source/Utility/FileSpec.cpp698
-rw-r--r--source/Utility/History.cpp24
-rw-r--r--source/Utility/JSON.cpp6
-rw-r--r--source/Utility/Log.cpp21
-rw-r--r--source/Utility/PPC64_DWARF_Registers.h127
-rw-r--r--source/Utility/RegularExpression.cpp43
-rw-r--r--source/Utility/SelectHelper.cpp9
-rw-r--r--source/Utility/SharingPtr.cpp8
-rw-r--r--source/Utility/Status.cpp41
-rw-r--r--source/Utility/Stream.cpp25
-rw-r--r--source/Utility/StringExtractor.cpp23
-rw-r--r--source/Utility/StringExtractorGDBRemote.cpp15
-rw-r--r--source/Utility/StructuredData.cpp7
-rw-r--r--source/Utility/TildeExpressionResolver.cpp5
-rw-r--r--source/Utility/UUID.cpp176
-rw-r--r--source/Utility/VASprintf.cpp4
-rw-r--r--test/CMakeLists.txt56
-rw-r--r--tools/argdumper/CMakeLists.txt2
-rw-r--r--tools/darwin-debug/CMakeLists.txt2
-rw-r--r--tools/darwin-threads/examine-threads.c2
-rw-r--r--tools/debugserver/debugserver.xcodeproj/project.pbxproj680
-rw-r--r--tools/debugserver/source/CMakeLists.txt47
-rw-r--r--tools/debugserver/source/DNB.cpp15
-rw-r--r--tools/debugserver/source/DNB.h6
-rw-r--r--tools/debugserver/source/DNBDefs.h26
-rw-r--r--tools/debugserver/source/JSONGenerator.h2
-rw-r--r--tools/debugserver/source/MacOSX/MachException.cpp2
-rw-r--r--tools/debugserver/source/MacOSX/MachProcess.h5
-rw-r--r--tools/debugserver/source/MacOSX/MachProcess.mm126
-rw-r--r--tools/debugserver/source/MacOSX/MachTask.mm67
-rw-r--r--tools/debugserver/source/MacOSX/MachVMMemory.cpp329
-rw-r--r--tools/debugserver/source/MacOSX/MachVMMemory.h24
-rw-r--r--tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp378
-rw-r--r--tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h8
-rw-r--r--tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h64
-rw-r--r--tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp575
-rw-r--r--tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h8
-rw-r--r--tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h106
-rw-r--r--tools/debugserver/source/RNBRemote.cpp62
-rw-r--r--tools/debugserver/source/RNBServices.cpp4
-rw-r--r--tools/debugserver/source/com.apple.internal.xpc.remote.debugserver.plist35
-rw-r--r--tools/debugserver/source/debugserver-entitlements.plist4
-rw-r--r--tools/debugserver/source/debugserver-macosx-entitlements.plist2
-rw-r--r--tools/driver/CMakeLists.txt10
-rw-r--r--tools/driver/Driver.cpp22
-rw-r--r--tools/driver/Driver.h5
-rw-r--r--tools/intel-features/intel-pt/Decoder.h8
-rw-r--r--tools/intel-features/intel-pt/PTDecoder.h14
-rw-r--r--tools/lldb-mi/MICmdBase.cpp58
-rw-r--r--tools/lldb-mi/MICmdBase.h12
-rw-r--r--tools/lldb-mi/MICmdCmdBreak.cpp15
-rw-r--r--tools/lldb-mi/MICmdCmdData.cpp217
-rw-r--r--tools/lldb-mi/MICmdCmdData.h4
-rw-r--r--tools/lldb-mi/MICmdCmdExec.cpp339
-rw-r--r--tools/lldb-mi/MICmdCmdExec.h19
-rw-r--r--tools/lldb-mi/MICmdCmdSymbol.cpp228
-rw-r--r--tools/lldb-mi/MICmdCmdSymbol.h4
-rw-r--r--tools/lldb-mi/MICmdCmdTarget.cpp2
-rw-r--r--tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp5
-rw-r--r--tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h1
-rw-r--r--tools/lldb-mi/MICmnResources.cpp4
-rw-r--r--tools/lldb-mi/MICmnResources.h1
-rw-r--r--tools/lldb-mi/MIDriver.cpp4
-rw-r--r--tools/lldb-mi/MIDriverMain.cpp12
-rw-r--r--tools/lldb-mi/MIDriverMgr.cpp1
-rw-r--r--tools/lldb-mi/MIReadMe.txt8
-rw-r--r--tools/lldb-mi/MIUtilSingletonHelper.h4
-rw-r--r--tools/lldb-mi/module.modulemap79
-rw-r--r--tools/lldb-server/CMakeLists.txt11
-rw-r--r--tools/lldb-server/LLDBServerUtilities.cpp2
-rw-r--r--tools/lldb-server/SystemInitializerLLGS.cpp33
-rw-r--r--tools/lldb-server/SystemInitializerLLGS.h21
-rw-r--r--tools/lldb-server/lldb-gdbserver.cpp5
-rw-r--r--tools/lldb-server/lldb-platform.cpp2
-rw-r--r--tools/lldb-server/lldb-server.cpp13
-rw-r--r--tools/lldb-test/SystemInitializerTest.cpp17
-rw-r--r--tools/lldb-test/lldb-test.cpp791
-rw-r--r--unittests/CMakeLists.txt4
-rw-r--r--unittests/Core/CMakeLists.txt3
-rw-r--r--unittests/Core/EventTest.cpp25
-rw-r--r--unittests/Core/MangledTest.cpp38
-rw-r--r--unittests/Core/ScalarTest.cpp88
-rw-r--r--unittests/Expression/CMakeLists.txt4
-rw-r--r--unittests/Expression/ClangParserTest.cpp73
-rw-r--r--unittests/Host/CMakeLists.txt3
-rw-r--r--unittests/Host/HostInfoTest.cpp3
-rw-r--r--unittests/Host/HostTest.cpp6
-rw-r--r--unittests/Host/PredicateTest.cpp34
-rw-r--r--unittests/Host/SymbolsTest.cpp3
-rw-r--r--unittests/Host/linux/HostTest.cpp4
-rw-r--r--unittests/Interpreter/CMakeLists.txt2
-rw-r--r--unittests/Interpreter/TestArgs.cpp362
-rw-r--r--unittests/Interpreter/TestCompletion.cpp93
-rw-r--r--unittests/Interpreter/TestOptionArgParser.cpp121
-rw-r--r--unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp27
-rw-r--r--unittests/ObjectFile/ELF/CMakeLists.txt2
-rw-r--r--unittests/ObjectFile/ELF/Inputs/early-section-headers.sobin0 -> 581 bytes
-rw-r--r--unittests/ObjectFile/ELF/TestELFHeader.cpp62
-rw-r--r--unittests/ObjectFile/ELF/TestObjectFileELF.cpp46
-rw-r--r--unittests/Platform/PlatformDarwinTest.cpp35
-rw-r--r--unittests/Process/gdb-remote/CMakeLists.txt1
-rw-r--r--unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp20
-rw-r--r--unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp50
-rw-r--r--unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp67
-rw-r--r--unittests/Process/minidump/CMakeLists.txt10
-rw-r--r--unittests/Process/minidump/Inputs/bad_duplicate_streams.dmpbin0 -> 32976 bytes
-rw-r--r--unittests/Process/minidump/Inputs/bad_overlapping_streams.dmpbin0 -> 32976 bytes
-rw-r--r--unittests/Process/minidump/Inputs/memory-list-not-padded.dmpbin0 -> 107 bytes
-rw-r--r--unittests/Process/minidump/Inputs/memory-list-padded.dmpbin0 -> 111 bytes
-rw-r--r--unittests/Process/minidump/Inputs/module-list-not-padded.dmpbin0 -> 296 bytes
-rw-r--r--unittests/Process/minidump/Inputs/module-list-padded.dmpbin0 -> 300 bytes
-rw-r--r--unittests/Process/minidump/Inputs/thread-list-not-padded.dmpbin0 -> 144 bytes
-rw-r--r--unittests/Process/minidump/Inputs/thread-list-padded.dmpbin0 -> 148 bytes
-rw-r--r--unittests/Process/minidump/MinidumpParserTest.cpp115
-rw-r--r--unittests/Symbol/CMakeLists.txt1
-rw-r--r--unittests/Symbol/TestClangASTContext.cpp5
-rw-r--r--unittests/Symbol/TestDWARFCallFrameInfo.cpp5
-rw-r--r--unittests/Symbol/TestType.cpp2
-rw-r--r--unittests/Target/CMakeLists.txt1
-rw-r--r--unittests/Target/ModuleCacheTest.cpp11
-rw-r--r--unittests/Target/PathMappingListTest.cpp116
-rw-r--r--unittests/UnwindAssembly/ARM64/CMakeLists.txt13
-rw-r--r--unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp (renamed from unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp)20
-rw-r--r--unittests/UnwindAssembly/CMakeLists.txt10
-rw-r--r--unittests/UnwindAssembly/InstEmulation/CMakeLists.txt15
-rw-r--r--unittests/UnwindAssembly/PPC64/CMakeLists.txt13
-rw-r--r--unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp259
-rw-r--r--unittests/Utility/AnsiTerminalTest.cpp55
-rw-r--r--unittests/Utility/ArchSpecTest.cpp19
-rw-r--r--unittests/Utility/ArgsTest.cpp191
-rw-r--r--unittests/Utility/CMakeLists.txt11
-rw-r--r--unittests/Utility/CleanUpTest.cpp47
-rw-r--r--unittests/Utility/CompletionRequestTest.cpp40
-rw-r--r--unittests/Utility/EnvironmentTest.cpp49
-rw-r--r--unittests/Utility/FileSpecTest.cpp (renamed from unittests/Host/FileSpecTest.cpp)252
-rw-r--r--unittests/Utility/FlagsTest.cpp199
-rw-r--r--unittests/Utility/LogTest.cpp192
-rw-r--r--unittests/Utility/OptionsWithRawTest.cpp183
-rw-r--r--unittests/Utility/StreamTeeTest.cpp197
-rw-r--r--unittests/Utility/UUIDTest.cpp84
-rw-r--r--unittests/Utility/VMRangeTest.cpp152
-rw-r--r--unittests/tools/CMakeLists.txt7
-rw-r--r--unittests/tools/lldb-server/CMakeLists.txt2
-rw-r--r--unittests/tools/lldb-server/tests/LLGSTest.cpp22
-rw-r--r--unittests/tools/lldb-server/tests/MessageObjects.cpp258
-rw-r--r--unittests/tools/lldb-server/tests/MessageObjects.h62
-rw-r--r--unittests/tools/lldb-server/tests/TestClient.cpp156
-rw-r--r--unittests/tools/lldb-server/tests/TestClient.h23
-rw-r--r--unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp14
-rw-r--r--utils/lldb-dotest/CMakeLists.txt22
-rwxr-xr-xutils/lldb-dotest/lldb-dotest.in16
-rwxr-xr-xwww/architecture/index.html2
-rwxr-xr-xwww/build.html11
-rwxr-xr-xwww/features.html4
-rwxr-xr-xwww/index.html6
-rwxr-xr-xwww/lldb-gdb.html2
-rwxr-xr-xwww/projects.html14
-rw-r--r--www/remote.html6
-rwxr-xr-xwww/status.html4
-rw-r--r--www/test.html6
-rwxr-xr-xwww/tutorial.html4
2018 files changed, 53385 insertions, 42820 deletions
diff --git a/.gitignore b/.gitignore
index 29f407fb3fb3..35da4f658fcc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -37,8 +37,6 @@ ninja/
*xcuserdata
test/20*
__pycache__/
-*.lock
-*.so
clang-module-cache
@@ -53,7 +51,3 @@ tags
# Ignore test trace directories.
20??-??-??-??_??_??/
-# Ignore crashlog support files.
-crashinfo.lock
-crashinfo.so
-
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6b082e104e5..00ddcdc1488f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,13 +29,39 @@ endif ()
set(LLDB_DISABLE_LIBEDIT ${LLDB_DEFAULT_DISABLE_LIBEDIT} CACHE BOOL "Disables the use of editline.")
if (LLDB_DISABLE_LIBEDIT)
add_definitions( -DLLDB_DISABLE_LIBEDIT )
+else()
+ find_package(LibEdit REQUIRED)
endif()
if(APPLE)
add_definitions(-DLLDB_USE_OS_LOG)
endif()
-# add_subdirectory(include)
+# lldb-suite is a dummy target that encompasses all the necessary tools and
+# libraries for building a fully-functioning liblldb.
+add_custom_target(lldb-suite)
+set(LLDB_SUITE_TARGET lldb-suite)
+
+option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
+if(LLDB_BUILD_FRAMEWORK)
+ if (CMAKE_VERSION VERSION_LESS 3.7)
+ message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
+ endif()
+ if (NOT APPLE)
+ message(FATAL_ERROR "LLDB.framework can only be generated when targeting Apple platforms")
+ endif()
+
+ # These are used to fill out LLDB-Info.plist. These are relevant when building
+ # the framework, and must be defined before building liblldb.
+ set(PRODUCT_NAME "LLDB")
+ set(EXECUTABLE_NAME "LLDB")
+ set(CURRENT_PROJECT_VERSION "360.99.0")
+ set(LLDB_SUITE_TARGET lldb-framework)
+
+ set(LLDB_FRAMEWORK_DIR
+ ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR})
+endif()
+
add_subdirectory(docs)
if (NOT LLDB_DISABLE_PYTHON)
if(LLDB_USE_SYSTEM_SIX)
@@ -45,8 +71,7 @@ if (NOT LLDB_DISABLE_PYTHON)
set(LLDB_PYTHON_TARGET_DIR ${LLDB_BINARY_DIR}/scripts)
set(LLDB_WRAP_PYTHON ${LLDB_BINARY_DIR}/scripts/LLDBWrapPython.cpp)
if(LLDB_BUILD_FRAMEWORK)
- set(LLDB_PYTHON_TARGET_DIR
- ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${LLDB_FRAMEWORK_INSTALL_DIR})
+ set(LLDB_PYTHON_TARGET_DIR ${LLDB_FRAMEWORK_DIR})
set(LLDB_WRAP_PYTHON ${LLDB_PYTHON_TARGET_DIR}/LLDBWrapPython.cpp)
else()
# Don't set -m when building the framework.
@@ -56,31 +81,90 @@ if (NOT LLDB_DISABLE_PYTHON)
add_subdirectory(scripts)
endif ()
+
add_subdirectory(source)
add_subdirectory(tools)
option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests."
${LLVM_INCLUDE_TESTS})
+option(LLDB_TEST_USE_CUSTOM_C_COMPILER "Use the C compiler provided via LLDB_TEST_C_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
+option(LLDB_TEST_USE_CUSTOM_CXX_COMPILER "Use the C++ compiler provided via LLDB_TEST_CXX_COMPILER for building test inferiors (instead of the just-built compiler). Defaults to OFF." OFF)
if(LLDB_INCLUDE_TESTS)
- if (TARGET clang)
- set(LLDB_DEFAULT_TEST_C_COMPILER "${LLVM_BINARY_DIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
- set(LLDB_DEFAULT_TEST_CXX_COMPILER "${LLVM_BINARY_DIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
+
+ # The difference between the following two paths is significant. The path to
+ # LLDB will point to LLDB's binary directory, while the other will point to
+ # LLVM's binary directory in case the two differ.
+ set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
+ set(LLDB_DEFAULT_TEST_DSYMUTIL "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/dsymutil${CMAKE_EXECUTABLE_SUFFIX}")
+
+ if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER AND TARGET clang)
+ set(LLDB_DEFAULT_TEST_C_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang${CMAKE_EXECUTABLE_SUFFIX}")
else()
set(LLDB_DEFAULT_TEST_C_COMPILER "")
+ endif()
+
+ if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER AND TARGET clang)
+ set(LLDB_DEFAULT_TEST_CXX_COMPILER "${LLVM_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin/clang++${CMAKE_EXECUTABLE_SUFFIX}")
+ else()
set(LLDB_DEFAULT_TEST_CXX_COMPILER "")
endif()
+ set(LLDB_TEST_EXECUTABLE "${LLDB_DEFAULT_TEST_EXECUTABLE}" CACHE PATH "lldb executable used for testing")
set(LLDB_TEST_C_COMPILER "${LLDB_DEFAULT_TEST_C_COMPILER}" CACHE PATH "C Compiler to use for building LLDB test inferiors")
set(LLDB_TEST_CXX_COMPILER "${LLDB_DEFAULT_TEST_CXX_COMPILER}" CACHE PATH "C++ Compiler to use for building LLDB test inferiors")
+ set(LLDB_TEST_DSYMUTIL "${LLDB_DEFAULT_TEST_DSYMUTIL}" CACHE PATH "dsymutil used for generating dSYM bundles")
if (("${LLDB_TEST_C_COMPILER}" STREQUAL "") OR
("${LLDB_TEST_CXX_COMPILER}" STREQUAL ""))
message(FATAL_ERROR "LLDB test compilers not specified. Tests will not run")
endif()
+ set(LLDB_TEST_DEPS lldb)
+
+ # darwin-debug is an hard dependency for the testsuite.
+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ list(APPEND LLDB_TEST_DEPS darwin-debug)
+ endif()
+
+ if(TARGET lldb-server)
+ list(APPEND LLDB_TEST_DEPS lldb-server)
+ endif()
+
+ if(TARGET debugserver)
+ if(NOT CMAKE_HOST_APPLE OR LLDB_CODESIGN_IDENTITY)
+ list(APPEND LLDB_TEST_DEPS debugserver)
+ endif()
+ endif()
+
+ if(TARGET lldb-mi)
+ list(APPEND LLDB_TEST_DEPS lldb-mi)
+ endif()
+
+ if(NOT LLDB_BUILT_STANDALONE)
+ list(APPEND LLDB_TEST_DEPS yaml2obj)
+ endif()
+
+ if(TARGET liblldb)
+ list(APPEND LLDB_TEST_DEPS liblldb)
+ endif()
+
+ if(TARGET clang)
+ list(APPEND LLDB_TEST_DEPS clang)
+ endif()
+
+ if(TARGET dsymutil)
+ list(APPEND LLDB_TEST_DEPS dsymutil)
+ endif()
+
add_subdirectory(test)
add_subdirectory(unittests)
add_subdirectory(lit)
+ add_subdirectory(utils/lldb-dotest)
+endif()
+
+if (LLDB_BUILD_FRAMEWORK)
+ add_custom_target(lldb-framework)
+ include(LLDBFramework)
endif()
if (NOT LLDB_DISABLE_PYTHON)
@@ -91,7 +175,7 @@ if (NOT LLDB_DISABLE_PYTHON)
${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
--srcRoot=${LLDB_SOURCE_DIR}
--targetDir=${LLDB_PYTHON_TARGET_DIR}
- --cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/scripts
+ --cfgBldDir=${LLDB_PYTHON_TARGET_DIR}
--prefix=${CMAKE_BINARY_DIR}
--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}
--lldbLibDir=lib${LLVM_LIBDIR_SUFFIX}
@@ -99,10 +183,11 @@ if (NOT LLDB_DISABLE_PYTHON)
${FINISH_EXTRA_ARGS}
VERBATIM
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/scripts/finishSwigWrapperClasses.py
- DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/scripts/lldb.py
+ DEPENDS ${LLDB_PYTHON_TARGET_DIR}/lldb.py
COMMENT "Python script sym-linking LLDB Python API")
- # We depend on liblldb being built before we can do this step.
- add_dependencies(finish_swig liblldb lldb-argdumper)
+
+ # We depend on liblldb and lldb-argdumper being built before we can do this step.
+ add_dependencies(finish_swig ${LLDB_SUITE_TARGET})
# If we build the readline module, we depend on that happening
# first.
@@ -113,8 +198,8 @@ if (NOT LLDB_DISABLE_PYTHON)
# Ensure we do the python post-build step when building lldb.
add_dependencies(lldb finish_swig)
- if(LLDB_BUILD_FRAMEWORK)
- # The target to install libLLDB needs to depend on finish swig so that the
+ if (LLDB_BUILD_FRAMEWORK)
+ # The target to install libLLDB needs to depend on finish_swig so that the
# framework build properly copies over the Python files.
add_dependencies(install-liblldb finish_swig)
endif()
diff --git a/CODE_OWNERS.txt b/CODE_OWNERS.txt
index dac886870779..8ee04557af61 100644
--- a/CODE_OWNERS.txt
+++ b/CODE_OWNERS.txt
@@ -17,7 +17,7 @@ D: Build scripts, Test suite, Platform, gdb-remote, Anything not covered by this
N: Jim Ingham
E: jingham@apple.com
D: Overall LLDB architecture, Thread plans, Expression parser, ValueObject, Breakpoints, ABI
-D: Watchpoints, Trampolines, Target, Command Interpreter, C++ / Objective C Language runtime
+D: Watchpoints, Trampolines, Target, Command Interpreter, C++ / Objective-C Language runtime
D: Expression evaluator, IR interpreter, Clang integration
D: Data Formatters
diff --git a/cmake/modules/AddLLDB.cmake b/cmake/modules/AddLLDB.cmake
index 2fd8b384d9e3..129a5ef7500d 100644
--- a/cmake/modules/AddLLDB.cmake
+++ b/cmake/modules/AddLLDB.cmake
@@ -86,7 +86,7 @@ endfunction(add_lldb_library)
function(add_lldb_executable name)
cmake_parse_arguments(ARG
- "INCLUDE_IN_FRAMEWORK;GENERATE_INSTALL"
+ "INCLUDE_IN_SUITE;GENERATE_INSTALL"
""
"LINK_LIBS;LINK_COMPONENTS"
${ARGN}
@@ -99,8 +99,9 @@ function(add_lldb_executable name)
set_target_properties(${name} PROPERTIES
FOLDER "lldb executables")
- if(LLDB_BUILD_FRAMEWORK)
- if(ARG_INCLUDE_IN_FRAMEWORK)
+ if(ARG_INCLUDE_IN_SUITE)
+ add_dependencies(lldb-suite ${name})
+ if(LLDB_BUILD_FRAMEWORK)
if(NOT IOS)
set(resource_dir "/Resources")
set(resource_dots "../")
@@ -110,29 +111,23 @@ function(add_lldb_executable name)
RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:liblldb>${resource_dir}
BUILD_WITH_INSTALL_RPATH On
INSTALL_RPATH "@loader_path/../../../${resource_dots}${_dots}/${LLDB_FRAMEWORK_INSTALL_DIR}")
- # For things inside the framework we don't need functional install targets
- # because CMake copies the resources and headers from the build directory.
- # But we still need this target to exist in order to use the
- # LLVM_DISTRIBUTION_COMPONENTS build option. We also need the
- # install-liblldb target to depend on this tool, so that it gets put into
- # the Resources directory before the framework is installed.
- if(ARG_GENERATE_INSTALL)
- add_custom_target(install-${name} DEPENDS ${name})
- add_dependencies(install-liblldb ${name})
- add_custom_target(install-${name}-stripped DEPENDS ${name})
- add_dependencies(install-liblldb-stripped ${name})
- endif()
- else()
- set_target_properties(${name} PROPERTIES
- BUILD_WITH_INSTALL_RPATH On
- INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
endif()
endif()
- if(ARG_GENERATE_INSTALL AND NOT (ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK ))
+ if(LLDB_BUILD_FRAMEWORK AND NOT ARG_INCLUDE_IN_SUITE)
+ set_target_properties(${name} PROPERTIES
+ BUILD_WITH_INSTALL_RPATH On
+ INSTALL_RPATH "@loader_path/../${LLDB_FRAMEWORK_INSTALL_DIR}")
+ endif()
+
+ if(ARG_GENERATE_INSTALL)
+ set(out_dir "bin")
+ if (LLDB_BUILD_FRAMEWORK AND ARG_INCLUDE_IN_SUITE)
+ set(out_dir ${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR})
+ endif()
install(TARGETS ${name}
COMPONENT ${name}
- RUNTIME DESTINATION bin)
+ RUNTIME DESTINATION ${out_dir})
if (NOT CMAKE_CONFIGURATION_TYPES)
add_llvm_install_targets(install-${name}
DEPENDS ${name}
@@ -140,7 +135,7 @@ function(add_lldb_executable name)
endif()
endif()
- if(ARG_INCLUDE_IN_FRAMEWORK AND LLDB_BUILD_FRAMEWORK)
+ if(ARG_INCLUDE_IN_SUITE AND LLDB_BUILD_FRAMEWORK)
add_llvm_tool_symlink(${name} ${name} ALWAYS_GENERATE SKIP_INSTALL
OUTPUT_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
endif()
diff --git a/cmake/modules/FindLibEdit.cmake b/cmake/modules/FindLibEdit.cmake
new file mode 100644
index 000000000000..81204d42f1d0
--- /dev/null
+++ b/cmake/modules/FindLibEdit.cmake
@@ -0,0 +1,62 @@
+#.rst:
+# FindLibEdit
+# -----------
+#
+# Find libedit library and headers
+#
+# The module defines the following variables:
+#
+# ::
+#
+# libedit_FOUND - true if libedit was found
+# libedit_INCLUDE_DIRS - include search path
+# libedit_LIBRARIES - libraries to link
+# libedit_VERSION - version number
+
+if(libedit_INCLUDE_DIRS AND libedit_LIBRARIES)
+ set(libedit_FOUND TRUE)
+else()
+ find_package(PkgConfig QUIET)
+ pkg_check_modules(PC_LIBEDIT QUIET libedit)
+
+ find_path(libedit_INCLUDE_DIRS
+ NAMES
+ histedit.h
+ HINTS
+ ${PC_LIBEDIT_INCLUDEDIR}
+ ${PC_LIBEDIT_INCLUDE_DIRS}
+ ${CMAKE_INSTALL_FULL_INCLUDEDIR})
+ find_library(libedit_LIBRARIES
+ NAMES
+ edit libedit
+ HINTS
+ ${PC_LIBEDIT_LIBDIR}
+ ${PC_LIBEDIT_LIBRARY_DIRS}
+ ${CMAKE_INSTALL_FULL_LIBDIR})
+
+ if(libedit_INCLUDE_DIRS AND EXISTS "${libedit_INCLUDE_DIRS}/histedit.h")
+ file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h"
+ libedit_major_version_str
+ REGEX "^#define[ \t]+LIBEDIT_MAJOR[ \t]+[0-9]+")
+ string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MAJOR[ \t]+([0-9]+)" "\\1"
+ LIBEDIT_MAJOR_VERSION "${libedit_major_version_str}")
+
+ file(STRINGS "${libedit_INCLUDE_DIRS}/histedit.h"
+ libedit_minor_version_str
+ REGEX "^#define[ \t]+LIBEDIT_MINOR[ \t]+[0-9]+")
+ string(REGEX REPLACE "^#define[ \t]+LIBEDIT_MINOR[ \t]+([0-9]+)" "\\1"
+ LIBEDIT_MINOR_VERSION "${libedit_minor_version_str}")
+
+ set(libedit_VERSION_STRING "${libedit_major_version}.${libedit_minor_version}")
+ endif()
+
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(libedit
+ REQUIRED_VARS
+ libedit_INCLUDE_DIRS
+ libedit_LIBRARIES
+ VERSION_VAR
+ libedit_VERSION_STRING)
+ mark_as_advanced(libedit_INCLUDE_DIRS libedit_LIBRARIES)
+endif()
+
diff --git a/cmake/modules/LLDBConfig.cmake b/cmake/modules/LLDBConfig.cmake
index 8f75880dfbff..dae6e365da38 100644
--- a/cmake/modules/LLDBConfig.cmake
+++ b/cmake/modules/LLDBConfig.cmake
@@ -277,27 +277,31 @@ include_directories(BEFORE
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
install(DIRECTORY include/
- COMPONENT lldb_headers
+ COMPONENT lldb-headers
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN ".cmake" EXCLUDE
PATTERN "Config.h" EXCLUDE
- PATTERN "lldb-*.h" EXCLUDE
- PATTERN "API/*.h" EXCLUDE
)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/include/
- COMPONENT lldb_headers
+ COMPONENT lldb-headers
DESTINATION include
FILES_MATCHING
PATTERN "*.h"
PATTERN ".svn" EXCLUDE
PATTERN ".cmake" EXCLUDE
- PATTERN "lldb-*.h" EXCLUDE
- PATTERN "API/*.h" EXCLUDE
)
+
+ add_custom_target(lldb-headers)
+ set_target_properties(lldb-headers PROPERTIES FOLDER "Misc")
+
+ if (NOT CMAKE_CONFIGURATION_TYPES)
+ add_llvm_install_targets(install-lldb-headers
+ COMPONENT lldb-headers)
+ endif()
endif()
if (NOT LIBXML2_FOUND AND NOT (CMAKE_SYSTEM_NAME MATCHES "Windows"))
@@ -342,14 +346,18 @@ else()
endif()
-if (HAVE_LIBPTHREAD)
- list(APPEND system_libs pthread)
-endif(HAVE_LIBPTHREAD)
+if( WIN32 AND NOT CYGWIN )
+ set(PURE_WINDOWS 1)
+endif()
-if (HAVE_LIBDL)
- list(APPEND system_libs ${CMAKE_DL_LIBS})
+if(NOT PURE_WINDOWS)
+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ find_package(Threads REQUIRED)
+ list(APPEND system_libs ${CMAKE_THREAD_LIBS_INIT})
endif()
+list(APPEND system_libs ${CMAKE_DL_LIBS})
+
# Figure out if lldb could use lldb-server. If so, then we'll
# ensure we build lldb-server when an lldb target is being built.
if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
@@ -403,15 +411,6 @@ if(LLDB_USING_LIBSTDCXX)
endif()
endif()
-if(MSVC)
- set(LLDB_USE_BUILTIN_DEMANGLER ON)
-else()
- option(LLDB_USE_BUILTIN_DEMANGLER "Use lldb's builtin demangler instead of the system one" ON)
-endif()
-if(LLDB_USE_BUILTIN_DEMANGLER)
- add_definitions(-DLLDB_USE_BUILTIN_DEMANGLER)
-endif()
-
if ((CMAKE_SYSTEM_NAME MATCHES "Android") AND LLVM_BUILD_STATIC AND
((ANDROID_ABI MATCHES "armeabi") OR (ANDROID_ABI MATCHES "mips")))
add_definitions(-DANDROID_USE_ACCEPT_WORKAROUND)
diff --git a/cmake/modules/LLDBFramework.cmake b/cmake/modules/LLDBFramework.cmake
new file mode 100644
index 000000000000..abacee89d9ac
--- /dev/null
+++ b/cmake/modules/LLDBFramework.cmake
@@ -0,0 +1,44 @@
+file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})
+foreach(header
+ ${public_headers}
+ ${root_public_headers}
+ ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
+ get_filename_component(basename ${header} NAME)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
+ DEPENDS ${header}
+ COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+ list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+endforeach()
+
+add_custom_target(lldb-framework-headers DEPENDS ${framework_headers})
+
+add_custom_command(TARGET lldb-framework POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
+ COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh $<TARGET_FILE_DIR:liblldb>/Headers ${LLDB_VERSION}
+)
+
+if (NOT IOS)
+ if (NOT LLDB_BUILT_STANDALONE)
+ add_dependencies(lldb-framework clang-headers)
+ endif()
+ add_custom_command(TARGET lldb-framework POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Headers
+ COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${LLDB_FRAMEWORK_DIR}/LLDB.framework/Versions/Current
+ COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
+ )
+endif()
+
+set_target_properties(liblldb PROPERTIES
+ OUTPUT_NAME LLDB
+ FRAMEWORK On
+ FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
+ MACOSX_FRAMEWORK_INFO_PLIST ${LLDB_SOURCE_DIR}/resources/LLDB-Info.plist
+ LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
+ PUBLIC_HEADER "${framework_headers}")
+
+add_dependencies(lldb-framework
+ lldb-framework-headers
+ lldb-suite)
diff --git a/cmake/modules/LLDBGenerateConfig.cmake b/cmake/modules/LLDBGenerateConfig.cmake
index ca2d5842a806..7586eda30d68 100644
--- a/cmake/modules/LLDBGenerateConfig.cmake
+++ b/cmake/modules/LLDBGenerateConfig.cmake
@@ -4,6 +4,7 @@ include(CheckSymbolExists)
include(CheckIncludeFile)
include(CheckIncludeFiles)
include(CheckLibraryExists)
+include(CheckTypeSize)
set(CMAKE_REQUIRED_DEFINITIONS -D_GNU_SOURCE)
check_symbol_exists(ppoll poll.h HAVE_PPOLL)
@@ -14,14 +15,8 @@ check_cxx_symbol_exists(accept4 "sys/socket.h" HAVE_ACCEPT4)
check_include_file(termios.h HAVE_TERMIOS_H)
check_include_files("sys/types.h;sys/event.h" HAVE_SYS_EVENT_H)
-check_cxx_source_compiles("
- #include <sys/uio.h>
- int main() { process_vm_readv(0, nullptr, 0, nullptr, 0, 0); return 0; }"
- HAVE_PROCESS_VM_READV)
-check_cxx_source_compiles("
- #include <sys/syscall.h>
- int main() { return __NR_process_vm_readv; }"
- HAVE_NR_PROCESS_VM_READV)
+check_cxx_symbol_exists(process_vm_readv "sys/uio.h" HAVE_PROCESS_VM_READV)
+check_cxx_symbol_exists(__NR_process_vm_readv "sys/syscall.h" HAVE_NR_PROCESS_VM_READV)
check_library_exists(compression compression_encode_buffer "" HAVE_LIBCOMPRESSION)
@@ -33,6 +28,24 @@ if(NOT UNIX)
set(LLDB_DISABLE_POSIX 1)
endif()
+if (NOT LLDB_DISABLE_LIBEDIT)
+ # Check if we libedit capable of handling wide characters (built with
+ # '--enable-widec').
+ set(CMAKE_REQUIRED_LIBRARIES ${libedit_LIBRARIES})
+ set(CMAKE_REQUIRED_INCLUDES ${libedit_INCLUDE_DIRS})
+ check_symbol_exists(el_winsertstr histedit.h LLDB_EDITLINE_USE_WCHAR)
+ set(CMAKE_EXTRA_INCLUDE_FILES histedit.h)
+ check_type_size(el_rfunc_t LLDB_EL_RFUNC_T_SIZE)
+ if (LLDB_EL_RFUNC_T_SIZE STREQUAL "")
+ set(LLDB_HAVE_EL_RFUNC_T 0)
+ else()
+ set(LLDB_HAVE_EL_RFUNC_T 1)
+ endif()
+ set(CMAKE_REQUIRED_LIBRARIES)
+ set(CMAKE_REQUIRED_INCLUDES)
+ set(CMAKE_EXTRA_INCLUDE_FILES)
+endif()
+
if(NOT LLDB_CONFIG_HEADER_INPUT)
set(LLDB_CONFIG_HEADER_INPUT ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake)
endif()
diff --git a/cmake/modules/LLDBStandalone.cmake b/cmake/modules/LLDBStandalone.cmake
index f07a3fcb57b6..742c464036a4 100644
--- a/cmake/modules/LLDBStandalone.cmake
+++ b/cmake/modules/LLDBStandalone.cmake
@@ -58,6 +58,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(LLVM_DIR ${LLVM_OBJ_ROOT}/cmake/modules/CMakeFiles CACHE PATH "Path to LLVM build tree CMake files")
set(LLVM_BINARY_DIR ${LLVM_OBJ_ROOT} CACHE PATH "Path to LLVM build tree")
set(LLVM_MAIN_SRC_DIR ${MAIN_SRC_DIR} CACHE PATH "Path to LLVM source tree")
+ set(LLVM_EXTERNAL_LIT ${LLVM_TOOLS_BINARY_DIR}/llvm-lit CACHE PATH "Path to llvm-lit")
find_program(LLVM_TABLEGEN_EXE "llvm-tblgen" ${LLVM_TOOLS_BINARY_DIR}
NO_DEFAULT_PATH)
@@ -99,7 +100,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Import CMake library targets from LLVM and Clang.
include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/llvm/LLVMConfig.cmake")
- # cmake/clang/ClangConfig.cmake is not created when LLVM and Cland are built together.
+ # cmake/clang/ClangConfig.cmake is not created when LLVM and Clang are built together.
if (EXISTS "${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
include("${LLVM_OBJ_ROOT}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake")
endif()
@@ -111,7 +112,7 @@ if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories("${LLVM_BINARY_DIR}/include" "${LLVM_MAIN_INCLUDE_DIR}")
# Next three include directories are needed when llvm-config is located in build directory.
- # LLVM and Cland are assumed to be built together
+ # LLVM and Clang are assumed to be built together
if (EXISTS "${LLVM_OBJ_ROOT}/include")
include_directories("${LLVM_OBJ_ROOT}/include")
endif()
diff --git a/docs/code-signing.txt b/docs/code-signing.txt
index 5407fd4bb42e..3da3a8085e66 100644
--- a/docs/code-signing.txt
+++ b/docs/code-signing.txt
@@ -1,6 +1,11 @@
-On MacOSX lldb needs to be code signed. The Debug, DebugClang and Release
-builds are set to code sign using a code signing certificate named
-"lldb_codesign".
+To use the in-tree debug server on macOS, lldb needs to be code signed. The
+Debug, DebugClang and Release builds are set to code sign using a code signing
+certificate named "lldb_codesign". This document explains how to set up the
+signing certificate.
+
+Note that it's possible to build and use lldb on macOS without setting up code
+signing by using the system's debug server. To configure lldb in this way with
+cmake, specify -DLLDB_CODESIGN_IDENTITY=''.
If you have re-installed a new OS, please delete all old lldb_codesign items
from your keychain. There will be a code signing certification and a public
diff --git a/docs/doxygen.cfg.in b/docs/doxygen.cfg.in
index 725a26f2a03c..0c2066051853 100644
--- a/docs/doxygen.cfg.in
+++ b/docs/doxygen.cfg.in
@@ -137,7 +137,7 @@ SHORT_NAMES = NO
# comments will behave just like regular Qt-style comments
# (thus requiring an explicit @brief command for a brief description.)
-JAVADOC_AUTOBRIEF = NO
+JAVADOC_AUTOBRIEF = YES
# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
# interpret the first line (until the first dot) of a Qt-style
@@ -145,7 +145,7 @@ JAVADOC_AUTOBRIEF = NO
# will behave just like regular Qt-style comments (thus requiring
# an explicit \brief command for a brief description.)
-QT_AUTOBRIEF = NO
+QT_AUTOBRIEF = YES
# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
# treat a multi-line C++ special comment block (i.e. a block of //! or ///
diff --git a/docs/lldb-gdb-remote.txt b/docs/lldb-gdb-remote.txt
index 0000738b556b..3b808642eb7c 100644
--- a/docs/lldb-gdb-remote.txt
+++ b/docs/lldb-gdb-remote.txt
@@ -148,7 +148,7 @@ This packet can be sent one or more times _prior_ to sending a "A" packet.
// are human readable along with an error code.
//----------------------------------------------------------------------
-send packet: $QErrorStringInPacketSupported
+send packet: $QEnableErrorStrings
read packet: $OK#00
//----------------------------------------------------------------------
diff --git a/docs/testsuite/a-detailed-walkthrough.txt b/docs/testsuite/a-detailed-walkthrough.txt
index 6b5267f414ce..be679ef353de 100644
--- a/docs/testsuite/a-detailed-walkthrough.txt
+++ b/docs/testsuite/a-detailed-walkthrough.txt
@@ -135,15 +135,16 @@ see test/array_types/TestArrayTypes.py:
self.array_types()
This method is decorated with a skipUnless decorator so that it will only gets
-included into the test suite if the platform it is running on is 'darwin', aka
-Mac OS X.
+included into the test suite if the platform it is running on is 'darwin', a.k.a.
+macOS.
Type 'man dsymutil' for more details.
After the binary is built, it is time to specify the file to be used as the main
executable by lldb:
- exe = os.path.join(os.getcwd(), "a.out")
+ # Construct the path to a file "a.out" inside the test's build folder.
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
This is where the attribute assignment:
@@ -174,10 +175,11 @@ execution. This can be accomplished by passing the keyword argument pair
After the current executable is set, we'll then execute two more commands:
# Set the output-path and verify it is set.
- self.runCmd("settings set target.process.output-path 'stdout.txt'")
+ stdout = self.getBuildArtifact('stdout.txt')
+ self.runCmd("settings set target.process.output-path '%s'" %stdout)
self.expect("settings show target.process.output-path",
SETTING_MSG("target.process.output-path"),
- startstr = "target.process.output-path (string) = 'stdout.txt'")
+ startstr = "target.process.output-path (string) = '.*stdout.txt'")
The first uses the 'settings set' command to set the static setting
target.process.output-path to be 'stdout.txt', instead of the default
@@ -188,7 +190,7 @@ door and grabs the output from the command execution and expects to match the
start string of the output against what we pass in as the value of the keyword
argument pair:
- startstr = "target.process.output-path (string) = 'stdout.txt'"
+ startstr = "target.process.output-path (string) = '%s'" %stdout
Take a look at TestBase.expect() within lldbtest.py for more details. Among
other things, it can also match against a list of regexp patterns as well as a
@@ -204,15 +206,15 @@ And this asserts that the file 'stdout.txt' should be present after running the
program.
# The 'stdout.txt' file should now exist.
- self.assertTrue(os.path.isfile("stdout.txt"),
- "'stdout.txt' exists due to target.process.output-path.")
+ self.assertTrue(os.path.isfile(stdout),
+ "stdout.txt' exists due to target.process.output-path.")
Also take a look at main.cpp which emits some message to the stdout. Now, if we
pass this assertion, it's time to examine the contents of the file to make sure
it contains the same message as programmed in main.cpp:
# Read the output file produced by running the program.
- with open('stdout.txt', 'r') as f:
+ with open(stdout, 'r') as f:
output = f.read()
self.expect(output, exe=False,
@@ -235,8 +237,8 @@ file:
@classmethod
def classCleanup(cls):
- system(["/bin/sh", "-c", "rm -f output.txt"])
- system(["/bin/sh", "-c", "rm -f stdout.txt"])
+ system(["/bin/sh", "-c", "rm -f "+self.getBuildArtifact("output.txt")])
+ system(["/bin/sh", "-c", "rm -f "+self.getBuildArtifact("stdout.txt")])
This is a classmethod (as shown by the @classmethod decorator) which allows the
individual test class to perform cleanup actions after the test harness finishes
diff --git a/examples/darwin/heap_find/heap/heap_find.cpp b/examples/darwin/heap_find/heap/heap_find.cpp
index 3567e559a6a7..b63d18b712bd 100644
--- a/examples/darwin/heap_find/heap/heap_find.cpp
+++ b/examples/darwin/heap_find/heap/heap_find.cpp
@@ -410,7 +410,7 @@ public:
m_sort_type = eSortTypeBytes;
}
if (print && m_size > 0) {
- puts("Objective C objects by total bytes:");
+ puts("Objective-C objects by total bytes:");
puts("Total Bytes Class Name");
puts("----------- "
"-----------------------------------------------------------------");
@@ -427,7 +427,7 @@ public:
m_sort_type = eSortTypeCount;
}
if (print && m_size > 0) {
- puts("Objective C objects by total count:");
+ puts("Objective-C objects by total count:");
puts("Count Class Name");
puts("-------- "
"-----------------------------------------------------------------");
diff --git a/examples/python/bsd.py b/examples/python/bsd.py
new file mode 100755
index 000000000000..8218f4ae6323
--- /dev/null
+++ b/examples/python/bsd.py
@@ -0,0 +1,481 @@
+#!/usr/bin/python
+
+import optparse
+import os
+import shlex
+import struct
+import sys
+
+ARMAG = "!<arch>\n"
+SARMAG = 8
+ARFMAG = "`\n"
+AR_EFMT1 = "#1/"
+
+
+def memdump(src, bytes_per_line=16, address=0):
+ FILTER = ''.join([(len(repr(chr(x))) == 3) and chr(x) or '.'
+ for x in range(256)])
+ for i in range(0, len(src), bytes_per_line):
+ s = src[i:i+bytes_per_line]
+ hex_bytes = ' '.join(["%02x" % (ord(x)) for x in s])
+ ascii = s.translate(FILTER)
+ print("%#08.8x: %-*s %s" % (address+i, bytes_per_line*3, hex_bytes,
+ ascii))
+
+
+class Object(object):
+ def __init__(self, file):
+ def read_str(file, str_len):
+ return file.read(str_len).rstrip('\0 ')
+
+ def read_int(file, str_len, base):
+ return int(read_str(file, str_len), base)
+
+ self.offset = file.tell()
+ self.file = file
+ self.name = read_str(file, 16)
+ self.date = read_int(file, 12, 10)
+ self.uid = read_int(file, 6, 10)
+ self.gid = read_int(file, 6, 10)
+ self.mode = read_int(file, 8, 8)
+ self.size = read_int(file, 10, 10)
+ if file.read(2) != ARFMAG:
+ raise ValueError('invalid BSD object at offset %#08.8x' % (
+ self.offset))
+ # If we have an extended name read it. Extended names start with
+ name_len = 0
+ if self.name.startswith(AR_EFMT1):
+ name_len = int(self.name[len(AR_EFMT1):], 10)
+ self.name = read_str(file, name_len)
+ self.obj_offset = file.tell()
+ self.obj_size = self.size - name_len
+ file.seek(self.obj_size, 1)
+
+ def dump(self, f=sys.stdout, flat=True):
+ if flat:
+ f.write('%#08.8x: %#08.8x %5u %5u %6o %#08.8x %s\n' % (self.offset,
+ self.date, self.uid, self.gid, self.mode, self.size,
+ self.name))
+ else:
+ f.write('%#08.8x: \n' % self.offset)
+ f.write(' name = "%s"\n' % self.name)
+ f.write(' date = %#08.8x\n' % self.date)
+ f.write(' uid = %i\n' % self.uid)
+ f.write(' gid = %i\n' % self.gid)
+ f.write(' mode = %o\n' % self.mode)
+ f.write(' size = %#08.8x\n' % (self.size))
+ self.file.seek(self.obj_offset, 0)
+ first_bytes = self.file.read(4)
+ f.write('bytes = ')
+ memdump(first_bytes)
+
+ def get_bytes(self):
+ saved_pos = self.file.tell()
+ self.file.seek(self.obj_offset, 0)
+ bytes = self.file.read(self.obj_size)
+ self.file.seek(saved_pos, 0)
+ return bytes
+
+
+class StringTable(object):
+ def __init__(self, bytes):
+ self.bytes = bytes
+
+ def get_string(self, offset):
+ length = len(self.bytes)
+ if offset >= length:
+ return None
+ return self.bytes[offset:self.bytes.find('\0', offset)]
+
+
+class Archive(object):
+ def __init__(self, path):
+ self.path = path
+ self.file = open(path, 'r')
+ self.objects = []
+ self.offset_to_object = {}
+ if self.file.read(SARMAG) != ARMAG:
+ print("error: file isn't a BSD archive")
+ while True:
+ try:
+ self.objects.append(Object(self.file))
+ except ValueError:
+ break
+
+ def get_object_at_offset(self, offset):
+ if offset in self.offset_to_object:
+ return self.offset_to_object[offset]
+ for obj in self.objects:
+ if obj.offset == offset:
+ self.offset_to_object[offset] = obj
+ return obj
+ return None
+
+ def find(self, name, mtime=None, f=sys.stdout):
+ '''
+ Find an object(s) by name with optional modification time. There
+ can be multple objects with the same name inside and possibly with
+ the same modification time within a BSD archive so clients must be
+ prepared to get multiple results.
+ '''
+ matches = []
+ for obj in self.objects:
+ if obj.name == name and (mtime is None or mtime == obj.date):
+ matches.append(obj)
+ return matches
+
+ @classmethod
+ def dump_header(self, f=sys.stdout):
+ f.write(' DATE UID GID MODE SIZE NAME\n')
+ f.write(' ---------- ----- ----- ------ ---------- '
+ '--------------\n')
+
+ def get_symdef(self):
+ def get_uint32(file):
+ '''Extract a uint32_t from the current file position.'''
+ v, = struct.unpack('=I', file.read(4))
+ return v
+
+ for obj in self.objects:
+ symdef = []
+ if obj.name.startswith("__.SYMDEF"):
+ self.file.seek(obj.obj_offset, 0)
+ ranlib_byte_size = get_uint32(self.file)
+ num_ranlib_structs = ranlib_byte_size/8
+ str_offset_pairs = []
+ for _ in range(num_ranlib_structs):
+ strx = get_uint32(self.file)
+ offset = get_uint32(self.file)
+ str_offset_pairs.append((strx, offset))
+ strtab_len = get_uint32(self.file)
+ strtab = StringTable(self.file.read(strtab_len))
+ for s in str_offset_pairs:
+ symdef.append((strtab.get_string(s[0]), s[1]))
+ return symdef
+
+ def get_object_dicts(self):
+ '''
+ Returns an array of object dictionaries that contain they following
+ keys:
+ 'object': the actual bsd.Object instance
+ 'symdefs': an array of symbol names that the object contains
+ as found in the "__.SYMDEF" item in the archive
+ '''
+ symdefs = self.get_symdef()
+ symdef_dict = {}
+ if symdefs:
+ for (name, offset) in symdefs:
+ if offset in symdef_dict:
+ object_dict = symdef_dict[offset]
+ else:
+ object_dict = {
+ 'object': self.get_object_at_offset(offset),
+ 'symdefs': []
+ }
+ symdef_dict[offset] = object_dict
+ object_dict['symdefs'].append(name)
+ object_dicts = []
+ for offset in sorted(symdef_dict):
+ object_dicts.append(symdef_dict[offset])
+ return object_dicts
+
+ def dump(self, f=sys.stdout, flat=True):
+ f.write('%s:\n' % self.path)
+ if flat:
+ self.dump_header(f=f)
+ for obj in self.objects:
+ obj.dump(f=f, flat=flat)
+
+
+def main():
+ parser = optparse.OptionParser(
+ prog='bsd',
+ description='Utility for BSD archives')
+ parser.add_option(
+ '--object',
+ type='string',
+ dest='object_name',
+ default=None,
+ help=('Specify the name of a object within the BSD archive to get '
+ 'information on'))
+ parser.add_option(
+ '-s', '--symbol',
+ type='string',
+ dest='find_symbol',
+ default=None,
+ help=('Specify the name of a symbol within the BSD archive to get '
+ 'information on from SYMDEF'))
+ parser.add_option(
+ '--symdef',
+ action='store_true',
+ dest='symdef',
+ default=False,
+ help=('Dump the information in the SYMDEF.'))
+ parser.add_option(
+ '-v', '--verbose',
+ action='store_true',
+ dest='verbose',
+ default=False,
+ help='Enable verbose output')
+ parser.add_option(
+ '-e', '--extract',
+ action='store_true',
+ dest='extract',
+ default=False,
+ help=('Specify this to extract the object specified with the --object '
+ 'option. There must be only one object with a matching name or '
+ 'the --mtime option must be specified to uniquely identify a '
+ 'single object.'))
+ parser.add_option(
+ '-m', '--mtime',
+ type='int',
+ dest='mtime',
+ default=None,
+ help=('Specify the modification time of the object an object. This '
+ 'option is used with either the --object or --extract options.'))
+ parser.add_option(
+ '-o', '--outfile',
+ type='string',
+ dest='outfile',
+ default=None,
+ help=('Specify a different name or path for the file to extract when '
+ 'using the --extract option. If this option isn\'t specified, '
+ 'then the extracted object file will be extracted into the '
+ 'current working directory if a file doesn\'t already exist '
+ 'with that name.'))
+
+ (options, args) = parser.parse_args(sys.argv[1:])
+
+ for path in args:
+ archive = Archive(path)
+ if options.object_name:
+ print('%s:\n' % (path))
+ matches = archive.find(options.object_name, options.mtime)
+ if matches:
+ dump_all = True
+ if options.extract:
+ if len(matches) == 1:
+ dump_all = False
+ if options.outfile is None:
+ outfile_path = matches[0].name
+ else:
+ outfile_path = options.outfile
+ if os.path.exists(outfile_path):
+ print('error: outfile "%s" already exists' % (
+ outfile_path))
+ else:
+ print('Saving file to "%s"...' % (outfile_path))
+ with open(outfile_path, 'w') as outfile:
+ outfile.write(matches[0].get_bytes())
+ else:
+ print('error: multiple objects match "%s". Specify '
+ 'the modification time using --mtime.' % (
+ options.object_name))
+ if dump_all:
+ for obj in matches:
+ obj.dump(flat=False)
+ else:
+ print('error: object "%s" not found in archive' % (
+ options.object_name))
+ elif options.find_symbol:
+ symdefs = archive.get_symdef()
+ if symdefs:
+ success = False
+ for (name, offset) in symdefs:
+ obj = archive.get_object_at_offset(offset)
+ if name == options.find_symbol:
+ print('Found "%s" in:' % (options.find_symbol))
+ obj.dump(flat=False)
+ success = True
+ if not success:
+ print('Didn\'t find "%s" in any objects' % (
+ options.find_symbol))
+ else:
+ print("error: no __.SYMDEF was found")
+ elif options.symdef:
+ object_dicts = archive.get_object_dicts()
+ for object_dict in object_dicts:
+ object_dict['object'].dump(flat=False)
+ print("symbols:")
+ for name in object_dict['symdefs']:
+ print(" %s" % (name))
+ else:
+ archive.dump(flat=not options.verbose)
+
+
+if __name__ == '__main__':
+ main()
+
+
+def print_mtime_error(result, dmap_mtime, actual_mtime):
+ print >>result, ("error: modification time in debug map (%#08.8x) doesn't "
+ "match the .o file modification time (%#08.8x)" % (
+ dmap_mtime, actual_mtime))
+
+
+def print_file_missing_error(result, path):
+ print >>result, "error: file \"%s\" doesn't exist" % (path)
+
+
+def print_multiple_object_matches(result, object_name, mtime, matches):
+ print >>result, ("error: multiple matches for object '%s' with with "
+ "modification time %#08.8x:" % (object_name, mtime))
+ Archive.dump_header(f=result)
+ for match in matches:
+ match.dump(f=result, flat=True)
+
+
+def print_archive_object_error(result, object_name, mtime, archive):
+ matches = archive.find(object_name, f=result)
+ if len(matches) > 0:
+ print >>result, ("error: no objects have a modification time that "
+ "matches %#08.8x for '%s'. Potential matches:" % (
+ mtime, object_name))
+ Archive.dump_header(f=result)
+ for match in matches:
+ match.dump(f=result, flat=True)
+ else:
+ print >>result, "error: no object named \"%s\" found in archive:" % (
+ object_name)
+ Archive.dump_header(f=result)
+ for match in archive.objects:
+ match.dump(f=result, flat=True)
+ # archive.dump(f=result, flat=True)
+
+
+class VerifyDebugMapCommand:
+ name = "verify-debug-map-objects"
+
+ def create_options(self):
+ usage = "usage: %prog [options]"
+ description = '''This command reports any .o files that are missing
+or whose modification times don't match in the debug map of an executable.'''
+
+ self.parser = optparse.OptionParser(
+ description=description,
+ prog=self.name,
+ usage=usage,
+ add_help_option=False)
+
+ self.parser.add_option(
+ '-e', '--errors',
+ action='store_true',
+ dest='errors',
+ default=False,
+ help="Only show errors")
+
+ def get_short_help(self):
+ return "Verify debug map object files."
+
+ def get_long_help(self):
+ return self.help_string
+
+ def __init__(self, debugger, unused):
+ self.create_options()
+ self.help_string = self.parser.format_help()
+
+ def __call__(self, debugger, command, exe_ctx, result):
+ import lldb
+ # Use the Shell Lexer to properly parse up command options just like a
+ # shell would
+ command_args = shlex.split(command)
+
+ try:
+ (options, args) = self.parser.parse_args(command_args)
+ except:
+ result.SetError("option parsing failed")
+ return
+
+ # Always get program state from the SBExecutionContext passed in
+ target = exe_ctx.GetTarget()
+ if not target.IsValid():
+ result.SetError("invalid target")
+ return
+ archives = {}
+ for module_spec in args:
+ module = target.module[module_spec]
+ if not (module and module.IsValid()):
+ result.SetError('error: invalid module specification: "%s". '
+ 'Specify the full path, basename, or UUID of '
+ 'a module ' % (module_spec))
+ return
+ num_symbols = module.GetNumSymbols()
+ num_errors = 0
+ for i in range(num_symbols):
+ symbol = module.GetSymbolAtIndex(i)
+ if symbol.GetType() != lldb.eSymbolTypeObjectFile:
+ continue
+ path = symbol.GetName()
+ if not path:
+ continue
+ # Extract the value of the symbol by dumping the
+ # symbol. The value is the mod time.
+ dmap_mtime = int(str(symbol).split('value = ')
+ [1].split(',')[0], 16)
+ if not options.errors:
+ print >>result, '%s' % (path)
+ if os.path.exists(path):
+ actual_mtime = int(os.stat(path).st_mtime)
+ if dmap_mtime != actual_mtime:
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_mtime_error(result, dmap_mtime,
+ actual_mtime)
+ elif path[-1] == ')':
+ (archive_path, object_name) = path[0:-1].split('(')
+ if not archive_path and not object_name:
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_file_missing_error(path)
+ continue
+ if not os.path.exists(archive_path):
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_file_missing_error(archive_path)
+ continue
+ if archive_path in archives:
+ archive = archives[archive_path]
+ else:
+ archive = Archive(archive_path)
+ archives[archive_path] = archive
+ matches = archive.find(object_name, dmap_mtime)
+ num_matches = len(matches)
+ if num_matches == 1:
+ print >>result, '1 match'
+ obj = matches[0]
+ if obj.date != dmap_mtime:
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_mtime_error(result, dmap_mtime, obj.date)
+ elif num_matches == 0:
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_archive_object_error(result, object_name,
+ dmap_mtime, archive)
+ elif num_matches > 1:
+ num_errors += 1
+ if options.errors:
+ print >>result, '%s' % (path),
+ print_multiple_object_matches(result,
+ object_name,
+ dmap_mtime, matches)
+ if num_errors > 0:
+ print >>result, "%u errors found" % (num_errors)
+ else:
+ print >>result, "No errors detected in debug map"
+
+
+def __lldb_init_module(debugger, dict):
+ # This initializer is being run from LLDB in the embedded command
+ # interpreter.
+ # Add any commands contained in this module to LLDB
+ debugger.HandleCommand(
+ 'command script add -c %s.VerifyDebugMapCommand %s' % (
+ __name__, VerifyDebugMapCommand.name))
+ print('The "%s" command has been installed, type "help %s" for detailed '
+ 'help.' % (VerifyDebugMapCommand.name, VerifyDebugMapCommand.name))
diff --git a/examples/python/cmdtemplate.py b/examples/python/cmdtemplate.py
index 4d506b91aaf8..0acb04ef4715 100644
--- a/examples/python/cmdtemplate.py
+++ b/examples/python/cmdtemplate.py
@@ -1,69 +1,91 @@
#!/usr/bin/python
-#----------------------------------------------------------------------
+# ---------------------------------------------------------------------
# Be sure to add the python path that points to the LLDB shared library.
#
# # To use this in the embedded python interpreter using "lldb" just
# import it with the full path using the "command script import"
# command
# (lldb) command script import /path/to/cmdtemplate.py
-#----------------------------------------------------------------------
+# ---------------------------------------------------------------------
+import inspect
import lldb
-import commands
import optparse
import shlex
+import sys
+
class FrameStatCommand:
- def create_options(self):
+ program = 'framestats'
+
+ @classmethod
+ def register_lldb_command(cls, debugger, module_name):
+ parser = cls.create_options()
+ cls.__doc__ = parser.format_help()
+ # Add any commands contained in this module to LLDB
+ command = 'command script add -c %s.%s %s' % (module_name,
+ cls.__name__,
+ cls.program)
+ debugger.HandleCommand(command)
+ print('The "{0}" command has been installed, type "help {0}" or "{0} '
+ '--help" for detailed help.'.format(cls.program))
+
+ @classmethod
+ def create_options(cls):
usage = "usage: %prog [options]"
- description = '''This command is meant to be an example of how to make an LLDB command that
-does something useful, follows best practices, and exploits the SB API.
-Specifically, this command computes the aggregate and average size of the variables in the current frame
-and allows you to tweak exactly which variables are to be accounted in the computation.
-'''
-
- # Pass add_help_option = False, since this keeps the command in line with lldb commands,
- # and we wire up "help command" to work by providing the long & short help methods below.
- self.parser = optparse.OptionParser(
- description = description,
- prog = 'framestats',
- usage = usage,
- add_help_option = False)
-
- self.parser.add_option(
+ description = ('This command is meant to be an example of how to make '
+ 'an LLDB command that does something useful, follows '
+ 'best practices, and exploits the SB API. '
+ 'Specifically, this command computes the aggregate '
+ 'and average size of the variables in the current '
+ 'frame and allows you to tweak exactly which variables '
+ 'are to be accounted in the computation.')
+
+ # Pass add_help_option = False, since this keeps the command in line
+ # with lldb commands, and we wire up "help command" to work by
+ # providing the long & short help methods below.
+ parser = optparse.OptionParser(
+ description=description,
+ prog=cls.program,
+ usage=usage,
+ add_help_option=False)
+
+ parser.add_option(
'-i',
'--in-scope',
- action = 'store_true',
- dest = 'inscope',
- help = 'in_scope_only = True',
- default = True)
+ action='store_true',
+ dest='inscope',
+ help='in_scope_only = True',
+ default=True)
- self.parser.add_option(
+ parser.add_option(
'-a',
'--arguments',
- action = 'store_true',
- dest = 'arguments',
- help = 'arguments = True',
- default = True)
+ action='store_true',
+ dest='arguments',
+ help='arguments = True',
+ default=True)
- self.parser.add_option(
+ parser.add_option(
'-l',
'--locals',
- action = 'store_true',
- dest = 'locals',
- help = 'locals = True',
- default = True)
+ action='store_true',
+ dest='locals',
+ help='locals = True',
+ default=True)
- self.parser.add_option(
+ parser.add_option(
'-s',
'--statics',
- action = 'store_true',
- dest = 'statics',
- help = 'statics = True',
- default = True)
-
+ action='store_true',
+ dest='statics',
+ help='statics = True',
+ default=True)
+
+ return parser
+
def get_short_help(self):
return "Example command for use in debugging"
@@ -71,23 +93,25 @@ and allows you to tweak exactly which variables are to be accounted in the compu
return self.help_string
def __init__(self, debugger, unused):
- self.create_options()
+ self.parser = self.create_options()
self.help_string = self.parser.format_help()
def __call__(self, debugger, command, exe_ctx, result):
# Use the Shell Lexer to properly parse up command options just like a
# shell would
command_args = shlex.split(command)
-
+
try:
(options, args) = self.parser.parse_args(command_args)
except:
- # if you don't handle exceptions, passing an incorrect argument to the OptionParser will cause LLDB to exit
- # (courtesy of OptParse dealing with argument errors by throwing SystemExit)
+ # if you don't handle exceptions, passing an incorrect argument to
+ # the OptionParser will cause LLDB to exit (courtesy of OptParse
+ # dealing with argument errors by throwing SystemExit)
result.SetError("option parsing failed")
return
- # Always get program state from the SBExecutionContext passed in as exe_ctx
+ # Always get program state from the lldb.SBExecutionContext passed
+ # in as exe_ctx
frame = exe_ctx.GetFrame()
if not frame.IsValid():
result.SetError("invalid frame")
@@ -108,15 +132,16 @@ and allows you to tweak exactly which variables are to be accounted in the compu
variable_type = variable.GetType()
total_size = total_size + variable_type.GetByteSize()
average_size = float(total_size) / variables_count
- print >>result, "Your frame has %d variables. Their total size is %d bytes. The average size is %f bytes" % (
- variables_count, total_size, average_size)
- # not returning anything is akin to returning success
+ print >>result, ("Your frame has %d variables. Their total size "
+ "is %d bytes. The average size is %f bytes") % (
+ variables_count, total_size, average_size)
+ # not returning anything is akin to returning success
def __lldb_init_module(debugger, dict):
- # This initializer is being run from LLDB in the embedded command interpreter
-
- # Add any commands contained in this module to LLDB
- debugger.HandleCommand(
- 'command script add -c cmdtemplate.FrameStatCommand framestats')
- print 'The "framestats" command has been installed, type "help framestats" for detailed help.'
+ # Register all classes that have a register_lldb_command method
+ for _name, cls in inspect.getmembers(sys.modules[__name__]):
+ if inspect.isclass(cls) and callable(getattr(cls,
+ "register_lldb_command",
+ None)):
+ cls.register_lldb_command(debugger, __name__)
diff --git a/include/lldb/API/SBAddress.h b/include/lldb/API/SBAddress.h
index 9e697beffdd1..02e847b97aa1 100644
--- a/include/lldb/API/SBAddress.h
+++ b/include/lldb/API/SBAddress.h
@@ -54,9 +54,9 @@ public:
lldb::SBSymbolContext GetSymbolContext(uint32_t resolve_scope);
// The following functions grab individual objects for a given address and
- // are less efficient if you want more than one symbol related objects.
- // Use one of the following when you want multiple debug symbol related
- // objects for an address:
+ // are less efficient if you want more than one symbol related objects. Use
+ // one of the following when you want multiple debug symbol related objects
+ // for an address:
// lldb::SBSymbolContext SBAddress::GetSymbolContext (uint32_t
// resolve_scope);
// lldb::SBSymbolContext SBTarget::ResolveSymbolContextForAddress (const
@@ -80,8 +80,6 @@ public:
lldb::SBLineEntry GetLineEntry();
- lldb::AddressClass GetAddressClass();
-
protected:
friend class SBBlock;
friend class SBBreakpointLocation;
@@ -103,7 +101,7 @@ protected:
const lldb_private::Address *operator->() const;
- friend bool operator==(const SBAddress &lhs, const SBAddress &rhs);
+ friend bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
lldb_private::Address *get();
@@ -119,7 +117,7 @@ private:
std::unique_ptr<lldb_private::Address> m_opaque_ap;
};
-bool operator==(const SBAddress &lhs, const SBAddress &rhs);
+bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs);
} // namespace lldb
diff --git a/include/lldb/API/SBBroadcaster.h b/include/lldb/API/SBBroadcaster.h
index 3fc47af65513..dc6c50ec0a8a 100644
--- a/include/lldb/API/SBBroadcaster.h
+++ b/include/lldb/API/SBBroadcaster.h
@@ -46,17 +46,17 @@ public:
bool RemoveListener(const lldb::SBListener &listener,
uint32_t event_mask = UINT32_MAX);
- // This comparison is checking if the internal opaque pointer value
- // is equal to that in "rhs".
+ // This comparison is checking if the internal opaque pointer value is equal
+ // to that in "rhs".
bool operator==(const lldb::SBBroadcaster &rhs) const;
- // This comparison is checking if the internal opaque pointer value
- // is not equal to that in "rhs".
+ // This comparison is checking if the internal opaque pointer value is not
+ // equal to that in "rhs".
bool operator!=(const lldb::SBBroadcaster &rhs) const;
- // This comparison is checking if the internal opaque pointer value
- // is less than that in "rhs" so SBBroadcaster objects can be contained
- // in ordered containers.
+ // This comparison is checking if the internal opaque pointer value is less
+ // than that in "rhs" so SBBroadcaster objects can be contained in ordered
+ // containers.
bool operator<(const lldb::SBBroadcaster &rhs) const;
protected:
diff --git a/include/lldb/API/SBCommandInterpreter.h b/include/lldb/API/SBCommandInterpreter.h
index 80f24ceca7b4..8b9f06599366 100644
--- a/include/lldb/API/SBCommandInterpreter.h
+++ b/include/lldb/API/SBCommandInterpreter.h
@@ -138,23 +138,20 @@ public:
lldb::SBCommandReturnObject result);
// The pointer based interface is not useful in SWIG, since the cursor &
- // last_char arguments are string pointers INTO current_line
- // and you can't do that in a scripting language interface in general...
+ // last_char arguments are string pointers INTO current_line and you can't do
+ // that in a scripting language interface in general...
// In either case, the way this works is that the you give it a line and
- // cursor position in the line. The function
- // will return the number of completions. The matches list will contain
- // number_of_completions + 1 elements. The first
- // element is the common substring after the cursor position for all the
- // matches. The rest of the elements are the
- // matches. The first element is useful if you are emulating the common shell
- // behavior where the tab completes
- // to the string that is common among all the matches, then you should first
- // check if the first element is non-empty,
+ // cursor position in the line. The function will return the number of
+ // completions. The matches list will contain number_of_completions + 1
+ // elements. The first element is the common substring after the cursor
+ // position for all the matches. The rest of the elements are the matches.
+ // The first element is useful if you are emulating the common shell behavior
+ // where the tab completes to the string that is common among all the
+ // matches, then you should first check if the first element is non-empty,
// and if so just insert it and move the cursor to the end of the insertion.
- // The next tab will return an empty
- // common substring, and a list of choices (if any), at which point you should
- // display the choices and let the user
+ // The next tab will return an empty common substring, and a list of choices
+ // (if any), at which point you should display the choices and let the user
// type further to disambiguate.
int HandleCompletion(const char *current_line, const char *cursor,
@@ -167,9 +164,9 @@ public:
bool WasInterrupted() const;
- // Catch commands before they execute by registering a callback that will
- // get called when the command gets executed. This allows GUI or command
- // line interfaces to intercept a command and stop it from happening
+ // Catch commands before they execute by registering a callback that will get
+ // called when the command gets executed. This allows GUI or command line
+ // interfaces to intercept a command and stop it from happening
bool SetCommandOverrideCallback(const char *command_name,
lldb::CommandOverrideCallback callback,
void *baton);
@@ -211,6 +208,25 @@ public:
void SetPromptOnQuit(bool b);
//----------------------------------------------------------------------
+ /// Sets whether the command interpreter should allow custom exit codes
+ /// for the 'quit' command.
+ //----------------------------------------------------------------------
+ void AllowExitCodeOnQuit(bool allow);
+
+ //----------------------------------------------------------------------
+ /// Returns true if the user has called the 'quit' command with a custom exit
+ /// code.
+ //----------------------------------------------------------------------
+ bool HasCustomQuitExitCode();
+
+ //----------------------------------------------------------------------
+ /// Returns the exit code that the user has specified when running the
+ /// 'quit' command. Returns 0 if the user hasn't called 'quit' at all or
+ /// without a custom exit code.
+ //----------------------------------------------------------------------
+ int GetQuitStatus();
+
+ //----------------------------------------------------------------------
/// Resolve the command just as HandleCommand would, expanding abbreviations
/// and aliases. If successful, result->GetOutput has the full expansion.
//----------------------------------------------------------------------
diff --git a/include/lldb/API/SBCommandReturnObject.h b/include/lldb/API/SBCommandReturnObject.h
index c73e3f7cf1f2..a372ea2ad9ee 100644
--- a/include/lldb/API/SBCommandReturnObject.h
+++ b/include/lldb/API/SBCommandReturnObject.h
@@ -67,8 +67,7 @@ public:
bool GetDescription(lldb::SBStream &description);
- // deprecated, these two functions do not take
- // ownership of file handle
+ // deprecated, these two functions do not take ownership of file handle
void SetImmediateOutputFile(FILE *fh);
void SetImmediateErrorFile(FILE *fh);
diff --git a/include/lldb/API/SBData.h b/include/lldb/API/SBData.h
index 7aa4ea0ff8d0..7ff619e68667 100644
--- a/include/lldb/API/SBData.h
+++ b/include/lldb/API/SBData.h
@@ -71,11 +71,10 @@ public:
lldb::addr_t base_addr = LLDB_INVALID_ADDRESS);
// it would be nice to have SetData(SBError, const void*, size_t) when
- // endianness and address size can be
- // inferred from the existing DataExtractor, but having two SetData()
- // signatures triggers a SWIG bug where
- // the typemap isn't applied before resolving the overload, and thus the right
- // function never gets called
+ // endianness and address size can be inferred from the existing
+ // DataExtractor, but having two SetData() signatures triggers a SWIG bug
+ // where the typemap isn't applied before resolving the overload, and thus
+ // the right function never gets called
void SetData(lldb::SBError &error, const void *buf, size_t size,
lldb::ByteOrder endian, uint8_t addr_size);
@@ -87,9 +86,8 @@ public:
const char *data);
// in the following CreateData*() and SetData*() prototypes, the two
- // parameters array and array_len
- // should not be renamed or rearranged, because doing so will break the SWIG
- // typemap
+ // parameters array and array_len should not be renamed or rearranged,
+ // because doing so will break the SWIG typemap
static lldb::SBData CreateDataFromUInt64Array(lldb::ByteOrder endian,
uint32_t addr_byte_size,
uint64_t *array,
diff --git a/include/lldb/API/SBDebugger.h b/include/lldb/API/SBDebugger.h
index 8379a6911afc..a416b460f318 100644
--- a/include/lldb/API/SBDebugger.h
+++ b/include/lldb/API/SBDebugger.h
@@ -181,6 +181,8 @@ public:
static const char *StateAsCString(lldb::StateType state);
+ static SBStructuredData GetBuildConfiguration();
+
static bool StateIsRunningState(lldb::StateType state);
static bool StateIsStoppedState(lldb::StateType state);
diff --git a/include/lldb/API/SBExpressionOptions.h b/include/lldb/API/SBExpressionOptions.h
index 370811d0c355..1459ba6fee2a 100644
--- a/include/lldb/API/SBExpressionOptions.h
+++ b/include/lldb/API/SBExpressionOptions.h
@@ -51,10 +51,8 @@ public:
uint32_t GetOneThreadTimeoutInMicroSeconds() const;
// Set the timeout for running on one thread, 0 means use the default
- // behavior.
- // If you set this higher than the overall timeout, you'll get an error when
- // you
- // try to run the expression.
+ // behavior. If you set this higher than the overall timeout, you'll get an
+ // error when you try to run the expression.
void SetOneThreadTimeoutInMicroSeconds(uint32_t timeout = 0);
bool GetTryAllThreads() const;
diff --git a/include/lldb/API/SBFrame.h b/include/lldb/API/SBFrame.h
index 58339750def6..b8953dd13236 100644
--- a/include/lldb/API/SBFrame.h
+++ b/include/lldb/API/SBFrame.h
@@ -153,10 +153,10 @@ public:
lldb::DynamicValueType use_dynamic);
// Find a value for a variable expression path like "rect.origin.x" or
- // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_
- // and expression result and is not a constant object like
- // SBFrame::EvaluateExpression(...) returns, but a child object of
- // the variable value.
+ // "pt_ptr->x", "*self", "*this->obj_ptr". The returned value is _not_ and
+ // expression result and is not a constant object like
+ // SBFrame::EvaluateExpression(...) returns, but a child object of the
+ // variable value.
lldb::SBValue GetValueForVariablePath(const char *var_expr_cstr,
DynamicValueType use_dynamic);
diff --git a/include/lldb/API/SBInstruction.h b/include/lldb/API/SBInstruction.h
index 23daf1c56637..5ef02b8f696a 100644
--- a/include/lldb/API/SBInstruction.h
+++ b/include/lldb/API/SBInstruction.h
@@ -16,8 +16,7 @@
#include <stdio.h>
// There's a lot to be fixed here, but need to wait for underlying insn
-// implementation
-// to be revised & settle down first.
+// implementation to be revised & settle down first.
class InstructionImpl;
@@ -37,8 +36,6 @@ public:
SBAddress GetAddress();
- lldb::AddressClass GetAddressClass();
-
const char *GetMnemonic(lldb::SBTarget target);
const char *GetOperands(lldb::SBTarget target);
diff --git a/include/lldb/API/SBInstructionList.h b/include/lldb/API/SBInstructionList.h
index 0323a3c80c05..c8fed5c83192 100644
--- a/include/lldb/API/SBInstructionList.h
+++ b/include/lldb/API/SBInstructionList.h
@@ -33,8 +33,8 @@ public:
lldb::SBInstruction GetInstructionAtIndex(uint32_t idx);
// ----------------------------------------------------------------------
- // Returns the number of instructions between the start and end address.
- // If canSetBreakpoint is true then the count will be the number of
+ // Returns the number of instructions between the start and end address. If
+ // canSetBreakpoint is true then the count will be the number of
// instructions on which a breakpoint can be set.
// ----------------------------------------------------------------------
size_t GetInstructionsCount(const SBAddress &start,
diff --git a/include/lldb/API/SBLaunchInfo.h b/include/lldb/API/SBLaunchInfo.h
index 1cece235127f..80eea7e42921 100644
--- a/include/lldb/API/SBLaunchInfo.h
+++ b/include/lldb/API/SBLaunchInfo.h
@@ -12,6 +12,10 @@
#include "lldb/API/SBDefines.h"
+namespace lldb_private {
+class SBLaunchInfoImpl;
+}
+
namespace lldb {
class SBPlatform;
@@ -141,11 +145,10 @@ protected:
friend class SBPlatform;
friend class SBTarget;
- lldb_private::ProcessLaunchInfo &ref();
-
const lldb_private::ProcessLaunchInfo &ref() const;
+ void set_ref(const lldb_private::ProcessLaunchInfo &info);
- ProcessLaunchInfoSP m_opaque_sp;
+ std::shared_ptr<lldb_private::SBLaunchInfoImpl> m_opaque_sp;
};
} // namespace lldb
diff --git a/include/lldb/API/SBModule.h b/include/lldb/API/SBModule.h
index bcc3997a275b..d73267f8af50 100644
--- a/include/lldb/API/SBModule.h
+++ b/include/lldb/API/SBModule.h
@@ -129,6 +129,21 @@ public:
lldb::SBCompileUnit GetCompileUnitAtIndex(uint32_t);
+ //------------------------------------------------------------------
+ /// Find compile units related to *this module and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ lldb::SBSymbolContextList
+ FindCompileUnits(const lldb::SBFileSpec &sb_file_spec);
+
size_t GetNumSymbols();
lldb::SBSymbol GetSymbolAtIndex(size_t idx);
diff --git a/include/lldb/API/SBProcess.h b/include/lldb/API/SBProcess.h
index 2e8925941fb7..4ad24f63f076 100644
--- a/include/lldb/API/SBProcess.h
+++ b/include/lldb/API/SBProcess.h
@@ -98,10 +98,10 @@ public:
lldb::SBThread GetSelectedThread() const;
//------------------------------------------------------------------
- // Function for lazily creating a thread using the current OS
- // plug-in. This function will be removed in the future when there
- // are APIs to create SBThread objects through the interface and add
- // them to the process through the SBProcess API.
+ // Function for lazily creating a thread using the current OS plug-in. This
+ // function will be removed in the future when there are APIs to create
+ // SBThread objects through the interface and add them to the process through
+ // the SBProcess API.
//------------------------------------------------------------------
lldb::SBThread CreateOSPluginThread(lldb::tid_t tid, lldb::addr_t context);
@@ -313,6 +313,40 @@ public:
const lldb::SBFileSpec &remote_image_spec,
lldb::SBError &error);
+ //------------------------------------------------------------------
+ /// Load a shared library into this process, starting with a
+ /// library name and a list of paths, searching along the list of
+ /// paths till you find a matching library.
+ ///
+ /// @param[in] local_spec
+ /// The name of the shared library that you want to load.
+ /// If local_spec is a relative path, the relative path will be
+ /// appended to the search paths.
+ /// If the local_spec is an absolute path, just the basename is used.
+ ///
+ /// @param[in] paths
+ /// A list of paths to search for the library whose basename is
+ /// local_spec.
+ ///
+ /// @param[out] loaded_path
+ /// If the library was found along the paths, this will store the
+ /// full path to the found library.
+ ///
+ /// @param[out] error
+ /// An error object that gets filled in with any errors that
+ /// might occur when trying to search for the shared library.
+ ///
+ /// @return
+ /// A token that represents the shared library that can be
+ /// later passed to UnloadImage. A value of
+ /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
+ /// library can't be opened.
+ //------------------------------------------------------------------
+ uint32_t LoadImageUsingPaths(const lldb::SBFileSpec &image_spec,
+ SBStringList &paths,
+ lldb::SBFileSpec &loaded_path,
+ lldb::SBError &error);
+
lldb::SBError UnloadImage(uint32_t image_token);
lldb::SBError SendEventData(const char *data);
diff --git a/include/lldb/API/SBStream.h b/include/lldb/API/SBStream.h
index a75afc7ee375..7364ca7797f8 100644
--- a/include/lldb/API/SBStream.h
+++ b/include/lldb/API/SBStream.h
@@ -26,13 +26,12 @@ public:
bool IsValid() const;
- // If this stream is not redirected to a file, it will maintain a local
- // cache for the stream data which can be accessed using this accessor.
+ // If this stream is not redirected to a file, it will maintain a local cache
+ // for the stream data which can be accessed using this accessor.
const char *GetData();
- // If this stream is not redirected to a file, it will maintain a local
- // cache for the stream output whose length can be accessed using this
- // accessor.
+ // If this stream is not redirected to a file, it will maintain a local cache
+ // for the stream output whose length can be accessed using this accessor.
size_t GetSize();
void Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
@@ -44,8 +43,8 @@ public:
void RedirectToFileDescriptor(int fd, bool transfer_fh_ownership);
// If the stream is redirected to a file, forget about the file and if
- // ownership of the file was transferred to this object, close the file.
- // If the stream is backed by a local cache, clear this cache.
+ // ownership of the file was transferred to this object, close the file. If
+ // the stream is backed by a local cache, clear this cache.
void Clear();
protected:
diff --git a/include/lldb/API/SBStructuredData.h b/include/lldb/API/SBStructuredData.h
index f3baaf7c4801..ca8229a574df 100644
--- a/include/lldb/API/SBStructuredData.h
+++ b/include/lldb/API/SBStructuredData.h
@@ -99,6 +99,7 @@ public:
protected:
friend class SBTraceOptions;
friend class SBDebugger;
+ friend class SBTarget;
StructuredDataImplUP m_impl_up;
};
diff --git a/include/lldb/API/SBSymbol.h b/include/lldb/API/SBSymbol.h
index d17a4ccffe02..a29ac61d2912 100644
--- a/include/lldb/API/SBSymbol.h
+++ b/include/lldb/API/SBSymbol.h
@@ -55,8 +55,8 @@ public:
bool GetDescription(lldb::SBStream &description);
//----------------------------------------------------------------------
- // Returns true if the symbol is externally visible in the module that
- // it is defined in
+ // Returns true if the symbol is externally visible in the module that it is
+ // defined in
//----------------------------------------------------------------------
bool IsExternal();
diff --git a/include/lldb/API/SBTarget.h b/include/lldb/API/SBTarget.h
index 4085a16b43fb..8d99545902fe 100644
--- a/include/lldb/API/SBTarget.h
+++ b/include/lldb/API/SBTarget.h
@@ -75,6 +75,8 @@ public:
lldb::SBProcess GetProcess();
+ lldb::SBStructuredData GetStatistics();
+
//------------------------------------------------------------------
/// Return the platform object associated with the target.
///
@@ -163,6 +165,7 @@ public:
bool stop_at_entry, lldb::SBError &error);
SBProcess LoadCore(const char *core_file);
+ SBProcess LoadCore(const char *core_file, lldb::SBError &error);
//------------------------------------------------------------------
/// Launch a new process with sensible defaults.
@@ -289,6 +292,21 @@ public:
lldb::SBModule FindModule(const lldb::SBFileSpec &file_spec);
+ //------------------------------------------------------------------
+ /// Find compile units related to *this target and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ lldb::SBSymbolContextList
+ FindCompileUnits(const lldb::SBFileSpec &sb_file_spec);
+
lldb::ByteOrder GetByteOrder();
uint32_t GetAddressByteSize();
@@ -716,9 +734,9 @@ public:
// Finds all breakpoints by name, returning the list in bkpt_list. Returns
// false if the name is not a valid breakpoint name, true otherwise.
bool FindBreakpointsByName(const char *name, SBBreakpointList &bkpt_list);
-
+
void GetBreakpointNames(SBStringList &names);
-
+
void DeleteBreakpointName(const char *name);
bool EnableAllBreakpoints();
@@ -773,8 +791,7 @@ public:
const void *buf, size_t size);
// The "WithFlavor" is necessary to keep SWIG from getting confused about
- // overloaded arguments when
- // using the buf + size -> Python Object magic.
+ // overloaded arguments when using the buf + size -> Python Object magic.
lldb::SBInstructionList GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const char *flavor_string,
@@ -827,8 +844,8 @@ protected:
friend class SBValue;
//------------------------------------------------------------------
- // Constructors are private, use static Target::Create function to
- // create an instance of this class.
+ // Constructors are private, use static Target::Create function to create an
+ // instance of this class.
//------------------------------------------------------------------
lldb::TargetSP GetSP() const;
diff --git a/include/lldb/API/SBThread.h b/include/lldb/API/SBThread.h
index 7f1cf10cc456..afc05d2c61ad 100644
--- a/include/lldb/API/SBThread.h
+++ b/include/lldb/API/SBThread.h
@@ -93,6 +93,8 @@ public:
void StepOver(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+ void StepOver(lldb::RunMode stop_other_threads, SBError &error);
+
void StepInto(lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
void StepInto(const char *target_name,
@@ -103,10 +105,16 @@ public:
void StepOut();
- void StepOutOfFrame(lldb::SBFrame &frame);
+ void StepOut(SBError &error);
+
+ void StepOutOfFrame(SBFrame &frame);
+
+ void StepOutOfFrame(SBFrame &frame, SBError &error);
void StepInstruction(bool step_over);
+ void StepInstruction(bool step_over, SBError &error);
+
SBError StepOverUntil(lldb::SBFrame &frame, lldb::SBFileSpec &file_spec,
uint32_t line);
@@ -119,6 +127,8 @@ public:
void RunToAddress(lldb::addr_t addr);
+ void RunToAddress(lldb::addr_t addr, SBError &error);
+
SBError ReturnFromFrame(SBFrame &frame, SBValue &return_value);
SBError UnwindInnermostExpression();
@@ -146,8 +156,12 @@ public:
//--------------------------------------------------------------------------
bool Suspend();
+ bool Suspend(SBError &error);
+
bool Resume();
+ bool Resume(SBError &error);
+
bool IsSuspended();
bool IsStopped();
diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h
index 5ef8915b58f9..ab5bdfea993d 100644
--- a/include/lldb/API/SBValue.h
+++ b/include/lldb/API/SBValue.h
@@ -134,8 +134,7 @@ public:
lldb::SBType type);
// this has no address! GetAddress() and GetLoadAddress() as well as
- // AddressOf()
- // on the return of this call all return invalid
+ // AddressOf() on the return of this call all return invalid
lldb::SBValue CreateValueFromData(const char *name, lldb::SBData data,
lldb::SBType type);
diff --git a/include/lldb/API/SBValueList.h b/include/lldb/API/SBValueList.h
index 495b0140cad0..0242dd7f71a2 100644
--- a/include/lldb/API/SBValueList.h
+++ b/include/lldb/API/SBValueList.h
@@ -43,8 +43,8 @@ public:
const lldb::SBValueList &operator=(const lldb::SBValueList &rhs);
protected:
- // only useful for visualizing the pointer or comparing two SBValueLists
- // to see if they are backed by the same underlying Impl.
+ // only useful for visualizing the pointer or comparing two SBValueLists to
+ // see if they are backed by the same underlying Impl.
void *opaque_ptr();
private:
diff --git a/include/lldb/Breakpoint/Breakpoint.h b/include/lldb/Breakpoint/Breakpoint.h
index 9a798090a59f..ec4bc946280f 100644
--- a/include/lldb/Breakpoint/Breakpoint.h
+++ b/include/lldb/Breakpoint/Breakpoint.h
@@ -33,8 +33,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h"
-/// @brief Class that manages logical breakpoint setting.
+/// @class Breakpoint Breakpoint.h "lldb/Breakpoint/Breakpoint.h" Class that
+/// manages logical breakpoint setting.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -42,33 +42,28 @@ namespace lldb_private {
/// A breakpoint has four main parts, a filter, a resolver, the list of
/// breakpoint
/// locations that have been determined for the filter/resolver pair, and
-/// finally
-/// a set of options for the breakpoint.
+/// finally a set of options for the breakpoint.
///
/// \b Filter:
-/// This is an object derived from SearchFilter. It manages the search
-/// for breakpoint location matches through the symbols in the module list of
-/// the target
-/// that owns it. It also filters out locations based on whatever logic it
-/// wants.
+/// This is an object derived from SearchFilter. It manages the search for
+/// breakpoint location matches through the symbols in the module list of the
+/// target that owns it. It also filters out locations based on whatever
+/// logic it wants.
///
/// \b Resolver:
-/// This is an object derived from BreakpointResolver. It provides a
-/// callback to the filter that will find breakpoint locations. How it does
-/// this is
+/// This is an object derived from BreakpointResolver. It provides a callback
+/// to the filter that will find breakpoint locations. How it does this is
/// determined by what kind of resolver it is.
///
/// The Breakpoint class also provides constructors for the common breakpoint
-/// cases
-/// which make the appropriate filter and resolver for you.
+/// cases which make the appropriate filter and resolver for you.
///
/// \b Location List:
-/// This stores the breakpoint locations that have been determined
-/// to date. For a given breakpoint, there will be only one location with a
-/// given
-/// address. Adding a location at an already taken address will just return the
-/// location
-/// already at that address. Locations can be looked up by ID, or by address.
+/// This stores the breakpoint locations that have been determined to date.
+/// For a given breakpoint, there will be only one location with a given
+/// address. Adding a location at an already taken address will just return
+/// the location already at that address. Locations can be looked up by ID,
+/// or by address.
///
/// \b Options:
/// This includes:
@@ -77,25 +72,17 @@ namespace lldb_private {
/// \b Callback
/// \b Condition
/// Note, these options can be set on the breakpoint, and they can also be set
-/// on the
-/// individual locations. The options set on the breakpoint take precedence
-/// over the
-/// options set on the individual location.
-/// So for instance disabling the breakpoint will cause NONE of the locations to
-/// get hit.
-/// But if the breakpoint is enabled, then the location's enabled state will be
-/// checked
-/// to determine whether to insert that breakpoint location.
+/// on the individual locations. The options set on the breakpoint take
+/// precedence over the options set on the individual location. So for
+/// instance disabling the breakpoint will cause NONE of the locations to get
+/// hit. But if the breakpoint is enabled, then the location's enabled state
+/// will be checked to determine whether to insert that breakpoint location.
/// Similarly, if the breakpoint condition says "stop", we won't check the
-/// location's condition.
-/// But if the breakpoint condition says "continue", then we will check the
-/// location for whether
-/// to actually stop or not.
-/// One subtle point worth observing here is that you don't actually stop at a
-/// Breakpoint, you
-/// always stop at one of its locations. So the "should stop" tests are done by
-/// the location,
-/// not by the breakpoint.
+/// location's condition. But if the breakpoint condition says "continue",
+/// then we will check the location for whether to actually stop or not. One
+/// subtle point worth observing here is that you don't actually stop at a
+/// Breakpoint, you always stop at one of its locations. So the "should stop"
+/// tests are done by the location, not by the breakpoint.
//----------------------------------------------------------------------
class Breakpoint : public std::enable_shared_from_this<Breakpoint>,
public Stoppoint {
@@ -103,8 +90,8 @@ public:
static const ConstString &GetEventIdentifier();
//------------------------------------------------------------------
- /// An enum specifying the match style for breakpoint settings. At
- /// present only used for function name style breakpoints.
+ /// An enum specifying the match style for breakpoint settings. At present
+ /// only used for function name style breakpoints.
//------------------------------------------------------------------
typedef enum { Exact, Regexp, Glob } MatchType;
@@ -191,9 +178,9 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is not virtual since there should be no reason to subclass
- /// breakpoints. The varieties of breakpoints are specified instead by
- /// providing different resolvers & filters.
+ /// The destructor is not virtual since there should be no reason to
+ /// subclass breakpoints. The varieties of breakpoints are specified
+ /// instead by providing different resolvers & filters.
//------------------------------------------------------------------
~Breakpoint() override;
@@ -202,8 +189,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Tell whether this breakpoint is an "internal" breakpoint.
- /// @return
+ /// Tell whether this breakpoint is an "internal" breakpoint. @return
/// Returns \b true if this is an internal breakpoint, \b false otherwise.
//------------------------------------------------------------------
bool IsInternal() const;
@@ -214,13 +200,13 @@ public:
void Dump(Stream *s) override;
//------------------------------------------------------------------
- // The next set of methods provide ways to tell the breakpoint to update
- // it's location list - usually done when modules appear or disappear.
+ // The next set of methods provide ways to tell the breakpoint to update it's
+ // location list - usually done when modules appear or disappear.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Tell this breakpoint to clear all its breakpoint sites. Done
- /// when the process holding the breakpoint sites is destroyed.
+ /// Tell this breakpoint to clear all its breakpoint sites. Done when the
+ /// process holding the breakpoint sites is destroyed.
//------------------------------------------------------------------
void ClearAllBreakpointSites();
@@ -231,8 +217,8 @@ public:
void ResolveBreakpoint();
//------------------------------------------------------------------
- /// Tell this breakpoint to scan a given module list and resolve any
- /// new locations that match the breakpoint's specifications.
+ /// Tell this breakpoint to scan a given module list and resolve any new
+ /// locations that match the breakpoint's specifications.
///
/// @param[in] module_list
/// The list of modules to look in for new locations.
@@ -245,8 +231,8 @@ public:
bool send_event = true);
//------------------------------------------------------------------
- /// Tell this breakpoint to scan a given module list and resolve any
- /// new locations that match the breakpoint's specifications.
+ /// Tell this breakpoint to scan a given module list and resolve any new
+ /// locations that match the breakpoint's specifications.
///
/// @param[in] changed_modules
/// The list of modules to look in for new locations.
@@ -274,9 +260,9 @@ public:
bool delete_locations = false);
//------------------------------------------------------------------
- /// Tells the breakpoint the old module \a old_module_sp has been
- /// replaced by new_module_sp (usually because the underlying file has been
- /// rebuilt, and the old version is gone.)
+ /// Tells the breakpoint the old module \a old_module_sp has been replaced
+ /// by new_module_sp (usually because the underlying file has been rebuilt,
+ /// and the old version is gone.)
///
/// @param[in] old_module_sp
/// The old module that is going away.
@@ -287,13 +273,13 @@ public:
lldb::ModuleSP new_module_sp);
//------------------------------------------------------------------
- // The next set of methods provide access to the breakpoint locations
- // for this breakpoint.
+ // The next set of methods provide access to the breakpoint locations for
+ // this breakpoint.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Add a location to the breakpoint's location list. This is only meant
- /// to be called by the breakpoint's resolver. FIXME: how do I ensure that?
+ /// Add a location to the breakpoint's location list. This is only meant to
+ /// be called by the breakpoint's resolver. FIXME: how do I ensure that?
///
/// @param[in] addr
/// The Address specifying the new location.
@@ -359,12 +345,12 @@ public:
/// Removes all invalid breakpoint locations.
///
/// Removes all breakpoint locations with architectures that aren't
- /// compatible with \a arch. Also remove any breakpoint locations
- /// with whose locations have address where the section has been
- /// deleted (module and object files no longer exist).
+ /// compatible with \a arch. Also remove any breakpoint locations with whose
+ /// locations have address where the section has been deleted (module and
+ /// object files no longer exist).
///
- /// This is typically used after the process calls exec, or anytime
- /// the architecture of the target changes.
+ /// This is typically used after the process calls exec, or anytime the
+ /// architecture of the target changes.
///
/// @param[in] arch
/// If valid, check the module in each breakpoint to make sure
@@ -403,8 +389,7 @@ public:
uint32_t GetIgnoreCount() const;
//------------------------------------------------------------------
- /// Return the current hit count for all locations.
- /// @return
+ /// Return the current hit count for all locations. @return
/// The current hit count for all locations.
//------------------------------------------------------------------
uint32_t GetHitCount() const;
@@ -422,7 +407,8 @@ public:
bool IsOneShot() const;
//------------------------------------------------------------------
- /// If \a auto_continue is \b true, breakpoint will auto-continue when on hit.
+ /// If \a auto_continue is \b true, breakpoint will auto-continue when on
+ /// hit.
//------------------------------------------------------------------
void SetAutoContinue(bool auto_continue);
@@ -508,8 +494,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Return the number of breakpoint locations that have resolved to
- /// actual breakpoint sites.
+ /// Return the number of breakpoint locations that have resolved to actual
+ /// breakpoint sites.
///
/// @return
/// The number locations resolved breakpoint sites.
@@ -541,10 +527,9 @@ public:
//------------------------------------------------------------------
/// Set the "kind" description for a breakpoint. If the breakpoint is hit
- /// the stop info will show this "kind" description instead of the breakpoint
- /// number. Mostly useful for internal breakpoints, where the breakpoint
- /// number
- /// doesn't have meaning to the user.
+ /// the stop info will show this "kind" description instead of the
+ /// breakpoint number. Mostly useful for internal breakpoints, where the
+ /// breakpoint number doesn't have meaning to the user.
///
/// @param[in] kind
/// New "kind" description.
@@ -574,10 +559,9 @@ public:
//------------------------------------------------------------------
/// Find breakpoint locations which match the (filename, line_number)
- /// description.
- /// The breakpoint location collection is to be filled with the matching
- /// locations.
- /// It should be initialized with 0 size by the API client.
+ /// description. The breakpoint location collection is to be filled with the
+ /// matching locations. It should be initialized with 0 size by the API
+ /// client.
///
/// @return
/// True if there is a match
@@ -661,13 +645,12 @@ public:
/// Set a pre-condition filter that overrides all user provided
/// filters/callbacks etc.
///
- /// Used to define fancy breakpoints that can do dynamic hit detection without
- /// taking up the condition slot -
- /// which really belongs to the user anyway...
+ /// Used to define fancy breakpoints that can do dynamic hit detection
+ /// without taking up the condition slot - which really belongs to the user
+ /// anyway...
///
- /// The Precondition should not continue the target, it should return true if
- /// the condition says to stop and
- /// false otherwise.
+ /// The Precondition should not continue the target, it should return true
+ /// if the condition says to stop and false otherwise.
///
//------------------------------------------------------------------
void SetPrecondition(BreakpointPreconditionSP precondition_sp) {
@@ -706,10 +689,9 @@ protected:
//------------------------------------------------------------------
/// Constructors and Destructors
/// Only the Target can make a breakpoint, and it owns the breakpoint
- /// lifespans.
- /// The constructor takes a filter and a resolver. Up in Target there are
- /// convenience
- /// variants that make breakpoints for some common cases.
+ /// lifespans. The constructor takes a filter and a resolver. Up in Target
+ /// there are convenience variants that make breakpoints for some common
+ /// cases.
///
/// @param[in] target
/// The target in which the breakpoint will be set.
@@ -744,10 +726,10 @@ protected:
void DecrementIgnoreCount();
// BreakpointLocation::IgnoreCountShouldStop &
- // Breakpoint::IgnoreCountShouldStop can only be called once per stop,
- // and BreakpointLocation::IgnoreCountShouldStop should be tested first, and
- // if it returns false we should
- // continue, otherwise we should test Breakpoint::IgnoreCountShouldStop.
+ // Breakpoint::IgnoreCountShouldStop can only be called once per stop, and
+ // BreakpointLocation::IgnoreCountShouldStop should be tested first, and if
+ // it returns false we should continue, otherwise we should test
+ // Breakpoint::IgnoreCountShouldStop.
bool IgnoreCountShouldStop();
@@ -760,8 +742,7 @@ protected:
private:
// This one should only be used by Target to copy breakpoints from target to
- // target - primarily from the dummy
- // target to prime new targets.
+ // target - primarily from the dummy target to prime new targets.
Breakpoint(Target &new_target, Breakpoint &bp_to_copy_from);
//------------------------------------------------------------------
@@ -782,9 +763,9 @@ private:
BreakpointPreconditionSP m_precondition_sp; // The precondition is a
// breakpoint-level hit filter
// that can be used
- // to skip certain breakpoint hits. For instance, exception breakpoints
- // use this to limit the stop to certain exception classes, while leaving
- // the condition & callback free for user specification.
+ // to skip certain breakpoint hits. For instance, exception breakpoints use
+ // this to limit the stop to certain exception classes, while leaving the
+ // condition & callback free for user specification.
std::unique_ptr<BreakpointOptions>
m_options_up; // Settable breakpoint options
BreakpointLocationList
diff --git a/include/lldb/Breakpoint/BreakpointID.h b/include/lldb/Breakpoint/BreakpointID.h
index 57411b316317..bbad45ca2d8b 100644
--- a/include/lldb/Breakpoint/BreakpointID.h
+++ b/include/lldb/Breakpoint/BreakpointID.h
@@ -57,7 +57,7 @@ public:
//------------------------------------------------------------------
/// Takes an input string containing the description of a breakpoint or
- /// breakpoint and location and returns the a BreakpointID filled out with
+ /// breakpoint and location and returns a BreakpointID filled out with
/// the proper id and location.
///
/// @param[in] input
diff --git a/include/lldb/Breakpoint/BreakpointIDList.h b/include/lldb/Breakpoint/BreakpointIDList.h
index 5877b6c551ad..ec305583e8d9 100644
--- a/include/lldb/Breakpoint/BreakpointIDList.h
+++ b/include/lldb/Breakpoint/BreakpointIDList.h
@@ -55,7 +55,7 @@ public:
bool FindBreakpointID(const char *bp_id, size_t *position) const;
- void InsertStringArray(const char **string_array, size_t array_size,
+ void InsertStringArray(llvm::ArrayRef<const char *> string_array,
CommandReturnObject &result);
// Returns a pair consisting of the beginning and end of a breakpoint
diff --git a/include/lldb/Breakpoint/BreakpointList.h b/include/lldb/Breakpoint/BreakpointList.h
index 9f38f8aa120d..f4c013d41cc2 100644
--- a/include/lldb/Breakpoint/BreakpointList.h
+++ b/include/lldb/Breakpoint/BreakpointList.h
@@ -23,7 +23,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointList BreakpointList.h "lldb/Breakpoint/BreakpointList.h"
-/// @brief This class manages a list of breakpoints.
+/// This class manages a list of breakpoints.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -91,7 +91,8 @@ public:
lldb::BreakpointSP GetBreakpointAtIndex(size_t i);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint with index \a i, const version
+ /// Returns a shared pointer to the breakpoint with index \a i, const
+ /// version
///
/// @param[in] i
/// The breakpoint index to seek for.
@@ -138,13 +139,13 @@ public:
//------------------------------------------------------------------
/// Removes all invalid breakpoint locations.
///
- /// Removes all breakpoint locations in the list with architectures
- /// that aren't compatible with \a arch. Also remove any breakpoint
- /// locations with whose locations have address where the section
- /// has been deleted (module and object files no longer exist).
+ /// Removes all breakpoint locations in the list with architectures that
+ /// aren't compatible with \a arch. Also remove any breakpoint locations
+ /// with whose locations have address where the section has been deleted
+ /// (module and object files no longer exist).
///
- /// This is typically used after the process calls exec, or anytime
- /// the architecture of the target changes.
+ /// This is typically used after the process calls exec, or anytime the
+ /// architecture of the target changes.
///
/// @param[in] arch
/// If valid, check the module in each breakpoint to make sure
@@ -163,8 +164,8 @@ public:
//------------------------------------------------------------------
/// Removes all the breakpoints from this list - first checking the
- /// ePermDelete on the breakpoints. This call should be used unless you
- /// are shutting down and need to actually clear them all.
+ /// ePermDelete on the breakpoints. This call should be used unless you are
+ /// shutting down and need to actually clear them all.
//------------------------------------------------------------------
void RemoveAllowed(bool notify);
diff --git a/include/lldb/Breakpoint/BreakpointLocation.h b/include/lldb/Breakpoint/BreakpointLocation.h
index b68a9ffad04c..c5911085e61b 100644
--- a/include/lldb/Breakpoint/BreakpointLocation.h
+++ b/include/lldb/Breakpoint/BreakpointLocation.h
@@ -27,22 +27,20 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointLocation BreakpointLocation.h
-/// "lldb/Breakpoint/BreakpointLocation.h"
-/// @brief Class that manages one unique (by address) instance of a logical
-/// breakpoint.
+/// "lldb/Breakpoint/BreakpointLocation.h" Class that manages one unique (by
+/// address) instance of a logical breakpoint.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
/// A breakpoint location is defined by the breakpoint that produces it,
-/// and the address that resulted in this particular instantiation.
-/// Each breakpoint location also may have a breakpoint site if its
-/// address has been loaded into the program.
-/// Finally it has a settable options object.
+/// and the address that resulted in this particular instantiation. Each
+/// breakpoint location also may have a breakpoint site if its address has
+/// been loaded into the program. Finally it has a settable options object.
///
/// FIXME: Should we also store some fingerprint for the location, so
-/// we can map one location to the "equivalent location" on rerun? This
-/// would be useful if you've set options on the locations.
+/// we can map one location to the "equivalent location" on rerun? This would
+/// be useful if you've set options on the locations.
//----------------------------------------------------------------------
class BreakpointLocation
@@ -52,22 +50,19 @@ public:
~BreakpointLocation() override;
//------------------------------------------------------------------
- /// Gets the load address for this breakpoint location
- /// @return
+ /// Gets the load address for this breakpoint location @return
/// Returns breakpoint location load address, \b
/// LLDB_INVALID_ADDRESS if not yet set.
//------------------------------------------------------------------
lldb::addr_t GetLoadAddress() const override;
//------------------------------------------------------------------
- /// Gets the Address for this breakpoint location
- /// @return
+ /// Gets the Address for this breakpoint location @return
/// Returns breakpoint location Address.
//------------------------------------------------------------------
Address &GetAddress();
//------------------------------------------------------------------
- /// Gets the Breakpoint that created this breakpoint location
- /// @return
+ /// Gets the Breakpoint that created this breakpoint location @return
/// Returns the owning breakpoint.
//------------------------------------------------------------------
Breakpoint &GetBreakpoint();
@@ -75,12 +70,11 @@ public:
Target &GetTarget();
//------------------------------------------------------------------
- /// Determines whether we should stop due to a hit at this
- /// breakpoint location.
+ /// Determines whether we should stop due to a hit at this breakpoint
+ /// location.
///
- /// Side Effects: This may evaluate the breakpoint condition, and
- /// run the callback. So this command may do a considerable amount
- /// of work.
+ /// Side Effects: This may evaluate the breakpoint condition, and run the
+ /// callback. So this command may do a considerable amount of work.
///
/// @return
/// \b true if this breakpoint location thinks we should stop,
@@ -93,8 +87,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// If \a enable is \b true, enable the breakpoint, if \b false
- /// disable it.
+ /// If \a enable is \b true, enable the breakpoint, if \b false disable it.
//------------------------------------------------------------------
void SetEnabled(bool enabled);
@@ -138,8 +131,8 @@ public:
//------------------------------------------------------------------
/// Set the callback action invoked when the breakpoint is hit.
///
- /// The callback will return a bool indicating whether the target
- /// should stop at this breakpoint or not.
+ /// The callback will return a bool indicating whether the target should
+ /// stop at this breakpoint or not.
///
/// @param[in] callback
/// The method that will get called when the breakpoint is hit.
@@ -213,8 +206,8 @@ public:
bool ResolveBreakpointSite();
//------------------------------------------------------------------
- /// Clear this breakpoint location's breakpoint site - for instance
- /// when disabling the breakpoint.
+ /// Clear this breakpoint location's breakpoint site - for instance when
+ /// disabling the breakpoint.
///
/// @return
/// \b true if there was a breakpoint site to be cleared, \b false
@@ -223,8 +216,7 @@ public:
bool ClearBreakpointSite();
//------------------------------------------------------------------
- /// Return whether this breakpoint location has a breakpoint site.
- /// @return
+ /// Return whether this breakpoint location has a breakpoint site. @return
/// \b true if there was a breakpoint site for this breakpoint
/// location, \b false otherwise.
//------------------------------------------------------------------
@@ -237,8 +229,7 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Print a description of this breakpoint location to the stream
- /// \a s.
+ /// Print a description of this breakpoint location to the stream \a s.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -259,8 +250,8 @@ public:
//------------------------------------------------------------------
/// Use this to set location specific breakpoint options.
///
- /// It will create a copy of the containing breakpoint's options if
- /// that hasn't been done already
+ /// It will create a copy of the containing breakpoint's options if that
+ /// hasn't been done already
///
/// @return
/// A pointer to the breakpoint options.
@@ -302,8 +293,7 @@ public:
//------------------------------------------------------------------
/// Returns whether we should resolve Indirect functions in setting the
- /// breakpoint site
- /// for this location.
+ /// breakpoint site for this location.
///
/// @return
/// \b true if the breakpoint SITE for this location should be set on the
@@ -315,8 +305,7 @@ public:
//------------------------------------------------------------------
/// Returns whether the address set in the breakpoint site for this location
- /// was found by resolving
- /// an indirect symbol.
+ /// was found by resolving an indirect symbol.
///
/// @return
/// \b true or \b false as given in the description above.
@@ -327,8 +316,7 @@ public:
//------------------------------------------------------------------
/// Returns whether the address set in the breakpoint location was re-routed
- /// to the target of a
- /// re-exported symbol.
+ /// to the target of a re-exported symbol.
///
/// @return
/// \b true or \b false as given in the description above.
@@ -339,10 +327,8 @@ public:
//------------------------------------------------------------------
/// Returns whether the two breakpoint locations might represent "equivalent
- /// locations".
- /// This is used when modules changed to determine if a Location in the old
- /// module might
- /// be the "same as" the input location.
+ /// locations". This is used when modules changed to determine if a Location
+ /// in the old module might be the "same as" the input location.
///
/// @param[in] location
/// The location to compare against.
@@ -384,8 +370,7 @@ private:
//------------------------------------------------------------------
// Constructors and Destructors
//
- // Only the Breakpoint can make breakpoint locations, and it owns
- // them.
+ // Only the Breakpoint can make breakpoint locations, and it owns them.
//------------------------------------------------------------------
//------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointLocationCollection.h b/include/lldb/Breakpoint/BreakpointLocationCollection.h
index 4b2d9d4b344d..579d468647f3 100644
--- a/include/lldb/Breakpoint/BreakpointLocationCollection.h
+++ b/include/lldb/Breakpoint/BreakpointLocationCollection.h
@@ -178,8 +178,8 @@ public:
protected:
//------------------------------------------------------------------
- // Classes that inherit from BreakpointLocationCollection can see
- // and modify these
+ // Classes that inherit from BreakpointLocationCollection can see and modify
+ // these
//------------------------------------------------------------------
private:
diff --git a/include/lldb/Breakpoint/BreakpointLocationList.h b/include/lldb/Breakpoint/BreakpointLocationList.h
index 46eb2612bbe8..4e61abb2838e 100644
--- a/include/lldb/Breakpoint/BreakpointLocationList.h
+++ b/include/lldb/Breakpoint/BreakpointLocationList.h
@@ -26,21 +26,16 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointLocationList BreakpointLocationList.h
-/// "lldb/Breakpoint/BreakpointLocationList.h"
-/// @brief This class is used by Breakpoint to manage a list of breakpoint
-/// locations,
-// each breakpoint location in the list
-/// has a unique ID, and is unique by Address as well.
+/// "lldb/Breakpoint/BreakpointLocationList.h" This class is used by
+/// Breakpoint to manage a list of breakpoint locations, each breakpoint
+/// location in the list has a unique ID, and is unique by Address as well.
//----------------------------------------------------------------------
-
class BreakpointLocationList {
- // Only Breakpoints can make the location list, or add elements to it.
- // This is not just some random collection of locations. Rather, the act of
- // adding the location
- // to this list sets its ID, and implicitly all the locations have the same
- // breakpoint ID as
- // well. If you need a generic container for breakpoint locations, use
- // BreakpointLocationCollection.
+ // Only Breakpoints can make the location list, or add elements to it. This
+ // is not just some random collection of locations. Rather, the act of
+ // adding the location to this list sets its ID, and implicitly all the
+ // locations have the same breakpoint ID as well. If you need a generic
+ // container for breakpoint locations, use BreakpointLocationCollection.
friend class Breakpoint;
public:
@@ -52,8 +47,8 @@ public:
void Dump(Stream *s) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location at address
- /// \a addr - const version.
+ /// Returns a shared pointer to the breakpoint location at address \a addr -
+ /// const version.
///
/// @param[in] addr
/// The address to look for.
@@ -65,8 +60,8 @@ public:
const lldb::BreakpointLocationSP FindByAddress(const Address &addr) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with id
- /// \a breakID, const version.
+ /// Returns a shared pointer to the breakpoint location with id \a breakID,
+ /// const version.
///
/// @param[in] breakID
/// The breakpoint location ID to seek for.
@@ -78,8 +73,8 @@ public:
lldb::BreakpointLocationSP FindByID(lldb::break_id_t breakID) const;
//------------------------------------------------------------------
- /// Returns the breakpoint location id to the breakpoint location
- /// at address \a addr.
+ /// Returns the breakpoint location id to the breakpoint location at address
+ /// \a addr.
///
/// @param[in] addr
/// The address to match.
@@ -90,9 +85,8 @@ public:
lldb::break_id_t FindIDByAddress(const Address &addr);
//------------------------------------------------------------------
- /// Returns a breakpoint location list of the breakpoint locations
- /// in the module \a module. This list is allocated, and owned by
- /// the caller.
+ /// Returns a breakpoint location list of the breakpoint locations in the
+ /// module \a module. This list is allocated, and owned by the caller.
///
/// @param[in] module
/// The module to seek in.
@@ -108,8 +102,7 @@ public:
BreakpointLocationCollection &bp_loc_list);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with
- /// index \a i.
+ /// Returns a shared pointer to the breakpoint location with index \a i.
///
/// @param[in] i
/// The breakpoint location index to seek for.
@@ -121,8 +114,8 @@ public:
lldb::BreakpointLocationSP GetByIndex(size_t i);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint location with index
- /// \a i, const version.
+ /// Returns a shared pointer to the breakpoint location with index \a i,
+ /// const version.
///
/// @param[in] i
/// The breakpoint location index to seek for.
@@ -134,20 +127,20 @@ public:
const lldb::BreakpointLocationSP GetByIndex(size_t i) const;
//------------------------------------------------------------------
- /// Removes all the locations in this list from their breakpoint site
- /// owners list.
+ /// Removes all the locations in this list from their breakpoint site owners
+ /// list.
//------------------------------------------------------------------
void ClearAllBreakpointSites();
//------------------------------------------------------------------
- /// Tells all the breakpoint locations in this list to attempt to
- /// resolve any possible breakpoint sites.
+ /// Tells all the breakpoint locations in this list to attempt to resolve
+ /// any possible breakpoint sites.
//------------------------------------------------------------------
void ResolveAllBreakpointSites();
//------------------------------------------------------------------
- /// Returns the number of breakpoint locations in this list with
- /// resolved breakpoints.
+ /// Returns the number of breakpoint locations in this list with resolved
+ /// breakpoints.
///
/// @result
/// Number of qualifying breakpoint locations.
@@ -163,8 +156,8 @@ public:
uint32_t GetHitCount() const;
//------------------------------------------------------------------
- /// Enquires of the breakpoint location in this list with ID \a
- /// breakID whether we should stop.
+ /// Enquires of the breakpoint location in this list with ID \a breakID
+ /// whether we should stop.
///
/// @param[in] context
/// This contains the information about this stop.
@@ -186,8 +179,8 @@ public:
size_t GetSize() const { return m_locations.size(); }
//------------------------------------------------------------------
- /// Print a description of the breakpoint locations in this list to
- /// the stream \a s.
+ /// Print a description of the breakpoint locations in this list to the
+ /// stream \a s.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -204,9 +197,9 @@ protected:
//------------------------------------------------------------------
/// This is the standard constructor.
///
- /// It creates an empty breakpoint location list. It is protected
- /// here because only Breakpoints are allowed to create the
- /// breakpoint location list.
+ /// It creates an empty breakpoint location list. It is protected here
+ /// because only Breakpoints are allowed to create the breakpoint location
+ /// list.
//------------------------------------------------------------------
BreakpointLocationList(Breakpoint &owner);
@@ -235,6 +228,8 @@ protected:
lldb::BreakpointLocationSP from_location_sp);
bool RemoveLocation(const lldb::BreakpointLocationSP &bp_loc_sp);
+
+ void RemoveLocationByIndex(size_t idx);
void RemoveInvalidLocations(const ArchSpec &arch);
diff --git a/include/lldb/Breakpoint/BreakpointName.h b/include/lldb/Breakpoint/BreakpointName.h
index 1cfa141011a0..292a0de4f48b 100644
--- a/include/lldb/Breakpoint/BreakpointName.h
+++ b/include/lldb/Breakpoint/BreakpointName.h
@@ -80,8 +80,8 @@ public:
*this = Permissions();
}
- // Merge the permissions from incoming into this set of permissions.
- // Only merge set permissions, and most restrictive permission wins.
+ // Merge the permissions from incoming into this set of permissions. Only
+ // merge set permissions, and most restrictive permission wins.
void MergeInto(const Permissions &incoming)
{
MergePermission(incoming, listPerm);
diff --git a/include/lldb/Breakpoint/BreakpointOptions.h b/include/lldb/Breakpoint/BreakpointOptions.h
index 0229d52df471..84821817f980 100644
--- a/include/lldb/Breakpoint/BreakpointOptions.h
+++ b/include/lldb/Breakpoint/BreakpointOptions.h
@@ -27,9 +27,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointOptions BreakpointOptions.h
-/// "lldb/Breakpoint/BreakpointOptions.h"
-/// @brief Class that manages the options on a breakpoint or breakpoint
-/// location.
+/// "lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a
+/// breakpoint or breakpoint location.
//----------------------------------------------------------------------
class BreakpointOptions {
@@ -106,9 +105,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// This constructor allows you to specify all the breakpoint options
- /// except the callback. That one is more complicated, and better
- /// to do by hand.
+ /// This constructor allows you to specify all the breakpoint options except
+ /// the callback. That one is more complicated, and better to do by hand.
///
/// @param[in] condition
/// The expression which if it evaluates to \b true if we are to stop
@@ -125,8 +123,8 @@ public:
bool auto_continue = false);
//------------------------------------------------------------------
- /// Breakpoints make options with all flags set. Locations and Names make options
- /// with no flags set.
+ /// Breakpoints make options with all flags set. Locations and Names make
+ /// options with no flags set.
//------------------------------------------------------------------
BreakpointOptions(bool all_flags_set);
BreakpointOptions(const BreakpointOptions &rhs);
@@ -156,18 +154,16 @@ public:
// Callbacks
//
// Breakpoint callbacks come in two forms, synchronous and asynchronous.
- // Synchronous callbacks will get
- // run before any of the thread plans are consulted, and if they return false
- // the target will continue
- // "under the radar" of the thread plans. There are a couple of restrictions
- // to synchronous callbacks:
- // 1) They should NOT resume the target themselves. Just return false if you
- // want the target to restart.
- // 2) Breakpoints with synchronous callbacks can't have conditions (or rather,
- // they can have them, but they
- // won't do anything. Ditto with ignore counts, etc... You are supposed
- // to control that all through the
- // callback.
+ // Synchronous callbacks will get run before any of the thread plans are
+ // consulted, and if they return false the target will continue "under the
+ // radar" of the thread plans. There are a couple of restrictions to
+ // synchronous callbacks:
+ // 1) They should NOT resume the target themselves.
+ // Just return false if you want the target to restart.
+ // 2) Breakpoints with synchronous callbacks can't have conditions
+ // (or rather, they can have them, but they won't do anything.
+ // Ditto with ignore counts, etc... You are supposed to control that all
+ // through the callback.
// Asynchronous callbacks get run as part of the "ShouldStop" logic in the
// thread plan. The logic there is:
// a) If the breakpoint is thread specific and not for this thread, continue
@@ -181,12 +177,10 @@ public:
// b) If the ignore count says we shouldn't stop, then ditto.
// c) If the condition says we shouldn't stop, then ditto.
// d) Otherwise, the callback will get run, and if it returns true we will
- // stop, and if false we won't.
+ // stop, and if false we won't.
// The asynchronous callback can run the target itself, but at present that
- // should be the last action the
- // callback does. We will relax this condition at some point, but it will
- // take a bit of plumbing to get
- // that to work.
+ // should be the last action the callback does. We will relax this condition
+ // at some point, but it will take a bit of plumbing to get that to work.
//
//------------------------------------------------------------------
@@ -227,8 +221,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
- // The rest of these functions are meant to be used only within the breakpoint
- // handling mechanism.
+ // The rest of these functions are meant to be used only within the
+ // breakpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.
@@ -367,8 +361,7 @@ public:
//------------------------------------------------------------------
/// Return the current thread spec for this option. This will return nullptr
- /// if the no thread
- /// specifications have been set for this Option yet.
+ /// if the no thread specifications have been set for this Option yet.
/// @return
/// The thread specification pointer for this option, or nullptr if none
/// has
@@ -377,8 +370,8 @@ public:
const ThreadSpec *GetThreadSpecNoCreate() const;
//------------------------------------------------------------------
- /// Returns a pointer to the ThreadSpec for this option, creating it.
- /// if it hasn't been created already. This API is used for setting the
+ /// Returns a pointer to the ThreadSpec for this option, creating it. if it
+ /// hasn't been created already. This API is used for setting the
/// ThreadSpec items for this option.
//------------------------------------------------------------------
ThreadSpec *GetThreadSpec();
@@ -400,8 +393,8 @@ public:
lldb::user_id_t break_loc_id);
//------------------------------------------------------------------
- /// Set a callback based on BreakpointOptions::CommandData.
- /// @param[in] cmd_data
+ /// Set a callback based on BreakpointOptions::CommandData. @param[in]
+ /// cmd_data
/// A UP holding the new'ed CommandData object.
/// The breakpoint will take ownership of pointer held by this object.
//------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointResolver.h b/include/lldb/Breakpoint/BreakpointResolver.h
index 7bcd889ce78b..944741308da6 100644
--- a/include/lldb/Breakpoint/BreakpointResolver.h
+++ b/include/lldb/Breakpoint/BreakpointResolver.h
@@ -26,24 +26,19 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolver BreakpointResolver.h
-/// "lldb/Breakpoint/BreakpointResolver.h"
-/// @brief This class works with SearchFilter to resolve logical breakpoints to
-/// their
-/// of concrete breakpoint locations.
+/// "lldb/Breakpoint/BreakpointResolver.h" This class works with SearchFilter
+/// to resolve logical breakpoints to their of concrete breakpoint locations.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
-/// The BreakpointResolver is a Searcher. In that protocol,
-/// the SearchFilter asks the question "At what depth of the symbol context
-/// descent do you want your callback to get called?" of the filter. The
-/// resolver
-/// answers this question (in the GetDepth method) and provides the resolution
-/// callback.
+/// The BreakpointResolver is a Searcher. In that protocol, the SearchFilter
+/// asks the question "At what depth of the symbol context descent do you want
+/// your callback to get called?" of the filter. The resolver answers this
+/// question (in the GetDepth method) and provides the resolution callback.
/// Each Breakpoint has a BreakpointResolver, and it calls either
-/// ResolveBreakpoint
-/// or ResolveBreakpointInModules to tell it to look for new breakpoint
-/// locations.
+/// ResolveBreakpoint or ResolveBreakpointInModules to tell it to look for new
+/// breakpoint locations.
//----------------------------------------------------------------------
class BreakpointResolver : public Searcher {
@@ -53,8 +48,7 @@ public:
//------------------------------------------------------------------
/// The breakpoint resolver need to have a breakpoint for "ResolveBreakpoint
/// to make sense. It can be constructed without a breakpoint, but you have
- /// to
- /// call SetBreakpoint before ResolveBreakpoint.
+ /// to call SetBreakpoint before ResolveBreakpoint.
///
/// @param[in] bkpt
/// The breakpoint that owns this resolver.
@@ -82,9 +76,9 @@ public:
void SetBreakpoint(Breakpoint *bkpt);
//------------------------------------------------------------------
- /// This updates the offset for this breakpoint. All the locations currently
- /// set for this breakpoint will have their offset adjusted when this is
- /// called.
+ /// This updates the offset for this breakpoint. All the locations
+ /// currently set for this breakpoint will have their offset adjusted when
+ /// this is called.
///
/// @param[in] offset
/// The offset to add to all locations.
@@ -92,9 +86,9 @@ public:
void SetOffset(lldb::addr_t offset);
//------------------------------------------------------------------
- /// This updates the offset for this breakpoint. All the locations currently
- /// set for this breakpoint will have their offset adjusted when this is
- /// called.
+ /// This updates the offset for this breakpoint. All the locations
+ /// currently set for this breakpoint will have their offset adjusted when
+ /// this is called.
///
/// @param[in] offset
/// The offset to add to all locations.
@@ -103,8 +97,7 @@ public:
//------------------------------------------------------------------
/// In response to this method the resolver scans all the modules in the
- /// breakpoint's
- /// target, and adds any new locations it finds.
+ /// breakpoint's target, and adds any new locations it finds.
///
/// @param[in] filter
/// The filter that will manage the search for this resolver.
@@ -113,8 +106,7 @@ public:
//------------------------------------------------------------------
/// In response to this method the resolver scans the modules in the module
- /// list
- /// \a modules, and adds any new locations it finds.
+ /// list \a modules, and adds any new locations it finds.
///
/// @param[in] filter
/// The filter that will manage the search for this resolver.
@@ -157,8 +149,8 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// An enumeration for keeping track of the concrete subclass that
- /// is actually instantiated. Values of this enumeration are kept in the
+ /// An enumeration for keeping track of the concrete subclass that is
+ /// actually instantiated. Values of this enumeration are kept in the
/// BreakpointResolver's SubclassID field. They are used for concrete type
/// identification.
enum ResolverTy {
@@ -171,8 +163,8 @@ public:
UnknownResolver
};
- // Translate the Ty to name for serialization,
- // the "+2" is one for size vrs. index, and one for UnknownResolver.
+ // Translate the Ty to name for serialization, the "+2" is one for size vrs.
+ // index, and one for UnknownResolver.
static const char *g_ty_to_name[LastKnownResolverType + 2];
//------------------------------------------------------------------
@@ -199,8 +191,8 @@ public:
protected:
// Used for serializing resolver options:
- // The options in this enum and the strings in the
- // g_option_names must be kept in sync.
+ // The options in this enum and the strings in the g_option_names must be
+ // kept in sync.
enum class OptionNames : uint32_t {
AddressOffset = 0,
ExactMatch,
@@ -227,12 +219,10 @@ public:
protected:
//------------------------------------------------------------------
- /// SetSCMatchesByLine - Takes a symbol context list of matches which
- /// supposedly represent the same file and
- /// line number in a CU, and find the nearest actual line number that matches,
- /// and then filter down the
- /// matching addresses to unique entries, and skip the prologue if asked to do
- /// so, and then set
+ /// Takes a symbol context list of matches which supposedly represent the
+ /// same file and line number in a CU, and find the nearest actual line
+ /// number that matches, and then filter down the matching addresses to
+ /// unique entries, and skip the prologue if asked to do so, and then set
/// breakpoint locations in this breakpoint for all the resultant addresses.
void SetSCMatchesByLine(SearchFilter &filter, SymbolContextList &sc_list,
bool skip_prologue, llvm::StringRef log_ident);
diff --git a/include/lldb/Breakpoint/BreakpointResolverAddress.h b/include/lldb/Breakpoint/BreakpointResolverAddress.h
index 9d757c8853b9..5845fe7cabed 100644
--- a/include/lldb/Breakpoint/BreakpointResolverAddress.h
+++ b/include/lldb/Breakpoint/BreakpointResolverAddress.h
@@ -21,10 +21,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverAddress BreakpointResolverAddress.h
-/// "lldb/Breakpoint/BreakpointResolverAddress.h"
-/// @brief This class sets breakpoints on a given Address. This breakpoint only
-/// takes
-/// once, and then it won't attempt to reset itself.
+/// "lldb/Breakpoint/BreakpointResolverAddress.h" This class sets breakpoints
+/// on a given Address. This breakpoint only takes once, and then it won't
+/// attempt to reset itself.
//----------------------------------------------------------------------
class BreakpointResolverAddress : public BreakpointResolver {
@@ -74,8 +73,7 @@ protected:
FileSpec m_module_filespec; // If this filespec is Valid, and m_addr is an
// offset, then it will be converted
// to a Section+Offset address in this module, whenever that module gets
- // around to
- // being loaded.
+ // around to being loaded.
private:
DISALLOW_COPY_AND_ASSIGN(BreakpointResolverAddress);
};
diff --git a/include/lldb/Breakpoint/BreakpointResolverFileLine.h b/include/lldb/Breakpoint/BreakpointResolverFileLine.h
index f7bba3d4ccb4..3464f8ea80d8 100644
--- a/include/lldb/Breakpoint/BreakpointResolverFileLine.h
+++ b/include/lldb/Breakpoint/BreakpointResolverFileLine.h
@@ -20,10 +20,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverFileLine BreakpointResolverFileLine.h
-/// "lldb/Breakpoint/BreakpointResolverFileLine.h"
-/// @brief This class sets breakpoints by file and line. Optionally, it will
-/// look for inlined
-/// instances of the file and line specification.
+/// "lldb/Breakpoint/BreakpointResolverFileLine.h" This class sets breakpoints
+/// by file and line. Optionally, it will look for inlined instances of the
+/// file and line specification.
//----------------------------------------------------------------------
class BreakpointResolverFileLine : public BreakpointResolver {
@@ -63,7 +62,7 @@ public:
lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override;
protected:
- void FilterContexts(SymbolContextList &sc_list);
+ void FilterContexts(SymbolContextList &sc_list, bool is_relative);
friend class Breakpoint;
FileSpec m_file_spec; // This is the file spec we are looking for.
diff --git a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
index d620e99ffc60..c1a7a15566a5 100644
--- a/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
+++ b/include/lldb/Breakpoint/BreakpointResolverFileRegex.h
@@ -23,9 +23,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverFileRegex BreakpointResolverFileRegex.h
-/// "lldb/Breakpoint/BreakpointResolverFileRegex.h"
-/// @brief This class sets breakpoints by file and line. Optionally, it will
-/// look for inlined
+/// "lldb/Breakpoint/BreakpointResolverFileRegex.h" This class sets
+/// breakpoints by file and line. Optionally, it will look for inlined
/// instances of the file and line specification.
//----------------------------------------------------------------------
diff --git a/include/lldb/Breakpoint/BreakpointResolverName.h b/include/lldb/Breakpoint/BreakpointResolverName.h
index c7716d5146ef..794ea67bb721 100644
--- a/include/lldb/Breakpoint/BreakpointResolverName.h
+++ b/include/lldb/Breakpoint/BreakpointResolverName.h
@@ -24,10 +24,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointResolverName BreakpointResolverName.h
-/// "lldb/Breakpoint/BreakpointResolverName.h"
-/// @brief This class sets breakpoints on a given function name, either by exact
-/// match
-/// or by regular expression.
+/// "lldb/Breakpoint/BreakpointResolverName.h" This class sets breakpoints on
+/// a given function name, either by exact match or by regular expression.
//----------------------------------------------------------------------
class BreakpointResolverName : public BreakpointResolver {
@@ -48,8 +46,8 @@ public:
uint32_t name_type_mask, lldb::LanguageType language,
lldb::addr_t offset, bool skip_prologue);
- // Creates a function breakpoint by regular expression. Takes over control of
- // the lifespan of func_regex.
+ // Creates a function breakpoint by regular expression. Takes over control
+ // of the lifespan of func_regex.
BreakpointResolverName(Breakpoint *bkpt, RegularExpression &func_regex,
lldb::LanguageType language, lldb::addr_t offset,
bool skip_prologue);
diff --git a/include/lldb/Breakpoint/BreakpointSite.h b/include/lldb/Breakpoint/BreakpointSite.h
index 6e9875615fd9..c9bd883ca738 100644
--- a/include/lldb/Breakpoint/BreakpointSite.h
+++ b/include/lldb/Breakpoint/BreakpointSite.h
@@ -28,15 +28,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointSite BreakpointSite.h "lldb/Breakpoint/BreakpointSite.h"
-/// @brief Class that manages the actual breakpoint that will be inserted
-/// into the running program.
+/// Class that manages the actual breakpoint that will be inserted into the
+/// running program.
///
-/// The BreakpointSite class handles the physical breakpoint that is
-/// actually inserted in the target program. As such, it is also the
-/// one that gets hit, when the program stops. It keeps a list of all
-/// BreakpointLocations that share this physical site. When the
-/// breakpoint is hit, all the locations are informed by the breakpoint
-/// site. Breakpoint sites are owned by the process.
+/// The BreakpointSite class handles the physical breakpoint that is actually
+/// inserted in the target program. As such, it is also the one that gets
+/// hit, when the program stops. It keeps a list of all BreakpointLocations
+/// that share this physical site. When the breakpoint is hit, all the
+/// locations are informed by the breakpoint site. Breakpoint sites are owned
+/// by the process.
//----------------------------------------------------------------------
class BreakpointSite : public std::enable_shared_from_this<BreakpointSite>,
@@ -101,10 +101,9 @@ public:
/// Tells whether the current breakpoint site is enabled or not
///
/// This is a low-level enable bit for the breakpoint sites. If a
- /// breakpoint site has no enabled owners, it should just get
- /// removed. This enable/disable is for the low-level target code
- /// to enable and disable breakpoint sites when single stepping,
- /// etc.
+ /// breakpoint site has no enabled owners, it should just get removed. This
+ /// enable/disable is for the low-level target code to enable and disable
+ /// breakpoint sites when single stepping, etc.
//------------------------------------------------------------------
bool IsEnabled() const;
@@ -118,8 +117,7 @@ public:
//------------------------------------------------------------------
/// Enquires of the breakpoint locations that produced this breakpoint site
- /// whether
- /// we should stop at this location.
+ /// whether we should stop at this location.
///
/// @param[in] context
/// This contains the information about this stop.
@@ -138,9 +136,8 @@ public:
void Dump(Stream *s) const override;
//------------------------------------------------------------------
- /// The "Owners" are the breakpoint locations that share this
- /// breakpoint site. The method adds the \a owner to this breakpoint
- /// site's owner list.
+ /// The "Owners" are the breakpoint locations that share this breakpoint
+ /// site. The method adds the \a owner to this breakpoint site's owner list.
///
/// @param[in] context
/// \a owner is the Breakpoint Location to add.
@@ -148,8 +145,8 @@ public:
void AddOwner(const lldb::BreakpointLocationSP &owner);
//------------------------------------------------------------------
- /// This method returns the number of breakpoint locations currently
- /// located at this breakpoint site.
+ /// This method returns the number of breakpoint locations currently located
+ /// at this breakpoint site.
///
/// @return
/// The number of owners.
@@ -157,10 +154,10 @@ public:
size_t GetNumberOfOwners();
//------------------------------------------------------------------
- /// This method returns the breakpoint location at index \a index
- /// located at this breakpoint site. The owners are listed ordinally
- /// from 0 to GetNumberOfOwners() - 1 so you can use this method to iterate
- /// over the owners
+ /// This method returns the breakpoint location at index \a index located at
+ /// this breakpoint site. The owners are listed ordinally from 0 to
+ /// GetNumberOfOwners() - 1 so you can use this method to iterate over the
+ /// owners
///
/// @param[in] index
/// The index in the list of owners for which you wish the owner location.
@@ -183,9 +180,9 @@ public:
size_t CopyOwnersList(BreakpointLocationCollection &out_collection);
//------------------------------------------------------------------
- /// Check whether the owners of this breakpoint site have any
- /// thread specifiers, and if yes, is \a thread contained in any
- /// of these specifiers.
+ /// Check whether the owners of this breakpoint site have any thread
+ /// specifiers, and if yes, is \a thread contained in any of these
+ /// specifiers.
///
/// @param[in] thread
/// The thread against which to test.
@@ -198,9 +195,9 @@ public:
//------------------------------------------------------------------
/// Print a description of this breakpoint site to the stream \a s.
- /// GetDescription tells you about the breakpoint site's owners.
- /// Use BreakpointSite::Dump(Stream *) to get information about the
- /// breakpoint site itself.
+ /// GetDescription tells you about the breakpoint site's owners. Use
+ /// BreakpointSite::Dump(Stream *) to get information about the breakpoint
+ /// site itself.
///
/// @param[in] s
/// The stream to which to print the description.
@@ -226,7 +223,8 @@ public:
bool IsBreakpointAtThisSite(lldb::break_id_t bp_id);
//------------------------------------------------------------------
- /// Tell whether ALL the breakpoints in the location collection are internal.
+ /// Tell whether ALL the breakpoints in the location collection are
+ /// internal.
///
/// @result
/// \b true if all breakpoint locations are owned by internal breakpoints,
@@ -241,15 +239,16 @@ public:
private:
friend class Process;
friend class BreakpointLocation;
- // The StopInfoBreakpoint knows when it is processing a hit for a thread for a
- // site, so let it be the
- // one to manage setting the location hit count once and only once.
+ // The StopInfoBreakpoint knows when it is processing a hit for a thread for
+ // a site, so let it be the one to manage setting the location hit count once
+ // and only once.
friend class StopInfoBreakpoint;
void BumpHitCounts();
//------------------------------------------------------------------
- /// The method removes the owner at \a break_loc_id from this breakpoint list.
+ /// The method removes the owner at \a break_loc_id from this breakpoint
+ /// list.
///
/// @param[in] context
/// \a break_loc_id is the Breakpoint Location to remove.
@@ -264,8 +263,8 @@ private:
bool
m_enabled; ///< Boolean indicating if this breakpoint site enabled or not.
- // Consider adding an optimization where if there is only one
- // owner, we don't store a list. The usual case will be only one owner...
+ // Consider adding an optimization where if there is only one owner, we don't
+ // store a list. The usual case will be only one owner...
BreakpointLocationCollection m_owners; ///< This has the BreakpointLocations
///that share this breakpoint site.
std::recursive_mutex
diff --git a/include/lldb/Breakpoint/BreakpointSiteList.h b/include/lldb/Breakpoint/BreakpointSiteList.h
index 1431fe799675..d6530c170430 100644
--- a/include/lldb/Breakpoint/BreakpointSiteList.h
+++ b/include/lldb/Breakpoint/BreakpointSiteList.h
@@ -24,8 +24,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class BreakpointSiteList BreakpointSiteList.h
-/// "lldb/Breakpoint/BreakpointSiteList.h"
-/// @brief Class that manages lists of BreakpointSite shared pointers.
+/// "lldb/Breakpoint/BreakpointSiteList.h" Class that manages lists of
+/// BreakpointSite shared pointers.
//----------------------------------------------------------------------
class BreakpointSiteList {
// At present Process directly accesses the map of BreakpointSites so it can
@@ -56,15 +56,13 @@ public:
lldb::break_id_t Add(const lldb::BreakpointSiteSP &bp_site_sp);
//------------------------------------------------------------------
- /// Standard Dump routine, doesn't do anything at present.
- /// @param[in] s
+ /// Standard Dump routine, doesn't do anything at present. @param[in] s
/// Stream into which to dump the description.
//------------------------------------------------------------------
void Dump(Stream *s) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint site at address
- /// \a addr.
+ /// Returns a shared pointer to the breakpoint site at address \a addr.
///
/// @param[in] addr
/// The address to look for.
@@ -89,8 +87,8 @@ public:
lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID);
//------------------------------------------------------------------
- /// Returns a shared pointer to the breakpoint site with id \a breakID - const
- /// version.
+ /// Returns a shared pointer to the breakpoint site with id \a breakID -
+ /// const version.
///
/// @param[in] breakID
/// The breakpoint site ID to seek for.
@@ -103,7 +101,8 @@ public:
const lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID) const;
//------------------------------------------------------------------
- /// Returns the breakpoint site id to the breakpoint site at address \a addr.
+ /// Returns the breakpoint site id to the breakpoint site at address \a
+ /// addr.
///
/// @param[in] addr
/// The address to match.
@@ -161,8 +160,8 @@ public:
void *baton);
//------------------------------------------------------------------
- /// Enquires of the breakpoint site on in this list with ID \a breakID whether
- /// we should stop for the breakpoint or not.
+ /// Enquires of the breakpoint site on in this list with ID \a breakID
+ /// whether we should stop for the breakpoint or not.
///
/// @param[in] context
/// This contains the information about this stop.
diff --git a/include/lldb/Breakpoint/StoppointCallbackContext.h b/include/lldb/Breakpoint/StoppointCallbackContext.h
index 2680584845d7..1dac342d3325 100644
--- a/include/lldb/Breakpoint/StoppointCallbackContext.h
+++ b/include/lldb/Breakpoint/StoppointCallbackContext.h
@@ -17,18 +17,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class StoppointCallbackContext StoppointCallbackContext.h
-/// "lldb/Breakpoint/StoppointCallbackContext.h"
-/// @brief Class holds the information that a breakpoint callback needs to
-/// evaluate this stop.
+/// "lldb/Breakpoint/StoppointCallbackContext.h" Class holds the information
+/// that a breakpoint callback needs to evaluate this stop.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
/// When we hit a breakpoint we need to package up whatever information is
-/// needed
-/// to evaluate breakpoint commands and conditions. This class is the container
-/// of
-/// that information.
+/// needed to evaluate breakpoint commands and conditions. This class is the
+/// container of that information.
//----------------------------------------------------------------------
class StoppointCallbackContext {
diff --git a/include/lldb/Breakpoint/StoppointLocation.h b/include/lldb/Breakpoint/StoppointLocation.h
index f64035bbb941..5c717bbc3b0f 100644
--- a/include/lldb/Breakpoint/StoppointLocation.h
+++ b/include/lldb/Breakpoint/StoppointLocation.h
@@ -77,8 +77,8 @@ protected:
// breakpoint/watchpoint
uint32_t m_byte_size; // The size in bytes of stop location. e.g. the length
// of the trap opcode for
- // software breakpoints, or the optional length in bytes for
- // hardware breakpoints, or the length of the watchpoint.
+ // software breakpoints, or the optional length in bytes for hardware
+ // breakpoints, or the length of the watchpoint.
uint32_t
m_hit_count; // Number of times this breakpoint/watchpoint has been hit
diff --git a/include/lldb/Breakpoint/Watchpoint.h b/include/lldb/Breakpoint/Watchpoint.h
index 69067a567621..10df18a5c266 100644
--- a/include/lldb/Breakpoint/Watchpoint.h
+++ b/include/lldb/Breakpoint/Watchpoint.h
@@ -71,9 +71,9 @@ public:
bool IsEnabled() const;
- // This doesn't really enable/disable the watchpoint.
- // It is currently just for use in the Process plugin's
- // {Enable,Disable}Watchpoint, which should be used instead.
+ // This doesn't really enable/disable the watchpoint. It is currently just
+ // for use in the Process plugin's {Enable,Disable}Watchpoint, which should
+ // be used instead.
void SetEnabled(bool enabled, bool notify = true);
@@ -197,10 +197,8 @@ private:
uint32_t m_disabled_count; // Keep track of the count that the watchpoint is
// disabled while in ephemeral mode.
// At the end of the ephemeral mode when the watchpoint is to be enabled
- // again,
- // we check the count, if it is more than 1, it means the user-supplied
- // actions
- // actually want the watchpoint to be disabled!
+ // again, we check the count, if it is more than 1, it means the user-
+ // supplied actions actually want the watchpoint to be disabled!
uint32_t m_watch_read : 1, // 1 if we stop when the watched data is read from
m_watch_write : 1, // 1 if we stop when the watched data is written to
m_watch_was_read : 1, // Set to 1 when watchpoint is hit for a read access
diff --git a/include/lldb/Breakpoint/WatchpointList.h b/include/lldb/Breakpoint/WatchpointList.h
index 9abac9167b0b..d5e0da444afb 100644
--- a/include/lldb/Breakpoint/WatchpointList.h
+++ b/include/lldb/Breakpoint/WatchpointList.h
@@ -25,15 +25,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class WatchpointList WatchpointList.h "lldb/Breakpoint/WatchpointList.h"
-/// @brief This class is used by Watchpoint to manage a list of watchpoints,
+/// This class is used by Watchpoint to manage a list of watchpoints,
// each watchpoint in the list has a unique ID, and is unique by Address as
// well.
//----------------------------------------------------------------------
class WatchpointList {
- // Only Target can make the watchpoint list, or add elements to it.
- // This is not just some random collection of watchpoints. Rather, the act of
- // adding the watchpoint to this list sets its ID.
+ // Only Target can make the watchpoint list, or add elements to it. This is
+ // not just some random collection of watchpoints. Rather, the act of adding
+ // the watchpoint to this list sets its ID.
friend class Watchpoint;
friend class Target;
@@ -70,9 +70,8 @@ public:
void DumpWithLevel(Stream *s, lldb::DescriptionLevel description_level) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint at address
- /// \a addr -
- /// const version.
+ /// Returns a shared pointer to the watchpoint at address \a addr - const
+ /// version.
///
/// @param[in] addr
/// The address to look for.
@@ -84,9 +83,8 @@ public:
const lldb::WatchpointSP FindByAddress(lldb::addr_t addr) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint with watchpoint spec
- /// \a spec -
- /// const version.
+ /// Returns a shared pointer to the watchpoint with watchpoint spec \a spec
+ /// - const version.
///
/// @param[in] spec
/// The watchpoint spec to look for.
@@ -98,8 +96,7 @@ public:
const lldb::WatchpointSP FindBySpec(std::string spec) const;
//------------------------------------------------------------------
- /// Returns a shared pointer to the watchpoint with id
- /// \a watchID, const
+ /// Returns a shared pointer to the watchpoint with id \a watchID, const
/// version.
///
/// @param[in] watchID
@@ -112,8 +109,7 @@ public:
lldb::WatchpointSP FindByID(lldb::watch_id_t watchID) const;
//------------------------------------------------------------------
- /// Returns the watchpoint id to the watchpoint
- /// at address \a addr.
+ /// Returns the watchpoint id to the watchpoint at address \a addr.
///
/// @param[in] addr
/// The address to match.
@@ -124,8 +120,8 @@ public:
lldb::watch_id_t FindIDByAddress(lldb::addr_t addr);
//------------------------------------------------------------------
- /// Returns the watchpoint id to the watchpoint
- /// with watchpoint spec \a spec.
+ /// Returns the watchpoint id to the watchpoint with watchpoint spec \a
+ /// spec.
///
/// @param[in] spec
/// The watchpoint spec to match.
diff --git a/include/lldb/Breakpoint/WatchpointOptions.h b/include/lldb/Breakpoint/WatchpointOptions.h
index 6ab1264a1c7f..8cb3b97f3a62 100644
--- a/include/lldb/Breakpoint/WatchpointOptions.h
+++ b/include/lldb/Breakpoint/WatchpointOptions.h
@@ -25,8 +25,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class WatchpointOptions WatchpointOptions.h
-/// "lldb/Breakpoint/WatchpointOptions.h"
-/// @brief Class that manages the options on a watchpoint.
+/// "lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a
+/// watchpoint.
//----------------------------------------------------------------------
class WatchpointOptions {
@@ -69,15 +69,13 @@ public:
// Callbacks
//
// Watchpoint callbacks come in two forms, synchronous and asynchronous.
- // Synchronous callbacks will get
- // run before any of the thread plans are consulted, and if they return false
- // the target will continue
- // "under the radar" of the thread plans. There are a couple of restrictions
- // to synchronous callbacks:
- // 1) They should NOT resume the target themselves. Just return false if you
- // want the target to restart.
- // 2) Watchpoints with synchronous callbacks can't have conditions (or rather,
- // they can have them, but they
+ // Synchronous callbacks will get run before any of the thread plans are
+ // consulted, and if they return false the target will continue "under the
+ // radar" of the thread plans. There are a couple of restrictions to
+ // synchronous callbacks: 1) They should NOT resume the target themselves.
+ // Just return false if you want the target to restart. 2) Watchpoints with
+ // synchronous callbacks can't have conditions (or rather, they can have
+ // them, but they
// won't do anything. Ditto with ignore counts, etc... You are supposed
// to control that all through the
// callback.
@@ -118,8 +116,8 @@ public:
//------------------------------------------------------------------
void ClearCallback();
- // The rest of these functions are meant to be used only within the watchpoint
- // handling mechanism.
+ // The rest of these functions are meant to be used only within the
+ // watchpoint handling mechanism.
//------------------------------------------------------------------
/// Use this function to invoke the callback for a specific stop.
@@ -168,8 +166,7 @@ public:
//------------------------------------------------------------------
/// Return the current thread spec for this option. This will return nullptr
- /// if the no thread
- /// specifications have been set for this Option yet.
+ /// if the no thread specifications have been set for this Option yet.
/// @return
/// The thread specification pointer for this option, or nullptr if none
/// has
@@ -178,8 +175,8 @@ public:
const ThreadSpec *GetThreadSpecNoCreate() const;
//------------------------------------------------------------------
- /// Returns a pointer to the ThreadSpec for this option, creating it.
- /// if it hasn't been created already. This API is used for setting the
+ /// Returns a pointer to the ThreadSpec for this option, creating it. if it
+ /// hasn't been created already. This API is used for setting the
/// ThreadSpec items for this option.
//------------------------------------------------------------------
ThreadSpec *GetThreadSpec();
diff --git a/include/lldb/Core/Address.h b/include/lldb/Core/Address.h
index 4c77458061d0..617aaefe91c9 100644
--- a/include/lldb/Core/Address.h
+++ b/include/lldb/Core/Address.h
@@ -11,8 +11,8 @@
#define liblldb_Address_h_
#include "lldb/lldb-defines.h" // for LLDB_INVALID_ADDRESS
-#include "lldb/lldb-enumerations.h" // for AddressClass::eAddressClassInvalid
#include "lldb/lldb-forward.h" // for SectionWP, SectionSP, ModuleSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
#include "lldb/lldb-types.h" // for addr_t
#include <stddef.h> // for size_t
@@ -53,54 +53,50 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Address Address.h "lldb/Core/Address.h"
-/// @brief A section + offset based address class.
+/// A section + offset based address class.
///
-/// The Address class allows addresses to be relative to a section
-/// that can move during runtime due to images (executables, shared
-/// libraries, bundles, frameworks) being loaded at different
-/// addresses than the addresses found in the object file that
-/// represents them on disk. There are currently two types of addresses
-/// for a section:
+/// The Address class allows addresses to be relative to a section that can
+/// move during runtime due to images (executables, shared libraries, bundles,
+/// frameworks) being loaded at different addresses than the addresses found
+/// in the object file that represents them on disk. There are currently two
+/// types of addresses for a section:
/// @li file addresses
/// @li load addresses
///
-/// File addresses represent the virtual addresses that are in the "on
-/// disk" object files. These virtual addresses are converted to be
-/// relative to unique sections scoped to the object file so that
-/// when/if the addresses slide when the images are loaded/unloaded
-/// in memory, we can easily track these changes without having to
-/// update every object (compile unit ranges, line tables, function
-/// address ranges, lexical block and inlined subroutine address
-/// ranges, global and static variables) each time an image is loaded or
-/// unloaded.
+/// File addresses represent the virtual addresses that are in the "on disk"
+/// object files. These virtual addresses are converted to be relative to
+/// unique sections scoped to the object file so that when/if the addresses
+/// slide when the images are loaded/unloaded in memory, we can easily track
+/// these changes without having to update every object (compile unit ranges,
+/// line tables, function address ranges, lexical block and inlined subroutine
+/// address ranges, global and static variables) each time an image is loaded
+/// or unloaded.
///
-/// Load addresses represent the virtual addresses where each section
-/// ends up getting loaded at runtime. Before executing a program, it
-/// is common for all of the load addresses to be unresolved. When a
-/// DynamicLoader plug-in receives notification that shared libraries
-/// have been loaded/unloaded, the load addresses of the main executable
-/// and any images (shared libraries) will be resolved/unresolved. When
-/// this happens, breakpoints that are in one of these sections can be
-/// set/cleared.
+/// Load addresses represent the virtual addresses where each section ends up
+/// getting loaded at runtime. Before executing a program, it is common for
+/// all of the load addresses to be unresolved. When a DynamicLoader plug-in
+/// receives notification that shared libraries have been loaded/unloaded, the
+/// load addresses of the main executable and any images (shared libraries)
+/// will be resolved/unresolved. When this happens, breakpoints that are in
+/// one of these sections can be set/cleared.
//----------------------------------------------------------------------
class Address {
public:
//------------------------------------------------------------------
- /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const
- /// function to display Address contents in a variety of ways.
+ /// Dump styles allow the Address::Dump(Stream *,DumpStyle) const function
+ /// to display Address contents in a variety of ways.
//------------------------------------------------------------------
typedef enum {
DumpStyleInvalid, ///< Invalid dump style
DumpStyleSectionNameOffset, ///< Display as the section name + offset.
///< \code
/// // address for printf in libSystem.B.dylib as a section name + offset
- /// libSystem.B.dylib.__TEXT.__text + 0x0005cfdf
- /// \endcode
+ /// libSystem.B.dylib.__TEXT.__text + 0x0005cfdf \endcode
DumpStyleSectionPointerOffset, ///< Display as the section pointer + offset
///(debug output).
///< \code
- /// // address for printf in libSystem.B.dylib as a section pointer + offset
- /// (lldb::Section *)0x35cc50 + 0x000000000005cfdf \endcode
+ /// // address for printf in libSystem.B.dylib as a section pointer +
+ /// offset (lldb::Section *)0x35cc50 + 0x000000000005cfdf \endcode
DumpStyleFileAddress, ///< Display as the file address (if any).
///< \code
/// // address for printf in libSystem.B.dylib as a file address
@@ -135,8 +131,8 @@ public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Initialize with a invalid section (NULL) and an invalid
- /// offset (LLDB_INVALID_ADDRESS).
+ /// Initialize with a invalid section (NULL) and an invalid offset
+ /// (LLDB_INVALID_ADDRESS).
//------------------------------------------------------------------
Address() : m_section_wp(), m_offset(LLDB_INVALID_ADDRESS) {}
@@ -154,8 +150,7 @@ public:
//------------------------------------------------------------------
/// Construct with a section pointer and offset.
///
- /// Initialize the address with the supplied \a section and \a
- /// offset.
+ /// Initialize the address with the supplied \a section and \a offset.
///
/// @param[in] section
/// A section pointer to a valid lldb::Section, or NULL if the
@@ -175,8 +170,8 @@ public:
//------------------------------------------------------------------
/// Construct with a virtual address and section list.
///
- /// Initialize and resolve the address with the supplied virtual
- /// address \a file_addr.
+ /// Initialize and resolve the address with the supplied virtual address \a
+ /// file_addr.
///
/// @param[in] file_addr
/// A virtual file address.
@@ -191,8 +186,8 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
-/// Copies the address value from another Address object \a rhs
-/// into \a this object.
+/// Copies the address value from another Address object \a rhs into \a this
+/// object.
///
/// @param[in] rhs
/// A const Address object reference to copy.
@@ -207,8 +202,8 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Sets the section to an invalid value (NULL) and an invalid
- /// offset (LLDB_INVALID_ADDRESS).
+ /// Sets the section to an invalid value (NULL) and an invalid offset
+ /// (LLDB_INVALID_ADDRESS).
//------------------------------------------------------------------
void Clear() {
m_section_wp.reset();
@@ -250,9 +245,9 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. There are many ways to display a section
- /// offset based address, and \a style lets the user choose.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. There are many ways to display a section offset based address, and
+ /// \a style lets the user choose.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -275,14 +270,14 @@ public:
DumpStyle fallback_style = DumpStyleInvalid,
uint32_t addr_byte_size = UINT32_MAX) const;
- lldb::AddressClass GetAddressClass() const;
+ AddressClass GetAddressClass() const;
//------------------------------------------------------------------
/// Get the file address.
///
- /// If an address comes from a file on disk that has section
- /// relative addresses, then it has a virtual address that is
- /// relative to unique section in the object file.
+ /// If an address comes from a file on disk that has section relative
+ /// addresses, then it has a virtual address that is relative to unique
+ /// section in the object file.
///
/// @return
/// The valid file virtual address, or LLDB_INVALID_ADDRESS if
@@ -294,12 +289,12 @@ public:
//------------------------------------------------------------------
/// Get the load address.
///
- /// If an address comes from a file on disk that has section
- /// relative addresses, then it has a virtual address that is
- /// relative to unique section in the object file. Sections get
- /// resolved at runtime by DynamicLoader plug-ins as images
- /// (executables and shared libraries) get loaded/unloaded. If a
- /// section is loaded, then the load address can be resolved.
+ /// If an address comes from a file on disk that has section relative
+ /// addresses, then it has a virtual address that is relative to unique
+ /// section in the object file. Sections get resolved at runtime by
+ /// DynamicLoader plug-ins as images (executables and shared libraries) get
+ /// loaded/unloaded. If a section is loaded, then the load address can be
+ /// resolved.
///
/// @return
/// The valid load virtual address, or LLDB_INVALID_ADDRESS if
@@ -310,12 +305,12 @@ public:
//------------------------------------------------------------------
/// Get the load address as a callable code load address.
///
- /// This function will first resolve its address to a load address.
- /// Then, if the address turns out to be in code address, return the
- /// load address that would be required to call or return to. The
- /// address might have extra bits set (bit zero will be set to Thumb
- /// functions for an ARM target) that are required when changing the
- /// program counter to setting a return address.
+ /// This function will first resolve its address to a load address. Then, if
+ /// the address turns out to be in code address, return the load address
+ /// that would be required to call or return to. The address might have
+ /// extra bits set (bit zero will be set to Thumb functions for an ARM
+ /// target) that are required when changing the program counter to setting a
+ /// return address.
///
/// @return
/// The valid load virtual address, or LLDB_INVALID_ADDRESS if
@@ -327,14 +322,14 @@ public:
//------------------------------------------------------------------
/// Get the load address as an opcode load address.
///
- /// This function will first resolve its address to a load address.
- /// Then, if the address turns out to be in code address, return the
- /// load address for an opcode. This address object might have
- /// extra bits set (bit zero will be set to Thumb functions for an
+ /// This function will first resolve its address to a load address. Then, if
+ /// the address turns out to be in code address, return the load address for
+ /// an opcode. This address object might have extra bits set (bit zero will
+ /// be set to Thumb functions for an
/// ARM target) that are required for changing the program counter
- /// and this function will remove any bits that are intended for
- /// these special purposes. The result of this function can be used
- /// to safely write a software breakpoint trap to memory.
+ /// and this function will remove any bits that are intended for these
+ /// special purposes. The result of this function can be used to safely
+ /// write a software breakpoint trap to memory.
///
/// @return
/// The valid load virtual address with extra callable bits
@@ -343,7 +338,7 @@ public:
//------------------------------------------------------------------
lldb::addr_t GetOpcodeLoadAddress(
Target *target,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
+ AddressClass addr_class = AddressClass::eInvalid) const;
//------------------------------------------------------------------
/// Get the section relative offset value.
@@ -357,11 +352,11 @@ public:
//------------------------------------------------------------------
/// Check if an address is section offset.
///
- /// When converting a virtual file or load address into a section
- /// offset based address, we often need to know if, given a section
- /// list, if the address was able to be converted to section offset.
- /// This function returns true if the current value contained in
- /// this object is section offset based.
+ /// When converting a virtual file or load address into a section offset
+ /// based address, we often need to know if, given a section list, if the
+ /// address was able to be converted to section offset. This function
+ /// returns true if the current value contained in this object is section
+ /// offset based.
///
/// @return
/// Returns \b true if the address has a valid section and
@@ -375,8 +370,8 @@ public:
/// Check if the object state is valid.
///
/// A valid Address object contains either a section pointer and
- /// and offset (for section offset based addresses), or just a valid
- /// offset (for absolute addresses that have no section).
+ /// offset (for section offset based addresses), or just a valid offset
+ /// (for absolute addresses that have no section).
///
/// @return
/// Returns \b true if the offset is valid, \b false
@@ -395,8 +390,8 @@ public:
//------------------------------------------------------------------
/// Resolve a file virtual address using a section list.
///
- /// Given a list of sections, attempt to resolve \a addr as a
- /// an offset into one of the file sections.
+ /// Given a list of sections, attempt to resolve \a addr as an offset into
+ /// one of the file sections.
///
/// @return
/// Returns \b true if \a addr was able to be resolved, \b false
@@ -408,11 +403,10 @@ public:
//------------------------------------------------------------------
/// Set the address to represent \a load_addr.
///
- /// The address will attempt to find a loaded section within
- /// \a target that contains \a load_addr. If successful, this
- /// address object will have a valid section and offset. Else this
- /// address object will have no section (NULL) and the offset will
- /// be \a load_addr.
+ /// The address will attempt to find a loaded section within \a target that
+ /// contains \a load_addr. If successful, this address object will have a
+ /// valid section and offset. Else this address object will have no section
+ /// (NULL) and the offset will be \a load_addr.
///
/// @param[in] load_addr
/// A load address from a current process.
@@ -438,7 +432,7 @@ public:
bool SetOpcodeLoadAddress(
lldb::addr_t load_addr, Target *target,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid,
+ AddressClass addr_class = AddressClass::eInvalid,
bool allow_section_end = false);
bool SetCallableLoadAddress(lldb::addr_t load_addr, Target *target);
@@ -507,10 +501,10 @@ public:
//------------------------------------------------------------------
/// Reconstruct a symbol context from an address.
///
- /// This class doesn't inherit from SymbolContextScope because many
- /// address objects have short lifespans. Address objects that are
- /// section offset can reconstruct their symbol context by looking
- /// up the address in the module found in the section.
+ /// This class doesn't inherit from SymbolContextScope because many address
+ /// objects have short lifespans. Address objects that are section offset
+ /// can reconstruct their symbol context by looking up the address in the
+ /// module found in the section.
///
/// @see SymbolContextScope::CalculateSymbolContext(SymbolContext*)
//------------------------------------------------------------------
@@ -531,11 +525,11 @@ public:
bool CalculateSymbolContextLineEntry(LineEntry &line_entry) const;
//------------------------------------------------------------------
- // Returns true if the section should be valid, but isn't because
- // the shared pointer to the section can't be reconstructed from
- // a weak pointer that contains a valid weak reference to a section.
- // Returns false if the section weak pointer has no reference to
- // a section, or if the section is still valid
+ // Returns true if the section should be valid, but isn't because the shared
+ // pointer to the section can't be reconstructed from a weak pointer that
+ // contains a valid weak reference to a section. Returns false if the section
+ // weak pointer has no reference to a section, or if the section is still
+ // valid
//------------------------------------------------------------------
bool SectionWasDeleted() const;
@@ -547,29 +541,27 @@ protected:
lldb::addr_t m_offset; ///< Offset into section if \a m_section_wp is valid...
//------------------------------------------------------------------
- // Returns true if the m_section_wp once had a reference to a valid
- // section shared pointer, but no longer does. This can happen if
- // we have an address from a module that gets unloaded and deleted.
- // This function should only be called if GetSection() returns an
- // empty shared pointer and you want to know if this address used to
- // have a valid section.
+ // Returns true if the m_section_wp once had a reference to a valid section
+ // shared pointer, but no longer does. This can happen if we have an address
+ // from a module that gets unloaded and deleted. This function should only be
+ // called if GetSection() returns an empty shared pointer and you want to
+ // know if this address used to have a valid section.
//------------------------------------------------------------------
bool SectionWasDeletedPrivate() const;
};
//----------------------------------------------------------------------
// NOTE: Be careful using this operator. It can correctly compare two
-// addresses from the same Module correctly. It can't compare two
-// addresses from different modules in any meaningful way, but it will
-// compare the module pointers.
+// addresses from the same Module correctly. It can't compare two addresses
+// from different modules in any meaningful way, but it will compare the module
+// pointers.
//
// To sum things up:
-// - works great for addresses within the same module
-// - it works for addresses across multiple modules, but don't expect the
+// - works great for addresses within the same module - it works for addresses
+// across multiple modules, but don't expect the
// address results to make much sense
//
-// This basically lets Address objects be used in ordered collection
-// classes.
+// This basically lets Address objects be used in ordered collection classes.
//----------------------------------------------------------------------
bool operator<(const Address &lhs, const Address &rhs);
bool operator>(const Address &lhs, const Address &rhs);
diff --git a/include/lldb/Core/AddressRange.h b/include/lldb/Core/AddressRange.h
index e787d1d5740d..9f69c87ee354 100644
--- a/include/lldb/Core/AddressRange.h
+++ b/include/lldb/Core/AddressRange.h
@@ -30,23 +30,23 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressRange AddressRange.h "lldb/Core/AddressRange.h"
-/// @brief A section + offset based address range class.
+/// A section + offset based address range class.
//----------------------------------------------------------------------
class AddressRange {
public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Initialize with a invalid section (NULL), an invalid
- /// offset (LLDB_INVALID_ADDRESS), and zero byte size.
+ /// Initialize with a invalid section (NULL), an invalid offset
+ /// (LLDB_INVALID_ADDRESS), and zero byte size.
//------------------------------------------------------------------
AddressRange();
//------------------------------------------------------------------
/// Construct with a section pointer, offset, and byte_size.
///
- /// Initialize the address with the supplied \a section, \a
- /// offset and \a byte_size.
+ /// Initialize the address with the supplied \a section, \a offset and \a
+ /// byte_size.
///
/// @param[in] section
/// A section pointer to a valid lldb::Section, or NULL if the
@@ -64,8 +64,8 @@ public:
//------------------------------------------------------------------
/// Construct with a virtual address, section list and byte size.
///
- /// Initialize and resolve the address with the supplied virtual
- /// address \a file_addr, and byte size \a byte_size.
+ /// Initialize and resolve the address with the supplied virtual address \a
+ /// file_addr, and byte size \a byte_size.
///
/// @param[in] file_addr
/// A virtual address.
@@ -82,8 +82,8 @@ public:
//------------------------------------------------------------------
/// Construct with a Address object address and byte size.
///
- /// Initialize by copying the section offset address in \a so_addr,
- /// and setting the byte size to \a byte_size.
+ /// Initialize by copying the section offset address in \a so_addr, and
+ /// setting the byte size to \a byte_size.
///
/// @param[in] so_addr
/// A section offset address object.
@@ -135,8 +135,8 @@ public:
// Contains (const Address *so_addr_ptr) const;
//------------------------------------------------------------------
- /// Check if a section offset \a so_addr when represented as a file
- /// address is contained within this object's file address range.
+ /// Check if a section offset \a so_addr when represented as a file address
+ /// is contained within this object's file address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -149,8 +149,8 @@ public:
bool ContainsFileAddress(const Address &so_addr) const;
//------------------------------------------------------------------
- /// Check if the resolved file address \a file_addr is contained
- /// within this object's file address range.
+ /// Check if the resolved file address \a file_addr is contained within this
+ /// object's file address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -163,8 +163,8 @@ public:
bool ContainsFileAddress(lldb::addr_t file_addr) const;
//------------------------------------------------------------------
- /// Check if a section offset \a so_addr when represented as a load
- /// address is contained within this object's load address range.
+ /// Check if a section offset \a so_addr when represented as a load address
+ /// is contained within this object's load address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -177,8 +177,8 @@ public:
bool ContainsLoadAddress(const Address &so_addr, Target *target) const;
//------------------------------------------------------------------
- /// Check if the resolved load address \a load_addr is contained
- /// within this object's load address range.
+ /// Check if the resolved load address \a load_addr is contained within this
+ /// object's load address range.
///
/// @param[in] so_addr
/// A section offset address object reference.
@@ -193,10 +193,10 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. There are many ways to display a section
- /// offset based address range, and \a style lets the user choose
- /// how the base address gets displayed.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. There are many ways to display a section offset based address
+ /// range, and \a style lets the user choose how the base address gets
+ /// displayed.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -219,11 +219,11 @@ public:
//------------------------------------------------------------------
/// Dump a debug description of this object to a Stream.
///
- /// Dump a debug description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a debug description of the contents of this object to the supplied
+ /// stream \a s.
///
- /// The debug description contains verbose internal state such
- /// and pointer values, reference counts, etc.
+ /// The debug description contains verbose internal state such and pointer
+ /// values, reference counts, etc.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -261,8 +261,8 @@ public:
/// The number of bytes that this object occupies in memory.
//------------------------------------------------------------------
size_t MemorySize() const {
- // Noting special for the memory size of a single AddressRange object,
- // it is just the size of itself.
+ // Noting special for the memory size of a single AddressRange object, it
+ // is just the size of itself.
return sizeof(AddressRange);
}
diff --git a/include/lldb/Core/AddressResolver.h b/include/lldb/Core/AddressResolver.h
index 432268e497b4..cfd103e0be01 100644
--- a/include/lldb/Core/AddressResolver.h
+++ b/include/lldb/Core/AddressResolver.h
@@ -27,18 +27,16 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
-/// @brief This class works with SearchFilter to resolve function names and
-/// source file locations to their concrete addresses.
+/// This class works with SearchFilter to resolve function names and source
+/// file locations to their concrete addresses.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
/// General Outline:
-/// The AddressResolver is a Searcher. In that protocol,
-/// the SearchFilter asks the question "At what depth of the symbol context
-/// descent do you want your callback to get called?" of the filter. The
-/// resolver
-/// answers this question (in the GetDepth method) and provides the resolution
-/// callback.
+/// The AddressResolver is a Searcher. In that protocol, the SearchFilter
+/// asks the question "At what depth of the symbol context descent do you want
+/// your callback to get called?" of the filter. The resolver answers this
+/// question (in the GetDepth method) and provides the resolution callback.
//----------------------------------------------------------------------
class AddressResolver : public Searcher {
diff --git a/include/lldb/Core/AddressResolverFileLine.h b/include/lldb/Core/AddressResolverFileLine.h
index ec15cc76d887..e434a62e0319 100644
--- a/include/lldb/Core/AddressResolverFileLine.h
+++ b/include/lldb/Core/AddressResolverFileLine.h
@@ -31,10 +31,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolverFileLine AddressResolverFileLine.h
-/// "lldb/Core/AddressResolverFileLine.h"
-/// @brief This class finds address for source file and line. Optionally, it
-/// will look for inlined
-/// instances of the file and line specification.
+/// "lldb/Core/AddressResolverFileLine.h" This class finds address for source
+/// file and line. Optionally, it will look for inlined instances of the file
+/// and line specification.
//----------------------------------------------------------------------
class AddressResolverFileLine : public AddressResolver {
diff --git a/include/lldb/Core/AddressResolverName.h b/include/lldb/Core/AddressResolverName.h
index aadc05495999..49a805f2115a 100644
--- a/include/lldb/Core/AddressResolverName.h
+++ b/include/lldb/Core/AddressResolverName.h
@@ -30,10 +30,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class AddressResolverName AddressResolverName.h
-/// "lldb/Core/AddressResolverName.h"
-/// @brief This class finds addresses for a given function name, either by exact
-/// match
-/// or by regular expression.
+/// "lldb/Core/AddressResolverName.h" This class finds addresses for a given
+/// function name, either by exact match or by regular expression.
//----------------------------------------------------------------------
class AddressResolverName : public AddressResolver {
@@ -41,8 +39,8 @@ public:
AddressResolverName(const char *func_name,
AddressResolver::MatchType type = Exact);
- // Creates a function breakpoint by regular expression. Takes over control of
- // the lifespan of func_regex.
+ // Creates a function breakpoint by regular expression. Takes over control
+ // of the lifespan of func_regex.
AddressResolverName(RegularExpression &func_regex);
AddressResolverName(const char *class_name, const char *method,
diff --git a/include/lldb/Core/Architecture.h b/include/lldb/Core/Architecture.h
index af774ecdaf9c..3a5a9789223d 100644
--- a/include/lldb/Core/Architecture.h
+++ b/include/lldb/Core/Architecture.h
@@ -31,7 +31,41 @@ public:
/// stopped at the current PC. The code is generic and applies to all
/// ARM CPUs.
//------------------------------------------------------------------
- virtual void OverrideStopInfo(Thread &thread) = 0;
+ virtual void OverrideStopInfo(Thread &thread) const = 0;
+
+ //------------------------------------------------------------------
+ /// This method is used to get the number of bytes that should be
+ /// skipped, from function start address, to reach the first
+ /// instruction after the prologue. If overrode, it must return
+ /// non-zero only if the current address matches one of the known
+ /// function entry points.
+ ///
+ /// This method is called only if the standard platform-independent
+ /// code fails to get the number of bytes to skip, giving the plugin
+ /// a chance to try to find the missing info.
+ ///
+ /// This is specifically used for PPC64, where functions may have
+ /// more than one entry point, global and local, so both should
+ /// be compared with current address, in order to find out the
+ /// number of bytes that should be skipped, in case we are stopped
+ /// at either function entry point.
+ //------------------------------------------------------------------
+ virtual size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const {
+ return 0;
+ }
+
+ //------------------------------------------------------------------
+ /// Adjust function breakpoint address, if needed. In some cases,
+ /// the function start address is not the right place to set the
+ /// breakpoint, specially in functions with multiple entry points.
+ ///
+ /// This is specifically used for PPC64, for functions that have
+ /// both a global and a local entry point. In this case, the
+ /// breakpoint is adjusted to the first function address reached
+ /// by both entry points.
+ //------------------------------------------------------------------
+ virtual void AdjustBreakpointAddress(const Symbol &func,
+ Address &addr) const {}
private:
Architecture(const Architecture &) = delete;
diff --git a/include/lldb/Core/Broadcaster.h b/include/lldb/Core/Broadcaster.h
index 825287db5984..4851007c9a2a 100644
--- a/include/lldb/Core/Broadcaster.h
+++ b/include/lldb/Core/Broadcaster.h
@@ -59,10 +59,9 @@ public:
uint32_t GetEventBits() const { return m_event_bits; }
- // Tell whether this BroadcastEventSpec is contained in in_spec.
- // That is:
- // (a) the two spec's share the same broadcaster class
- // (b) the event bits of this spec are wholly contained in those of in_spec.
+ // Tell whether this BroadcastEventSpec is contained in in_spec. That is: (a)
+ // the two spec's share the same broadcaster class (b) the event bits of this
+ // spec are wholly contained in those of in_spec.
bool IsContainedIn(BroadcastEventSpec in_spec) const {
if (m_broadcaster_class != in_spec.GetBroadcasterClass())
return false;
@@ -224,21 +223,21 @@ private:
};
//----------------------------------------------------------------------
-/// @class Broadcaster Broadcaster.h "lldb/Core/Broadcaster.h"
-/// @brief An event broadcasting class.
+/// @class Broadcaster Broadcaster.h "lldb/Core/Broadcaster.h" An event
+/// broadcasting class.
///
-/// The Broadcaster class is designed to be subclassed by objects that
-/// wish to vend events in a multi-threaded environment. Broadcaster
-/// objects can each vend 32 events. Each event is represented by a bit
-/// in a 32 bit value and these bits can be set:
+/// The Broadcaster class is designed to be subclassed by objects that wish to
+/// vend events in a multi-threaded environment. Broadcaster objects can each
+/// vend 32 events. Each event is represented by a bit in a 32 bit value and
+/// these bits can be set:
/// @see Broadcaster::SetEventBits(uint32_t)
/// or cleared:
/// @see Broadcaster::ResetEventBits(uint32_t)
-/// When an event gets set the Broadcaster object will notify the
-/// Listener object that is listening for the event (if there is one).
+/// When an event gets set the Broadcaster object will notify the Listener
+/// object that is listening for the event (if there is one).
///
-/// Subclasses should provide broadcast bit definitions for any events
-/// they vend, typically using an enumeration:
+/// Subclasses should provide broadcast bit definitions for any events they
+/// vend, typically using an enumeration:
/// \code
/// class Foo : public Broadcaster
/// {
@@ -324,12 +323,11 @@ public:
//------------------------------------------------------------------
/// Listen for any events specified by \a event_mask.
///
- /// Only one listener can listen to each event bit in a given
- /// Broadcaster. Once a listener has acquired an event bit, no
- /// other broadcaster will have access to it until it is
- /// relinquished by the first listener that gets it. The actual
- /// event bits that get acquired by \a listener may be different
- /// from what is requested in \a event_mask, and to track this the
+ /// Only one listener can listen to each event bit in a given Broadcaster.
+ /// Once a listener has acquired an event bit, no other broadcaster will
+ /// have access to it until it is relinquished by the first listener that
+ /// gets it. The actual event bits that get acquired by \a listener may be
+ /// different from what is requested in \a event_mask, and to track this the
/// actual event bits that are acquired get returned.
///
/// @param[in] listener
@@ -349,8 +347,7 @@ public:
}
//------------------------------------------------------------------
- /// Get the NULL terminated C string name of this Broadcaster
- /// object.
+ /// Get the NULL terminated C string name of this Broadcaster object.
///
/// @return
/// The NULL terminated C string name of this Broadcaster.
@@ -395,10 +392,10 @@ public:
}
//------------------------------------------------------------------
- /// Removes a Listener from this broadcasters list and frees the
- /// event bits specified by \a event_mask that were previously
- /// acquired by \a listener (assuming \a listener was listening to
- /// this object) for other listener objects to use.
+ /// Removes a Listener from this broadcasters list and frees the event bits
+ /// specified by \a event_mask that were previously acquired by \a listener
+ /// (assuming \a listener was listening to this object) for other listener
+ /// objects to use.
///
/// @param[in] listener
/// A Listener object that previously called AddListener.
@@ -420,10 +417,9 @@ public:
//------------------------------------------------------------------
/// Provides a simple mechanism to temporarily redirect events from
/// broadcaster. When you call this function passing in a listener and
- /// event type mask, all events from the broadcaster matching the mask
- /// will now go to the hijacking listener.
- /// Only one hijack can occur at a time. If we need more than this we
- /// will have to implement a Listener stack.
+ /// event type mask, all events from the broadcaster matching the mask will
+ /// now go to the hijacking listener. Only one hijack can occur at a time.
+ /// If we need more than this we will have to implement a Listener stack.
///
/// @param[in] listener
/// A Listener object. You do not need to call StartListeningForEvents
@@ -454,8 +450,7 @@ public:
void RestoreBroadcaster() { m_broadcaster_sp->RestoreBroadcaster(); }
// This needs to be filled in if you are going to register the broadcaster
- // with the broadcaster
- // manager and do broadcaster class matching.
+ // with the broadcaster manager and do broadcaster class matching.
// FIXME: Probably should make a ManagedBroadcaster subclass with all the bits
// needed to work
// with the BroadcasterManager, so that it is clearer how to add one.
@@ -465,21 +460,17 @@ public:
protected:
// BroadcasterImpl contains the actual Broadcaster implementation. The
- // Broadcaster makes a BroadcasterImpl
- // which lives as long as it does. The Listeners & the Events hold a weak
- // pointer to the BroadcasterImpl,
- // so that they can survive if a Broadcaster they were listening to is
- // destroyed w/o their being able to
- // unregister from it (which can happen if the Broadcasters & Listeners are
- // being destroyed on separate threads
- // simultaneously.
- // The Broadcaster itself can't be shared out as a weak pointer, because some
- // things that are broadcasters
- // (e.g. the Target and the Process) are shared in their own right.
+ // Broadcaster makes a BroadcasterImpl which lives as long as it does. The
+ // Listeners & the Events hold a weak pointer to the BroadcasterImpl, so that
+ // they can survive if a Broadcaster they were listening to is destroyed w/o
+ // their being able to unregister from it (which can happen if the
+ // Broadcasters & Listeners are being destroyed on separate threads
+ // simultaneously. The Broadcaster itself can't be shared out as a weak
+ // pointer, because some things that are broadcasters (e.g. the Target and
+ // the Process) are shared in their own right.
//
// For the most part, the Broadcaster functions dispatch to the
- // BroadcasterImpl, and are documented in the
- // public Broadcaster API above.
+ // BroadcasterImpl, and are documented in the public Broadcaster API above.
class BroadcasterImpl {
friend class Listener;
@@ -557,7 +548,7 @@ protected:
llvm::SmallVector<std::pair<lldb::ListenerSP, uint32_t &>, 4>
GetListeners();
- Broadcaster &m_broadcaster; ///< The broadcsater that this implements
+ Broadcaster &m_broadcaster; ///< The broadcaster that this implements
event_names_map m_event_names; ///< Optionally define event names for
///readability and logging for each event bit
collection m_listeners; ///< A list of Listener / event_mask pairs that are
diff --git a/include/lldb/Core/Communication.h b/include/lldb/Core/Communication.h
index 57fa483bd3a3..3e29307039e4 100644
--- a/include/lldb/Core/Communication.h
+++ b/include/lldb/Core/Communication.h
@@ -39,60 +39,57 @@ class Status;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Communication Communication.h "lldb/Core/Communication.h"
-/// @brief An abstract communications class.
+/// @class Communication Communication.h "lldb/Core/Communication.h" An
+/// abstract communications class.
///
-/// Communication is an class that handles data communication
-/// between two data sources. It uses a Connection class to do the
-/// real communication. This approach has a couple of advantages: it
-/// allows a single instance of this class to be used even though its
-/// connection can change. Connections could negotiate for different
-/// connections based on abilities like starting with Bluetooth and
-/// negotiating up to WiFi if available. It also allows this class to be
-/// subclassed by any interfaces that don't want to give bytes but want
-/// to validate and give out packets. This can be done by overriding:
+/// Communication is an class that handles data communication between two data
+/// sources. It uses a Connection class to do the real communication. This
+/// approach has a couple of advantages: it allows a single instance of this
+/// class to be used even though its connection can change. Connections could
+/// negotiate for different connections based on abilities like starting with
+/// Bluetooth and negotiating up to WiFi if available. It also allows this
+/// class to be subclassed by any interfaces that don't want to give bytes but
+/// want to validate and give out packets. This can be done by overriding:
///
/// AppendBytesToCache (const uint8_t *src, size_t src_len, bool broadcast);
///
-/// Communication inherits from Broadcaster which means it can be
-/// used in conjunction with Listener to wait for multiple broadcaster
-/// objects and multiple events from each of those objects.
-/// Communication defines a set of pre-defined event bits (see
-/// enumerations definitions that start with "eBroadcastBit" below).
+/// Communication inherits from Broadcaster which means it can be used in
+/// conjunction with Listener to wait for multiple broadcaster objects and
+/// multiple events from each of those objects. Communication defines a set of
+/// pre-defined event bits (see enumerations definitions that start with
+/// "eBroadcastBit" below).
///
/// There are two modes in which communications can occur:
/// @li single-threaded
/// @li multi-threaded
///
-/// In single-threaded mode, all reads and writes happen synchronously
-/// on the calling thread.
+/// In single-threaded mode, all reads and writes happen synchronously on the
+/// calling thread.
///
-/// In multi-threaded mode, a read thread is spawned that continually
-/// reads data and caches any received bytes. To start the read thread
-/// clients call:
+/// In multi-threaded mode, a read thread is spawned that continually reads
+/// data and caches any received bytes. To start the read thread clients call:
///
/// bool Communication::StartReadThread (Status *);
///
-/// If true is returned a read thread has been spawned that will
-/// continually execute a call to the pure virtual DoRead function:
+/// If true is returned a read thread has been spawned that will continually
+/// execute a call to the pure virtual DoRead function:
///
/// size_t Communication::ReadFromConnection (void *, size_t, uint32_t);
///
-/// When bytes are received the data gets cached in \a m_bytes and this
-/// class will broadcast a \b eBroadcastBitReadThreadGotBytes event.
-/// Clients that want packet based communication should override
-/// AppendBytesToCache. The subclasses can choose to call the
-/// built in AppendBytesToCache with the \a broadcast parameter set to
-/// false. This will cause the \b eBroadcastBitReadThreadGotBytes event
-/// not get broadcast, and then the subclass can post a \b
-/// eBroadcastBitPacketAvailable event when a full packet of data has
-/// been received.
+/// When bytes are received the data gets cached in \a m_bytes and this class
+/// will broadcast a \b eBroadcastBitReadThreadGotBytes event. Clients that
+/// want packet based communication should override AppendBytesToCache. The
+/// subclasses can choose to call the built in AppendBytesToCache with the \a
+/// broadcast parameter set to false. This will cause the \b
+/// eBroadcastBitReadThreadGotBytes event not get broadcast, and then the
+/// subclass can post a \b eBroadcastBitPacketAvailable event when a full
+/// packet of data has been received.
///
-/// If the connection is disconnected a \b eBroadcastBitDisconnected
-/// event gets broadcast. If the read thread exits a \b
-/// eBroadcastBitReadThreadDidExit event will be broadcast. Clients
-/// can also post a \b eBroadcastBitReadThreadShouldExit event to this
-/// object which will cause the read thread to exit.
+/// If the connection is disconnected a \b eBroadcastBitDisconnected event
+/// gets broadcast. If the read thread exits a \b
+/// eBroadcastBitReadThreadDidExit event will be broadcast. Clients can also
+/// post a \b eBroadcastBitReadThreadShouldExit event to this object which
+/// will cause the read thread to exit.
//----------------------------------------------------------------------
class Communication : public Broadcaster {
public:
@@ -120,8 +117,8 @@ public:
size_t src_len);
//------------------------------------------------------------------
- /// Construct the Communication object with the specified name for
- /// the Broadcaster that this object inherits from.
+ /// Construct the Communication object with the specified name for the
+ /// Broadcaster that this object inherits from.
///
/// @param[in] broadcaster_name
/// The name of the broadcaster object. This name should be as
@@ -141,9 +138,8 @@ public:
void Clear();
//------------------------------------------------------------------
- /// Connect using the current connection by passing \a url to its
- /// connect function.
- /// string.
+ /// Connect using the current connection by passing \a url to its connect
+ /// function. string.
///
/// @param[in] url
/// A string that contains all information needed by the
@@ -160,8 +156,7 @@ public:
lldb::ConnectionStatus Connect(const char *url, Status *error_ptr);
//------------------------------------------------------------------
- /// Disconnect the communications connection if one is currently
- /// connected.
+ /// Disconnect the communications connection if one is currently connected.
///
/// @return
/// \b True if the disconnect succeeded, \b false otherwise. The
@@ -189,16 +184,15 @@ public:
//------------------------------------------------------------------
/// Read bytes from the current connection.
///
- /// If no read thread is running, this function call the
- /// connection's Connection::Read(...) function to get any available.
+ /// If no read thread is running, this function call the connection's
+ /// Connection::Read(...) function to get any available.
///
- /// If a read thread has been started, this function will check for
- /// any cached bytes that have already been read and return any
- /// currently available bytes. If no bytes are cached, it will wait
- /// for the bytes to become available by listening for the \a
- /// eBroadcastBitReadThreadGotBytes event. If this function consumes
- /// all of the bytes in the cache, it will reset the
- /// \a eBroadcastBitReadThreadGotBytes event bit.
+ /// If a read thread has been started, this function will check for any
+ /// cached bytes that have already been read and return any currently
+ /// available bytes. If no bytes are cached, it will wait for the bytes to
+ /// become available by listening for the \a eBroadcastBitReadThreadGotBytes
+ /// event. If this function consumes all of the bytes in the cache, it will
+ /// reset the \a eBroadcastBitReadThreadGotBytes event bit.
///
/// @param[in] dst
/// A destination buffer that must be at least \a dst_len bytes
@@ -220,8 +214,8 @@ public:
lldb::ConnectionStatus &status, Status *error_ptr);
//------------------------------------------------------------------
- /// The actual write function that attempts to write to the
- /// communications protocol.
+ /// The actual write function that attempts to write to the communications
+ /// protocol.
///
/// Subclasses must override this function.
///
@@ -242,11 +236,10 @@ public:
//------------------------------------------------------------------
/// Sets the connection that it to be used by this class.
///
- /// By making a communication class that uses different connections
- /// it allows a single communication interface to negotiate and
- /// change its connection without any interruption to the client.
- /// It also allows the Communication class to be subclassed for
- /// packet based communication.
+ /// By making a communication class that uses different connections it
+ /// allows a single communication interface to negotiate and change its
+ /// connection without any interruption to the client. It also allows the
+ /// Communication class to be subclassed for packet based communication.
///
/// @param[in] connection
/// A connection that this class will own and destroy.
@@ -257,19 +250,19 @@ public:
void SetConnection(Connection *connection);
//------------------------------------------------------------------
- /// Starts a read thread whose sole purpose it to read bytes from
- /// the current connection. This function will call connection's
- /// read function:
+ /// Starts a read thread whose sole purpose it to read bytes from the
+ /// current connection. This function will call connection's read function:
///
/// size_t Connection::Read (void *, size_t);
///
/// When bytes are read and cached, this function will call:
///
- /// Communication::AppendBytesToCache (const uint8_t * bytes, size_t len, bool
+ /// Communication::AppendBytesToCache (const uint8_t * bytes, size_t len,
+ /// bool
/// broadcast);
///
- /// Subclasses should override this function if they wish to override
- /// the default action of caching the bytes and broadcasting a \b
+ /// Subclasses should override this function if they wish to override the
+ /// default action of caching the bytes and broadcasting a \b
/// eBroadcastBitReadThreadGotBytes event.
///
/// @return
@@ -277,8 +270,8 @@ public:
/// false otherwise.
///
/// @see size_t Connection::Read (void *, size_t);
- /// @see void Communication::AppendBytesToCache (const uint8_t * bytes, size_t
- /// len, bool broadcast);
+ /// @see void Communication::AppendBytesToCache (const uint8_t * bytes,
+ /// size_t len, bool broadcast);
//------------------------------------------------------------------
virtual bool StartReadThread(Status *error_ptr = nullptr);
@@ -301,11 +294,10 @@ public:
bool ReadThreadIsRunning();
//------------------------------------------------------------------
- /// The static read thread function. This function will call
- /// the "DoRead" function continuously and wait for data to become
- /// available. When data is received it will append the available
- /// data to the internal cache and broadcast a
- /// \b eBroadcastBitReadThreadGotBytes event.
+ /// The static read thread function. This function will call the "DoRead"
+ /// function continuously and wait for data to become available. When data
+ /// is received it will append the available data to the internal cache and
+ /// broadcast a \b eBroadcastBitReadThreadGotBytes event.
///
/// @param[in] comm_ptr
/// A pointer to an instance of this class.
@@ -364,18 +356,17 @@ protected:
lldb::ConnectionStatus &status, Status *error_ptr);
//------------------------------------------------------------------
- /// Append new bytes that get read from the read thread into the
- /// internal object byte cache. This will cause a \b
- /// eBroadcastBitReadThreadGotBytes event to be broadcast if \a
- /// broadcast is true.
+ /// Append new bytes that get read from the read thread into the internal
+ /// object byte cache. This will cause a \b eBroadcastBitReadThreadGotBytes
+ /// event to be broadcast if \a broadcast is true.
///
- /// Subclasses can override this function in order to inspect the
- /// received data and check if a packet is available.
+ /// Subclasses can override this function in order to inspect the received
+ /// data and check if a packet is available.
///
- /// Subclasses can also still call this function from the
- /// overridden method to allow the caching to correctly happen and
- /// suppress the broadcasting of the \a eBroadcastBitReadThreadGotBytes
- /// event by setting \a broadcast to false.
+ /// Subclasses can also still call this function from the overridden method
+ /// to allow the caching to correctly happen and suppress the broadcasting
+ /// of the \a eBroadcastBitReadThreadGotBytes event by setting \a broadcast
+ /// to false.
///
/// @param[in] src
/// A source buffer that must be at least \a src_len bytes
@@ -389,9 +380,9 @@ protected:
lldb::ConnectionStatus status);
//------------------------------------------------------------------
- /// Get any available bytes from our data cache. If this call
- /// empties the data cache, the \b eBroadcastBitReadThreadGotBytes event
- /// will be reset to signify no more bytes are available.
+ /// Get any available bytes from our data cache. If this call empties the
+ /// data cache, the \b eBroadcastBitReadThreadGotBytes event will be reset
+ /// to signify no more bytes are available.
///
/// @param[in] dst
/// A destination buffer that must be at least \a dst_len bytes
diff --git a/include/lldb/Core/Debugger.h b/include/lldb/Core/Debugger.h
index 34d35ffe7c80..cc7176e5c95d 100644
--- a/include/lldb/Core/Debugger.h
+++ b/include/lldb/Core/Debugger.h
@@ -76,7 +76,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Debugger Debugger.h "lldb/Core/Debugger.h"
-/// @brief A class to manage flag bits.
+/// A class to manage flag bits.
///
/// Provides a global root objects for the debugger core.
//----------------------------------------------------------------------
@@ -156,11 +156,9 @@ public:
lldb::ListenerSP GetListener() { return m_listener_sp; }
// This returns the Debugger's scratch source manager. It won't be able to
- // look up files in debug
- // information, but it can look up files by absolute path and display them to
- // you.
- // To get the target's source manager, call GetSourceManager on the target
- // instead.
+ // look up files in debug information, but it can look up files by absolute
+ // path and display them to you. To get the target's source manager, call
+ // GetSourceManager on the target instead.
SourceManager &GetSourceManager();
lldb::TargetSP GetSelectedTarget() {
@@ -171,10 +169,9 @@ public:
//------------------------------------------------------------------
/// Get accessor for the target list.
///
- /// The target list is part of the global debugger object. This
- /// the single debugger shared instance to control where targets
- /// get created and to allow for tracking and searching for targets
- /// based on certain criteria.
+ /// The target list is part of the global debugger object. This the single
+ /// debugger shared instance to control where targets get created and to
+ /// allow for tracking and searching for targets based on certain criteria.
///
/// @return
/// A global shared target list.
@@ -188,9 +185,8 @@ public:
void DispatchInputEndOfFile();
//------------------------------------------------------------------
- // If any of the streams are not set, set them to the in/out/err
- // stream of the top most input reader to ensure they at least have
- // something
+ // If any of the streams are not set, set them to the in/out/err stream of
+ // the top most input reader to ensure they at least have something
//------------------------------------------------------------------
void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in,
lldb::StreamFileSP &out,
@@ -323,9 +319,8 @@ public:
Status RunREPL(lldb::LanguageType language, const char *repl_options);
// This is for use in the command interpreter, when you either want the
- // selected target, or if no target
- // is present you want to prime the dummy target with entities that will be
- // copied over to new targets.
+ // selected target, or if no target is present you want to prime the dummy
+ // target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
@@ -378,8 +373,8 @@ protected:
lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a
// broadcaster manager of
// last resort.
- // It needs to get constructed before the target_list or any other
- // member that might want to broadcast through the debugger.
+ // It needs to get constructed before the target_list or any other member
+ // that might want to broadcast through the debugger.
TerminalState m_terminal_state;
TargetList m_target_list;
@@ -418,8 +413,8 @@ protected:
};
private:
- // Use Debugger::CreateInstance() to get a shared pointer to a new
- // debugger object
+ // Use Debugger::CreateInstance() to get a shared pointer to a new debugger
+ // object
Debugger(lldb::LogOutputCallback m_log_callback, void *baton);
DISALLOW_COPY_AND_ASSIGN(Debugger);
diff --git a/include/lldb/Core/Disassembler.h b/include/lldb/Core/Disassembler.h
index fa5e6a636aaf..ef1f2ee54dd1 100644
--- a/include/lldb/Core/Disassembler.h
+++ b/include/lldb/Core/Disassembler.h
@@ -22,8 +22,8 @@
#include "lldb/Utility/ConstString.h" // for ConstString
#include "lldb/Utility/FileSpec.h"
#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
-#include "lldb/lldb-enumerations.h" // for AddressClass, AddressClass...
#include "lldb/lldb-forward.h" // for InstructionSP, DisassemblerSP
+#include "lldb/lldb-private-enumerations.h" // for AddressClass
#include "lldb/lldb-types.h" // for addr_t, offset_t
#include "llvm/ADT/StringRef.h" // for StringRef
@@ -78,7 +78,7 @@ namespace lldb_private {
class Instruction {
public:
Instruction(const Address &address,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid);
+ AddressClass addr_class = AddressClass::eInvalid);
virtual ~Instruction();
@@ -102,12 +102,11 @@ public:
virtual void
CalculateMnemonicOperandsAndComment(const ExecutionContext *exe_ctx) = 0;
- lldb::AddressClass GetAddressClass();
+ AddressClass GetAddressClass();
void SetAddress(const Address &addr) {
- // Invalidate the address class to lazily discover
- // it if we need to.
- m_address_class = lldb::eAddressClassInvalid;
+ // Invalidate the address class to lazily discover it if we need to.
+ m_address_class = AddressClass::eInvalid;
m_address = addr;
}
@@ -235,14 +234,15 @@ public:
protected:
Address m_address; // The section offset address of this instruction
// We include an address class in the Instruction class to
- // allow the instruction specify the eAddressClassCodeAlternateISA
- // (currently used for thumb), and also to specify data (eAddressClassData).
- // The usual value will be eAddressClassCode, but often when
- // disassembling memory, you might run into data. This can
- // help us to disassemble appropriately.
+ // allow the instruction specify the
+ // AddressClass::eCodeAlternateISA (currently used for
+ // thumb), and also to specify data (AddressClass::eData).
+ // The usual value will be AddressClass::eCode, but often
+ // when disassembling memory, you might run into data.
+ // This can help us to disassemble appropriately.
private:
- lldb::AddressClass
- m_address_class; // Use GetAddressClass () accessor function!
+ AddressClass m_address_class; // Use GetAddressClass () accessor function!
+
protected:
Opcode m_opcode; // The opcode for this instruction
std::string m_opcode_name;
@@ -365,12 +365,10 @@ public:
};
// FindPlugin should be lax about the flavor string (it is too annoying to
- // have various internal uses of the
- // disassembler fail because the global flavor string gets set wrong.
- // Instead, if you get a flavor string you
+ // have various internal uses of the disassembler fail because the global
+ // flavor string gets set wrong. Instead, if you get a flavor string you
// don't understand, use the default. Folks who care to check can use the
- // FlavorValidForArchSpec method on the
- // disassembler they got back.
+ // FlavorValidForArchSpec method on the disassembler they got back.
static lldb::DisassemblerSP
FindPlugin(const ArchSpec &arch, const char *flavor, const char *plugin_name);
@@ -470,8 +468,8 @@ public:
const char *flavor) = 0;
protected:
- // SourceLine and SourceLinesToDisplay structures are only used in
- // the mixed source and assembly display methods internal to this class.
+ // SourceLine and SourceLinesToDisplay structures are only used in the mixed
+ // source and assembly display methods internal to this class.
struct SourceLine {
FileSpec file;
@@ -494,9 +492,9 @@ protected:
struct SourceLinesToDisplay {
std::vector<SourceLine> lines;
- // index of the "current" source line, if we want to highlight that
- // when displaying the source lines. (as opposed to the surrounding
- // source lines provided to give context)
+ // index of the "current" source line, if we want to highlight that when
+ // displaying the source lines. (as opposed to the surrounding source
+ // lines provided to give context)
size_t current_source_line;
// Whether to print a blank line at the end of the source lines.
@@ -507,8 +505,8 @@ protected:
}
};
- // Get the function's declaration line number, hopefully a line number earlier
- // than the opening curly brace at the start of the function body.
+ // Get the function's declaration line number, hopefully a line number
+ // earlier than the opening curly brace at the start of the function body.
static SourceLine GetFunctionDeclLineEntry(const SymbolContext &sc);
// Add the provided SourceLine to the map of filenames-to-source-lines-seen.
@@ -517,14 +515,13 @@ protected:
std::map<FileSpec, std::set<uint32_t>> &source_lines_seen);
// Given a source line, determine if we should print it when we're doing
- // mixed source & assembly output.
- // We're currently using the target.process.thread.step-avoid-regexp setting
- // (which is used for stepping over inlined STL functions by default) to
- // determine what source lines to avoid showing.
+ // mixed source & assembly output. We're currently using the
+ // target.process.thread.step-avoid-regexp setting (which is used for
+ // stepping over inlined STL functions by default) to determine what source
+ // lines to avoid showing.
//
// Returns true if this source line should be elided (if the source line
- // should
- // not be displayed).
+ // should not be displayed).
static bool
ElideMixedSourceAndDisassemblyLine(const ExecutionContext &exe_ctx,
const SymbolContext &sc, SourceLine &line);
diff --git a/include/lldb/Core/DumpRegisterValue.h b/include/lldb/Core/DumpRegisterValue.h
new file mode 100644
index 000000000000..bc4860fbc0e5
--- /dev/null
+++ b/include/lldb/Core/DumpRegisterValue.h
@@ -0,0 +1,31 @@
+//===-- DumpRegisterValue.h -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_CORE_DUMPREGISTERVALUE_H
+#define LLDB_CORE_DUMPREGISTERVALUE_H
+
+#include "lldb/lldb-enumerations.h"
+#include <cstdint>
+
+namespace lldb_private {
+
+class RegisterValue;
+struct RegisterInfo;
+class Stream;
+
+// The default value of 0 for reg_name_right_align_at means no alignment at
+// all.
+bool DumpRegisterValue(const RegisterValue &reg_val, Stream *s,
+ const RegisterInfo *reg_info, bool prefix_with_name,
+ bool prefix_with_alt_name, lldb::Format format,
+ uint32_t reg_name_right_align_at = 0);
+
+} // namespace lldb_private
+
+#endif // LLDB_CORE_DUMPREGISTERVALUE_H
diff --git a/include/lldb/Core/EmulateInstruction.h b/include/lldb/Core/EmulateInstruction.h
index b0a4267a00a2..5d23bcd7b96e 100644
--- a/include/lldb/Core/EmulateInstruction.h
+++ b/include/lldb/Core/EmulateInstruction.h
@@ -48,62 +48,61 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class EmulateInstruction EmulateInstruction.h
/// "lldb/Core/EmulateInstruction.h"
-/// @brief A class that allows emulation of CPU opcodes.
+/// A class that allows emulation of CPU opcodes.
///
-/// This class is a plug-in interface that is accessed through the
-/// standard static FindPlugin function call in the EmulateInstruction
-/// class. The FindPlugin takes a target triple and returns a new object
-/// if there is a plug-in that supports the architecture and OS. Four
-/// callbacks and a baton are provided. The four callbacks are read
-/// register, write register, read memory and write memory.
+/// This class is a plug-in interface that is accessed through the standard
+/// static FindPlugin function call in the EmulateInstruction class. The
+/// FindPlugin takes a target triple and returns a new object if there is a
+/// plug-in that supports the architecture and OS. Four callbacks and a baton
+/// are provided. The four callbacks are read register, write register, read
+/// memory and write memory.
///
-/// This class is currently designed for these main use cases:
-/// - Auto generation of Call Frame Information (CFI) from assembly code
-/// - Predicting single step breakpoint locations
-/// - Emulating instructions for breakpoint traps
+/// This class is currently designed for these main use cases: - Auto
+/// generation of Call Frame Information (CFI) from assembly code - Predicting
+/// single step breakpoint locations - Emulating instructions for breakpoint
+/// traps
///
-/// Objects can be asked to read an instruction which will cause a call
-/// to the read register callback to get the PC, followed by a read
-/// memory call to read the opcode. If ReadInstruction () returns true,
-/// then a call to EmulateInstruction::EvaluateInstruction () can be
-/// made. At this point the EmulateInstruction subclass will use all of
-/// the callbacks to emulate an instruction.
+/// Objects can be asked to read an instruction which will cause a call to the
+/// read register callback to get the PC, followed by a read memory call to
+/// read the opcode. If ReadInstruction () returns true, then a call to
+/// EmulateInstruction::EvaluateInstruction () can be made. At this point the
+/// EmulateInstruction subclass will use all of the callbacks to emulate an
+/// instruction.
///
/// Clients that provide the callbacks can either do the read/write
-/// registers/memory to actually emulate the instruction on a real or
-/// virtual CPU, or watch for the EmulateInstruction::Context which
-/// is context for the read/write register/memory which explains why
-/// the callback is being called. Examples of a context are:
-/// "pushing register 3 onto the stack at offset -12", or "adjusting
-/// stack pointer by -16". This extra context allows the generation of
+/// registers/memory to actually emulate the instruction on a real or virtual
+/// CPU, or watch for the EmulateInstruction::Context which is context for the
+/// read/write register/memory which explains why the callback is being
+/// called. Examples of a context are: "pushing register 3 onto the stack at
+/// offset -12", or "adjusting stack pointer by -16". This extra context
+/// allows the generation of
/// CFI information from assembly code without having to actually do
/// the read/write register/memory.
///
-/// Clients must be prepared that not all instructions for an
-/// Instruction Set Architecture (ISA) will be emulated.
+/// Clients must be prepared that not all instructions for an Instruction Set
+/// Architecture (ISA) will be emulated.
///
-/// Subclasses at the very least should implement the instructions that
-/// save and restore registers onto the stack and adjustment to the stack
-/// pointer. By just implementing a few instructions for an ISA that are
-/// the typical prologue opcodes, you can then generate CFI using a
-/// class that will soon be available.
+/// Subclasses at the very least should implement the instructions that save
+/// and restore registers onto the stack and adjustment to the stack pointer.
+/// By just implementing a few instructions for an ISA that are the typical
+/// prologue opcodes, you can then generate CFI using a class that will soon
+/// be available.
///
-/// Implementing all of the instructions that affect the PC can then
-/// allow single step prediction support.
+/// Implementing all of the instructions that affect the PC can then allow
+/// single step prediction support.
///
-/// Implementing all of the instructions allows for emulation of opcodes
-/// for breakpoint traps and will pave the way for "thread centric"
-/// debugging. The current debugging model is "process centric" where
-/// all threads must be stopped when any thread is stopped; when
-/// hitting software breakpoints we must disable the breakpoint by
-/// restoring the original breakpoint opcode, single stepping and
-/// restoring the breakpoint trap. If all threads were allowed to run
-/// then other threads could miss the breakpoint.
+/// Implementing all of the instructions allows for emulation of opcodes for
+/// breakpoint traps and will pave the way for "thread centric" debugging. The
+/// current debugging model is "process centric" where all threads must be
+/// stopped when any thread is stopped; when hitting software breakpoints we
+/// must disable the breakpoint by restoring the original breakpoint opcode,
+/// single stepping and restoring the breakpoint trap. If all threads were
+/// allowed to run then other threads could miss the breakpoint.
///
-/// This class centralizes the code that usually is done in separate
-/// code paths in a debugger (single step prediction, finding save
-/// restore locations of registers for unwinding stack frame variables)
-/// and emulating the instruction is just a bonus.
+/// This class centralizes the code that usually is done in separate code
+/// paths in a debugger (single step prediction, finding save restore
+/// locations of registers for unwinding stack frame variables) and emulating
+/// the instruction is just a bonus.
//----------------------------------------------------------------------
class EmulateInstruction : public PluginInterface {
@@ -125,8 +124,8 @@ public:
// prologue
eContextPushRegisterOnStack,
- // Exclusively used when restoring a register off the stack as part of
- // the epilogue
+ // Exclusively used when restoring a register off the stack as part of the
+ // epilogue
eContextPopRegisterOffStack,
// Add or subtract a value from the stack
@@ -135,8 +134,8 @@ public:
// Adjust the frame pointer for the current frame
eContextSetFramePointer,
- // Typically in an epilogue sequence. Copy the frame pointer back
- // into the stack pointer, use SP for CFA calculations again.
+ // Typically in an epilogue sequence. Copy the frame pointer back into the
+ // stack pointer, use SP for CFA calculations again.
eContextRestoreStackPointer,
// Add or subtract a value from a base address register (other than SP)
@@ -159,8 +158,8 @@ public:
// Used when performing an absolute branch where the
eContextAbsoluteBranchRegister,
- // Used when performing a supervisor call to an operating system to
- // provide a service:
+ // Used when performing a supervisor call to an operating system to provide
+ // a service:
eContextSupervisorCall,
// Used when performing a MemU operation to read the PC-relative offset
@@ -360,9 +359,8 @@ public:
const RegisterValue &reg_value);
// Type to represent the condition of an instruction. The UINT32 value is
- // reserved for the
- // unconditional case and all other value can be used in an architecture
- // dependent way.
+ // reserved for the unconditional case and all other value can be used in an
+ // architecture dependent way.
typedef uint32_t InstructionCondition;
static const InstructionCondition UnconditionalCondition = UINT32_MAX;
diff --git a/include/lldb/Core/Event.h b/include/lldb/Core/Event.h
index f4c7f4769a37..fa3017057675 100644
--- a/include/lldb/Core/Event.h
+++ b/include/lldb/Core/Event.h
@@ -121,10 +121,8 @@ public:
const ConstString &GetFlavor() const override { return GetFlavorString(); }
- bool WaitForEventReceived(
- const std::chrono::microseconds &abstime = std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- return m_predicate.WaitForValueEqualTo(true, abstime, timed_out);
+ bool WaitForEventReceived(const Timeout<std::micro> &timeout = llvm::None) {
+ return m_predicate.WaitForValueEqualTo(true, timeout);
}
private:
diff --git a/include/lldb/Core/FileLineResolver.h b/include/lldb/Core/FileLineResolver.h
index 54bce4fd2f41..855d749ed5d4 100644
--- a/include/lldb/Core/FileLineResolver.h
+++ b/include/lldb/Core/FileLineResolver.h
@@ -28,9 +28,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FileLineResolver FileLineResolver.h "lldb/Core/FileLineResolver.h"
-/// @brief This class finds address for source file and line. Optionally, it
-/// will look for inlined
-/// instances of the file and line specification.
+/// This class finds address for source file and line. Optionally, it will
+/// look for inlined instances of the file and line specification.
//----------------------------------------------------------------------
class FileLineResolver : public Searcher {
diff --git a/include/lldb/Core/FileSpecList.h b/include/lldb/Core/FileSpecList.h
index 3cbffca44f69..713ed2aaffc6 100644
--- a/include/lldb/Core/FileSpecList.h
+++ b/include/lldb/Core/FileSpecList.h
@@ -25,7 +25,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FileSpecList FileSpecList.h "lldb/Core/FileSpecList.h"
-/// @brief A file collection class.
+/// A file collection class.
///
/// A class that contains a mutable list of FileSpec objects.
//----------------------------------------------------------------------
@@ -56,8 +56,7 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
- /// Replace the file list in this object with the file list from
- /// \a rhs.
+ /// Replace the file list in this object with the file list from \a rhs.
///
/// @param[in] rhs
/// A file list object to copy.
@@ -80,8 +79,8 @@ public:
//------------------------------------------------------------------
/// Append a FileSpec object if unique.
///
- /// Appends \a file to the end of the file list if it doesn't
- /// already exist in the file list.
+ /// Appends \a file to the end of the file list if it doesn't already exist
+ /// in the file list.
///
/// @param[in] file
/// A new file to append to this file list.
@@ -107,8 +106,8 @@ public:
//------------------------------------------------------------------
/// Find a file index.
///
- /// Find the index of the file in the file spec list that matches
- /// \a file starting \a idx entries into the file spec list.
+ /// Find the index of the file in the file spec list that matches \a file
+ /// starting \a idx entries into the file spec list.
///
/// @param[in] idx
/// An index into the file list.
@@ -119,24 +118,18 @@ public:
/// @param[in] full
/// Should FileSpec::Equal be called with "full" true or false.
///
- /// @param[in] remove_backup_dots
- /// Should FileSpec::Equal be called with "remove_backup_dots" true or
- /// false.
- ///
/// @return
/// The index of the file that matches \a file if it is found,
/// else UINT32_MAX is returned.
//------------------------------------------------------------------
- size_t FindFileIndex(size_t idx, const FileSpec &file, bool full,
- bool remove_backup_dots = false) const;
+ size_t FindFileIndex(size_t idx, const FileSpec &file, bool full) const;
//------------------------------------------------------------------
/// Get file at index.
///
- /// Gets a file from the file list. If \a idx is not a valid index,
- /// an empty FileSpec object will be returned. The file objects
- /// that are returned can be tested using
- /// FileSpec::operator void*().
+ /// Gets a file from the file list. If \a idx is not a valid index, an empty
+ /// FileSpec object will be returned. The file objects that are returned can
+ /// be tested using FileSpec::operator void*().
///
/// @param[in] idx
/// An index into the file list.
@@ -151,8 +144,8 @@ public:
//------------------------------------------------------------------
/// Get file specification pointer at index.
///
- /// Gets a file from the file list. The file objects that are
- /// returned can be tested using FileSpec::operator void*().
+ /// Gets a file from the file list. The file objects that are returned can
+ /// be tested using FileSpec::operator void*().
///
/// @param[in] idx
/// An index into the file list.
@@ -166,9 +159,9 @@ public:
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, not any shared string
- /// values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, not any shared string values it may
+ /// refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
diff --git a/include/lldb/Core/FormatEntity.h b/include/lldb/Core/FormatEntity.h
index aa5ccb48e56a..93c7b3a94e4e 100644
--- a/include/lldb/Core/FormatEntity.h
+++ b/include/lldb/Core/FormatEntity.h
@@ -10,6 +10,7 @@
#ifndef liblldb_FormatEntity_h_
#define liblldb_FormatEntity_h_
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/FileSpec.h" // for FileSpec
#include "lldb/Utility/Status.h"
#include "lldb/lldb-enumerations.h" // for Format::eFormatDefault, Format
@@ -211,17 +212,15 @@ public:
llvm::StringRef &variable_name,
llvm::StringRef &variable_format);
- static size_t AutoComplete(llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ static size_t AutoComplete(lldb_private::CompletionRequest &request);
//----------------------------------------------------------------------
// Format the current elements into the stream \a s.
//
- // The root element will be stripped off and the format str passed in
- // will be either an empty string (print a description of this object),
- // or contain a . separated series like a domain name that identifies
- // further sub elements to display.
+ // The root element will be stripped off and the format str passed in will be
+ // either an empty string (print a description of this object), or contain a
+ // `.`-separated series like a domain name that identifies further
+ // sub-elements to display.
//----------------------------------------------------------------------
static bool FormatFileSpec(const FileSpec &file, Stream &s,
llvm::StringRef elements,
diff --git a/include/lldb/Core/IOHandler.h b/include/lldb/Core/IOHandler.h
index e8cfbade5c61..2170ad10674e 100644
--- a/include/lldb/Core/IOHandler.h
+++ b/include/lldb/Core/IOHandler.h
@@ -63,14 +63,13 @@ public:
virtual ~IOHandler();
- // Each IOHandler gets to run until it is done. It should read data
- // from the "in" and place output into "out" and "err and return
- // when done.
+ // Each IOHandler gets to run until it is done. It should read data from the
+ // "in" and place output into "out" and "err and return when done.
virtual void Run() = 0;
- // Called when an input reader should relinquish its control so another
- // can be pushed onto the IO handler stack, or so the current IO
- // handler can pop itself off the stack
+ // Called when an input reader should relinquish its control so another can
+ // be pushed onto the IO handler stack, or so the current IO handler can pop
+ // itself off the stack
virtual void Cancel() = 0;
@@ -273,8 +272,8 @@ public:
//------------------------------------------------------------------
virtual bool IOHandlerIsInputComplete(IOHandler &io_handler,
StringList &lines) {
- // Impose no requirements for input to be considered
- // complete. subclasses should do something more intelligent.
+ // Impose no requirements for input to be considered complete. subclasses
+ // should do something more intelligent.
return true;
}
@@ -289,8 +288,8 @@ public:
//------------------------------------------------------------------
// Intercept the IOHandler::Interrupt() calls and do something.
//
- // Return true if the interrupt was handled, false if the IOHandler
- // should continue to try handle the interrupt itself.
+ // Return true if the interrupt was handled, false if the IOHandler should
+ // continue to try handle the interrupt itself.
//------------------------------------------------------------------
virtual bool IOHandlerInterrupt(IOHandler &io_handler) { return false; }
@@ -302,8 +301,7 @@ protected:
// IOHandlerDelegateMultiline
//
// A IOHandlerDelegate that handles terminating multi-line input when
-// the last line is equal to "end_line" which is specified in the
-// constructor.
+// the last line is equal to "end_line" which is specified in the constructor.
//----------------------------------------------------------------------
class IOHandlerDelegateMultiline : public IOHandlerDelegate {
public:
@@ -325,9 +323,8 @@ public:
// Determine whether the end of input signal has been entered
const size_t num_lines = lines.GetSize();
if (num_lines > 0 && lines[num_lines - 1] == m_end_line) {
- // Remove the terminal line from "lines" so it doesn't appear in
- // the resulting input and return true to indicate we are done
- // getting lines
+ // Remove the terminal line from "lines" so it doesn't appear in the
+ // resulting input and return true to indicate we are done getting lines
lines.PopBack();
return true;
}
@@ -454,8 +451,7 @@ protected:
};
// The order of base classes is important. Look at the constructor of
-// IOHandlerConfirm
-// to see how.
+// IOHandlerConfirm to see how.
class IOHandlerConfirm : public IOHandlerDelegate, public IOHandlerEditline {
public:
IOHandlerConfirm(Debugger &debugger, llvm::StringRef prompt,
diff --git a/include/lldb/Core/LoadedModuleInfoList.h b/include/lldb/Core/LoadedModuleInfoList.h
index ecbe3548d687..6554c64fa870 100644
--- a/include/lldb/Core/LoadedModuleInfoList.h
+++ b/include/lldb/Core/LoadedModuleInfoList.h
@@ -13,10 +13,14 @@
// C Includes
// C++ Includes
+#include <cassert>
+#include <string>
#include <vector>
// Other libraries and framework includes
+#include "lldb/lldb-defines.h"
#include "lldb/lldb-private-forward.h"
+#include "lldb/lldb-types.h"
namespace lldb_private {
class LoadedModuleInfoList {
diff --git a/include/lldb/Core/Mangled.h b/include/lldb/Core/Mangled.h
index 22778fabe63d..d263297ecfc6 100644
--- a/include/lldb/Core/Mangled.h
+++ b/include/lldb/Core/Mangled.h
@@ -28,15 +28,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Mangled Mangled.h "lldb/Core/Mangled.h"
-/// @brief A class that handles mangled names.
+/// A class that handles mangled names.
///
-/// Designed to handle mangled names. The demangled version of any names
-/// will be computed when the demangled name is accessed through the
-/// Demangled() acccessor. This class can also tokenize the demangled
-/// version of the name for powerful searches. Functions and symbols
-/// could make instances of this class for their mangled names. Uniqued
-/// string pools are used for the mangled, demangled, and token string
-/// values to allow for faster comparisons and for efficient memory use.
+/// Designed to handle mangled names. The demangled version of any names will
+/// be computed when the demangled name is accessed through the Demangled()
+/// acccessor. This class can also tokenize the demangled version of the name
+/// for powerful searches. Functions and symbols could make instances of this
+/// class for their mangled names. Uniqued string pools are used for the
+/// mangled, demangled, and token string values to allow for faster
+/// comparisons and for efficient memory use.
//----------------------------------------------------------------------
class Mangled {
public:
@@ -91,16 +91,16 @@ public:
//----------------------------------------------------------------------
/// Destructor
///
- /// Releases its ref counts on the mangled and demangled strings that
- /// live in the global string pool.
+ /// Releases its ref counts on the mangled and demangled strings that live
+ /// in the global string pool.
//----------------------------------------------------------------------
~Mangled();
//----------------------------------------------------------------------
/// Convert to pointer operator.
///
- /// This allows code to check a Mangled object to see if it contains
- /// a valid mangled name using code such as:
+ /// This allows code to check a Mangled object to see if it contains a valid
+ /// mangled name using code such as:
///
/// @code
/// Mangled mangled(...);
@@ -117,8 +117,8 @@ public:
//----------------------------------------------------------------------
/// Logical NOT operator.
///
- /// This allows code to check a Mangled object to see if it contains
- /// an empty mangled name using code such as:
+ /// This allows code to check a Mangled object to see if it contains an
+ /// empty mangled name using code such as:
///
/// @code
/// Mangled mangled(...);
@@ -158,8 +158,8 @@ public:
//----------------------------------------------------------------------
/// Dump a description of this object to a Stream \a s.
///
- /// Dump a Mangled object to stream \a s. We don't force our
- /// demangled name to be computed currently (we don't use the accessor).
+ /// Dump a Mangled object to stream \a s. We don't force our demangled name
+ /// to be computed currently (we don't use the accessor).
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -245,9 +245,9 @@ public:
//----------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, not any shared string
- /// values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, not any shared string values it may
+ /// refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -259,8 +259,8 @@ public:
//----------------------------------------------------------------------
/// Set the string value in this object.
///
- /// If \a is_mangled is \b true, then the mangled named is set to \a
- /// name, else the demangled name is set to \a name.
+ /// If \a is_mangled is \b true, then the mangled named is set to \a name,
+ /// else the demangled name is set to \a name.
///
/// @param[in] name
/// The already const version of the name for this object.
@@ -285,14 +285,14 @@ public:
//----------------------------------------------------------------------
/// Try to guess the language from the mangling.
///
- /// For a mangled name to have a language it must have both a mangled
- /// and a demangled name and it can be guessed from the mangling what
- /// the language is. Note: this will return C++ for any language that
- /// uses Itanium ABI mangling.
+ /// For a mangled name to have a language it must have both a mangled and a
+ /// demangled name and it can be guessed from the mangling what the language
+ /// is. Note: this will return C++ for any language that uses Itanium ABI
+ /// mangling.
///
- /// Standard C function names will return eLanguageTypeUnknown because
- /// they aren't mangled and it isn't clear what language the name
- /// represents (there will be no mangled name).
+ /// Standard C function names will return eLanguageTypeUnknown because they
+ /// aren't mangled and it isn't clear what language the name represents
+ /// (there will be no mangled name).
///
/// @return
/// The language for the mangled/demangled name, eLanguageTypeUnknown
diff --git a/include/lldb/Core/MappedHash.h b/include/lldb/Core/MappedHash.h
index d56a6d537868..1bdf59c73649 100644
--- a/include/lldb/Core/MappedHash.h
+++ b/include/lldb/Core/MappedHash.h
@@ -24,6 +24,7 @@
// Project includes
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Stream.h"
+#include "llvm/Support/DJB.h"
class MappedHash {
public:
@@ -32,22 +33,10 @@ public:
// by the ELF GNU_HASH sections
};
- static uint32_t HashStringUsingDJB(const char *s) {
- uint32_t h = 5381;
-
- for (unsigned char c = *s; c; c = *++s)
- h = ((h << 5) + h) + c;
-
- return h;
- }
-
- static uint32_t HashString(uint32_t hash_function, const char *s) {
- if (!s)
- return 0;
-
+ static uint32_t HashString(uint32_t hash_function, llvm::StringRef s) {
switch (hash_function) {
case MappedHash::eHashFunctionDJB:
- return HashStringUsingDJB(s);
+ return llvm::djbHash(s);
default:
break;
@@ -152,164 +141,6 @@ public:
// Write (int fd);
};
- template <typename __KeyType, class __HeaderDataType, class __ValueType>
- class ExportTable {
- public:
- typedef __HeaderDataType HeaderDataType;
- typedef Header<HeaderDataType> HeaderType;
- typedef __KeyType KeyType;
- typedef __ValueType ValueType;
-
- struct Entry {
- uint32_t hash;
- KeyType key;
- ValueType value;
- };
-
- typedef std::vector<ValueType> ValueArrayType;
-
- typedef std::map<KeyType, ValueArrayType> HashData;
- // Map a name hash to one or more name infos
- typedef std::map<uint32_t, HashData> HashToHashData;
-
- virtual KeyType GetKeyForStringType(const char *cstr) const = 0;
-
- virtual size_t GetByteSize(const HashData &key_to_key_values) = 0;
-
- virtual bool WriteHashData(const HashData &hash_data,
- lldb_private::Stream &ostrm) = 0;
- //
- void AddEntry(const char *cstr, const ValueType &value) {
- Entry entry;
- entry.hash = MappedHash::HashString(eHashFunctionDJB, cstr);
- entry.key = GetKeyForStringType(cstr);
- entry.value = value;
- m_entries.push_back(entry);
- }
-
- void Save(const HeaderDataType &header_data, lldb_private::Stream &ostrm) {
- if (m_entries.empty())
- return;
-
- const uint32_t num_entries = m_entries.size();
- uint32_t i = 0;
-
- HeaderType header;
-
- header.magic = HASH_MAGIC;
- header.version = 1;
- header.hash_function = eHashFunctionDJB;
- header.bucket_count = 0;
- header.hashes_count = 0;
- header.prologue_length = header_data.GetByteSize();
-
- // We need to figure out the number of unique hashes first before we can
- // calculate the number of buckets we want to use.
- typedef std::vector<uint32_t> hash_coll;
- hash_coll unique_hashes;
- unique_hashes.resize(num_entries);
- for (i = 0; i < num_entries; ++i)
- unique_hashes[i] = m_entries[i].hash;
- std::sort(unique_hashes.begin(), unique_hashes.end());
- hash_coll::iterator pos =
- std::unique(unique_hashes.begin(), unique_hashes.end());
- const size_t num_unique_hashes =
- std::distance(unique_hashes.begin(), pos);
-
- if (num_unique_hashes > 1024)
- header.bucket_count = num_unique_hashes / 4;
- else if (num_unique_hashes > 16)
- header.bucket_count = num_unique_hashes / 2;
- else
- header.bucket_count = num_unique_hashes;
- if (header.bucket_count == 0)
- header.bucket_count = 1;
-
- std::vector<HashToHashData> hash_buckets;
- std::vector<uint32_t> hash_indexes(header.bucket_count, 0);
- std::vector<uint32_t> hash_values;
- std::vector<uint32_t> hash_offsets;
- hash_buckets.resize(header.bucket_count);
- uint32_t bucket_entry_empties = 0;
- // StreamString hash_file_data(Stream::eBinary,
- // dwarf->GetObjectFile()->GetAddressByteSize(),
- // dwarf->GetObjectFile()->GetByteSize());
-
- // Push all of the hashes into their buckets and create all bucket
- // entries all populated with data.
- for (i = 0; i < num_entries; ++i) {
- const uint32_t hash = m_entries[i].hash;
- const uint32_t bucket_idx = hash % header.bucket_count;
- const uint32_t strp_offset = m_entries[i].str_offset;
- const uint32_t die_offset = m_entries[i].die_offset;
- hash_buckets[bucket_idx][hash][strp_offset].push_back(die_offset);
- }
-
- // Now for each bucket we write the bucket value which is the
- // number of hashes and the hash index encoded into a single
- // 32 bit unsigned integer.
- for (i = 0; i < header.bucket_count; ++i) {
- HashToHashData &bucket_entry = hash_buckets[i];
-
- if (bucket_entry.empty()) {
- // Empty bucket
- ++bucket_entry_empties;
- hash_indexes[i] = UINT32_MAX;
- } else {
- const uint32_t hash_value_index = hash_values.size();
- uint32_t hash_count = 0;
- typename HashToHashData::const_iterator pos, end = bucket_entry.end();
- for (pos = bucket_entry.begin(); pos != end; ++pos) {
- hash_values.push_back(pos->first);
- hash_offsets.push_back(GetByteSize(pos->second));
- ++hash_count;
- }
-
- hash_indexes[i] = hash_value_index;
- }
- }
- header.hashes_count = hash_values.size();
-
- // Write the header out now that we have the hash_count
- header.Write(ostrm);
-
- // Now for each bucket we write the start index of the hashes
- // for the current bucket, or UINT32_MAX if the bucket is empty
- for (i = 0; i < header.bucket_count; ++i) {
- ostrm.PutHex32(hash_indexes[i]);
- }
-
- // Now we need to write out all of the hash values
- for (i = 0; i < header.hashes_count; ++i) {
- ostrm.PutHex32(hash_values[i]);
- }
-
- // Now we need to write out all of the hash data offsets,
- // there is an offset for each hash in the hashes array
- // that was written out above
- for (i = 0; i < header.hashes_count; ++i) {
- ostrm.PutHex32(hash_offsets[i]);
- }
-
- // Now we write the data for each hash and verify we got the offset
- // correct above...
- for (i = 0; i < header.bucket_count; ++i) {
- HashToHashData &bucket_entry = hash_buckets[i];
-
- typename HashToHashData::const_iterator pos, end = bucket_entry.end();
- for (pos = bucket_entry.begin(); pos != end; ++pos) {
- if (!bucket_entry.empty()) {
- WriteHashData(pos->second);
- }
- }
- }
- }
-
- protected:
- typedef std::vector<Entry> collection;
- collection m_entries;
- };
-
// A class for reading and using a saved hash table from a block of data
// in memory
template <typename __KeyType, class __HeaderType, class __HashData>
@@ -377,8 +208,8 @@ public:
return result;
}
- bool Find(const char *name, Pair &pair) const {
- if (!name || !name[0])
+ bool Find(llvm::StringRef name, Pair &pair) const {
+ if (name.empty())
return false;
if (IsValid()) {
@@ -425,13 +256,12 @@ public:
return false;
}
- // This method must be implemented in any subclasses.
- // The KeyType is user specified and must somehow result in a string
- // value. For example, the KeyType might be a string offset in a string
- // table and subclasses can store their string table as a member of the
- // subclass and return a valie "const char *" given a "key". The value
- // could also be a C string pointer, in which case just returning "key"
- // will suffice.
+ // This method must be implemented in any subclasses. The KeyType is user
+ // specified and must somehow result in a string value. For example, the
+ // KeyType might be a string offset in a string table and subclasses can
+ // store their string table as a member of the subclass and return a valie
+ // "const char *" given a "key". The value could also be a C string
+ // pointer, in which case just returning "key" will suffice.
virtual const char *GetStringForKeyType(KeyType key) const = 0;
virtual bool ReadHashData(uint32_t hash_data_offset,
@@ -439,20 +269,19 @@ public:
// This method must be implemented in any subclasses and it must try to
// read one "Pair" at the offset pointed to by the "hash_data_offset_ptr"
- // parameter. This offset should be updated as bytes are consumed and
- // a value "Result" enum should be returned. If the "name" matches the
- // full name for the "pair.key" (which must be filled in by this call),
- // then the HashData in the pair ("pair.value") should be extracted and
- // filled in and "eResultKeyMatch" should be returned. If "name" doesn't
- // match this string for the key, then "eResultKeyMismatch" should be
- // returned and all data for the current HashData must be consumed or
- // skipped and the "hash_data_offset_ptr" offset needs to be updated to
- // point to the next HashData. If the end of the HashData objects for
- // a given hash value have been reached, then "eResultEndOfHashData"
- // should be returned. If anything else goes wrong during parsing,
- // return "eResultError" and the corresponding "Find()" function will
- // be canceled and return false.
- virtual Result GetHashDataForName(const char *name,
+ // parameter. This offset should be updated as bytes are consumed and a
+ // value "Result" enum should be returned. If the "name" matches the full
+ // name for the "pair.key" (which must be filled in by this call), then the
+ // HashData in the pair ("pair.value") should be extracted and filled in
+ // and "eResultKeyMatch" should be returned. If "name" doesn't match this
+ // string for the key, then "eResultKeyMismatch" should be returned and all
+ // data for the current HashData must be consumed or skipped and the
+ // "hash_data_offset_ptr" offset needs to be updated to point to the next
+ // HashData. If the end of the HashData objects for a given hash value have
+ // been reached, then "eResultEndOfHashData" should be returned. If
+ // anything else goes wrong during parsing, return "eResultError" and the
+ // corresponding "Find()" function will be canceled and return false.
+ virtual Result GetHashDataForName(llvm::StringRef name,
lldb::offset_t *hash_data_offset_ptr,
Pair &pair) const = 0;
diff --git a/include/lldb/Core/Module.h b/include/lldb/Core/Module.h
index da981ade78ba..83d5f519f086 100644
--- a/include/lldb/Core/Module.h
+++ b/include/lldb/Core/Module.h
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h" // for Address
#include "lldb/Core/ModuleSpec.h" // for ModuleSpec
+#include "lldb/Symbol/ObjectFile.h" // for ObjectFile
#include "lldb/Symbol/SymbolContextScope.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Target/PathMappingList.h"
@@ -93,33 +94,30 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Module Module.h "lldb/Core/Module.h"
-/// @brief A class that describes an executable image and its associated
+/// A class that describes an executable image and its associated
/// object and symbol files.
///
/// The module is designed to be able to select a single slice of an
-/// executable image as it would appear on disk and during program
-/// execution.
+/// executable image as it would appear on disk and during program execution.
///
/// Modules control when and if information is parsed according to which
/// accessors are called. For example the object file (ObjectFile)
-/// representation will only be parsed if the object file is requested
-/// using the Module::GetObjectFile() is called. The debug symbols
-/// will only be parsed if the symbol vendor (SymbolVendor) is
-/// requested using the Module::GetSymbolVendor() is called.
+/// representation will only be parsed if the object file is requested using
+/// the Module::GetObjectFile() is called. The debug symbols will only be
+/// parsed if the symbol vendor (SymbolVendor) is requested using the
+/// Module::GetSymbolVendor() is called.
///
-/// The module will parse more detailed information as more queries are
-/// made.
+/// The module will parse more detailed information as more queries are made.
//----------------------------------------------------------------------
class Module : public std::enable_shared_from_this<Module>,
public SymbolContextScope {
public:
- // Static functions that can track the lifetime of module objects.
- // This is handy because we might have Module objects that are in
- // shared pointers that aren't in the global module list (from
- // ModuleList). If this is the case we need to know about it.
- // The modules in the global list maintained by these functions
- // can be viewed using the "target modules list" command using the
- // "--global" (-g for short).
+ // Static functions that can track the lifetime of module objects. This is
+ // handy because we might have Module objects that are in shared pointers
+ // that aren't in the global module list (from ModuleList). If this is the
+ // case we need to know about it. The modules in the global list maintained
+ // by these functions can be viewed using the "target modules list" command
+ // using the "--global" (-g for short).
static size_t GetNumberAllocatedModules();
static Module *GetAllocatedModuleAtIndex(size_t idx);
@@ -129,8 +127,8 @@ public:
//------------------------------------------------------------------
/// Construct with file specification and architecture.
///
- /// Clients that wish to share modules with other targets should
- /// use ModuleList::GetSharedModule().
+ /// Clients that wish to share modules with other targets should use
+ /// ModuleList::GetSharedModule().
///
/// @param[in] file_spec
/// The file specification for the on disk representation of
@@ -158,8 +156,23 @@ public:
Module(const ModuleSpec &module_spec);
- static lldb::ModuleSP
- CreateJITModule(const lldb::ObjectFileJITDelegateSP &delegate_sp);
+ template <typename ObjFilePlugin, typename... Args>
+ static lldb::ModuleSP CreateModuleFromObjectFile(Args &&... args) {
+ // Must create a module and place it into a shared pointer before we can
+ // create an object file since it has a std::weak_ptr back to the module,
+ // so we need to control the creation carefully in this static function
+ lldb::ModuleSP module_sp(new Module());
+ module_sp->m_objfile_sp =
+ std::make_shared<ObjFilePlugin>(module_sp, std::forward<Args>(args)...);
+
+ // Once we get the object file, update our module with the object file's
+ // architecture since it might differ in vendor/os if some parts were
+ // unknown.
+ if (!module_sp->m_objfile_sp->GetArchitecture(module_sp->m_arch))
+ return nullptr;
+
+ return module_sp;
+ }
//------------------------------------------------------------------
/// Destructor.
@@ -169,13 +182,13 @@ public:
bool MatchesModuleSpec(const ModuleSpec &module_ref);
//------------------------------------------------------------------
- /// Set the load address for all sections in a module to be the
- /// file address plus \a slide.
+ /// Set the load address for all sections in a module to be the file address
+ /// plus \a slide.
///
- /// Many times a module will be loaded in a target with a constant
- /// offset applied to all top level sections. This function can
- /// set the load address for all top level sections to be the
- /// section file address + offset.
+ /// Many times a module will be loaded in a target with a constant offset
+ /// applied to all top level sections. This function can set the load
+ /// address for all top level sections to be the section file address +
+ /// offset.
///
/// @param[in] target
/// The target in which to apply the section load addresses.
@@ -225,19 +238,18 @@ public:
//------------------------------------------------------------------
/// Get the module path and object name.
///
- /// Modules can refer to object files. In this case the specification
- /// is simple and would return the path to the file:
+ /// Modules can refer to object files. In this case the specification is
+ /// simple and would return the path to the file:
///
/// "/usr/lib/foo.dylib"
///
- /// Modules can be .o files inside of a BSD archive (.a file). In
- /// this case, the object specification will look like:
+ /// Modules can be .o files inside of a BSD archive (.a file). In this case,
+ /// the object specification will look like:
///
/// "/usr/lib/foo.a(bar.o)"
///
- /// There are many places where logging wants to log this fully
- /// qualified specification, so we centralize this functionality
- /// here.
+ /// There are many places where logging wants to log this fully qualified
+ /// specification, so we centralize this functionality here.
///
/// @return
/// The object path + object name if there is one.
@@ -247,11 +259,10 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s. The dumped content will be only what has
- /// been loaded or parsed up to this point at which this function
- /// is called, so this is a good way to see what has been parsed
- /// in a module.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s. The dumped content will be only what has been loaded or parsed up
+ /// to this point at which this function is called, so this is a good way to
+ /// see what has been parsed in a module.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -316,8 +327,8 @@ public:
//------------------------------------------------------------------
/// Find compile units by partial or full path.
///
- /// Finds all compile units that match \a path in all of the modules
- /// and returns the results in \a sc_list.
+ /// Finds all compile units that match \a path in all of the modules and
+ /// returns the results in \a sc_list.
///
/// @param[in] path
/// The name of the function we are looking for.
@@ -342,8 +353,7 @@ public:
///
/// If the function is an inlined function, it will have a block,
/// representing the inlined function, and the function will be the
- /// containing function. If it is not inlined, then the block will
- /// be NULL.
+ /// containing function. If it is not inlined, then the block will be NULL.
///
/// @param[in] name
/// The name of the compile unit we are looking for.
@@ -379,8 +389,7 @@ public:
///
/// If the function is an inlined function, it will have a block,
/// representing the inlined function, and the function will be the
- /// containing function. If it is not inlined, then the block will
- /// be NULL.
+ /// containing function. If it is not inlined, then the block will be NULL.
///
/// @param[in] regex
/// A regular expression to use when matching the name.
@@ -438,26 +447,19 @@ public:
/// @param[in] parent_decl_ctx
/// If valid, a decl context that results must exist within
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
size_t FindGlobalVariables(const ConstString &name,
const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
- VariableList &variable_list);
+ size_t max_matches, VariableList &variable_list);
//------------------------------------------------------------------
/// Find global and static variables by regular expression.
@@ -465,44 +467,36 @@ public:
/// @param[in] regex
/// A regular expression to use when matching the name.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const RegularExpression &regex, bool append,
- size_t max_matches, VariableList &variable_list);
+ size_t FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
+ VariableList &variable_list);
//------------------------------------------------------------------
/// Find types by name.
///
- /// Type lookups in modules go through the SymbolVendor (which will
- /// use one or more SymbolFile subclasses). The SymbolFile needs to
- /// be able to lookup types by basename and not the fully qualified
- /// typename. This allows the type accelerator tables to stay small,
- /// even with heavily templatized C++. The type search will then
- /// narrow down the search results. If "exact_match" is true, then
- /// the type search will only match exact type name matches. If
- /// "exact_match" is false, the type will match as long as the base
- /// typename matches and as long as any immediate containing
- /// namespaces/class scopes that are specified match. So to search
- /// for a type "d" in "b::c", the name "b::c::d" can be specified
- /// and it will match any class/namespace "b" which contains a
- /// class/namespace "c" which contains type "d". We do this to
- /// allow users to not always have to specify complete scoping on
- /// all expressions, but it also allows for exact matching when
- /// required.
+ /// Type lookups in modules go through the SymbolVendor (which will use one
+ /// or more SymbolFile subclasses). The SymbolFile needs to be able to
+ /// lookup types by basename and not the fully qualified typename. This
+ /// allows the type accelerator tables to stay small, even with heavily
+ /// templatized C++. The type search will then narrow down the search
+ /// results. If "exact_match" is true, then the type search will only match
+ /// exact type name matches. If "exact_match" is false, the type will match
+ /// as long as the base typename matches and as long as any immediate
+ /// containing namespaces/class scopes that are specified match. So to
+ /// search for a type "d" in "b::c", the name "b::c::d" can be specified and
+ /// it will match any class/namespace "b" which contains a class/namespace
+ /// "c" which contains type "d". We do this to allow users to not always
+ /// have to specify complete scoping on all expressions, but it also allows
+ /// for exact matching when required.
///
/// @param[in] sc
/// A symbol context that scopes where to extract a type list
@@ -535,9 +529,9 @@ public:
const ConstString &type_name, bool exact_match);
//------------------------------------------------------------------
- /// Find types by name that are in a namespace. This function is
- /// used by the expression parser when searches need to happen in
- /// an exact namespace scope.
+ /// Find types by name that are in a namespace. This function is used by the
+ /// expression parser when searches need to happen in an exact namespace
+ /// scope.
///
/// @param[in] sc
/// A symbol context that scopes where to extract a type list
@@ -572,9 +566,9 @@ public:
//------------------------------------------------------------------
/// Get const accessor for the module file specification.
///
- /// This function returns the file for the module on the host system
- /// that is running LLDB. This can differ from the path on the
- /// platform since we might be doing remote debugging.
+ /// This function returns the file for the module on the host system that is
+ /// running LLDB. This can differ from the path on the platform since we
+ /// might be doing remote debugging.
///
/// @return
/// A const reference to the file specification object.
@@ -584,14 +578,13 @@ public:
//------------------------------------------------------------------
/// Get accessor for the module platform file specification.
///
- /// Platform file refers to the path of the module as it is known on
- /// the remote system on which it is being debugged. For local
- /// debugging this is always the same as Module::GetFileSpec(). But
- /// remote debugging might mention a file "/usr/lib/liba.dylib"
- /// which might be locally downloaded and cached. In this case the
- /// platform file could be something like:
- /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib"
- /// The file could also be cached in a local developer kit directory.
+ /// Platform file refers to the path of the module as it is known on the
+ /// remote system on which it is being debugged. For local debugging this is
+ /// always the same as Module::GetFileSpec(). But remote debugging might
+ /// mention a file "/usr/lib/liba.dylib" which might be locally downloaded
+ /// and cached. In this case the platform file could be something like:
+ /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib" The
+ /// file could also be cached in a local developer kit directory.
///
/// @return
/// A const reference to the file specification object.
@@ -631,8 +624,8 @@ public:
}
//------------------------------------------------------------------
- /// Tells whether this module is capable of being the main executable
- /// for a process.
+ /// Tells whether this module is capable of being the main executable for a
+ /// process.
///
/// @return
/// \b true if it is, \b false otherwise.
@@ -640,9 +633,9 @@ public:
bool IsExecutable();
//------------------------------------------------------------------
- /// Tells whether this module has been loaded in the target passed in.
- /// This call doesn't distinguish between whether the module is loaded
- /// by the dynamic loader, or by a "target module add" type call.
+ /// Tells whether this module has been loaded in the target passed in. This
+ /// call doesn't distinguish between whether the module is loaded by the
+ /// dynamic loader, or by a "target module add" type call.
///
/// @param[in] target
/// The target to check whether this is loaded in.
@@ -673,9 +666,8 @@ public:
//------------------------------------------------------------------
/// Get the object file representation for the current architecture.
///
- /// If the object file has not been located or parsed yet, this
- /// function will find the best ObjectFile plug-in that can parse
- /// Module::m_file.
+ /// If the object file has not been located or parsed yet, this function
+ /// will find the best ObjectFile plug-in that can parse Module::m_file.
///
/// @return
/// If Module::m_file does not exist, or no plug-in was found
@@ -688,12 +680,12 @@ public:
virtual ObjectFile *GetObjectFile();
//------------------------------------------------------------------
- /// Get the unified section list for the module. This is the section
- /// list created by the module's object file and any debug info and
- /// symbol files created by the symbol vendor.
+ /// Get the unified section list for the module. This is the section list
+ /// created by the module's object file and any debug info and symbol files
+ /// created by the symbol vendor.
///
- /// If the symbol vendor has not been loaded yet, this function
- /// will return the section list for the object file.
+ /// If the symbol vendor has not been loaded yet, this function will return
+ /// the section list for the object file.
///
/// @return
/// Unified module section list.
@@ -701,27 +693,26 @@ public:
virtual SectionList *GetSectionList();
//------------------------------------------------------------------
- /// Notify the module that the file addresses for the Sections have
- /// been updated.
+ /// Notify the module that the file addresses for the Sections have been
+ /// updated.
///
- /// If the Section file addresses for a module are updated, this
- /// method should be called. Any parts of the module, object file,
- /// or symbol file that has cached those file addresses must invalidate
- /// or update its cache.
+ /// If the Section file addresses for a module are updated, this method
+ /// should be called. Any parts of the module, object file, or symbol file
+ /// that has cached those file addresses must invalidate or update its
+ /// cache.
//------------------------------------------------------------------
virtual void SectionFileAddressesChanged();
- uint32_t GetVersion(uint32_t *versions, uint32_t num_versions);
+ llvm::VersionTuple GetVersion();
//------------------------------------------------------------------
/// Load an object file from memory.
///
- /// If available, the size of the object file in memory may be
- /// passed to avoid additional round trips to process memory.
- /// If the size is not provided, a default value is used. This
- /// value should be large enough to enable the ObjectFile plugins
- /// to read the header of the object file without going back to the
- /// process.
+ /// If available, the size of the object file in memory may be passed to
+ /// avoid additional round trips to process memory. If the size is not
+ /// provided, a default value is used. This value should be large enough to
+ /// enable the ObjectFile plugins to read the header of the object file
+ /// without going back to the process.
///
/// @return
/// The object file loaded from memory or nullptr, if the operation
@@ -733,9 +724,8 @@ public:
//------------------------------------------------------------------
/// Get the symbol vendor interface for the current architecture.
///
- /// If the symbol vendor file has not been located yet, this
- /// function will find the best SymbolVendor plug-in that can
- /// use the current object file.
+ /// If the symbol vendor file has not been located yet, this function will
+ /// find the best SymbolVendor plug-in that can use the current object file.
///
/// @return
/// If this module does not have a valid object file, or no
@@ -758,11 +748,11 @@ public:
TypeList *GetTypeList();
//------------------------------------------------------------------
- /// Get a pointer to the UUID value contained in this object.
+ /// Get a reference to the UUID value contained in this object.
///
- /// If the executable image file doesn't not have a UUID value built
- /// into the file format, an MD5 checksum of the entire file, or
- /// slice of the file for the current architecture should be used.
+ /// If the executable image file doesn't not have a UUID value built into
+ /// the file format, an MD5 checksum of the entire file, or slice of the
+ /// file for the current architecture should be used.
///
/// @return
/// A const pointer to the internal copy of the UUID value in
@@ -775,14 +765,13 @@ public:
/// A debugging function that will cause everything in a module to
/// be parsed.
///
- /// All compile units will be parsed, along with all globals and
- /// static variables and all functions for those compile units.
- /// All types, scopes, local variables, static variables, global
- /// variables, and line tables will be parsed. This can be used
- /// prior to dumping a module to see a complete list of the
- /// resulting debug information that gets parsed, or as a debug
- /// function to ensure that the module can consume all of the
- /// debug data the symbol vendor provides.
+ /// All compile units will be parsed, along with all globals and static
+ /// variables and all functions for those compile units. All types, scopes,
+ /// local variables, static variables, global variables, and line tables
+ /// will be parsed. This can be used prior to dumping a module to see a
+ /// complete list of the resulting debug information that gets parsed, or as
+ /// a debug function to ensure that the module can consume all of the debug
+ /// data the symbol vendor provides.
//------------------------------------------------------------------
void ParseAllDebugSymbols();
@@ -791,17 +780,16 @@ public:
//------------------------------------------------------------------
/// Resolve the symbol context for the given address.
///
- /// Tries to resolve the matching symbol context based on a lookup
- /// from the current symbol vendor. If the lazy lookup fails,
- /// an attempt is made to parse the eh_frame section to handle
- /// stripped symbols. If this fails, an attempt is made to resolve
- /// the symbol to the previous address to handle the case of a
- /// function with a tail call.
+ /// Tries to resolve the matching symbol context based on a lookup from the
+ /// current symbol vendor. If the lazy lookup fails, an attempt is made to
+ /// parse the eh_frame section to handle stripped symbols. If this fails,
+ /// an attempt is made to resolve the symbol to the previous address to
+ /// handle the case of a function with a tail call.
///
- /// Use properties of the modified SymbolContext to inspect any
- /// resolved target, module, compilation unit, symbol, function,
- /// function block or line entry. Use the return value to determine
- /// which of these properties have been modified.
+ /// Use properties of the modified SymbolContext to inspect any resolved
+ /// target, module, compilation unit, symbol, function, function block or
+ /// line entry. Use the return value to determine which of these properties
+ /// have been modified.
///
/// @param[in] so_addr
/// A load address to resolve.
@@ -836,15 +824,14 @@ public:
//------------------------------------------------------------------
/// Resolve items in the symbol context for a given file and line.
///
- /// Tries to resolve \a file_path and \a line to a list of matching
- /// symbol contexts.
+ /// Tries to resolve \a file_path and \a line to a list of matching symbol
+ /// contexts.
///
- /// The line table entries contains addresses that can be used to
- /// further resolve the values in each match: the function, block,
- /// symbol. Care should be taken to minimize the amount of
- /// information that is requested to only what is needed --
- /// typically the module, compile unit, line table and line table
- /// entry are sufficient.
+ /// The line table entries contains addresses that can be used to further
+ /// resolve the values in each match: the function, block, symbol. Care
+ /// should be taken to minimize the amount of information that is requested
+ /// to only what is needed -- typically the module, compile unit, line table
+ /// and line table entry are sufficient.
///
/// @param[in] file_path
/// A path to a source file to match. If \a file_path does not
@@ -883,15 +870,14 @@ public:
//------------------------------------------------------------------
/// Resolve items in the symbol context for a given file and line.
///
- /// Tries to resolve \a file_spec and \a line to a list of matching
- /// symbol contexts.
+ /// Tries to resolve \a file_spec and \a line to a list of matching symbol
+ /// contexts.
///
- /// The line table entries contains addresses that can be used to
- /// further resolve the values in each match: the function, block,
- /// symbol. Care should be taken to minimize the amount of
- /// information that is requested to only what is needed --
- /// typically the module, compile unit, line table and line table
- /// entry are sufficient.
+ /// The line table entries contains addresses that can be used to further
+ /// resolve the values in each match: the function, block, symbol. Care
+ /// should be taken to minimize the amount of information that is requested
+ /// to only what is needed -- typically the module, compile unit, line table
+ /// and line table entry are sufficient.
///
/// @param[in] file_spec
/// A file spec to a source file to match. If \a file_path does
@@ -936,12 +922,10 @@ public:
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language);
// Special error functions that can do printf style formatting that will
- // prepend the message with
- // something appropriate for this module (like the architecture, path and
- // object name (if any)).
- // This centralizes code so that everyone doesn't need to format their error
- // and log messages on
- // their own and keeps the output a bit more consistent.
+ // prepend the message with something appropriate for this module (like the
+ // architecture, path and object name (if any)). This centralizes code so
+ // that everyone doesn't need to format their error and log messages on their
+ // own and keeps the output a bit more consistent.
void LogMessage(Log *log, const char *format, ...)
__attribute__((format(printf, 3, 4)));
@@ -960,15 +944,15 @@ public:
__attribute__((format(printf, 2, 3)));
//------------------------------------------------------------------
- // Return true if the file backing this module has changed since the
- // module was originally created since we saved the initial file
- // modification time when the module first gets created.
+ // Return true if the file backing this module has changed since the module
+ // was originally created since we saved the initial file modification time
+ // when the module first gets created.
//------------------------------------------------------------------
bool FileHasChanged() const;
//------------------------------------------------------------------
- // SymbolVendor, SymbolFile and ObjectFile member objects should
- // lock the module mutex to avoid deadlocks.
+ // SymbolVendor, SymbolFile and ObjectFile member objects should lock the
+ // module mutex to avoid deadlocks.
//------------------------------------------------------------------
std::recursive_mutex &GetMutex() const { return m_mutex; }
@@ -979,14 +963,13 @@ public:
}
//------------------------------------------------------------------
- /// Finds a source file given a file spec using the module source
- /// path remappings (if any).
+ /// Finds a source file given a file spec using the module source path
+ /// remappings (if any).
///
/// Tries to resolve \a orig_spec by checking the module source path
- /// remappings. It makes sure the file exists, so this call can be
- /// expensive if the remappings are on a network file system, so
- /// use this function sparingly (not in a tight debug info parsing
- /// loop).
+ /// remappings. It makes sure the file exists, so this call can be expensive
+ /// if the remappings are on a network file system, so use this function
+ /// sparingly (not in a tight debug info parsing loop).
///
/// @param[in] orig_spec
/// The original source file path to try and remap.
@@ -1004,9 +987,9 @@ public:
//------------------------------------------------------------------
/// Remaps a source file given \a path into \a new_path.
///
- /// Remaps \a path if any source remappings match. This function
- /// does NOT stat the file system so it can be used in tight loops
- /// where debug info is being parsed.
+ /// Remaps \a path if any source remappings match. This function does NOT
+ /// stat the file system so it can be used in tight loops where debug info
+ /// is being parsed.
///
/// @param[in] path
/// The original source file path to try and remap.
@@ -1021,43 +1004,28 @@ public:
bool RemapSourceFile(llvm::StringRef path, std::string &new_path) const;
bool RemapSourceFile(const char *, std::string &) const = delete;
- //------------------------------------------------------------------
- /// Loads this module to memory.
- ///
- /// Loads the bits needed to create an executable image to the memory.
- /// It is useful with bare-metal targets where target does not have the
- /// ability to start a process itself.
- ///
- /// @param[in] target
- /// Target where to load the module.
- ///
- /// @return
- //------------------------------------------------------------------
- Status LoadInMemory(Target &target, bool set_pc);
-
//----------------------------------------------------------------------
/// @class LookupInfo Module.h "lldb/Core/Module.h"
- /// @brief A class that encapsulates name lookup information.
- ///
- /// Users can type a wide variety of partial names when setting
- /// breakpoints by name or when looking for functions by name.
- /// SymbolVendor and SymbolFile objects are only required to implement
- /// name lookup for function basenames and for fully mangled names.
- /// This means if the user types in a partial name, we must reduce this
- /// to a name lookup that will work with all SymbolFile objects. So we
- /// might reduce a name lookup to look for a basename, and then prune
- /// out any results that don't match.
- ///
- /// The "m_name" member variable represents the name as it was typed
- /// by the user. "m_lookup_name" will be the name we actually search
- /// for through the symbol or objects files. Lanaguage is included in
- /// case we need to filter results by language at a later date. The
- /// "m_name_type_mask" member variable tells us what kinds of names we
- /// are looking for and can help us prune out unwanted results.
+ /// A class that encapsulates name lookup information.
+ ///
+ /// Users can type a wide variety of partial names when setting breakpoints
+ /// by name or when looking for functions by name. SymbolVendor and
+ /// SymbolFile objects are only required to implement name lookup for
+ /// function basenames and for fully mangled names. This means if the user
+ /// types in a partial name, we must reduce this to a name lookup that will
+ /// work with all SymbolFile objects. So we might reduce a name lookup to
+ /// look for a basename, and then prune out any results that don't match.
+ ///
+ /// The "m_name" member variable represents the name as it was typed by the
+ /// user. "m_lookup_name" will be the name we actually search for through
+ /// the symbol or objects files. Lanaguage is included in case we need to
+ /// filter results by language at a later date. The "m_name_type_mask"
+ /// member variable tells us what kinds of names we are looking for and can
+ /// help us prune out unwanted results.
///
/// Function lookups are done in Module.cpp, ModuleList.cpp and in
- /// BreakpointResolverName.cpp and they all now use this class to do
- /// lookups correctly.
+ /// BreakpointResolverName.cpp and they all now use this class to do lookups
+ /// correctly.
//----------------------------------------------------------------------
class LookupInfo {
public:
@@ -1146,7 +1114,7 @@ protected:
std::atomic<bool> m_did_load_objfile{false};
std::atomic<bool> m_did_load_symbol_vendor{false};
- std::atomic<bool> m_did_parse_uuid{false};
+ std::atomic<bool> m_did_set_uuid{false};
mutable bool m_file_has_changed : 1,
m_first_file_changed_log : 1; /// See if the module was modified after it
/// was initially opened.
@@ -1156,9 +1124,9 @@ protected:
///
/// Tries to resolve \a vm_addr as a file address (if \a
/// vm_addr_is_file_addr is true) or as a load address if \a
- /// vm_addr_is_file_addr is false) in the symbol vendor.
- /// \a resolve_scope indicates what clients wish to resolve
- /// and can be used to limit the scope of what is parsed.
+ /// vm_addr_is_file_addr is false) in the symbol vendor. \a resolve_scope
+ /// indicates what clients wish to resolve and can be used to limit the
+ /// scope of what is parsed.
///
/// @param[in] vm_addr
/// The load virtual address to resolve.
@@ -1196,6 +1164,8 @@ protected:
bool SetArchitecture(const ArchSpec &new_arch);
+ void SetUUID(const lldb_private::UUID &uuid);
+
SectionList *GetUnifiedSectionList();
friend class ModuleList;
diff --git a/include/lldb/Core/ModuleChild.h b/include/lldb/Core/ModuleChild.h
index 8f2985c8185b..73438040c359 100644
--- a/include/lldb/Core/ModuleChild.h
+++ b/include/lldb/Core/ModuleChild.h
@@ -16,7 +16,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ModuleChild ModuleChild.h "lldb/Core/ModuleChild.h"
-/// @brief A mix in class that contains a pointer back to the module
+/// A mix in class that contains a pointer back to the module
/// that owns the object which inherits from it.
//----------------------------------------------------------------------
class ModuleChild {
diff --git a/include/lldb/Core/ModuleList.h b/include/lldb/Core/ModuleList.h
index 4b637c9b0427..e1d8a9a7fb85 100644
--- a/include/lldb/Core/ModuleList.h
+++ b/include/lldb/Core/ModuleList.h
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h" // for Address
#include "lldb/Core/ModuleSpec.h" // for ModuleSpec
+#include "lldb/Core/UserSettingsController.h"
#include "lldb/Utility/FileSpec.h" // for FileSpec
#include "lldb/Utility/Iterable.h"
#include "lldb/Utility/Status.h" // for Status
@@ -74,12 +75,21 @@ class VariableList;
namespace lldb_private {
+class ModuleListProperties : public Properties {
+public:
+ ModuleListProperties();
+
+ FileSpec GetClangModulesCachePath() const;
+ bool SetClangModulesCachePath(llvm::StringRef path);
+ bool GetEnableExternalLookup() const;
+};
+
//----------------------------------------------------------------------
/// @class ModuleList ModuleList.h "lldb/Core/ModuleList.h"
-/// @brief A collection class for Module objects.
+/// A collection class for Module objects.
///
-/// Modules in the module collection class are stored as reference
-/// counted shared pointers to Module objects.
+/// Modules in the module collection class are stored as reference counted
+/// shared pointers to Module objects.
//----------------------------------------------------------------------
class ModuleList {
public:
@@ -107,8 +117,7 @@ public:
//------------------------------------------------------------------
/// Copy Constructor.
///
- /// Creates a new module list object with a copy of the modules from
- /// \a rhs.
+ /// Creates a new module list object with a copy of the modules from \a rhs.
///
/// @param[in] rhs
/// Another module list object.
@@ -146,9 +155,9 @@ public:
void Append(const lldb::ModuleSP &module_sp);
//------------------------------------------------------------------
- /// Append a module to the module list and remove any equivalent
- /// modules. Equivalent modules are ones whose file, platform file
- /// and architecture matches.
+ /// Append a module to the module list and remove any equivalent modules.
+ /// Equivalent modules are ones whose file, platform file and architecture
+ /// matches.
///
/// Replaces the module to the collection.
///
@@ -169,27 +178,27 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Clears the list of modules and releases a reference to each
- /// module object and if the reference count goes to zero, the
- /// module will be deleted.
+ /// Clears the list of modules and releases a reference to each module
+ /// object and if the reference count goes to zero, the module will be
+ /// deleted.
//------------------------------------------------------------------
void Clear();
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Clears the list of modules and releases a reference to each
- /// module object and if the reference count goes to zero, the
- /// module will be deleted. Also release all memory that might be
- /// held by any collection classes (like std::vector)
+ /// Clears the list of modules and releases a reference to each module
+ /// object and if the reference count goes to zero, the module will be
+ /// deleted. Also release all memory that might be held by any collection
+ /// classes (like std::vector)
//------------------------------------------------------------------
void Destroy();
//------------------------------------------------------------------
/// Dump the description of each module contained in this list.
///
- /// Dump the description of each module contained in this list to
- /// the supplied stream \a s.
+ /// Dump the description of each module contained in this list to the
+ /// supplied stream \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -220,8 +229,8 @@ public:
//------------------------------------------------------------------
/// Get the module shared pointer for the module at index \a idx without
- /// acquiring the ModuleList mutex. This MUST already have been
- /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ /// acquiring the ModuleList mutex. This MUST already have been acquired
+ /// with ModuleList::GetMutex and locked for this call to be safe.
///
/// @param[in] idx
/// An index into this module collection.
@@ -249,9 +258,9 @@ public:
Module *GetModulePointerAtIndex(size_t idx) const;
//------------------------------------------------------------------
- /// Get the module pointer for the module at index \a idx without
- /// acquiring the ModuleList mutex. This MUST already have been
- /// acquired with ModuleList::GetMutex and locked for this call to be safe.
+ /// Get the module pointer for the module at index \a idx without acquiring
+ /// the ModuleList mutex. This MUST already have been acquired with
+ /// ModuleList::GetMutex and locked for this call to be safe.
///
/// @param[in] idx
/// An index into this module collection.
@@ -267,8 +276,8 @@ public:
//------------------------------------------------------------------
/// Find compile units by partial or full path.
///
- /// Finds all compile units that match \a path in all of the modules
- /// and returns the results in \a sc_list.
+ /// Finds all compile units that match \a path in all of the modules and
+ /// returns the results in \a sc_list.
///
/// @param[in] path
/// The name of the compile unit we are looking for.
@@ -315,24 +324,17 @@ public:
/// The name of the global or static variable we are looking
/// for.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const ConstString &name, bool append,
- size_t max_matches,
+ size_t FindGlobalVariables(const ConstString &name, size_t max_matches,
VariableList &variable_list) const;
//------------------------------------------------------------------
@@ -341,29 +343,21 @@ public:
/// @param[in] regex
/// A regular expression to use when matching the name.
///
- /// @param[in] append
- /// If \b true, any matches will be appended to \a
- /// variable_list, else matches replace the contents of
- /// \a variable_list.
- ///
/// @param[in] max_matches
/// Allow the number of matches to be limited to \a
/// max_matches. Specify UINT32_MAX to get all possible matches.
///
/// @param[in] variable_list
- /// A list of variables that gets the matches appended to (if
- /// \a append it \b true), or replace (if \a append is \b false).
+ /// A list of variables that gets the matches appended to.
///
/// @return
/// The number of matches added to \a variable_list.
//------------------------------------------------------------------
- size_t FindGlobalVariables(const RegularExpression &regex, bool append,
- size_t max_matches,
+ size_t FindGlobalVariables(const RegularExpression &regex, size_t max_matches,
VariableList &variable_list) const;
//------------------------------------------------------------------
- /// Finds the first module whose file specification matches \a
- /// file_spec.
+ /// Finds the first module whose file specification matches \a file_spec.
///
/// @param[in] file_spec_ptr
/// A file specification object to match against the Module's
@@ -400,9 +394,9 @@ public:
//------------------------------------------------------------------
// Find a module by UUID
//
- // The UUID value for a module is extracted from the ObjectFile and
- // is the MD5 checksum, or a smarter object file equivalent, so
- // finding modules by UUID values is very efficient and accurate.
+ // The UUID value for a module is extracted from the ObjectFile and is the
+ // MD5 checksum, or a smarter object file equivalent, so finding modules by
+ // UUID values is very efficient and accurate.
//------------------------------------------------------------------
lldb::ModuleSP FindModule(const UUID &uuid) const;
@@ -534,6 +528,8 @@ public:
Stream *feedback_stream = nullptr,
bool continue_on_error = true);
+ static ModuleListProperties &GetGlobalModuleListProperties();
+
static bool ModuleIsInCache(const Module *module_ptr);
static Status GetSharedModule(const ModuleSpec &module_spec,
@@ -551,7 +547,7 @@ public:
static size_t RemoveOrphanSharedModules(bool mandatory);
static bool RemoveSharedModuleIfOrphaned(const Module *module_ptr);
-
+
void ForEach(std::function<bool(const lldb::ModuleSP &module_sp)> const
&callback) const;
diff --git a/include/lldb/Core/ModuleSpec.h b/include/lldb/Core/ModuleSpec.h
index cc95bd0a0638..16a35a187780 100644
--- a/include/lldb/Core/ModuleSpec.h
+++ b/include/lldb/Core/ModuleSpec.h
@@ -34,9 +34,9 @@ public:
m_object_name(), m_object_offset(0), m_object_size(0),
m_source_mappings() {}
- ModuleSpec(const FileSpec &file_spec)
+ ModuleSpec(const FileSpec &file_spec, const UUID& uuid = UUID())
: m_file(file_spec), m_platform_file(), m_symbol_file(), m_arch(),
- m_uuid(), m_object_name(), m_object_offset(0),
+ m_uuid(uuid), m_object_name(), m_object_offset(0),
m_object_size(file_spec.GetByteSize()), m_source_mappings() {}
ModuleSpec(const FileSpec &file_spec, const ArchSpec &arch)
@@ -341,8 +341,8 @@ public:
m_specs.insert(m_specs.end(), rhs.m_specs.begin(), rhs.m_specs.end());
}
- // The index "i" must be valid and this can't be used in
- // multi-threaded code as no mutex lock is taken.
+ // The index "i" must be valid and this can't be used in multi-threaded code
+ // as no mutex lock is taken.
ModuleSpec &GetModuleSpecRefAtIndex(size_t i) { return m_specs[i]; }
bool GetModuleSpecAtIndex(size_t i, ModuleSpec &module_spec) const {
diff --git a/include/lldb/Core/PluginManager.h b/include/lldb/Core/PluginManager.h
index 68e6ca20b266..b782294f1f60 100644
--- a/include/lldb/Core/PluginManager.h
+++ b/include/lldb/Core/PluginManager.h
@@ -477,11 +477,11 @@ public:
const ConstString &name);
//------------------------------------------------------------------
- // Some plug-ins might register a DebuggerInitializeCallback
- // callback when registering the plug-in. After a new Debugger
- // instance is created, this DebuggerInitialize function will get
- // called. This allows plug-ins to install Properties and do any
- // other initialization that requires a debugger instance.
+ // Some plug-ins might register a DebuggerInitializeCallback callback when
+ // registering the plug-in. After a new Debugger instance is created, this
+ // DebuggerInitialize function will get called. This allows plug-ins to
+ // install Properties and do any other initialization that requires a
+ // debugger instance.
//------------------------------------------------------------------
static void DebuggerInitialize(Debugger &debugger);
diff --git a/include/lldb/Core/RangeMap.h b/include/lldb/Core/RangeMap.h
index 91fd409fb4ed..45bda26e2659 100644
--- a/include/lldb/Core/RangeMap.h
+++ b/include/lldb/Core/RangeMap.h
@@ -27,9 +27,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// Templatized classes for dealing with generic ranges and also
-// collections of ranges, or collections of ranges that have associated
-// data.
+// Templatized classes for dealing with generic ranges and also collections of
+// ranges, or collections of ranges that have associated data.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -214,8 +213,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
+ // Use the swap technique in case our new vector is much smaller. We
+ // must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@@ -228,8 +227,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // first range's base
+ // m_entries must be sorted, so if we aren't empty, we grab the first
+ // range's base
return m_entries.front().GetRangeBase();
}
@@ -239,8 +238,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // last range's end
+ // m_entries must be sorted, so if we aren't empty, we grab the last
+ // range's end
return m_entries.back().GetRangeEnd();
}
@@ -446,8 +445,8 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
+ // Use the swap technique in case our new vector is much smaller. We
+ // must swap when using the STL because std::vector objects never
// release or reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
@@ -460,8 +459,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // first range's base
+ // m_entries must be sorted, so if we aren't empty, we grab the first
+ // range's base
return m_entries.front().GetRangeBase();
}
@@ -471,8 +470,8 @@ public:
#endif
if (m_entries.empty())
return fail_value;
- // m_entries must be sorted, so if we aren't empty, we grab the
- // last range's end
+ // m_entries must be sorted, so if we aren't empty, we grab the last
+ // range's end
return m_entries.back().GetRangeEnd();
}
@@ -604,8 +603,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
-// the range base "B", the type used for the range byte size "S", and
-// the type for the associated data "T".
+// the range base "B", the type used for the range byte size "S", and the type
+// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename S, typename T>
struct RangeData : public Range<B, S> {
@@ -688,8 +687,8 @@ public:
}
}
- // We we can combine at least one entry, then we make a new collection
- // and populate it accordingly, and then swap it into place.
+ // We we can combine at least one entry, then we make a new collection and
+ // populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@@ -699,9 +698,9 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
- // release or reduce the memory once it has been allocated/reserved.
+ // Use the swap technique in case our new vector is much smaller. We must
+ // swap when using the STL because std::vector objects never release or
+ // reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
@@ -828,8 +827,8 @@ protected:
Collection m_entries;
};
-// Same as RangeDataArray, but uses std::vector as to not
-// require static storage of N items in the class itself
+// Same as RangeDataArray, but uses std::vector as to not require static
+// storage of N items in the class itself
template <typename B, typename S, typename T> class RangeDataVector {
public:
typedef RangeData<B, S, T> Entry;
@@ -878,8 +877,8 @@ public:
}
}
- // We we can combine at least one entry, then we make a new collection
- // and populate it accordingly, and then swap it into place.
+ // We we can combine at least one entry, then we make a new collection and
+ // populate it accordingly, and then swap it into place.
if (can_combine) {
Collection minimal_ranges;
for (pos = m_entries.begin(), end = m_entries.end(), prev = end;
@@ -889,15 +888,15 @@ public:
else
minimal_ranges.push_back(*pos);
}
- // Use the swap technique in case our new vector is much smaller.
- // We must swap when using the STL because std::vector objects never
- // release or reduce the memory once it has been allocated/reserved.
+ // Use the swap technique in case our new vector is much smaller. We must
+ // swap when using the STL because std::vector objects never release or
+ // reduce the memory once it has been allocated/reserved.
m_entries.swap(minimal_ranges);
}
}
- // Calculate the byte size of ranges with zero byte sizes by finding
- // the next entry with a base address > the current base address
+ // Calculate the byte size of ranges with zero byte sizes by finding the next
+ // entry with a base address > the current base address
void CalculateSizesOfZeroByteSizeRanges(S full_size = 0) {
#ifdef ASSERT_RANGEMAP_ARE_SORTED
assert(IsSorted());
@@ -907,9 +906,9 @@ public:
typename Collection::iterator next;
for (pos = m_entries.begin(), end = m_entries.end(); pos != end; ++pos) {
if (pos->GetByteSize() == 0) {
- // Watch out for multiple entries with same address and make sure
- // we find an entry that is greater than the current base address
- // before we use that for the size
+ // Watch out for multiple entries with same address and make sure we
+ // find an entry that is greater than the current base address before
+ // we use that for the size
auto curr_base = pos->GetRangeBase();
for (next = pos + 1; next != end; ++next) {
auto next_base = next->GetRangeBase();
@@ -1060,8 +1059,8 @@ public:
}
// This method will return the entry that contains the given address, or the
- // entry following that address. If you give it an address of 0 and the first
- // entry starts at address 0x100, you will get the entry at 0x100.
+ // entry following that address. If you give it an address of 0 and the
+ // first entry starts at address 0x100, you will get the entry at 0x100.
//
// For most uses, FindEntryThatContains is the correct one to use, this is a
// less commonly needed behavior. It was added for core file memory regions,
@@ -1102,8 +1101,8 @@ protected:
//----------------------------------------------------------------------
// A simple range with data class where you get to define the type of
-// the range base "B", the type used for the range byte size "S", and
-// the type for the associated data "T".
+// the range base "B", the type used for the range byte size "S", and the type
+// for the associated data "T".
//----------------------------------------------------------------------
template <typename B, typename T> struct AddressData {
typedef B BaseType;
diff --git a/include/lldb/Core/RegisterValue.h b/include/lldb/Core/RegisterValue.h
index a45db00fb76e..b369c3dff9a9 100644
--- a/include/lldb/Core/RegisterValue.h
+++ b/include/lldb/Core/RegisterValue.h
@@ -35,7 +35,7 @@ namespace lldb_private {
class RegisterValue {
public:
- enum { kMaxRegisterByteSize = 32u };
+ enum { kMaxRegisterByteSize = 64u };
enum Type {
eTypeInvalid,
@@ -95,14 +95,13 @@ public:
bool GetData(DataExtractor &data) const;
- // Copy the register value from this object into a buffer in "dst"
- // and obey the "dst_byte_order" when copying the data. Also watch out
- // in case "dst_len" is longer or shorter than the register value
- // described by "reg_info" and only copy the least significant bytes
- // of the register value, or pad the destination with zeroes if the
- // register byte size is shorter that "dst_len" (all while correctly
- // abiding the "dst_byte_order"). Returns the number of bytes copied
- // into "dst".
+ // Copy the register value from this object into a buffer in "dst" and obey
+ // the "dst_byte_order" when copying the data. Also watch out in case
+ // "dst_len" is longer or shorter than the register value described by
+ // "reg_info" and only copy the least significant bytes of the register
+ // value, or pad the destination with zeroes if the register byte size is
+ // shorter that "dst_len" (all while correctly abiding the "dst_byte_order").
+ // Returns the number of bytes copied into "dst".
uint32_t GetAsMemoryData(const RegisterInfo *reg_info, void *dst,
uint32_t dst_len, lldb::ByteOrder dst_byte_order,
Status &error) const;
@@ -249,12 +248,6 @@ public:
Status SetValueFromData(const RegisterInfo *reg_info, DataExtractor &data,
lldb::offset_t offset, bool partial_data_ok);
- // The default value of 0 for reg_name_right_align_at means no alignment at
- // all.
- bool Dump(Stream *s, const RegisterInfo *reg_info, bool prefix_with_name,
- bool prefix_with_alt_name, lldb::Format format,
- uint32_t reg_name_right_align_at = 0) const;
-
const void *GetBytes() const;
lldb::ByteOrder GetByteOrder() const {
diff --git a/include/lldb/Core/STLUtils.h b/include/lldb/Core/STLUtils.h
index d851ed5464c9..55f1ac05c975 100644
--- a/include/lldb/Core/STLUtils.h
+++ b/include/lldb/Core/STLUtils.h
@@ -40,8 +40,8 @@ struct CStringEqualBinaryPredicate {
};
//----------------------------------------------------------------------
-// Templated type for finding an entry in a std::map<F,S> whose value
-// is equal to something
+// Templated type for finding an entry in a std::map<F,S> whose value is equal
+// to something
//----------------------------------------------------------------------
template <class F, class S> class ValueEquals {
public:
diff --git a/include/lldb/Core/Scalar.h b/include/lldb/Core/Scalar.h
index 943398b88020..40671a242ec3 100644
--- a/include/lldb/Core/Scalar.h
+++ b/include/lldb/Core/Scalar.h
@@ -36,9 +36,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A class designed to hold onto values and their corresponding types.
-// Operators are defined and Scalar objects will correctly promote
-// their types and values before performing these operations. Type
-// promotion currently follows the ANSI C type promotion rules.
+// Operators are defined and Scalar objects will correctly promote their types
+// and values before performing these operations. Type promotion currently
+// follows the ANSI C type promotion rules.
//----------------------------------------------------------------------
class Scalar {
public:
@@ -50,13 +50,13 @@ public:
e_ulong,
e_slonglong,
e_ulonglong,
- e_float,
- e_double,
- e_long_double,
- e_uint128,
e_sint128,
+ e_uint128,
+ e_sint256,
e_uint256,
- e_sint256
+ e_float,
+ e_double,
+ e_long_double
};
//------------------------------------------------------------------
@@ -165,8 +165,6 @@ public:
bool Promote(Scalar::Type type);
- bool Cast(Scalar::Type type);
-
bool MakeSigned();
bool MakeUnsigned();
@@ -182,10 +180,10 @@ public:
static Scalar::Type GetValueTypeForFloatWithByteSize(size_t byte_size);
//----------------------------------------------------------------------
- // All operators can benefits from the implicit conversions that will
- // happen automagically by the compiler, so no temporary objects will
- // need to be created. As a result, we currently don't need a variety of
- // overloaded set value accessors.
+ // All operators can benefits from the implicit conversions that will happen
+ // automagically by the compiler, so no temporary objects will need to be
+ // created. As a result, we currently don't need a variety of overloaded set
+ // value accessors.
//----------------------------------------------------------------------
Scalar &operator=(const int i);
Scalar &operator=(unsigned int v);
@@ -204,27 +202,27 @@ public:
Scalar &operator&=(const Scalar &rhs);
//----------------------------------------------------------------------
- // Shifts the current value to the right without maintaining the current
- // sign of the value (if it is signed).
+ // Shifts the current value to the right without maintaining the current sign
+ // of the value (if it is signed).
//----------------------------------------------------------------------
bool ShiftRightLogical(const Scalar &rhs); // Returns true on success
//----------------------------------------------------------------------
- // Takes the absolute value of the current value if it is signed, else
- // the value remains unchanged.
- // Returns false if the contained value has a void type.
+ // Takes the absolute value of the current value if it is signed, else the
+ // value remains unchanged. Returns false if the contained value has a void
+ // type.
//----------------------------------------------------------------------
bool AbsoluteValue(); // Returns true on success
//----------------------------------------------------------------------
- // Negates the current value (even for unsigned values).
- // Returns false if the contained value has a void type.
+ // Negates the current value (even for unsigned values). Returns false if the
+ // contained value has a void type.
//----------------------------------------------------------------------
bool UnaryNegate(); // Returns true on success
//----------------------------------------------------------------------
- // Inverts all bits in the current value as long as it isn't void or
- // a float/double/long double type.
- // Returns false if the contained value has a void/float/double/long
- // double type, else the value is inverted and true is returned.
+ // Inverts all bits in the current value as long as it isn't void or a
+ // float/double/long double type. Returns false if the contained value has a
+ // void/float/double/long double type, else the value is inverted and true is
+ // returned.
//----------------------------------------------------------------------
bool OnesComplement(); // Returns true on success
@@ -234,9 +232,9 @@ public:
Scalar::Type GetType() const { return m_type; }
//----------------------------------------------------------------------
- // Returns a casted value of the current contained data without
- // modifying the current value. FAIL_VALUE will be returned if the type
- // of the value is void or invalid.
+ // Returns a casted value of the current contained data without modifying the
+ // current value. FAIL_VALUE will be returned if the type of the value is
+ // void or invalid.
//----------------------------------------------------------------------
int SInt(int fail_value = 0) const;
@@ -344,8 +342,8 @@ private:
};
//----------------------------------------------------------------------
-// Split out the operators into a format where the compiler will be able
-// to implicitly convert numbers into Scalar objects.
+// Split out the operators into a format where the compiler will be able to
+// implicitly convert numbers into Scalar objects.
//
// This allows code like:
// Scalar two(2);
diff --git a/include/lldb/Core/SearchFilter.h b/include/lldb/Core/SearchFilter.h
index 5861afc801cb..2e641983dc73 100644
--- a/include/lldb/Core/SearchFilter.h
+++ b/include/lldb/Core/SearchFilter.h
@@ -52,9 +52,9 @@ class Target;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Searcher SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief Class that is driven by the SearchFilter to search the
-/// SymbolContext space of the target program.
+/// @class Searcher SearchFilter.h "lldb/Core/SearchFilter.h" Class that is
+/// driven by the SearchFilter to search the SymbolContext space of the target
+/// program.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -99,10 +99,10 @@ public:
};
//----------------------------------------------------------------------
-/// @class SearchFilter SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief Class descends through the SymbolContext space of the target,
-/// applying a filter at each stage till it reaches the depth specified by
-/// the GetDepth method of the searcher, and calls its callback at that point.
+/// @class SearchFilter SearchFilter.h "lldb/Core/SearchFilter.h" Class
+/// descends through the SymbolContext space of the target, applying a filter
+/// at each stage till it reaches the depth specified by the GetDepth method
+/// of the searcher, and calls its callback at that point.
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -110,15 +110,12 @@ public:
/// Provides the callback and search depth for the SearchFilter search.
///
/// The search is done by cooperation between the search filter and the
-/// searcher.
-/// The search filter does the heavy work of recursing through the SymbolContext
-/// space of the target program's symbol space. The Searcher specifies the
-/// depth
-/// at which it wants its callback to be invoked. Note that since the
-/// resolution
-/// of the Searcher may be greater than that of the SearchFilter, before the
-/// Searcher qualifies an address it should pass it to "AddressPasses."
-/// The default implementation is "Everything Passes."
+/// searcher. The search filter does the heavy work of recursing through the
+/// SymbolContext space of the target program's symbol space. The Searcher
+/// specifies the depth at which it wants its callback to be invoked. Note
+/// that since the resolution of the Searcher may be greater than that of the
+/// SearchFilter, before the Searcher qualifies an address it should pass it
+/// to "AddressPasses." The default implementation is "Everything Passes."
//----------------------------------------------------------------------
class SearchFilter {
@@ -172,8 +169,8 @@ public:
virtual bool AddressPasses(Address &addr);
//------------------------------------------------------------------
- /// Call this method with a FileSpec to see if \a file spec passes the filter
- /// as the name of a compilation unit.
+ /// Call this method with a FileSpec to see if \a file spec passes the
+ /// filter as the name of a compilation unit.
///
/// @param[in] fileSpec
/// The file spec to check against the filter.
@@ -218,11 +215,10 @@ public:
virtual void SearchInModuleList(Searcher &searcher, ModuleList &modules);
//------------------------------------------------------------------
- /// This determines which items are REQUIRED for the filter to pass.
- /// For instance, if you are filtering by Compilation Unit, obviously
- /// symbols that have no compilation unit can't pass So return
- /// eSymbolContextCU
- /// and search callbacks can then short cut the search to avoid looking at
+ /// This determines which items are REQUIRED for the filter to pass. For
+ /// instance, if you are filtering by Compilation Unit, obviously symbols
+ /// that have no compilation unit can't pass So return eSymbolContextCU and
+ /// search callbacks can then short cut the search to avoid looking at
/// things that obviously won't pass.
///
/// @return
@@ -303,8 +299,7 @@ protected:
OptionNames name, FileSpecList &file_list);
// These are utility functions to assist with the search iteration. They are
- // used by the
- // default Search method.
+ // used by the default Search method.
Searcher::CallbackReturn DoModuleIteration(const SymbolContext &context,
Searcher &searcher);
@@ -333,9 +328,9 @@ private:
//----------------------------------------------------------------------
/// @class SearchFilterForUnconstrainedSearches SearchFilter.h
-/// "lldb/Core/SearchFilter.h"
-/// @brief This is a SearchFilter that searches through all modules. It also
-/// consults the Target::ModuleIsExcludedForUnconstrainedSearches.
+/// "lldb/Core/SearchFilter.h" This is a SearchFilter that searches through
+/// all modules. It also consults the
+/// Target::ModuleIsExcludedForUnconstrainedSearches.
//----------------------------------------------------------------------
class SearchFilterForUnconstrainedSearches : public SearchFilter {
public:
@@ -360,8 +355,8 @@ protected:
};
//----------------------------------------------------------------------
-/// @class SearchFilterByModule SearchFilter.h "lldb/Core/SearchFilter.h"
-/// @brief This is a SearchFilter that restricts the search to a given module.
+/// @class SearchFilterByModule SearchFilter.h "lldb/Core/SearchFilter.h" This
+/// is a SearchFilter that restricts the search to a given module.
//----------------------------------------------------------------------
class SearchFilterByModule : public SearchFilter {
diff --git a/include/lldb/Core/Section.h b/include/lldb/Core/Section.h
index 2d5d6443ba7f..8e275ce3199e 100644
--- a/include/lldb/Core/Section.h
+++ b/include/lldb/Core/Section.h
@@ -182,6 +182,8 @@ public:
lldb::SectionType GetType() const { return m_type; }
+ const char *GetTypeAsCString() const;
+
lldb::SectionSP GetParent() const { return m_parent_wp.lock(); }
bool IsThreadSpecific() const { return m_thread_specific; }
@@ -270,10 +272,9 @@ protected:
SectionList m_children; // Child sections
bool m_fake : 1, // If true, then this section only can contain the address if
// one of its
- // children contains an address. This allows for gaps between the children
- // that are contained in the address range for this section, but do not
- // produce
- // hits unless the children contain the address.
+ // children contains an address. This allows for gaps between the
+ // children that are contained in the address range for this section, but
+ // do not produce hits unless the children contain the address.
m_encrypted : 1, // Set to true if the contents are encrypted
m_thread_specific : 1, // This section is thread specific
m_readable : 1, // If this section has read permissions
diff --git a/include/lldb/Core/SourceManager.h b/include/lldb/Core/SourceManager.h
index 053badf64ddc..ef652531244d 100644
--- a/include/lldb/Core/SourceManager.h
+++ b/include/lldb/Core/SourceManager.h
@@ -106,9 +106,8 @@ public:
#ifndef SWIG
// The SourceFileCache class separates the source manager from the cache of
- // source files, so the
- // cache can be stored in the Debugger, but the source managers can be per
- // target.
+ // source files, so the cache can be stored in the Debugger, but the source
+ // managers can be per target.
class SourceFileCache {
public:
SourceFileCache() = default;
diff --git a/include/lldb/Core/StreamBuffer.h b/include/lldb/Core/StreamBuffer.h
index 3b18573021b3..307dc7e18a5e 100644
--- a/include/lldb/Core/StreamBuffer.h
+++ b/include/lldb/Core/StreamBuffer.h
@@ -39,9 +39,8 @@ public:
void Clear() { m_packet.clear(); }
// Beware, this might not be NULL terminated as you can expect from
- // StringString as there may be random bits in the llvm::SmallVector. If
- // you are using this class to create a C string, be sure the call PutChar
- // ('\0')
+ // StringString as there may be random bits in the llvm::SmallVector. If you
+ // are using this class to create a C string, be sure the call PutChar ('\0')
// after you have created your string, or use StreamString.
const char *GetData() const { return m_packet.data(); }
diff --git a/include/lldb/Core/ThreadSafeDenseSet.h b/include/lldb/Core/ThreadSafeDenseSet.h
index 49c55e96abe1..44ec2464385f 100644
--- a/include/lldb/Core/ThreadSafeDenseSet.h
+++ b/include/lldb/Core/ThreadSafeDenseSet.h
@@ -46,7 +46,7 @@ public:
}
void Clear() {
- stds::lock_guard<_MutexType> guard(m_mutex);
+ std::lock_guard<_MutexType> guard(m_mutex);
m_set.clear();
}
diff --git a/include/lldb/Core/ThreadSafeValue.h b/include/lldb/Core/ThreadSafeValue.h
index 60eaf91c4f02..10ef8fa41d0c 100644
--- a/include/lldb/Core/ThreadSafeValue.h
+++ b/include/lldb/Core/ThreadSafeValue.h
@@ -17,6 +17,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/lldb-defines.h"
namespace lldb_private {
diff --git a/include/lldb/Core/UniqueCStringMap.h b/include/lldb/Core/UniqueCStringMap.h
index e8c6c7c1353e..fe3e831a6045 100644
--- a/include/lldb/Core/UniqueCStringMap.h
+++ b/include/lldb/Core/UniqueCStringMap.h
@@ -25,11 +25,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
// Templatized uniqued string map.
//
-// This map is useful for mapping unique C string names to values of
-// type T. Each "const char *" name added must be unique for a given
+// This map is useful for mapping unique C string names to values of type T.
+// Each "const char *" name added must be unique for a given
// C string value. ConstString::GetCString() can provide such strings.
-// Any other string table that has guaranteed unique values can also
-// be used.
+// Any other string table that has guaranteed unique values can also be used.
//----------------------------------------------------------------------
template <typename T> class UniqueCStringMap {
public:
@@ -51,9 +50,9 @@ public:
};
//------------------------------------------------------------------
- // Call this function multiple times to add a bunch of entries to
- // this map, then later call UniqueCStringMap<T>::Sort() before doing
- // any searches by name.
+ // Call this function multiple times to add a bunch of entries to this map,
+ // then later call UniqueCStringMap<T>::Sort() before doing any searches by
+ // name.
//------------------------------------------------------------------
void Append(ConstString unique_cstr, const T &value) {
m_map.push_back(typename UniqueCStringMap<T>::Entry(unique_cstr, value));
@@ -64,8 +63,8 @@ public:
void Clear() { m_map.clear(); }
//------------------------------------------------------------------
- // Call this function to always keep the map sorted when putting
- // entries into the map.
+ // Call this function to always keep the map sorted when putting entries into
+ // the map.
//------------------------------------------------------------------
void Insert(ConstString unique_cstr, const T &value) {
typename UniqueCStringMap<T>::Entry e(unique_cstr, value);
@@ -79,8 +78,8 @@ public:
//------------------------------------------------------------------
// Get an entries by index in a variety of forms.
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned values.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned values.
//------------------------------------------------------------------
bool GetValueAtIndex(uint32_t idx, T &value) const {
if (idx < m_map.size()) {
@@ -94,12 +93,12 @@ public:
return m_map[idx].cstring;
}
- // Use this function if you have simple types in your map that you
- // can easily copy when accessing values by index.
+ // Use this function if you have simple types in your map that you can easily
+ // copy when accessing values by index.
T GetValueAtIndexUnchecked(uint32_t idx) const { return m_map[idx].value; }
- // Use this function if you have complex types in your map that you
- // don't want to copy when accessing values by index.
+ // Use this function if you have complex types in your map that you don't
+ // want to copy when accessing values by index.
const T &GetValueRefAtIndexUnchecked(uint32_t idx) const {
return m_map[idx].value;
}
@@ -111,8 +110,8 @@ public:
//------------------------------------------------------------------
// Find the value for the unique string in the map.
//
- // Return the value for \a unique_cstr if one is found, return
- // \a fail_value otherwise. This method works well for simple type
+ // Return the value for \a unique_cstr if one is found, return \a fail_value
+ // otherwise. This method works well for simple type
// T values and only if there is a sensible failure value that can
// be returned and that won't match any existing values.
//------------------------------------------------------------------
@@ -128,11 +127,11 @@ public:
}
//------------------------------------------------------------------
- // Get a pointer to the first entry that matches "name". nullptr will
- // be returned if there is no entry that matches "name".
+ // Get a pointer to the first entry that matches "name". nullptr will be
+ // returned if there is no entry that matches "name".
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned pointer.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindFirstValueForName(ConstString unique_cstr) const {
Entry search_entry(unique_cstr);
@@ -144,12 +143,12 @@ public:
}
//------------------------------------------------------------------
- // Get a pointer to the next entry that matches "name" from a
- // previously returned Entry pointer. nullptr will be returned if there
- // is no subsequent entry that matches "name".
+ // Get a pointer to the next entry that matches "name" from a previously
+ // returned Entry pointer. nullptr will be returned if there is no subsequent
+ // entry that matches "name".
//
- // The caller is responsible for ensuring that the collection does
- // not change during while using the returned pointer.
+ // The caller is responsible for ensuring that the collection does not change
+ // during while using the returned pointer.
//------------------------------------------------------------------
const Entry *FindNextValueForName(const Entry *entry_ptr) const {
if (!m_map.empty()) {
@@ -204,16 +203,15 @@ public:
bool IsEmpty() const { return m_map.empty(); }
//------------------------------------------------------------------
- // Reserve memory for at least "n" entries in the map. This is
- // useful to call when you know you will be adding a lot of entries
- // using UniqueCStringMap::Append() (which should be followed by a
- // call to UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
+ // Reserve memory for at least "n" entries in the map. This is useful to call
+ // when you know you will be adding a lot of entries using
+ // UniqueCStringMap::Append() (which should be followed by a call to
+ // UniqueCStringMap::Sort()) or to UniqueCStringMap::Insert().
//------------------------------------------------------------------
void Reserve(size_t n) { m_map.reserve(n); }
//------------------------------------------------------------------
- // Sort the unsorted contents in this map. A typical code flow would
- // be:
+ // Sort the unsorted contents in this map. A typical code flow would be:
// size_t approximate_num_entries = ....
// UniqueCStringMap<uint32_t> my_map;
// my_map.Reserve (approximate_num_entries);
@@ -226,12 +224,11 @@ public:
void Sort() { std::sort(m_map.begin(), m_map.end()); }
//------------------------------------------------------------------
- // Since we are using a vector to contain our items it will always
- // double its memory consumption as things are added to the vector,
- // so if you intend to keep a UniqueCStringMap around and have
- // a lot of entries in the map, you will want to call this function
- // to create a new vector and copy _only_ the exact size needed as
- // part of the finalization of the string map.
+ // Since we are using a vector to contain our items it will always double its
+ // memory consumption as things are added to the vector, so if you intend to
+ // keep a UniqueCStringMap around and have a lot of entries in the map, you
+ // will want to call this function to create a new vector and copy _only_ the
+ // exact size needed as part of the finalization of the string map.
//------------------------------------------------------------------
void SizeToFit() {
if (m_map.size() < m_map.capacity()) {
diff --git a/include/lldb/Core/UserSettingsController.h b/include/lldb/Core/UserSettingsController.h
index 67bc9b2c0713..aefd42e751ab 100644
--- a/include/lldb/Core/UserSettingsController.h
+++ b/include/lldb/Core/UserSettingsController.h
@@ -49,8 +49,8 @@ public:
virtual ~Properties() {}
virtual lldb::OptionValuePropertiesSP GetValueProperties() const {
- // This function is virtual in case subclasses want to lazily
- // implement creating the properties.
+ // This function is virtual in case subclasses want to lazily implement
+ // creating the properties.
return m_collection_sp;
}
@@ -82,16 +82,11 @@ public:
// We sometimes need to introduce a setting to enable experimental features,
// but then we don't want the setting for these to cause errors when the
- // setting
- // goes away. Add a sub-topic of the settings using this experimental name,
- // and
- // two things will happen. One is that settings that don't find the name will
- // not
- // be treated as errors. Also, if you decide to keep the settings just move
- // them into
- // the containing properties, and we will auto-forward the experimental
- // settings to the
- // real one.
+ // setting goes away. Add a sub-topic of the settings using this
+ // experimental name, and two things will happen. One is that settings that
+ // don't find the name will not be treated as errors. Also, if you decide to
+ // keep the settings just move them into the containing properties, and we
+ // will auto-forward the experimental settings to the real one.
static const char *GetExperimentalSettingsName();
static bool IsSettingExperimental(llvm::StringRef setting);
diff --git a/include/lldb/Core/Value.h b/include/lldb/Core/Value.h
index 678b56fc49f5..801e818c6f5c 100644
--- a/include/lldb/Core/Value.h
+++ b/include/lldb/Core/Value.h
@@ -48,8 +48,8 @@ namespace lldb_private {
class Value {
public:
- // Values Less than zero are an error, greater than or equal to zero
- // returns what the Scalar result is.
+ // Values Less than zero are an error, greater than or equal to zero returns
+ // what the Scalar result is.
enum ValueType {
// m_value contains...
// ============================
@@ -107,8 +107,7 @@ public:
byte_order != lldb::eByteOrderInvalid);
}
// Casts a vector, if valid, to an unsigned int of matching or largest
- // supported size.
- // Truncates to the beginning of the vector if required.
+ // supported size. Truncates to the beginning of the vector if required.
// Returns a default constructed Scalar if the Vector data is internally
// inconsistent.
llvm::APInt rhs = llvm::APInt(BITWIDTH_INT128, NUM_OF_WORDS_INT128,
@@ -229,6 +228,9 @@ public:
static const char *GetContextTypeAsCString(ContextType context_type);
+ /// Convert this value's file address to a load address, if possible.
+ void ConvertToLoadAddress(Module *module, Target *target);
+
bool GetData(DataExtractor &data);
void Clear();
diff --git a/include/lldb/Core/ValueObject.h b/include/lldb/Core/ValueObject.h
index fa1d14870b05..fddc06413196 100644
--- a/include/lldb/Core/ValueObject.h
+++ b/include/lldb/Core/ValueObject.h
@@ -11,7 +11,6 @@
#define liblldb_ValueObject_h_
#include "lldb/Core/Value.h"
-#include "lldb/DataFormatters/DumpValueObjectOptions.h" // for DumpValueObj...
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Symbol/Type.h" // for TypeImpl
#include "lldb/Target/ExecutionContext.h"
@@ -45,6 +44,9 @@ namespace lldb_private {
class Declaration;
}
namespace lldb_private {
+class DumpValueObjectOptions;
+}
+namespace lldb_private {
class EvaluateExpressionOptions;
}
namespace lldb_private {
@@ -286,10 +288,10 @@ public:
return m_exe_ctx_ref;
}
- // Set the EvaluationPoint to the values in exe_scope,
- // Return true if the Evaluation Point changed.
- // Since the ExecutionContextScope is always going to be valid currently,
- // the Updated Context will also always be valid.
+ // Set the EvaluationPoint to the values in exe_scope, Return true if the
+ // Evaluation Point changed. Since the ExecutionContextScope is always
+ // going to be valid currently, the Updated Context will also always be
+ // valid.
// bool
// SetContext (ExecutionContextScope *exe_scope);
@@ -327,8 +329,7 @@ public:
void SetInvalid() {
// Use the stop id to mark us as invalid, leave the thread id and the
- // stack id around for logging and
- // history purposes.
+ // stack id around for logging and history purposes.
m_mod_id.SetInvalid();
// Can't update an invalid state.
@@ -464,17 +465,16 @@ public:
virtual bool SetValueFromCString(const char *value_str, Status &error);
- // Return the module associated with this value object in case the
- // value is from an executable file and might have its data in
- // sections of the file. This can be used for variables.
+ // Return the module associated with this value object in case the value is
+ // from an executable file and might have its data in sections of the file.
+ // This can be used for variables.
virtual lldb::ModuleSP GetModule();
ValueObject *GetRoot();
// Given a ValueObject, loop over itself and its parent, and its parent's
- // parent, ..
- // until either the given callback returns false, or you end up at a null
- // pointer
+ // parent, .. until either the given callback returns false, or you end up at
+ // a null pointer
ValueObject *FollowParentChain(std::function<bool(ValueObject *)>);
virtual bool GetDeclaration(Declaration &decl);
@@ -517,9 +517,9 @@ public:
virtual bool ResolveValue(Scalar &scalar);
- // return 'false' whenever you set the error, otherwise
- // callers may assume true means everything is OK - this will
- // break breakpoint conditions among potentially a few others
+ // return 'false' whenever you set the error, otherwise callers may assume
+ // true means everything is OK - this will break breakpoint conditions among
+ // potentially a few others
virtual bool IsLogicalTrue(Status &error);
virtual const char *GetLocationAsCString();
@@ -646,8 +646,8 @@ public:
virtual lldb::ValueObjectSP CastPointerType(const char *name,
lldb::TypeSP &type_sp);
- // The backing bits of this value object were updated, clear any
- // descriptive string, so we know we have to refetch them
+ // The backing bits of this value object were updated, clear any descriptive
+ // string, so we know we have to refetch them
virtual void ValueUpdated() {
ClearUserVisibleData(eClearUserVisibleDataItemsValue |
eClearUserVisibleDataItemsSummary |
@@ -694,9 +694,8 @@ public:
lldb::ValueObjectSP Persist();
- // returns true if this is a char* or a char[]
- // if it is a char* and check_pointer is true,
- // it also checks that the pointer is valid
+ // returns true if this is a char* or a char[] if it is a char* and
+ // check_pointer is true, it also checks that the pointer is valid
bool IsCStringContainer(bool check_pointer = false);
std::pair<size_t, bool>
@@ -776,11 +775,9 @@ public:
}
// Use GetParent for display purposes, but if you want to tell the parent to
- // update itself
- // then use m_parent. The ValueObjectDynamicValue's parent is not the correct
- // parent for
- // displaying, they are really siblings, so for display it needs to route
- // through to its grandparent.
+ // update itself then use m_parent. The ValueObjectDynamicValue's parent is
+ // not the correct parent for displaying, they are really siblings, so for
+ // display it needs to route through to its grandparent.
virtual ValueObject *GetParent() { return m_parent; }
virtual const ValueObject *GetParent() const { return m_parent; }
@@ -904,9 +901,9 @@ protected:
ValueObjectManager *m_manager; // This object is managed by the root object
// (any ValueObject that gets created
// without a parent.) The manager gets passed through all the generations of
- // dependent objects, and will keep the whole cluster of objects alive as long
- // as a shared pointer to any of them has been handed out. Shared pointers to
- // value objects must always be made with the GetSP method.
+ // dependent objects, and will keep the whole cluster of objects alive as
+ // long as a shared pointer to any of them has been handed out. Shared
+ // pointers to value objects must always be made with the GetSP method.
ChildrenManager m_children;
std::map<ConstString, ValueObject *> m_synthetic_children;
@@ -954,21 +951,19 @@ protected:
// Constructors and Destructors
//------------------------------------------------------------------
- // Use the no-argument constructor to make a constant variable object (with no
- // ExecutionContextScope.)
+ // Use the no-argument constructor to make a constant variable object (with
+ // no ExecutionContextScope.)
ValueObject();
// Use this constructor to create a "root variable object". The ValueObject
- // will be locked to this context
- // through-out its lifespan.
+ // will be locked to this context through-out its lifespan.
ValueObject(ExecutionContextScope *exe_scope,
AddressType child_ptr_or_ref_addr_type = eAddressTypeLoad);
// Use this constructor to create a ValueObject owned by another ValueObject.
- // It will inherit the ExecutionContext
- // of its parent.
+ // It will inherit the ExecutionContext of its parent.
ValueObject(ValueObject &parent);
@@ -990,8 +985,8 @@ protected:
virtual void CalculateSyntheticValue(bool use_synthetic = true);
- // Should only be called by ValueObject::GetChildAtIndex()
- // Returns a ValueObject managed by this ValueObject's manager.
+ // Should only be called by ValueObject::GetChildAtIndex() Returns a
+ // ValueObject managed by this ValueObject's manager.
virtual ValueObject *CreateChildAtIndex(size_t idx,
bool synthetic_array_member,
int32_t synthetic_index);
@@ -1043,8 +1038,9 @@ private:
//------------------------------------------------------------------------------
// A value object manager class that is seeded with the static variable value
// and it vends the user facing value object. If the type is dynamic it can
-// vend the dynamic type. If this user type also has a synthetic type associated
-// with it, it will vend the synthetic type. The class watches the process' stop
+// vend the dynamic type. If this user type also has a synthetic type
+// associated with it, it will vend the synthetic type. The class watches the
+// process' stop
// ID and will update the user type when needed.
//------------------------------------------------------------------------------
class ValueObjectManager {
diff --git a/include/lldb/Core/ValueObjectSyntheticFilter.h b/include/lldb/Core/ValueObjectSyntheticFilter.h
index e32e14030418..b3af6c0ae827 100644
--- a/include/lldb/Core/ValueObjectSyntheticFilter.h
+++ b/include/lldb/Core/ValueObjectSyntheticFilter.h
@@ -39,9 +39,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
// A ValueObject that obtains its children from some source other than
// real information
-// This is currently used to implement Python-based children and filters
-// but you can bind it to any source of synthetic information and have
-// it behave accordingly
+// This is currently used to implement Python-based children and filters but
+// you can bind it to any source of synthetic information and have it behave
+// accordingly
//----------------------------------------------------------------------
class ValueObjectSynthetic : public ValueObject {
public:
diff --git a/include/lldb/DataFormatters/DataVisualization.h b/include/lldb/DataFormatters/DataVisualization.h
index 343099bf2a7b..369fa686a9ff 100644
--- a/include/lldb/DataFormatters/DataVisualization.h
+++ b/include/lldb/DataFormatters/DataVisualization.h
@@ -21,15 +21,14 @@
namespace lldb_private {
-// this class is the high-level front-end of LLDB Data Visualization
-// code in FormatManager.h/cpp is the low-level implementation of this feature
-// clients should refer to this class as the entry-point into the data
-// formatters
+// this class is the high-level front-end of LLDB Data Visualization code in
+// FormatManager.h/cpp is the low-level implementation of this feature clients
+// should refer to this class as the entry-point into the data formatters
// unless they have a good reason to bypass this and go to the backend
class DataVisualization {
public:
- // use this call to force the FM to consider itself updated even when there is
- // no apparent reason for that
+ // use this call to force the FM to consider itself updated even when there
+ // is no apparent reason for that
static void ForceUpdate();
static uint32_t GetCurrentRevision();
diff --git a/include/lldb/DataFormatters/FormatClasses.h b/include/lldb/DataFormatters/FormatClasses.h
index c559c212c2db..458477578d3f 100644
--- a/include/lldb/DataFormatters/FormatClasses.h
+++ b/include/lldb/DataFormatters/FormatClasses.h
@@ -160,8 +160,8 @@ public:
private:
bool m_is_regex;
- // this works better than TypeAndOrName because the latter only wraps a TypeSP
- // whereas TypePair can also be backed by a CompilerType
+ // this works better than TypeAndOrName because the latter only wraps a
+ // TypeSP whereas TypePair can also be backed by a CompilerType
struct TypeOrName {
std::string m_type_name;
TypePair m_type_pair;
diff --git a/include/lldb/DataFormatters/FormatManager.h b/include/lldb/DataFormatters/FormatManager.h
index 924ef0cdf6b4..e973c8b3e849 100644
--- a/include/lldb/DataFormatters/FormatManager.h
+++ b/include/lldb/DataFormatters/FormatManager.h
@@ -33,12 +33,10 @@
namespace lldb_private {
// this file (and its. cpp) contain the low-level implementation of LLDB Data
-// Visualization
-// class DataVisualization is the high-level front-end of this feature
-// clients should refer to that class as the entry-point into the data
-// formatters
-// unless they have a good reason to bypass it and prefer to use this file's
-// objects directly
+// Visualization class DataVisualization is the high-level front-end of this
+// feature clients should refer to that class as the entry-point into the data
+// formatters unless they have a good reason to bypass it and prefer to use
+// this file's objects directly
class FormatManager : public IFormatChangeListener {
typedef FormatMap<ConstString, TypeSummaryImpl> NamedSummariesMap;
@@ -175,24 +173,22 @@ public:
static const char *GetFormatAsCString(lldb::Format format);
- // if the user tries to add formatters for, say, "struct Foo"
- // those will not match any type because of the way we strip qualifiers from
- // typenames
- // this method looks for the case where the user is adding a
- // "class","struct","enum" or "union" Foo
- // and strips the unnecessary qualifier
+ // if the user tries to add formatters for, say, "struct Foo" those will not
+ // match any type because of the way we strip qualifiers from typenames this
+ // method looks for the case where the user is adding a
+ // "class","struct","enum" or "union" Foo and strips the unnecessary
+ // qualifier
static ConstString GetValidTypeName(const ConstString &type);
// when DataExtractor dumps a vectorOfT, it uses a predefined format for each
- // item
- // this method returns it, or eFormatInvalid if vector_format is not a
+ // item this method returns it, or eFormatInvalid if vector_format is not a
// vectorOf
static lldb::Format GetSingleItemFormat(lldb::Format vector_format);
- // this returns true if the ValueObjectPrinter is *highly encouraged*
- // to actually represent this ValueObject in one-liner format
- // If this object has a summary formatter, however, we should not
- // try and do one-lining, just let the summary do the right thing
+ // this returns true if the ValueObjectPrinter is *highly encouraged* to
+ // actually represent this ValueObject in one-liner format If this object has
+ // a summary formatter, however, we should not try and do one-lining, just
+ // let the summary do the right thing
bool ShouldPrintAsOneLiner(ValueObject &valobj);
void Changed() override;
@@ -249,15 +245,12 @@ private:
TypeCategoryMap &GetCategories() { return m_categories_map; }
- // These functions are meant to initialize formatters that are very
- // low-level/global in nature
- // and do not naturally belong in any language. The intent is that most
- // formatters go in
- // language-specific categories. Eventually, the runtimes should also be
- // allowed to vend their
- // own formatters, and then one could put formatters that depend on specific
- // library load events
- // in the language runtimes, on an as-needed basis
+ // These functions are meant to initialize formatters that are very low-
+ // level/global in nature and do not naturally belong in any language. The
+ // intent is that most formatters go in language-specific categories.
+ // Eventually, the runtimes should also be allowed to vend their own
+ // formatters, and then one could put formatters that depend on specific
+ // library load events in the language runtimes, on an as-needed basis
void LoadSystemFormatters();
void LoadVectorFormatters();
diff --git a/include/lldb/DataFormatters/FormattersContainer.h b/include/lldb/DataFormatters/FormattersContainer.h
index 2df5bf4efcfb..df88e88011fe 100644
--- a/include/lldb/DataFormatters/FormattersContainer.h
+++ b/include/lldb/DataFormatters/FormattersContainer.h
@@ -43,12 +43,10 @@ public:
virtual uint32_t GetCurrentRevision() = 0;
};
-// if the user tries to add formatters for, say, "struct Foo"
-// those will not match any type because of the way we strip qualifiers from
-// typenames
-// this method looks for the case where the user is adding a
-// "class","struct","enum" or "union" Foo
-// and strips the unnecessary qualifier
+// if the user tries to add formatters for, say, "struct Foo" those will not
+// match any type because of the way we strip qualifiers from typenames this
+// method looks for the case where the user is adding a "class","struct","enum"
+// or "union" Foo and strips the unnecessary qualifier
static inline ConstString GetValidTypeName_Impl(const ConstString &type) {
if (type.IsEmpty())
return type;
diff --git a/include/lldb/DataFormatters/StringPrinter.h b/include/lldb/DataFormatters/StringPrinter.h
index 8d4a099fbec9..18207921bb71 100644
--- a/include/lldb/DataFormatters/StringPrinter.h
+++ b/include/lldb/DataFormatters/StringPrinter.h
@@ -266,8 +266,7 @@ public:
// I can't use a std::unique_ptr for this because the Deleter is a template
// argument there
// and I want the same type to represent both pointers I want to free and
- // pointers I don't need
- // to free - which is what this class essentially is
+ // pointers I don't need to free - which is what this class essentially is
// It's very specialized to the needs of this file, and not suggested for
// general use
template <typename T = uint8_t, typename U = char, typename S = size_t>
diff --git a/include/lldb/DataFormatters/TypeFormat.h b/include/lldb/DataFormatters/TypeFormat.h
index 8cfe021da3e0..77e3542f5522 100644
--- a/include/lldb/DataFormatters/TypeFormat.h
+++ b/include/lldb/DataFormatters/TypeFormat.h
@@ -146,10 +146,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its value
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its value
virtual bool FormatObject(ValueObject *valobj, std::string &dest) const = 0;
virtual std::string GetDescription() = 0;
diff --git a/include/lldb/DataFormatters/TypeSummary.h b/include/lldb/DataFormatters/TypeSummary.h
index 1bde565aa5c8..17cd61ae8c1e 100644
--- a/include/lldb/DataFormatters/TypeSummary.h
+++ b/include/lldb/DataFormatters/TypeSummary.h
@@ -258,10 +258,9 @@ public:
void SetOptions(uint32_t value) { m_flags.SetValue(value); }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its summary
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its summary
virtual bool FormatObject(ValueObject *valobj, std::string &dest,
const TypeSummaryOptions &options) = 0;
@@ -311,8 +310,8 @@ private:
// summaries implemented via a C++ function
struct CXXFunctionSummaryFormat : public TypeSummaryImpl {
- // we should convert these to SBValue and SBStream if we ever cross
- // the boundary towards the external world
+ // we should convert these to SBValue and SBStream if we ever cross the
+ // boundary towards the external world
typedef std::function<bool(ValueObject &, Stream &,
const TypeSummaryOptions &)>
Callback;
diff --git a/include/lldb/DataFormatters/TypeSynthetic.h b/include/lldb/DataFormatters/TypeSynthetic.h
index 59fb6d3fcdbb..07dacd670a62 100644
--- a/include/lldb/DataFormatters/TypeSynthetic.h
+++ b/include/lldb/DataFormatters/TypeSynthetic.h
@@ -55,34 +55,29 @@ public:
virtual size_t GetIndexOfChildWithName(const ConstString &name) = 0;
// this function is assumed to always succeed and it if fails, the front-end
- // should know to deal
- // with it in the correct way (most probably, by refusing to return any
- // children)
- // the return value of Update() should actually be interpreted as
- // "ValueObjectSyntheticFilter cache is good/bad"
- // if =true, ValueObjectSyntheticFilter is allowed to use the children it
- // fetched previously and cached
- // if =false, ValueObjectSyntheticFilter must throw away its cache, and query
- // again for children
+ // should know to deal with it in the correct way (most probably, by refusing
+ // to return any children) the return value of Update() should actually be
+ // interpreted as "ValueObjectSyntheticFilter cache is good/bad" if =true,
+ // ValueObjectSyntheticFilter is allowed to use the children it fetched
+ // previously and cached if =false, ValueObjectSyntheticFilter must throw
+ // away its cache, and query again for children
virtual bool Update() = 0;
// if this function returns false, then CalculateNumChildren() MUST return 0
- // since UI frontends
- // might validly decide not to inquire for children given a false return value
- // from this call
- // if it returns true, then CalculateNumChildren() can return any number >= 0
- // (0 being valid)
- // it should if at all possible be more efficient than CalculateNumChildren()
+ // since UI frontends might validly decide not to inquire for children given
+ // a false return value from this call if it returns true, then
+ // CalculateNumChildren() can return any number >= 0 (0 being valid) it
+ // should if at all possible be more efficient than CalculateNumChildren()
virtual bool MightHaveChildren() = 0;
// if this function returns a non-null ValueObject, then the returned
- // ValueObject will stand
- // for this ValueObject whenever a "value" request is made to this ValueObject
+ // ValueObject will stand for this ValueObject whenever a "value" request is
+ // made to this ValueObject
virtual lldb::ValueObjectSP GetSyntheticValue() { return nullptr; }
- // if this function returns a non-empty ConstString, then clients are expected
- // to use the return
- // as the name of the type of this ValueObject for display purposes
+ // if this function returns a non-empty ConstString, then clients are
+ // expected to use the return as the name of the type of this ValueObject for
+ // display purposes
virtual ConstString GetSyntheticTypeName() { return ConstString(); }
typedef std::shared_ptr<SyntheticChildrenFrontEnd> SharedPointer;
@@ -212,6 +207,19 @@ public:
return *this;
}
+ bool GetFrontEndWantsDereference() const {
+ return (m_flags & lldb::eTypeOptionFrontEndWantsDereference) ==
+ lldb::eTypeOptionFrontEndWantsDereference;
+ }
+
+ Flags &SetFrontEndWantsDereference(bool value = true) {
+ if (value)
+ m_flags |= lldb::eTypeOptionFrontEndWantsDereference;
+ else
+ m_flags &= ~lldb::eTypeOptionFrontEndWantsDereference;
+ return *this;
+ }
+
uint32_t GetValue() { return m_flags; }
void SetValue(uint32_t value) { m_flags = value; }
@@ -231,6 +239,8 @@ public:
bool SkipsReferences() const { return m_flags.GetSkipReferences(); }
bool NonCacheable() const { return m_flags.GetNonCacheable(); }
+
+ bool WantsDereference() const { return m_flags.GetFrontEndWantsDereference();}
void SetCascades(bool value) { m_flags.SetCascades(value); }
diff --git a/include/lldb/DataFormatters/TypeValidator.h b/include/lldb/DataFormatters/TypeValidator.h
index 3c414e39353f..fa2a89148118 100644
--- a/include/lldb/DataFormatters/TypeValidator.h
+++ b/include/lldb/DataFormatters/TypeValidator.h
@@ -147,10 +147,9 @@ public:
virtual Type GetType() { return Type::eTypeUnknown; }
// we are using a ValueObject* instead of a ValueObjectSP because we do not
- // need to hold on to this for
- // extended periods of time and we trust the ValueObject to stay around for as
- // long as it is required
- // for us to generate its value
+ // need to hold on to this for extended periods of time and we trust the
+ // ValueObject to stay around for as long as it is required for us to
+ // generate its value
virtual ValidationResult FormatObject(ValueObject *valobj) const = 0;
virtual std::string GetDescription() = 0;
diff --git a/include/lldb/DataFormatters/ValueObjectPrinter.h b/include/lldb/DataFormatters/ValueObjectPrinter.h
index 41851436873d..67048a4932cf 100644
--- a/include/lldb/DataFormatters/ValueObjectPrinter.h
+++ b/include/lldb/DataFormatters/ValueObjectPrinter.h
@@ -47,16 +47,16 @@ protected:
InstancePointersSetSP m_printed_instance_pointers;
- // only this class (and subclasses, if any) should ever be concerned with
- // the depth mechanism
+ // only this class (and subclasses, if any) should ever be concerned with the
+ // depth mechanism
ValueObjectPrinter(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,
uint32_t curr_depth,
InstancePointersSetSP printed_instance_pointers);
- // we should actually be using delegating constructors here
- // but some versions of GCC still have trouble with those
+ // we should actually be using delegating constructors here but some versions
+ // of GCC still have trouble with those
void Init(ValueObject *valobj, Stream *s,
const DumpValueObjectOptions &options,
const DumpValueObjectOptions::PointerDepth &ptr_depth,
diff --git a/include/lldb/DataFormatters/VectorIterator.h b/include/lldb/DataFormatters/VectorIterator.h
index fcf5aba6ecbe..f695d2290502 100644
--- a/include/lldb/DataFormatters/VectorIterator.h
+++ b/include/lldb/DataFormatters/VectorIterator.h
@@ -13,6 +13,7 @@
#include "lldb/lldb-forward.h"
+#include "lldb/DataFormatters/TypeSynthetic.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Utility/ConstString.h"
diff --git a/include/lldb/Expression/DWARFExpression.h b/include/lldb/Expression/DWARFExpression.h
index c85aaa5c1f9a..b4bd9697da58 100644
--- a/include/lldb/Expression/DWARFExpression.h
+++ b/include/lldb/Expression/DWARFExpression.h
@@ -18,22 +18,22 @@
#include "lldb/lldb-private.h"
#include <functional>
-class DWARFCompileUnit;
+class DWARFUnit;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class DWARFExpression DWARFExpression.h "lldb/Expression/DWARFExpression.h"
-/// @brief Encapsulates a DWARF location expression and interprets it.
+/// @class DWARFExpression DWARFExpression.h
+/// "lldb/Expression/DWARFExpression.h" Encapsulates a DWARF location
+/// expression and interprets it.
///
/// DWARF location expressions are used in two ways by LLDB. The first
-/// use is to find entities specified in the debug information, since
-/// their locations are specified in precisely this language. The second
-/// is to interpret expressions without having to run the target in cases
-/// where the overhead from copying JIT-compiled code into the target is
-/// too high or where the target cannot be run. This class encapsulates
-/// a single DWARF location expression or a location list and interprets
-/// it.
+/// use is to find entities specified in the debug information, since their
+/// locations are specified in precisely this language. The second is to
+/// interpret expressions without having to run the target in cases where the
+/// overhead from copying JIT-compiled code into the target is too high or
+/// where the target cannot be run. This class encapsulates a single DWARF
+/// location expression or a location list and interprets it.
//----------------------------------------------------------------------
class DWARFExpression {
public:
@@ -46,7 +46,7 @@ public:
//------------------------------------------------------------------
/// Constructor
//------------------------------------------------------------------
- explicit DWARFExpression(DWARFCompileUnit *dwarf_cu);
+ explicit DWARFExpression(DWARFUnit *dwarf_cu);
//------------------------------------------------------------------
/// Constructor
@@ -62,7 +62,7 @@ public:
/// The byte length of the location expression.
//------------------------------------------------------------------
DWARFExpression(lldb::ModuleSP module, const DataExtractor &data,
- DWARFCompileUnit *dwarf_cu, lldb::offset_t data_offset,
+ DWARFUnit *dwarf_cu, lldb::offset_t data_offset,
lldb::offset_t data_length);
//------------------------------------------------------------------
@@ -130,12 +130,12 @@ public:
//------------------------------------------------------------------
/// If a location is not a location list, return true if the location
- /// contains a DW_OP_addr () opcode in the stream that matches \a
- /// file_addr. If file_addr is LLDB_INVALID_ADDRESS, the this
- /// function will return true if the variable there is any DW_OP_addr
- /// in a location that (yet still is NOT a location list). This helps
- /// us detect if a variable is a global or static variable since
- /// there is no other indication from DWARF debug info.
+ /// contains a DW_OP_addr () opcode in the stream that matches \a file_addr.
+ /// If file_addr is LLDB_INVALID_ADDRESS, the this function will return true
+ /// if the variable there is any DW_OP_addr in a location that (yet still is
+ /// NOT a location list). This helps us detect if a variable is a global or
+ /// static variable since there is no other indication from DWARF debug
+ /// info.
///
/// @param[in] op_addr_idx
/// The DW_OP_addr index to retrieve in case there is more than
@@ -161,8 +161,8 @@ public:
&link_address_callback);
//------------------------------------------------------------------
- /// Make the expression parser read its location information from a
- /// given data source. Does not change the offset and length
+ /// Make the expression parser read its location information from a given
+ /// data source. Does not change the offset and length
///
/// @param[in] data
/// A data extractor configured to read the DWARF location expression's
@@ -171,8 +171,8 @@ public:
void SetOpcodeData(const DataExtractor &data);
//------------------------------------------------------------------
- /// Make the expression parser read its location information from a
- /// given data source
+ /// Make the expression parser read its location information from a given
+ /// data source
///
/// @param[in] module_sp
/// The module that defines the DWARF expression.
@@ -193,16 +193,15 @@ public:
//------------------------------------------------------------------
/// Copy the DWARF location expression into a local buffer.
///
- /// It is a good idea to copy the data so we don't keep the entire
- /// object file worth of data around just for a few bytes of location
- /// expression. LLDB typically will mmap the entire contents of debug
- /// information files, and if we use SetOpcodeData, it will get a
- /// shared reference to all of this data for the and cause the object
- /// file to have to stay around. Even worse, a very very large ".a"
- /// that contains one or more .o files could end up being referenced.
- /// Location lists are typically small so even though we are copying
- /// the data, it shouldn't amount to that much for the variables we
- /// end up parsing.
+ /// It is a good idea to copy the data so we don't keep the entire object
+ /// file worth of data around just for a few bytes of location expression.
+ /// LLDB typically will mmap the entire contents of debug information files,
+ /// and if we use SetOpcodeData, it will get a shared reference to all of
+ /// this data for the and cause the object file to have to stay around. Even
+ /// worse, a very very large ".a" that contains one or more .o files could
+ /// end up being referenced. Location lists are typically small so even
+ /// though we are copying the data, it shouldn't amount to that much for the
+ /// variables we end up parsing.
///
/// @param[in] module_sp
/// The module that defines the DWARF expression.
@@ -254,8 +253,8 @@ public:
//------------------------------------------------------------------
/// Wrapper for the static evaluate function that accepts an
- /// ExecutionContextScope instead of an ExecutionContext and uses
- /// member variables to populate many operands
+ /// ExecutionContextScope instead of an ExecutionContext and uses member
+ /// variables to populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContextScope *exe_scope,
lldb::addr_t loclist_base_load_addr,
@@ -263,8 +262,8 @@ public:
Value &result, Status *error_ptr) const;
//------------------------------------------------------------------
- /// Wrapper for the static evaluate function that uses member
- /// variables to populate many operands
+ /// Wrapper for the static evaluate function that uses member variables to
+ /// populate many operands
//------------------------------------------------------------------
bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::addr_t loclist_base_load_addr,
@@ -332,7 +331,7 @@ public:
//------------------------------------------------------------------
static bool Evaluate(ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP opcode_ctx, const DataExtractor &opcodes,
- DWARFCompileUnit *dwarf_cu, const lldb::offset_t offset,
+ DWARFUnit *dwarf_cu, const lldb::offset_t offset,
const lldb::offset_t length,
const lldb::RegisterKind reg_set,
const Value *initial_value_ptr,
@@ -348,7 +347,7 @@ public:
lldb::addr_t loclist_base_load_addr,
lldb::addr_t address, ABI *abi);
- static size_t LocationListSize(const DWARFCompileUnit *dwarf_cu,
+ static size_t LocationListSize(const DWARFUnit *dwarf_cu,
const DataExtractor &debug_loc_data,
lldb::offset_t offset);
@@ -356,7 +355,7 @@ public:
int address_size, int dwarf_ref_size,
bool location_expression);
- static void PrintDWARFLocationList(Stream &s, const DWARFCompileUnit *cu,
+ static void PrintDWARFLocationList(Stream &s, const DWARFUnit *cu,
const DataExtractor &debug_loc_data,
lldb::offset_t offset);
@@ -389,7 +388,7 @@ protected:
lldb::offset_t &offset, lldb::offset_t &len);
static bool AddressRangeForLocationListEntry(
- const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data,
+ const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data,
lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc);
bool GetOpAndEndOffsets(StackFrame &frame, lldb::offset_t &op_offset,
@@ -401,7 +400,7 @@ protected:
lldb::ModuleWP m_module_wp; ///< Module which defined this expression.
DataExtractor m_data; ///< A data extractor capable of reading opcode bytes
- DWARFCompileUnit *m_dwarf_cu; ///< The DWARF compile unit this expression
+ DWARFUnit *m_dwarf_cu; ///< The DWARF compile unit this expression
///belongs to. It is used
///< to evaluate values indexing into the .debug_addr section (e.g.
///< DW_OP_GNU_addr_index, DW_OP_GNU_const_index)
diff --git a/include/lldb/Expression/Expression.h b/include/lldb/Expression/Expression.h
index 860444e9c2c2..6b9363864722 100644
--- a/include/lldb/Expression/Expression.h
+++ b/include/lldb/Expression/Expression.h
@@ -28,14 +28,14 @@ namespace lldb_private {
class RecordingMemoryManager;
//----------------------------------------------------------------------
-/// @class Expression Expression.h "lldb/Expression/Expression.h"
-/// @brief Encapsulates a single expression for use in lldb
+/// @class Expression Expression.h "lldb/Expression/Expression.h" Encapsulates
+/// a single expression for use in lldb
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. Expression encapsulates
-/// the objects needed to parse and interpret or JIT an expression. It
-/// uses the expression parser appropriate to the language of the expression
-/// to produce LLVM IR from the expression.
+/// and as a backend for the expr command. Expression encapsulates the
+/// objects needed to parse and interpret or JIT an expression. It uses the
+/// expression parser appropriate to the language of the expression to produce
+/// LLVM IR from the expression.
//----------------------------------------------------------------------
class Expression {
public:
@@ -58,20 +58,19 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
virtual const char *FunctionName() = 0;
//------------------------------------------------------------------
- /// Return the language that should be used when parsing. To use
- /// the default, return eLanguageTypeUnknown.
+ /// Return the language that should be used when parsing. To use the
+ /// default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
virtual lldb::LanguageType Language() { return lldb::eLanguageTypeUnknown; }
//------------------------------------------------------------------
- /// Return the desired result type of the function, or
- /// eResultTypeAny if indifferent.
+ /// Return the desired result type of the function, or eResultTypeAny if
+ /// indifferent.
//------------------------------------------------------------------
virtual ResultType DesiredResultType() { return eResultTypeAny; }
@@ -80,14 +79,12 @@ public:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
virtual bool NeedsValidation() = 0;
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
virtual bool NeedsVariableResolution() = 0;
diff --git a/include/lldb/Expression/ExpressionParser.h b/include/lldb/Expression/ExpressionParser.h
index a550d576f437..66957926650a 100644
--- a/include/lldb/Expression/ExpressionParser.h
+++ b/include/lldb/Expression/ExpressionParser.h
@@ -20,8 +20,8 @@ class IRExecutionUnit;
//----------------------------------------------------------------------
/// @class ExpressionParser ExpressionParser.h
-/// "lldb/Expression/ExpressionParser.h"
-/// @brief Encapsulates an instance of a compiler that can parse expressions.
+/// "lldb/Expression/ExpressionParser.h" Encapsulates an instance of a
+/// compiler that can parse expressions.
///
/// ExpressionParser is the base class for llvm based Expression parsers.
//----------------------------------------------------------------------
@@ -50,8 +50,8 @@ public:
virtual ~ExpressionParser(){};
//------------------------------------------------------------------
- /// Parse a single expression and convert it to IR using Clang. Don't
- /// wrap the expression in anything at all.
+ /// Parse a single expression and convert it to IR using Clang. Don't wrap
+ /// the expression in anything at all.
///
/// @param[in] diagnostic_manager
/// The diagnostic manager in which to store the errors and warnings.
@@ -64,8 +64,8 @@ public:
//------------------------------------------------------------------
/// Try to use the FixIts in the diagnostic_manager to rewrite the
- /// expression. If successful, the rewritten expression is stored
- /// in the diagnostic_manager, get it out with GetFixedExpression.
+ /// expression. If successful, the rewritten expression is stored in the
+ /// diagnostic_manager, get it out with GetFixedExpression.
///
/// @param[in] diagnostic_manager
/// The diagnostic manager containing fixit's to apply.
@@ -78,8 +78,8 @@ public:
}
//------------------------------------------------------------------
- /// Ready an already-parsed expression for execution, possibly
- /// evaluating it statically.
+ /// Ready an already-parsed expression for execution, possibly evaluating it
+ /// statically.
///
/// @param[out] func_addr
/// The address to which the function has been written.
diff --git a/include/lldb/Expression/ExpressionSourceCode.h b/include/lldb/Expression/ExpressionSourceCode.h
index 02fc72aaf251..b5a6187bf3c5 100644
--- a/include/lldb/Expression/ExpressionSourceCode.h
+++ b/include/lldb/Expression/ExpressionSourceCode.h
@@ -40,9 +40,8 @@ public:
bool static_method, ExecutionContext &exe_ctx) const;
// Given a string returned by GetText, find the beginning and end of the body
- // passed to CreateWrapped.
- // Return true if the bounds could be found. This will also work on text with
- // FixItHints applied.
+ // passed to CreateWrapped. Return true if the bounds could be found. This
+ // will also work on text with FixItHints applied.
static bool GetOriginalBodyBounds(std::string transformed_text,
lldb::LanguageType wrapping_language,
size_t &start_loc, size_t &end_loc);
diff --git a/include/lldb/Expression/ExpressionTypeSystemHelper.h b/include/lldb/Expression/ExpressionTypeSystemHelper.h
index 20a5e67cf9b7..ffcad54fb9f9 100644
--- a/include/lldb/Expression/ExpressionTypeSystemHelper.h
+++ b/include/lldb/Expression/ExpressionTypeSystemHelper.h
@@ -18,11 +18,11 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ExpressionTypeSystemHelper ExpressionTypeSystemHelper.h
/// "lldb/Expression/ExpressionTypeSystemHelper.h"
-/// @brief A helper object that the Expression can pass to its ExpressionParser
+/// A helper object that the Expression can pass to its ExpressionParser
/// to provide generic information that
/// any type of expression will need to supply. It's only job is to support
-/// dyn_cast so that the expression parser
-/// can cast it back to the requisite specific type.
+/// dyn_cast so that the expression parser can cast it back to the requisite
+/// specific type.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Expression/ExpressionVariable.h b/include/lldb/Expression/ExpressionVariable.h
index c7570932c15a..89b0500faf9c 100644
--- a/include/lldb/Expression/ExpressionVariable.h
+++ b/include/lldb/Expression/ExpressionVariable.h
@@ -69,15 +69,12 @@ public:
void SetName(const ConstString &name) { m_frozen_sp->SetName(name); }
// this function is used to copy the address-of m_live_sp into m_frozen_sp
- // this is necessary because the results of certain cast and
- // pointer-arithmetic
- // operations (such as those described in bugzilla issues 11588 and 11618)
- // generate
- // frozen objects that do not have a valid address-of, which can be
- // troublesome when
- // using synthetic children providers. Transferring the address-of the live
- // object
- // solves these issues and provides the expected user-level behavior
+ // this is necessary because the results of certain cast and pointer-
+ // arithmetic operations (such as those described in bugzilla issues 11588
+ // and 11618) generate frozen objects that do not have a valid address-of,
+ // which can be troublesome when using synthetic children providers.
+ // Transferring the address-of the live object solves these issues and
+ // provides the expected user-level behavior
void TransferAddress(bool force = false) {
if (m_live_sp.get() == nullptr)
return;
@@ -129,7 +126,7 @@ public:
//----------------------------------------------------------------------
/// @class ExpressionVariableList ExpressionVariable.h
/// "lldb/Expression/ExpressionVariable.h"
-/// @brief A list of variable references.
+/// A list of variable references.
///
/// This class stores variables internally, acting as the permanent store.
//----------------------------------------------------------------------
@@ -242,7 +239,12 @@ public:
lldb::ByteOrder byte_order,
uint32_t addr_byte_size) = 0;
- virtual ConstString GetNextPersistentVariableName() = 0;
+ /// Return a new persistent variable name with the specified prefix.
+ ConstString GetNextPersistentVariableName(Target &target,
+ llvm::StringRef prefix);
+
+ virtual llvm::StringRef
+ GetPersistentVariablePrefix(bool is_error = false) const = 0;
virtual void
RemovePersistentVariable(lldb::ExpressionVariableSP variable) = 0;
diff --git a/include/lldb/Expression/FunctionCaller.h b/include/lldb/Expression/FunctionCaller.h
index 56305d5181bd..c36263e34240 100644
--- a/include/lldb/Expression/FunctionCaller.h
+++ b/include/lldb/Expression/FunctionCaller.h
@@ -29,7 +29,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FunctionCaller FunctionCaller.h "lldb/Expression/FunctionCaller.h"
-/// @brief Encapsulates a function that can be called.
+/// Encapsulates a function that can be called.
///
/// A given FunctionCaller object can handle a single function signature.
/// Once constructed, it can set up any number of concurrent calls to
@@ -42,8 +42,8 @@ namespace lldb_private {
/// struct with the written arguments. This method lets Clang handle the
/// vagaries of function calling conventions.
///
-/// The simplest use of the FunctionCaller is to construct it with a
-/// function representative of the signature you want to use, then call
+/// The simplest use of the FunctionCaller is to construct it with a function
+/// representative of the signature you want to use, then call
/// ExecuteFunction(ExecutionContext &, Stream &, Value &).
///
/// If you need to reuse the arguments for several calls, you can call
@@ -53,8 +53,8 @@ namespace lldb_private {
/// If you need to call the function on the thread plan stack, you can also
/// call InsertFunction() followed by GetThreadPlanToCallFunction().
///
-/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed
-/// a pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
+/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed a
+/// pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
/// and its address returned in that variable.
///
/// Any of the methods that take arg_addr_ptr can be passed nullptr, and the
@@ -170,8 +170,8 @@ public:
DiagnosticManager &diagnostic_manager);
//------------------------------------------------------------------
- /// Insert an argument struct with a non-default function address and
- /// non-default argument values
+ /// Insert an argument struct with a non-default function address and non-
+ /// default argument values
///
/// @param[in] exe_ctx
/// The execution context to insert the function and its arguments
@@ -308,28 +308,25 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override {
return m_wrapper_function_name.c_str();
}
//------------------------------------------------------------------
- /// Return the object that the parser should use when registering
- /// local variables. May be nullptr if the Expression doesn't care.
+ /// Return the object that the parser should use when registering local
+ /// variables. May be nullptr if the Expression doesn't care.
//------------------------------------------------------------------
ExpressionVariableList *LocalVariables() { return nullptr; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return false; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return false; }
diff --git a/include/lldb/Expression/IRDynamicChecks.h b/include/lldb/Expression/IRDynamicChecks.h
index b793a60585bb..f31c03cfb9ef 100644
--- a/include/lldb/Expression/IRDynamicChecks.h
+++ b/include/lldb/Expression/IRDynamicChecks.h
@@ -33,17 +33,18 @@ class Stream;
//----------------------------------------------------------------------
/// @class DynamicCheckerFunctions IRDynamicChecks.h
-/// "lldb/Expression/IRDynamicChecks.h"
-/// @brief Encapsulates dynamic check functions used by expressions.
+/// "lldb/Expression/IRDynamicChecks.h" Encapsulates dynamic check functions
+/// used by expressions.
///
/// Each of the utility functions encapsulated in this class is responsible
-/// for validating some data that an expression is about to use. Examples are:
+/// for validating some data that an expression is about to use. Examples
+/// are:
///
-/// a = *b; // check that b is a valid pointer
-/// [b init]; // check that b is a valid object to send "init" to
+/// a = *b; // check that b is a valid pointer [b init]; // check that b
+/// is a valid object to send "init" to
///
-/// The class installs each checker function into the target process and
-/// makes it available to IRDynamicChecks to use.
+/// The class installs each checker function into the target process and makes
+/// it available to IRDynamicChecks to use.
//----------------------------------------------------------------------
class DynamicCheckerFunctions {
public:
@@ -58,8 +59,8 @@ public:
~DynamicCheckerFunctions();
//------------------------------------------------------------------
- /// Install the utility functions into a process. This binds the
- /// instance of DynamicCheckerFunctions to that process.
+ /// Install the utility functions into a process. This binds the instance
+ /// of DynamicCheckerFunctions to that process.
///
/// @param[in] diagnostic_manager
/// A diagnostic manager to report errors to.
@@ -81,16 +82,16 @@ public:
};
//----------------------------------------------------------------------
-/// @class IRDynamicChecks IRDynamicChecks.h "lldb/Expression/IRDynamicChecks.h"
-/// @brief Adds dynamic checks to a user-entered expression to reduce its
-/// likelihood of crashing
+/// @class IRDynamicChecks IRDynamicChecks.h
+/// "lldb/Expression/IRDynamicChecks.h" Adds dynamic checks to a user-entered
+/// expression to reduce its likelihood of crashing
///
/// When an IR function is executed in the target process, it may cause
-/// crashes or hangs by dereferencing NULL pointers, trying to call Objective-C
-/// methods on objects that do not respond to them, and so forth.
+/// crashes or hangs by dereferencing NULL pointers, trying to call
+/// Objective-C methods on objects that do not respond to them, and so forth.
///
-/// IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions
-/// to appropriate locations in an expression's IR.
+/// IRDynamicChecks adds calls to the functions in DynamicCheckerFunctions to
+/// appropriate locations in an expression's IR.
//----------------------------------------------------------------------
class IRDynamicChecks : public llvm::ModulePass {
public:
diff --git a/include/lldb/Expression/IRExecutionUnit.h b/include/lldb/Expression/IRExecutionUnit.h
index 703fcd152af4..e73f8956d955 100644
--- a/include/lldb/Expression/IRExecutionUnit.h
+++ b/include/lldb/Expression/IRExecutionUnit.h
@@ -42,23 +42,23 @@ namespace lldb_private {
class Status;
//----------------------------------------------------------------------
-/// @class IRExecutionUnit IRExecutionUnit.h "lldb/Expression/IRExecutionUnit.h"
-/// @brief Contains the IR and, optionally, JIT-compiled code for a module.
+/// @class IRExecutionUnit IRExecutionUnit.h
+/// "lldb/Expression/IRExecutionUnit.h" Contains the IR and, optionally, JIT-
+/// compiled code for a module.
///
-/// This class encapsulates the compiled version of an expression, in IR
-/// form (for interpretation purposes) and in raw machine code form (for
-/// execution in the target).
+/// This class encapsulates the compiled version of an expression, in IR form
+/// (for interpretation purposes) and in raw machine code form (for execution
+/// in the target).
///
-/// This object wraps an IR module that comes from the expression parser,
-/// and knows how to use the JIT to make it into executable code. It can
-/// then be used as input to the IR interpreter, or the address of the
-/// executable code can be passed to a thread plan to run in the target.
+/// This object wraps an IR module that comes from the expression parser, and
+/// knows how to use the JIT to make it into executable code. It can then be
+/// used as input to the IR interpreter, or the address of the executable code
+/// can be passed to a thread plan to run in the target.
///
/// This class creates a subclass of LLVM's SectionMemoryManager, because that
-/// is
-/// how the JIT emits code. Because LLDB needs to move JIT-compiled code
-/// into the target process, the IRExecutionUnit knows how to copy the
-/// emitted code into the target process.
+/// is how the JIT emits code. Because LLDB needs to move JIT-compiled code
+/// into the target process, the IRExecutionUnit knows how to copy the emitted
+/// code into the target process.
//----------------------------------------------------------------------
class IRExecutionUnit : public std::enable_shared_from_this<IRExecutionUnit>,
public IRMemoryMap,
@@ -90,9 +90,9 @@ public:
lldb::addr_t &func_end);
//------------------------------------------------------------------
- /// Accessors for IRForTarget and other clients that may want binary
- /// data placed on their behalf. The binary data is owned by the
- /// IRExecutionUnit unless the client explicitly chooses to free it.
+ /// Accessors for IRForTarget and other clients that may want binary data
+ /// placed on their behalf. The binary data is owned by the IRExecutionUnit
+ /// unless the client explicitly chooses to free it.
//------------------------------------------------------------------
lldb::addr_t WriteNow(const uint8_t *bytes, size_t size, Status &error);
@@ -123,7 +123,7 @@ public:
//----------------------------------------------------------------------
/// @class JittedFunction IRExecutionUnit.h
/// "lldb/Expression/IRExecutionUnit.h"
- /// @brief Encapsulates a single function that has been generated by the JIT.
+ /// Encapsulates a single function that has been generated by the JIT.
///
/// Functions that have been generated by the JIT are first resident in the
/// local process, and then placed in the target process. JittedFunction
@@ -182,9 +182,9 @@ public:
private:
//------------------------------------------------------------------
- /// Look up the object in m_address_map that contains a given address,
- /// find where it was copied to, and return the remote address at the
- /// same offset into the copied entity
+ /// Look up the object in m_address_map that contains a given address, find
+ /// where it was copied to, and return the remote address at the same offset
+ /// into the copied entity
///
/// @param[in] local_address
/// The address in the debugger.
@@ -195,9 +195,9 @@ private:
lldb::addr_t GetRemoteAddressForLocal(lldb::addr_t local_address);
//------------------------------------------------------------------
- /// Look up the object in m_address_map that contains a given address,
- /// find where it was copied to, and return its address range in the
- /// target process
+ /// Look up the object in m_address_map that contains a given address, find
+ /// where it was copied to, and return its address range in the target
+ /// process
///
/// @param[in] local_address
/// The address in the debugger.
@@ -272,8 +272,8 @@ private:
~MemoryManager() override;
//------------------------------------------------------------------
- /// Allocate space for executable code, and add it to the
- /// m_spaceBlocks map
+ /// Allocate space for executable code, and add it to the m_spaceBlocks
+ /// map
///
/// @param[in] Size
/// The size of the area.
@@ -315,8 +315,8 @@ private:
bool IsReadOnly) override;
//------------------------------------------------------------------
- /// Called when object loading is complete and section page
- /// permissions can be applied. Currently unimplemented for LLDB.
+ /// Called when object loading is complete and section page permissions
+ /// can be applied. Currently unimplemented for LLDB.
///
/// @param[out] ErrMsg
/// The error that prevented the page protection from succeeding.
@@ -355,11 +355,11 @@ private:
//----------------------------------------------------------------------
/// @class AllocationRecord IRExecutionUnit.h
- /// "lldb/Expression/IRExecutionUnit.h"
- /// @brief Encapsulates a single allocation request made by the JIT.
+ /// "lldb/Expression/IRExecutionUnit.h" Encapsulates a single allocation
+ /// request made by the JIT.
///
- /// Allocations made by the JIT are first queued up and then applied in
- /// bulk to the underlying process.
+ /// Allocations made by the JIT are first queued up and then applied in bulk
+ /// to the underlying process.
//----------------------------------------------------------------------
enum class AllocationKind { Stub, Code, Data, Global, Bytes };
diff --git a/include/lldb/Expression/IRInterpreter.h b/include/lldb/Expression/IRInterpreter.h
index 36e03c6fc4f6..2d87346b7066 100644
--- a/include/lldb/Expression/IRInterpreter.h
+++ b/include/lldb/Expression/IRInterpreter.h
@@ -29,12 +29,12 @@ class IRMemoryMap;
//----------------------------------------------------------------------
/// @class IRInterpreter IRInterpreter.h "lldb/Expression/IRInterpreter.h"
-/// @brief Attempt to interpret the function's code if it does not require
+/// Attempt to interpret the function's code if it does not require
/// running the target.
///
-/// In some cases, the IR for an expression can be evaluated entirely
-/// in the debugger, manipulating variables but not executing any code
-/// in the target. The IRInterpreter attempts to do this.
+/// In some cases, the IR for an expression can be evaluated entirely in the
+/// debugger, manipulating variables but not executing any code in the target.
+/// The IRInterpreter attempts to do this.
//----------------------------------------------------------------------
class IRInterpreter {
public:
diff --git a/include/lldb/Expression/IRMemoryMap.h b/include/lldb/Expression/IRMemoryMap.h
index abb5cd745053..df8a03f4763f 100644
--- a/include/lldb/Expression/IRMemoryMap.h
+++ b/include/lldb/Expression/IRMemoryMap.h
@@ -20,19 +20,19 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class IRMemoryMap IRMemoryMap.h "lldb/Expression/IRMemoryMap.h"
-/// @brief Encapsulates memory that may exist in the process but must
+/// Encapsulates memory that may exist in the process but must
/// also be available in the host process.
///
-/// This class encapsulates a group of memory objects that must be readable
-/// or writable from the host process regardless of whether the process
-/// exists. This allows the IR interpreter as well as JITted code to access
-/// the same memory. All allocations made by this class are represented as
-/// disjoint intervals.
+/// This class encapsulates a group of memory objects that must be readable or
+/// writable from the host process regardless of whether the process exists.
+/// This allows the IR interpreter as well as JITted code to access the same
+/// memory. All allocations made by this class are represented as disjoint
+/// intervals.
///
/// Point queries against this group of memory objects can be made by the
-/// address in the tar at which they reside. If the inferior does not
-/// exist, allocations still get made-up addresses. If an inferior appears
-/// at some point, then those addresses need to be re-mapped.
+/// address in the tar at which they reside. If the inferior does not exist,
+/// allocations still get made-up addresses. If an inferior appears at some
+/// point, then those addresses need to be re-mapped.
//----------------------------------------------------------------------
class IRMemoryMap {
public:
@@ -83,8 +83,8 @@ public:
lldb::TargetSP GetTarget() { return m_target_wp.lock(); }
protected:
- // This function should only be used if you know you are using the JIT.
- // Any other cases should use GetBestExecutionContextScope().
+ // This function should only be used if you know you are using the JIT. Any
+ // other cases should use GetBestExecutionContextScope().
lldb::ProcessWP &GetProcessWP() { return m_process_wp; }
diff --git a/include/lldb/Expression/LLVMUserExpression.h b/include/lldb/Expression/LLVMUserExpression.h
index 745d413e077b..a2f87e8a6e25 100644
--- a/include/lldb/Expression/LLVMUserExpression.h
+++ b/include/lldb/Expression/LLVMUserExpression.h
@@ -26,25 +26,24 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class LLVMUserExpression LLVMUserExpression.h
-/// "lldb/Expression/LLVMUserExpression.h"
-/// @brief Encapsulates a one-time expression for use in lldb.
+/// "lldb/Expression/LLVMUserExpression.h" Encapsulates a one-time expression
+/// for use in lldb.
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. LLVMUserExpression is a virtual base
-/// class that encapsulates the objects needed to parse and JIT an expression.
-/// The actual parsing part will be provided by the specific implementations
-/// of LLVMUserExpression - which will be vended through the appropriate
-/// TypeSystem.
+/// and as a backend for the expr command. LLVMUserExpression is a virtual
+/// base class that encapsulates the objects needed to parse and JIT an
+/// expression. The actual parsing part will be provided by the specific
+/// implementations of LLVMUserExpression - which will be vended through the
+/// appropriate TypeSystem.
//----------------------------------------------------------------------
class LLVMUserExpression : public UserExpression {
public:
// The IRPasses struct is filled in by a runtime after an expression is
- // compiled and can be used to to run
- // fixups/analysis passes as required. EarlyPasses are run on the generated
- // module before lldb runs its own IR
+ // compiled and can be used to to run fixups/analysis passes as required.
+ // EarlyPasses are run on the generated module before lldb runs its own IR
// fixups and inserts instrumentation code/pointer checks. LatePasses are run
- // after the module has been processed by
- // llvm, before the module is assembled and run in the ThreadPlan.
+ // after the module has been processed by llvm, before the module is
+ // assembled and run in the ThreadPlan.
struct IRPasses {
IRPasses() : EarlyPasses(nullptr), LatePasses(nullptr){};
std::shared_ptr<llvm::legacy::PassManager> EarlyPasses;
diff --git a/include/lldb/Expression/UserExpression.h b/include/lldb/Expression/UserExpression.h
index ced5cb2bf2b7..96ca80c882e5 100644
--- a/include/lldb/Expression/UserExpression.h
+++ b/include/lldb/Expression/UserExpression.h
@@ -30,7 +30,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class UserExpression UserExpression.h "lldb/Expression/UserExpression.h"
-/// @brief Encapsulates a one-time expression for use in lldb.
+/// Encapsulates a one-time expression for use in lldb.
///
/// LLDB uses expressions for various purposes, notably to call functions
/// and as a backend for the expr command. UserExpression is a virtual base
@@ -103,8 +103,8 @@ public:
bool MatchesContext(ExecutionContext &exe_ctx);
//------------------------------------------------------------------
- /// Execute the parsed expression by callinng the derived class's
- /// DoExecute method.
+ /// Execute the parsed expression by callinng the derived class's DoExecute
+ /// method.
///
/// @param[in] diagnostic_manager
/// A diagnostic manager to report errors to.
@@ -177,32 +177,29 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override { return "$__lldb_expr"; }
//------------------------------------------------------------------
- /// Return the language that should be used when parsing. To use
- /// the default, return eLanguageTypeUnknown.
+ /// Return the language that should be used when parsing. To use the
+ /// default, return eLanguageTypeUnknown.
//------------------------------------------------------------------
lldb::LanguageType Language() override { return m_language; }
//------------------------------------------------------------------
- /// Return the desired result type of the function, or
- /// eResultTypeAny if indifferent.
+ /// Return the desired result type of the function, or eResultTypeAny if
+ /// indifferent.
//------------------------------------------------------------------
ResultType DesiredResultType() override { return m_desired_type; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return true; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return true; }
@@ -216,8 +213,8 @@ public:
virtual lldb::ModuleSP GetJITModule() { return lldb::ModuleSP(); }
//------------------------------------------------------------------
- /// Evaluate one expression in the scratch context of the
- /// target passed in the exe_ctx and return its result.
+ /// Evaluate one expression in the scratch context of the target passed in
+ /// the exe_ctx and return its result.
///
/// @param[in] exe_ctx
/// The execution context to use when evaluating the expression.
diff --git a/include/lldb/Expression/UtilityFunction.h b/include/lldb/Expression/UtilityFunction.h
index 9c54db35fa37..5d4bc8676b95 100644
--- a/include/lldb/Expression/UtilityFunction.h
+++ b/include/lldb/Expression/UtilityFunction.h
@@ -25,13 +25,13 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class UtilityFunction UtilityFunction.h "lldb/Expression/UtilityFunction.h"
-/// @brief Encapsulates a bit of source code that provides a function that is
-/// callable
+/// @class UtilityFunction UtilityFunction.h
+/// "lldb/Expression/UtilityFunction.h" Encapsulates a bit of source code that
+/// provides a function that is callable
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. UtilityFunction encapsulates
-/// a self-contained function meant to be used from other code. Utility
+/// and as a backend for the expr command. UtilityFunction encapsulates a
+/// self-contained function meant to be used from other code. Utility
/// functions can perform error-checking for ClangUserExpressions,
//----------------------------------------------------------------------
class UtilityFunction : public Expression {
@@ -69,8 +69,7 @@ public:
/// Check whether the given PC is inside the function
///
/// Especially useful if the function dereferences nullptr to indicate a
- /// failed
- /// assert.
+ /// failed assert.
///
/// @param[in] pc
/// The program counter to check.
@@ -80,8 +79,8 @@ public:
/// false if not (or the function is not JIT compiled)
//------------------------------------------------------------------
bool ContainsAddress(lldb::addr_t address) {
- // nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS,
- // so this always returns false if the function is not JIT compiled yet
+ // nothing is both >= LLDB_INVALID_ADDRESS and < LLDB_INVALID_ADDRESS, so
+ // this always returns false if the function is not JIT compiled yet
return (address >= m_jit_start_addr && address < m_jit_end_addr);
}
@@ -93,33 +92,29 @@ public:
//------------------------------------------------------------------
/// Return the function name that should be used for executing the
- /// expression. Text() should contain the definition of this
- /// function.
+ /// expression. Text() should contain the definition of this function.
//------------------------------------------------------------------
const char *FunctionName() override { return m_function_name.c_str(); }
//------------------------------------------------------------------
- /// Return the object that the parser should use when registering
- /// local variables. May be nullptr if the Expression doesn't care.
+ /// Return the object that the parser should use when registering local
+ /// variables. May be nullptr if the Expression doesn't care.
//------------------------------------------------------------------
ExpressionVariableList *LocalVariables() { return nullptr; }
//------------------------------------------------------------------
- /// Return true if validation code should be inserted into the
- /// expression.
+ /// Return true if validation code should be inserted into the expression.
//------------------------------------------------------------------
bool NeedsValidation() override { return false; }
//------------------------------------------------------------------
- /// Return true if external variables in the expression should be
- /// resolved.
+ /// Return true if external variables in the expression should be resolved.
//------------------------------------------------------------------
bool NeedsVariableResolution() override { return false; }
- // This makes the function caller function.
- // Pass in the ThreadSP if you have one available, compilation can end up
- // calling code (e.g. to look up indirect
- // functions) and we don't want this to wander onto another thread.
+ // This makes the function caller function. Pass in the ThreadSP if you have
+ // one available, compilation can end up calling code (e.g. to look up
+ // indirect functions) and we don't want this to wander onto another thread.
FunctionCaller *MakeFunctionCaller(const CompilerType &return_type,
const ValueList &arg_value_list,
lldb::ThreadSP compilation_thread,
diff --git a/include/lldb/Host/Config.h b/include/lldb/Host/Config.h
index 3fa19e77452d..771937498b32 100644
--- a/include/lldb/Host/Config.h
+++ b/include/lldb/Host/Config.h
@@ -16,6 +16,10 @@
// absence of a configuration step.
#define LLDB_CONFIG_TERMIOS_SUPPORTED 1
+#define LLDB_EDITLINE_USE_WCHAR 1
+
+#define LLDB_HAVE_EL_RFUNC_T 1
+
#define HAVE_SYS_EVENT_H 1
#define HAVE_PPOLL 0
diff --git a/include/lldb/Host/Config.h.cmake b/include/lldb/Host/Config.h.cmake
index 73f4b8f6cc4a..02a57ad8ca92 100644
--- a/include/lldb/Host/Config.h.cmake
+++ b/include/lldb/Host/Config.h.cmake
@@ -12,8 +12,14 @@
#cmakedefine LLDB_CONFIG_TERMIOS_SUPPORTED
+#cmakedefine01 LLDB_EDITLINE_USE_WCHAR
+
+#cmakedefine01 LLDB_HAVE_EL_RFUNC_T
+
#cmakedefine LLDB_DISABLE_POSIX
+#define LLDB_LIBDIR_SUFFIX "${LLVM_LIBDIR_SUFFIX}"
+
#cmakedefine01 HAVE_SYS_EVENT_H
#cmakedefine01 HAVE_PPOLL
@@ -24,6 +30,8 @@
#cmakedefine01 HAVE_NR_PROCESS_VM_READV
+#ifndef HAVE_LIBCOMPRESSION
#cmakedefine HAVE_LIBCOMPRESSION
+#endif
#endif // #ifndef LLDB_HOST_CONFIG_H
diff --git a/include/lldb/Host/Debug.h b/include/lldb/Host/Debug.h
index fc190a4eca8f..ed8e633c113f 100644
--- a/include/lldb/Host/Debug.h
+++ b/include/lldb/Host/Debug.h
@@ -25,7 +25,8 @@ namespace lldb_private {
//------------------------------------------------------------------
struct ResumeAction {
lldb::tid_t tid; // The thread ID that this action applies to,
- // LLDB_INVALID_THREAD_ID for the default thread action
+ // LLDB_INVALID_THREAD_ID for the default thread
+ // action
lldb::StateType state; // Valid values are eStateStopped/eStateSuspended,
// eStateRunning, and eStateStepping.
int signal; // When resuming this thread, resume it with this signal if this
@@ -34,10 +35,9 @@ struct ResumeAction {
//------------------------------------------------------------------
// A class that contains instructions for all threads for
-// NativeProcessProtocol::Resume(). Each thread can either run, stay
-// suspended, or step when the process is resumed. We optionally
-// have the ability to also send a signal to the thread when the
-// action is run or step.
+// NativeProcessProtocol::Resume(). Each thread can either run, stay suspended,
+// or step when the process is resumed. We optionally have the ability to also
+// send a signal to the thread when the action is run or step.
//------------------------------------------------------------------
class ResumeActionList {
public:
diff --git a/include/lldb/Host/Editline.h b/include/lldb/Host/Editline.h
index 0b75e9c923ca..beb96e7c4924 100644
--- a/include/lldb/Host/Editline.h
+++ b/include/lldb/Host/Editline.h
@@ -23,8 +23,8 @@
// broken, which is why we're
// working around it here.
// c) When resizing the terminal window, if the cursor moves between rows
-// libedit will get confused.
-// d) The incremental search uses escape to cancel input, so it's confused by
+// libedit will get confused. d) The incremental search uses escape to cancel
+// input, so it's confused by
// ANSI sequences starting with escape.
// e) Emoji support is fairly terrible, presumably it doesn't understand
// composed characters?
@@ -33,24 +33,13 @@
#define liblldb_Editline_h_
#if defined(__cplusplus)
+#if LLDB_EDITLINE_USE_WCHAR
+#include <codecvt>
+#endif
#include <locale>
#include <sstream>
#include <vector>
-// components needed to handle wide characters ( <codecvt>, codecvt_utf8,
-// libedit built with '--enable-widec' )
-// are available on some platforms. The wchar_t versions of libedit functions
-// will only be
-// used in cases where this is true. This is a compile time dependecy, for now
-// selected per target Platform
-#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__NetBSD__) || \
- defined(__OpenBSD__)
-#define LLDB_EDITLINE_USE_WCHAR 1
-#include <codecvt>
-#else
-#define LLDB_EDITLINE_USE_WCHAR 0
-#endif
-
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/lldb-private.h"
@@ -82,7 +71,11 @@ using EditLineStringStreamType = std::stringstream;
using EditLineCharType = char;
#endif
-#ifdef EL_CLIENTDATA /* editline with wide support + wide char read function */
+// At one point the callback type of el_set getchar callback changed from char
+// to wchar_t. It is not possible to detect differentiate between the two
+// versions exactly, but this is a pretty good approximation and allows us to
+// build against almost any editline version out there.
+#if LLDB_EDITLINE_USE_WCHAR || defined(EL_CLIENTDATA) || LLDB_HAVE_EL_RFUNC_T
using EditLineGetCharType = wchar_t;
#else
using EditLineGetCharType = char;
diff --git a/include/lldb/Host/File.h b/include/lldb/Host/File.h
index 1dfa12ea593d..d240f810bc8b 100644
--- a/include/lldb/Host/File.h
+++ b/include/lldb/Host/File.h
@@ -23,7 +23,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class File File.h "lldb/Host/File.h"
-/// @brief A file class.
+/// A file class.
///
/// A file class that divides abstracts the LLDB core from host file
/// functionality.
@@ -65,9 +65,9 @@ public:
//------------------------------------------------------------------
/// Constructor with path.
///
- /// Takes a path to a file which can be just a filename, or a full
- /// path. If \a path is not nullptr or empty, this function will call
- /// File::Open (const char *path, uint32_t options, uint32_t permissions).
+ /// Takes a path to a file which can be just a filename, or a full path. If
+ /// \a path is not nullptr or empty, this function will call File::Open
+ /// (const char *path, uint32_t options, uint32_t permissions).
///
/// @param[in] path
/// The full or partial path to a file.
@@ -78,7 +78,8 @@ public:
/// @param[in] permissions
/// Options to use when opening (see File::Permissions)
///
- /// @see File::Open (const char *path, uint32_t options, uint32_t permissions)
+ /// @see File::Open (const char *path, uint32_t options, uint32_t
+ /// permissions)
//------------------------------------------------------------------
File(const char *path, uint32_t options,
uint32_t permissions = lldb::eFilePermissionsFileDefault);
@@ -87,8 +88,7 @@ public:
/// Constructor with FileSpec.
///
/// Takes a FileSpec pointing to a file which can be just a filename, or a
- /// full
- /// path. If \a path is not nullptr or empty, this function will call
+ /// full path. If \a path is not nullptr or empty, this function will call
/// File::Open (const char *path, uint32_t options, uint32_t permissions).
///
/// @param[in] filespec
@@ -100,7 +100,8 @@ public:
/// @param[in] permissions
/// Options to use when opening (see File::Permissions)
///
- /// @see File::Open (const char *path, uint32_t options, uint32_t permissions)
+ /// @see File::Open (const char *path, uint32_t options, uint32_t
+ /// permissions)
//------------------------------------------------------------------
File(const FileSpec &filespec, uint32_t options,
uint32_t permissions = lldb::eFilePermissionsFileDefault);
@@ -125,8 +126,8 @@ public:
//------------------------------------------------------------------
/// Convert to pointer operator.
///
- /// This allows code to check a File object to see if it
- /// contains anything valid using code such as:
+ /// This allows code to check a File object to see if it contains anything
+ /// valid using code such as:
///
/// @code
/// File file(...);
@@ -143,8 +144,8 @@ public:
//------------------------------------------------------------------
/// Logical NOT operator.
///
- /// This allows code to check a File object to see if it is
- /// invalid using code such as:
+ /// This allows code to check a File object to see if it is invalid using
+ /// code such as:
///
/// @code
/// File file(...);
@@ -169,8 +170,7 @@ public:
//------------------------------------------------------------------
/// Open a file for read/writing with the specified options.
///
- /// Takes a path to a file which can be just a filename, or a full
- /// path.
+ /// Takes a path to a file which can be just a filename, or a full path.
///
/// @param[in] path
/// The full or partial path to a file.
@@ -202,8 +202,8 @@ public:
/// Read bytes from a file from the current file position.
///
/// NOTE: This function is NOT thread safe. Use the read function
- /// that takes an "off_t &offset" to ensure correct operation in
- /// multi-threaded environments.
+ /// that takes an "off_t &offset" to ensure correct operation in multi-
+ /// threaded environments.
///
/// @param[in] buf
/// A buffer where to put the bytes that are read.
@@ -222,8 +222,8 @@ public:
/// Write bytes to a file at the current file position.
///
/// NOTE: This function is NOT thread safe. Use the write function
- /// that takes an "off_t &offset" to ensure correct operation in
- /// multi-threaded environments.
+ /// that takes an "off_t &offset" to ensure correct operation in multi-
+ /// threaded environments.
///
/// @param[in] buf
/// A buffer where to put the bytes that are read.
@@ -243,10 +243,10 @@ public:
/// Seek to an offset relative to the beginning of the file.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in] offset
/// The offset to seek to within the file relative to the
@@ -265,10 +265,10 @@ public:
/// Seek to an offset relative to the current file position.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in] offset
/// The offset to seek to within the file relative to the
@@ -287,10 +287,10 @@ public:
/// Seek to an offset relative to the end of the file.
///
/// NOTE: This function is NOT thread safe, other threads that
- /// access this object might also change the current file position.
- /// For thread safe reads and writes see the following functions:
- /// @see File::Read (void *, size_t, off_t &)
- /// @see File::Write (const void *, size_t, off_t &)
+ /// access this object might also change the current file position. For
+ /// thread safe reads and writes see the following functions: @see
+ /// File::Read (void *, size_t, off_t &) @see File::Write (const void *,
+ /// size_t, off_t &)
///
/// @param[in,out] offset
/// The offset to seek to within the file relative to the
@@ -310,8 +310,8 @@ public:
/// Read bytes from a file from the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers and reads on other threads won't mess
- /// up the current read.
+ /// own file position markers and reads on other threads won't mess up the
+ /// current read.
///
/// @param[in] dst
/// A buffer where to put the bytes that are read.
@@ -335,8 +335,8 @@ public:
/// Read bytes from a file from the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers and reads on other threads won't mess
- /// up the current read.
+ /// own file position markers and reads on other threads won't mess up the
+ /// current read.
///
/// @param[in,out] num_bytes
/// The number of bytes to read form the current file position
@@ -367,9 +367,9 @@ public:
/// Write bytes to a file at the specified file offset.
///
/// NOTE: This function is thread safe in that clients manager their
- /// own file position markers, though clients will need to implement
- /// their own locking externally to avoid multiple people writing
- /// to the file at the same time.
+ /// own file position markers, though clients will need to implement their
+ /// own locking externally to avoid multiple people writing to the file at
+ /// the same time.
///
/// @param[in] src
/// A buffer containing the bytes to write.
@@ -431,10 +431,9 @@ public:
//------------------------------------------------------------------
/// Return true if this file from a real terminal.
///
- /// Just knowing a file is a interactive isn't enough, we also need
- /// to know if the terminal has a width and height so we can do
- /// cursor movement and other terminal manipulations by sending
- /// escape sequences.
+ /// Just knowing a file is a interactive isn't enough, we also need to know
+ /// if the terminal has a width and height so we can do cursor movement and
+ /// other terminal manipulations by sending escape sequences.
///
/// @return
/// True if this file is a terminal (tty, not a pty) that has
diff --git a/include/lldb/Host/Host.h b/include/lldb/Host/Host.h
index f099c72381be..459e9f563d1e 100644
--- a/include/lldb/Host/Host.h
+++ b/include/lldb/Host/Host.h
@@ -12,8 +12,9 @@
#include "lldb/Host/File.h"
#include "lldb/Host/HostThread.h"
+#include "lldb/Utility/Environment.h"
#include "lldb/Utility/FileSpec.h"
-#include "lldb/Utility/StringList.h"
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-private.h"
#include <cerrno>
@@ -56,10 +57,9 @@ inline bool operator!=(WaitStatus a, WaitStatus b) { return !(a == b); }
//----------------------------------------------------------------------
/// @class Host Host.h "lldb/Host/Host.h"
-/// @brief A class that provides host computer information.
+/// A class that provides host computer information.
///
-/// Host is a class that answers information about the host operating
-/// system.
+/// Host is a class that answers information about the host operating system.
//----------------------------------------------------------------------
class Host {
public:
@@ -72,18 +72,17 @@ public:
//------------------------------------------------------------------
/// Start monitoring a child process.
///
- /// Allows easy monitoring of child processes. \a callback will be
- /// called when the child process exits or if it gets a signal. The
- /// callback will only be called with signals if \a monitor_signals
- /// is \b true. \a callback will usually be called from another
- /// thread so the callback function must be thread safe.
+ /// Allows easy monitoring of child processes. \a callback will be called
+ /// when the child process exits or if it gets a signal. The callback will
+ /// only be called with signals if \a monitor_signals is \b true. \a
+ /// callback will usually be called from another thread so the callback
+ /// function must be thread safe.
///
- /// When the callback gets called, the return value indicates if
- /// monitoring should stop. If \b true is returned from \a callback
- /// the information will be removed. If \b false is returned then
- /// monitoring will continue. If the child process exits, the
- /// monitoring will automatically stop after the callback returned
- /// regardless of the callback return value.
+ /// When the callback gets called, the return value indicates if monitoring
+ /// should stop. If \b true is returned from \a callback the information
+ /// will be removed. If \b false is returned then monitoring will continue.
+ /// If the child process exits, the monitoring will automatically stop after
+ /// the callback returned regardless of the callback return value.
///
/// @param[in] callback
/// A function callback to call when a child receives a signal
@@ -126,9 +125,8 @@ public:
static void Kill(lldb::pid_t pid, int signo);
//------------------------------------------------------------------
- /// Get the thread token (the one returned by ThreadCreate when the thread was
- /// created) for the
- /// calling thread in the current process.
+ /// Get the thread token (the one returned by ThreadCreate when the thread
+ /// was created) for the calling thread in the current process.
///
/// @return
/// The thread token for the calling thread in the current process.
@@ -138,11 +136,11 @@ public:
static const char *GetSignalAsCString(int signo);
//------------------------------------------------------------------
- /// Given an address in the current process (the process that
- /// is running the LLDB code), return the name of the module that
- /// it comes from. This can be useful when you need to know the
- /// path to the shared library that your code is running in for
- /// loading resources that are relative to your binary.
+ /// Given an address in the current process (the process that is running the
+ /// LLDB code), return the name of the module that it comes from. This can
+ /// be useful when you need to know the path to the shared library that your
+ /// code is running in for loading resources that are relative to your
+ /// binary.
///
/// @param[in] host_addr
/// The pointer to some code in the current process.
@@ -155,10 +153,9 @@ public:
static FileSpec GetModuleFileSpecForHostAddress(const void *host_addr);
//------------------------------------------------------------------
- /// If you have an executable that is in a bundle and want to get
- /// back to the bundle directory from the path itself, this
- /// function will change a path to a file within a bundle to the
- /// bundle directory itself.
+ /// If you have an executable that is in a bundle and want to get back to
+ /// the bundle directory from the path itself, this function will change a
+ /// path to a file within a bundle to the bundle directory itself.
///
/// @param[in] file
/// A file spec that might point to a file in a bundle.
@@ -176,10 +173,9 @@ public:
FileSpec &bundle_directory);
//------------------------------------------------------------------
- /// When executable files may live within a directory, where the
- /// directory represents an executable bundle (like the MacOSX
- /// app bundles), then locate the executable within the containing
- /// bundle.
+ /// When executable files may live within a directory, where the directory
+ /// represents an executable bundle (like the MacOSX app bundles), then
+ /// locate the executable within the containing bundle.
///
/// @param[in,out] file
/// A file spec that currently points to the bundle that will
@@ -203,11 +199,14 @@ public:
static const lldb::UnixSignalsSP &GetUnixSignals();
+ /// Launch the process specified in launch_info. The monitoring callback in
+ /// launch_info must be set, and it will be called when the process
+ /// terminates.
static Status LaunchProcess(ProcessLaunchInfo &launch_info);
//------------------------------------------------------------------
- /// Perform expansion of the command-line for this launch info
- /// This can potentially involve wildcard expansion
+ /// Perform expansion of the command-line for this launch info This can
+ /// potentially involve wildcard expansion
// environment variable replacement, and whatever other
// argument magic the platform defines as part of its typical
// user experience
@@ -224,8 +223,7 @@ public:
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec,
- bool run_in_default_shell = true);
+ const Timeout<std::micro> &timeout, bool run_in_default_shell = true);
static Status RunShellCommand(
const Args &args,
@@ -236,13 +234,12 @@ public:
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec,
- bool run_in_default_shell = true);
+ const Timeout<std::micro> &timeout, bool run_in_default_shell = true);
static bool OpenFileInExternalEditor(const FileSpec &file_spec,
uint32_t line_no);
- static size_t GetEnvironment(StringList &env);
+ static Environment GetEnvironment();
static std::unique_ptr<Connection>
CreateDefaultConnection(llvm::StringRef url);
@@ -252,8 +249,8 @@ public:
namespace llvm {
template <> struct format_provider<lldb_private::WaitStatus> {
- /// Options = "" gives a human readable description of the status
- /// Options = "g" gives a gdb-remote protocol status (e.g., X09)
+ /// Options = "" gives a human readable description of the status Options =
+ /// "g" gives a gdb-remote protocol status (e.g., X09)
static void format(const lldb_private::WaitStatus &WS, raw_ostream &OS,
llvm::StringRef Options);
};
diff --git a/include/lldb/Host/HostInfo.h b/include/lldb/Host/HostInfo.h
index b4a2f8baf37f..df762d7160e0 100644
--- a/include/lldb/Host/HostInfo.h
+++ b/include/lldb/Host/HostInfo.h
@@ -12,7 +12,7 @@
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostInfo.h"
-/// @brief A class that provides host computer information.
+/// A class that provides host computer information.
///
/// HostInfo is a class that answers information about the host operating
/// system. Note that HostInfo is NOT intended to be used to manipulate or
@@ -22,15 +22,16 @@
/// HostInfoWindows) in a separate file, and then typedefed to HostInfo here.
/// Users of the class reference it as HostInfo::method().
///
-/// Not all hosts provide the same functionality. It is important that methods
-/// only be implemented at the lowest level at which they make sense. It should
-/// be up to the clients of the class to ensure that they not attempt to call a
-/// method which doesn't make sense for a particular platform. For example,
-/// when implementing a method that only makes sense on a posix-compliant
-/// system, implement it on HostInfoPosix, and not on HostInfoBase with a
-/// default implementation. This way, users of HostInfo are required to think
-/// about the implications of calling a particular method and if used in a
-/// context where the method doesn't make sense, will generate a compiler error.
+/// Not all hosts provide the same functionality. It is important that
+/// methods only be implemented at the lowest level at which they make sense.
+/// It should be up to the clients of the class to ensure that they not
+/// attempt to call a method which doesn't make sense for a particular
+/// platform. For example, when implementing a method that only makes sense
+/// on a posix-compliant system, implement it on HostInfoPosix, and not on
+/// HostInfoBase with a default implementation. This way, users of HostInfo
+/// are required to think about the implications of calling a particular
+/// method and if used in a context where the method doesn't make sense, will
+/// generate a compiler error.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Host/HostInfoBase.h b/include/lldb/Host/HostInfoBase.h
index 52648d2031fc..b2567b296277 100644
--- a/include/lldb/Host/HostInfoBase.h
+++ b/include/lldb/Host/HostInfoBase.h
@@ -63,25 +63,39 @@ public:
static llvm::Optional<ArchitectureKind> ParseArchitectureKind(llvm::StringRef kind);
- //------------------------------------------------------------------
- /// Find a resource files that are related to LLDB.
- ///
- /// Operating systems have different ways of storing shared
- /// libraries and related resources. This function abstracts the
- /// access to these paths.
- ///
- /// @param[in] path_type
- /// The type of LLDB resource path you are looking for. If the
- /// enumeration ends with "Dir", then only the \a file_spec's
- /// directory member gets filled in.
- ///
- /// @param[in] file_spec
- /// A file spec that gets filled in with the appropriate path.
- ///
- /// @return
- /// \b true if \a resource_path was resolved, \a false otherwise.
- //------------------------------------------------------------------
- static bool GetLLDBPath(lldb::PathType type, FileSpec &file_spec);
+ /// Returns the directory containing the lldb shared library. Only the
+ /// directory member of the FileSpec is filled in.
+ static FileSpec GetShlibDir();
+
+ /// Returns the directory containing the support executables (debugserver,
+ /// ...). Only the directory member of the FileSpec is filled in.
+ static FileSpec GetSupportExeDir();
+
+ /// Returns the directory containing the lldb headers. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetHeaderDir();
+
+ /// Returns the directory containing the python modules. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetPythonDir();
+
+ /// Returns the directory containing the system plugins. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetSystemPluginDir();
+
+ /// Returns the directory containing the user plugins. Only the directory
+ /// member of the FileSpec is filled in.
+ static FileSpec GetUserPluginDir();
+
+ /// Returns the proces temporary directory. This directory will be cleaned up
+ /// when this process exits. Only the directory member of the FileSpec is
+ /// filled in.
+ static FileSpec GetProcessTempDir();
+
+ /// Returns the global temporary directory. This directory will **not** be
+ /// cleaned up when this process exits. Only the directory member of the
+ /// FileSpec is filled in.
+ static FileSpec GetGlobalTempDir();
//---------------------------------------------------------------------------
/// If the triple does not specify the vendor, os, and environment parts, we
@@ -98,7 +112,6 @@ protected:
static bool ComputeTempFileBaseDirectory(FileSpec &file_spec);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
diff --git a/include/lldb/Host/HostProcess.h b/include/lldb/Host/HostProcess.h
index dfc997bd81f7..626ebab7ce68 100644
--- a/include/lldb/Host/HostProcess.h
+++ b/include/lldb/Host/HostProcess.h
@@ -15,17 +15,17 @@
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostProcess.h"
-/// @brief A class that represents a running process on the host machine.
+/// A class that represents a running process on the host machine.
///
/// HostProcess allows querying and manipulation of processes running on the
-/// host machine. It is not intended to be represent a process which is
-/// being debugged, although the native debug engine of a platform may likely
-/// back inferior processes by a HostProcess.
+/// host machine. It is not intended to be represent a process which is being
+/// debugged, although the native debug engine of a platform may likely back
+/// inferior processes by a HostProcess.
///
/// HostProcess is implemented using static polymorphism so that on any given
-/// platform, an instance of HostProcess will always be able to bind statically
-/// to the concrete Process implementation for that platform. See HostInfo
-/// for more details.
+/// platform, an instance of HostProcess will always be able to bind
+/// statically to the concrete Process implementation for that platform. See
+/// HostInfo for more details.
///
//----------------------------------------------------------------------
diff --git a/include/lldb/Host/HostThread.h b/include/lldb/Host/HostThread.h
index 0d2fbe6045af..120776283aa4 100644
--- a/include/lldb/Host/HostThread.h
+++ b/include/lldb/Host/HostThread.h
@@ -22,7 +22,7 @@ class HostNativeThreadBase;
//----------------------------------------------------------------------
/// @class HostInfo HostInfo.h "lldb/Host/HostThread.h"
-/// @brief A class that represents a thread running inside of a process on the
+/// A class that represents a thread running inside of a process on the
/// local machine.
///
/// HostThread allows querying and manipulation of threads running on the host
diff --git a/include/lldb/Host/MainLoop.h b/include/lldb/Host/MainLoop.h
index c59a5aa5b0e8..13d1ff0212fa 100644
--- a/include/lldb/Host/MainLoop.h
+++ b/include/lldb/Host/MainLoop.h
@@ -21,12 +21,12 @@
namespace lldb_private {
-// Implementation of the MainLoopBase class. It can monitor file descriptors for
-// readability using ppoll, kqueue, poll or WSAPoll. On Windows it only supports
-// polling sockets, and will not work on generic file handles or pipes. On
-// systems without kqueue or ppoll handling singnals is not supported. In
-// addition to the common base, this class provides the ability to invoke a
-// given handler when a signal is received.
+// Implementation of the MainLoopBase class. It can monitor file descriptors
+// for readability using ppoll, kqueue, poll or WSAPoll. On Windows it only
+// supports polling sockets, and will not work on generic file handles or
+// pipes. On systems without kqueue or ppoll handling singnals is not
+// supported. In addition to the common base, this class provides the ability
+// to invoke a given handler when a signal is received.
//
// Since this class is primarily intended to be used for single-threaded
// processing, it does not attempt to perform any internal synchronisation and
@@ -49,13 +49,13 @@ public:
const Callback &callback,
Status &error) override;
- // Listening for signals from multiple MainLoop instances is perfectly safe as
- // long as they don't try to listen for the same signal. The callback function
- // is invoked when the control returns to the Run() function, not when the
- // hander is executed. This mean that you can treat the callback as a normal
- // function and perform things which would not be safe in a signal handler.
- // However, since the callback is not invoked synchronously, you cannot use
- // this mechanism to handle SIGSEGV and the like.
+ // Listening for signals from multiple MainLoop instances is perfectly safe
+ // as long as they don't try to listen for the same signal. The callback
+ // function is invoked when the control returns to the Run() function, not
+ // when the hander is executed. This mean that you can treat the callback as
+ // a normal function and perform things which would not be safe in a signal
+ // handler. However, since the callback is not invoked synchronously, you
+ // cannot use this mechanism to handle SIGSEGV and the like.
SignalHandleUP RegisterSignal(int signo, const Callback &callback,
Status &error);
diff --git a/include/lldb/Host/MainLoopBase.h b/include/lldb/Host/MainLoopBase.h
index a87d262e9452..bf01ba16db0e 100644
--- a/include/lldb/Host/MainLoopBase.h
+++ b/include/lldb/Host/MainLoopBase.h
@@ -18,21 +18,17 @@
namespace lldb_private {
// The purpose of this class is to enable multiplexed processing of data from
-// different sources
-// without resorting to multi-threading. Clients can register IOObjects, which
-// will be monitored
-// for readability, and when they become ready, the specified callback will be
-// invoked.
-// Monitoring for writability is not supported, but can be easily added if
-// needed.
+// different sources without resorting to multi-threading. Clients can register
+// IOObjects, which will be monitored for readability, and when they become
+// ready, the specified callback will be invoked. Monitoring for writability is
+// not supported, but can be easily added if needed.
//
// The RegisterReadObject function return a handle, which controls the duration
-// of the monitoring. When
-// this handle is destroyed, the callback is deregistered.
+// of the monitoring. When this handle is destroyed, the callback is
+// deregistered.
//
// This class simply defines the interface common for all platforms, actual
-// implementations are
-// platform-specific.
+// implementations are platform-specific.
class MainLoopBase {
private:
class ReadHandle;
@@ -52,8 +48,7 @@ public:
}
// Waits for registered events and invoke the proper callbacks. Returns when
- // all callbacks
- // deregister themselves or when someone requests termination.
+ // all callbacks deregister themselves or when someone requests termination.
virtual Status Run() { llvm_unreachable("Not implemented"); }
// Requests the exit of the Run() function.
diff --git a/include/lldb/Host/MonitoringProcessLauncher.h b/include/lldb/Host/MonitoringProcessLauncher.h
index 9ad36e90a779..341284800a4e 100644
--- a/include/lldb/Host/MonitoringProcessLauncher.h
+++ b/include/lldb/Host/MonitoringProcessLauncher.h
@@ -24,6 +24,9 @@ public:
explicit MonitoringProcessLauncher(
std::unique_ptr<ProcessLauncher> delegate_launcher);
+ /// Launch the process specified in launch_info. The monitoring callback in
+ /// launch_info must be set, and it will be called when the process
+ /// terminates.
HostProcess LaunchProcess(const ProcessLaunchInfo &launch_info,
Status &error) override;
diff --git a/include/lldb/Host/PosixApi.h b/include/lldb/Host/PosixApi.h
index d5c48dd6d170..dae2bb480091 100644
--- a/include/lldb/Host/PosixApi.h
+++ b/include/lldb/Host/PosixApi.h
@@ -11,13 +11,14 @@
#define liblldb_Host_PosixApi_h
// This file defines platform specific functions, macros, and types necessary
-// to provide a minimum level of compatibility across all platforms to rely
-// on various posix api functionality.
+// to provide a minimum level of compatibility across all platforms to rely on
+// various posix api functionality.
#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h"
#else
#include <unistd.h>
+#include <csignal>
#endif
#endif
diff --git a/include/lldb/Host/Predicate.h b/include/lldb/Host/Predicate.h
index 3ee27e74b4ba..d8128e71c53e 100644
--- a/include/lldb/Host/Predicate.h
+++ b/include/lldb/Host/Predicate.h
@@ -20,6 +20,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-defines.h"
//#define DB_PTHREAD_LOG_EVENTS
@@ -38,8 +39,8 @@ typedef enum {
//----------------------------------------------------------------------
/// @class Predicate Predicate.h "lldb/Host/Predicate.h"
-/// @brief A C++ wrapper class for providing threaded access to a value
-/// of type T.
+/// A C++ wrapper class for providing threaded access to a value of
+/// type T.
///
/// A templatized class that provides multi-threaded access to a value
/// of type T. Threads can efficiently wait for bits within T to be set
@@ -118,169 +119,39 @@ public:
}
//------------------------------------------------------------------
- /// Set some bits in \a m_value.
+ /// Wait for Cond(m_value) to be true.
///
- /// Logically set the bits \a bits in the contained \a m_value in a
- /// thread safe way and broadcast if needed.
+ /// Waits in a thread safe way for Cond(m_value) to be true. If Cond(m_value)
+ /// is already true, this function will return without waiting.
///
- /// @param[in] bits
- /// The bits to set in \a m_value.
+ /// It is possible for the value to be changed between the time the value is
+ /// set and the time the waiting thread wakes up. If the value no longer
+ /// satisfies the condition when the waiting thread wakes up, it will go back
+ /// into a wait state. It may be necessary for the calling code to use
+ /// additional thread synchronization methods to detect transitory states.
///
- /// @param[in] broadcast_type
- /// A value indicating when and if to broadcast. See the
- /// PredicateBroadcastType enumeration for details.
- ///
- /// @see Predicate::Broadcast()
- //------------------------------------------------------------------
- void SetValueBits(T bits, PredicateBroadcastType broadcast_type) {
- std::lock_guard<std::mutex> guard(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, broadcast_type = %i)\n", __FUNCTION__, bits,
- broadcast_type);
-#endif
- const T old_value = m_value;
- m_value |= bits;
-
- Broadcast(old_value, broadcast_type);
- }
-
- //------------------------------------------------------------------
- /// Reset some bits in \a m_value.
- ///
- /// Logically reset (clear) the bits \a bits in the contained
- /// \a m_value in a thread safe way and broadcast if needed.
- ///
- /// @param[in] bits
- /// The bits to clear in \a m_value.
- ///
- /// @param[in] broadcast_type
- /// A value indicating when and if to broadcast. See the
- /// PredicateBroadcastType enumeration for details.
- ///
- /// @see Predicate::Broadcast()
- //------------------------------------------------------------------
- void ResetValueBits(T bits, PredicateBroadcastType broadcast_type) {
- std::lock_guard<std::mutex> guard(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, broadcast_type = %i)\n", __FUNCTION__, bits,
- broadcast_type);
-#endif
- const T old_value = m_value;
- m_value &= ~bits;
-
- Broadcast(old_value, broadcast_type);
- }
-
- //------------------------------------------------------------------
- /// Wait for bits to be set in \a m_value.
- ///
- /// Waits in a thread safe way for any bits in \a bits to get
- /// logically set in \a m_value. If any bits are already set in
- /// \a m_value, this function will return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the bits are set and the time the waiting thread wakes up.
- /// If the bits are no longer set when the waiting thread wakes
- /// up, it will go back into a wait state. It may be necessary
- /// for the calling code to use additional thread synchronization
- /// methods to detect transitory states.
- ///
- /// @param[in] bits
- /// The bits we are waiting to be set in \a m_value.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @return
- /// Any bits of the requested bits that actually were set within
- /// the time specified. Zero if a timeout or unrecoverable error
- /// occurred.
- //------------------------------------------------------------------
- T WaitForSetValueBits(T bits, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, bits, timeout.count(), m_value);
-#endif
- while ((m_value & bits) == 0) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
- }
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x), m_value = 0x%8.8x, returning 0x%8.8x\n",
- __FUNCTION__, bits, m_value, m_value & bits);
-#endif
-
- return m_value & bits;
- }
-
- //------------------------------------------------------------------
- /// Wait for bits to be reset in \a m_value.
- ///
- /// Waits in a thread safe way for any bits in \a bits to get
- /// logically reset in \a m_value. If all bits are already reset in
- /// \a m_value, this function will return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the bits are reset and the time the waiting thread wakes up.
- /// If the bits are no set when the waiting thread wakes up, it will
- /// go back into a wait state. It may be necessary for the calling
- /// code to use additional thread synchronization methods to detect
- /// transitory states.
- ///
- /// @param[in] bits
- /// The bits we are waiting to be reset in \a m_value.
+ /// @param[in] Cond
+ /// The condition we want \a m_value satisfy.
///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
- /// Zero on successful waits, or non-zero if a timeout or
- /// unrecoverable error occurs.
+ /// @li m_value if Cond(m_value) is true.
+ /// @li None otherwise (timeout occurred).
//------------------------------------------------------------------
- T WaitForResetValueBits(T bits, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
+ template <typename C>
+ llvm::Optional<T> WaitFor(C Cond, const Timeout<std::micro> &timeout) {
std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, bits, timeout.count(), m_value);
-#endif
- while ((m_value & bits) != 0) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
+ auto RealCond = [&] { return Cond(m_value); };
+ if (!timeout) {
+ m_condition.wait(lock, RealCond);
+ return m_value;
}
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (bits = 0x%8.8x), m_value = 0x%8.8x, returning 0x%8.8x\n",
- __FUNCTION__, bits, m_value, m_value & bits);
-#endif
- return m_value & bits;
+ if (m_condition.wait_for(lock, *timeout, RealCond))
+ return m_value;
+ return llvm::None;
}
-
//------------------------------------------------------------------
/// Wait for \a m_value to be equal to \a value.
///
@@ -298,124 +169,17 @@ public:
/// @param[in] value
/// The value we want \a m_value to be equal to.
///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @param[out] timed_out
- /// If not null, set to true if we return because of a time out,
- /// and false if the value was set.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
/// @li \b true if the \a m_value is equal to \a value
- /// @li \b false otherwise
+ /// @li \b false otherwise (timeout occurred)
//------------------------------------------------------------------
- bool WaitForValueEqualTo(T value, const std::chrono::microseconds &timeout =
- std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (value = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, value, timeout.count(), m_value);
-#endif
- if (timed_out)
- *timed_out = false;
-
- while (m_value != value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout) {
- if (timed_out)
- *timed_out = true;
- break;
- }
- }
- }
-
- return m_value == value;
- }
-
- //------------------------------------------------------------------
- /// Wait for \a m_value to be equal to \a value and then set it to
- /// a new value.
- ///
- /// Waits in a thread safe way for \a m_value to be equal to \a
- /// value and then sets \a m_value to \a new_value. If \a m_value
- /// is already equal to \a value, this function will immediately
- /// set \a m_value to \a new_value and return without waiting.
- ///
- /// It is possible for the value to be changed between the time
- /// the value is set and the time the waiting thread wakes up.
- /// If the value no longer matches the requested value when the
- /// waiting thread wakes up, it will go back into a wait state. It
- /// may be necessary for the calling code to use additional thread
- /// synchronization methods to detect transitory states.
- ///
- /// @param[in] value
- /// The value we want \a m_value to be equal to.
- ///
- /// @param[in] new_value
- /// The value to which \a m_value will be set if \b true is
- /// returned.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
- ///
- /// @param[out] timed_out
- /// If not null, set to true if we return because of a time out,
- /// and false if the value was set.
- ///
- /// @return
- /// @li \b true if the \a m_value became equal to \a value
- /// @li \b false otherwise
- //------------------------------------------------------------------
- bool WaitForValueEqualToAndSetValueTo(
- T wait_value, T new_value,
- const std::chrono::microseconds &timeout = std::chrono::microseconds(0),
- bool *timed_out = nullptr) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (wait_value = 0x%8.8x, new_value = 0x%8.8x, timeout = %llu), "
- "m_value = 0x%8.8x\n",
- __FUNCTION__, wait_value, new_value, timeout.count(), m_value);
-#endif
- if (timed_out)
- *timed_out = false;
-
- while (m_value != wait_value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout) {
- if (timed_out)
- *timed_out = true;
- break;
- }
- }
- }
-
- if (m_value == wait_value) {
- m_value = new_value;
- return true;
- }
-
- return false;
+ bool WaitForValueEqualTo(T value,
+ const Timeout<std::micro> &timeout = llvm::None) {
+ return WaitFor([&value](T current) { return value == current; }, timeout) !=
+ llvm::None;
}
//------------------------------------------------------------------
@@ -435,51 +199,23 @@ public:
/// @param[in] value
/// The value we want \a m_value to not be equal to.
///
- /// @param[out] new_value
- /// The new value if \b true is returned.
- ///
- /// @param[in] abstime
- /// If non-nullptr, the absolute time at which we should stop
- /// waiting, else wait an infinite amount of time.
+ /// @param[in] timeout
+ /// How long to wait for the condition to hold.
///
/// @return
- /// @li \b true if the \a m_value is equal to \a value
- /// @li \b false otherwise
+ /// @li m_value if m_value != value
+ /// @li None otherwise (timeout occurred).
//------------------------------------------------------------------
- bool WaitForValueNotEqualTo(
- T value, T &new_value,
- const std::chrono::microseconds &timeout = std::chrono::microseconds(0)) {
- // pthread_cond_timedwait() or pthread_cond_wait() will atomically
- // unlock the mutex and wait for the condition to be set. When either
- // function returns, they will re-lock the mutex. We use an auto lock/unlock
- // class (std::lock_guard) to allow us to return at any point in this
- // function and not have to worry about unlocking the mutex.
- std::unique_lock<std::mutex> lock(m_mutex);
-#ifdef DB_PTHREAD_LOG_EVENTS
- printf("%s (value = 0x%8.8x, timeout = %llu), m_value = 0x%8.8x\n",
- __FUNCTION__, value, timeout.count(), m_value);
-#endif
- while (m_value == value) {
- if (timeout == std::chrono::microseconds(0)) {
- m_condition.wait(lock);
- } else {
- std::cv_status result = m_condition.wait_for(lock, timeout);
- if (result == std::cv_status::timeout)
- break;
- }
- }
-
- if (m_value != value) {
- new_value = m_value;
- return true;
- }
- return false;
+ llvm::Optional<T>
+ WaitForValueNotEqualTo(T value,
+ const Timeout<std::micro> &timeout = llvm::None) {
+ return WaitFor([&value](T current) { return value != current; }, timeout);
}
protected:
//----------------------------------------------------------------------
- // pthread condition and mutex variable to control access and allow
- // blocking between the main thread and the spotlight index thread.
+ // pthread condition and mutex variable to control access and allow blocking
+ // between the main thread and the spotlight index thread.
//----------------------------------------------------------------------
T m_value; ///< The templatized value T that we are protecting access to
mutable std::mutex m_mutex; ///< The mutex to use when accessing the data
diff --git a/include/lldb/Host/ProcessRunLock.h b/include/lldb/Host/ProcessRunLock.h
index 7044fdbd9ef9..6f39eea716e8 100644
--- a/include/lldb/Host/ProcessRunLock.h
+++ b/include/lldb/Host/ProcessRunLock.h
@@ -26,9 +26,9 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ProcessRunLock ProcessRunLock.h "lldb/Host/ProcessRunLock.h"
-/// @brief A class used to prevent the process from starting while other
-/// threads are accessing its data, and prevent access to its data while
-/// it is running.
+/// A class used to prevent the process from starting while other
+/// threads are accessing its data, and prevent access to its data while it is
+/// running.
//----------------------------------------------------------------------
class ProcessRunLock {
diff --git a/include/lldb/Host/PseudoTerminal.h b/include/lldb/Host/PseudoTerminal.h
index 00c0da6f3315..858bd35f73a6 100644
--- a/include/lldb/Host/PseudoTerminal.h
+++ b/include/lldb/Host/PseudoTerminal.h
@@ -19,10 +19,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class PseudoTerminal PseudoTerminal.h "lldb/Host/PseudoTerminal.h"
-/// @brief A pseudo terminal helper class.
+/// A pseudo terminal helper class.
///
-/// The pseudo terminal class abstracts the use of pseudo terminals on
-/// the host system.
+/// The pseudo terminal class abstracts the use of pseudo terminals on the
+/// host system.
//----------------------------------------------------------------------
class PseudoTerminal {
public:
@@ -33,19 +33,17 @@ public:
//------------------------------------------------------------------
/// Default constructor
///
- /// Constructs this object with invalid master and slave file
- /// descriptors.
+ /// Constructs this object with invalid master and slave file descriptors.
//------------------------------------------------------------------
PseudoTerminal();
//------------------------------------------------------------------
/// Destructor
///
- /// The destructor will close the master and slave file descriptors
- /// if they are valid and ownership has not been released using
- /// one of:
- /// @li PseudoTerminal::ReleaseMasterFileDescriptor()
- /// @li PseudoTerminal::ReleaseSaveFileDescriptor()
+ /// The destructor will close the master and slave file descriptors if they
+ /// are valid and ownership has not been released using one of: @li
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+ /// PseudoTerminal::ReleaseSaveFileDescriptor()
//------------------------------------------------------------------
~PseudoTerminal();
@@ -62,20 +60,18 @@ public:
//------------------------------------------------------------------
/// Fork a child process that uses pseudo terminals for its stdio.
///
- /// In the parent process, a call to this function results in a pid
- /// being returned. If the pid is valid, the master file descriptor
- /// can be used for read/write access to stdio of the child process.
+ /// In the parent process, a call to this function results in a pid being
+ /// returned. If the pid is valid, the master file descriptor can be used
+ /// for read/write access to stdio of the child process.
///
- /// In the child process the stdin/stdout/stderr will already be
- /// routed to the slave pseudo terminal and the master file
- /// descriptor will be closed as it is no longer needed by the child
- /// process.
+ /// In the child process the stdin/stdout/stderr will already be routed to
+ /// the slave pseudo terminal and the master file descriptor will be closed
+ /// as it is no longer needed by the child process.
///
- /// This class will close the file descriptors for the master/slave
- /// when the destructor is called. The file handles can be released
- /// using either:
- /// @li PseudoTerminal::ReleaseMasterFileDescriptor()
- /// @li PseudoTerminal::ReleaseSaveFileDescriptor()
+ /// This class will close the file descriptors for the master/slave when the
+ /// destructor is called. The file handles can be released using either: @li
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() @li
+ /// PseudoTerminal::ReleaseSaveFileDescriptor()
///
/// @param[out] error
/// An pointer to an error that can describe any errors that
@@ -91,10 +87,10 @@ public:
//------------------------------------------------------------------
/// The master file descriptor accessor.
///
- /// This object retains ownership of the master file descriptor when
- /// this accessor is used. Users can call the member function
- /// PseudoTerminal::ReleaseMasterFileDescriptor() if this
- /// object should release ownership of the slave file descriptor.
+ /// This object retains ownership of the master file descriptor when this
+ /// accessor is used. Users can call the member function
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() if this object should
+ /// release ownership of the slave file descriptor.
///
/// @return
/// The master file descriptor, or PseudoTerminal::invalid_fd
@@ -107,10 +103,10 @@ public:
//------------------------------------------------------------------
/// The slave file descriptor accessor.
///
- /// This object retains ownership of the slave file descriptor when
- /// this accessor is used. Users can call the member function
- /// PseudoTerminal::ReleaseSlaveFileDescriptor() if this
- /// object should release ownership of the slave file descriptor.
+ /// This object retains ownership of the slave file descriptor when this
+ /// accessor is used. Users can call the member function
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor() if this object should
+ /// release ownership of the slave file descriptor.
///
/// @return
/// The slave file descriptor, or PseudoTerminal::invalid_fd
@@ -146,12 +142,12 @@ public:
/// Open the first available pseudo terminal.
///
/// Opens the first available pseudo terminal with \a oflag as the
- /// permissions. The opened master file descriptor is stored in this
- /// object and can be accessed by calling the
- /// PseudoTerminal::GetMasterFileDescriptor() accessor. Clients
- /// can call the PseudoTerminal::ReleaseMasterFileDescriptor()
- /// accessor function if they wish to use the master file descriptor
- /// beyond the lifespan of this object.
+ /// permissions. The opened master file descriptor is stored in this object
+ /// and can be accessed by calling the
+ /// PseudoTerminal::GetMasterFileDescriptor() accessor. Clients can call the
+ /// PseudoTerminal::ReleaseMasterFileDescriptor() accessor function if they
+ /// wish to use the master file descriptor beyond the lifespan of this
+ /// object.
///
/// If this object still has a valid master file descriptor when its
/// destructor is called, it will close it.
@@ -169,8 +165,8 @@ public:
/// successfully opened.
/// @li \b false if anything goes wrong.
///
- /// @see PseudoTerminal::GetMasterFileDescriptor()
- /// @see PseudoTerminal::ReleaseMasterFileDescriptor()
+ /// @see PseudoTerminal::GetMasterFileDescriptor() @see
+ /// PseudoTerminal::ReleaseMasterFileDescriptor()
//------------------------------------------------------------------
bool OpenFirstAvailableMaster(int oflag, char *error_str, size_t error_len);
@@ -178,12 +174,12 @@ public:
/// Open the slave for the current master pseudo terminal.
///
/// A master pseudo terminal should already be valid prior to
- /// calling this function. The opened slave file descriptor is
- /// stored in this object and can be accessed by calling the
- /// PseudoTerminal::GetSlaveFileDescriptor() accessor. Clients
- /// can call the PseudoTerminal::ReleaseSlaveFileDescriptor()
- /// accessor function if they wish to use the slave file descriptor
- /// beyond the lifespan of this object.
+ /// calling this function. The opened slave file descriptor is stored in
+ /// this object and can be accessed by calling the
+ /// PseudoTerminal::GetSlaveFileDescriptor() accessor. Clients can call the
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor() accessor function if they
+ /// wish to use the slave file descriptor beyond the lifespan of this
+ /// object.
///
/// If this object still has a valid slave file descriptor when its
/// destructor is called, it will close it.
@@ -200,19 +196,19 @@ public:
/// successfully opened.
/// @li \b false if anything goes wrong.
///
- /// @see PseudoTerminal::OpenFirstAvailableMaster()
- /// @see PseudoTerminal::GetSlaveFileDescriptor()
- /// @see PseudoTerminal::ReleaseSlaveFileDescriptor()
+ /// @see PseudoTerminal::OpenFirstAvailableMaster() @see
+ /// PseudoTerminal::GetSlaveFileDescriptor() @see
+ /// PseudoTerminal::ReleaseSlaveFileDescriptor()
//------------------------------------------------------------------
bool OpenSlave(int oflag, char *error_str, size_t error_len);
//------------------------------------------------------------------
/// Release the master file descriptor.
///
- /// Releases ownership of the master pseudo terminal file descriptor
- /// without closing it. The destructor for this class will close the
- /// master file descriptor if the ownership isn't released using this
- /// call and the master file descriptor has been opened.
+ /// Releases ownership of the master pseudo terminal file descriptor without
+ /// closing it. The destructor for this class will close the master file
+ /// descriptor if the ownership isn't released using this call and the
+ /// master file descriptor has been opened.
///
/// @return
/// The master file descriptor, or PseudoTerminal::invalid_fd
@@ -223,10 +219,10 @@ public:
//------------------------------------------------------------------
/// Release the slave file descriptor.
///
- /// Release ownership of the slave pseudo terminal file descriptor
- /// without closing it. The destructor for this class will close the
- /// slave file descriptor if the ownership isn't released using this
- /// call and the slave file descriptor has been opened.
+ /// Release ownership of the slave pseudo terminal file descriptor without
+ /// closing it. The destructor for this class will close the slave file
+ /// descriptor if the ownership isn't released using this call and the slave
+ /// file descriptor has been opened.
///
/// @return
/// The slave file descriptor, or PseudoTerminal::invalid_fd
diff --git a/include/lldb/Host/Socket.h b/include/lldb/Host/Socket.h
index 37f468f23ce0..f6e51fd45679 100644
--- a/include/lldb/Host/Socket.h
+++ b/include/lldb/Host/Socket.h
@@ -60,10 +60,8 @@ public:
virtual Status Accept(Socket *&socket) = 0;
// Initialize a Tcp Socket object in listening mode. listen and accept are
- // implemented
- // separately because the caller may wish to manipulate or query the socket
- // after it is
- // initialized, but before entering a blocking accept.
+ // implemented separately because the caller may wish to manipulate or query
+ // the socket after it is initialized, but before entering a blocking accept.
static Status TcpListen(llvm::StringRef host_and_port,
bool child_processes_inherit, Socket *&socket,
Predicate<uint16_t> *predicate, int backlog = 5);
diff --git a/include/lldb/Host/SocketAddress.h b/include/lldb/Host/SocketAddress.h
index ebc6f4e57ee8..749a9c664c81 100644
--- a/include/lldb/Host/SocketAddress.h
+++ b/include/lldb/Host/SocketAddress.h
@@ -111,17 +111,16 @@ public:
uint16_t GetPort() const;
//------------------------------------------------------------------
- // Set the port if the socket address for the family has a port.
- // The family must be set correctly prior to calling this function.
+ // Set the port if the socket address for the family has a port. The family
+ // must be set correctly prior to calling this function.
//------------------------------------------------------------------
bool SetPort(uint16_t port);
//------------------------------------------------------------------
- // Set the socket address according to the first match from a call
- // to getaddrinfo() (or equivalent functions for systems that don't
- // have getaddrinfo(). If "addr_info_ptr" is not NULL, it will get
- // filled in with the match that was used to populate this socket
- // address.
+ // Set the socket address according to the first match from a call to
+ // getaddrinfo() (or equivalent functions for systems that don't have
+ // getaddrinfo(). If "addr_info_ptr" is not NULL, it will get filled in with
+ // the match that was used to populate this socket address.
//------------------------------------------------------------------
bool
getaddrinfo(const char *host, // Hostname ("foo.bar.com" or "foo" or IP
@@ -133,9 +132,9 @@ public:
int ai_protocol = 0, int ai_flags = 0);
//------------------------------------------------------------------
- // Quick way to set the SocketAddress to localhost given the family.
- // Returns true if successful, false if "family" doesn't support
- // localhost or if "family" is not supported by this class.
+ // Quick way to set the SocketAddress to localhost given the family. Returns
+ // true if successful, false if "family" doesn't support localhost or if
+ // "family" is not supported by this class.
//------------------------------------------------------------------
bool SetToLocalhost(sa_family_t family, uint16_t port);
@@ -190,11 +189,10 @@ public:
}
//------------------------------------------------------------------
- // Conversion operators to allow getting the contents of this class
- // as a pointer to the appropriate structure. This allows an instance
- // of this class to be used in calls that take one of the sockaddr
- // structure variants without having to manually use the correct
- // accessor function.
+ // Conversion operators to allow getting the contents of this class as a
+ // pointer to the appropriate structure. This allows an instance of this
+ // class to be used in calls that take one of the sockaddr structure variants
+ // without having to manually use the correct accessor function.
//------------------------------------------------------------------
operator struct sockaddr *() { return &m_socket_addr.sa; }
diff --git a/include/lldb/Host/StringConvert.h b/include/lldb/Host/StringConvert.h
index 05bd7808ecd4..d197df10d79e 100644
--- a/include/lldb/Host/StringConvert.h
+++ b/include/lldb/Host/StringConvert.h
@@ -24,7 +24,7 @@ namespace StringConvert {
//----------------------------------------------------------------------
/// @namespace StringConvert StringConvert.h "lldb/Host/StringConvert.h"
-/// @brief Utility classes for converting strings into Integers
+/// Utility classes for converting strings into Integers
//----------------------------------------------------------------------
int32_t ToSInt32(const char *s, int32_t fail_value = 0, int base = 0,
diff --git a/include/lldb/Host/Symbols.h b/include/lldb/Host/Symbols.h
index 5f8632d221f7..ce95d91497f8 100644
--- a/include/lldb/Host/Symbols.h
+++ b/include/lldb/Host/Symbols.h
@@ -29,16 +29,16 @@ public:
//----------------------------------------------------------------------
// Locate the executable file given a module specification.
//
- // Locating the file should happen only on the local computer or using
- // the current computers global settings.
+ // Locating the file should happen only on the local computer or using the
+ // current computers global settings.
//----------------------------------------------------------------------
static ModuleSpec LocateExecutableObjectFile(const ModuleSpec &module_spec);
//----------------------------------------------------------------------
// Locate the symbol file given a module specification.
//
- // Locating the file should happen only on the local computer or using
- // the current computers global settings.
+ // Locating the file should happen only on the local computer or using the
+ // current computers global settings.
//----------------------------------------------------------------------
static FileSpec LocateExecutableSymbolFile(const ModuleSpec &module_spec);
@@ -51,10 +51,10 @@ public:
//
// Locating the file can try to download the file from a corporate build
// repository, or using any other means necessary to locate both the
- // unstripped object file and the debug symbols.
- // The force_lookup argument controls whether the external program is called
- // unconditionally to find the symbol file, or if the user's settings are
- // checked to see if they've enabled the external program before calling.
+ // unstripped object file and the debug symbols. The force_lookup argument
+ // controls whether the external program is called unconditionally to find
+ // the symbol file, or if the user's settings are checked to see if they've
+ // enabled the external program before calling.
//
//----------------------------------------------------------------------
static bool DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
diff --git a/include/lldb/Host/TaskPool.h b/include/lldb/Host/TaskPool.h
index 13076e7eb70b..fe1714151076 100644
--- a/include/lldb/Host/TaskPool.h
+++ b/include/lldb/Host/TaskPool.h
@@ -20,32 +20,27 @@
namespace lldb_private {
-// Global TaskPool class for running tasks in parallel on a set of worker thread
-// created the first
-// time the task pool is used. The TaskPool provide no guarantee about the order
-// the task will be run
-// and about what tasks will run in parallel. None of the task added to the task
-// pool should block
-// on something (mutex, future, condition variable) what will be set only by the
-// completion of an
-// other task on the task pool as they may run on the same thread sequentally.
+// Global TaskPool class for running tasks in parallel on a set of worker
+// thread created the first time the task pool is used. The TaskPool provide no
+// guarantee about the order the task will be run and about what tasks will run
+// in parallel. None of the task added to the task pool should block on
+// something (mutex, future, condition variable) what will be set only by the
+// completion of an other task on the task pool as they may run on the same
+// thread sequentally.
class TaskPool {
public:
// Add a new task to the task pool and return a std::future belonging to the
- // newly created task.
- // The caller of this function has to wait on the future for this task to
- // complete.
+ // newly created task. The caller of this function has to wait on the future
+ // for this task to complete.
template <typename F, typename... Args>
static std::future<typename std::result_of<F(Args...)>::type>
AddTask(F &&f, Args &&... args);
// Run all of the specified tasks on the task pool and wait until all of them
- // are finished
- // before returning. This method is intended to be used for small number tasks
- // where listing
- // them as function arguments is acceptable. For running large number of tasks
- // you should use
- // AddTask for each task and then call wait() on each returned future.
+ // are finished before returning. This method is intended to be used for
+ // small number tasks where listing them as function arguments is acceptable.
+ // For running large number of tasks you should use AddTask for each task and
+ // then call wait() on each returned future.
template <typename... T> static void RunTasks(T &&... tasks);
private:
diff --git a/include/lldb/Host/Terminal.h b/include/lldb/Host/Terminal.h
index f0d93ad24ed6..193b6d21d51e 100644
--- a/include/lldb/Host/Terminal.h
+++ b/include/lldb/Host/Terminal.h
@@ -44,7 +44,7 @@ protected:
//----------------------------------------------------------------------
/// @class State Terminal.h "lldb/Host/Terminal.h"
-/// @brief A terminal state saving/restoring class.
+/// A terminal state saving/restoring class.
///
/// This class can be used to remember the terminal state for a file
/// descriptor and later restore that state as it originally was.
@@ -64,9 +64,9 @@ public:
//------------------------------------------------------------------
/// Save the TTY state for \a fd.
///
- /// Save the current state of the TTY for the file descriptor "fd"
- /// and if "save_process_group" is true, attempt to save the process
- /// group info for the TTY.
+ /// Save the current state of the TTY for the file descriptor "fd" and if
+ /// "save_process_group" is true, attempt to save the process group info for
+ /// the TTY.
///
/// @param[in] fd
/// The file descriptor to save the state of.
@@ -84,8 +84,8 @@ public:
//------------------------------------------------------------------
/// Restore the TTY state to the cached state.
///
- /// Restore the state of the TTY using the cached values from a
- /// previous call to TerminalState::Save(int,bool).
+ /// Restore the state of the TTY using the cached values from a previous
+ /// call to TerminalState::Save(int,bool).
///
/// @return
/// Returns \b true if the TTY state was successfully restored,
@@ -147,7 +147,7 @@ protected:
//----------------------------------------------------------------------
/// @class TerminalStateSwitcher Terminal.h "lldb/Host/Terminal.h"
-/// @brief A TTY state switching class.
+/// A TTY state switching class.
///
/// This class can be used to remember 2 TTY states for a given file
/// descriptor and switch between the two states.
@@ -182,10 +182,9 @@ public:
bool Restore(uint32_t idx) const;
//------------------------------------------------------------------
- /// Save the TTY state information for the state at index \a idx.
- /// The TTY state is saved for the file descriptor \a fd and
- /// the process group information will also be saved if requested
- /// by \a save_process_group.
+ /// Save the TTY state information for the state at index \a idx. The TTY
+ /// state is saved for the file descriptor \a fd and the process group
+ /// information will also be saved if requested by \a save_process_group.
///
/// @param[in] idx
/// The index into the state array where the state should be
diff --git a/include/lldb/Host/XML.h b/include/lldb/Host/XML.h
index 96b5227305e1..5088f1f25b0d 100644
--- a/include/lldb/Host/XML.h
+++ b/include/lldb/Host/XML.h
@@ -82,6 +82,9 @@ public:
llvm::StringRef GetAttributeValue(const char *name,
const char *fail_value = nullptr) const;
+ bool GetAttributeValueAsUnsigned(const char *name, uint64_t &value,
+ uint64_t fail_value = 0, int base = 0) const;
+
XMLNode FindFirstChildElementWithName(const char *name) const;
XMLNode GetElementForPath(const NamePath &path);
@@ -97,8 +100,8 @@ public:
void ForEachSiblingElement(NodeCallback const &callback) const;
//----------------------------------------------------------------------
- // Iterate through only the sibling nodes that are elements and whose
- // name matches \a name.
+ // Iterate through only the sibling nodes that are elements and whose name
+ // matches \a name.
//----------------------------------------------------------------------
void ForEachSiblingElementWithName(const char *name,
NodeCallback const &callback) const;
@@ -134,8 +137,8 @@ public:
const char *url = "untitled.xml");
//----------------------------------------------------------------------
- // If \a name is nullptr, just get the root element node, else only return
- // a value XMLNode if the name of the root element matches \a name.
+ // If \a name is nullptr, just get the root element node, else only return a
+ // value XMLNode if the name of the root element matches \a name.
//----------------------------------------------------------------------
XMLNode GetRootElement(const char *required_name = nullptr);
@@ -173,12 +176,11 @@ public:
StructuredData::ObjectSP GetStructuredData();
protected:
- // Using a node returned from GetValueNode() extract its value as a
- // string (if possible). Array and dictionary nodes will return false
- // as they have no string value. Boolean nodes will return true and
- // \a value will be "true" or "false" as the string value comes from
- // the element name itself. All other nodes will return the text
- // content of the XMLNode.
+ // Using a node returned from GetValueNode() extract its value as a string
+ // (if possible). Array and dictionary nodes will return false as they have
+ // no string value. Boolean nodes will return true and \a value will be
+ // "true" or "false" as the string value comes from the element name itself.
+ // All other nodes will return the text content of the XMLNode.
static bool ExtractStringFromValueNode(const XMLNode &node,
std::string &value);
diff --git a/include/lldb/Host/common/GetOptInc.h b/include/lldb/Host/common/GetOptInc.h
index 4d5cab5cbec2..c69f7227a5cf 100644
--- a/include/lldb/Host/common/GetOptInc.h
+++ b/include/lldb/Host/common/GetOptInc.h
@@ -19,8 +19,8 @@
// option structure
struct option {
const char *name;
- // has_arg can't be an enum because some compilers complain about
- // type mismatches in all the code that assumes it is an int.
+ // has_arg can't be an enum because some compilers complain about type
+ // mismatches in all the code that assumes it is an int.
int has_arg;
int *flag;
int val;
diff --git a/include/lldb/Host/common/NativeBreakpoint.h b/include/lldb/Host/common/NativeBreakpoint.h
index 73639d64c9e8..681570aadef0 100644
--- a/include/lldb/Host/common/NativeBreakpoint.h
+++ b/include/lldb/Host/common/NativeBreakpoint.h
@@ -45,8 +45,8 @@ protected:
private:
bool m_enabled;
- // -----------------------------------------------------------
- // interface for NativeBreakpointList
+ // ----------------------------------------------------------- interface for
+ // NativeBreakpointList
// -----------------------------------------------------------
void AddRef();
int32_t DecRef();
diff --git a/include/lldb/Host/common/NativeProcessProtocol.h b/include/lldb/Host/common/NativeProcessProtocol.h
index bd8b8744b115..d96835d75839 100644
--- a/include/lldb/Host/common/NativeProcessProtocol.h
+++ b/include/lldb/Host/common/NativeProcessProtocol.h
@@ -69,8 +69,8 @@ public:
virtual Status Kill() = 0;
//------------------------------------------------------------------
- // Tells a process not to stop the inferior on given signals
- // and just reinject them back.
+ // Tells a process not to stop the inferior on given signals and just
+ // reinject them back.
//------------------------------------------------------------------
virtual Status IgnoreSignals(llvm::ArrayRef<int> signals);
@@ -421,33 +421,30 @@ protected:
int m_terminal_fd;
uint32_t m_stop_id = 0;
- // Set of signal numbers that LLDB directly injects back to inferior
- // without stopping it.
+ // Set of signal numbers that LLDB directly injects back to inferior without
+ // stopping it.
llvm::DenseSet<int> m_signals_to_ignore;
// lldb_private::Host calls should be used to launch a process for debugging,
- // and
- // then the process should be attached to. When attaching to a process
- // lldb_private::Host calls should be used to locate the process to attach to,
- // and then this function should be called.
+ // and then the process should be attached to. When attaching to a process
+ // lldb_private::Host calls should be used to locate the process to attach
+ // to, and then this function should be called.
NativeProcessProtocol(lldb::pid_t pid, int terminal_fd,
NativeDelegate &delegate);
- // -----------------------------------------------------------
- // Internal interface for state handling
+ // ----------------------------------------------------------- Internal
+ // interface for state handling
// -----------------------------------------------------------
void SetState(lldb::StateType state, bool notify_delegates = true);
- // Derived classes need not implement this. It can be used as a
- // hook to clear internal caches that should be invalidated when
- // stop ids change.
+ // Derived classes need not implement this. It can be used as a hook to
+ // clear internal caches that should be invalidated when stop ids change.
//
- // Note this function is called with the state mutex obtained
- // by the caller.
+ // Note this function is called with the state mutex obtained by the caller.
virtual void DoStopIDBumped(uint32_t newBumpId);
- // -----------------------------------------------------------
- // Internal interface for software breakpoints
+ // ----------------------------------------------------------- Internal
+ // interface for software breakpoints
// -----------------------------------------------------------
Status SetSoftwareBreakpoint(lldb::addr_t addr, uint32_t size_hint);
@@ -466,11 +463,6 @@ protected:
NativeThreadProtocol *GetThreadByIDUnlocked(lldb::tid_t tid);
- // -----------------------------------------------------------
- // Static helper methods for derived classes.
- // -----------------------------------------------------------
- static Status ResolveProcessArchitecture(lldb::pid_t pid, ArchSpec &arch);
-
private:
void SynchronouslyNotifyProcessStateChanged(lldb::StateType state);
};
diff --git a/include/lldb/Host/common/NativeRegisterContext.h b/include/lldb/Host/common/NativeRegisterContext.h
index a8c5fa17e264..26458db153c1 100644
--- a/include/lldb/Host/common/NativeRegisterContext.h
+++ b/include/lldb/Host/common/NativeRegisterContext.h
@@ -98,17 +98,14 @@ public:
virtual lldb::addr_t GetWatchpointAddress(uint32_t wp_index);
// MIPS Linux kernel returns a masked address (last 3bits are masked)
- // when a HW watchpoint is hit. However user may not have set a watchpoint
- // on this address. This function emulates the instruction at PC and
- // finds the base address used in the load/store instruction. This gives the
- // exact address used to read/write the variable being watched.
- // For example:
- // 'n' is at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at
- // 'm',
+ // when a HW watchpoint is hit. However user may not have set a watchpoint on
+ // this address. This function emulates the instruction at PC and finds the
+ // base address used in the load/store instruction. This gives the exact
+ // address used to read/write the variable being watched. For example: 'n' is
+ // at 0x120010d00 and 'm' is 0x120010d04. When a watchpoint is set at 'm',
// then watch exception is generated even when 'n' is read/written. This
- // function
- // returns address of 'n' so that client can check whether a watchpoint is set
- // on this address or not.
+ // function returns address of 'n' so that client can check whether a
+ // watchpoint is set on this address or not.
virtual lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index);
virtual bool HardwareSingleStep(bool enable);
diff --git a/include/lldb/Host/common/NativeThreadProtocol.h b/include/lldb/Host/common/NativeThreadProtocol.h
index 5609cdda4eea..6f4452c688e7 100644
--- a/include/lldb/Host/common/NativeThreadProtocol.h
+++ b/include/lldb/Host/common/NativeThreadProtocol.h
@@ -32,14 +32,6 @@ public:
virtual NativeRegisterContext &GetRegisterContext() = 0;
- virtual Status ReadRegister(uint32_t reg, RegisterValue &reg_value);
-
- virtual Status WriteRegister(uint32_t reg, const RegisterValue &reg_value);
-
- virtual Status SaveAllRegisters(lldb::DataBufferSP &data_sp);
-
- virtual Status RestoreAllRegisters(lldb::DataBufferSP &data_sp);
-
virtual bool GetStopReason(ThreadStopInfo &stop_info,
std::string &description) = 0;
diff --git a/include/lldb/Host/freebsd/HostInfoFreeBSD.h b/include/lldb/Host/freebsd/HostInfoFreeBSD.h
index 945ec835f778..5b3a18d21079 100644
--- a/include/lldb/Host/freebsd/HostInfoFreeBSD.h
+++ b/include/lldb/Host/freebsd/HostInfoFreeBSD.h
@@ -12,12 +12,13 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
class HostInfoFreeBSD : public HostInfoPosix {
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
diff --git a/include/lldb/Host/linux/HostInfoLinux.h b/include/lldb/Host/linux/HostInfoLinux.h
index d1f2e747b117..820d3bd17a2e 100644
--- a/include/lldb/Host/linux/HostInfoLinux.h
+++ b/include/lldb/Host/linux/HostInfoLinux.h
@@ -12,8 +12,8 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
-
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/VersionTuple.h"
#include <string>
@@ -30,7 +30,7 @@ private:
public:
static void Initialize();
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static llvm::StringRef GetDistributionId();
diff --git a/include/lldb/Host/macosx/HostInfoMacOSX.h b/include/lldb/Host/macosx/HostInfoMacOSX.h
index eee842beec87..d5b0bfd861c0 100644
--- a/include/lldb/Host/macosx/HostInfoMacOSX.h
+++ b/include/lldb/Host/macosx/HostInfoMacOSX.h
@@ -12,6 +12,7 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -26,7 +27,7 @@ private:
~HostInfoMacOSX();
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
@@ -36,8 +37,6 @@ protected:
static void ComputeHostArchitectureSupport(ArchSpec &arch_32,
ArchSpec &arch_64);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
- static bool ComputePythonDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
static bool ComputeSystemPluginsDirectory(FileSpec &file_spec);
static bool ComputeUserPluginsDirectory(FileSpec &file_spec);
};
diff --git a/include/lldb/Host/netbsd/HostInfoNetBSD.h b/include/lldb/Host/netbsd/HostInfoNetBSD.h
index 9ebff6ba6b0e..0d4de79d03b1 100644
--- a/include/lldb/Host/netbsd/HostInfoNetBSD.h
+++ b/include/lldb/Host/netbsd/HostInfoNetBSD.h
@@ -12,12 +12,13 @@
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
class HostInfoNetBSD : public HostInfoPosix {
public:
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static FileSpec GetProgramFileSpec();
diff --git a/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h b/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
index b7e08eb33af7..0d125ca2c813 100644
--- a/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
+++ b/include/lldb/Host/posix/ConnectionFileDescriptorPosix.h
@@ -72,7 +72,7 @@ public:
lldb::IOObjectSP GetReadObject() override { return m_read_sp; }
- uint16_t GetListeningPort(uint32_t timeout_sec);
+ uint16_t GetListeningPort(const Timeout<std::micro> &timeout);
bool GetChildProcessesInherit() const;
void SetChildProcessesInherit(bool child_processes_inherit);
@@ -104,8 +104,8 @@ protected:
Predicate<uint16_t>
m_port_predicate; // Used when binding to port zero to wait for the thread
- // that creates the socket, binds and listens to resolve
- // the port number.
+ // that creates the socket, binds and listens to
+ // resolve the port number.
Pipe m_pipe;
std::recursive_mutex m_mutex;
diff --git a/include/lldb/Host/posix/HostInfoPosix.h b/include/lldb/Host/posix/HostInfoPosix.h
index 34994aea44fe..dda70f9f5a96 100644
--- a/include/lldb/Host/posix/HostInfoPosix.h
+++ b/include/lldb/Host/posix/HostInfoPosix.h
@@ -33,13 +33,12 @@ public:
static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
+ static bool ComputePathRelativeToLibrary(FileSpec &file_spec,
+ llvm::StringRef dir);
+
protected:
static bool ComputeSupportExeDirectory(FileSpec &file_spec);
static bool ComputeHeaderDirectory(FileSpec &file_spec);
- static bool ComputePythonDirectory(FileSpec &file_spec);
- static bool ComputeClangDirectory(FileSpec &file_spec);
- static bool ComputePathRelativeToLibrary(FileSpec &file_spec,
- llvm::StringRef dir);
};
}
diff --git a/include/lldb/Host/posix/PipePosix.h b/include/lldb/Host/posix/PipePosix.h
index 8208b1b8bd6b..bb65a56abd00 100644
--- a/include/lldb/Host/posix/PipePosix.h
+++ b/include/lldb/Host/posix/PipePosix.h
@@ -17,7 +17,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class PipePosix PipePosix.h "lldb/Host/posix/PipePosix.h"
-/// @brief A posix-based implementation of Pipe, a class that abtracts
+/// A posix-based implementation of Pipe, a class that abtracts
/// unix style pipes.
///
/// A class that abstracts the LLDB core from host pipe functionality.
diff --git a/include/lldb/Host/windows/HostInfoWindows.h b/include/lldb/Host/windows/HostInfoWindows.h
index 9dfbf93591ed..24949e6001f7 100644
--- a/include/lldb/Host/windows/HostInfoWindows.h
+++ b/include/lldb/Host/windows/HostInfoWindows.h
@@ -12,6 +12,7 @@
#include "lldb/Host/HostInfoBase.h"
#include "lldb/Utility/FileSpec.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -29,7 +30,7 @@ public:
static size_t GetPageSize();
- static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ static llvm::VersionTuple GetOSVersion();
static bool GetOSBuildString(std::string &s);
static bool GetOSKernelDescription(std::string &s);
static bool GetHostname(std::string &s);
@@ -38,9 +39,6 @@ public:
static bool GetEnvironmentVar(const std::string &var_name, std::string &var);
-protected:
- static bool ComputePythonDirectory(FileSpec &file_spec);
-
private:
static FileSpec m_program_filespec;
};
diff --git a/include/lldb/Host/windows/PipeWindows.h b/include/lldb/Host/windows/PipeWindows.h
index 86dec5a79d8e..e309c421a71c 100644
--- a/include/lldb/Host/windows/PipeWindows.h
+++ b/include/lldb/Host/windows/PipeWindows.h
@@ -17,7 +17,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Pipe PipeWindows.h "lldb/Host/windows/PipeWindows.h"
-/// @brief A windows-based implementation of Pipe, a class that abtracts
+/// A windows-based implementation of Pipe, a class that abtracts
/// unix style pipes.
///
/// A class that abstracts the LLDB core from host pipe functionality.
diff --git a/include/lldb/Host/windows/PosixApi.h b/include/lldb/Host/windows/PosixApi.h
index de70266a5efb..801107dadceb 100644
--- a/include/lldb/Host/windows/PosixApi.h
+++ b/include/lldb/Host/windows/PosixApi.h
@@ -11,7 +11,7 @@
#define liblldb_Host_windows_PosixApi_h
#include "llvm/Support/Compiler.h"
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
#error "windows/PosixApi.h being #included on non Windows system!"
#endif
diff --git a/include/lldb/Interpreter/CommandAlias.h b/include/lldb/Interpreter/CommandAlias.h
index 4658a1e444f4..01522bd6ecea 100644
--- a/include/lldb/Interpreter/CommandAlias.h
+++ b/include/lldb/Interpreter/CommandAlias.h
@@ -16,8 +16,9 @@
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/lldb-forward.h"
namespace lldb_private {
@@ -40,17 +41,11 @@ public:
bool WantsCompletion() override;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override;
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
Options *GetOptions() override;
@@ -74,8 +69,8 @@ public:
OptionArgVectorSP GetOptionArguments() const { return m_option_args_sp; }
const char *GetOptionString() { return m_option_string.c_str(); }
- // this takes an alias - potentially nested (i.e. an alias to an alias)
- // and expands it all the way to a non-alias command
+ // this takes an alias - potentially nested (i.e. an alias to an alias) and
+ // expands it all the way to a non-alias command
std::pair<lldb::CommandObjectSP, OptionArgVectorSP> Desugar();
protected:
diff --git a/include/lldb/Interpreter/CommandCompletions.h b/include/lldb/Interpreter/CommandCompletions.h
index 8bac3e8639d7..d17864e05f3e 100644
--- a/include/lldb/Interpreter/CommandCompletions.h
+++ b/include/lldb/Interpreter/CommandCompletions.h
@@ -18,6 +18,7 @@
// Project includes
#include "lldb/Core/FileSpecList.h"
#include "lldb/Core/SearchFilter.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/lldb-private.h"
@@ -29,20 +30,13 @@ class CommandCompletions {
public:
//----------------------------------------------------------------------
// This is the command completion callback that is used to complete the
- // argument of the option
- // it is bound to (in the OptionDefinition table below). Return the total
- // number of matches.
+ // argument of the option it is bound to (in the OptionDefinition table
+ // below). Return the total number of matches.
//----------------------------------------------------------------------
- typedef int (*CompletionCallback)(
- CommandInterpreter &interpreter,
- llvm::StringRef completion_str, // This is the argument we are completing
- int match_start_point, // This is the point in the list of matches that
- // you should start returning elements
- int max_return_elements, // This is the number of matches requested.
- lldb_private::SearchFilter
- *searcher, // A search filter to limit the search...
- bool &word_complete,
- lldb_private::StringList &matches); // The array of matches we return.
+ typedef int (*CompletionCallback)(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ // A search filter to limit the search...
+ lldb_private::SearchFilter *searcher);
typedef enum {
eNoCompletion = 0u,
eSourceFileCompletion = (1u << 0),
@@ -54,9 +48,9 @@ public:
ePlatformPluginCompletion = (1u << 6),
eArchitectureCompletion = (1u << 7),
eVariablePathCompletion = (1u << 8),
- // This item serves two purposes. It is the last element in the enum,
- // so you can add custom enums starting from here in your Option class.
- // Also if you & in this bit the base code will not process the option.
+ // This item serves two purposes. It is the last element in the enum, so
+ // you can add custom enums starting from here in your Option class. Also
+ // if you & in this bit the base code will not process the option.
eCustomCompletion = (1u << 9)
} CommonCompletionTypes;
@@ -67,81 +61,55 @@ public:
static bool InvokeCommonCompletionCallbacks(
CommandInterpreter &interpreter, uint32_t completion_mask,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ lldb_private::CompletionRequest &request, SearchFilter *searcher);
//----------------------------------------------------------------------
// These are the generic completer functions:
//----------------------------------------------------------------------
static int DiskFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int DiskFiles(const llvm::Twine &partial_file_name,
StringList &matches, TildeExpressionResolver &Resolver);
static int DiskDirectories(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int DiskDirectories(const llvm::Twine &partial_file_name,
StringList &matches,
TildeExpressionResolver &Resolver);
static int SourceFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int Modules(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int Symbols(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name, int match_start_point,
- int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int SettingsNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
static int PlatformPluginNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int ArchitectureNames(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request,
+ SearchFilter *searcher);
static int VariablePath(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- lldb_private::StringList &matches);
+ CompletionRequest &request, SearchFilter *searcher);
//----------------------------------------------------------------------
- // The Completer class is a convenient base class for building searchers
- // that go along with the SearchFilter passed to the standard Completer
- // functions.
+ // The Completer class is a convenient base class for building searchers that
+ // go along with the SearchFilter passed to the standard Completer functions.
//----------------------------------------------------------------------
class Completer : public Searcher {
public:
- Completer(CommandInterpreter &interpreter, llvm::StringRef completion_str,
- int match_start_point, int max_return_elements,
- StringList &matches);
+ Completer(CommandInterpreter &interpreter, CompletionRequest &request);
~Completer() override;
@@ -154,10 +122,7 @@ public:
protected:
CommandInterpreter &m_interpreter;
- std::string m_completion_str;
- int m_match_start_point;
- int m_max_return_elements;
- StringList &m_matches;
+ CompletionRequest &m_request;
private:
DISALLOW_COPY_AND_ASSIGN(Completer);
@@ -169,9 +134,7 @@ public:
class SourceFileCompleter : public Completer {
public:
SourceFileCompleter(CommandInterpreter &interpreter,
- bool include_support_files,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ bool include_support_files, CompletionRequest &request);
Searcher::Depth GetDepth() override;
@@ -197,8 +160,7 @@ public:
class ModuleCompleter : public Completer {
public:
ModuleCompleter(CommandInterpreter &interpreter,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ CompletionRequest &request);
Searcher::Depth GetDepth() override;
@@ -222,8 +184,7 @@ public:
class SymbolCompleter : public Completer {
public:
SymbolCompleter(CommandInterpreter &interpreter,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches);
+ CompletionRequest &request);
Searcher::Depth GetDepth() override;
diff --git a/include/lldb/Interpreter/CommandInterpreter.h b/include/lldb/Interpreter/CommandInterpreter.h
index 5e561f47946d..78f505c24754 100644
--- a/include/lldb/Interpreter/CommandInterpreter.h
+++ b/include/lldb/Interpreter/CommandInterpreter.h
@@ -19,11 +19,12 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Event.h"
#include "lldb/Core/IOHandler.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandAlias.h"
#include "lldb/Interpreter/CommandHistory.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-forward.h"
@@ -86,11 +87,10 @@ public:
m_add_to_history = value;
}
// These return the default behaviors if the behavior is not
- // eLazyBoolCalculate.
- // But I've also left the ivars public since for different ways of running the
- // interpreter you might want to force different defaults... In that case,
- // just grab
- // the LazyBool ivars directly and do what you want with eLazyBoolCalculate.
+ // eLazyBoolCalculate. But I've also left the ivars public since for
+ // different ways of running the interpreter you might want to force
+ // different defaults... In that case, just grab the LazyBool ivars directly
+ // and do what you want with eLazyBoolCalculate.
bool GetStopOnContinue() const { return DefaultToNo(m_stop_on_continue); }
void SetStopOnContinue(bool stop_on_continue) {
@@ -293,26 +293,19 @@ public:
CommandObject *GetCommandObjectForCommand(llvm::StringRef &command_line);
// This handles command line completion. You are given a pointer to the
- // command string buffer, to the current cursor,
- // and to the end of the string (in case it is not NULL terminated).
- // You also passed in an StringList object to fill with the returns.
- // The first element of the array will be filled with the string that you
- // would need to insert at
- // the cursor point to complete the cursor point to the longest common
- // matching prefix.
- // If you want to limit the number of elements returned, set
- // max_return_elements to the number of elements
- // you want returned. Otherwise set max_return_elements to -1.
- // If you want to start some way into the match list, then set
- // match_start_point to the desired start
- // point.
- // Returns:
- // -1 if the completion character should be inserted
- // -2 if the entire command line should be deleted and replaced with
- // matches.GetStringAtIndex(0)
+ // command string buffer, to the current cursor, and to the end of the string
+ // (in case it is not NULL terminated). You also passed in an StringList
+ // object to fill with the returns. The first element of the array will be
+ // filled with the string that you would need to insert at the cursor point
+ // to complete the cursor point to the longest common matching prefix. If you
+ // want to limit the number of elements returned, set max_return_elements to
+ // the number of elements you want returned. Otherwise set
+ // max_return_elements to -1. If you want to start some way into the match
+ // list, then set match_start_point to the desired start point. Returns: -1
+ // if the completion character should be inserted -2 if the entire command
+ // line should be deleted and replaced with matches.GetStringAtIndex(0)
// INT_MAX if the number of matches is > max_return_elements, but it is
- // expensive to compute.
- // Otherwise, returns the number of matches.
+ // expensive to compute. Otherwise, returns the number of matches.
//
// FIXME: Only max_return_elements == -1 is supported at present.
int HandleCompletion(const char *current_line, const char *cursor,
@@ -320,15 +313,9 @@ public:
int max_return_elements, StringList &matches);
// This version just returns matches, and doesn't compute the substring. It
- // is here so the
- // Help command can call it for the first argument.
- // word_complete tells whether the completions are considered a "complete"
- // response (so the
- // completer should complete the quote & put a space after the word.
- int HandleCompletionMatches(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ // is here so the Help command can call it for the first argument. It uses
+ // a CompletionRequest for simplicity reasons.
+ int HandleCompletionMatches(CompletionRequest &request);
int GetCommandNamesMatchingPartialString(const char *cmd_cstr,
bool include_aliases,
@@ -469,6 +456,30 @@ public:
void SetPromptOnQuit(bool b);
+ //------------------------------------------------------------------
+ /// Specify if the command interpreter should allow that the user can
+ /// specify a custom exit code when calling 'quit'.
+ //------------------------------------------------------------------
+ void AllowExitCodeOnQuit(bool allow);
+
+ //------------------------------------------------------------------
+ /// Sets the exit code for the quit command.
+ /// @param[in] exit_code
+ /// The exit code that the driver should return on exit.
+ /// @return True if the exit code was successfully set; false if the
+ /// interpreter doesn't allow custom exit codes.
+ /// @see AllowExitCodeOnQuit
+ //------------------------------------------------------------------
+ LLVM_NODISCARD bool SetQuitExitCode(int exit_code);
+
+ //------------------------------------------------------------------
+ /// Returns the exit code that the user has specified when running the
+ /// 'quit' command.
+ /// @param[out] exited
+ /// Set to true if the user has called quit with a custom exit code.
+ //------------------------------------------------------------------
+ int GetQuitExitCode(bool &exited) const;
+
void ResolveCommand(const char *command_line, CommandReturnObject &result);
bool GetStopCmdSourceOnError() const;
@@ -572,6 +583,12 @@ private:
uint32_t m_num_errors;
bool m_quit_requested;
bool m_stopped_for_crash;
+
+ // The exit code the user has requested when calling the 'quit' command.
+ // No value means the user hasn't set a custom exit code so far.
+ llvm::Optional<int> m_quit_exit_code;
+ // If the driver is accepts custom exit codes for the 'quit' command.
+ bool m_allow_exit_code = false;
};
} // namespace lldb_private
diff --git a/include/lldb/Interpreter/CommandObject.h b/include/lldb/Interpreter/CommandObject.h
index ff4c829e5c70..7afb18b2f598 100644
--- a/include/lldb/Interpreter/CommandObject.h
+++ b/include/lldb/Interpreter/CommandObject.h
@@ -20,9 +20,11 @@
// Project includes
#include "lldb/Utility/Flags.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
+#include "lldb/Interpreter/Options.h"
#include "lldb/Target/ExecutionContext.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/StringList.h"
#include "lldb/lldb-private.h"
@@ -31,9 +33,8 @@ namespace lldb_private {
// This function really deals with CommandObjectLists, but we didn't make a
// CommandObjectList class, so I'm sticking it here. But we really should have
// such a class. Anyway, it looks up the commands in the map that match the
-// partial
-// string cmd_str, inserts the matches into matches, and returns the number
-// added.
+// partial string cmd_str, inserts the matches into matches, and returns the
+// number added.
template <typename ValueType>
int AddNamesMatchingPartialString(const std::map<std::string, ValueType> &in_map,
@@ -137,8 +138,8 @@ public:
void SetSyntax(llvm::StringRef str);
- // override this to return true if you want to enable the user to delete
- // the Command object from the Command dictionary (aliases have their own
+ // override this to return true if you want to enable the user to delete the
+ // Command object from the Command dictionary (aliases have their own
// deletion scheme, so they do not need to care about this)
virtual bool IsRemovable() const { return false; }
@@ -148,9 +149,9 @@ public:
virtual bool IsAlias() { return false; }
- // override this to return true if your command is somehow a "dash-dash"
- // form of some other command (e.g. po is expr -O --); this is a powerful
- // hint to the help system that one cannot pass options to this command
+ // override this to return true if your command is somehow a "dash-dash" form
+ // of some other command (e.g. po is expr -O --); this is a powerful hint to
+ // the help system that one cannot pass options to this command
virtual bool IsDashDashCommand() { return false; }
virtual lldb::CommandObjectSP GetSubcommandSP(llvm::StringRef sub_cmd,
@@ -174,10 +175,9 @@ public:
virtual void GenerateHelpText(Stream &result);
- // this is needed in order to allow the SBCommand class to
- // transparently try and load subcommands - it will fail on
- // anything but a multiword command, but it avoids us doing
- // type checkings and casts
+ // this is needed in order to allow the SBCommand class to transparently try
+ // and load subcommands - it will fail on anything but a multiword command,
+ // but it avoids us doing type checkings and casts
virtual bool LoadSubCommand(llvm::StringRef cmd_name,
const lldb::CommandObjectSP &command_obj) {
return false;
@@ -185,9 +185,9 @@ public:
virtual bool WantsRawCommandString() = 0;
- // By default, WantsCompletion = !WantsRawCommandString.
- // Subclasses who want raw command string but desire, for example,
- // argument completion should override this method to return true.
+ // By default, WantsCompletion = !WantsRawCommandString. Subclasses who want
+ // raw command string but desire, for example, argument completion should
+ // override this method to return true.
virtual bool WantsCompletion() { return !WantsRawCommandString(); }
virtual Options *GetOptions();
@@ -209,10 +209,10 @@ public:
static const char *GetArgumentName(lldb::CommandArgumentType arg_type);
// Generates a nicely formatted command args string for help command output.
- // By default, all possible args are taken into account, for example,
- // '<expr | variable-name>'. This can be refined by passing a second arg
- // specifying which option set(s) we are interested, which could then, for
- // example, produce either '<expr>' or '<variable-name>'.
+ // By default, all possible args are taken into account, for example, '<expr
+ // | variable-name>'. This can be refined by passing a second arg specifying
+ // which option set(s) we are interested, which could then, for example,
+ // produce either '<expr>' or '<variable-name>'.
void GetFormattedCommandArguments(Stream &str,
uint32_t opt_set_mask = LLDB_OPT_SET_ALL);
@@ -223,44 +223,13 @@ public:
void SetCommandName(llvm::StringRef name);
//------------------------------------------------------------------
- /// The input array contains a parsed version of the line. The insertion
- /// point is given by cursor_index (the index in input of the word containing
- /// the cursor) and cursor_char_position (the position of the cursor in that
- /// word.)
/// This default version handles calling option argument completions and then
- /// calls
- /// HandleArgumentCompletion if the cursor is on an argument, not an option.
- /// Don't override this method, override HandleArgumentCompletion instead
- /// unless
- /// you have special reasons.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] cursor_char_pos
- /// The character position of the cursor in its argument word.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// FIXME: Not yet implemented... If there is a match that is expensive
- /// to compute, these are
- /// here to allow you to compute the completions in batches. Start the
- /// completion from \amatch_start_point,
- /// and return \amatch_return_elements elements.
+ /// calls HandleArgumentCompletion if the cursor is on an argument, not an
+ /// option. Don't override this method, override HandleArgumentCompletion
+ /// instead unless you have special reasons.
///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be inserted
- /// after the
- /// completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// @param[in/out] request
+ /// The completion request that needs to be answered.
///
/// FIXME: This is the wrong return value, since we also need to make a
/// distinction between
@@ -269,10 +238,7 @@ public:
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
- virtual int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ virtual int HandleCompletion(CompletionRequest &request);
//------------------------------------------------------------------
/// The input array contains a parsed version of the line. The insertion
@@ -280,36 +246,10 @@ public:
/// the cursor) and cursor_char_position (the position of the cursor in that
/// word.)
/// We've constructed the map of options and their arguments as well if that
- /// is
- /// helpful for the completion.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] cursor_char_pos
- /// The character position of the cursor in its argument word.
+ /// is helpful for the completion.
///
- /// @param[in] opt_element_vector
- /// The results of the options parse of \a input.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of how these
- /// work.
- ///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be inserted
- /// after the
- /// completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// @param[in/out] request
+ /// The completion request that needs to be answered.
///
/// FIXME: This is the wrong return value, since we also need to make a
/// distinction between
@@ -318,10 +258,9 @@ public:
/// @return
/// The number of completions.
//------------------------------------------------------------------
- virtual int HandleArgumentCompletion(
- Args &input, int &cursor_index, int &cursor_char_position,
- OptionElementVector &opt_element_vector, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
+ virtual int
+ HandleArgumentCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector) {
return 0;
}
@@ -397,6 +336,10 @@ public:
CommandReturnObject &result) = 0;
protected:
+ bool ParseOptionsAndNotify(Args &args, CommandReturnObject &result,
+ OptionGroupOptions &group_options,
+ ExecutionContext &exe_ctx);
+
virtual const char *GetInvalidTargetDescription() {
return "invalid target, create a target using the 'target create' command";
}
@@ -414,18 +357,16 @@ protected:
}
// This is for use in the command interpreter, when you either want the
- // selected target, or if no target
- // is present you want to prime the dummy target with entities that will be
- // copied over to new targets.
+ // selected target, or if no target is present you want to prime the dummy
+ // target with entities that will be copied over to new targets.
Target *GetSelectedOrDummyTarget(bool prefer_dummy = false);
Target *GetDummyTarget();
- // If a command needs to use the "current" thread, use this call.
- // Command objects will have an ExecutionContext to use, and that may or may
- // not have a thread in it. If it
- // does, you should use that by default, if not, then use the
- // ExecutionContext's target's selected thread, etc...
- // This call insulates you from the details of this calculation.
+ // If a command needs to use the "current" thread, use this call. Command
+ // objects will have an ExecutionContext to use, and that may or may not have
+ // a thread in it. If it does, you should use that by default, if not, then
+ // use the ExecutionContext's target's selected thread, etc... This call
+ // insulates you from the details of this calculation.
Thread *GetDefaultThread();
//------------------------------------------------------------------
@@ -492,7 +433,8 @@ public:
bool Execute(const char *args_string, CommandReturnObject &result) override;
protected:
- virtual bool DoExecute(const char *command, CommandReturnObject &result) = 0;
+ virtual bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) = 0;
bool WantsRawCommandString() override { return true; }
};
diff --git a/include/lldb/Interpreter/CommandObjectMultiword.h b/include/lldb/Interpreter/CommandObjectMultiword.h
index 947272f4212e..d9eff9a6e545 100644
--- a/include/lldb/Interpreter/CommandObjectMultiword.h
+++ b/include/lldb/Interpreter/CommandObjectMultiword.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
namespace lldb_private {
@@ -56,10 +57,7 @@ public:
bool WantsRawCommandString() override { return false; }
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
const char *GetRepeatCommand(Args &current_command_args,
uint32_t index) override;
@@ -87,8 +85,8 @@ public:
~CommandObjectProxy() override;
- // Subclasses must provide a command object that will be transparently
- // used for this object.
+ // Subclasses must provide a command object that will be transparently used
+ // for this object.
virtual CommandObject *GetProxyCommandObject() = 0;
llvm::StringRef GetHelpLong() override;
@@ -121,17 +119,11 @@ public:
Options *GetOptions() override;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
-
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
+
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override;
const char *GetRepeatCommand(Args &current_command_args,
uint32_t index) override;
diff --git a/include/lldb/Interpreter/CommandObjectRegexCommand.h b/include/lldb/Interpreter/CommandObjectRegexCommand.h
index 50dbebc21b1d..36c3f068bdf3 100644
--- a/include/lldb/Interpreter/CommandObjectRegexCommand.h
+++ b/include/lldb/Interpreter/CommandObjectRegexCommand.h
@@ -17,6 +17,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/RegularExpression.h"
namespace lldb_private {
@@ -40,13 +41,10 @@ public:
bool HasRegexEntries() const { return !m_entries.empty(); }
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override;
+ bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
struct Entry {
RegularExpression regex;
diff --git a/include/lldb/Interpreter/OptionArgParser.h b/include/lldb/Interpreter/OptionArgParser.h
new file mode 100644
index 000000000000..5ace7e5d0250
--- /dev/null
+++ b/include/lldb/Interpreter/OptionArgParser.h
@@ -0,0 +1,43 @@
+//===-- OptionArgParser.h ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_INTERPRETER_OPTIONARGPARSER_H
+#define LLDB_INTERPRETER_OPTIONARGPARSER_H
+
+#include "lldb/lldb-private-types.h"
+
+namespace lldb_private {
+
+struct OptionArgParser {
+ static lldb::addr_t ToAddress(const ExecutionContext *exe_ctx,
+ llvm::StringRef s, lldb::addr_t fail_value,
+ Status *error);
+
+ static bool ToBoolean(llvm::StringRef s, bool fail_value, bool *success_ptr);
+
+ static char ToChar(llvm::StringRef s, char fail_value, bool *success_ptr);
+
+ static int64_t ToOptionEnum(llvm::StringRef s,
+ OptionEnumValueElement *enum_values,
+ int32_t fail_value, Status &error);
+
+ static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s,
+ lldb::ScriptLanguage fail_value,
+ bool *success_ptr);
+
+ // TODO: Use StringRef
+ static Status ToFormat(const char *s, lldb::Format &format,
+ size_t *byte_size_ptr); // If non-NULL, then a
+ // byte size can precede
+ // the format character
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_INTERPRETER_OPTIONARGPARSER_H
diff --git a/include/lldb/Interpreter/OptionGroupBoolean.h b/include/lldb/Interpreter/OptionGroupBoolean.h
index 53d08d79d67a..2489a648dd7e 100644
--- a/include/lldb/Interpreter/OptionGroupBoolean.h
+++ b/include/lldb/Interpreter/OptionGroupBoolean.h
@@ -24,9 +24,9 @@ namespace lldb_private {
class OptionGroupBoolean : public OptionGroup {
public:
- // When 'no_argument_toggle_default' is true, then setting the option
- // value does NOT require an argument, it sets the boolean value to the
- // inverse of the default value
+ // When 'no_argument_toggle_default' is true, then setting the option value
+ // does NOT require an argument, it sets the boolean value to the inverse of
+ // the default value
OptionGroupBoolean(uint32_t usage_mask, bool required,
const char *long_option, int short_option,
const char *usage_text, bool default_value,
diff --git a/include/lldb/Interpreter/OptionGroupPlatform.h b/include/lldb/Interpreter/OptionGroupPlatform.h
index e79662400279..cda4246f1b01 100644
--- a/include/lldb/Interpreter/OptionGroupPlatform.h
+++ b/include/lldb/Interpreter/OptionGroupPlatform.h
@@ -16,6 +16,7 @@
// Project includes
#include "lldb/Interpreter/Options.h"
#include "lldb/Utility/ConstString.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -28,8 +29,6 @@ class OptionGroupPlatform : public OptionGroup {
public:
OptionGroupPlatform(bool include_platform_option)
: OptionGroup(), m_platform_name(), m_sdk_sysroot(),
- m_os_version_major(UINT32_MAX), m_os_version_minor(UINT32_MAX),
- m_os_version_update(UINT32_MAX),
m_include_platform_option(include_platform_option) {}
~OptionGroupPlatform() override = default;
@@ -72,9 +71,7 @@ protected:
std::string m_platform_name;
ConstString m_sdk_sysroot;
ConstString m_sdk_build;
- uint32_t m_os_version_major;
- uint32_t m_os_version_minor;
- uint32_t m_os_version_update;
+ llvm::VersionTuple m_os_version;
bool m_include_platform_option;
};
diff --git a/include/lldb/Interpreter/OptionValue.h b/include/lldb/Interpreter/OptionValue.h
index 6008e1ea4411..4748e309c77e 100644
--- a/include/lldb/Interpreter/OptionValue.h
+++ b/include/lldb/Interpreter/OptionValue.h
@@ -15,6 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Core/FormatEntity.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Status.h"
#include "lldb/lldb-defines.h"
@@ -76,8 +77,8 @@ public:
//-----------------------------------------------------------------
virtual Type GetType() const = 0;
- // If this value is always hidden, the avoid showing any info on this
- // value, just show the info for the child values.
+ // If this value is always hidden, the avoid showing any info on this value,
+ // just show the info for the child values.
virtual bool ValueIsTransparent() const {
return GetType() == eTypeProperties;
}
@@ -100,9 +101,7 @@ public:
virtual lldb::OptionValueSP DeepCopy() const = 0;
virtual size_t AutoComplete(CommandInterpreter &interpreter,
- llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches);
+ CompletionRequest &request);
//-----------------------------------------------------------------
// Subclasses can override these functions
@@ -126,8 +125,8 @@ public:
virtual bool DumpQualifiedName(Stream &strm) const;
//-----------------------------------------------------------------
- // Subclasses should NOT override these functions as they use the
- // above functions to implement functionality
+ // Subclasses should NOT override these functions as they use the above
+ // functions to implement functionality
//-----------------------------------------------------------------
uint32_t GetTypeAsMask() { return 1u << GetType(); }
@@ -183,9 +182,8 @@ public:
CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask,
Status &error);
- // Get this value as a uint64_t value if it is encoded as a boolean,
- // uint64_t or int64_t. Other types will cause "fail_value" to be
- // returned
+ // Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
+ // or int64_t. Other types will cause "fail_value" to be returned
uint64_t GetUInt64Value(uint64_t fail_value, bool *success_ptr);
OptionValueArch *GetAsArch();
@@ -339,10 +337,10 @@ protected:
void *m_baton;
bool m_value_was_set; // This can be used to see if a value has been set
// by a call to SetValueFromCString(). It is often
- // handy to know if an option value was set from
- // the command line or as a setting, versus if we
- // just have the default value that was already
- // populated in the option value.
+ // handy to know if an option value was set from the
+ // command line or as a setting, versus if we just have
+ // the default value that was already populated in the
+ // option value.
};
} // namespace lldb_private
diff --git a/include/lldb/Interpreter/OptionValueArch.h b/include/lldb/Interpreter/OptionValueArch.h
index d66448aa2bed..15b74ad17893 100644
--- a/include/lldb/Interpreter/OptionValueArch.h
+++ b/include/lldb/Interpreter/OptionValueArch.h
@@ -12,6 +12,7 @@
#include "lldb/Interpreter/OptionValue.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/CompletionRequest.h"
namespace lldb_private {
@@ -57,9 +58,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ lldb_private::CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueArray.h b/include/lldb/Interpreter/OptionValueArray.h
index bbf4e371a893..44709d00763f 100644
--- a/include/lldb/Interpreter/OptionValueArray.h
+++ b/include/lldb/Interpreter/OptionValueArray.h
@@ -78,8 +78,8 @@ public:
}
bool AppendValue(const lldb::OptionValueSP &value_sp) {
- // Make sure the value_sp object is allowed to contain
- // values of the type passed in...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
m_values.push_back(value_sp);
return true;
@@ -88,8 +88,8 @@ public:
}
bool InsertValue(size_t idx, const lldb::OptionValueSP &value_sp) {
- // Make sure the value_sp object is allowed to contain
- // values of the type passed in...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size())
m_values.insert(m_values.begin() + idx, value_sp);
@@ -101,8 +101,8 @@ public:
}
bool ReplaceValue(size_t idx, const lldb::OptionValueSP &value_sp) {
- // Make sure the value_sp object is allowed to contain
- // values of the type passed in...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (idx < m_values.size()) {
m_values[idx] = value_sp;
diff --git a/include/lldb/Interpreter/OptionValueBoolean.h b/include/lldb/Interpreter/OptionValueBoolean.h
index 1ff84dd3367d..6d2a16e59597 100644
--- a/include/lldb/Interpreter/OptionValueBoolean.h
+++ b/include/lldb/Interpreter/OptionValueBoolean.h
@@ -50,9 +50,8 @@ public:
return true;
}
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueEnumeration.h b/include/lldb/Interpreter/OptionValueEnumeration.h
index 4aa8823e620f..08d6ac70de52 100644
--- a/include/lldb/Interpreter/OptionValueEnumeration.h
+++ b/include/lldb/Interpreter/OptionValueEnumeration.h
@@ -59,9 +59,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueFileSpec.h b/include/lldb/Interpreter/OptionValueFileSpec.h
index 293ecd0d8054..41a479e2fc9e 100644
--- a/include/lldb/Interpreter/OptionValueFileSpec.h
+++ b/include/lldb/Interpreter/OptionValueFileSpec.h
@@ -54,9 +54,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueFormatEntity.h b/include/lldb/Interpreter/OptionValueFormatEntity.h
index e5a65b7e7eb6..880e434dc5c0 100644
--- a/include/lldb/Interpreter/OptionValueFormatEntity.h
+++ b/include/lldb/Interpreter/OptionValueFormatEntity.h
@@ -45,9 +45,8 @@ public:
lldb::OptionValueSP DeepCopy() const override;
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
//---------------------------------------------------------------------
// Subclass specific functions
diff --git a/include/lldb/Interpreter/OptionValueProperties.h b/include/lldb/Interpreter/OptionValueProperties.h
index 16d31aa4ea90..96bd93ab3d7b 100644
--- a/include/lldb/Interpreter/OptionValueProperties.h
+++ b/include/lldb/Interpreter/OptionValueProperties.h
@@ -75,15 +75,15 @@ public:
//---------------------------------------------------------------------
// Get the index of a property given its exact name in this property
- // collection, "name" can't be a path to a property path that refers
- // to a property within a property
+ // collection, "name" can't be a path to a property path that refers to a
+ // property within a property
//---------------------------------------------------------------------
virtual uint32_t GetPropertyIndex(const ConstString &name) const;
//---------------------------------------------------------------------
- // Get a property by exact name exists in this property collection, name
- // can not be a path to a property path that refers to a property within
- // a property
+ // Get a property by exact name exists in this property collection, name can
+ // not be a path to a property path that refers to a property within a
+ // property
//---------------------------------------------------------------------
virtual const Property *GetProperty(const ExecutionContext *exe_ctx,
bool will_modify,
diff --git a/include/lldb/Interpreter/OptionValueUInt64.h b/include/lldb/Interpreter/OptionValueUInt64.h
index be13ff073721..96404bed8e67 100644
--- a/include/lldb/Interpreter/OptionValueUInt64.h
+++ b/include/lldb/Interpreter/OptionValueUInt64.h
@@ -34,9 +34,9 @@ public:
//---------------------------------------------------------------------
// Decode a uint64_t from "value_cstr" return a OptionValueUInt64 object
- // inside of a lldb::OptionValueSP object if all goes well. If the
- // string isn't a uint64_t value or any other error occurs, return an
- // empty lldb::OptionValueSP and fill error in with the correct stuff.
+ // inside of a lldb::OptionValueSP object if all goes well. If the string
+ // isn't a uint64_t value or any other error occurs, return an empty
+ // lldb::OptionValueSP and fill error in with the correct stuff.
//---------------------------------------------------------------------
static lldb::OptionValueSP Create(const char *, Status &) = delete;
static lldb::OptionValueSP Create(llvm::StringRef value_str, Status &error);
diff --git a/include/lldb/Interpreter/OptionValueUUID.h b/include/lldb/Interpreter/OptionValueUUID.h
index 6e0aeebb0e99..950efb518d5a 100644
--- a/include/lldb/Interpreter/OptionValueUUID.h
+++ b/include/lldb/Interpreter/OptionValueUUID.h
@@ -61,9 +61,8 @@ public:
void SetCurrentValue(const UUID &value) { m_uuid = value; }
- size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s,
- int match_start_point, int max_return_elements,
- bool &word_complete, StringList &matches) override;
+ size_t AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) override;
protected:
UUID m_uuid;
diff --git a/include/lldb/Interpreter/Options.h b/include/lldb/Interpreter/Options.h
index 87121005575a..316bf568fd92 100644
--- a/include/lldb/Interpreter/Options.h
+++ b/include/lldb/Interpreter/Options.h
@@ -17,7 +17,9 @@
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/CompletionRequest.h"
+#include "lldb/Utility/Status.h"
#include "lldb/lldb-defines.h"
#include "lldb/lldb-private.h"
@@ -25,6 +27,24 @@
namespace lldb_private {
+struct Option;
+
+typedef std::vector<std::tuple<std::string, int, std::string>> OptionArgVector;
+typedef std::shared_ptr<OptionArgVector> OptionArgVectorSP;
+
+struct OptionArgElement {
+ enum { eUnrecognizedArg = -1, eBareDash = -2, eBareDoubleDash = -3 };
+
+ OptionArgElement(int defs_index, int pos, int arg_pos)
+ : opt_defs_index(defs_index), opt_pos(pos), opt_arg_pos(arg_pos) {}
+
+ int opt_defs_index;
+ int opt_pos;
+ int opt_arg_pos;
+};
+
+typedef std::vector<OptionArgElement> OptionElementVector;
+
static inline bool isprint8(int ch) {
if (ch & 0xffffff00u)
return false;
@@ -33,90 +53,18 @@ static inline bool isprint8(int ch) {
//----------------------------------------------------------------------
/// @class Options Options.h "lldb/Interpreter/Options.h"
-/// @brief A command line option parsing protocol class.
+/// A command line option parsing protocol class.
///
-/// Options is designed to be subclassed to contain all needed
-/// options for a given command. The options can be parsed by calling:
-/// \code
-/// Status Args::ParseOptions (Options &);
-/// \endcode
+/// Options is designed to be subclassed to contain all needed options for a
+/// given command. The options can be parsed by calling the Parse function.
///
-/// The options are specified using the format defined for the libc
-/// options parsing function getopt_long_only:
-/// \code
+/// The options are specified using the format defined for the libc options
+/// parsing function getopt_long_only: \code
/// #include <getopt.h>
/// int getopt_long_only(int argc, char * const *argv, const char
/// *optstring, const struct option *longopts, int *longindex);
/// \endcode
///
-/// Example code:
-/// \code
-/// #include <getopt.h>
-/// #include <string>
-///
-/// class CommandOptions : public Options
-/// {
-/// public:
-/// virtual struct option *
-/// GetLongOptions() {
-/// return g_options;
-/// }
-///
-/// virtual Status
-/// SetOptionValue (uint32_t option_idx, int option_val, const char
-/// *option_arg)
-/// {
-/// Status error;
-/// switch (option_val)
-/// {
-/// case 'g': debug = true; break;
-/// case 'v': verbose = true; break;
-/// case 'l': log_file = option_arg; break;
-/// case 'f': log_flags = strtoull(option_arg, nullptr, 0); break;
-/// default:
-/// error.SetErrorStringWithFormat("unrecognized short option
-/// %c", option_val);
-/// break;
-/// }
-///
-/// return error;
-/// }
-///
-/// CommandOptions (CommandInterpreter &interpreter) : debug (true),
-/// verbose (false), log_file (), log_flags (0)
-/// {}
-///
-/// bool debug;
-/// bool verbose;
-/// std::string log_file;
-/// uint32_t log_flags;
-///
-/// static struct option g_options[];
-///
-/// };
-///
-/// struct option CommandOptions::g_options[] =
-/// {
-/// { "debug", no_argument, nullptr, 'g' },
-/// { "log-file", required_argument, nullptr, 'l' },
-/// { "log-flags", required_argument, nullptr, 'f' },
-/// { "verbose", no_argument, nullptr, 'v' },
-/// { nullptr, 0, nullptr, 0 }
-/// };
-///
-/// int main (int argc, const char **argv, const char **envp)
-/// {
-/// CommandOptions options;
-/// Args main_command;
-/// main_command.SetArguments(argc, argv, false);
-/// main_command.ParseOptions(options);
-///
-/// if (options.verbose)
-/// {
-/// std::cout << "verbose is on" << std::endl;
-/// }
-/// }
-/// \endcode
//----------------------------------------------------------------------
class Options {
public:
@@ -143,9 +91,9 @@ public:
bool VerifyOptions(CommandReturnObject &result);
- // Verify that the options given are in the options table and can
- // be used together, but there may be some required options that are
- // missing (used to verify options that get folded into command aliases).
+ // Verify that the options given are in the options table and can be used
+ // together, but there may be some required options that are missing (used to
+ // verify options that get folded into command aliases).
bool VerifyPartialOptions(CommandReturnObject &result);
void OutputFormattedUsageText(Stream &strm,
@@ -157,20 +105,50 @@ public:
bool SupportsLongOption(const char *long_option);
- // The following two pure virtual functions must be defined by every
- // class that inherits from this class.
+ // The following two pure virtual functions must be defined by every class
+ // that inherits from this class.
virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() {
return llvm::ArrayRef<OptionDefinition>();
}
- // Call this prior to parsing any options. This call will call the
- // subclass OptionParsingStarting() and will avoid the need for all
+ // Call this prior to parsing any options. This call will call the subclass
+ // OptionParsingStarting() and will avoid the need for all
// OptionParsingStarting() function instances from having to call the
- // Option::OptionParsingStarting() like they did before. This was error
- // prone and subclasses shouldn't have to do it.
+ // Option::OptionParsingStarting() like they did before. This was error prone
+ // and subclasses shouldn't have to do it.
void NotifyOptionParsingStarting(ExecutionContext *execution_context);
+ //------------------------------------------------------------------
+ /// Parse the provided arguments.
+ ///
+ /// The parsed options are set via calls to SetOptionValue. In case of a
+ /// successful parse, the function returns a copy of the input arguments
+ /// with the parsed options removed. Otherwise, it returns an error.
+ ///
+ /// param[in] platform_sp
+ /// The platform used for option validation. This is necessary
+ /// because an empty execution_context is not enough to get us
+ /// to a reasonable platform. If the platform isn't given,
+ /// we'll try to get it from the execution context. If we can't
+ /// get it from the execution context, we'll skip validation.
+ ///
+ /// param[in] require_validation
+ /// When true, it will fail option parsing if validation could
+ /// not occur due to not having a platform.
+ //------------------------------------------------------------------
+ llvm::Expected<Args> Parse(const Args &args,
+ ExecutionContext *execution_context,
+ lldb::PlatformSP platform_sp,
+ bool require_validation);
+
+ llvm::Expected<Args> ParseAlias(const Args &args,
+ OptionArgVector *option_arg_vector,
+ std::string &input_line);
+
+ OptionElementVector ParseForCompletion(const Args &args,
+ uint32_t cursor_index);
+
Status NotifyOptionParsingFinished(ExecutionContext *execution_context);
//------------------------------------------------------------------
@@ -196,99 +174,48 @@ public:
ExecutionContext *execution_context) = 0;
//------------------------------------------------------------------
- /// Handles the generic bits of figuring out whether we are in an
- /// option, and if so completing it.
- ///
- /// @param[in] input
- /// The command line parsed into words
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] char_pos
- /// The character position of the cursor in its argument word.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of
- /// how these work.
+ /// @param[in/out] request
+ /// The completion request that we need to act upon.
///
/// @param[in] interpreter
/// The interpreter that's doing the completing.
///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will be
- /// inserted after the completion.) \b false otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
- ///
/// FIXME: This is the wrong return value, since we also need to
- /// make a distinction between total number of matches, and the
- /// window the user wants returned.
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
///
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
- bool HandleOptionCompletion(Args &input, OptionElementVector &option_map,
- int cursor_index, int char_pos,
- int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter,
- bool &word_complete,
- lldb_private::StringList &matches);
+ bool HandleOptionCompletion(lldb_private::CompletionRequest &request,
+ OptionElementVector &option_map,
+ CommandInterpreter &interpreter);
//------------------------------------------------------------------
- /// Handles the generic bits of figuring out whether we are in an
- /// option, and if so completing it.
- ///
- /// @param[in] interpreter
- /// The command interpreter doing the completion.
- ///
- /// @param[in] input
- /// The command line parsed into words
- ///
- /// @param[in] cursor_index
- /// The index in \ainput of the word in which the cursor lies.
- ///
- /// @param[in] char_pos
- /// The character position of the cursor in its argument word.
+ /// Handles the generic bits of figuring out whether we are in an option,
+ /// and if so completing it.
///
- /// @param[in] opt_element_vector
- /// The results of the options parse of \a input.
- ///
- /// @param[in] opt_element_index
- /// The position in \a opt_element_vector of the word in \a
- /// input containing the cursor.
- ///
- /// @param[in] match_start_point
- /// @param[in] match_return_elements
- /// See CommandObject::HandleCompletions for a description of
- /// how these work.
+ /// @param[in/out] request
+ /// The completion request that we need to act upon.
///
/// @param[in] interpreter
- /// The command interpreter in which we're doing completion.
- ///
- /// @param[out] word_complete
- /// \btrue if this is a complete option value (a space will
- /// be inserted after the completion.) \bfalse otherwise.
- ///
- /// @param[out] matches
- /// The array of matches returned.
+ /// The command interpreter doing the completion.
///
/// FIXME: This is the wrong return value, since we also need to
- /// make a distinction between total number of matches, and the
- /// window the user wants returned.
+ /// make a distinction between total number of matches, and the window the
+ /// user wants returned.
///
/// @return
/// \btrue if we were in an option, \bfalse otherwise.
//------------------------------------------------------------------
virtual bool
- HandleOptionArgumentCompletion(Args &input, int cursor_index, int char_pos,
+ HandleOptionArgumentCompletion(lldb_private::CompletionRequest &request,
OptionElementVector &opt_element_vector,
- int opt_element_index, int match_start_point,
- int max_return_elements,
- CommandInterpreter &interpreter,
- bool &word_complete, StringList &matches);
+ int opt_element_index,
+ CommandInterpreter &interpreter);
protected:
// This is a set of options expressed as indexes into the options table for
@@ -319,14 +246,14 @@ protected:
void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b,
OptionSet &union_set);
- // Subclasses must reset their option values prior to starting a new
- // option parse. Each subclass must override this function and revert
- // all option settings to default values.
+ // Subclasses must reset their option values prior to starting a new option
+ // parse. Each subclass must override this function and revert all option
+ // settings to default values.
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
- // If subclasses need to know when the options are done being parsed
- // they can implement this function to do extra checking
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
Status error;
return error;
}
@@ -347,8 +274,8 @@ public:
virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0;
virtual Status OptionParsingFinished(ExecutionContext *execution_context) {
- // If subclasses need to know when the options are done being parsed
- // they can implement this function to do extra checking
+ // If subclasses need to know when the options are done being parsed they
+ // can implement this function to do extra checking
Status error;
return error;
}
@@ -364,8 +291,8 @@ public:
//----------------------------------------------------------------------
/// Append options from a OptionGroup class.
///
- /// Append all options from \a group using the exact same option groups
- /// that each option is defined with.
+ /// Append all options from \a group using the exact same option groups that
+ /// each option is defined with.
///
/// @param[in] group
/// A group of options to take option values from and copy their
@@ -376,9 +303,9 @@ public:
//----------------------------------------------------------------------
/// Append options from a OptionGroup class.
///
- /// Append options from \a group that have a usage mask that has any bits
- /// in "src_mask" set. After the option definition is copied into the
- /// options definitions in this class, set the usage_mask to "dst_mask".
+ /// Append options from \a group that have a usage mask that has any bits in
+ /// "src_mask" set. After the option definition is copied into the options
+ /// definitions in this class, set the usage_mask to "dst_mask".
///
/// @param[in] group
/// A group of options to take option values from and copy their
diff --git a/include/lldb/Interpreter/ScriptInterpreter.h b/include/lldb/Interpreter/ScriptInterpreter.h
index 335231cb29ec..d2189edd04a6 100644
--- a/include/lldb/Interpreter/ScriptInterpreter.h
+++ b/include/lldb/Interpreter/ScriptInterpreter.h
@@ -96,13 +96,13 @@ public:
virtual bool Interrupt() { return false; }
virtual bool ExecuteOneLine(
- const char *command, CommandReturnObject *result,
+ llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) = 0;
virtual void ExecuteInterpreterLoop() = 0;
virtual bool ExecuteOneLineWithReturn(
- const char *in_string, ScriptReturnType return_type, void *ret_value,
+ llvm::StringRef in_string, ScriptReturnType return_type, void *ret_value,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) {
return true;
}
@@ -343,7 +343,7 @@ public:
}
virtual bool
- RunScriptBasedCommand(const char *impl_function, const char *args,
+ RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj,
Status &error,
@@ -351,12 +351,11 @@ public:
return false;
}
- virtual bool
- RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, const char *args,
- ScriptedCommandSynchronicity synchronicity,
- lldb_private::CommandReturnObject &cmd_retobj,
- Status &error,
- const lldb_private::ExecutionContext &exe_ctx) {
+ virtual bool RunScriptBasedCommand(
+ StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
+ ScriptedCommandSynchronicity synchronicity,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
+ const lldb_private::ExecutionContext &exe_ctx) {
return false;
}
diff --git a/include/lldb/Symbol/Block.h b/include/lldb/Symbol/Block.h
index a5387cca21c5..1664362431f9 100644
--- a/include/lldb/Symbol/Block.h
+++ b/include/lldb/Symbol/Block.h
@@ -30,21 +30,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Block Block.h "lldb/Symbol/Block.h"
-/// @brief A class that describes a single lexical block.
+/// A class that describes a single lexical block.
///
/// A Function object owns a BlockList object which owns one or more
-/// Block objects. The BlockList object contains a section offset
-/// address range, and Block objects contain one or more ranges
-/// which are offsets into that range. Blocks are can have discontiguous
-/// ranges within the BlockList address range, and each block can
-/// contain child blocks each with their own sets of ranges.
+/// Block objects. The BlockList object contains a section offset address
+/// range, and Block objects contain one or more ranges which are offsets into
+/// that range. Blocks are can have discontiguous ranges within the BlockList
+/// address range, and each block can contain child blocks each with their own
+/// sets of ranges.
///
-/// Each block has a variable list that represents local, argument, and
-/// static variables that are scoped to the block.
+/// Each block has a variable list that represents local, argument, and static
+/// variables that are scoped to the block.
///
-/// Inlined functions are represented by attaching a
-/// InlineFunctionInfo shared pointer object to a block. Inlined
-/// functions are represented as named blocks.
+/// Inlined functions are represented by attaching a InlineFunctionInfo shared
+/// pointer object to a block. Inlined functions are represented as named
+/// blocks.
//----------------------------------------------------------------------
class Block : public UserID, public SymbolContextScope {
public:
@@ -54,10 +54,9 @@ public:
//------------------------------------------------------------------
/// Construct with a User ID \a uid, \a depth.
///
- /// Initialize this block with the specified UID \a uid. The
- /// \a depth in the \a block_list is used to represent the parent,
- /// sibling, and child block information and also allows for partial
- /// parsing at the block level.
+ /// Initialize this block with the specified UID \a uid. The \a depth in the
+ /// \a block_list is used to represent the parent, sibling, and child block
+ /// information and also allows for partial parsing at the block level.
///
/// @param[in] uid
/// The UID for a given block. This value is given by the
@@ -146,8 +145,7 @@ public:
bool Contains(const Range &range) const;
//------------------------------------------------------------------
- /// Check if this object contains "block" as a child block at any
- /// depth.
+ /// Check if this object contains "block" as a child block at any depth.
///
/// @param[in] block
/// A potential child block.
@@ -256,8 +254,8 @@ public:
lldb::VariableListSP GetBlockVariableList(bool can_create);
//------------------------------------------------------------------
- /// Get the variable list for this block and optionally all child
- /// blocks if \a get_child_variables is \b true.
+ /// Get the variable list for this block and optionally all child blocks if
+ /// \a get_child_variables is \b true.
///
/// @param[in] get_child_variables
/// If \b true, all variables from all child blocks will be
@@ -286,8 +284,8 @@ public:
VariableList *variable_list);
//------------------------------------------------------------------
- /// Appends the variables from this block, and optionally from all
- /// parent blocks, to \a variable_list.
+ /// Appends the variables from this block, and optionally from all parent
+ /// blocks, to \a variable_list.
///
/// @param[in] can_create
/// If \b true, the variables can be parsed if they already
@@ -334,8 +332,8 @@ public:
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Returns the cost of this object plus any owned objects from the
- /// ranges, variables, and inline function information.
+ /// Returns the cost of this object plus any owned objects from the ranges,
+ /// variables, and inline function information.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -374,9 +372,8 @@ public:
//------------------------------------------------------------------
/// Set accessor for the variable list.
///
- /// Called by the SymbolFile plug-ins after they have parsed the
- /// variable lists and are ready to hand ownership of the list over
- /// to this object.
+ /// Called by the SymbolFile plug-ins after they have parsed the variable
+ /// lists and are ready to hand ownership of the list over to this object.
///
/// @param[in] variable_list_sp
/// A shared pointer to a VariableList.
@@ -403,8 +400,8 @@ public:
uint32_t GetRangeIndexContainingAddress(const Address &addr);
//------------------------------------------------------------------
- // Since blocks might have multiple discontiguous address ranges,
- // we need to be able to get at any of the address ranges in a block.
+ // Since blocks might have multiple discontiguous address ranges, we need to
+ // be able to get at any of the address ranges in a block.
//------------------------------------------------------------------
bool GetRangeAtIndex(uint32_t range_idx, AddressRange &range);
diff --git a/include/lldb/Symbol/ClangASTContext.h b/include/lldb/Symbol/ClangASTContext.h
index 2d2c804eb025..9364149d98e7 100644
--- a/include/lldb/Symbol/ClangASTContext.h
+++ b/include/lldb/Symbol/ClangASTContext.h
@@ -253,6 +253,9 @@ public:
&type_fields,
bool packed = false);
+ static bool IsOperator(const char *name,
+ clang::OverloadedOperatorKind &op_kind);
+
//------------------------------------------------------------------
// Structure, Unions, Classes
//------------------------------------------------------------------
@@ -302,6 +305,9 @@ public:
lldb::AccessType access_type, const char *class_name,
int kind, const TemplateParameterInfos &infos);
+ clang::TemplateTemplateParmDecl *
+ CreateTemplateTemplateParmDecl(const char *template_name);
+
clang::ClassTemplateSpecializationDecl *CreateClassTemplateSpecializationDecl(
clang::DeclContext *decl_ctx,
clang::ClassTemplateDecl *class_template_decl, int kind,
@@ -632,8 +638,7 @@ public:
//----------------------------------------------------------------------
// Using the current type, create a new typedef to that type using
- // "typedef_name"
- // as the name and "decl_ctx" as the decl context.
+ // "typedef_name" as the name and "decl_ctx" as the decl context.
static CompilerType
CreateTypedefType(const CompilerType &type, const char *typedef_name,
const CompilerDeclContext &compiler_decl_ctx);
@@ -650,8 +655,7 @@ public:
GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) override;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type,
@@ -763,8 +767,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) override;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
bool omit_empty_base_classes) override;
@@ -794,8 +798,8 @@ public:
CompilerType GetTypeForFormatters(void *type) override;
#define LLDB_INVALID_DECL_LEVEL UINT32_MAX
- // LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if
- // child_decl_ctx could not be found in decl_ctx.
+ // LLDB_INVALID_DECL_LEVEL is returned by CountDeclLevels if child_decl_ctx
+ // could not be found in decl_ctx.
uint32_t CountDeclLevels(clang::DeclContext *frame_decl_ctx,
clang::DeclContext *child_decl_ctx,
ConstString *child_name = nullptr,
@@ -821,6 +825,7 @@ public:
clang::CXXMethodDecl *
AddMethodToCXXRecordType(lldb::opaque_compiler_type_t type, const char *name,
+ const char *mangled_name,
const CompilerType &method_type,
lldb::AccessType access, bool is_virtual,
bool is_static, bool is_inline, bool is_explicit,
@@ -885,13 +890,13 @@ public:
// Pointers & References
//------------------------------------------------------------------
- // Call this function using the class type when you want to make a
- // member pointer type to pointee_type.
+ // Call this function using the class type when you want to make a member
+ // pointer type to pointee_type.
static CompilerType CreateMemberPointerType(const CompilerType &type,
const CompilerType &pointee_type);
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
size_t dst_size) override;
diff --git a/include/lldb/Symbol/ClangASTImporter.h b/include/lldb/Symbol/ClangASTImporter.h
index 6823ad748282..52a164a1d2dd 100644
--- a/include/lldb/Symbol/ClangASTImporter.h
+++ b/include/lldb/Symbol/ClangASTImporter.h
@@ -250,13 +250,12 @@ private:
// recorded and placed into the decls_to_deport set.
//
// A call to "ExecuteDeportWorkQueues" completes all the Decls that
- // are in decls_to_deport, adding any Decls it sees along the way that
- // it hasn't already deported. It proceeds until decls_to_deport is
- // empty.
+ // are in decls_to_deport, adding any Decls it sees along the way that it
+ // hasn't already deported. It proceeds until decls_to_deport is empty.
//
- // These calls must be paired. Leaving a minion in deport mode or
- // trying to start deport minion with a new pair of queues will result
- // in an assertion failure.
+ // These calls must be paired. Leaving a minion in deport mode or trying
+ // to start deport minion with a new pair of queues will result in an
+ // assertion failure.
void
InitDeportWorkQueues(std::set<clang::NamedDecl *> *decls_to_deport,
diff --git a/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h b/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
index 61bbc122dd5f..ef0010314e1d 100644
--- a/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
+++ b/include/lldb/Symbol/ClangExternalASTSourceCallbacks.h
@@ -60,21 +60,21 @@ public:
//------------------------------------------------------------------
clang::Decl *GetExternalDecl(uint32_t ID) override {
- // This method only needs to be implemented if the AST source ever
- // passes back decl sets as VisibleDeclaration objects.
+ // This method only needs to be implemented if the AST source ever passes
+ // back decl sets as VisibleDeclaration objects.
return nullptr;
}
clang::Stmt *GetExternalDeclStmt(uint64_t Offset) override {
- // This operation is meant to be used via a LazyOffsetPtr. It only
- // needs to be implemented if the AST source uses methods like
+ // This operation is meant to be used via a LazyOffsetPtr. It only needs
+ // to be implemented if the AST source uses methods like
// FunctionDecl::setLazyBody when building decls.
return nullptr;
}
clang::Selector GetExternalSelector(uint32_t ID) override {
- // This operation only needs to be implemented if the AST source
- // returns non-zero for GetNumKnownSelectors().
+ // This operation only needs to be implemented if the AST source returns
+ // non-zero for GetNumKnownSelectors().
return clang::Selector();
}
diff --git a/include/lldb/Symbol/CompactUnwindInfo.h b/include/lldb/Symbol/CompactUnwindInfo.h
index 630067241735..711420f66a46 100644
--- a/include/lldb/Symbol/CompactUnwindInfo.h
+++ b/include/lldb/Symbol/CompactUnwindInfo.h
@@ -22,23 +22,18 @@
namespace lldb_private {
// Compact Unwind info is an unwind format used on Darwin. The unwind
-// instructions
-// for typical compiler-generated functions can be expressed in a 32-bit
-// encoding.
-// The format includes a two-level index so the unwind information for a
-// function
-// can be found by two binary searches in the section. It can represent both
-// stack frames that use a frame-pointer register and frameless functions, on
-// i386/x86_64 for instance. When a function is too complex to be represented
-// in
-// the compact unwind format, it calls out to eh_frame unwind instructions.
+// instructions for typical compiler-generated functions can be expressed in a
+// 32-bit encoding. The format includes a two-level index so the unwind
+// information for a function can be found by two binary searches in the
+// section. It can represent both stack frames that use a frame-pointer
+// register and frameless functions, on i386/x86_64 for instance. When a
+// function is too complex to be represented in the compact unwind format, it
+// calls out to eh_frame unwind instructions.
// On Mac OS X / iOS, a function will have either a compact unwind
-// representation
-// or an eh_frame representation. If lldb is going to benefit from the
-// compiler's
-// description about saved register locations, it must be able to read both
-// sources of information.
+// representation or an eh_frame representation. If lldb is going to benefit
+// from the compiler's description about saved register locations, it must be
+// able to read both sources of information.
class CompactUnwindInfo {
public:
@@ -54,9 +49,8 @@ private:
// The top level index entries of the compact unwind info
// (internal representation of struct
// unwind_info_section_header_index_entry)
- // There are relatively few of these (one per 500/1000 functions, depending on
- // format) so
- // creating them on first scan will not be too costly.
+ // There are relatively few of these (one per 500/1000 functions, depending
+ // on format) so creating them on first scan will not be too costly.
struct UnwindIndex {
uint32_t function_offset; // The offset of the first function covered by
// this index
@@ -84,8 +78,7 @@ private:
};
// An internal object used to store the information we retrieve about a
- // function --
- // the encoding bits and possibly the LSDA/personality function.
+ // function -- the encoding bits and possibly the LSDA/personality function.
struct FunctionInfo {
uint32_t encoding; // compact encoding 32-bit value for this function
Address lsda_address; // the address of the LSDA data for this function
diff --git a/include/lldb/Symbol/CompileUnit.h b/include/lldb/Symbol/CompileUnit.h
index e7a1ebc8c00f..b816439cee13 100644
--- a/include/lldb/Symbol/CompileUnit.h
+++ b/include/lldb/Symbol/CompileUnit.h
@@ -21,16 +21,16 @@
namespace lldb_private {
//----------------------------------------------------------------------
/// @class CompileUnit CompileUnit.h "lldb/Symbol/CompileUnit.h"
-/// @brief A class that describes a compilation unit.
+/// A class that describes a compilation unit.
///
/// A representation of a compilation unit, or compiled source file.
-/// The UserID of the compile unit is specified by the SymbolFile
-/// plug-in and can have any value as long as the value is unique
-/// within the Module that owns this compile units.
+/// The UserID of the compile unit is specified by the SymbolFile plug-in and
+/// can have any value as long as the value is unique within the Module that
+/// owns this compile units.
///
-/// Each compile unit has a list of functions, global and static
-/// variables, support file list (include files and inlined source
-/// files), and a line table.
+/// Each compile unit has a list of functions, global and static variables,
+/// support file list (include files and inlined source files), and a line
+/// table.
//----------------------------------------------------------------------
class CompileUnit : public std::enable_shared_from_this<CompileUnit>,
public ModuleChild,
@@ -41,9 +41,9 @@ public:
//------------------------------------------------------------------
/// Construct with a module, path, UID and language.
///
- /// Initialize the compile unit given the owning \a module, a path
- /// to convert into a FileSpec, the SymbolFile plug-in supplied
- /// \a uid, and the source language type.
+ /// Initialize the compile unit given the owning \a module, a path to
+ /// convert into a FileSpec, the SymbolFile plug-in supplied \a uid, and the
+ /// source language type.
///
/// @param[in] module
/// The parent module that owns this compile unit. This value
@@ -81,9 +81,9 @@ public:
//------------------------------------------------------------------
/// Construct with a module, file spec, UID and language.
///
- /// Initialize the compile unit given the owning \a module, a path
- /// to convert into a FileSpec, the SymbolFile plug-in supplied
- /// \a uid, and the source language type.
+ /// Initialize the compile unit given the owning \a module, a path to
+ /// convert into a FileSpec, the SymbolFile plug-in supplied \a uid, and the
+ /// source language type.
///
/// @param[in] module
/// The parent module that owns this compile unit. This value
@@ -127,8 +127,8 @@ public:
//------------------------------------------------------------------
/// Add a function to this compile unit.
///
- /// Typically called by the SymbolFile plug-ins as they partially
- /// parse the debug information.
+ /// Typically called by the SymbolFile plug-ins as they partially parse the
+ /// debug information.
///
/// @param[in] function_sp
/// A shared pointer to the Function object.
@@ -163,13 +163,12 @@ public:
void GetDescription(Stream *s, lldb::DescriptionLevel level) const;
//------------------------------------------------------------------
- /// Get a shared pointer to a function in this compile unit by
- /// index.
+ /// Get a shared pointer to a function in this compile unit by index.
///
- /// Typically called when iterating though all functions in a
- /// compile unit after all functions have been parsed. This provides
- /// raw access to the function shared pointer list and will not
- /// cause the SymbolFile plug-in to parse any unparsed functions.
+ /// Typically called when iterating though all functions in a compile unit
+ /// after all functions have been parsed. This provides raw access to the
+ /// function shared pointer list and will not cause the SymbolFile plug-in
+ /// to parse any unparsed functions.
///
/// @param[in] idx
/// An index into the function list.
@@ -195,16 +194,15 @@ public:
//------------------------------------------------------------------
/// Find the line entry by line and optional inlined file spec.
///
- /// Finds the first line entry that has an index greater than
- /// \a start_idx that matches \a line. If \a file_spec_ptr
- /// is NULL, then the search matches line entries whose file matches
- /// the file for the compile unit. If \a file_spec_ptr is
- /// not NULL, line entries must match the specified file spec (for
- /// inlined line table entries).
+ /// Finds the first line entry that has an index greater than \a start_idx
+ /// that matches \a line. If \a file_spec_ptr is NULL, then the search
+ /// matches line entries whose file matches the file for the compile unit.
+ /// If \a file_spec_ptr is not NULL, line entries must match the specified
+ /// file spec (for inlined line table entries).
///
- /// Multiple calls to this function can find all entries that match
- /// a given file and line by starting with \a start_idx equal to zero,
- /// and calling this function back with the return value + 1.
+ /// Multiple calls to this function can find all entries that match a given
+ /// file and line by starting with \a start_idx equal to zero, and calling
+ /// this function back with the return value + 1.
///
/// @param[in] start_idx
/// The zero based index at which to start looking for matches.
@@ -237,10 +235,9 @@ public:
//------------------------------------------------------------------
/// Get the line table for the compile unit.
///
- /// Called by clients and the SymbolFile plug-in. The SymbolFile
- /// plug-ins use this function to determine if the line table has
- /// be parsed yet. Clients use this function to get the line table
- /// from a compile unit.
+ /// Called by clients and the SymbolFile plug-in. The SymbolFile plug-ins
+ /// use this function to determine if the line table has be parsed yet.
+ /// Clients use this function to get the line table from a compile unit.
///
/// @return
/// The line table object pointer, or NULL if this line table
@@ -253,8 +250,8 @@ public:
//------------------------------------------------------------------
/// Get the compile unit's support file list.
///
- /// The support file list is used by the line table, and any objects
- /// that have valid Declaration objects.
+ /// The support file list is used by the line table, and any objects that
+ /// have valid Declaration objects.
///
/// @return
/// A support file list object.
@@ -264,8 +261,8 @@ public:
//------------------------------------------------------------------
/// Get the compile unit's imported module list.
///
- /// This reports all the imports that the compile unit made,
- /// including the current module.
+ /// This reports all the imports that the compile unit made, including the
+ /// current module.
///
/// @return
/// A list of imported module names.
@@ -275,9 +272,8 @@ public:
//------------------------------------------------------------------
/// Get the SymbolFile plug-in user data.
///
- /// SymbolFile plug-ins can store user data to internal state or
- /// objects to quickly allow them to parse more information for a
- /// given object.
+ /// SymbolFile plug-ins can store user data to internal state or objects to
+ /// quickly allow them to parse more information for a given object.
///
/// @return
/// The user data stored with the CompileUnit when it was
@@ -288,9 +284,9 @@ public:
//------------------------------------------------------------------
/// Get the variable list for a compile unit.
///
- /// Called by clients to get the variable list for a compile unit.
- /// The variable list will contain all global and static variables
- /// that were defined at the compile unit level.
+ /// Called by clients to get the variable list for a compile unit. The
+ /// variable list will contain all global and static variables that were
+ /// defined at the compile unit level.
///
/// @param[in] can_create
/// If \b true, the variable list will be parsed on demand. If
@@ -309,9 +305,8 @@ public:
//------------------------------------------------------------------
/// Finds a function by user ID.
///
- /// Typically used by SymbolFile plug-ins when partially parsing
- /// the debug information to see if the function has been parsed
- /// yet.
+ /// Typically used by SymbolFile plug-ins when partially parsing the debug
+ /// information to see if the function has been parsed yet.
///
/// @param[in] uid
/// The user ID of the function to find. This value is supplied
@@ -328,10 +323,9 @@ public:
//------------------------------------------------------------------
/// Set the line table for the compile unit.
///
- /// Called by the SymbolFile plug-in when if first parses the line
- /// table and hands ownership of the line table to this object. The
- /// compile unit owns the line table object and will delete the
- /// object when it is deleted.
+ /// Called by the SymbolFile plug-in when if first parses the line table and
+ /// hands ownership of the line table to this object. The compile unit owns
+ /// the line table object and will delete the object when it is deleted.
///
/// @param[in] line_table
/// A line table object pointer that this object now owns.
@@ -343,9 +337,8 @@ public:
//------------------------------------------------------------------
/// Set accessor for the variable list.
///
- /// Called by the SymbolFile plug-ins after they have parsed the
- /// variable lists and are ready to hand ownership of the list over
- /// to this object.
+ /// Called by the SymbolFile plug-ins after they have parsed the variable
+ /// lists and are ready to hand ownership of the list over to this object.
///
/// @param[in] variable_list_sp
/// A shared pointer to a VariableList.
@@ -355,9 +348,8 @@ public:
//------------------------------------------------------------------
/// Resolve symbol contexts by file and line.
///
- /// Given a file in \a file_spec, and a line number, find all
- /// instances and append them to the supplied symbol context list
- /// \a sc_list.
+ /// Given a file in \a file_spec, and a line number, find all instances and
+ /// append them to the supplied symbol context list \a sc_list.
///
/// @param[in] file_spec
/// A file specification. If \a file_spec contains no directory
@@ -405,10 +397,10 @@ public:
//------------------------------------------------------------------
/// Get whether compiler optimizations were enabled for this compile unit
///
- /// "optimized" means that the debug experience may be difficult
- /// for the user to understand. Variables may not be available when
- /// the developer would expect them, stepping through the source lines
- /// in the function may appear strange, etc.
+ /// "optimized" means that the debug experience may be difficult for the
+ /// user to understand. Variables may not be available when the developer
+ /// would expect them, stepping through the source lines in the function may
+ /// appear strange, etc.
///
/// @return
/// Returns 'true' if this compile unit was compiled with
diff --git a/include/lldb/Symbol/CompilerType.h b/include/lldb/Symbol/CompilerType.h
index 70d56db7fc21..1170832a7396 100644
--- a/include/lldb/Symbol/CompilerType.h
+++ b/include/lldb/Symbol/CompilerType.h
@@ -28,13 +28,12 @@ class DataExtractor;
//----------------------------------------------------------------------
// A class that can carry around a clang ASTContext and a opaque clang
-// QualType. A clang::QualType can be easily reconstructed from an
-// opaque clang type and often the ASTContext is needed when doing
-// various type related tasks, so this class allows both items to travel
-// in a single very lightweight class that can be used. There are many
-// static equivalents of the member functions that allow the ASTContext
-// and the opaque clang QualType to be specified for ease of use and
-// to avoid code duplication.
+// QualType. A clang::QualType can be easily reconstructed from an opaque clang
+// type and often the ASTContext is needed when doing various type related
+// tasks, so this class allows both items to travel in a single very
+// lightweight class that can be used. There are many static equivalents of the
+// member functions that allow the ASTContext and the opaque clang QualType to
+// be specified for ease of use and to avoid code duplication.
//----------------------------------------------------------------------
class CompilerType {
public:
@@ -206,8 +205,7 @@ public:
CompilerType GetFullyUnqualifiedType() const;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount() const;
CompilerType GetFunctionArgumentTypeAtIndex(size_t idx) const;
@@ -220,14 +218,14 @@ public:
//----------------------------------------------------------------------
// If this type is a reference to a type (L value or R value reference),
- // return a new type with the reference removed, else return the current
- // type itself.
+ // return a new type with the reference removed, else return the current type
+ // itself.
//----------------------------------------------------------------------
CompilerType GetNonReferenceType() const;
//----------------------------------------------------------------------
- // If this type is a pointer type, return the type that the pointer
- // points to, else return an invalid type.
+ // If this type is a pointer type, return the type that the pointer points
+ // to, else return an invalid type.
//----------------------------------------------------------------------
CompilerType GetPointeeType() const;
@@ -237,44 +235,44 @@ public:
CompilerType GetPointerType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType that is a L value reference to this type if
- // this type is valid and the type system supports L value references,
- // else return an invalid type.
+ // Return a new CompilerType that is a L value reference to this type if this
+ // type is valid and the type system supports L value references, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType GetLValueReferenceType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType that is a R value reference to this type if
- // this type is valid and the type system supports R value references,
- // else return an invalid type.
+ // Return a new CompilerType that is a R value reference to this type if this
+ // type is valid and the type system supports R value references, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType GetRValueReferenceType() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a const modifier to this type if
- // this type is valid and the type system supports const modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a const modifier to this type if this type
+ // is valid and the type system supports const modifiers, else return an
+ // invalid type.
//----------------------------------------------------------------------
CompilerType AddConstModifier() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a volatile modifier to this type if
- // this type is valid and the type system supports volatile modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a volatile modifier to this type if this
+ // type is valid and the type system supports volatile modifiers, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType AddVolatileModifier() const;
//----------------------------------------------------------------------
- // Return a new CompilerType adds a restrict modifier to this type if
- // this type is valid and the type system supports restrict modifiers,
- // else return an invalid type.
+ // Return a new CompilerType adds a restrict modifier to this type if this
+ // type is valid and the type system supports restrict modifiers, else return
+ // an invalid type.
//----------------------------------------------------------------------
CompilerType AddRestrictModifier() const;
//----------------------------------------------------------------------
- // Create a typedef to this type using "name" as the name of the typedef
- // this type is valid and the type system supports typedefs, else return
- // an invalid type.
+ // Create a typedef to this type using "name" as the name of the typedef this
+ // type is valid and the type system supports typedefs, else return an
+ // invalid type.
//----------------------------------------------------------------------
CompilerType CreateTypedef(const char *name,
const CompilerDeclContext &decl_ctx) const;
@@ -311,8 +309,8 @@ public:
//----------------------------------------------------------------------
// If this type is an enumeration, iterate through all of its enumerators
- // using a callback. If the callback returns true, keep iterating, else
- // abort the iteration.
+ // using a callback. If the callback returns true, keep iterating, else abort
+ // the iteration.
//----------------------------------------------------------------------
void ForEachEnumerator(
std::function<bool(const CompilerType &integer_type,
@@ -351,8 +349,8 @@ public:
bool &child_is_deref_of_parent, ValueObject *valobj,
uint64_t &language_flags) const;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(const char *name,
bool omit_empty_base_classes) const;
@@ -385,8 +383,8 @@ public:
// Pointers & References
//------------------------------------------------------------------
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(const char *s, uint8_t *dst,
size_t dst_size) const;
diff --git a/include/lldb/Symbol/DWARFCallFrameInfo.h b/include/lldb/Symbol/DWARFCallFrameInfo.h
index a1bd1bc8b1c9..133c66d4ae4f 100644
--- a/include/lldb/Symbol/DWARFCallFrameInfo.h
+++ b/include/lldb/Symbol/DWARFCallFrameInfo.h
@@ -25,12 +25,12 @@
namespace lldb_private {
-// DWARFCallFrameInfo is a class which can read eh_frame and DWARF
-// Call Frame Information FDEs. It stores little information internally.
-// Only two APIs are exported - one to find the high/low pc values
-// of a function given a text address via the information in the
-// eh_frame / debug_frame, and one to generate an UnwindPlan based
-// on the FDE in the eh_frame / debug_frame section.
+// DWARFCallFrameInfo is a class which can read eh_frame and DWARF Call Frame
+// Information FDEs. It stores little information internally. Only two APIs
+// are exported - one to find the high/low pc values of a function given a text
+// address via the information in the eh_frame / debug_frame, and one to
+// generate an UnwindPlan based on the FDE in the eh_frame / debug_frame
+// section.
class DWARFCallFrameInfo {
public:
@@ -40,13 +40,13 @@ public:
~DWARFCallFrameInfo() = default;
- // Locate an AddressRange that includes the provided Address in this
- // object's eh_frame/debug_info
- // Returns true if a range is found to cover that address.
+ // Locate an AddressRange that includes the provided Address in this object's
+ // eh_frame/debug_info Returns true if a range is found to cover that
+ // address.
bool GetAddressRange(Address addr, AddressRange &range);
- // Return an UnwindPlan based on the call frame information encoded
- // in the FDE of this DWARFCallFrameInfo section.
+ // Return an UnwindPlan based on the call frame information encoded in the
+ // FDE of this DWARFCallFrameInfo section.
bool GetUnwindPlan(Address addr, UnwindPlan &unwind_plan);
typedef RangeVector<lldb::addr_t, uint32_t> FunctionAddressAndSizeVector;
@@ -55,12 +55,11 @@ public:
// Build a vector of file address and size for all functions in this Module
// based on the eh_frame FDE entries.
//
- // The eh_frame information can be a useful source of file address and size of
- // the functions in a Module. Often a binary's non-exported symbols are
- // stripped
- // before shipping so lldb won't know the start addr / size of many functions
- // in the Module. But the eh_frame can help to give the addresses of these
- // stripped symbols, at least.
+ // The eh_frame information can be a useful source of file address and size
+ // of the functions in a Module. Often a binary's non-exported symbols are
+ // stripped before shipping so lldb won't know the start addr / size of many
+ // functions in the Module. But the eh_frame can help to give the addresses
+ // of these stripped symbols, at least.
//
// @param[out] function_info
// A vector provided by the caller is filled out. May be empty if no
@@ -112,10 +111,9 @@ private:
typedef std::map<dw_offset_t, CIESP> cie_map_t;
- // Start address (file address), size, offset of FDE location
- // used for finding an FDE for a given File address; the start address field
- // is
- // an offset into an individual Module.
+ // Start address (file address), size, offset of FDE location used for
+ // finding an FDE for a given File address; the start address field is an
+ // offset into an individual Module.
typedef RangeDataVector<lldb::addr_t, uint32_t, dw_offset_t> FDEEntryMap;
bool IsEHFrame() const;
@@ -133,8 +131,8 @@ private:
void GetCFIData();
// Applies the specified DWARF opcode to the given row. This function handle
- // the commands
- // operates only on a single row (these are the ones what can appear both in
+ // the commands operates only on a single row (these are the ones what can
+ // appear both in
// CIE and in FDE).
// Returns true if the opcode is handled and false otherwise.
bool HandleCommonDwarfOpcode(uint8_t primary_opcode, uint8_t extended_opcode,
diff --git a/include/lldb/Symbol/DeclVendor.h b/include/lldb/Symbol/DeclVendor.h
index f0ce9157cfa5..d1ccb4191cbc 100644
--- a/include/lldb/Symbol/DeclVendor.h
+++ b/include/lldb/Symbol/DeclVendor.h
@@ -20,9 +20,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// The Decl vendor class is intended as a generic interface to search
-// for named declarations that are not necessarily backed by a specific
-// symbol file.
+// The Decl vendor class is intended as a generic interface to search for named
+// declarations that are not necessarily backed by a specific symbol file.
//----------------------------------------------------------------------
class DeclVendor {
public:
diff --git a/include/lldb/Symbol/Declaration.h b/include/lldb/Symbol/Declaration.h
index 581176e23961..b654988bccd2 100644
--- a/include/lldb/Symbol/Declaration.h
+++ b/include/lldb/Symbol/Declaration.h
@@ -17,13 +17,12 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Declaration Declaration.h "lldb/Symbol/Declaration.h"
-/// @brief A class that describes the declaration location of a
+/// A class that describes the declaration location of a
/// lldb object.
///
-/// The declarations include the file specification, line number, and
-/// the column info and can help track where functions, blocks, inlined
-/// functions, types, variables, any many other debug core objects were
-/// declared.
+/// The declarations include the file specification, line number, and the
+/// column info and can help track where functions, blocks, inlined functions,
+/// types, variables, any many other debug core objects were declared.
//----------------------------------------------------------------------
class Declaration {
public:
@@ -92,8 +91,8 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Sets the file specification to be empty, and the line and column
- /// to zero.
+ /// Sets the file specification to be empty, and the line and column to
+ /// zero.
//------------------------------------------------------------------
void Clear() {
m_file.Clear();
@@ -106,9 +105,9 @@ public:
//------------------------------------------------------------------
/// Compare two declaration objects.
///
- /// Compares the two file specifications from \a lhs and \a rhs. If
- /// the file specifications are equal, then continue to compare the
- /// line number and column numbers respectively.
+ /// Compares the two file specifications from \a lhs and \a rhs. If the file
+ /// specifications are equal, then continue to compare the line number and
+ /// column numbers respectively.
///
/// @param[in] lhs
/// The Left Hand Side const Declaration object reference.
@@ -126,8 +125,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
diff --git a/include/lldb/Symbol/FuncUnwinders.h b/include/lldb/Symbol/FuncUnwinders.h
index 27f42cf425b2..ae8bcc892ce4 100644
--- a/include/lldb/Symbol/FuncUnwinders.h
+++ b/include/lldb/Symbol/FuncUnwinders.h
@@ -12,8 +12,8 @@ class UnwindTable;
class FuncUnwinders {
public:
- // FuncUnwinders objects are used to track UnwindPlans for a function
- // (named or not - really just an address range)
+ // FuncUnwinders objects are used to track UnwindPlans for a function (named
+ // or not - really just an address range)
// We'll record four different UnwindPlans for each address range:
//
@@ -28,8 +28,8 @@ public:
// available for some reason.
// Additionally, FuncUnwinds object can be asked where the prologue
- // instructions are finished for migrating breakpoints past the
- // stack frame setup instructions when we don't have line table information.
+ // instructions are finished for migrating breakpoints past the stack frame
+ // setup instructions when we don't have line table information.
FuncUnwinders(lldb_private::UnwindTable &unwind_table, AddressRange range);
@@ -38,10 +38,8 @@ public:
// current_offset is the byte offset into the function.
// 0 means no instructions have executed yet. -1 means the offset is unknown.
// On architectures where the pc points to the next instruction that will
- // execute, this
- // offset value will have already been decremented by 1 to stay within the
- // bounds of the
- // correct function body.
+ // execute, this offset value will have already been decremented by 1 to stay
+ // within the bounds of the correct function body.
lldb::UnwindPlanSP GetUnwindPlanAtCallSite(Target &target,
int current_offset);
@@ -69,24 +67,19 @@ public:
// A function may have a Language Specific Data Area specified -- a block of
// data in
// the object file which is used in the processing of an exception throw /
- // catch.
- // If any of the UnwindPlans have the address of the LSDA region for this
- // function,
- // this will return it.
+ // catch. If any of the UnwindPlans have the address of the LSDA region for
+ // this function, this will return it.
Address GetLSDAAddress(Target &target);
// A function may have a Personality Routine associated with it -- used in the
// processing of throwing an exception. If any of the UnwindPlans have the
- // address of the personality routine, this will return it. Read the
- // target-pointer
- // at this address to get the personality function address.
+ // address of the personality routine, this will return it. Read the target-
+ // pointer at this address to get the personality function address.
Address GetPersonalityRoutinePtrAddress(Target &target);
// The following methods to retrieve specific unwind plans should rarely be
- // used.
- // Instead, clients should ask for the *behavior* they are looking for, using
- // one
- // of the above UnwindPlan retrieval methods.
+ // used. Instead, clients should ask for the *behavior* they are looking for,
+ // using one of the above UnwindPlan retrieval methods.
lldb::UnwindPlanSP GetAssemblyUnwindPlan(Target &target, Thread &thread,
int current_offset);
@@ -116,11 +109,11 @@ public:
private:
lldb::UnwindAssemblySP GetUnwindAssemblyProfiler(Target &target);
- // Do a simplistic comparison for the register restore rule for getting
- // the caller's pc value on two UnwindPlans -- returns LazyBoolYes if
- // they have the same unwind rule for the pc, LazyBoolNo if they do not
- // have the same unwind rule for the pc, and LazyBoolCalculate if it was
- // unable to determine this for some reason.
+ // Do a simplistic comparison for the register restore rule for getting the
+ // caller's pc value on two UnwindPlans -- returns LazyBoolYes if they have
+ // the same unwind rule for the pc, LazyBoolNo if they do not have the same
+ // unwind rule for the pc, and LazyBoolCalculate if it was unable to
+ // determine this for some reason.
lldb_private::LazyBool CompareUnwindPlansForIdenticalInitialPCLocation(
Thread &thread, const lldb::UnwindPlanSP &a, const lldb::UnwindPlanSP &b);
@@ -143,8 +136,8 @@ private:
lldb::UnwindPlanSP m_unwind_plan_arch_default_sp;
lldb::UnwindPlanSP m_unwind_plan_arch_default_at_func_entry_sp;
- // Fetching the UnwindPlans can be expensive - if we've already attempted
- // to get one & failed, don't try again.
+ // Fetching the UnwindPlans can be expensive - if we've already attempted to
+ // get one & failed, don't try again.
bool m_tried_unwind_plan_assembly : 1, m_tried_unwind_plan_eh_frame : 1,
m_tried_unwind_plan_debug_frame : 1,
m_tried_unwind_plan_eh_frame_augmented : 1,
diff --git a/include/lldb/Symbol/Function.h b/include/lldb/Symbol/Function.h
index 9d376007a411..28c6b4857b10 100644
--- a/include/lldb/Symbol/Function.h
+++ b/include/lldb/Symbol/Function.h
@@ -21,10 +21,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FunctionInfo Function.h "lldb/Symbol/Function.h"
-/// @brief A class that contains generic function information.
+/// A class that contains generic function information.
///
-/// This provides generic function information that gets reused between
-/// inline functions and function types.
+/// This provides generic function information that gets reused between inline
+/// functions and function types.
//----------------------------------------------------------------------
class FunctionInfo {
public:
@@ -67,8 +67,8 @@ public:
//------------------------------------------------------------------
/// Compare two function information objects.
///
- /// First compares the method names, and if equal, then compares
- /// the declaration information.
+ /// First compares the method names, and if equal, then compares the
+ /// declaration information.
///
/// @param[in] lhs
/// The Left Hand Side const FunctionInfo object reference.
@@ -86,8 +86,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -141,13 +141,13 @@ protected:
//----------------------------------------------------------------------
/// @class InlineFunctionInfo Function.h "lldb/Symbol/Function.h"
-/// @brief A class that describes information for an inlined function.
+/// A class that describes information for an inlined function.
//----------------------------------------------------------------------
class InlineFunctionInfo : public FunctionInfo {
public:
//------------------------------------------------------------------
- /// Construct with the function method name, mangled name, and
- /// optional declaration information.
+ /// Construct with the function method name, mangled name, and optional
+ /// declaration information.
///
/// @param[in] name
/// A C string name for the method name for this function. This
@@ -171,8 +171,8 @@ public:
const Declaration *call_decl_ptr);
//------------------------------------------------------------------
- /// Construct with the function method name, mangled name, and
- /// optional declaration information.
+ /// Construct with the function method name, mangled name, and optional
+ /// declaration information.
///
/// @param[in] name
/// A name for the method name for this function. This value
@@ -202,8 +202,8 @@ public:
//------------------------------------------------------------------
/// Compare two inlined function information objects.
///
- /// First compares the FunctionInfo objects, and if equal,
- /// compares the mangled names.
+ /// First compares the FunctionInfo objects, and if equal, compares the
+ /// mangled names.
///
/// @param[in] lhs
/// The Left Hand Side const InlineFunctionInfo object
@@ -223,8 +223,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -292,17 +292,15 @@ private:
//----------------------------------------------------------------------
/// @class Function Function.h "lldb/Symbol/Function.h"
-/// @brief A class that describes a function.
+/// A class that describes a function.
///
-/// Functions belong to CompileUnit objects (Function::m_comp_unit),
-/// have unique user IDs (Function::UserID), know how to reconstruct
-/// their symbol context (Function::SymbolContextScope), have a
-/// specific function type (Function::m_type_uid), have a simple
-/// method name (FunctionInfo::m_name), be declared at a specific
-/// location (FunctionInfo::m_declaration), possibly have mangled
-/// names (Function::m_mangled), an optional return type
-/// (Function::m_type), and contains lexical blocks
-/// (Function::m_blocks).
+/// Functions belong to CompileUnit objects (Function::m_comp_unit), have
+/// unique user IDs (Function::UserID), know how to reconstruct their symbol
+/// context (Function::SymbolContextScope), have a specific function type
+/// (Function::m_type_uid), have a simple method name (FunctionInfo::m_name),
+/// be declared at a specific location (FunctionInfo::m_declaration), possibly
+/// have mangled names (Function::m_mangled), an optional return type
+/// (Function::m_type), and contains lexical blocks (Function::m_blocks).
///
/// The function information is split into a few pieces:
/// @li The concrete instance information
@@ -311,15 +309,14 @@ private:
/// The abstract information is found in the function type (Type) that
/// describes a function information, return type and parameter types.
///
-/// The concrete information is the address range information and
-/// specific locations for an instance of this function.
+/// The concrete information is the address range information and specific
+/// locations for an instance of this function.
//----------------------------------------------------------------------
class Function : public UserID, public SymbolContextScope {
public:
//------------------------------------------------------------------
- /// Construct with a compile unit, function UID, function type UID,
- /// optional mangled name, function type, and a section offset
- /// based address range.
+ /// Construct with a compile unit, function UID, function type UID, optional
+ /// mangled name, function type, and a section offset based address range.
///
/// @param[in] comp_unit
/// The compile unit to which this function belongs.
@@ -352,9 +349,8 @@ public:
Type *func_type, const AddressRange &range);
//------------------------------------------------------------------
- /// Construct with a compile unit, function UID, function type UID,
- /// optional mangled name, function type, and a section offset
- /// based address range.
+ /// Construct with a compile unit, function UID, function type UID, optional
+ /// mangled name, function type, and a section offset based address range.
///
/// @param[in] comp_unit
/// The compile unit to which this function belongs.
@@ -408,10 +404,10 @@ public:
lldb::LanguageType GetLanguage() const;
//------------------------------------------------------------------
- /// Find the file and line number of the source location of the start
- /// of the function. This will use the declaration if present and fall
- /// back on the line table if that fails. So there may NOT be a line
- /// table entry for this source file/line combo.
+ /// Find the file and line number of the source location of the start of the
+ /// function. This will use the declaration if present and fall back on the
+ /// line table if that fails. So there may NOT be a line table entry for
+ /// this source file/line combo.
///
/// @param[out] source_file
/// The source file.
@@ -422,8 +418,8 @@ public:
void GetStartLineSourceInfo(FileSpec &source_file, uint32_t &line_no);
//------------------------------------------------------------------
- /// Find the file and line number of the source location of the end
- /// of the function.
+ /// Find the file and line number of the source location of the end of the
+ /// function.
///
///
/// @param[out] source_file
@@ -497,8 +493,8 @@ public:
CompilerDeclContext GetDeclContext();
//------------------------------------------------------------------
- /// Get accessor for the type that describes the function
- /// return value type, and parameter types.
+ /// Get accessor for the type that describes the function return value type,
+ /// and parameter types.
///
/// @return
/// A type object pointer.
@@ -506,8 +502,8 @@ public:
Type *GetType();
//------------------------------------------------------------------
- /// Get const accessor for the type that describes the function
- /// return value type, and parameter types.
+ /// Get const accessor for the type that describes the function return value
+ /// type, and parameter types.
///
/// @return
/// A const type object pointer.
@@ -518,10 +514,8 @@ public:
//------------------------------------------------------------------
/// Get the size of the prologue instructions for this function. The
- /// "prologue"
- /// instructions include any instructions given line number 0 immediately
- /// following
- /// the prologue end.
+ /// "prologue" instructions include any instructions given line number 0
+ /// immediately following the prologue end.
///
/// @return
/// The size of the prologue.
@@ -531,8 +525,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -567,10 +561,10 @@ public:
///
/// The debug information may provide information about whether this
/// function was compiled with optimization or not. In this case,
- /// "optimized" means that the debug experience may be difficult
- /// for the user to understand. Variables may not be available when
- /// the developer would expect them, stepping through the source lines
- /// in the function may appear strange, etc.
+ /// "optimized" means that the debug experience may be difficult for the
+ /// user to understand. Variables may not be available when the developer
+ /// would expect them, stepping through the source lines in the function may
+ /// appear strange, etc.
///
/// @return
/// Returns 'true' if this function was compiled with
@@ -582,10 +576,10 @@ public:
//------------------------------------------------------------------
/// Get whether this function represents a 'top-level' function
///
- /// The concept of a top-level function is language-specific, mostly
- /// meant to represent the notion of scripting-style code that has
- /// global visibility of the variables/symbols/functions/...
- /// defined within the containing file/module
+ /// The concept of a top-level function is language-specific, mostly meant
+ /// to represent the notion of scripting-style code that has global
+ /// visibility of the variables/symbols/functions/... defined within the
+ /// containing file/module
///
/// If stopped in a top-level function, LLDB will expose global variables
/// as-if locals in the 'frame variable' command
diff --git a/include/lldb/Symbol/GoASTContext.h b/include/lldb/Symbol/GoASTContext.h
index ee111942c205..29c8cdceacff 100644
--- a/include/lldb/Symbol/GoASTContext.h
+++ b/include/lldb/Symbol/GoASTContext.h
@@ -216,8 +216,7 @@ public:
CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type) override;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) override;
CompilerType GetFunctionArgumentTypeAtIndex(lldb::opaque_compiler_type_t type,
@@ -294,8 +293,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) override;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
bool omit_empty_base_classes) override;
@@ -347,8 +346,8 @@ public:
Stream *s, const DataExtractor &data,
lldb::offset_t data_offset, size_t data_byte_size) override;
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
size_t dst_size) override;
diff --git a/include/lldb/Symbol/LineEntry.h b/include/lldb/Symbol/LineEntry.h
index b9a1a1442d47..c1ce614609c1 100644
--- a/include/lldb/Symbol/LineEntry.h
+++ b/include/lldb/Symbol/LineEntry.h
@@ -18,7 +18,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class LineEntry LineEntry.h "lldb/Symbol/LineEntry.h"
-/// @brief A line table entry class.
+/// A line table entry class.
//----------------------------------------------------------------------
struct LineEntry {
//------------------------------------------------------------------
@@ -44,8 +44,8 @@ struct LineEntry {
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -79,8 +79,8 @@ struct LineEntry {
Target *target, bool show_address_only) const;
//------------------------------------------------------------------
- /// Dumps information specific to a process that stops at this
- /// line entry to the supplied stream \a s.
+ /// Dumps information specific to a process that stops at this line entry to
+ /// the supplied stream \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -123,25 +123,25 @@ struct LineEntry {
static int Compare(const LineEntry &lhs, const LineEntry &rhs);
//------------------------------------------------------------------
- /// Give the range for this LineEntry + any additional LineEntries for
- /// this same source line that are contiguous.
+ /// Give the range for this LineEntry + any additional LineEntries for this
+ /// same source line that are contiguous.
///
/// A compiler may emit multiple line entries for a single source line,
- /// e.g. to indicate subexpressions at different columns. This method
- /// will get the AddressRange for all of the LineEntries for this source
- /// line that are contiguous.
+ /// e.g. to indicate subexpressions at different columns. This method will
+ /// get the AddressRange for all of the LineEntries for this source line
+ /// that are contiguous.
//
- /// Line entries with a line number of 0 are treated specially - these
- /// are compiler-generated line table entries that the user did not
- /// write in their source code, and we want to skip past in the debugger.
- /// If this LineEntry is for line 32, and the following LineEntry is for
- /// line 0, we will extend the range to include the AddressRange of the
- /// line 0 LineEntry (and it will include the range of the following
- /// LineEntries that match either 32 or 0.)
- ///
- /// If the initial LineEntry this method is called on is a line #0, only
- /// the range of contiuous LineEntries with line #0 will be included in
- /// the complete range.
+ /// Line entries with a line number of 0 are treated specially - these are
+ /// compiler-generated line table entries that the user did not write in
+ /// their source code, and we want to skip past in the debugger. If this
+ /// LineEntry is for line 32, and the following LineEntry is for line 0, we
+ /// will extend the range to include the AddressRange of the line 0
+ /// LineEntry (and it will include the range of the following LineEntries
+ /// that match either 32 or 0.)
+ ///
+ /// If the initial LineEntry this method is called on is a line #0, only the
+ /// range of contiuous LineEntries with line #0 will be included in the
+ /// complete range.
///
/// @return
/// The contiguous AddressRange for this source line.
diff --git a/include/lldb/Symbol/LineTable.h b/include/lldb/Symbol/LineTable.h
index a55e797f7b16..fe8be0c55764 100644
--- a/include/lldb/Symbol/LineTable.h
+++ b/include/lldb/Symbol/LineTable.h
@@ -25,8 +25,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class LineSequence LineTable.h "lldb/Symbol/LineTable.h"
-/// @brief An abstract base class used during symbol table creation.
+/// @class LineSequence LineTable.h "lldb/Symbol/LineTable.h" An abstract base
+/// class used during symbol table creation.
//----------------------------------------------------------------------
class LineSequence {
public:
@@ -42,7 +42,7 @@ private:
//----------------------------------------------------------------------
/// @class LineTable LineTable.h "lldb/Symbol/LineTable.h"
-/// @brief A line table class.
+/// A line table class.
//----------------------------------------------------------------------
class LineTable {
public:
@@ -111,8 +111,7 @@ public:
void GetDescription(Stream *s, Target *target, lldb::DescriptionLevel level);
//------------------------------------------------------------------
- /// Find a line entry that contains the section offset address \a
- /// so_addr.
+ /// Find a line entry that contains the section offset address \a so_addr.
///
/// @param[in] so_addr
/// A section offset address object containing the address we
@@ -134,12 +133,12 @@ public:
uint32_t *index_ptr = nullptr);
//------------------------------------------------------------------
- /// Find a line entry index that has a matching file index and
- /// source line number.
+ /// Find a line entry index that has a matching file index and source line
+ /// number.
///
- /// Finds the next line entry that has a matching \a file_idx and
- /// source line number \a line starting at the \a start_idx entries
- /// into the line entry collection.
+ /// Finds the next line entry that has a matching \a file_idx and source
+ /// line number \a line starting at the \a start_idx entries into the line
+ /// entry collection.
///
/// @param[in] start_idx
/// The number of entries to skip when starting the search.
@@ -224,8 +223,8 @@ public:
bool append);
//------------------------------------------------------------------
- /// Given a file range link map, relink the current line table
- /// and return a fixed up line table.
+ /// Given a file range link map, relink the current line table and return a
+ /// fixed up line table.
///
/// @param[out] file_range_map
/// A collection of file ranges that maps to new file ranges
diff --git a/include/lldb/Symbol/ObjectContainer.h b/include/lldb/Symbol/ObjectContainer.h
index 110379234fb5..2138d22808c3 100644
--- a/include/lldb/Symbol/ObjectContainer.h
+++ b/include/lldb/Symbol/ObjectContainer.h
@@ -25,23 +25,23 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ObjectContainer ObjectContainer.h "lldb/Symbol/ObjectContainer.h"
-/// @brief A plug-in interface definition class for object containers.
+/// A plug-in interface definition class for object containers.
///
-/// Object containers contain object files from one or more
-/// architectures, and also can contain one or more named objects.
+/// Object containers contain object files from one or more architectures, and
+/// also can contain one or more named objects.
///
-/// Typical object containers are static libraries (.a files) that
-/// contain multiple named object files, and universal files that contain
-/// multiple architectures.
+/// Typical object containers are static libraries (.a files) that contain
+/// multiple named object files, and universal files that contain multiple
+/// architectures.
//----------------------------------------------------------------------
class ObjectContainer : public PluginInterface, public ModuleChild {
public:
//------------------------------------------------------------------
/// Construct with a parent module, offset, and header data.
///
- /// Object files belong to modules and a valid module must be
- /// supplied upon construction. The at an offset within a file for
- /// objects that contain more than one architecture or object.
+ /// Object files belong to modules and a valid module must be supplied upon
+ /// construction. The at an offset within a file for objects that contain
+ /// more than one architecture or object.
//------------------------------------------------------------------
ObjectContainer(const lldb::ModuleSP &module_sp, const FileSpec *file,
lldb::offset_t file_offset, lldb::offset_t length,
@@ -58,18 +58,17 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~ObjectContainer() override = default;
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the current contents of this object
- /// to the supplied stream \a s. The dumping should include the
- /// section list if it has been parsed, and the symbol table
- /// if it has been parsed.
+ /// Dump a description of the current contents of this object to the
+ /// supplied stream \a s. The dumping should include the section list if it
+ /// has been parsed, and the symbol table if it has been parsed.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -101,8 +100,8 @@ public:
//------------------------------------------------------------------
/// Returns the offset into a file at which this object resides.
///
- /// Some files contain many object files, and this function allows
- /// access to an object's offset within the file.
+ /// Some files contain many object files, and this function allows access to
+ /// an object's offset within the file.
///
/// @return
/// The offset in bytes into the file. Defaults to zero for
@@ -124,10 +123,10 @@ public:
//------------------------------------------------------------------
/// Get the number of architectures in this object file.
///
- /// The default implementation returns 1 as for object files that
- /// contain a single architecture. ObjectContainer instances that
- /// contain more than one architecture should override this function
- /// and return an appropriate value.
+ /// The default implementation returns 1 as for object files that contain a
+ /// single architecture. ObjectContainer instances that contain more than
+ /// one architecture should override this function and return an appropriate
+ /// value.
///
/// @return
/// The number of architectures contained in this object file.
@@ -137,11 +136,11 @@ public:
//------------------------------------------------------------------
/// Attempts to parse the object header.
///
- /// This function is used as a test to see if a given plug-in
- /// instance can parse the header data already contained in
- /// ObjectContainer::m_data. If an object file parser does not
- /// recognize that magic bytes in a header, false should be returned
- /// and the next plug-in can attempt to parse an object file.
+ /// This function is used as a test to see if a given plug-in instance can
+ /// parse the header data already contained in ObjectContainer::m_data. If
+ /// an object file parser does not recognize that magic bytes in a header,
+ /// false should be returned and the next plug-in can attempt to parse an
+ /// object file.
///
/// @return
/// Returns \b true if the header was parsed successfully, \b
@@ -152,14 +151,14 @@ public:
//------------------------------------------------------------------
/// Selects an architecture in an object file.
///
- /// Object files that contain a single architecture should verify
- /// that the specified \a arch matches the architecture in in
- /// object file and return \b true or \b false accordingly.
+ /// Object files that contain a single architecture should verify that the
+ /// specified \a arch matches the architecture in in object file and return
+ /// \b true or \b false accordingly.
///
- /// Object files that contain more than one architecture should
- /// attempt to select that architecture, and if successful, clear
- /// out any previous state from any previously selected architecture
- /// and prepare to return information for the new architecture.
+ /// Object files that contain more than one architecture should attempt to
+ /// select that architecture, and if successful, clear out any previous
+ /// state from any previously selected architecture and prepare to return
+ /// information for the new architecture.
///
/// @return
/// Returns a pointer to the object file of the requested \a
diff --git a/include/lldb/Symbol/ObjectFile.h b/include/lldb/Symbol/ObjectFile.h
index dff802522da8..1e9ae8b45417 100644
--- a/include/lldb/Symbol/ObjectFile.h
+++ b/include/lldb/Symbol/ObjectFile.h
@@ -20,6 +20,7 @@
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/UUID.h"
#include "lldb/lldb-private.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -44,16 +45,15 @@ public:
//----------------------------------------------------------------------
/// @class ObjectFile ObjectFile.h "lldb/Symbol/ObjectFile.h"
-/// @brief A plug-in interface definition class for object file parsers.
+/// A plug-in interface definition class for object file parsers.
///
-/// Object files belong to Module objects and know how to extract
-/// information from executable, shared library, and object (.o) files
-/// used by operating system runtime. The symbol table and section list
-/// for an object file.
+/// Object files belong to Module objects and know how to extract information
+/// from executable, shared library, and object (.o) files used by operating
+/// system runtime. The symbol table and section list for an object file.
///
-/// Object files can be represented by the entire file, or by part of a
-/// file. An example of a partial file ObjectFile is one that contains
-/// information for one of multiple architectures in the same file.
+/// Object files can be represented by the entire file, or by part of a file.
+/// An example of a partial file ObjectFile is one that contains information
+/// for one of multiple architectures in the same file.
///
/// Once an architecture is selected the object file information can be
/// extracted from this abstract class.
@@ -88,12 +88,17 @@ public:
eStrataJIT
} Strata;
+ struct LoadableData {
+ lldb::addr_t Dest;
+ llvm::ArrayRef<uint8_t> Contents;
+ };
+
//------------------------------------------------------------------
/// Construct with a parent module, offset, and header data.
///
- /// Object files belong to modules and a valid module must be
- /// supplied upon construction. The at an offset within a file for
- /// objects that contain more than one architecture or object.
+ /// Object files belong to modules and a valid module must be supplied upon
+ /// construction. The at an offset within a file for objects that contain
+ /// more than one architecture or object.
//------------------------------------------------------------------
ObjectFile(const lldb::ModuleSP &module_sp, const FileSpec *file_spec_ptr,
lldb::offset_t file_offset, lldb::offset_t length,
@@ -105,18 +110,17 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~ObjectFile() override;
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the current contents of this object
- /// to the supplied stream \a s. The dumping should include the
- /// section list if it has been parsed, and the symbol table
- /// if it has been parsed.
+ /// Dump a description of the current contents of this object to the
+ /// supplied stream \a s. The dumping should include the section list if it
+ /// has been parsed, and the symbol table if it has been parsed.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -126,9 +130,9 @@ public:
//------------------------------------------------------------------
/// Find a ObjectFile plug-in that can parse \a file_spec.
///
- /// Scans all loaded plug-in interfaces that implement versions of
- /// the ObjectFile plug-in interface and returns the first
- /// instance that can parse the file.
+ /// Scans all loaded plug-in interfaces that implement versions of the
+ /// ObjectFile plug-in interface and returns the first instance that can
+ /// parse the file.
///
/// @param[in] module
/// The parent module that owns this object file.
@@ -156,9 +160,9 @@ public:
//------------------------------------------------------------------
/// Find a ObjectFile plug-in that can parse a file in memory.
///
- /// Scans all loaded plug-in interfaces that implement versions of
- /// the ObjectFile plug-in interface and returns the first
- /// instance that can parse the file.
+ /// Scans all loaded plug-in interfaces that implement versions of the
+ /// ObjectFile plug-in interface and returns the first instance that can
+ /// parse the file.
///
/// @param[in] module
/// The parent module that owns this object file.
@@ -189,9 +193,9 @@ public:
//------------------------------------------------------------------
/// Split a path into a file path with object name.
///
- /// For paths like "/tmp/foo.a(bar.o)" we often need to split a path
- /// up into the actual path name and into the object name so we can
- /// make a valid object file from it.
+ /// For paths like "/tmp/foo.a(bar.o)" we often need to split a path up into
+ /// the actual path name and into the object name so we can make a valid
+ /// object file from it.
///
/// @param[in] path_with_object
/// A path that might contain an archive path with a .o file
@@ -228,29 +232,25 @@ public:
//------------------------------------------------------------------
/// Get the address type given a file address in an object file.
///
- /// Many binary file formats know what kinds
- /// This is primarily for ARM binaries, though it can be applied to
- /// any executable file format that supports different opcode types
- /// within the same binary. ARM binaries support having both ARM and
- /// Thumb within the same executable container. We need to be able
- /// to get
- /// @return
+ /// Many binary file formats know what kinds This is primarily for ARM
+ /// binaries, though it can be applied to any executable file format that
+ /// supports different opcode types within the same binary. ARM binaries
+ /// support having both ARM and Thumb within the same executable container.
+ /// We need to be able to get @return
/// The size of an address in bytes for the currently selected
/// architecture (and object for archives). Returns zero if no
/// architecture or object has been selected.
//------------------------------------------------------------------
- virtual lldb::AddressClass GetAddressClass(lldb::addr_t file_addr);
+ virtual AddressClass GetAddressClass(lldb::addr_t file_addr);
//------------------------------------------------------------------
/// Extract the dependent modules from an object file.
///
- /// If an object file has information about which other images it
- /// depends on (such as shared libraries), this function will
- /// provide the list. Since many executables or shared libraries
- /// may depend on the same files,
- /// FileSpecList::AppendIfUnique(const FileSpec &) should be
- /// used to make sure any files that are added are not already in
- /// the list.
+ /// If an object file has information about which other images it depends on
+ /// (such as shared libraries), this function will provide the list. Since
+ /// many executables or shared libraries may depend on the same files,
+ /// FileSpecList::AppendIfUnique(const FileSpec &) should be used to make
+ /// sure any files that are added are not already in the list.
///
/// @param[out] file_list
/// A list of file specification objects that gets dependent
@@ -275,8 +275,8 @@ public:
//------------------------------------------------------------------
/// Returns the offset into a file at which this object resides.
///
- /// Some files contain many object files, and this function allows
- /// access to an object's offset within the file.
+ /// Some files contain many object files, and this function allows access to
+ /// an object's offset within the file.
///
/// @return
/// The offset in bytes into the file. Defaults to zero for
@@ -307,8 +307,8 @@ public:
//------------------------------------------------------------------
/// Get the name of the cpu, vendor and OS for this object file.
///
- /// This value is a string that represents the target triple where
- /// the cpu type, the vendor and the OS are encoded into a string.
+ /// This value is a string that represents the target triple where the cpu
+ /// type, the vendor and the OS are encoded into a string.
///
/// @param[out] target_triple
/// The string value of the target triple.
@@ -320,11 +320,11 @@ public:
virtual bool GetArchitecture(ArchSpec &arch) = 0;
//------------------------------------------------------------------
- /// Gets the section list for the currently selected architecture
- /// (and object for archives).
+ /// Gets the section list for the currently selected architecture (and
+ /// object for archives).
///
- /// Section list parsing can be deferred by ObjectFile instances
- /// until this accessor is called the first time.
+ /// Section list parsing can be deferred by ObjectFile instances until this
+ /// accessor is called the first time.
///
/// @return
/// The list of sections contained in this object file.
@@ -334,17 +334,17 @@ public:
virtual void CreateSections(SectionList &unified_section_list) = 0;
//------------------------------------------------------------------
- /// Notify the ObjectFile that the file addresses in the Sections
- /// for this module have been changed.
+ /// Notify the ObjectFile that the file addresses in the Sections for this
+ /// module have been changed.
//------------------------------------------------------------------
virtual void SectionFileAddressesChanged() {}
//------------------------------------------------------------------
- /// Gets the symbol table for the currently selected architecture
- /// (and object for archives).
+ /// Gets the symbol table for the currently selected architecture (and
+ /// object for archives).
///
- /// Symbol table parsing can be deferred by ObjectFile instances
- /// until this accessor is called the first time.
+ /// Symbol table parsing can be deferred by ObjectFile instances until this
+ /// accessor is called the first time.
///
/// @return
/// The symbol table for this object file.
@@ -360,11 +360,11 @@ public:
//------------------------------------------------------------------
/// Appends a Symbol for the specified so_addr to the symbol table.
///
- /// If verify_unique is false, the symbol table is not searched
- /// to determine if a Symbol found at this address has already been
- /// added to the symbol table. When verify_unique is true, this
- /// method resolves the Symbol as the first match in the SymbolTable
- /// and appends a Symbol only if required/found.
+ /// If verify_unique is false, the symbol table is not searched to determine
+ /// if a Symbol found at this address has already been added to the symbol
+ /// table. When verify_unique is true, this method resolves the Symbol as
+ /// the first match in the SymbolTable and appends a Symbol only if
+ /// required/found.
///
/// @return
/// The resolved symbol or nullptr. Returns nullptr if a
@@ -372,13 +372,13 @@ public:
//------------------------------------------------------------------
virtual Symbol *ResolveSymbolForAddress(const Address &so_addr,
bool verify_unique) {
- // Typically overridden to lazily add stripped symbols recoverable from
- // the exception handling unwind information (i.e. without parsing
- // the entire eh_frame section.
+ // Typically overridden to lazily add stripped symbols recoverable from the
+ // exception handling unwind information (i.e. without parsing the entire
+ // eh_frame section.
//
- // The availability of LC_FUNCTION_STARTS allows ObjectFileMachO
- // to efficiently add stripped symbols when the symbol table is
- // first constructed. Poorer cousins are PECoff and ELF.
+ // The availability of LC_FUNCTION_STARTS allows ObjectFileMachO to
+ // efficiently add stripped symbols when the symbol table is first
+ // constructed. Poorer cousins are PECoff and ELF.
return nullptr;
}
@@ -410,10 +410,9 @@ public:
//------------------------------------------------------------------
/// Gets the UUID for this object file.
///
- /// If the object file format contains a UUID, the value should be
- /// returned. Else ObjectFile instances should return the MD5
- /// checksum of all of the bytes for the object file (or memory for
- /// memory based object files).
+ /// If the object file format contains a UUID, the value should be returned.
+ /// Else ObjectFile instances should return the MD5 checksum of all of the
+ /// bytes for the object file (or memory for memory based object files).
///
/// @return
/// Returns \b true if a UUID was successfully extracted into
@@ -424,8 +423,8 @@ public:
//------------------------------------------------------------------
/// Gets the symbol file spec list for this object file.
///
- /// If the object file format contains a debug symbol file link,
- /// the values will be returned in the FileSpecList.
+ /// If the object file format contains a debug symbol file link, the values
+ /// will be returned in the FileSpecList.
///
/// @return
/// Returns filespeclist.
@@ -438,8 +437,8 @@ public:
/// Gets the file spec list of libraries re-exported by this object file.
///
/// If the object file format has the notion of one library re-exporting the
- /// symbols from another,
- /// the re-exported libraries will be returned in the FileSpecList.
+ /// symbols from another, the re-exported libraries will be returned in the
+ /// FileSpecList.
///
/// @return
/// Returns filespeclist.
@@ -449,8 +448,8 @@ public:
}
//------------------------------------------------------------------
- /// Sets the load address for an entire module, assuming a rigid
- /// slide of sections, if possible in the implementation.
+ /// Sets the load address for an entire module, assuming a rigid slide of
+ /// sections, if possible in the implementation.
///
/// @return
/// Returns true iff any section's load address changed.
@@ -461,8 +460,8 @@ public:
}
//------------------------------------------------------------------
- /// Gets whether endian swapping should occur when extracting data
- /// from this object file.
+ /// Gets whether endian swapping should occur when extracting data from this
+ /// object file.
///
/// @return
/// Returns \b true if endian swapping is needed, \b false
@@ -473,11 +472,11 @@ public:
//------------------------------------------------------------------
/// Attempts to parse the object header.
///
- /// This function is used as a test to see if a given plug-in
- /// instance can parse the header data already contained in
- /// ObjectFile::m_data. If an object file parser does not
- /// recognize that magic bytes in a header, false should be returned
- /// and the next plug-in can attempt to parse an object file.
+ /// This function is used as a test to see if a given plug-in instance can
+ /// parse the header data already contained in ObjectFile::m_data. If an
+ /// object file parser does not recognize that magic bytes in a header,
+ /// false should be returned and the next plug-in can attempt to parse an
+ /// object file.
///
/// @return
/// Returns \b true if the header was parsed successfully, \b
@@ -488,11 +487,11 @@ public:
//------------------------------------------------------------------
/// Returns a reference to the UnwindTable for this ObjectFile
///
- /// The UnwindTable contains FuncUnwinders objects for any function in
- /// this ObjectFile. If a FuncUnwinders object hasn't been created yet
- /// (i.e. the function has yet to be unwound in a stack walk), it
- /// will be created when requested. Specifically, we do not create
- /// FuncUnwinders objects for functions until they are needed.
+ /// The UnwindTable contains FuncUnwinders objects for any function in this
+ /// ObjectFile. If a FuncUnwinders object hasn't been created yet (i.e. the
+ /// function has yet to be unwound in a stack walk), it will be created when
+ /// requested. Specifically, we do not create FuncUnwinders objects for
+ /// functions until they are needed.
///
/// @return
/// Returns the unwind table for this object file.
@@ -500,21 +499,21 @@ public:
virtual lldb_private::UnwindTable &GetUnwindTable() { return m_unwind_table; }
//------------------------------------------------------------------
- /// Returns if the function bounds for symbols in this symbol file
- /// are likely accurate.
+ /// Returns if the function bounds for symbols in this symbol file are
+ /// likely accurate.
///
/// The unwinder can emulate the instructions of functions to understand
- /// prologue/epilogue code sequences, where registers are spilled on
- /// the stack, etc. This feature relies on having the correct start
- /// addresses of all functions. If the ObjectFile has a way to tell
- /// that symbols have been stripped and there's no way to reconstruct
- /// start addresses (e.g. LC_FUNCTION_STARTS on Mach-O, or eh_frame
- /// unwind info), the ObjectFile should indicate that assembly emulation
- /// should not be used for this module.
+ /// prologue/epilogue code sequences, where registers are spilled on the
+ /// stack, etc. This feature relies on having the correct start addresses
+ /// of all functions. If the ObjectFile has a way to tell that symbols have
+ /// been stripped and there's no way to reconstruct start addresses (e.g.
+ /// LC_FUNCTION_STARTS on Mach-O, or eh_frame unwind info), the ObjectFile
+ /// should indicate that assembly emulation should not be used for this
+ /// module.
///
- /// It is uncommon for this to return false. An ObjectFile needs to
- /// be sure that symbol start addresses are unavailable before false
- /// is returned. If it is unclear, this should return true.
+ /// It is uncommon for this to return false. An ObjectFile needs to be sure
+ /// that symbol start addresses are unavailable before false is returned.
+ /// If it is unclear, this should return true.
///
/// @return
/// Returns true if assembly emulation should be used for this
@@ -542,9 +541,9 @@ public:
}
//------------------------------------------------------------------
- /// Returns the address of the Entry Point in this object file - if
- /// the object file doesn't have an entry point (because it is not an
- /// executable file) then an invalid address is returned.
+ /// Returns the address of the Entry Point in this object file - if the
+ /// object file doesn't have an entry point (because it is not an executable
+ /// file) then an invalid address is returned.
///
/// @return
/// Returns the entry address for this module.
@@ -552,14 +551,13 @@ public:
virtual lldb_private::Address GetEntryPointAddress() { return Address(); }
//------------------------------------------------------------------
- /// Returns the address that represents the header of this object
- /// file.
+ /// Returns the address that represents the header of this object file.
///
- /// The header address is defined as where the header for the object
- /// file is that describes the content of the file. If the header
- /// doesn't appear in a section that is defined in the object file,
- /// an address with no section is returned that has the file offset
- /// set in the m_file_offset member of the lldb_private::Address object.
+ /// The header address is defined as where the header for the object file is
+ /// that describes the content of the file. If the header doesn't appear in
+ /// a section that is defined in the object file, an address with no section
+ /// is returned that has the file offset set in the m_file_offset member of
+ /// the lldb_private::Address object.
///
/// @return
/// Returns the entry address for this module.
@@ -571,9 +569,9 @@ public:
virtual uint32_t GetNumThreadContexts() { return 0; }
//------------------------------------------------------------------
- /// Some object files may have an identifier string embedded in them,
- /// e.g. in a Mach-O core file using the LC_IDENT load command (which
- /// is obsolete, but can still be found in some old files)
+ /// Some object files may have an identifier string embedded in them, e.g.
+ /// in a Mach-O core file using the LC_IDENT load command (which is
+ /// obsolete, but can still be found in some old files)
///
/// @return
/// Returns the identifier string if one exists, else an empty
@@ -584,11 +582,11 @@ public:
}
//------------------------------------------------------------------
- /// When the ObjectFile is a core file, lldb needs to locate the
- /// "binary" in the core file. lldb can iterate over the pages looking
- /// for a valid binary, but some core files may have metadata
- /// describing where the main binary is exactly which removes ambiguity
- /// when there are multiple binaries present in the captured memory pages.
+ /// When the ObjectFile is a core file, lldb needs to locate the "binary" in
+ /// the core file. lldb can iterate over the pages looking for a valid
+ /// binary, but some core files may have metadata describing where the main
+ /// binary is exactly which removes ambiguity when there are multiple
+ /// binaries present in the captured memory pages.
///
/// @param[out] address
/// If the address of the binary is specified, this will be set.
@@ -615,13 +613,12 @@ public:
}
//------------------------------------------------------------------
- /// The object file should be able to calculate its type by looking
- /// at its file header and possibly the sections or other data in
- /// the object file. The file type is used in the debugger to help
- /// select the correct plug-ins for the job at hand, so this is
- /// important to get right. If any eTypeXXX definitions do not match
- /// up with the type of file you are loading, please feel free to
- /// add a new enumeration value.
+ /// The object file should be able to calculate its type by looking at its
+ /// file header and possibly the sections or other data in the object file.
+ /// The file type is used in the debugger to help select the correct plug-
+ /// ins for the job at hand, so this is important to get right. If any
+ /// eTypeXXX definitions do not match up with the type of file you are
+ /// loading, please feel free to add a new enumeration value.
///
/// @return
/// The calculated file type for the current object file.
@@ -629,20 +626,19 @@ public:
virtual Type CalculateType() = 0;
//------------------------------------------------------------------
- /// In cases where the type can't be calculated (elf files), this
- /// routine allows someone to explicitly set it. As an example,
- /// SymbolVendorELF uses this routine to set eTypeDebugInfo when
- /// loading debug link files.
+ /// In cases where the type can't be calculated (elf files), this routine
+ /// allows someone to explicitly set it. As an example, SymbolVendorELF uses
+ /// this routine to set eTypeDebugInfo when loading debug link files.
virtual void SetType(Type type) { m_type = type; }
//------------------------------------------------------------------
- /// The object file should be able to calculate the strata of the
- /// object file.
+ /// The object file should be able to calculate the strata of the object
+ /// file.
///
- /// Many object files for platforms might be for either user space
- /// debugging or for kernel debugging. If your object file subclass
- /// can figure this out, it will help with debugger plug-in selection
- /// when it comes time to debug.
+ /// Many object files for platforms might be for either user space debugging
+ /// or for kernel debugging. If your object file subclass can figure this
+ /// out, it will help with debugger plug-in selection when it comes time to
+ /// debug.
///
/// @return
/// The calculated object file strata for the current object
@@ -653,96 +649,31 @@ public:
//------------------------------------------------------------------
/// Get the object file version numbers.
///
- /// Many object files have a set of version numbers that describe
- /// the version of the executable or shared library. Typically there
- /// are major, minor and build, but there may be more. This function
- /// will extract the versions from object files if they are available.
- ///
- /// If \a versions is NULL, or if \a num_versions is 0, the return
- /// value will indicate how many version numbers are available in
- /// this object file. Then a subsequent call can be made to this
- /// function with a value of \a versions and \a num_versions that
- /// has enough storage to store some or all version numbers.
- ///
- /// @param[out] versions
- /// A pointer to an array of uint32_t types that is \a num_versions
- /// long. If this value is NULL, the return value will indicate
- /// how many version numbers are required for a subsequent call
- /// to this function so that all versions can be retrieved. If
- /// the value is non-NULL, then at most \a num_versions of the
- /// existing versions numbers will be filled into \a versions.
- /// If there is no version information available, \a versions
- /// will be filled with \a num_versions UINT32_MAX values
- /// and zero will be returned.
- ///
- /// @param[in] num_versions
- /// The maximum number of entries to fill into \a versions. If
- /// this value is zero, then the return value will indicate
- /// how many version numbers there are in total so another call
- /// to this function can be make with adequate storage in
- /// \a versions to get all of the version numbers. If \a
- /// num_versions is less than the actual number of version
- /// numbers in this object file, only \a num_versions will be
- /// filled into \a versions (if \a versions is non-NULL).
- ///
- /// @return
- /// This function always returns the number of version numbers
- /// that this object file has regardless of the number of
- /// version numbers that were copied into \a versions.
- //------------------------------------------------------------------
- virtual uint32_t GetVersion(uint32_t *versions, uint32_t num_versions) {
- if (versions && num_versions) {
- for (uint32_t i = 0; i < num_versions; ++i)
- versions[i] = UINT32_MAX;
- }
- return 0;
- }
+ /// Many object files have a set of version numbers that describe the
+ /// version of the executable or shared library. Typically there are major,
+ /// minor and build, but there may be more. This function will extract the
+ /// versions from object files if they are available.
+ ///
+ /// @return
+ /// This function returns extracted version numbers as a
+ /// llvm::VersionTuple. In case of error an empty VersionTuple is
+ /// returned.
+ //------------------------------------------------------------------
+ virtual llvm::VersionTuple GetVersion() { return llvm::VersionTuple(); }
//------------------------------------------------------------------
/// Get the minimum OS version this object file can run on.
///
- /// Some object files have information that specifies the minimum OS
- /// version that they can be used on.
- ///
- /// If \a versions is NULL, or if \a num_versions is 0, the return
- /// value will indicate how many version numbers are available in
- /// this object file. Then a subsequent call can be made to this
- /// function with a value of \a versions and \a num_versions that
- /// has enough storage to store some or all version numbers.
- ///
- /// @param[out] versions
- /// A pointer to an array of uint32_t types that is \a num_versions
- /// long. If this value is NULL, the return value will indicate
- /// how many version numbers are required for a subsequent call
- /// to this function so that all versions can be retrieved. If
- /// the value is non-NULL, then at most \a num_versions of the
- /// existing versions numbers will be filled into \a versions.
- /// If there is no version information available, \a versions
- /// will be filled with \a num_versions UINT32_MAX values
- /// and zero will be returned.
- ///
- /// @param[in] num_versions
- /// The maximum number of entries to fill into \a versions. If
- /// this value is zero, then the return value will indicate
- /// how many version numbers there are in total so another call
- /// to this function can be make with adequate storage in
- /// \a versions to get all of the version numbers. If \a
- /// num_versions is less than the actual number of version
- /// numbers in this object file, only \a num_versions will be
- /// filled into \a versions (if \a versions is non-NULL).
- ///
- /// @return
- /// This function always returns the number of version numbers
- /// that this object file has regardless of the number of
- /// version numbers that were copied into \a versions.
- //------------------------------------------------------------------
- virtual uint32_t GetMinimumOSVersion(uint32_t *versions,
- uint32_t num_versions) {
- if (versions && num_versions) {
- for (uint32_t i = 0; i < num_versions; ++i)
- versions[i] = UINT32_MAX;
- }
- return 0;
+ /// Some object files have information that specifies the minimum OS version
+ /// that they can be used on.
+ ///
+ /// @return
+ /// This function returns extracted version numbers as a
+ /// llvm::VersionTuple. In case of error an empty VersionTuple is
+ /// returned.
+ //------------------------------------------------------------------
+ virtual llvm::VersionTuple GetMinimumOSVersion() {
+ return llvm::VersionTuple();
}
//------------------------------------------------------------------
@@ -762,12 +693,11 @@ public:
//------------------------------------------------------------------
/// Return true if this file is a dynamic link editor (dyld)
///
- /// Often times dyld has symbols that mirror symbols in libc and
- /// other shared libraries (like "malloc" and "free") and the user
- /// does _not_ want to stop in these shared libraries by default.
- /// We can ask the ObjectFile if it is such a file and should be
- /// avoided for things like settings breakpoints and doing function
- /// lookups for expressions.
+ /// Often times dyld has symbols that mirror symbols in libc and other
+ /// shared libraries (like "malloc" and "free") and the user does _not_ want
+ /// to stop in these shared libraries by default. We can ask the ObjectFile
+ /// if it is such a file and should be avoided for things like settings
+ /// breakpoints and doing function lookups for expressions.
//------------------------------------------------------------------
virtual bool GetIsDynamicLinkEditor() { return false; }
@@ -786,10 +716,9 @@ public:
return m_strata;
}
- // When an object file is in memory, subclasses should try and lock
- // the process weak pointer. If the process weak pointer produces a
- // valid ProcessSP, then subclasses can call this function to read
- // memory.
+ // When an object file is in memory, subclasses should try and lock the
+ // process weak pointer. If the process weak pointer produces a valid
+ // ProcessSP, then subclasses can call this function to read memory.
static lldb::DataBufferSP ReadMemory(const lldb::ProcessSP &process_sp,
lldb::addr_t addr, size_t byte_size);
@@ -809,8 +738,8 @@ public:
size_t dst_len);
// This function will transparently decompress section data if the section if
- // compressed. Note that for compressed section the resulting data size may be
- // larger than what Section::GetFileSize reports.
+ // compressed. Note that for compressed section the resulting data size may
+ // be larger than what Section::GetFileSize reports.
virtual size_t ReadSectionData(Section *section,
DataExtractor &section_data);
@@ -829,16 +758,16 @@ public:
//------------------------------------------------------------------
/// Loads this objfile to memory.
///
- /// Loads the bits needed to create an executable image to the memory.
- /// It is useful with bare-metal targets where target does not have the
- /// ability to start a process itself.
+ /// Loads the bits needed to create an executable image to the memory. It is
+ /// useful with bare-metal targets where target does not have the ability to
+ /// start a process itself.
///
/// @param[in] target
/// Target where to load.
///
/// @return
//------------------------------------------------------------------
- virtual Status LoadInMemory(Target &target, bool set_pc);
+ virtual std::vector<LoadableData> GetLoadableData(Target &target);
protected:
//------------------------------------------------------------------
@@ -864,9 +793,9 @@ protected:
uint32_t m_synthetic_symbol_idx;
//------------------------------------------------------------------
- /// Sets the architecture for a module. At present the architecture
- /// can only be set if it is invalid. It is not allowed to switch from
- /// one concrete architecture to another.
+ /// Sets the architecture for a module. At present the architecture can
+ /// only be set if it is invalid. It is not allowed to switch from one
+ /// concrete architecture to another.
///
/// @param[in] new_arch
/// The architecture this module will be set to.
diff --git a/include/lldb/Symbol/Symbol.h b/include/lldb/Symbol/Symbol.h
index 44c67f6f4716..9523158e0780 100644
--- a/include/lldb/Symbol/Symbol.h
+++ b/include/lldb/Symbol/Symbol.h
@@ -20,11 +20,9 @@ namespace lldb_private {
class Symbol : public SymbolContextScope {
public:
- // ObjectFile readers can classify their symbol table entries and searches can
- // be made
- // on specific types where the symbol values will have drastically different
- // meanings
- // and sorting requirements.
+ // ObjectFile readers can classify their symbol table entries and searches
+ // can be made on specific types where the symbol values will have
+ // drastically different meanings and sorting requirements.
Symbol();
Symbol(uint32_t symID, const char *name, bool name_is_mangled,
@@ -52,56 +50,53 @@ public:
bool ValueIsAddress() const;
//------------------------------------------------------------------
- // The GetAddressRef() accessor functions should only be called if
- // you previously call ValueIsAddress() otherwise you might get an
- // reference to an Address object that contains an constant integer
- // value in m_addr_range.m_base_addr.m_offset which could be
- // incorrectly used to represent an absolute address since it has
- // no section.
+ // The GetAddressRef() accessor functions should only be called if you
+ // previously call ValueIsAddress() otherwise you might get an reference to
+ // an Address object that contains an constant integer value in
+ // m_addr_range.m_base_addr.m_offset which could be incorrectly used to
+ // represent an absolute address since it has no section.
//------------------------------------------------------------------
Address &GetAddressRef() { return m_addr_range.GetBaseAddress(); }
const Address &GetAddressRef() const { return m_addr_range.GetBaseAddress(); }
//------------------------------------------------------------------
- // Makes sure the symbol's value is an address and returns the file
- // address. Returns LLDB_INVALID_ADDRESS if the symbol's value isn't
- // an address.
+ // Makes sure the symbol's value is an address and returns the file address.
+ // Returns LLDB_INVALID_ADDRESS if the symbol's value isn't an address.
//------------------------------------------------------------------
lldb::addr_t GetFileAddress() const;
//------------------------------------------------------------------
- // Makes sure the symbol's value is an address and gets the load
- // address using \a target if it is. Returns LLDB_INVALID_ADDRESS
- // if the symbol's value isn't an address or if the section isn't
- // loaded in \a target.
+ // Makes sure the symbol's value is an address and gets the load address
+ // using \a target if it is. Returns LLDB_INVALID_ADDRESS if the symbol's
+ // value isn't an address or if the section isn't loaded in \a target.
//------------------------------------------------------------------
lldb::addr_t GetLoadAddress(Target *target) const;
//------------------------------------------------------------------
- // Access the address value. Do NOT hand out the AddressRange as an
- // object as the byte size of the address range may not be filled in
- // and it should be accessed via GetByteSize().
+ // Access the address value. Do NOT hand out the AddressRange as an object as
+ // the byte size of the address range may not be filled in and it should be
+ // accessed via GetByteSize().
//------------------------------------------------------------------
Address GetAddress() const {
- // Make sure the our value is an address before we hand a copy out.
- // We use the Address inside m_addr_range to contain the value for
- // symbols that are not address based symbols so we are using it
- // for more than just addresses. For example undefined symbols on
- // MacOSX have a nlist.n_value of 0 (zero) and this will get placed
- // into m_addr_range.m_base_addr.m_offset and it will have no section.
- // So in the GetAddress() accessor, we need to hand out an invalid
- // address if the symbol's value isn't an address.
+ // Make sure the our value is an address before we hand a copy out. We use
+ // the Address inside m_addr_range to contain the value for symbols that
+ // are not address based symbols so we are using it for more than just
+ // addresses. For example undefined symbols on MacOSX have a nlist.n_value
+ // of 0 (zero) and this will get placed into
+ // m_addr_range.m_base_addr.m_offset and it will have no section. So in the
+ // GetAddress() accessor, we need to hand out an invalid address if the
+ // symbol's value isn't an address.
if (ValueIsAddress())
return m_addr_range.GetBaseAddress();
else
return Address();
}
- // When a symbol's value isn't an address, we need to access the raw
- // value. This function will ensure this symbol's value isn't an address
- // and return the integer value if this checks out, otherwise it will
- // return "fail_value" if the symbol is an address value.
+ // When a symbol's value isn't an address, we need to access the raw value.
+ // This function will ensure this symbol's value isn't an address and return
+ // the integer value if this checks out, otherwise it will return
+ // "fail_value" if the symbol is an address value.
uint64_t GetIntegerValue(uint64_t fail_value = 0) const {
if (ValueIsAddress()) {
// This symbol's value is an address. Use Symbol::GetAddress() to get the
@@ -238,9 +233,8 @@ public:
protected:
// This is the internal guts of ResolveReExportedSymbol, it assumes
- // reexport_name is not null, and that module_spec
- // is valid. We track the modules we've already seen to make sure we don't
- // get caught in a cycle.
+ // reexport_name is not null, and that module_spec is valid. We track the
+ // modules we've already seen to make sure we don't get caught in a cycle.
Symbol *ResolveReExportedSymbolInModuleSpec(
Target &target, ConstString &reexport_name,
@@ -260,8 +254,8 @@ protected:
m_size_is_sibling : 1, // m_size contains the index of this symbol's
// sibling
m_size_is_synthesized : 1, // non-zero if this symbol's size was
- // calculated using a delta between this symbol
- // and the next
+ // calculated using a delta between this
+ // symbol and the next
m_size_is_valid : 1,
m_demangled_is_synthesized : 1, // The demangled name was created should
// not be used for expressions or other
diff --git a/include/lldb/Symbol/SymbolContext.h b/include/lldb/Symbol/SymbolContext.h
index f84b7cf916fe..0ec0006f193a 100644
--- a/include/lldb/Symbol/SymbolContext.h
+++ b/include/lldb/Symbol/SymbolContext.h
@@ -29,14 +29,12 @@ namespace lldb_private {
class SymbolContextScope;
//----------------------------------------------------------------------
-/// @class SymbolContext SymbolContext.h "lldb/Symbol/SymbolContext.h"
-/// @brief Defines a symbol context baton that can be handed other debug
-/// core functions.
+/// @class SymbolContext SymbolContext.h "lldb/Symbol/SymbolContext.h" Defines
+/// a symbol context baton that can be handed other debug core functions.
///
-/// Many debugger functions require a context when doing lookups. This
-/// class provides a common structure that can be used as the result
-/// of a query that can contain a single result. Examples of such
-/// queries include
+/// Many debugger functions require a context when doing lookups. This class
+/// provides a common structure that can be used as the result of a query that
+/// can contain a single result. Examples of such queries include
/// @li Looking up a load address.
//----------------------------------------------------------------------
class SymbolContext {
@@ -44,14 +42,14 @@ public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Initialize all pointer members to nullptr and all struct members
- /// to their default state.
+ /// Initialize all pointer members to nullptr and all struct members to
+ /// their default state.
//------------------------------------------------------------------
SymbolContext();
//------------------------------------------------------------------
- /// Construct with an object that knows how to reconstruct its
- /// symbol context.
+ /// Construct with an object that knows how to reconstruct its symbol
+ /// context.
///
/// @param[in] sc_scope
/// A symbol context scope object that knows how to reconstruct
@@ -60,8 +58,8 @@ public:
explicit SymbolContext(SymbolContextScope *sc_scope);
//------------------------------------------------------------------
- /// Construct with module, and optional compile unit, function,
- /// block, line table, line entry and symbol.
+ /// Construct with module, and optional compile unit, function, block, line
+ /// table, line entry and symbol.
///
/// Initialize all pointer to the specified values.
///
@@ -112,8 +110,8 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
- /// Copies the address value from another SymbolContext object \a
- /// rhs into \a this object.
+ /// Copies the address value from another SymbolContext object \a rhs into
+ /// \a this object.
///
/// @param[in] rhs
/// A const SymbolContext object reference to copy.
@@ -126,16 +124,16 @@ public:
//------------------------------------------------------------------
/// Clear the object's state.
///
- /// Resets all pointer members to nullptr, and clears any class objects
- /// to their default state.
+ /// Resets all pointer members to nullptr, and clears any class objects to
+ /// their default state.
//------------------------------------------------------------------
void Clear(bool clear_target);
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of this object to the
- /// supplied stream \a s.
+ /// Dump a description of the contents of this object to the supplied stream
+ /// \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -145,13 +143,12 @@ public:
//------------------------------------------------------------------
/// Dump the stop context in this object to a Stream.
///
- /// Dump the best description of this object to the stream. The
- /// information displayed depends on the amount and quality of the
- /// information in this context. If a module, function, file and
- /// line number are available, they will be dumped. If only a
- /// module and function or symbol name with offset is available,
- /// that will be output. Else just the address at which the target
- /// was stopped will be displayed.
+ /// Dump the best description of this object to the stream. The information
+ /// displayed depends on the amount and quality of the information in this
+ /// context. If a module, function, file and line number are available, they
+ /// will be dumped. If only a module and function or symbol name with offset
+ /// is available, that will be output. Else just the address at which the
+ /// target was stopped will be displayed.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -267,21 +264,21 @@ public:
lldb::LanguageType GetLanguage() const;
//------------------------------------------------------------------
- /// Find a block that defines the function represented by this
- /// symbol context.
+ /// Find a block that defines the function represented by this symbol
+ /// context.
///
- /// If this symbol context points to a block that is an inlined
- /// function, or is contained within an inlined function, the block
- /// that defines the inlined function is returned.
+ /// If this symbol context points to a block that is an inlined function, or
+ /// is contained within an inlined function, the block that defines the
+ /// inlined function is returned.
///
- /// If this symbol context has no block in it, or the block is not
- /// itself an inlined function block or contained within one, we
- /// return the top level function block.
+ /// If this symbol context has no block in it, or the block is not itself an
+ /// inlined function block or contained within one, we return the top level
+ /// function block.
///
- /// This is a handy function to call when you want to get the block
- /// whose variable list will include the arguments for the function
- /// that is represented by this symbol context (whether the function
- /// is an inline function or not).
+ /// This is a handy function to call when you want to get the block whose
+ /// variable list will include the arguments for the function that is
+ /// represented by this symbol context (whether the function is an inline
+ /// function or not).
///
/// @return
/// The block object pointer that defines the function that is
@@ -290,8 +287,8 @@ public:
Block *GetFunctionBlock();
//------------------------------------------------------------------
- /// If this symbol context represents a function that is a method,
- /// return true and provide information about the method.
+ /// If this symbol context represents a function that is a method, return
+ /// true and provide information about the method.
///
/// @param[out] language
/// If \b true is returned, the language for the method.
@@ -313,8 +310,7 @@ public:
ConstString &language_object_name);
//------------------------------------------------------------------
- /// Sorts the types in TypeMap according to SymbolContext
- /// to TypeList
+ /// Sorts the types in TypeMap according to SymbolContext to TypeList
///
//------------------------------------------------------------------
void SortTypeList(TypeMap &type_map, TypeList &type_list) const;
@@ -322,8 +318,8 @@ public:
//------------------------------------------------------------------
/// Find a name of the innermost function for the symbol context.
///
- /// For instance, if the symbol context contains an inlined block,
- /// it will return the inlined function name.
+ /// For instance, if the symbol context contains an inlined block, it will
+ /// return the inlined function name.
///
/// @param[in] prefer_mangled
/// if \btrue, then the mangled name will be returned if there
@@ -339,14 +335,13 @@ public:
//------------------------------------------------------------------
/// Get the line entry that corresponds to the function.
///
- /// If the symbol context contains an inlined block, the line entry
- /// for the start address of the inlined function will be returned,
- /// otherwise the line entry for the start address of the function
- /// will be returned. This can be used after doing a
- /// Module::FindFunctions(...) or ModuleList::FindFunctions(...)
- /// call in order to get the correct line table information for
- /// the symbol context.
- /// it will return the inlined function name.
+ /// If the symbol context contains an inlined block, the line entry for the
+ /// start address of the inlined function will be returned, otherwise the
+ /// line entry for the start address of the function will be returned. This
+ /// can be used after doing a Module::FindFunctions(...) or
+ /// ModuleList::FindFunctions(...) call in order to get the correct line
+ /// table information for the symbol context. it will return the inlined
+ /// function name.
///
/// @param[in] prefer_mangled
/// if \btrue, then the mangled name will be returned if there
@@ -361,8 +356,8 @@ public:
//------------------------------------------------------------------
/// Find the block containing the inlined block that contains this block.
///
- /// For instance, if the symbol context contains an inlined block,
- /// it will return the inlined function name.
+ /// For instance, if the symbol context contains an inlined block, it will
+ /// return the inlined function name.
///
/// @param[in] curr_frame_pc
/// The address within the block of this object.
@@ -440,11 +435,11 @@ private:
//----------------------------------------------------------------------
/// @class SymbolContextList SymbolContext.h "lldb/Symbol/SymbolContext.h"
-/// @brief Defines a list of symbol context objects.
+/// Defines a list of symbol context objects.
///
-/// This class provides a common structure that can be used to contain
-/// the result of a query that can contain a multiple results. Examples
-/// of such queries include:
+/// This class provides a common structure that can be used to contain the
+/// result of a query that can contain a multiple results. Examples of such
+/// queries include:
/// @li Looking up a function by name.
/// @li Finding all addresses for a specified file and line number.
//----------------------------------------------------------------------
@@ -491,8 +486,8 @@ public:
//------------------------------------------------------------------
/// Dump a description of this object to a Stream.
///
- /// Dump a description of the contents of each symbol context in
- /// the list to the supplied stream \a s.
+ /// Dump a description of the contents of each symbol context in the list to
+ /// the supplied stream \a s.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -502,8 +497,8 @@ public:
//------------------------------------------------------------------
/// Get accessor for a symbol context at index \a idx.
///
- /// Dump a description of the contents of each symbol context in
- /// the list to the supplied stream \a s.
+ /// Dump a description of the contents of each symbol context in the list to
+ /// the supplied stream \a s.
///
/// @param[in] idx
/// The zero based index into the symbol context list.
@@ -521,8 +516,8 @@ public:
//------------------------------------------------------------------
/// Direct reference accessor for a symbol context at index \a idx.
///
- /// The index \a idx must be a valid index, no error checking will
- /// be done to ensure that it is valid.
+ /// The index \a idx must be a valid index, no error checking will be done
+ /// to ensure that it is valid.
///
/// @param[in] idx
/// The zero based index into the symbol context list.
diff --git a/include/lldb/Symbol/SymbolContextScope.h b/include/lldb/Symbol/SymbolContextScope.h
index 926e34bc03a2..c2fbb5272fc0 100644
--- a/include/lldb/Symbol/SymbolContextScope.h
+++ b/include/lldb/Symbol/SymbolContextScope.h
@@ -20,16 +20,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class SymbolContextScope SymbolContextScope.h
-/// "lldb/Symbol/SymbolContextScope.h"
-/// @brief Inherit from this if your object is part of a symbol context
+/// "lldb/Symbol/SymbolContextScope.h" Inherit from this if your object is
+/// part of a symbol context
/// and can reconstruct its symbol context.
///
-/// Many objects that are part of a symbol context that have pointers
-/// back to parent objects that own them. Any members of a symbol
-/// context that, once they are built, will not go away, can inherit
-/// from this pure virtual class and can then reconstruct their symbol
-/// context without having to keep a complete SymbolContext object in
-/// the object.
+/// Many objects that are part of a symbol context that have pointers back to
+/// parent objects that own them. Any members of a symbol context that, once
+/// they are built, will not go away, can inherit from this pure virtual class
+/// and can then reconstruct their symbol context without having to keep a
+/// complete SymbolContext object in the object.
///
/// Examples of these objects include:
/// @li Module
@@ -38,14 +37,14 @@ namespace lldb_private {
/// @li Block
/// @li Symbol
///
-/// Other objects can store a "SymbolContextScope *" using any pointers
-/// to one of the above objects. This allows clients to hold onto a
-/// pointer that uniquely will identify a symbol context. Those clients
-/// can then always reconstruct the symbol context using the pointer, or
-/// use it to uniquely identify a symbol context for an object.
+/// Other objects can store a "SymbolContextScope *" using any pointers to one
+/// of the above objects. This allows clients to hold onto a pointer that
+/// uniquely will identify a symbol context. Those clients can then always
+/// reconstruct the symbol context using the pointer, or use it to uniquely
+/// identify a symbol context for an object.
///
-/// Example objects include that currently use "SymbolContextScope *"
-/// objects include:
+/// Example objects include that currently use "SymbolContextScope *" objects
+/// include:
/// @li Variable objects that can reconstruct where they are scoped
/// by making sure the SymbolContextScope * comes from the scope
/// in which the variable was declared. If a variable is a global,
@@ -63,11 +62,11 @@ namespace lldb_private {
/// location) match within the same thread, that the stack
/// frame is the same as the previous stack frame.
///
-/// Objects that adhere to this protocol can reconstruct enough of a
-/// symbol context to allow functions that take a symbol context to be
-/// called. Lists can also be created using a SymbolContextScope* and
-/// and object pairs that allow large collections of objects to be
-/// passed around with minimal overhead.
+/// Objects that adhere to this protocol can reconstruct enough of a symbol
+/// context to allow functions that take a symbol context to be called. Lists
+/// can also be created using a SymbolContextScope* and and object pairs that
+/// allow large collections of objects to be passed around with minimal
+/// overhead.
//----------------------------------------------------------------------
class SymbolContextScope {
public:
@@ -76,9 +75,9 @@ public:
//------------------------------------------------------------------
/// Reconstruct the object's symbol context into \a sc.
///
- /// The object should fill in as much of the SymbolContext as it
- /// can so function calls that require a symbol context can be made
- /// for the given object.
+ /// The object should fill in as much of the SymbolContext as it can so
+ /// function calls that require a symbol context can be made for the given
+ /// object.
///
/// @param[out] sc
/// A symbol context object pointer that gets filled in.
@@ -100,9 +99,9 @@ public:
//------------------------------------------------------------------
/// Dump the object's symbol context to the stream \a s.
///
- /// The object should dump its symbol context to the stream \a s.
- /// This function is widely used in the DumpDebug and verbose output
- /// for lldb objects.
+ /// The object should dump its symbol context to the stream \a s. This
+ /// function is widely used in the DumpDebug and verbose output for lldb
+ /// objects.
///
/// @param[in] s
/// The stream to which to dump the object's symbol context.
diff --git a/include/lldb/Symbol/SymbolFile.h b/include/lldb/Symbol/SymbolFile.h
index 69110dc68cd7..7b77c60a3c3d 100644
--- a/include/lldb/Symbol/SymbolFile.h
+++ b/include/lldb/Symbol/SymbolFile.h
@@ -26,10 +26,10 @@ public:
//------------------------------------------------------------------
// Symbol file ability bits.
//
- // Each symbol file can claim to support one or more symbol file
- // abilities. These get returned from SymbolFile::GetAbilities().
- // These help us to determine which plug-in will be best to load
- // the debug information found in files.
+ // Each symbol file can claim to support one or more symbol file abilities.
+ // These get returned from SymbolFile::GetAbilities(). These help us to
+ // determine which plug-in will be best to load the debug information found
+ // in files.
//------------------------------------------------------------------
enum Abilities {
CompileUnits = (1u << 0),
@@ -148,10 +148,10 @@ public:
SymbolContextList &sc_list);
virtual uint32_t
FindGlobalVariables(const ConstString &name,
- const CompilerDeclContext *parent_decl_ctx, bool append,
+ const CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, VariableList &variables);
virtual uint32_t FindGlobalVariables(const RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
VariableList &variables);
virtual uint32_t FindFunctions(const ConstString &name,
const CompilerDeclContext *parent_decl_ctx,
@@ -200,6 +200,8 @@ public:
//------------------------------------------------------------------
virtual void SectionFileAddressesChanged() {}
+ virtual void Dump(Stream &s) {}
+
protected:
ObjectFile *m_obj_file; // The object file that symbols can be extracted from.
uint32_t m_abilities;
diff --git a/include/lldb/Symbol/SymbolVendor.h b/include/lldb/Symbol/SymbolVendor.h
index 7db3de6e690c..312b146f2970 100644
--- a/include/lldb/Symbol/SymbolVendor.h
+++ b/include/lldb/Symbol/SymbolVendor.h
@@ -22,14 +22,13 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// The symbol vendor class is designed to abstract the process of
-// searching for debug information for a given module. Platforms can
-// subclass this class and provide extra ways to find debug information.
-// Examples would be a subclass that would allow for locating a stand
-// alone debug file, parsing debug maps, or runtime data in the object
-// files. A symbol vendor can use multiple sources (SymbolFile
-// objects) to provide the information and only parse as deep as needed
-// in order to provide the information that is requested.
+// The symbol vendor class is designed to abstract the process of searching for
+// debug information for a given module. Platforms can subclass this class and
+// provide extra ways to find debug information. Examples would be a subclass
+// that would allow for locating a stand alone debug file, parsing debug maps,
+// or runtime data in the object files. A symbol vendor can use multiple
+// sources (SymbolFile objects) to provide the information and only parse as
+// deep as needed in order to provide the information that is requested.
//----------------------------------------------------------------------
class SymbolVendor : public ModuleChild, public PluginInterface {
public:
@@ -82,11 +81,11 @@ public:
virtual size_t FindGlobalVariables(const ConstString &name,
const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variables);
virtual size_t FindGlobalVariables(const RegularExpression &regex,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variables);
virtual size_t FindFunctions(const ConstString &name,
diff --git a/include/lldb/Symbol/Type.h b/include/lldb/Symbol/Type.h
index 9740dc25a587..fec2578c9fec 100644
--- a/include/lldb/Symbol/Type.h
+++ b/include/lldb/Symbol/Type.h
@@ -24,8 +24,8 @@
namespace lldb_private {
//----------------------------------------------------------------------
-// CompilerContext allows an array of these items to be passed to
-// perform detailed lookups in SymbolVendor and SymbolFile functions.
+// CompilerContext allows an array of these items to be passed to perform
+// detailed lookups in SymbolVendor and SymbolFile functions.
//----------------------------------------------------------------------
struct CompilerContext {
CompilerContext(CompilerContextKind t, const ConstString &n)
@@ -82,16 +82,12 @@ public:
eEncodingIsSyntheticUID
} EncodingDataType;
- // We must force the underlying type of the enum to be unsigned here. Not all
- // compilers
- // behave the same with regards to the default underlying type of an enum, but
- // because
- // this enum is used in an enum bitfield and integer comparisons are done with
- // the value
- // we need to guarantee that it's always unsigned so that, for example,
- // eResolveStateFull
- // doesn't compare less than eResolveStateUnresolved when used in a 2-bit
- // bitfield.
+ // We must force the underlying type of the enum to be unsigned here. Not
+ // all compilers behave the same with regards to the default underlying type
+ // of an enum, but because this enum is used in an enum bitfield and integer
+ // comparisons are done with the value we need to guarantee that it's always
+ // unsigned so that, for example, eResolveStateFull doesn't compare less than
+ // eResolveStateUnresolved when used in a 2-bit bitfield.
typedef enum ResolveStateTag : unsigned {
eResolveStateUnresolved = 0,
eResolveStateForward = 1,
@@ -106,8 +102,7 @@ public:
ResolveState compiler_type_resolve_state);
// This makes an invalid type. Used for functions that return a Type when
- // they
- // get an error.
+ // they get an error.
Type();
Type(const Type &rhs);
@@ -119,7 +114,8 @@ public:
void DumpTypeName(Stream *s);
// Since Type instances only keep a "SymbolFile *" internally, other classes
- // like TypeImpl need make sure the module is still around before playing with
+ // like TypeImpl need make sure the module is still around before playing
+ // with
// Type instances. They can store a weak pointer to the Module;
lldb::ModuleSP GetModule();
@@ -188,8 +184,8 @@ public:
CompilerType GetFullCompilerType();
// Get the clang type, and resolve definitions enough so that the type could
- // have layout performed. This allows ptrs and refs to class/struct/union/enum
- // types remain forward declarations.
+ // have layout performed. This allows ptrs and refs to
+ // class/struct/union/enum types remain forward declarations.
CompilerType GetLayoutCompilerType();
// Get the clang type and leave class/struct/union/enum types as forward
@@ -198,8 +194,8 @@ public:
static int Compare(const Type &a, const Type &b);
- // From a fully qualified typename, split the type into the type basename
- // and the remaining type scope (namespaces/classes).
+ // From a fully qualified typename, split the type into the type basename and
+ // the remaining type scope (namespaces/classes).
static bool GetTypeScopeAndBasename(const llvm::StringRef& name,
llvm::StringRef &scope,
llvm::StringRef &basename,
@@ -366,8 +362,8 @@ protected:
lldb::TypeSP type_sp;
};
-// the two classes here are used by the public API as a backend to
-// the SBType and SBTypeList classes
+// the two classes here are used by the public API as a backend to the SBType
+// and SBTypeList classes
class TypeImpl {
public:
diff --git a/include/lldb/Symbol/TypeSystem.h b/include/lldb/Symbol/TypeSystem.h
index ff85d8428746..94d1b9cdf3fd 100644
--- a/include/lldb/Symbol/TypeSystem.h
+++ b/include/lldb/Symbol/TypeSystem.h
@@ -66,8 +66,8 @@ public:
// {
// }
//
- // Then you can use the llvm casting on any "TypeSystem *" to get an
- // instance of your subclass.
+ // Then you can use the llvm casting on any "TypeSystem *" to get an instance
+ // of your subclass.
//----------------------------------------------------------------------
enum LLVMCastKind {
eKindClang,
@@ -94,8 +94,7 @@ public:
Target *target);
// Free up any resources associated with this TypeSystem. Done before
- // removing
- // all the TypeSystems from the TypeSystemMap.
+ // removing all the TypeSystems from the TypeSystemMap.
virtual void Finalize() {}
virtual DWARFASTParser *GetDWARFParser() { return nullptr; }
@@ -239,8 +238,7 @@ public:
virtual CompilerType GetCanonicalType(lldb::opaque_compiler_type_t type) = 0;
// Returns -1 if this isn't a function of if the function doesn't have a
- // prototype
- // Returns a value >= 0 if there is a prototype.
+ // prototype Returns a value >= 0 if there is a prototype.
virtual int GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) = 0;
virtual CompilerType
@@ -332,8 +330,8 @@ public:
bool &child_is_base_class, bool &child_is_deref_of_parent,
ValueObject *valobj, uint64_t &language_flags) = 0;
- // Lookup a child given a name. This function will match base class names
- // and member member names in "clang_type" only, not descendants.
+ // Lookup a child given a name. This function will match base class names and
+ // member member names in "clang_type" only, not descendants.
virtual uint32_t GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
bool omit_empty_base_classes) = 0;
@@ -395,8 +393,8 @@ public:
lldb::offset_t data_offset,
size_t data_byte_size) = 0;
- // Converts "s" to a floating point value and place resulting floating
- // point bytes in the "dst" buffer.
+ // Converts "s" to a floating point value and place resulting floating point
+ // bytes in the "dst" buffer.
virtual size_t ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
size_t dst_size) = 0;
@@ -481,23 +479,17 @@ public:
virtual LazyBool ShouldPrintAsOneLiner(void *type, ValueObject *valobj);
// Type systems can have types that are placeholder types, which are meant to
- // indicate
- // the presence of a type, but offer no actual information about said types,
- // and leave
- // the burden of actually figuring type information out to dynamic type
- // resolution. For instance
- // a language with a generics system, can use placeholder types to indicate
- // "type argument goes here",
- // without promising uniqueness of the placeholder, nor attaching any actually
- // idenfiable information
- // to said placeholder. This API allows type systems to tell LLDB when such a
- // type has been encountered
- // In response, the debugger can react by not using this type as a cache entry
- // in any type-specific way
- // For instance, LLDB will currently not cache any formatters that are
- // discovered on such a type as
- // attributable to the meaningless type itself, instead preferring to use the
- // dynamic type
+ // indicate the presence of a type, but offer no actual information about
+ // said types, and leave the burden of actually figuring type information out
+ // to dynamic type resolution. For instance a language with a generics
+ // system, can use placeholder types to indicate "type argument goes here",
+ // without promising uniqueness of the placeholder, nor attaching any
+ // actually idenfiable information to said placeholder. This API allows type
+ // systems to tell LLDB when such a type has been encountered In response,
+ // the debugger can react by not using this type as a cache entry in any
+ // type-specific way For instance, LLDB will currently not cache any
+ // formatters that are discovered on such a type as attributable to the
+ // meaningless type itself, instead preferring to use the dynamic type
virtual bool IsMeaninglessWithoutDynamicResolution(void *type);
protected:
@@ -514,8 +506,8 @@ public:
// empties the map.
void Clear();
- // Iterate through all of the type systems that are created. Return true
- // from callback to keep iterating, false to stop iterating.
+ // Iterate through all of the type systems that are created. Return true from
+ // callback to keep iterating, false to stop iterating.
void ForEach(std::function<bool(TypeSystem *)> const &callback);
TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language,
diff --git a/include/lldb/Symbol/UnwindPlan.h b/include/lldb/Symbol/UnwindPlan.h
index abb57a2c499d..a76ea23b46bc 100644
--- a/include/lldb/Symbol/UnwindPlan.h
+++ b/include/lldb/Symbol/UnwindPlan.h
@@ -25,28 +25,25 @@
namespace lldb_private {
-// The UnwindPlan object specifies how to unwind out of a function - where
-// this function saves the caller's register values before modifying them
-// (for non-volatile aka saved registers) and how to find this frame's
-// Canonical Frame Address (CFA).
-
-// Most commonly, registers are saved on the stack, offset some bytes from
-// the Canonical Frame Address, or CFA, which is the starting address of
-// this function's stack frame (the CFA is same as the eh_frame's CFA,
-// whatever that may be on a given architecture).
-// The CFA address for the stack frame does not change during
-// the lifetime of the function.
+// The UnwindPlan object specifies how to unwind out of a function - where this
+// function saves the caller's register values before modifying them (for non-
+// volatile aka saved registers) and how to find this frame's Canonical Frame
+// Address (CFA).
+
+// Most commonly, registers are saved on the stack, offset some bytes from the
+// Canonical Frame Address, or CFA, which is the starting address of this
+// function's stack frame (the CFA is same as the eh_frame's CFA, whatever that
+// may be on a given architecture). The CFA address for the stack frame does
+// not change during the lifetime of the function.
// Internally, the UnwindPlan is structured as a vector of register locations
// organized by code address in the function, showing which registers have been
-// saved at that point and where they are saved.
-// It can be thought of as the expanded table form of the DWARF CFI
-// encoded information.
+// saved at that point and where they are saved. It can be thought of as the
+// expanded table form of the DWARF CFI encoded information.
// Other unwind information sources will be converted into UnwindPlans before
-// being added to a FuncUnwinders object. The unwind source may be
-// an eh_frame FDE, a DWARF debug_frame FDE, or assembly language based
-// prologue analysis.
+// being added to a FuncUnwinders object. The unwind source may be an eh_frame
+// FDE, a DWARF debug_frame FDE, or assembly language based prologue analysis.
// The UnwindPlan is the canonical form of this information that the unwinder
// code will use when walking the stack.
@@ -371,12 +368,10 @@ public:
void InsertRow(const RowSP &row_sp, bool replace_existing = false);
// Returns a pointer to the best row for the given offset into the function's
- // instructions.
- // If offset is -1 it indicates that the function start is unknown - the final
- // row in the UnwindPlan is returned.
- // In practice, the UnwindPlan for a function with no known start address will
- // be the architectural default
- // UnwindPlan which will only have one row.
+ // instructions. If offset is -1 it indicates that the function start is
+ // unknown - the final row in the UnwindPlan is returned. In practice, the
+ // UnwindPlan for a function with no known start address will be the
+ // architectural default UnwindPlan which will only have one row.
UnwindPlan::RowSP GetRowForFunctionOffset(int offset) const;
lldb::RegisterKind GetRegisterKind() const { return m_register_kind; }
@@ -427,15 +422,13 @@ public:
}
// Is this UnwindPlan valid at all instructions? If not, then it is assumed
- // valid at call sites,
- // e.g. for exception handling.
+ // valid at call sites, e.g. for exception handling.
lldb_private::LazyBool GetUnwindPlanValidAtAllInstructions() const {
return m_plan_is_valid_at_all_instruction_locations;
}
// Is this UnwindPlan valid at all instructions? If not, then it is assumed
- // valid at call sites,
- // e.g. for exception handling.
+ // valid at call sites, e.g. for exception handling.
void SetUnwindPlanValidAtAllInstructions(
lldb_private::LazyBool valid_at_all_insn) {
m_plan_is_valid_at_all_instruction_locations = valid_at_all_insn;
diff --git a/include/lldb/Symbol/UnwindTable.h b/include/lldb/Symbol/UnwindTable.h
index 851d24bea03b..5c83e3003192 100644
--- a/include/lldb/Symbol/UnwindTable.h
+++ b/include/lldb/Symbol/UnwindTable.h
@@ -18,8 +18,8 @@
namespace lldb_private {
// A class which holds all the FuncUnwinders objects for a given ObjectFile.
-// The UnwindTable is populated with FuncUnwinders objects lazily during
-// the debug session.
+// The UnwindTable is populated with FuncUnwinders objects lazily during the
+// debug session.
class UnwindTable {
public:
@@ -39,16 +39,13 @@ public:
bool GetAllowAssemblyEmulationUnwindPlans();
// Normally when we create a new FuncUnwinders object we track it in this
- // UnwindTable so it can
- // be reused later. But for the target modules show-unwind we want to create
- // brand new
- // UnwindPlans for the function of interest - so ignore any existing
- // FuncUnwinders for that
- // function and don't add this new one to our UnwindTable.
- // This FuncUnwinders object does have a reference to the UnwindTable but the
- // lifetime of this
- // uncached FuncUnwinders is expected to be short so in practice this will not
- // be a problem.
+ // UnwindTable so it can be reused later. But for the target modules show-
+ // unwind we want to create brand new UnwindPlans for the function of
+ // interest - so ignore any existing FuncUnwinders for that function and
+ // don't add this new one to our UnwindTable. This FuncUnwinders object does
+ // have a reference to the UnwindTable but the lifetime of this uncached
+ // FuncUnwinders is expected to be short so in practice this will not be a
+ // problem.
lldb::FuncUnwindersSP
GetUncachedFuncUnwindersContainingAddress(const Address &addr,
SymbolContext &sc);
diff --git a/include/lldb/Symbol/Variable.h b/include/lldb/Symbol/Variable.h
index 507b41309042..531312e63591 100644
--- a/include/lldb/Symbol/Variable.h
+++ b/include/lldb/Symbol/Variable.h
@@ -17,6 +17,7 @@
#include "lldb/Core/RangeMap.h"
#include "lldb/Expression/DWARFExpression.h"
#include "lldb/Symbol/Declaration.h"
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/UserID.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-private.h"
@@ -53,11 +54,11 @@ public:
SymbolContextScope *GetSymbolContextScope() const { return m_owner_scope; }
- // Since a variable can have a basename "i" and also a mangled
- // named "_ZN12_GLOBAL__N_11iE" and a demangled mangled name
- // "(anonymous namespace)::i", this function will allow a generic match
- // function that can be called by commands and expression parsers to make
- // sure we match anything we come across.
+ // Since a variable can have a basename "i" and also a mangled named
+ // "_ZN12_GLOBAL__N_11iE" and a demangled mangled name "(anonymous
+ // namespace)::i", this function will allow a generic match function that can
+ // be called by commands and expression parsers to make sure we match
+ // anything we come across.
bool NameMatches(const ConstString &name) const;
bool NameMatches(const RegularExpression &regex) const;
@@ -103,8 +104,7 @@ public:
ValueObjectList &valobj_list);
static size_t AutoComplete(const ExecutionContext &exe_ctx,
- llvm::StringRef name, StringList &matches,
- bool &word_complete);
+ CompletionRequest &request);
CompilerDeclContext GetDeclContext();
diff --git a/include/lldb/Symbol/VariableList.h b/include/lldb/Symbol/VariableList.h
index c9e0be89a3bc..6729a9c108a9 100644
--- a/include/lldb/Symbol/VariableList.h
+++ b/include/lldb/Symbol/VariableList.h
@@ -50,11 +50,11 @@ public:
size_t AppendVariablesIfUnique(VariableList &var_list);
- // Returns the actual number of unique variables that were added to the
- // list. "total_matches" will get updated with the actually number of
- // matches that were found regardless of whether they were unique or not
- // to allow for error conditions when nothing is found, versus conditions
- // where any variables that match "regex" were already in "var_list".
+ // Returns the actual number of unique variables that were added to the list.
+ // "total_matches" will get updated with the actually number of matches that
+ // were found regardless of whether they were unique or not to allow for
+ // error conditions when nothing is found, versus conditions where any
+ // variables that match "regex" were already in "var_list".
size_t AppendVariablesIfUnique(const RegularExpression &regex,
VariableList &var_list, size_t &total_matches);
@@ -66,6 +66,7 @@ public:
size_t MemorySize() const;
size_t GetSize() const;
+ bool Empty() const { return m_variables.empty(); }
protected:
typedef std::vector<lldb::VariableSP> collection;
diff --git a/include/lldb/Target/ABI.h b/include/lldb/Target/ABI.h
index 0418d683af63..343b3a749597 100644
--- a/include/lldb/Target/ABI.h
+++ b/include/lldb/Target/ABI.h
@@ -82,8 +82,7 @@ public:
protected:
// This is the method the ABI will call to actually calculate the return
- // value.
- // Don't put it in a persistent value object, that will be done by the
+ // value. Don't put it in a persistent value object, that will be done by the
// ABI::GetReturnValueObject.
virtual lldb::ValueObjectSP
GetReturnValueObjectImpl(Thread &thread, CompilerType &ast_type) const = 0;
@@ -118,17 +117,17 @@ public:
// restrictions (4, 8 or 16 byte aligned), and zero is usually not allowed.
// This function should return true if "cfa" is valid call frame address for
// the ABI, and false otherwise. This is used by the generic stack frame
- // unwinding
- // code to help determine when a stack ends.
+ // unwinding code to help determine when a stack ends.
virtual bool CallFrameAddressIsValid(lldb::addr_t cfa) = 0;
- // Validates a possible PC value and returns true if an opcode can be at "pc".
+ // Validates a possible PC value and returns true if an opcode can be at
+ // "pc".
virtual bool CodeAddressIsValid(lldb::addr_t pc) = 0;
virtual lldb::addr_t FixCodeAddress(lldb::addr_t pc) {
- // Some targets might use bits in a code address to indicate
- // a mode switch. ARM uses bit zero to signify a code address is
- // thumb, so any ARM ABI plug-ins would strip those bits.
+ // Some targets might use bits in a code address to indicate a mode switch.
+ // ARM uses bit zero to signify a code address is thumb, so any ARM ABI
+ // plug-ins would strip those bits.
return pc;
}
diff --git a/include/lldb/Target/DynamicLoader.h b/include/lldb/Target/DynamicLoader.h
index b5890662d4e5..de9c4e233b0c 100644
--- a/include/lldb/Target/DynamicLoader.h
+++ b/include/lldb/Target/DynamicLoader.h
@@ -48,24 +48,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class DynamicLoader DynamicLoader.h "lldb/Target/DynamicLoader.h"
-/// @brief A plug-in interface definition class for dynamic loaders.
+/// A plug-in interface definition class for dynamic loaders.
///
/// Dynamic loader plug-ins track image (shared library) loading and
-/// unloading. The class is initialized given a live process that is
-/// halted at its entry point or just after attaching.
+/// unloading. The class is initialized given a live process that is halted at
+/// its entry point or just after attaching.
///
-/// Dynamic loader plug-ins can track the process by registering
-/// callbacks using the:
-/// Process::RegisterNotificationCallbacks (const Notifications&)
+/// Dynamic loader plug-ins can track the process by registering callbacks
+/// using the: Process::RegisterNotificationCallbacks (const Notifications&)
/// function.
///
-/// Breakpoints can also be set in the process which can register
-/// functions that get called using:
-/// Process::BreakpointSetCallback (lldb::user_id_t, BreakpointHitCallback, void
-/// *).
-/// These breakpoint callbacks return a boolean value that indicates if
-/// the process should continue or halt and should return the global
-/// setting for this using:
+/// Breakpoints can also be set in the process which can register functions
+/// that get called using: Process::BreakpointSetCallback (lldb::user_id_t,
+/// BreakpointHitCallback, void *). These breakpoint callbacks return a
+/// boolean value that indicates if the process should continue or halt and
+/// should return the global setting for this using:
/// DynamicLoader::StopWhenImagesChange() const.
//----------------------------------------------------------------------
class DynamicLoader : public PluginInterface {
@@ -73,9 +70,8 @@ public:
//------------------------------------------------------------------
/// Find a dynamic loader plugin for a given process.
///
- /// Scans the installed DynamicLoader plug-ins and tries to find
- /// an instance that can be used to track image changes in \a
- /// process.
+ /// Scans the installed DynamicLoader plug-ins and tries to find an instance
+ /// that can be used to track image changes in \a process.
///
/// @param[in] process
/// The process for which to try and locate a dynamic loader
@@ -95,45 +91,44 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
virtual ~DynamicLoader() override;
//------------------------------------------------------------------
/// Called after attaching a process.
///
- /// Allow DynamicLoader plug-ins to execute some code after
- /// attaching to a process.
+ /// Allow DynamicLoader plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach() = 0;
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow DynamicLoader plug-ins to execute some code after
- /// the process has stopped for the first time on launch.
+ /// Allow DynamicLoader plug-ins to execute some code after the process has
+ /// stopped for the first time on launch.
//------------------------------------------------------------------
virtual void DidLaunch() = 0;
//------------------------------------------------------------------
- /// Helper function that can be used to detect when a process has
- /// called exec and is now a new and different process. This can
- /// be called when necessary to try and detect the exec. The process
- /// might be able to answer this question, but sometimes it might
- /// not be able and the dynamic loader often knows what the program
- /// entry point is. So the process and the dynamic loader can work
- /// together to detect this.
+ /// Helper function that can be used to detect when a process has called
+ /// exec and is now a new and different process. This can be called when
+ /// necessary to try and detect the exec. The process might be able to
+ /// answer this question, but sometimes it might not be able and the dynamic
+ /// loader often knows what the program entry point is. So the process and
+ /// the dynamic loader can work together to detect this.
//------------------------------------------------------------------
virtual bool ProcessDidExec() { return false; }
//------------------------------------------------------------------
/// Get whether the process should stop when images change.
///
- /// When images (executables and shared libraries) get loaded or
- /// unloaded, often debug sessions will want to try and resolve or
- /// unresolve breakpoints that are set in these images. Any
- /// breakpoints set by DynamicLoader plug-in instances should
- /// return this value to ensure consistent debug session behaviour.
+ /// When images (executables and shared libraries) get loaded or unloaded,
+ /// often debug sessions will want to try and resolve or unresolve
+ /// breakpoints that are set in these images. Any breakpoints set by
+ /// DynamicLoader plug-in instances should return this value to ensure
+ /// consistent debug session behaviour.
///
/// @return
/// Returns \b true if the process should stop when images
@@ -144,11 +139,11 @@ public:
//------------------------------------------------------------------
/// Set whether the process should stop when images change.
///
- /// When images (executables and shared libraries) get loaded or
- /// unloaded, often debug sessions will want to try and resolve or
- /// unresolve breakpoints that are set in these images. The default
- /// is set so that the process stops when images change, but this
- /// can be overridden using this function callback.
+ /// When images (executables and shared libraries) get loaded or unloaded,
+ /// often debug sessions will want to try and resolve or unresolve
+ /// breakpoints that are set in these images. The default is set so that the
+ /// process stops when images change, but this can be overridden using this
+ /// function callback.
///
/// @param[in] stop
/// Boolean value that indicates whether the process should stop
@@ -157,8 +152,8 @@ public:
void SetStopWhenImagesChange(bool stop);
//------------------------------------------------------------------
- /// Provides a plan to step through the dynamic loader trampoline
- /// for the current state of \a thread.
+ /// Provides a plan to step through the dynamic loader trampoline for the
+ /// current state of \a thread.
///
///
/// @param[in] stop_others
@@ -173,12 +168,9 @@ public:
//------------------------------------------------------------------
/// Some dynamic loaders provide features where there are a group of symbols
- /// "equivalent to"
- /// a given symbol one of which will be chosen when the symbol is bound. If
- /// you want to
- /// set a breakpoint on one of these symbols, you really need to set it on all
- /// the
- /// equivalent symbols.
+ /// "equivalent to" a given symbol one of which will be chosen when the
+ /// symbol is bound. If you want to set a breakpoint on one of these
+ /// symbols, you really need to set it on all the equivalent symbols.
///
///
/// @param[in] original_symbol
@@ -201,13 +193,12 @@ public:
}
//------------------------------------------------------------------
- /// Ask if it is ok to try and load or unload an shared library
- /// (image).
+ /// Ask if it is ok to try and load or unload an shared library (image).
///
- /// The dynamic loader often knows when it would be ok to try and
- /// load or unload a shared library. This function call allows the
- /// dynamic loader plug-ins to check any current dyld state to make
- /// sure it is an ok time to load a shared library.
+ /// The dynamic loader often knows when it would be ok to try and load or
+ /// unload a shared library. This function call allows the dynamic loader
+ /// plug-ins to check any current dyld state to make sure it is an ok time
+ /// to load a shared library.
///
/// @return
/// \b true if it is currently ok to try and load a shared
@@ -216,20 +207,20 @@ public:
virtual Status CanLoadImage() = 0;
//------------------------------------------------------------------
- /// Ask if the eh_frame information for the given SymbolContext should
- /// be relied on even when it's the first frame in a stack unwind.
+ /// Ask if the eh_frame information for the given SymbolContext should be
+ /// relied on even when it's the first frame in a stack unwind.
///
- /// The CFI instructions from the eh_frame section are normally only
- /// valid at call sites -- places where a program could throw an
- /// exception and need to unwind out. But some Modules may be known
- /// to the system as having reliable eh_frame information at all call
- /// sites. This would be the case if the Module's contents are largely
- /// hand-written assembly with hand-written eh_frame information.
- /// Normally when unwinding from a function at the beginning of a stack
- /// unwind lldb will examine the assembly instructions to understand
- /// how the stack frame is set up and where saved registers are stored.
- /// But with hand-written assembly this is not reliable enough -- we need
- /// to consult those function's hand-written eh_frame information.
+ /// The CFI instructions from the eh_frame section are normally only valid
+ /// at call sites -- places where a program could throw an exception and
+ /// need to unwind out. But some Modules may be known to the system as
+ /// having reliable eh_frame information at all call sites. This would be
+ /// the case if the Module's contents are largely hand-written assembly with
+ /// hand-written eh_frame information. Normally when unwinding from a
+ /// function at the beginning of a stack unwind lldb will examine the
+ /// assembly instructions to understand how the stack frame is set up and
+ /// where saved registers are stored. But with hand-written assembly this is
+ /// not reliable enough -- we need to consult those function's hand-written
+ /// eh_frame information.
///
/// @return
/// \b True if the symbol context should use eh_frame instructions
@@ -271,17 +262,17 @@ public:
//------------------------------------------------------------------
/// Get information about the shared cache for a process, if possible.
///
- /// On some systems (e.g. Darwin based systems), a set of libraries
- /// that are common to most processes may be put in a single region
- /// of memory and mapped into every process, this is called the
- /// shared cache, as a performance optimization.
+ /// On some systems (e.g. Darwin based systems), a set of libraries that are
+ /// common to most processes may be put in a single region of memory and
+ /// mapped into every process, this is called the shared cache, as a
+ /// performance optimization.
///
/// Many targets will not have the concept of a shared cache.
///
- /// Depending on how the DynamicLoader gathers information about the
- /// shared cache, it may be able to only return basic information -
- /// like the UUID of the cache - or it may be able to return additional
- /// information about the cache.
+ /// Depending on how the DynamicLoader gathers information about the shared
+ /// cache, it may be able to only return basic information - like the UUID
+ /// of the cache - or it may be able to return additional information about
+ /// the cache.
///
/// @param[out] base_address
/// The base address (load address) of the shared cache.
@@ -356,8 +347,8 @@ protected:
// Return -1 if the read fails, otherwise return the result as an int64_t.
int64_t ReadUnsignedIntWithSizeInBytes(lldb::addr_t addr, int size_in_bytes);
- // Read a pointer from memory at the given addr.
- // Return LLDB_INVALID_ADDRESS if the read fails.
+ // Read a pointer from memory at the given addr. Return LLDB_INVALID_ADDRESS
+ // if the read fails.
lldb::addr_t ReadPointer(lldb::addr_t addr);
// Calls into the Process protected method LoadOperatingSystemPlugin:
diff --git a/include/lldb/Target/ExecutionContext.h b/include/lldb/Target/ExecutionContext.h
index 04af3ebc278d..70eba3654dec 100644
--- a/include/lldb/Target/ExecutionContext.h
+++ b/include/lldb/Target/ExecutionContext.h
@@ -22,61 +22,59 @@
namespace lldb_private {
//===----------------------------------------------------------------------===//
-/// Execution context objects refer to objects in the execution of the
-/// program that is being debugged. The consist of one or more of the
-/// following objects: target, process, thread, and frame. Many objects
-/// in the debugger need to track different executions contexts. For
-/// example, a local function variable might have an execution context
-/// that refers to a stack frame. A global or static variable might
-/// refer to a target since a stack frame isn't required in order to
-/// evaluate a global or static variable (a process isn't necessarily
-/// needed for a global variable since we might be able to read the
-/// variable value from a data section in one of the object files in
+/// Execution context objects refer to objects in the execution of the program
+/// that is being debugged. The consist of one or more of the following
+/// objects: target, process, thread, and frame. Many objects in the debugger
+/// need to track different executions contexts. For example, a local function
+/// variable might have an execution context that refers to a stack frame. A
+/// global or static variable might refer to a target since a stack frame
+/// isn't required in order to evaluate a global or static variable (a process
+/// isn't necessarily needed for a global variable since we might be able to
+/// read the variable value from a data section in one of the object files in
/// a target). There are two types of objects that hold onto execution
-/// contexts: ExecutionContextRef and ExecutionContext. Both of these
-/// objects are described below.
+/// contexts: ExecutionContextRef and ExecutionContext. Both of these objects
+/// are described below.
///
-/// Not all objects in an ExectionContext objects will be valid. If you want
-/// to refer strongly (ExectionContext) or weakly (ExectionContextRef) to
-/// a process, then only the process and target references will be valid.
-/// For threads, only the thread, process and target references will be
-/// filled in. For frames, all of the objects will be filled in.
+/// Not all objects in an ExecutionContext objects will be valid. If you want
+/// to refer strongly (ExecutionContext) or weakly (ExecutionContextRef) to a
+/// process, then only the process and target references will be valid. For
+/// threads, only the thread, process and target references will be filled in.
+/// For frames, all of the objects will be filled in.
///
-/// These classes are designed to be used as baton objects that get passed
-/// to a wide variety of functions that require execution contexts.
+/// These classes are designed to be used as baton objects that get passed to
+/// a wide variety of functions that require execution contexts.
//===----------------------------------------------------------------------===//
//----------------------------------------------------------------------
/// @class ExecutionContextRef ExecutionContext.h
/// "lldb/Target/ExecutionContext.h"
-/// @brief A class that holds a weak reference to an execution context.
+/// A class that holds a weak reference to an execution context.
///
-/// ExecutionContextRef objects are designed to hold onto an execution
-/// context that might change over time. For example, if an object wants
-/// to refer to a stack frame, it should hold onto an ExecutionContextRef
-/// to a frame object. The backing object that represents the stack frame
-/// might change over time and instances of this object can track the logical
-/// object that refers to a frame even if it does change.
+/// ExecutionContextRef objects are designed to hold onto an execution context
+/// that might change over time. For example, if an object wants to refer to a
+/// stack frame, it should hold onto an ExecutionContextRef to a frame object.
+/// The backing object that represents the stack frame might change over time
+/// and instances of this object can track the logical object that refers to a
+/// frame even if it does change.
///
/// These objects also don't keep execution objects around longer than they
-/// should since they use weak pointers. For example if an object refers
-/// to a stack frame and a stack frame is no longer in a thread, then a
-/// ExecutionContextRef object that refers to that frame will not be able
-/// to get a shared pointer to those objects since they are no longer around.
+/// should since they use weak pointers. For example if an object refers to a
+/// stack frame and a stack frame is no longer in a thread, then a
+/// ExecutionContextRef object that refers to that frame will not be able to
+/// get a shared pointer to those objects since they are no longer around.
///
-/// ExecutionContextRef objects can also be used as objects in classes
-/// that want to track a "previous execution context". Since the weak
-/// references to the execution objects (target, process, thread and frame)
-/// don't keep these objects around, they are safe to keep around.
+/// ExecutionContextRef objects can also be used as objects in classes that
+/// want to track a "previous execution context". Since the weak references to
+/// the execution objects (target, process, thread and frame) don't keep these
+/// objects around, they are safe to keep around.
///
-/// The general rule of thumb is all long lived objects that want to
-/// refer to execution contexts should use ExecutionContextRef objects.
-/// The ExecutionContext class is used to temporarily get shared
-/// pointers to any execution context objects that are still around
-/// so they are guaranteed to exist during a function that requires the
-/// objects. ExecutionContext objects should NOT be used for long term
-/// storage since they will keep objects alive with extra shared pointer
-/// references to these objects.
+/// The general rule of thumb is all long lived objects that want to refer to
+/// execution contexts should use ExecutionContextRef objects. The
+/// ExecutionContext class is used to temporarily get shared pointers to any
+/// execution context objects that are still around so they are guaranteed to
+/// exist during a function that requires the objects. ExecutionContext
+/// objects should NOT be used for long term storage since they will keep
+/// objects alive with extra shared pointer references to these objects.
//----------------------------------------------------------------------
class ExecutionContextRef {
public:
@@ -93,9 +91,9 @@ public:
//------------------------------------------------------------------
/// Construct using an ExecutionContext object that might be nullptr.
///
- /// If \a exe_ctx_ptr is valid, then make weak references to any
- /// valid objects in the ExecutionContext, otherwise no weak
- /// references to any execution context objects will be made.
+ /// If \a exe_ctx_ptr is valid, then make weak references to any valid
+ /// objects in the ExecutionContext, otherwise no weak references to any
+ /// execution context objects will be made.
//------------------------------------------------------------------
ExecutionContextRef(const ExecutionContext *exe_ctx_ptr);
@@ -107,38 +105,37 @@ public:
ExecutionContextRef(const ExecutionContext &exe_ctx);
//------------------------------------------------------------------
- /// Construct using the target and all the selected items inside of it
- /// (the process and its selected thread, and the thread's selected
- /// frame). If there is no selected thread, default to the first thread
- /// If there is no selected frame, default to the first frame.
+ /// Construct using the target and all the selected items inside of it (the
+ /// process and its selected thread, and the thread's selected frame). If
+ /// there is no selected thread, default to the first thread If there is no
+ /// selected frame, default to the first frame.
//------------------------------------------------------------------
ExecutionContextRef(Target *target, bool adopt_selected);
//------------------------------------------------------------------
/// Construct using an execution context scope.
///
- /// If the ExecutionContextScope object is valid and refers to a frame,
- /// make weak references too the frame, thread, process and target.
- /// If the ExecutionContextScope object is valid and refers to a thread,
- /// make weak references too the thread, process and target.
- /// If the ExecutionContextScope object is valid and refers to a process,
- /// make weak references too the process and target.
- /// If the ExecutionContextScope object is valid and refers to a target,
- /// make weak references too the target.
+ /// If the ExecutionContextScope object is valid and refers to a frame, make
+ /// weak references too the frame, thread, process and target. If the
+ /// ExecutionContextScope object is valid and refers to a thread, make weak
+ /// references too the thread, process and target. If the
+ /// ExecutionContextScope object is valid and refers to a process, make weak
+ /// references too the process and target. If the ExecutionContextScope
+ /// object is valid and refers to a target, make weak references too the
+ /// target.
//------------------------------------------------------------------
ExecutionContextRef(ExecutionContextScope *exe_scope);
//------------------------------------------------------------------
/// Construct using an execution context scope.
///
- /// If the ExecutionContextScope object refers to a frame,
- /// make weak references too the frame, thread, process and target.
- /// If the ExecutionContextScope object refers to a thread,
- /// make weak references too the thread, process and target.
- /// If the ExecutionContextScope object refers to a process,
- /// make weak references too the process and target.
- /// If the ExecutionContextScope object refers to a target,
- /// make weak references too the target.
+ /// If the ExecutionContextScope object refers to a frame, make weak
+ /// references too the frame, thread, process and target. If the
+ /// ExecutionContextScope object refers to a thread, make weak references
+ /// too the thread, process and target. If the ExecutionContextScope object
+ /// refers to a process, make weak references too the process and target. If
+ /// the ExecutionContextScope object refers to a target, make weak
+ /// references too the target.
//------------------------------------------------------------------
ExecutionContextRef(ExecutionContextScope &exe_scope);
@@ -167,33 +164,33 @@ public:
void Clear();
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the target
- /// referenced in \a target_sp.
+ /// Set accessor that creates a weak reference to the target referenced in
+ /// \a target_sp.
///
- /// If \a target_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous target weak
- /// reference contained in this object will be reset.
+ /// If \a target_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous target weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the target will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the target's process, use
- /// the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the target will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the target's process, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::TargetSP &, bool)
//------------------------------------------------------------------
void SetTargetSP(const lldb::TargetSP &target_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the process
- /// referenced in \a process_sp.
+ /// Set accessor that creates a weak reference to the process referenced in
+ /// \a process_sp.
///
- /// If \a process_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous process weak
- /// reference contained in this object will be reset.
+ /// If \a process_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous process weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the process will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the target, use the
+ /// Only the weak reference to the process will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the target, use the
/// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::ProcessSP &)
@@ -201,34 +198,34 @@ public:
void SetProcessSP(const lldb::ProcessSP &process_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the thread
- /// referenced in \a thread_sp.
+ /// Set accessor that creates a weak reference to the thread referenced in
+ /// \a thread_sp.
///
- /// If \a thread_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous thread weak
- /// reference contained in this object will be reset.
+ /// If \a thread_sp is valid this object will create a weak reference to
+ /// that object, otherwise any previous thread weak reference contained in
+ /// this object will be reset.
///
- /// Only the weak reference to the thread will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the thread's process and
- /// target, use the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the thread will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the thread's process and target, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::ThreadSP &)
//------------------------------------------------------------------
void SetThreadSP(const lldb::ThreadSP &thread_sp);
//------------------------------------------------------------------
- /// Set accessor that creates a weak reference to the frame
- /// referenced in \a frame_sp.
+ /// Set accessor that creates a weak reference to the frame referenced in \a
+ /// frame_sp.
///
- /// If \a frame_sp is valid this object will create a weak
- /// reference to that object, otherwise any previous frame weak
- /// reference contained in this object will be reset.
+ /// If \a frame_sp is valid this object will create a weak reference to that
+ /// object, otherwise any previous frame weak reference contained in this
+ /// object will be reset.
///
- /// Only the weak reference to the frame will be updated, no other
- /// weak references will be modified. If you want this execution
- /// context to make a weak reference to the frame's thread, process
- /// and target, use the ExecutionContextRef::SetContext() functions.
+ /// Only the weak reference to the frame will be updated, no other weak
+ /// references will be modified. If you want this execution context to make
+ /// a weak reference to the frame's thread, process and target, use the
+ /// ExecutionContextRef::SetContext() functions.
///
/// @see ExecutionContextRef::SetContext(const lldb::StackFrameSP &)
//------------------------------------------------------------------
@@ -281,28 +278,25 @@ public:
//------------------------------------------------------------------
/// Create an ExecutionContext object from this object.
///
- /// Create strong references to any execution context objects that
- /// are still valid. Any of the returned shared pointers in the
- /// ExecutionContext objects is not guaranteed to be valid.
- /// @returns
+ /// Create strong references to any execution context objects that are still
+ /// valid. Any of the returned shared pointers in the ExecutionContext
+ /// objects is not guaranteed to be valid. @returns
/// An execution context object that has strong references to
/// any valid weak references in this object.
//------------------------------------------------------------------
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const;
//------------------------------------------------------------------
- /// Returns true if this object has a weak reference to a thread.
- /// The return value is only an indication of whether this object has
- /// a weak reference and does not indicate whether the weak reference
- /// is valid or not.
+ /// Returns true if this object has a weak reference to a thread. The return
+ /// value is only an indication of whether this object has a weak reference
+ /// and does not indicate whether the weak reference is valid or not.
//------------------------------------------------------------------
bool HasThreadRef() const { return m_tid != LLDB_INVALID_THREAD_ID; }
//------------------------------------------------------------------
- /// Returns true if this object has a weak reference to a frame.
- /// The return value is only an indication of whether this object has
- /// a weak reference and does not indicate whether the weak reference
- /// is valid or not.
+ /// Returns true if this object has a weak reference to a frame. The return
+ /// value is only an indication of whether this object has a weak reference
+ /// and does not indicate whether the weak reference is valid or not.
//------------------------------------------------------------------
bool HasFrameRef() const { return m_stack_id.IsValid(); }
@@ -327,25 +321,25 @@ protected:
};
//----------------------------------------------------------------------
-/// @class ExecutionContext ExecutionContext.h "lldb/Target/ExecutionContext.h"
-/// @brief A class that contains an execution context.
+/// @class ExecutionContext ExecutionContext.h
+/// "lldb/Target/ExecutionContext.h"
+/// A class that contains an execution context.
///
-/// This baton object can be passed into any function that requires
-/// a context that specifies a target, process, thread and frame.
-/// These objects are designed to be used for short term execution
-/// context object storage while a function might be trying to evaluate
-/// something that requires a thread or frame. ExecutionContextRef
-/// objects can be used to initialize one of these objects to turn
-/// the weak execution context object references to the target, process,
-/// thread and frame into strong references (shared pointers) so that
-/// functions can guarantee that these objects won't go away in the
+/// This baton object can be passed into any function that requires a context
+/// that specifies a target, process, thread and frame. These objects are
+/// designed to be used for short term execution context object storage while
+/// a function might be trying to evaluate something that requires a thread or
+/// frame. ExecutionContextRef objects can be used to initialize one of these
+/// objects to turn the weak execution context object references to the
+/// target, process, thread and frame into strong references (shared pointers)
+/// so that functions can guarantee that these objects won't go away in the
/// middle of a function.
///
-/// ExecutionContext objects should be used as short lived objects
-/// (typically on the stack) in order to lock down an execution context
-/// for local use and for passing down to other functions that also
-/// require specific contexts. They should NOT be used for long term
-/// storage, for long term storage use ExecutionContextRef objects.
+/// ExecutionContext objects should be used as short lived objects (typically
+/// on the stack) in order to lock down an execution context for local use and
+/// for passing down to other functions that also require specific contexts.
+/// They should NOT be used for long term storage, for long term storage use
+/// ExecutionContextRef objects.
//----------------------------------------------------------------------
class ExecutionContext {
public:
@@ -384,8 +378,7 @@ public:
bool thread_and_frame_only_if_stopped = false);
// These two variants take in a locker, and grab the target, lock the API
- // mutex into locker, then
- // fill in the rest of the shared pointers.
+ // mutex into locker, then fill in the rest of the shared pointers.
ExecutionContext(const ExecutionContextRef &exe_ctx_ref,
std::unique_lock<std::recursive_mutex> &locker);
ExecutionContext(const ExecutionContextRef *exe_ctx_ref,
@@ -441,14 +434,14 @@ public:
/// Returns a pointer to the target object.
///
/// The returned pointer might be nullptr. Calling HasTargetScope(),
- /// HasProcessScope(), HasThreadScope(), or HasFrameScope()
- /// can help to pre-validate this pointer so that this accessor can
- /// freely be used without having to check for nullptr each time.
+ /// HasProcessScope(), HasThreadScope(), or HasFrameScope() can help to pre-
+ /// validate this pointer so that this accessor can freely be used without
+ /// having to check for nullptr each time.
///
- /// @see ExecutionContext::HasTargetScope() const
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasTargetScope() const @see
+ /// ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Target *GetTargetPtr() const;
@@ -456,13 +449,13 @@ public:
/// Returns a pointer to the process object.
///
/// The returned pointer might be nullptr. Calling HasProcessScope(),
- /// HasThreadScope(), or HasFrameScope() can help to pre-validate
- /// this pointer so that this accessor can freely be used without
- /// having to check for nullptr each time.
+ /// HasThreadScope(), or HasFrameScope() can help to pre-validate this
+ /// pointer so that this accessor can freely be used without having to check
+ /// for nullptr each time.
///
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Process *GetProcessPtr() const;
@@ -470,21 +463,21 @@ public:
/// Returns a pointer to the thread object.
///
/// The returned pointer might be nullptr. Calling HasThreadScope() or
- /// HasFrameScope() can help to pre-validate this pointer so that
- /// this accessor can freely be used without having to check for
- /// nullptr each time.
+ /// HasFrameScope() can help to pre-validate this pointer so that this
+ /// accessor can freely be used without having to check for nullptr each
+ /// time.
///
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Thread *GetThreadPtr() const { return m_thread_sp.get(); }
//------------------------------------------------------------------
/// Returns a pointer to the frame object.
///
- /// The returned pointer might be nullptr. Calling HasFrameScope(),
- /// can help to pre-validate this pointer so that this accessor can
- /// freely be used without having to check for nullptr each time.
+ /// The returned pointer might be nullptr. Calling HasFrameScope(), can help
+ /// to pre-validate this pointer so that this accessor can freely be used
+ /// without having to check for nullptr each time.
///
/// @see ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
@@ -494,14 +487,13 @@ public:
/// Returns a reference to the target object.
///
/// Clients should call HasTargetScope(), HasProcessScope(),
- /// HasThreadScope(), or HasFrameScope() prior to calling this
- /// function to ensure that this ExecutionContext object contains
- /// a valid target.
+ /// HasThreadScope(), or HasFrameScope() prior to calling this function to
+ /// ensure that this ExecutionContext object contains a valid target.
///
- /// @see ExecutionContext::HasTargetScope() const
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasTargetScope() const @see
+ /// ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Target &GetTargetRef() const;
@@ -509,33 +501,32 @@ public:
/// Returns a reference to the process object.
///
/// Clients should call HasProcessScope(), HasThreadScope(), or
- /// HasFrameScope() prior to calling this function to ensure that
- /// this ExecutionContext object contains a valid target.
+ /// HasFrameScope() prior to calling this function to ensure that this
+ /// ExecutionContext object contains a valid target.
///
- /// @see ExecutionContext::HasProcessScope() const
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasProcessScope() const @see
+ /// ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Process &GetProcessRef() const;
//------------------------------------------------------------------
/// Returns a reference to the thread object.
///
- /// Clients should call HasThreadScope(), or HasFrameScope() prior
- /// to calling this function to ensure that this ExecutionContext
- /// object contains a valid target.
+ /// Clients should call HasThreadScope(), or HasFrameScope() prior to
+ /// calling this function to ensure that this ExecutionContext object
+ /// contains a valid target.
///
- /// @see ExecutionContext::HasThreadScope() const
- /// @see ExecutionContext::HasFrameScope() const
+ /// @see ExecutionContext::HasThreadScope() const @see
+ /// ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
Thread &GetThreadRef() const;
//------------------------------------------------------------------
/// Returns a reference to the thread object.
///
- /// Clients should call HasFrameScope() prior to calling this
- /// function to ensure that this ExecutionContext object contains
- /// a valid target.
+ /// Clients should call HasFrameScope() prior to calling this function to
+ /// ensure that this ExecutionContext object contains a valid target.
///
/// @see ExecutionContext::HasFrameScope() const
//------------------------------------------------------------------
@@ -596,8 +587,8 @@ public:
void SetTargetPtr(Target *target);
//------------------------------------------------------------------
- /// Set accessor to set only the process shared pointer from a
- /// process pointer.
+ /// Set accessor to set only the process shared pointer from a process
+ /// pointer.
//------------------------------------------------------------------
void SetProcessPtr(Process *process);
@@ -608,50 +599,47 @@ public:
void SetThreadPtr(Thread *thread);
//------------------------------------------------------------------
- /// Set accessor to set only the frame shared pointer from a frame
- /// pointer.
+ /// Set accessor to set only the frame shared pointer from a frame pointer.
//------------------------------------------------------------------
void SetFramePtr(StackFrame *frame);
//------------------------------------------------------------------
// Set the execution context using a target shared pointer.
//
- // If "target_sp" is valid, sets the target context to match and
- // if "get_process" is true, sets the process shared pointer if
- // the target currently has a process.
+ // If "target_sp" is valid, sets the target context to match and if
+ // "get_process" is true, sets the process shared pointer if the target
+ // currently has a process.
//------------------------------------------------------------------
void SetContext(const lldb::TargetSP &target_sp, bool get_process);
//------------------------------------------------------------------
// Set the execution context using a process shared pointer.
//
- // If "process_sp" is valid, then set the process and target in this
- // context. Thread and frame contexts will be cleared.
- // If "process_sp" is not valid, all shared pointers are reset.
+ // If "process_sp" is valid, then set the process and target in this context.
+ // Thread and frame contexts will be cleared. If "process_sp" is not valid,
+ // all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::ProcessSP &process_sp);
//------------------------------------------------------------------
// Set the execution context using a thread shared pointer.
//
- // If "thread_sp" is valid, then set the thread, process and target
- // in this context. The frame context will be cleared.
- // If "thread_sp" is not valid, all shared pointers are reset.
+ // If "thread_sp" is valid, then set the thread, process and target in this
+ // context. The frame context will be cleared. If "thread_sp" is not valid,
+ // all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::ThreadSP &thread_sp);
//------------------------------------------------------------------
// Set the execution context using a frame shared pointer.
//
- // If "frame_sp" is valid, then set the frame, thread, process and
- // target in this context
- // If "frame_sp" is not valid, all shared pointers are reset.
+ // If "frame_sp" is valid, then set the frame, thread, process and target in
+ // this context If "frame_sp" is not valid, all shared pointers are reset.
//------------------------------------------------------------------
void SetContext(const lldb::StackFrameSP &frame_sp);
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target.
+ /// Returns true the ExecutionContext object contains a valid target.
///
/// This function can be called after initializing an ExecutionContext
/// object, and if it returns true, calls to GetTargetPtr() and
@@ -660,36 +648,35 @@ public:
bool HasTargetScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target and process.
+ /// Returns true the ExecutionContext object contains a valid target and
+ /// process.
///
/// This function can be called after initializing an ExecutionContext
/// object, and if it returns true, calls to GetTargetPtr() and
- /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not
- /// need to be checked for validity.
+ /// GetTargetRef(), GetProcessPtr(), and GetProcessRef(), do not need to be
+ /// checked for validity.
//------------------------------------------------------------------
bool HasProcessScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target, process, and thread.
+ /// Returns true the ExecutionContext object contains a valid target,
+ /// process, and thread.
///
/// This function can be called after initializing an ExecutionContext
- /// object, and if it returns true, calls to GetTargetPtr(),
- /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
- /// and GetThreadRef() do not need to be checked for validity.
+ /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(),
+ /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), and GetThreadRef() do
+ /// not need to be checked for validity.
//------------------------------------------------------------------
bool HasThreadScope() const;
//------------------------------------------------------------------
- /// Returns true the ExecutionContext object contains a valid
- /// target, process, thread and frame.
+ /// Returns true the ExecutionContext object contains a valid target,
+ /// process, thread and frame.
///
/// This function can be called after initializing an ExecutionContext
- /// object, and if it returns true, calls to GetTargetPtr(),
- /// GetTargetRef(), GetProcessPtr(), GetProcessRef(), GetThreadPtr(),
- /// GetThreadRef(), GetFramePtr(), and GetFrameRef() do not need
- /// to be checked for validity.
+ /// object, and if it returns true, calls to GetTargetPtr(), GetTargetRef(),
+ /// GetProcessPtr(), GetProcessRef(), GetThreadPtr(), GetThreadRef(),
+ /// GetFramePtr(), and GetFrameRef() do not need to be checked for validity.
//------------------------------------------------------------------
bool HasFrameScope() const;
diff --git a/include/lldb/Target/ExecutionContextScope.h b/include/lldb/Target/ExecutionContextScope.h
index 36d3d9de49b0..b73ca576bd8a 100644
--- a/include/lldb/Target/ExecutionContextScope.h
+++ b/include/lldb/Target/ExecutionContextScope.h
@@ -20,22 +20,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ExecutionContextScope ExecutionContextScope.h
-/// "lldb/Symbol/ExecutionContextScope.h"
-/// @brief Inherit from this if your object can reconstruct its
+/// "lldb/Symbol/ExecutionContextScope.h" Inherit from this if your object can
+/// reconstruct its
/// execution context.
///
-/// Many objects that have pointers back to parent execution context
-/// objects can inherit from this pure virtual class can reconstruct
-/// their execution context without having to keep a complete
-/// ExecutionContext object in the object state. Examples of these
-/// objects include: Process, Thread, RegisterContext and StackFrame.
+/// Many objects that have pointers back to parent execution context objects
+/// can inherit from this pure virtual class can reconstruct their execution
+/// context without having to keep a complete ExecutionContext object in the
+/// object state. Examples of these objects include: Process, Thread,
+/// RegisterContext and StackFrame.
///
-/// Objects can contain a valid pointer to an instance of this so they
-/// can reconstruct the execution context.
+/// Objects can contain a valid pointer to an instance of this so they can
+/// reconstruct the execution context.
///
-/// Objects that adhere to this protocol can reconstruct enough of a
-/// execution context to allow functions that take a execution contexts
-/// to be called.
+/// Objects that adhere to this protocol can reconstruct enough of a execution
+/// context to allow functions that take a execution contexts to be called.
//----------------------------------------------------------------------
class ExecutionContextScope {
public:
@@ -52,9 +51,9 @@ public:
//------------------------------------------------------------------
/// Reconstruct the object's execution context into \a sc.
///
- /// The object should fill in as much of the ExecutionContextScope as it
- /// can so function calls that require a execution context can be made
- /// for the given object.
+ /// The object should fill in as much of the ExecutionContextScope as it can
+ /// so function calls that require a execution context can be made for the
+ /// given object.
///
/// @param[out] exe_ctx
/// A reference to an execution context object that gets filled
diff --git a/include/lldb/Target/JITLoader.h b/include/lldb/Target/JITLoader.h
index 97f2a9796a80..56f1417eddb0 100644
--- a/include/lldb/Target/JITLoader.h
+++ b/include/lldb/Target/JITLoader.h
@@ -19,21 +19,21 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class JITLoader JITLoader.h "lldb/Target/JITLoader.h"
-/// @brief A plug-in interface definition class for JIT loaders.
+/// A plug-in interface definition class for JIT loaders.
///
-/// Plugins of this kind listen for code generated at runtime in the
-/// target. They are very similar to dynamic loader, with the difference
-/// that they do not have information about the target's dyld and
-/// that there may be multiple JITLoader plugins per process, while
-/// there is at most one DynamicLoader.
+/// Plugins of this kind listen for code generated at runtime in the target.
+/// They are very similar to dynamic loader, with the difference that they do
+/// not have information about the target's dyld and that there may be
+/// multiple JITLoader plugins per process, while there is at most one
+/// DynamicLoader.
//----------------------------------------------------------------------
class JITLoader : public PluginInterface {
public:
//------------------------------------------------------------------
/// Find a JIT loader plugin for a given process.
///
- /// Scans the installed DynamicLoader plug-ins and tries to find
- /// all applicable instances for the current process.
+ /// Scans the installed DynamicLoader plug-ins and tries to find all
+ /// applicable instances for the current process.
///
/// @param[in] process
/// The process for which to try and locate a JIT loader
@@ -52,22 +52,22 @@ public:
//------------------------------------------------------------------
/// Called after attaching a process.
///
- /// Allow JITLoader plug-ins to execute some code after
- /// attaching to a process.
+ /// Allow JITLoader plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach() = 0;
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow JITLoader plug-ins to execute some code after
- /// the process has stopped for the first time on launch.
+ /// Allow JITLoader plug-ins to execute some code after the process has
+ /// stopped for the first time on launch.
//------------------------------------------------------------------
virtual void DidLaunch() = 0;
//------------------------------------------------------------------
- /// Called after a new shared object has been loaded so that it can
- /// be probed for JIT entry point hooks.
+ /// Called after a new shared object has been loaded so that it can be
+ /// probed for JIT entry point hooks.
//------------------------------------------------------------------
virtual void ModulesDidLoad(lldb_private::ModuleList &module_list) = 0;
diff --git a/include/lldb/Target/Language.h b/include/lldb/Target/Language.h
index f81679f78129..dd7db26f3ba6 100644
--- a/include/lldb/Target/Language.h
+++ b/include/lldb/Target/Language.h
@@ -184,19 +184,16 @@ public:
virtual const char *GetLanguageSpecificTypeLookupHelp();
// if an individual data formatter can apply to several types and cross a
- // language boundary
- // it makes sense for individual languages to want to customize the printing
- // of values of that
- // type by appending proper prefix/suffix information in language-specific
- // ways
+ // language boundary it makes sense for individual languages to want to
+ // customize the printing of values of that type by appending proper
+ // prefix/suffix information in language-specific ways
virtual bool GetFormatterPrefixSuffix(ValueObject &valobj,
ConstString type_hint,
std::string &prefix,
std::string &suffix);
// if a language has a custom format for printing variable declarations that
- // it wants LLDB to honor
- // it should return an appropriate closure here
+ // it wants LLDB to honor it should return an appropriate closure here
virtual DumpValueObjectOptions::DeclPrintingHelper GetDeclPrintingHelper();
virtual LazyBool IsLogicalTrue(ValueObject &valobj, Status &error);
@@ -206,11 +203,9 @@ public:
virtual bool IsNilReference(ValueObject &valobj);
// for a ValueObject of some "reference type", if the language provides a
- // technique
- // to decide whether the reference has ever been assigned to some object, this
- // method
- // will return true if such detection is possible, and if the reference has
- // never been assigned
+ // technique to decide whether the reference has ever been assigned to some
+ // object, this method will return true if such detection is possible, and if
+ // the reference has never been assigned
virtual bool IsUninitializedReference(ValueObject &valobj);
virtual bool GetFunctionDisplayName(const SymbolContext *sc,
diff --git a/include/lldb/Target/LanguageRuntime.h b/include/lldb/Target/LanguageRuntime.h
index 98db941669c7..6537a8f6dd55 100644
--- a/include/lldb/Target/LanguageRuntime.h
+++ b/include/lldb/Target/LanguageRuntime.h
@@ -85,26 +85,23 @@ public:
Address &address,
Value::ValueType &value_type) = 0;
- // This call should return a CompilerType given a generic type name
- // and an ExecutionContextScope in which one can actually fetch
- // any specialization information required.
+ // This call should return a CompilerType given a generic type name and an
+ // ExecutionContextScope in which one can actually fetch any specialization
+ // information required.
virtual CompilerType GetConcreteType(ExecutionContextScope *exe_scope,
ConstString abstract_type_name) {
return CompilerType();
}
// This should be a fast test to determine whether it is likely that this
- // value would
- // have a dynamic type.
+ // value would have a dynamic type.
virtual bool CouldHaveDynamicValue(ValueObject &in_value) = 0;
// The contract for GetDynamicTypeAndAddress() is to return a "bare-bones"
- // dynamic type
- // For instance, given a Base* pointer, GetDynamicTypeAndAddress() will return
- // the type of
- // Derived, not Derived*. The job of this API is to correct this misalignment
- // between the
- // static type and the discovered dynamic type
+ // dynamic type For instance, given a Base* pointer,
+ // GetDynamicTypeAndAddress() will return the type of Derived, not Derived*.
+ // The job of this API is to correct this misalignment between the static
+ // type and the discovered dynamic type
virtual TypeAndOrName FixUpDynamicType(const TypeAndOrName &type_and_or_name,
ValueObject &static_value) = 0;
@@ -144,18 +141,16 @@ public:
virtual void ModulesDidLoad(const ModuleList &module_list) {}
- // Called by the Clang expression evaluation engine to allow runtimes to alter
- // the set of target options provided to
- // the compiler.
- // If the options prototype is modified, runtimes must return true, false
- // otherwise.
+ // Called by the Clang expression evaluation engine to allow runtimes to
+ // alter the set of target options provided to the compiler. If the options
+ // prototype is modified, runtimes must return true, false otherwise.
virtual bool GetOverrideExprOptions(clang::TargetOptions &prototype) {
return false;
}
// Called by ClangExpressionParser::PrepareForExecution to query for any
- // custom LLVM IR passes
- // that need to be run before an expression is assembled and run.
+ // custom LLVM IR passes that need to be run before an expression is
+ // assembled and run.
virtual bool GetIRPasses(LLVMUserExpression::IRPasses &custom_passes) {
return false;
}
diff --git a/include/lldb/Target/Memory.h b/include/lldb/Target/Memory.h
index af6be15df9fb..16d7b256a78e 100644
--- a/include/lldb/Target/Memory.h
+++ b/include/lldb/Target/Memory.h
@@ -120,8 +120,8 @@ protected:
//----------------------------------------------------------------------
// A class that can track allocated memory and give out allocated memory
-// without us having to make an allocate/deallocate call every time we
-// need some memory in a process that is being debugged.
+// without us having to make an allocate/deallocate call every time we need
+// some memory in a process that is being debugged.
//----------------------------------------------------------------------
class AllocatedMemoryCache {
public:
diff --git a/include/lldb/Target/MemoryRegionInfo.h b/include/lldb/Target/MemoryRegionInfo.h
index 0824b2442acc..505ecfcfc5ae 100644
--- a/include/lldb/Target/MemoryRegionInfo.h
+++ b/include/lldb/Target/MemoryRegionInfo.h
@@ -25,7 +25,7 @@ public:
MemoryRegionInfo()
: m_range(), m_read(eDontKnow), m_write(eDontKnow), m_execute(eDontKnow),
- m_mapped(eDontKnow) {}
+ m_mapped(eDontKnow), m_flash(eDontKnow), m_blocksize(0) {}
~MemoryRegionInfo() {}
@@ -58,9 +58,17 @@ public:
void SetName(const char *name) { m_name = ConstString(name); }
+ OptionalBool GetFlash() const { return m_flash; }
+
+ void SetFlash(OptionalBool val) { m_flash = val; }
+
+ lldb::offset_t GetBlocksize() const { return m_blocksize; }
+
+ void SetBlocksize(lldb::offset_t blocksize) { m_blocksize = blocksize; }
+
//----------------------------------------------------------------------
- // Get permissions as a uint32_t that is a mask of one or more bits from
- // the lldb::Permissions
+ // Get permissions as a uint32_t that is a mask of one or more bits from the
+ // lldb::Permissions
//----------------------------------------------------------------------
uint32_t GetLLDBPermissions() const {
uint32_t permissions = 0;
@@ -74,8 +82,8 @@ public:
}
//----------------------------------------------------------------------
- // Set permissions from a uint32_t that contains one or more bits from
- // the lldb::Permissions
+ // Set permissions from a uint32_t that contains one or more bits from the
+ // lldb::Permissions
//----------------------------------------------------------------------
void SetLLDBPermissions(uint32_t permissions) {
m_read = (permissions & lldb::ePermissionsReadable) ? eYes : eNo;
@@ -98,6 +106,8 @@ protected:
OptionalBool m_execute;
OptionalBool m_mapped;
ConstString m_name;
+ OptionalBool m_flash;
+ lldb::offset_t m_blocksize;
};
}
diff --git a/include/lldb/Target/ModuleCache.h b/include/lldb/Target/ModuleCache.h
index 4959ee8ea0a3..a060937e0614 100644
--- a/include/lldb/Target/ModuleCache.h
+++ b/include/lldb/Target/ModuleCache.h
@@ -28,10 +28,10 @@ class UUID;
//----------------------------------------------------------------------
/// @class ModuleCache ModuleCache.h "lldb/Target/ModuleCache.h"
-/// @brief A module cache class.
+/// A module cache class.
///
-/// Caches locally modules that are downloaded from remote targets.
-/// Each cached module maintains 2 views:
+/// Caches locally modules that are downloaded from remote targets. Each
+/// cached module maintains 2 views:
/// - UUID view:
/// /${CACHE_ROOT}/${PLATFORM_NAME}/.cache/${UUID}/${MODULE_FILENAME}
/// - Sysroot view:
@@ -42,7 +42,8 @@ class UUID;
///
/// Example:
/// UUID view :
-/// /tmp/lldb/remote-linux/.cache/30C94DC6-6A1F-E951-80C3-D68D2B89E576-D5AE213C/libc.so.6
+/// /tmp/lldb/remote-
+/// linux/.cache/30C94DC6-6A1F-E951-80C3-D68D2B89E576-D5AE213C/libc.so.6
/// Sysroot view: /tmp/lldb/remote-linux/ubuntu/lib/x86_64-linux-gnu/libc.so.6
//----------------------------------------------------------------------
diff --git a/include/lldb/Target/ObjCLanguageRuntime.h b/include/lldb/Target/ObjCLanguageRuntime.h
index 97a2a731581a..6f8354ea3a27 100644
--- a/include/lldb/Target/ObjCLanguageRuntime.h
+++ b/include/lldb/Target/ObjCLanguageRuntime.h
@@ -48,10 +48,9 @@ public:
class ClassDescriptor;
typedef std::shared_ptr<ClassDescriptor> ClassDescriptorSP;
- // the information that we want to support retrieving from an ObjC class
- // this needs to be pure virtual since there are at least 2 different
- // implementations
- // of the runtime, and more might come
+ // the information that we want to support retrieving from an ObjC class this
+ // needs to be pure virtual since there are at least 2 different
+ // implementations of the runtime, and more might come
class ClassDescriptor {
public:
ClassDescriptor()
@@ -66,8 +65,8 @@ public:
virtual ClassDescriptorSP GetMetaclass() const = 0;
- // virtual if any implementation has some other version-specific rules
- // but for the known v1/v2 this is all that needs to be done
+ // virtual if any implementation has some other version-specific rules but
+ // for the known v1/v2 this is all that needs to be done
virtual bool IsKVO() {
if (m_is_kvo == eLazyBoolCalculate) {
const char *class_name = GetClassName().AsCString();
@@ -78,8 +77,8 @@ public:
return (m_is_kvo == eLazyBoolYes);
}
- // virtual if any implementation has some other version-specific rules
- // but for the known v1/v2 this is all that needs to be done
+ // virtual if any implementation has some other version-specific rules but
+ // for the known v1/v2 this is all that needs to be done
virtual bool IsCFType() {
if (m_is_cf == eLazyBoolCalculate) {
const char *class_name = GetClassName().AsCString();
@@ -268,15 +267,14 @@ public:
virtual DeclVendor *GetDeclVendor() { return nullptr; }
// Finds the byte offset of the child_type ivar in parent_type. If it can't
- // find the
- // offset, returns LLDB_INVALID_IVAR_OFFSET.
+ // find the offset, returns LLDB_INVALID_IVAR_OFFSET.
virtual size_t GetByteOffsetForIvar(CompilerType &parent_qual_type,
const char *ivar_name);
- // Given the name of an Objective-C runtime symbol (e.g., ivar offset symbol),
- // try to determine from the runtime what the value of that symbol would be.
- // Useful when the underlying binary is stripped.
+ // Given the name of an Objective-C runtime symbol (e.g., ivar offset
+ // symbol), try to determine from the runtime what the value of that symbol
+ // would be. Useful when the underlying binary is stripped.
virtual lldb::addr_t LookupRuntimeSymbol(const ConstString &name) {
return LLDB_INVALID_ADDRESS;
}
@@ -334,8 +332,7 @@ protected:
private:
// We keep a map of <Class,Selector>->Implementation so we don't have to call
- // the resolver
- // function over and over.
+ // the resolver function over and over.
// FIXME: We need to watch for the loading of Protocols, and flush the cache
// for any
diff --git a/include/lldb/Target/OperatingSystem.h b/include/lldb/Target/OperatingSystem.h
index 24ded3f69723..fe4fdee182f4 100644
--- a/include/lldb/Target/OperatingSystem.h
+++ b/include/lldb/Target/OperatingSystem.h
@@ -22,13 +22,13 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class OperatingSystem OperatingSystem.h "lldb/Target/OperatingSystem.h"
-/// @brief A plug-in interface definition class for halted OS helpers.
+/// A plug-in interface definition class for halted OS helpers.
///
/// Halted OS plug-ins can be used by any process to locate and create
/// OS objects, like threads, during the lifetime of a debug session.
/// This is commonly used when attaching to an operating system that is
-/// halted, such as when debugging over JTAG or connecting to low level
-/// kernel debug services.
+/// halted, such as when debugging over JTAG or connecting to low level kernel
+/// debug services.
//----------------------------------------------------------------------
class OperatingSystem : public PluginInterface {
@@ -36,9 +36,8 @@ public:
//------------------------------------------------------------------
/// Find a halted OS plugin for a given process.
///
- /// Scans the installed OperatingSystem plug-ins and tries to find
- /// an instance that matches the current target triple and
- /// executable.
+ /// Scans the installed OperatingSystem plug-ins and tries to find an
+ /// instance that matches the current target triple and executable.
///
/// @param[in] process
/// The process for which to try and locate a halted OS
diff --git a/include/lldb/Target/PathMappingList.h b/include/lldb/Target/PathMappingList.h
index b1b551f2d24d..a5ee3265a223 100644
--- a/include/lldb/Target/PathMappingList.h
+++ b/include/lldb/Target/PathMappingList.h
@@ -90,7 +90,7 @@ public:
bool RemapPath(llvm::StringRef path, std::string &new_path) const;
bool RemapPath(const char *, std::string &) const = delete;
- bool ReverseRemapPath(const ConstString &path, ConstString &new_path) const;
+ bool ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const;
//------------------------------------------------------------------
/// Finds a source file given a file spec using the path remappings.
diff --git a/include/lldb/Target/Platform.h b/include/lldb/Target/Platform.h
index 6288a3ab684f..217b945d29cd 100644
--- a/include/lldb/Target/Platform.h
+++ b/include/lldb/Target/Platform.h
@@ -27,12 +27,10 @@
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-private-forward.h"
#include "lldb/lldb-public.h"
-
-// TODO pull NativeDelegate class out of NativeProcessProtocol so we
-// can just forward ref the NativeDelegate rather than include it here.
-#include "lldb/Host/common/NativeProcessProtocol.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -57,7 +55,7 @@ typedef llvm::SmallVector<lldb::addr_t, 6> MmapArgList;
//----------------------------------------------------------------------
/// @class Platform Platform.h "lldb/Target/Platform.h"
-/// @brief A plug-in interface definition class for debug platform that
+/// A plug-in interface definition class for debug platform that
/// includes many platform abilities such as:
/// @li getting platform information such as supported architectures,
/// supported binary file formats and more
@@ -78,8 +76,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~Platform() override;
@@ -92,13 +90,13 @@ public:
//------------------------------------------------------------------
/// Get the native host platform plug-in.
///
- /// There should only be one of these for each host that LLDB runs
- /// upon that should be statically compiled in and registered using
- /// preprocessor macros or other similar build mechanisms in a
+ /// There should only be one of these for each host that LLDB runs upon that
+ /// should be statically compiled in and registered using preprocessor
+ /// macros or other similar build mechanisms in a
/// PlatformSubclass::Initialize() function.
///
- /// This platform will be used as the default platform when launching
- /// or attaching to processes unless another platform is specified.
+ /// This platform will be used as the default platform when launching or
+ /// attaching to processes unless another platform is specified.
//------------------------------------------------------------------
static lldb::PlatformSP GetHostPlatform();
@@ -127,8 +125,8 @@ public:
//------------------------------------------------------------------
/// Find a platform plugin for a given process.
///
- /// Scans the installed Platform plug-ins and tries to find
- /// an instance that can be used for \a process
+ /// Scans the installed Platform plug-ins and tries to find an instance that
+ /// can be used for \a process
///
/// @param[in] process
/// The process for which to try and locate a platform
@@ -142,19 +140,17 @@ public:
// FindPlugin (Process *process, const ConstString &plugin_name);
//------------------------------------------------------------------
- /// Set the target's executable based off of the existing
- /// architecture information in \a target given a path to an
- /// executable \a exe_file.
+ /// Set the target's executable based off of the existing architecture
+ /// information in \a target given a path to an executable \a exe_file.
///
- /// Each platform knows the architectures that it supports and can
- /// select the correct architecture slice within \a exe_file by
- /// inspecting the architecture in \a target. If the target had an
- /// architecture specified, then in can try and obey that request
- /// and optionally fail if the architecture doesn't match up.
- /// If no architecture is specified, the platform should select the
- /// default architecture from \a exe_file. Any application bundles
- /// or executable wrappers can also be inspected for the actual
- /// application binary within the bundle that should be used.
+ /// Each platform knows the architectures that it supports and can select
+ /// the correct architecture slice within \a exe_file by inspecting the
+ /// architecture in \a target. If the target had an architecture specified,
+ /// then in can try and obey that request and optionally fail if the
+ /// architecture doesn't match up. If no architecture is specified, the
+ /// platform should select the default architecture from \a exe_file. Any
+ /// application bundles or executable wrappers can also be inspected for the
+ /// actual application binary within the bundle that should be used.
///
/// @return
/// Returns \b true if this Platform plug-in was able to find
@@ -167,10 +163,10 @@ public:
//------------------------------------------------------------------
/// Find a symbol file given a symbol file module specification.
///
- /// Each platform might have tricks to find symbol files for an
- /// executable given information in a symbol file ModuleSpec. Some
- /// platforms might also support symbol files that are bundles and
- /// know how to extract the right symbol file given a bundle.
+ /// Each platform might have tricks to find symbol files for an executable
+ /// given information in a symbol file ModuleSpec. Some platforms might also
+ /// support symbol files that are bundles and know how to extract the right
+ /// symbol file given a bundle.
///
/// @param[in] target
/// The target in which we are trying to resolve the symbol file.
@@ -215,9 +211,8 @@ public:
FileSpec &sym_file);
//------------------------------------------------------------------
- /// Resolves the FileSpec to a (possibly) remote path. Remote
- /// platforms must override this to resolve to a path on the remote
- /// side.
+ /// Resolves the FileSpec to a (possibly) remote path. Remote platforms must
+ /// override this to resolve to a path on the remote side.
//------------------------------------------------------------------
virtual bool ResolveRemotePath(const FileSpec &platform_path,
FileSpec &resolved_platform_path);
@@ -225,17 +220,15 @@ public:
//------------------------------------------------------------------
/// Get the OS version from a connected platform.
///
- /// Some platforms might not be connected to a remote platform, but
- /// can figure out the OS version for a process. This is common for
- /// simulator platforms that will run native programs on the current
- /// host, but the simulator might be simulating a different OS. The
- /// \a process parameter might be specified to help to determine
- /// the OS version.
+ /// Some platforms might not be connected to a remote platform, but can
+ /// figure out the OS version for a process. This is common for simulator
+ /// platforms that will run native programs on the current host, but the
+ /// simulator might be simulating a different OS. The \a process parameter
+ /// might be specified to help to determine the OS version.
//------------------------------------------------------------------
- virtual bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
- Process *process = nullptr);
+ virtual llvm::VersionTuple GetOSVersion(Process *process = nullptr);
- bool SetOSVersion(uint32_t major, uint32_t minor, uint32_t update);
+ bool SetOSVersion(llvm::VersionTuple os_version);
bool GetOSBuildString(std::string &s);
@@ -253,19 +246,19 @@ public:
//------------------------------------------------------------------
/// Report the current status for this platform.
///
- /// The returned string usually involves returning the OS version
- /// (if available), and any SDK directory that might be being used
- /// for local file caching, and if connected a quick blurb about
- /// what this platform is connected to.
+ /// The returned string usually involves returning the OS version (if
+ /// available), and any SDK directory that might be being used for local
+ /// file caching, and if connected a quick blurb about what this platform is
+ /// connected to.
//------------------------------------------------------------------
virtual void GetStatus(Stream &strm);
//------------------------------------------------------------------
// Subclasses must be able to fetch the current OS version
//
- // Remote classes must be connected for this to succeed. Local
- // subclasses don't need to override this function as it will just
- // call the HostInfo::GetOSVersion().
+ // Remote classes must be connected for this to succeed. Local subclasses
+ // don't need to override this function as it will just call the
+ // HostInfo::GetOSVersion().
//------------------------------------------------------------------
virtual bool GetRemoteOSVersion() { return false; }
@@ -295,8 +288,8 @@ public:
//------------------------------------------------------------------
/// Locate a file for a platform.
///
- /// The default implementation of this function will return the same
- /// file patch in \a local_file as was in \a platform_file.
+ /// The default implementation of this function will return the same file
+ /// patch in \a local_file as was in \a platform_file.
///
/// @param[in] platform_file
/// The platform file path to locate and cache locally.
@@ -326,8 +319,8 @@ public:
//----------------------------------------------------------------------
// Locate the scripting resource given a module specification.
//
- // Locating the file should happen only on the local computer or using
- // the current computers global settings.
+ // Locating the file should happen only on the local computer or using the
+ // current computers global settings.
//----------------------------------------------------------------------
virtual FileSpecList
LocateExecutableScriptingResources(Target *target, Module &module,
@@ -347,8 +340,8 @@ public:
virtual Status DisconnectRemote();
//------------------------------------------------------------------
- /// Get the platform's supported architectures in the order in which
- /// they should be searched.
+ /// Get the platform's supported architectures in the order in which they
+ /// should be searched.
///
/// @param[in] idx
/// A zero based architecture index
@@ -368,14 +361,14 @@ public:
BreakpointSite *bp_site);
//------------------------------------------------------------------
- /// Launch a new process on a platform, not necessarily for
- /// debugging, it could be just for running the process.
+ /// Launch a new process on a platform, not necessarily for debugging, it
+ /// could be just for running the process.
//------------------------------------------------------------------
virtual Status LaunchProcess(ProcessLaunchInfo &launch_info);
//------------------------------------------------------------------
- /// Perform expansion of the command-line for this launch info
- /// This can potentially involve wildcard expansion
+ /// Perform expansion of the command-line for this launch info This can
+ /// potentially involve wildcard expansion
// environment variable replacement, and whatever other
// argument magic the platform defines as part of its typical
// user experience
@@ -388,28 +381,27 @@ public:
virtual Status KillProcess(const lldb::pid_t pid);
//------------------------------------------------------------------
- /// Lets a platform answer if it is compatible with a given
- /// architecture and the target triple contained within.
+ /// Lets a platform answer if it is compatible with a given architecture and
+ /// the target triple contained within.
//------------------------------------------------------------------
virtual bool IsCompatibleArchitecture(const ArchSpec &arch,
bool exact_arch_match,
ArchSpec *compatible_arch_ptr);
//------------------------------------------------------------------
- /// Not all platforms will support debugging a process by spawning
- /// somehow halted for a debugger (specified using the
- /// "eLaunchFlagDebug" launch flag) and then attaching. If your
- /// platform doesn't support this, override this function and return
- /// false.
+ /// Not all platforms will support debugging a process by spawning somehow
+ /// halted for a debugger (specified using the "eLaunchFlagDebug" launch
+ /// flag) and then attaching. If your platform doesn't support this,
+ /// override this function and return false.
//------------------------------------------------------------------
virtual bool CanDebugProcess() { return true; }
//------------------------------------------------------------------
- /// Subclasses do not need to implement this function as it uses
- /// the Platform::LaunchProcess() followed by Platform::Attach ().
- /// Remote platforms will want to subclass this function in order
- /// to be able to intercept STDIO and possibly launch a separate
- /// process that will debug the debuggee.
+ /// Subclasses do not need to implement this function as it uses the
+ /// Platform::LaunchProcess() followed by Platform::Attach (). Remote
+ /// platforms will want to subclass this function in order to be able to
+ /// intercept STDIO and possibly launch a separate process that will debug
+ /// the debuggee.
//------------------------------------------------------------------
virtual lldb::ProcessSP
DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
@@ -426,11 +418,11 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process using a process ID.
///
- /// Each platform subclass needs to implement this function and
- /// attempt to attach to the process with the process ID of \a pid.
- /// The platform subclass should return an appropriate ProcessSP
- /// subclass that is attached to the process, or an empty shared
- /// pointer with an appropriate error.
+ /// Each platform subclass needs to implement this function and attempt to
+ /// attach to the process with the process ID of \a pid. The platform
+ /// subclass should return an appropriate ProcessSP subclass that is
+ /// attached to the process, or an empty shared pointer with an appropriate
+ /// error.
///
/// @param[in] pid
/// The process ID that we should attempt to attach to.
@@ -451,12 +443,11 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process by process name.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call
- /// Process::WillAttach (const char *) and if that returns \b
- /// true, Process::DoAttach (const char *) will be called to
- /// actually do the attach. If DoAttach returns \b true, then
- /// Process::DidAttach() will be called.
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call Process::WillAttach (const char *) and if that returns
+ /// \b true, Process::DoAttach (const char *) will be called to actually do
+ /// the attach. If DoAttach returns \b true, then Process::DidAttach() will
+ /// be called.
///
/// @param[in] process_name
/// A process name to match against the current process list.
@@ -471,8 +462,8 @@ public:
// Status &error) = 0;
//------------------------------------------------------------------
- // The base class Platform will take care of the host platform.
- // Subclasses will need to fill in the remote case.
+ // The base class Platform will take care of the host platform. Subclasses
+ // will need to fill in the remote case.
//------------------------------------------------------------------
virtual uint32_t FindProcesses(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &proc_infos);
@@ -480,15 +471,15 @@ public:
virtual bool GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &proc_info);
//------------------------------------------------------------------
- // Set a breakpoint on all functions that can end up creating a thread
- // for this platform. This is needed when running expressions and
- // also for process control.
+ // Set a breakpoint on all functions that can end up creating a thread for
+ // this platform. This is needed when running expressions and also for
+ // process control.
//------------------------------------------------------------------
virtual lldb::BreakpointSP SetThreadCreationBreakpoint(Target &target);
//------------------------------------------------------------------
- // Given a target, find the local SDK directory if one exists on the
- // current host.
+ // Given a target, find the local SDK directory if one exists on the current
+ // host.
//------------------------------------------------------------------
virtual lldb_private::ConstString
GetSDKDirectory(lldb_private::Target &target) {
@@ -517,9 +508,9 @@ public:
}
//---------------------------------------------------------------------------
- /// If the triple contains not specify the vendor, os, and environment parts,
- /// we "augment" these using information from the platform and return the
- /// resulting ArchSpec object.
+ /// If the triple contains not specify the vendor, os, and environment
+ /// parts, we "augment" these using information from the platform and return
+ /// the resulting ArchSpec object.
//---------------------------------------------------------------------------
ArchSpec GetAugmentedArchSpec(llvm::StringRef triple);
@@ -537,8 +528,8 @@ public:
void SetSDKBuild(const ConstString &sdk_build) { m_sdk_build = sdk_build; }
- // Override this to return true if your platform supports Clang modules.
- // You may also need to override AddClangModuleCompilationOptions to pass the
+ // Override this to return true if your platform supports Clang modules. You
+ // may also need to override AddClangModuleCompilationOptions to pass the
// right Clang flags for your platform.
virtual bool SupportsModules() { return false; }
@@ -553,9 +544,8 @@ public:
bool SetWorkingDirectory(const FileSpec &working_dir);
// There may be modules that we don't want to find by default for operations
- // like "setting breakpoint by name".
- // The platform will return "true" from this call if the passed in module
- // happens to be one of these.
+ // like "setting breakpoint by name". The platform will return "true" from
+ // this call if the passed in module happens to be one of these.
virtual bool
ModuleIsExcludedForUnconstrainedSearches(Target &target,
@@ -610,11 +600,11 @@ public:
//----------------------------------------------------------------------
/// Install a file or directory to the remote system.
///
- /// Install is similar to Platform::PutFile(), but it differs in that if
- /// an application/framework/shared library is installed on a remote
- /// platform and the remote platform requires something to be done to
- /// register the application/framework/shared library, then this extra
- /// registration can be done.
+ /// Install is similar to Platform::PutFile(), but it differs in that if an
+ /// application/framework/shared library is installed on a remote platform
+ /// and the remote platform requires something to be done to register the
+ /// application/framework/shared library, then this extra registration can
+ /// be done.
///
/// @param[in] src
/// The source file/directory to install on the remote system.
@@ -633,7 +623,7 @@ public:
//----------------------------------------------------------------------
virtual Status Install(const FileSpec &src, const FileSpec &dst);
- virtual size_t GetEnvironment(StringList &environment);
+ virtual Environment GetEnvironment();
virtual bool GetFileExists(const lldb_private::FileSpec &file_spec);
@@ -687,8 +677,7 @@ public:
// the process to exit
std::string
*command_output, // Pass nullptr if you don't want the command output
- uint32_t timeout_sec); // Timeout in seconds to wait for shell program to
- // finish
+ const Timeout<std::micro> &timeout);
virtual void SetLocalCacheDirectory(const char *local);
@@ -710,12 +699,12 @@ public:
//------------------------------------------------------------------
/// Locate a queue name given a thread's qaddr
///
- /// On a system using libdispatch ("Grand Central Dispatch") style
- /// queues, a thread may be associated with a GCD queue or not,
- /// and a queue may be associated with multiple threads.
- /// The process/thread must provide a way to find the "dispatch_qaddr"
- /// for each thread, and from that dispatch_qaddr this Platform method
- /// will locate the queue name and provide that.
+ /// On a system using libdispatch ("Grand Central Dispatch") style queues, a
+ /// thread may be associated with a GCD queue or not, and a queue may be
+ /// associated with multiple threads. The process/thread must provide a way
+ /// to find the "dispatch_qaddr" for each thread, and from that
+ /// dispatch_qaddr this Platform method will locate the queue name and
+ /// provide that.
///
/// @param[in] process
/// A process is required for reading memory.
@@ -736,12 +725,12 @@ public:
//------------------------------------------------------------------
/// Locate a queue ID given a thread's qaddr
///
- /// On a system using libdispatch ("Grand Central Dispatch") style
- /// queues, a thread may be associated with a GCD queue or not,
- /// and a queue may be associated with multiple threads.
- /// The process/thread must provide a way to find the "dispatch_qaddr"
- /// for each thread, and from that dispatch_qaddr this Platform method
- /// will locate the queue ID and provide that.
+ /// On a system using libdispatch ("Grand Central Dispatch") style queues, a
+ /// thread may be associated with a GCD queue or not, and a queue may be
+ /// associated with multiple threads. The process/thread must provide a way
+ /// to find the "dispatch_qaddr" for each thread, and from that
+ /// dispatch_qaddr this Platform method will locate the queue ID and provide
+ /// that.
///
/// @param[in] process
/// A process is required for reading memory.
@@ -761,12 +750,12 @@ public:
//------------------------------------------------------------------
/// Provide a list of trap handler function names for this platform
///
- /// The unwinder needs to treat trap handlers specially -- the stack
- /// frame may not be aligned correctly for a trap handler (the kernel
- /// often won't perturb the stack pointer, or won't re-align it properly,
- /// in the process of calling the handler) and the frame above the handler
- /// needs to be treated by the unwinder's "frame 0" rules instead of its
- /// "middle of the stack frame" rules.
+ /// The unwinder needs to treat trap handlers specially -- the stack frame
+ /// may not be aligned correctly for a trap handler (the kernel often won't
+ /// perturb the stack pointer, or won't re-align it properly, in the process
+ /// of calling the handler) and the frame above the handler needs to be
+ /// treated by the unwinder's "frame 0" rules instead of its "middle of the
+ /// stack frame" rules.
///
/// In a user process debugging scenario, the list of trap handlers is
/// typically just "_sigtramp".
@@ -782,12 +771,11 @@ public:
virtual const std::vector<ConstString> &GetTrapHandlerSymbolNames();
//------------------------------------------------------------------
- /// Find a support executable that may not live within in the
- /// standard locations related to LLDB.
+ /// Find a support executable that may not live within in the standard
+ /// locations related to LLDB.
///
- /// Executable might exist within the Platform SDK directories, or
- /// in standard tool directories within the current IDE that is
- /// running LLDB.
+ /// Executable might exist within the Platform SDK directories, or in
+ /// standard tool directories within the current IDE that is running LLDB.
///
/// @param[in] basename
/// The basename of the executable to locate in the current
@@ -801,19 +789,17 @@ public:
//------------------------------------------------------------------
/// Allow the platform to set preferred memory cache line size. If non-zero
- /// (and the user
- /// has not set cache line size explicitly), this value will be used as the
- /// cache line
- /// size for memory reads.
+ /// (and the user has not set cache line size explicitly), this value will
+ /// be used as the cache line size for memory reads.
//------------------------------------------------------------------
virtual uint32_t GetDefaultMemoryCacheLineSize() { return 0; }
//------------------------------------------------------------------
/// Load a shared library into this process.
///
- /// Try and load a shared library into the current process. This
- /// call might fail in the dynamic loader plug-in says it isn't safe
- /// to try and load shared libraries at the moment.
+ /// Try and load a shared library into the current process. This call might
+ /// fail in the dynamic loader plug-in says it isn't safe to try and load
+ /// shared libraries at the moment.
///
/// @param[in] process
/// The process to load the image.
@@ -846,9 +832,49 @@ public:
const lldb_private::FileSpec &remote_file,
lldb_private::Status &error);
+ //------------------------------------------------------------------
+ /// Load a shared library specified by base name into this process,
+ /// looking by hand along a set of paths.
+ ///
+ /// @param[in] process
+ /// The process to load the image.
+ ///
+ /// @param[in] library_name
+ /// The name of the library to look for. If library_name is an
+ /// absolute path, the basename will be extracted and searched for
+ /// along the paths. This emulates the behavior of the loader when
+ /// given an install name and a set (e.g. DYLD_LIBRARY_PATH provided) of
+ /// alternate paths.
+ ///
+ /// @param[in] path_list
+ /// The list of paths to use to search for the library. First
+ /// match wins.
+ ///
+ /// @param[out] error
+ /// An error object that gets filled in with any errors that
+ /// might occur when trying to load the shared library.
+ ///
+ /// @param[out] loaded_path
+ /// If non-null, the path to the dylib that was successfully loaded
+ /// is stored in this path.
+ ///
+ /// @return
+ /// A token that represents the shared library which can be
+ /// passed to UnloadImage. A value of
+ /// LLDB_INVALID_IMAGE_TOKEN will be returned if the shared
+ /// library can't be opened.
+ //------------------------------------------------------------------
+ uint32_t LoadImageUsingPaths(lldb_private::Process *process,
+ const lldb_private::FileSpec &library_name,
+ const std::vector<std::string> &paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_path);
+
virtual uint32_t DoLoadImage(lldb_private::Process *process,
const lldb_private::FileSpec &remote_file,
- lldb_private::Status &error);
+ const std::vector<std::string> *paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_path = nullptr);
virtual Status UnloadImage(lldb_private::Process *process,
uint32_t image_token);
@@ -856,8 +882,8 @@ public:
//------------------------------------------------------------------
/// Connect to all processes waiting for a debugger to attach
///
- /// If the platform have a list of processes waiting for a debugger
- /// to connect to them then connect to all of these pending processes.
+ /// If the platform have a list of processes waiting for a debugger to
+ /// connect to them then connect to all of these pending processes.
///
/// @param[in] debugger
/// The debugger used for the connect.
@@ -874,11 +900,11 @@ public:
protected:
bool m_is_host;
- // Set to true when we are able to actually set the OS version while
- // being connected. For remote platforms, we might set the version ahead
- // of time before we actually connect and this version might change when
- // we actually connect to a remote platform. For the host platform this
- // will be set to the once we call HostInfo::GetOSVersion().
+ // Set to true when we are able to actually set the OS version while being
+ // connected. For remote platforms, we might set the version ahead of time
+ // before we actually connect and this version might change when we actually
+ // connect to a remote platform. For the host platform this will be set to
+ // the once we call HostInfo::GetOSVersion().
bool m_os_version_set_while_connected;
bool m_system_arch_set_while_connected;
ConstString
@@ -888,9 +914,7 @@ protected:
// modules that have no install path set
std::string m_remote_url;
std::string m_name;
- uint32_t m_major_os_version;
- uint32_t m_minor_os_version;
- uint32_t m_update_os_version;
+ llvm::VersionTuple m_os_version;
ArchSpec
m_system_arch; // The architecture of the kernel or the remote platform
typedef std::map<uint32_t, ConstString> IDToNameMap;
@@ -915,23 +939,22 @@ protected:
//------------------------------------------------------------------
/// Ask the Platform subclass to fill in the list of trap handler names
///
- /// For most Unix user process environments, this will be a single
- /// function name, _sigtramp. More specialized environments may have
- /// additional handler names. The unwinder code needs to know when a
- /// trap handler is on the stack because the unwind rules for the frame
- /// that caused the trap are different.
+ /// For most Unix user process environments, this will be a single function
+ /// name, _sigtramp. More specialized environments may have additional
+ /// handler names. The unwinder code needs to know when a trap handler is
+ /// on the stack because the unwind rules for the frame that caused the trap
+ /// are different.
///
- /// The base class Platform ivar m_trap_handlers should be updated by
- /// the Platform subclass when this method is called. If there are no
+ /// The base class Platform ivar m_trap_handlers should be updated by the
+ /// Platform subclass when this method is called. If there are no
/// predefined trap handlers, this method may be a no-op.
//------------------------------------------------------------------
virtual void CalculateTrapHandlerSymbolNames() = 0;
const char *GetCachedUserName(uint32_t uid) {
std::lock_guard<std::mutex> guard(m_mutex);
- // return the empty string if our string is NULL
- // so we can tell when things were in the negative
- // cached (didn't find a valid user name, don't keep
+ // return the empty string if our string is NULL so we can tell when things
+ // were in the negative cached (didn't find a valid user name, don't keep
// trying)
const auto pos = m_uid_map.find(uid);
return ((pos != m_uid_map.end()) ? pos->second.AsCString("") : nullptr);
@@ -961,9 +984,8 @@ protected:
const char *GetCachedGroupName(uint32_t gid) {
std::lock_guard<std::mutex> guard(m_mutex);
- // return the empty string if our string is NULL
- // so we can tell when things were in the negative
- // cached (didn't find a valid group name, don't keep
+ // return the empty string if our string is NULL so we can tell when things
+ // were in the negative cached (didn't find a valid group name, don't keep
// trying)
const auto pos = m_gid_map.find(gid);
return ((pos != m_gid_map.end()) ? pos->second.AsCString("") : nullptr);
@@ -1057,11 +1079,10 @@ public:
//------------------------------------------------------------------
/// Select the active platform.
///
- /// In order to debug remotely, other platform's can be remotely
- /// connected to and set as the selected platform for any subsequent
- /// debugging. This allows connection to remote targets and allows
- /// the ability to discover process info, launch and attach to remote
- /// processes.
+ /// In order to debug remotely, other platform's can be remotely connected
+ /// to and set as the selected platform for any subsequent debugging. This
+ /// allows connection to remote targets and allows the ability to discover
+ /// process info, launch and attach to remote processes.
//------------------------------------------------------------------
lldb::PlatformSP GetSelectedPlatform() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
diff --git a/include/lldb/Target/Process.h b/include/lldb/Target/Process.h
index 16f37f4dd5dc..66ac5a692522 100644
--- a/include/lldb/Target/Process.h
+++ b/include/lldb/Target/Process.h
@@ -38,6 +38,7 @@
#include "lldb/Host/HostThread.h"
#include "lldb/Host/ProcessRunLock.h"
#include "lldb/Interpreter/Options.h"
+#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ExecutionContextScope.h"
#include "lldb/Target/InstrumentationRuntime.h"
#include "lldb/Target/Memory.h"
@@ -53,6 +54,7 @@
#include "lldb/lldb-private.h"
#include "llvm/ADT/ArrayRef.h"
+#include "llvm/Support/VersionTuple.h"
namespace lldb_private {
@@ -113,8 +115,8 @@ typedef std::shared_ptr<ProcessProperties> ProcessPropertiesSP;
//----------------------------------------------------------------------
// ProcessInstanceInfo
//
-// Describes an existing process and any discoverable information that
-// pertains to that process.
+// Describes an existing process and any discoverable information that pertains
+// to that process.
//----------------------------------------------------------------------
class ProcessInstanceInfo : public ProcessInfo {
public:
@@ -278,7 +280,8 @@ protected:
class ProcessLaunchCommandOptions : public Options {
public:
ProcessLaunchCommandOptions() : Options() {
- // Keep default values of all options in one place: OptionParsingStarting ()
+ // Keep default values of all options in one place: OptionParsingStarting
+ // ()
OptionParsingStarting(nullptr);
}
@@ -316,7 +319,8 @@ public:
NameMatch process_name_match_type)
: m_match_info(), m_name_match_type(process_name_match_type),
m_match_all_users(false) {
- m_match_info.GetExecutableFile().SetFile(process_name, false);
+ m_match_info.GetExecutableFile().SetFile(process_name, false,
+ FileSpec::Style::native);
}
ProcessInstanceInfo &GetProcessInfo() { return m_match_info; }
@@ -388,10 +392,8 @@ protected:
};
// This class tracks the Modification state of the process. Things that can
-// currently modify
-// the program are running the program (which will up the StopID) and writing
-// memory (which
-// will up the MemoryID.)
+// currently modify the program are running the program (which will up the
+// StopID) and writing memory (which will up the MemoryID.)
// FIXME: Should we also include modification of register states?
class ProcessModID {
@@ -498,7 +500,7 @@ inline bool operator!=(const ProcessModID &lhs, const ProcessModID &rhs) {
//----------------------------------------------------------------------
/// @class Process Process.h "lldb/Target/Process.h"
-/// @brief A plug-in interface definition class for debugging a process.
+/// A plug-in interface definition class for debugging a process.
//----------------------------------------------------------------------
class Process : public std::enable_shared_from_this<Process>,
public ProcessProperties,
@@ -539,12 +541,11 @@ public:
enum Warnings { eWarningsOptimization = 1 };
typedef Range<lldb::addr_t, lldb::addr_t> LoadRange;
- // We use a read/write lock to allow on or more clients to
- // access the process state while the process is stopped (reader).
- // We lock the write lock to control access to the process
- // while it is running (readers, or clients that want the process
- // stopped can block waiting for the process to stop, or just
- // try to lock it to see if they can immediately access the stopped
+ // We use a read/write lock to allow on or more clients to access the process
+ // state while the process is stopped (reader). We lock the write lock to
+ // control access to the process while it is running (readers, or clients
+ // that want the process stopped can block waiting for the process to stop,
+ // or just try to lock it to see if they can immediately access the stopped
// process. If the try read lock fails, then the process is running.
typedef ProcessRunLock::ProcessRunLocker StopLocker;
@@ -560,8 +561,8 @@ public:
/// A notification structure that can be used by clients to listen
/// for changes in a process's lifetime.
///
-/// @see RegisterNotificationCallbacks (const Notifications&)
-/// @see UnregisterNotificationCallbacks (const Notifications&)
+/// @see RegisterNotificationCallbacks (const Notifications&) @see
+/// UnregisterNotificationCallbacks (const Notifications&)
//------------------------------------------------------------------
#ifndef SWIG
typedef struct {
@@ -657,8 +658,8 @@ public:
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp);
//------------------------------------------------------------------
- /// Construct with a shared pointer to a target, the Process listener,
- /// and the appropriate UnixSignalsSP for the process.
+ /// Construct with a shared pointer to a target, the Process listener, and
+ /// the appropriate UnixSignalsSP for the process.
//------------------------------------------------------------------
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp,
const lldb::UnixSignalsSP &unix_signals_sp);
@@ -666,8 +667,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited from by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// from by the plug-in instance.
//------------------------------------------------------------------
~Process() override;
@@ -678,12 +679,12 @@ public:
static const ProcessPropertiesSP &GetGlobalProperties();
//------------------------------------------------------------------
- /// Find a Process plug-in that can debug \a module using the
- /// currently selected architecture.
+ /// Find a Process plug-in that can debug \a module using the currently
+ /// selected architecture.
///
- /// Scans all loaded plug-in interfaces that implement versions of
- /// the Process plug-in interface and returns the first instance
- /// that can debug the file.
+ /// Scans all loaded plug-in interfaces that implement versions of the
+ /// Process plug-in interface and returns the first instance that can debug
+ /// the file.
///
/// @param[in] module_sp
/// The module shared pointer that this process will debug.
@@ -704,11 +705,10 @@ public:
/// Static function that can be used with the \b host function
/// Host::StartMonitoringChildProcess ().
///
- /// This function can be used by lldb_private::Process subclasses
- /// when they want to watch for a local process and have its exit
- /// status automatically set when the host child process exits.
- /// Subclasses should call Host::StartMonitoringChildProcess ()
- /// with:
+ /// This function can be used by lldb_private::Process subclasses when they
+ /// want to watch for a local process and have its exit status automatically
+ /// set when the host child process exits. Subclasses should call
+ /// Host::StartMonitoringChildProcess () with:
/// callback = Process::SetHostProcessExitStatus
/// pid = Process::GetID()
/// monitor_signals = false
@@ -728,9 +728,9 @@ public:
//------------------------------------------------------------------
/// Check if a plug-in instance can debug the file in \a module.
///
- /// Each plug-in is given a chance to say whether it can debug
- /// the file in \a module. If the Process plug-in instance can
- /// debug a file on the current system, it should return \b true.
+ /// Each plug-in is given a chance to say whether it can debug the file in
+ /// \a module. If the Process plug-in instance can debug a file on the
+ /// current system, it should return \b true.
///
/// @return
/// Returns \b true if this Process plug-in instance can
@@ -742,8 +742,8 @@ public:
//------------------------------------------------------------------
/// This object is about to be destroyed, do any necessary cleanup.
///
- /// Subclasses that override this method should always call this
- /// superclass method.
+ /// Subclasses that override this method should always call this superclass
+ /// method.
//------------------------------------------------------------------
virtual void Finalize();
@@ -757,13 +757,13 @@ public:
bool IsValid() const { return !m_finalize_called; }
//------------------------------------------------------------------
- /// Return a multi-word command object that can be used to expose
- /// plug-in specific commands.
+ /// Return a multi-word command object that can be used to expose plug-in
+ /// specific commands.
///
/// This object will be used to resolve plug-in commands and can be
/// triggered by a call to:
///
- /// (lldb) process commmand <args>
+ /// (lldb) process command <args>
///
/// @return
/// A CommandObject which can be one of the concrete subclasses
@@ -775,16 +775,15 @@ public:
//------------------------------------------------------------------
/// Launch a new process.
///
- /// Launch a new process by spawning a new process using the
- /// target object's executable module's file as the file to launch.
+ /// Launch a new process by spawning a new process using the target object's
+ /// executable module's file as the file to launch.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call Process::WillLaunch (Module *)
- /// and if that returns \b true, Process::DoLaunch (Module*,
- /// char const *[],char const *[],const char *,const char *,
- /// const char *) will be called to actually do the launching. If
- /// DoLaunch returns \b true, then Process::DidLaunch() will be
- /// called.
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call Process::WillLaunch (Module *) and if that returns \b
+ /// true, Process::DoLaunch (Module*, char const *[],char const *[],const
+ /// char *,const char *, const char *) will be called to actually do the
+ /// launching. If DoLaunch returns \b true, then Process::DidLaunch() will
+ /// be called.
///
/// @param[in] launch_info
/// Details regarding the environment, STDIN/STDOUT/STDERR
@@ -807,13 +806,48 @@ public:
}
//------------------------------------------------------------------
+ // FUTURE WORK: GetLoadImageUtilityFunction are the first use we've
+ // had of having other plugins cache data in the Process. This is handy for
+ // long-living plugins - like the Platform - which manage interactions whose
+ // lifetime is governed by the Process lifetime. If we find we need to do
+ // this more often, we should construct a general solution to the problem.
+ // The consensus suggestion was that we have a token based registry in the
+ // Process. Some undecided questions are (1) who manages the tokens. It's
+ // probably best that you add the element and get back a token that
+ // represents it. That will avoid collisions. But there may be some utility
+ // in the registerer controlling the token? (2) whether the thing added
+ // should be simply owned by Process, and just go away when it does (3)
+ // whether the registree should be notified of the Process' demise.
+ //
+ // We are postponing designing this till we have at least a second use case.
+ //------------------------------------------------------------------
+ //------------------------------------------------------------------
+ /// Get the cached UtilityFunction that assists in loading binary images
+ /// into the process.
+ ///
+ /// @param[in] platform
+ /// The platform fetching the UtilityFunction.
+ /// @param[in] factory
+ /// A function that will be called only once per-process in a
+ /// thread-safe way to create the UtilityFunction if it has not
+ /// been initialized yet.
+ ///
+ /// @return
+ /// The cached utility function or null if the platform is not the
+ /// same as the target's platform.
+ //------------------------------------------------------------------
+ UtilityFunction *GetLoadImageUtilityFunction(
+ Platform *platform,
+ llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory);
+
+ //------------------------------------------------------------------
/// Get the dynamic loader plug-in for this process.
///
- /// The default action is to let the DynamicLoader plug-ins check
- /// the main executable and the DynamicLoader will select itself
- /// automatically. Subclasses can override this if inspecting the
- /// executable is not desired, or if Process subclasses can only
- /// use a specific DynamicLoader plug-in.
+ /// The default action is to let the DynamicLoader plug-ins check the main
+ /// executable and the DynamicLoader will select itself automatically.
+ /// Subclasses can override this if inspecting the executable is not
+ /// desired, or if Process subclasses can only use a specific DynamicLoader
+ /// plug-in.
//------------------------------------------------------------------
virtual DynamicLoader *GetDynamicLoader();
@@ -828,11 +862,11 @@ public:
virtual const lldb::DataBufferSP GetAuxvData();
//------------------------------------------------------------------
- /// Sometimes processes know how to retrieve and load shared libraries.
- /// This is normally done by DynamicLoader plug-ins, but sometimes the
- /// connection to the process allows retrieving this information. The
- /// dynamic loader plug-ins can use this function if they can't
- /// determine the current shared library load state.
+ /// Sometimes processes know how to retrieve and load shared libraries. This
+ /// is normally done by DynamicLoader plug-ins, but sometimes the connection
+ /// to the process allows retrieving this information. The dynamic loader
+ /// plug-ins can use this function if they can't determine the current
+ /// shared library load state.
///
/// @return
/// The number of shared libraries that were loaded
@@ -857,11 +891,10 @@ public:
//------------------------------------------------------------------
/// Attach to an existing process using the process attach info.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. It will first call WillAttach (lldb::pid_t)
- /// or WillAttach (const char *), and if that returns \b
- /// true, DoAttach (lldb::pid_t) or DoAttach (const char *) will
- /// be called to actually do the attach. If DoAttach returns \b
+ /// This function is not meant to be overridden by Process subclasses. It
+ /// will first call WillAttach (lldb::pid_t) or WillAttach (const char *),
+ /// and if that returns \b true, DoAttach (lldb::pid_t) or DoAttach (const
+ /// char *) will be called to actually do the attach. If DoAttach returns \b
/// true, then Process::DidAttach() will be called.
///
/// @param[in] pid
@@ -896,12 +929,11 @@ public:
//------------------------------------------------------------------
/// Get the image information address for the current process.
///
- /// Some runtimes have system functions that can help dynamic
- /// loaders locate the dynamic loader information needed to observe
- /// shared libraries being loaded or unloaded. This function is
- /// in the Process interface (as opposed to the DynamicLoader
- /// interface) to ensure that remote debugging can take advantage of
- /// this functionality.
+ /// Some runtimes have system functions that can help dynamic loaders locate
+ /// the dynamic loader information needed to observe shared libraries being
+ /// loaded or unloaded. This function is in the Process interface (as
+ /// opposed to the DynamicLoader interface) to ensure that remote debugging
+ /// can take advantage of this functionality.
///
/// @return
/// The address of the dynamic loader information, or
@@ -913,17 +945,16 @@ public:
//------------------------------------------------------------------
/// Called when the process is about to broadcast a public stop.
///
- /// There are public and private stops. Private stops are when the
- /// process is doing things like stepping and the client doesn't
- /// need to know about starts and stop that implement a thread plan.
- /// Single stepping over a source line in code might end up being
- /// implemented by one or more process starts and stops. Public stops
- /// are when clients will be notified that the process is stopped.
- /// These events typically trigger UI updates (thread stack frames to
- /// be displayed, variables to be displayed, and more). This function
- /// can be overriden and allows process subclasses to do something
- /// before the eBroadcastBitStateChanged event is sent to public
- /// clients.
+ /// There are public and private stops. Private stops are when the process
+ /// is doing things like stepping and the client doesn't need to know about
+ /// starts and stop that implement a thread plan. Single stepping over a
+ /// source line in code might end up being implemented by one or more
+ /// process starts and stops. Public stops are when clients will be notified
+ /// that the process is stopped. These events typically trigger UI updates
+ /// (thread stack frames to be displayed, variables to be displayed, and
+ /// more). This function can be overriden and allows process subclasses to
+ /// do something before the eBroadcastBitStateChanged event is sent to
+ /// public clients.
//------------------------------------------------------------------
virtual void WillPublicStop() {}
@@ -946,8 +977,8 @@ public:
//------------------------------------------------------------------
/// Unregister for process and thread notifications.
///
-/// Clients can unregister notification callbacks by passing a copy of
-/// the original baton and callbacks in \a callbacks.
+/// Clients can unregister notification callbacks by passing a copy of the
+/// original baton and callbacks in \a callbacks.
///
/// @param[in] callbacks
/// A structure that contains the notification baton and
@@ -967,25 +998,24 @@ public:
// Built in Process Control functions
//==================================================================
//------------------------------------------------------------------
- /// Resumes all of a process's threads as configured using the
- /// Thread run control functions.
+ /// Resumes all of a process's threads as configured using the Thread run
+ /// control functions.
///
- /// Threads for a process should be updated with one of the run
- /// control actions (resume, step, or suspend) that they should take
- /// when the process is resumed. If no run control action is given
- /// to a thread it will be resumed by default.
+ /// Threads for a process should be updated with one of the run control
+ /// actions (resume, step, or suspend) that they should take when the
+ /// process is resumed. If no run control action is given to a thread it
+ /// will be resumed by default.
///
- /// This function is not meant to be overridden by Process
- /// subclasses. This function will take care of disabling any
- /// breakpoints that threads may be stopped at, single stepping, and
- /// re-enabling breakpoints, and enabling the basic flow control
- /// that the plug-in instances need not worry about.
+ /// This function is not meant to be overridden by Process subclasses. This
+ /// function will take care of disabling any breakpoints that threads may be
+ /// stopped at, single stepping, and re-enabling breakpoints, and enabling
+ /// the basic flow control that the plug-in instances need not worry about.
///
- /// N.B. This function also sets the Write side of the Run Lock,
- /// which is unset when the corresponding stop event is pulled off
- /// the Public Event Queue. If you need to resume the process without
- /// setting the Run Lock, use PrivateResume (though you should only do
- /// that from inside the Process class.
+ /// N.B. This function also sets the Write side of the Run Lock, which is
+ /// unset when the corresponding stop event is pulled off the Public Event
+ /// Queue. If you need to resume the process without setting the Run Lock,
+ /// use PrivateResume (though you should only do that from inside the
+ /// Process class.
///
/// @return
/// Returns an error object.
@@ -1001,11 +1031,10 @@ public:
//------------------------------------------------------------------
/// Halts a running process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
- /// If the process is successfully halted, a eStateStopped
- /// process event with GetInterrupted will be broadcast. If false, we will
- /// halt the process with no events generated by the halt.
+ /// This function is not meant to be overridden by Process subclasses. If
+ /// the process is successfully halted, a eStateStopped process event with
+ /// GetInterrupted will be broadcast. If false, we will halt the process
+ /// with no events generated by the halt.
///
/// @param[in] clear_thread_plans
/// If true, when the process stops, clear all thread plans.
@@ -1023,8 +1052,7 @@ public:
//------------------------------------------------------------------
/// Detaches from a running or stopped process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @param[in] keep_stopped
/// If true, don't resume the process on detach.
@@ -1035,11 +1063,10 @@ public:
Status Detach(bool keep_stopped);
//------------------------------------------------------------------
- /// Kills the process and shuts down all threads that were spawned
- /// to track and monitor the process.
+ /// Kills the process and shuts down all threads that were spawned to track
+ /// and monitor the process.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @param[in] force_kill
/// Whether lldb should force a kill (instead of a detach) from
@@ -1057,8 +1084,7 @@ public:
//------------------------------------------------------------------
/// Sends a process a UNIX signal \a signal.
///
- /// This function is not meant to be overridden by Process
- /// subclasses.
+ /// This function is not meant to be overridden by Process subclasses.
///
/// @return
/// Returns an error object.
@@ -1076,8 +1102,7 @@ public:
//------------------------------------------------------------------
/// Called before attaching to a process.
///
- /// Allow Process plug-ins to execute some code before attaching a
- /// process.
+ /// Allow Process plug-ins to execute some code before attaching a process.
///
/// @return
/// Returns an error object.
@@ -1087,8 +1112,7 @@ public:
//------------------------------------------------------------------
/// Called before attaching to a process.
///
- /// Allow Process plug-ins to execute some code before attaching a
- /// process.
+ /// Allow Process plug-ins to execute some code before attaching a process.
///
/// @return
/// Returns an error object.
@@ -1173,33 +1197,31 @@ public:
/// If you can figure out the process architecture after attach, fill it
/// in here.
///
- /// Allow Process plug-ins to execute some code after attaching to
- /// a process.
+ /// Allow Process plug-ins to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach(ArchSpec &process_arch) { process_arch.Clear(); }
//------------------------------------------------------------------
/// Called after a process re-execs itself.
///
- /// Allow Process plug-ins to execute some code after a process has
- /// exec'ed itself. Subclasses typically should override DoDidExec()
- /// as the lldb_private::Process class needs to remove its dynamic
- /// loader, runtime, ABI and other plug-ins, as well as unload all
- /// shared libraries.
+ /// Allow Process plug-ins to execute some code after a process has exec'ed
+ /// itself. Subclasses typically should override DoDidExec() as the
+ /// lldb_private::Process class needs to remove its dynamic loader, runtime,
+ /// ABI and other plug-ins, as well as unload all shared libraries.
//------------------------------------------------------------------
virtual void DidExec();
//------------------------------------------------------------------
- /// Subclasses of Process should implement this function if they
- /// need to do anything after a process exec's itself.
+ /// Subclasses of Process should implement this function if they need to do
+ /// anything after a process exec's itself.
//------------------------------------------------------------------
virtual void DoDidExec() {}
//------------------------------------------------------------------
/// Called before launching to a process.
///
- /// Allow Process plug-ins to execute some code before launching a
- /// process.
+ /// Allow Process plug-ins to execute some code before launching a process.
///
/// @return
/// Returns an error object.
@@ -1209,9 +1231,9 @@ public:
//------------------------------------------------------------------
/// Launch a new process.
///
- /// Launch a new process by spawning a new process using
- /// \a exe_module's file as the file to launch. Launch details are
- /// provided in \a launch_info.
+ /// Launch a new process by spawning a new process using \a exe_module's
+ /// file as the file to launch. Launch details are provided in \a
+ /// launch_info.
///
/// @param[in] exe_module
/// The module from which to extract the file specification and
@@ -1236,16 +1258,14 @@ public:
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow Process plug-ins to execute some code after launching
- /// a process.
+ /// Allow Process plug-ins to execute some code after launching a process.
//------------------------------------------------------------------
virtual void DidLaunch() {}
//------------------------------------------------------------------
/// Called before resuming to a process.
///
- /// Allow Process plug-ins to execute some code before resuming a
- /// process.
+ /// Allow Process plug-ins to execute some code before resuming a process.
///
/// @return
/// Returns an error object.
@@ -1253,13 +1273,13 @@ public:
virtual Status WillResume() { return Status(); }
//------------------------------------------------------------------
- /// Resumes all of a process's threads as configured using the
- /// Thread run control functions.
+ /// Resumes all of a process's threads as configured using the Thread run
+ /// control functions.
///
- /// Threads for a process should be updated with one of the run
- /// control actions (resume, step, or suspend) that they should take
- /// when the process is resumed. If no run control action is given
- /// to a thread it will be resumed by default.
+ /// Threads for a process should be updated with one of the run control
+ /// actions (resume, step, or suspend) that they should take when the
+ /// process is resumed. If no run control action is given to a thread it
+ /// will be resumed by default.
///
/// @return
/// Returns \b true if the process successfully resumes using
@@ -1280,16 +1300,14 @@ public:
//------------------------------------------------------------------
/// Called after resuming a process.
///
- /// Allow Process plug-ins to execute some code after resuming
- /// a process.
+ /// Allow Process plug-ins to execute some code after resuming a process.
//------------------------------------------------------------------
virtual void DidResume() {}
//------------------------------------------------------------------
/// Called before halting to a process.
///
- /// Allow Process plug-ins to execute some code before halting a
- /// process.
+ /// Allow Process plug-ins to execute some code before halting a process.
///
/// @return
/// Returns an error object.
@@ -1300,13 +1318,10 @@ public:
/// Halts a running process.
///
/// DoHalt must produce one and only one stop StateChanged event if it
- /// actually
- /// stops the process. If the stop happens through some natural event (for
- /// instance a SIGSTOP), then forwarding that event will do. Otherwise, you
- /// must
- /// generate the event manually. This function is called from the context of
- /// the
- /// private state thread.
+ /// actually stops the process. If the stop happens through some natural
+ /// event (for instance a SIGSTOP), then forwarding that event will do.
+ /// Otherwise, you must generate the event manually. This function is called
+ /// from the context of the private state thread.
///
/// @param[out] caused_stop
/// If true, then this Halt caused the stop, otherwise, the
@@ -1327,16 +1342,15 @@ public:
//------------------------------------------------------------------
/// Called after halting a process.
///
- /// Allow Process plug-ins to execute some code after halting
- /// a process.
+ /// Allow Process plug-ins to execute some code after halting a process.
//------------------------------------------------------------------
virtual void DidHalt() {}
//------------------------------------------------------------------
/// Called before detaching from a process.
///
- /// Allow Process plug-ins to execute some code before detaching
- /// from a process.
+ /// Allow Process plug-ins to execute some code before detaching from a
+ /// process.
///
/// @return
/// Returns an error object.
@@ -1361,8 +1375,8 @@ public:
//------------------------------------------------------------------
/// Called after detaching from a process.
///
- /// Allow Process plug-ins to execute some code after detaching
- /// from a process.
+ /// Allow Process plug-ins to execute some code after detaching from a
+ /// process.
//------------------------------------------------------------------
virtual void DidDetach() {}
@@ -1371,8 +1385,8 @@ public:
//------------------------------------------------------------------
/// Called before sending a signal to a process.
///
- /// Allow Process plug-ins to execute some code before sending a
- /// signal to a process.
+ /// Allow Process plug-ins to execute some code before sending a signal to a
+ /// process.
///
/// @return
/// Returns no error if it is safe to proceed with a call to
@@ -1406,8 +1420,8 @@ public:
//------------------------------------------------------------------
/// Called after sending a signal to a process.
///
- /// Allow Process plug-ins to execute some code after sending a
- /// signal to a process.
+ /// Allow Process plug-ins to execute some code after sending a signal to a
+ /// process.
//------------------------------------------------------------------
virtual void DidSignal() {}
@@ -1417,45 +1431,28 @@ public:
/// event is taken from the queue...
///
/// This callback is called as the event
- /// is about to be queued up to allow Process plug-ins to execute
- /// some code prior to clients being notified that a process was
- /// stopped. Common operations include updating the thread list,
- /// invalidating any thread state (registers, stack, etc) prior to
- /// letting the notification go out.
+ /// is about to be queued up to allow Process plug-ins to execute some code
+ /// prior to clients being notified that a process was stopped. Common
+ /// operations include updating the thread list, invalidating any thread
+ /// state (registers, stack, etc) prior to letting the notification go out.
///
//------------------------------------------------------------------
virtual void RefreshStateAfterStop() = 0;
//------------------------------------------------------------------
- /// Sometimes the connection to a process can detect the host OS
- /// version that the process is running on. The current platform
- /// should be checked first in case the platform is connected, but
- /// clients can fall back onto this function if the platform fails
- /// to identify the host OS version. The platform should be checked
- /// first in case you are running a simulator platform that might
- /// itself be running natively, but have different heuristics for
- /// figuring out which OS is is emulating.
- ///
- /// @param[out] major
- /// The major OS version, or UINT32_MAX if it can't be determined
- ///
- /// @param[out] minor
- /// The minor OS version, or UINT32_MAX if it can't be determined
- ///
- /// @param[out] update
- /// The update OS version, or UINT32_MAX if it can't be determined
+ /// Sometimes the connection to a process can detect the host OS version
+ /// that the process is running on. The current platform should be checked
+ /// first in case the platform is connected, but clients can fall back onto
+ /// this function if the platform fails to identify the host OS version. The
+ /// platform should be checked first in case you are running a simulator
+ /// platform that might itself be running natively, but have different
+ /// heuristics for figuring out which OS is is emulating.
///
/// @return
- /// Returns \b true if the host OS version info was filled in
- /// and \b false otherwise.
+ /// Returns the version tuple of the host OS. In case of failure an empty
+ /// VersionTuple is returner.
//------------------------------------------------------------------
- virtual bool GetHostOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
- major = UINT32_MAX;
- minor = UINT32_MAX;
- update = UINT32_MAX;
- return false;
- }
+ virtual llvm::VersionTuple GetHostOSVersion() { return llvm::VersionTuple(); }
//------------------------------------------------------------------
/// Get the target object pointer for this module.
@@ -1464,7 +1461,7 @@ public:
/// A Target object pointer to the target that owns this
/// module.
//------------------------------------------------------------------
- Target &GetTarget() { return *m_target_sp.lock(); }
+ Target &GetTarget() { return *m_target_wp.lock(); }
//------------------------------------------------------------------
/// Get the const target object pointer for this module.
@@ -1473,17 +1470,17 @@ public:
/// A const Target object pointer to the target that owns this
/// module.
//------------------------------------------------------------------
- const Target &GetTarget() const { return *m_target_sp.lock(); }
+ const Target &GetTarget() const { return *m_target_wp.lock(); }
//------------------------------------------------------------------
/// Flush all data in the process.
///
- /// Flush the memory caches, all threads, and any other cached data
- /// in the process.
+ /// Flush the memory caches, all threads, and any other cached data in the
+ /// process.
///
- /// This function can be called after a world changing event like
- /// adding a new symbol file, or after the process makes a large
- /// context switch (from boot ROM to booted into an OS).
+ /// This function can be called after a world changing event like adding a
+ /// new symbol file, or after the process makes a large context switch (from
+ /// boot ROM to booted into an OS).
//------------------------------------------------------------------
void Flush();
@@ -1516,22 +1513,23 @@ public:
//------------------------------------------------------------------
// Notify this process class that modules got loaded.
//
- // If subclasses override this method, they must call this version
- // before doing anything in the subclass version of the function.
+ // If subclasses override this method, they must call this version before
+ // doing anything in the subclass version of the function.
//------------------------------------------------------------------
virtual void ModulesDidLoad(ModuleList &module_list);
//------------------------------------------------------------------
/// Retrieve the list of shared libraries that are loaded for this process
- /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10,
- /// pre-watchOS 3 systems. The following two methods are for newer versions
- /// of those OSes.
+ /// This method is used on pre-macOS 10.12, pre-iOS 10, pre-tvOS 10, pre-
+ /// watchOS 3 systems. The following two methods are for newer versions of
+ /// those OSes.
///
/// For certain platforms, the time it takes for the DynamicLoader plugin to
/// read all of the shared libraries out of memory over a slow communication
/// channel may be too long. In that instance, the gdb-remote stub may be
- /// able to retrieve the necessary information about the solibs out of memory
- /// and return a concise summary sufficient for the DynamicLoader plugin.
+ /// able to retrieve the necessary information about the solibs out of
+ /// memory and return a concise summary sufficient for the DynamicLoader
+ /// plugin.
///
/// @param [in] image_list_address
/// The address where the table of shared libraries is stored in memory,
@@ -1555,16 +1553,14 @@ public:
}
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // the full list of loaded shared libraries without needing any input.
+ // return the full list of loaded shared libraries without needing any input.
virtual lldb_private::StructuredData::ObjectSP
GetLoadedDynamicLibrariesInfos() {
return StructuredData::ObjectSP();
}
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // information about binaries given their load addresses.
+ // return information about binaries given their load addresses.
virtual lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(
const std::vector<lldb::addr_t> &load_addresses) {
return StructuredData::ObjectSP();
@@ -1574,21 +1570,20 @@ public:
// Get information about the library shared cache, if that exists
//
// On macOS 10.12, tvOS 10, iOS 10, watchOS 3 and newer, debugserver can
- // return
- // information about the library shared cache (a set of standard libraries
- // that are
- // loaded at the same location for all processes on a system) in use.
+ // return information about the library shared cache (a set of standard
+ // libraries that are loaded at the same location for all processes on a
+ // system) in use.
//------------------------------------------------------------------
virtual lldb_private::StructuredData::ObjectSP GetSharedCacheInfo() {
return StructuredData::ObjectSP();
}
//------------------------------------------------------------------
- /// Print a user-visible warning about a module being built with optimization
+ /// Print a user-visible warning about a module being built with
+ /// optimization
///
- /// Prints a async warning message to the user one time per Module
- /// where a function is found that was compiled with optimization, per
- /// Process.
+ /// Prints a async warning message to the user one time per Module where a
+ /// function is found that was compiled with optimization, per Process.
///
/// @param [in] sc
/// A SymbolContext with eSymbolContextFunction and eSymbolContextModule
@@ -1648,13 +1643,12 @@ public:
//------------------------------------------------------------------
/// Set accessor for the process exit status (return code).
///
- /// Sometimes a child exits and the exit can be detected by global
- /// functions (signal handler for SIGCHLD for example). This
- /// accessor allows the exit status to be set from an external
- /// source.
+ /// Sometimes a child exits and the exit can be detected by global functions
+ /// (signal handler for SIGCHLD for example). This accessor allows the exit
+ /// status to be set from an external source.
///
- /// Setting this will cause a eStateExited event to be posted to
- /// the process event queue.
+ /// Setting this will cause a eStateExited event to be posted to the process
+ /// event queue.
///
/// @param[in] exit_status
/// The value for the process's return code.
@@ -1673,11 +1667,10 @@ public:
virtual bool IsAlive();
//------------------------------------------------------------------
- /// Before lldb detaches from a process, it warns the user that they are about
- /// to lose their debug session.
- /// In some cases, this warning doesn't need to be emitted -- for instance,
- /// with core file debugging where
- /// the user can reconstruct the "state" by simply re-running the debugger on
+ /// Before lldb detaches from a process, it warns the user that they are
+ /// about to lose their debug session. In some cases, this warning doesn't
+ /// need to be emitted -- for instance, with core file debugging where the
+ /// user can reconstruct the "state" by simply re-running the debugger on
/// the core file.
///
/// @return
@@ -1688,10 +1681,9 @@ public:
//------------------------------------------------------------------
/// Actually do the reading of memory from a process.
///
- /// Subclasses must override this function and can return fewer
- /// bytes than requested when memory requests are too large. This
- /// class will break up the memory requests and keep advancing the
- /// arguments along as needed.
+ /// Subclasses must override this function and can return fewer bytes than
+ /// requested when memory requests are too large. This class will break up
+ /// the memory requests and keep advancing the arguments along as needed.
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start reading
@@ -1704,8 +1696,15 @@ public:
/// A byte buffer that is at least \a size bytes long that
/// will receive the memory bytes.
///
+ /// @param[out] error
+ /// An error that indicates the success or failure of this
+ /// operation. If error indicates success (error.Success()),
+ /// then the value returned can be trusted, otherwise zero
+ /// will be returned.
+ ///
/// @return
/// The number of bytes that were actually read into \a buf.
+ /// Zero is returned in the case of an error.
//------------------------------------------------------------------
virtual size_t DoReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
Status &error) = 0;
@@ -1713,13 +1712,12 @@ public:
//------------------------------------------------------------------
/// Read of memory from a process.
///
- /// This function will read memory from the current process's
- /// address space and remove any traps that may have been inserted
- /// into the memory.
+ /// This function will read memory from the current process's address space
+ /// and remove any traps that may have been inserted into the memory.
///
- /// This function is not meant to be overridden by Process
- /// subclasses, the subclasses should implement
- /// Process::DoReadMemory (lldb::addr_t, size_t, void *).
+ /// This function is not meant to be overridden by Process subclasses, the
+ /// subclasses should implement Process::DoReadMemory (lldb::addr_t, size_t,
+ /// void *).
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start reading
@@ -1732,12 +1730,18 @@ public:
/// @param[in] size
/// The number of bytes to read.
///
+ /// @param[out] error
+ /// An error that indicates the success or failure of this
+ /// operation. If error indicates success (error.Success()),
+ /// then the value returned can be trusted, otherwise zero
+ /// will be returned.
+ ///
/// @return
/// The number of bytes that were actually read into \a buf. If
/// the returned number is greater than zero, yet less than \a
/// size, then this function will get called again with \a
/// vm_addr, \a buf, and \a size updated appropriately. Zero is
- /// returned to indicate an error.
+ /// returned in the case of an error.
//------------------------------------------------------------------
virtual size_t ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
Status &error);
@@ -1745,12 +1749,12 @@ public:
//------------------------------------------------------------------
/// Read a NULL terminated string from memory
///
- /// This function will read a cache page at a time until a NULL
- /// string terminator is found. It will stop reading if an aligned
- /// sequence of NULL termination \a type_width bytes is not found
- /// before reading \a cstr_max_len bytes. The results are always
- /// guaranteed to be NULL terminated, and that no more than
- /// (max_bytes - type_width) bytes will be read.
+ /// This function will read a cache page at a time until a NULL string
+ /// terminator is found. It will stop reading if an aligned sequence of NULL
+ /// termination \a type_width bytes is not found before reading \a
+ /// cstr_max_len bytes. The results are always guaranteed to be NULL
+ /// terminated, and that no more than (max_bytes - type_width) bytes will be
+ /// read.
///
/// @param[in] vm_addr
/// The virtual load address to start the memory read.
@@ -1779,9 +1783,9 @@ public:
///
/// This function will read a cache page at a time until the NULL
/// C string terminator is found. It will stop reading if the NULL
- /// termination byte isn't found before reading \a cstr_max_len
- /// bytes, and the results are always guaranteed to be NULL
- /// terminated (at most cstr_max_len - 1 bytes will be read).
+ /// termination byte isn't found before reading \a cstr_max_len bytes, and
+ /// the results are always guaranteed to be NULL terminated (at most
+ /// cstr_max_len - 1 bytes will be read).
//------------------------------------------------------------------
size_t ReadCStringFromMemory(lldb::addr_t vm_addr, char *cstr,
size_t cstr_max_len, Status &error);
@@ -1793,8 +1797,8 @@ public:
Status &error);
//------------------------------------------------------------------
- /// Reads an unsigned integer of the specified byte size from
- /// process memory.
+ /// Reads an unsigned integer of the specified byte size from process
+ /// memory.
///
/// @param[in] load_addr
/// A load address of the integer to read.
@@ -1862,13 +1866,12 @@ public:
//------------------------------------------------------------------
/// Write all or part of a scalar value to memory.
///
- /// The value contained in \a scalar will be swapped to match the
- /// byte order of the process that is being debugged. If \a size is
- /// less than the size of scalar, the least significant \a size bytes
- /// from scalar will be written. If \a size is larger than the byte
- /// size of scalar, then the extra space will be padded with zeros
- /// and the scalar value will be placed in the least significant
- /// bytes in memory.
+ /// The value contained in \a scalar will be swapped to match the byte order
+ /// of the process that is being debugged. If \a size is less than the size
+ /// of scalar, the least significant \a size bytes from scalar will be
+ /// written. If \a size is larger than the byte size of scalar, then the
+ /// extra space will be padded with zeros and the scalar value will be
+ /// placed in the least significant bytes in memory.
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start writing
@@ -1901,13 +1904,13 @@ public:
//------------------------------------------------------------------
/// Write memory to a process.
///
- /// This function will write memory to the current process's
- /// address space and maintain any traps that might be present due
- /// to software breakpoints.
+ /// This function will write memory to the current process's address space
+ /// and maintain any traps that might be present due to software
+ /// breakpoints.
///
- /// This function is not meant to be overridden by Process
- /// subclasses, the subclasses should implement
- /// Process::DoWriteMemory (lldb::addr_t, size_t, void *).
+ /// This function is not meant to be overridden by Process subclasses, the
+ /// subclasses should implement Process::DoWriteMemory (lldb::addr_t,
+ /// size_t, void *).
///
/// @param[in] vm_addr
/// A virtual load address that indicates where to start writing
@@ -1930,9 +1933,9 @@ public:
//------------------------------------------------------------------
/// Actually allocate memory in the process.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -1950,12 +1953,14 @@ public:
return LLDB_INVALID_ADDRESS;
}
+ virtual Status WriteObjectFile(std::vector<ObjectFile::LoadableData> entries);
+
//------------------------------------------------------------------
/// The public interface to allocating memory in the process.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -1979,9 +1984,9 @@ public:
/// The public interface to allocating memory in the process, this also
/// clears the allocated memory.
///
- /// This function will allocate memory in the process's address
- /// space. This can't rely on the generic function calling mechanism,
- /// since that requires this function.
+ /// This function will allocate memory in the process's address space. This
+ /// can't rely on the generic function calling mechanism, since that
+ /// requires this function.
///
/// @param[in] size
/// The size of the allocation requested.
@@ -2023,18 +2028,18 @@ public:
/// Locate the memory region that contains load_addr.
///
/// If load_addr is within the address space the process has mapped
- /// range_info will be filled in with the start and end of that range
- /// as well as the permissions for that range and range_info.GetMapped
- /// will return true.
+ /// range_info will be filled in with the start and end of that range as
+ /// well as the permissions for that range and range_info.GetMapped will
+ /// return true.
///
- /// If load_addr is outside any mapped region then range_info will
- /// have its start address set to load_addr and the end of the
- /// range will indicate the start of the next mapped range or be
- /// set to LLDB_INVALID_ADDRESS if there are no valid mapped ranges
- /// between load_addr and the end of the process address space.
+ /// If load_addr is outside any mapped region then range_info will have its
+ /// start address set to load_addr and the end of the range will indicate
+ /// the start of the next mapped range or be set to LLDB_INVALID_ADDRESS if
+ /// there are no valid mapped ranges between load_addr and the end of the
+ /// process address space.
///
- /// GetMemoryRegionInfo will only return an error if it is
- /// unimplemented for the current process.
+ /// GetMemoryRegionInfo will only return an error if it is unimplemented for
+ /// the current process.
///
/// @param[in] load_addr
/// The load address to query the range_info for.
@@ -2087,9 +2092,9 @@ public:
//------------------------------------------------------------------
/// Attempt to get the attributes for a region of memory in the process.
///
- /// It may be possible for the remote debug server to inspect attributes
- /// for a region of memory in the process, such as whether there is a
- /// valid page of memory at a given address or whether that page is
+ /// It may be possible for the remote debug server to inspect attributes for
+ /// a region of memory in the process, such as whether there is a valid page
+ /// of memory at a given address or whether that page is
/// readable/writable/executable by the process.
///
/// @param[in] load_addr
@@ -2109,8 +2114,8 @@ public:
uint32_t &permissions);
//------------------------------------------------------------------
- /// Determines whether executing JIT-compiled code in this process
- /// is possible.
+ /// Determines whether executing JIT-compiled code in this process is
+ /// possible.
///
/// @return
/// True if execution of JIT code is possible; false otherwise.
@@ -2118,8 +2123,7 @@ public:
bool CanJIT();
//------------------------------------------------------------------
- /// Sets whether executing JIT-compiled code in this process
- /// is possible.
+ /// Sets whether executing JIT-compiled code in this process is possible.
///
/// @param[in] can_jit
/// True if execution of JIT code is possible; false otherwise.
@@ -2127,8 +2131,8 @@ public:
void SetCanJIT(bool can_jit);
//------------------------------------------------------------------
- /// Determines whether executing function calls using the interpreter
- /// is possible for this process.
+ /// Determines whether executing function calls using the interpreter is
+ /// possible for this process.
///
/// @return
/// True if possible; false otherwise.
@@ -2136,8 +2140,8 @@ public:
bool CanInterpretFunctionCalls() { return m_can_interpret_function_calls; }
//------------------------------------------------------------------
- /// Sets whether executing function calls using the interpreter
- /// is possible for this process.
+ /// Sets whether executing function calls using the interpreter is possible
+ /// for this process.
///
/// @param[in] can_interpret_function_calls
/// True if possible; false otherwise.
@@ -2147,8 +2151,8 @@ public:
}
//------------------------------------------------------------------
- /// Sets whether executing code in this process is possible.
- /// This could be either through JIT or interpreting.
+ /// Sets whether executing code in this process is possible. This could be
+ /// either through JIT or interpreting.
///
/// @param[in] can_run_code
/// True if execution of code is possible; false otherwise.
@@ -2158,8 +2162,8 @@ public:
//------------------------------------------------------------------
/// Actually deallocate memory in the process.
///
- /// This function will deallocate memory in the process's address
- /// space that was allocated with AllocateMemory.
+ /// This function will deallocate memory in the process's address space that
+ /// was allocated with AllocateMemory.
///
/// @param[in] ptr
/// A return value from AllocateMemory, pointing to the memory you
@@ -2179,8 +2183,8 @@ public:
//------------------------------------------------------------------
/// The public interface to deallocating memory in the process.
///
- /// This function will deallocate memory in the process's address
- /// space that was allocated with AllocateMemory.
+ /// This function will deallocate memory in the process's address space that
+ /// was allocated with AllocateMemory.
///
/// @param[in] ptr
/// A return value from AllocateMemory, pointing to the memory you
@@ -2194,20 +2198,19 @@ public:
//------------------------------------------------------------------
/// Get any available STDOUT.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDOUT.
///
- /// Note that the implementation will probably need to start a read
- /// thread in the background to make sure that the pipe is drained
- /// and the STDOUT buffered appropriately, to prevent the process
- /// from deadlocking trying to write to a full buffer.
+ /// Note that the implementation will probably need to start a read thread
+ /// in the background to make sure that the pipe is drained and the STDOUT
+ /// buffered appropriately, to prevent the process from deadlocking trying
+ /// to write to a full buffer.
///
- /// Events will be queued indicating that there is STDOUT available
- /// that can be retrieved using this function.
+ /// Events will be queued indicating that there is STDOUT available that can
+ /// be retrieved using this function.
///
/// @param[out] buf
/// A buffer that will receive any STDOUT bytes that are
@@ -2226,20 +2229,19 @@ public:
//------------------------------------------------------------------
/// Get any available STDERR.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDERR.
///
- /// Note that the implementation will probably need to start a read
- /// thread in the background to make sure that the pipe is drained
- /// and the STDERR buffered appropriately, to prevent the process
- /// from deadlocking trying to write to a full buffer.
+ /// Note that the implementation will probably need to start a read thread
+ /// in the background to make sure that the pipe is drained and the STDERR
+ /// buffered appropriately, to prevent the process from deadlocking trying
+ /// to write to a full buffer.
///
- /// Events will be queued indicating that there is STDERR available
- /// that can be retrieved using this function.
+ /// Events will be queued indicating that there is STDERR available that can
+ /// be retrieved using this function.
///
/// @param[in] buf
/// A buffer that will receive any STDERR bytes that are
@@ -2258,11 +2260,10 @@ public:
//------------------------------------------------------------------
/// Puts data into this process's STDIN.
///
- /// Calling this method is a valid operation only if all of the
- /// following conditions are true:
- /// 1) The process was launched, and not attached to.
- /// 2) The process was not launched with eLaunchFlagDisableSTDIO.
- /// 3) The process was launched without supplying a valid file path
+ /// Calling this method is a valid operation only if all of the following
+ /// conditions are true: 1) The process was launched, and not attached to.
+ /// 2) The process was not launched with eLaunchFlagDisableSTDIO. 3) The
+ /// process was launched without supplying a valid file path
/// for STDIN.
///
/// @param[in] buf
@@ -2320,9 +2321,9 @@ public:
}
// This is implemented completely using the lldb::Process API. Subclasses
- // don't need to implement this function unless the standard flow of
- // read existing opcode, write breakpoint opcode, verify breakpoint opcode
- // doesn't work for a specific process plug-in.
+ // don't need to implement this function unless the standard flow of read
+ // existing opcode, write breakpoint opcode, verify breakpoint opcode doesn't
+ // work for a specific process plug-in.
virtual Status EnableSoftwareBreakpoint(BreakpointSite *bp_site);
// This is implemented completely using the lldb::Process API. Subclasses
@@ -2346,8 +2347,8 @@ public:
Status EnableBreakpointSiteByID(lldb::user_id_t break_id);
- // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove
- // themselves from the owner's list of this breakpoint sites.
+ // BreakpointLocations use RemoveOwnerFromBreakpointSite to remove themselves
+ // from the owner's list of this breakpoint sites.
void RemoveOwnerFromBreakpointSite(lldb::user_id_t owner_id,
lldb::user_id_t owner_loc_id,
lldb::BreakpointSiteSP &bp_site_sp);
@@ -2369,11 +2370,10 @@ public:
ThreadList &GetThreadList() { return m_thread_list; }
- // When ExtendedBacktraces are requested, the HistoryThreads that are
- // created need an owner -- they're saved here in the Process. The
- // threads in this list are not iterated over - driver programs need to
- // request the extended backtrace calls starting from a root concrete
- // thread one by one.
+ // When ExtendedBacktraces are requested, the HistoryThreads that are created
+ // need an owner -- they're saved here in the Process. The threads in this
+ // list are not iterated over - driver programs need to request the extended
+ // backtrace calls starting from a root concrete thread one by one.
ThreadList &GetExtendedThreadList() { return m_extended_thread_list; }
ThreadList::ThreadIterable Threads() { return m_thread_list.Threads(); }
@@ -2385,10 +2385,9 @@ public:
// Returns true if an index id has been assigned to a thread.
bool HasAssignedIndexIDToThread(uint64_t sb_thread_id);
- // Given a thread_id, it will assign a more reasonable index id for display to
- // the user.
- // If the thread_id has previously been assigned, the same index id will be
- // used.
+ // Given a thread_id, it will assign a more reasonable index id for display
+ // to the user. If the thread_id has previously been assigned, the same index
+ // id will be used.
uint32_t AssignIndexIDToThread(uint64_t thread_id);
//------------------------------------------------------------------
@@ -2413,13 +2412,11 @@ public:
lldb::StateType GetNextEvent(lldb::EventSP &event_sp);
// Returns the process state when it is stopped. If specified, event_sp_ptr
- // is set to the event which triggered the stop. If wait_always = false,
- // and the process is already stopped, this function returns immediately.
- // If the process is hijacked and use_run_lock is true (the default), then
- // this
+ // is set to the event which triggered the stop. If wait_always = false, and
+ // the process is already stopped, this function returns immediately. If the
+ // process is hijacked and use_run_lock is true (the default), then this
// function releases the run lock after the stop. Setting use_run_lock to
- // false
- // will avoid this behavior.
+ // false will avoid this behavior.
lldb::StateType
WaitForProcessToStop(const Timeout<std::micro> &timeout,
lldb::EventSP *event_sp_ptr = nullptr,
@@ -2433,14 +2430,13 @@ public:
/// Waits for the process state to be running within a given msec timeout.
///
/// The main purpose of this is to implement an interlock waiting for
- /// HandlePrivateEvent
- /// to push an IOHandler.
+ /// HandlePrivateEvent to push an IOHandler.
///
- /// @param[in] timeout_msec
+ /// @param[in] timeout
/// The maximum time length to wait for the process to transition to the
- /// eStateRunning state, specified in milliseconds.
+ /// eStateRunning state.
//--------------------------------------------------------------------------------------
- void SyncIOHandler(uint32_t iohandler_id, uint64_t timeout_msec);
+ void SyncIOHandler(uint32_t iohandler_id, const Timeout<std::micro> &timeout);
lldb::StateType GetStateChangedEvents(
lldb::EventSP &event_sp, const Timeout<std::micro> &timeout,
@@ -2448,8 +2444,8 @@ public:
hijack_listener); // Pass an empty ListenerSP to use builtin listener
//--------------------------------------------------------------------------------------
- /// Centralize the code that handles and prints descriptions for process state
- /// changes.
+ /// Centralize the code that handles and prints descriptions for process
+ /// state changes.
///
/// @param[in] event_sp
/// The process state changed event
@@ -2494,8 +2490,8 @@ public:
/// event, then make a new listener, set to listen to process events, and
/// then call this with that listener. Then you will have to wait on that
/// listener explicitly for events (rather than using the GetNextEvent &
- /// WaitFor*
- /// calls above. Be sure to call RestoreProcessEvents when you are done.
+ /// WaitFor* calls above. Be sure to call RestoreProcessEvents when you are
+ /// done.
///
/// @param[in] listener
/// This is the new listener to whom all process events will be delivered.
@@ -2577,27 +2573,26 @@ public:
void SetSTDIOFileDescriptor(int file_descriptor);
//------------------------------------------------------------------
- // Add a permanent region of memory that should never be read or
- // written to. This can be used to ensure that memory reads or writes
- // to certain areas of memory never end up being sent to the
- // DoReadMemory or DoWriteMemory functions which can improve
- // performance.
+ // Add a permanent region of memory that should never be read or written to.
+ // This can be used to ensure that memory reads or writes to certain areas of
+ // memory never end up being sent to the DoReadMemory or DoWriteMemory
+ // functions which can improve performance.
//------------------------------------------------------------------
void AddInvalidMemoryRegion(const LoadRange &region);
//------------------------------------------------------------------
- // Remove a permanent region of memory that should never be read or
- // written to that was previously added with AddInvalidMemoryRegion.
+ // Remove a permanent region of memory that should never be read or written
+ // to that was previously added with AddInvalidMemoryRegion.
//------------------------------------------------------------------
bool RemoveInvalidMemoryRange(const LoadRange &region);
//------------------------------------------------------------------
// If the setup code of a thread plan needs to do work that might involve
- // calling a function in the target, it should not do that work directly
- // in one of the thread plan functions (DidPush/WillResume) because
- // such work needs to be handled carefully. Instead, put that work in
- // a PreResumeAction callback, and register it with the process. It will
- // get done before the actual "DoResume" gets called.
+ // calling a function in the target, it should not do that work directly in
+ // one of the thread plan functions (DidPush/WillResume) because such work
+ // needs to be handled carefully. Instead, put that work in a
+ // PreResumeAction callback, and register it with the process. It will get
+ // done before the actual "DoResume" gets called.
//------------------------------------------------------------------
typedef bool(PreResumeActionCallback)(void *);
@@ -2623,10 +2618,10 @@ public:
GetInstrumentationRuntime(lldb::InstrumentationRuntimeType type);
//------------------------------------------------------------------
- /// Try to fetch the module specification for a module with the
- /// given file name and architecture. Process sub-classes have to
- /// override this method if they support platforms where the
- /// Platform object can't get the module spec for all module.
+ /// Try to fetch the module specification for a module with the given file
+ /// name and architecture. Process sub-classes have to override this method
+ /// if they support platforms where the Platform object can't get the module
+ /// spec for all module.
///
/// @param[in] module_file_spec
/// The file name of the module to get specification for.
@@ -2650,8 +2645,8 @@ public:
//------------------------------------------------------------------
/// Try to find the load address of a file.
- /// The load address is defined as the address of the first memory
- /// region what contains data mapped from the specified file.
+ /// The load address is defined as the address of the first memory region
+ /// what contains data mapped from the specified file.
///
/// @param[in] file
/// The name of the file whose load address we are looking for
@@ -2678,12 +2673,11 @@ public:
//------------------------------------------------------------------
/// Find the next branch instruction to set a breakpoint on
///
- /// When instruction stepping through a source line, instead of
- /// stepping through each instruction, we can put a breakpoint on
- /// the next branch instruction (within the range of instructions
- /// we are stepping through) and continue the process to there,
- /// yielding significant performance benefits over instruction
- /// stepping.
+ /// When instruction stepping through a source line, instead of stepping
+ /// through each instruction, we can put a breakpoint on the next branch
+ /// instruction (within the range of instructions we are stepping through)
+ /// and continue the process to there, yielding significant performance
+ /// benefits over instruction stepping.
///
/// @param[in] default_stop_addr
/// The address of the instruction where lldb would put a
@@ -2710,8 +2704,8 @@ public:
/// The default implementation here will always return an error indiciating
/// the feature is unsupported.
///
- /// StructuredDataPlugin implementations will call this to configure
- /// a feature that has been reported as being supported.
+ /// StructuredDataPlugin implementations will call this to configure a
+ /// feature that has been reported as being supported.
///
/// @param[in] type_name
/// The StructuredData type name as previously discovered by
@@ -2733,13 +2727,12 @@ public:
const StructuredData::ObjectSP &config_sp);
//------------------------------------------------------------------
- /// Broadcasts the given structured data object from the given
- /// plugin.
+ /// Broadcasts the given structured data object from the given plugin.
///
- /// StructuredDataPlugin instances can use this to optionally
- /// broadcast any of their data if they want to make it available
- /// for clients. The data will come in on the structured data
- /// event bit (eBroadcastBitStructuredData).
+ /// StructuredDataPlugin instances can use this to optionally broadcast any
+ /// of their data if they want to make it available for clients. The data
+ /// will come in on the structured data event bit
+ /// (eBroadcastBitStructuredData).
///
/// @param[in] object_sp
/// The structured data object to broadcast.
@@ -2752,12 +2745,12 @@ public:
const lldb::StructuredDataPluginSP &plugin_sp);
//------------------------------------------------------------------
- /// Returns the StructuredDataPlugin associated with a given type
- /// name, if there is one.
+ /// Returns the StructuredDataPlugin associated with a given type name, if
+ /// there is one.
///
/// There will only be a plugin for a given StructuredDataType if the
- /// debugged process monitor claims that the feature is supported.
- /// This is one way to tell whether a feature is available.
+ /// debugged process monitor claims that the feature is supported. This is
+ /// one way to tell whether a feature is available.
///
/// @return
/// The plugin if one is available for the specified feature;
@@ -2767,17 +2760,14 @@ public:
GetStructuredDataPlugin(const ConstString &type_name) const;
//------------------------------------------------------------------
- /// Starts tracing with the configuration provided in options. To
- /// enable tracing on the complete process the thread_id in the
- /// options should be set to LLDB_INVALID_THREAD_ID. The API returns
- /// a user_id which is needed by other API's that manipulate the
- /// trace instance.
- /// The handling of erroneous or unsupported configuration is left
- /// to the trace technology implementations in the server, as they
- /// could be returned as an error, or rounded to a valid
- /// configuration to start tracing. In the later case the
- /// GetTraceConfig should supply the actual used trace
- /// configuration.
+ /// Starts tracing with the configuration provided in options. To enable
+ /// tracing on the complete process the thread_id in the options should be
+ /// set to LLDB_INVALID_THREAD_ID. The API returns a user_id which is needed
+ /// by other API's that manipulate the trace instance. The handling of
+ /// erroneous or unsupported configuration is left to the trace technology
+ /// implementations in the server, as they could be returned as an error, or
+ /// rounded to a valid configuration to start tracing. In the later case the
+ /// GetTraceConfig should supply the actual used trace configuration.
//------------------------------------------------------------------
virtual lldb::user_id_t StartTrace(const TraceOptions &options,
Status &error) {
@@ -2786,25 +2776,23 @@ public:
}
//------------------------------------------------------------------
- /// Stops the tracing instance leading to deletion of the trace
- /// data. The tracing instance is identified by the user_id which
- /// is obtained when tracing was started from the StartTrace.
- /// In case tracing of the complete process needs to be stopped
- /// the thread_id should be set to LLDB_INVALID_THREAD_ID.
- /// In the other case that tracing on an individual thread needs
- /// to be stopped a thread_id can be supplied.
+ /// Stops the tracing instance leading to deletion of the trace data. The
+ /// tracing instance is identified by the user_id which is obtained when
+ /// tracing was started from the StartTrace. In case tracing of the complete
+ /// process needs to be stopped the thread_id should be set to
+ /// LLDB_INVALID_THREAD_ID. In the other case that tracing on an individual
+ /// thread needs to be stopped a thread_id can be supplied.
//------------------------------------------------------------------
virtual Status StopTrace(lldb::user_id_t uid, lldb::tid_t thread_id) {
return Status("Not implemented");
}
//------------------------------------------------------------------
- /// Provides the trace data as raw bytes. A buffer needs to be
- /// supplied to copy the trace data. The exact behavior of this API
- /// may vary across trace technology, as some may support partial
- /// reading of the trace data from a specified offset while some
- /// may not. The thread_id should be used to select a particular
- /// thread for trace extraction.
+ /// Provides the trace data as raw bytes. A buffer needs to be supplied to
+ /// copy the trace data. The exact behavior of this API may vary across
+ /// trace technology, as some may support partial reading of the trace data
+ /// from a specified offset while some may not. The thread_id should be used
+ /// to select a particular thread for trace extraction.
//------------------------------------------------------------------
virtual Status GetData(lldb::user_id_t uid, lldb::tid_t thread_id,
llvm::MutableArrayRef<uint8_t> &buffer,
@@ -2823,12 +2811,12 @@ public:
//------------------------------------------------------------------
/// API to obtain the trace configuration used by a trace instance.
- /// Configurations that may be specific to some trace technology
- /// should be stored in the custom parameters. The options are
- /// transported to the server, which shall interpret accordingly.
- /// The thread_id can be specified in the options to obtain the
- /// configuration used by a specific thread. The thread_id specified
- /// should also match the uid otherwise an error will be returned.
+ /// Configurations that may be specific to some trace technology should be
+ /// stored in the custom parameters. The options are transported to the
+ /// server, which shall interpret accordingly. The thread_id can be
+ /// specified in the options to obtain the configuration used by a specific
+ /// thread. The thread_id specified should also match the uid otherwise an
+ /// error will be returned.
//------------------------------------------------------------------
virtual Status GetTraceConfig(lldb::user_id_t uid, TraceOptions &options) {
return Status("Not implemented");
@@ -2840,8 +2828,8 @@ protected:
lldb::StateType GetPrivateState();
//------------------------------------------------------------------
- /// The "private" side of resuming a process. This doesn't alter the
- /// state of m_run_lock, but just causes the process to resume.
+ /// The "private" side of resuming a process. This doesn't alter the state
+ /// of m_run_lock, but just causes the process to resume.
///
/// @return
/// An Status object describing the success or failure of the resume.
@@ -2858,16 +2846,16 @@ protected:
///
/// A facility for printing a warning to the user once per repeat_key.
///
- /// warning_type is from the Process::Warnings enums.
- /// repeat_key is a pointer value that will be used to ensure that the
- /// warning message is not printed multiple times. For instance, with a
- /// warning about a function being optimized, you can pass the CompileUnit
- /// pointer to have the warning issued for only the first function in a
- /// CU, or the Function pointer to have it issued once for every function,
- /// or a Module pointer to have it issued once per Module.
+ /// warning_type is from the Process::Warnings enums. repeat_key is a
+ /// pointer value that will be used to ensure that the warning message is
+ /// not printed multiple times. For instance, with a warning about a
+ /// function being optimized, you can pass the CompileUnit pointer to have
+ /// the warning issued for only the first function in a CU, or the Function
+ /// pointer to have it issued once for every function, or a Module pointer
+ /// to have it issued once per Module.
///
- /// Classes outside Process should call a specific PrintWarning method
- /// so that the warning strings are all centralized in Process, instead of
+ /// Classes outside Process should call a specific PrintWarning method so
+ /// that the warning strings are all centralized in Process, instead of
/// calling PrintWarning() directly.
///
/// @param [in] warning_type
@@ -2885,15 +2873,14 @@ protected:
const char *fmt, ...) __attribute__((format(printf, 4, 5)));
//------------------------------------------------------------------
- // NextEventAction provides a way to register an action on the next
- // event that is delivered to this process. There is currently only
- // one next event action allowed in the process at one time. If a
- // new "NextEventAction" is added while one is already present, the
- // old action will be discarded (with HandleBeingUnshipped called
- // after it is discarded.)
+ // NextEventAction provides a way to register an action on the next event
+ // that is delivered to this process. There is currently only one next event
+ // action allowed in the process at one time. If a new "NextEventAction" is
+ // added while one is already present, the old action will be discarded (with
+ // HandleBeingUnshipped called after it is discarded.)
//
- // If you want to resume the process as a result of a resume action,
- // call RequestResume, don't call Resume directly.
+ // If you want to resume the process as a result of a resume action, call
+ // RequestResume, don't call Resume directly.
//------------------------------------------------------------------
class NextEventAction {
public:
@@ -2949,18 +2936,17 @@ protected:
void ForceNextEventDelivery() { m_force_next_event_delivery = true; }
//------------------------------------------------------------------
- /// Loads any plugins associated with asynchronous structured data
- /// and maps the relevant supported type name to the plugin.
+ /// Loads any plugins associated with asynchronous structured data and maps
+ /// the relevant supported type name to the plugin.
///
- /// Processes can receive asynchronous structured data from the
- /// process monitor. This method will load and map any structured
- /// data plugins that support the given set of supported type names.
- /// Later, if any of these features are enabled, the process monitor
- /// is free to generate asynchronous structured data. The data must
- /// come in as a single \b StructuredData::Dictionary. That dictionary
- /// must have a string field named 'type', with a value that equals
- /// the relevant type name string (one of the values in
- /// \b supported_type_names).
+ /// Processes can receive asynchronous structured data from the process
+ /// monitor. This method will load and map any structured data plugins that
+ /// support the given set of supported type names. Later, if any of these
+ /// features are enabled, the process monitor is free to generate
+ /// asynchronous structured data. The data must come in as a single \b
+ /// StructuredData::Dictionary. That dictionary must have a string field
+ /// named 'type', with a value that equals the relevant type name string
+ /// (one of the values in \b supported_type_names).
///
/// @param[in] supported_type_names
/// An array of zero or more type names. Each must be unique.
@@ -2973,10 +2959,9 @@ protected:
//------------------------------------------------------------------
/// Route the incoming structured data dictionary to the right plugin.
///
- /// The incoming structured data must be a dictionary, and it must
- /// have a key named 'type' that stores a string value. The string
- /// value must be the name of the structured data feature that
- /// knows how to handle it.
+ /// The incoming structured data must be a dictionary, and it must have a
+ /// key named 'type' that stores a string value. The string value must be
+ /// the name of the structured data feature that knows how to handle it.
///
/// @param[in] object_sp
/// When non-null and pointing to a dictionary, the 'type'
@@ -3022,7 +3007,7 @@ protected:
//------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
- std::weak_ptr<Target> m_target_sp; ///< The target that owns this process.
+ std::weak_ptr<Target> m_target_wp; ///< The target that owns this process.
ThreadSafeValue<lldb::StateType> m_public_state;
ThreadSafeValue<lldb::StateType>
m_private_state; // The actual state of our process
@@ -3107,11 +3092,11 @@ protected:
bool m_currently_handling_do_on_removals;
bool m_resume_requested; // If m_currently_handling_event or
// m_currently_handling_do_on_removals are true,
- // Resume will only request a resume, using this flag
- // to check.
+ // Resume will only request a resume, using this
+ // flag to check.
bool m_finalizing; // This is set at the beginning of Process::Finalize() to
- // stop functions from looking up or creating things during
- // a finalize call
+ // stop functions from looking up or creating things
+ // during a finalize call
bool m_finalize_called; // This is set at the end of Process::Finalize()
bool m_clear_thread_plans_on_stop;
bool m_force_next_event_delivery;
@@ -3129,6 +3114,9 @@ protected:
StructuredDataPluginMap m_structured_data_plugin_map;
enum { eCanJITDontKnow = 0, eCanJITYes, eCanJITNo } m_can_jit;
+
+ std::unique_ptr<UtilityFunction> m_dlopen_utility_func_up;
+ std::once_flag m_dlopen_utility_func_flag_once;
size_t RemoveBreakpointOpcodesFromBuffer(lldb::addr_t addr, size_t size,
uint8_t *buf) const;
@@ -3160,12 +3148,9 @@ private:
static lldb::thread_result_t PrivateStateThread(void *arg);
// The starts up the private state thread that will watch for events from the
- // debugee.
- // Pass true for is_secondary_thread in the case where you have to temporarily
- // spin up a
- // secondary state thread to handle events from a hand-called function on the
- // primary
- // private state thread.
+ // debugee. Pass true for is_secondary_thread in the case where you have to
+ // temporarily spin up a secondary state thread to handle events from a hand-
+ // called function on the primary private state thread.
lldb::thread_result_t RunPrivateStateThread(bool is_secondary_thread);
@@ -3178,8 +3163,7 @@ protected:
const Timeout<std::micro> &timeout);
// This waits for both the state change broadcaster, and the control
- // broadcaster.
- // If control_only, it only waits for the control broadcaster.
+ // broadcaster. If control_only, it only waits for the control broadcaster.
bool GetEventsPrivate(lldb::EventSP &event_sp,
const Timeout<std::micro> &timeout, bool control_only);
@@ -3220,14 +3204,12 @@ protected:
private:
//------------------------------------------------------------------
- /// This is the part of the event handling that for a process event.
- /// It decides what to do with the event and returns true if the
- /// event needs to be propagated to the user, and false otherwise.
- /// If the event is not propagated, this call will most likely set
- /// the target to executing again.
- /// There is only one place where this call should be called,
- /// HandlePrivateEvent.
- /// Don't call it from anywhere else...
+ /// This is the part of the event handling that for a process event. It
+ /// decides what to do with the event and returns true if the event needs to
+ /// be propagated to the user, and false otherwise. If the event is not
+ /// propagated, this call will most likely set the target to executing
+ /// again. There is only one place where this call should be called,
+ /// HandlePrivateEvent. Don't call it from anywhere else...
///
/// @param[in] event_ptr
/// This is the event we are handling.
diff --git a/include/lldb/Target/ProcessInfo.h b/include/lldb/Target/ProcessInfo.h
index 4077abf89baf..0e0d8548feb6 100644
--- a/include/lldb/Target/ProcessInfo.h
+++ b/include/lldb/Target/ProcessInfo.h
@@ -11,8 +11,9 @@
#define liblldb_ProcessInfo_h_
// LLDB headers
-#include "lldb/Interpreter/Args.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/Environment.h"
#include "lldb/Utility/FileSpec.h"
namespace lldb_private {
@@ -20,9 +21,9 @@ namespace lldb_private {
// ProcessInfo
//
// A base class for information for a process. This can be used to fill
-// out information for a process prior to launching it, or it can be
-// used for an instance of a process and can be filled in with the
-// existing values for that process.
+// out information for a process prior to launching it, or it can be used for
+// an instance of a process and can be filled in with the existing values for
+// that process.
//----------------------------------------------------------------------
class ProcessInfo {
public:
@@ -81,18 +82,16 @@ public:
void SetArguments(char const **argv, bool first_arg_is_executable);
- Args &GetEnvironmentEntries() { return m_environment; }
-
- const Args &GetEnvironmentEntries() const { return m_environment; }
+ Environment &GetEnvironment() { return m_environment; }
+ const Environment &GetEnvironment() const { return m_environment; }
protected:
FileSpec m_executable;
std::string m_arg0; // argv[0] if supported. If empty, then use m_executable.
- // Not all process plug-ins support specifying an argv[0]
- // that differs from the resolved platform executable
- // (which is in m_executable)
+ // Not all process plug-ins support specifying an argv[0] that differs from
+ // the resolved platform executable (which is in m_executable)
Args m_arguments; // All program arguments except argv[0]
- Args m_environment;
+ Environment m_environment;
uint32_t m_uid;
uint32_t m_gid;
ArchSpec m_arch;
diff --git a/include/lldb/Target/ProcessLaunchInfo.h b/include/lldb/Target/ProcessLaunchInfo.h
index fc715f28544d..92c517a3e460 100644
--- a/include/lldb/Target/ProcessLaunchInfo.h
+++ b/include/lldb/Target/ProcessLaunchInfo.h
@@ -107,13 +107,18 @@ public:
return m_monitor_callback;
}
+ /// A Monitor callback which does not take any action on process events. Use
+ /// this if you don't need to take any particular action when the process
+ /// terminates, but you still need to reap it.
+ static bool NoOpMonitorCallback(lldb::pid_t pid, bool exited, int signal,
+ int status);
+
bool GetMonitorSignals() const { return m_monitor_signals; }
// If the LaunchInfo has a monitor callback, then arrange to monitor the
- // process.
- // Return true if the LaunchInfo has taken care of monitoring the process, and
- // false if the
- // caller might want to monitor the process themselves.
+ // process. Return true if the LaunchInfo has taken care of monitoring the
+ // process, and false if the caller might want to monitor the process
+ // themselves.
bool MonitorProcess() const;
diff --git a/include/lldb/Target/ProcessStructReader.h b/include/lldb/Target/ProcessStructReader.h
index cfc8fe11a39a..8f1445ae8c1b 100644
--- a/include/lldb/Target/ProcessStructReader.h
+++ b/include/lldb/Target/ProcessStructReader.h
@@ -16,6 +16,7 @@
#include "lldb/Symbol/CompilerType.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Status.h"
diff --git a/include/lldb/Target/Queue.h b/include/lldb/Target/Queue.h
index 2df4d54a89b6..62cc3ccf2e2f 100644
--- a/include/lldb/Target/Queue.h
+++ b/include/lldb/Target/Queue.h
@@ -22,15 +22,14 @@ namespace lldb_private {
//------------------------------------------------------------------
// Queue:
-// This class represents a libdispatch aka Grand Central Dispatch
-// queue in the process.
+// This class represents a libdispatch aka Grand Central Dispatch queue in the
+// process.
//
// A program using libdispatch will create queues, put work items
-// (functions, blocks) on the queues. The system will create /
-// reassign pthreads to execute the work items for the queues. A
-// serial queue will be associated with a single thread (or possibly
-// no thread, if it is not doing any work). A concurrent queue may
-// be associated with multiple threads.
+// (functions, blocks) on the queues. The system will create / reassign
+// pthreads to execute the work items for the queues. A serial queue will be
+// associated with a single thread (or possibly no thread, if it is not doing
+// any work). A concurrent queue may be associated with multiple threads.
//------------------------------------------------------------------
class Queue : public std::enable_shared_from_this<Queue> {
diff --git a/include/lldb/Target/QueueItem.h b/include/lldb/Target/QueueItem.h
index acbf94e1b0f9..76bcea36a2fa 100644
--- a/include/lldb/Target/QueueItem.h
+++ b/include/lldb/Target/QueueItem.h
@@ -29,12 +29,11 @@ namespace lldb_private {
//------------------------------------------------------------------
// QueueItem:
-// This class represents a work item enqueued on a libdispatch aka
-// Grand Central Dispatch (GCD) queue. Most often, this will be a
-// function or block.
-// "enqueued" here means that the work item has been added to a queue
-// but it has not yet started executing. When it is "dequeued",
-// execution of the item begins.
+// This class represents a work item enqueued on a libdispatch aka Grand
+// Central Dispatch (GCD) queue. Most often, this will be a function or block.
+// "enqueued" here means that the work item has been added to a queue but it
+// has not yet started executing. When it is "dequeued", execution of the item
+// begins.
//------------------------------------------------------------------
class QueueItem : public std::enable_shared_from_this<QueueItem> {
diff --git a/include/lldb/Target/QueueList.h b/include/lldb/Target/QueueList.h
index 91cf3eb6d4c2..b35de13aa1e5 100644
--- a/include/lldb/Target/QueueList.h
+++ b/include/lldb/Target/QueueList.h
@@ -21,12 +21,11 @@ namespace lldb_private {
//------------------------------------------------------------------
// QueueList:
-// This is the container for libdispatch aka Grand Central Dispatch
-// Queue objects.
+// This is the container for libdispatch aka Grand Central Dispatch Queue
+// objects.
//
-// Each Process will have a QueueList. When the process execution is
-// paused, the QueueList may be populated with Queues by the
-// SystemRuntime.
+// Each Process will have a QueueList. When the process execution is paused,
+// the QueueList may be populated with Queues by the SystemRuntime.
//------------------------------------------------------------------
class QueueList {
diff --git a/include/lldb/Target/RegisterCheckpoint.h b/include/lldb/Target/RegisterCheckpoint.h
index 578cf25eef25..e4b407124c9f 100644
--- a/include/lldb/Target/RegisterCheckpoint.h
+++ b/include/lldb/Target/RegisterCheckpoint.h
@@ -16,20 +16,19 @@
namespace lldb_private {
-// Inherit from UserID in case pushing/popping all register values can be
-// done using a 64 bit integer that holds a baton/cookie instead of actually
-// having to read all register values into a buffer
+// Inherit from UserID in case pushing/popping all register values can be done
+// using a 64 bit integer that holds a baton/cookie instead of actually having
+// to read all register values into a buffer
class RegisterCheckpoint : public UserID {
public:
enum class Reason {
// An expression is about to be run on the thread if the protocol that
// talks to the debuggee supports checkpointing the registers using a
- // push/pop then the UserID base class in the RegisterCheckpoint can
- // be used to store the baton/cookie that refers to the remote saved
- // state.
+ // push/pop then the UserID base class in the RegisterCheckpoint can be
+ // used to store the baton/cookie that refers to the remote saved state.
eExpression,
- // The register checkpoint wants the raw register bytes, so they must
- // be read into m_data_sp, or the save/restore checkpoint should fail.
+ // The register checkpoint wants the raw register bytes, so they must be
+ // read into m_data_sp, or the save/restore checkpoint should fail.
eDataBackup
};
diff --git a/include/lldb/Target/RegisterContext.h b/include/lldb/Target/RegisterContext.h
index c438a0cd12cf..73a2930fd2b5 100644
--- a/include/lldb/Target/RegisterContext.h
+++ b/include/lldb/Target/RegisterContext.h
@@ -63,16 +63,14 @@ public:
}
// These two functions are used to implement "push" and "pop" of register
- // states. They are used primarily
- // for expression evaluation, where we need to push a new state (storing the
- // old one in data_sp) and then
- // restoring the original state by passing the data_sp we got from
- // ReadAllRegisters to WriteAllRegisterValues.
- // ReadAllRegisters will do what is necessary to return a coherent set of
- // register values for this thread, which
- // may mean e.g. interrupting a thread that is sitting in a kernel trap. That
- // is a somewhat disruptive operation,
- // so these API's should only be used when this behavior is needed.
+ // states. They are used primarily for expression evaluation, where we need
+ // to push a new state (storing the old one in data_sp) and then restoring
+ // the original state by passing the data_sp we got from ReadAllRegisters to
+ // WriteAllRegisterValues. ReadAllRegisters will do what is necessary to
+ // return a coherent set of register values for this thread, which may mean
+ // e.g. interrupting a thread that is sitting in a kernel trap. That is a
+ // somewhat disruptive operation, so these API's should only be used when
+ // this behavior is needed.
virtual bool
ReadAllRegisterValues(lldb_private::RegisterCheckpoint &reg_checkpoint);
diff --git a/include/lldb/Target/RegisterNumber.h b/include/lldb/Target/RegisterNumber.h
index 5649c8022ee7..1a0ab49bdce3 100644
--- a/include/lldb/Target/RegisterNumber.h
+++ b/include/lldb/Target/RegisterNumber.h
@@ -26,8 +26,8 @@ public:
// This constructor plus the init() method below allow for the placeholder
// creation of an invalid object initially, possibly to be filled in. It
- // would be more consistent to have three Set* methods to set the three
- // data that the object needs.
+ // would be more consistent to have three Set* methods to set the three data
+ // that the object needs.
RegisterNumber();
void init(lldb_private::Thread &thread, lldb::RegisterKind kind,
diff --git a/include/lldb/Target/SectionLoadHistory.h b/include/lldb/Target/SectionLoadHistory.h
index e1db141ea9e3..0ed335a9d040 100644
--- a/include/lldb/Target/SectionLoadHistory.h
+++ b/include/lldb/Target/SectionLoadHistory.h
@@ -23,8 +23,8 @@ namespace lldb_private {
class SectionLoadHistory {
public:
enum : unsigned {
- // Pass eStopIDNow to any function that takes a stop ID to get
- // the current value.
+ // Pass eStopIDNow to any function that takes a stop ID to get the current
+ // value.
eStopIDNow = UINT32_MAX
};
//------------------------------------------------------------------
@@ -33,8 +33,8 @@ public:
SectionLoadHistory() : m_stop_id_to_section_load_list(), m_mutex() {}
~SectionLoadHistory() {
- // Call clear since this takes a lock and clears the section load list
- // in case another thread is currently using this section load list
+ // Call clear since this takes a lock and clears the section load list in
+ // case another thread is currently using this section load list
Clear();
}
@@ -59,14 +59,14 @@ public:
bool warn_multiple = false);
// The old load address should be specified when unloading to ensure we get
- // the correct instance of the section as a shared library could be loaded
- // at more than one location.
+ // the correct instance of the section as a shared library could be loaded at
+ // more than one location.
bool SetSectionUnloaded(uint32_t stop_id, const lldb::SectionSP &section_sp,
lldb::addr_t load_addr);
// Unload all instances of a section. This function can be used on systems
- // that don't support multiple copies of the same shared library to be
- // loaded at the same time.
+ // that don't support multiple copies of the same shared library to be loaded
+ // at the same time.
size_t SetSectionUnloaded(uint32_t stop_id,
const lldb::SectionSP &section_sp);
diff --git a/include/lldb/Target/SectionLoadList.h b/include/lldb/Target/SectionLoadList.h
index beb345b71290..1156c686df17 100644
--- a/include/lldb/Target/SectionLoadList.h
+++ b/include/lldb/Target/SectionLoadList.h
@@ -34,8 +34,8 @@ public:
SectionLoadList(const SectionLoadList &rhs);
~SectionLoadList() {
- // Call clear since this takes a lock and clears the section load list
- // in case another thread is currently using this section load list
+ // Call clear since this takes a lock and clears the section load list in
+ // case another thread is currently using this section load list
Clear();
}
@@ -55,14 +55,14 @@ public:
bool warn_multiple = false);
// The old load address should be specified when unloading to ensure we get
- // the correct instance of the section as a shared library could be loaded
- // at more than one location.
+ // the correct instance of the section as a shared library could be loaded at
+ // more than one location.
bool SetSectionUnloaded(const lldb::SectionSP &section_sp,
lldb::addr_t load_addr);
// Unload all instances of a section. This function can be used on systems
- // that don't support multiple copies of the same shared library to be
- // loaded at the same time.
+ // that don't support multiple copies of the same shared library to be loaded
+ // at the same time.
size_t SetSectionUnloaded(const lldb::SectionSP &section_sp);
void Dump(Stream &s, Target *target);
diff --git a/include/lldb/Target/StackFrame.h b/include/lldb/Target/StackFrame.h
index d97043578ce9..ce9b16227672 100644
--- a/include/lldb/Target/StackFrame.h
+++ b/include/lldb/Target/StackFrame.h
@@ -32,7 +32,7 @@ namespace lldb_private {
/// @class StackFrame StackFrame.h "lldb/Target/StackFrame.h"
///
-/// @brief This base class provides an interface to stack frames.
+/// This base class provides an interface to stack frames.
///
/// StackFrames may have a Canonical Frame Address (CFA) or not.
/// A frame may have a plain pc value or it may have a pc value + stop_id
@@ -59,10 +59,10 @@ public:
///
/// This is the one constructor that doesn't take a RegisterContext
/// parameter. This ctor may be called when creating a history StackFrame;
- /// these are used if we've collected a stack trace of pc addresses at
- /// some point in the past. We may only have pc values. We may have pc
- /// values and the stop_id when the stack trace was recorded. We may have a
- /// CFA, or more likely, we won't.
+ /// these are used if we've collected a stack trace of pc addresses at some
+ /// point in the past. We may only have pc values. We may have pc values
+ /// and the stop_id when the stack trace was recorded. We may have a CFA,
+ /// or more likely, we won't.
///
/// @param [in] thread_sp
/// The Thread that this frame belongs to.
@@ -165,9 +165,9 @@ public:
/// Provide a SymbolContext for this StackFrame's current pc value.
///
/// The StackFrame maintains this SymbolContext and adds additional
- /// information
- /// to it on an as-needed basis. This helps to avoid different functions
- /// looking up symbolic information for a given pc value multiple times.
+ /// information to it on an as-needed basis. This helps to avoid different
+ /// functions looking up symbolic information for a given pc value multiple
+ /// times.
///
/// @params [in] resolve_scope
/// Flags from the SymbolContextItem enumerated type which specify what
@@ -182,9 +182,9 @@ public:
//------------------------------------------------------------------
/// Return the Canonical Frame Address (DWARF term) for this frame.
///
- /// The CFA is typically the value of the stack pointer register before
- /// the call invocation is made. It will not change during the lifetime
- /// of a stack frame. It is often not the same thing as the frame pointer
+ /// The CFA is typically the value of the stack pointer register before the
+ /// call invocation is made. It will not change during the lifetime of a
+ /// stack frame. It is often not the same thing as the frame pointer
/// register value.
///
/// Live StackFrames will always have a CFA but other types of frames may
@@ -220,9 +220,8 @@ public:
//------------------------------------------------------------------
/// Get the current lexical scope block for this StackFrame, if possible.
///
- /// If debug information is available for this stack frame, return a
- /// pointer to the innermost lexical Block that the frame is currently
- /// executing.
+ /// If debug information is available for this stack frame, return a pointer
+ /// to the innermost lexical Block that the frame is currently executing.
///
/// @return
/// A pointer to the current Block. nullptr is returned if this can
@@ -251,11 +250,12 @@ public:
}
//------------------------------------------------------------------
- /// Retrieve the list of variables that are in scope at this StackFrame's pc.
+ /// Retrieve the list of variables that are in scope at this StackFrame's
+ /// pc.
///
/// A frame that is not live may return an empty VariableList for a given
- /// pc value even though variables would be available at this point if
- /// it were a live stack frame.
+ /// pc value even though variables would be available at this point if it
+ /// were a live stack frame.
///
/// @param[in] get_file_globals
/// Whether to also retrieve compilation-unit scoped variables
@@ -268,11 +268,12 @@ public:
VariableList *GetVariableList(bool get_file_globals);
//------------------------------------------------------------------
- /// Retrieve the list of variables that are in scope at this StackFrame's pc.
+ /// Retrieve the list of variables that are in scope at this StackFrame's
+ /// pc.
///
/// A frame that is not live may return an empty VariableListSP for a
- /// given pc value even though variables would be available at this point
- /// if it were a live stack frame.
+ /// given pc value even though variables would be available at this point if
+ /// it were a live stack frame.
///
/// @param[in] get_file_globals
/// Whether to also retrieve compilation-unit scoped variables
@@ -287,8 +288,8 @@ public:
bool must_have_valid_location = false);
//------------------------------------------------------------------
- /// Create a ValueObject for a variable name / pathname, possibly
- /// including simple dereference/child selection syntax.
+ /// Create a ValueObject for a variable name / pathname, possibly including
+ /// simple dereference/child selection syntax.
///
/// @param[in] var_expr
/// The string specifying a variable to base the VariableObject off
@@ -327,8 +328,8 @@ public:
bool HasDebugInformation();
//------------------------------------------------------------------
- /// Return the disassembly for the instructions of this StackFrame's function
- /// as a single C string.
+ /// Return the disassembly for the instructions of this StackFrame's
+ /// function as a single C string.
///
/// @return
// C string with the assembly instructions for this function.
@@ -366,8 +367,8 @@ public:
void Dump(Stream *strm, bool show_frame_index, bool show_fullpaths);
//------------------------------------------------------------------
- /// Print a description of this stack frame and/or the source context/assembly
- /// for this stack frame.
+ /// Print a description of this stack frame and/or the source
+ /// context/assembly for this stack frame.
///
/// @param[in] strm
/// The Stream to send the output to.
@@ -392,9 +393,9 @@ public:
bool show_unique = false, const char *frame_marker = nullptr);
//------------------------------------------------------------------
- /// Query whether this frame is a concrete frame on the call stack,
- /// or if it is an inlined frame derived from the debug information
- /// and presented by the debugger.
+ /// Query whether this frame is a concrete frame on the call stack, or if it
+ /// is an inlined frame derived from the debug information and presented by
+ /// the debugger.
///
/// @return
/// true if this is an inlined frame.
@@ -402,7 +403,8 @@ public:
bool IsInlined();
//------------------------------------------------------------------
- /// Query this frame to find what frame it is in this Thread's StackFrameList.
+ /// Query this frame to find what frame it is in this Thread's
+ /// StackFrameList.
///
/// @return
/// StackFrame index 0 indicates the currently-executing function. Inline
@@ -411,8 +413,8 @@ public:
uint32_t GetFrameIndex() const;
//------------------------------------------------------------------
- /// Query this frame to find what frame it is in this Thread's StackFrameList,
- /// not counting inlined frames.
+ /// Query this frame to find what frame it is in this Thread's
+ /// StackFrameList, not counting inlined frames.
///
/// @return
/// StackFrame index 0 indicates the currently-executing function. Inline
@@ -442,8 +444,7 @@ public:
//------------------------------------------------------------------
/// Add an arbitrary Variable object (e.g. one that specifics a global or
- /// static)
- /// to a StackFrame's list of ValueObjects.
+ /// static) to a StackFrame's list of ValueObjects.
///
/// @params [in] variable_sp
/// The Variable to base this ValueObject on
@@ -460,8 +461,8 @@ public:
lldb::DynamicValueType use_dynamic);
//------------------------------------------------------------------
- /// Query this frame to determine what the default language should be
- /// when parsing expressions given the execution context.
+ /// Query this frame to determine what the default language should be when
+ /// parsing expressions given the execution context.
///
/// @return
/// The language of the frame if known, else lldb::eLanguageTypeUnknown.
@@ -469,8 +470,7 @@ public:
lldb::LanguageType GetLanguage();
// similar to GetLanguage(), but is allowed to take a potentially incorrect
- // guess
- // if exact information is not available
+ // guess if exact information is not available
lldb::LanguageType GuessLanguage();
//------------------------------------------------------------------
@@ -488,8 +488,8 @@ public:
//------------------------------------------------------------------
/// Attempt to reconstruct the ValueObject for the address contained in a
- /// given register plus an offset. The ExpressionPath should indicate how to
- /// get to this value using "frame variable."
+ /// given register plus an offset. The ExpressionPath should indicate how
+ /// to get to this value using "frame variable."
///
/// @params [in] reg
/// The name of the register.
diff --git a/include/lldb/Target/StackID.h b/include/lldb/Target/StackID.h
index 7b7e9e5187b6..51e51a6c0741 100644
--- a/include/lldb/Target/StackID.h
+++ b/include/lldb/Target/StackID.h
@@ -81,20 +81,20 @@ protected:
lldb::addr_t
m_pc; // The pc value for the function/symbol for this frame. This will
// only get used if the symbol scope is nullptr (the code where we are
- // stopped is not represented by any function or symbol in any
- // shared library).
+ // stopped is not represented by any function or symbol in any shared
+ // library).
lldb::addr_t m_cfa; // The call frame address (stack pointer) value
// at the beginning of the function that uniquely
- // identifies this frame (along with m_symbol_scope below)
+ // identifies this frame (along with m_symbol_scope
+ // below)
SymbolContextScope *
m_symbol_scope; // If nullptr, there is no block or symbol for this frame.
// If not nullptr, this will either be the scope for the
- // lexical block for the frame, or the scope
- // for the symbol. Symbol context scopes are
- // always be unique pointers since the are part
- // of the Block and Symbol objects and can easily
- // be used to tell if a stack ID is the same as
- // another.
+ // lexical block for the frame, or the scope for the
+ // symbol. Symbol context scopes are always be unique
+ // pointers since the are part of the Block and Symbol
+ // objects and can easily be used to tell if a stack ID
+ // is the same as another.
};
bool operator==(const StackID &lhs, const StackID &rhs);
diff --git a/include/lldb/Target/StopInfo.h b/include/lldb/Target/StopInfo.h
index c99877cbd8ab..b25bf7dd3d5d 100644
--- a/include/lldb/Target/StopInfo.h
+++ b/include/lldb/Target/StopInfo.h
@@ -40,12 +40,10 @@ public:
lldb::ThreadSP GetThread() const { return m_thread_wp.lock(); }
- // The value of the StopInfo depends on the StopReason.
- // StopReason Meaning
- // ----------------------------------------------
- // eStopReasonBreakpoint BreakpointSiteID
- // eStopReasonSignal Signal number
- // eStopReasonWatchpoint WatchpointLocationID
+ // The value of the StopInfo depends on the StopReason. StopReason
+ // Meaning ----------------------------------------------
+ // eStopReasonBreakpoint BreakpointSiteID eStopReasonSignal
+ // Signal number eStopReasonWatchpoint WatchpointLocationID
// eStopReasonPlanComplete No significance
uint64_t GetValue() const { return m_value; }
@@ -53,10 +51,8 @@ public:
virtual lldb::StopReason GetStopReason() const = 0;
// ShouldStopSynchronous will get called before any thread plans are
- // consulted, and if it says we should
- // resume the target, then we will just immediately resume. This should not
- // run any code in or resume the
- // target.
+ // consulted, and if it says we should resume the target, then we will just
+ // immediately resume. This should not run any code in or resume the target.
virtual bool ShouldStopSynchronous(Event *event_ptr) { return true; }
@@ -88,14 +84,11 @@ public:
virtual bool IsValidForOperatingSystemThread(Thread &thread) { return true; }
// Sometimes the thread plan logic will know that it wants a given stop to
- // stop or not,
- // regardless of what the ordinary logic for that StopInfo would dictate. The
- // main example
- // of this is the ThreadPlanCallFunction, which for instance knows - based on
- // how that particular
- // expression was executed - whether it wants all breakpoints to auto-continue
- // or not.
- // Use OverrideShouldStop on the StopInfo to implement this.
+ // stop or not, regardless of what the ordinary logic for that StopInfo would
+ // dictate. The main example of this is the ThreadPlanCallFunction, which
+ // for instance knows - based on how that particular expression was executed
+ // - whether it wants all breakpoints to auto-continue or not. Use
+ // OverrideShouldStop on the StopInfo to implement this.
void OverrideShouldStop(bool override_value) {
m_override_should_stop = override_value ? eLazyBoolYes : eLazyBoolNo;
@@ -159,15 +152,13 @@ protected:
virtual bool DoShouldNotify(Event *event_ptr) { return false; }
- // Stop the thread by default. Subclasses can override this to allow
- // the thread to continue if desired. The ShouldStop method should not do
- // anything
- // that might run code. If you need to run code when deciding whether to stop
- // at this StopInfo, that must be done in the PerformAction.
+ // Stop the thread by default. Subclasses can override this to allow the
+ // thread to continue if desired. The ShouldStop method should not do
+ // anything that might run code. If you need to run code when deciding
+ // whether to stop at this StopInfo, that must be done in the PerformAction.
// The PerformAction will always get called before the ShouldStop. This is
- // done by the
- // ProcessEventData::DoOnRemoval, though the ThreadPlanBase needs to consult
- // this later on.
+ // done by the ProcessEventData::DoOnRemoval, though the ThreadPlanBase needs
+ // to consult this later on.
virtual bool ShouldStop(Event *event_ptr) { return true; }
//------------------------------------------------------------------
@@ -185,14 +176,13 @@ protected:
StructuredData::ObjectSP
m_extended_info; // The extended info for this stop info
- // This determines whether the target has run since this stop info.
- // N.B. running to evaluate a user expression does not count.
+ // This determines whether the target has run since this stop info. N.B.
+ // running to evaluate a user expression does not count.
bool HasTargetRunSinceMe();
// MakeStopInfoValid is necessary to allow saved stop infos to resurrect
- // themselves as valid.
- // It should only be used by Thread::RestoreThreadStateFromCheckpoint and to
- // make sure the one-step
+ // themselves as valid. It should only be used by
+ // Thread::RestoreThreadStateFromCheckpoint and to make sure the one-step
// needed for before-the-fact watchpoints does not prevent us from stopping
void MakeStopInfoValid();
diff --git a/include/lldb/Target/SystemRuntime.h b/include/lldb/Target/SystemRuntime.h
index 8c6c2ece967f..06cc3ec2d012 100644
--- a/include/lldb/Target/SystemRuntime.h
+++ b/include/lldb/Target/SystemRuntime.h
@@ -29,20 +29,20 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class SystemRuntime SystemRuntime.h "lldb/Target/SystemRuntime.h"
-/// @brief A plug-in interface definition class for system runtimes.
+/// A plug-in interface definition class for system runtimes.
///
/// The system runtime plugins can collect information from the system
-/// libraries during a Process' lifetime and provide information about
-/// how objects/threads were originated.
+/// libraries during a Process' lifetime and provide information about how
+/// objects/threads were originated.
///
-/// For instance, a system runtime plugin use a breakpoint when threads
-/// are created to record the backtrace of where that thread was created.
-/// Later, when backtracing the created thread, it could extend the backtrace
-/// to show where it was originally created from.
+/// For instance, a system runtime plugin use a breakpoint when threads are
+/// created to record the backtrace of where that thread was created. Later,
+/// when backtracing the created thread, it could extend the backtrace to show
+/// where it was originally created from.
///
-/// The plugin will insert its own breakpoint when Created and start collecting
-/// information. Later when it comes time to augment a Thread, it can be
-/// asked to provide that information.
+/// The plugin will insert its own breakpoint when Created and start
+/// collecting information. Later when it comes time to augment a Thread, it
+/// can be asked to provide that information.
///
//----------------------------------------------------------------------
@@ -51,9 +51,8 @@ public:
//------------------------------------------------------------------
/// Find a system runtime plugin for a given process.
///
- /// Scans the installed SystemRuntime plugins and tries to find
- /// an instance that can be used to track image changes in \a
- /// process.
+ /// Scans the installed SystemRuntime plugins and tries to find an instance
+ /// that can be used to track image changes in \a process.
///
/// @param[in] process
/// The process for which to try and locate a system runtime
@@ -69,60 +68,60 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// The destructor is virtual since this class is designed to be
- /// inherited by the plug-in instance.
+ /// The destructor is virtual since this class is designed to be inherited
+ /// by the plug-in instance.
//------------------------------------------------------------------
~SystemRuntime() override;
//------------------------------------------------------------------
/// Called after attaching to a process.
///
- /// Allow the SystemRuntime plugin to execute some code after attaching
- /// to a process.
+ /// Allow the SystemRuntime plugin to execute some code after attaching to a
+ /// process.
//------------------------------------------------------------------
virtual void DidAttach();
//------------------------------------------------------------------
/// Called after launching a process.
///
- /// Allow the SystemRuntime plugin to execute some code after launching
- /// a process.
+ /// Allow the SystemRuntime plugin to execute some code after launching a
+ /// process.
//------------------------------------------------------------------
virtual void DidLaunch();
//------------------------------------------------------------------
/// Called when modules have been loaded in the process.
///
- /// Allow the SystemRuntime plugin to enable logging features in the
- /// system runtime libraries.
+ /// Allow the SystemRuntime plugin to enable logging features in the system
+ /// runtime libraries.
//------------------------------------------------------------------
virtual void ModulesDidLoad(lldb_private::ModuleList &module_list);
//------------------------------------------------------------------
/// Called before detaching from a process.
///
- /// This will give a SystemRuntime plugin a chance to free any resources
- /// in the inferior process before we detach.
+ /// This will give a SystemRuntime plugin a chance to free any resources in
+ /// the inferior process before we detach.
//------------------------------------------------------------------
virtual void Detach();
//------------------------------------------------------------------
- /// Return a list of thread origin extended backtraces that may
- /// be available.
+ /// Return a list of thread origin extended backtraces that may be
+ /// available.
///
/// A System Runtime may be able to provide a backtrace of when this
- /// thread was originally created. Furthermore, it may be able to
- /// provide that extended backtrace for different styles of creation.
- /// On a system with both pthreads and libdispatch, aka Grand Central
- /// Dispatch, queues, the system runtime may be able to provide the
- /// pthread creation of the thread and it may also be able to provide
- /// the backtrace of when this GCD queue work block was enqueued.
- /// The caller may request these different origins by name.
- ///
- /// The names will be provided in the order that they are most likely
- /// to be requested. For instance, a most natural order may be to
- /// request the GCD libdispatch queue origin. If there is none, then
- /// request the pthread origin.
+ /// thread was originally created. Furthermore, it may be able to provide
+ /// that extended backtrace for different styles of creation. On a system
+ /// with both pthreads and libdispatch, aka Grand Central Dispatch, queues,
+ /// the system runtime may be able to provide the pthread creation of the
+ /// thread and it may also be able to provide the backtrace of when this GCD
+ /// queue work block was enqueued. The caller may request these different
+ /// origins by name.
+ ///
+ /// The names will be provided in the order that they are most likely to be
+ /// requested. For instance, a most natural order may be to request the GCD
+ /// libdispatch queue origin. If there is none, then request the pthread
+ /// origin.
///
/// @return
/// A vector of ConstStrings with names like "pthread" or "libdispatch".
@@ -135,13 +134,12 @@ public:
/// Return a Thread which shows the origin of this thread's creation.
///
/// This likely returns a HistoryThread which shows how thread was
- /// originally created (e.g. "pthread" type), or how the work that
- /// is currently executing on it was originally enqueued (e.g.
- /// "libdispatch" type).
+ /// originally created (e.g. "pthread" type), or how the work that is
+ /// currently executing on it was originally enqueued (e.g. "libdispatch"
+ /// type).
///
- /// There may be a chain of thread-origins; it may be informative to
- /// the end user to query the returned ThreadSP for its origins as
- /// well.
+ /// There may be a chain of thread-origins; it may be informative to the end
+ /// user to query the returned ThreadSP for its origins as well.
///
/// @param [in] thread
/// The thread to examine.
@@ -168,8 +166,8 @@ public:
/// a libdispatch queue in the future, or it represents a function/block
/// that is currently executing on a thread.
///
- /// This method will report a thread backtrace of the function that
- /// enqueued it originally, if possible.
+ /// This method will report a thread backtrace of the function that enqueued
+ /// it originally, if possible.
///
/// @param [in] queue_item_sp
/// The QueueItem that we are getting an extended backtrace for.
@@ -189,10 +187,11 @@ public:
}
//------------------------------------------------------------------
- /// Populate the Process' QueueList with libdispatch / GCD queues that exist.
+ /// Populate the Process' QueueList with libdispatch / GCD queues that
+ /// exist.
///
- /// When process execution is paused, the SystemRuntime may be called to fill
- /// in the list of Queues that currently exist.
+ /// When process execution is paused, the SystemRuntime may be called to
+ /// fill in the list of Queues that currently exist.
///
/// @param [out] queue_list
/// This QueueList will be cleared, and any queues that currently exist
@@ -205,12 +204,10 @@ public:
/// Get the queue name for a thread given a thread's dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr. At the
- /// dispatch_qaddr
- /// we will find the address of this thread's dispatch_queue_t structure.
- /// Given the address of the dispatch_queue_t structure for a thread,
- /// get the queue name and return it.
+ /// queue. There will be a call to get the thread's dispatch_qaddr. At the
+ /// dispatch_qaddr we will find the address of this thread's
+ /// dispatch_queue_t structure. Given the address of the dispatch_queue_t
+ /// structure for a thread, get the queue name and return it.
///
/// @param [in] dispatch_qaddr
/// The address of the dispatch_qaddr pointer for this thread.
@@ -229,12 +226,10 @@ public:
/// dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr. At the
- /// dispatch_qaddr
- /// we will find the address of this thread's dispatch_queue_t structure.
- /// Given the address of the dispatch_queue_t structure for a thread,
- /// get the queue ID and return it.
+ /// queue. There will be a call to get the thread's dispatch_qaddr. At the
+ /// dispatch_qaddr we will find the address of this thread's
+ /// dispatch_queue_t structure. Given the address of the dispatch_queue_t
+ /// structure for a thread, get the queue ID and return it.
///
/// @param [in] dispatch_qaddr
/// The address of the dispatch_qaddr pointer for this thread.
@@ -252,10 +247,8 @@ public:
/// dispatch_qaddr.
///
/// On systems using libdispatch queues, a thread may be associated with a
- /// queue.
- /// There will be a call to get the thread's dispatch_qaddr.
- /// Given the thread's dispatch_qaddr, find the libdispatch_queue_t address
- /// and
+ /// queue. There will be a call to get the thread's dispatch_qaddr. Given
+ /// the thread's dispatch_qaddr, find the libdispatch_queue_t address and
/// return it.
///
/// @param [in] dispatch_qaddr
@@ -274,8 +267,8 @@ public:
/// Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
///
/// Retrieve the Queue kind - either eQueueKindSerial or
- /// eQueueKindConcurrent, indicating that this queue processes work
- /// items serially or concurrently.
+ /// eQueueKindConcurrent, indicating that this queue processes work items
+ /// serially or concurrently.
///
/// @return
/// The Queue kind, if it could be read, else eQueueKindUnknown.
@@ -288,8 +281,8 @@ public:
/// Get the pending work items for a libdispatch Queue
///
/// If this system/process is using libdispatch and the runtime can do so,
- /// retrieve the list of pending work items for the specified Queue and
- /// add it to the Queue.
+ /// retrieve the list of pending work items for the specified Queue and add
+ /// it to the Queue.
///
/// @param [in] queue
/// The queue of interest.
@@ -300,8 +293,8 @@ public:
/// Complete the fields in a QueueItem
///
/// PopulatePendingItemsForQueue() may not fill in all of the QueueItem
- /// details; when the remaining fields are needed, they will be
- /// fetched by call this method.
+ /// details; when the remaining fields are needed, they will be fetched by
+ /// call this method.
///
/// @param [in] queue_item
/// The QueueItem that we will be completing.
@@ -316,8 +309,7 @@ public:
//------------------------------------------------------------------
/// Add key-value pairs to the StructuredData dictionary object with
/// information debugserver may need when constructing the
- /// jThreadExtendedInfo
- /// packet.
+ /// jThreadExtendedInfo packet.
///
/// @param [out] dict
/// Dictionary to which key-value pairs should be added; they will
diff --git a/include/lldb/Target/Target.h b/include/lldb/Target/Target.h
index a5d200069810..75af8e80d2e5 100644
--- a/include/lldb/Target/Target.h
+++ b/include/lldb/Target/Target.h
@@ -35,6 +35,7 @@
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/SectionLoadHistory.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Timeout.h"
#include "lldb/lldb-public.h"
@@ -102,9 +103,6 @@ public:
const char *GetDisassemblyFlavor() const;
- // void
- // SetDisassemblyFlavor(const char *flavor);
-
InlineStrategy GetInlineStrategy() const;
llvm::StringRef GetArg0() const;
@@ -115,9 +113,8 @@ public:
void SetRunArguments(const Args &args);
- size_t GetEnvironmentAsArgs(Args &env) const;
-
- void SetEnvironmentFromArgs(const Args &env);
+ Environment GetEnvironment() const;
+ void SetEnvironment(Environment env);
bool GetSkipPrologue() const;
@@ -235,8 +232,8 @@ class EvaluateExpressionOptions {
public:
// MSVC has a bug here that reports C4268: 'const' static/global data
// initialized with compiler generated default constructor fills the object
-// with zeros.
-// Confirmed that MSVC is *not* zero-initializing, it's just a bogus warning.
+// with zeros. Confirmed that MSVC is *not* zero-initializing, it's just a
+// bogus warning.
#if defined(_MSC_VER)
#pragma warning(push)
#pragma warning(disable : 4268)
@@ -353,8 +350,7 @@ public:
}
// Allows the expression contents to be remapped to point to the specified
- // file and line
- // using #line directives.
+ // file and line using #line directives.
void SetPoundLine(const char *path, uint32_t line) const {
if (path && path[0]) {
m_pound_line_file = path;
@@ -401,8 +397,8 @@ private:
Timeout<std::micro> m_one_thread_timeout = llvm::None;
lldb::ExpressionCancelCallback m_cancel_callback = nullptr;
void *m_cancel_callback_baton = nullptr;
- // If m_pound_line_file is not empty and m_pound_line_line is non-zero,
- // use #line %u "%s" before the expression content to remap where the source
+ // If m_pound_line_file is not empty and m_pound_line_line is non-zero, use
+ // #line %u "%s" before the expression content to remap where the source
// originates
mutable std::string m_pound_line_file;
mutable uint32_t m_pound_line_line;
@@ -490,9 +486,6 @@ public:
static void SetDefaultArchitecture(const ArchSpec &arch);
- // void
- // UpdateInstanceName ();
-
lldb::ModuleSP GetSharedModule(const ModuleSpec &module_spec,
Status *error_ptr = nullptr);
@@ -563,9 +556,8 @@ public:
LazyBool move_to_nearest_code);
// Use this to create breakpoint that matches regex against the source lines
- // in files given in source_file_list:
- // If function_names is non-empty, also filter by function after the matches
- // are made.
+ // in files given in source_file_list: If function_names is non-empty, also
+ // filter by function after the matches are made.
lldb::BreakpointSP CreateSourceRegexBreakpoint(
const FileSpecList *containingModules,
const FileSpecList *source_file_list,
@@ -589,8 +581,8 @@ public:
// Use this to create a function breakpoint by regexp in
// containingModule/containingSourceFiles, or all modules if it is nullptr
- // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
- // setting, else we use the values passed in
+ // When "skip_prologue is set to eLazyBoolCalculate, we use the current
+ // target setting, else we use the values passed in
lldb::BreakpointSP CreateFuncRegexBreakpoint(
const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles, RegularExpression &func_regexp,
@@ -598,10 +590,10 @@ public:
bool internal, bool request_hardware);
// Use this to create a function breakpoint by name in containingModule, or
- // all modules if it is nullptr
- // When "skip_prologue is set to eLazyBoolCalculate, we use the current target
- // setting, else we use the values passed in.
- // func_name_type_mask is or'ed values from the FunctionNameType enum.
+ // all modules if it is nullptr When "skip_prologue is set to
+ // eLazyBoolCalculate, we use the current target setting, else we use the
+ // values passed in. func_name_type_mask is or'ed values from the
+ // FunctionNameType enum.
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
const char *func_name,
@@ -618,11 +610,10 @@ public:
Status *additional_args_error = nullptr);
// This is the same as the func_name breakpoint except that you can specify a
- // vector of names. This is cheaper
- // than a regular expression breakpoint in the case where you just want to set
- // a breakpoint on a set of names
- // you already know.
- // func_name_type_mask is or'ed values from the FunctionNameType enum.
+ // vector of names. This is cheaper than a regular expression breakpoint in
+ // the case where you just want to set a breakpoint on a set of names you
+ // already know. func_name_type_mask is or'ed values from the
+ // FunctionNameType enum.
lldb::BreakpointSP
CreateBreakpoint(const FileSpecList *containingModules,
const FileSpecList *containingSourceFiles,
@@ -741,14 +732,14 @@ public:
/// Take \a load_addr and potentially add any address bits that are
/// needed to make the address callable. For ARM this can set bit
/// zero (if it already isn't) if \a load_addr is a thumb function.
- /// If \a addr_class is set to eAddressClassInvalid, then the address
+ /// If \a addr_class is set to AddressClass::eInvalid, then the address
/// adjustment will always happen. If it is set to an address class
/// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
/// returned.
//------------------------------------------------------------------
lldb::addr_t GetCallableLoadAddress(
lldb::addr_t load_addr,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
+ AddressClass addr_class = AddressClass::eInvalid) const;
//------------------------------------------------------------------
/// Get \a load_addr as an opcode for this target.
@@ -757,22 +748,20 @@ public:
/// needed to make the address point to an opcode. For ARM this can
/// clear bit zero (if it already isn't) if \a load_addr is a
/// thumb function and load_addr is in code.
- /// If \a addr_class is set to eAddressClassInvalid, then the address
+ /// If \a addr_class is set to AddressClass::eInvalid, then the address
/// adjustment will always happen. If it is set to an address class
/// that doesn't have code in it, LLDB_INVALID_ADDRESS will be
/// returned.
//------------------------------------------------------------------
lldb::addr_t GetOpcodeLoadAddress(
lldb::addr_t load_addr,
- lldb::AddressClass addr_class = lldb::eAddressClassInvalid) const;
-
- // Get load_addr as breakable load address for this target.
- // Take a addr and check if for any reason there is a better address than this
- // to put a breakpoint on.
- // If there is then return that address.
- // For MIPS, if instruction at addr is a delay slot instruction then this
- // method will find the address of its
- // previous instruction and return that address.
+ AddressClass addr_class = AddressClass::eInvalid) const;
+
+ // Get load_addr as breakable load address for this target. Take a addr and
+ // check if for any reason there is a better address than this to put a
+ // breakpoint on. If there is then return that address. For MIPS, if
+ // instruction at addr is a delay slot instruction then this method will find
+ // the address of its previous instruction and return that address.
lldb::addr_t GetBreakableLoadAddress(lldb::addr_t addr);
void ModulesDidLoad(ModuleList &module_list);
@@ -949,7 +938,7 @@ public:
bool MergeArchitecture(const ArchSpec &arch_spec);
- Architecture *GetArchitecturePlugin() { return m_arch.GetPlugin(); }
+ Architecture *GetArchitecturePlugin() const { return m_arch.GetPlugin(); }
Debugger &GetDebugger() { return m_debugger; }
@@ -957,12 +946,12 @@ public:
Status &error);
// Reading memory through the target allows us to skip going to the process
- // for reading memory if possible and it allows us to try and read from
- // any constant sections in our object files on disk. If you always want
- // live program memory, read straight from the process. If you possibly
- // want to read from const sections in object files, read from the target.
- // This version of ReadMemory will try and read memory from the process
- // if the process is alive. The order is:
+ // for reading memory if possible and it allows us to try and read from any
+ // constant sections in our object files on disk. If you always want live
+ // program memory, read straight from the process. If you possibly want to
+ // read from const sections in object files, read from the target. This
+ // version of ReadMemory will try and read memory from the process if the
+ // process is alive. The order is:
// 1 - if (prefer_file_cache == true) then read from object file cache
// 2 - if there is a valid process, try and read from its memory
// 3 - if (prefer_file_cache == false) then read from object file cache
@@ -993,13 +982,6 @@ public:
return m_section_load_history.GetCurrentSectionLoadList();
}
- // const SectionLoadList&
- // GetSectionLoadList() const
- // {
- // return const_cast<SectionLoadHistory
- // *>(&m_section_load_history)->GetCurrentSectionLoadList();
- // }
-
static Target *GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
const SymbolContext *sc_ptr);
@@ -1025,9 +1007,8 @@ public:
PersistentExpressionState *
GetPersistentExpressionStateForLanguage(lldb::LanguageType language);
- // Creates a UserExpression for the given language, the rest of the parameters
- // have the
- // same meaning as for the UserExpression constructor.
+ // Creates a UserExpression for the given language, the rest of the
+ // parameters have the same meaning as for the UserExpression constructor.
// Returns a new-ed object which the caller owns.
UserExpression *GetUserExpressionForLanguage(
@@ -1035,10 +1016,9 @@ public:
Expression::ResultType desired_type,
const EvaluateExpressionOptions &options, Status &error);
- // Creates a FunctionCaller for the given language, the rest of the parameters
- // have the
- // same meaning as for the FunctionCaller constructor. Since a FunctionCaller
- // can't be
+ // Creates a FunctionCaller for the given language, the rest of the
+ // parameters have the same meaning as for the FunctionCaller constructor.
+ // Since a FunctionCaller can't be
// IR Interpreted, it makes no sense to call this with an
// ExecutionContextScope that lacks
// a Process.
@@ -1051,8 +1031,7 @@ public:
const char *name, Status &error);
// Creates a UtilityFunction for the given language, the rest of the
- // parameters have the
- // same meaning as for the UtilityFunction constructor.
+ // parameters have the same meaning as for the UtilityFunction constructor.
// Returns a new-ed object which the caller owns.
UtilityFunction *GetUtilityFunctionForLanguage(const char *expr,
@@ -1065,8 +1044,8 @@ public:
lldb::ClangASTImporterSP GetClangASTImporter();
//----------------------------------------------------------------------
- // Install any files through the platform that need be to installed
- // prior to launching or attaching.
+ // Install any files through the platform that need be to installed prior to
+ // launching or attaching.
//----------------------------------------------------------------------
Status Install(ProcessLaunchInfo *launch_info);
@@ -1091,10 +1070,10 @@ public:
void ClearAllLoadedSections();
// Since expressions results can persist beyond the lifetime of a process,
- // and the const expression results are available after a process is gone,
- // we provide a way for expressions to be evaluated from the Target itself.
- // If an expression is going to be run, then it should have a frame filled
- // in in th execution context.
+ // and the const expression results are available after a process is gone, we
+ // provide a way for expressions to be evaluated from the Target itself. If
+ // an expression is going to be run, then it should have a frame filled in in
+ // th execution context.
lldb::ExpressionResults EvaluateExpression(
llvm::StringRef expression, ExecutionContextScope *exe_scope,
lldb::ValueObjectSP &result_valobj_sp,
@@ -1103,6 +1082,11 @@ public:
lldb::ExpressionVariableSP GetPersistentVariable(const ConstString &name);
+ /// Return the next available number for numbered persistent variables.
+ unsigned GetNextPersistentVariableIndex() {
+ return m_next_persistent_variable_index++;
+ }
+
lldb::addr_t GetPersistentSymbol(const ConstString &name);
//------------------------------------------------------------------
@@ -1148,17 +1132,15 @@ public:
bool m_active;
// Use CreateStopHook to make a new empty stop hook. The GetCommandPointer
- // and fill it with commands,
- // and SetSpecifier to set the specifier shared pointer (can be null, that
- // will match anything.)
+ // and fill it with commands, and SetSpecifier to set the specifier shared
+ // pointer (can be null, that will match anything.)
StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid);
friend class Target;
};
typedef std::shared_ptr<StopHook> StopHookSP;
- // Add an empty stop hook to the Target's stop hook list, and returns a shared
- // pointer to it in new_hook.
- // Returns the id of the new hook.
+ // Add an empty stop hook to the Target's stop hook list, and returns a
+ // shared pointer to it in new_hook. Returns the id of the new hook.
StopHookSP CreateStopHook();
void RunStopHooks();
@@ -1173,9 +1155,6 @@ public:
bool GetSuppressStopHooks() { return m_suppress_stop_hooks; }
- // StopHookSP &
- // GetStopHookByIndex (size_t index);
- //
bool RemoveStopHookByID(lldb::user_id_t uid);
void RemoveAllStopHooks();
@@ -1275,9 +1254,9 @@ protected:
lldb::BreakpointSP m_last_created_breakpoint;
WatchpointList m_watchpoint_list;
lldb::WatchpointSP m_last_created_watchpoint;
- // We want to tightly control the process destruction process so
- // we can correctly tear down everything that we need to, so the only
- // class that knows about the process lifespan is this target class.
+ // We want to tightly control the process destruction process so we can
+ // correctly tear down everything that we need to, so the only class that
+ // knows about the process lifespan is this target class.
lldb::ProcessSP m_process_sp;
lldb::SearchFilterSP m_search_filter_sp;
PathMappingList m_image_search_paths;
@@ -1297,10 +1276,33 @@ protected:
bool m_valid;
bool m_suppress_stop_hooks;
bool m_is_dummy_target;
+ unsigned m_next_persistent_variable_index = 0;
static void ImageSearchPathsChanged(const PathMappingList &path_list,
void *baton);
+ //------------------------------------------------------------------
+ // Utilities for `statistics` command.
+ //------------------------------------------------------------------
+private:
+ std::vector<uint32_t> m_stats_storage;
+ bool m_collecting_stats = false;
+
+public:
+ void SetCollectingStats(bool v) { m_collecting_stats = v; }
+
+ bool GetCollectingStats() { return m_collecting_stats; }
+
+ void IncrementStats(lldb_private::StatisticKind key) {
+ if (!GetCollectingStats())
+ return;
+ lldbassert(key < lldb_private::StatisticKind::StatisticMax &&
+ "invalid statistics!");
+ m_stats_storage[key] += 1;
+ }
+
+ std::vector<uint32_t> GetStatistics() { return m_stats_storage; }
+
private:
//------------------------------------------------------------------
/// Construct with optional file and arch.
diff --git a/include/lldb/Target/Thread.h b/include/lldb/Target/Thread.h
index 1b0b6ef557e8..9ce73e0cbeff 100644
--- a/include/lldb/Target/Thread.h
+++ b/include/lldb/Target/Thread.h
@@ -214,8 +214,8 @@ public:
// This function is called on all the threads before "ShouldResume" and
// "WillResume" in case a thread needs to change its state before the
- // ThreadList polls all the threads to figure out which ones actually
- // will get to run and how.
+ // ThreadList polls all the threads to figure out which ones actually will
+ // get to run and how.
void SetupForResume();
// Do not override this function, it is for thread plan logic only
@@ -224,8 +224,8 @@ public:
// Override this to do platform specific tasks before resume.
virtual void WillResume(lldb::StateType resume_state) {}
- // This clears generic thread state after a resume. If you subclass this,
- // be sure to call it.
+ // This clears generic thread state after a resume. If you subclass this, be
+ // sure to call it.
virtual void DidResume();
// This notifies the thread when a private stop occurs.
@@ -244,14 +244,10 @@ public:
void Flush();
// Return whether this thread matches the specification in ThreadSpec. This
- // is a virtual
- // method because at some point we may extend the thread spec with a platform
- // specific
- // dictionary of attributes, which then only the platform specific Thread
- // implementation
- // would know how to match. For now, this just calls through to the
- // ThreadSpec's
- // ThreadPassesBasicTests method.
+ // is a virtual method because at some point we may extend the thread spec
+ // with a platform specific dictionary of attributes, which then only the
+ // platform specific Thread implementation would know how to match. For now,
+ // this just calls through to the ThreadSpec's ThreadPassesBasicTests method.
virtual bool MatchesSpec(const ThreadSpec *spec);
lldb::StopInfoSP GetStopInfo();
@@ -261,9 +257,8 @@ public:
bool StopInfoIsUpToDate() const;
// This sets the stop reason to a "blank" stop reason, so you can call
- // functions on the thread
- // without having the called function run with whatever stop reason you
- // stopped with.
+ // functions on the thread without having the called function run with
+ // whatever stop reason you stopped with.
void SetStopInfoToNothing();
bool ThreadStoppedForAReason();
@@ -492,16 +487,15 @@ public:
virtual void ClearBackingThread() {
// Subclasses can use this function if a thread is actually backed by
// another thread. This is currently used for the OperatingSystem plug-ins
- // where they might have a thread that is in memory, yet its registers
- // are available through the lldb_private::Thread subclass for the current
+ // where they might have a thread that is in memory, yet its registers are
+ // available through the lldb_private::Thread subclass for the current
// lldb_private::Process class. Since each time the process stops the
- // backing
- // threads for memory threads can change, we need a way to clear the backing
- // thread for all memory threads each time we stop.
+ // backing threads for memory threads can change, we need a way to clear
+ // the backing thread for all memory threads each time we stop.
}
- // If stop_format is true, this will be the form used when we print stop info.
- // If false, it will be the form we use for thread list and co.
+ // If stop_format is true, this will be the form used when we print stop
+ // info. If false, it will be the form we use for thread list and co.
void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx,
bool stop_format);
@@ -607,30 +601,24 @@ public:
// Thread Plan Providers:
// This section provides the basic thread plans that the Process control
// machinery uses to run the target. ThreadPlan.h provides more details on
- // how this mechanism works.
- // The thread provides accessors to a set of plans that perform basic
- // operations.
- // The idea is that particular Platform plugins can override these methods to
- // provide the implementation of these basic operations appropriate to their
- // environment.
+ // how this mechanism works. The thread provides accessors to a set of plans
+ // that perform basic operations. The idea is that particular Platform
+ // plugins can override these methods to provide the implementation of these
+ // basic operations appropriate to their environment.
//
// NB: All the QueueThreadPlanXXX providers return Shared Pointers to
// Thread plans. This is useful so that you can modify the plans after
// creation in ways specific to that plan type. Also, it is often necessary
- // for
- // ThreadPlans that utilize other ThreadPlans to implement their task to keep
- // a shared
- // pointer to the sub-plan.
- // But besides that, the shared pointers should only be held onto by entities
- // who live no longer
- // than the thread containing the ThreadPlan.
+ // for ThreadPlans that utilize other ThreadPlans to implement their task to
+ // keep a shared pointer to the sub-plan. But besides that, the shared
+ // pointers should only be held onto by entities who live no longer than the
+ // thread containing the ThreadPlan.
// FIXME: If this becomes a problem, we can make a version that just returns a
// pointer,
// which it is clearly unsafe to hold onto, and a shared pointer version, and
- // only allow
- // ThreadPlan and Co. to use the latter. That is made more annoying to do
- // because there's
- // no elegant way to friend a method to all sub-classes of a given class.
+ // only allow ThreadPlan and Co. to use the latter. That is made more
+ // annoying to do because there's no elegant way to friend a method to all
+ // sub-classes of a given class.
//
//------------------------------------------------------------------
@@ -717,9 +705,8 @@ public:
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
// Helper function that takes a LineEntry to step, insted of an AddressRange.
- // This may combine multiple
- // LineEntries of the same source line number to step over a longer address
- // range in a single operation.
+ // This may combine multiple LineEntries of the same source line number to
+ // step over a longer address range in a single operation.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOverRange(
bool abort_other_plans, const LineEntry &line_entry,
const SymbolContext &addr_context, lldb::RunMode stop_other_threads,
@@ -779,9 +766,8 @@ public:
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
// Helper function that takes a LineEntry to step, insted of an AddressRange.
- // This may combine multiple
- // LineEntries of the same source line number to step over a longer address
- // range in a single operation.
+ // This may combine multiple LineEntries of the same source line number to
+ // step over a longer address range in a single operation.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepInRange(
bool abort_other_plans, const LineEntry &line_entry,
const SymbolContext &addr_context, const char *step_in_target,
@@ -1115,23 +1101,22 @@ public:
void SetTracer(lldb::ThreadPlanTracerSP &tracer_sp);
//------------------------------------------------------------------
- // Get the thread index ID. The index ID that is guaranteed to not
- // be re-used by a process. They start at 1 and increase with each
- // new thread. This allows easy command line access by a unique ID
- // that is easier to type than the actual system thread ID.
+ // Get the thread index ID. The index ID that is guaranteed to not be re-used
+ // by a process. They start at 1 and increase with each new thread. This
+ // allows easy command line access by a unique ID that is easier to type than
+ // the actual system thread ID.
//------------------------------------------------------------------
uint32_t GetIndexID() const;
//------------------------------------------------------------------
// Get the originating thread's index ID.
- // In the case of an "extended" thread -- a thread which represents
- // the stack that enqueued/spawned work that is currently executing --
- // we need to provide the IndexID of the thread that actually did
- // this work. We don't want to just masquerade as that thread's IndexID
- // by using it in our own IndexID because that way leads to madness -
- // but the driver program which is iterating over extended threads
- // may ask for the OriginatingThreadID to display that information
- // to the user.
+ // In the case of an "extended" thread -- a thread which represents the stack
+ // that enqueued/spawned work that is currently executing -- we need to
+ // provide the IndexID of the thread that actually did this work. We don't
+ // want to just masquerade as that thread's IndexID by using it in our own
+ // IndexID because that way leads to madness - but the driver program which
+ // is iterating over extended threads may ask for the OriginatingThreadID to
+ // display that information to the user.
// Normal threads will return the same thing as GetIndexID();
//------------------------------------------------------------------
virtual uint32_t GetExtendedBacktraceOriginatingIndexID() {
@@ -1139,10 +1124,10 @@ public:
}
//------------------------------------------------------------------
- // The API ID is often the same as the Thread::GetID(), but not in
- // all cases. Thread::GetID() is the user visible thread ID that
- // clients would want to see. The API thread ID is the thread ID
- // that is used when sending data to/from the debugging protocol.
+ // The API ID is often the same as the Thread::GetID(), but not in all cases.
+ // Thread::GetID() is the user visible thread ID that clients would want to
+ // see. The API thread ID is the thread ID that is used when sending data
+ // to/from the debugging protocol.
//------------------------------------------------------------------
virtual lldb::user_id_t GetProtocolID() const { return GetID(); }
@@ -1171,9 +1156,9 @@ public:
uint32_t num_frames_with_source);
// We need a way to verify that even though we have a thread in a shared
- // pointer that the object itself is still valid. Currently this won't be
- // the case if DestroyThread() was called. DestroyThread is called when
- // a thread has been removed from the Process' thread list.
+ // pointer that the object itself is still valid. Currently this won't be the
+ // case if DestroyThread() was called. DestroyThread is called when a thread
+ // has been removed from the Process' thread list.
bool IsValid() const { return !m_destroy_called; }
// Sets and returns a valid stop info based on the process stop ID and the
@@ -1194,8 +1179,8 @@ public:
//----------------------------------------------------------------------
// Ask the thread subclass to set its stop info.
//
- // Thread subclasses should call Thread::SetStopInfo(...) with the
- // reason the thread stopped.
+ // Thread subclasses should call Thread::SetStopInfo(...) with the reason the
+ // thread stopped.
//
// @return
// True if Thread::SetStopInfo(...) was called, false otherwise.
@@ -1206,10 +1191,10 @@ public:
// Gets the temporary resume state for a thread.
//
// This value gets set in each thread by complex debugger logic in
- // Thread::ShouldResume() and an appropriate thread resume state will get
- // set in each thread every time the process is resumed prior to calling
- // Process::DoResume(). The lldb_private::Process subclass should adhere
- // to the thread resume state request which will be one of:
+ // Thread::ShouldResume() and an appropriate thread resume state will get set
+ // in each thread every time the process is resumed prior to calling
+ // Process::DoResume(). The lldb_private::Process subclass should adhere to
+ // the thread resume state request which will be one of:
//
// eStateRunning - thread will resume when process is resumed
// eStateStepping - thread should step 1 instruction and stop when process
@@ -1257,10 +1242,9 @@ protected:
friend class StackFrame;
friend class OperatingSystem;
- // This is necessary to make sure thread assets get destroyed while the thread
- // is still in good shape
- // to call virtual thread methods. This must be called by classes that derive
- // from Thread in their destructor.
+ // This is necessary to make sure thread assets get destroyed while the
+ // thread is still in good shape to call virtual thread methods. This must
+ // be called by classes that derive from Thread in their destructor.
virtual void DestroyThread();
void PushPlan(lldb::ThreadPlanSP &plan_sp);
@@ -1286,8 +1270,7 @@ protected:
virtual bool IsOperatingSystemPluginThread() const { return false; }
// Subclasses that have a way to get an extended info dictionary for this
- // thread should
- // fill
+ // thread should fill
virtual lldb_private::StructuredData::ObjectSP FetchThreadExtendedInfo() {
return StructuredData::ObjectSP();
}
@@ -1307,7 +1290,8 @@ protected:
lldb::StopInfoSP m_stop_info_sp; ///< The private stop reason for this thread
uint32_t m_stop_info_stop_id; // This is the stop id for which the StopInfo is
// valid. Can use this so you know that
- // the thread's m_stop_info_sp is current and you don't have to fetch it again
+ // the thread's m_stop_info_sp is current and you don't have to fetch it
+ // again
uint32_t m_stop_info_override_stop_id; // The stop ID containing the last time
// the stop info was checked against
// the stop info override
diff --git a/include/lldb/Target/ThreadCollection.h b/include/lldb/Target/ThreadCollection.h
index e3965b57e7a6..dd5e81c1af48 100644
--- a/include/lldb/Target/ThreadCollection.h
+++ b/include/lldb/Target/ThreadCollection.h
@@ -39,9 +39,9 @@ public:
void InsertThread(const lldb::ThreadSP &thread_sp, uint32_t idx);
- // Note that "idx" is not the same as the "thread_index". It is a zero
- // based index to accessing the current threads, whereas "thread_index"
- // is a unique index assigned
+ // Note that "idx" is not the same as the "thread_index". It is a zero based
+ // index to accessing the current threads, whereas "thread_index" is a unique
+ // index assigned
lldb::ThreadSP GetThreadAtIndex(uint32_t idx);
virtual ThreadIterable Threads() {
diff --git a/include/lldb/Target/ThreadList.h b/include/lldb/Target/ThreadList.h
index 2ebcd0b0e2c9..6285cb1e0fb4 100644
--- a/include/lldb/Target/ThreadList.h
+++ b/include/lldb/Target/ThreadList.h
@@ -43,9 +43,8 @@ public:
lldb::ThreadSP GetSelectedThread();
// Manage the thread to use for running expressions. This is usually the
- // Selected thread,
- // but sometimes (e.g. when evaluating breakpoint conditions & stop hooks) it
- // isn't.
+ // Selected thread, but sometimes (e.g. when evaluating breakpoint conditions
+ // & stop hooks) it isn't.
class ExpressionExecutionThreadPusher {
public:
ExpressionExecutionThreadPusher(ThreadList &thread_list, lldb::tid_t tid)
@@ -83,9 +82,9 @@ public:
void Destroy();
- // Note that "idx" is not the same as the "thread_index". It is a zero
- // based index to accessing the current threads, whereas "thread_index"
- // is a unique index assigned
+ // Note that "idx" is not the same as the "thread_index". It is a zero based
+ // index to accessing the current threads, whereas "thread_index" is a unique
+ // index assigned
lldb::ThreadSP GetThreadAtIndex(uint32_t idx, bool can_update = true);
lldb::ThreadSP FindThreadByID(lldb::tid_t tid, bool can_update = true);
@@ -102,6 +101,8 @@ public:
lldb::ThreadSP GetThreadSPForThreadPtr(Thread *thread_ptr);
+ lldb::ThreadSP GetBackingThread(const lldb::ThreadSP &real_thread);
+
bool ShouldStop(Event *event_ptr);
Vote ShouldReportStop(Event *event_ptr);
diff --git a/include/lldb/Target/ThreadPlan.h b/include/lldb/Target/ThreadPlan.h
index acc63ffe562b..7591fa9c9d07 100644
--- a/include/lldb/Target/ThreadPlan.h
+++ b/include/lldb/Target/ThreadPlan.h
@@ -340,9 +340,8 @@ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
public:
typedef enum { eAllThreads, eSomeThreads, eThisThread } ThreadScope;
- // We use these enums so that we can cast a base thread plan to it's real type
- // without having to resort
- // to dynamic casting.
+ // We use these enums so that we can cast a base thread plan to it's real
+ // type without having to resort to dynamic casting.
typedef enum {
eKindGeneric,
eKindNull,
@@ -432,9 +431,8 @@ public:
virtual bool ShouldAutoContinue(Event *event_ptr) { return false; }
- // Whether a "stop class" event should be reported to the "outside world". In
- // general
- // if a thread plan is active, events should not be reported.
+ // Whether a "stop class" event should be reported to the "outside world".
+ // In general if a thread plan is active, events should not be reported.
virtual Vote ShouldReportStop(Event *event_ptr);
@@ -445,8 +443,7 @@ public:
virtual bool StopOthers();
// This is the wrapper for DoWillResume that does generic ThreadPlan logic,
- // then
- // calls DoWillResume.
+ // then calls DoWillResume.
bool WillResume(lldb::StateType resume_state, bool current_plan);
virtual bool WillStop() = 0;
@@ -468,8 +465,8 @@ public:
virtual bool MischiefManaged();
virtual void ThreadDestroyed() {
- // Any cleanup that a plan might want to do in case the thread goes away
- // in the middle of the plan being queued on a thread can be done here.
+ // Any cleanup that a plan might want to do in case the thread goes away in
+ // the middle of the plan being queued on a thread can be done here.
}
bool GetPrivate() { return m_plan_private; }
@@ -509,39 +506,35 @@ public:
}
// Some thread plans hide away the actual stop info which caused any
- // particular stop. For
- // instance the ThreadPlanCallFunction restores the original stop reason so
- // that stopping and
- // calling a few functions won't lose the history of the run.
- // This call can be implemented to get you back to the real stop info.
+ // particular stop. For instance the ThreadPlanCallFunction restores the
+ // original stop reason so that stopping and calling a few functions won't
+ // lose the history of the run. This call can be implemented to get you back
+ // to the real stop info.
virtual lldb::StopInfoSP GetRealStopInfo() { return m_thread.GetStopInfo(); }
// If the completion of the thread plan stepped out of a function, the return
- // value of the function
- // might have been captured by the thread plan (currently only
- // ThreadPlanStepOut does this.)
- // If so, the ReturnValueObject can be retrieved from here.
+ // value of the function might have been captured by the thread plan
+ // (currently only ThreadPlanStepOut does this.) If so, the ReturnValueObject
+ // can be retrieved from here.
virtual lldb::ValueObjectSP GetReturnValueObject() {
return lldb::ValueObjectSP();
}
// If the thread plan managing the evaluation of a user expression lives
- // longer than the command
- // that instigated the expression (generally because the expression evaluation
- // hit a breakpoint, and
- // the user regained control at that point) a subsequent process control
- // command step/continue/etc. might
- // complete the expression evaluations. If so, the result of the expression
- // evaluation will show up here.
+ // longer than the command that instigated the expression (generally because
+ // the expression evaluation hit a breakpoint, and the user regained control
+ // at that point) a subsequent process control command step/continue/etc.
+ // might complete the expression evaluations. If so, the result of the
+ // expression evaluation will show up here.
virtual lldb::ExpressionVariableSP GetExpressionVariable() {
return lldb::ExpressionVariableSP();
}
- // If a thread plan stores the state before it was run, then you might
- // want to restore the state when it is done. This will do that job.
- // This is mostly useful for artificial plans like CallFunction plans.
+ // If a thread plan stores the state before it was run, then you might want
+ // to restore the state when it is done. This will do that job. This is
+ // mostly useful for artificial plans like CallFunction plans.
virtual bool RestoreThreadState() {
// Nothing to do in general.
@@ -585,8 +578,7 @@ protected:
ThreadPlan *GetPreviousPlan() { return m_thread.GetPreviousPlan(this); }
// This forwards the private Thread::GetPrivateStopInfo which is generally
- // what
- // ThreadPlan's need to know.
+ // what ThreadPlan's need to know.
lldb::StopInfoSP GetPrivateStopInfo() {
return m_thread.GetPrivateStopInfo();
@@ -638,10 +630,10 @@ private:
//----------------------------------------------------------------------
// ThreadPlanNull:
-// Threads are assumed to always have at least one plan on the plan stack.
-// This is put on the plan stack when a thread is destroyed so that if you
-// accidentally access a thread after it is destroyed you won't crash.
-// But asking questions of the ThreadPlanNull is definitely an error.
+// Threads are assumed to always have at least one plan on the plan stack. This
+// is put on the plan stack when a thread is destroyed so that if you
+// accidentally access a thread after it is destroyed you won't crash. But
+// asking questions of the ThreadPlanNull is definitely an error.
//----------------------------------------------------------------------
class ThreadPlanNull : public ThreadPlan {
diff --git a/include/lldb/Target/ThreadPlanCallFunction.h b/include/lldb/Target/ThreadPlanCallFunction.h
index 1c75b0a3645c..56bfc819320c 100644
--- a/include/lldb/Target/ThreadPlanCallFunction.h
+++ b/include/lldb/Target/ThreadPlanCallFunction.h
@@ -24,9 +24,8 @@ namespace lldb_private {
class ThreadPlanCallFunction : public ThreadPlan {
// Create a thread plan to call a function at the address passed in the
- // "function"
- // argument. If you plan to call GetReturnValueObject, then pass in the
- // return type, otherwise just pass in an invalid CompilerType.
+ // "function" argument. If you plan to call GetReturnValueObject, then pass
+ // in the return type, otherwise just pass in an invalid CompilerType.
public:
ThreadPlanCallFunction(Thread &thread, const Address &function,
const CompilerType &return_type,
@@ -69,27 +68,23 @@ public:
return m_return_valobj_sp;
}
- // Return the stack pointer that the function received
- // on entry. Any stack address below this should be
- // considered invalid after the function has been
- // cleaned up.
+ // Return the stack pointer that the function received on entry. Any stack
+ // address below this should be considered invalid after the function has
+ // been cleaned up.
lldb::addr_t GetFunctionStackPointer() { return m_function_sp; }
- // Classes that derive from FunctionCaller, and implement
- // their own WillPop methods should call this so that the
- // thread state gets restored if the plan gets discarded.
+ // Classes that derive from FunctionCaller, and implement their own WillPop
+ // methods should call this so that the thread state gets restored if the
+ // plan gets discarded.
void WillPop() override;
// If the thread plan stops mid-course, this will be the stop reason that
- // interrupted us.
- // Once DoTakedown is called, this will be the real stop reason at the end of
- // the function call.
- // If it hasn't been set for one or the other of these reasons, we'll return
- // the PrivateStopReason.
- // This is needed because we want the CallFunction thread plans not to show up
- // as the stop reason.
- // But if something bad goes wrong, it is nice to be able to tell the user
- // what really happened.
+ // interrupted us. Once DoTakedown is called, this will be the real stop
+ // reason at the end of the function call. If it hasn't been set for one or
+ // the other of these reasons, we'll return the PrivateStopReason. This is
+ // needed because we want the CallFunction thread plans not to show up as the
+ // stop reason. But if something bad goes wrong, it is nice to be able to
+ // tell the user what really happened.
lldb::StopInfoSP GetRealStopInfo() override {
if (m_real_stop_info_sp)
@@ -140,9 +135,9 @@ protected:
Thread::ThreadStateCheckpoint m_stored_thread_state;
lldb::StopInfoSP
m_real_stop_info_sp; // In general we want to hide call function
- // thread plans, but for reporting purposes,
- // it's nice to know the real stop reason.
- // This gets set in DoTakedown.
+ // thread plans, but for reporting purposes, it's
+ // nice to know the real stop reason. This gets set
+ // in DoTakedown.
StreamString m_constructor_errors;
lldb::ValueObjectSP m_return_valobj_sp; // If this contains a valid pointer,
// use the ABI to extract values when
diff --git a/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h b/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
index 1c67ddd5cdda..d58f7f050dbe 100644
--- a/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
+++ b/include/lldb/Target/ThreadPlanCallFunctionUsingABI.h
@@ -27,11 +27,9 @@ namespace lldb_private {
class ThreadPlanCallFunctionUsingABI : public ThreadPlanCallFunction {
// Create a thread plan to call a function at the address passed in the
- // "function"
- // argument, this function is executed using register manipulation instead of
- // JIT.
- // Class derives from ThreadPlanCallFunction and differs by calling a
- // alternative
+ // "function" argument, this function is executed using register manipulation
+ // instead of JIT. Class derives from ThreadPlanCallFunction and differs by
+ // calling a alternative
// ABI interface ABI::PrepareTrivialCall() which provides more detailed
// information.
public:
diff --git a/include/lldb/Target/ThreadPlanShouldStopHere.h b/include/lldb/Target/ThreadPlanShouldStopHere.h
index 60c0e3866707..030d5e434bd9 100644
--- a/include/lldb/Target/ThreadPlanShouldStopHere.h
+++ b/include/lldb/Target/ThreadPlanShouldStopHere.h
@@ -19,20 +19,16 @@
namespace lldb_private {
// This is an interface that ThreadPlans can adopt to allow flexible
-// modifications of the behavior
-// when a thread plan comes to a place where it would ordinarily stop. If such
-// modification makes
-// sense for your plan, inherit from this class, and when you would be about to
-// stop (in your ShouldStop
-// method), call InvokeShouldStopHereCallback, passing in the frame comparison
-// between where the step operation
-// started and where you arrived. If it returns true, then QueueStepOutFromHere
-// will queue the plan
-// to execute instead of stopping.
+// modifications of the behavior when a thread plan comes to a place where it
+// would ordinarily stop. If such modification makes sense for your plan,
+// inherit from this class, and when you would be about to stop (in your
+// ShouldStop method), call InvokeShouldStopHereCallback, passing in the frame
+// comparison between where the step operation started and where you arrived.
+// If it returns true, then QueueStepOutFromHere will queue the plan to execute
+// instead of stopping.
//
// The classic example of the use of this is ThreadPlanStepInRange not stopping
-// in frames that have
-// no debug information.
+// in frames that have no debug information.
//
// This class also defines a set of flags to control general aspects of this
// "ShouldStop" behavior.
@@ -82,11 +78,9 @@ public:
virtual ~ThreadPlanShouldStopHere();
// Set the ShouldStopHere callbacks. Pass in null to clear them and have no
- // special behavior (though you
- // can also call ClearShouldStopHereCallbacks for that purpose. If you pass
- // in a valid pointer, it will
- // adopt the non-null fields, and any null fields will be set to the default
- // values.
+ // special behavior (though you can also call ClearShouldStopHereCallbacks
+ // for that purpose. If you pass in a valid pointer, it will adopt the non-
+ // null fields, and any null fields will be set to the default values.
void
SetShouldStopHereCallbacks(const ThreadPlanShouldStopHereCallbacks *callbacks,
diff --git a/include/lldb/Target/ThreadPlanStepOverBreakpoint.h b/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
index 969c008f67d1..e799ec5a44ff 100644
--- a/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
+++ b/include/lldb/Target/ThreadPlanStepOverBreakpoint.h
@@ -31,6 +31,7 @@ public:
bool StopOthers() override;
lldb::StateType GetPlanRunState() override;
bool WillStop() override;
+ void WillPop() override;
bool MischiefManaged() override;
void ThreadDestroyed() override;
void SetAutoContinue(bool do_it);
diff --git a/include/lldb/Target/ThreadPlanStepRange.h b/include/lldb/Target/ThreadPlanStepRange.h
index ffb27d02e2d0..65bc1671cb1e 100644
--- a/include/lldb/Target/ThreadPlanStepRange.h
+++ b/include/lldb/Target/ThreadPlanStepRange.h
@@ -58,10 +58,9 @@ protected:
size_t &insn_offset);
// Pushes a plan to proceed through the next section of instructions in the
- // range - usually just a RunToAddress
- // plan to run to the next branch. Returns true if it pushed such a plan. If
- // there was no available 'quick run'
- // plan, then just single step.
+ // range - usually just a RunToAddress plan to run to the next branch.
+ // Returns true if it pushed such a plan. If there was no available 'quick
+ // run' plan, then just single step.
bool SetNextBranchBreakpoint();
void ClearNextBranchBreakpoint();
diff --git a/include/lldb/Target/UnixSignals.h b/include/lldb/Target/UnixSignals.h
index a209f3549aed..7ec683585f8e 100644
--- a/include/lldb/Target/UnixSignals.h
+++ b/include/lldb/Target/UnixSignals.h
@@ -63,8 +63,7 @@ public:
// These provide an iterator through the signals available on this system.
// Call GetFirstSignalNumber to get the first entry, then iterate on
- // GetNextSignalNumber
- // till you get back LLDB_INVALID_SIGNAL_NUMBER.
+ // GetNextSignalNumber till you get back LLDB_INVALID_SIGNAL_NUMBER.
int32_t GetFirstSignalNumber() const;
int32_t GetNextSignalNumber(int32_t current_signal) const;
@@ -76,13 +75,10 @@ public:
ConstString GetShortName(ConstString name) const;
// We assume that the elements of this object are constant once it is
- // constructed,
- // since a process should never need to add or remove symbols as it runs. So
- // don't
- // call these functions anywhere but the constructor of your subclass of
- // UnixSignals or in
- // your Process Plugin's GetUnixSignals method before you return the
- // UnixSignal object.
+ // constructed, since a process should never need to add or remove symbols as
+ // it runs. So don't call these functions anywhere but the constructor of
+ // your subclass of UnixSignals or in your Process Plugin's GetUnixSignals
+ // method before you return the UnixSignal object.
void AddSignal(int signo, const char *name, bool default_suppress,
bool default_stop, bool default_notify,
@@ -90,15 +86,14 @@ public:
void RemoveSignal(int signo);
- // Returns a current version of the data stored in this class.
- // Version gets incremented each time Set... method is called.
+ // Returns a current version of the data stored in this class. Version gets
+ // incremented each time Set... method is called.
uint64_t GetVersion() const;
- // Returns a vector of signals that meet criteria provided in arguments.
- // Each should_[suppress|stop|notify] flag can be
- // None - no filtering by this flag
- // true - only signals that have it set to true are returned
- // false - only signals that have it set to true are returned
+ // Returns a vector of signals that meet criteria provided in arguments. Each
+ // should_[suppress|stop|notify] flag can be None - no filtering by this
+ // flag true - only signals that have it set to true are returned false -
+ // only signals that have it set to true are returned
std::vector<int32_t> GetFilteredSignals(llvm::Optional<bool> should_suppress,
llvm::Optional<bool> should_stop,
llvm::Optional<bool> should_notify);
@@ -126,10 +121,10 @@ protected:
collection m_signals;
- // This version gets incremented every time something is changing in
- // this class, including when we call AddSignal from the constructor.
- // So after the object is constructed m_version is going to be > 0
- // if it has at least one signal registered in it.
+ // This version gets incremented every time something is changing in this
+ // class, including when we call AddSignal from the constructor. So after the
+ // object is constructed m_version is going to be > 0 if it has at least one
+ // signal registered in it.
uint64_t m_version = 0;
// GDBRemote signals need to be copyable.
diff --git a/include/lldb/Utility/AnsiTerminal.h b/include/lldb/Utility/AnsiTerminal.h
index 5eaf2fd0e069..b5ff239f800d 100644
--- a/include/lldb/Utility/AnsiTerminal.h
+++ b/include/lldb/Utility/AnsiTerminal.h
@@ -50,6 +50,7 @@
#define ANSI_1_CTRL(ctrl1) "\033["##ctrl1 ANSI_ESC_END
#define ANSI_2_CTRL(ctrl1, ctrl2) "\033["##ctrl1 ";"##ctrl2 ANSI_ESC_END
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
@@ -118,17 +119,21 @@ inline std::string FormatAnsiTerminalCodes(llvm::StringRef format,
break;
}
+ bool found_code = false;
for (const auto &code : codes) {
if (!right.consume_front(code.name))
continue;
if (do_color)
fmt.append(code.value);
- format = right;
+ found_code = true;
break;
}
-
- format = format.drop_front();
+ format = right;
+ // If we haven't found a valid replacement value, we just copy the string
+ // to the result without any modifications.
+ if (!found_code)
+ fmt.append(tok_hdr);
}
return fmt;
}
diff --git a/include/lldb/Utility/ArchSpec.h b/include/lldb/Utility/ArchSpec.h
index 50f69606e3df..680e9b1b9ea6 100644
--- a/include/lldb/Utility/ArchSpec.h
+++ b/include/lldb/Utility/ArchSpec.h
@@ -10,6 +10,7 @@
#ifndef LLDB_UTILITY_ARCHSPEC_H
#define LLDB_UTILITY_ARCHSPEC_H
+#include "lldb/Utility/CompletionRequest.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
@@ -23,13 +24,13 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class ArchSpec ArchSpec.h "lldb/Utility/ArchSpec.h"
-/// @brief An architecture specification class.
+/// @class ArchSpec ArchSpec.h "lldb/Utility/ArchSpec.h" An architecture
+/// specification class.
///
/// A class designed to be created from a cpu type and subtype, a
-/// string representation, or an llvm::Triple. Keeping all of the
-/// conversions of strings to architecture enumeration values confined
-/// to this class allows new architecture support to be added easily.
+/// string representation, or an llvm::Triple. Keeping all of the conversions
+/// of strings to architecture enumeration values confined to this class
+/// allows new architecture support to be added easily.
//----------------------------------------------------------------------
class ArchSpec {
public:
@@ -245,16 +246,15 @@ public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// Default constructor that initializes the object with invalid
- /// cpu type and subtype values.
+ /// Default constructor that initializes the object with invalid cpu type
+ /// and subtype values.
//------------------------------------------------------------------
ArchSpec();
//------------------------------------------------------------------
/// Constructor over triple.
///
- /// Constructs an ArchSpec with properties consistent with the given
- /// Triple.
+ /// Constructs an ArchSpec with properties consistent with the given Triple.
//------------------------------------------------------------------
explicit ArchSpec(const llvm::Triple &triple);
explicit ArchSpec(const char *triple_cstr);
@@ -262,8 +262,8 @@ public:
//------------------------------------------------------------------
/// Constructor over architecture name.
///
- /// Constructs an ArchSpec with properties consistent with the given
- /// object type and architecture name.
+ /// Constructs an ArchSpec with properties consistent with the given object
+ /// type and architecture name.
//------------------------------------------------------------------
explicit ArchSpec(ArchitectureType arch_type, uint32_t cpu_type,
uint32_t cpu_subtype);
@@ -284,16 +284,18 @@ public:
//---------------------------------------------------------------------------
/// Returns true if the OS, vendor and environment fields of the triple are
- /// unset. The triple is expected to be normalized (llvm::Triple::normalize).
+ /// unset. The triple is expected to be normalized
+ /// (llvm::Triple::normalize).
//---------------------------------------------------------------------------
static bool ContainsOnlyArch(const llvm::Triple &normalized_triple);
- static size_t AutoComplete(llvm::StringRef name, StringList &matches);
+ static void ListSupportedArchNames(StringList &list);
+ static size_t AutoComplete(CompletionRequest &request);
//------------------------------------------------------------------
/// Returns a static string representing the current architecture.
///
- /// @return A static string correcponding to the current
+ /// @return A static string corresponding to the current
/// architecture.
//------------------------------------------------------------------
const char *GetArchitectureName() const;
@@ -306,8 +308,8 @@ public:
bool IsMIPS() const;
//------------------------------------------------------------------
- /// Returns a string representing current architecture as a target CPU
- /// for tools like compiler, disassembler etc.
+ /// Returns a string representing current architecture as a target CPU for
+ /// tools like compiler, disassembler etc.
///
/// @return A string representing target CPU for the current
/// architecture.
@@ -329,8 +331,7 @@ public:
void Clear();
//------------------------------------------------------------------
- /// Returns the size in bytes of an address of the current
- /// architecture.
+ /// Returns the size in bytes of an address of the current architecture.
///
/// @return The byte size of an address of the current architecture.
//------------------------------------------------------------------
@@ -356,9 +357,8 @@ public:
//------------------------------------------------------------------
/// Set the distribution id of the architecture.
///
- /// This will be something like "ubuntu", "fedora", etc. on Linux.
- /// This should be the same value returned by
- /// HostInfo::GetDistributionId ().
+ /// This will be something like "ubuntu", "fedora", etc. on Linux. This
+ /// should be the same value returned by HostInfo::GetDistributionId ().
///------------------------------------------------------------------
void SetDistributionId(const char *distribution_id);
@@ -395,13 +395,12 @@ public:
//------------------------------------------------------------------
/// Merges fields from another ArchSpec into this ArchSpec.
///
- /// This will use the supplied ArchSpec to fill in any fields of
- /// the triple in this ArchSpec which were unspecified. This can
- /// be used to refine a generic ArchSpec with a more specific one.
- /// For example, if this ArchSpec's triple is something like
- /// i386-unknown-unknown-unknown, and we have a triple which is
- /// x64-pc-windows-msvc, then merging that triple into this one
- /// will result in the triple i386-pc-windows-msvc.
+ /// This will use the supplied ArchSpec to fill in any fields of the triple
+ /// in this ArchSpec which were unspecified. This can be used to refine a
+ /// generic ArchSpec with a more specific one. For example, if this
+ /// ArchSpec's triple is something like i386-unknown-unknown-unknown, and we
+ /// have a triple which is x64-pc-windows-msvc, then merging that triple
+ /// into this one will result in the triple i386-pc-windows-msvc.
///
//------------------------------------------------------------------
void MergeFrom(const ArchSpec &other);
@@ -421,16 +420,16 @@ public:
///
/// @return True if the object, and CPU were successfully set.
///
- /// As a side effect, the vendor value is usually set to unknown.
- /// The exections are
+ /// As a side effect, the vendor value is usually set to unknown. The
+ /// exceptions are
/// aarch64-apple-ios
/// arm-apple-ios
/// thumb-apple-ios
/// x86-apple-
/// x86_64-apple-
///
- /// As a side effect, the os value is usually set to unknown
- /// The exceptions are
+ /// As a side effect, the os value is usually set to unknown The exceptions
+ /// are
/// *-*-aix
/// aarch64-apple-ios
/// arm-apple-ios
@@ -456,10 +455,10 @@ public:
//------------------------------------------------------------------
/// Sets this ArchSpec's byte order.
///
- /// In the common case there is no need to call this method as the
- /// byte order can almost always be determined by the architecture.
- /// However, many CPU's are bi-endian (ARM, Alpha, PowerPC, etc)
- /// and the default/assumed byte order may be incorrect.
+ /// In the common case there is no need to call this method as the byte
+ /// order can almost always be determined by the architecture. However, many
+ /// CPU's are bi-endian (ARM, Alpha, PowerPC, etc) and the default/assumed
+ /// byte order may be incorrect.
//------------------------------------------------------------------
void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; }
@@ -476,28 +475,28 @@ public:
//------------------------------------------------------------------
/// Architecture data byte width accessor
///
- /// @return the size in 8-bit (host) bytes of a minimum addressable
- /// unit from the Architecture's data bus
+ /// @return the size in 8-bit (host) bytes of a minimum addressable unit
+ /// from the Architecture's data bus
//------------------------------------------------------------------
uint32_t GetDataByteSize() const;
//------------------------------------------------------------------
/// Architecture code byte width accessor
///
- /// @return the size in 8-bit (host) bytes of a minimum addressable
- /// unit from the Architecture's code bus
+ /// @return the size in 8-bit (host) bytes of a minimum addressable unit
+ /// from the Architecture's code bus
//------------------------------------------------------------------
uint32_t GetCodeByteSize() const;
//------------------------------------------------------------------
- /// Architecture tripple accessor.
+ /// Architecture triple accessor.
///
/// @return A triple describing this ArchSpec.
//------------------------------------------------------------------
llvm::Triple &GetTriple() { return m_triple; }
//------------------------------------------------------------------
- /// Architecture tripple accessor.
+ /// Architecture triple accessor.
///
/// @return A triple describing this ArchSpec.
//------------------------------------------------------------------
@@ -506,14 +505,14 @@ public:
void DumpTriple(Stream &s) const;
//------------------------------------------------------------------
- /// Architecture tripple setter.
+ /// Architecture triple setter.
///
- /// Configures this ArchSpec according to the given triple. If the
- /// triple has unknown components in all of the vendor, OS, and
- /// the optional environment field (i.e. "i386-unknown-unknown")
- /// then default values are taken from the host. Architecture and
- /// environment components are used to further resolve the CPU type
- /// and subtype, endian characteristics, etc.
+ /// Configures this ArchSpec according to the given triple. If the triple
+ /// has unknown components in all of the vendor, OS, and the optional
+ /// environment field (i.e. "i386-unknown-unknown") then default values are
+ /// taken from the host. Architecture and environment components are used
+ /// to further resolve the CPU type and subtype, endian characteristics,
+ /// etc.
///
/// @return A triple describing this ArchSpec.
//------------------------------------------------------------------
@@ -530,8 +529,8 @@ public:
lldb::ByteOrder GetDefaultEndian() const;
//------------------------------------------------------------------
- /// Returns true if 'char' is a signed type by defualt in the
- /// architecture false otherwise
+ /// Returns true if 'char' is a signed type by default in the architecture
+ /// false otherwise
///
/// @return True if 'char' is a signed type by default on the
/// architecture and false otherwise.
@@ -539,18 +538,18 @@ public:
bool CharIsSignedByDefault() const;
//------------------------------------------------------------------
- /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu
- /// type match between them.
- /// e.g. armv7s is not an exact match with armv7 - this would return false
+ /// Compare an ArchSpec to another ArchSpec, requiring an exact cpu type
+ /// match between them. e.g. armv7s is not an exact match with armv7 - this
+ /// would return false
///
/// @return true if the two ArchSpecs match.
//------------------------------------------------------------------
bool IsExactMatch(const ArchSpec &rhs) const;
//------------------------------------------------------------------
- /// Compare an ArchSpec to another ArchSpec, requiring a compatible
- /// cpu type match between them.
- /// e.g. armv7s is compatible with armv7 - this method would return true
+ /// Compare an ArchSpec to another ArchSpec, requiring a compatible cpu type
+ /// match between them. e.g. armv7s is compatible with armv7 - this method
+ /// would return true
///
/// @return true if the two ArchSpecs are compatible
//------------------------------------------------------------------
@@ -566,12 +565,12 @@ public:
//------------------------------------------------------------------
/// Detect whether this architecture uses thumb code exclusively
///
- /// Some embedded ARM chips (e.g. the ARM Cortex M0-7 line) can
- /// only execute the Thumb instructions, never Arm. We should normally
- /// pick up arm/thumbness from their the processor status bits (cpsr/xpsr)
- /// or hints on each function - but when doing bare-boards low level
- /// debugging (especially common with these embedded processors), we may
- /// not have those things easily accessible.
+ /// Some embedded ARM chips (e.g. the ARM Cortex M0-7 line) can only execute
+ /// the Thumb instructions, never Arm. We should normally pick up
+ /// arm/thumbness from their the processor status bits (cpsr/xpsr) or hints
+ /// on each function - but when doing bare-boards low level debugging
+ /// (especially common with these embedded processors), we may not have
+ /// those things easily accessible.
///
/// @return true if this is an arm ArchSpec which can only execute Thumb
/// instructions
@@ -592,31 +591,30 @@ protected:
Core m_core = kCore_invalid;
lldb::ByteOrder m_byte_order = lldb::eByteOrderInvalid;
- // Additional arch flags which we cannot get from triple and core
- // For MIPS these are application specific extensions like
- // micromips, mips16 etc.
+ // Additional arch flags which we cannot get from triple and core For MIPS
+ // these are application specific extensions like micromips, mips16 etc.
uint32_t m_flags = 0;
ConstString m_distribution_id;
- // Called when m_def or m_entry are changed. Fills in all remaining
- // members with default values.
+ // Called when m_def or m_entry are changed. Fills in all remaining members
+ // with default values.
void CoreUpdated(bool update_triple);
};
//------------------------------------------------------------------
-/// @fn bool operator< (const ArchSpec& lhs, const ArchSpec& rhs)
-/// @brief Less than operator.
+/// @fn bool operator< (const ArchSpec& lhs, const ArchSpec& rhs) Less than
+/// operator.
///
-/// Tests two ArchSpec objects to see if \a lhs is less than \a
-/// rhs.
+/// Tests two ArchSpec objects to see if \a lhs is less than \a rhs.
///
-/// @param[in] lhs The Left Hand Side ArchSpec object to compare.
-/// @param[in] rhs The Left Hand Side ArchSpec object to compare.
+/// @param[in] lhs The Left Hand Side ArchSpec object to compare. @param[in]
+/// rhs The Left Hand Side ArchSpec object to compare.
///
/// @return true if \a lhs is less than \a rhs
//------------------------------------------------------------------
bool operator<(const ArchSpec &lhs, const ArchSpec &rhs);
+bool operator==(const ArchSpec &lhs, const ArchSpec &rhs);
bool ParseMachCPUDashSubtypeTriple(llvm::StringRef triple_str, ArchSpec &arch);
diff --git a/include/lldb/Interpreter/Args.h b/include/lldb/Utility/Args.h
index 19d7ac418566..dec3dfaa4785 100644
--- a/include/lldb/Interpreter/Args.h
+++ b/include/lldb/Utility/Args.h
@@ -7,54 +7,30 @@
//
//===----------------------------------------------------------------------===//
-#ifndef liblldb_Command_h_
-#define liblldb_Command_h_
+#ifndef LLDB_UTILITY_ARGS_H
+#define LLDB_UTILITY_ARGS_H
-// C Includes
-// C++ Includes
-#include <list>
+#include "lldb/Utility/Environment.h"
+#include "lldb/lldb-private-types.h"
+#include "lldb/lldb-types.h"
+#include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/StringRef.h"
#include <string>
#include <utility>
#include <vector>
-// Other libraries and framework includes
-#include "llvm/ADT/ArrayRef.h"
-#include "llvm/ADT/StringRef.h"
-// Project includes
-#include "lldb/Utility/Status.h"
-#include "lldb/lldb-private-types.h"
-#include "lldb/lldb-types.h"
-
namespace lldb_private {
-struct Option;
-
-typedef std::vector<std::tuple<std::string, int, std::string>> OptionArgVector;
-typedef std::shared_ptr<OptionArgVector> OptionArgVectorSP;
-
-struct OptionArgElement {
- enum { eUnrecognizedArg = -1, eBareDash = -2, eBareDoubleDash = -3 };
-
- OptionArgElement(int defs_index, int pos, int arg_pos)
- : opt_defs_index(defs_index), opt_pos(pos), opt_arg_pos(arg_pos) {}
-
- int opt_defs_index;
- int opt_pos;
- int opt_arg_pos;
-};
-
-typedef std::vector<OptionArgElement> OptionElementVector;
-
//----------------------------------------------------------------------
-/// @class Args Args.h "lldb/Interpreter/Args.h"
-/// @brief A command line argument class.
+/// @class Args Args.h "lldb/Utility/Args.h"
+/// A command line argument class.
///
-/// The Args class is designed to be fed a command line. The
-/// command line is copied into an internal buffer and then split up
-/// into arguments. Arguments are space delimited if there are no quotes
-/// (single, double, or backtick quotes) surrounding the argument. Spaces
-/// can be escaped using a \ character to avoid having to surround an
-/// argument that contains a space with quotes.
+/// The Args class is designed to be fed a command line. The command line is
+/// copied into an internal buffer and then split up into arguments. Arguments
+/// are space delimited if there are no quotes (single, double, or backtick
+/// quotes) surrounding the argument. Spaces can be escaped using a \
+/// character to avoid having to surround an argument that contains a space
+/// with quotes.
//----------------------------------------------------------------------
class Args {
public:
@@ -72,6 +48,11 @@ public:
llvm::StringRef ref;
char quote;
const char *c_str() const { return ptr.get(); }
+
+ //------------------------------------------------------------------
+ /// Returns true if this argument was quoted in any way.
+ //------------------------------------------------------------------
+ bool IsQuoted() const { return quote != '\0'; }
};
//------------------------------------------------------------------
@@ -95,6 +76,12 @@ public:
//------------------------------------------------------------------
~Args();
+ explicit Args(const Environment &env) : Args() {
+ SetArguments(const_cast<const char **>(env.getEnvp().get()));
+ }
+
+ explicit operator Environment() const { return GetConstArgumentVector(); }
+
//------------------------------------------------------------------
/// Dump all entries to the stream \a s using label \a label_name.
///
@@ -113,18 +100,17 @@ public:
//------------------------------------------------------------------
/// Sets the command string contained by this object.
///
- /// The command string will be copied and split up into arguments
- /// that can be accessed via the accessor functions.
+ /// The command string will be copied and split up into arguments that can
+ /// be accessed via the accessor functions.
///
/// @param[in] command
/// A command StringRef that will be copied and split up
/// into arguments.
///
/// @see Args::GetArgumentCount() const
- /// @see Args::GetArgumentAtIndex (size_t) const
- /// @see Args::GetArgumentVector ()
- /// @see Args::Shift ()
- /// @see Args::Unshift (const char *)
+ /// @see Args::GetArgumentAtIndex (size_t) const @see
+ /// Args::GetArgumentVector () @see Args::Shift () @see Args::Unshift (const
+ /// char *)
//------------------------------------------------------------------
void SetCommandString(llvm::StringRef command);
@@ -142,8 +128,8 @@ public:
bool empty() const { return GetArgumentCount() == 0; }
//------------------------------------------------------------------
- /// Gets the NULL terminated C string argument pointer for the
- /// argument at index \a idx.
+ /// Gets the NULL terminated C string argument pointer for the argument at
+ /// index \a idx.
///
/// @return
/// The NULL terminated C string argument pointer if \a idx is a
@@ -154,10 +140,10 @@ public:
llvm::ArrayRef<ArgEntry> entries() const { return m_entries; }
char GetArgumentQuoteCharAtIndex(size_t idx) const;
- std::vector<ArgEntry>::const_iterator begin() const {
- return m_entries.begin();
- }
- std::vector<ArgEntry>::const_iterator end() const { return m_entries.end(); }
+ using const_iterator = std::vector<ArgEntry>::const_iterator;
+
+ const_iterator begin() const { return m_entries.begin(); }
+ const_iterator end() const { return m_entries.end(); }
size_t size() const { return GetArgumentCount(); }
const ArgEntry &operator[](size_t n) const { return m_entries[n]; }
@@ -165,9 +151,9 @@ public:
//------------------------------------------------------------------
/// Gets the argument vector.
///
- /// The value returned by this function can be used by any function
- /// that takes and vector. The return value is just like \a argv
- /// in the standard C entry point function:
+ /// The value returned by this function can be used by any function that
+ /// takes and vector. The return value is just like \a argv in the standard
+ /// C entry point function:
/// \code
/// int main (int argc, const char **argv);
/// \endcode
@@ -181,9 +167,9 @@ public:
//------------------------------------------------------------------
/// Gets the argument vector.
///
- /// The value returned by this function can be used by any function
- /// that takes and vector. The return value is just like \a argv
- /// in the standard C entry point function:
+ /// The value returned by this function can be used by any function that
+ /// takes and vector. The return value is just like \a argv in the standard
+ /// C entry point function:
/// \code
/// int main (int argc, const char **argv);
/// \endcode
@@ -237,8 +223,8 @@ public:
char quote_char = '\0');
//------------------------------------------------------------------
- /// Replaces the argument value at index \a idx to \a arg_cstr
- /// if \a idx is a valid argument index.
+ /// Replaces the argument value at index \a idx to \a arg_cstr if \a idx is
+ /// a valid argument index.
///
/// @param[in] idx
/// The index of the argument that will have its value replaced.
@@ -263,11 +249,11 @@ public:
void DeleteArgumentAtIndex(size_t idx);
//------------------------------------------------------------------
- /// Sets the argument vector value, optionally copying all
- /// arguments into an internal buffer.
+ /// Sets the argument vector value, optionally copying all arguments into an
+ /// internal buffer.
///
- /// Sets the arguments to match those found in \a argv. All argument
- /// strings will be copied into an internal buffers.
+ /// Sets the arguments to match those found in \a argv. All argument strings
+ /// will be copied into an internal buffers.
//
// FIXME: Handle the quote character somehow.
//------------------------------------------------------------------
@@ -276,21 +262,20 @@ public:
void SetArguments(const char **argv);
//------------------------------------------------------------------
- /// Shifts the first argument C string value of the array off the
- /// argument array.
+ /// Shifts the first argument C string value of the array off the argument
+ /// array.
///
- /// The string value will be freed, so a copy of the string should
- /// be made by calling Args::GetArgumentAtIndex (size_t) const
- /// first and copying the returned value before calling
- /// Args::Shift().
+ /// The string value will be freed, so a copy of the string should be made
+ /// by calling Args::GetArgumentAtIndex (size_t) const first and copying the
+ /// returned value before calling Args::Shift().
///
/// @see Args::GetArgumentAtIndex (size_t) const
//------------------------------------------------------------------
void Shift();
//------------------------------------------------------------------
- /// Inserts a class owned copy of \a arg_cstr at the beginning of
- /// the argument vector.
+ /// Inserts a class owned copy of \a arg_cstr at the beginning of the
+ /// argument vector.
///
/// A copy \a arg_cstr will be made.
///
@@ -303,44 +288,6 @@ public:
void Unshift(llvm::StringRef arg_str, char quote_char = '\0');
//------------------------------------------------------------------
- /// Parse the arguments in the contained arguments.
- ///
- /// The arguments that are consumed by the argument parsing process
- /// will be removed from the argument vector. The arguments that
- /// get processed start at the second argument. The first argument
- /// is assumed to be the command and will not be touched.
- ///
- /// param[in] platform_sp
- /// The platform used for option validation. This is necessary
- /// because an empty execution_context is not enough to get us
- /// to a reasonable platform. If the platform isn't given,
- /// we'll try to get it from the execution context. If we can't
- /// get it from the execution context, we'll skip validation.
- ///
- /// param[in] require_validation
- /// When true, it will fail option parsing if validation could
- /// not occur due to not having a platform.
- ///
- /// @see class Options
- //------------------------------------------------------------------
- Status ParseOptions(Options &options, ExecutionContext *execution_context,
- lldb::PlatformSP platform_sp, bool require_validation);
-
- bool IsPositionalArgument(const char *arg);
-
- // The following works almost identically to ParseOptions, except that no
- // option is required to have arguments, and it builds up the
- // option_arg_vector as it parses the options.
-
- std::string ParseAliasOptions(Options &options, CommandReturnObject &result,
- OptionArgVector *option_arg_vector,
- llvm::StringRef raw_input_line);
-
- void ParseArgsForCompletion(Options &options,
- OptionElementVector &option_element_vector,
- uint32_t cursor_index);
-
- //------------------------------------------------------------------
// Clear the arguments.
//
// For re-setting or blanking out the list of arguments.
@@ -376,39 +323,12 @@ public:
return min <= sval64 && sval64 <= max;
}
- static lldb::addr_t StringToAddress(const ExecutionContext *exe_ctx,
- llvm::StringRef s,
- lldb::addr_t fail_value, Status *error);
-
- static bool StringToBoolean(llvm::StringRef s, bool fail_value,
- bool *success_ptr);
-
- static char StringToChar(llvm::StringRef s, char fail_value,
- bool *success_ptr);
-
- static int64_t StringToOptionEnum(llvm::StringRef s,
- OptionEnumValueElement *enum_values,
- int32_t fail_value, Status &error);
-
- static lldb::ScriptLanguage
- StringToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value,
- bool *success_ptr);
-
- // TODO: Use StringRef
- static Status StringToFormat(const char *s, lldb::Format &format,
- size_t *byte_size_ptr); // If non-NULL, then a
- // byte size can precede
- // the format character
-
static lldb::Encoding
StringToEncoding(llvm::StringRef s,
lldb::Encoding fail_value = lldb::eEncodingInvalid);
static uint32_t StringToGenericRegister(llvm::StringRef s);
- static bool StringToVersion(llvm::StringRef string, uint32_t &major,
- uint32_t &minor, uint32_t &update);
-
static const char *GetShellSafeArgument(const FileSpec &shell,
const char *unsafe_arg,
std::string &safe_arg);
@@ -423,58 +343,121 @@ public:
static void EncodeEscapeSequences(const char *src, std::string &dst);
// ExpandEscapeSequences will change a string of possibly non-printable
- // characters and expand them into text. So '\n' will turn into two characters
- // like "\n" which is suitable for human reading. When a character is not
- // printable and isn't one of the common in escape sequences listed in the
- // help for EncodeEscapeSequences, then it will be encoded as octal. Printable
- // characters are left alone.
+ // characters and expand them into text. So '\n' will turn into two
+ // characters like "\n" which is suitable for human reading. When a character
+ // is not printable and isn't one of the common in escape sequences listed in
+ // the help for EncodeEscapeSequences, then it will be encoded as octal.
+ // Printable characters are left alone.
static void ExpandEscapedCharacters(const char *src, std::string &dst);
static std::string EscapeLLDBCommandArgument(const std::string &arg,
char quote_char);
+private:
+ std::vector<ArgEntry> m_entries;
+ std::vector<char *> m_argv;
+};
+
+//----------------------------------------------------------------------
+/// @class OptionsWithRaw Args.h "lldb/Utility/Args.h"
+/// A pair of an option list with a 'raw' string as a suffix.
+///
+/// This class works similar to Args, but handles the case where we have a
+/// trailing string that shouldn't be interpreted as a list of arguments but
+/// preserved as is. It is also only useful for handling command line options
+/// (e.g. '-foo bar -i0') that start with a dash.
+///
+/// The leading option list is optional. If the first non-space character
+/// in the string starts with a dash, and the string contains an argument
+/// that is an unquoted double dash (' -- '), then everything up to the double
+/// dash is parsed as a list of arguments. Everything after the double dash
+/// is interpreted as the raw suffix string. Note that the space behind the
+/// double dash is not part of the raw suffix.
+///
+/// All strings not matching the above format as considered to be just a raw
+/// string without any options.
+///
+/// @see Args
+//----------------------------------------------------------------------
+class OptionsWithRaw {
+public:
//------------------------------------------------------------------
- /// Add or replace an environment variable with the given value.
+ /// Parse the given string as a list of optional arguments with a raw suffix.
///
- /// This command adds the environment variable if it is not already
- /// present using the given value. If the environment variable is
- /// already in the list, it replaces the first such occurrence
- /// with the new value.
+ /// See the class description for a description of the input format.
+ ///
+ /// @param[in] argument_string
+ /// The string that should be parsed.
//------------------------------------------------------------------
- void AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
- llvm::StringRef new_value);
+ explicit OptionsWithRaw(llvm::StringRef argument_string);
- /// Return whether a given environment variable exists.
+ //------------------------------------------------------------------
+ /// Returns true if there are any arguments before the raw suffix.
+ //------------------------------------------------------------------
+ bool HasArgs() const { return m_has_args; }
+
+ //------------------------------------------------------------------
+ /// Returns the list of arguments.
///
- /// This command treats Args like a list of environment variables,
- /// as used in ProcessLaunchInfo. It treats each argument as
- /// an {env_var_name}={value} or an {env_var_name} entry.
+ /// You can only call this method if HasArgs returns true.
+ //------------------------------------------------------------------
+ Args &GetArgs() {
+ assert(m_has_args);
+ return m_args;
+ }
+
+ //------------------------------------------------------------------
+ /// Returns the list of arguments.
///
- /// @param[in] env_var_name
- /// Specifies the name of the environment variable to check.
+ /// You can only call this method if HasArgs returns true.
+ //------------------------------------------------------------------
+ const Args &GetArgs() const {
+ assert(m_has_args);
+ return m_args;
+ }
+
+ //------------------------------------------------------------------
+ /// Returns the part of the input string that was used for parsing the
+ /// argument list. This string also includes the double dash that is used
+ /// for separating the argument list from the suffix.
///
- /// @param[out] argument_index
- /// If non-null, then when the environment variable is found,
- /// the index of the argument position will be returned in
- /// the size_t pointed to by this argument.
+ /// You can only call this method if HasArgs returns true.
+ //------------------------------------------------------------------
+ llvm::StringRef GetArgStringWithDelimiter() const {
+ assert(m_has_args);
+ return m_arg_string_with_delimiter;
+ }
+
+ //------------------------------------------------------------------
+ /// Returns the part of the input string that was used for parsing the
+ /// argument list.
///
- /// @return
- /// true if the specified env var name exists in the list in
- /// either of the above-mentioned formats; otherwise, false.
+ /// You can only call this method if HasArgs returns true.
//------------------------------------------------------------------
- bool ContainsEnvironmentVariable(llvm::StringRef env_var_name,
- size_t *argument_index = nullptr) const;
+ llvm::StringRef GetArgString() const {
+ assert(m_has_args);
+ return m_arg_string;
+ }
+
+ //------------------------------------------------------------------
+ /// Returns the raw suffix part of the parsed string.
+ //------------------------------------------------------------------
+ const std::string &GetRawPart() const { return m_suffix; }
private:
- size_t FindArgumentIndexForOption(Option *long_options,
- int long_options_index) const;
+ void SetFromString(llvm::StringRef arg_string);
- std::vector<ArgEntry> m_entries;
- std::vector<char *> m_argv;
+ /// Keeps track if we have parsed and stored any arguments.
+ bool m_has_args = false;
+ Args m_args;
+ llvm::StringRef m_arg_string;
+ llvm::StringRef m_arg_string_with_delimiter;
- void UpdateArgsAfterOptionParsing();
+ // FIXME: This should be a StringRef, but some of the calling code expect a
+ // C string here so only a real std::string is possible.
+ std::string m_suffix;
};
} // namespace lldb_private
-#endif // liblldb_Command_h_
+#endif // LLDB_UTILITY_ARGS_H
diff --git a/include/lldb/Utility/Baton.h b/include/lldb/Utility/Baton.h
index 065f2960962d..59999e4697fa 100644
--- a/include/lldb/Utility/Baton.h
+++ b/include/lldb/Utility/Baton.h
@@ -23,15 +23,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Baton Baton.h "lldb/Core/Baton.h"
-/// @brief A class designed to wrap callback batons so they can cleanup
+/// A class designed to wrap callback batons so they can cleanup
/// any acquired resources
///
-/// This class is designed to be used by any objects that have a
-/// callback function that takes a baton where the baton might need to
+/// This class is designed to be used by any objects that have a callback
+/// function that takes a baton where the baton might need to
/// free/delete/close itself.
///
-/// The default behavior is to not free anything. Subclasses can
-/// free any needed resources in their destructors.
+/// The default behavior is to not free anything. Subclasses can free any
+/// needed resources in their destructors.
//----------------------------------------------------------------------
class Baton {
public:
diff --git a/include/lldb/Utility/CleanUp.h b/include/lldb/Utility/CleanUp.h
index 0d7bc8d99219..ef460ddd5e7f 100644
--- a/include/lldb/Utility/CleanUp.h
+++ b/include/lldb/Utility/CleanUp.h
@@ -13,249 +13,31 @@
#include "lldb/lldb-public.h"
#include <functional>
-namespace lldb_utility {
+namespace lldb_private {
-//----------------------------------------------------------------------
-// Templated class that guarantees that a cleanup callback function will
-// be called. The cleanup function will be called once under the
-// following conditions:
-// - when the object goes out of scope
-// - when the user explicitly calls clean.
-// - the current value will be cleaned up when a new value is set using
-// set(T value) as long as the current value hasn't already been cleaned.
-//
-// This class is designed to be used with simple types for type T (like
-// file descriptors, opaque handles, pointers, etc). If more complex
-// type T objects are desired, we need to probably specialize this class
-// to take "const T&" for all input T parameters. Yet if a type T is
-// complex already it might be better to build the cleanup functionality
-// into T.
-//
-// The cleanup function must take one argument that is of type T.
-// The calback function return type is R. The return value is currently
-// needed for "CallbackType". If there is an easy way to get around the
-// need for the return value we can change this class.
-//
-// The two template parameters are:
-// T - The variable type of value that will be stored and used as the
-// sole argument for the cleanup callback.
-// R - The return type for the cleanup function.
-//
-// EXAMPLES
-// // Use with file handles that get opened where you want to close
-// // them. Below we use "int open(const char *path, int oflag, ...)"
-// // which returns an integer file descriptor. -1 is the invalid file
-// // descriptor so to make an object that will call "int close(int fd)"
-// // automatically we can use:
-//
-// CleanUp <int, int> fd(open("/tmp/a.txt", O_RDONLY, 0), -1, close);
-//
-// // malloc/free example
-// CleanUp <void *, void> malloced_bytes(malloc(32), NULL, free);
-//----------------------------------------------------------------------
-template <typename T, typename R = void> class CleanUp {
-public:
- typedef T value_type;
- typedef std::function<R(value_type)> CallbackType;
-
- //----------------------------------------------------------------------
- // Constructor that sets the current value only. No values are
- // considered to be invalid and the cleanup function will be called
- // regardless of the value of m_current_value.
- //----------------------------------------------------------------------
- CleanUp(value_type value, CallbackType callback)
- : m_current_value(value), m_invalid_value(), m_callback(callback),
- m_callback_called(false), m_invalid_value_is_valid(false) {}
-
- //----------------------------------------------------------------------
- // Constructor that sets the current value and also the invalid value.
- // The cleanup function will be called on "m_value" as long as it isn't
- // equal to "m_invalid_value".
- //----------------------------------------------------------------------
- CleanUp(value_type value, value_type invalid, CallbackType callback)
- : m_current_value(value), m_invalid_value(invalid), m_callback(callback),
- m_callback_called(false), m_invalid_value_is_valid(true) {}
-
- //----------------------------------------------------------------------
- // Automatically cleanup when this object goes out of scope.
- //----------------------------------------------------------------------
- ~CleanUp() { clean(); }
-
- //----------------------------------------------------------------------
- // Access the value stored in this class
- //----------------------------------------------------------------------
- value_type get() { return m_current_value; }
-
- //----------------------------------------------------------------------
- // Access the value stored in this class
- //----------------------------------------------------------------------
- const value_type get() const { return m_current_value; }
-
- //----------------------------------------------------------------------
- // Reset the owned value to "value". If a current value is valid and
- // the cleanup callback hasn't been called, the previous value will
- // be cleaned up (see void CleanUp::clean()).
- //----------------------------------------------------------------------
- void set(const value_type value) {
- // Cleanup the current value if needed
- clean();
- // Now set the new value and mark our callback as not called
- m_callback_called = false;
- m_current_value = value;
- }
-
- //----------------------------------------------------------------------
- // Checks is "m_current_value" is valid. The value is considered valid
- // no invalid value was supplied during construction of this object or
- // if an invalid value was supplied and "m_current_value" is not equal
- // to "m_invalid_value".
- //
- // Returns true if "m_current_value" is valid, false otherwise.
- //----------------------------------------------------------------------
- bool is_valid() const {
- if (m_invalid_value_is_valid)
- return m_current_value != m_invalid_value;
- return true;
- }
-
- //----------------------------------------------------------------------
- // This function will call the cleanup callback provided in the
- // constructor one time if the value is considered valid (See is_valid()).
- // This function sets m_callback_called to true so we don't call the
- // cleanup callback multiple times on the same value.
- //----------------------------------------------------------------------
- void clean() {
- if (m_callback && !m_callback_called) {
- m_callback_called = true;
- if (is_valid())
- m_callback(m_current_value);
- }
- }
+/// Run a cleanup function on scope exit unless it's explicitly disabled.
+class CleanUp {
+ std::function<void()> Clean;
- //----------------------------------------------------------------------
- // Cancels the cleanup that would have been called on "m_current_value"
- // if it was valid. This function can be used to release the value
- // contained in this object so ownership can be transferred to the caller.
- //----------------------------------------------------------------------
- value_type release() {
- m_callback_called = true;
- return m_current_value;
- }
-
-private:
- value_type m_current_value;
- const value_type m_invalid_value;
- CallbackType m_callback;
- bool m_callback_called;
- bool m_invalid_value_is_valid;
-
- // Outlaw default constructor, copy constructor and the assignment operator
- DISALLOW_COPY_AND_ASSIGN(CleanUp);
-};
-
-template <typename T, typename R, typename A0> class CleanUp2 {
public:
- typedef T value_type;
- typedef std::function<R(value_type, A0)> CallbackType;
-
- //----------------------------------------------------------------------
- // Constructor that sets the current value only. No values are
- // considered to be invalid and the cleanup function will be called
- // regardless of the value of m_current_value.
- //----------------------------------------------------------------------
- CleanUp2(value_type value, CallbackType callback, A0 arg)
- : m_current_value(value), m_invalid_value(), m_callback(callback),
- m_callback_called(false), m_invalid_value_is_valid(false),
- m_argument(arg) {}
-
- //----------------------------------------------------------------------
- // Constructor that sets the current value and also the invalid value.
- // The cleanup function will be called on "m_value" as long as it isn't
- // equal to "m_invalid_value".
- //----------------------------------------------------------------------
- CleanUp2(value_type value, value_type invalid, CallbackType callback, A0 arg)
- : m_current_value(value), m_invalid_value(invalid), m_callback(callback),
- m_callback_called(false), m_invalid_value_is_valid(true),
- m_argument(arg) {}
-
- //----------------------------------------------------------------------
- // Automatically cleanup when this object goes out of scope.
- //----------------------------------------------------------------------
- ~CleanUp2() { clean(); }
+ /// Register a cleanup function which applies \p Func to a list of arguments.
+ /// Use caution with arguments which are references: they will be copied.
+ template <typename F, typename... Args>
+ CleanUp(F &&Func, Args &&... args)
+ : Clean(std::bind(std::forward<F>(Func), std::forward<Args>(args)...)) {}
- //----------------------------------------------------------------------
- // Access the value stored in this class
- //----------------------------------------------------------------------
- value_type get() { return m_current_value; }
-
- //----------------------------------------------------------------------
- // Access the value stored in this class
- //----------------------------------------------------------------------
- const value_type get() const { return m_current_value; }
-
- //----------------------------------------------------------------------
- // Reset the owned value to "value". If a current value is valid and
- // the cleanup callback hasn't been called, the previous value will
- // be cleaned up (see void CleanUp::clean()).
- //----------------------------------------------------------------------
- void set(const value_type value) {
- // Cleanup the current value if needed
- clean();
- // Now set the new value and mark our callback as not called
- m_callback_called = false;
- m_current_value = value;
+ ~CleanUp() {
+ if (Clean)
+ Clean();
}
- //----------------------------------------------------------------------
- // Checks is "m_current_value" is valid. The value is considered valid
- // no invalid value was supplied during construction of this object or
- // if an invalid value was supplied and "m_current_value" is not equal
- // to "m_invalid_value".
- //
- // Returns true if "m_current_value" is valid, false otherwise.
- //----------------------------------------------------------------------
- bool is_valid() const {
- if (m_invalid_value_is_valid)
- return m_current_value != m_invalid_value;
- return true;
- }
-
- //----------------------------------------------------------------------
- // This function will call the cleanup callback provided in the
- // constructor one time if the value is considered valid (See is_valid()).
- // This function sets m_callback_called to true so we don't call the
- // cleanup callback multiple times on the same value.
- //----------------------------------------------------------------------
- void clean() {
- if (m_callback && !m_callback_called) {
- m_callback_called = true;
- if (is_valid())
- m_callback(m_current_value, m_argument);
- }
- }
+ /// Disable the cleanup.
+ void disable() { Clean = nullptr; }
- //----------------------------------------------------------------------
- // Cancels the cleanup that would have been called on "m_current_value"
- // if it was valid. This function can be used to release the value
- // contained in this object so ownership can be transferred to the caller.
- //----------------------------------------------------------------------
- value_type release() {
- m_callback_called = true;
- return m_current_value;
- }
-
-private:
- value_type m_current_value;
- const value_type m_invalid_value;
- CallbackType m_callback;
- bool m_callback_called;
- bool m_invalid_value_is_valid;
- A0 m_argument;
-
- // Outlaw default constructor, copy constructor and the assignment operator
- DISALLOW_COPY_AND_ASSIGN(CleanUp2);
+ // Prevent cleanups from being run more than once.
+ DISALLOW_COPY_AND_ASSIGN(CleanUp);
};
-} // namespace lldb_utility
+} // namespace lldb_private
#endif // #ifndef liblldb_CleanUp_h_
diff --git a/include/lldb/Utility/CompletionRequest.h b/include/lldb/Utility/CompletionRequest.h
new file mode 100644
index 000000000000..cfae16f00b37
--- /dev/null
+++ b/include/lldb/Utility/CompletionRequest.h
@@ -0,0 +1,120 @@
+//===-- CompletionRequest.h -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_UTILITY_COMPLETIONREQUEST_H
+#define LLDB_UTILITY_COMPLETIONREQUEST_H
+
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/StringList.h"
+#include "llvm/ADT/StringRef.h"
+
+namespace lldb_private {
+
+//----------------------------------------------------------------------
+/// @class CompletionRequest CompletionRequest.h
+/// "lldb/Utility/ArgCompletionRequest.h"
+///
+/// Contains all information necessary to complete an incomplete command
+/// for the user. Will be filled with the generated completions by the different
+/// completions functions.
+///
+//----------------------------------------------------------------------
+class CompletionRequest {
+public:
+ //----------------------------------------------------------
+ /// Constructs a completion request.
+ ///
+ /// @param [in] command_line
+ /// The command line the user has typed at this point.
+ ///
+ /// @param [in] raw_cursor_pos
+ /// The position of the cursor in the command line string. Index 0 means
+ /// the cursor is at the start of the line. The completion starts from
+ /// this cursor position.
+ ///
+ /// @param [in] match_start_point
+ /// @param [in] max_return_elements
+ /// If there is a match that is expensive to compute, these are here to
+ /// allow you to compute the completions in batches. Start the
+ /// completion from match_start_point, and return match_return_elements
+ /// elements.
+ ///
+ /// @param [out] matches
+ /// A list of matches that will be filled by the different completion
+ /// handlers.
+ //----------------------------------------------------------
+ CompletionRequest(llvm::StringRef command_line, unsigned raw_cursor_pos,
+ int match_start_point, int max_return_elements,
+ StringList &matches);
+
+ llvm::StringRef GetRawLine() const { return m_command; }
+
+ unsigned GetRawCursorPos() const { return m_raw_cursor_pos; }
+
+ const Args &GetParsedLine() const { return m_parsed_line; }
+
+ Args &GetParsedLine() { return m_parsed_line; }
+
+ const Args &GetPartialParsedLine() const { return m_partial_parsed_line; }
+
+ void SetCursorIndex(int i) { m_cursor_index = i; }
+ int GetCursorIndex() const { return m_cursor_index; }
+
+ void SetCursorCharPosition(int pos) { m_cursor_char_position = pos; }
+ int GetCursorCharPosition() const { return m_cursor_char_position; }
+
+ int GetMatchStartPoint() const { return m_match_start_point; }
+
+ int GetMaxReturnElements() const { return m_max_return_elements; }
+
+ bool GetWordComplete() { return m_word_complete; }
+
+ void SetWordComplete(bool v) { m_word_complete = v; }
+
+ /// The array of matches returned.
+ StringList &GetMatches() { return *m_matches; }
+
+ llvm::StringRef GetCursorArgument() const {
+ return GetParsedLine().GetArgumentAtIndex(GetCursorIndex());
+ }
+
+ llvm::StringRef GetCursorArgumentPrefix() const {
+ return GetCursorArgument().substr(0, GetCursorCharPosition());
+ }
+
+private:
+ /// The raw command line we are supposed to complete.
+ llvm::StringRef m_command;
+ /// The cursor position in m_command.
+ unsigned m_raw_cursor_pos;
+ /// The command line parsed as arguments.
+ Args m_parsed_line;
+ /// The command line until the cursor position parsed as arguments.
+ Args m_partial_parsed_line;
+ /// The index of the argument in which the completion cursor is.
+ int m_cursor_index;
+ /// The cursor position in the argument indexed by m_cursor_index.
+ int m_cursor_char_position;
+ /// If there is a match that is expensive
+ /// to compute, these are here to allow you to compute the completions in
+ /// batches. Start the completion from \amatch_start_point, and return
+ /// \amatch_return_elements elements.
+ // FIXME: These two values are not implemented.
+ int m_match_start_point;
+ int m_max_return_elements;
+ /// \btrue if this is a complete option value (a space will be inserted
+ /// after the completion.) \bfalse otherwise.
+ bool m_word_complete = false;
+ // We don't own the list.
+ StringList *m_matches;
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_UTILITY_COMPLETIONREQUEST_H
diff --git a/include/lldb/Utility/Connection.h b/include/lldb/Utility/Connection.h
index be5641d5fa63..1b0801378f84 100644
--- a/include/lldb/Utility/Connection.h
+++ b/include/lldb/Utility/Connection.h
@@ -32,16 +32,16 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Connection Connection.h "lldb/Utility/Connection.h"
-/// @brief A communication connection class.
+/// A communication connection class.
///
/// A class that implements that actual communication functions for
-/// connecting/disconnecting, reading/writing, and waiting for bytes
-/// to become available from a two way communication connection.
+/// connecting/disconnecting, reading/writing, and waiting for bytes to become
+/// available from a two way communication connection.
///
-/// This class is designed to only do very simple communication
-/// functions. Instances can be instantiated and given to a
-/// Communication class to perform communications where clients can
-/// listen for broadcasts, and perform other higher level communications.
+/// This class is designed to only do very simple communication functions.
+/// Instances can be instantiated and given to a Communication class to
+/// perform communications where clients can listen for broadcasts, and
+/// perform other higher level communications.
//----------------------------------------------------------------------
class Connection {
public:
@@ -51,8 +51,8 @@ public:
Connection() = default;
//------------------------------------------------------------------
- /// Virtual destructor since this class gets subclassed and handed
- /// to a Communication object.
+ /// Virtual destructor since this class gets subclassed and handed to a
+ /// Communication object.
//------------------------------------------------------------------
virtual ~Connection();
@@ -79,8 +79,7 @@ public:
Status *error_ptr) = 0;
//------------------------------------------------------------------
- /// Disconnect the communications connection if one is currently
- /// connected.
+ /// Disconnect the communications connection if one is currently connected.
///
/// @param[out] error_ptr
/// A pointer to an error object that should be given an
@@ -138,8 +137,8 @@ public:
lldb::ConnectionStatus &status, Status *error_ptr) = 0;
//------------------------------------------------------------------
- /// The actual write function that attempts to write to the
- /// communications protocol.
+ /// The actual write function that attempts to write to the communications
+ /// protocol.
///
/// Subclasses must override this function.
///
@@ -190,10 +189,9 @@ public:
//------------------------------------------------------------------
/// Returns the underlying IOObject used by the Connection.
///
- /// The IOObject can be used to wait for data to become available
- /// on the connection. If the Connection does not use IOObjects (and
- /// hence does not support waiting) this function should return a
- /// null pointer.
+ /// The IOObject can be used to wait for data to become available on the
+ /// connection. If the Connection does not use IOObjects (and hence does not
+ /// support waiting) this function should return a null pointer.
///
/// @return
/// The underlying IOObject used for reading.
diff --git a/include/lldb/Utility/ConstString.h b/include/lldb/Utility/ConstString.h
index fbf1a9bf536e..98b3447abe3e 100644
--- a/include/lldb/Utility/ConstString.h
+++ b/include/lldb/Utility/ConstString.h
@@ -26,17 +26,17 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ConstString ConstString.h "lldb/Utility/ConstString.h"
-/// @brief A uniqued constant string class.
+/// A uniqued constant string class.
///
-/// Provides an efficient way to store strings as uniqued strings. After
-/// the strings are uniqued, finding strings that are equal to one
-/// another is very fast as just the pointers need to be compared. It
-/// also allows for many common strings from many different sources to
-/// be shared to keep the memory footprint low.
+/// Provides an efficient way to store strings as uniqued strings. After the
+/// strings are uniqued, finding strings that are equal to one another is very
+/// fast as just the pointers need to be compared. It also allows for many
+/// common strings from many different sources to be shared to keep the memory
+/// footprint low.
///
-/// No reference counting is done on strings that are added to the
-/// string pool, once strings are added they are in the string pool for
-/// the life of the program.
+/// No reference counting is done on strings that are added to the string
+/// pool, once strings are added they are in the string pool for the life of
+/// the program.
//----------------------------------------------------------------------
class ConstString {
public:
@@ -74,11 +74,10 @@ public:
//------------------------------------------------------------------
/// Construct with C String value with max length
///
- /// Constructs this object with a C string with a length. If
- /// \a max_cstr_len is greater than the actual length of the string,
- /// the string length will be truncated. This allows substrings to
- /// be created without the need to NULL terminate the string as it
- /// is passed into this function.
+ /// Constructs this object with a C string with a length. If \a max_cstr_len
+ /// is greater than the actual length of the string, the string length will
+ /// be truncated. This allows substrings to be created without the need to
+ /// NULL terminate the string as it is passed into this function.
///
/// @param[in] cstr
/// A pointer to the first character in the C string. The C
@@ -99,8 +98,8 @@ public:
//------------------------------------------------------------------
/// Destructor
///
- /// Since constant string values are currently not reference counted,
- /// there isn't much to do here.
+ /// Since constant string values are currently not reference counted, there
+ /// isn't much to do here.
//------------------------------------------------------------------
~ConstString() = default;
@@ -112,8 +111,8 @@ public:
//--------------------------------------------------------------
/// C equality test.
///
- /// Two C strings are equal when they are contained in ConstString
- /// objects when their pointer values are equal to each other.
+ /// Two C strings are equal when they are contained in ConstString objects
+ /// when their pointer values are equal to each other.
///
/// @return
/// Returns \b true if the C string in \a lhs is equal to
@@ -127,8 +126,8 @@ public:
//------------------------------------------------------------------
/// Convert to bool operator.
///
- /// This allows code to check a ConstString object to see if it
- /// contains a valid string using code such as:
+ /// This allows code to check a ConstString object to see if it contains a
+ /// valid string using code such as:
///
/// @code
/// ConstString str(...);
@@ -140,7 +139,7 @@ public:
/// /b True this object contains a valid non-empty C string, \b
/// false otherwise.
//------------------------------------------------------------------
- explicit operator bool() const { return m_string && m_string[0]; }
+ explicit operator bool() const { return !IsEmpty(); }
//------------------------------------------------------------------
/// Assignment operator
@@ -161,10 +160,9 @@ public:
//------------------------------------------------------------------
/// Equal to operator
///
- /// Returns true if this string is equal to the string in \a rhs.
- /// This operation is very fast as it results in a pointer
- /// comparison since all strings are in a uniqued in a global string
- /// pool.
+ /// Returns true if this string is equal to the string in \a rhs. This
+ /// operation is very fast as it results in a pointer comparison since all
+ /// strings are in a uniqued in a global string pool.
///
/// @param[in] rhs
/// Another string object to compare this object to.
@@ -174,18 +172,17 @@ public:
/// @li \b false if this object is not equal to \a rhs.
//------------------------------------------------------------------
bool operator==(const ConstString &rhs) const {
- // We can do a pointer compare to compare these strings since they
- // must come from the same pool in order to be equal.
+ // We can do a pointer compare to compare these strings since they must
+ // come from the same pool in order to be equal.
return m_string == rhs.m_string;
}
//------------------------------------------------------------------
/// Not equal to operator
///
- /// Returns true if this string is not equal to the string in \a rhs.
- /// This operation is very fast as it results in a pointer
- /// comparison since all strings are in a uniqued in a global string
- /// pool.
+ /// Returns true if this string is not equal to the string in \a rhs. This
+ /// operation is very fast as it results in a pointer comparison since all
+ /// strings are in a uniqued in a global string pool.
///
/// @param[in] rhs
/// Another string object to compare this object to.
@@ -203,8 +200,8 @@ public:
//------------------------------------------------------------------
/// Get the string value as a C string.
///
- /// Get the value of the contained string as a NULL terminated C
- /// string value.
+ /// Get the value of the contained string as a NULL terminated C string
+ /// value.
///
/// If \a value_if_empty is nullptr, then nullptr will be returned.
///
@@ -230,11 +227,10 @@ public:
//------------------------------------------------------------------
/// Get the string value as a C string.
///
- /// Get the value of the contained string as a NULL terminated C
- /// string value. Similar to the ConstString::AsCString() function,
- /// yet this function will always return nullptr if the string is not
- /// valid. So this function is a direct accessor to the string
- /// pointer value.
+ /// Get the value of the contained string as a NULL terminated C string
+ /// value. Similar to the ConstString::AsCString() function, yet this
+ /// function will always return nullptr if the string is not valid. So this
+ /// function is a direct accessor to the string pointer value.
///
/// @return
/// Returns nullptr the string is invalid, otherwise the C string
@@ -245,8 +241,8 @@ public:
//------------------------------------------------------------------
/// Get the length in bytes of string value.
///
- /// The string pool stores the length of the string, so we can avoid
- /// calling strlen() on the pointer value with this function.
+ /// The string pool stores the length of the string, so we can avoid calling
+ /// strlen() on the pointer value with this function.
///
/// @return
/// Returns the number of bytes that this string occupies in
@@ -257,18 +253,18 @@ public:
//------------------------------------------------------------------
/// Clear this object's state.
///
- /// Clear any contained string and reset the value to the an empty
- /// string value.
+ /// Clear any contained string and reset the value to the an empty string
+ /// value.
//------------------------------------------------------------------
void Clear() { m_string = nullptr; }
//------------------------------------------------------------------
/// Equal to operator
///
- /// Returns true if this string is equal to the string in \a rhs.
- /// If case sensitive equality is tested, this operation is very
- /// fast as it results in a pointer comparison since all strings
- /// are in a uniqued in a global string pool.
+ /// Returns true if this string is equal to the string in \a rhs. If case
+ /// sensitive equality is tested, this operation is very fast as it results
+ /// in a pointer comparison since all strings are in a uniqued in a global
+ /// string pool.
///
/// @param[in] rhs
/// The Left Hand Side const ConstString object reference.
@@ -290,13 +286,13 @@ public:
//------------------------------------------------------------------
/// Compare two string objects.
///
- /// Compares the C string values contained in \a lhs and \a rhs and
- /// returns an integer result.
+ /// Compares the C string values contained in \a lhs and \a rhs and returns
+ /// an integer result.
///
/// NOTE: only call this function when you want a true string
- /// comparison. If you want string equality use the, use the ==
- /// operator as it is much more efficient. Also if you want string
- /// inequality, use the != operator for the same reasons.
+ /// comparison. If you want string equality use the, use the == operator as
+ /// it is much more efficient. Also if you want string inequality, use the
+ /// != operator for the same reasons.
///
/// @param[in] lhs
/// The Left Hand Side const ConstString object reference.
@@ -319,10 +315,9 @@ public:
//------------------------------------------------------------------
/// Dump the object description to a stream.
///
- /// Dump the string value to the stream \a s. If the contained string
- /// is empty, print \a value_if_empty to the stream instead. If
- /// \a value_if_empty is nullptr, then nothing will be dumped to the
- /// stream.
+ /// Dump the string value to the stream \a s. If the contained string is
+ /// empty, print \a value_if_empty to the stream instead. If \a
+ /// value_if_empty is nullptr, then nothing will be dumped to the stream.
///
/// @param[in] s
/// The stream that will be used to dump the object description.
@@ -353,12 +348,12 @@ public:
//------------------------------------------------------------------
/// Set the C string value.
///
- /// Set the string value in the object by uniquing the \a cstr
- /// string value in our global string pool.
+ /// Set the string value in the object by uniquing the \a cstr string value
+ /// in our global string pool.
///
- /// If the C string already exists in the global string pool, it
- /// finds the current entry and returns the existing value. If it
- /// doesn't exist, it is added to the string pool.
+ /// If the C string already exists in the global string pool, it finds the
+ /// current entry and returns the existing value. If it doesn't exist, it is
+ /// added to the string pool.
///
/// @param[in] cstr
/// A NULL terminated C string to add to the string pool.
@@ -370,12 +365,12 @@ public:
//------------------------------------------------------------------
/// Set the C string value and its mangled counterpart.
///
- /// Object files and debug symbols often use mangled string to
- /// represent the linkage name for a symbol, function or global.
- /// The string pool can efficiently store these values and their
- /// counterparts so when we run into another instance of a mangled
- /// name, we can avoid calling the name demangler over and over on
- /// the same strings and then trying to unique them.
+ /// Object files and debug symbols often use mangled string to represent the
+ /// linkage name for a symbol, function or global. The string pool can
+ /// efficiently store these values and their counterparts so when we run
+ /// into another instance of a mangled name, we can avoid calling the name
+ /// demangler over and over on the same strings and then trying to unique
+ /// them.
///
/// @param[in] demangled
/// The demangled C string to correlate with the \a mangled
@@ -389,15 +384,15 @@ public:
const ConstString &mangled);
//------------------------------------------------------------------
- /// Retrieve the mangled or demangled counterpart for a mangled
- /// or demangled ConstString.
+ /// Retrieve the mangled or demangled counterpart for a mangled or demangled
+ /// ConstString.
///
- /// Object files and debug symbols often use mangled string to
- /// represent the linkage name for a symbol, function or global.
- /// The string pool can efficiently store these values and their
- /// counterparts so when we run into another instance of a mangled
- /// name, we can avoid calling the name demangler over and over on
- /// the same strings and then trying to unique them.
+ /// Object files and debug symbols often use mangled string to represent the
+ /// linkage name for a symbol, function or global. The string pool can
+ /// efficiently store these values and their counterparts so when we run
+ /// into another instance of a mangled name, we can avoid calling the name
+ /// demangler over and over on the same strings and then trying to unique
+ /// them.
///
/// @param[in] counterpart
/// A reference to a ConstString object that might get filled in
@@ -413,14 +408,13 @@ public:
/// Set the C string value with length.
///
/// Set the string value in the object by uniquing \a cstr_len bytes
- /// starting at the \a cstr string value in our global string pool.
- /// If trim is true, then \a cstr_len indicates a maximum length of
- /// the CString and if the actual length of the string is less, then
- /// it will be trimmed.
+ /// starting at the \a cstr string value in our global string pool. If trim
+ /// is true, then \a cstr_len indicates a maximum length of the CString and
+ /// if the actual length of the string is less, then it will be trimmed.
///
- /// If the C string already exists in the global string pool, it
- /// finds the current entry and returns the existing value. If it
- /// doesn't exist, it is added to the string pool.
+ /// If the C string already exists in the global string pool, it finds the
+ /// current entry and returns the existing value. If it doesn't exist, it is
+ /// added to the string pool.
///
/// @param[in] cstr
/// A NULL terminated C string to add to the string pool.
@@ -431,20 +425,19 @@ public:
void SetCStringWithLength(const char *cstr, size_t cstr_len);
//------------------------------------------------------------------
- /// Set the C string value with the minimum length between
- /// \a fixed_cstr_len and the actual length of the C string. This
- /// can be used for data structures that have a fixed length to
- /// store a C string where the string might not be NULL terminated
- /// if the string takes the entire buffer.
+ /// Set the C string value with the minimum length between \a fixed_cstr_len
+ /// and the actual length of the C string. This can be used for data
+ /// structures that have a fixed length to store a C string where the string
+ /// might not be NULL terminated if the string takes the entire buffer.
//------------------------------------------------------------------
void SetTrimmedCStringWithLength(const char *cstr, size_t fixed_cstr_len);
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, which does not include
- /// any the shared string values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, which does not include any the shared
+ /// string values it may refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -456,9 +449,8 @@ public:
//------------------------------------------------------------------
/// Get the size in bytes of the current global string pool.
///
- /// Reports the size in bytes of all shared C string values,
- /// containers and any other values as a byte size for the
- /// entire string pool.
+ /// Reports the size in bytes of all shared C string values, containers and
+ /// any other values as a byte size for the entire string pool.
///
/// @return
/// The number of bytes that the global string pool occupies
diff --git a/include/lldb/Utility/DataBuffer.h b/include/lldb/Utility/DataBuffer.h
index ffa71c06be80..05cb60920737 100644
--- a/include/lldb/Utility/DataBuffer.h
+++ b/include/lldb/Utility/DataBuffer.h
@@ -22,39 +22,36 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class DataBuffer DataBuffer.h "lldb/Core/DataBuffer.h"
-/// @brief A pure virtual protocol class for abstracted data buffers.
+/// A pure virtual protocol class for abstracted data buffers.
///
/// DataBuffer is an abstract class that gets packaged into a shared pointer
-/// that can use to implement various ways to store data (on the heap,
-/// memory mapped, cached inferior memory). It gets used by DataExtractor
-/// so many DataExtractor objects can share the same data and sub-ranges
-/// of that shared data, and the last object that contains a reference
-/// to the shared data will free it.
+/// that can use to implement various ways to store data (on the heap, memory
+/// mapped, cached inferior memory). It gets used by DataExtractor so many
+/// DataExtractor objects can share the same data and sub-ranges of that
+/// shared data, and the last object that contains a reference to the shared
+/// data will free it.
///
/// Subclasses can implement as many different constructors or member
-/// functions that allow data to be stored in the object's buffer prior
-/// to handing the shared data to clients that use these buffers.
+/// functions that allow data to be stored in the object's buffer prior to
+/// handing the shared data to clients that use these buffers.
///
-/// All subclasses must override all of the pure virtual functions as
-/// they are used by clients to access the data. Having a common
-/// interface allows different ways of storing data, yet using it in
-/// one common way.
+/// All subclasses must override all of the pure virtual functions as they are
+/// used by clients to access the data. Having a common interface allows
+/// different ways of storing data, yet using it in one common way.
///
-/// This class currently expects all data to be available without any
-/// extra calls being made, but we can modify it to optionally get
-/// data on demand with some extra function calls to load the data
-/// before it gets accessed.
+/// This class currently expects all data to be available without any extra
+/// calls being made, but we can modify it to optionally get data on demand
+/// with some extra function calls to load the data before it gets accessed.
//----------------------------------------------------------------------
class DataBuffer {
public:
//------------------------------------------------------------------
/// Destructor
///
- /// The destructor is virtual as other classes will inherit from
- /// this class and be downcast to the DataBuffer pure virtual
- /// interface. The virtual destructor ensures that destructing the
- /// base class will destruct the class that inherited from it
- /// correctly.
+ /// The destructor is virtual as other classes will inherit from this class
+ /// and be downcast to the DataBuffer pure virtual interface. The virtual
+ /// destructor ensures that destructing the base class will destruct the
+ /// class that inherited from it correctly.
//------------------------------------------------------------------
virtual ~DataBuffer() {}
diff --git a/include/lldb/Utility/DataBufferHeap.h b/include/lldb/Utility/DataBufferHeap.h
index 20e27ef8950c..d64e5b7563a9 100644
--- a/include/lldb/Utility/DataBufferHeap.h
+++ b/include/lldb/Utility/DataBufferHeap.h
@@ -21,14 +21,14 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class DataBufferHeap DataBufferHeap.h "lldb/Core/DataBufferHeap.h"
-/// @brief A subclass of DataBuffer that stores a data buffer on the heap.
+/// A subclass of DataBuffer that stores a data buffer on the heap.
///
-/// This class keeps its data in a heap based buffer that is owned by
-/// the object. This class is best used to store chunks of data that
-/// are created or read from sources that can't intelligently and lazily
-/// fault new data pages in. Large amounts of data that comes from files
-/// should probably use DataBufferLLVM, which can intelligently determine
-/// when memory mapping is optimal.
+/// This class keeps its data in a heap based buffer that is owned by the
+/// object. This class is best used to store chunks of data that are created
+/// or read from sources that can't intelligently and lazily fault new data
+/// pages in. Large amounts of data that comes from files should probably use
+/// DataBufferLLVM, which can intelligently determine when memory mapping is
+/// optimal.
//----------------------------------------------------------------------
class DataBufferHeap : public DataBuffer {
public:
@@ -42,8 +42,7 @@ public:
//------------------------------------------------------------------
/// Construct with size \a n and fill with \a ch.
///
- /// Initialize this class with \a n bytes and fills the buffer with
- /// \a ch.
+ /// Initialize this class with \a n bytes and fills the buffer with \a ch.
///
/// @param[in] n
/// The number of bytes that heap based buffer should contain.
@@ -67,8 +66,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// Virtual destructor since this class inherits from a pure virtual
- /// base class #DataBuffer.
+ /// Virtual destructor since this class inherits from a pure virtual base
+ /// class #DataBuffer.
//------------------------------------------------------------------
~DataBufferHeap() override;
@@ -90,8 +89,8 @@ public:
//------------------------------------------------------------------
/// Set the number of bytes in the data buffer.
///
- /// Sets the number of bytes that this object should be able to
- /// contain. This can be used prior to copying data into the buffer.
+ /// Sets the number of bytes that this object should be able to contain.
+ /// This can be used prior to copying data into the buffer.
///
/// @param[in] byte_size
/// The new size in bytes that this data buffer should attempt
@@ -123,8 +122,8 @@ public:
private:
//------------------------------------------------------------------
- // This object uses a std::vector<uint8_t> to store its data. This
- // takes care of free the data when the object is deleted.
+ // This object uses a std::vector<uint8_t> to store its data. This takes care
+ // of free the data when the object is deleted.
//------------------------------------------------------------------
typedef std::vector<uint8_t> buffer_t; ///< Buffer type
buffer_t m_data; ///< The heap based buffer where data is stored
diff --git a/include/lldb/Utility/DataBufferLLVM.h b/include/lldb/Utility/DataBufferLLVM.h
index 0eb229cffbe2..d76582cbf47c 100644
--- a/include/lldb/Utility/DataBufferLLVM.h
+++ b/include/lldb/Utility/DataBufferLLVM.h
@@ -40,8 +40,8 @@ public:
char *GetChars() { return reinterpret_cast<char *>(GetBytes()); }
private:
- /// \brief Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a
- /// valid pointer.
+ /// Construct a DataBufferLLVM from \p Buffer. \p Buffer must be a valid
+ /// pointer.
explicit DataBufferLLVM(std::unique_ptr<llvm::WritableMemoryBuffer> Buffer);
std::unique_ptr<llvm::WritableMemoryBuffer> Buffer;
diff --git a/include/lldb/Utility/DataEncoder.h b/include/lldb/Utility/DataEncoder.h
index ea347d86237b..c1214705c726 100644
--- a/include/lldb/Utility/DataEncoder.h
+++ b/include/lldb/Utility/DataEncoder.h
@@ -23,13 +23,12 @@
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class DataEncoder DataEncoder.h "lldb/Core/DataEncoder.h"
-/// @brief An binary data encoding class.
+/// @class DataEncoder DataEncoder.h "lldb/Core/DataEncoder.h" An binary data
+/// encoding class.
///
-/// DataEncoder is a class that can encode binary data (swapping if needed)
-/// to a data buffer. The data buffer can be caller owned, or can be
-/// shared data that can be shared between multiple DataEncoder or
-/// DataEncoder instances.
+/// DataEncoder is a class that can encode binary data (swapping if needed) to
+/// a data buffer. The data buffer can be caller owned, or can be shared data
+/// that can be shared between multiple DataEncoder or DataEncoder instances.
///
/// @see DataBuffer
//----------------------------------------------------------------------
@@ -45,9 +44,8 @@ public:
//------------------------------------------------------------------
/// Construct with a buffer that is owned by the caller.
///
- /// This constructor allows us to use data that is owned by the
- /// caller. The data must stay around as long as this object is
- /// valid.
+ /// This constructor allows us to use data that is owned by the caller. The
+ /// data must stay around as long as this object is valid.
///
/// @param[in] data
/// A pointer to caller owned data.
@@ -67,10 +65,10 @@ public:
//------------------------------------------------------------------
/// Construct with shared data.
///
- /// Copies the data shared pointer which adds a reference to the
- /// contained in \a data_sp. The shared data reference is reference
- /// counted to ensure the data lives as long as anyone still has a
- /// valid shared pointer to the data in \a data_sp.
+ /// Copies the data shared pointer which adds a reference to the contained
+ /// in \a data_sp. The shared data reference is reference counted to ensure
+ /// the data lives as long as anyone still has a valid shared pointer to the
+ /// data in \a data_sp.
///
/// @param[in] data_sp
/// A shared pointer to data.
@@ -87,26 +85,24 @@ public:
//------------------------------------------------------------------
/// Destructor
///
- /// If this object contains a valid shared data reference, the
- /// reference count on the data will be decremented, and if zero,
- /// the data will be freed.
+ /// If this object contains a valid shared data reference, the reference
+ /// count on the data will be decremented, and if zero, the data will be
+ /// freed.
//------------------------------------------------------------------
~DataEncoder();
//------------------------------------------------------------------
/// Clears the object state.
///
- /// Clears the object contents back to a default invalid state, and
- /// release any references to shared data that this object may
- /// contain.
+ /// Clears the object contents back to a default invalid state, and release
+ /// any references to shared data that this object may contain.
//------------------------------------------------------------------
void Clear();
//------------------------------------------------------------------
/// Get the current address size.
///
- /// Return the size in bytes of any address values this object will
- /// extract.
+ /// Return the size in bytes of any address values this object will extract.
///
/// @return
/// The size in bytes of address values that will be extracted.
@@ -135,8 +131,7 @@ public:
//------------------------------------------------------------------
/// Get the shared data offset.
///
- /// Get the offset of the first byte of data in the shared data (if
- /// any).
+ /// Get the offset of the first byte of data in the shared data (if any).
///
/// @return
/// If this object contains shared data, this function returns
@@ -189,11 +184,10 @@ public:
//------------------------------------------------------------------
/// Encode an unsigned integer of size \a byte_size to \a offset.
///
- /// Encode a single integer value at \a offset and return the offset
- /// that follows the newly encoded integer when the data is successfully
- /// encoded into the existing data. There must be enough room in the
- /// data, else UINT32_MAX will be returned to indicate that encoding
- /// failed.
+ /// Encode a single integer value at \a offset and return the offset that
+ /// follows the newly encoded integer when the data is successfully encoded
+ /// into the existing data. There must be enough room in the data, else
+ /// UINT32_MAX will be returned to indicate that encoding failed.
///
/// @param[in] offset
/// The offset within the contained data at which to put the
@@ -233,15 +227,14 @@ public:
uint32_t PutData(uint32_t offset, const void *src, uint32_t src_len);
//------------------------------------------------------------------
- /// Encode an address in the existing buffer at \a offset bytes into
- /// the buffer.
+ /// Encode an address in the existing buffer at \a offset bytes into the
+ /// buffer.
///
- /// Encode a single address (honoring the m_addr_size member) to
- /// the data and return the next offset where subsequent data would
- /// go.
- /// pointed to by \a offset_ptr. The size of the extracted address
- /// comes from the \a m_addr_size member variable and should be
- /// set correctly prior to extracting any address values.
+ /// Encode a single address (honoring the m_addr_size member) to the data
+ /// and return the next offset where subsequent data would go. pointed to by
+ /// \a offset_ptr. The size of the extracted address comes from the \a
+ /// m_addr_size member variable and should be set correctly prior to
+ /// extracting any address values.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -259,8 +252,7 @@ public:
//------------------------------------------------------------------
/// Put a C string to \a offset.
///
- /// Encodes a C string into the existing data including the
- /// terminating
+ /// Encodes a C string into the existing data including the terminating
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -282,8 +274,8 @@ public:
//------------------------------------------------------------------
/// Set the address byte size.
///
- /// Set the size in bytes that will be used when extracting any
- /// address and pointer values from data contained in this object.
+ /// Set the size in bytes that will be used when extracting any address and
+ /// pointer values from data contained in this object.
///
/// @param[in] addr_size
/// The size in bytes to use when extracting addresses.
@@ -293,11 +285,10 @@ public:
//------------------------------------------------------------------
/// Set data with a buffer that is caller owned.
///
- /// Use data that is owned by the caller when extracting values.
- /// The data must stay around as long as this object, or any object
- /// that copies a subset of this object's data, is valid. If \a
- /// bytes is NULL, or \a length is zero, this object will contain
- /// no data.
+ /// Use data that is owned by the caller when extracting values. The data
+ /// must stay around as long as this object, or any object that copies a
+ /// subset of this object's data, is valid. If \a bytes is NULL, or \a
+ /// length is zero, this object will contain no data.
///
/// @param[in] bytes
/// A pointer to caller owned data.
@@ -316,15 +307,14 @@ public:
//------------------------------------------------------------------
/// Adopt a subset of shared data in \a data_sp.
///
- /// Copies the data shared pointer which adds a reference to the
- /// contained in \a data_sp. The shared data reference is reference
- /// counted to ensure the data lives as long as anyone still has a
- /// valid shared pointer to the data in \a data_sp. The byte order
- /// and address byte size settings remain the same. If
- /// \a offset is not a valid offset in \a data_sp, then no reference
- /// to the shared data will be added. If there are not \a length
- /// bytes available in \a data starting at \a offset, the length
- /// will be truncated to contains as many bytes as possible.
+ /// Copies the data shared pointer which adds a reference to the contained
+ /// in \a data_sp. The shared data reference is reference counted to ensure
+ /// the data lives as long as anyone still has a valid shared pointer to the
+ /// data in \a data_sp. The byte order and address byte size settings remain
+ /// the same. If \a offset is not a valid offset in \a data_sp, then no
+ /// reference to the shared data will be added. If there are not \a length
+ /// bytes available in \a data starting at \a offset, the length will be
+ /// truncated to contains as many bytes as possible.
///
/// @param[in] data_sp
/// A shared pointer to data.
@@ -344,8 +334,8 @@ public:
//------------------------------------------------------------------
/// Set the byte_order value.
///
- /// Sets the byte order of the data to extract. Extracted values
- /// will be swapped if necessary when decoding.
+ /// Sets the byte order of the data to extract. Extracted values will be
+ /// swapped if necessary when decoding.
///
/// @param[in] byte_order
/// The byte order value to use when extracting data.
diff --git a/include/lldb/Utility/DataExtractor.h b/include/lldb/Utility/DataExtractor.h
index 8107a3554422..50c88db8e358 100644
--- a/include/lldb/Utility/DataExtractor.h
+++ b/include/lldb/Utility/DataExtractor.h
@@ -34,16 +34,16 @@ template <typename T> class SmallVectorImpl;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h"
-/// @brief An data extractor class.
+/// @class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h" An data
+/// extractor class.
///
-/// DataExtractor is a class that can extract data (swapping if needed)
-/// from a data buffer. The data buffer can be caller owned, or can be
-/// shared data that can be shared between multiple DataExtractor
-/// instances. Multiple DataExtractor objects can share the same data,
-/// yet extract values in different address sizes and byte order modes.
-/// Each object can have a unique position in the shared data and extract
-/// data from different offsets.
+/// DataExtractor is a class that can extract data (swapping if needed) from a
+/// data buffer. The data buffer can be caller owned, or can be shared data
+/// that can be shared between multiple DataExtractor instances. Multiple
+/// DataExtractor objects can share the same data, yet extract values in
+/// different address sizes and byte order modes. Each object can have a
+/// unique position in the shared data and extract data from different
+/// offsets.
///
/// @see DataBuffer
//----------------------------------------------------------------------
@@ -51,7 +51,7 @@ class DataExtractor {
public:
//------------------------------------------------------------------
/// @typedef DataExtractor::Type
- /// @brief Type enumerations used in the dump routines.
+ /// Type enumerations used in the dump routines.
//------------------------------------------------------------------
typedef enum {
TypeUInt8, ///< Format output as unsigned 8 bit integers
@@ -74,9 +74,8 @@ public:
//------------------------------------------------------------------
/// Construct with a buffer that is owned by the caller.
///
- /// This constructor allows us to use data that is owned by the
- /// caller. The data must stay around as long as this object is
- /// valid.
+ /// This constructor allows us to use data that is owned by the caller. The
+ /// data must stay around as long as this object is valid.
///
/// @param[in] data
/// A pointer to caller owned data.
@@ -100,10 +99,10 @@ public:
//------------------------------------------------------------------
/// Construct with shared data.
///
- /// Copies the data shared pointer which adds a reference to the
- /// contained in \a data_sp. The shared data reference is reference
- /// counted to ensure the data lives as long as anyone still has a
- /// valid shared pointer to the data in \a data_sp.
+ /// Copies the data shared pointer which adds a reference to the contained
+ /// in \a data_sp. The shared data reference is reference counted to ensure
+ /// the data lives as long as anyone still has a valid shared pointer to the
+ /// data in \a data_sp.
///
/// @param[in] data_sp
/// A shared pointer to data.
@@ -123,16 +122,14 @@ public:
//------------------------------------------------------------------
/// Construct with a subset of \a data.
///
- /// Initialize this object with a subset of the data bytes in \a
- /// data. If \a data contains shared data, then a reference to the
- /// shared data will be added to ensure the shared data stays around
- /// as long as any objects have references to the shared data. The
- /// byte order value and the address size settings are copied from \a
- /// data. If \a offset is not a valid offset in \a data, then no
- /// reference to the shared data will be added. If there are not
- /// \a length bytes available in \a data starting at \a offset,
- /// the length will be truncated to contain as many bytes as
- /// possible.
+ /// Initialize this object with a subset of the data bytes in \a data. If \a
+ /// data contains shared data, then a reference to the shared data will be
+ /// added to ensure the shared data stays around as long as any objects have
+ /// references to the shared data. The byte order value and the address size
+ /// settings are copied from \a data. If \a offset is not a valid offset in
+ /// \a data, then no reference to the shared data will be added. If there
+ /// are not \a length bytes available in \a data starting at \a offset, the
+ /// length will be truncated to contain as many bytes as possible.
///
/// @param[in] data
/// Another DataExtractor object that contains data.
@@ -155,8 +152,8 @@ public:
/// Assignment operator.
///
/// Copies all data, byte order and address size settings from \a rhs into
- /// this object. If \a rhs contains shared data, a reference to that
- /// shared data will be added.
+ /// this object. If \a rhs contains shared data, a reference to that shared
+ /// data will be added.
///
/// @param[in] rhs
/// Another DataExtractor object to copy.
@@ -169,9 +166,9 @@ public:
//------------------------------------------------------------------
/// Destructor
///
- /// If this object contains a valid shared data reference, the
- /// reference count on the data will be decremented, and if zero,
- /// the data will be freed.
+ /// If this object contains a valid shared data reference, the reference
+ /// count on the data will be decremented, and if zero, the data will be
+ /// freed.
//------------------------------------------------------------------
virtual ~DataExtractor();
@@ -180,19 +177,17 @@ public:
//------------------------------------------------------------------
/// Clears the object state.
///
- /// Clears the object contents back to a default invalid state, and
- /// release any references to shared data that this object may
- /// contain.
+ /// Clears the object contents back to a default invalid state, and release
+ /// any references to shared data that this object may contain.
//------------------------------------------------------------------
void Clear();
//------------------------------------------------------------------
- /// Dumps the binary data as \a type objects to stream \a s (or to
- /// Log() if \a s is nullptr) starting \a offset bytes into the data
- /// and stopping after dumping \a length bytes. The offset into the
- /// data is displayed at the beginning of each line and can be
- /// offset by base address \a base_addr. \a num_per_line objects
- /// will be displayed on each line.
+ /// Dumps the binary data as \a type objects to stream \a s (or to Log() if
+ /// \a s is nullptr) starting \a offset bytes into the data and stopping
+ /// after dumping \a length bytes. The offset into the data is displayed at
+ /// the beginning of each line and can be offset by base address \a
+ /// base_addr. \a num_per_line objects will be displayed on each line.
///
/// @param[in] s
/// The stream to dump the output to. If nullptr the output will
@@ -228,29 +223,11 @@ public:
const char *type_format = nullptr) const;
//------------------------------------------------------------------
- /// Dump a UUID value at \a offset.
+ /// Extract an arbitrary number of bytes in the specified byte order.
///
- /// Dump a UUID starting at \a offset bytes into this object's data.
- /// If the stream \a s is nullptr, the output will be sent to Log().
- ///
- /// @param[in] s
- /// The stream to dump the output to. If nullptr the output will
- /// be dumped to Log().
- ///
- /// @param[in] offset
- /// The offset into the data at which to extract and dump a
- /// UUID value.
- //------------------------------------------------------------------
- void DumpUUID(Stream *s, lldb::offset_t offset) const;
-
- //------------------------------------------------------------------
- /// Extract an arbitrary number of bytes in the specified byte
- /// order.
- ///
- /// Attemps to extract \a length bytes starting at \a offset bytes
- /// into this data in the requested byte order (\a dst_byte_order)
- /// and place the results in \a dst. \a dst must be at least \a
- /// length bytes long.
+ /// Attemps to extract \a length bytes starting at \a offset bytes into this
+ /// data in the requested byte order (\a dst_byte_order) and place the
+ /// results in \a dst. \a dst must be at least \a length bytes long.
///
/// @param[in] offset
/// The offset in bytes into the contained data at which to
@@ -278,10 +255,10 @@ public:
//------------------------------------------------------------------
/// Extract an address from \a *offset_ptr.
///
- /// Extract a single address from the data and update the offset
- /// pointed to by \a offset_ptr. The size of the extracted address
- /// comes from the \a m_addr_size member variable and should be
- /// set correctly prior to extracting any address values.
+ /// Extract a single address from the data and update the offset pointed to
+ /// by \a offset_ptr. The size of the extracted address comes from the \a
+ /// m_addr_size member variable and should be set correctly prior to
+ /// extracting any address values.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -300,8 +277,7 @@ public:
//------------------------------------------------------------------
/// Get the current address size.
///
- /// Return the size in bytes of any address values this object will
- /// extract.
+ /// Return the size in bytes of any address values this object will extract.
///
/// @return
/// The size in bytes of address values that will be extracted.
@@ -319,11 +295,10 @@ public:
//------------------------------------------------------------------
/// Extract a C string from \a *offset_ptr.
///
- /// Returns a pointer to a C String from the data at the offset
- /// pointed to by \a offset_ptr. A variable length NULL terminated C
- /// string will be extracted and the \a offset_ptr will be
- /// updated with the offset of the byte that follows the NULL
- /// terminator byte.
+ /// Returns a pointer to a C String from the data at the offset pointed to
+ /// by \a offset_ptr. A variable length NULL terminated C string will be
+ /// extracted and the \a offset_ptr will be updated with the offset of the
+ /// byte that follows the NULL terminator byte.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -343,8 +318,8 @@ public:
//------------------------------------------------------------------
/// Extract a C string from \a *offset_ptr with field size \a len.
///
- /// Returns a pointer to a C String from the data at the offset
- /// pointed to by \a offset_ptr, with a field length of \a len.
+ /// Returns a pointer to a C String from the data at the offset pointed to
+ /// by \a offset_ptr, with a field length of \a len.
/// A NULL terminated C string will be extracted and the \a offset_ptr
/// will be updated with the offset of the byte that follows the fixed
/// length field.
@@ -367,10 +342,10 @@ public:
//------------------------------------------------------------------
/// Extract \a length bytes from \a *offset_ptr.
///
- /// Returns a pointer to a bytes in this object's data at the offset
- /// pointed to by \a offset_ptr. If \a length is zero or too large,
- /// then the offset pointed to by \a offset_ptr will not be updated
- /// and nullptr will be returned.
+ /// Returns a pointer to a bytes in this object's data at the offset pointed
+ /// to by \a offset_ptr. If \a length is zero or too large, then the offset
+ /// pointed to by \a offset_ptr will not be updated and nullptr will be
+ /// returned.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -414,17 +389,16 @@ public:
void *dst) const;
//------------------------------------------------------------------
- /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied
- /// data is treated as a value that can be swapped to match the
- /// specified byte order.
+ /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied data is
+ /// treated as a value that can be swapped to match the specified byte
+ /// order.
///
- /// For values that are larger than the supported integer sizes,
- /// this function can be used to extract data in a specified byte
- /// order. It can also be used to copy a smaller integer value from
- /// to a larger value. The extra bytes left over will be padded
- /// correctly according to the byte order of this object and the
- /// \a dst_byte_order. This can be very handy when say copying a
- /// partial data value into a register.
+ /// For values that are larger than the supported integer sizes, this
+ /// function can be used to extract data in a specified byte order. It can
+ /// also be used to copy a smaller integer value from to a larger value. The
+ /// extra bytes left over will be padded correctly according to the byte
+ /// order of this object and the \a dst_byte_order. This can be very handy
+ /// when say copying a partial data value into a register.
///
/// @param[in] src_offset
/// The offset into this data from which to start copying an
@@ -469,8 +443,7 @@ public:
//------------------------------------------------------------------
/// Get the shared data offset.
///
- /// Get the offset of the first byte of data in the shared data (if
- /// any).
+ /// Get the offset of the first byte of data in the shared data (if any).
///
/// @return
/// If this object contains shared data, this function returns
@@ -511,10 +484,10 @@ public:
//------------------------------------------------------------------
/// Extract an integer of size \a byte_size from \a *offset_ptr.
///
- /// Extract a single integer value and update the offset pointed to
- /// by \a offset_ptr. The size of the extracted integer is specified
- /// by the \a byte_size argument. \a byte_size must have a value
- /// >= 1 and <= 4 since the return value is only 32 bits wide.
+ /// Extract a single integer value and update the offset pointed to by \a
+ /// offset_ptr. The size of the extracted integer is specified by the \a
+ /// byte_size argument. \a byte_size must have a value >= 1 and <= 4 since
+ /// the return value is only 32 bits wide.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -532,14 +505,13 @@ public:
uint32_t GetMaxU32(lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
- /// Extract an unsigned integer of size \a byte_size from \a
- /// *offset_ptr.
+ /// Extract an unsigned integer of size \a byte_size from \a *offset_ptr.
///
- /// Extract a single unsigned integer value and update the offset
- /// pointed to by \a offset_ptr. The size of the extracted integer
- /// is specified by the \a byte_size argument. \a byte_size must
- /// have a value greater than or equal to one and less than or equal
- /// to eight since the return value is 64 bits wide.
+ /// Extract a single unsigned integer value and update the offset pointed to
+ /// by \a offset_ptr. The size of the extracted integer is specified by the
+ /// \a byte_size argument. \a byte_size must have a value greater than or
+ /// equal to one and less than or equal to eight since the return value is
+ /// 64 bits wide.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -563,12 +535,11 @@ public:
//------------------------------------------------------------------
/// Extract an signed integer of size \a byte_size from \a *offset_ptr.
///
- /// Extract a single signed integer value (sign extending if required)
- /// and update the offset pointed to by \a offset_ptr. The size of
- /// the extracted integer is specified by the \a byte_size argument.
- /// \a byte_size must have a value greater than or equal to one and
- /// less than or equal to eight since the return value is 64 bits
- /// wide.
+ /// Extract a single signed integer value (sign extending if required) and
+ /// update the offset pointed to by \a offset_ptr. The size of the extracted
+ /// integer is specified by the \a byte_size argument. \a byte_size must
+ /// have a value greater than or equal to one and less than or equal to
+ /// eight since the return value is 64 bits wide.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -587,15 +558,15 @@ public:
int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t byte_size) const;
//------------------------------------------------------------------
- /// Extract an unsigned integer of size \a byte_size from \a
- /// *offset_ptr, then extract the bitfield from this value if
- /// \a bitfield_bit_size is non-zero.
+ /// Extract an unsigned integer of size \a byte_size from \a *offset_ptr,
+ /// then extract the bitfield from this value if \a bitfield_bit_size is
+ /// non-zero.
///
- /// Extract a single unsigned integer value and update the offset
- /// pointed to by \a offset_ptr. The size of the extracted integer
- /// is specified by the \a byte_size argument. \a byte_size must
- /// have a value greater than or equal to one and less than or equal
- /// to 8 since the return value is 64 bits wide.
+ /// Extract a single unsigned integer value and update the offset pointed to
+ /// by \a offset_ptr. The size of the extracted integer is specified by the
+ /// \a byte_size argument. \a byte_size must have a value greater than or
+ /// equal to one and less than or equal to 8 since the return value is 64
+ /// bits wide.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -627,16 +598,15 @@ public:
uint32_t bitfield_bit_offset) const;
//------------------------------------------------------------------
- /// Extract an signed integer of size \a byte_size from \a
- /// *offset_ptr, then extract and signe extend the bitfield from
- /// this value if \a bitfield_bit_size is non-zero.
+ /// Extract an signed integer of size \a byte_size from \a *offset_ptr, then
+ /// extract and signe extend the bitfield from this value if \a
+ /// bitfield_bit_size is non-zero.
///
- /// Extract a single signed integer value (sign extending if required)
- /// and update the offset pointed to by \a offset_ptr. The size of
- /// the extracted integer is specified by the \a byte_size argument.
- /// \a byte_size must have a value greater than or equal to one and
- /// less than or equal to eight since the return value is 64 bits
- /// wide.
+ /// Extract a single signed integer value (sign extending if required) and
+ /// update the offset pointed to by \a offset_ptr. The size of the extracted
+ /// integer is specified by the \a byte_size argument. \a byte_size must
+ /// have a value greater than or equal to one and less than or equal to
+ /// eight since the return value is 64 bits wide.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -670,10 +640,10 @@ public:
//------------------------------------------------------------------
/// Extract an pointer from \a *offset_ptr.
///
- /// Extract a single pointer from the data and update the offset
- /// pointed to by \a offset_ptr. The size of the extracted pointer
- /// comes from the \a m_addr_size member variable and should be
- /// set correctly prior to extracting any pointer values.
+ /// Extract a single pointer from the data and update the offset pointed to
+ /// by \a offset_ptr. The size of the extracted pointer comes from the \a
+ /// m_addr_size member variable and should be set correctly prior to
+ /// extracting any pointer values.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -699,8 +669,8 @@ public:
//------------------------------------------------------------------
/// Extract a uint8_t value from \a *offset_ptr.
///
- /// Extract a single uint8_t from the binary data at the offset
- /// pointed to by \a offset_ptr, and advance the offset on success.
+ /// Extract a single uint8_t from the binary data at the offset pointed to
+ /// by \a offset_ptr, and advance the offset on success.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -728,9 +698,9 @@ public:
//------------------------------------------------------------------
/// Extract \a count uint8_t values from \a *offset_ptr.
///
- /// Extract \a count uint8_t values from the binary data at the
- /// offset pointed to by \a offset_ptr, and advance the offset on
- /// success. The extracted values are copied into \a dst.
+ /// Extract \a count uint8_t values from the binary data at the offset
+ /// pointed to by \a offset_ptr, and advance the offset on success. The
+ /// extracted values are copied into \a dst.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -755,8 +725,8 @@ public:
//------------------------------------------------------------------
/// Extract a uint16_t value from \a *offset_ptr.
///
- /// Extract a single uint16_t from the binary data at the offset
- /// pointed to by \a offset_ptr, and update the offset on success.
+ /// Extract a single uint16_t from the binary data at the offset pointed to
+ /// by \a offset_ptr, and update the offset on success.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -773,9 +743,9 @@ public:
//------------------------------------------------------------------
/// Extract \a count uint16_t values from \a *offset_ptr.
///
- /// Extract \a count uint16_t values from the binary data at the
- /// offset pointed to by \a offset_ptr, and advance the offset on
- /// success. The extracted values are copied into \a dst.
+ /// Extract \a count uint16_t values from the binary data at the offset
+ /// pointed to by \a offset_ptr, and advance the offset on success. The
+ /// extracted values are copied into \a dst.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -800,8 +770,8 @@ public:
//------------------------------------------------------------------
/// Extract a uint32_t value from \a *offset_ptr.
///
- /// Extract a single uint32_t from the binary data at the offset
- /// pointed to by \a offset_ptr, and update the offset on success.
+ /// Extract a single uint32_t from the binary data at the offset pointed to
+ /// by \a offset_ptr, and update the offset on success.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -818,9 +788,9 @@ public:
//------------------------------------------------------------------
/// Extract \a count uint32_t values from \a *offset_ptr.
///
- /// Extract \a count uint32_t values from the binary data at the
- /// offset pointed to by \a offset_ptr, and advance the offset on
- /// success. The extracted values are copied into \a dst.
+ /// Extract \a count uint32_t values from the binary data at the offset
+ /// pointed to by \a offset_ptr, and advance the offset on success. The
+ /// extracted values are copied into \a dst.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -845,8 +815,8 @@ public:
//------------------------------------------------------------------
/// Extract a uint64_t value from \a *offset_ptr.
///
- /// Extract a single uint64_t from the binary data at the offset
- /// pointed to by \a offset_ptr, and update the offset on success.
+ /// Extract a single uint64_t from the binary data at the offset pointed to
+ /// by \a offset_ptr, and update the offset on success.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -863,9 +833,9 @@ public:
//------------------------------------------------------------------
/// Extract \a count uint64_t values from \a *offset_ptr.
///
- /// Extract \a count uint64_t values from the binary data at the
- /// offset pointed to by \a offset_ptr, and advance the offset on
- /// success. The extracted values are copied into \a dst.
+ /// Extract \a count uint64_t values from the binary data at the offset
+ /// pointed to by \a offset_ptr, and advance the offset on success. The
+ /// extracted values are copied into \a dst.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -890,10 +860,10 @@ public:
//------------------------------------------------------------------
/// Extract a signed LEB128 value from \a *offset_ptr.
///
- /// Extracts an signed LEB128 number from this object's data
- /// starting at the offset pointed to by \a offset_ptr. The offset
- /// pointed to by \a offset_ptr will be updated with the offset of
- /// the byte following the last extracted byte.
+ /// Extracts an signed LEB128 number from this object's data starting at the
+ /// offset pointed to by \a offset_ptr. The offset pointed to by \a
+ /// offset_ptr will be updated with the offset of the byte following the
+ /// last extracted byte.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -910,10 +880,10 @@ public:
//------------------------------------------------------------------
/// Extract a unsigned LEB128 value from \a *offset_ptr.
///
- /// Extracts an unsigned LEB128 number from this object's data
- /// starting at the offset pointed to by \a offset_ptr. The offset
- /// pointed to by \a offset_ptr will be updated with the offset of
- /// the byte following the last extracted byte.
+ /// Extracts an unsigned LEB128 number from this object's data starting at
+ /// the offset pointed to by \a offset_ptr. The offset pointed to by \a
+ /// offset_ptr will be updated with the offset of the byte following the
+ /// last extracted byte.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
@@ -932,9 +902,9 @@ public:
//------------------------------------------------------------------
/// Peek at a C string at \a offset.
///
- /// Peeks at a string in the contained data. No verification is done
- /// to make sure the entire string lies within the bounds of this
- /// object's data, only \a offset is verified to be a valid offset.
+ /// Peeks at a string in the contained data. No verification is done to make
+ /// sure the entire string lies within the bounds of this object's data,
+ /// only \a offset is verified to be a valid offset.
///
/// @param[in] offset
/// An offset into the data.
@@ -948,8 +918,8 @@ public:
//------------------------------------------------------------------
/// Peek at a bytes at \a offset.
///
- /// Returns a pointer to \a length bytes at \a offset as long as
- /// there are \a length bytes available starting at \a offset.
+ /// Returns a pointer to \a length bytes at \a offset as long as there are
+ /// \a length bytes available starting at \a offset.
///
/// @return
/// A non-nullptr data pointer if \a offset is a valid offset and
@@ -965,8 +935,8 @@ public:
//------------------------------------------------------------------
/// Set the address byte size.
///
- /// Set the size in bytes that will be used when extracting any
- /// address and pointer values from data contained in this object.
+ /// Set the size in bytes that will be used when extracting any address and
+ /// pointer values from data contained in this object.
///
/// @param[in] addr_size
/// The size in bytes to use when extracting addresses.
@@ -981,11 +951,10 @@ public:
//------------------------------------------------------------------
/// Set data with a buffer that is caller owned.
///
- /// Use data that is owned by the caller when extracting values.
- /// The data must stay around as long as this object, or any object
- /// that copies a subset of this object's data, is valid. If \a
- /// bytes is nullptr, or \a length is zero, this object will contain
- /// no data.
+ /// Use data that is owned by the caller when extracting values. The data
+ /// must stay around as long as this object, or any object that copies a
+ /// subset of this object's data, is valid. If \a bytes is nullptr, or \a
+ /// length is zero, this object will contain no data.
///
/// @param[in] bytes
/// A pointer to caller owned data.
@@ -1005,16 +974,14 @@ public:
//------------------------------------------------------------------
/// Adopt a subset of \a data.
///
- /// Set this object's data to be a subset of the data bytes in \a
- /// data. If \a data contains shared data, then a reference to the
- /// shared data will be added to ensure the shared data stays around
- /// as long as any objects have references to the shared data. The
- /// byte order and the address size settings are copied from \a
- /// data. If \a offset is not a valid offset in \a data, then no
- /// reference to the shared data will be added. If there are not
- /// \a length bytes available in \a data starting at \a offset,
- /// the length will be truncated to contains as many bytes as
- /// possible.
+ /// Set this object's data to be a subset of the data bytes in \a data. If
+ /// \a data contains shared data, then a reference to the shared data will
+ /// be added to ensure the shared data stays around as long as any objects
+ /// have references to the shared data. The byte order and the address size
+ /// settings are copied from \a data. If \a offset is not a valid offset in
+ /// \a data, then no reference to the shared data will be added. If there
+ /// are not \a length bytes available in \a data starting at \a offset, the
+ /// length will be truncated to contains as many bytes as possible.
///
/// @param[in] data
/// Another DataExtractor object that contains data.
@@ -1034,15 +1001,14 @@ public:
//------------------------------------------------------------------
/// Adopt a subset of shared data in \a data_sp.
///
- /// Copies the data shared pointer which adds a reference to the
- /// contained in \a data_sp. The shared data reference is reference
- /// counted to ensure the data lives as long as anyone still has a
- /// valid shared pointer to the data in \a data_sp. The byte order
- /// and address byte size settings remain the same. If
- /// \a offset is not a valid offset in \a data_sp, then no reference
- /// to the shared data will be added. If there are not \a length
- /// bytes available in \a data starting at \a offset, the length
- /// will be truncated to contains as many bytes as possible.
+ /// Copies the data shared pointer which adds a reference to the contained
+ /// in \a data_sp. The shared data reference is reference counted to ensure
+ /// the data lives as long as anyone still has a valid shared pointer to the
+ /// data in \a data_sp. The byte order and address byte size settings remain
+ /// the same. If \a offset is not a valid offset in \a data_sp, then no
+ /// reference to the shared data will be added. If there are not \a length
+ /// bytes available in \a data starting at \a offset, the length will be
+ /// truncated to contains as many bytes as possible.
///
/// @param[in] data_sp
/// A shared pointer to data.
@@ -1063,8 +1029,8 @@ public:
//------------------------------------------------------------------
/// Set the byte_order value.
///
- /// Sets the byte order of the data to extract. Extracted values
- /// will be swapped if necessary when decoding.
+ /// Sets the byte order of the data to extract. Extracted values will be
+ /// swapped if necessary when decoding.
///
/// @param[in] byte_order
/// The byte order value to use when extracting data.
@@ -1074,10 +1040,10 @@ public:
//------------------------------------------------------------------
/// Skip an LEB128 number at \a *offset_ptr.
///
- /// Skips a LEB128 number (signed or unsigned) from this object's
- /// data starting at the offset pointed to by \a offset_ptr. The
- /// offset pointed to by \a offset_ptr will be updated with the
- /// offset of the byte following the last extracted byte.
+ /// Skips a LEB128 number (signed or unsigned) from this object's data
+ /// starting at the offset pointed to by \a offset_ptr. The offset pointed
+ /// to by \a offset_ptr will be updated with the offset of the byte
+ /// following the last extracted byte.
///
/// @param[in,out] offset_ptr
/// A pointer to an offset within the data that will be advanced
diff --git a/include/lldb/Utility/Environment.h b/include/lldb/Utility/Environment.h
new file mode 100644
index 000000000000..ed0a36d7b3aa
--- /dev/null
+++ b/include/lldb/Utility/Environment.h
@@ -0,0 +1,96 @@
+//===-- Environment.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_UTILITY_ENVIRONMENT_H
+#define LLDB_UTILITY_ENVIRONMENT_H
+
+#include "llvm/ADT/StringMap.h"
+#include "llvm/Support/Allocator.h"
+#include "llvm/Support/FormatProviders.h"
+
+namespace lldb_private {
+
+class Environment : private llvm::StringMap<std::string> {
+ using Base = llvm::StringMap<std::string>;
+
+public:
+ class Envp {
+ public:
+ Envp(Envp &&RHS) = default;
+ Envp &operator=(Envp &&RHS) = default;
+
+ char *const *get() const { return Data; }
+ operator char *const *() const { return get(); }
+
+ private:
+ explicit Envp(const Environment &Env);
+ char *make_entry(llvm::StringRef Key, llvm::StringRef Value);
+ Envp(const Envp &) = delete;
+ Envp &operator=(const Envp &) = delete;
+ friend class Environment;
+
+ llvm::BumpPtrAllocator Allocator;
+ char **Data;
+ };
+
+ using Base::const_iterator;
+ using Base::iterator;
+ using Base::value_type;
+
+ using Base::begin;
+ using Base::clear;
+ using Base::count;
+ using Base::empty;
+ using Base::end;
+ using Base::erase;
+ using Base::find;
+ using Base::insert;
+ using Base::lookup;
+ using Base::size;
+ using Base::try_emplace;
+ using Base::operator[];
+
+ Environment() : Base() {}
+ Environment(const Environment &RHS) : Base(RHS) {}
+ Environment(Environment &&RHS) : Base(std::move(RHS)) {}
+ Environment(char *const *Env)
+ : Environment(const_cast<const char *const *>(Env)) {}
+ Environment(const char *const *Env);
+
+ Environment &operator=(Environment RHS) {
+ Base::operator=(std::move(RHS));
+ return *this;
+ }
+
+ std::pair<iterator, bool> insert(llvm::StringRef KeyEqValue) {
+ return insert(KeyEqValue.split('='));
+ }
+
+ void insert(const_iterator first, const_iterator last);
+
+ Envp getEnvp() const { return Envp(*this); }
+
+ static std::string compose(const value_type &KeyValue) {
+ return (KeyValue.first() + "=" + KeyValue.second).str();
+ }
+};
+
+} // namespace lldb_private
+
+namespace llvm {
+template <> struct format_provider<lldb_private::Environment> {
+ static void format(const lldb_private::Environment &Env, raw_ostream &Stream,
+ StringRef Style) {
+ for (const auto &KV : Env)
+ Stream << "env[" << KV.first() << "] = " << KV.second << "\n";
+ }
+};
+} // namespace llvm
+
+#endif // #ifndef LLDB_UTILITY_ENVIRONMENT_H
diff --git a/include/lldb/Utility/FileSpec.h b/include/lldb/Utility/FileSpec.h
index 55d44d84087d..d062ba598ccc 100644
--- a/include/lldb/Utility/FileSpec.h
+++ b/include/lldb/Utility/FileSpec.h
@@ -19,9 +19,10 @@
// Project includes
#include "lldb/Utility/ConstString.h"
-#include "llvm/ADT/StringRef.h" // for StringRef
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatVariadic.h"
+#include "llvm/Support/Path.h"
#include <stddef.h> // for size_t
#include <stdint.h> // for uint32_t, uint64_t
@@ -43,37 +44,32 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class FileSpec FileSpec.h "lldb/Host/FileSpec.h"
-/// @brief A file utility class.
+/// A file utility class.
///
/// A file specification class that divides paths up into a directory
-/// and basename. These string values of the paths are put into uniqued
-/// string pools for fast comparisons and efficient memory usage.
+/// and basename. These string values of the paths are put into uniqued string
+/// pools for fast comparisons and efficient memory usage.
///
-/// Another reason the paths are split into the directory and basename
-/// is to allow efficient debugger searching. Often in a debugger the
-/// user types in the basename of the file, for example setting a
-/// breakpoint by file and line, or specifying a module (shared library)
-/// to limit the scope in which to execute a command. The user rarely
-/// types in a full path. When the paths are already split up, it makes
-/// it easy for us to compare only the basenames of a lot of file
-/// specifications without having to split up the file path each time
-/// to get to the basename.
+/// Another reason the paths are split into the directory and basename is to
+/// allow efficient debugger searching. Often in a debugger the user types in
+/// the basename of the file, for example setting a breakpoint by file and
+/// line, or specifying a module (shared library) to limit the scope in which
+/// to execute a command. The user rarely types in a full path. When the paths
+/// are already split up, it makes it easy for us to compare only the
+/// basenames of a lot of file specifications without having to split up the
+/// file path each time to get to the basename.
//----------------------------------------------------------------------
class FileSpec {
public:
- enum PathSyntax : unsigned char {
- ePathSyntaxPosix,
- ePathSyntaxWindows,
- ePathSyntaxHostNative
- };
+ using Style = llvm::sys::path::Style;
FileSpec();
//------------------------------------------------------------------
/// Constructor with path.
///
- /// Takes a path to a file which can be just a filename, or a full
- /// path. If \a path is not nullptr or empty, this function will call
+ /// Takes a path to a file which can be just a filename, or a full path. If
+ /// \a path is not nullptr or empty, this function will call
/// FileSpec::SetFile (const char *path, bool resolve).
///
/// @param[in] path
@@ -87,7 +83,7 @@ public:
/// @see FileSpec::SetFile (const char *path, bool resolve)
//------------------------------------------------------------------
explicit FileSpec(llvm::StringRef path, bool resolve_path,
- PathSyntax syntax = ePathSyntaxHostNative);
+ Style style = Style::native);
explicit FileSpec(llvm::StringRef path, bool resolve_path,
const llvm::Triple &Triple);
@@ -95,8 +91,7 @@ public:
//------------------------------------------------------------------
/// Copy constructor
///
- /// Makes a copy of the uniqued directory and filename strings from
- /// \a rhs.
+ /// Makes a copy of the uniqued directory and filename strings from \a rhs.
///
/// @param[in] rhs
/// A const FileSpec object reference to copy.
@@ -106,8 +101,8 @@ public:
//------------------------------------------------------------------
/// Copy constructor
///
- /// Makes a copy of the uniqued directory and filename strings from
- /// \a rhs if it is not nullptr.
+ /// Makes a copy of the uniqued directory and filename strings from \a rhs
+ /// if it is not nullptr.
///
/// @param[in] rhs
/// A const FileSpec object pointer to copy if non-nullptr.
@@ -126,8 +121,7 @@ public:
//------------------------------------------------------------------
/// Assignment operator.
///
- /// Makes a copy of the uniqued directory and filename strings from
- /// \a rhs.
+ /// Makes a copy of the uniqued directory and filename strings from \a rhs.
///
/// @param[in] rhs
/// A const FileSpec object reference to assign to this object.
@@ -185,8 +179,8 @@ public:
//------------------------------------------------------------------
/// Convert to pointer operator.
///
- /// This allows code to check a FileSpec object to see if it
- /// contains anything valid using code such as:
+ /// This allows code to check a FileSpec object to see if it contains
+ /// anything valid using code such as:
///
/// @code
/// FileSpec file_spec(...);
@@ -203,8 +197,8 @@ public:
//------------------------------------------------------------------
/// Logical NOT operator.
///
- /// This allows code to check a FileSpec object to see if it is
- /// invalid using code such as:
+ /// This allows code to check a FileSpec object to see if it is invalid
+ /// using code such as:
///
/// @code
/// FileSpec file_spec(...);
@@ -221,20 +215,19 @@ public:
//------------------------------------------------------------------
/// Clears the object state.
///
- /// Clear this object by releasing both the directory and filename
- /// string values and reverting them to empty strings.
+ /// Clear this object by releasing both the directory and filename string
+ /// values and reverting them to empty strings.
//------------------------------------------------------------------
void Clear();
//------------------------------------------------------------------
/// Compare two FileSpec objects.
///
- /// If \a full is true, then both the directory and the filename
- /// must match. If \a full is false, then the directory names for
- /// \a lhs and \a rhs are only compared if they are both not empty.
- /// This allows a FileSpec object to only contain a filename
- /// and it can match FileSpec objects that have matching
- /// filenames with different paths.
+ /// If \a full is true, then both the directory and the filename must match.
+ /// If \a full is false, then the directory names for \a lhs and \a rhs are
+ /// only compared if they are both not empty. This allows a FileSpec object
+ /// to only contain a filename and it can match FileSpec objects that have
+ /// matching filenames with different paths.
///
/// @param[in] lhs
/// A const reference to the Left Hand Side object to compare.
@@ -256,8 +249,7 @@ public:
//------------------------------------------------------------------
static int Compare(const FileSpec &lhs, const FileSpec &rhs, bool full);
- static bool Equal(const FileSpec &a, const FileSpec &b, bool full,
- bool remove_backups = false);
+ static bool Equal(const FileSpec &a, const FileSpec &b, bool full);
//------------------------------------------------------------------
/// Case sensitivity of path.
@@ -266,14 +258,14 @@ public:
/// \b true if the file path is case sensitive (POSIX), false
/// if case insensitive (Windows).
//------------------------------------------------------------------
- bool IsCaseSensitive() const { return m_syntax != ePathSyntaxWindows; }
+ bool IsCaseSensitive() const { return m_style != Style::windows; }
//------------------------------------------------------------------
/// Dump this object to a Stream.
///
- /// Dump the object to the supplied stream \a s. If the object
- /// contains a valid directory name, it will be displayed followed
- /// by a directory delimiter, and the filename.
+ /// Dump the object to the supplied stream \a s. If the object contains a
+ /// valid directory name, it will be displayed followed by a directory
+ /// delimiter, and the filename.
///
/// @param[in] s
/// The stream to which to dump the object description.
@@ -303,8 +295,8 @@ public:
/// Call into the Host to see if it can help find the file (e.g. by
/// searching paths set in the environment, etc.).
///
- /// If found, sets the value of m_directory to the directory where
- /// the file was found.
+ /// If found, sets the value of m_directory to the directory where the file
+ /// was found.
///
/// @return
/// \b true if was able to find the file using expanded search
@@ -314,14 +306,14 @@ public:
//------------------------------------------------------------------
/// Canonicalize this file path (basically running the static
- /// FileSpec::Resolve method on it). Useful if you asked us not to
- /// resolve the file path when you set the file.
+ /// FileSpec::Resolve method on it). Useful if you asked us not to resolve
+ /// the file path when you set the file.
//------------------------------------------------------------------
bool ResolvePath();
uint64_t GetByteSize() const;
- PathSyntax GetPathSyntax() const;
+ Style GetPathStyle() const;
//------------------------------------------------------------------
/// Directory string get accessor.
@@ -356,9 +348,8 @@ public:
const ConstString &GetFilename() const;
//------------------------------------------------------------------
- /// Returns true if the filespec represents an implementation source
- /// file (files with a ".c", ".cpp", ".m", ".mm" (many more)
- /// extension).
+ /// Returns true if the filespec represents an implementation source file
+ /// (files with a ".c", ".cpp", ".m", ".mm" (many more) extension).
///
/// @return
/// \b true if the filespec represents an implementation source
@@ -387,9 +378,8 @@ public:
//------------------------------------------------------------------
/// Extract the full path to the file.
///
- /// Extract the directory and path into a fixed buffer. This is
- /// needed as the directory and path are stored in separate string
- /// values.
+ /// Extract the directory and path into a fixed buffer. This is needed as
+ /// the directory and path are stored in separate string values.
///
/// @param[out] path
/// The buffer in which to place the extracted full path.
@@ -436,10 +426,10 @@ public:
//------------------------------------------------------------------
/// Extract the extension of the file.
///
- /// Returns a ConstString that represents the extension of the filename
- /// for this FileSpec object. If this object does not represent a file,
- /// or the filename has no extension, ConstString(nullptr) is returned.
- /// The dot ('.') character is not returned as part of the extension
+ /// Returns a ConstString that represents the extension of the filename for
+ /// this FileSpec object. If this object does not represent a file, or the
+ /// filename has no extension, ConstString(nullptr) is returned. The dot
+ /// ('.') character is not returned as part of the extension
///
/// @return
/// Returns the extension of the file as a ConstString object.
@@ -450,8 +440,8 @@ public:
/// Return the filename without the extension part
///
/// Returns a ConstString that represents the filename of this object
- /// without the extension part (e.g. for a file named "foo.bar", "foo"
- /// is returned)
+ /// without the extension part (e.g. for a file named "foo.bar", "foo" is
+ /// returned)
///
/// @return
/// Returns the filename without extension
@@ -462,9 +452,8 @@ public:
//------------------------------------------------------------------
/// Return the current permissions of the path.
///
- /// Returns a bitmask for the current permissions of the file
- /// ( zero or more of the permission bits defined in
- /// File::Permissions).
+ /// Returns a bitmask for the current permissions of the file ( zero or more
+ /// of the permission bits defined in File::Permissions).
///
/// @return
/// Zero if the file doesn't exist or we are unable to get
@@ -476,9 +465,9 @@ public:
//------------------------------------------------------------------
/// Get the memory cost of this object.
///
- /// Return the size in bytes that this object takes in memory. This
- /// returns the size in bytes of this object, not any shared string
- /// values it may refer to.
+ /// Return the size in bytes that this object takes in memory. This returns
+ /// the size in bytes of this object, not any shared string values it may
+ /// refer to.
///
/// @return
/// The number of bytes that this object occupies in memory.
@@ -488,17 +477,11 @@ public:
size_t MemorySize() const;
//------------------------------------------------------------------
- /// Normalize a pathname by collapsing redundant separators and
- /// up-level references.
- //------------------------------------------------------------------
- FileSpec GetNormalizedPath() const;
-
- //------------------------------------------------------------------
/// Change the file specified with a new path.
///
- /// Update the contents of this object with a new path. The path will
- /// be split up into a directory and filename and stored as uniqued
- /// string values for quick comparison and efficient memory usage.
+ /// Update the contents of this object with a new path. The path will be
+ /// split up into a directory and filename and stored as uniqued string
+ /// values for quick comparison and efficient memory usage.
///
/// @param[in] path
/// A full, partial, or relative path to a file.
@@ -507,8 +490,7 @@ public:
/// If \b true, then we will try to resolve links the path using
/// the static FileSpec::Resolve.
//------------------------------------------------------------------
- void SetFile(llvm::StringRef path, bool resolve_path,
- PathSyntax syntax = ePathSyntaxHostNative);
+ void SetFile(llvm::StringRef path, bool resolve_path, Style style);
void SetFile(llvm::StringRef path, bool resolve_path,
const llvm::Triple &Triple);
@@ -518,11 +500,11 @@ public:
//------------------------------------------------------------------
/// Set if the file path has been resolved or not.
///
- /// If you know a file path is already resolved and avoided passing
- /// a \b true parameter for any functions that take a "bool
- /// resolve_path" parameter, you can set the value manually using
- /// this call to make sure we don't try and resolve it later, or try
- /// and resolve a path that has already been resolved.
+ /// If you know a file path is already resolved and avoided passing a \b
+ /// true parameter for any functions that take a "bool resolve_path"
+ /// parameter, you can set the value manually using this call to make sure
+ /// we don't try and resolve it later, or try and resolve a path that has
+ /// already been resolved.
///
/// @param[in] is_resolved
/// A boolean value that will replace the current value that
@@ -549,7 +531,14 @@ public:
void AppendPathComponent(llvm::StringRef component);
void AppendPathComponent(const FileSpec &new_path);
- void RemoveLastPathComponent();
+ //------------------------------------------------------------------
+ /// Removes the last path component by replacing the current path with its
+ /// parent. When the current path has no parent, this is a no-op.
+ ///
+ /// @return
+ /// A boolean value indicating whether the path was updated.
+ //------------------------------------------------------------------
+ bool RemoveLastPathComponent();
ConstString GetLastPathComponent() const;
@@ -576,13 +565,17 @@ public:
protected:
//------------------------------------------------------------------
+ // Convenience method for setting the file without changing the style.
+ //------------------------------------------------------------------
+ void SetFile(llvm::StringRef path, bool resolve_path);
+
+ //------------------------------------------------------------------
// Member variables
//------------------------------------------------------------------
ConstString m_directory; ///< The uniqued directory path
ConstString m_filename; ///< The uniqued filename path
mutable bool m_is_resolved = false; ///< True if this path has been resolved.
- PathSyntax
- m_syntax; ///< The syntax that this path uses (e.g. Windows / Posix)
+ Style m_style; ///< The syntax that this path uses (e.g. Windows / Posix)
};
//----------------------------------------------------------------------
@@ -616,6 +609,6 @@ template <> struct format_provider<lldb_private::FileSpec> {
static void format(const lldb_private::FileSpec &F, llvm::raw_ostream &Stream,
StringRef Style);
};
-}
+} // namespace llvm
#endif // liblldb_FileSpec_h_
diff --git a/include/lldb/Utility/Flags.h b/include/lldb/Utility/Flags.h
index 1b303858b1c1..5ef6122d1146 100644
--- a/include/lldb/Utility/Flags.h
+++ b/include/lldb/Utility/Flags.h
@@ -17,10 +17,10 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Flags Flags.h "lldb/Utility/Flags.h"
-/// @brief A class to manage flags.
+/// A class to manage flags.
///
-/// The Flags class managed flag bits and allows testing and
-/// modification of individual or multiple flag bits.
+/// The Flags class managed flag bits and allows testing and modification of
+/// individual or multiple flag bits.
//----------------------------------------------------------------------
class Flags {
public:
@@ -32,8 +32,8 @@ public:
//----------------------------------------------------------------------
/// Construct with initial flag bit values.
///
- /// Constructs this object with \a mask as the initial value for all
- /// of the flags.
+ /// Constructs this object with \a mask as the initial value for all of the
+ /// flags.
///
/// @param[in] mask
/// The initial value for all flags.
@@ -64,8 +64,7 @@ public:
ValueType Get() const { return m_flags; }
//----------------------------------------------------------------------
- /// Return the number of flags that can be represented in this
- /// object.
+ /// Return the number of flags that can be represented in this object.
///
/// @return
/// The maximum number bits in this flag object.
@@ -95,8 +94,7 @@ public:
}
//----------------------------------------------------------------------
- /// Set one or more flags by logical OR'ing \a mask with the current
- /// flags.
+ /// Set one or more flags by logical OR'ing \a mask with the current flags.
///
/// @param[in] mask
/// A bitfield containing one or more flags.
diff --git a/include/lldb/Utility/History.h b/include/lldb/Utility/History.h
deleted file mode 100644
index c6882b65fd8e..000000000000
--- a/include/lldb/Utility/History.h
+++ /dev/null
@@ -1,136 +0,0 @@
-//===-- History.h -----------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef lldb_History_h_
-#define lldb_History_h_
-
-#include "lldb/lldb-defines.h" // for DISALLOW_COPY_AND_ASSIGN
-
-// C++ Includes
-#include <mutex>
-#include <stack>
-#include <string>
-
-#include <stddef.h> // for size_t
-#include <stdint.h>
-
-namespace lldb_private {
-class Stream;
-}
-
-namespace lldb_private {
-
-//----------------------------------------------------------------------
-/// @class HistorySource History.h "lldb/Core/History.h"
-/// @brief A class that defines history events.
-//----------------------------------------------------------------------
-
-class HistorySource {
-public:
- typedef const void *HistoryEvent;
-
- HistorySource() : m_mutex(), m_events() {}
-
- virtual ~HistorySource() {}
-
- // Create a new history event. Subclasses should use any data or members
- // in the subclass of this class to produce a history event and push it
- // onto the end of the history stack.
-
- virtual HistoryEvent CreateHistoryEvent() = 0;
-
- virtual void DeleteHistoryEvent(HistoryEvent event) = 0;
-
- virtual void DumpHistoryEvent(Stream &strm, HistoryEvent event) = 0;
-
- virtual size_t GetHistoryEventCount() = 0;
-
- virtual HistoryEvent GetHistoryEventAtIndex(uint32_t idx) = 0;
-
- virtual HistoryEvent GetCurrentHistoryEvent() = 0;
-
- // Return 0 when lhs == rhs, 1 if lhs > rhs, or -1 if lhs < rhs.
- virtual int CompareHistoryEvents(const HistoryEvent lhs,
- const HistoryEvent rhs) = 0;
-
- virtual bool IsCurrentHistoryEvent(const HistoryEvent event) = 0;
-
-private:
- typedef std::stack<HistoryEvent> collection;
-
- std::recursive_mutex m_mutex;
- collection m_events;
-
- DISALLOW_COPY_AND_ASSIGN(HistorySource);
-};
-
-//----------------------------------------------------------------------
-/// @class HistorySourceUInt History.h "lldb/Core/History.h"
-/// @brief A class that defines history events that are represented by
-/// unsigned integers.
-///
-/// Any history event that is defined by a unique monotonically
-/// increasing unsigned integer
-//----------------------------------------------------------------------
-
-class HistorySourceUInt : public HistorySource {
- HistorySourceUInt(const char *id_name, uintptr_t start_value = 0u)
- : HistorySource(), m_name(id_name), m_curr_id(start_value) {}
-
- ~HistorySourceUInt() override {}
-
- // Create a new history event. Subclasses should use any data or members
- // in the subclass of this class to produce a history event and push it
- // onto the end of the history stack.
-
- HistoryEvent CreateHistoryEvent() override {
- ++m_curr_id;
- return (HistoryEvent)m_curr_id;
- }
-
- void DeleteHistoryEvent(HistoryEvent event) override {
- // Nothing to delete, the event contains the integer
- }
-
- void DumpHistoryEvent(Stream &strm, HistoryEvent event) override;
-
- size_t GetHistoryEventCount() override { return m_curr_id; }
-
- HistoryEvent GetHistoryEventAtIndex(uint32_t idx) override {
- return (HistoryEvent)((uintptr_t)idx);
- }
-
- HistoryEvent GetCurrentHistoryEvent() override {
- return (HistoryEvent)m_curr_id;
- }
-
- // Return 0 when lhs == rhs, 1 if lhs > rhs, or -1 if lhs < rhs.
- int CompareHistoryEvents(const HistoryEvent lhs,
- const HistoryEvent rhs) override {
- uintptr_t lhs_uint = (uintptr_t)lhs;
- uintptr_t rhs_uint = (uintptr_t)rhs;
- if (lhs_uint < rhs_uint)
- return -1;
- if (lhs_uint > rhs_uint)
- return +1;
- return 0;
- }
-
- bool IsCurrentHistoryEvent(const HistoryEvent event) override {
- return (uintptr_t)event == m_curr_id;
- }
-
-protected:
- std::string m_name; // The name of the history unsigned integer
- uintptr_t m_curr_id; // The current value of the history unsigned unteger
-};
-
-} // namespace lldb_private
-
-#endif // lldb_History_h_
diff --git a/include/lldb/Utility/JSON.h b/include/lldb/Utility/JSON.h
index 8bf9c4b37b02..6fe1945ea227 100644
--- a/include/lldb/Utility/JSON.h
+++ b/include/lldb/Utility/JSON.h
@@ -79,9 +79,8 @@ public:
// SFINAE to avoid having ambiguous overloads because of the implicit type
// promotion. If we
// would have constructors only with int64_t, uint64_t and double types then
- // constructing a
- // JSONNumber from an int32_t (or any other similar type) would fail to
- // compile.
+ // constructing a JSONNumber from an int32_t (or any other similar type)
+ // would fail to compile.
template <typename T, typename std::enable_if<
std::is_integral<T>::value &&
diff --git a/include/lldb/Utility/Log.h b/include/lldb/Utility/Log.h
index 80a80fc16485..62776bdb281b 100644
--- a/include/lldb/Utility/Log.h
+++ b/include/lldb/Utility/Log.h
@@ -17,6 +17,7 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/StringMap.h" // for StringMap
#include "llvm/ADT/StringRef.h" // for StringRef, StringLiteral
+#include "llvm/Support/Error.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/RWMutex.h"
@@ -73,10 +74,10 @@ public:
: log_ptr(nullptr), categories(categories),
default_flags(default_flags) {}
- // This function is safe to call at any time
- // If the channel is disabled after (or concurrently with) this function
- // returning a non-null Log pointer, it is still safe to attempt to write to
- // the Log object -- the output will be discarded.
+ // This function is safe to call at any time If the channel is disabled
+ // after (or concurrently with) this function returning a non-null Log
+ // pointer, it is still safe to attempt to write to the Log object -- the
+ // output will be discarded.
Log *GetLogIfAll(uint32_t mask) {
Log *log = log_ptr.load(std::memory_order_relaxed);
if (log && log->GetMask().AllSet(mask))
@@ -84,10 +85,10 @@ public:
return nullptr;
}
- // This function is safe to call at any time
- // If the channel is disabled after (or concurrently with) this function
- // returning a non-null Log pointer, it is still safe to attempt to write to
- // the Log object -- the output will be discarded.
+ // This function is safe to call at any time If the channel is disabled
+ // after (or concurrently with) this function returning a non-null Log
+ // pointer, it is still safe to attempt to write to the Log object -- the
+ // output will be discarded.
Log *GetLogIfAny(uint32_t mask) {
Log *log = log_ptr.load(std::memory_order_relaxed);
if (log && log->GetMask().AnySet(mask))
@@ -140,6 +141,15 @@ public:
Format(file, function, llvm::formatv(format, std::forward<Args>(args)...));
}
+ template <typename... Args>
+ void FormatError(llvm::Error error, llvm::StringRef file,
+ llvm::StringRef function, const char *format,
+ Args &&... args) {
+ Format(file, function,
+ llvm::formatv(format, llvm::toString(std::move(error)),
+ std::forward<Args>(args)...));
+ }
+
void Printf(const char *format, ...) __attribute__((format(printf, 2, 3)));
void VAPrintf(const char *format, va_list args);
@@ -161,8 +171,8 @@ public:
private:
Channel &m_channel;
- // The mutex makes sure enable/disable operations are thread-safe. The options
- // and mask variables are atomic to enable their reading in
+ // The mutex makes sure enable/disable operations are thread-safe. The
+ // options and mask variables are atomic to enable their reading in
// Channel::GetLogIfAny without taking the mutex to speed up the fast path.
// Their modification however, is still protected by this mutex.
llvm::sys::RWMutex m_mutex;
@@ -208,14 +218,27 @@ private:
do { \
::lldb_private::Log *log_private = (log); \
if (log_private) \
- log_private->Format(__FILE__, __FUNCTION__, __VA_ARGS__); \
+ log_private->Format(__FILE__, __func__, __VA_ARGS__); \
} while (0)
#define LLDB_LOGV(log, ...) \
do { \
::lldb_private::Log *log_private = (log); \
if (log_private && log_private->GetVerbose()) \
- log_private->Format(__FILE__, __FUNCTION__, __VA_ARGS__); \
+ log_private->Format(__FILE__, __func__, __VA_ARGS__); \
+ } while (0)
+
+// Write message to log, if error is set. In the log message refer to the error
+// with {0}. Error is cleared regardless of whether logging is enabled.
+#define LLDB_LOG_ERROR(log, error, ...) \
+ do { \
+ ::lldb_private::Log *log_private = (log); \
+ ::llvm::Error error_private = (error); \
+ if (log_private && error_private) { \
+ log_private->FormatError(::std::move(error_private), __FILE__, __func__, \
+ __VA_ARGS__); \
+ } else \
+ ::llvm::consumeError(::std::move(error_private)); \
} while (0)
#endif // LLDB_UTILITY_LOG_H
diff --git a/include/lldb/Utility/RegularExpression.h b/include/lldb/Utility/RegularExpression.h
index dba7001ce0fa..6048fcc610a3 100644
--- a/include/lldb/Utility/RegularExpression.h
+++ b/include/lldb/Utility/RegularExpression.h
@@ -52,11 +52,11 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class RegularExpression RegularExpression.h
/// "lldb/Utility/RegularExpression.h"
-/// @brief A C++ wrapper class for regex.
+/// A C++ wrapper class for regex.
///
-/// This regular expression class wraps the posix regex functions
-/// \c regcomp(), \c regerror(), \c regexec(), and \c regfree() from
-/// the header file in \c /usr/include/regex\.h.
+/// This regular expression class wraps the posix regex functions \c
+/// regcomp(), \c regerror(), \c regexec(), and \c regfree() from the header
+/// file in \c /usr/include/regex\.h.
//----------------------------------------------------------------------
class RegularExpression {
public:
@@ -98,8 +98,8 @@ public:
//------------------------------------------------------------------
/// Default constructor.
///
- /// The default constructor that initializes the object state such
- /// that it contains no compiled regular expression.
+ /// The default constructor that initializes the object state such that it
+ /// contains no compiled regular expression.
//------------------------------------------------------------------
RegularExpression();
@@ -108,8 +108,8 @@ public:
//------------------------------------------------------------------
/// Destructor.
///
- /// Any previously compiled regular expression contained in this
- /// object will be freed.
+ /// Any previously compiled regular expression contained in this object will
+ /// be freed.
//------------------------------------------------------------------
~RegularExpression();
@@ -120,12 +120,11 @@ public:
//------------------------------------------------------------------
/// Compile a regular expression.
///
- /// Compile a regular expression using the supplied regular
- /// expression text. The compiled regular expression lives
- /// in this object so that it can be readily used for regular
- /// expression matches. Execute() can be called after the regular
- /// expression is compiled. Any previously compiled regular
- /// expression contained in this object will be freed.
+ /// Compile a regular expression using the supplied regular expression text.
+ /// The compiled regular expression lives in this object so that it can be
+ /// readily used for regular expression matches. Execute() can be called
+ /// after the regular expression is compiled. Any previously compiled
+ /// regular expression contained in this object will be freed.
///
/// @param[in] re
/// A NULL terminated C string that represents the regular
@@ -141,11 +140,11 @@ public:
//------------------------------------------------------------------
/// Executes a regular expression.
///
- /// Execute a regular expression match using the compiled regular
- /// expression that is already in this object against the match
- /// string \a s. If any parens are used for regular expression
- /// matches \a match_count should indicate the number of regmatch_t
- /// values that are present in \a match_ptr.
+ /// Execute a regular expression match using the compiled regular expression
+ /// that is already in this object against the match string \a s. If any
+ /// parens are used for regular expression matches \a match_count should
+ /// indicate the number of regmatch_t values that are present in \a
+ /// match_ptr.
///
/// @param[in] string
/// The string to match against the compile regular expression.
@@ -167,8 +166,8 @@ public:
//------------------------------------------------------------------
/// Free the compiled regular expression.
///
- /// If this object contains a valid compiled regular expression,
- /// this function will free any resources it was consuming.
+ /// If this object contains a valid compiled regular expression, this
+ /// function will free any resources it was consuming.
//------------------------------------------------------------------
void Free();
diff --git a/include/lldb/Utility/SafeMachO.h b/include/lldb/Utility/SafeMachO.h
index 791410a38b34..1565b313f42b 100644
--- a/include/lldb/Utility/SafeMachO.h
+++ b/include/lldb/Utility/SafeMachO.h
@@ -9,18 +9,15 @@
#ifndef liblldb_SafeMachO_h_
#define liblldb_SafeMachO_h_
-// This header file is required to work around collisions between the defines in
-// mach/machine.h, and enum members
-// of the same name in llvm's MachO.h. If you want to use llvm/Support/MachO.h,
-// use this file instead.
-// The caveats are:
-// 1) You can only use the MachO.h enums, you can't use the defines. That won't
-// make a difference since the values
+// This header file is required to work around collisions between the defines
+// in mach/machine.h, and enum members of the same name in llvm's MachO.h. If
+// you want to use llvm/Support/MachO.h, use this file instead. The caveats
+// are: 1) You can only use the MachO.h enums, you can't use the defines. That
+// won't make a difference since the values
// are the same.
// 2) If you need any header file that relies on mach/machine.h, you must
-// include that first.
-// 3) This isn't a total solution, it doesn't undef every define that MachO.h
-// has borrowed from various system headers,
+// include that first. 3) This isn't a total solution, it doesn't undef every
+// define that MachO.h has borrowed from various system headers,
// only the ones that come from mach/machine.h because that is the one we
// ended up pulling in from various places.
//
diff --git a/include/lldb/Utility/SelectHelper.h b/include/lldb/Utility/SelectHelper.h
index 12950d032fb6..004952f1c598 100644
--- a/include/lldb/Utility/SelectHelper.h
+++ b/include/lldb/Utility/SelectHelper.h
@@ -23,32 +23,31 @@ public:
// Defaults to infinite wait for select unless you call SetTimeout()
SelectHelper();
- // Call SetTimeout() before calling SelectHelper::Select() to set the
- // timeout based on the current time + the timeout. This allows multiple
- // calls to SelectHelper::Select() without having to worry about the
- // absolute timeout as this class manages to set the relative timeout
- // correctly.
+ // Call SetTimeout() before calling SelectHelper::Select() to set the timeout
+ // based on the current time + the timeout. This allows multiple calls to
+ // SelectHelper::Select() without having to worry about the absolute timeout
+ // as this class manages to set the relative timeout correctly.
void SetTimeout(const std::chrono::microseconds &timeout);
- // Call the FDSet*() functions before calling SelectHelper::Select() to
- // set the file descriptors that we will watch for when calling
- // select. This will cause FD_SET() to be called prior to calling select
- // using the "fd" provided.
+ // Call the FDSet*() functions before calling SelectHelper::Select() to set
+ // the file descriptors that we will watch for when calling select. This will
+ // cause FD_SET() to be called prior to calling select using the "fd"
+ // provided.
void FDSetRead(lldb::socket_t fd);
void FDSetWrite(lldb::socket_t fd);
void FDSetError(lldb::socket_t fd);
- // Call the FDIsSet*() functions after calling SelectHelper::Select()
- // to check which file descriptors are ready for read/write/error. This
- // will contain the result of FD_ISSET after calling select for a given
- // file descriptor.
+ // Call the FDIsSet*() functions after calling SelectHelper::Select() to
+ // check which file descriptors are ready for read/write/error. This will
+ // contain the result of FD_ISSET after calling select for a given file
+ // descriptor.
bool FDIsSetRead(lldb::socket_t fd) const;
bool FDIsSetWrite(lldb::socket_t fd) const;
bool FDIsSetError(lldb::socket_t fd) const;
- // Call the system's select() to wait for descriptors using
- // timeout provided in a call the SelectHelper::SetTimeout(),
- // or infinite wait if no timeout was set.
+ // Call the system's select() to wait for descriptors using timeout provided
+ // in a call the SelectHelper::SetTimeout(), or infinite wait if no timeout
+ // was set.
lldb_private::Status Select();
protected:
diff --git a/include/lldb/Utility/SharedCluster.h b/include/lldb/Utility/SharedCluster.h
index b01f702c2787..61b9804ad335 100644
--- a/include/lldb/Utility/SharedCluster.h
+++ b/include/lldb/Utility/SharedCluster.h
@@ -15,6 +15,8 @@
#include "llvm/ADT/SmallPtrSet.h"
+#include <mutex>
+
namespace lldb_private {
namespace imp {
@@ -48,9 +50,9 @@ public:
delete object;
}
- // Decrement refcount should have been called on this ClusterManager,
- // and it should have locked the mutex, now we will unlock it before
- // we destroy it...
+ // Decrement refcount should have been called on this ClusterManager, and
+ // it should have locked the mutex, now we will unlock it before we destroy
+ // it...
m_mutex.unlock();
}
diff --git a/include/lldb/Utility/SharingPtr.h b/include/lldb/Utility/SharingPtr.h
index 41fa0c8121d8..691c92afaaae 100644
--- a/include/lldb/Utility/SharingPtr.h
+++ b/include/lldb/Utility/SharingPtr.h
@@ -14,9 +14,9 @@
// C++ Includes
#include <memory>
-// Microsoft Visual C++ currently does not enable std::atomic to work
-// in CLR mode - as such we need to "hack around it" for MSVC++ builds only
-// using Windows specific intrinsics instead of the C++11 atomic support
+// Microsoft Visual C++ currently does not enable std::atomic to work in CLR
+// mode - as such we need to "hack around it" for MSVC++ builds only using
+// Windows specific intrinsics instead of the C++11 atomic support
#ifdef _MSC_VER
#include <intrin.h>
#else
diff --git a/include/lldb/Utility/Status.h b/include/lldb/Utility/Status.h
index 8c3e009a8c2e..3bd2cd5b3b41 100644
--- a/include/lldb/Utility/Status.h
+++ b/include/lldb/Utility/Status.h
@@ -28,30 +28,27 @@ class raw_ostream;
namespace lldb_private {
//----------------------------------------------------------------------
-/// @class Status Status.h "lldb/Utility/Status.h"
-/// @brief An error handling class.
+/// @class Status Status.h "lldb/Utility/Status.h" An error handling class.
///
/// This class is designed to be able to hold any error code that can be
-/// encountered on a given platform. The errors are stored as a value
-/// of type Status::ValueType. This value should be large enough to hold
-/// any and all errors that the class supports. Each error has an
-/// associated type that is of type lldb::ErrorType. New types
-/// can be added to support new error types, and architecture specific
-/// types can be enabled. In the future we may wish to switch to a
-/// registration mechanism where new error types can be registered at
-/// runtime instead of a hard coded scheme.
+/// encountered on a given platform. The errors are stored as a value of type
+/// Status::ValueType. This value should be large enough to hold any and all
+/// errors that the class supports. Each error has an associated type that is
+/// of type lldb::ErrorType. New types can be added to support new error
+/// types, and architecture specific types can be enabled. In the future we
+/// may wish to switch to a registration mechanism where new error types can
+/// be registered at runtime instead of a hard coded scheme.
///
-/// All errors in this class also know how to generate a string
-/// representation of themselves for printing results and error codes.
-/// The string value will be fetched on demand and its string value will
-/// be cached until the error is cleared of the value of the error
-/// changes.
+/// All errors in this class also know how to generate a string representation
+/// of themselves for printing results and error codes. The string value will
+/// be fetched on demand and its string value will be cached until the error
+/// is cleared of the value of the error changes.
//----------------------------------------------------------------------
class Status {
public:
//------------------------------------------------------------------
- /// Every error value that this object can contain needs to be able
- /// to fit into ValueType.
+ /// Every error value that this object can contain needs to be able to fit
+ /// into ValueType.
//------------------------------------------------------------------
typedef uint32_t ValueType;
@@ -98,11 +95,10 @@ public:
//------------------------------------------------------------------
/// Get the error string associated with the current error.
//
- /// Gets the error value as a NULL terminated C string. The error
- /// string will be fetched and cached on demand. The error string
- /// will be retrieved from a callback that is appropriate for the
- /// type of the error and will be cached until the error value is
- /// changed or cleared.
+ /// Gets the error value as a NULL terminated C string. The error string
+ /// will be fetched and cached on demand. The error string will be retrieved
+ /// from a callback that is appropriate for the type of the error and will
+ /// be cached until the error value is changed or cleared.
///
/// @return
/// The error as a NULL terminated C string value if the error
@@ -114,8 +110,8 @@ public:
//------------------------------------------------------------------
/// Clear the object state.
///
- /// Reverts the state of this object to contain a generic success
- /// value and frees any cached error string value.
+ /// Reverts the state of this object to contain a generic success value and
+ /// frees any cached error string value.
//------------------------------------------------------------------
void Clear();
@@ -147,8 +143,8 @@ public:
//------------------------------------------------------------------
/// Set accessor from a kern_return_t.
///
- /// Set accesssor for the error value to \a err and the error type
- /// to \c MachKernel.
+ /// Set accesssor for the error value to \a err and the error type to \c
+ /// MachKernel.
///
/// @param[in] err
/// A mach error code.
@@ -163,8 +159,8 @@ public:
//------------------------------------------------------------------
/// Set accesssor with an error value and type.
///
- /// Set accesssor for the error value to \a err and the error type
- /// to \a type.
+ /// Set accesssor for the error value to \a err and the error type to \a
+ /// type.
///
/// @param[in] err
/// A mach error code.
@@ -177,28 +173,28 @@ public:
//------------------------------------------------------------------
/// Set the current error to errno.
///
- /// Update the error value to be \c errno and update the type to
- /// be \c Status::POSIX.
+ /// Update the error value to be \c errno and update the type to be \c
+ /// Status::POSIX.
//------------------------------------------------------------------
void SetErrorToErrno();
//------------------------------------------------------------------
/// Set the current error to a generic error.
///
- /// Update the error value to be \c LLDB_GENERIC_ERROR and update the
- /// type to be \c Status::Generic.
+ /// Update the error value to be \c LLDB_GENERIC_ERROR and update the type
+ /// to be \c Status::Generic.
//------------------------------------------------------------------
void SetErrorToGenericError();
//------------------------------------------------------------------
/// Set the current error string to \a err_str.
///
- /// Set accessor for the error string value for a generic errors,
- /// or to supply additional details above and beyond the standard
- /// error strings that the standard type callbacks typically
- /// provide. This allows custom strings to be supplied as an
- /// error explanation. The error string value will remain until the
- /// error value is cleared or a new error value/type is assigned.
+ /// Set accessor for the error string value for a generic errors, or to
+ /// supply additional details above and beyond the standard error strings
+ /// that the standard type callbacks typically provide. This allows custom
+ /// strings to be supplied as an error explanation. The error string value
+ /// will remain until the error value is cleared or a new error value/type
+ /// is assigned.
///
/// @param err_str
/// The new custom error string to copy and cache.
@@ -224,8 +220,8 @@ public:
//------------------------------------------------------------------
/// Test for success condition.
///
- /// Returns true if the error code in this object is considered a
- /// successful return value.
+ /// Returns true if the error code in this object is considered a successful
+ /// return value.
///
/// @return
/// \b true if this object contains an value that describes
@@ -236,8 +232,8 @@ public:
//------------------------------------------------------------------
/// Test for a failure due to a generic interrupt.
///
- /// Returns true if the error code in this object was caused by an interrupt.
- /// At present only supports Posix EINTR.
+ /// Returns true if the error code in this object was caused by an
+ /// interrupt. At present only supports Posix EINTR.
///
/// @return
/// \b true if this object contains an value that describes
diff --git a/include/lldb/Utility/Stream.h b/include/lldb/Utility/Stream.h
index 5a00f0a50ca3..bf837749fa37 100644
--- a/include/lldb/Utility/Stream.h
+++ b/include/lldb/Utility/Stream.h
@@ -25,7 +25,7 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class Stream Stream.h "lldb/Utility/Stream.h"
-/// @brief A stream class that can stream formatted output to a file.
+/// A stream class that can stream formatted output to a file.
//----------------------------------------------------------------------
class Stream {
public:
@@ -40,15 +40,14 @@ public:
//------------------------------------------------------------------
/// Construct with flags and address size and byte order.
///
- /// Construct with dump flags \a flags and the default address
- /// size. \a flags can be any of the above enumeration logical OR'ed
- /// together.
+ /// Construct with dump flags \a flags and the default address size. \a
+ /// flags can be any of the above enumeration logical OR'ed together.
//------------------------------------------------------------------
Stream(uint32_t flags, uint32_t addr_size, lldb::ByteOrder byte_order);
//------------------------------------------------------------------
- /// Construct a default Stream, not binary, host byte order and
- /// host addr size.
+ /// Construct a default Stream, not binary, host byte order and host addr
+ /// size.
///
//------------------------------------------------------------------
Stream();
@@ -65,16 +64,15 @@ public:
//------------------------------------------------------------------
/// Flush the stream.
///
- /// Subclasses should flush the stream to make any output appear
- /// if the stream has any buffering.
+ /// Subclasses should flush the stream to make any output appear if the
+ /// stream has any buffering.
//------------------------------------------------------------------
virtual void Flush() = 0;
//------------------------------------------------------------------
/// Output character bytes to the stream.
///
- /// Appends \a src_len characters from the buffer \a src to the
- /// stream.
+ /// Appends \a src_len characters from the buffer \a src to the stream.
///
/// @param[in] src
/// A buffer containing at least \a src_len bytes of data.
@@ -95,8 +93,8 @@ public:
//------------------------------------------------------------------
/// Set the byte_order value.
///
- /// Sets the byte order of the data to extract. Extracted values
- /// will be swapped if necessary when decoding.
+ /// Sets the byte order of the data to extract. Extracted values will be
+ /// swapped if necessary when decoding.
///
/// @param[in] byte_order
/// The byte order value to use when extracting data.
@@ -107,9 +105,8 @@ public:
lldb::ByteOrder SetByteOrder(lldb::ByteOrder byte_order);
//------------------------------------------------------------------
- /// Format a C string from a printf style format and variable
- /// arguments and encode and append the resulting C string as hex
- /// bytes.
+ /// Format a C string from a printf style format and variable arguments and
+ /// encode and append the resulting C string as hex bytes.
///
/// @param[in] format
/// A printf style format string.
@@ -124,9 +121,8 @@ public:
__attribute__((__format__(__printf__, 2, 3)));
//------------------------------------------------------------------
- /// Format a C string from a printf style format and variable
- /// arguments and encode and append the resulting C string as hex
- /// bytes.
+ /// Format a C string from a printf style format and variable arguments and
+ /// encode and append the resulting C string as hex bytes.
///
/// @param[in] format
/// A printf style format string.
@@ -163,8 +159,8 @@ public:
size_t PutPointer(void *ptr);
- // Append \a src_len bytes from \a src to the stream as hex characters
- // (two ascii characters per byte of input data)
+ // Append \a src_len bytes from \a src to the stream as hex characters (two
+ // ascii characters per byte of input data)
size_t
PutBytesAsRawHex8(const void *src, size_t src_len,
lldb::ByteOrder src_byte_order = lldb::eByteOrderInvalid,
@@ -314,8 +310,8 @@ public:
//------------------------------------------------------------------
/// Output an address value to this stream.
///
- /// Put an address \a addr out to the stream with optional \a prefix
- /// and \a suffix strings.
+ /// Put an address \a addr out to the stream with optional \a prefix and \a
+ /// suffix strings.
///
/// @param[in] addr
/// An address value.
@@ -335,8 +331,8 @@ public:
//------------------------------------------------------------------
/// Output an address range to this stream.
///
- /// Put an address range \a lo_addr - \a hi_addr out to the stream
- /// with optional \a prefix and \a suffix strings.
+ /// Put an address range \a lo_addr - \a hi_addr out to the stream with
+ /// optional \a prefix and \a suffix strings.
///
/// @param[in] lo_addr
/// The start address of the address range.
@@ -415,8 +411,8 @@ public:
//------------------------------------------------------------------
/// Indent the current line in the stream.
///
- /// Indent the current line using the current indentation level and
- /// print an optional string following the indentation spaces.
+ /// Indent the current line using the current indentation level and print an
+ /// optional string following the indentation spaces.
///
/// @param[in] s
/// A C string to print following the indentation. If nullptr, just
@@ -438,8 +434,8 @@ public:
//------------------------------------------------------------------
/// Output an offset value.
///
- /// Put an offset \a uval out to the stream using the printf format
- /// in \a format.
+ /// Put an offset \a uval out to the stream using the printf format in \a
+ /// format.
///
/// @param[in] offset
/// The offset value.
@@ -472,8 +468,8 @@ public:
//------------------------------------------------------------------
/// Output a quoted C string value to the stream.
///
- /// Print a double quoted NULL terminated C string to the stream
- /// using the printf format in \a format.
+ /// Print a double quoted NULL terminated C string to the stream using the
+ /// printf format in \a format.
///
/// @param[in] cstr
/// A NULL terminated C string value.
@@ -503,8 +499,8 @@ public:
//------------------------------------------------------------------
/// Output a SLEB128 number to the stream.
///
- /// Put an SLEB128 \a uval out to the stream using the printf format
- /// in \a format.
+ /// Put an SLEB128 \a uval out to the stream using the printf format in \a
+ /// format.
///
/// @param[in] uval
/// A uint64_t value that was extracted as a SLEB128 value.
@@ -517,8 +513,8 @@ public:
//------------------------------------------------------------------
/// Output a ULEB128 number to the stream.
///
- /// Put an ULEB128 \a uval out to the stream using the printf format
- /// in \a format.
+ /// Put an ULEB128 \a uval out to the stream using the printf format in \a
+ /// format.
///
/// @param[in] uval
/// A uint64_t value that was extracted as a ULEB128 value.
diff --git a/include/lldb/Utility/StreamTee.h b/include/lldb/Utility/StreamTee.h
index 676178a0fe75..569ba1979978 100644
--- a/include/lldb/Utility/StreamTee.h
+++ b/include/lldb/Utility/StreamTee.h
@@ -61,10 +61,9 @@ public:
std::lock_guard<std::recursive_mutex> guard(m_streams_mutex);
collection::iterator pos, end;
for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) {
- // Allow for our collection to contain NULL streams. This allows
- // the StreamTee to be used with hard coded indexes for clients
- // that might want N total streams with only a few that are set
- // to valid values.
+ // Allow for our collection to contain NULL streams. This allows the
+ // StreamTee to be used with hard coded indexes for clients that might
+ // want N total streams with only a few that are set to valid values.
Stream *strm = pos->get();
if (strm)
strm->Flush();
@@ -79,10 +78,9 @@ public:
size_t min_bytes_written = SIZE_MAX;
collection::iterator pos, end;
for (pos = m_streams.begin(), end = m_streams.end(); pos != end; ++pos) {
- // Allow for our collection to contain NULL streams. This allows
- // the StreamTee to be used with hard coded indexes for clients
- // that might want N total streams with only a few that are set
- // to valid values.
+ // Allow for our collection to contain NULL streams. This allows the
+ // StreamTee to be used with hard coded indexes for clients that might
+ // want N total streams with only a few that are set to valid values.
Stream *strm = pos->get();
if (strm) {
const size_t bytes_written = strm->Write(s, length);
@@ -121,10 +119,9 @@ public:
void SetStreamAtIndex(uint32_t idx, const lldb::StreamSP &stream_sp) {
std::lock_guard<std::recursive_mutex> guard(m_streams_mutex);
- // Resize our stream vector as necessary to fit as many streams
- // as needed. This also allows this class to be used with hard
- // coded indexes that can be used contain many streams, not all
- // of which are valid.
+ // Resize our stream vector as necessary to fit as many streams as needed.
+ // This also allows this class to be used with hard coded indexes that can
+ // be used contain many streams, not all of which are valid.
if (idx >= m_streams.size())
m_streams.resize(idx + 1);
m_streams[idx] = stream_sp;
diff --git a/include/lldb/Utility/StringExtractor.h b/include/lldb/Utility/StringExtractor.h
index 311cec87e695..4b75d5c5484d 100644
--- a/include/lldb/Utility/StringExtractor.h
+++ b/include/lldb/Utility/StringExtractor.h
@@ -41,8 +41,8 @@ public:
m_index = 0;
}
- // Returns true if the file position is still valid for the data
- // contained in this string extractor object.
+ // Returns true if the file position is still valid for the data contained in
+ // this string extractor object.
bool IsGood() const { return m_index != UINT64_MAX; }
uint64_t GetFilePos() const { return m_index; }
@@ -129,9 +129,9 @@ protected:
//------------------------------------------------------------------
std::string m_packet; // The string in which to extract data.
uint64_t m_index; // When extracting data from a packet, this index
- // will march along as things get extracted. If set
- // to UINT64_MAX the end of the packet data was
- // reached when decoding information
+ // will march along as things get extracted. If set to
+ // UINT64_MAX the end of the packet data was reached
+ // when decoding information
};
#endif // utility_StringExtractor_h_
diff --git a/source/Utility/StringExtractorGDBRemote.h b/include/lldb/Utility/StringExtractorGDBRemote.h
index f4ed642a706e..93e760b88112 100644
--- a/source/Utility/StringExtractorGDBRemote.h
+++ b/include/lldb/Utility/StringExtractorGDBRemote.h
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef utility_StringExtractorGDBRemote_h_
-#define utility_StringExtractorGDBRemote_h_
+#ifndef LLDB_UTILITY_STRINGEXTRACTORGDBREMOTE_H
+#define LLDB_UTILITY_STRINGEXTRACTORGDBREMOTE_H
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StringExtractor.h"
@@ -188,8 +188,8 @@ public:
bool IsErrorResponse() const;
- // Returns zero if the packet isn't a EXX packet where XX are two hex
- // digits. Otherwise the error encoded in XX is returned.
+ // Returns zero if the packet isn't a EXX packet where XX are two hex digits.
+ // Otherwise the error encoded in XX is returned.
uint8_t GetError();
lldb_private::Status GetStatus();
@@ -201,4 +201,4 @@ protected:
void *m_validator_baton;
};
-#endif // utility_StringExtractorGDBRemote_h_
+#endif // LLDB_UTILITY_STRINGEXTRACTORGDBREMOTE_H
diff --git a/include/lldb/Utility/StringList.h b/include/lldb/Utility/StringList.h
index 6553e5dfdfb9..1cb68885e771 100644
--- a/include/lldb/Utility/StringList.h
+++ b/include/lldb/Utility/StringList.h
@@ -100,20 +100,17 @@ public:
// Copy assignment for a vector of strings
StringList &operator=(const std::vector<std::string> &rhs);
- // This string list contains a list of valid auto completion
- // strings, and the "s" is passed in. "matches" is filled in
- // with zero or more string values that start with "s", and
- // the first string to exactly match one of the string
- // values in this collection, will have "exact_matches_idx"
- // filled in to match the index, or "exact_matches_idx" will
- // have SIZE_MAX
+ // This string list contains a list of valid auto completion strings, and the
+ // "s" is passed in. "matches" is filled in with zero or more string values
+ // that start with "s", and the first string to exactly match one of the
+ // string values in this collection, will have "exact_matches_idx" filled in
+ // to match the index, or "exact_matches_idx" will have SIZE_MAX
size_t AutoComplete(llvm::StringRef s, StringList &matches,
size_t &exact_matches_idx) const;
// Dump the StringList to the given lldb_private::Log, `log`, one item per
- // line.
- // If given, `name` will be used to identify the start and end of the list in
- // the output.
+ // line. If given, `name` will be used to identify the start and end of the
+ // list in the output.
virtual void LogDump(Log *log, const char *name = nullptr);
// Static helper to convert an iterable of strings to a StringList, and then
diff --git a/include/lldb/Utility/StructuredData.h b/include/lldb/Utility/StructuredData.h
index 2ea5fb98e055..d3ebab16f51d 100644
--- a/include/lldb/Utility/StructuredData.h
+++ b/include/lldb/Utility/StructuredData.h
@@ -38,17 +38,17 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class StructuredData StructuredData.h "lldb/Utility/StructuredData.h"
-/// @brief A class which can hold structured data
+/// A class which can hold structured data
///
-/// The StructuredData class is designed to hold the data from a JSON
-/// or plist style file -- a serialized data structure with dictionaries
-/// (maps, hashes), arrays, and concrete values like integers, floating
-/// point numbers, strings, booleans.
+/// The StructuredData class is designed to hold the data from a JSON or plist
+/// style file -- a serialized data structure with dictionaries (maps,
+/// hashes), arrays, and concrete values like integers, floating point
+/// numbers, strings, booleans.
///
-/// StructuredData does not presuppose any knowledge of the schema for
-/// the data it is holding; it can parse JSON data, for instance, and
-/// other parts of lldb can iterate through the parsed data set to find
-/// keys and values that may be present.
+/// StructuredData does not presuppose any knowledge of the schema for the
+/// data it is holding; it can parse JSON data, for instance, and other parts
+/// of lldb can iterate through the parsed data set to find keys and values
+/// that may be present.
//----------------------------------------------------------------------
class StructuredData {
diff --git a/include/lldb/Utility/TildeExpressionResolver.h b/include/lldb/Utility/TildeExpressionResolver.h
index 84620320c7ac..ae6b4073f6aa 100644
--- a/include/lldb/Utility/TildeExpressionResolver.h
+++ b/include/lldb/Utility/TildeExpressionResolver.h
@@ -22,7 +22,7 @@ class TildeExpressionResolver {
public:
virtual ~TildeExpressionResolver();
- /// \brief Resolve a Tilde Expression contained according to bash rules.
+ /// Resolve a Tilde Expression contained according to bash rules.
///
/// \param Expr Contains the tilde expression to resolve. A valid tilde
/// expression must begin with a tilde and contain only non
@@ -35,7 +35,7 @@ public:
virtual bool ResolveExact(llvm::StringRef Expr,
llvm::SmallVectorImpl<char> &Output) = 0;
- /// \brief Auto-complete a tilde expression with all matching values.
+ /// Auto-complete a tilde expression with all matching values.
///
/// \param Expr Contains the tilde expression prefix to resolve. See
/// ResolveExact() for validity rules.
@@ -48,8 +48,8 @@ public:
virtual bool ResolvePartial(llvm::StringRef Expr,
llvm::StringSet<> &Output) = 0;
- /// \brief Resolve an entire path that begins with a tilde expression,
- /// replacing the username portion with the matched result.
+ /// Resolve an entire path that begins with a tilde expression, replacing
+ /// the username portion with the matched result.
bool ResolveFullPath(llvm::StringRef Expr,
llvm::SmallVectorImpl<char> &Output);
};
diff --git a/include/lldb/Utility/Timeout.h b/include/lldb/Utility/Timeout.h
index 7b627a45fc63..ecb33b346e96 100644
--- a/include/lldb/Utility/Timeout.h
+++ b/include/lldb/Utility/Timeout.h
@@ -22,9 +22,9 @@ namespace lldb_private {
// from Timeout<std::milli> to Timeout<std::micro>.
//
// The intended meaning of the values is:
-// - llvm::None - no timeout, the call should wait forever
-// - 0 - poll, only complete the call if it will not block
-// - >0 - wait for a given number of units for the result
+// - llvm::None - no timeout, the call should wait forever - 0 - poll, only
+// complete the call if it will not block - >0 - wait for a given number of
+// units for the result
template <typename Ratio>
class Timeout : public llvm::Optional<std::chrono::duration<int64_t, Ratio>> {
private:
diff --git a/include/lldb/Utility/Timer.h b/include/lldb/Utility/Timer.h
index c06ac17d344d..2c1e984837c2 100644
--- a/include/lldb/Utility/Timer.h
+++ b/include/lldb/Utility/Timer.h
@@ -20,7 +20,7 @@ class Stream;
//----------------------------------------------------------------------
/// @class Timer Timer.h "lldb/Utility/Timer.h"
-/// @brief A timer class that simplifies common timing metrics.
+/// A timer class that simplifies common timing metrics.
//----------------------------------------------------------------------
class Timer {
diff --git a/include/lldb/Utility/UUID.h b/include/lldb/Utility/UUID.h
index 5e64e9079789..d42c88862bfa 100644
--- a/include/lldb/Utility/UUID.h
+++ b/include/lldb/Utility/UUID.h
@@ -15,6 +15,7 @@
#include <stddef.h>
#include <stdint.h>
#include <string>
+#include "llvm/ADT/ArrayRef.h"
namespace llvm {
class StringRef;
@@ -26,36 +27,49 @@ namespace lldb_private {
class UUID {
public:
- // Most UUIDs are 16 bytes, but some Linux build-ids (SHA1) are 20.
- typedef uint8_t ValueType[20];
-
- //------------------------------------------------------------------
- // Constructors and Destructors
- //------------------------------------------------------------------
- UUID();
- UUID(const UUID &rhs);
- UUID(const void *uuid_bytes, uint32_t num_uuid_bytes);
-
- ~UUID();
-
- const UUID &operator=(const UUID &rhs);
-
- void Clear();
+ UUID() = default;
+
+ /// Creates a UUID from the data pointed to by the bytes argument. No special
+ /// significance is attached to any of the values.
+ static UUID fromData(const void *bytes, uint32_t num_bytes) {
+ if (bytes)
+ return fromData({reinterpret_cast<const uint8_t *>(bytes), num_bytes});
+ return UUID();
+ }
+
+ /// Creates a uuid from the data pointed to by the bytes argument. No special
+ /// significance is attached to any of the values.
+ static UUID fromData(llvm::ArrayRef<uint8_t> bytes) { return UUID(bytes); }
+
+ /// Creates a UUID from the data pointed to by the bytes argument. Data
+ /// consisting purely of zero bytes is treated as an invalid UUID.
+ static UUID fromOptionalData(const void *bytes, uint32_t num_bytes) {
+ if (bytes)
+ return fromOptionalData(
+ {reinterpret_cast<const uint8_t *>(bytes), num_bytes});
+ return UUID();
+ }
+
+ /// Creates a UUID from the data pointed to by the bytes argument. Data
+ /// consisting purely of zero bytes is treated as an invalid UUID.
+ static UUID fromOptionalData(llvm::ArrayRef<uint8_t> bytes) {
+ if (llvm::all_of(bytes, [](uint8_t b) { return b == 0; }))
+ return UUID();
+ return UUID(bytes);
+ }
+
+ void Clear() { m_bytes.clear(); }
void Dump(Stream *s) const;
- const void *GetBytes() const;
+ llvm::ArrayRef<uint8_t> GetBytes() const { return m_bytes; }
- size_t GetByteSize() const;
+ explicit operator bool() const { return IsValid(); }
+ bool IsValid() const { return !m_bytes.empty(); }
- bool IsValid() const;
-
- bool SetBytes(const void *uuid_bytes, uint32_t num_uuid_bytes = 16);
-
- std::string GetAsString(const char *separator = nullptr) const;
+ std::string GetAsString(llvm::StringRef separator = "-") const;
size_t SetFromStringRef(llvm::StringRef str, uint32_t num_uuid_bytes = 16);
- size_t SetFromCString(const char *c_str, uint32_t num_uuid_bytes = 16);
// Decode as many UUID bytes (up to 16) as possible from the C string "cstr"
// This is used for auto completion where a partial UUID might have been
@@ -77,25 +91,34 @@ public:
/// The original string, with all decoded bytes removed.
//------------------------------------------------------------------
static llvm::StringRef
- DecodeUUIDBytesFromString(llvm::StringRef str, ValueType &uuid_bytes,
- uint32_t &bytes_decoded,
+ DecodeUUIDBytesFromString(llvm::StringRef str,
+ llvm::SmallVectorImpl<uint8_t> &uuid_bytes,
uint32_t num_uuid_bytes = 16);
-protected:
- //------------------------------------------------------------------
- // Classes that inherit from UUID can see and modify these
- //------------------------------------------------------------------
- uint32_t m_num_uuid_bytes; // Should be 16 or 20
- ValueType m_uuid;
+private:
+ UUID(llvm::ArrayRef<uint8_t> bytes) : m_bytes(bytes.begin(), bytes.end()) {}
+
+ // GNU ld generates 20-byte build-ids. Size chosen to avoid heap allocations
+ // for this case.
+ llvm::SmallVector<uint8_t, 20> m_bytes;
+
+ friend bool operator==(const UUID &LHS, const UUID &RHS) {
+ return LHS.m_bytes == RHS.m_bytes;
+ }
+ friend bool operator!=(const UUID &LHS, const UUID &RHS) {
+ return !(LHS == RHS);
+ }
+ friend bool operator<(const UUID &LHS, const UUID &RHS) {
+ return LHS.m_bytes < RHS.m_bytes;
+ }
+ friend bool operator<=(const UUID &LHS, const UUID &RHS) {
+ return !(RHS < LHS);
+ }
+ friend bool operator>(const UUID &LHS, const UUID &RHS) { return RHS < LHS; }
+ friend bool operator>=(const UUID &LHS, const UUID &RHS) {
+ return !(LHS < RHS);
+ }
};
-
-bool operator==(const UUID &lhs, const UUID &rhs);
-bool operator!=(const UUID &lhs, const UUID &rhs);
-bool operator<(const UUID &lhs, const UUID &rhs);
-bool operator<=(const UUID &lhs, const UUID &rhs);
-bool operator>(const UUID &lhs, const UUID &rhs);
-bool operator>=(const UUID &lhs, const UUID &rhs);
-
} // namespace lldb_private
#endif // LLDB_UTILITY_UUID_H
diff --git a/include/lldb/Utility/UserID.h b/include/lldb/Utility/UserID.h
index b178efd44fe4..9e15e6a43c6c 100644
--- a/include/lldb/Utility/UserID.h
+++ b/include/lldb/Utility/UserID.h
@@ -20,14 +20,14 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class UserID UserID.h "lldb/Core/UserID.h"
-/// @brief A mix in class that contains a generic user ID.
+/// A mix in class that contains a generic user ID.
///
-/// UserID is designed as a mix in class that can contain an integer
-/// based unique identifier for a variety of objects in lldb.
+/// UserID is designed as a mix in class that can contain an integer based
+/// unique identifier for a variety of objects in lldb.
///
-/// The value for this identifier is chosen by each parser plug-in. A
-/// value should be chosen that makes sense for each kind of object
-/// and should allow quick access to further and more in depth parsing.
+/// The value for this identifier is chosen by each parser plug-in. A value
+/// should be chosen that makes sense for each kind of object and should allow
+/// quick access to further and more in depth parsing.
///
/// Symbol table entries can use this to store the original symbol table
/// index, functions can use it to store the symbol table index or the
@@ -68,11 +68,9 @@ struct UserID {
void SetID(lldb::user_id_t uid) { m_uid = uid; }
//------------------------------------------------------------------
- /// Unary predicate function object that can search for a matching
- /// user ID.
+ /// Unary predicate function object that can search for a matching user ID.
///
- /// Function object that can be used on any class that inherits
- /// from UserID:
+ /// Function object that can be used on any class that inherits from UserID:
/// \code
/// iterator pos;
/// pos = std::find_if (coll.begin(), coll.end(), UserID::IDMatches(blockID));
diff --git a/include/lldb/lldb-defines.h b/include/lldb/lldb-defines.h
index a1318f4412e9..edb70be09fd9 100644
--- a/include/lldb/lldb-defines.h
+++ b/include/lldb/lldb-defines.h
@@ -12,7 +12,7 @@
#include "lldb/lldb-types.h"
-#if defined(_MSC_VER)
+#if defined(_WIN32)
#if defined(EXPORT_LIBLLDB)
#define LLDB_API __declspec(dllexport)
#elif defined(IMPORT_LIBLLDB)
@@ -20,7 +20,7 @@
#else
#define LLDB_API
#endif
-#else // defined (_MSC_VER)
+#else // defined (_WIN32)
#define LLDB_API
#endif
diff --git a/include/lldb/lldb-enumerations.h b/include/lldb/lldb-enumerations.h
index 760e12b0e799..a1f730379534 100644
--- a/include/lldb/lldb-enumerations.h
+++ b/include/lldb/lldb-enumerations.h
@@ -21,8 +21,8 @@
// warning, as it's part of -Wmicrosoft which also catches a whole slew of
// other useful issues.
//
-// To make matters worse, early versions of SWIG don't recognize the syntax
-// of specifying the underlying type of an enum (and Python doesn't care anyway)
+// To make matters worse, early versions of SWIG don't recognize the syntax of
+// specifying the underlying type of an enum (and Python doesn't care anyway)
// so we need a way to specify the underlying type when the enum is being used
// from C++ code, but just use a regular enum when swig is pre-processing.
#define FLAGS_ENUM(Name) enum Name : unsigned
@@ -44,6 +44,9 @@ enum StateType {
///launched or attached to anything yet
eStateAttaching, ///< Process is currently trying to attach
eStateLaunching, ///< Process is in the process of launching
+ // The state changes eStateAttaching and eStateLaunching are both sent while the
+ // private state thread is either not yet started or paused. For that reason, they
+ // should only be signaled as public state changes, and not private state changes.
eStateStopped, ///< Process or thread is stopped and can be examined.
eStateRunning, ///< Process or thread is running and can't be examined.
eStateStepping, ///< Process or thread is in the process of stepping and can
@@ -193,9 +196,8 @@ enum ScriptLanguage {
//----------------------------------------------------------------------
// Register numbering types
-// See RegisterContext::ConvertRegisterKindToRegisterNumber to convert
-// any of these to the lldb internal register numbering scheme
-// (eRegisterKindLLDB).
+// See RegisterContext::ConvertRegisterKindToRegisterNumber to convert any of
+// these to the lldb internal register numbering scheme (eRegisterKindLLDB).
//----------------------------------------------------------------------
enum RegisterKind {
eRegisterKindEHFrame = 0, // the register numbers seen in eh_frame
@@ -445,8 +447,8 @@ enum LanguageType {
// Vendor Extensions
// Note: Language::GetNameForLanguageType
// assumes these can be used as indexes into array language_names, and
- // Language::SetLanguageFromCString and Language::AsCString
- // assume these can be used as indexes into array g_languages.
+ // Language::SetLanguageFromCString and Language::AsCString assume these can
+ // be used as indexes into array g_languages.
eLanguageTypeMipsAssembler = 0x0024, ///< Mips_Assembler.
eLanguageTypeExtRenderScript = 0x0025, ///< RenderScript.
eNumLanguageTypes
@@ -624,7 +626,7 @@ enum SectionType {
eSectionTypeDebug,
eSectionTypeZeroFill,
eSectionTypeDataObjCMessageRefs, // Pointer to function pointer + selector
- eSectionTypeDataObjCCFStrings, // Objective C const CFString/NSString objects
+ eSectionTypeDataObjCCFStrings, // Objective-C const CFString/NSString objects
eSectionTypeDWARFDebugAbbrev,
eSectionTypeDWARFDebugAddr,
eSectionTypeDWARFDebugAranges,
@@ -656,6 +658,9 @@ enum SectionType {
eSectionTypeGoSymtab,
eSectionTypeAbsoluteAddress, // Dummy section for symbols with absolute
// address
+ eSectionTypeDWARFGNUDebugAltLink,
+ eSectionTypeDWARFDebugTypes, // DWARF .debug_types section
+ eSectionTypeDWARFDebugNames, // DWARF v5 .debug_names
eSectionTypeOther
};
@@ -670,10 +675,10 @@ FLAGS_ENUM(FunctionNameType){
(1u << 1), // Automatically figure out which FunctionNameType
// bits to set based on the function name.
eFunctionNameTypeFull = (1u << 2), // The function name.
- // For C this is the same as just the name of the function
- // For C++ this is the mangled or demangled version of the mangled name.
- // For ObjC this is the full function signature with the + or
- // - and the square brackets and the class and selector
+ // For C this is the same as just the name of the function For C++ this is
+ // the mangled or demangled version of the mangled name. For ObjC this is
+ // the full function signature with the + or - and the square brackets and
+ // the class and selector
eFunctionNameTypeBase = (1u << 3), // The function name only, no namespaces
// or arguments and no class
// methods or selectors will be searched.
@@ -772,8 +777,8 @@ enum TemplateArgumentKind {
};
//----------------------------------------------------------------------
-// Options that can be set for a formatter to alter its behavior
-// Not all of these are applicable to all formatter types
+// Options that can be set for a formatter to alter its behavior Not all of
+// these are applicable to all formatter types
//----------------------------------------------------------------------
FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
eTypeOptionCascade = (1u << 0),
@@ -784,23 +789,22 @@ FLAGS_ENUM(TypeOptions){eTypeOptionNone = (0u),
eTypeOptionShowOneLiner = (1u << 5),
eTypeOptionHideNames = (1u << 6),
eTypeOptionNonCacheable = (1u << 7),
- eTypeOptionHideEmptyAggregates = (1u << 8)};
+ eTypeOptionHideEmptyAggregates = (1u << 8),
+ eTypeOptionFrontEndWantsDereference = (1u << 9)
+};
//----------------------------------------------------------------------
-// This is the return value for frame comparisons. If you are comparing frame A
-// to frame B
-// the following cases arise:
-// 1) When frame A pushes frame B (or a frame that ends up pushing B) A is Older
-// than B.
-// 2) When frame A pushed frame B (or if frame A is on the stack but B is not) A
-// is Younger than B
-// 3) When frame A and frame B have the same StackID, they are Equal.
-// 4) When frame A and frame B have the same immediate parent frame, but are not
-// equal, the comparison yields
+// This is the return value for frame comparisons. If you are comparing frame
+// A to frame B the following cases arise: 1) When frame A pushes frame B (or a
+// frame that ends up pushing B) A is Older than B. 2) When frame A pushed
+// frame B (or if frame A is on the stack but B is not) A is Younger than B 3)
+// When frame A and frame B have the same StackID, they are Equal. 4) When
+// frame A and frame B have the same immediate parent frame, but are not equal,
+// the comparison yields
// SameParent.
// 5) If the two frames are on different threads or processes the comparison is
-// Invalid
-// 6) If for some reason we can't figure out what went on, we return Unknown.
+// Invalid 6) If for some reason we can't figure out what went on, we return
+// Unknown.
//----------------------------------------------------------------------
enum FrameComparison {
eFrameCompareInvalid,
@@ -812,31 +816,10 @@ enum FrameComparison {
};
//----------------------------------------------------------------------
-// Address Class
-//
-// A way of classifying an address used for disassembling and setting
-// breakpoints. Many object files can track exactly what parts of their
-// object files are code, data and other information. This is of course
-// above and beyond just looking at the section types. For example, code
-// might contain PC relative data and the object file might be able to
-// tell us that an address in code is data.
-//----------------------------------------------------------------------
-enum AddressClass {
- eAddressClassInvalid,
- eAddressClassUnknown,
- eAddressClassCode,
- eAddressClassCodeAlternateISA,
- eAddressClassData,
- eAddressClassDebug,
- eAddressClassRuntime
-};
-
-//----------------------------------------------------------------------
// File Permissions
//
-// Designed to mimic the unix file permission bits so they can be
-// used with functions that set 'mode_t' to certain values for
-// permissions.
+// Designed to mimic the unix file permission bits so they can be used with
+// functions that set 'mode_t' to certain values for permissions.
//----------------------------------------------------------------------
FLAGS_ENUM(FilePermissions){
eFilePermissionsUserRead = (1u << 8), eFilePermissionsUserWrite = (1u << 7),
@@ -896,8 +879,8 @@ FLAGS_ENUM(FilePermissions){
//----------------------------------------------------------------------
// Queue work item types
//
-// The different types of work that can be enqueued on a libdispatch
-// aka Grand Central Dispatch (GCD) queue.
+// The different types of work that can be enqueued on a libdispatch aka Grand
+// Central Dispatch (GCD) queue.
//----------------------------------------------------------------------
enum QueueItemKind {
eQueueItemKindUnknown = 0,
@@ -931,8 +914,8 @@ enum ExpressionEvaluationPhase {
//----------------------------------------------------------------------
// Watchpoint Kind
-// Indicates what types of events cause the watchpoint to fire.
-// Used by Native*Protocol-related classes.
+// Indicates what types of events cause the watchpoint to fire. Used by Native
+// *Protocol-related classes.
//----------------------------------------------------------------------
FLAGS_ENUM(WatchpointKind){eWatchpointKindWrite = (1u << 0),
eWatchpointKindRead = (1u << 1)};
@@ -947,9 +930,9 @@ enum GdbSignal {
};
//----------------------------------------------------------------------
-// Used with SBHost::GetPath (lldb::PathType) to find files that are
-// related to LLDB on the current host machine. Most files are relative
-// to LLDB or are in known locations.
+// Used with SBHost::GetPath (lldb::PathType) to find files that are related to
+// LLDB on the current host machine. Most files are relative to LLDB or are in
+// known locations.
//----------------------------------------------------------------------
enum PathType {
ePathTypeLLDBShlibDir, // The directory where the lldb.so (unix) or LLDB
@@ -1008,58 +991,54 @@ FLAGS_ENUM(CommandFlags){
//----------------------------------------------------------------------
// eCommandRequiresTarget
//
- // Ensures a valid target is contained in m_exe_ctx prior to executing
- // the command. If a target doesn't exist or is invalid, the command
- // will fail and CommandObject::GetInvalidTargetDescription() will be
- // returned as the error. CommandObject subclasses can override the
- // virtual function for GetInvalidTargetDescription() to provide custom
- // strings when needed.
+ // Ensures a valid target is contained in m_exe_ctx prior to executing the
+ // command. If a target doesn't exist or is invalid, the command will fail
+ // and CommandObject::GetInvalidTargetDescription() will be returned as the
+ // error. CommandObject subclasses can override the virtual function for
+ // GetInvalidTargetDescription() to provide custom strings when needed.
//----------------------------------------------------------------------
eCommandRequiresTarget = (1u << 0),
//----------------------------------------------------------------------
// eCommandRequiresProcess
//
- // Ensures a valid process is contained in m_exe_ctx prior to executing
- // the command. If a process doesn't exist or is invalid, the command
- // will fail and CommandObject::GetInvalidProcessDescription() will be
- // returned as the error. CommandObject subclasses can override the
- // virtual function for GetInvalidProcessDescription() to provide custom
- // strings when needed.
+ // Ensures a valid process is contained in m_exe_ctx prior to executing the
+ // command. If a process doesn't exist or is invalid, the command will fail
+ // and CommandObject::GetInvalidProcessDescription() will be returned as
+ // the error. CommandObject subclasses can override the virtual function
+ // for GetInvalidProcessDescription() to provide custom strings when
+ // needed.
//----------------------------------------------------------------------
eCommandRequiresProcess = (1u << 1),
//----------------------------------------------------------------------
// eCommandRequiresThread
//
- // Ensures a valid thread is contained in m_exe_ctx prior to executing
- // the command. If a thread doesn't exist or is invalid, the command
- // will fail and CommandObject::GetInvalidThreadDescription() will be
- // returned as the error. CommandObject subclasses can override the
- // virtual function for GetInvalidThreadDescription() to provide custom
- // strings when needed.
+ // Ensures a valid thread is contained in m_exe_ctx prior to executing the
+ // command. If a thread doesn't exist or is invalid, the command will fail
+ // and CommandObject::GetInvalidThreadDescription() will be returned as the
+ // error. CommandObject subclasses can override the virtual function for
+ // GetInvalidThreadDescription() to provide custom strings when needed.
//----------------------------------------------------------------------
eCommandRequiresThread = (1u << 2),
//----------------------------------------------------------------------
// eCommandRequiresFrame
//
- // Ensures a valid frame is contained in m_exe_ctx prior to executing
- // the command. If a frame doesn't exist or is invalid, the command
- // will fail and CommandObject::GetInvalidFrameDescription() will be
- // returned as the error. CommandObject subclasses can override the
- // virtual function for GetInvalidFrameDescription() to provide custom
- // strings when needed.
+ // Ensures a valid frame is contained in m_exe_ctx prior to executing the
+ // command. If a frame doesn't exist or is invalid, the command will fail
+ // and CommandObject::GetInvalidFrameDescription() will be returned as the
+ // error. CommandObject subclasses can override the virtual function for
+ // GetInvalidFrameDescription() to provide custom strings when needed.
//----------------------------------------------------------------------
eCommandRequiresFrame = (1u << 3),
//----------------------------------------------------------------------
// eCommandRequiresRegContext
//
- // Ensures a valid register context (from the selected frame if there
- // is a frame in m_exe_ctx, or from the selected thread from m_exe_ctx)
- // is available from m_exe_ctx prior to executing the command. If a
- // target doesn't exist or is invalid, the command will fail and
- // CommandObject::GetInvalidRegContextDescription() will be returned as
- // the error. CommandObject subclasses can override the virtual function
- // for GetInvalidRegContextDescription() to provide custom strings when
- // needed.
+ // Ensures a valid register context (from the selected frame if there is a
+ // frame in m_exe_ctx, or from the selected thread from m_exe_ctx) is
+ // available from m_exe_ctx prior to executing the command. If a target
+ // doesn't exist or is invalid, the command will fail and
+ // CommandObject::GetInvalidRegContextDescription() will be returned as the
+ // error. CommandObject subclasses can override the virtual function for
+ // GetInvalidRegContextDescription() to provide custom strings when needed.
//----------------------------------------------------------------------
eCommandRequiresRegContext = (1u << 4),
//----------------------------------------------------------------------
@@ -1073,15 +1052,15 @@ FLAGS_ENUM(CommandFlags){
//----------------------------------------------------------------------
// eCommandProcessMustBeLaunched
//
- // Verifies that there is a launched process in m_exe_ctx, if there
- // isn't, the command will fail with an appropriate error message.
+ // Verifies that there is a launched process in m_exe_ctx, if there isn't,
+ // the command will fail with an appropriate error message.
//----------------------------------------------------------------------
eCommandProcessMustBeLaunched = (1u << 6),
//----------------------------------------------------------------------
// eCommandProcessMustBePaused
//
- // Verifies that there is a paused process in m_exe_ctx, if there
- // isn't, the command will fail with an appropriate error message.
+ // Verifies that there is a paused process in m_exe_ctx, if there isn't,
+ // the command will fail with an appropriate error message.
//----------------------------------------------------------------------
eCommandProcessMustBePaused = (1u << 7)};
diff --git a/include/lldb/lldb-forward.h b/include/lldb/lldb-forward.h
index a324edf9da3b..e3964268dfda 100644
--- a/include/lldb/lldb-forward.h
+++ b/include/lldb/lldb-forward.h
@@ -76,6 +76,7 @@ class ConnectionFileDescriptor;
class ConstString;
class CXXSyntheticChildren;
class DWARFCallFrameInfo;
+class DWARFDataExtractor;
class DWARFExpression;
class DataBuffer;
class DataEncoder;
diff --git a/include/lldb/lldb-private-defines.h b/include/lldb/lldb-private-defines.h
index 22172366c259..9b6594422e82 100644
--- a/include/lldb/lldb-private-defines.h
+++ b/include/lldb/lldb-private-defines.h
@@ -23,7 +23,7 @@
#endif
/// \macro LLVM_FALLTHROUGH
-/// \brief Marks an empty statement preceding a deliberate switch fallthrough.
+/// Marks an empty statement preceding a deliberate switch fallthrough.
#if __has_cpp_attribute(clang::fallthrough)
#define LLVM_FALLTHROUGH [[clang::fallthrough]]
#else
diff --git a/include/lldb/lldb-private-enumerations.h b/include/lldb/lldb-private-enumerations.h
index 983ddf3d23d6..c25f285c9713 100644
--- a/include/lldb/lldb-private-enumerations.h
+++ b/include/lldb/lldb-private-enumerations.h
@@ -43,6 +43,26 @@ typedef enum AddressType {
} AddressType;
//----------------------------------------------------------------------
+// Address Class
+//
+// A way of classifying an address used for disassembling and setting
+// breakpoints. Many object files can track exactly what parts of their object
+// files are code, data and other information. This is of course above and
+// beyond just looking at the section types. For example, code might contain PC
+// relative data and the object file might be able to tell us that an address
+// in code is data.
+//----------------------------------------------------------------------
+enum class AddressClass {
+ eInvalid,
+ eUnknown,
+ eCode,
+ eCodeAlternateISA,
+ eData,
+ eDebug,
+ eRuntime
+};
+
+//----------------------------------------------------------------------
// Votes - Need a tri-state, yes, no, no opinion...
//----------------------------------------------------------------------
typedef enum Vote { eVoteNo = -1, eVoteNoOpinion = 0, eVoteYes = 1 } Vote;
@@ -105,9 +125,9 @@ typedef enum SortOrder {
} SortOrder;
//----------------------------------------------------------------------
-// LazyBool is for boolean values that need to be calculated lazily.
-// Values start off set to eLazyBoolCalculate, and then they can be
-// calculated once and set to eLazyBoolNo or eLazyBoolYes.
+// LazyBool is for boolean values that need to be calculated lazily. Values
+// start off set to eLazyBoolCalculate, and then they can be calculated once
+// and set to eLazyBoolNo or eLazyBoolYes.
//----------------------------------------------------------------------
typedef enum LazyBool {
eLazyBoolCalculate = -1,
@@ -217,8 +237,7 @@ enum class LineStatus {
enum class TypeValidatorResult : bool { Success = true, Failure = false };
//----------------------------------------------------------------------
-// Enumerations that can be used to specify scopes types when looking up
-// types.
+// Enumerations that can be used to specify scopes types when looking up types.
//----------------------------------------------------------------------
enum class CompilerContextKind {
Invalid = 0,
@@ -234,6 +253,35 @@ enum class CompilerContextKind {
Typedef
};
+//----------------------------------------------------------------------
+// Enumerations that can be used to specify the kind of metric we're looking at
+// when collecting stats.
+//----------------------------------------------------------------------
+enum StatisticKind {
+ ExpressionSuccessful = 0,
+ ExpressionFailure = 1,
+ FrameVarSuccess = 2,
+ FrameVarFailure = 3,
+ StatisticMax = 4
+};
+
+
+inline std::string GetStatDescription(lldb_private::StatisticKind K) {
+ switch (K) {
+ case StatisticKind::ExpressionSuccessful:
+ return "Number of expr evaluation successes";
+ case StatisticKind::ExpressionFailure:
+ return "Number of expr evaluation failures";
+ case StatisticKind::FrameVarSuccess:
+ return "Number of frame var successes";
+ case StatisticKind::FrameVarFailure:
+ return "Number of frame var failures";
+ case StatisticKind::StatisticMax:
+ return "";
+ }
+ llvm_unreachable("Statistic not registered!");
+}
+
} // namespace lldb_private
namespace llvm {
diff --git a/include/lldb/lldb-private-forward.h b/include/lldb/lldb-private-forward.h
index ea122525ef90..65d303281164 100644
--- a/include/lldb/lldb-private-forward.h
+++ b/include/lldb/lldb-private-forward.h
@@ -15,8 +15,8 @@
#include <memory>
namespace lldb_private {
-// ---------------------------------------------------------------
-// Class forward decls.
+// --------------------------------------------------------------- Class
+// forward decls.
// ---------------------------------------------------------------
class NativeBreakpoint;
class NativeBreakpointList;
@@ -26,8 +26,7 @@ class NativeThreadProtocol;
class ResumeActionList;
class UnixSignals;
-// ---------------------------------------------------------------
-// SP/WP decls.
+// --------------------------------------------------------------- SP/WP decls.
// ---------------------------------------------------------------
typedef std::shared_ptr<NativeBreakpoint> NativeBreakpointSP;
}
diff --git a/include/lldb/lldb-private-types.h b/include/lldb/lldb-private-types.h
index fd21641218fb..7ba7350e868c 100644
--- a/include/lldb/lldb-private-types.h
+++ b/include/lldb/lldb-private-types.h
@@ -30,9 +30,8 @@ typedef llvm::sys::DynamicLibrary (*LoadPluginCallbackType)(
const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error);
//----------------------------------------------------------------------
-// Every register is described in detail including its name, alternate
-// name (optional), encoding, size in bytes and the default display
-// format.
+// Every register is described in detail including its name, alternate name
+// (optional), encoding, size in bytes and the default display format.
//----------------------------------------------------------------------
struct RegisterInfo {
const char *name; // Name of this register, can't be NULL
@@ -41,28 +40,29 @@ struct RegisterInfo {
uint32_t byte_offset; // The byte offset in the register context data where
// this register's value is found.
// This is optional, and can be 0 if a particular RegisterContext does not
- // need to
- // address its registers by byte offset.
+ // need to address its registers by byte offset.
lldb::Encoding encoding; // Encoding of the register bits
lldb::Format format; // Default display format
uint32_t kinds[lldb::kNumRegisterKinds]; // Holds all of the various register
// numbers for all register kinds
uint32_t *value_regs; // List of registers (terminated with
- // LLDB_INVALID_REGNUM). If this value is not
- // null, all registers in this list will be read first, at which point the
- // value
- // for this register will be valid. For example, the value list for ah
- // would be eax (x86) or rax (x64).
+ // LLDB_INVALID_REGNUM). If this value is not null,
+ // all registers in this list will be read first, at
+ // which point the value for this register will be
+ // valid. For example, the value list for ah would be
+ // eax (x86) or rax (x64).
uint32_t *invalidate_regs; // List of registers (terminated with
// LLDB_INVALID_REGNUM). If this value is not
- // null, all registers in this list will be invalidated when the value of this
- // register changes. For example, the invalidate list for eax would be rax
- // ax, ah, and al.
+ // null, all registers in this list will be
+ // invalidated when the value of this register
+ // changes. For example, the invalidate list for
+ // eax would be rax ax, ah, and al.
const uint8_t *dynamic_size_dwarf_expr_bytes; // A DWARF expression that when
// evaluated gives
// the byte size of this register.
size_t dynamic_size_dwarf_len; // The length of the DWARF expression in bytes
- // in the dynamic_size_dwarf_expr_bytes member.
+ // in the dynamic_size_dwarf_expr_bytes
+ // member.
llvm::ArrayRef<uint8_t> data(const uint8_t *context_base) const {
return llvm::ArrayRef<uint8_t>(context_base + byte_offset, byte_size);
@@ -85,8 +85,8 @@ struct RegisterSet {
// values in this array are
// *indices* (not register numbers) into a particular RegisterContext's
// register array. For example, if eax is defined at index 4 for a
- // particular RegisterContext, eax would be included in this RegisterSet
- // by adding the value 4. Not by adding the value lldb_eax_i386.
+ // particular RegisterContext, eax would be included in this RegisterSet by
+ // adding the value 4. Not by adding the value lldb_eax_i386.
};
struct OptionEnumValueElement {
@@ -112,7 +112,8 @@ struct OptionDefinition {
int short_option; // Single character for this option.
int option_has_arg; // no_argument, required_argument or optional_argument
OptionValidator *validator; // If non-NULL, option is valid iff
- // |validator->IsValid()|, otherwise always valid.
+ // |validator->IsValid()|, otherwise always
+ // valid.
OptionEnumValueElement *enum_values; // If non-NULL an array of enum values.
uint32_t completion_type; // Cookie the option class can use to do define the
// argument completion.
diff --git a/include/lldb/lldb-types.h b/include/lldb/lldb-types.h
index fc445f55a9e5..79f441569304 100644
--- a/include/lldb/lldb-types.h
+++ b/include/lldb/lldb-types.h
@@ -31,8 +31,8 @@
//----------------------------------------------------------------------
// TODO: Add a bunch of ifdefs to determine the host system and what
-// things should be defined. Currently MacOSX is being assumed by default
-// since that is what lldb was first developed for.
+// things should be defined. Currently MacOSX is being assumed by default since
+// that is what lldb was first developed for.
#ifdef _WIN32
diff --git a/include/lldb/lldb-versioning.h b/include/lldb/lldb-versioning.h
index b0af5dc64b47..9d5fd164119e 100644
--- a/include/lldb/lldb-versioning.h
+++ b/include/lldb/lldb-versioning.h
@@ -100,8 +100,8 @@
*/
// if you want the version checking to work on other OS/compiler, define
-// appropriate IMPL_DEPRECATED/IMPL_TOONEW
-// and define LLDB_API_CHECK_VERSIONING_WORKS when you are ready to go live
+// appropriate IMPL_DEPRECATED/IMPL_TOONEW and define
+// LLDB_API_CHECK_VERSIONING_WORKS when you are ready to go live
#if defined(__APPLE__) && defined(__clang__)
#define LLDB_API_IMPL_DEPRECATED __attribute__((deprecated))
#define LLDB_API_IMPL_TOONEW __attribute__((unavailable))
diff --git a/include/lldb/module.modulemap b/include/lldb/module.modulemap
new file mode 100644
index 000000000000..cec0428c1840
--- /dev/null
+++ b/include/lldb/module.modulemap
@@ -0,0 +1,139 @@
+
+module lldb_API {
+ requires cplusplus
+
+ umbrella "API"
+ module * { export * }
+}
+
+module lldb_Host {
+ requires cplusplus
+
+ // Because we have OS-specific headers in Host, we just list
+ // all OS-independent headers here that will include the correct
+ // OS-specific header for us.
+ module ConnectionFileDescriptor { header "Host/ConnectionFileDescriptor.h" export * }
+ module Debug { header "Host/Debug.h" export * }
+ module Editline { header "Host/Editline.h" export * }
+ module FileCache { header "Host/FileCache.h" export * }
+ module File { header "Host/File.h" export * }
+ module FileSystem { header "Host/FileSystem.h" export * }
+ module HostGetOpt { header "Host/HostGetOpt.h" export * }
+ module Host { header "Host/Host.h" export * }
+ module HostInfoBase { header "Host/HostInfoBase.h" export * }
+ module HostInfo { header "Host/HostInfo.h" export * }
+ module HostNativeProcessBase { header "Host/HostNativeProcessBase.h" export * }
+ module HostNativeProcess { header "Host/HostNativeProcess.h" export * }
+ module HostNativeThreadBase { header "Host/HostNativeThreadBase.h" export * }
+ module HostNativeThreadForward { header "Host/HostNativeThreadForward.h" export * }
+ module HostNativeThread { header "Host/HostNativeThread.h" export * }
+ module HostProcess { header "Host/HostProcess.h" export * }
+ module HostThread { header "Host/HostThread.h" export * }
+ module LockFileBase { header "Host/LockFileBase.h" export * }
+ module LockFile { header "Host/LockFile.h" export * }
+ module MainLoopBase { header "Host/MainLoopBase.h" export * }
+ module MainLoop { header "Host/MainLoop.h" export * }
+ module MonitoringProcessLauncher { header "Host/MonitoringProcessLauncher.h" export * }
+ module OptionParser { header "Host/OptionParser.h" export * }
+ module PipeBase { header "Host/PipeBase.h" export * }
+ module Pipe { header "Host/Pipe.h" export * }
+ module PosixApi { header "Host/PosixApi.h" export * }
+ module Predicate { header "Host/Predicate.h" export * }
+ module ProcessLauncher { header "Host/ProcessLauncher.h" export * }
+ module ProcessRunLock { header "Host/ProcessRunLock.h" export * }
+ module PseudoTerminal { header "Host/PseudoTerminal.h" export * }
+ module SocketAddress { header "Host/SocketAddress.h" export * }
+ module Socket { header "Host/Socket.h" export * }
+ module StringConvert { header "Host/StringConvert.h" export * }
+ module Symbols { header "Host/Symbols.h" export * }
+ module TaskPool { header "Host/TaskPool.h" export * }
+ module Terminal { header "Host/Terminal.h" export * }
+ module ThreadLauncher { header "Host/ThreadLauncher.h" export * }
+ module Time { header "Host/Time.h" export * }
+ module XML { header "Host/XML.h" export * }
+
+ export *
+}
+
+module lldb_Initialization {
+ requires cplusplus
+
+ umbrella "Initialization"
+ module * { export * }
+}
+
+
+module lldb_Wrapper {
+
+ module lldb_Breakpoint {
+ requires cplusplus
+
+ umbrella "Breakpoint"
+ module * { export * }
+ }
+
+ module lldb_Core {
+ requires cplusplus
+
+ umbrella "Core"
+ module * { export * }
+ }
+
+ module lldb_DataFormatters {
+ requires cplusplus
+
+ umbrella "DataFormatters"
+ module * { export * }
+ }
+
+ module lldb_Expression {
+ requires cplusplus
+
+ umbrella "Expression"
+ module * { export * }
+ // TODO: This file includes a non-public header.
+ exclude header "Expression/REPL.h"
+ }
+
+ module lldb_Interpreter {
+ requires cplusplus
+
+ umbrella "Interpreter"
+ module * { export * }
+ }
+
+ module lldb_Symbol {
+ requires cplusplus
+
+ umbrella "Symbol"
+ module * { export * }
+ }
+ module lldb_Target {
+ requires cplusplus
+
+ umbrella "Target"
+ module * { export * }
+ }
+}
+
+
+module lldb_Utility {
+ requires cplusplus
+
+ umbrella "Utility"
+ module * { export * }
+
+ module lldb_defines { header "lldb-defines.h" export * }
+ module lldb_enumerations { header "lldb-enumerations.h" export * }
+ module lldb_forward { header "lldb-forward.h" export * }
+ module lldb_private_enumerations { header "lldb-private-enumerations.h" export * }
+ module lldb_private_defines { header "lldb-private-defines.h" export * }
+ module lldb_private_forward { header "lldb-private-forward.h" export * }
+ module lldb_private { header "lldb-private.h" export * }
+ module lldb_private_interfaces { header "lldb-private-interfaces.h" export * }
+ module lldb_private_types { header "lldb-private-types.h" export * }
+ module lldb_public { header "lldb-public.h" export * }
+ module lldb_types { header "lldb-types.h" export * }
+ module lldb_versioning { header "lldb-versioning.h" export * }
+
+}
diff --git a/lit/Breakpoint/Inputs/case-sensitive.c b/lit/Breakpoint/Inputs/case-sensitive.c
new file mode 100644
index 000000000000..6df38dcacd78
--- /dev/null
+++ b/lit/Breakpoint/Inputs/case-sensitive.c
@@ -0,0 +1,4 @@
+int main() {
+ int x = 47; // REGEX-THIS
+ return x;
+}
diff --git a/lit/Breakpoint/Inputs/ppc64-localentry.s b/lit/Breakpoint/Inputs/ppc64-localentry.s
new file mode 100644
index 000000000000..5fe0a97d06d3
--- /dev/null
+++ b/lit/Breakpoint/Inputs/ppc64-localentry.s
@@ -0,0 +1,55 @@
+ .text
+ .abiversion 2
+
+ .globl lfunc
+ .p2align 4
+ .type lfunc,@function
+lfunc: # @lfunc
+.Lfunc_begin0:
+.Lfunc_gep0:
+ addis 2, 12, .TOC.-.Lfunc_gep0@ha
+ addi 2, 2, .TOC.-.Lfunc_gep0@l
+.Lfunc_lep0:
+ .localentry lfunc, .Lfunc_lep0-.Lfunc_gep0
+# BB#0:
+ mr 4, 3
+ addis 3, 2, .LC0@toc@ha
+ ld 3, .LC0@toc@l(3)
+ stw 4, -12(1)
+ lwz 4, 0(3)
+ lwz 5, -12(1)
+ mullw 4, 4, 5
+ extsw 3, 4
+ blr
+ .long 0
+ .quad 0
+.Lfunc_end0:
+ .size lfunc, .Lfunc_end0-.Lfunc_begin0
+
+ .globl simple
+ .p2align 4
+ .type simple,@function
+simple: # @simple
+.Lfunc_begin1:
+# %bb.0: # %entry
+ mr 4, 3
+ stw 4, -12(1)
+ lwz 4, -12(1)
+ mulli 4, 4, 10
+ extsw 3, 4
+ blr
+ .long 0
+ .quad 0
+.Lfunc_end1:
+ .size simple, .Lfunc_end1-.Lfunc_begin1
+
+ .section .toc,"aw",@progbits
+.LC0:
+ .tc g_foo[TC],g_foo
+ .type g_foo,@object # @g_foo
+ .data
+ .globl g_foo
+ .p2align 2
+g_foo:
+ .long 2 # 0x2
+ .size g_foo, 4
diff --git a/lit/Breakpoint/case-insensitive.test b/lit/Breakpoint/case-insensitive.test
new file mode 100644
index 000000000000..841448c42990
--- /dev/null
+++ b/lit/Breakpoint/case-insensitive.test
@@ -0,0 +1,46 @@
+# REQUIRES: windows
+# XFAIL: windows
+# -> llvm.org/pr24528
+#
+# RUN: %cc %p/Inputs/case-sensitive.c -g -o %t
+# RUN: lldb-test breakpoints %t %s | FileCheck %s
+
+breakpoint set -f case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f case-sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f %p/Inputs/case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f Case-Sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/Case-Sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f case-sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f %p/Inputs/case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f Case-Sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/Case-Sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
diff --git a/lit/Breakpoint/case-sensitive.test b/lit/Breakpoint/case-sensitive.test
new file mode 100644
index 000000000000..dd5635b952d6
--- /dev/null
+++ b/lit/Breakpoint/case-sensitive.test
@@ -0,0 +1,46 @@
+# REQUIRES: nowindows
+#
+# RUN: %cc %p/Inputs/case-sensitive.c -g -o %t
+# RUN: lldb-test breakpoints %t %s | FileCheck %s
+
+breakpoint set -f case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f case-sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f %p/Inputs/case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -l 3
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/case-sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -l 3
+# CHECK: 0 locations.
+
+breakpoint set -f Case-Sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -l 3
+# CHECK: 0 locations.
+
+breakpoint set -f %p/INPUTS/Case-Sensitive.c -l 3
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -l 3
+# CHECK: 0 locations.
+
+breakpoint set -f case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f case-sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f %p/Inputs/case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/Inputs/case-sensitive.c -p REGEX-THIS
+# CHECK: At least one location.
+
+breakpoint set -f %p/INPUTS/case-sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/case-sensitive.c -p REGEX-THIS
+# CHECK: 0 locations.
+
+breakpoint set -f Case-Sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f Case-Sensitive.c -p REGEX-THIS
+# CHECK: 0 locations.
+
+breakpoint set -f %p/INPUTS/Case-Sensitive.c -p REGEX-THIS
+# CHECK-LABEL: breakpoint set -f {{.*}}/INPUTS/Case-Sensitive.c -p REGEX-THIS
+# CHECK: 0 locations.
+
+
diff --git a/lit/Breakpoint/lit.local.cfg b/lit/Breakpoint/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/Breakpoint/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/Breakpoint/ppc64-localentry.test b/lit/Breakpoint/ppc64-localentry.test
new file mode 100644
index 000000000000..16cce703045c
--- /dev/null
+++ b/lit/Breakpoint/ppc64-localentry.test
@@ -0,0 +1,12 @@
+# REQUIRES: powerpc
+#
+# RUN: llvm-mc -triple=powerpc64le -filetype=obj %p/Inputs/ppc64-localentry.s -o %t
+# RUN: lldb-test breakpoints %t %s | FileCheck %s
+
+breakpoint set -n lfunc
+# CHECK-LABEL: breakpoint set -n lfunc
+# CHECK: Address: {{.*}}`lfunc + 8
+
+breakpoint set -n simple
+# CHECK-LABEL: breakpoint set -n simple
+# CHECK: Address: {{.*}}`simple
diff --git a/lit/CMakeLists.txt b/lit/CMakeLists.txt
index 5488154318a9..8a93236d2cf0 100644
--- a/lit/CMakeLists.txt
+++ b/lit/CMakeLists.txt
@@ -1,45 +1,69 @@
-set(LLVM_SOURCE_DIR "${LLVM_MAIN_SRC_DIR}")
-set(LLVM_BINARY_DIR "${LLVM_BINARY_DIR}")
-set(LLVM_BUILD_MODE "%(build_mode)s")
-set(LLVM_TOOLS_DIR "${LLVM_TOOLS_BINARY_DIR}/%(build_config)s")
-set(LLVM_LIBS_DIR "${LLVM_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/%(build_config)s")
-set(CLANG_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
-set(CLANG_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/..")
+# Test runner infrastructure for LLDB. This configures the LLDB test trees
+# for use by Lit, and delegates to LLVM's lit test handlers.
+
+if (CMAKE_CFG_INTDIR STREQUAL ".")
+ set(LLVM_BUILD_MODE ".")
+else ()
+ set(LLVM_BUILD_MODE "%(build_mode)s")
+endif ()
+
+if (NOT LLDB_TEST_USE_CUSTOM_C_COMPILER)
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_C_COMPILER ${LLDB_TEST_C_COMPILER})
+endif ()
+
+if (NOT LLDB_TEST_USE_CUSTOM_CXX_COMPILER)
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TEST_CXX_COMPILER ${LLDB_TEST_CXX_COMPILER})
+endif ()
+
+get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
+
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_LIBS_DIR ${LLVM_LIBRARY_OUTPUT_INTDIR})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+
+list(APPEND LLDB_TEST_DEPS
+ LLDBUnitTests
+ dsymutil
+ lldb
+ lldb-test
+ llvm-config
+ llvm-mc
+ llvm-objcopy
+ )
+
+if(TARGET lld)
+ list(APPEND LLDB_TEST_DEPS lld)
+ set(LLDB_HAVE_LLD 1)
+else()
+ set(LLDB_HAVE_LLD 0)
+endif()
+
if(BUILD_SHARED_LIBS)
set(ENABLE_SHARED 1)
else()
set(ENABLE_SHARED 0)
endif(BUILD_SHARED_LIBS)
+# the value is not canonicalized within LLVM
+llvm_canonicalize_cmake_booleans(
+ LLDB_DISABLE_PYTHON
+ LLVM_ENABLE_ZLIB)
+
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/Unit/lit.site.cfg.in
- ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
- )
-
-set(LLDB_TEST_DEPS
- LLDBUnitTests
- lldb
- lldb-test
- )
+ ${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg)
+configure_lit_site_cfg(
+ ${CMAKE_CURRENT_SOURCE_DIR}/Suite/lit.site.cfg.in
+ ${CMAKE_CURRENT_BINARY_DIR}/Suite/lit.site.cfg)
if(NOT LLDB_BUILT_STANDALONE)
- list(APPEND LLDB_TEST_DEPS FileCheck not yaml2obj)
-endif()
-
-# lldb-server is not built on every platform.
-if (TARGET lldb-server)
- list(APPEND LLDB_TEST_DEPS lldb-server)
-endif()
-
-if(APPLE)
- list(APPEND LLDB_TEST_DEPS debugserver)
-endif()
-
-if(TARGET clang)
- list(APPEND LLDB_TEST_DEPS clang)
+ list(APPEND LLDB_TEST_DEPS
+ FileCheck
+ not
+ )
endif()
set(LLDB_TEST_PARAMS
@@ -49,7 +73,7 @@ set(LLDB_TEST_PARAMS
add_lit_testsuite(check-lldb-lit "Running lldb lit test suite"
${CMAKE_CURRENT_BINARY_DIR}
PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
- lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
+ lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS ${LLDB_TEST_DEPS}
)
@@ -61,7 +85,8 @@ if (TARGET clang)
add_dependencies(check-lldb-lit clang)
endif()
-add_lit_testsuites(LLDB ${CMAKE_CURRENT_SOURCE_DIR}
+add_lit_testsuites(LLDB
+ ${CMAKE_CURRENT_BINARY_DIR}
PARAMS lldb_site_config=${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg
lldb_unit_site_config=${CMAKE_CURRENT_BINARY_DIR}/Unit/lit.site.cfg
DEPENDS ${LLDB_TEST_DEPS}
diff --git a/lit/Expr/Inputs/anonymous-struct.cpp b/lit/Expr/Inputs/anonymous-struct.cpp
deleted file mode 100644
index 5b170c5f943a..000000000000
--- a/lit/Expr/Inputs/anonymous-struct.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <tgmath.h>
-
-typedef struct {
- float f;
- int i;
-} my_untagged_struct;
-
-double multiply(my_untagged_struct *s)
-{
- return s->f * s->i;
-}
-
-double multiply(my_untagged_struct *s, int x)
-{
- return multiply(s) * x;
-}
-
-int main(int argc, char **argv)
-{
- my_untagged_struct s = {
- .f = (float)argc,
- .i = argc,
- };
- // lldb testsuite break
- return !(multiply(&s, argc) == pow(argc, 3));
-}
diff --git a/lit/Expr/Inputs/ir-memory-map-basic b/lit/Expr/Inputs/ir-memory-map-basic
new file mode 100644
index 000000000000..c48392594ca7
--- /dev/null
+++ b/lit/Expr/Inputs/ir-memory-map-basic
@@ -0,0 +1,25 @@
+L1 = malloc 0 1
+L2 = malloc 1 1
+
+L3 = malloc 2 1
+L4 = malloc 2 2
+L5 = malloc 2 4
+
+L6 = malloc 3 1
+L7 = malloc 3 2
+L8 = malloc 3 4
+
+L9 = malloc 128 1
+L10 = malloc 128 2
+L11 = malloc 128 4
+L12 = malloc 128 128
+
+L13 = malloc 2048 1
+L14 = malloc 2048 2
+L15 = malloc 2048 4
+
+L16 = malloc 3968 1
+L17 = malloc 3968 2
+L18 = malloc 3968 4
+
+L19 = malloc 0 1
diff --git a/lit/Expr/Inputs/ir-memory-map-mix-malloc-free b/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
new file mode 100644
index 000000000000..3b57cc8bdf4c
--- /dev/null
+++ b/lit/Expr/Inputs/ir-memory-map-mix-malloc-free
@@ -0,0 +1,272 @@
+L1 = malloc 32 2
+free L1
+L2 = malloc 3 4
+L3 = malloc 3 128
+free L3
+free L2
+L4 = malloc 2 16
+free L4
+L5 = malloc 4097 4
+free L5
+L6 = malloc 2 2
+L7 = malloc 3 2
+L8 = malloc 32 16
+free L6
+free L8
+free L7
+L9 = malloc 8192 2
+L10 = malloc 33 4
+free L9
+L11 = malloc 2047 2
+L12 = malloc 5 16
+L13 = malloc 4 16
+L14 = malloc 2048 2
+free L10
+L15 = malloc 4 128
+free L13
+L16 = malloc 1 2
+L17 = malloc 4095 128
+free L12
+free L15
+L18 = malloc 0 128
+L19 = malloc 2 128
+L20 = malloc 4096 2
+L21 = malloc 2 2
+L22 = malloc 8192 128
+L23 = malloc 4 2
+L24 = malloc 4097 4
+free L19
+free L20
+L25 = malloc 3 128
+free L23
+free L21
+free L22
+free L25
+free L16
+L26 = malloc 1 128
+L27 = malloc 4096 4
+free L14
+L28 = malloc 31 2
+free L24
+L29 = malloc 2048 128
+free L28
+free L11
+L30 = malloc 4 2
+L31 = malloc 32 16
+L32 = malloc 1 4
+free L30
+L33 = malloc 3 2
+L34 = malloc 4096 4
+free L17
+free L18
+free L32
+L35 = malloc 4097 4
+L36 = malloc 8193 2
+L37 = malloc 3 2
+free L34
+L38 = malloc 8193 16
+L39 = malloc 4096 4
+L40 = malloc 8192 16
+L41 = malloc 32 4
+free L26
+free L38
+free L37
+L42 = malloc 0 2
+free L31
+free L40
+free L36
+free L35
+L43 = malloc 2047 2
+free L41
+L44 = malloc 4 4
+free L43
+free L33
+free L42
+L45 = malloc 4097 16
+free L27
+L46 = malloc 32 128
+L47 = malloc 8191 16
+L48 = malloc 1 16
+L49 = malloc 32 128
+L50 = malloc 3 2
+L51 = malloc 4096 128
+free L51
+L52 = malloc 2048 4
+free L29
+L53 = malloc 4097 128
+free L44
+L54 = malloc 1 16
+L55 = malloc 4095 16
+L56 = malloc 2047 2
+L57 = malloc 0 2
+L58 = malloc 2048 2
+free L48
+L59 = malloc 1 4
+L60 = malloc 32 16
+free L50
+L61 = malloc 1 4
+L62 = malloc 4096 2
+free L60
+L63 = malloc 1 16
+L64 = malloc 32 128
+free L55
+L65 = malloc 8192 16
+free L57
+L66 = malloc 1 128
+free L65
+free L61
+free L45
+free L64
+free L39
+L67 = malloc 2048 2
+free L47
+L68 = malloc 2049 4
+free L63
+free L68
+free L54
+free L59
+free L52
+L69 = malloc 2 2
+L70 = malloc 8192 16
+L71 = malloc 2049 16
+L72 = malloc 3 16
+L73 = malloc 4097 16
+L74 = malloc 4096 2
+L75 = malloc 4097 4
+free L67
+free L71
+free L72
+free L75
+free L74
+L76 = malloc 3 4
+free L70
+free L69
+L77 = malloc 4 4
+free L49
+L78 = malloc 4096 16
+L79 = malloc 33 2
+free L76
+L80 = malloc 2 16
+free L58
+free L80
+free L56
+L81 = malloc 1 128
+free L73
+L82 = malloc 1 16
+free L53
+free L81
+free L77
+L83 = malloc 2 2
+L84 = malloc 3 16
+free L62
+L85 = malloc 2049 2
+free L83
+L86 = malloc 3 4
+L87 = malloc 4096 128
+free L86
+L88 = malloc 3 2
+free L82
+free L66
+free L84
+L89 = malloc 8192 4
+free L88
+L90 = malloc 3 4
+L91 = malloc 1 4
+L92 = malloc 4097 4
+L93 = malloc 5 16
+L94 = malloc 2 128
+L95 = malloc 4096 2
+L96 = malloc 32 16
+L97 = malloc 8192 16
+L98 = malloc 32 128
+free L90
+free L79
+L99 = malloc 8193 4
+free L46
+L100 = malloc 31 4
+L101 = malloc 8192 128
+free L99
+L102 = malloc 2049 16
+L103 = malloc 4 2
+L104 = malloc 32 2
+free L101
+free L98
+L105 = malloc 1 16
+free L92
+L106 = malloc 2 2
+L107 = malloc 31 16
+L108 = malloc 2 4
+free L94
+L109 = malloc 4097 4
+L110 = malloc 31 4
+free L103
+L111 = malloc 31 4
+free L111
+L112 = malloc 2049 2
+L113 = malloc 32 128
+free L106
+L114 = malloc 8191 2
+free L105
+free L97
+free L109
+L115 = malloc 2 16
+free L78
+free L93
+free L114
+free L115
+free L96
+free L85
+L116 = malloc 2 16
+free L89
+free L87
+L117 = malloc 33 2
+L118 = malloc 1 4
+L119 = malloc 4096 128
+free L107
+L120 = malloc 8192 4
+L121 = malloc 1 128
+L122 = malloc 3 4
+L123 = malloc 2047 4
+L124 = malloc 2 2
+free L121
+free L102
+L125 = malloc 2 4
+L126 = malloc 1 16
+L127 = malloc 2048 2
+L128 = malloc 2048 16
+L129 = malloc 32 128
+free L124
+L130 = malloc 2048 16
+L131 = malloc 32 16
+L132 = malloc 32 128
+free L100
+free L117
+free L126
+L133 = malloc 8192 4
+L134 = malloc 8192 2
+L135 = malloc 2 16
+free L119
+L136 = malloc 31 16
+free L118
+free L125
+free L132
+free L122
+free L134
+free L136
+free L130
+free L110
+free L123
+free L104
+free L116
+free L133
+free L91
+free L113
+free L128
+free L129
+free L95
+free L131
+free L127
+free L112
+free L108
+free L135
+free L120 \ No newline at end of file
diff --git a/lit/Expr/Inputs/ir-memory-map-overlap1 b/lit/Expr/Inputs/ir-memory-map-overlap1
new file mode 100644
index 000000000000..6e842671fba7
--- /dev/null
+++ b/lit/Expr/Inputs/ir-memory-map-overlap1
@@ -0,0 +1,10 @@
+L1 = malloc 8 16
+L2 = malloc 16 8
+L3 = malloc 64 32
+L4 = malloc 1 8
+L5 = malloc 64 32
+L6 = malloc 64 8
+L7 = malloc 1024 32
+L8 = malloc 1 16
+L9 = malloc 8 16
+L10 = malloc 1024 16
diff --git a/lit/Expr/TestCallStdStringFunction.test b/lit/Expr/TestCallStdStringFunction.test
deleted file mode 100644
index dadb5dbd0961..000000000000
--- a/lit/Expr/TestCallStdStringFunction.test
+++ /dev/null
@@ -1,14 +0,0 @@
-# XFAIL: windows
-# -> llvm.org/pr21765
-
-# XFAIL: freebsd
-# -> llvm.org/pr17807
-
-# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t && %lldb -b -s %s -- %t | FileCheck %s
-
-breakpoint set --file call-function.cpp --line 52
-run
-print str
-# CHECK: Hello world
-print str.c_str()
-# CHECK: Hello world
diff --git a/lit/Expr/TestCallStopAndContinue.test b/lit/Expr/TestCallStopAndContinue.test
deleted file mode 100644
index 263fa2a6f59a..000000000000
--- a/lit/Expr/TestCallStopAndContinue.test
+++ /dev/null
@@ -1,12 +0,0 @@
-# XFAIL: windows
-# -> llvm.org/pr24489
-
-# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t && %lldb -b -s %s -o continue -o "thread list" -- %t 2>&1 | FileCheck %s
-
-breakpoint set --file call-function.cpp --line 52
-run
-breakpoint set --file call-function.cpp --line 14
-expression -i false -- returnsFive()
-# CHECK: Execution was interrupted, reason: breakpoint
-# CHECK: stop reason = User Expression thread plan
-# CHECK: Completed expression: (Five) $0 = (number = 5{{.*}}, name = "five")
diff --git a/lit/Expr/TestCallUserAnonTypedef.test b/lit/Expr/TestCallUserAnonTypedef.test
deleted file mode 100644
index 510f40c22e2d..000000000000
--- a/lit/Expr/TestCallUserAnonTypedef.test
+++ /dev/null
@@ -1,11 +0,0 @@
-# XFAIL: windows
-
-# XFAIL: armhf-linux
-# -> llvm.org/pr27868
-
-# RUN: %cxx %p/Inputs/anonymous-struct.cpp -g -o %t && %lldb -b -s %s -- %t | FileCheck %s
-
-breakpoint set --file anonymous-struct.cpp --line 24
-run
-expression multiply(&s)
-# CHECK: $0 = 1
diff --git a/lit/Expr/TestCallUserDefinedFunction.test b/lit/Expr/TestCallUserDefinedFunction.test
deleted file mode 100644
index 0c98a9bae78c..000000000000
--- a/lit/Expr/TestCallUserDefinedFunction.test
+++ /dev/null
@@ -1,20 +0,0 @@
-# XFAIL: windows
-# -> llvm.org/pr24489
-
-# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t && %lldb -b -s %s -- %t | FileCheck %s
-
-breakpoint set --file call-function.cpp --line 52
-run
-expression fib(5)
-# CHECK: $0 = 5
-expression add(4,8)
-# CHECK: $1 = 12
-
-expression add(add(5,2),add(3,4))
-# CHECK: $2 = 14
-expression add(add(5,2),fib(5))
-# CHECK: $3 = 12
-expression stringCompare((const char*) "Hello world")
-# CHECK: $4 = true
-expression stringCompare((const char*) "Hellworld")
-# CHECK: $5 = false
diff --git a/lit/Expr/TestIRMemoryMap.test b/lit/Expr/TestIRMemoryMap.test
new file mode 100644
index 000000000000..23595945011d
--- /dev/null
+++ b/lit/Expr/TestIRMemoryMap.test
@@ -0,0 +1,12 @@
+# XFAIL: windows
+
+# RUN: %cxx %p/Inputs/call-function.cpp -g -o %t
+
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-basic
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-basic
+
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-overlap1
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-overlap1
+
+# RUN: lldb-test ir-memory-map %t %S/Inputs/ir-memory-map-mix-malloc-free
+# RUN: lldb-test ir-memory-map -host-only %t %S/Inputs/ir-memory-map-mix-malloc-free
diff --git a/lit/Expr/TestTypeOfDeclTypeExpr.test b/lit/Expr/TestTypeOfDeclTypeExpr.test
new file mode 100644
index 000000000000..c156ae556a71
--- /dev/null
+++ b/lit/Expr/TestTypeOfDeclTypeExpr.test
@@ -0,0 +1,13 @@
+# RUN: %lldb -b -s %s | FileCheck %s
+
+expression int i; __typeof__(i) j = 1; j
+# CHECK: (lldb) expression int i; __typeof__(i) j = 1; j
+# CHECK-NEXT: (typeof (i)) {{.*}} = 1
+
+expression int i; typeof(i) j = 1; j
+# CHECK: (lldb) expression int i; typeof(i) j = 1; j
+# CHECK-NEXT: (typeof (i)) {{.*}} = 1
+
+expression int i; decltype(i) j = 1; j
+# CHECK: (lldb) expression int i; decltype(i) j = 1; j
+# CHECK-NEXT: (decltype(i)) {{.*}} = 1
diff --git a/lit/Modules/build-id-case.yaml b/lit/Modules/build-id-case.yaml
new file mode 100644
index 000000000000..246163ad52af
--- /dev/null
+++ b/lit/Modules/build-id-case.yaml
@@ -0,0 +1,43 @@
+# RUN: mkdir -p %t/.build-id/1b
+# RUN: yaml2obj %s > %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug
+# RUN: cd %t
+# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/stripped.out
+# RUN: lldb-test object-file %t/stripped.out | FileCheck %s
+
+# CHECK: Name: .debug_frame
+# CHECK-NEXT: Type: dwarf-frame
+# CHECK-NEXT: VM size: 0
+# CHECK-NEXT: File size: 8
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+ Entry: 0x00000000004003D0
+Sections:
+ - Name: .note.gnu.build-id
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000400274
+ AddressAlign: 0x0000000000000004
+ Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x00000000004003D0
+ AddressAlign: 0x0000000000000010
+ Content: DEADBEEFBAADF00D
+ - Name: .debug_frame
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000008
+ Content: DEADBEEFBAADF00D
+Symbols:
+ Local:
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x00000000004003D0
+ Size: 0x0000000000000008
+...
diff --git a/lit/Modules/compressed-sections.yaml b/lit/Modules/compressed-sections.yaml
index 0eabd99f2d6d..c75dc857522a 100644
--- a/lit/Modules/compressed-sections.yaml
+++ b/lit/Modules/compressed-sections.yaml
@@ -1,6 +1,6 @@
# REQUIRES: zlib
# RUN: yaml2obj %s > %t
-# RUN: lldb-test module-sections --contents %t | FileCheck %s
+# RUN: lldb-test object-file --contents %t | FileCheck %s
--- !ELF
FileHeader:
Class: ELFCLASS32
@@ -18,12 +18,14 @@ Sections:
Content: deadbeefbaadf00d
# CHECK: Name: .hello_elf
+# CHECK-NEXT: Type: regular
# CHECK-NEXT: VM size: 0
# CHECK-NEXT: File size: 28
# CHECK-NEXT: Data:
# CHECK-NEXT: 20304050 60708090
# CHECK: Name: .bogus
+# CHECK-NEXT: Type: regular
# CHECK-NEXT: VM size: 0
# CHECK-NEXT: File size: 8
# CHECK-NEXT: Data:
diff --git a/lit/Modules/elf-duplicate-section.yaml b/lit/Modules/elf-duplicate-section.yaml
new file mode 100644
index 000000000000..b4b391cc912d
--- /dev/null
+++ b/lit/Modules/elf-duplicate-section.yaml
@@ -0,0 +1,42 @@
+# RUN: mkdir -p %t/.build-id/1b
+# RUN: yaml2obj %s > %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug
+# RUN: cd %t
+# RUN: llvm-objcopy --strip-all --add-gnu-debuglink=.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/.build-id/1b/8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9.debug %t/stripped.out
+# RUN: lldb-test object-file %t/stripped.out | FileCheck %s
+
+# Make sure that the debug_frame section is present only once.
+# CHECK: Name: .debug_frame
+# CHECK-NOT: .debug_frame
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+ Entry: 0x00000000004003D0
+Sections:
+ - Name: .note.gnu.build-id
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000400274
+ AddressAlign: 0x0000000000000004
+ Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x00000000004003D0
+ AddressAlign: 0x0000000000000010
+ Content: DEADBEEFBAADF00D
+ - Name: .debug_frame
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000008
+ Content: DEADBEEFBAADF00D
+Symbols:
+ Local:
+ - Name: main
+ Type: STT_FUNC
+ Section: .text
+ Value: 0x00000000004003D0
+ Size: 0x0000000000000008
+...
diff --git a/lit/Modules/elf-many-sections.s b/lit/Modules/elf-many-sections.s
new file mode 100644
index 000000000000..a5e4aee18821
--- /dev/null
+++ b/lit/Modules/elf-many-sections.s
@@ -0,0 +1,72 @@
+# REQUIRES: x86
+# RUN: llvm-mc -filetype=obj -triple x86_64-pc-linux %s -o %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+## Check that we are able to parse ELF files with more than SHN_LORESERVE
+## sections. This generates a file that contains 64k sections from
+## aaaaaaaa..dddddddd, plus a couple of standard ones (.strtab, etc.)
+## Check the number is correct plus the names of a couple of chosen sections.
+
+# CHECK: Showing 65541 sections
+# CHECK: Name: aaaaaaaa
+# CHECK: Name: bbbbbbbb
+# CHECK: Name: cccccccc
+# CHECK: Name: abcdabcd
+# CHECK: Name: dddddddd
+
+.macro gen_sections4 x
+ .section a\x
+ .section b\x
+ .section c\x
+ .section d\x
+.endm
+
+.macro gen_sections16 x
+ gen_sections4 a\x
+ gen_sections4 b\x
+ gen_sections4 c\x
+ gen_sections4 d\x
+.endm
+
+.macro gen_sections64 x
+ gen_sections16 a\x
+ gen_sections16 b\x
+ gen_sections16 c\x
+ gen_sections16 d\x
+.endm
+
+.macro gen_sections256 x
+ gen_sections64 a\x
+ gen_sections64 b\x
+ gen_sections64 c\x
+ gen_sections64 d\x
+.endm
+
+.macro gen_sections1024 x
+ gen_sections256 a\x
+ gen_sections256 b\x
+ gen_sections256 c\x
+ gen_sections256 d\x
+.endm
+
+.macro gen_sections4096 x
+ gen_sections1024 a\x
+ gen_sections1024 b\x
+ gen_sections1024 c\x
+ gen_sections1024 d\x
+.endm
+
+.macro gen_sections16384 x
+ gen_sections4096 a\x
+ gen_sections4096 b\x
+ gen_sections4096 c\x
+ gen_sections4096 d\x
+.endm
+
+gen_sections16384 a
+gen_sections16384 b
+gen_sections16384 c
+gen_sections16384 d
+
+.global _start
+_start:
diff --git a/lit/Modules/elf-section-types.yaml b/lit/Modules/elf-section-types.yaml
new file mode 100644
index 000000000000..64906a9acf8b
--- /dev/null
+++ b/lit/Modules/elf-section-types.yaml
@@ -0,0 +1,62 @@
+# RUN: yaml2obj %s > %t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: Name: .text
+# CHECK-NEXT: Type: code
+
+# CHECK: Name: .debug_info
+# CHECK-NEXT: Type: dwarf-info
+# CHECK-NEXT: VM size: 0
+# CHECK-NEXT: File size: 8
+
+# CHECK: Name: .debug_types
+# CHECK-NEXT: Type: dwarf-types
+# CHECK-NEXT: VM size: 0
+# CHECK-NEXT: File size: 8
+
+# CHECK: Name: .debug_names
+# CHECK-NEXT: Type: dwarf-names
+# CHECK-NEXT: VM size: 0
+# CHECK-NEXT: File size: 8
+
+# CHECK: Name: .gnu_debugaltlink
+# CHECK-NEXT: Type: dwarf-gnu-debugaltlink
+# CHECK-NEXT: VM size: 0
+# CHECK-NEXT: File size: 8
+
+# CHECK: Name: __codesection
+# CHECK-NEXT: Type: code
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_DYN
+ Machine: EM_X86_64
+ Entry: 0x00000000000007A0
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Content: DEADBEEFBAADF00D
+ - Name: .debug_info
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: DEADBEEFBAADF00D
+ - Name: .debug_types
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: DEADBEEFBAADF00D
+ - Name: .debug_names
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: DEADBEEFBAADF00D
+ - Name: .gnu_debugaltlink
+ Type: SHT_PROGBITS
+ AddressAlign: 0x0000000000000001
+ Content: DEADBEEFBAADF00D
+ - Name: __codesection
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Content: DEADBEEFBAADF00D
+...
diff --git a/lit/Modules/lc_version_min.yaml b/lit/Modules/lc_version_min.yaml
new file mode 100644
index 000000000000..e79107069f33
--- /dev/null
+++ b/lit/Modules/lc_version_min.yaml
@@ -0,0 +1,205 @@
+# RUN: yaml2obj %s > %t.out
+# RUN: lldb-test object-file %t.out | FileCheck %s
+
+# Test that the deployment target is parsed from the load commands.
+# CHECK: Architecture: x86_64-apple-macosx10.9.0
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x01000007
+ cpusubtype: 0x80000003
+ filetype: 0x00000002
+ ncmds: 14
+ sizeofcmds: 728
+ flags: 0x00200085
+ reserved: 0x00000000
+LoadCommands:
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: __PAGEZERO
+ vmaddr: 0
+ vmsize: 4294967296
+ fileoff: 0
+ filesize: 0
+ maxprot: 0
+ initprot: 0
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 232
+ segname: __TEXT
+ vmaddr: 4294967296
+ vmsize: 4096
+ fileoff: 0
+ filesize: 4096
+ maxprot: 7
+ initprot: 5
+ nsects: 2
+ flags: 0
+ Sections:
+ - sectname: __text
+ segname: __TEXT
+ addr: 0x0000000100000FB0
+ size: 8
+ offset: 0x00000FB0
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x80000400
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __unwind_info
+ segname: __TEXT
+ addr: 0x0000000100000FB8
+ size: 72
+ offset: 0x00000FB8
+ align: 2
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: __LINKEDIT
+ vmaddr: 4294971392
+ vmsize: 4096
+ fileoff: 4096
+ filesize: 152
+ maxprot: 7
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_DYLD_INFO_ONLY
+ cmdsize: 48
+ rebase_off: 0
+ rebase_size: 0
+ bind_off: 0
+ bind_size: 0
+ weak_bind_off: 0
+ weak_bind_size: 0
+ lazy_bind_off: 0
+ lazy_bind_size: 0
+ export_off: 4096
+ export_size: 48
+ - cmd: LC_SYMTAB
+ cmdsize: 24
+ symoff: 4152
+ nsyms: 3
+ stroff: 4200
+ strsize: 48
+ - cmd: LC_DYSYMTAB
+ cmdsize: 80
+ ilocalsym: 0
+ nlocalsym: 0
+ iextdefsym: 0
+ nextdefsym: 2
+ iundefsym: 2
+ nundefsym: 1
+ tocoff: 0
+ ntoc: 0
+ modtaboff: 0
+ nmodtab: 0
+ extrefsymoff: 0
+ nextrefsyms: 0
+ indirectsymoff: 0
+ nindirectsyms: 0
+ extreloff: 0
+ nextrel: 0
+ locreloff: 0
+ nlocrel: 0
+ - cmd: LC_LOAD_DYLINKER
+ cmdsize: 32
+ name: 12
+ PayloadString: /usr/lib/dyld
+ ZeroPadBytes: 7
+ - cmd: LC_UUID
+ cmdsize: 24
+ uuid: E75E737C-4FB3-312D-9B17-10987F48F957
+ - cmd: LC_VERSION_MIN_MACOSX
+ cmdsize: 16
+ version: 657664
+ sdk: 658944
+ - cmd: LC_SOURCE_VERSION
+ cmdsize: 16
+ version: 0
+ - cmd: LC_MAIN
+ cmdsize: 24
+ entryoff: 4016
+ stacksize: 0
+ - cmd: LC_LOAD_DYLIB
+ cmdsize: 56
+ dylib:
+ name: 24
+ timestamp: 2
+ current_version: 82102276
+ compatibility_version: 65536
+ PayloadString: /usr/lib/libSystem.B.dylib
+ ZeroPadBytes: 6
+ - cmd: LC_FUNCTION_STARTS
+ cmdsize: 16
+ dataoff: 4144
+ datasize: 8
+ - cmd: LC_DATA_IN_CODE
+ cmdsize: 16
+ dataoff: 4152
+ datasize: 0
+LinkEditData:
+ ExportTrie:
+ TerminalSize: 0
+ NodeOffset: 0
+ Name: ''
+ Flags: 0x0000000000000000
+ Address: 0x0000000000000000
+ Other: 0x0000000000000000
+ ImportName: ''
+ Children:
+ - TerminalSize: 0
+ NodeOffset: 5
+ Name: _
+ Flags: 0x0000000000000000
+ Address: 0x0000000000000000
+ Other: 0x0000000000000000
+ ImportName: ''
+ Children:
+ - TerminalSize: 2
+ NodeOffset: 33
+ Name: _mh_execute_header
+ Flags: 0x0000000000000000
+ Address: 0x0000000000000000
+ Other: 0x0000000000000000
+ ImportName: ''
+ - TerminalSize: 3
+ NodeOffset: 37
+ Name: main
+ Flags: 0x0000000000000000
+ Address: 0x0000000000000FB0
+ Other: 0x0000000000000000
+ ImportName: ''
+ NameList:
+ - n_strx: 2
+ n_type: 0x0F
+ n_sect: 1
+ n_desc: 16
+ n_value: 4294967296
+ - n_strx: 22
+ n_type: 0x0F
+ n_sect: 1
+ n_desc: 0
+ n_value: 4294971312
+ - n_strx: 28
+ n_type: 0x01
+ n_sect: 0
+ n_desc: 256
+ n_value: 0
+ StringTable:
+ - ' '
+ - __mh_execute_header
+ - _main
+ - dyld_stub_binder
+ - ''
+ - ''
+ - ''
+...
diff --git a/lit/Modules/lit.local.cfg b/lit/Modules/lit.local.cfg
index 8169b9f95e11..71a6605683a4 100644
--- a/lit/Modules/lit.local.cfg
+++ b/lit/Modules/lit.local.cfg
@@ -1 +1 @@
-config.suffixes = ['.yaml']
+config.suffixes = ['.s', '.yaml']
diff --git a/lit/Modules/short-build-id.yaml b/lit/Modules/short-build-id.yaml
new file mode 100644
index 000000000000..907813473920
--- /dev/null
+++ b/lit/Modules/short-build-id.yaml
@@ -0,0 +1,26 @@
+# RUN: yaml2obj %s >%t
+# RUN: lldb-test object-file %t | FileCheck %s
+
+# CHECK: UUID: 333059A4-3CC3-D5F9
+
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+ Entry: 0x0000000000201000
+Sections:
+ - Name: .note.gnu.build-id
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000200190
+ AddressAlign: 0x0000000000000004
+ Content: 040000000800000003000000474E5500333059A43CC3D5F9
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x0000000000201000
+ AddressAlign: 0x0000000000000004
+ Content: ''
+...
diff --git a/lit/Quit/TestQuitExitCode-30.test b/lit/Quit/TestQuitExitCode-30.test
new file mode 100644
index 000000000000..0f6eff927f0c
--- /dev/null
+++ b/lit/Quit/TestQuitExitCode-30.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: python %S/expect_exit_code.py 226 %lldb -b -s %s
+q -30
diff --git a/lit/Quit/TestQuitExitCode0.test b/lit/Quit/TestQuitExitCode0.test
new file mode 100644
index 000000000000..c15cb5e9ea7b
--- /dev/null
+++ b/lit/Quit/TestQuitExitCode0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: %lldb -b -s %s
+q 0
diff --git a/lit/Quit/TestQuitExitCode30.test b/lit/Quit/TestQuitExitCode30.test
new file mode 100644
index 000000000000..b5249400ec2f
--- /dev/null
+++ b/lit/Quit/TestQuitExitCode30.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: python %S/expect_exit_code.py 30 %lldb -b -s %s
+q 30
diff --git a/lit/Quit/TestQuitExitCodeHex0.test b/lit/Quit/TestQuitExitCodeHex0.test
new file mode 100644
index 000000000000..3e1fc5dbeeb1
--- /dev/null
+++ b/lit/Quit/TestQuitExitCodeHex0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: %lldb -b -s %s
+q 0x0
diff --git a/lit/Quit/TestQuitExitCodeHexA.test b/lit/Quit/TestQuitExitCodeHexA.test
new file mode 100644
index 000000000000..e06c25b0619f
--- /dev/null
+++ b/lit/Quit/TestQuitExitCodeHexA.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: python %S/expect_exit_code.py 10 %lldb -b -s %s
+q 0xA
diff --git a/lit/Quit/TestQuitExitCodeImplicit0.test b/lit/Quit/TestQuitExitCodeImplicit0.test
new file mode 100644
index 000000000000..1a95e8dc0bf1
--- /dev/null
+++ b/lit/Quit/TestQuitExitCodeImplicit0.test
@@ -0,0 +1,3 @@
+# UNSUPPORTED: windows
+# RUN: %lldb -b -s %s
+q
diff --git a/lit/Quit/TestQuitExitCodeNonInt.test b/lit/Quit/TestQuitExitCodeNonInt.test
new file mode 100644
index 000000000000..2b54163d6489
--- /dev/null
+++ b/lit/Quit/TestQuitExitCodeNonInt.test
@@ -0,0 +1,4 @@
+# UNSUPPORTED: windows
+# RUN: %lldb -b -s %s 2>&1 | FileCheck %s
+q str
+// CHECK: Couldn't parse 'str'
diff --git a/lit/Quit/TestQuitExitCodeTooManyArgs.test b/lit/Quit/TestQuitExitCodeTooManyArgs.test
new file mode 100644
index 000000000000..05be357fd57a
--- /dev/null
+++ b/lit/Quit/TestQuitExitCodeTooManyArgs.test
@@ -0,0 +1,4 @@
+# UNSUPPORTED: windows
+# RUN: %lldb -b -s %s 2>&1 | FileCheck %s
+q 1 2
+// CHECK: Too many arguments for 'quit'
diff --git a/lit/Quit/expect_exit_code.py b/lit/Quit/expect_exit_code.py
new file mode 100755
index 000000000000..f4a7590b7d52
--- /dev/null
+++ b/lit/Quit/expect_exit_code.py
@@ -0,0 +1,16 @@
+#!/usr/bin/env python2
+
+import subprocess
+import sys
+
+args = sys.argv
+
+expected_exit_code = args[1]
+
+args = args[2:]
+print("Running " + (" ".join(args)))
+real_exit_code = subprocess.call(args)
+
+if str(real_exit_code) != expected_exit_code:
+ print("Got exit code %d but expected %s" % (real_exit_code, expected_exit_code))
+ exit(1)
diff --git a/lit/Quit/lit.local.cfg b/lit/Quit/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/Quit/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/Suite/lit.cfg b/lit/Suite/lit.cfg
new file mode 100644
index 000000000000..eb0fac9541ac
--- /dev/null
+++ b/lit/Suite/lit.cfg
@@ -0,0 +1,37 @@
+# -*- Python -*-
+
+# Configuration file for the 'lit' test runner.
+
+import os
+import shlex
+
+import lit.formats
+
+# name: The name of this test suite.
+config.name = 'lldb-Suite'
+
+# suffixes: A list of file extensions to treat as test files.
+config.suffixes = ['.py']
+
+# test_source_root: The root path where tests are located.
+# test_exec_root: The root path where tests should be run.
+config.test_source_root = os.path.join(config.lldb_src_root, 'packages',
+ 'Python', 'lldbsuite', 'test')
+config.test_exec_root = config.test_source_root
+
+# Build dotest command.
+dotest_cmd = [config.dotest_path, '-q']
+dotest_cmd.extend(config.dotest_args_str.split(';'))
+
+# We don't want to force users passing arguments to lit to use `;` as a
+# separator. We use Python's simple lexical analyzer to turn the args into a
+# list.
+if config.dotest_lit_args_str:
+ dotest_cmd.extend(shlex.split(config.dotest_lit_args_str))
+
+# Load LLDB test format.
+sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
+import lldbtest
+
+# testFormat: The test format to use to interpret tests.
+config.test_format = lldbtest.LLDBTest(dotest_cmd)
diff --git a/lit/Suite/lit.site.cfg.in b/lit/Suite/lit.site.cfg.in
new file mode 100644
index 000000000000..40f3310c6129
--- /dev/null
+++ b/lit/Suite/lit.site.cfg.in
@@ -0,0 +1,37 @@
+@LIT_SITE_CFG_IN_HEADER@
+
+config.test_exec_root = "@LLVM_BINARY_DIR@"
+config.llvm_src_root = "@LLVM_SOURCE_DIR@"
+config.llvm_obj_root = "@LLVM_BINARY_DIR@"
+config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
+config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
+config.llvm_build_mode = "@LLVM_BUILD_MODE@"
+config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
+config.lldb_obj_root = "@LLDB_BINARY_DIR@"
+config.lldb_src_root = "@LLDB_SOURCE_DIR@"
+config.target_triple = "@TARGET_TRIPLE@"
+config.python_executable = "@PYTHON_EXECUTABLE@"
+config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
+config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
+config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
+config.dotest_lit_args_str = None
+
+# Additional dotest arguments can be passed to lit by providing a
+# semicolon-separates list: --param dotest-args="arg;arg".
+dotest_lit_args_str = lit_config.params.get('dotest-args', None)
+if dotest_lit_args_str:
+ config.dotest_lit_args_str = dotest_lit_args_str
+
+# Support substitution of the tools and libs dirs with user parameters. This is
+# used when we can't determine the tool dir at configuration time.
+try:
+ config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
+ config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+ config.dotest_args_str = config.dotest_args_str % lit_config.params
+ config.llvm_build_mode = config.llvm_build_mode % lit_config.params
+except KeyError as e:
+ key, = e.args
+ lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
+
+# Let the main config do the real work.
+lit_config.load_config(config, "@LLDB_SOURCE_DIR@/lit/Suite/lit.cfg")
diff --git a/lit/Suite/lldbtest.py b/lit/Suite/lldbtest.py
new file mode 100644
index 000000000000..fbdab183a4a3
--- /dev/null
+++ b/lit/Suite/lldbtest.py
@@ -0,0 +1,70 @@
+from __future__ import absolute_import
+import os
+
+import subprocess
+import sys
+
+import lit.Test
+import lit.TestRunner
+import lit.util
+from lit.formats.base import TestFormat
+
+
+class LLDBTest(TestFormat):
+ def __init__(self, dotest_cmd):
+ self.dotest_cmd = dotest_cmd
+
+ def getTestsInDirectory(self, testSuite, path_in_suite, litConfig,
+ localConfig):
+ source_path = testSuite.getSourcePath(path_in_suite)
+ for filename in os.listdir(source_path):
+ # Ignore dot files and excluded tests.
+ if (filename.startswith('.') or filename in localConfig.excludes):
+ continue
+
+ # Ignore files that don't start with 'Test'.
+ if not filename.startswith('Test'):
+ continue
+
+ filepath = os.path.join(source_path, filename)
+ if not os.path.isdir(filepath):
+ base, ext = os.path.splitext(filename)
+ if ext in localConfig.suffixes:
+ yield lit.Test.Test(testSuite, path_in_suite +
+ (filename, ), localConfig)
+
+ def execute(self, test, litConfig):
+ if litConfig.noExecute:
+ return lit.Test.PASS, ''
+
+ if test.config.lldb_disable_python:
+ return (lit.Test.UNSUPPORTED, 'Python module disabled')
+
+ if test.config.unsupported:
+ return (lit.Test.UNSUPPORTED, 'Test is unsupported')
+
+ testPath, testFile = os.path.split(test.getSourcePath())
+ # On Windows, the system does not always correctly interpret shebang lines.
+ # To make sure we can execute the tests, add python exe as the first parameter
+ # of the command.
+ cmd = [sys.executable] + self.dotest_cmd + [testPath, '-p', testFile]
+
+ try:
+ out, err, exitCode = lit.util.executeCommand(
+ cmd,
+ env=test.config.environment,
+ timeout=litConfig.maxIndividualTestTime)
+ except lit.util.ExecuteCommandTimeoutException:
+ return (lit.Test.TIMEOUT, 'Reached timeout of {} seconds'.format(
+ litConfig.maxIndividualTestTime))
+
+ if exitCode:
+ return lit.Test.FAIL, out + err
+
+ passing_test_line = 'RESULT: PASSED'
+ if passing_test_line not in out and passing_test_line not in err:
+ msg = ('Unable to find %r in dotest output:\n\n%s%s' %
+ (passing_test_line, out, err))
+ return lit.Test.UNRESOLVED, msg
+
+ return lit.Test.PASS, ''
diff --git a/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp b/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
new file mode 100644
index 000000000000..cd02cb07c62c
--- /dev/null
+++ b/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
@@ -0,0 +1,3 @@
+namespace two {
+int foo;
+}
diff --git a/lit/SymbolFile/DWARF/apple-index-is-used.cpp b/lit/SymbolFile/DWARF/apple-index-is-used.cpp
new file mode 100644
index 000000000000..104d86756e48
--- /dev/null
+++ b/lit/SymbolFile/DWARF/apple-index-is-used.cpp
@@ -0,0 +1,8 @@
+// Test that we use the apple indexes.
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols %t | FileCheck %s
+
+// CHECK: .apple_names index present
+// CHECK: .apple_types index present
+
+int foo;
diff --git a/lit/SymbolFile/DWARF/debug-names-compressed.cpp b/lit/SymbolFile/DWARF/debug-names-compressed.cpp
new file mode 100644
index 000000000000..076cac192522
--- /dev/null
+++ b/lit/SymbolFile/DWARF/debug-names-compressed.cpp
@@ -0,0 +1,14 @@
+// Test for a bug where we crashed while processing a compressed debug_names
+// section (use after free).
+
+// REQUIRES: lld, zlib
+
+// RUN: clang -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %s
+// RUN: ld.lld %t.o -o %t --compress-debug-sections=zlib
+// RUN: lldb-test symbols --find=variable --name=foo %t | FileCheck %s
+
+// CHECK: Found 1 variables:
+int foo;
+// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = debug-names-compressed.cpp:[[@LINE-1]]
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp b/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp
new file mode 100644
index 000000000000..14d2bc076d78
--- /dev/null
+++ b/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp
@@ -0,0 +1,13 @@
+// Test that we use the DWARF v5 name indexes.
+
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols %t | FileCheck %s
+
+// CHECK: Name Index
+// CHECK: String: 0x{{.*}} "_start"
+// CHECK: Tag: DW_TAG_subprogram
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp b/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp
new file mode 100644
index 000000000000..3a2cf0122951
--- /dev/null
+++ b/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp
@@ -0,0 +1,23 @@
+// Test that we return complete results when only a part of the binary is built
+// with an index.
+
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t-1.o --target=x86_64-pc-linux -DONE -mllvm -accel-tables=Dwarf
+// RUN: clang %s -g -c -o %t-2.o --target=x86_64-pc-linux -DTWO -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --find=variable --name=foo %t | FileCheck %s
+
+// CHECK: Found 2 variables:
+#ifdef ONE
+namespace one {
+int foo;
+// CHECK-DAG: name = "foo", {{.*}} decl = dwarf5-partial-index.cpp:[[@LINE-1]]
+} // namespace one
+extern "C" void _start() {}
+#else
+namespace two {
+int foo;
+// CHECK-DAG: name = "foo", {{.*}} decl = dwarf5-partial-index.cpp:[[@LINE-1]]
+} // namespace two
+#endif
diff --git a/lit/SymbolFile/DWARF/find-basic-function.cpp b/lit/SymbolFile/DWARF/find-basic-function.cpp
new file mode 100644
index 000000000000..d04c94b38547
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-basic-function.cpp
@@ -0,0 +1,106 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=BASE %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck --check-prefix=METHOD %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL %s
+// RUN: lldb-test symbols --name=_Z3fooi --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL-MANGLED %s
+// RUN: lldb-test symbols --name=foo --context=context --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=function %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=BASE %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck --check-prefix=METHOD %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL %s
+// RUN: lldb-test symbols --name=_Z3fooi --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL-MANGLED %s
+// RUN: lldb-test symbols --name=foo --context=context --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=function %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=BASE %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck --check-prefix=METHOD %s
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL %s
+// RUN: lldb-test symbols --name=_Z3fooi --find=function --function-flags=full %t | \
+// RUN: FileCheck --check-prefix=FULL-MANGLED %s
+// RUN: lldb-test symbols --name=foo --context=context --find=function --function-flags=base %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=function %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// BASE: Found 4 functions:
+// BASE-DAG: name = "foo()", mangled = "_Z3foov"
+// BASE-DAG: name = "foo(int)", mangled = "_Z3fooi"
+// BASE-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
+// BASE-DAG: name = "bar::baz::foo()", mangled = "_ZN3bar3baz3fooEv"
+
+// METHOD: Found 3 functions:
+// METHOD-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
+// METHOD-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
+// METHOD-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
+
+// FULL: Found 7 functions:
+// FULL-DAG: name = "foo()", mangled = "_Z3foov"
+// FULL-DAG: name = "foo(int)", mangled = "_Z3fooi"
+// FULL-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
+// FULL-DAG: name = "bar::baz::foo()", mangled = "_ZN3bar3baz3fooEv"
+// FULL-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
+// FULL-DAG: name = "sbar::foo(int)", mangled = "_ZN4sbar3fooEi"
+// FULL-DAG: name = "ffbar()::sbaz::foo()", mangled = "_ZZ5ffbarvEN4sbaz3fooEv"
+
+// FULL-MANGLED: Found 1 functions:
+// FULL-MANGLED-DAG: name = "foo(int)", mangled = "_Z3fooi"
+
+// CONTEXT: Found 1 functions:
+// CONTEXT-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
+
+// EMPTY: Found 0 functions:
+
+void foo() {}
+void foo(int) {}
+
+namespace bar {
+int context;
+void foo() {}
+namespace baz {
+void foo() {}
+} // namespace baz
+} // namespace bar
+
+struct foo {};
+void fbar(struct foo) {}
+
+void Foo() {}
+
+struct sbar {
+ void foo();
+ static void foo(int);
+};
+void sbar::foo() {}
+void sbar::foo(int) {}
+
+void ffbar() {
+ struct sbaz {
+ void foo() {}
+ };
+ sbaz a;
+ a.foo();
+}
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/find-basic-namespace.cpp b/lit/SymbolFile/DWARF/find-basic-namespace.cpp
new file mode 100644
index 000000000000..11a660bfba9f
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-basic-namespace.cpp
@@ -0,0 +1,46 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=namespace %t | \
+// RUN: FileCheck --check-prefix=FOO %s
+// RUN: lldb-test symbols --name=foo --find=namespace --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=namespace %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=namespace %t | \
+// RUN: FileCheck --check-prefix=FOO %s
+// RUN: lldb-test symbols --name=foo --find=namespace --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=namespace %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=namespace %t | \
+// RUN: FileCheck --check-prefix=FOO %s
+// RUN: lldb-test symbols --name=foo --find=namespace --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=namespace %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// FOO: Found namespace: foo
+
+// CONTEXT: Found namespace: bar::foo
+
+// EMPTY: Namespace not found.
+
+namespace foo {
+int X;
+}
+
+namespace bar {
+int context;
+namespace foo {
+int X;
+}
+} // namespace bar
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/find-basic-type.cpp b/lit/SymbolFile/DWARF/find-basic-type.cpp
new file mode 100644
index 000000000000..a470ef762e61
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-basic-type.cpp
@@ -0,0 +1,55 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=type %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=type %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=type %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=type %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=type %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --name=foo --context=context --find=type %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=not_there --find=type %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// EMPTY: Found 0 types:
+// NAME: Found 4 types:
+// CONTEXT: Found 1 types:
+struct foo { };
+// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
+
+namespace bar {
+int context;
+struct foo {};
+// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
+// CONTEXT-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-2]]
+namespace baz {
+struct foo {};
+// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
+}
+}
+
+struct sbar {
+ struct foo {};
+// NAME-DAG: name = "foo", {{.*}} decl = find-basic-type.cpp:[[@LINE-1]]
+};
+
+struct foobar {};
+
+struct Foo {};
+
+extern "C" void _start(foo, bar::foo, bar::baz::foo, sbar::foo, foobar, Foo) {}
diff --git a/lit/SymbolFile/DWARF/find-basic-variable.cpp b/lit/SymbolFile/DWARF/find-basic-variable.cpp
new file mode 100644
index 000000000000..222ad420d400
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-basic-variable.cpp
@@ -0,0 +1,76 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=variable --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --regex --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=REGEX %s
+// RUN: lldb-test symbols --name=not_there --find=variable %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=variable --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --regex --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=REGEX %s
+// RUN: lldb-test symbols --name=not_there --find=variable %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+//
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=variable --context=context %t | \
+// RUN: FileCheck --check-prefix=CONTEXT %s
+// RUN: lldb-test symbols --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+// RUN: lldb-test symbols --regex --name=foo --find=variable %t | \
+// RUN: FileCheck --check-prefix=REGEX %s
+// RUN: lldb-test symbols --name=not_there --find=variable %t | \
+// RUN: FileCheck --check-prefix=EMPTY %s
+
+// EMPTY: Found 0 variables:
+// NAME: Found 4 variables:
+// CONTEXT: Found 1 variables:
+// REGEX: Found 5 variables:
+int foo;
+// NAME-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-1]]
+// REGEX-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-2]]
+namespace bar {
+int context;
+long foo;
+// NAME-DAG: name = "foo", type = {{.*}} (long int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-1]]
+// CONTEXT-DAG: name = "foo", type = {{.*}} (long int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-2]]
+// REGEX-DAG: name = "foo", type = {{.*}} (long int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-3]]
+namespace baz {
+static short foo;
+// NAME-DAG: name = "foo", type = {{.*}} (short), {{.*}} decl = find-basic-variable.cpp:[[@LINE-1]]
+// REGEX-DAG: name = "foo", type = {{.*}} (short), {{.*}} decl = find-basic-variable.cpp:[[@LINE-2]]
+}
+}
+
+struct sbar {
+ static int foo;
+// NAME-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-1]]
+// REGEX-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-2]]
+};
+int sbar::foo;
+
+int foobar;
+// REGEX-DAG: name = "foobar", type = {{.*}} (int), {{.*}} decl = find-basic-variable.cpp:[[@LINE-1]]
+
+int fbar() {
+ static int foo;
+ return foo + bar::baz::foo;
+}
+
+int Foo;
+
+struct ssbar {
+ int foo;
+};
+
+extern "C" void _start(sbar, ssbar) {}
diff --git a/lit/SymbolFile/DWARF/find-function-regex.cpp b/lit/SymbolFile/DWARF/find-function-regex.cpp
new file mode 100644
index 000000000000..2e099eb4fd74
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-function-regex.cpp
@@ -0,0 +1,26 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=f.o --regex --find=function %t | FileCheck %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=f.o --regex --find=function %t | FileCheck %s
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=f.o --regex --find=function %t | FileCheck %s
+
+// CHECK: Found 3 functions:
+// CHECK-DAG: name = "foo()", mangled = "_Z3foov"
+// CHECK-DAG: name = "ffo()", mangled = "_Z3ffov"
+// CHECK-DAG: name = "bar::foo()", mangled = "_ZN3bar3fooEv"
+
+void foo() {}
+void ffo() {}
+namespace bar {
+void foo() {}
+} // namespace bar
+void fof() {}
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/find-inline-method.s b/lit/SymbolFile/DWARF/find-inline-method.s
new file mode 100644
index 000000000000..6910130ee92c
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-inline-method.s
@@ -0,0 +1,152 @@
+# REQUIRES: lld
+
+# RUN: llvm-mc -triple x86_64-pc-linux %s -filetype=obj > %t.o
+# RUN: ld.lld %t.o -o %t
+# RUN: lldb-test symbols --find=function --name=inl --function-flags=method %t \
+# RUN: | FileCheck %s
+
+# CHECK: Function: {{.*}} mangled = "_Z8externali"
+# CHECK: Blocks: {{.*}} range = [0x00201000-0x00201002)
+# CHECK-NEXT: range = [0x00201000-0x00201002), name = "inl", mangled = _ZN1S3inlEi
+
+
+# Generated via:
+# clang -O2 -g -S
+
+# from file:
+# int forward(int);
+# struct S {
+# static int inl(int a) { return forward(a); }
+# };
+# int external(int a) { return S::inl(a); }
+
+# and then simplified.
+
+ .text
+_Z8externali:
+.Lfunc_begin0:
+ jmp _Z7forwardi
+.Lfunc_end0:
+
+.globl _start
+_start:
+_Z7forwardi:
+ ret
+
+ .section .debug_str,"MS",@progbits,1
+.Linfo_string0:
+ .asciz "clang version 7.0.0 (trunk 332830) (llvm/trunk 332835) with manual modifications"
+.Linfo_string3:
+ .asciz "_ZN1S3inlEi"
+.Linfo_string4:
+ .asciz "inl"
+.Linfo_string6:
+ .asciz "S"
+.Linfo_string8:
+ .asciz "_Z8externali"
+.Linfo_string9:
+ .asciz "external"
+ .section .debug_abbrev,"",@progbits
+ .byte 1 # Abbreviation Code
+ .byte 17 # DW_TAG_compile_unit
+ .byte 1 # DW_CHILDREN_yes
+ .byte 37 # DW_AT_producer
+ .byte 14 # DW_FORM_strp
+ .byte 19 # DW_AT_language
+ .byte 5 # DW_FORM_data2
+ .byte 17 # DW_AT_low_pc
+ .byte 1 # DW_FORM_addr
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 2 # Abbreviation Code
+ .byte 19 # DW_TAG_structure_type
+ .byte 1 # DW_CHILDREN_yes
+ .byte 3 # DW_AT_name
+ .byte 14 # DW_FORM_strp
+ .byte 11 # DW_AT_byte_size
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 3 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 0 # DW_CHILDREN_no
+ .byte 110 # DW_AT_linkage_name
+ .byte 14 # DW_FORM_strp
+ .byte 3 # DW_AT_name
+ .byte 14 # DW_FORM_strp
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 6 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 0 # DW_CHILDREN_no
+ .byte 71 # DW_AT_specification
+ .byte 19 # DW_FORM_ref4
+ .byte 32 # DW_AT_inline
+ .byte 11 # DW_FORM_data1
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 8 # Abbreviation Code
+ .byte 46 # DW_TAG_subprogram
+ .byte 1 # DW_CHILDREN_yes
+ .byte 17 # DW_AT_low_pc
+ .byte 1 # DW_FORM_addr
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 110 # DW_AT_linkage_name
+ .byte 14 # DW_FORM_strp
+ .byte 3 # DW_AT_name
+ .byte 14 # DW_FORM_strp
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 10 # Abbreviation Code
+ .byte 29 # DW_TAG_inlined_subroutine
+ .byte 1 # DW_CHILDREN_yes
+ .byte 49 # DW_AT_abstract_origin
+ .byte 19 # DW_FORM_ref4
+ .byte 17 # DW_AT_low_pc
+ .byte 1 # DW_FORM_addr
+ .byte 18 # DW_AT_high_pc
+ .byte 6 # DW_FORM_data4
+ .byte 0 # EOM(1)
+ .byte 0 # EOM(2)
+ .byte 0 # EOM(3)
+ .section .debug_info,"",@progbits
+.Lcu_begin0:
+ .long .Lcu_end0-.Lcu_start0 # Length of Unit
+.Lcu_start0:
+ .short 4 # DWARF version number
+ .long .debug_abbrev # Offset Into Abbrev. Section
+ .byte 8 # Address Size (in bytes)
+ .byte 1 # Abbrev [1] 0xb:0x9e DW_TAG_compile_unit
+ .long .Linfo_string0 # DW_AT_producer
+ .short 4 # DW_AT_language
+ .quad .Lfunc_begin0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 2 # Abbrev [2] 0x2a:0x1f DW_TAG_structure_type
+ .long .Linfo_string6 # DW_AT_name
+ .byte 1 # DW_AT_byte_size
+.Linl_spec:
+ .byte 3 # Abbrev [3] 0x33:0x15 DW_TAG_subprogram
+ .long .Linfo_string3 # DW_AT_linkage_name
+ .long .Linfo_string4 # DW_AT_name
+ .byte 0 # End Of Children Mark
+.Linl_abstract:
+ .byte 6 # Abbrev [6] 0x50:0x12 DW_TAG_subprogram
+ .long .Linl_spec # DW_AT_specification
+ .byte 1 # DW_AT_inline
+.Linl_a_abstract:
+ .byte 8 # Abbrev [8] 0x62:0x46 DW_TAG_subprogram
+ .quad .Lfunc_begin0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .long .Linfo_string8 # DW_AT_linkage_name
+ .long .Linfo_string9 # DW_AT_name
+ .byte 10 # Abbrev [10] 0x8c:0x1b DW_TAG_inlined_subroutine
+ .long .Linl_abstract # DW_AT_abstract_origin
+ .quad .Lfunc_begin0 # DW_AT_low_pc
+ .long .Lfunc_end0-.Lfunc_begin0 # DW_AT_high_pc
+ .byte 0 # End Of Children Mark
+ .byte 0 # End Of Children Mark
+ .byte 0 # End Of Children Mark
+.Lcu_end0:
diff --git a/lit/SymbolFile/DWARF/find-method-local-struct.cpp b/lit/SymbolFile/DWARF/find-method-local-struct.cpp
new file mode 100644
index 000000000000..19b41e77c17d
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-method-local-struct.cpp
@@ -0,0 +1,19 @@
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck %s
+
+// CHECK-DAG: name = "sbar::foo()", mangled = "_ZN4sbar3fooEv"
+// CHECK-DAG: name = "ffbar()::sbar::foo()", mangled = "_ZZ5ffbarvEN4sbar3fooEv"
+
+struct sbar {
+ void foo();
+};
+void sbar::foo() {}
+
+void ffbar() {
+ struct sbar {
+ void foo() {}
+ };
+ sbar a;
+ a.foo();
+}
diff --git a/lit/SymbolFile/DWARF/find-method.cpp b/lit/SymbolFile/DWARF/find-method.cpp
new file mode 100644
index 000000000000..013e13435b9f
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-method.cpp
@@ -0,0 +1,31 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck %s
+//
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=foo --find=function --function-flags=method %t | \
+// RUN: FileCheck %s
+
+// CHECK-DAG: name = "A::foo()", mangled = "_ZN1A3fooEv"
+// CHECK-DAG: name = "B::foo()", mangled = "_ZN1B3fooEv"
+// CHECK-DAG: name = "C::foo()", mangled = "_ZN1C3fooEv"
+
+struct A {
+ void foo();
+};
+void A::foo() {}
+
+class B {
+ void foo();
+};
+void B::foo() {}
+
+union C {
+ void foo();
+};
+void C::foo() {}
+
+extern "C" void _start() {}
diff --git a/lit/SymbolFile/DWARF/find-qualified-variable.cpp b/lit/SymbolFile/DWARF/find-qualified-variable.cpp
new file mode 100644
index 000000000000..ca1b3184fbe7
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-qualified-variable.cpp
@@ -0,0 +1,15 @@
+// RUN: clang %s -g -c -o %t --target=x86_64-apple-macosx
+// RUN: lldb-test symbols --name=A::foo --find=variable %t | FileCheck %s
+
+// CHECK: Found 1 variables:
+
+struct A {
+ static int foo;
+};
+int A::foo;
+// NAME-DAG: name = "foo", {{.*}} decl = find-qualified-variable.cpp:[[@LINE-1]]
+
+struct B {
+ static int foo;
+};
+int B::foo;
diff --git a/lit/SymbolFile/DWARF/find-type-in-function.cpp b/lit/SymbolFile/DWARF/find-type-in-function.cpp
new file mode 100644
index 000000000000..a0894284fa26
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-type-in-function.cpp
@@ -0,0 +1,24 @@
+// REQUIRES: lld
+
+// XFAIL: *
+
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux
+// RUN: ld.lld %t.o -o %t
+// RUN: lldb-test symbols --name=foo --find=type %t | \
+// RUN: FileCheck --check-prefix=NAME %s
+
+// Lookup for "foo" should find either both "struct foo" types or just the
+// global one. Right now, it finds the definition inside bar(), which is
+// definitely wrong.
+
+// NAME: Found 2 types:
+struct foo {};
+// NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
+
+void bar() {
+ struct foo {};
+// NAME-DAG: name = "foo", {{.*}} decl = find-type-in-function.cpp:[[@LINE-1]]
+ foo a;
+}
+
+extern "C" void _start(foo) {}
diff --git a/lit/SymbolFile/DWARF/find-variable-dwo.cpp b/lit/SymbolFile/DWARF/find-variable-dwo.cpp
new file mode 100644
index 000000000000..142ddc82cdab
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-variable-dwo.cpp
@@ -0,0 +1,25 @@
+// REQUIRES: lld
+
+// RUN: clang %s -g -gsplit-dwarf -c -emit-llvm -o - --target=x86_64-pc-linux -DONE | \
+// RUN: llc -accel-tables=Dwarf -filetype=obj -split-dwarf-file=%t-1.dwo -o %t-1.o
+// RUN: llvm-objcopy --split-dwo=%t-1.dwo %t-1.o
+// RUN: clang %s -g -gsplit-dwarf -c -emit-llvm -o - --target=x86_64-pc-linux -DTWO | \
+// RUN: llc -accel-tables=Dwarf -filetype=obj -split-dwarf-file=%t-2.dwo -o %t-2.o
+// RUN: llvm-objcopy --split-dwo=%t-2.dwo %t-2.o
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --name=foo --find=variable %t | FileCheck %s
+
+// CHECK: Found 2 variables:
+#ifdef ONE
+namespace one {
+int foo;
+// CHECK-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-dwo.cpp:[[@LINE-1]]
+} // namespace one
+
+extern "C" void _start() {}
+#else
+namespace two {
+int foo;
+// CHECK-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-dwo.cpp:[[@LINE-1]]
+} // namespace two
+#endif
diff --git a/lit/SymbolFile/DWARF/find-variable-file.cpp b/lit/SymbolFile/DWARF/find-variable-file.cpp
new file mode 100644
index 000000000000..f71d4a2b09b6
--- /dev/null
+++ b/lit/SymbolFile/DWARF/find-variable-file.cpp
@@ -0,0 +1,28 @@
+// REQUIRES: lld
+
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux -mllvm -accel-tables=Disable %S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=TWO %s
+
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux -mllvm -accel-tables=Dwarf %S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | \
+// RUN: FileCheck --check-prefix=TWO %s
+
+// ONE: Found 1 variables:
+namespace one {
+int foo;
+// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = find-variable-file.cpp:[[@LINE-1]]
+} // namespace one
+
+extern "C" void _start() {}
+
+// TWO: Found 1 variables:
+// TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:2
diff --git a/lit/SymbolFile/DWARF/lit.local.cfg b/lit/SymbolFile/DWARF/lit.local.cfg
new file mode 100644
index 000000000000..2f03ed183547
--- /dev/null
+++ b/lit/SymbolFile/DWARF/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.cpp', '.s']
diff --git a/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp b/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp
new file mode 100644
index 000000000000..4cce7f667ff7
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/CompilandsTest.cpp
@@ -0,0 +1,3 @@
+int main() {
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp b/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp
new file mode 100644
index 000000000000..ccccf6ffd108
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FuncSymbols.cpp
@@ -0,0 +1,16 @@
+// Static function
+namespace {
+static long StaticFunction(int a)
+{
+ return 2;
+}
+}
+
+// Inlined function
+static inline int InlinedFunction(long a) { return 10; }
+
+void FunctionCall()
+{
+ StaticFunction(1);
+ InlinedFunction(1);
+}
diff --git a/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp b/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp
new file mode 100644
index 000000000000..17eeab7117bf
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FuncSymbolsTestMain.cpp
@@ -0,0 +1,59 @@
+
+// Global functions
+int Func_arg_array(int array[]) { return 1; }
+void Func_arg_void(void) { return; }
+void Func_arg_none(void) { return; }
+void Func_varargs(...) { return; }
+
+// Class
+namespace MemberTest {
+ class A {
+ public:
+ int Func(int a, ...) { return 1; }
+ };
+}
+
+// Template
+template <int N=1, class ...T>
+void TemplateFunc(T ...Arg) {
+ return;
+}
+
+// namespace
+namespace {
+ void Func(int a, const long b, volatile bool c, ...) { return; }
+}
+
+namespace NS {
+ void Func(char a, int b) {
+ return;
+ }
+}
+
+// Static function
+static long StaticFunction(int a)
+{
+ return 2;
+}
+
+// Inlined function
+inline void InlinedFunction(long a) { return; }
+
+extern void FunctionCall();
+
+int main() {
+ MemberTest::A v1;
+ v1.Func('a',10);
+
+ Func(1, 5, true, 10, 8);
+ NS::Func('c', 2);
+
+ TemplateFunc(10);
+ TemplateFunc(10,11,88);
+
+ StaticFunction(2);
+ InlinedFunction(1);
+
+ FunctionCall();
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp
new file mode 100644
index 000000000000..fa0030bacbf3
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.cpp
@@ -0,0 +1,9 @@
+#include "FunctionLevelLinkingTest.h"
+
+int foo() {
+ return 0;
+}
+
+int main() {
+ return foo() + bar() + baz();
+}
diff --git a/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h
new file mode 100644
index 000000000000..0cc9d80d85d1
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.h
@@ -0,0 +1,12 @@
+#ifndef FUNCTION_LEVEL_LINKING_TEST_H
+#define FUNCTION_LEVEL_LINKING_TEST_H
+
+int bar() {
+ return 0;
+}
+
+int baz() {
+ return 0;
+}
+
+#endif
diff --git a/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord
new file mode 100644
index 000000000000..48abd0b872f9
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FunctionLevelLinkingTest.ord
@@ -0,0 +1,4 @@
+?foo@@YAHXZ
+?bar@@YAHXZ
+main
+?baz@@YAHXZ
diff --git a/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp b/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp
new file mode 100644
index 000000000000..62e201df5fef
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/FunctionNestedBlockTest.cpp
@@ -0,0 +1,8 @@
+int main() {
+ auto r = 0;
+ for (auto i = 1; i <= 10; i++) {
+ r += i & 1 + (i - 1) & 1 - 1;
+ }
+
+ return r;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp b/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
new file mode 100644
index 000000000000..8e516201644c
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/SimpleTypesTest.cpp
@@ -0,0 +1,49 @@
+// typedef
+typedef unsigned long ULongArrayTypedef[10];
+ULongArrayTypedef ULongArrayVar;
+
+typedef long double*& RefTypedef;
+long double* LongDoublePtrVar = 0;
+RefTypedef RefVar = LongDoublePtrVar;
+
+typedef long long (*FuncPtrTypedef)(int&, unsigned char**, short[], const double, volatile bool);
+FuncPtrTypedef FuncVar;
+
+typedef char (*VarArgsFuncTypedef)(void*, long, unsigned short, unsigned int, ...);
+VarArgsFuncTypedef VarArgsFuncVar;
+
+typedef float (*VarArgsFuncTypedefA)(...);
+VarArgsFuncTypedefA VarArgsFuncVarA;
+
+// unscoped enum
+enum Enum { RED, GREEN, BLUE };
+Enum EnumVar;
+
+enum EnumConst { LOW, NORMAL = 10, HIGH };
+EnumConst EnumConstVar;
+
+enum EnumEmpty {};
+EnumEmpty EnumEmptyVar;
+
+enum EnumUChar : unsigned char { ON, OFF, AUTO };
+EnumUChar EnumCharVar;
+
+// scoped enum
+enum class EnumClass { YES, NO, DEFAULT };
+EnumClass EnumClassVar;
+
+enum struct EnumStruct { red, blue, black };
+EnumStruct EnumStructVar;
+
+typedef char16_t WChar16Typedef;
+WChar16Typedef WC16Var;
+
+typedef char32_t WChar32Typedef;
+WChar32Typedef WC32Var;
+
+typedef wchar_t WCharTypedef;
+WCharTypedef WCVar;
+
+int main() {
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp b/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp
new file mode 100644
index 000000000000..bedafcdacfc3
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/TypeQualsTest.cpp
@@ -0,0 +1,46 @@
+// Rank > 0 array
+typedef volatile int* RankNArray[10][100];
+RankNArray ArrayVar;
+
+typedef int __unaligned *UnalignedTypedef;
+UnalignedTypedef UnVar;
+
+typedef long* __restrict RestrictTypedef;
+RestrictTypedef RestrictVar;
+
+void Func1(const int* a, int const* b, const int ** const c, const int* const* d) {
+ return;
+}
+
+void Func2(volatile int* a, int volatile* b) {
+ return;
+}
+
+void Func3(int*& a, int& b, const int&c, int&& d) {
+ return;
+}
+
+void Func4(int* __unaligned a, __unaligned int* b) {
+ return;
+}
+
+void Func5(int a, int* __restrict b, int& __restrict c) {
+ return;
+}
+
+void Func6(const volatile int* __restrict b) {
+ return;
+}
+
+// LValue
+typedef int& IntRef;
+int x = 0;
+IntRef IVar = x;
+
+// RValue
+typedef int&& IIRef;
+IIRef IIVar = int(1);
+
+int main() {
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp b/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp
new file mode 100644
index 000000000000..54d54c0d56a6
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.cpp
@@ -0,0 +1,15 @@
+int g_var = 2222;
+
+void __fastcall foo(short arg_0, float arg_1) {
+ char loc_0 = 'x';
+ double loc_1 = 0.5678;
+}
+
+int main(int argc, char *argv[]) {
+ bool loc_0 = true;
+ int loc_1 = 3333;
+
+ foo(1111, 0.1234);
+
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script b/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script
new file mode 100644
index 000000000000..7058f29ae1c1
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/VariablesLocationsTest.script
@@ -0,0 +1,16 @@
+breakpoint set --file VariablesLocationsTest.cpp --line 6
+
+run
+
+target variable g_var
+
+frame variable arg_0
+frame variable arg_1
+
+frame variable loc_0
+frame variable loc_1
+
+frame select 1
+
+frame variable loc_0
+frame variable loc_1
diff --git a/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp b/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp
new file mode 100644
index 000000000000..304d90566091
--- /dev/null
+++ b/lit/SymbolFile/PDB/Inputs/VariablesTest.cpp
@@ -0,0 +1,50 @@
+typedef int IntTypedef;
+IntTypedef g_IntVar; // Testing globals.
+
+typedef enum Enum { // Testing constants.
+ RED,
+ GREEN,
+ BLUE
+} EnumTypedef;
+EnumTypedef g_EnumVar; // Testing members.
+
+// FIXME: `sg_IntVar` appears both in global scope's children and compiland's
+// children but with different symbol's id.
+static int sg_IntVar = -1; // Testing file statics.
+
+// FIXME: `g_Const` appears both in global scope's children and compiland's
+// children but with different symbol's id.
+const int g_Const = 0x88; // Testing constant data.
+const int *g_pConst = &g_Const; // Avoid optimizing the const away
+
+thread_local int g_tls = 0; // Testing thread-local storage.
+
+class Class {
+ static int m_StaticClassMember;
+public:
+ explicit Class(int a) {}
+ void Func() {}
+};
+int Class::m_StaticClassMember = 10; // Testing static class members.
+Class ClassVar(1);
+
+int f(int var_arg1, int var_arg2) { // Testing parameters.
+ long same_name_var = -1;
+ return 1;
+}
+
+int same_name_var = 100;
+int main() {
+ int same_name_var = 0; // Testing locals.
+ const char local_const = 0x1;
+
+ // FIXME: 'local_CString` is not found through compiland's children.
+ const char local_CString[] = "abc"; // Testing constant string.
+ const char *local_pCString = local_CString; // Avoid optimizing the const away
+
+ int a = 10;
+ a++;
+
+ ClassVar.Func();
+ return 0;
+}
diff --git a/lit/SymbolFile/PDB/compilands.test b/lit/SymbolFile/PDB/compilands.test
new file mode 100644
index 000000000000..2e7b014fe966
--- /dev/null
+++ b/lit/SymbolFile/PDB/compilands.test
@@ -0,0 +1,9 @@
+REQUIRES: windows
+RUN: clang-cl /Z7 %S/Inputs/CompilandsTest.cpp /o %T/CompilandsTest.cpp.exe
+RUN: lldb-test symbols %T/CompilandsTest.cpp.exe | FileCheck %s
+
+; Link default libraries
+
+CHECK: Module [[CU:.*]]
+CHECK: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
+CHECK: {{^[0-9A-F]+}}: CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", file = '{{.*}}\CompilandsTest.cpp'
diff --git a/lit/SymbolFile/PDB/enums-layout.test b/lit/SymbolFile/PDB/enums-layout.test
new file mode 100644
index 000000000000..ce0b23f453be
--- /dev/null
+++ b/lit/SymbolFile/PDB/enums-layout.test
@@ -0,0 +1,45 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/SimpleTypesTest.cpp /o %T/SimpleTypesTest.cpp.enums.obj
+RUN: link %T/SimpleTypesTest.cpp.enums.obj /DEBUG /nodefaultlib /ENTRY:main /OUT:%T/SimpleTypesTest.cpp.enums.exe
+RUN: lldb-test symbols %T/SimpleTypesTest.cpp.enums.exe | FileCheck %s
+
+; FIXME: PDB does not have information about scoped enumeration (Enum class) so the
+; compiler type used is the same as the one for unscoped enumeration.
+
+CHECK: Module [[CU:.*]]
+CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[CU]])
+CHECK: Type{{.*}} , name = "Enum", size = 4, decl = SimpleTypesTest.cpp:19, compiler_type = {{.*}} enum Enum {
+CHECK-NEXT: RED,
+CHECK-NEXT: GREEN,
+CHECK-NEXT: BLUE
+CHECK-NEXT:}
+
+CHECK: Type{{.*}} , name = "EnumConst", size = 4, decl = SimpleTypesTest.cpp:22, compiler_type = {{.*}} enum EnumConst {
+CHECK-NEXT: LOW,
+CHECK-NEXT: NORMAL,
+CHECK-NEXT: HIGH
+CHECK-NEXT:}
+
+CHECK: Type{{.*}} , name = "EnumEmpty", size = 4, decl = SimpleTypesTest.cpp:25, compiler_type = {{.*}} enum EnumEmpty {
+CHECK-NEXT:}
+
+CHECK: Type{{.*}} , name = "EnumUChar", size = 1, decl = SimpleTypesTest.cpp:28, compiler_type = {{.*}} enum EnumUChar {
+CHECK-NEXT: ON,
+CHECK-NEXT: OFF,
+CHECK-NEXT: AUTO
+CHECK-NEXT:}
+
+; Note that `enum EnumClass` is tested instead of `enum class EnumClass`
+CHECK: Type{{.*}} , name = "EnumClass", size = 4, decl = SimpleTypesTest.cpp:32, compiler_type = {{.*}} enum EnumClass {
+CHECK-NEXT: YES,
+CHECK-NEXT: NO,
+CHECK-NEXT: DEFAULT
+CHECK-NEXT:}
+
+CHECK: Type{{.*}} , name = "EnumStruct", size = 4, decl = SimpleTypesTest.cpp:35, compiler_type = {{.*}} enum EnumStruct {
+CHECK-NEXT: red,
+CHECK-NEXT: blue,
+CHECK-NEXT: black
+CHECK-NEXT:}
+
+CHECK-DAG: {{^[0-9A-F]+}}: CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", file = '{{.*}}\SimpleTypesTest.cpp'
diff --git a/lit/SymbolFile/PDB/func-symbols.test b/lit/SymbolFile/PDB/func-symbols.test
new file mode 100644
index 000000000000..b13ff7e65bb0
--- /dev/null
+++ b/lit/SymbolFile/PDB/func-symbols.test
@@ -0,0 +1,48 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/FuncSymbolsTestMain.cpp /o %T/FuncSymbolsTestMain.cpp.obj
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/FuncSymbols.cpp /o %T/FuncSymbols.cpp.obj
+RUN: link %T/FuncSymbolsTestMain.cpp.obj %T/FuncSymbols.cpp.obj /DEBUG /nodefaultlib /Entry:main /OUT:%T/FuncSymbolsTest.exe
+RUN: lldb-test symbols %T/FuncSymbolsTest.exe | FileCheck --check-prefix=CHECK-ONE %s
+RUN: lldb-test symbols %T/FuncSymbolsTest.exe | FileCheck --check-prefix=CHECK-TWO %s
+
+; Link multiple objects
+; In this test, We don't check demangled name of a mangled function.
+
+CHECK-ONE: Module [[MD:.*]]
+CHECK-ONE-DAG: {{.*}}: SymbolVendor ([[MD]])
+CHECK-ONE-DAG: [[TY0:.*]]: Type{[[UID0:.*]]} , name = "Func_arg_array", decl = FuncSymbolsTestMain.cpp:3, compiler_type = {{.*}} int (int *)
+CHECK-ONE-DAG: [[TY1:.*]]: Type{[[UID1:.*]]} , name = "Func_arg_void", decl = FuncSymbolsTestMain.cpp:4, compiler_type = {{.*}} void (void)
+CHECK-ONE-DAG: [[TY2:.*]]: Type{[[UID2:.*]]} , name = "Func_arg_none", decl = FuncSymbolsTestMain.cpp:5, compiler_type = {{.*}} void (void)
+CHECK-ONE-DAG: [[TY3:.*]]: Type{[[UID3:.*]]} , name = "Func_varargs", decl = FuncSymbolsTestMain.cpp:6, compiler_type = {{.*}} void (...)
+CHECK-ONE-DAG: [[TY4:.*]]: Type{[[UID4:.*]]} , name = "NS::Func", decl = FuncSymbolsTestMain.cpp:28, compiler_type = {{.*}} void (signed char, int)
+CHECK-ONE-DAG: [[TY5:.*]]: Type{[[UID5:.*]]} , name = "main", decl = FuncSymbolsTestMain.cpp:44, compiler_type = {{.*}} int (void)
+CHECK-ONE-DAG: [[TY6:.*]]: Type{[[UID6:.*]]} , name = "`anonymous namespace'::Func", decl = FuncSymbolsTestMain.cpp:24, compiler_type = {{.*}} void (int, const long, volatile _Bool, ...)
+CHECK-ONE-DAG: [[TY7:.*]]: Type{[[UID7:.*]]} , name = "StaticFunction", decl = FuncSymbolsTestMain.cpp:35, compiler_type = {{.*}} long (int)
+CHECK-ONE-DAG: [[TY8:.*]]: Type{[[UID8:.*]]} , name = "MemberTest::A::Func", decl = FuncSymbolsTestMain.cpp:12, compiler_type = {{.*}} int (int, ...)
+CHECK-ONE-DAG: [[TY9:.*]]: Type{[[UID9:.*]]} , name = "TemplateFunc<1,int>", decl = FuncSymbolsTestMain.cpp:18, compiler_type = {{.*}} void (int)
+CHECK-ONE-DAG: [[TY10:.*]]: Type{[[UID10:.*]]} , name = "TemplateFunc<1,int,int,int>", decl = FuncSymbolsTestMain.cpp:18, compiler_type = {{.*}} void (int, int, int)
+CHECK-ONE-DAG: [[TY11:.*]]: Type{[[UID11:.*]]} , name = "InlinedFunction", decl = FuncSymbolsTestMain.cpp:40, compiler_type = {{.*}} void (long)
+
+CHECK-ONE: {{.*}}: CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbolsTestMain.cpp'
+CHECK-ONE-DAG: Function{[[UID0]]}, mangled = ?Func_arg_array@@YAHQAH@Z, demangled = {{.*}}, type = [[TY0]]
+CHECK-ONE-DAG: Function{[[UID1]]}, mangled = ?Func_arg_void@@YAXXZ, demangled = {{.*}}, type = [[TY1]]
+CHECK-ONE-DAG: Function{[[UID2]]}, mangled = ?Func_arg_none@@YAXXZ, demangled = {{.*}}, type = [[TY2]]
+CHECK-ONE-DAG: Function{[[UID3]]}, mangled = ?Func_varargs@@YAXZZ, demangled = {{.*}}, type = [[TY3]]
+CHECK-ONE-DAG: Function{[[UID4]]}, mangled = ?Func@NS@@YAXDH@Z, demangled = {{.*}}, type = [[TY4]]
+CHECK-ONE-DAG: Function{[[UID5]]}, mangled = _main, demangled = {{.*}}, type = [[TY5]]
+CHECK-ONE-DAG: Function{[[UID6]]}, demangled = {{.*}}`anonymous namespace'::Func{{.*}}, type = [[TY6]]
+CHECK-ONE-DAG: Function{[[UID7]]}, demangled = {{.*}}StaticFunction{{.*}}, type = [[TY7]]
+CHECK-ONE-DAG: Function{[[UID8]]}, mangled = ?Func@A@MemberTest@@QAAHHZZ, demangled = {{.*}}, type = [[TY8]]
+CHECK-ONE-DAG: Function{[[UID9]]}, mangled = ??$TemplateFunc@$00H@@YAXH@Z, demangled = {{.*}}, type = [[TY9]]
+CHECK-ONE-DAG: Function{[[UID10]]}, mangled = ??$TemplateFunc@$00HHH@@YAXHHH@Z, demangled = {{.*}}, type = [[TY10]]
+CHECK-ONE-DAG: Function{[[UID11]]}, mangled = ?InlinedFunction@@YAXJ@Z, demangled = {{.*}}, type = [[TY11]]
+
+; We expect new types observed in another compile unit
+CHECK-TWO-DAG: [[TY30:.*]]: Type{[[UID30:.*]]} , name = "FunctionCall", decl = FuncSymbols.cpp:13, compiler_type = {{.*}} void (void)
+CHECK-TWO-DAG: [[TY31:.*]]: Type{[[UID31:.*]]} , name = "`anonymous namespace'::StaticFunction", decl = FuncSymbols.cpp:4, compiler_type = {{.*}} long (int)
+CHECK-TWO-DAG: [[TY32:.*]]: Type{[[UID32:.*]]} , name = "InlinedFunction", decl = FuncSymbols.cpp:10, compiler_type = {{.*}} int (long)
+
+CHECK-TWO: {{.*}}: CompileUnit{{.*}}, language = "c++", file = '{{.*}}\FuncSymbols.cpp'
+CHECK-TWO-DAG: Function{[[UID30]]}, mangled = ?FunctionCall@@YAXXZ, demangled = {{.*}}, type = [[TY30]]
+CHECK-TWO-DAG: Function{[[UID31]]}, demangled = {{.*}}`anonymous namespace'::StaticFunction{{.*}}, type = [[TY31]]
+CHECK-TWO-DAG: Function{[[UID32]]}, demangled = {{.*}}InlinedFunction{{.*}}, type = [[TY32]]
diff --git a/lit/SymbolFile/PDB/function-level-linking.test b/lit/SymbolFile/PDB/function-level-linking.test
new file mode 100644
index 000000000000..9b28ec1ba217
--- /dev/null
+++ b/lit/SymbolFile/PDB/function-level-linking.test
@@ -0,0 +1,4 @@
+REQUIRES: windows, lld
+RUN: clang-cl /c /Zi /Gy %S/Inputs/FunctionLevelLinkingTest.cpp /o %t.obj
+RUN: lld-link /debug:full /nodefaultlib /entry:main /order:@%S/Inputs/FunctionLevelLinkingTest.ord %t.obj /out:%t.exe
+RUN: lldb-test symbols -verify %t.exe
diff --git a/lit/SymbolFile/PDB/function-nested-block.test b/lit/SymbolFile/PDB/function-nested-block.test
new file mode 100644
index 000000000000..93543c681130
--- /dev/null
+++ b/lit/SymbolFile/PDB/function-nested-block.test
@@ -0,0 +1,7 @@
+REQUIRES: windows, lld
+RUN: clang-cl /c /Zi %S/Inputs/FunctionNestedBlockTest.cpp /o %t.obj
+RUN: lld-link /debug:full /nodefaultlib /entry:main %t.obj /out:%t.exe
+RUN: lldb-test symbols -find=function -file FunctionNestedBlockTest.cpp -line 4 %t.exe | FileCheck %s
+
+CHECK: Found 1 functions:
+CHECK: name = "{{.*}}", mangled = "{{_?}}main"
diff --git a/lit/SymbolFile/PDB/lit.local.cfg b/lit/SymbolFile/PDB/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/SymbolFile/PDB/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/SymbolFile/PDB/type-quals.test b/lit/SymbolFile/PDB/type-quals.test
new file mode 100644
index 000000000000..fbe10c0d8d64
--- /dev/null
+++ b/lit/SymbolFile/PDB/type-quals.test
@@ -0,0 +1,39 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/TypeQualsTest.cpp /o %T/TypeQualsTest.cpp.obj
+RUN: link %T/TypeQualsTest.cpp.obj /DEBUG /nodefaultlib /ENTRY:main /OUT:%T/TypeQualsTest.cpp.exe
+RUN: lldb-test symbols %T/TypeQualsTest.cpp.exe | FileCheck %s
+
+CHECK: Module [[MOD:.*]]
+CHECK-DAG: {{^[0-9A-F]+}}: SymbolVendor ([[MOD]])
+CHECK: Type{{.*}} , name = "const int", size = 4, compiler_type = {{.*}} const int
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} const int *
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} const int **const
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} const int *const
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} const int *const *
+CHECK: Type{{.*}} , name = "Func1", {{.*}}, compiler_type = {{.*}} void (const int *, const int *, const int **const, const int *const *)
+
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} volatile int *
+CHECK: Type{{.*}} , name = "Func2", {{.*}}, compiler_type = {{.*}} void (volatile int *, volatile int *)
+
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int *
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int *&
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int &
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} const int &
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int &&
+CHECK: Type{{.*}} , name = "Func3", {{.*}}, compiler_type = {{.*}} void (int *&, int &, const int &, int &&)
+
+// FIXME: __unaligned is not supported.
+CHECK: Type{{.*}} , name = "Func4", {{.*}}, compiler_type = {{.*}} void (int *, int *)
+
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int *__restrict
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} int &__restrict
+CHECK: Type{{.*}} , name = "Func5", {{.*}}, compiler_type = {{.*}} void (int, int *__restrict, int &__restrict)
+
+CHECK: Type{{.*}} , name = "Func6", {{.*}}, compiler_type = {{.*}} void (const volatile int *__restrict)
+
+CHECK: Type{{.*}} , size = 400, compiler_type = {{.*}} volatile int *[100]
+CHECK: Type{{.*}} , size = 4000, compiler_type = {{.*}} volatile int *[10][100]
+
+CHECK: Type{{.*}} , size = 4, compiler_type = {{.*}} long *__restrict
+
+CHECK-DAG: {{^[0-9A-F]+}}: CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", file = '{{.*}}\TypeQualsTest.cpp'
diff --git a/lit/SymbolFile/PDB/typedefs.test b/lit/SymbolFile/PDB/typedefs.test
new file mode 100644
index 000000000000..659ef6392d1c
--- /dev/null
+++ b/lit/SymbolFile/PDB/typedefs.test
@@ -0,0 +1,59 @@
+REQUIRES: windows
+RUN: clang-cl -m32 /Z7 /c /GS- %S/Inputs/SimpleTypesTest.cpp /o %T/SimpleTypesTest.cpp.typedefs.obj
+RUN: link %T/SimpleTypesTest.cpp.typedefs.obj /DEBUG /nodefaultlib /ENTRY:main /OUT:%T/SimpleTypesTest.cpp.typedefs.exe
+RUN: lldb-test symbols %T/SimpleTypesTest.cpp.typedefs.exe | FileCheck %s
+
+; Generate 32-bit target
+
+; FIXME: PDB does not have line information for typedef statements so source
+; and line information for them is not tested.
+
+; Note, types `long double` and `double` have same bit size in MSVC and there
+; is no information in the PDB to distinguish them. So the compiler type for
+; both of them is the same.
+
+CHECK: Module [[MOD:.*]]
+CHECK: {{^[0-9A-F]+}}: SymbolVendor ([[MOD]])
+CHECK-DAG: name = "char32_t", size = 4, compiler_type = {{.*}} char32_t
+CHECK-DAG: name = "char16_t", size = 2, compiler_type = {{.*}} char16_t
+CHECK-DAG: Type{{.*}} , name = "unsigned long", size = 4, compiler_type = {{.*}} unsigned long
+CHECK-DAG: Type{{.*}} , size = 40, compiler_type = {{.*}} unsigned long [10]
+CHECK-DAG: Type{{.*}} , name = "ULongArrayTypedef", compiler_type = {{.*}} typedef ULongArrayTypedef
+
+; Note: compiler_type of `long double` is represented by the one for `double`
+CHECK-DAG: Type{{.*}} , name = "double", size = 8, compiler_type = {{.*}} double
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} double *
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} double *&
+CHECK-DAG: Type{{.*}} , name = "RefTypedef", compiler_type = {{.*}} typedef RefTypedef
+
+CHECK-DAG: Type{{.*}} , name = "wchar_t", size = 2, compiler_type = {{.*}} wchar_t
+
+CHECK-DAG: Type{{.*}} , name = "int", size = 4, compiler_type = {{.*}} int
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} int &
+CHECK-DAG: Type{{.*}} , name = "unsigned char", size = 1, compiler_type = {{.*}} unsigned char
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} unsigned char *
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} unsigned char **
+CHECK-DAG: Type{{.*}} , name = "short", size = 2, compiler_type = {{.*}} short
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} short *
+CHECK-DAG: Type{{.*}} , name = "const double", size = 8, compiler_type = {{.*}} const double
+CHECK-DAG: Type{{.*}} , name = "volatile bool", size = 1, compiler_type = {{.*}} volatile _Bool
+CHECK-DAG: Type{{.*}} , name = "long long", size = 8, compiler_type = {{.*}} long long
+CHECK-DAG: Type{{.*}} , compiler_type = {{.*}} long long (int &, unsigned char **, short *, const double, volatile _Bool)
+CHECK-DAG: Type{{.*}} , name = "FuncPtrTypedef", compiler_type = {{.*}} typedef FuncPtrTypedef
+
+CHECK-DAG: Type{{.*}} , name = "void", compiler_type = {{.*}} void
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} void *
+CHECK-DAG: Type{{.*}} , name = "long", size = 4, compiler_type = {{.*}} long
+CHECK-DAG: Type{{.*}} , name = "unsigned short", size = 2, compiler_type = {{.*}} unsigned short
+CHECK-DAG: Type{{.*}} , name = "unsigned int", size = 4, compiler_type = {{.*}} unsigned int
+CHECK-DAG: Type{{.*}} , name = "signed char", size = 1, compiler_type = {{.*}} signed char
+CHECK-DAG: Type{{.*}} , compiler_type = {{.*}} signed char (void *, long, unsigned short, unsigned int, ...)
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} signed char (*)(void *, long, unsigned short, unsigned int, ...)
+CHECK-DAG: Type{{.*}} , name = "VarArgsFuncTypedef", compiler_type = {{.*}} typedef VarArgsFuncTypedef
+
+CHECK-DAG: Type{{.*}} , name = "float", size = 4, compiler_type = {{.*}} float
+CHECK-DAG: Type{{.*}} , compiler_type = {{.*}} float (...)
+CHECK-DAG: Type{{.*}} , size = 4, compiler_type = {{.*}} float (*)(...)
+CHECK-DAG: Type{{.*}} , name = "VarArgsFuncTypedefA", compiler_type = {{.*}} typedef VarArgsFuncTypedefA
+
+CHECK-DAG: {{^[0-9A-F]+}}: CompileUnit{{[{]0x[0-9a-f]+[}]}}, language = "c++", file = '{{.*}}\SimpleTypesTest.cpp'
diff --git a/lit/SymbolFile/PDB/variables-locations.test b/lit/SymbolFile/PDB/variables-locations.test
new file mode 100644
index 000000000000..b70339fa23ac
--- /dev/null
+++ b/lit/SymbolFile/PDB/variables-locations.test
@@ -0,0 +1,14 @@
+REQUIRES: windows
+RUN: clang-cl /Zi %S/Inputs/VariablesLocationsTest.cpp /o %t.exe
+RUN: %lldb -b -s %S/Inputs/VariablesLocationsTest.script -- %t.exe | FileCheck %s
+
+CHECK: g_var = 2222
+
+CHECK: arg_0 = 1111
+CHECK: arg_1 = 0.123
+
+CHECK: loc_0 = 'x'
+CHECK: loc_1 = 0.567
+
+CHECK: loc_0 = true
+CHECK: loc_1 = 3333
diff --git a/lit/SymbolFile/PDB/variables.test b/lit/SymbolFile/PDB/variables.test
new file mode 100644
index 000000000000..6d37cd975b45
--- /dev/null
+++ b/lit/SymbolFile/PDB/variables.test
@@ -0,0 +1,58 @@
+REQUIRES: windows
+RUN: clang-cl /Z7 /c /GS- %S/Inputs/VariablesTest.cpp /o %T/VariablesTest.cpp.obj
+RUN: link %T/VariablesTest.cpp.obj /DEBUG /nodefaultlib /ENTRY:main /OUT:%T/VariablesTest.cpp.exe
+RUN: lldb-test symbols %T/VariablesTest.cpp.exe | FileCheck %s
+
+CHECK: Module [[MOD:.*]]
+CHECK: SymbolVendor ([[MOD]])
+CHECK: CompileUnit{{.*}}, language = "c++", file = '{{.*}}\VariablesTest.cpp'
+CHECK-DAG: Variable{{.*}}, name = "g_IntVar"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "m_StaticClassMember"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "g_pConst"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "same_name_var"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "g_EnumVar"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "g_tls"
+CHECK-SAME: scope = thread local, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "ClassVar"
+CHECK-SAME: scope = global, location = {{.*}}, external
+CHECK-DAG: Variable{{.*}}, name = "g_Const"
+CHECK-SAME: scope = ??? (2)
+
+CHECK-DAG: Function{[[FID1:.*]]}, mangled = ?f@@YAHHH@Z
+CHECK-NEXT: Block{[[FID1]]}
+CHECK-DAG: Variable{{.*}}, name = "var_arg1"
+CHECK-SAME: scope = parameter
+CHECK-DAG: Variable{{.*}}, name = "var_arg2"
+CHECK-SAME: scope = parameter
+CHECK-DAG: Variable{{.*}}, name = "same_name_var"
+CHECK-SAME: scope = local
+
+CHECK-DAG: Function{[[FID2:.*]]}, mangled = main
+CHECK-NEXT: Block{[[FID2]]}
+CHECK-DAG: Variable{{.*}}, name = "same_name_var"
+CHECK-SAME: scope = local
+CHECK-DAG: Variable{{.*}}, name = "local_const"
+CHECK-SAME: scope = local
+CHECK-DAG: Variable{{.*}}, name = "local_pCString"
+CHECK-SAME: scope = local
+CHECK-DAG: Variable{{.*}}, name = "a"
+CHECK-SAME: scope = local
+
+CHECK-DAG: Function{[[FID3:.*]]}, mangled = ??0Class@@QEAA@H@Z
+CHECK-NEXT: Block{[[FID3]]}
+CHECK-DAG: Variable{{.*}}, name = "this"
+CHECK-SAME: scope = parameter
+CHECK-SAME: artificial
+CHECK-DAG: Variable{{.*}}, name = "a"
+CHECK-SAME: scope = parameter
+
+CHECK-DAG: Function{[[FID4:.*]]}, mangled = ?Func@Class@@QEAAXXZ
+CHECK-NEXT: Block{[[FID4]]}
+CHECK-DAG: Variable{{.*}}, name = "this"
+CHECK-SAME: scope = parameter
+CHECK-SAME: artificial \ No newline at end of file
diff --git a/lit/lit-lldb-init b/lit/lit-lldb-init
new file mode 100644
index 000000000000..b3a5d4dc9841
--- /dev/null
+++ b/lit/lit-lldb-init
@@ -0,0 +1,2 @@
+# LLDB init file for the LIT tests.
+settings set symbols.enable-external-lookup false
diff --git a/lit/lit.cfg b/lit/lit.cfg
index 402d03947ca8..7e1fcf7520ca 100644
--- a/lit/lit.cfg
+++ b/lit/lit.cfg
@@ -28,6 +28,8 @@ config.test_format = lit.formats.ShTest(execute_external)
# suffixes: We only support unit tests
config.suffixes = []
+config.excludes = ['Inputs']
+
# test_source_root: The root path where tests are located.
config.test_source_root = os.path.dirname(__file__)
@@ -55,7 +57,10 @@ config.environment['PYTHON_EXECUTABLE'] = getattr(config, 'python_executable', '
config.substitutions.append(('%python', config.python_executable))
debugserver = lit.util.which('debugserver', lldb_tools_dir)
-lldb = lit.util.which('lldb', lldb_tools_dir)
+lldb = "%s -S %s/lit-lldb-init" % (lit.util.which('lldb', lldb_tools_dir),
+ config.test_source_root)
+
+lldbmi = lit.util.which('lldb-mi', lldb_tools_dir)
if not os.path.exists(config.cc):
config.cc = lit.util.which(config.cc, config.environment['PATH'])
@@ -75,9 +80,14 @@ if platform.system() in ['Darwin']:
config.cc += " -isysroot %s" % sdk_path
config.cxx += " -isysroot %s" % sdk_path
+if platform.system() in ['OpenBSD']:
+ config.cc += " -pthread"
+ config.cxx += " -pthread"
+
config.substitutions.append(('%cc', config.cc))
config.substitutions.append(('%cxx', config.cxx))
+config.substitutions.append(('%lldbmi', lldbmi + " --synchronous"))
config.substitutions.append(('%lldb', lldb))
if debugserver is not None:
@@ -91,11 +101,11 @@ for pattern in [r"\bFileCheck\b",
pattern)
tool_pipe = tool_match.group(2)
tool_name = tool_match.group(4)
- tool_path = lit.util.which(tool_name, config.llvm_tools_dir)
+ tool_path = lit.util.which(tool_name, config.environment['PATH'])
if not tool_path:
# Warn, but still provide a substitution.
lit_config.note(
- 'Did not find ' + tool_name + ' in ' + config.llvm_tools_dir)
+ 'Did not find ' + tool_name + ' in ' + config.environment['PATH'])
config.substitutions.append((pattern, tool_pipe + tool_path))
# Shell execution
@@ -115,8 +125,8 @@ if platform.system() in ['FreeBSD', 'Linux']:
else:
config.available_features.add('linux')
-if platform.system() in ['Windows']:
- config.available_features.add('windows')
+config.available_features.add(
+ binary_feature(platform.system() in ['Windows'], 'windows', 'no'))
if re.match(r'^arm(hf.*-linux)|(.*-linux-gnuabihf)', config.target_triple):
config.available_features.add("armhf-linux")
@@ -131,6 +141,8 @@ elif re.match(r'cl', config.cc):
config.available_features.add("compiler-msvc")
config.available_features.add(binary_feature(config.have_zlib, "zlib", "no"))
+if config.have_lld:
+ config.available_features.add("lld")
# llvm-config knows whether it is compiled with asserts (and)
# whether we are operating in release/debug mode.
@@ -155,6 +167,8 @@ if re.search(r'ARM', llvm_config_output_list[2]):
config.available_features.add('arm')
if re.search(r'Mips', llvm_config_output_list[2]):
config.available_features.add('mips')
+if re.search(r'PowerPC', llvm_config_output_list[2]):
+ config.available_features.add('powerpc')
if re.search(r'X86', llvm_config_output_list[2]):
config.available_features.add('x86')
llvm_config_cmd.wait()
diff --git a/lit/lit.site.cfg.in b/lit/lit.site.cfg.in
index 2cfa677651a1..55942db64c4f 100644
--- a/lit/lit.site.cfg.in
+++ b/lit/lit.site.cfg.in
@@ -6,19 +6,24 @@ config.llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.llvm_libs_dir = "@LLVM_LIBS_DIR@"
config.lit_tools_dir = "@LLVM_LIT_TOOLS_DIR@"
config.lldb_obj_root = "@LLDB_BINARY_DIR@"
-config.lldb_libs_dir = "@LLVM_LIBRARY_OUTPUT_INTDIR@"
-config.lldb_tools_dir = "@LLVM_RUNTIME_OUTPUT_INTDIR@"
+config.lldb_libs_dir = "@LLDB_LIBS_DIR@"
+config.lldb_tools_dir = "@LLDB_TOOLS_DIR@"
config.target_triple = "@TARGET_TRIPLE@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.cc = "@LLDB_TEST_C_COMPILER@"
config.cxx = "@LLDB_TEST_CXX_COMPILER@"
-config.have_zlib = @HAVE_LIBZ@
+config.have_zlib = @LLVM_ENABLE_ZLIB@
+config.have_lld = @LLDB_HAVE_LLD@
# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
try:
config.llvm_tools_dir = config.llvm_tools_dir % lit_config.params
config.llvm_libs_dir = config.llvm_libs_dir % lit_config.params
+ config.lldb_libs_dir = config.lldb_libs_dir % lit_config.params
+ config.lldb_tools_dir = config.lldb_tools_dir % lit_config.params
+ config.cc = config.cc % lit_config.params
+ config.cxx = config.cxx % lit_config.params
except KeyError as e:
key, = e.args
lit_config.fatal("unable to find %r parameter, use '--param=%s=VALUE'" % (key,key))
diff --git a/lit/tools/lldb-mi/breakpoint/break-insert.test b/lit/tools/lldb-mi/breakpoint/break-insert.test
new file mode 100644
index 000000000000..cecf9e2443ae
--- /dev/null
+++ b/lit/tools/lldb-mi/breakpoint/break-insert.test
@@ -0,0 +1,18 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o a.exe %p/inputs/break-insert.c -g
+# RUN: %lldbmi < %s | FileCheck %s
+
+# Test that a breakpoint can be inserted before creating a target.
+
+-break-insert breakpoint
+# CHECK: ^done,bkpt={number="1"
+
+-file-exec-and-symbols a.exe
+# CHECK: ^done
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
diff --git a/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c b/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c
new file mode 100644
index 000000000000..67d2e56ee597
--- /dev/null
+++ b/lit/tools/lldb-mi/breakpoint/inputs/break-insert.c
@@ -0,0 +1,7 @@
+int breakpoint() { // Breakpoint will be set here.
+ return 0;
+}
+
+int main() {
+ return breakpoint();
+}
diff --git a/lit/tools/lldb-mi/breakpoint/lit.local.cfg b/lit/tools/lldb-mi/breakpoint/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/tools/lldb-mi/breakpoint/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/tools/lldb-mi/data/data-info-line.test b/lit/tools/lldb-mi/data/data-info-line.test
new file mode 100644
index 000000000000..c224efa4de2d
--- /dev/null
+++ b/lit/tools/lldb-mi/data/data-info-line.test
@@ -0,0 +1,36 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/data-info-line.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -data-info-line command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-data-info-line *0x0
+# Test that -data-info-line fails when invalid address is specified.
+# CHECK: ^error,msg="Command 'data-info-line'. Error: The LineEntry is absent or has an unknown format."
+
+-data-info-line unknown_file:1
+# Test that -data-info-line fails when file is unknown.
+# CHECK: ^error,msg="Command 'data-info-line'. Error: The LineEntry is absent or has an unknown format."
+
+-data-info-line data-info-line.c:bad_line
+# Test that -data-info-line fails when line has invalid format.
+# CHECK: ^error,msg="Command 'data-info-line'. Error: The LineEntry is absent or has an unknown format."
+
+-data-info-line data-info-line.c:0
+# Test that -data-info-line fails when invalid line is specified.
+# CHECK: ^error,msg="Command 'data-info-line'. Error: The LineEntry is absent or has an unknown format."
+
+-data-info-line data-info-line.c:2
+# CHECK: ^done,start="0x{{[0-9a-f]+}}",end="0x{{[0-9a-f]+}}",file="{{.*}}data-info-line.c",line="{{[0-9]+}}"
diff --git a/lit/tools/lldb-mi/data/inputs/data-info-line.c b/lit/tools/lldb-mi/data/inputs/data-info-line.c
new file mode 100644
index 000000000000..61c3710bf203
--- /dev/null
+++ b/lit/tools/lldb-mi/data/inputs/data-info-line.c
@@ -0,0 +1,4 @@
+int main(void) {
+ int x = 0;
+ return 12345 + x;
+}
diff --git a/lit/tools/lldb-mi/data/lit.local.cfg b/lit/tools/lldb-mi/data/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/tools/lldb-mi/data/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/tools/lldb-mi/exec/exec-continue.test b/lit/tools/lldb-mi/exec/exec-continue.test
new file mode 100644
index 000000000000..c363422373d3
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-continue.test
@@ -0,0 +1,20 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-continue command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-continue
+# CHECK: ^running
diff --git a/lit/tools/lldb-mi/exec/exec-finish.test b/lit/tools/lldb-mi/exec/exec-finish.test
new file mode 100644
index 000000000000..03c6b158fcf3
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-finish.test
@@ -0,0 +1,33 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-finish command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-break-insert dummyFunction
+# CHECK: ^done,bkpt={number="2"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-finish --thread 0
+# Check that exec-finish can process the case of invalid thread ID.
+# CHECK: ^error,msg="Command 'exec-finish'. Thread ID invalid"
+
+-exec-finish --thread 1
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-finish
+# Check exec-finish in a selected thread.
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
diff --git a/lit/tools/lldb-mi/exec/exec-interrupt.test b/lit/tools/lldb-mi/exec/exec-interrupt.test
new file mode 100644
index 000000000000..81a3e72ee7e6
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-interrupt.test
@@ -0,0 +1,20 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-interrupt command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-interrupt
+# CHECK: ^error,msg="Process is not running."
diff --git a/lit/tools/lldb-mi/exec/exec-next-instruction.test b/lit/tools/lldb-mi/exec/exec-next-instruction.test
new file mode 100644
index 000000000000..1dcca0468490
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-next-instruction.test
@@ -0,0 +1,30 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-next-instruction command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-next-instruction --thread 0
+# Check that exec-next-instruction can process the case of invalid thread ID.
+# CHECK: ^error,msg="Command 'exec-next-instruction'. Thread ID invalid"
+
+-exec-next-instruction --thread 1
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
+
+-exec-next-instruction
+# Check exec-next-instruction in a selected thread.
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
diff --git a/lit/tools/lldb-mi/exec/exec-next.test b/lit/tools/lldb-mi/exec/exec-next.test
new file mode 100644
index 000000000000..a4dd737b5ddb
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-next.test
@@ -0,0 +1,30 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-next command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-next --thread 0
+# Check that exec-next can process the case of invalid thread ID.
+# CHECK: ^error,msg="Command 'exec-next'. Thread ID invalid"
+
+-exec-next --thread 1
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
+
+-exec-next
+# Check that exec-next can step over in a selected thread.
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
diff --git a/lit/tools/lldb-mi/exec/exec-run-wrong-binary.test b/lit/tools/lldb-mi/exec/exec-run-wrong-binary.test
new file mode 100644
index 000000000000..98dc75f509cd
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-run-wrong-binary.test
@@ -0,0 +1,6 @@
+# RUN: %lldbmi < %s | FileCheck %s
+
+# Test that -exec-run command won't hang in case of wrong name of binary file.
+
+-file-exec-and-symbols name.exe
+# CHECK: ^error,msg="Command 'file-exec-and-symbols'. Target binary 'name.exe' is invalid.
diff --git a/lit/tools/lldb-mi/exec/exec-step-instruction.test b/lit/tools/lldb-mi/exec/exec-step-instruction.test
new file mode 100644
index 000000000000..a02bc01a07d6
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-step-instruction.test
@@ -0,0 +1,30 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-step-instruction command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-step-instruction --thread 0
+# Check that exec-step-instruction can process the case of invalid thread ID.
+# CHECK: ^error,msg="Command 'exec-step-instruction'. Thread ID invalid"
+
+-exec-next-instruction --thread 1
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
+
+-exec-step-instruction
+# Check exec-step-instruction in a selected thread.
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
diff --git a/lit/tools/lldb-mi/exec/exec-step.test b/lit/tools/lldb-mi/exec/exec-step.test
new file mode 100644
index 000000000000..095bba714ec8
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/exec-step.test
@@ -0,0 +1,30 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -exec-step command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-break-insert main
+# CHECK: ^done,bkpt={number="1"
+
+-exec-run
+# CHECK: ^running
+# CHECK: *stopped,reason="breakpoint-hit"
+
+-exec-step --thread 0
+# Check that exec-step can process the case of invalid thread ID.
+# CHECK: ^error,msg="Command 'exec-step'. Thread ID invalid"
+
+-exec-step --thread 1
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
+
+-exec-step
+# Check that exec-step can step-in in a selected thread.
+# CHECK: ^running
+# CHECK: *stopped,reason="end-stepping-range"
diff --git a/lit/tools/lldb-mi/exec/inputs/main.c b/lit/tools/lldb-mi/exec/inputs/main.c
new file mode 100644
index 000000000000..b9d8f9d16f4d
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/inputs/main.c
@@ -0,0 +1,9 @@
+void dummyFunction() {
+ int a = 0;
+}
+
+int main(void) {
+ int x = 0;
+ dummyFunction();
+ return x;
+}
diff --git a/lit/tools/lldb-mi/exec/lit.local.cfg b/lit/tools/lldb-mi/exec/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/tools/lldb-mi/exec/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c b/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c
new file mode 100644
index 000000000000..74e627645406
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.c
@@ -0,0 +1,3 @@
+void HelpFunction(void) {
+ int x = 12345;
+}
diff --git a/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.h b/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.h
new file mode 100644
index 000000000000..05edab992a5f
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/inputs/list-lines-helper.h
@@ -0,0 +1 @@
+void HelpFunction(void);
diff --git a/lit/tools/lldb-mi/symbol/inputs/main.c b/lit/tools/lldb-mi/symbol/inputs/main.c
new file mode 100644
index 000000000000..f21edf3230a5
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/inputs/main.c
@@ -0,0 +1,6 @@
+#include "symbol-list-lines.h"
+
+int main(void) {
+ int x = GetZero();
+ return 0;
+}
diff --git a/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.c b/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.c
new file mode 100644
index 000000000000..761f793548b6
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.c
@@ -0,0 +1,6 @@
+#include "list-lines-helper.h"
+
+int GetZero() {
+ HelpFunction();
+ return 0;
+}
diff --git a/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.h b/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.h
new file mode 100644
index 000000000000..1b74ff621ecb
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/inputs/symbol-list-lines.h
@@ -0,0 +1 @@
+int GetZero();
diff --git a/lit/tools/lldb-mi/symbol/lit.local.cfg b/lit/tools/lldb-mi/symbol/lit.local.cfg
new file mode 100644
index 000000000000..df9b335dd131
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/lit.local.cfg
@@ -0,0 +1 @@
+config.suffixes = ['.test']
diff --git a/lit/tools/lldb-mi/symbol/symbol-list-lines.test b/lit/tools/lldb-mi/symbol/symbol-list-lines.test
new file mode 100644
index 000000000000..f40ad2f94e40
--- /dev/null
+++ b/lit/tools/lldb-mi/symbol/symbol-list-lines.test
@@ -0,0 +1,20 @@
+# XFAIL: windows
+# -> llvm.org/pr24452
+#
+# RUN: %cc -o %t %p/inputs/main.c %p/inputs/symbol-list-lines.c %p/inputs/list-lines-helper.c -g
+# RUN: %lldbmi %t < %s | FileCheck %s
+
+# Test lldb-mi -symbol-list-lines command.
+
+# Check that we have a valid target created via '%lldbmi %t'.
+# CHECK: ^done
+
+-symbol-list-lines invalid_file.c
+# Check a case of invalid file name.
+# CHECK: ^error,msg="File Handler. Invalid file name path"
+
+-symbol-list-lines symbol-list-lines.c
+# CHECK: ^done,lines=[{pc="0x{{[0-9A-Fa-f]+}}",line="3"},{pc="0x{{[0-9A-Fa-f]+}}",line="4"},{pc="0x{{[0-9A-Fa-f]+}}",line="5"}]
+
+-symbol-list-lines list-lines-helper.c
+# CHECK: ^done,lines=[{pc="0x{{[0-9A-Fa-f]+}}",line="1"},{pc="0x{{[0-9A-Fa-f]+}}",line="2"},{pc="0x{{[0-9A-Fa-f]+}}",line="3"}]
diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj
index d69ef3280129..d8a714415320 100644
--- a/lldb.xcodeproj/project.pbxproj
+++ b/lldb.xcodeproj/project.pbxproj
@@ -50,211 +50,362 @@
name = ios;
productName = ios;
};
+ AFA9B71120606A13008E86C6 /* ios-mini */ = {
+ isa = PBXAggregateTarget;
+ buildConfigurationList = AFA9B71F20606A13008E86C6 /* Build configuration list for PBXAggregateTarget "ios-mini" */;
+ buildPhases = (
+ AFA9B71820606A13008E86C6 /* CopyFiles */,
+ );
+ dependencies = (
+ AFA9B71220606A13008E86C6 /* PBXTargetDependency */,
+ );
+ name = "ios-mini";
+ productName = ios;
+ };
/* End PBXAggregateTarget section */
/* Begin PBXBuildFile section */
- 23042D121976CA1D00621B2C /* PlatformKalimba.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */; };
- 23059A0719532B96007B8189 /* LinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0519532B96007B8189 /* LinuxSignals.cpp */; };
- 23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */; };
- 23059A121958B3B2007B8189 /* SBUnixSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = 23059A111958B37B007B8189 /* SBUnixSignals.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 230EC45B1D63C3BA008DF59F /* ThreadPlanCallOnFunctionExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.cpp */; };
- 232CB615191E00CD00EF39FC /* NativeBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60B191E00CC00EF39FC /* NativeBreakpoint.cpp */; };
- 232CB617191E00CD00EF39FC /* NativeBreakpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60D191E00CC00EF39FC /* NativeBreakpointList.cpp */; };
- 232CB619191E00CD00EF39FC /* NativeProcessProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60F191E00CC00EF39FC /* NativeProcessProtocol.cpp */; };
- 232CB61B191E00CD00EF39FC /* NativeThreadProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB611191E00CC00EF39FC /* NativeThreadProtocol.cpp */; };
- 232CB61D191E00CD00EF39FC /* SoftwareBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB613191E00CC00EF39FC /* SoftwareBreakpoint.cpp */; };
- 233B007D1960C9F90090E598 /* ProcessInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007B1960C9E60090E598 /* ProcessInfo.cpp */; };
- 233B007F1960CB280090E598 /* ProcessLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */; };
- 236124A41986B4E2004EFC37 /* IOObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A21986B4E2004EFC37 /* IOObject.cpp */; };
- 236124A51986B4E2004EFC37 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A31986B4E2004EFC37 /* Socket.cpp */; };
- 2374D7531D4BB2FF005C9575 /* GDBRemoteClientBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2374D74E1D4BB299005C9575 /* GDBRemoteClientBase.cpp */; };
- 2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; };
- 237A8BAF1DEC9C7800CEBAFF /* RegisterInfoPOSIX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237A8BAB1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.cpp */; };
- 238F2B9E1D2C82D0001FF92A /* StructuredDataPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2B9D1D2C82D0001FF92A /* StructuredDataPlugin.cpp */; };
- 238F2BA11D2C835A001FF92A /* StructuredDataPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2B9F1D2C835A001FF92A /* StructuredDataPlugin.h */; };
- 238F2BA21D2C835A001FF92A /* SystemRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2BA01D2C835A001FF92A /* SystemRuntime.h */; };
- 238F2BA81D2C85FA001FF92A /* StructuredDataDarwinLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2BA61D2C85FA001FF92A /* StructuredDataDarwinLog.cpp */; };
- 238F2BA91D2C85FA001FF92A /* StructuredDataDarwinLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2BA71D2C85FA001FF92A /* StructuredDataDarwinLog.h */; };
- 239481861C59EBDD00DF7168 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 239481851C59EBDD00DF7168 /* libncurses.dylib */; };
- 23CB15331D66DA9300EDDDE1 /* GoParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */; };
- 23CB15341D66DA9300EDDDE1 /* CPlusPlusLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FA1D66CCF100EDDDE1 /* CPlusPlusLanguageTest.cpp */; };
- 23CB15351D66DA9300EDDDE1 /* UriParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9461BDD346100BA9A93 /* UriParserTest.cpp */; };
- 23CB15361D66DA9300EDDDE1 /* FileSpecTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */; };
- 23CB15371D66DA9300EDDDE1 /* PythonTestSuite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45E1FC1BF57C8D000563EB /* PythonTestSuite.cpp */; };
- 23CB15381D66DA9300EDDDE1 /* PythonExceptionStateTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FA093141BF65D3A0037DD08 /* PythonExceptionStateTests.cpp */; };
- 23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E81D66CC0E00EDDDE1 /* DataExtractorTest.cpp */; };
- 23CB153A1D66DA9300EDDDE1 /* GDBRemoteClientBaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37D1D66C587000E7BE6 /* GDBRemoteClientBaseTest.cpp */; };
- 23CB153B1D66DA9300EDDDE1 /* SocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93A1BDD332400BA9A93 /* SocketTest.cpp */; };
- 23CB153C1D66DA9300EDDDE1 /* TestArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93E1BDD33CE00BA9A93 /* TestArgs.cpp */; };
- 23CB153D1D66DA9300EDDDE1 /* GDBRemoteCommunicationClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37E1D66C587000E7BE6 /* GDBRemoteCommunicationClientTest.cpp */; };
- 23CB153E1D66DA9300EDDDE1 /* PythonDataObjectsTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F94D1BDD360F00BA9A93 /* PythonDataObjectsTests.cpp */; };
- 23CB153F1D66DA9300EDDDE1 /* SymbolsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */; };
- 23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB150C1D66CF5600EDDDE1 /* TestClangASTContext.cpp */; };
- 23CB15411D66DA9300EDDDE1 /* StringExtractorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */; };
- 23CB15421D66DA9300EDDDE1 /* TaskPoolTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */; };
- 23CB15431D66DA9300EDDDE1 /* BroadcasterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E61D66CC0E00EDDDE1 /* BroadcasterTest.cpp */; };
- 23CB15441D66DA9300EDDDE1 /* ScalarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E91D66CC0E00EDDDE1 /* ScalarTest.cpp */; };
- 23CB15451D66DA9300EDDDE1 /* SocketAddressTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9391BDD332400BA9A93 /* SocketAddressTest.cpp */; };
- 23CB15461D66DA9300EDDDE1 /* GDBRemoteTestUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37F1D66C587000E7BE6 /* GDBRemoteTestUtils.cpp */; };
- 23CB15471D66DA9300EDDDE1 /* EditlineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2326CF511BDD693B00A5CEAC /* EditlineTest.cpp */; };
- 23CB15491D66DA9300EDDDE1 /* libxml2.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CB14E31D66CA2200EDDDE1 /* libxml2.2.dylib */; };
- 23CB154A1D66DA9300EDDDE1 /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4E1BDD687800A5CEAC /* libpanel.dylib */; };
- 23CB154B1D66DA9300EDDDE1 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4C1BDD684B00A5CEAC /* libedit.dylib */; };
- 23CB154C1D66DA9300EDDDE1 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4A1BDD681800A5CEAC /* libz.dylib */; };
- 23CB154D1D66DA9300EDDDE1 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF471BDD67C100A5CEAC /* libncurses.dylib */; };
- 23CB154E1D66DA9300EDDDE1 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
- 23D0658F1D4A7BEE0008EDE6 /* RenderScriptExpressionOpts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065821D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.cpp */; };
- 23D065901D4A7BEE0008EDE6 /* RenderScriptRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065841D4A7BDA0008EDE6 /* RenderScriptRuntime.cpp */; };
- 23D065911D4A7BEE0008EDE6 /* RenderScriptx86ABIFixups.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065861D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.cpp */; };
- 23D4007D1C2101F2000C3885 /* DWARFDebugMacro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E77CD61C20F29F007192AD /* DWARFDebugMacro.cpp */; };
- 23D4007E1C210201000C3885 /* DebugMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */; };
- 23DCBEA21D63E7190084C36B /* SBStructuredData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCBEA01D63E6440084C36B /* SBStructuredData.cpp */; };
- 23DCBEA31D63E71F0084C36B /* SBStructuredData.h in Headers */ = {isa = PBXBuildFile; fileRef = 23DCBE9F1D63E3800084C36B /* SBStructuredData.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 23DCEA461D1C4D0F00A602B4 /* SBMemoryRegionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */; };
- 23DCEA471D1C4D0F00A602B4 /* SBMemoryRegionInfoList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCEA431D1C4C6900A602B4 /* SBMemoryRegionInfoList.cpp */; };
- 23DDF226196C3EE600BB8417 /* CommandOptionValidators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */; };
- 23E2E5251D90373D006F38BB /* ArchSpecTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5161D903689006F38BB /* ArchSpecTest.cpp */; };
- 23E2E5271D903782006F38BB /* MinidumpParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E51A1D9036F2006F38BB /* MinidumpParserTest.cpp */; };
- 23E2E5321D903832006F38BB /* BreakpointIDTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E52D1D90382B006F38BB /* BreakpointIDTest.cpp */; };
- 23E2E5441D904913006F38BB /* MinidumpParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5371D9048FB006F38BB /* MinidumpParser.cpp */; };
- 23E2E5451D904913006F38BB /* MinidumpTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5391D9048FB006F38BB /* MinidumpTypes.cpp */; };
- 23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */ = {isa = PBXBuildFile; fileRef = 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 23EFE38B193D1AEC00E54E54 /* SBTypeEnumMember.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */; };
- 23F4034D1926E0F60046DC9B /* NativeRegisterContextRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */; };
- 250D6AE31A9679440049CC70 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 250D6AE11A9679270049CC70 /* FileSystem.cpp */; };
- 25420ECD1A6490B8009ADBCB /* OptionValueChar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */; };
- 25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; };
- 254FBB951A81AA7F00BD6378 /* SBLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */; };
- 254FBB971A81B03100BD6378 /* SBLaunchInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 254FBBA31A9166F100BD6378 /* SBAttachInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 254FBBA51A91670E00BD6378 /* SBAttachInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */; };
- 255EFF741AFABA720069F277 /* LockFileBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 255EFF731AFABA720069F277 /* LockFileBase.cpp */; };
- 255EFF761AFABA950069F277 /* LockFilePosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 255EFF751AFABA950069F277 /* LockFilePosix.cpp */; };
- 256CBDB41ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDB21ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp */; };
- 256CBDBC1ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDB81ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp */; };
- 256CBDC01ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDBE1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp */; };
- 2579065C1BD0488100178368 /* TCPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065A1BD0488100178368 /* TCPSocket.cpp */; };
- 2579065D1BD0488100178368 /* UDPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065B1BD0488100178368 /* UDPSocket.cpp */; };
- 2579065F1BD0488D00178368 /* DomainSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065E1BD0488D00178368 /* DomainSocket.cpp */; };
+ 268900E813353E6F00698AC0 /* ABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 497E7B9D1188F6690065CCA1 /* ABI.cpp */; };
+ 26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */; };
+ 26DB3E191379E7AD0080DC73 /* ABIMacOSX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0B1379E7AD0080DC73 /* ABIMacOSX_arm64.cpp */; };
+ 26DB3E1C1379E7AD0080DC73 /* ABIMacOSX_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */; };
+ AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */; };
+ AF20F76A1AF18F9000751A6E /* ABISysV_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */; };
+ 26BF51F31B3C754400016294 /* ABISysV_hexagon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */; };
+ 26BF51F61B3C754400016294 /* ABISysV_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */; };
+ 9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */; };
+ 263641191B34AEE200145B2F /* ABISysV_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263641151B34AEE200145B2F /* ABISysV_mips64.cpp */; };
+ AF77E08F1A033C700096C0EA /* ABISysV_ppc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */; };
+ AF77E0931A033C7F0096C0EA /* ABISysV_ppc64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp */; };
+ 267F684A1CC02DED0086832B /* ABISysV_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68471CC02DED0086832B /* ABISysV_s390x.cpp */; };
+ 267F684B1CC02DED0086832B /* ABISysV_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68481CC02DED0086832B /* ABISysV_s390x.h */; };
+ 26DB3E1F1379E7AD0080DC73 /* ABISysV_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */; };
+ 2689006713353E0E00698AC0 /* ASTDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4906FD4012F2255300A2A77C /* ASTDumper.cpp */; };
+ 2689006813353E0E00698AC0 /* ASTResultSynthesizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A8A39F11D568A300AD3B68 /* ASTResultSynthesizer.cpp */; };
+ 2689006913353E0E00698AC0 /* ASTStructExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 491193501226386000578B7F /* ASTStructExtractor.cpp */; };
+ 8CF02AEA19DCC02100B14BE0 /* ASanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */; };
257906641BD5AFD000178368 /* Acceptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 257906621BD5AFD000178368 /* Acceptor.cpp */; };
257906651BD5AFD000178368 /* Acceptor.h in Headers */ = {isa = PBXBuildFile; fileRef = 257906631BD5AFD000178368 /* Acceptor.h */; };
25EF23781AC09B3700908DF0 /* AdbClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25EF23751AC09AD800908DF0 /* AdbClient.cpp */; };
- 260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
- 260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
- 2606EDDF184E68A10034641B /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
- 260A63171861008E00FECF8E /* IOHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A63161861008E00FECF8E /* IOHandler.h */; };
- 260A63191861009E00FECF8E /* IOHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260A63181861009E00FECF8E /* IOHandler.cpp */; };
- 260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */; };
- 260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */; };
- 260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */; };
- 260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */; };
- 260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */; };
- 260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */; };
- 260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */; };
- 260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */; };
- 260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */; };
- 260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */; };
- 260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */; };
- 260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */; };
- 260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */; };
- 260E07C6136FA69E00CF21D3 /* OptionGroupUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */; };
- 260E07C8136FAB9200CF21D3 /* OptionGroupFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */; };
- 26151DC31B41E4A200FF7F1C /* SharingPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; };
- 2617447A11685869005ADD65 /* SBType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2617447911685869005ADD65 /* SBType.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 262173A318395D4600C52091 /* SectionLoadHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262173A218395D4600C52091 /* SectionLoadHistory.cpp */; };
- 26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */; };
- 2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2628A4D313D4977900F5487A /* ThreadKDP.cpp */; };
- 262CFC7711A4510000946C6C /* debugserver in Resources */ = {isa = PBXBuildFile; fileRef = 26CE05A0115C31E50022F371 /* debugserver */; };
- 262ED0081631FA3A00879631 /* OptionGroupString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262ED0071631FA3A00879631 /* OptionGroupString.cpp */; };
- 262F12B51835468600AEB384 /* SBPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262F12B41835468600AEB384 /* SBPlatform.cpp */; };
- 262F12B71835469C00AEB384 /* SBPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 262F12B61835469C00AEB384 /* SBPlatform.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2635879417822FC2004C30BA /* SymbolVendorELF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2635879017822E56004C30BA /* SymbolVendorELF.cpp */; };
- 263641191B34AEE200145B2F /* ABISysV_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263641151B34AEE200145B2F /* ABISysV_mips64.cpp */; };
- 26368A3C126B697600E8659F /* darwin-debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26368A3B126B697600E8659F /* darwin-debug.cpp */; };
- 26368AF7126B960500E8659F /* darwin-debug in Resources */ = {isa = PBXBuildFile; fileRef = 26579F68126A25920007C5CB /* darwin-debug */; };
- 263C4938178B50C40070F12D /* SBModuleSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263C4937178B50C40070F12D /* SBModuleSpec.cpp */; };
- 263C493A178B50CF0070F12D /* SBModuleSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 263C4939178B50CF0070F12D /* SBModuleSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */; };
- 263FDE601A79A01500E68013 /* FormatEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263FDE5F1A79A01500E68013 /* FormatEntity.cpp */; };
- 2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2640E19E15DC78FD00F23B50 /* Property.cpp */; };
- 264297571D1DF247003F2BF4 /* SBMemoryRegionInfoList.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 264297581D1DF250003F2BF4 /* SBMemoryRegionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2689002A13353E0400698AC0 /* Address.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6910F1B85900F91463 /* Address.cpp */; };
+ 2689002B13353E0400698AC0 /* AddressRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6A10F1B85900F91463 /* AddressRange.cpp */; };
+ 2689002C13353E0400698AC0 /* AddressResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034011752C6B0086C050 /* AddressResolver.cpp */; };
+ 2689002D13353E0400698AC0 /* AddressResolverFileLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034211752C720086C050 /* AddressResolverFileLine.cpp */; };
+ 2689002E13353E0400698AC0 /* AddressResolverName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034411752C790086C050 /* AddressResolverName.cpp */; };
+ 4CD44CFD20B37C440003557C /* AppleDWARFIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44CFA20B37C440003557C /* AppleDWARFIndex.cpp */; };
+ AF0E22F018A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0E22EE18A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp */; };
+ AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */; };
+ AF25AB26188F685C0030DEC3 /* AppleGetQueuesHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF25AB24188F685C0030DEC3 /* AppleGetQueuesHandler.cpp */; };
+ AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */; };
+ 94CD7D0919A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0819A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp */; };
+ 49DA65031485C92A005FF180 /* AppleObjCDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCDeclVendor.cpp */; };
+ 4CCA645013B40B82003BDF98 /* AppleObjCRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */; };
+ 4CCA645213B40B82003BDF98 /* AppleObjCRuntimeV1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */; };
+ 4CCA645413B40B82003BDF98 /* AppleObjCRuntimeV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */; };
+ 4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; };
+ 94CD7D0C19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0B19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp */; };
+ 4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; };
+ AF6CA6661FBBAF28005A0DC3 /* ArchSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */; };
+ AF6CA6681FBBAF37005A0DC3 /* ArchSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */; };
+ 23E2E5251D90373D006F38BB /* ArchSpecTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5161D903689006F38BB /* ArchSpecTest.cpp */; };
+ AF2E02A31FA2CEAF00A86C34 /* ArchitectureArm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2E02A11FA2CEAF00A86C34 /* ArchitectureArm.cpp */; };
+ AF2E02A41FA2CEAF00A86C34 /* ArchitectureArm.h in Headers */ = {isa = PBXBuildFile; fileRef = AF2E02A21FA2CEAF00A86C34 /* ArchitectureArm.h */; };
+ 4C14CEFB2057258D00DEEF94 /* ArchitecturePPC64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C14CEF82057258D00DEEF94 /* ArchitecturePPC64.cpp */; };
+ 2689007D13353E2200698AC0 /* Args.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6C10F1B85900F91463 /* Args.cpp */; };
+ 23CB153C1D66DA9300EDDDE1 /* ArgsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93E1BDD33CE00BA9A93 /* ArgsTest.cpp */; };
+ 6D99A3631BBC2F3200979793 /* ArmUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */; };
+ 26FFC19914FC072100087D58 /* AuxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19314FC072100087D58 /* AuxVector.cpp */; };
+ AFC2DCE91E6E2F2C00283714 /* Baton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCE81E6E2F2C00283714 /* Baton.cpp */; };
+ 268900D013353E6F00698AC0 /* Block.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1310F1B8EC00F91463 /* Block.cpp */; };
+ 49DEF1251CD7C6DF006A7C7D /* BlockPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */; };
+ 2689FFEF13353DB600698AC0 /* Breakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0A10F1B83100F91463 /* Breakpoint.cpp */; };
+ 2689FFF113353DB600698AC0 /* BreakpointID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0B10F1B83100F91463 /* BreakpointID.cpp */; };
+ 2689FFF313353DB600698AC0 /* BreakpointIDList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0C10F1B83100F91463 /* BreakpointIDList.cpp */; };
+ 23E2E5321D903832006F38BB /* BreakpointIDTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E52D1D90382B006F38BB /* BreakpointIDTest.cpp */; };
+ 2689FFF513353DB600698AC0 /* BreakpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0D10F1B83100F91463 /* BreakpointList.cpp */; };
+ 2689FFF713353DB600698AC0 /* BreakpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0E10F1B83100F91463 /* BreakpointLocation.cpp */; };
+ 2689FFF913353DB600698AC0 /* BreakpointLocationCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0F10F1B83100F91463 /* BreakpointLocationCollection.cpp */; };
+ 2689FFFB13353DB600698AC0 /* BreakpointLocationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1010F1B83100F91463 /* BreakpointLocationList.cpp */; };
+ 4CAA19E61F5A40040099E692 /* BreakpointName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D48281F509CCD005314B4 /* BreakpointName.cpp */; };
+ 2689FFFD13353DB600698AC0 /* BreakpointOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1110F1B83100F91463 /* BreakpointOptions.cpp */; };
+ 2689FFFF13353DB600698AC0 /* BreakpointResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1210F1B83100F91463 /* BreakpointResolver.cpp */; };
+ 2689000113353DB600698AC0 /* BreakpointResolverAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */; };
+ 2689000313353DB600698AC0 /* BreakpointResolverFileLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */; };
+ 4C3ADCD61810D88B00357218 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; };
+ 2689000513353DB600698AC0 /* BreakpointResolverName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */; };
+ 2689000713353DB600698AC0 /* BreakpointSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1310F1B83100F91463 /* BreakpointSite.cpp */; };
+ 2689000913353DB600698AC0 /* BreakpointSiteList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1410F1B83100F91463 /* BreakpointSiteList.cpp */; };
+ 2689003113353E0400698AC0 /* Broadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */; };
+ 23CB15431D66DA9300EDDDE1 /* BroadcasterTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E61D66CC0E00EDDDE1 /* BroadcasterTest.cpp */; };
+ 949EEDAE1BA7671C008C63CF /* CF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDAC1BA76719008C63CF /* CF.cpp */; };
+ 2689007613353E1A00698AC0 /* CFCBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EED10F1B8AD00F91463 /* CFCBundle.cpp */; };
+ 2689007713353E1A00698AC0 /* CFCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EEF10F1B8AD00F91463 /* CFCData.cpp */; };
+ 2689007813353E1A00698AC0 /* CFCMutableArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF110F1B8AD00F91463 /* CFCMutableArray.cpp */; };
+ 2689007913353E1A00698AC0 /* CFCMutableDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF310F1B8AD00F91463 /* CFCMutableDictionary.cpp */; };
+ 2689007A13353E1A00698AC0 /* CFCMutableSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF510F1B8AD00F91463 /* CFCMutableSet.cpp */; };
+ 2689007B13353E1A00698AC0 /* CFCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF810F1B8AD00F91463 /* CFCString.cpp */; };
+ 268900E913353E6F00698AC0 /* CPPLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */; };
+ 94B6385D1B8FB178004FE1E4 /* CPlusPlusLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */; };
+ 23CB15341D66DA9300EDDDE1 /* CPlusPlusLanguageTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FA1D66CCF100EDDDE1 /* CPlusPlusLanguageTest.cpp */; };
+ 49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */; };
+ 945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */; };
+ 268900D113353E6F00698AC0 /* ClangASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */; };
+ 49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */; };
+ 2689005E13353E0E00698AC0 /* ClangASTSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D7072811B5AD11001AD875 /* ClangASTSource.cpp */; };
+ 2689006013353E0E00698AC0 /* ClangExpressionDeclMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */; };
+ 2689006113353E0E00698AC0 /* ClangExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49445C2512245E3600C11A81 /* ClangExpressionParser.cpp */; };
+ 4984BA131B978C55008658D4 /* ClangExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA0E1B978C3E008658D4 /* ClangExpressionVariable.cpp */; };
+ 268900D313353E6F00698AC0 /* ClangExternalASTSourceCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */; };
+ 4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */; };
+ 2689005F13353E0E00698AC0 /* ClangFunctionCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DA118FB96F00E575D0 /* ClangFunctionCaller.cpp */; };
+ 4CD44D5820C603CB0003557C /* ClangHost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44D5620C603A80003557C /* ClangHost.cpp */; };
+ 4959511F1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */; };
+ 2689006313353E0E00698AC0 /* ClangPersistentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D4FE871210B61C00CDB854 /* ClangPersistentVariables.cpp */; };
+ 2689006413353E0E00698AC0 /* ClangUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7ED510F1B86700F91463 /* ClangUserExpression.cpp */; };
+ 304B2E461CAAA57B007829FE /* ClangUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3032B1B61CAAA3D1004BE1AB /* ClangUtil.cpp */; };
+ 30B38A001CAAA6D7009524E3 /* ClangUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 3032B1B91CAAA400004BE1AB /* ClangUtil.h */; };
+ 2689006513353E0E00698AC0 /* ClangUtilityFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 497C86BD122823D800B54702 /* ClangUtilityFunction.cpp */; };
+ 949EEDA31BA76577008C63CF /* Cocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA11BA76571008C63CF /* Cocoa.cpp */; };
+ 9441816E1C8F5EC900E5A8D9 /* CommandAlias.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9441816D1C8F5EC900E5A8D9 /* CommandAlias.cpp */; };
+ 2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */; };
+ 94BA8B70176F97CE005A91B5 /* CommandHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp */; };
+ 2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */; };
+ 2689008113353E2200698AC0 /* CommandObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */; };
+ 2689001213353DDE00698AC0 /* CommandObjectApropos.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */; };
+ 2689001413353DDE00698AC0 /* CommandObjectBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */; };
+ 2689001513353DDE00698AC0 /* CommandObjectBreakpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A42976211861AA600FE05CD /* CommandObjectBreakpointCommand.cpp */; };
+ 6D86CEA01B440F8500A7FBFA /* CommandObjectBugreport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D86CE9E1B440F6B00A7FBFA /* CommandObjectBugreport.cpp */; };
+ 2689001613353DDE00698AC0 /* CommandObjectCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */; };
+ 2689001713353DDE00698AC0 /* CommandObjectDisassemble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */; };
+ 2689001813353DDE00698AC0 /* CommandObjectExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */; };
+ 2689001A13353DDE00698AC0 /* CommandObjectFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */; };
+ 26CEB5F218762056008F575A /* CommandObjectGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CEB5F018762056008F575A /* CommandObjectGUI.cpp */; };
+ 2689001B13353DDE00698AC0 /* CommandObjectHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */; };
+ AFC234091AF85CE100CDE8B6 /* CommandObjectLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */; };
+ 2689001D13353DDE00698AC0 /* CommandObjectLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264AD83711095BA600E0B039 /* CommandObjectLog.cpp */; };
+ 2689001E13353DDE00698AC0 /* CommandObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */; };
+ 2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */; };
+ 2689001F13353DDE00698AC0 /* CommandObjectPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26879CE71333F58B0012C1F8 /* CommandObjectPlatform.cpp */; };
+ 947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */; };
+ 2689002013353DDE00698AC0 /* CommandObjectProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3810F1B84700F91463 /* CommandObjectProcess.cpp */; };
+ 2689002113353DDE00698AC0 /* CommandObjectQuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3910F1B84700F91463 /* CommandObjectQuit.cpp */; };
+ 2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */; };
+ 2689002213353DDE00698AC0 /* CommandObjectRegister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3B10F1B84700F91463 /* CommandObjectRegister.cpp */; };
+ 2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */; };
+ 2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */; };
+ 2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */; };
+ AFB6B9ED2065BBE90047661E /* CommandObjectStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */; };
+ 2689002713353DDE00698AC0 /* CommandObjectTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */; };
+ 2689002813353DDE00698AC0 /* CommandObjectThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */; };
+ 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; };
+ 2689002913353DDE00698AC0 /* CommandObjectVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */; };
+ B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; };
+ B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */; };
+ 23DDF226196C3EE600BB8417 /* CommandOptionValidators.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */; };
+ 2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */; };
+ 2689003213353E0400698AC0 /* Communication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6E10F1B85900F91463 /* Communication.cpp */; };
2642FBAE13D003B400ED6808 /* CommunicationKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */; };
- 2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; };
- 2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */; };
- 26474CA818D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA218D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp */; };
- 26474CAA18D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA418D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp */; };
- 26474CAC18D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA618D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp */; };
- 26474CB218D0CB180073DEBA /* RegisterContextLinux_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CAE18D0CB180073DEBA /* RegisterContextLinux_i386.cpp */; };
- 26474CB418D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB018D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp */; };
- 26474CBC18D0CB2D0073DEBA /* RegisterContextMach_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB618D0CB2D0073DEBA /* RegisterContextMach_arm.cpp */; };
- 26474CBE18D0CB2D0073DEBA /* RegisterContextMach_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB818D0CB2D0073DEBA /* RegisterContextMach_i386.cpp */; };
- 26474CC018D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CBA18D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp */; };
- 26474CC918D0CB5B0073DEBA /* RegisterContextMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC218D0CB5B0073DEBA /* RegisterContextMemory.cpp */; };
- 26474CCB18D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC418D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp */; };
- 26474CCD18D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC618D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp */; };
- 26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */; };
- 264A12FC1372522000875C42 /* EmulateInstructionARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A12FA1372522000875C42 /* EmulateInstructionARM64.cpp */; };
- 264A58EE1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A58ED1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp */; };
- 264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */; };
- 264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */; };
+ 964463EC1A330C0500154ED8 /* CompactUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 964463EB1A330C0500154ED8 /* CompactUnwindInfo.cpp */; };
+ 268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */; };
265192C61BA8E905002F08F6 /* CompilerDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */; };
- 265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */; };
- 265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A413D3E3F700132FE2 /* RegisterContextKDP_i386.cpp */; };
- 265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */; };
- 2654A6801E54D59400DA1013 /* ModuleCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A67F1E54D59400DA1013 /* ModuleCache.cpp */; };
- 2654A6831E54D5E200DA1013 /* RegisterNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A6821E54D5E200DA1013 /* RegisterNumber.cpp */; };
- 2654A68D1E552D1500DA1013 /* PseudoTerminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A68C1E552D1500DA1013 /* PseudoTerminal.cpp */; };
- 2654A6901E552ED500DA1013 /* VASprintf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A68F1E552ED500DA1013 /* VASprintf.cpp */; };
- 2656BBC31AE0739C00441749 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
- 2656BBC41AE073A800441749 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
- 2656BBC51AE073AD00441749 /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
- 2656BBC61AE073B500441749 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
2657AFB71B86910100958979 /* CompilerDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */; };
- 2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; settings = {COMPILER_FLAGS = "-Dregister="; }; };
- 26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; };
+ 268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */; };
+ 58EC744120EAEB5200695209 /* CompletionRequest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58EC744020EAEB5200695209 /* CompletionRequest.cpp */; };
+ 2689003313353E0400698AC0 /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6F10F1B85900F91463 /* Connection.cpp */; };
+ AFDFDFD119E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFDFDFD019E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp */; };
+ 26764C971E48F482008D3573 /* ConstString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C961E48F482008D3573 /* ConstString.cpp */; };
+ 9A3D43D61F3151C400EB767C /* ConstStringTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */; };
+ 2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; };
+ 949EEDA01BA74B6D008C63CF /* CoreMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */; };
+ 945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */; };
+ 6D95DC001B9DC057000E318A /* DIERef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFD1B9DC057000E318A /* DIERef.cpp */; };
+ 269DDD4A1B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269DDD481B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp */; };
+ AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */; };
+ 6D0F61481C80AAD600A4ECEE /* DWARFASTParserJava.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */; };
+ 4CC7C6581D529B950076FF94 /* DWARFASTParserOCaml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */; };
+ 268900B713353E5F00698AC0 /* DWARFAbbreviationDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B310F57C5600BB2B04 /* DWARFAbbreviationDeclaration.cpp */; };
+ 266E829D1B8E542C008FCA06 /* DWARFAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */; };
+ 4CD44D4220B777850003557C /* DWARFBaseDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44D4020B777850003557C /* DWARFBaseDIE.cpp */; };
+ 268900D713353E6F00698AC0 /* DWARFCallFrameInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1710F1B8EC00F91463 /* DWARFCallFrameInfo.cpp */; };
+ 268900B813353E5F00698AC0 /* DWARFCompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B710F57C5600BB2B04 /* DWARFCompileUnit.cpp */; };
+ 266E82971B8CE3AC008FCA06 /* DWARFDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E82961B8CE3AC008FCA06 /* DWARFDIE.cpp */; };
+ 268900C513353E5F00698AC0 /* DWARFDIECollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */; };
+ 26AB92121819D74600E63F3E /* DWARFDataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26AB92101819D74600E63F3E /* DWARFDataExtractor.cpp */; };
+ 268900B913353E5F00698AC0 /* DWARFDebugAbbrev.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B910F57C5600BB2B04 /* DWARFDebugAbbrev.cpp */; };
+ 268900BB13353E5F00698AC0 /* DWARFDebugArangeSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BD10F57C5600BB2B04 /* DWARFDebugArangeSet.cpp */; };
+ 268900BA13353E5F00698AC0 /* DWARFDebugAranges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BB10F57C5600BB2B04 /* DWARFDebugAranges.cpp */; };
+ 268900BC13353E5F00698AC0 /* DWARFDebugInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BF10F57C5600BB2B04 /* DWARFDebugInfo.cpp */; };
+ 268900BD13353E5F00698AC0 /* DWARFDebugInfoEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C110F57C5600BB2B04 /* DWARFDebugInfoEntry.cpp */; };
+ 268900BE13353E5F00698AC0 /* DWARFDebugLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C310F57C5600BB2B04 /* DWARFDebugLine.cpp */; };
+ 268900BF13353E5F00698AC0 /* DWARFDebugMacinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C510F57C5600BB2B04 /* DWARFDebugMacinfo.cpp */; };
+ 268900C013353E5F00698AC0 /* DWARFDebugMacinfoEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C710F57C5600BB2B04 /* DWARFDebugMacinfoEntry.cpp */; };
+ 23D4007D1C2101F2000C3885 /* DWARFDebugMacro.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E77CD61C20F29F007192AD /* DWARFDebugMacro.cpp */; };
+ 268900C313353E5F00698AC0 /* DWARFDebugRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */; };
+ 26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */; };
+ 268900C413353E5F00698AC0 /* DWARFDefines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */; };
+ 2689006613353E0E00698AC0 /* DWARFExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7ED810F1B86700F91463 /* DWARFExpression.cpp */; };
+ 268900C613353E5F00698AC0 /* DWARFFormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */; };
+ 4CD44CFB20B37C440003557C /* DWARFIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44CF820B37C440003557C /* DWARFIndex.cpp */; };
+ AFE228832060699D0042D0C8 /* DWARFUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7F2AAA5920601BE000A422D8 /* DWARFUnit.cpp */; };
+ 26FFC19B14FC072100087D58 /* DYLDRendezvous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19514FC072100087D58 /* DYLDRendezvous.cpp */; };
+ 49CA96FC1E6AACC900C03FEE /* DataBufferHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E61E6AAC6600C03FEE /* DataBufferHeap.cpp */; };
+ 49CA96FD1E6AACC900C03FEE /* DataBufferLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E71E6AAC6600C03FEE /* DataBufferLLVM.cpp */; };
+ 49CA96FE1E6AACC900C03FEE /* DataEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E81E6AAC6600C03FEE /* DataEncoder.cpp */; };
+ 49CA96FF1E6AACC900C03FEE /* DataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp */; };
+ 23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E81D66CC0E00EDDDE1 /* DataExtractorTest.cpp */; };
+ 94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* DataVisualization.cpp */; };
+ 23D4007E1C210201000C3885 /* DebugMacros.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */; };
+ AF116BEF20CF234B0071093F /* DebugNamesDWARFIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF116BED20CF234B0071093F /* DebugNamesDWARFIndex.cpp */; };
+ 2689003913353E0400698AC0 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263664921140A4930075843B /* Debugger.cpp */; };
+ 268900D613353E6F00698AC0 /* Declaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */; };
+ 49E4F66B1C9CAD16008487EA /* DiagnosticManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E4F6681C9CAD12008487EA /* DiagnosticManager.cpp */; };
+ 2689003A13353E0400698AC0 /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7610F1B85900F91463 /* Disassembler.cpp */; };
+ B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };
+ 2579065F1BD0488D00178368 /* DomainSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065E1BD0488D00178368 /* DomainSocket.cpp */; };
+ 26F5C27710F3D9E4009D5894 /* Driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F5C27310F3D9E4009D5894 /* Driver.cpp */; };
+ 4C4EB7811E6A4DCC002035C0 /* DumpDataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */; };
+ AFA585D02107EB7400D7689A /* DumpRegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFA585CF2107EB7300D7689A /* DumpRegisterValue.cpp */; };
+ 9447DE431BD5963300E67212 /* DumpValueObjectOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9447DE421BD5963300E67212 /* DumpValueObjectOptions.cpp */; };
+ 268900EA13353E6F00698AC0 /* DynamicLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */; };
+ AF27AD551D3603EA00CF2833 /* DynamicLoaderDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF27AD531D3603EA00CF2833 /* DynamicLoaderDarwin.cpp */; };
+ AF27AD561D3603EA00CF2833 /* DynamicLoaderDarwin.h in Headers */ = {isa = PBXBuildFile; fileRef = AF27AD541D3603EA00CF2833 /* DynamicLoaderDarwin.h */; };
+ 26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */; };
2666ADC61B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC11B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp */; };
+ AF2907BF1D3F082400E10654 /* DynamicLoaderMacOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2907BD1D3F082400E10654 /* DynamicLoaderMacOS.cpp */; };
+ 2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */; };
+ 26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */; };
+ 2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */; };
+ 26F006561B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F006541B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp */; };
+ 26954EBE1401EE8B00294D09 /* DynamicRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */; };
+ 2689009813353E4200698AC0 /* ELFHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */; };
+ 26CFDCA3186163A4000E63E5 /* Editline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CFDCA2186163A4000E63E5 /* Editline.cpp */; };
+ 23CB15471D66DA9300EDDDE1 /* EditlineTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2326CF511BDD693B00A5CEAC /* EditlineTest.cpp */; };
+ 2689003B13353E0400698AC0 /* EmulateInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */; };
+ 9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */; };
+ 264A12FC1372522000875C42 /* EmulateInstructionARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A12FA1372522000875C42 /* EmulateInstructionARM64.cpp */; };
+ E778E9A21B062D1700247609 /* EmulateInstructionMIPS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E778E99F1B062D1700247609 /* EmulateInstructionMIPS.cpp */; };
+ 94A5B3971AB9FE8D00A5EE7F /* EmulateInstructionMIPS64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */; };
+ AFDBC36E204663AF00B9C8F2 /* EmulateInstructionPPC64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFDBC36C204663AF00B9C8F2 /* EmulateInstructionPPC64.cpp */; };
+ 9A22A163135E30370024DDC3 /* EmulationStateARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15F135E30370024DDC3 /* EmulationStateARM.cpp */; };
+ 6B74D89B200696BB0074051B /* Environment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 22DC561920064C9600A7E9E8 /* Environment.cpp */; };
+ 2689003D13353E0400698AC0 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7910F1B85900F91463 /* Event.cpp */; };
+ 268900EB13353E6F00698AC0 /* ExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3510F1B90C00F91463 /* ExecutionContext.cpp */; };
+ 4C88BC2A1BA3722B00AA0964 /* Expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C88BC291BA3722B00AA0964 /* Expression.cpp */; };
+ 49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */; };
+ 4984BA161B979973008658D4 /* ExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA151B979973008658D4 /* ExpressionVariable.cpp */; };
+ 4984BA181B979C08008658D4 /* ExpressionVariable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4984BA171B979C08008658D4 /* ExpressionVariable.h */; };
+ AFC2DCE71E6E2ED000283714 /* FastDemangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */; };
+ 2689006E13353E1A00698AC0 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C6EA213011581005E16B0 /* File.cpp */; };
+ 3FDFDDBD199C3A06009756A7 /* FileAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDBC199C3A06009756A7 /* FileAction.cpp */; };
+ 3FDFDDBF199D345E009756A7 /* FileCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDBE199D345E009756A7 /* FileCache.cpp */; };
+ 26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */; };
+ 2689006F13353E1A00698AC0 /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FA43171301048600E71120 /* FileSpec.cpp */; };
+ 2689003E13353E0400698AC0 /* FileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */; };
+ 23CB15361D66DA9300EDDDE1 /* FileSpecTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */; };
+ 250D6AE31A9679440049CC70 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 250D6AE11A9679270049CC70 /* FileSystem.cpp */; };
+ 3FDFDDC6199D37ED009756A7 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDC5199D37ED009756A7 /* FileSystem.cpp */; };
+ 9A2057381F3B8E7E00F6C293 /* FileSystemTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572E1F3B8E7600F6C293 /* FileSystemTest.cpp */; };
+ 94CB257416B1D3880059775D /* FormatCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB257316B1D3870059775D /* FormatCache.cpp */; };
+ 94CB255D16B069770059775D /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255916B069770059775D /* FormatClasses.cpp */; };
+ 263FDE601A79A01500E68013 /* FormatEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263FDE5F1A79A01500E68013 /* FormatEntity.cpp */; };
+ 94CB255E16B069770059775D /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255A16B069770059775D /* FormatManager.cpp */; };
+ 94D0858C1B9675B8000D24BD /* FormattersHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D0858B1B9675B8000D24BD /* FormattersHelpers.cpp */; };
+ AF23B4DB19009C66003E2A58 /* FreeBSDSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp */; };
+ 268900D913353E6F00698AC0 /* FuncUnwinders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABB81235DE1600F93A47 /* FuncUnwinders.cpp */; };
+ 268900D813353E6F00698AC0 /* Function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1810F1B8EC00F91463 /* Function.cpp */; };
+ 4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp */; };
+ 2374D7531D4BB2FF005C9575 /* GDBRemoteClientBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2374D74E1D4BB299005C9575 /* GDBRemoteClientBase.cpp */; };
+ 23CB153A1D66DA9300EDDDE1 /* GDBRemoteClientBaseTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37D1D66C587000E7BE6 /* GDBRemoteClientBaseTest.cpp */; };
+ 2689009D13353E4200698AC0 /* GDBRemoteCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5B1315B29C001D6D71 /* GDBRemoteCommunication.cpp */; };
+ 26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */; };
+ 23CB153D1D66DA9300EDDDE1 /* GDBRemoteCommunicationClientTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37E1D66C587000E7BE6 /* GDBRemoteCommunicationClientTest.cpp */; };
+ 26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; };
+ 6D55B2901A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28D1A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp */; };
+ 6D55B2911A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28E1A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp */; };
+ 6D55B2921A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28F1A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp */; };
+ 2689009E13353E4200698AC0 /* GDBRemoteRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5D1315B29C001D6D71 /* GDBRemoteRegisterContext.cpp */; };
+ E7E94ABC1B54961F00D0AE30 /* GDBRemoteSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */; };
+ 23CB15461D66DA9300EDDDE1 /* GDBRemoteTestUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2370A37F1D66C587000E7BE6 /* GDBRemoteTestUtils.cpp */; };
+ AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */; };
+ AE44FB4C1BB4BB540033EB62 /* GoFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB4A1BB4BB540033EB62 /* GoFormatterFunctions.cpp */; };
+ AE44FB471BB4BB090033EB62 /* GoLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB451BB4BB090033EB62 /* GoLanguage.cpp */; };
+ AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */; };
+ AE44FB311BB07EB80033EB62 /* GoLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2A1BB07DD80033EB62 /* GoLexer.cpp */; };
+ AE44FB321BB07EBC0033EB62 /* GoParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2B1BB07DD80033EB62 /* GoParser.cpp */; };
+ 23CB15331D66DA9300EDDDE1 /* GoParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */; };
+ AE44FB301BB07EB20033EB62 /* GoUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2C1BB07DD80033EB62 /* GoUserExpression.cpp */; };
+ 6D95DC011B9DC057000E318A /* HashedNameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */; };
2666ADC81B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2666ADC31B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp */; };
- 2668020E115FD12C008E1FE4 /* lldb-defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668020F115FD12C008E1FE4 /* lldb-enumerations.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680214115FD12C008E1FE4 /* lldb-types.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2910F1B3BC00F91463 /* lldb-types.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680219115FD13D008E1FE4 /* SBBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668021A115FD13D008E1FE4 /* SBBreakpointLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668021B115FD13D008E1FE4 /* SBBroadcaster.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F31125FC5800A56CB0 /* SBBroadcaster.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668021D115FD13D008E1FE4 /* SBCommandInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F71125FC5800A56CB0 /* SBCommandInterpreter.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668021E115FD13D008E1FE4 /* SBCommandReturnObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F91125FC5800A56CB0 /* SBCommandReturnObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668021F115FD13D008E1FE4 /* SBCommunication.h in Headers */ = {isa = PBXBuildFile; fileRef = 260223E7115F06D500A601A2 /* SBCommunication.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680220115FD13D008E1FE4 /* SBDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FB1125FC5800A56CB0 /* SBDebugger.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680221115FD13D008E1FE4 /* SBDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FC1125FC5800A56CB0 /* SBDefines.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680222115FD13D008E1FE4 /* SBError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2682F286115EF3BD00CCFF99 /* SBError.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680223115FD13D008E1FE4 /* SBEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FE1125FC5800A56CB0 /* SBEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680224115FD13D008E1FE4 /* SBFileSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 26022531115F27FA00A601A2 /* SBFileSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680225115FD13D008E1FE4 /* SBFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A633FE8112DCE3C001A7E43 /* SBFrame.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26680227115FD13D008E1FE4 /* SBListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831021125FC5800A56CB0 /* SBListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668022A115FD13D008E1FE4 /* SBProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831041125FC5800A56CB0 /* SBProcess.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668022B115FD13D008E1FE4 /* SBSourceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831061125FC5800A56CB0 /* SBSourceManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668022C115FD13D008E1FE4 /* SBTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831081125FC5800A56CB0 /* SBTarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668022E115FD13D008E1FE4 /* SBThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A98310A1125FC5800A56CB0 /* SBThread.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 2668022F115FD19D008E1FE4 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */; };
- 26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; };
- 26680324116005D9008E1FE4 /* SBThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831091125FC5800A56CB0 /* SBThread.cpp */; };
- 26680326116005DB008E1FE4 /* SBTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831071125FC5800A56CB0 /* SBTarget.cpp */; };
- 26680327116005DC008E1FE4 /* SBSourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */; };
- 26680328116005DE008E1FE4 /* SBProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831031125FC5800A56CB0 /* SBProcess.cpp */; };
- 2668032A116005E0008E1FE4 /* SBListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831011125FC5800A56CB0 /* SBListener.cpp */; };
- 2668032C116005E2008E1FE4 /* SBFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A633FE7112DCE3C001A7E43 /* SBFrame.cpp */; };
- 2668032D116005E3008E1FE4 /* SBFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26022532115F281400A601A2 /* SBFileSpec.cpp */; };
- 2668032E116005E5008E1FE4 /* SBEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */; };
- 2668032F116005E6008E1FE4 /* SBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2682F284115EF3A700CCFF99 /* SBError.cpp */; };
- 26680330116005E7008E1FE4 /* SBDebugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */; };
- 26680331116005E9008E1FE4 /* SBCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260223E8115F06E500A601A2 /* SBCommunication.cpp */; };
- 26680332116005EA008E1FE4 /* SBCommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F81125FC5800A56CB0 /* SBCommandReturnObject.cpp */; };
- 26680333116005EC008E1FE4 /* SBCommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F61125FC5800A56CB0 /* SBCommandInterpreter.cpp */; };
- 26680335116005EE008E1FE4 /* SBBroadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F21125FC5800A56CB0 /* SBBroadcaster.cpp */; };
- 26680336116005EF008E1FE4 /* SBBreakpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */; };
- 26680337116005F1008E1FE4 /* SBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */; };
+ AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1729D4182C907200E0AB97 /* HistoryThread.cpp */; };
+ AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp */; };
+ 2689007113353E1A00698AC0 /* Host.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1C1236C5D400C660B5 /* Host.cpp */; };
+ AFF81FB020D1CC400010F95E /* Host.mm in Sources */ = {isa = PBXBuildFile; fileRef = AFF81FAD20D1CC400010F95E /* Host.mm */; };
+ 3FDFE53519A29327009756A7 /* HostInfoBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE53419A29327009756A7 /* HostInfoBase.cpp */; };
+ AFF81FAE20D1CC400010F95E /* HostInfoMacOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = AFF81FAB20D1CC400010F95E /* HostInfoMacOSX.mm */; };
+ 3FDFE53119A292F0009756A7 /* HostInfoPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE53019A292F0009756A7 /* HostInfoPosix.cpp */; };
+ 3FDFED2719BA6D96009756A7 /* HostNativeThreadBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2419BA6D96009756A7 /* HostNativeThreadBase.cpp */; };
+ 3FDFED2D19C257A0009756A7 /* HostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */; };
+ 3FDFE56C19AF9C44009756A7 /* HostProcessPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56A19AF9C44009756A7 /* HostProcessPosix.cpp */; };
+ 9A2057391F3B8E7E00F6C293 /* HostTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572F1F3B8E7600F6C293 /* HostTest.cpp */; };
+ 3FDFED2819BA6D96009756A7 /* HostThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2519BA6D96009756A7 /* HostThread.cpp */; };
+ AFF81FAF20D1CC400010F95E /* HostThreadMacOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = AFF81FAC20D1CC400010F95E /* HostThreadMacOSX.mm */; };
+ 3FDFE56D19AF9C44009756A7 /* HostThreadPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp */; };
+ 260A63191861009E00FECF8E /* IOHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260A63181861009E00FECF8E /* IOHandler.cpp */; };
+ 260A63171861008E00FECF8E /* IOHandler.h in Headers */ = {isa = PBXBuildFile; fileRef = 260A63161861008E00FECF8E /* IOHandler.h */; };
+ 236124A41986B4E2004EFC37 /* IOObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A21986B4E2004EFC37 /* IOObject.cpp */; };
+ 2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */; };
+ 2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */; };
+ 2689006B13353E0E00698AC0 /* IRForTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */; };
+ 49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 496B01581406DE8900F830D5 /* IRInterpreter.cpp */; };
+ 49DCF6FE170E6B4A0092F75E /* IRMemoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */; };
+ B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
+ 8CF02AE919DCC01900B14BE0 /* InstrumentationRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02ADF19DCBF3B00B14BE0 /* InstrumentationRuntime.cpp */; };
+ 8CF02AEF19DD16B100B14BE0 /* InstrumentationRuntimeStopInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02AED19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.cpp */; };
+ 4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; };
+ 26BC179918C7F2B300D2196D /* JITLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC179718C7F2B300D2196D /* JITLoader.cpp */; };
+ AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; };
+ 26BC179A18C7F2B300D2196D /* JITLoaderList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC179818C7F2B300D2196D /* JITLoaderList.cpp */; };
+ 942829561A89614C00521B30 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942829551A89614C00521B30 /* JSON.cpp */; };
+ 8C3BD9A01EF5D1FF0016C343 /* JSONTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */; };
+ 6D0F61431C80AAAE00A4ECEE /* JavaASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */; };
+ 6D0F61591C80AB3500A4ECEE /* JavaFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61511C80AB3000A4ECEE /* JavaFormatterFunctions.cpp */; };
+ 6D0F615A1C80AB3900A4ECEE /* JavaLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61531C80AB3000A4ECEE /* JavaLanguage.cpp */; };
+ 6D0F614E1C80AB0700A4ECEE /* JavaLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F614A1C80AB0400A4ECEE /* JavaLanguageRuntime.cpp */; };
+ 6D0F614F1C80AB0C00A4ECEE /* JavaLanguageRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D0F614B1C80AB0400A4ECEE /* JavaLanguageRuntime.h */; };
2668035C11601108008E1FE4 /* LLDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; };
+ 2669424D1A6DC32B0063BE93 /* LLDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; };
+ 26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B42C4C1187ABA50079C8C8 /* LLDB.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 943BDEFE1AA7B2F800789CE8 /* LLDBAssert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */; };
+ 6D762BEE1B1605D2006C929D /* LLDBServerUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D762BEC1B1605CD006C929D /* LLDBServerUtilities.cpp */; };
+ 2660AAB914622483003A9694 /* LLDBWrapPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */; settings = {COMPILER_FLAGS = "-Dregister="; }; };
+ AEB0E4591BD6E9F800B24093 /* LLVMUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */; };
+ 94B638531B8F8E6C004FE1E4 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B638521B8F8E6C004FE1E4 /* Language.cpp */; };
+ 942612F71B95000000EF842E /* LanguageCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942612F61B95000000EF842E /* LanguageCategory.cpp */; };
+ 268900EC13353E6F00698AC0 /* LanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */; };
+ 945261C01B9A11FC00BF138D /* LibCxx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B51B9A11E800BF138D /* LibCxx.cpp */; };
+ 9428BC2C1C6E64E4002A24D7 /* LibCxxAtomic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9428BC291C6E64DC002A24D7 /* LibCxxAtomic.cpp */; };
+ AFC67B151FBBB03600860ECB /* LibCxxBitset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC67B141FBBB03500860ECB /* LibCxxBitset.cpp */; };
+ 945261C11B9A11FC00BF138D /* LibCxxInitializerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */; };
+ 945261C21B9A11FC00BF138D /* LibCxxList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B81B9A11E800BF138D /* LibCxxList.cpp */; };
+ 945261C31B9A11FC00BF138D /* LibCxxMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B91B9A11E800BF138D /* LibCxxMap.cpp */; };
+ AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */; };
+ AF9FF1F51FAA79A400474976 /* LibCxxTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */; };
+ 945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */; };
+ 945261C51B9A11FC00BF138D /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */; };
+ 945261C61B9A11FC00BF138D /* LibStdcpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */; };
+ 4CDB8D6E1DBA91B6006C5B13 /* LibStdcppTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp */; };
+ 4CDB8D6D1DBA91B6006C5B13 /* LibStdcppUniquePointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D671DBA91A6006C5B13 /* LibStdcppUniquePointer.cpp */; };
+ 268900DA13353E6F00698AC0 /* LineEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1910F1B8EC00F91463 /* LineEntry.cpp */; };
+ 268900DB13353E6F00698AC0 /* LineTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1A10F1B8EC00F91463 /* LineTable.cpp */; };
+ 23059A0719532B96007B8189 /* LinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0519532B96007B8189 /* LinuxSignals.cpp */; };
+ 2689004113353E0400698AC0 /* Listener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7E10F1B85900F91463 /* Listener.cpp */; };
+ 9A3D43EC1F3237F900EB767C /* ListenerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E31F3237D500EB767C /* ListenerTest.cpp */; };
+ 255EFF741AFABA720069F277 /* LockFileBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 255EFF731AFABA720069F277 /* LockFileBase.cpp */; };
+ 255EFF761AFABA950069F277 /* LockFilePosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 255EFF751AFABA950069F277 /* LockFilePosix.cpp */; };
+ 2689004213353E0400698AC0 /* Log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7F10F1B85900F91463 /* Log.cpp */; };
+ 268900CB13353E5F00698AC0 /* LogChannelDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */; };
+ 9A3D43D71F3151C400EB767C /* LogTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C71F3150D200EB767C /* LogTest.cpp */; };
+ 3F8160A61AB9F7DD001DA9DF /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8160A51AB9F7DD001DA9DF /* Logging.cpp */; };
266942001A6DC2AC0063BE93 /* MICmdArgContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941601A6DC2AB0063BE93 /* MICmdArgContext.cpp */; };
266942011A6DC2AC0063BE93 /* MICmdArgSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941621A6DC2AB0063BE93 /* MICmdArgSet.cpp */; };
266942021A6DC2AC0063BE93 /* MICmdArgValBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941641A6DC2AB0063BE93 /* MICmdArgValBase.cpp */; };
@@ -265,6 +416,7 @@
266942071A6DC2AC0063BE93 /* MICmdArgValNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2669416E1A6DC2AC0063BE93 /* MICmdArgValNumber.cpp */; };
266942081A6DC2AC0063BE93 /* MICmdArgValOptionLong.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941701A6DC2AC0063BE93 /* MICmdArgValOptionLong.cpp */; };
266942091A6DC2AC0063BE93 /* MICmdArgValOptionShort.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941721A6DC2AC0063BE93 /* MICmdArgValOptionShort.cpp */; };
+ 267DFB461B06752A00000FB7 /* MICmdArgValPrintValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267DFB441B06752A00000FB7 /* MICmdArgValPrintValues.cpp */; };
2669420A1A6DC2AC0063BE93 /* MICmdArgValString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941741A6DC2AC0063BE93 /* MICmdArgValString.cpp */; };
2669420B1A6DC2AC0063BE93 /* MICmdArgValThreadGrp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941761A6DC2AC0063BE93 /* MICmdArgValThreadGrp.cpp */; };
2669420C1A6DC2AC0063BE93 /* MICmdBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941781A6DC2AC0063BE93 /* MICmdBase.cpp */; };
@@ -276,11 +428,13 @@
266942121A6DC2AC0063BE93 /* MICmdCmdFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941841A6DC2AC0063BE93 /* MICmdCmdFile.cpp */; };
266942131A6DC2AC0063BE93 /* MICmdCmdGdbInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941861A6DC2AC0063BE93 /* MICmdCmdGdbInfo.cpp */; };
266942141A6DC2AC0063BE93 /* MICmdCmdGdbSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941881A6DC2AC0063BE93 /* MICmdCmdGdbSet.cpp */; };
+ AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */; };
266942151A6DC2AC0063BE93 /* MICmdCmdGdbThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2669418A1A6DC2AC0063BE93 /* MICmdCmdGdbThread.cpp */; };
266942161A6DC2AC0063BE93 /* MICmdCmdMiscellanous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2669418C1A6DC2AC0063BE93 /* MICmdCmdMiscellanous.cpp */; };
266942171A6DC2AC0063BE93 /* MICmdCmdStack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2669418E1A6DC2AC0063BE93 /* MICmdCmdStack.cpp */; };
266942181A6DC2AC0063BE93 /* MICmdCmdSupportInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941901A6DC2AC0063BE93 /* MICmdCmdSupportInfo.cpp */; };
266942191A6DC2AC0063BE93 /* MICmdCmdSupportList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941921A6DC2AC0063BE93 /* MICmdCmdSupportList.cpp */; };
+ 26D52C1F1A980FE300E5D2FB /* MICmdCmdSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */; };
2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp */; };
2669421B1A6DC2AC0063BE93 /* MICmdCmdThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941961A6DC2AC0063BE93 /* MICmdCmdThread.cpp */; };
2669421C1A6DC2AC0063BE93 /* MICmdCmdTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941981A6DC2AC0063BE93 /* MICmdCmdTrace.cpp */; };
@@ -294,10 +448,10 @@
266942241A6DC2AC0063BE93 /* MICmdMgrSetCmdDeleteCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941A81A6DC2AC0063BE93 /* MICmdMgrSetCmdDeleteCallback.cpp */; };
266942251A6DC2AC0063BE93 /* MICmnBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941AA1A6DC2AC0063BE93 /* MICmnBase.cpp */; };
266942261A6DC2AC0063BE93 /* MICmnLLDBBroadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941AD1A6DC2AC0063BE93 /* MICmnLLDBBroadcaster.cpp */; };
- 266942271A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941AF1A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp */; };
- 266942281A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B11A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp */; };
266942291A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B31A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfo.cpp */; };
2669422A1A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfoVarObj.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B51A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfoVarObj.cpp */; };
+ 266942271A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941AF1A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp */; };
+ 266942281A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B11A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp */; };
2669422B1A6DC2AC0063BE93 /* MICmnLLDBProxySBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B71A6DC2AC0063BE93 /* MICmnLLDBProxySBValue.cpp */; };
2669422C1A6DC2AC0063BE93 /* MICmnLLDBUtilSBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941B91A6DC2AC0063BE93 /* MICmnLLDBUtilSBValue.cpp */; };
2669422D1A6DC2AC0063BE93 /* MICmnLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941BB1A6DC2AC0063BE93 /* MICmnLog.cpp */; };
@@ -325,722 +479,595 @@
266942451A6DC2AC0063BE93 /* MIUtilString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941EE1A6DC2AC0063BE93 /* MIUtilString.cpp */; };
2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp */; };
2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp */; };
- 2669424D1A6DC32B0063BE93 /* LLDB.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26680207115FD0ED008E1FE4 /* LLDB.framework */; };
- 266DFE9713FD656E00D0C574 /* OperatingSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266DFE9613FD656E00D0C574 /* OperatingSystem.cpp */; };
- 266E82971B8CE3AC008FCA06 /* DWARFDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E82961B8CE3AC008FCA06 /* DWARFDIE.cpp */; };
- 266E829D1B8E542C008FCA06 /* DWARFAttribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */; };
- 2670F8121862B44A006B332C /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
- 26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */; };
- 26744EF31338317700EF765A /* GDBRemoteCommunicationServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */; };
- 26764C971E48F482008D3573 /* ConstString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C961E48F482008D3573 /* ConstString.cpp */; };
- 26764C9E1E48F51E008D3573 /* Stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9D1E48F51E008D3573 /* Stream.cpp */; };
- 26764CA01E48F528008D3573 /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9F1E48F528008D3573 /* RegularExpression.cpp */; };
- 26764CA21E48F547008D3573 /* StreamString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764CA11E48F547008D3573 /* StreamString.cpp */; };
- 26780C611867C33D00234593 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
- 267A47FB1B1411C40021A5BC /* NativeRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A47FA1B1411C40021A5BC /* NativeRegisterContext.cpp */; };
- 267A47FF1B1411D90021A5BC /* NativeWatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A47FE1B1411D90021A5BC /* NativeWatchpointList.cpp */; };
- 267A48011B1411E40021A5BC /* XML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A48001B1411E40021A5BC /* XML.cpp */; };
- 267C012B136880DF006E963E /* OptionGroupValueObjectDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */; };
- 267C01371368C49C006E963E /* OptionGroupOutputFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */; };
- 267DFB461B06752A00000FB7 /* MICmdArgValPrintValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267DFB441B06752A00000FB7 /* MICmdArgValPrintValues.cpp */; };
- 267F684A1CC02DED0086832B /* ABISysV_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68471CC02DED0086832B /* ABISysV_s390x.cpp */; };
- 267F684B1CC02DED0086832B /* ABISysV_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68481CC02DED0086832B /* ABISysV_s390x.h */; };
- 267F684F1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F684D1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp */; };
- 267F68501CC02E270086832B /* RegisterContextPOSIXCore_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F684E1CC02E270086832B /* RegisterContextPOSIXCore_s390x.h */; };
- 267F68531CC02E920086832B /* RegisterContextLinux_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68511CC02E920086832B /* RegisterContextLinux_s390x.cpp */; };
- 267F68541CC02E920086832B /* RegisterContextLinux_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68521CC02E920086832B /* RegisterContextLinux_s390x.h */; };
- 267F68571CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68551CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp */; };
- 267F68581CC02EAE0086832B /* RegisterContextPOSIX_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68561CC02EAE0086832B /* RegisterContextPOSIX_s390x.h */; };
- 267F685A1CC02EBE0086832B /* RegisterInfos_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68591CC02EBE0086832B /* RegisterInfos_s390x.h */; };
- 268648C416531BF800F04704 /* com.apple.debugserver.posix.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */; };
- 268648C516531BF800F04704 /* com.apple.debugserver.applist.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */; };
- 268648C616531BF800F04704 /* com.apple.debugserver.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */; };
- 2686536C1370ACB200D186A3 /* OptionGroupBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */; };
- 268653701370AE7200D186A3 /* OptionGroupUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536F1370AE7200D186A3 /* OptionGroupUInt64.cpp */; };
- 2689000113353DB600698AC0 /* BreakpointResolverAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */; };
- 2689000313353DB600698AC0 /* BreakpointResolverFileLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */; };
- 2689000513353DB600698AC0 /* BreakpointResolverName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */; };
- 2689000713353DB600698AC0 /* BreakpointSite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1310F1B83100F91463 /* BreakpointSite.cpp */; };
- 2689000913353DB600698AC0 /* BreakpointSiteList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1410F1B83100F91463 /* BreakpointSiteList.cpp */; };
- 2689000B13353DB600698AC0 /* Stoppoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1610F1B83100F91463 /* Stoppoint.cpp */; };
- 2689000D13353DB600698AC0 /* StoppointCallbackContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0910F1B83100F91463 /* StoppointCallbackContext.cpp */; };
- 2689000F13353DB600698AC0 /* StoppointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1710F1B83100F91463 /* StoppointLocation.cpp */; };
- 2689001113353DB600698AC0 /* Watchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1810F1B83100F91463 /* Watchpoint.cpp */; };
- 2689001213353DDE00698AC0 /* CommandObjectApropos.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */; };
- 2689001313353DDE00698AC0 /* CommandObjectArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 499F381F11A5B3F300F5CE02 /* CommandObjectArgs.cpp */; };
- 2689001413353DDE00698AC0 /* CommandObjectBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */; };
- 2689001513353DDE00698AC0 /* CommandObjectBreakpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A42976211861AA600FE05CD /* CommandObjectBreakpointCommand.cpp */; };
- 2689001613353DDE00698AC0 /* CommandObjectCommands.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */; };
- 2689001713353DDE00698AC0 /* CommandObjectDisassemble.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */; };
- 2689001813353DDE00698AC0 /* CommandObjectExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */; };
- 2689001A13353DDE00698AC0 /* CommandObjectFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */; };
- 2689001B13353DDE00698AC0 /* CommandObjectHelp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */; };
- 2689001D13353DDE00698AC0 /* CommandObjectLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264AD83711095BA600E0B039 /* CommandObjectLog.cpp */; };
- 2689001E13353DDE00698AC0 /* CommandObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */; };
- 2689001F13353DDE00698AC0 /* CommandObjectPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26879CE71333F58B0012C1F8 /* CommandObjectPlatform.cpp */; };
- 2689002013353DDE00698AC0 /* CommandObjectProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3810F1B84700F91463 /* CommandObjectProcess.cpp */; };
- 2689002113353DDE00698AC0 /* CommandObjectQuit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3910F1B84700F91463 /* CommandObjectQuit.cpp */; };
- 2689002213353DDE00698AC0 /* CommandObjectRegister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3B10F1B84700F91463 /* CommandObjectRegister.cpp */; };
- 2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */; };
- 2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */; };
- 2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */; };
- 2689002613353DDE00698AC0 /* CommandObjectSyntax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */; };
- 2689002713353DDE00698AC0 /* CommandObjectTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */; };
- 2689002813353DDE00698AC0 /* CommandObjectThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */; };
- 2689002913353DDE00698AC0 /* CommandObjectVersion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */; };
- 2689002A13353E0400698AC0 /* Address.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6910F1B85900F91463 /* Address.cpp */; };
- 2689002B13353E0400698AC0 /* AddressRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6A10F1B85900F91463 /* AddressRange.cpp */; };
- 2689002C13353E0400698AC0 /* AddressResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034011752C6B0086C050 /* AddressResolver.cpp */; };
- 2689002D13353E0400698AC0 /* AddressResolverFileLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034211752C720086C050 /* AddressResolverFileLine.cpp */; };
- 2689002E13353E0400698AC0 /* AddressResolverName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC7034411752C790086C050 /* AddressResolverName.cpp */; };
- 2689003113353E0400698AC0 /* Broadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */; };
- 2689003213353E0400698AC0 /* Communication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6E10F1B85900F91463 /* Communication.cpp */; };
- 2689003313353E0400698AC0 /* Connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6F10F1B85900F91463 /* Connection.cpp */; };
- 2689003913353E0400698AC0 /* Debugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263664921140A4930075843B /* Debugger.cpp */; };
- 2689003A13353E0400698AC0 /* Disassembler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7610F1B85900F91463 /* Disassembler.cpp */; };
- 2689003B13353E0400698AC0 /* EmulateInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */; };
- 2689003D13353E0400698AC0 /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7910F1B85900F91463 /* Event.cpp */; };
- 2689003E13353E0400698AC0 /* FileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */; };
- 2689004113353E0400698AC0 /* Listener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7E10F1B85900F91463 /* Listener.cpp */; };
- 2689004213353E0400698AC0 /* Log.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7F10F1B85900F91463 /* Log.cpp */; };
+ D67521381EA17C4200439694 /* MainLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D67521351EA17C3900439694 /* MainLoop.cpp */; };
+ 9A20573A1F3B8E7E00F6C293 /* MainLoopTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */; };
+ 8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */; };
2689004313353E0400698AC0 /* Mangled.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8010F1B85900F91463 /* Mangled.cpp */; };
+ 4F29D3CF21010FA3003B549A /* MangledTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4F29D3CD21010F84003B549A /* MangledTest.cpp */; };
+ 4CD44CFC20B37C440003557C /* ManualDWARFIndex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44CF920B37C440003557C /* ManualDWARFIndex.cpp */; };
+ 49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; };
+ 2690B3711381D5C300ECFBAE /* Memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2690B3701381D5C300ECFBAE /* Memory.cpp */; };
+ 8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */; };
+ 8C2D6A5E197A250F006989C9 /* MemoryHistoryASan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */; };
+ 9A2057081F3B819100F6C293 /* MemoryRegionInfoTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057061F3B818600F6C293 /* MemoryRegionInfoTest.cpp */; };
+ 23E2E5441D904913006F38BB /* MinidumpParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5371D9048FB006F38BB /* MinidumpParser.cpp */; };
+ 23E2E5271D903782006F38BB /* MinidumpParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E51A1D9036F2006F38BB /* MinidumpParserTest.cpp */; };
+ 23E2E5451D904913006F38BB /* MinidumpTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23E2E5391D9048FB006F38BB /* MinidumpTypes.cpp */; };
+ 26B75B441AD6E29A001F7A57 /* MipsLinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B75B421AD6E29A001F7A57 /* MipsLinuxSignals.cpp */; };
+ 9A18903B1F47D5E600394BCA /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890321F47D5D400394BCA /* MockTildeExpressionResolver.cpp */; };
2689004413353E0400698AC0 /* Module.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8110F1B85900F91463 /* Module.cpp */; };
+ 2654A6801E54D59400DA1013 /* ModuleCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A67F1E54D59400DA1013 /* ModuleCache.cpp */; };
+ AFAFD80A1E57E1B90017A14F /* ModuleCacheTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */; };
2689004513353E0400698AC0 /* ModuleChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8210F1B85900F91463 /* ModuleChild.cpp */; };
2689004613353E0400698AC0 /* ModuleList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8310F1B85900F91463 /* ModuleList.cpp */; };
- 2689004713353E0400698AC0 /* PluginManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8A10F1B85900F91463 /* PluginManager.cpp */; };
- 2689004913353E0400698AC0 /* Scalar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8D10F1B85900F91463 /* Scalar.cpp */; };
- 2689004A13353E0400698AC0 /* SearchFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1510F1B83100F91463 /* SearchFilter.cpp */; };
- 2689004B13353E0400698AC0 /* Section.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8E10F1B85900F91463 /* Section.cpp */; };
- 2689004C13353E0400698AC0 /* SourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8F10F1B85900F91463 /* SourceManager.cpp */; };
- 2689004D13353E0400698AC0 /* State.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9010F1B85900F91463 /* State.cpp */; };
- 2689004F13353E0400698AC0 /* StreamFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9210F1B85900F91463 /* StreamFile.cpp */; };
- 2689005113353E0400698AC0 /* StringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A35765F116E76B900E8ED2F /* StringList.cpp */; };
- 2689005213353E0400698AC0 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9610F1B85900F91463 /* Timer.cpp */; };
- 2689005413353E0400698AC0 /* UserSettingsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4633DC11F65D9A00955CE1 /* UserSettingsController.cpp */; };
- 2689005613353E0400698AC0 /* Value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9910F1B85900F91463 /* Value.cpp */; };
- 2689005713353E0400698AC0 /* ValueObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9A10F1B85900F91463 /* ValueObject.cpp */; };
- 2689005813353E0400698AC0 /* ValueObjectChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */; };
- 2689005913353E0400698AC0 /* ValueObjectConstResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */; };
- 2689005A13353E0400698AC0 /* ValueObjectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9C10F1B85900F91463 /* ValueObjectList.cpp */; };
- 2689005B13353E0400698AC0 /* ValueObjectRegister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */; };
- 2689005C13353E0400698AC0 /* ValueObjectVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9D10F1B85900F91463 /* ValueObjectVariable.cpp */; };
- 2689005E13353E0E00698AC0 /* ClangASTSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D7072811B5AD11001AD875 /* ClangASTSource.cpp */; };
- 2689005F13353E0E00698AC0 /* ClangFunctionCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DA118FB96F00E575D0 /* ClangFunctionCaller.cpp */; };
- 2689006013353E0E00698AC0 /* ClangExpressionDeclMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */; };
- 2689006113353E0E00698AC0 /* ClangExpressionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49445C2512245E3600C11A81 /* ClangExpressionParser.cpp */; };
- 2689006313353E0E00698AC0 /* ClangPersistentVariables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D4FE871210B61C00CDB854 /* ClangPersistentVariables.cpp */; };
- 2689006413353E0E00698AC0 /* ClangUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7ED510F1B86700F91463 /* ClangUserExpression.cpp */; };
- 2689006513353E0E00698AC0 /* ClangUtilityFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 497C86BD122823D800B54702 /* ClangUtilityFunction.cpp */; };
- 2689006613353E0E00698AC0 /* DWARFExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7ED810F1B86700F91463 /* DWARFExpression.cpp */; };
- 2689006713353E0E00698AC0 /* ASTDumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4906FD4012F2255300A2A77C /* ASTDumper.cpp */; };
- 2689006813353E0E00698AC0 /* ASTResultSynthesizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A8A39F11D568A300AD3B68 /* ASTResultSynthesizer.cpp */; };
- 2689006913353E0E00698AC0 /* ASTStructExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 491193501226386000578B7F /* ASTStructExtractor.cpp */; };
- 2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */; };
- 2689006B13353E0E00698AC0 /* IRForTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */; };
- 2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */; };
- 2689006E13353E1A00698AC0 /* File.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C6EA213011581005E16B0 /* File.cpp */; };
- 2689006F13353E1A00698AC0 /* FileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FA43171301048600E71120 /* FileSpec.cpp */; };
- 2689007113353E1A00698AC0 /* Host.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1C1236C5D400C660B5 /* Host.cpp */; };
- 2689007313353E1A00698AC0 /* Symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1F1236C5D400C660B5 /* Symbols.cpp */; };
- 2689007413353E1A00698AC0 /* Terminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268DA873130095ED00C9483A /* Terminal.cpp */; };
- 2689007613353E1A00698AC0 /* CFCBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EED10F1B8AD00F91463 /* CFCBundle.cpp */; };
- 2689007713353E1A00698AC0 /* CFCData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EEF10F1B8AD00F91463 /* CFCData.cpp */; };
- 2689007813353E1A00698AC0 /* CFCMutableArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF110F1B8AD00F91463 /* CFCMutableArray.cpp */; };
- 2689007913353E1A00698AC0 /* CFCMutableDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF310F1B8AD00F91463 /* CFCMutableDictionary.cpp */; };
- 2689007A13353E1A00698AC0 /* CFCMutableSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF510F1B8AD00F91463 /* CFCMutableSet.cpp */; };
- 2689007B13353E1A00698AC0 /* CFCString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EF810F1B8AD00F91463 /* CFCString.cpp */; };
- 2689007C13353E1A00698AC0 /* Symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2689B0B5113EE47E00A4AEDB /* Symbols.cpp */; };
- 2689007D13353E2200698AC0 /* Args.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E6C10F1B85900F91463 /* Args.cpp */; };
- 2689007F13353E2200698AC0 /* CommandCompletions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */; };
- 2689008013353E2200698AC0 /* CommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */; };
- 2689008113353E2200698AC0 /* CommandObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */; };
- 2689008313353E2200698AC0 /* CommandObjectMultiword.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */; };
- 2689008413353E2200698AC0 /* CommandObjectRegexCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */; };
- 2689008513353E2200698AC0 /* CommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */; };
- 2689008613353E2200698AC0 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8610F1B85900F91463 /* Options.cpp */; };
- 2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */; };
- 2689008D13353E4200698AC0 /* DynamicLoaderMacOSXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */; };
- 2689008E13353E4200698AC0 /* DynamicLoaderStatic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */; };
+ 949EEDAF1BA76729008C63CF /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA41BA765B5008C63CF /* NSArray.cpp */; };
+ 949EEDB11BA7672D008C63CF /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */; };
+ 9404957A1BEC497E00926025 /* NSError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940495781BEC497E00926025 /* NSError.cpp */; };
+ 9404957B1BEC497E00926025 /* NSException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940495791BEC497E00926025 /* NSException.cpp */; };
+ 949EEDB21BA76731008C63CF /* NSIndexPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */; };
+ 949EEDB31BA76736008C63CF /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA71BA765B5008C63CF /* NSSet.cpp */; };
+ 94B9E5121BBF20F4000A48DC /* NSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B9E5111BBF20F4000A48DC /* NSString.cpp */; };
+ 3F81691A1ABA2419001DA9DF /* NameMatches.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8169181ABA2419001DA9DF /* NameMatches.cpp */; };
+ 9A3D43D81F3151C400EB767C /* NameMatchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */; };
+ 268900C913353E5F00698AC0 /* NameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */; };
+ 232CB615191E00CD00EF39FC /* NativeBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60B191E00CC00EF39FC /* NativeBreakpoint.cpp */; };
+ 232CB617191E00CD00EF39FC /* NativeBreakpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60D191E00CC00EF39FC /* NativeBreakpointList.cpp */; };
+ 232CB619191E00CD00EF39FC /* NativeProcessProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB60F191E00CC00EF39FC /* NativeProcessProtocol.cpp */; };
+ 267A47FB1B1411C40021A5BC /* NativeRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A47FA1B1411C40021A5BC /* NativeRegisterContext.cpp */; };
+ 23F4034D1926E0F60046DC9B /* NativeRegisterContextRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */; };
+ 232CB61B191E00CD00EF39FC /* NativeThreadProtocol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB611191E00CC00EF39FC /* NativeThreadProtocol.cpp */; };
+ 267A47FF1B1411D90021A5BC /* NativeWatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A47FE1B1411D90021A5BC /* NativeWatchpointList.cpp */; };
+ AF33B4BE1C1FA441001B28D9 /* NetBSDSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */; };
+ AF33B4BF1C1FA441001B28D9 /* NetBSDSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */; };
+ 4CC7C6571D52997A0076FF94 /* OCamlASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C6551D52996C0076FF94 /* OCamlASTContext.cpp */; };
+ 4CC7C6501D5298F30076FF94 /* OCamlLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C64D1D5298E20076FF94 /* OCamlLanguage.cpp */; };
+ 942612F81B952C9B00EF842E /* ObjCLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385E1B8FB7A2004FE1E4 /* ObjCLanguage.cpp */; };
+ 268900ED13353E6F00698AC0 /* ObjCLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */; };
+ 94B638631B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B638621B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp */; };
2689009613353E4200698AC0 /* ObjectContainerBSDArchive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */; };
2689009713353E4200698AC0 /* ObjectContainerUniversalMachO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */; };
- 2689009813353E4200698AC0 /* ELFHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */; };
+ 268900DC13353E6F00698AC0 /* ObjectFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F4C10F1BC1A00F91463 /* ObjectFile.cpp */; };
2689009913353E4200698AC0 /* ObjectFileELF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C898510F57C5600BB2B04 /* ObjectFileELF.cpp */; };
+ 26EFC4CD18CFAF0D00865D87 /* ObjectFileJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26EFC4CA18CFAF0D00865D87 /* ObjectFileJIT.cpp */; };
2689009A13353E4200698AC0 /* ObjectFileMachO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C898810F57C5600BB2B04 /* ObjectFileMachO.cpp */; };
+ 26E152261419CAD4007967D0 /* ObjectFilePECOFF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */; };
+ 26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26651A17133BF9DF005B64B7 /* Opcode.cpp */; };
+ 266DFE9713FD656E00D0C574 /* OperatingSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266DFE9613FD656E00D0C574 /* OperatingSystem.cpp */; };
+ AE8F624919EF3E1E00326B21 /* OperatingSystemGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */; };
+ 2698699B15E6CBD0002415FF /* OperatingSystemPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */; };
+ 4C719395207D235400FDF430 /* OptionArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C719394207D235400FDF430 /* OptionArgParser.cpp */; };
+ 26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
+ 2686536C1370ACB200D186A3 /* OptionGroupBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */; };
+ 260E07C8136FAB9200CF21D3 /* OptionGroupFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */; };
+ 26BCFC521368AE38006DC050 /* OptionGroupFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC511368AE38006DC050 /* OptionGroupFormat.cpp */; };
+ 267C01371368C49C006E963E /* OptionGroupOutputFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */; };
+ 26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
+ 262ED0081631FA3A00879631 /* OptionGroupString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262ED0071631FA3A00879631 /* OptionGroupString.cpp */; };
+ 268653701370AE7200D186A3 /* OptionGroupUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2686536F1370AE7200D186A3 /* OptionGroupUInt64.cpp */; };
+ 260E07C6136FA69E00CF21D3 /* OptionGroupUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */; };
+ 267C012B136880DF006E963E /* OptionGroupValueObjectDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */; };
+ 26ED3D6D13C563810017D45E /* OptionGroupVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */; };
+ B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; };
+ A36FF33C17D8E94600244D40 /* OptionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A36FF33B17D8E94600244D40 /* OptionParser.cpp */; };
+ 26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* OptionValue.cpp */; };
+ 2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A39215E404B1003E682C /* OptionValueArch.cpp */; };
+ 260CC64815D0440D002BF2E0 /* OptionValueArgs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */; };
+ 260CC64915D0440D002BF2E0 /* OptionValueArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */; };
+ 260CC64A15D0440D002BF2E0 /* OptionValueBoolean.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */; };
+ 25420ECD1A6490B8009ADBCB /* OptionValueChar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */; };
+ 260CC64C15D0440D002BF2E0 /* OptionValueDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */; };
+ 260CC64D15D0440D002BF2E0 /* OptionValueEnumeration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */; };
+ 260CC64E15D0440D002BF2E0 /* OptionValueFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */; };
+ 260CC64F15D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */; };
+ 260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */; };
+ 264A58EE1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A58ED1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp */; };
+ 946216C21A97C080006E19CC /* OptionValueLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946216C11A97C080006E19CC /* OptionValueLanguage.cpp */; };
+ 26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */; };
+ 260CC64B15D0440D002BF2E0 /* OptionValueProperties.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */; };
+ 26491E3E15E1DB9F00CBFFC2 /* OptionValueRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */; };
+ 260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */; };
+ 260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */; };
+ 260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */; };
+ 260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */; };
+ 2689008613353E2200698AC0 /* Options.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8610F1B85900F91463 /* Options.cpp */; };
+ 4C562CC71CC07DF700C52EAC /* PDBASTParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C562CC21CC07DDD00C52EAC /* PDBASTParser.cpp */; };
+ 4CA0C6CC20F929C700CFE6BB /* PDBLocationToDWARFExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA0C6CA20F929C600CFE6BB /* PDBLocationToDWARFExpression.cpp */; };
+ 268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp */; };
+ 2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2668A2ED20AF417D00D94111 /* PathMappingListTest.cpp */; };
+ 25420ED21A649D88009ADBCB /* PipeBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 25420ED11A649D88009ADBCB /* PipeBase.cpp */; };
+ 2377C2F819E613C100737875 /* PipePosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2377C2F719E613C100737875 /* PipePosix.cpp */; };
+ 268900EF13353E6F00698AC0 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A43BD1320BCEB005B4096 /* Platform.cpp */; };
+ 6D55BAED1A8CD0A800A70529 /* PlatformAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55BAE91A8CD08C00A70529 /* PlatformAndroid.cpp */; };
+ 6D55BAEE1A8CD0B200A70529 /* PlatformAndroidRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55BAEB1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.cpp */; };
+ 9455630F1BEAD0600073F75F /* PlatformAppleSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */; };
+ AF8AD62E1BEC28A400150209 /* PlatformAppleTVSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD62A1BEC28A400150209 /* PlatformAppleTVSimulator.cpp */; };
+ AF8AD62F1BEC28A400150209 /* PlatformAppleTVSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD62B1BEC28A400150209 /* PlatformAppleTVSimulator.h */; };
+ AF8AD6301BEC28A400150209 /* PlatformAppleWatchSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD62C1BEC28A400150209 /* PlatformAppleWatchSimulator.cpp */; };
+ AF8AD6311BEC28A400150209 /* PlatformAppleWatchSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD62D1BEC28A400150209 /* PlatformAppleWatchSimulator.h */; };
+ 2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */; };
+ AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */; };
+ 9A20571C1F3B867400F6C293 /* PlatformDarwinTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20571A1F3B866F00F6C293 /* PlatformDarwinTest.cpp */; };
+ 2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */; };
+ 23042D121976CA1D00621B2C /* PlatformKalimba.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */; };
+ 2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */; };
2689009B13353E4200698AC0 /* PlatformMacOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */; };
+ 26EFB61B1BFE8D3E00544801 /* PlatformNetBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp */; };
+ 26EFB61C1BFE8D3E00544801 /* PlatformNetBSD.h in Headers */ = {isa = PBXBuildFile; fileRef = 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */; };
+ 4CE4EFAA1E8999B900A80C06 /* PlatformOpenBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFA61E8999B000A80C06 /* PlatformOpenBSD.cpp */; };
+ 945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945759651534941F005A9070 /* PlatformPOSIX.cpp */; };
+ AF8AD6371BEC28C400150209 /* PlatformRemoteAppleTV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD6331BEC28C400150209 /* PlatformRemoteAppleTV.cpp */; };
+ AF8AD6381BEC28C400150209 /* PlatformRemoteAppleTV.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD6341BEC28C400150209 /* PlatformRemoteAppleTV.h */; };
+ AF8AD6391BEC28C400150209 /* PlatformRemoteAppleWatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD6351BEC28C400150209 /* PlatformRemoteAppleWatch.cpp */; };
+ AF8AD63A1BEC28C400150209 /* PlatformRemoteAppleWatch.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD6361BEC28C400150209 /* PlatformRemoteAppleWatch.h */; };
+ AF3A4AD21EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */; };
+ AF3A4AD31EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */; };
+ 264A97BF133918BC0017F0BE /* PlatformRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */; };
2689009C13353E4200698AC0 /* PlatformRemoteiOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2675F6FE1332BE690067997B /* PlatformRemoteiOS.cpp */; };
- 2689009D13353E4200698AC0 /* GDBRemoteCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5B1315B29C001D6D71 /* GDBRemoteCommunication.cpp */; };
- 2689009E13353E4200698AC0 /* GDBRemoteRegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5D1315B29C001D6D71 /* GDBRemoteRegisterContext.cpp */; };
+ 490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */; };
+ 26B7564E14F89356008D9CB3 /* PlatformiOSSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */; };
+ AFF81FB320D1CC910010F95E /* PlatformiOSSimulatorCoreSimulatorSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = AFF81FB220D1CC910010F95E /* PlatformiOSSimulatorCoreSimulatorSupport.mm */; };
+ 2689004713353E0400698AC0 /* PluginManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8A10F1B85900F91463 /* PluginManager.cpp */; };
+ 268900F013353E6F00698AC0 /* Process.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3610F1B90C00F91463 /* Process.cpp */; };
+ 26BC17AB18C7F4CB00D2196D /* ProcessElfCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A218C7F4CB00D2196D /* ProcessElfCore.cpp */; };
2689009F13353E4200698AC0 /* ProcessGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE5F1315B29C001D6D71 /* ProcessGDBRemote.cpp */; };
268900A013353E4200698AC0 /* ProcessGDBRemoteLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE611315B29C001D6D71 /* ProcessGDBRemoteLog.cpp */; };
- 268900A113353E4200698AC0 /* ThreadGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE631315B29C001D6D71 /* ThreadGDBRemote.cpp */; };
- 268900AF13353E5000698AC0 /* UnwindLLDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */; };
+ 233B007D1960C9F90090E598 /* ProcessInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007B1960C9E60090E598 /* ProcessInfo.cpp */; };
+ 2642FBB013D003B400ED6808 /* ProcessKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */; };
+ 2642FBB213D003B400ED6808 /* ProcessKDPLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */; };
+ 233B007F1960CB280090E598 /* ProcessLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */; };
+ 26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */; };
+ 947CF7711DC7B1EE00EF980B /* ProcessMinidump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7701DC7B1EE00EF980B /* ProcessMinidump.cpp */; };
+ AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp */; };
+ 2640E19F15DC78FD00F23B50 /* Property.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2640E19E15DC78FD00F23B50 /* Property.cpp */; };
+ 2654A68D1E552D1500DA1013 /* PseudoTerminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A68C1E552D1500DA1013 /* PseudoTerminal.cpp */; };
+ 4CEC86A92047395F009B37B1 /* Python.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF3F1BDD613E00A5CEAC /* Python.framework */; };
+ 3FBA69EC1B6067430008F44A /* PythonDataObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69E31B60672A0008F44A /* PythonDataObjects.cpp */; };
+ 23CB153E1D66DA9300EDDDE1 /* PythonDataObjectsTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F94D1BDD360F00BA9A93 /* PythonDataObjectsTests.cpp */; };
+ AFCB2BBD1BF577F40018B553 /* PythonExceptionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFCB2BBB1BF577F40018B553 /* PythonExceptionState.cpp */; };
+ AFCB2BBE1BF577F40018B553 /* PythonExceptionState.h in Headers */ = {isa = PBXBuildFile; fileRef = AFCB2BBC1BF577F40018B553 /* PythonExceptionState.h */; };
+ 23CB15381D66DA9300EDDDE1 /* PythonExceptionStateTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FA093141BF65D3A0037DD08 /* PythonExceptionStateTests.cpp */; };
+ 23CB15371D66DA9300EDDDE1 /* PythonTestSuite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45E1FC1BF57C8D000563EB /* PythonTestSuite.cpp */; };
+ AF26703A1852D01E00B6CC36 /* Queue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2670381852D01E00B6CC36 /* Queue.cpp */; };
+ AF0C112818580CD800C4C45B /* QueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0C112718580CD800C4C45B /* QueueItem.cpp */; };
+ AF26703B1852D01E00B6CC36 /* QueueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2670391852D01E00B6CC36 /* QueueList.cpp */; };
+ 4939EA8D1BD56B6D00084382 /* REPL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4939EA8C1BD56B6D00084382 /* REPL.cpp */; };
+ 94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94BA8B6C176F8C9B005A91B5 /* Range.cpp */; };
+ 268900F113353E6F00698AC0 /* RegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */; };
+ 26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */; };
+ AF9107EE168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */; };
+ AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */; };
+ 26957D9A13D381C900670048 /* RegisterContextDarwin_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */; };
+ 26957D9C13D381C900670048 /* RegisterContextDarwin_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */; };
+ 944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */; };
+ 26474CA818D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA218D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp */; };
+ 26474CAA18D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA418D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp */; };
+ AF77E0A11A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09A1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp */; };
+ 26474CAC18D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CA618D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp */; };
+ AF061F87182C97ED00B6A19C /* RegisterContextHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF061F85182C97ED00B6A19C /* RegisterContextHistory.cpp */; };
+ 265205A813D3E3F700132FE2 /* RegisterContextKDP_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */; };
+ AF0F6E501739A76D009180FE /* RegisterContextKDP_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0F6E4E1739A76D009180FE /* RegisterContextKDP_arm64.cpp */; };
+ 265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A413D3E3F700132FE2 /* RegisterContextKDP_i386.cpp */; };
+ 265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */; };
268900B013353E5000698AC0 /* RegisterContextLLDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF68D2541255416E002FF25B /* RegisterContextLLDB.cpp */; };
+ 26474CB218D0CB180073DEBA /* RegisterContextLinux_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CAE18D0CB180073DEBA /* RegisterContextLinux_i386.cpp */; };
+ 9A0FDEA71E8EF5110086B2F5 /* RegisterContextLinux_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */; };
+ 256CBDBC1ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDB81ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp */; };
+ 267F68531CC02E920086832B /* RegisterContextLinux_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68511CC02E920086832B /* RegisterContextLinux_s390x.cpp */; };
+ 267F68541CC02E920086832B /* RegisterContextLinux_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68521CC02E920086832B /* RegisterContextLinux_s390x.h */; };
+ 26474CB418D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB018D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp */; };
268900B413353E5000698AC0 /* RegisterContextMacOSXFrameBackchain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E3EEF711A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.cpp */; };
+ 26474CBC18D0CB2D0073DEBA /* RegisterContextMach_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB618D0CB2D0073DEBA /* RegisterContextMach_arm.cpp */; };
+ 26474CBE18D0CB2D0073DEBA /* RegisterContextMach_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CB818D0CB2D0073DEBA /* RegisterContextMach_i386.cpp */; };
+ 26474CC018D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CBA18D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp */; };
+ 26474CC918D0CB5B0073DEBA /* RegisterContextMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC218D0CB5B0073DEBA /* RegisterContextMemory.cpp */; };
+ 947CF7761DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7741DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp */; };
+ AFD65C811D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFD65C7F1D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp */; };
+ AFD65C821D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = AFD65C801D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h */; };
+ 9AD9449F1E8DB26C004796ED /* RegisterContextNetBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9449B1E8DB267004796ED /* RegisterContextNetBSD_x86_64.cpp */; };
+ 4CE4EFB31E899A3400A80C06 /* RegisterContextOpenBSD_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFAB1E899A1200A80C06 /* RegisterContextOpenBSD_i386.cpp */; };
+ 4CE4EFB41E899A4000A80C06 /* RegisterContextOpenBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFAD1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.cpp */; };
+ 256CBDB41ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDB21ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp */; };
+ E7723D441AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7723D421AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp */; };
+ 26BC17AD18C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A418C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.cpp */; };
+ AF77E0A91A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E0A71A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp */; };
+ AF9113FD1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9113FB1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp */; };
+ AF9113FE1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF9113FC1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h */; };
+ 267F684F1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F684D1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp */; };
+ 267F68501CC02E270086832B /* RegisterContextPOSIXCore_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F684E1CC02E270086832B /* RegisterContextPOSIXCore_s390x.h */; };
+ 26BC17AF18C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A618C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.cpp */; };
+ 256CBDC01ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 256CBDBE1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp */; };
+ E7723D4C1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7723D4A1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp */; };
+ 26474CCB18D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC418D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp */; };
+ AF77E0A41A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09D1A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp */; };
+ AF235EB01FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF235EAE1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp */; };
+ AF235EB11FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF235EAF1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h */; };
+ 267F68571CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267F68551CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp */; };
+ 267F68581CC02EAE0086832B /* RegisterContextPOSIX_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68561CC02EAE0086832B /* RegisterContextPOSIX_s390x.h */; };
+ 26474CCD18D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26474CC618D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp */; };
+ 26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */; };
+ 9A77AD541E64E2760025CE04 /* RegisterInfoPOSIX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A77AD501E64E24E0025CE04 /* RegisterInfoPOSIX_arm.cpp */; };
+ 237A8BAF1DEC9C7800CEBAFF /* RegisterInfoPOSIX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237A8BAB1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.cpp */; };
+ AF235EB51FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF235EB31FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp */; };
+ AF235EB41FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF235EB21FBE7857009C5541 /* RegisterInfoPOSIX_ppc64le.h */; };
+ 267F685A1CC02EBE0086832B /* RegisterInfos_s390x.h in Headers */ = {isa = PBXBuildFile; fileRef = 267F68591CC02EBE0086832B /* RegisterInfos_s390x.h */; };
+ 2654A6831E54D5E200DA1013 /* RegisterNumber.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A6821E54D5E200DA1013 /* RegisterNumber.cpp */; };
+ 4CA9D1401FCE07CD00300E18 /* RegisterUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA9D13C1FCE07AF00300E18 /* RegisterUtilities.cpp */; };
+ 26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C6886E137880C400407EDF /* RegisterValue.cpp */; };
+ 26764CA01E48F528008D3573 /* RegularExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9F1E48F528008D3573 /* RegularExpression.cpp */; };
+ 23D0658F1D4A7BEE0008EDE6 /* RenderScriptExpressionOpts.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065821D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.cpp */; };
+ 23D065901D4A7BEE0008EDE6 /* RenderScriptRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065841D4A7BDA0008EDE6 /* RenderScriptRuntime.cpp */; };
+ 9485545A1DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 948554591DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp */; };
+ 23D065911D4A7BEE0008EDE6 /* RenderScriptx86ABIFixups.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D065861D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.cpp */; };
+ 26DE204511618ADA00A093E2 /* SBAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204411618ADA00A093E2 /* SBAddress.cpp */; };
+ 26DE204311618ACA00A093E2 /* SBAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204211618ACA00A093E2 /* SBAddress.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 254FBBA51A91670E00BD6378 /* SBAttachInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */; };
+ 254FBBA31A9166F100BD6378 /* SBAttachInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE20611161902700A093E2 /* SBBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20601161902600A093E2 /* SBBlock.cpp */; };
+ 26DE205711618FC500A093E2 /* SBBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205611618FC500A093E2 /* SBBlock.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680337116005F1008E1FE4 /* SBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */; };
+ 26680219115FD13D008E1FE4 /* SBBreakpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680336116005EF008E1FE4 /* SBBreakpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */; };
+ 2668021A115FD13D008E1FE4 /* SBBreakpointLocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4C54B27E1F61CE6300D469CA /* SBBreakpointName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C54B27C1F61CE5300D469CA /* SBBreakpointName.cpp */; };
+ 4C54B27B1F61CE2800D469CA /* SBBreakpointName.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54B2781F61CE1200D469CA /* SBBreakpointName.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4C05332B1F62121E00DED368 /* SBBreakpointOptionCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0533291F6211FB00DED368 /* SBBreakpointOptionCommon.cpp */; };
+ 26680335116005EE008E1FE4 /* SBBroadcaster.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F21125FC5800A56CB0 /* SBBroadcaster.cpp */; };
+ 2668021B115FD13D008E1FE4 /* SBBroadcaster.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F31125FC5800A56CB0 /* SBBroadcaster.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680333116005EC008E1FE4 /* SBCommandInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F61125FC5800A56CB0 /* SBCommandInterpreter.cpp */; };
+ 2668021D115FD13D008E1FE4 /* SBCommandInterpreter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F71125FC5800A56CB0 /* SBCommandInterpreter.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680332116005EA008E1FE4 /* SBCommandReturnObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830F81125FC5800A56CB0 /* SBCommandReturnObject.cpp */; };
+ 2668021E115FD13D008E1FE4 /* SBCommandReturnObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830F91125FC5800A56CB0 /* SBCommandReturnObject.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680331116005E9008E1FE4 /* SBCommunication.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260223E8115F06E500A601A2 /* SBCommunication.cpp */; };
+ 2668021F115FD13D008E1FE4 /* SBCommunication.h in Headers */ = {isa = PBXBuildFile; fileRef = 260223E7115F06D500A601A2 /* SBCommunication.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE205F1161901B00A093E2 /* SBCompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE205E1161901B00A093E2 /* SBCompileUnit.cpp */; };
+ 26DE205511618FB800A093E2 /* SBCompileUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205411618FB800A093E2 /* SBCompileUnit.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
+ 9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680330116005E7008E1FE4 /* SBDebugger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */; };
+ 26680220115FD13D008E1FE4 /* SBDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FB1125FC5800A56CB0 /* SBDebugger.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9452573A16262D0200325455 /* SBDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9452573916262D0200325455 /* SBDeclaration.cpp */; };
+ 490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680221115FD13D008E1FE4 /* SBDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FC1125FC5800A56CB0 /* SBDefines.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668032F116005E6008E1FE4 /* SBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2682F284115EF3A700CCFF99 /* SBError.cpp */; };
+ 26680222115FD13D008E1FE4 /* SBError.h in Headers */ = {isa = PBXBuildFile; fileRef = 2682F286115EF3BD00CCFF99 /* SBError.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668032E116005E5008E1FE4 /* SBEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */; };
+ 26680223115FD13D008E1FE4 /* SBEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9830FE1125FC5800A56CB0 /* SBEvent.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 940B02F619DC96E700AD0F52 /* SBExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940B02F519DC96E700AD0F52 /* SBExecutionContext.cpp */; };
+ AFDCDBCB19DD0F42005EA55E /* SBExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 940B02F419DC96CB00AD0F52 /* SBExecutionContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4CE4F675162C973F00F75CB3 /* SBExpressionOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */; };
+ 4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668032D116005E3008E1FE4 /* SBFileSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26022532115F281400A601A2 /* SBFileSpec.cpp */; };
+ 26680224115FD13D008E1FE4 /* SBFileSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 26022531115F27FA00A601A2 /* SBFileSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
+ 4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CF52AF41428291E0051E832 /* SBFileSpecList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668032C116005E2008E1FE4 /* SBFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A633FE7112DCE3C001A7E43 /* SBFrame.cpp */; };
+ 26680225115FD13D008E1FE4 /* SBFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A633FE8112DCE3C001A7E43 /* SBFrame.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE205D1161901400A093E2 /* SBFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE205C1161901400A093E2 /* SBFunction.cpp */; };
+ 26DE205311618FAC00A093E2 /* SBFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205211618FAC00A093E2 /* SBFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A3576AA116E9AC700E8ED2F /* SBHostOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */; };
+ 9A3576A8116E9AB700E8ED2F /* SBHostOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; };
+ 9AC7038E117674FB0086C050 /* SBInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038D117674EB0086C050 /* SBInstruction.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; };
+ 9AC70390117675270086C050 /* SBInstructionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038F117675270086C050 /* SBInstructionList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 964381701C8D6B8200023D59 /* SBLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */; };
+ 332CCB181AFF41620034D4C4 /* SBLanguageRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 3392EBB71AFF402200858B9F /* SBLanguageRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 254FBB951A81AA7F00BD6378 /* SBLaunchInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */; };
+ 254FBB971A81B03100BD6378 /* SBLaunchInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE20631161904200A093E2 /* SBLineEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20621161904200A093E2 /* SBLineEntry.cpp */; };
+ 26DE205911618FE700A093E2 /* SBLineEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205811618FE700A093E2 /* SBLineEntry.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668032A116005E0008E1FE4 /* SBListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831011125FC5800A56CB0 /* SBListener.cpp */; };
+ 26680227115FD13D008E1FE4 /* SBListener.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831021125FC5800A56CB0 /* SBListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23DCEA461D1C4D0F00A602B4 /* SBMemoryRegionInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */; };
+ 264297581D1DF250003F2BF4 /* SBMemoryRegionInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23DCEA471D1C4D0F00A602B4 /* SBMemoryRegionInfoList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCEA431D1C4C6900A602B4 /* SBMemoryRegionInfoList.cpp */; };
+ 264297571D1DF247003F2BF4 /* SBMemoryRegionInfoList.h in Headers */ = {isa = PBXBuildFile; fileRef = 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE204D11618E7A00A093E2 /* SBModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204C11618E7A00A093E2 /* SBModule.cpp */; };
+ 26DE204F11618E9800A093E2 /* SBModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204E11618E9800A093E2 /* SBModule.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 263C4938178B50C40070F12D /* SBModuleSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263C4937178B50C40070F12D /* SBModuleSpec.cpp */; };
+ 263C493A178B50CF0070F12D /* SBModuleSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = 263C4939178B50CF0070F12D /* SBModuleSpec.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 262F12B51835468600AEB384 /* SBPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262F12B41835468600AEB384 /* SBPlatform.cpp */; };
+ 262F12B71835469C00AEB384 /* SBPlatform.h in Headers */ = {isa = PBXBuildFile; fileRef = 262F12B61835469C00AEB384 /* SBPlatform.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680328116005DE008E1FE4 /* SBProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831031125FC5800A56CB0 /* SBProcess.cpp */; };
+ 2668022A115FD13D008E1FE4 /* SBProcess.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831041125FC5800A56CB0 /* SBProcess.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4971D4B51F30ECFB00823171 /* SBProcessInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */; };
+ 4C877B391F30EF990068FCFB /* SBProcessInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 4987FB201F30EC9900E5C17D /* SBProcessInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AF0EBBE8185940FB0059E52F /* SBQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE6185940FB0059E52F /* SBQueue.cpp */; };
+ AF0EBBEC185941360059E52F /* SBQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEA185941360059E52F /* SBQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AF0EBBE9185940FB0059E52F /* SBQueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */; };
+ AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEB185941360059E52F /* SBQueueItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8283F142D020F002DBC64 /* SBSection.cpp */; };
+ 26B8283D142D01E9002DBC64 /* SBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B8283C142D01E9002DBC64 /* SBSection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680327116005DC008E1FE4 /* SBSourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */; };
+ 2668022B115FD13D008E1FE4 /* SBSourceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831061125FC5800A56CB0 /* SBSourceManager.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };
+ 26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A357673116E7B6400E8ED2F /* SBStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A357672116E7B6400E8ED2F /* SBStringList.cpp */; };
+ 9A357671116E7B5200E8ED2F /* SBStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A357670116E7B5200E8ED2F /* SBStringList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23DCBEA21D63E7190084C36B /* SBStructuredData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23DCBEA01D63E6440084C36B /* SBStructuredData.cpp */; };
+ 23DCBEA31D63E71F0084C36B /* SBStructuredData.h in Headers */ = {isa = PBXBuildFile; fileRef = 23DCBE9F1D63E3800084C36B /* SBStructuredData.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE20651161904E00A093E2 /* SBSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20641161904E00A093E2 /* SBSymbol.cpp */; };
+ 26DE205B11618FF600A093E2 /* SBSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205A11618FF600A093E2 /* SBSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE204711618AED00A093E2 /* SBSymbolContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204611618AED00A093E2 /* SBSymbolContext.cpp */; };
+ 26DE204111618AB900A093E2 /* SBSymbolContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204011618AB900A093E2 /* SBSymbolContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */; };
+ 268F9D53123AA15200B91E9B /* SBSymbolContextList.h in Headers */ = {isa = PBXBuildFile; fileRef = 268F9D52123AA15200B91E9B /* SBSymbolContextList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680326116005DB008E1FE4 /* SBTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831071125FC5800A56CB0 /* SBTarget.cpp */; };
+ 2668022C115FD13D008E1FE4 /* SBTarget.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A9831081125FC5800A56CB0 /* SBTarget.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26680324116005D9008E1FE4 /* SBThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A9831091125FC5800A56CB0 /* SBThread.cpp */; };
+ 2668022E115FD13D008E1FE4 /* SBThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A98310A1125FC5800A56CB0 /* SBThread.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 8CCB018319BA51BF0009FD44 /* SBThreadCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB017F19BA4DD00009FD44 /* SBThreadCollection.cpp */; };
+ 8CCB018219BA4E270009FD44 /* SBThreadCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CCB018119BA4E210009FD44 /* SBThreadCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 4C56543719D22B32002E9C44 /* SBThreadPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C56543619D22B32002E9C44 /* SBThreadPlan.cpp */; };
+ 4C56543519D2297A002E9C44 /* SBThreadPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C56543419D2297A002E9C44 /* SBThreadPlan.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; };
+ 9A36D24D1EB3BE7F00AAD9EA /* SBTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59581EB2B10D002206A5 /* SBTrace.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A1E595D1EB2B141002206A5 /* SBTraceOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59531EB2B0B9002206A5 /* SBTraceOptions.cpp */; };
+ 9A36D24E1EB3BE7F00AAD9EA /* SBTraceOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59591EB2B10D002206A5 /* SBTraceOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 261744781168585B005ADD65 /* SBType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261744771168585B005ADD65 /* SBType.cpp */; };
+ 2617447A11685869005ADD65 /* SBType.h in Headers */ = {isa = PBXBuildFile; fileRef = 2617447911685869005ADD65 /* SBType.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */; };
+ 9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23EFE38B193D1AEC00E54E54 /* SBTypeEnumMember.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */; };
+ 23EFE389193D1ABC00E54E54 /* SBTypeEnumMember.h in Headers */ = {isa = PBXBuildFile; fileRef = 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; };
+ 941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568614E355F2003A195C /* SBTypeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568B14E35621003A195C /* SBTypeFormat.cpp */; };
+ 941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */; };
+ 9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9461569C14E358A6003A195C /* SBTypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568C14E35621003A195C /* SBTypeSummary.cpp */; };
+ 941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */; };
+ 941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 23059A101958B319007B8189 /* SBUnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */; };
+ 23059A121958B3B2007B8189 /* SBUnixSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = 23059A111958B37B007B8189 /* SBUnixSignals.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; };
+ 9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 9A35758E116CFE0F00E8ED2F /* SBValueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */; };
+ 9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A357582116CFDEE00E8ED2F /* SBValueList.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 94235B9E1A8D667400EB2EED /* SBVariablesOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */; };
+ 94235B9F1A8D66D600EB2EED /* SBVariablesOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
+ B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2689004913353E0400698AC0 /* Scalar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8D10F1B85900F91463 /* Scalar.cpp */; };
+ 23CB15441D66DA9300EDDDE1 /* ScalarTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB14E91D66CC0E00EDDDE1 /* ScalarTest.cpp */; };
+ 2689008713353E2200698AC0 /* ScriptInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */; };
+ 3FBA69E11B6067120008F44A /* ScriptInterpreterNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69DD1B6067020008F44A /* ScriptInterpreterNone.cpp */; };
+ 3FBA69ED1B60674B0008F44A /* ScriptInterpreterPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69E51B60672A0008F44A /* ScriptInterpreterPython.cpp */; };
+ 2689004A13353E0400698AC0 /* SearchFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1510F1B83100F91463 /* SearchFilter.cpp */; };
+ 2689004B13353E0400698AC0 /* Section.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8E10F1B85900F91463 /* Section.cpp */; };
+ 262173A318395D4600C52091 /* SectionLoadHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 262173A218395D4600C52091 /* SectionLoadHistory.cpp */; };
+ 268900F213353E6F00698AC0 /* SectionLoadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D7911240116900F2B8FE /* SectionLoadList.cpp */; };
+ 4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
+ 26A375811D59462700D6CBDB /* SelectHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3757F1D59462700D6CBDB /* SelectHelper.cpp */; };
+ 2689011013353E8200698AC0 /* SharingPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */; };
+ 26151DC31B41E4A200FF7F1C /* SharingPtr.h in Headers */ = {isa = PBXBuildFile; fileRef = 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 236124A51986B4E2004EFC37 /* Socket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 236124A31986B4E2004EFC37 /* Socket.cpp */; };
+ 26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */; };
+ 23CB15451D66DA9300EDDDE1 /* SocketAddressTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9391BDD332400BA9A93 /* SocketAddressTest.cpp */; };
+ 23CB153B1D66DA9300EDDDE1 /* SocketTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93A1BDD332400BA9A93 /* SocketTest.cpp */; };
+ 232CB61D191E00CD00EF39FC /* SoftwareBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 232CB613191E00CC00EF39FC /* SoftwareBreakpoint.cpp */; };
+ 2689004C13353E0400698AC0 /* SourceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E8F10F1B85900F91463 /* SourceManager.cpp */; };
+ 268900F313353E6F00698AC0 /* StackFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3810F1B90C00F91463 /* StackFrame.cpp */; };
+ 268900F413353E6F00698AC0 /* StackFrameList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3910F1B90C00F91463 /* StackFrameList.cpp */; };
+ 268900F513353E6F00698AC0 /* StackID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3A10F1B90C00F91463 /* StackID.cpp */; };
+ 2689004D13353E0400698AC0 /* State.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9010F1B85900F91463 /* State.cpp */; };
+ 9A3D43ED1F3237F900EB767C /* StateTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E21F3237D500EB767C /* StateTest.cpp */; };
+ 492DB7EB1EC662E200B9E9AF /* Status.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 492DB7E81EC662D100B9E9AF /* Status.cpp */; };
+ 9A3D43D91F3151C400EB767C /* StatusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C61F3150D200EB767C /* StatusTest.cpp */; };
+ 268900F613353E6F00698AC0 /* StopInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2615DB861208A9E40021781D /* StopInfo.cpp */; };
268900B513353E5000698AC0 /* StopInfoMachException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2615DBC81208B5FC0021781D /* StopInfoMachException.cpp */; };
- 268900B613353E5000698AC0 /* UnwindMacOSXFrameBackchain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E3EEE311A9901300FBADB6 /* UnwindMacOSXFrameBackchain.cpp */; };
- 268900B713353E5F00698AC0 /* DWARFAbbreviationDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B310F57C5600BB2B04 /* DWARFAbbreviationDeclaration.cpp */; };
- 268900B813353E5F00698AC0 /* DWARFCompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B710F57C5600BB2B04 /* DWARFCompileUnit.cpp */; };
- 268900B913353E5F00698AC0 /* DWARFDebugAbbrev.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89B910F57C5600BB2B04 /* DWARFDebugAbbrev.cpp */; };
- 268900BA13353E5F00698AC0 /* DWARFDebugAranges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BB10F57C5600BB2B04 /* DWARFDebugAranges.cpp */; };
- 268900BB13353E5F00698AC0 /* DWARFDebugArangeSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BD10F57C5600BB2B04 /* DWARFDebugArangeSet.cpp */; };
- 268900BC13353E5F00698AC0 /* DWARFDebugInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89BF10F57C5600BB2B04 /* DWARFDebugInfo.cpp */; };
- 268900BD13353E5F00698AC0 /* DWARFDebugInfoEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C110F57C5600BB2B04 /* DWARFDebugInfoEntry.cpp */; };
- 268900BE13353E5F00698AC0 /* DWARFDebugLine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C310F57C5600BB2B04 /* DWARFDebugLine.cpp */; };
- 268900BF13353E5F00698AC0 /* DWARFDebugMacinfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C510F57C5600BB2B04 /* DWARFDebugMacinfo.cpp */; };
- 268900C013353E5F00698AC0 /* DWARFDebugMacinfoEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C710F57C5600BB2B04 /* DWARFDebugMacinfoEntry.cpp */; };
- 268900C113353E5F00698AC0 /* DWARFDebugPubnames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89C910F57C5600BB2B04 /* DWARFDebugPubnames.cpp */; };
- 268900C213353E5F00698AC0 /* DWARFDebugPubnamesSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CB10F57C5600BB2B04 /* DWARFDebugPubnamesSet.cpp */; };
- 268900C313353E5F00698AC0 /* DWARFDebugRanges.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */; };
- 268900C413353E5F00698AC0 /* DWARFDefines.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */; };
- 268900C513353E5F00698AC0 /* DWARFDIECollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */; };
- 268900C613353E5F00698AC0 /* DWARFFormValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */; };
- 268900C913353E5F00698AC0 /* NameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */; };
- 268900CA13353E5F00698AC0 /* SymbolFileDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */; };
- 268900CB13353E5F00698AC0 /* LogChannelDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */; };
- 268900CC13353E5F00698AC0 /* SymbolFileDWARFDebugMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89DB10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.cpp */; };
- 268900CD13353E5F00698AC0 /* UniqueDWARFASTType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8B42312EEC52A00A831B2 /* UniqueDWARFASTType.cpp */; };
- 268900CE13353E5F00698AC0 /* SymbolFileSymtab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89DE10F57C5600BB2B04 /* SymbolFileSymtab.cpp */; };
- 268900CF13353E5F00698AC0 /* SymbolVendorMacOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */; };
- 268900D013353E6F00698AC0 /* Block.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1310F1B8EC00F91463 /* Block.cpp */; };
- 268900D113353E6F00698AC0 /* ClangASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */; };
- 268900D213353E6F00698AC0 /* CompilerType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */; };
- 268900D313353E6F00698AC0 /* ClangExternalASTSourceCallbacks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */; };
- 268900D513353E6F00698AC0 /* CompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */; };
- 268900D613353E6F00698AC0 /* Declaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */; };
- 268900D713353E6F00698AC0 /* DWARFCallFrameInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1710F1B8EC00F91463 /* DWARFCallFrameInfo.cpp */; };
- 268900D813353E6F00698AC0 /* Function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1810F1B8EC00F91463 /* Function.cpp */; };
- 268900D913353E6F00698AC0 /* FuncUnwinders.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABB81235DE1600F93A47 /* FuncUnwinders.cpp */; };
- 268900DA13353E6F00698AC0 /* LineEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1910F1B8EC00F91463 /* LineEntry.cpp */; };
- 268900DB13353E6F00698AC0 /* LineTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1A10F1B8EC00F91463 /* LineTable.cpp */; };
- 268900DC13353E6F00698AC0 /* ObjectFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F4C10F1BC1A00F91463 /* ObjectFile.cpp */; };
+ 2689000B13353DB600698AC0 /* Stoppoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1610F1B83100F91463 /* Stoppoint.cpp */; };
+ 2689000D13353DB600698AC0 /* StoppointCallbackContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0910F1B83100F91463 /* StoppointCallbackContext.cpp */; };
+ 2689000F13353DB600698AC0 /* StoppointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1710F1B83100F91463 /* StoppointLocation.cpp */; };
+ 26764C9E1E48F51E008D3573 /* Stream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764C9D1E48F51E008D3573 /* Stream.cpp */; };
+ 9A4F35101368A51A00823F52 /* StreamAsynchronousIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4F350F1368A51A00823F52 /* StreamAsynchronousIO.cpp */; };
+ AFC2DCF61E6E316A00283714 /* StreamCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCF51E6E316A00283714 /* StreamCallback.cpp */; };
+ 9A3D43EE1F3237F900EB767C /* StreamCallbackTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */; };
+ 2689004F13353E0400698AC0 /* StreamFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9210F1B85900F91463 /* StreamFile.cpp */; };
+ AFC2DCF91E6E318000283714 /* StreamGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCF81E6E318000283714 /* StreamGDBRemote.cpp */; };
+ 26764CA21E48F547008D3573 /* StreamString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26764CA11E48F547008D3573 /* StreamString.cpp */; };
+ 58EAC73F2106A07B0029571E /* StreamTeeTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 58EAC73D2106A0740029571E /* StreamTeeTest.cpp */; };
+ 33E5E8471A674FB60024ED68 /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33E5E8411A672A240024ED68 /* StringConvert.cpp */; };
+ 2689011113353E8200698AC0 /* StringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2660D9F611922A1300958FBD /* StringExtractor.cpp */; };
+ 2689011213353E8200698AC0 /* StringExtractorGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */; };
+ 23CB15411D66DA9300EDDDE1 /* StringExtractorTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */; };
+ 94380B8219940B0A00BFE4A8 /* StringLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */; };
+ 2689005113353E0400698AC0 /* StringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A35765F116E76B900E8ED2F /* StringList.cpp */; };
+ 94F48F251A01C687005C0EC6 /* StringPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94F48F241A01C687005C0EC6 /* StringPrinter.cpp */; };
+ AFEC3362194A8ABA00FF05C6 /* StructuredData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp */; };
+ 238F2BA81D2C85FA001FF92A /* StructuredDataDarwinLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2BA61D2C85FA001FF92A /* StructuredDataDarwinLog.cpp */; };
+ 238F2BA91D2C85FA001FF92A /* StructuredDataDarwinLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2BA71D2C85FA001FF92A /* StructuredDataDarwinLog.h */; };
+ 238F2B9E1D2C82D0001FF92A /* StructuredDataPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 238F2B9D1D2C82D0001FF92A /* StructuredDataPlugin.cpp */; };
+ 238F2BA11D2C835A001FF92A /* StructuredDataPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2B9F1D2C835A001FF92A /* StructuredDataPlugin.h */; };
+ 9A3D43DA1F3151C400EB767C /* StructuredDataTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CA1F3150D200EB767C /* StructuredDataTest.cpp */; };
268900DD13353E6F00698AC0 /* Symbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1B10F1B8EC00F91463 /* Symbol.cpp */; };
268900DE13353E6F00698AC0 /* SymbolContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1C10F1B8EC00F91463 /* SymbolContext.cpp */; };
268900DF13353E6F00698AC0 /* SymbolFile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1D10F1B8EC00F91463 /* SymbolFile.cpp */; };
+ 268900CA13353E5F00698AC0 /* SymbolFileDWARF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */; };
+ 268900CC13353E5F00698AC0 /* SymbolFileDWARFDebugMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89DB10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.cpp */; };
+ 6D95DC021B9DC057000E318A /* SymbolFileDWARFDwo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */; };
+ 4C7D48251F5099B2005314B4 /* SymbolFileDWARFDwoDwp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481F1F509964005314B4 /* SymbolFileDWARFDwoDwp.cpp */; };
+ 4C7D48241F5099A1005314B4 /* SymbolFileDWARFDwp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481C1F509963005314B4 /* SymbolFileDWARFDwp.cpp */; };
+ 9A2057121F3B824B00F6C293 /* SymbolFileDWARFTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20570A1F3B81F300F6C293 /* SymbolFileDWARFTests.cpp */; };
+ AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp */; };
+ AF6335E31C87B21E00F7D554 /* SymbolFilePDB.h in Headers */ = {isa = PBXBuildFile; fileRef = AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */; };
+ 268900CE13353E5F00698AC0 /* SymbolFileSymtab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89DE10F57C5600BB2B04 /* SymbolFileSymtab.cpp */; };
268900E013353E6F00698AC0 /* SymbolVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF94005711C03F6500085DB9 /* SymbolVendor.cpp */; };
+ 2635879417822FC2004C30BA /* SymbolVendorELF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2635879017822E56004C30BA /* SymbolVendorELF.cpp */; };
+ 268900CF13353E5F00698AC0 /* SymbolVendorMacOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */; };
+ 2689007313353E1A00698AC0 /* Symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 69A01E1F1236C5D400C660B5 /* Symbols.cpp */; };
+ 2689007C13353E1A00698AC0 /* Symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2689B0B5113EE47E00A4AEDB /* Symbols.cpp */; };
+ 23CB153F1D66DA9300EDDDE1 /* SymbolsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */; };
268900E113353E6F00698AC0 /* Symtab.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F1F10F1B8EC00F91463 /* Symtab.cpp */; };
- 268900E213353E6F00698AC0 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2010F1B8EC00F91463 /* Type.cpp */; };
- 268900E313353E6F00698AC0 /* TypeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2110F1B8EC00F91463 /* TypeList.cpp */; };
- 268900E413353E6F00698AC0 /* UnwindPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABB91235DE1600F93A47 /* UnwindPlan.cpp */; };
- 268900E513353E6F00698AC0 /* UnwindTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABBA1235DE1600F93A47 /* UnwindTable.cpp */; };
- 268900E613353E6F00698AC0 /* Variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2210F1B8EC00F91463 /* Variable.cpp */; };
- 268900E713353E6F00698AC0 /* VariableList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2310F1B8EC00F91463 /* VariableList.cpp */; };
- 268900E813353E6F00698AC0 /* ABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 497E7B9D1188F6690065CCA1 /* ABI.cpp */; };
- 268900E913353E6F00698AC0 /* CPPLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */; };
- 268900EA13353E6F00698AC0 /* DynamicLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */; };
- 268900EB13353E6F00698AC0 /* ExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3510F1B90C00F91463 /* ExecutionContext.cpp */; };
- 268900EC13353E6F00698AC0 /* LanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */; };
- 268900ED13353E6F00698AC0 /* ObjCLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */; };
- 268900EE13353E6F00698AC0 /* PathMappingList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 495BBACB119A0DBE00418BEA /* PathMappingList.cpp */; };
- 268900EF13353E6F00698AC0 /* Platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264A43BD1320BCEB005B4096 /* Platform.cpp */; };
- 268900F013353E6F00698AC0 /* Process.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3610F1B90C00F91463 /* Process.cpp */; };
- 268900F113353E6F00698AC0 /* RegisterContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */; };
- 268900F213353E6F00698AC0 /* SectionLoadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618D7911240116900F2B8FE /* SectionLoadList.cpp */; };
- 268900F313353E6F00698AC0 /* StackFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3810F1B90C00F91463 /* StackFrame.cpp */; };
- 268900F413353E6F00698AC0 /* StackFrameList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3910F1B90C00F91463 /* StackFrameList.cpp */; };
- 268900F513353E6F00698AC0 /* StackID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3A10F1B90C00F91463 /* StackID.cpp */; };
- 268900F613353E6F00698AC0 /* StopInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2615DB861208A9E40021781D /* StopInfo.cpp */; };
+ 3F8169311ABB7A6D001DA9DF /* SystemInitializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692E1ABB7A6D001DA9DF /* SystemInitializer.cpp */; };
+ 3F8169321ABB7A6D001DA9DF /* SystemInitializerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692F1ABB7A6D001DA9DF /* SystemInitializerCommon.cpp */; };
+ 3F81692C1ABB7A1E001DA9DF /* SystemInitializerFull.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692A1ABB7A16001DA9DF /* SystemInitializerFull.cpp */; };
+ 4CD44D2220B725DA0003557C /* SystemInitializerLLGS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD44D2020B725DA0003557C /* SystemInitializerLLGS.cpp */; };
+ 3F8169331ABB7A6D001DA9DF /* SystemLifetimeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8169301ABB7A6D001DA9DF /* SystemLifetimeManager.cpp */; };
+ AF81DEFA1828A23F0042CF19 /* SystemRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF81DEF91828A23F0042CF19 /* SystemRuntime.cpp */; };
+ 238F2BA21D2C835A001FF92A /* SystemRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 238F2BA01D2C835A001FF92A /* SystemRuntime.h */; };
+ AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */; };
+ 2579065C1BD0488100178368 /* TCPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065A1BD0488100178368 /* TCPSocket.cpp */; };
+ 8C26C4261C3EA5F90031DF7C /* TSanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C26C4241C3EA4340031DF7C /* TSanRuntime.cpp */; };
268900F713353E6F00698AC0 /* Target.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3B10F1B90C00F91463 /* Target.cpp */; };
268900F813353E6F00698AC0 /* TargetList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3C10F1B90C00F91463 /* TargetList.cpp */; };
+ 6DEC6F391BD66D750091ABA6 /* TaskPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */; };
+ 23CB15421D66DA9300EDDDE1 /* TaskPoolTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */; };
+ 2689007413353E1A00698AC0 /* Terminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268DA873130095ED00C9483A /* Terminal.cpp */; };
+ 4CEC86A4204738C5009B37B1 /* TestArm64InstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CEC86A3204738C5009B37B1 /* TestArm64InstEmulation.cpp */; };
+ 23CB15401D66DA9300EDDDE1 /* TestClangASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23CB150C1D66CF5600EDDDE1 /* TestClangASTContext.cpp */; };
+ 9A20572D1F3B8E6600F6C293 /* TestCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */; };
+ 9A2057171F3B861400F6C293 /* TestDWARFCallFrameInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057131F3B860D00F6C293 /* TestDWARFCallFrameInfo.cpp */; };
+ 9A2057291F3B8DDB00F6C293 /* TestObjectFileELF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057251F3B8DD200F6C293 /* TestObjectFileELF.cpp */; };
+ 4C719399207D23E300FDF430 /* TestOptionArgParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C719398207D23E300FDF430 /* TestOptionArgParser.cpp */; };
+ 4CEC86A7204738EB009B37B1 /* TestPPC64InstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CEC86A6204738EA009B37B1 /* TestPPC64InstEmulation.cpp */; };
+ 9A2057181F3B861400F6C293 /* TestType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057141F3B860D00F6C293 /* TestType.cpp */; };
+ 9A18903C1F47D5E600394BCA /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890341F47D5D400394BCA /* TestUtilities.cpp */; };
+ AFEC5FD81D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC5FD51D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp */; };
268900F913353E6F00698AC0 /* Thread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3D10F1B90C00F91463 /* Thread.cpp */; };
+ 8CCB017E19BA28A80009FD44 /* ThreadCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB017A19BA283D0009FD44 /* ThreadCollection.cpp */; };
+ 26BC17B118C7F4CB00D2196D /* ThreadElfCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A818C7F4CB00D2196D /* ThreadElfCore.cpp */; };
+ 268900A113353E4200698AC0 /* ThreadGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2618EE631315B29C001D6D71 /* ThreadGDBRemote.cpp */; };
+ 2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2628A4D313D4977900F5487A /* ThreadKDP.cpp */; };
+ 3FDFED2919BA6D96009756A7 /* ThreadLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp */; };
268900FA13353E6F00698AC0 /* ThreadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3E10F1B90C00F91463 /* ThreadList.cpp */; };
+ 26A527C314E24F5F00F3A14A /* ThreadMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */; };
+ 26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */; };
+ 947CF7771DC7B20D00EF980B /* ThreadMinidump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7751DC7B20D00EF980B /* ThreadMinidump.cpp */; };
268900FB13353E6F00698AC0 /* ThreadPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F3F10F1B90C00F91463 /* ThreadPlan.cpp */; };
268900FC13353E6F00698AC0 /* ThreadPlanBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847110F50EFC00BB2B04 /* ThreadPlanBase.cpp */; };
268900FD13353E6F00698AC0 /* ThreadPlanCallFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49EC3E98118F90AC00B1265E /* ThreadPlanCallFunction.cpp */; };
+ EB8375E71B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB8375E61B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp */; };
+ 230EC45B1D63C3BA008DF59F /* ThreadPlanCallOnFunctionExit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.cpp */; };
268900FE13353E6F00698AC0 /* ThreadPlanCallUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */; };
+ 4C56543119D1EFAA002E9C44 /* ThreadPlanPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C56543019D1EFAA002E9C44 /* ThreadPlanPython.cpp */; };
+ 2689010613353E6F00698AC0 /* ThreadPlanRunToAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFCE031101218900CA63DB /* ThreadPlanRunToAddress.cpp */; };
268900FF13353E6F00698AC0 /* ThreadPlanShouldStopHere.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C43DEFA110641F300E55CBF /* ThreadPlanShouldStopHere.cpp */; };
+ 2689010413353E6F00698AC0 /* ThreadPlanStepInRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C43DF8911069C3200E55CBF /* ThreadPlanStepInRange.cpp */; };
2689010013353E6F00698AC0 /* ThreadPlanStepInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847210F50EFC00BB2B04 /* ThreadPlanStepInstruction.cpp */; };
2689010113353E6F00698AC0 /* ThreadPlanStepOut.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847310F50EFC00BB2B04 /* ThreadPlanStepOut.cpp */; };
2689010213353E6F00698AC0 /* ThreadPlanStepOverBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847410F50EFC00BB2B04 /* ThreadPlanStepOverBreakpoint.cpp */; };
- 2689010313353E6F00698AC0 /* ThreadPlanStepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847610F50EFC00BB2B04 /* ThreadPlanStepRange.cpp */; };
- 2689010413353E6F00698AC0 /* ThreadPlanStepInRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C43DF8911069C3200E55CBF /* ThreadPlanStepInRange.cpp */; };
2689010513353E6F00698AC0 /* ThreadPlanStepOverRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C43DF8A11069C3200E55CBF /* ThreadPlanStepOverRange.cpp */; };
- 2689010613353E6F00698AC0 /* ThreadPlanRunToAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAFCE031101218900CA63DB /* ThreadPlanRunToAddress.cpp */; };
+ 2689010313353E6F00698AC0 /* ThreadPlanStepRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847610F50EFC00BB2B04 /* ThreadPlanStepRange.cpp */; };
2689010713353E6F00698AC0 /* ThreadPlanStepThrough.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260C847510F50EFC00BB2B04 /* ThreadPlanStepThrough.cpp */; };
2689010813353E6F00698AC0 /* ThreadPlanStepUntil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2660D9FE11922A7F00958FBD /* ThreadPlanStepUntil.cpp */; };
2689010A13353E6F00698AC0 /* ThreadPlanTracer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */; };
2689010B13353E6F00698AC0 /* ThreadSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C08CDE711C81EF8001610A8 /* ThreadSpec.cpp */; };
- 2689010C13353E6F00698AC0 /* UnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C00987011500B4300F316B0 /* UnixSignals.cpp */; };
- 2689011013353E8200698AC0 /* SharingPtr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */; };
- 2689011113353E8200698AC0 /* StringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2660D9F611922A1300958FBD /* StringExtractor.cpp */; };
- 2689011213353E8200698AC0 /* StringExtractorGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */; };
- 268901161335BBC300698AC0 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
- 2689FFDA13353D9D00698AC0 /* lldb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7410F1B85900F91463 /* lldb.cpp */; };
- 2689FFEF13353DB600698AC0 /* Breakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0A10F1B83100F91463 /* Breakpoint.cpp */; };
- 2689FFF113353DB600698AC0 /* BreakpointID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0B10F1B83100F91463 /* BreakpointID.cpp */; };
- 2689FFF313353DB600698AC0 /* BreakpointIDList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0C10F1B83100F91463 /* BreakpointIDList.cpp */; };
- 2689FFF513353DB600698AC0 /* BreakpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0D10F1B83100F91463 /* BreakpointList.cpp */; };
- 2689FFF713353DB600698AC0 /* BreakpointLocation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0E10F1B83100F91463 /* BreakpointLocation.cpp */; };
- 2689FFF913353DB600698AC0 /* BreakpointLocationCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E0F10F1B83100F91463 /* BreakpointLocationCollection.cpp */; };
- 2689FFFB13353DB600698AC0 /* BreakpointLocationList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1010F1B83100F91463 /* BreakpointLocationList.cpp */; };
- 2689FFFD13353DB600698AC0 /* BreakpointOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1110F1B83100F91463 /* BreakpointOptions.cpp */; };
- 2689FFFF13353DB600698AC0 /* BreakpointResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1210F1B83100F91463 /* BreakpointResolver.cpp */; };
- 268F9D53123AA15200B91E9B /* SBSymbolContextList.h in Headers */ = {isa = PBXBuildFile; fileRef = 268F9D52123AA15200B91E9B /* SBSymbolContextList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 268F9D55123AA16600B91E9B /* SBSymbolContextList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */; };
- 2690B3711381D5C300ECFBAE /* Memory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2690B3701381D5C300ECFBAE /* Memory.cpp */; };
- 2692BA15136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2692BA13136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp */; };
- 2694E99D14FC0BB30076DE67 /* PlatformFreeBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */; };
- 2694E9A414FC0BBD0076DE67 /* PlatformLinux.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */; };
- 26954EBE1401EE8B00294D09 /* DynamicRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */; };
- 26957D9813D381C900670048 /* RegisterContextDarwin_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */; };
- 26957D9A13D381C900670048 /* RegisterContextDarwin_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */; };
- 26957D9C13D381C900670048 /* RegisterContextDarwin_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */; };
- 2697A39315E404B1003E682C /* OptionValueArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A39215E404B1003E682C /* OptionValueArch.cpp */; };
- 2697A54D133A6305004E4240 /* PlatformDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */; };
- 2698699B15E6CBD0002415FF /* OperatingSystemPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */; };
- 269DDD4A1B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 269DDD481B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp */; };
- 26A375811D59462700D6CBDB /* SelectHelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A3757F1D59462700D6CBDB /* SelectHelper.cpp */; };
- 26A527C114E24F5F00F3A14A /* ProcessMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */; };
- 26A527C314E24F5F00F3A14A /* ThreadMachCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */; };
- 26A69C5F137A17A500262477 /* RegisterValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C6886E137880C400407EDF /* RegisterValue.cpp */; };
- 26A7A035135E6E4200FB369E /* OptionValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A7A034135E6E4200FB369E /* OptionValue.cpp */; };
- 26AB92121819D74600E63F3E /* DWARFDataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26AB92101819D74600E63F3E /* DWARFDataExtractor.cpp */; };
- 26B1EFAE154638AF00E2DAC7 /* DWARFDeclContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */; };
- 26B1FCC21338115F002886E2 /* Host.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7EE810F1B88F00F91463 /* Host.mm */; };
- 26B42C4D1187ABA50079C8C8 /* LLDB.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B42C4C1187ABA50079C8C8 /* LLDB.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26B7564E14F89356008D9CB3 /* PlatformiOSSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */; };
- 26B75B441AD6E29A001F7A57 /* MipsLinuxSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B75B421AD6E29A001F7A57 /* MipsLinuxSignals.cpp */; };
- 26B8283D142D01E9002DBC64 /* SBSection.h in Headers */ = {isa = PBXBuildFile; fileRef = 26B8283C142D01E9002DBC64 /* SBSection.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26B82840142D020F002DBC64 /* SBSection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8283F142D020F002DBC64 /* SBSection.cpp */; };
- 26BC179918C7F2B300D2196D /* JITLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC179718C7F2B300D2196D /* JITLoader.cpp */; };
- 26BC179A18C7F2B300D2196D /* JITLoaderList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC179818C7F2B300D2196D /* JITLoaderList.cpp */; };
- 26BC17AB18C7F4CB00D2196D /* ProcessElfCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A218C7F4CB00D2196D /* ProcessElfCore.cpp */; };
- 26BC17AD18C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A418C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.cpp */; };
- 26BC17AF18C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A618C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.cpp */; };
- 26BC17B118C7F4CB00D2196D /* ThreadElfCore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC17A818C7F4CB00D2196D /* ThreadElfCore.cpp */; };
- 26BCFC521368AE38006DC050 /* OptionGroupFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BCFC511368AE38006DC050 /* OptionGroupFormat.cpp */; };
- 26BD407F135D2AE000237D80 /* FileLineResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */; };
- 26BF51F31B3C754400016294 /* ABISysV_hexagon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */; };
- 26BF51F61B3C754400016294 /* ABISysV_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */; };
- 26C72C94124322890068DC16 /* SBStream.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C72C93124322890068DC16 /* SBStream.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26C72C961243229A0068DC16 /* SBStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C72C951243229A0068DC16 /* SBStream.cpp */; };
- 26C7C4831BFFEA7E009BD01F /* WindowsMiniDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp */; };
- 26C7C4841BFFEA7E009BD01F /* WindowsMiniDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h */; };
- 26CA97A1172B1FD5005DC71B /* RegisterContextThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */; };
- 26CEB5EF18761CB2008F575A /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
- 26CEB5F218762056008F575A /* CommandObjectGUI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CEB5F018762056008F575A /* CommandObjectGUI.cpp */; };
- 26CFDCA3186163A4000E63E5 /* Editline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CFDCA2186163A4000E63E5 /* Editline.cpp */; };
- 26CFDCA818616473000E63E5 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
- 26D265BC136B4269002EEE45 /* lldb-public.h in Headers */ = {isa = PBXBuildFile; fileRef = 26651A14133BEC76005B64B7 /* lldb-public.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26D52C1F1A980FE300E5D2FB /* MICmdCmdSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */; };
- 26D55235159A7DB100708D8D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
- 26D5E15F135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */; };
- 26D5E163135BB054006EA0A7 /* OptionGroupPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */; };
- 26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */; };
- 26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */; };
- 26DB3E161379E7AD0080DC73 /* ABIMacOSX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */; };
- 26DB3E191379E7AD0080DC73 /* ABIMacOSX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0B1379E7AD0080DC73 /* ABIMacOSX_arm64.cpp */; };
- 26DB3E1C1379E7AD0080DC73 /* ABIMacOSX_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */; };
- 26DB3E1F1379E7AD0080DC73 /* ABISysV_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */; };
- 26DC6A1D1337FECA00FF7998 /* lldb-platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */; };
- 26DE1E6C11616C2E00A093E2 /* lldb-forward.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE1E6A11616C2E00A093E2 /* lldb-forward.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE204111618AB900A093E2 /* SBSymbolContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204011618AB900A093E2 /* SBSymbolContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE204311618ACA00A093E2 /* SBAddress.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204211618ACA00A093E2 /* SBAddress.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE204511618ADA00A093E2 /* SBAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204411618ADA00A093E2 /* SBAddress.cpp */; };
- 26DE204711618AED00A093E2 /* SBSymbolContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204611618AED00A093E2 /* SBSymbolContext.cpp */; };
- 26DE204D11618E7A00A093E2 /* SBModule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE204C11618E7A00A093E2 /* SBModule.cpp */; };
- 26DE204F11618E9800A093E2 /* SBModule.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE204E11618E9800A093E2 /* SBModule.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205311618FAC00A093E2 /* SBFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205211618FAC00A093E2 /* SBFunction.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205511618FB800A093E2 /* SBCompileUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205411618FB800A093E2 /* SBCompileUnit.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205711618FC500A093E2 /* SBBlock.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205611618FC500A093E2 /* SBBlock.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205911618FE700A093E2 /* SBLineEntry.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205811618FE700A093E2 /* SBLineEntry.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205B11618FF600A093E2 /* SBSymbol.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE205A11618FF600A093E2 /* SBSymbol.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 26DE205D1161901400A093E2 /* SBFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE205C1161901400A093E2 /* SBFunction.cpp */; };
- 26DE205F1161901B00A093E2 /* SBCompileUnit.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE205E1161901B00A093E2 /* SBCompileUnit.cpp */; };
- 26DE20611161902700A093E2 /* SBBlock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20601161902600A093E2 /* SBBlock.cpp */; };
- 26DE20631161904200A093E2 /* SBLineEntry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20621161904200A093E2 /* SBLineEntry.cpp */; };
- 26DE20651161904E00A093E2 /* SBSymbol.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DE20641161904E00A093E2 /* SBSymbol.cpp */; };
- 26E152261419CAD4007967D0 /* ObjectFilePECOFF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */; };
- 26ED3D6D13C563810017D45E /* OptionGroupVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */; };
- 26EFB61B1BFE8D3E00544801 /* PlatformNetBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp */; };
- 26EFB61C1BFE8D3E00544801 /* PlatformNetBSD.h in Headers */ = {isa = PBXBuildFile; fileRef = 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */; };
- 26EFC4CD18CFAF0D00865D87 /* ObjectFileJIT.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26EFC4CA18CFAF0D00865D87 /* ObjectFileJIT.cpp */; };
- 26F006561B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F006541B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp */; };
- 26F4A21C13FBA31A0064B613 /* ThreadMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */; };
- 26F5C27710F3D9E4009D5894 /* Driver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26F5C27310F3D9E4009D5894 /* Driver.cpp */; };
- 26F5C32D10F3DFDD009D5894 /* libtermcap.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */; };
- 26FFC19914FC072100087D58 /* AuxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19314FC072100087D58 /* AuxVector.cpp */; };
- 26FFC19B14FC072100087D58 /* DYLDRendezvous.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19514FC072100087D58 /* DYLDRendezvous.cpp */; };
- 26FFC19D14FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */; };
- 304B2E461CAAA57B007829FE /* ClangUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3032B1B61CAAA3D1004BE1AB /* ClangUtil.cpp */; };
- 30B38A001CAAA6D7009524E3 /* ClangUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = 3032B1B91CAAA400004BE1AB /* ClangUtil.h */; };
- 332CCB181AFF41620034D4C4 /* SBLanguageRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 3392EBB71AFF402200858B9F /* SBLanguageRuntime.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 33E5E8471A674FB60024ED68 /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33E5E8411A672A240024ED68 /* StringConvert.cpp */; };
- 3F8160A61AB9F7DD001DA9DF /* Logging.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8160A51AB9F7DD001DA9DF /* Logging.cpp */; };
- 3F81691A1ABA2419001DA9DF /* NameMatches.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8169181ABA2419001DA9DF /* NameMatches.cpp */; };
- 3F81692C1ABB7A1E001DA9DF /* SystemInitializerFull.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692A1ABB7A16001DA9DF /* SystemInitializerFull.cpp */; };
- 3F8169311ABB7A6D001DA9DF /* SystemInitializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692E1ABB7A6D001DA9DF /* SystemInitializer.cpp */; };
- 3F8169321ABB7A6D001DA9DF /* SystemInitializerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F81692F1ABB7A6D001DA9DF /* SystemInitializerCommon.cpp */; };
- 3F8169331ABB7A6D001DA9DF /* SystemLifetimeManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F8169301ABB7A6D001DA9DF /* SystemLifetimeManager.cpp */; };
- 3FBA69E11B6067120008F44A /* ScriptInterpreterNone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69DD1B6067020008F44A /* ScriptInterpreterNone.cpp */; };
- 3FBA69EC1B6067430008F44A /* PythonDataObjects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69E31B60672A0008F44A /* PythonDataObjects.cpp */; };
- 3FBA69ED1B60674B0008F44A /* ScriptInterpreterPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FBA69E51B60672A0008F44A /* ScriptInterpreterPython.cpp */; };
- 3FDFDDBD199C3A06009756A7 /* FileAction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDBC199C3A06009756A7 /* FileAction.cpp */; };
- 3FDFDDBF199D345E009756A7 /* FileCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDBE199D345E009756A7 /* FileCache.cpp */; };
- 3FDFDDC6199D37ED009756A7 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFDDC5199D37ED009756A7 /* FileSystem.cpp */; };
- 3FDFE52C19A2917A009756A7 /* HostInfoMacOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE52B19A2917A009756A7 /* HostInfoMacOSX.mm */; };
- 3FDFE53119A292F0009756A7 /* HostInfoPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE53019A292F0009756A7 /* HostInfoPosix.cpp */; };
- 3FDFE53519A29327009756A7 /* HostInfoBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE53419A29327009756A7 /* HostInfoBase.cpp */; };
- 3FDFE56C19AF9C44009756A7 /* HostProcessPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56A19AF9C44009756A7 /* HostProcessPosix.cpp */; };
- 3FDFE56D19AF9C44009756A7 /* HostThreadPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp */; };
- 3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED0519B7C898009756A7 /* HostThreadMacOSX.mm */; };
- 3FDFED2719BA6D96009756A7 /* HostNativeThreadBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2419BA6D96009756A7 /* HostNativeThreadBase.cpp */; };
- 3FDFED2819BA6D96009756A7 /* HostThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2519BA6D96009756A7 /* HostThread.cpp */; };
- 3FDFED2919BA6D96009756A7 /* ThreadLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp */; };
- 3FDFED2D19C257A0009756A7 /* HostProcess.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */; };
- 490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */; };
- 490A966B1628C3BF00F0002E /* SBDeclaration.h in Headers */ = {isa = PBXBuildFile; fileRef = 9452573816262CEF00325455 /* SBDeclaration.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 492DB7EB1EC662E200B9E9AF /* Status.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 492DB7E81EC662D100B9E9AF /* Status.cpp */; };
- 4939EA8D1BD56B6D00084382 /* REPL.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4939EA8C1BD56B6D00084382 /* REPL.cpp */; };
- 494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; };
- 4959511F1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */; };
- 4966DCC4148978A10028481B /* ClangExternalASTSourceCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */; };
- 4971D4B51F30ECFB00823171 /* SBProcessInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */; };
- 4984BA131B978C55008658D4 /* ClangExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA0E1B978C3E008658D4 /* ClangExpressionVariable.cpp */; };
- 4984BA161B979973008658D4 /* ExpressionVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4984BA151B979973008658D4 /* ExpressionVariable.cpp */; };
- 4984BA181B979C08008658D4 /* ExpressionVariable.h in Headers */ = {isa = PBXBuildFile; fileRef = 4984BA171B979C08008658D4 /* ExpressionVariable.h */; };
- 49A1CAC51430E8DE00306AC9 /* ExpressionSourceCode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */; };
- 49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 496B01581406DE8900F830D5 /* IRInterpreter.cpp */; };
- 49CA96FC1E6AACC900C03FEE /* DataBufferHeap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E61E6AAC6600C03FEE /* DataBufferHeap.cpp */; };
- 49CA96FD1E6AACC900C03FEE /* DataBufferLLVM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E71E6AAC6600C03FEE /* DataBufferLLVM.cpp */; };
- 49CA96FE1E6AACC900C03FEE /* DataEncoder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E81E6AAC6600C03FEE /* DataEncoder.cpp */; };
- 49CA96FF1E6AACC900C03FEE /* DataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp */; };
- 49CA97001E6AACC900C03FEE /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96EA1E6AAC6600C03FEE /* UUID.cpp */; };
- 49D8FB3913B5598F00411094 /* ClangASTImporter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */; };
- 49DA65031485C92A005FF180 /* AppleObjCDeclVendor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DA65021485C92A005FF180 /* AppleObjCDeclVendor.cpp */; };
- 49DCF6FE170E6B4A0092F75E /* IRMemoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */; };
- 49DCF702170E70120092F75E /* Materializer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DCF700170E70120092F75E /* Materializer.cpp */; };
- 49DEF1251CD7C6DF006A7C7D /* BlockPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */; };
- 49E4F66B1C9CAD16008487EA /* DiagnosticManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49E4F6681C9CAD12008487EA /* DiagnosticManager.cpp */; };
- 49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */; };
- 4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp */; };
- 4C05332B1F62121E00DED368 /* SBBreakpointOptionCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0533291F6211FB00DED368 /* SBBreakpointOptionCommon.cpp */; };
- 4C2479BD1BA39295009C9A7B /* FunctionCaller.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp */; };
- 4C3ADCD61810D88B00357218 /* BreakpointResolverFileRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */; };
- 4C4EB7811E6A4DCC002035C0 /* DumpDataExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */; };
- 4C54B27B1F61CE2800D469CA /* SBBreakpointName.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C54B2781F61CE1200D469CA /* SBBreakpointName.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4C54B27E1F61CE6300D469CA /* SBBreakpointName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C54B27C1F61CE5300D469CA /* SBBreakpointName.cpp */; };
- 4C562CC71CC07DF700C52EAC /* PDBASTParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C562CC21CC07DDD00C52EAC /* PDBASTParser.cpp */; };
- 4C56543119D1EFAA002E9C44 /* ThreadPlanPython.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C56543019D1EFAA002E9C44 /* ThreadPlanPython.cpp */; };
- 4C56543519D2297A002E9C44 /* SBThreadPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 4C56543419D2297A002E9C44 /* SBThreadPlan.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4C56543719D22B32002E9C44 /* SBThreadPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C56543619D22B32002E9C44 /* SBThreadPlan.cpp */; };
- 4C7D48241F5099A1005314B4 /* SymbolFileDWARFDwp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481C1F509963005314B4 /* SymbolFileDWARFDwp.cpp */; };
- 4C7D48251F5099B2005314B4 /* SymbolFileDWARFDwoDwp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D481F1F509964005314B4 /* SymbolFileDWARFDwoDwp.cpp */; };
- 4C877B391F30EF990068FCFB /* SBProcessInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 4987FB201F30EC9900E5C17D /* SBProcessInfo.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4C88BC2A1BA3722B00AA0964 /* Expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C88BC291BA3722B00AA0964 /* Expression.cpp */; };
- 4C88BC2D1BA391B000AA0964 /* UserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0083331B9A5DE200D5CF24 /* UserExpression.cpp */; };
- 4CA9D1401FCE07CD00300E18 /* RegisterUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CA9D13C1FCE07AF00300E18 /* RegisterUtilities.cpp */; };
- 4CAA19E61F5A40040099E692 /* BreakpointName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C7D48281F509CCD005314B4 /* BreakpointName.cpp */; };
- 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; };
- 4CC7C6501D5298F30076FF94 /* OCamlLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C64D1D5298E20076FF94 /* OCamlLanguage.cpp */; };
- 4CC7C6571D52997A0076FF94 /* OCamlASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C6551D52996C0076FF94 /* OCamlASTContext.cpp */; };
- 4CC7C6581D529B950076FF94 /* DWARFASTParserOCaml.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */; };
- 4CCA644D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */; };
- 4CCA645013B40B82003BDF98 /* AppleObjCRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */; };
- 4CCA645213B40B82003BDF98 /* AppleObjCRuntimeV1.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */; };
- 4CCA645413B40B82003BDF98 /* AppleObjCRuntimeV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */; };
- 4CCA645613B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */; };
- 4CCA645813B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */; };
- 4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; };
- 4CDB8D6D1DBA91B6006C5B13 /* LibStdcppUniquePointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D671DBA91A6006C5B13 /* LibStdcppUniquePointer.cpp */; };
- 4CDB8D6E1DBA91B6006C5B13 /* LibStdcppTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp */; };
- 4CE4EFAA1E8999B900A80C06 /* PlatformOpenBSD.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFA61E8999B000A80C06 /* PlatformOpenBSD.cpp */; };
- 4CE4EFB31E899A3400A80C06 /* RegisterContextOpenBSD_i386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFAB1E899A1200A80C06 /* RegisterContextOpenBSD_i386.cpp */; };
- 4CE4EFB41E899A4000A80C06 /* RegisterContextOpenBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4EFAD1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.cpp */; };
- 4CE4F673162C971A00F75CB3 /* SBExpressionOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4CE4F675162C973F00F75CB3 /* SBExpressionOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */; };
- 4CF3D80C15AF4DC800845BF3 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EDB919B414F6F10D008FF64B /* Security.framework */; };
- 4CF52AF51428291E0051E832 /* SBFileSpecList.h in Headers */ = {isa = PBXBuildFile; fileRef = 4CF52AF41428291E0051E832 /* SBFileSpecList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 4CF52AF8142829390051E832 /* SBFileSpecList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */; };
- 54067BF11DF2041B00749AA5 /* UBSanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */; };
- 6D0F61431C80AAAE00A4ECEE /* JavaASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */; };
- 6D0F61481C80AAD600A4ECEE /* DWARFASTParserJava.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */; };
- 6D0F614E1C80AB0700A4ECEE /* JavaLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F614A1C80AB0400A4ECEE /* JavaLanguageRuntime.cpp */; };
- 6D0F614F1C80AB0C00A4ECEE /* JavaLanguageRuntime.h in Headers */ = {isa = PBXBuildFile; fileRef = 6D0F614B1C80AB0400A4ECEE /* JavaLanguageRuntime.h */; };
- 6D0F61591C80AB3500A4ECEE /* JavaFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61511C80AB3000A4ECEE /* JavaFormatterFunctions.cpp */; };
- 6D0F615A1C80AB3900A4ECEE /* JavaLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D0F61531C80AB3000A4ECEE /* JavaLanguage.cpp */; };
- 6D55B2901A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28D1A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp */; };
- 6D55B2911A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28E1A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp */; };
- 6D55B2921A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55B28F1A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp */; };
- 6D55BAED1A8CD0A800A70529 /* PlatformAndroid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55BAE91A8CD08C00A70529 /* PlatformAndroid.cpp */; };
- 6D55BAEE1A8CD0B200A70529 /* PlatformAndroidRemoteGDBServer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D55BAEB1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.cpp */; };
- 6D762BEE1B1605D2006C929D /* LLDBServerUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D762BEC1B1605CD006C929D /* LLDBServerUtilities.cpp */; };
- 6D86CEA01B440F8500A7FBFA /* CommandObjectBugreport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D86CE9E1B440F6B00A7FBFA /* CommandObjectBugreport.cpp */; };
- 6D95DC001B9DC057000E318A /* DIERef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFD1B9DC057000E318A /* DIERef.cpp */; };
- 6D95DC011B9DC057000E318A /* HashedNameToDIE.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */; };
- 6D95DC021B9DC057000E318A /* SymbolFileDWARFDwo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */; };
- 6D99A3631BBC2F3200979793 /* ArmUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */; };
- 6D9AB3DD1BB2B74E003F2289 /* TypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */; };
- 6DEC6F391BD66D750091ABA6 /* TaskPool.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */; };
- 8C26C4261C3EA5F90031DF7C /* TSanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C26C4241C3EA4340031DF7C /* TSanRuntime.cpp */; };
- 8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */; };
- 8C2D6A5E197A250F006989C9 /* MemoryHistoryASan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */; };
- 8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */; };
- 8C3BD9A01EF5D1FF0016C343 /* JSONTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */; };
- 8CCB017E19BA28A80009FD44 /* ThreadCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB017A19BA283D0009FD44 /* ThreadCollection.cpp */; };
- 8CCB018219BA4E270009FD44 /* SBThreadCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 8CCB018119BA4E210009FD44 /* SBThreadCollection.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 8CCB018319BA51BF0009FD44 /* SBThreadCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CCB017F19BA4DD00009FD44 /* SBThreadCollection.cpp */; };
- 8CF02AE919DCC01900B14BE0 /* InstrumentationRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02ADF19DCBF3B00B14BE0 /* InstrumentationRuntime.cpp */; };
- 8CF02AEA19DCC02100B14BE0 /* ASanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */; };
- 8CF02AEF19DD16B100B14BE0 /* InstrumentationRuntimeStopInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8CF02AED19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.cpp */; };
- 9404957A1BEC497E00926025 /* NSError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940495781BEC497E00926025 /* NSError.cpp */; };
- 9404957B1BEC497E00926025 /* NSException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940495791BEC497E00926025 /* NSException.cpp */; };
- 94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */; };
- 940B02F619DC96E700AD0F52 /* SBExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940B02F519DC96E700AD0F52 /* SBExecutionContext.cpp */; };
- 940B04D91A8984FF0045D5F7 /* argdumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940B04D81A8984FF0045D5F7 /* argdumper.cpp */; };
- 940B04E41A8987680045D5F7 /* lldb-argdumper in CopyFiles */ = {isa = PBXBuildFile; fileRef = 942829C01A89835300521B30 /* lldb-argdumper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
- 94145431175E63B500284436 /* lldb-versioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 94145430175D7FDE00284436 /* lldb-versioning.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9418EBCD1AA910910058B02E /* VectorType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9418EBCC1AA910910058B02E /* VectorType.cpp */; };
- 941BCC7F14E48C4000BB969C /* SBTypeFilter.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568614E355F2003A195C /* SBTypeFilter.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 941BCC8014E48C4000BB969C /* SBTypeFormat.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568714E355F2003A195C /* SBTypeFormat.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 941BCC8114E48C4000BB969C /* SBTypeSummary.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568814E355F2003A195C /* SBTypeSummary.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 941BCC8214E48C4000BB969C /* SBTypeSynthetic.h in Headers */ = {isa = PBXBuildFile; fileRef = 9461568914E355F2003A195C /* SBTypeSynthetic.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 94235B9E1A8D667400EB2EED /* SBVariablesOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */; };
- 94235B9F1A8D66D600EB2EED /* SBVariablesOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 942612F71B95000000EF842E /* LanguageCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942612F61B95000000EF842E /* LanguageCategory.cpp */; };
- 942612F81B952C9B00EF842E /* ObjCLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385E1B8FB7A2004FE1E4 /* ObjCLanguage.cpp */; };
- 942829561A89614C00521B30 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 942829551A89614C00521B30 /* JSON.cpp */; };
- 942829CC1A89839300521B30 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
- 9428BC2C1C6E64E4002A24D7 /* LibCxxAtomic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9428BC291C6E64DC002A24D7 /* LibCxxAtomic.cpp */; };
- 94380B8219940B0A00BFE4A8 /* StringLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */; };
- 943BDEFE1AA7B2F800789CE8 /* LLDBAssert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */; };
- 9441816E1C8F5EC900E5A8D9 /* CommandAlias.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9441816D1C8F5EC900E5A8D9 /* CommandAlias.cpp */; };
- 944372DC171F6B4300E57C32 /* RegisterContextDummy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */; };
- 9443B122140C18C40013457C /* SBData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9443B121140C18C10013457C /* SBData.cpp */; };
- 9443B123140C26AB0013457C /* SBData.h in Headers */ = {isa = PBXBuildFile; fileRef = 9443B120140C18A90013457C /* SBData.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9447DE431BD5963300E67212 /* DumpValueObjectOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9447DE421BD5963300E67212 /* DumpValueObjectOptions.cpp */; };
- 945215DF17F639EE00521C0B /* ValueObjectPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */; };
- 9452573A16262D0200325455 /* SBDeclaration.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9452573916262D0200325455 /* SBDeclaration.cpp */; };
- 945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */; };
- 945261C01B9A11FC00BF138D /* LibCxx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B51B9A11E800BF138D /* LibCxx.cpp */; };
- 945261C11B9A11FC00BF138D /* LibCxxInitializerList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */; };
- 945261C21B9A11FC00BF138D /* LibCxxList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B81B9A11E800BF138D /* LibCxxList.cpp */; };
- 945261C31B9A11FC00BF138D /* LibCxxMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261B91B9A11E800BF138D /* LibCxxMap.cpp */; };
- 945261C41B9A11FC00BF138D /* LibCxxUnorderedMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */; };
- 945261C51B9A11FC00BF138D /* LibCxxVector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */; };
- 945261C61B9A11FC00BF138D /* LibStdcpp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */; };
- 945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */; };
- 9455630F1BEAD0600073F75F /* PlatformAppleSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */; };
- 945563101BEAD0650073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9455630D1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm */; };
- 945759671534941F005A9070 /* PlatformPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945759651534941F005A9070 /* PlatformPOSIX.cpp */; };
- 9461569A14E358A6003A195C /* SBTypeFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568A14E35621003A195C /* SBTypeFilter.cpp */; };
- 9461569B14E358A6003A195C /* SBTypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568B14E35621003A195C /* SBTypeFormat.cpp */; };
- 9461569C14E358A6003A195C /* SBTypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568C14E35621003A195C /* SBTypeSummary.cpp */; };
- 9461569D14E358A6003A195C /* SBTypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */; };
- 946216C21A97C080006E19CC /* OptionValueLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946216C11A97C080006E19CC /* OptionValueLanguage.cpp */; };
- 9463D4CD13B1798800C230D4 /* CommandObjectType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */; };
- 9475C18814E5E9FA001BFC6D /* SBTypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */; };
- 9475C18914E5EA08001BFC6D /* SBTypeCategory.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9475C18E14E5F834001BFC6D /* SBTypeNameSpecifier.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */; };
- 9475C18F14E5F858001BFC6D /* SBTypeNameSpecifier.h in Headers */ = {isa = PBXBuildFile; fileRef = 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 947A1D641616476B0017C8D1 /* CommandObjectPlugin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */; };
- 947CF7711DC7B1EE00EF980B /* ProcessMinidump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7701DC7B1EE00EF980B /* ProcessMinidump.cpp */; };
- 947CF7761DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7741DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp */; };
- 947CF7771DC7B20D00EF980B /* ThreadMinidump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 947CF7751DC7B20D00EF980B /* ThreadMinidump.cpp */; };
- 9485545A1DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 948554591DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp */; };
- 949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; };
- 949EEDA01BA74B6D008C63CF /* CoreMedia.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */; };
- 949EEDA31BA76577008C63CF /* Cocoa.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA11BA76571008C63CF /* Cocoa.cpp */; };
- 949EEDAE1BA7671C008C63CF /* CF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDAC1BA76719008C63CF /* CF.cpp */; };
- 949EEDAF1BA76729008C63CF /* NSArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA41BA765B5008C63CF /* NSArray.cpp */; };
- 949EEDB11BA7672D008C63CF /* NSDictionary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */; };
- 949EEDB21BA76731008C63CF /* NSIndexPath.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */; };
- 949EEDB31BA76736008C63CF /* NSSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949EEDA71BA765B5008C63CF /* NSSet.cpp */; };
- 94A5B3971AB9FE8D00A5EE7F /* EmulateInstructionMIPS64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */; };
- 94B638531B8F8E6C004FE1E4 /* Language.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B638521B8F8E6C004FE1E4 /* Language.cpp */; };
- 94B6385D1B8FB178004FE1E4 /* CPlusPlusLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */; };
- 94B638631B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B638621B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp */; };
- 94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */; };
- 94B9E5121BBF20F4000A48DC /* NSString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B9E5111BBF20F4000A48DC /* NSString.cpp */; };
- 94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94BA8B6C176F8C9B005A91B5 /* Range.cpp */; };
- 94BA8B70176F97CE005A91B5 /* CommandHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp */; };
- 94CB255C16B069770059775D /* DataVisualization.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255816B069770059775D /* DataVisualization.cpp */; };
- 94CB255D16B069770059775D /* FormatClasses.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255916B069770059775D /* FormatClasses.cpp */; };
- 94CB255E16B069770059775D /* FormatManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB255A16B069770059775D /* FormatManager.cpp */; };
+ AFF8FF0C1E779D4B003830EF /* TildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFF8FF0B1E779D4B003830EF /* TildeExpressionResolver.cpp */; };
+ 9A3D43DB1F3151C400EB767C /* TildeExpressionResolverTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C91F3150D200EB767C /* TildeExpressionResolverTest.cpp */; };
+ 9A3D43DC1F3151C400EB767C /* TimeoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CC1F3150D200EB767C /* TimeoutTest.cpp */; };
+ 2689005213353E0400698AC0 /* Timer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9610F1B85900F91463 /* Timer.cpp */; };
+ 9A3D43DD1F3151C400EB767C /* TimerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C51F3150D200EB767C /* TimerTest.cpp */; };
+ 268900E213353E6F00698AC0 /* Type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2010F1B8EC00F91463 /* Type.cpp */; };
94CB256616B096F10059775D /* TypeCategory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256416B096F10059775D /* TypeCategory.cpp */; };
94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256516B096F10059775D /* TypeCategoryMap.cpp */; };
94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256D16B0A4260059775D /* TypeFormat.cpp */; };
+ 268900E313353E6F00698AC0 /* TypeList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2110F1B8EC00F91463 /* TypeList.cpp */; };
+ 6D9AB3DD1BB2B74E003F2289 /* TypeMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */; };
94CB257116B0A4270059775D /* TypeSummary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256E16B0A4260059775D /* TypeSummary.cpp */; };
94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB256F16B0A4270059775D /* TypeSynthetic.cpp */; };
- 94CB257416B1D3880059775D /* FormatCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CB257316B1D3870059775D /* FormatCache.cpp */; };
+ AEEA34051AC88A7400AB639D /* TypeSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEEA34041AC88A7400AB639D /* TypeSystem.cpp */; };
94CD131A19BA33B400DB7BED /* TypeValidator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD131919BA33B400DB7BED /* TypeValidator.cpp */; };
- 94CD7D0919A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0819A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp */; };
- 94CD7D0C19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94CD7D0B19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp */; };
- 94D0858C1B9675B8000D24BD /* FormattersHelpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94D0858B1B9675B8000D24BD /* FormattersHelpers.cpp */; };
- 94E829CA152D33C1006F96A3 /* lldb-server in Resources */ = {isa = PBXBuildFile; fileRef = 26DC6A101337FE6900FF7998 /* lldb-server */; };
- 94F48F251A01C687005C0EC6 /* StringPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94F48F241A01C687005C0EC6 /* StringPrinter.cpp */; };
- 94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */; };
- 964381701C8D6B8200023D59 /* SBLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */; };
- 964463EC1A330C0500154ED8 /* CompactUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 964463EB1A330C0500154ED8 /* CompactUnwindInfo.cpp */; };
- 966C6B7918E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
- 966C6B7A18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
- 966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
- 9694FA711B32AA64005EBB16 /* ABISysV_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */; };
- 9A0FDEA71E8EF5110086B2F5 /* RegisterContextLinux_mips.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */; };
- 9A18903B1F47D5E600394BCA /* MockTildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890321F47D5D400394BCA /* MockTildeExpressionResolver.cpp */; };
- 9A18903C1F47D5E600394BCA /* TestUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1890341F47D5D400394BCA /* TestUtilities.cpp */; };
- 9A19A6AF1163BBB200E0D453 /* SBValue.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A19A6A51163BB7E00E0D453 /* SBValue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A19A6B01163BBB300E0D453 /* SBValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */; };
- 9A1E595C1EB2B141002206A5 /* SBTrace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */; };
- 9A1E595D1EB2B141002206A5 /* SBTraceOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A1E59531EB2B0B9002206A5 /* SBTraceOptions.cpp */; };
- 9A2057031F3A605200F6C293 /* VASprintfTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */; };
- 9A2057081F3B819100F6C293 /* MemoryRegionInfoTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057061F3B818600F6C293 /* MemoryRegionInfoTest.cpp */; };
- 9A20570F1F3B821A00F6C293 /* test-dwarf.cpp in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A20570D1F3B821A00F6C293 /* test-dwarf.cpp */; };
- 9A2057101F3B821A00F6C293 /* test-dwarf.exe in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9A20570E1F3B821A00F6C293 /* test-dwarf.exe */; };
- 9A2057121F3B824B00F6C293 /* SymbolFileDWARFTests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20570A1F3B81F300F6C293 /* SymbolFileDWARFTests.cpp */; };
- 9A2057171F3B861400F6C293 /* TestDWARFCallFrameInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057131F3B860D00F6C293 /* TestDWARFCallFrameInfo.cpp */; };
- 9A2057181F3B861400F6C293 /* TestType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057141F3B860D00F6C293 /* TestType.cpp */; };
- 9A20571C1F3B867400F6C293 /* PlatformDarwinTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20571A1F3B866F00F6C293 /* PlatformDarwinTest.cpp */; };
+ 54067BF11DF2041B00749AA5 /* UBSanRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */; };
+ 2579065D1BD0488100178368 /* UDPSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2579065B1BD0488100178368 /* UDPSocket.cpp */; };
+ 49CA97001E6AACC900C03FEE /* UUID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 49CA96EA1E6AAC6600C03FEE /* UUID.cpp */; };
+ 268900CD13353E5F00698AC0 /* UniqueDWARFASTType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26B8B42312EEC52A00A831B2 /* UniqueDWARFASTType.cpp */; };
+ 2689010C13353E6F00698AC0 /* UnixSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C00987011500B4300F316B0 /* UnixSignals.cpp */; };
9A2057201F3B8D2500F6C293 /* UnixSignalsTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20571E1F3B8D2100F6C293 /* UnixSignalsTest.cpp */; };
- 9A2057281F3B8DDB00F6C293 /* TestELFHeader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057241F3B8DD200F6C293 /* TestELFHeader.cpp */; };
- 9A2057291F3B8DDB00F6C293 /* TestObjectFileELF.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057251F3B8DD200F6C293 /* TestObjectFileELF.cpp */; };
- 9A20572D1F3B8E6600F6C293 /* TestCompletion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */; };
- 9A2057381F3B8E7E00F6C293 /* FileSystemTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572E1F3B8E7600F6C293 /* FileSystemTest.cpp */; };
- 9A2057391F3B8E7E00F6C293 /* HostTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A20572F1F3B8E7600F6C293 /* HostTest.cpp */; };
- 9A20573A1F3B8E7E00F6C293 /* MainLoopTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */; };
- 9A22A161135E30370024DDC3 /* EmulateInstructionARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */; };
- 9A22A163135E30370024DDC3 /* EmulationStateARM.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A22A15F135E30370024DDC3 /* EmulationStateARM.cpp */; };
- 9A357583116CFDEE00E8ED2F /* SBValueList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A357582116CFDEE00E8ED2F /* SBValueList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A35758E116CFE0F00E8ED2F /* SBValueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */; };
- 9A357671116E7B5200E8ED2F /* SBStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A357670116E7B5200E8ED2F /* SBStringList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A357673116E7B6400E8ED2F /* SBStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A357672116E7B6400E8ED2F /* SBStringList.cpp */; };
- 9A3576A8116E9AB700E8ED2F /* SBHostOS.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A3576AA116E9AC700E8ED2F /* SBHostOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */; };
- 9A36D24D1EB3BE7F00AAD9EA /* SBTrace.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59581EB2B10D002206A5 /* SBTrace.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A36D24E1EB3BE7F00AAD9EA /* SBTraceOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 9A1E59591EB2B10D002206A5 /* SBTraceOptions.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9A3D43D61F3151C400EB767C /* ConstStringTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */; };
- 9A3D43D71F3151C400EB767C /* LogTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C71F3150D200EB767C /* LogTest.cpp */; };
- 9A3D43D81F3151C400EB767C /* NameMatchesTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */; };
- 9A3D43D91F3151C400EB767C /* StatusTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C61F3150D200EB767C /* StatusTest.cpp */; };
- 9A3D43DA1F3151C400EB767C /* StructuredDataTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CA1F3150D200EB767C /* StructuredDataTest.cpp */; };
- 9A3D43DB1F3151C400EB767C /* TildeExpressionResolverTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C91F3150D200EB767C /* TildeExpressionResolverTest.cpp */; };
- 9A3D43DC1F3151C400EB767C /* TimeoutTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43CC1F3150D200EB767C /* TimeoutTest.cpp */; };
- 9A3D43DD1F3151C400EB767C /* TimerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C51F3150D200EB767C /* TimerTest.cpp */; };
- 9A3D43EC1F3237F900EB767C /* ListenerTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E31F3237D500EB767C /* ListenerTest.cpp */; };
- 9A3D43ED1F3237F900EB767C /* StateTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E21F3237D500EB767C /* StateTest.cpp */; };
- 9A3D43EE1F3237F900EB767C /* StreamCallbackTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */; };
- 9A4F35101368A51A00823F52 /* StreamAsynchronousIO.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4F350F1368A51A00823F52 /* StreamAsynchronousIO.cpp */; };
- 9A77AD541E64E2760025CE04 /* RegisterInfoPOSIX_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A77AD501E64E24E0025CE04 /* RegisterInfoPOSIX_arm.cpp */; };
- 9AC7038E117674FB0086C050 /* SBInstruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038D117674EB0086C050 /* SBInstruction.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9AC70390117675270086C050 /* SBInstructionList.h in Headers */ = {isa = PBXBuildFile; fileRef = 9AC7038F117675270086C050 /* SBInstructionList.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 9AC703AF117675410086C050 /* SBInstruction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703AE117675410086C050 /* SBInstruction.cpp */; };
- 9AC703B1117675490086C050 /* SBInstructionList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AC703B0117675490086C050 /* SBInstructionList.cpp */; };
- 9AD9449F1E8DB26C004796ED /* RegisterContextNetBSD_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9AD9449B1E8DB267004796ED /* RegisterContextNetBSD_x86_64.cpp */; };
- A36FF33C17D8E94600244D40 /* OptionParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A36FF33B17D8E94600244D40 /* OptionParser.cpp */; };
- AE44FB301BB07EB20033EB62 /* GoUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2C1BB07DD80033EB62 /* GoUserExpression.cpp */; };
- AE44FB311BB07EB80033EB62 /* GoLexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2A1BB07DD80033EB62 /* GoLexer.cpp */; };
- AE44FB321BB07EBC0033EB62 /* GoParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB2B1BB07DD80033EB62 /* GoParser.cpp */; };
- AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */; };
- AE44FB471BB4BB090033EB62 /* GoLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB451BB4BB090033EB62 /* GoLanguage.cpp */; };
- AE44FB4C1BB4BB540033EB62 /* GoFormatterFunctions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE44FB4A1BB4BB540033EB62 /* GoFormatterFunctions.cpp */; };
- AE6897281B94F6DE0018845D /* DWARFASTParserGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */; };
- AE7F56291B8FE418001377A8 /* GoASTContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */; };
- AE8F624919EF3E1E00326B21 /* OperatingSystemGo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */; };
- AEB0E4591BD6E9F800B24093 /* LLVMUserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */; };
- AEEA34051AC88A7400AB639D /* TypeSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AEEA34041AC88A7400AB639D /* TypeSystem.cpp */; };
- AF061F87182C97ED00B6A19C /* RegisterContextHistory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF061F85182C97ED00B6A19C /* RegisterContextHistory.cpp */; };
- AF0C112818580CD800C4C45B /* QueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0C112718580CD800C4C45B /* QueueItem.cpp */; };
- AF0E22F018A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0E22EE18A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp */; };
- AF0EBBE8185940FB0059E52F /* SBQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE6185940FB0059E52F /* SBQueue.cpp */; };
- AF0EBBE9185940FB0059E52F /* SBQueueItem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */; };
- AF0EBBEC185941360059E52F /* SBQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEA185941360059E52F /* SBQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AF0EBBED185941360059E52F /* SBQueueItem.h in Headers */ = {isa = PBXBuildFile; fileRef = AF0EBBEB185941360059E52F /* SBQueueItem.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AF0F6E501739A76D009180FE /* RegisterContextKDP_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF0F6E4E1739A76D009180FE /* RegisterContextKDP_arm64.cpp */; };
- AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1729D4182C907200E0AB97 /* HistoryThread.cpp */; };
- AF1729D7182C907200E0AB97 /* HistoryUnwind.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp */; };
- AF1D88691B575E8D003CB899 /* ValueObjectConstResultCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF94726E1B575E430063D65C /* ValueObjectConstResultCast.cpp */; };
- AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */; };
- AF20F7661AF18F8500751A6E /* ABISysV_arm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */; };
- AF20F76A1AF18F9000751A6E /* ABISysV_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */; };
- AF235EB01FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF235EAE1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp */; };
- AF235EB11FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF235EAF1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h */; };
- AF235EB41FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF235EB21FBE7857009C5541 /* RegisterInfoPOSIX_ppc64le.h */; };
- AF235EB51FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF235EB31FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp */; };
- AF23B4DB19009C66003E2A58 /* FreeBSDSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp */; };
- AF248A4D1DA71C77000B814D /* TestArm64InstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF248A4C1DA71C77000B814D /* TestArm64InstEmulation.cpp */; };
- AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */; };
- AF25AB26188F685C0030DEC3 /* AppleGetQueuesHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF25AB24188F685C0030DEC3 /* AppleGetQueuesHandler.cpp */; };
- AF26703A1852D01E00B6CC36 /* Queue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2670381852D01E00B6CC36 /* Queue.cpp */; };
- AF26703B1852D01E00B6CC36 /* QueueList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2670391852D01E00B6CC36 /* QueueList.cpp */; };
- AF27AD551D3603EA00CF2833 /* DynamicLoaderDarwin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF27AD531D3603EA00CF2833 /* DynamicLoaderDarwin.cpp */; };
- AF27AD561D3603EA00CF2833 /* DynamicLoaderDarwin.h in Headers */ = {isa = PBXBuildFile; fileRef = AF27AD541D3603EA00CF2833 /* DynamicLoaderDarwin.h */; };
- AF2907BF1D3F082400E10654 /* DynamicLoaderMacOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2907BD1D3F082400E10654 /* DynamicLoaderMacOS.cpp */; };
+ 263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */; };
+ 264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */; };
+ 2692BA15136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2692BA13136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp */; };
+ 268900AF13353E5000698AC0 /* UnwindLLDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */; };
+ 268900B613353E5000698AC0 /* UnwindMacOSXFrameBackchain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26E3EEE311A9901300FBADB6 /* UnwindMacOSXFrameBackchain.cpp */; };
+ 268900E413353E6F00698AC0 /* UnwindPlan.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABB91235DE1600F93A47 /* UnwindPlan.cpp */; };
+ 268900E513353E6F00698AC0 /* UnwindTable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 961FABBA1235DE1600F93A47 /* UnwindTable.cpp */; };
AF2BA6EC1A707E3400C5248A /* UriParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 33064C991A5C7A330033D415 /* UriParser.cpp */; };
- AF2BCA6C18C7EFDE005B4526 /* JITLoaderGDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */; };
- AF2E02A31FA2CEAF00A86C34 /* ArchitectureArm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF2E02A11FA2CEAF00A86C34 /* ArchitectureArm.cpp */; };
- AF2E02A41FA2CEAF00A86C34 /* ArchitectureArm.h in Headers */ = {isa = PBXBuildFile; fileRef = AF2E02A21FA2CEAF00A86C34 /* ArchitectureArm.h */; };
- AF33B4BE1C1FA441001B28D9 /* NetBSDSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */; };
- AF33B4BF1C1FA441001B28D9 /* NetBSDSignals.h in Headers */ = {isa = PBXBuildFile; fileRef = AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */; };
- AF37E10A17C861F20061E18E /* ProcessRunLock.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF37E10917C861F20061E18E /* ProcessRunLock.cpp */; };
- AF3A4AD21EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */; };
- AF3A4AD31EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */; };
- AF415AE71D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF415AE51D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp */; };
- AF415AE81D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = AF415AE61D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h */; };
- AF45FDE518A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */; };
- AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp */; };
- AF6335E31C87B21E00F7D554 /* SymbolFilePDB.h in Headers */ = {isa = PBXBuildFile; fileRef = AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */; };
- AF6CA6661FBBAF28005A0DC3 /* ArchSpec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */; };
- AF6CA6681FBBAF37005A0DC3 /* ArchSpec.h in Headers */ = {isa = PBXBuildFile; fileRef = AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */; };
- AF77E08F1A033C700096C0EA /* ABISysV_ppc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */; };
- AF77E0931A033C7F0096C0EA /* ABISysV_ppc64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp */; };
- AF77E0A11A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09A1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp */; };
- AF77E0A41A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E09D1A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp */; };
- AF77E0A91A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF77E0A71A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp */; };
- AF81DEFA1828A23F0042CF19 /* SystemRuntime.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF81DEF91828A23F0042CF19 /* SystemRuntime.cpp */; };
- AF8AD62E1BEC28A400150209 /* PlatformAppleTVSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD62A1BEC28A400150209 /* PlatformAppleTVSimulator.cpp */; };
- AF8AD62F1BEC28A400150209 /* PlatformAppleTVSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD62B1BEC28A400150209 /* PlatformAppleTVSimulator.h */; };
- AF8AD6301BEC28A400150209 /* PlatformAppleWatchSimulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD62C1BEC28A400150209 /* PlatformAppleWatchSimulator.cpp */; };
- AF8AD6311BEC28A400150209 /* PlatformAppleWatchSimulator.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD62D1BEC28A400150209 /* PlatformAppleWatchSimulator.h */; };
- AF8AD6371BEC28C400150209 /* PlatformRemoteAppleTV.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD6331BEC28C400150209 /* PlatformRemoteAppleTV.cpp */; };
- AF8AD6381BEC28C400150209 /* PlatformRemoteAppleTV.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD6341BEC28C400150209 /* PlatformRemoteAppleTV.h */; };
- AF8AD6391BEC28C400150209 /* PlatformRemoteAppleWatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF8AD6351BEC28C400150209 /* PlatformRemoteAppleWatch.cpp */; };
- AF8AD63A1BEC28C400150209 /* PlatformRemoteAppleWatch.h in Headers */ = {isa = PBXBuildFile; fileRef = AF8AD6361BEC28C400150209 /* PlatformRemoteAppleWatch.h */; };
- AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = AF90106315AB7C5700FF120D /* lldb.1 */; };
- AF9107EE168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */; };
- AF9107EF168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */; };
- AF9113FD1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9113FB1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp */; };
- AF9113FE1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h in Headers */ = {isa = PBXBuildFile; fileRef = AF9113FC1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h */; };
- AF9B8F33182DB52900DA866F /* SystemRuntimeMacOSX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */; };
- AF9FF1F51FAA79A400474976 /* LibCxxTuple.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */; };
- AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */; };
- AFAFD80A1E57E1B90017A14F /* ModuleCacheTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */; };
- AFB3D2801AC262AB003B4B30 /* MICmdCmdGdbShow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */; };
- AFC234091AF85CE100CDE8B6 /* CommandObjectLanguage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */; };
- AFC2DCE71E6E2ED000283714 /* FastDemangle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */; };
- AFC2DCE91E6E2F2C00283714 /* Baton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCE81E6E2F2C00283714 /* Baton.cpp */; };
+ 23CB15351D66DA9300EDDDE1 /* UriParserTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2321F9461BDD346100BA9A93 /* UriParserTest.cpp */; };
+ 4C88BC2D1BA391B000AA0964 /* UserExpression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C0083331B9A5DE200D5CF24 /* UserExpression.cpp */; };
AFC2DCEB1E6E2F7D00283714 /* UserID.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCEA1E6E2F7D00283714 /* UserID.cpp */; };
+ 2689005413353E0400698AC0 /* UserSettingsController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A4633DC11F65D9A00955CE1 /* UserSettingsController.cpp */; };
+ 4C0083401B9F9BA900D5CF24 /* UtilityFunction.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp */; };
+ 2654A6901E552ED500DA1013 /* VASprintf.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2654A68F1E552ED500DA1013 /* VASprintf.cpp */; };
+ 9A2057031F3A605200F6C293 /* VASprintfTest.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */; };
AFC2DCF01E6E2FD200283714 /* VMRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCEF1E6E2FD200283714 /* VMRange.cpp */; };
- AFC2DCF31E6E30CF00283714 /* History.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCF21E6E30CF00283714 /* History.cpp */; };
- AFC2DCF61E6E316A00283714 /* StreamCallback.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCF51E6E316A00283714 /* StreamCallback.cpp */; };
- AFC2DCF91E6E318000283714 /* StreamGDBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC2DCF81E6E318000283714 /* StreamGDBRemote.cpp */; };
- AFC67B151FBBB03600860ECB /* LibCxxBitset.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFC67B141FBBB03500860ECB /* LibCxxBitset.cpp */; };
- AFCB2BBD1BF577F40018B553 /* PythonExceptionState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFCB2BBB1BF577F40018B553 /* PythonExceptionState.cpp */; };
- AFCB2BBE1BF577F40018B553 /* PythonExceptionState.h in Headers */ = {isa = PBXBuildFile; fileRef = AFCB2BBC1BF577F40018B553 /* PythonExceptionState.h */; };
- AFD65C811D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFD65C7F1D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp */; };
- AFD65C821D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h in Headers */ = {isa = PBXBuildFile; fileRef = AFD65C801D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h */; };
- AFDCDBCB19DD0F42005EA55E /* SBExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 940B02F419DC96CB00AD0F52 /* SBExecutionContext.h */; settings = {ATTRIBUTES = (Public, ); }; };
- AFDFDFD119E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFDFDFD019E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp */; };
- AFEC3362194A8ABA00FF05C6 /* StructuredData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp */; };
- AFEC5FD81D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC5FD51D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp */; };
- AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */; };
- AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */; };
- AFF8FF0C1E779D4B003830EF /* TildeExpressionResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFF8FF0B1E779D4B003830EF /* TildeExpressionResolver.cpp */; };
- B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */; };
- B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */; };
+ 2689005613353E0400698AC0 /* Value.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9910F1B85900F91463 /* Value.cpp */; };
+ 2689005713353E0400698AC0 /* ValueObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9A10F1B85900F91463 /* ValueObject.cpp */; };
+ 94094C6B163B6F840083A547 /* ValueObjectCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */; };
+ 2689005813353E0400698AC0 /* ValueObjectChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */; };
+ 2689005913353E0400698AC0 /* ValueObjectConstResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */; };
+ AF1D88691B575E8D003CB899 /* ValueObjectConstResultCast.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF94726E1B575E430063D65C /* ValueObjectConstResultCast.cpp */; };
+ 94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */; };
+ 949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */; };
+ 4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */; };
+ 2689005A13353E0400698AC0 /* ValueObjectList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9C10F1B85900F91463 /* ValueObjectList.cpp */; };
+ 4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */; };
+ 945215DF17F639EE00521C0B /* ValueObjectPrinter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */; };
+ 2689005B13353E0400698AC0 /* ValueObjectRegister.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */; };
+ 94B6E76213D88365005F417F /* ValueObjectSyntheticFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */; };
+ 2689005C13353E0400698AC0 /* ValueObjectVariable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E9D10F1B85900F91463 /* ValueObjectVariable.cpp */; };
+ 268900E613353E6F00698AC0 /* Variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2210F1B8EC00F91463 /* Variable.cpp */; };
+ 268900E713353E6F00698AC0 /* VariableList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7F2310F1B8EC00F91463 /* VariableList.cpp */; };
+ 9418EBCD1AA910910058B02E /* VectorType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9418EBCC1AA910910058B02E /* VectorType.cpp */; };
+ 494260DA14579144003C1C78 /* VerifyDecl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 494260D914579144003C1C78 /* VerifyDecl.cpp */; };
+ 2689001113353DB600698AC0 /* Watchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E1810F1B83100F91463 /* Watchpoint.cpp */; };
B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B27318411416AC12006039C8 /* WatchpointList.cpp */; };
- B28058A1139988B0002D96D0 /* InferiorCallPOSIX.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */; };
- B299580B14F2FA1400050A04 /* DisassemblerLLVMC.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */; };
- B2A58722143119810092BFBA /* SBWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = B2A58721143119810092BFBA /* SBWatchpoint.h */; settings = {ATTRIBUTES = (Public, ); }; };
- B2A58724143119D50092BFBA /* SBWatchpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2A58723143119D50092BFBA /* SBWatchpoint.cpp */; };
- B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */; };
B2B7CCF015D1C20F00EEFB57 /* WatchpointOptions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */; };
- D67521381EA17C4200439694 /* MainLoop.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D67521351EA17C3900439694 /* MainLoop.cpp */; };
+ 26C7C4831BFFEA7E009BD01F /* WindowsMiniDump.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp */; };
+ 26C7C4841BFFEA7E009BD01F /* WindowsMiniDump.h in Headers */ = {isa = PBXBuildFile; fileRef = 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h */; };
+ 267A48011B1411E40021A5BC /* XML.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 267A48001B1411E40021A5BC /* XML.cpp */; };
+ 940B04D91A8984FF0045D5F7 /* argdumper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 940B04D81A8984FF0045D5F7 /* argdumper.cpp */; };
+ 268648C516531BF800F04704 /* com.apple.debugserver.applist.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */; };
+ AFF87C8F150FF688000E1742 /* com.apple.debugserver.applist.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */; };
+ 268648C616531BF800F04704 /* com.apple.debugserver.internal.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */; };
+ AFF87C87150FF669000E1742 /* com.apple.debugserver.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */; };
+ 268648C416531BF800F04704 /* com.apple.debugserver.posix.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */; };
+ AF5CEC88206079A500384F20 /* com.apple.internal.xpc.remote.debugserver.plist in CopyFiles */ = {isa = PBXBuildFile; fileRef = AF5CEC87206079A500384F20 /* com.apple.internal.xpc.remote.debugserver.plist */; };
+ 26368AF7126B960500E8659F /* darwin-debug in Resources */ = {isa = PBXBuildFile; fileRef = 26579F68126A25920007C5CB /* darwin-debug */; };
+ 26368A3C126B697600E8659F /* darwin-debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26368A3B126B697600E8659F /* darwin-debug.cpp */; };
+ 262CFC7711A4510000946C6C /* debugserver in Resources */ = {isa = PBXBuildFile; fileRef = 26CE05A0115C31E50022F371 /* debugserver */; };
+ 23CB154B1D66DA9300EDDDE1 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4C1BDD684B00A5CEAC /* libedit.dylib */; };
+ 2656BBC31AE0739C00441749 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
+ 26CEB5EF18761CB2008F575A /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
+ 26CFDCA818616473000E63E5 /* libedit.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32A10F3DFDD009D5894 /* libedit.dylib */; };
+ 23CB154E1D66DA9300EDDDE1 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
+ 2606EDDF184E68A10034641B /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
+ 268901161335BBC300698AC0 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
+ 942829CC1A89839300521B30 /* liblldb-core.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2689FFCA13353D7A00698AC0 /* liblldb-core.a */; };
+ 239481861C59EBDD00DF7168 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 239481851C59EBDD00DF7168 /* libncurses.dylib */; };
+ 23CB154D1D66DA9300EDDDE1 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF471BDD67C100A5CEAC /* libncurses.dylib */; };
+ 2656BBC41AE073A800441749 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
+ 2670F8121862B44A006B332C /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
+ 26780C611867C33D00234593 /* libncurses.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2670F8111862B44A006B332C /* libncurses.dylib */; };
+ 26680233115FD1A7008E1FE4 /* libobjc.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C37410F3F61B009D5894 /* libobjc.dylib */; };
+ 23CB154A1D66DA9300EDDDE1 /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4E1BDD687800A5CEAC /* libpanel.dylib */; };
+ 260157C61885F51C00F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
+ 260157C81885F53100F875CF /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
+ 2656BBC51AE073AD00441749 /* libpanel.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 260157C41885F4FF00F875CF /* libpanel.dylib */; };
+ 26F5C32D10F3DFDD009D5894 /* libtermcap.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */; };
+ 23CB15491D66DA9300EDDDE1 /* libxml2.2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 23CB14E31D66CA2200EDDDE1 /* libxml2.2.dylib */; };
+ 26D55235159A7DB100708D8D /* libxml2.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 26D55234159A7DB100708D8D /* libxml2.dylib */; };
+ 23CB154C1D66DA9300EDDDE1 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 2326CF4A1BDD681800A5CEAC /* libz.dylib */; };
+ 2656BBC61AE073B500441749 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
+ 966C6B7918E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
+ 966C6B7A18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
+ 966C6B7C18E6A56A0093F5EC /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 966C6B7818E6A56A0093F5EC /* libz.dylib */; };
+ 940B04E41A8987680045D5F7 /* lldb-argdumper in CopyFiles */ = {isa = PBXBuildFile; fileRef = 942829C01A89835300521B30 /* lldb-argdumper */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
+ 2668020E115FD12C008E1FE4 /* lldb-defines.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 2668020F115FD12C008E1FE4 /* lldb-enumerations.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 26DE1E6C11616C2E00A093E2 /* lldb-forward.h in Headers */ = {isa = PBXBuildFile; fileRef = 26DE1E6A11616C2E00A093E2 /* lldb-forward.h */; settings = {ATTRIBUTES = (Public, ); }; };
E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */; };
+ 26DC6A1D1337FECA00FF7998 /* lldb-platform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */; };
+ 26D265BC136B4269002EEE45 /* lldb-public.h in Headers */ = {isa = PBXBuildFile; fileRef = 26651A14133BEC76005B64B7 /* lldb-public.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 94E829CA152D33C1006F96A3 /* lldb-server in Resources */ = {isa = PBXBuildFile; fileRef = 26DC6A101337FE6900FF7998 /* lldb-server */; };
E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E769331D1A94D18100C73337 /* lldb-server.cpp */; };
- E7723D441AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7723D421AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp */; };
- E7723D4C1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E7723D4A1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp */; };
- E778E9A21B062D1700247609 /* EmulateInstructionMIPS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E778E99F1B062D1700247609 /* EmulateInstructionMIPS.cpp */; };
- E7E94ABC1B54961F00D0AE30 /* GDBRemoteSignals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */; };
- EB8375E71B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EB8375E61B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp */; };
+ 26680214115FD12C008E1FE4 /* lldb-types.h in Headers */ = {isa = PBXBuildFile; fileRef = 26BC7C2910F1B3BC00F91463 /* lldb-types.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 94145431175E63B500284436 /* lldb-versioning.h in Headers */ = {isa = PBXBuildFile; fileRef = 94145430175D7FDE00284436 /* lldb-versioning.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = AF90106315AB7C5700FF120D /* lldb.1 */; };
+ 2689FFDA13353D9D00698AC0 /* lldb.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26BC7E7410F1B85900F91463 /* lldb.cpp */; };
+ AF415AE71D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF415AE51D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp */; };
+ AF415AE81D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h in Headers */ = {isa = PBXBuildFile; fileRef = AF415AE61D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@@ -1191,6 +1218,13 @@
remoteGlobalIDString = 26DC6A0F1337FE6900FF7998;
remoteInfo = "lldb-server";
};
+ AFA9B71320606A13008E86C6 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */;
+ proxyType = 1;
+ remoteGlobalIDString = 456F67431AD46CE9002850C2;
+ remoteInfo = "debugserver-mini";
+ };
AFCA21D11D18E556004386B8 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */;
@@ -1245,12 +1279,20 @@
dstPath = "$(DEVELOPER_INSTALL_DIR)/usr/share/man/man1";
dstSubfolderSpec = 0;
files = (
- 9A20570F1F3B821A00F6C293 /* test-dwarf.cpp in CopyFiles */,
- 9A2057101F3B821A00F6C293 /* test-dwarf.exe in CopyFiles */,
AF90106515AB7D3600FF120D /* lldb.1 in CopyFiles */,
);
runOnlyForDeploymentPostprocessing = 1;
};
+ AFA9B71820606A13008E86C6 /* CopyFiles */ = {
+ isa = PBXCopyFilesBuildPhase;
+ buildActionMask = 8;
+ dstPath = /AppleInternal/Library/LaunchDaemons;
+ dstSubfolderSpec = 0;
+ files = (
+ AF5CEC88206079A500384F20 /* com.apple.internal.xpc.remote.debugserver.plist in CopyFiles */,
+ );
+ runOnlyForDeploymentPostprocessing = 1;
+ };
AFF87C85150FF5CC000E1742 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 8;
@@ -1268,221 +1310,370 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
- 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformKalimba.cpp; sourceTree = "<group>"; };
- 23042D111976CA0A00621B2C /* PlatformKalimba.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformKalimba.h; sourceTree = "<group>"; };
- 23059A0519532B96007B8189 /* LinuxSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LinuxSignals.cpp; path = Utility/LinuxSignals.cpp; sourceTree = "<group>"; };
- 23059A0619532B96007B8189 /* LinuxSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LinuxSignals.h; path = Utility/LinuxSignals.h; sourceTree = "<group>"; };
- 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBUnixSignals.cpp; path = source/API/SBUnixSignals.cpp; sourceTree = "<group>"; };
- 23059A111958B37B007B8189 /* SBUnixSignals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBUnixSignals.h; path = include/lldb/API/SBUnixSignals.h; sourceTree = "<group>"; };
+ 497E7B9D1188F6690065CCA1 /* ABI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABI.cpp; path = source/Target/ABI.cpp; sourceTree = "<group>"; };
+ 497E7B331188ED300065CCA1 /* ABI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABI.h; path = include/lldb/Target/ABI.h; sourceTree = "<group>"; };
+ 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm.cpp; sourceTree = "<group>"; };
+ 26DB3E081379E7AD0080DC73 /* ABIMacOSX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm.h; sourceTree = "<group>"; };
+ 26DB3E0B1379E7AD0080DC73 /* ABIMacOSX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm64.cpp; sourceTree = "<group>"; };
+ 26DB3E0C1379E7AD0080DC73 /* ABIMacOSX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm64.h; sourceTree = "<group>"; };
+ 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_i386.cpp; sourceTree = "<group>"; };
+ 26DB3E101379E7AD0080DC73 /* ABIMacOSX_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_i386.h; sourceTree = "<group>"; };
+ AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_arm.cpp; path = "SysV-arm/ABISysV_arm.cpp"; sourceTree = "<group>"; };
+ AF20F7651AF18F8500751A6E /* ABISysV_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_arm.h; path = "SysV-arm/ABISysV_arm.h"; sourceTree = "<group>"; };
+ AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_arm64.cpp; path = "SysV-arm64/ABISysV_arm64.cpp"; sourceTree = "<group>"; };
+ AF20F7691AF18F9000751A6E /* ABISysV_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_arm64.h; path = "SysV-arm64/ABISysV_arm64.h"; sourceTree = "<group>"; };
+ 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_hexagon.cpp; sourceTree = "<group>"; };
+ 26BF51EB1B3C754400016294 /* ABISysV_hexagon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_hexagon.h; sourceTree = "<group>"; };
+ 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_i386.cpp; sourceTree = "<group>"; };
+ 26BF51F01B3C754400016294 /* ABISysV_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_i386.h; sourceTree = "<group>"; };
+ 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_mips.cpp; path = "SysV-mips/ABISysV_mips.cpp"; sourceTree = "<group>"; };
+ 9694FA701B32AA64005EBB16 /* ABISysV_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_mips.h; path = "SysV-mips/ABISysV_mips.h"; sourceTree = "<group>"; };
+ 263641151B34AEE200145B2F /* ABISysV_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_mips64.cpp; sourceTree = "<group>"; };
+ 263641161B34AEE200145B2F /* ABISysV_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_mips64.h; sourceTree = "<group>"; };
+ AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_ppc.cpp; path = "SysV-ppc/ABISysV_ppc.cpp"; sourceTree = "<group>"; };
+ AF77E08E1A033C700096C0EA /* ABISysV_ppc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_ppc.h; path = "SysV-ppc/ABISysV_ppc.h"; sourceTree = "<group>"; };
+ AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_ppc64.cpp; path = "SysV-ppc64/ABISysV_ppc64.cpp"; sourceTree = "<group>"; };
+ AF77E0921A033C7F0096C0EA /* ABISysV_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_ppc64.h; path = "SysV-ppc64/ABISysV_ppc64.h"; sourceTree = "<group>"; };
+ 267F68471CC02DED0086832B /* ABISysV_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_s390x.cpp; sourceTree = "<group>"; };
+ 267F68481CC02DED0086832B /* ABISysV_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_s390x.h; sourceTree = "<group>"; };
+ 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_x86_64.cpp; sourceTree = "<group>"; };
+ 26DB3E141379E7AD0080DC73 /* ABISysV_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_x86_64.h; sourceTree = "<group>"; };
+ 264A12FF137252C700875C42 /* ARM64_DWARF_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM64_DWARF_Registers.h; path = source/Utility/ARM64_DWARF_Registers.h; sourceTree = "<group>"; };
+ B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMDefines.h; path = Utility/ARMDefines.h; sourceTree = "<group>"; };
+ B23DD24F12EDFAC1000C3894 /* ARMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMUtils.h; path = Utility/ARMUtils.h; sourceTree = "<group>"; };
+ 26F996A7119B79C300412154 /* ARM_DWARF_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM_DWARF_Registers.h; path = source/Utility/ARM_DWARF_Registers.h; sourceTree = "<group>"; };
+ 4906FD4012F2255300A2A77C /* ASTDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTDumper.cpp; path = ExpressionParser/Clang/ASTDumper.cpp; sourceTree = "<group>"; };
+ 4906FD4412F2257600A2A77C /* ASTDumper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTDumper.h; path = ExpressionParser/Clang/ASTDumper.h; sourceTree = "<group>"; };
+ 49A8A39F11D568A300AD3B68 /* ASTResultSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTResultSynthesizer.cpp; path = ExpressionParser/Clang/ASTResultSynthesizer.cpp; sourceTree = "<group>"; };
+ 49A8A3A311D568BF00AD3B68 /* ASTResultSynthesizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTResultSynthesizer.h; path = ExpressionParser/Clang/ASTResultSynthesizer.h; sourceTree = "<group>"; };
+ 491193501226386000578B7F /* ASTStructExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTStructExtractor.cpp; path = ExpressionParser/Clang/ASTStructExtractor.cpp; sourceTree = "<group>"; };
+ 4911934B1226383D00578B7F /* ASTStructExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTStructExtractor.h; path = ExpressionParser/Clang/ASTStructExtractor.h; sourceTree = "<group>"; };
+ 8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASanRuntime.cpp; sourceTree = "<group>"; };
+ 8CF02AE619DCBF8400B14BE0 /* ASanRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASanRuntime.h; sourceTree = "<group>"; };
+ 257906621BD5AFD000178368 /* Acceptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Acceptor.cpp; path = "tools/lldb-server/Acceptor.cpp"; sourceTree = "<group>"; };
+ 257906631BD5AFD000178368 /* Acceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Acceptor.h; path = "tools/lldb-server/Acceptor.h"; sourceTree = "<group>"; };
+ 25EF23751AC09AD800908DF0 /* AdbClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AdbClient.cpp; sourceTree = "<group>"; };
+ 25EF23761AC09AD800908DF0 /* AdbClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdbClient.h; sourceTree = "<group>"; };
+ 236102981CF38A2B00B8E0B9 /* AddLLDB.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AddLLDB.cmake; sourceTree = "<group>"; };
+ 26BC7E6910F1B85900F91463 /* Address.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Address.cpp; path = source/Core/Address.cpp; sourceTree = "<group>"; };
+ 26BC7D5010F1B77400F91463 /* Address.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Address.h; path = include/lldb/Core/Address.h; sourceTree = "<group>"; };
+ 26BC7E6A10F1B85900F91463 /* AddressRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressRange.cpp; path = source/Core/AddressRange.cpp; sourceTree = "<group>"; };
+ 26BC7D5110F1B77400F91463 /* AddressRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressRange.h; path = include/lldb/Core/AddressRange.h; sourceTree = "<group>"; };
+ 9AC7034011752C6B0086C050 /* AddressResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolver.cpp; path = source/Core/AddressResolver.cpp; sourceTree = "<group>"; };
+ 9AC7033E11752C540086C050 /* AddressResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolver.h; path = include/lldb/Core/AddressResolver.h; sourceTree = "<group>"; };
+ 9AC7034211752C720086C050 /* AddressResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolverFileLine.cpp; path = source/Core/AddressResolverFileLine.cpp; sourceTree = "<group>"; };
+ 9AC7033D11752C4C0086C050 /* AddressResolverFileLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolverFileLine.h; path = include/lldb/Core/AddressResolverFileLine.h; sourceTree = "<group>"; };
+ 9AC7034411752C790086C050 /* AddressResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolverName.cpp; path = source/Core/AddressResolverName.cpp; sourceTree = "<group>"; };
+ 9AC7033F11752C590086C050 /* AddressResolverName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolverName.h; path = include/lldb/Core/AddressResolverName.h; sourceTree = "<group>"; };
+ 2361029E1CF38A3500B8E0B9 /* Android.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Android.cmake; sourceTree = "<group>"; };
+ 6D55BAE21A8CD06000A70529 /* Android.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Android.h; path = include/lldb/Host/android/Android.h; sourceTree = "<group>"; };
+ 26CF992414428766001E4138 /* AnsiTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnsiTerminal.h; path = include/lldb/Utility/AnsiTerminal.h; sourceTree = "<group>"; };
+ 4CD44CFA20B37C440003557C /* AppleDWARFIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleDWARFIndex.cpp; sourceTree = "<group>"; };
+ 4CD44CFF20B37C580003557C /* AppleDWARFIndex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleDWARFIndex.h; sourceTree = "<group>"; };
+ AF0E22EE18A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetItemInfoHandler.cpp; sourceTree = "<group>"; };
+ AF0E22EF18A09FB20009B7D1 /* AppleGetItemInfoHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetItemInfoHandler.h; sourceTree = "<group>"; };
+ AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetPendingItemsHandler.cpp; sourceTree = "<group>"; };
+ AF1F7B06189C904B0087DB9C /* AppleGetPendingItemsHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetPendingItemsHandler.h; sourceTree = "<group>"; };
+ AF25AB24188F685C0030DEC3 /* AppleGetQueuesHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetQueuesHandler.cpp; sourceTree = "<group>"; };
+ AF25AB25188F685C0030DEC3 /* AppleGetQueuesHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetQueuesHandler.h; sourceTree = "<group>"; };
+ AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetThreadItemInfoHandler.cpp; sourceTree = "<group>"; };
+ AF45FDE418A1F3AC0007051C /* AppleGetThreadItemInfoHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetThreadItemInfoHandler.h; sourceTree = "<group>"; };
+ 94CD7D0819A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCClassDescriptorV2.cpp; sourceTree = "<group>"; };
+ 94CD7D0719A3FB8600908B7C /* AppleObjCClassDescriptorV2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCClassDescriptorV2.h; sourceTree = "<group>"; };
+ 49DA65021485C92A005FF180 /* AppleObjCDeclVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCDeclVendor.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 49DA65041485C942005FF180 /* AppleObjCDeclVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCDeclVendor.h; sourceTree = "<group>"; };
+ 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCRuntime.cpp; sourceTree = "<group>"; };
+ 4CCA644313B40B82003BDF98 /* AppleObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCRuntime.h; sourceTree = "<group>"; };
+ 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCRuntimeV1.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 4CCA644513B40B82003BDF98 /* AppleObjCRuntimeV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AppleObjCRuntimeV1.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+ 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCRuntimeV2.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 4CCA644713B40B82003BDF98 /* AppleObjCRuntimeV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AppleObjCRuntimeV2.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+ 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCTrampolineHandler.cpp; sourceTree = "<group>"; };
+ 4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCTrampolineHandler.h; sourceTree = "<group>"; };
+ 94CD7D0B19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCTypeEncodingParser.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 94CD7D0A19A3FBC300908B7C /* AppleObjCTypeEncodingParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCTypeEncodingParser.h; sourceTree = "<group>"; };
+ 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleThreadPlanStepThroughObjCTrampoline.cpp; sourceTree = "<group>"; };
+ 4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = "<group>"; };
+ AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArchSpec.cpp; path = source/Utility/ArchSpec.cpp; sourceTree = "<group>"; };
+ AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArchSpec.h; path = include/lldb/Utility/ArchSpec.h; sourceTree = "<group>"; };
+ 23E2E5161D903689006F38BB /* ArchSpecTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchSpecTest.cpp; sourceTree = "<group>"; };
+ AF2E02A11FA2CEAF00A86C34 /* ArchitectureArm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchitectureArm.cpp; sourceTree = "<group>"; };
+ AF2E02A21FA2CEAF00A86C34 /* ArchitectureArm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitectureArm.h; sourceTree = "<group>"; };
+ 4C14CEF82057258D00DEEF94 /* ArchitecturePPC64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchitecturePPC64.cpp; sourceTree = "<group>"; };
+ 4C14CEF72057258D00DEEF94 /* ArchitecturePPC64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitecturePPC64.h; sourceTree = "<group>"; };
+ 26BC7E6C10F1B85900F91463 /* Args.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Args.cpp; path = source/Utility/Args.cpp; sourceTree = "<group>"; };
+ 26BC7D5310F1B77400F91463 /* Args.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Args.h; path = include/lldb/Utility/Args.h; sourceTree = "<group>"; };
+ 2321F93E1BDD33CE00BA9A93 /* ArgsTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ArgsTest.cpp; path = ../Utility/ArgsTest.cpp; sourceTree = "<group>"; };
+ 6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmUnwindInfo.cpp; path = source/Symbol/ArmUnwindInfo.cpp; sourceTree = "<group>"; };
+ 6D99A3611BBC2F1600979793 /* ArmUnwindInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ArmUnwindInfo.h; path = include/lldb/Symbol/ArmUnwindInfo.h; sourceTree = "<group>"; };
+ 3FDFE54719A2946B009756A7 /* AutoHandle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AutoHandle.h; path = include/lldb/Host/windows/AutoHandle.h; sourceTree = "<group>"; };
+ 26FFC19314FC072100087D58 /* AuxVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuxVector.cpp; sourceTree = "<group>"; };
+ 26FFC19414FC072100087D58 /* AuxVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuxVector.h; sourceTree = "<group>"; };
+ AFC2DCE81E6E2F2C00283714 /* Baton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Baton.cpp; path = source/Utility/Baton.cpp; sourceTree = "<group>"; };
+ AFC2DCEE1E6E2FA300283714 /* Baton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Baton.h; path = include/lldb/Utility/Baton.h; sourceTree = "<group>"; };
+ 26BC7F1310F1B8EC00F91463 /* Block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Block.cpp; path = source/Symbol/Block.cpp; sourceTree = "<group>"; };
+ 26BC7C5510F1B6E900F91463 /* Block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Block.h; path = include/lldb/Symbol/Block.h; sourceTree = "<group>"; };
+ 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlockPointer.cpp; path = Language/CPlusPlus/BlockPointer.cpp; sourceTree = "<group>"; };
+ 49DEF1201CD7BD90006A7C7D /* BlockPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlockPointer.h; path = Language/CPlusPlus/BlockPointer.h; sourceTree = "<group>"; };
+ 26BC7E0A10F1B83100F91463 /* Breakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Breakpoint.cpp; path = source/Breakpoint/Breakpoint.cpp; sourceTree = "<group>"; };
+ 26BC7CEE10F1B71400F91463 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpoint.h; path = include/lldb/Breakpoint/Breakpoint.h; sourceTree = "<group>"; };
+ 26BC7E0B10F1B83100F91463 /* BreakpointID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointID.cpp; path = source/Breakpoint/BreakpointID.cpp; sourceTree = "<group>"; };
+ 26BC7CEF10F1B71400F91463 /* BreakpointID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointID.h; path = include/lldb/Breakpoint/BreakpointID.h; sourceTree = "<group>"; };
+ 26BC7E0C10F1B83100F91463 /* BreakpointIDList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointIDList.cpp; path = source/Breakpoint/BreakpointIDList.cpp; sourceTree = "<group>"; };
+ 26BC7CF010F1B71400F91463 /* BreakpointIDList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointIDList.h; path = include/lldb/Breakpoint/BreakpointIDList.h; sourceTree = "<group>"; };
+ 23E2E52D1D90382B006F38BB /* BreakpointIDTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BreakpointIDTest.cpp; sourceTree = "<group>"; };
+ 26BC7E0D10F1B83100F91463 /* BreakpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointList.cpp; path = source/Breakpoint/BreakpointList.cpp; sourceTree = "<group>"; };
+ 26BC7CF110F1B71400F91463 /* BreakpointList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointList.h; path = include/lldb/Breakpoint/BreakpointList.h; sourceTree = "<group>"; };
+ 26BC7E0E10F1B83100F91463 /* BreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocation.cpp; path = source/Breakpoint/BreakpointLocation.cpp; sourceTree = "<group>"; };
+ 26BC7CF210F1B71400F91463 /* BreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocation.h; path = include/lldb/Breakpoint/BreakpointLocation.h; sourceTree = "<group>"; };
+ 26BC7E0F10F1B83100F91463 /* BreakpointLocationCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocationCollection.cpp; path = source/Breakpoint/BreakpointLocationCollection.cpp; sourceTree = "<group>"; };
+ 26BC7CF310F1B71400F91463 /* BreakpointLocationCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocationCollection.h; path = include/lldb/Breakpoint/BreakpointLocationCollection.h; sourceTree = "<group>"; };
+ 26BC7E1010F1B83100F91463 /* BreakpointLocationList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocationList.cpp; path = source/Breakpoint/BreakpointLocationList.cpp; sourceTree = "<group>"; };
+ 26BC7CF410F1B71400F91463 /* BreakpointLocationList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocationList.h; path = include/lldb/Breakpoint/BreakpointLocationList.h; sourceTree = "<group>"; };
+ 4C7D48281F509CCD005314B4 /* BreakpointName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointName.cpp; path = source/Breakpoint/BreakpointName.cpp; sourceTree = "<group>"; };
+ 4C7D482B1F509CF5005314B4 /* BreakpointName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointName.h; path = include/lldb/Breakpoint/BreakpointName.h; sourceTree = "<group>"; };
+ 26BC7E1110F1B83100F91463 /* BreakpointOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointOptions.cpp; path = source/Breakpoint/BreakpointOptions.cpp; sourceTree = "<group>"; };
+ 26BC7CF510F1B71400F91463 /* BreakpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointOptions.h; path = include/lldb/Breakpoint/BreakpointOptions.h; sourceTree = "<group>"; };
+ 26BC7E1210F1B83100F91463 /* BreakpointResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolver.cpp; path = source/Breakpoint/BreakpointResolver.cpp; sourceTree = "<group>"; };
+ 26BC7CF610F1B71400F91463 /* BreakpointResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolver.h; path = include/lldb/Breakpoint/BreakpointResolver.h; sourceTree = "<group>"; };
+ 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverAddress.cpp; path = source/Breakpoint/BreakpointResolverAddress.cpp; sourceTree = "<group>"; };
+ 26D0DD5010FE554D00271C65 /* BreakpointResolverAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverAddress.h; path = include/lldb/Breakpoint/BreakpointResolverAddress.h; sourceTree = "<group>"; };
+ 26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileLine.cpp; path = source/Breakpoint/BreakpointResolverFileLine.cpp; sourceTree = "<group>"; };
+ 26D0DD5110FE554D00271C65 /* BreakpointResolverFileLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileLine.h; path = include/lldb/Breakpoint/BreakpointResolverFileLine.h; sourceTree = "<group>"; };
+ 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileRegex.cpp; path = source/Breakpoint/BreakpointResolverFileRegex.cpp; sourceTree = "<group>"; };
+ 4CAA56121422D96A001FFA01 /* BreakpointResolverFileRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileRegex.h; path = include/lldb/Breakpoint/BreakpointResolverFileRegex.h; sourceTree = "<group>"; };
+ 26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverName.cpp; path = source/Breakpoint/BreakpointResolverName.cpp; sourceTree = "<group>"; };
+ 26D0DD5210FE554D00271C65 /* BreakpointResolverName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverName.h; path = include/lldb/Breakpoint/BreakpointResolverName.h; sourceTree = "<group>"; };
+ 26BC7E1310F1B83100F91463 /* BreakpointSite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointSite.cpp; path = source/Breakpoint/BreakpointSite.cpp; sourceTree = "<group>"; };
+ 26BC7CF710F1B71400F91463 /* BreakpointSite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointSite.h; path = include/lldb/Breakpoint/BreakpointSite.h; sourceTree = "<group>"; };
+ 26BC7E1410F1B83100F91463 /* BreakpointSiteList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointSiteList.cpp; path = source/Breakpoint/BreakpointSiteList.cpp; sourceTree = "<group>"; };
+ 26BC7CF810F1B71400F91463 /* BreakpointSiteList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointSiteList.h; path = include/lldb/Breakpoint/BreakpointSiteList.h; sourceTree = "<group>"; };
+ 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Broadcaster.cpp; path = source/Core/Broadcaster.cpp; sourceTree = "<group>"; };
+ 26BC7D5410F1B77400F91463 /* Broadcaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Broadcaster.h; path = include/lldb/Core/Broadcaster.h; sourceTree = "<group>"; };
+ 23CB14E61D66CC0E00EDDDE1 /* BroadcasterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BroadcasterTest.cpp; sourceTree = "<group>"; };
+ 949EEDAC1BA76719008C63CF /* CF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CF.cpp; path = Language/ObjC/CF.cpp; sourceTree = "<group>"; };
+ 949EEDAD1BA76719008C63CF /* CF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CF.h; path = Language/ObjC/CF.h; sourceTree = "<group>"; };
+ 26BC7EED10F1B8AD00F91463 /* CFCBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCBundle.cpp; path = source/Host/macosx/cfcpp/CFCBundle.cpp; sourceTree = "<group>"; };
+ 26BC7EEE10F1B8AD00F91463 /* CFCBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCBundle.h; path = source/Host/macosx/cfcpp/CFCBundle.h; sourceTree = "<group>"; };
+ 26BC7EEF10F1B8AD00F91463 /* CFCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCData.cpp; path = source/Host/macosx/cfcpp/CFCData.cpp; sourceTree = "<group>"; };
+ 26BC7EF010F1B8AD00F91463 /* CFCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCData.h; path = source/Host/macosx/cfcpp/CFCData.h; sourceTree = "<group>"; };
+ 26BC7EF110F1B8AD00F91463 /* CFCMutableArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableArray.cpp; path = source/Host/macosx/cfcpp/CFCMutableArray.cpp; sourceTree = "<group>"; };
+ 26BC7EF210F1B8AD00F91463 /* CFCMutableArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableArray.h; path = source/Host/macosx/cfcpp/CFCMutableArray.h; sourceTree = "<group>"; };
+ 26BC7EF310F1B8AD00F91463 /* CFCMutableDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableDictionary.cpp; path = source/Host/macosx/cfcpp/CFCMutableDictionary.cpp; sourceTree = "<group>"; };
+ 26BC7EF410F1B8AD00F91463 /* CFCMutableDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableDictionary.h; path = source/Host/macosx/cfcpp/CFCMutableDictionary.h; sourceTree = "<group>"; };
+ 26BC7EF510F1B8AD00F91463 /* CFCMutableSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableSet.cpp; path = source/Host/macosx/cfcpp/CFCMutableSet.cpp; sourceTree = "<group>"; };
+ 26BC7EF610F1B8AD00F91463 /* CFCMutableSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableSet.h; path = source/Host/macosx/cfcpp/CFCMutableSet.h; sourceTree = "<group>"; };
+ 26BC7EF710F1B8AD00F91463 /* CFCReleaser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCReleaser.h; path = source/Host/macosx/cfcpp/CFCReleaser.h; sourceTree = "<group>"; };
+ 26BC7EF810F1B8AD00F91463 /* CFCString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCString.cpp; path = source/Host/macosx/cfcpp/CFCString.cpp; sourceTree = "<group>"; };
+ 26BC7EF910F1B8AD00F91463 /* CFCString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCString.h; path = source/Host/macosx/cfcpp/CFCString.h; sourceTree = "<group>"; };
230EC4571D63C3A7008DF59F /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = source/Target/CMakeLists.txt; sourceTree = "<group>"; };
- 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallOnFunctionExit.cpp; path = source/Target/ThreadPlanCallOnFunctionExit.cpp; sourceTree = "<group>"; };
- 23173F8B192BA93F005C708F /* lldb-x86-register-enums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-x86-register-enums.h"; path = "Utility/lldb-x86-register-enums.h"; sourceTree = "<group>"; };
2321F9381BDD332400BA9A93 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2321F9391BDD332400BA9A93 /* SocketAddressTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SocketAddressTest.cpp; sourceTree = "<group>"; };
- 2321F93A1BDD332400BA9A93 /* SocketTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SocketTest.cpp; sourceTree = "<group>"; };
- 2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolsTest.cpp; sourceTree = "<group>"; };
2321F93D1BDD33CE00BA9A93 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2321F93E1BDD33CE00BA9A93 /* TestArgs.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestArgs.cpp; sourceTree = "<group>"; };
2321F9401BDD340D00BA9A93 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
2321F9431BDD346100BA9A93 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringExtractorTest.cpp; sourceTree = "<group>"; };
- 2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TaskPoolTest.cpp; sourceTree = "<group>"; };
- 2321F9461BDD346100BA9A93 /* UriParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UriParserTest.cpp; sourceTree = "<group>"; };
2321F94C1BDD360F00BA9A93 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2321F94D1BDD360F00BA9A93 /* PythonDataObjectsTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonDataObjectsTests.cpp; sourceTree = "<group>"; };
- 2326CF3F1BDD613E00A5CEAC /* Python.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Python.framework; path = System/Library/Frameworks/Python.framework; sourceTree = SDKROOT; };
- 2326CF451BDD647400A5CEAC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 2326CF471BDD67C100A5CEAC /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = ../../../../../../usr/lib/libncurses.dylib; sourceTree = "<group>"; };
- 2326CF4A1BDD681800A5CEAC /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = ../../../../../../usr/lib/libz.dylib; sourceTree = "<group>"; };
- 2326CF4C1BDD684B00A5CEAC /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = ../../../../../../usr/lib/libedit.dylib; sourceTree = "<group>"; };
- 2326CF4E1BDD687800A5CEAC /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = ../../../../../../usr/lib/libpanel.dylib; sourceTree = "<group>"; };
- 2326CF511BDD693B00A5CEAC /* EditlineTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditlineTest.cpp; sourceTree = "<group>"; };
- 232CB60B191E00CC00EF39FC /* NativeBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeBreakpoint.cpp; path = source/Host/common/NativeBreakpoint.cpp; sourceTree = "<group>"; };
- 232CB60D191E00CC00EF39FC /* NativeBreakpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeBreakpointList.cpp; path = source/Host/common/NativeBreakpointList.cpp; sourceTree = "<group>"; };
- 232CB60F191E00CC00EF39FC /* NativeProcessProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = NativeProcessProtocol.cpp; path = source/Host/common/NativeProcessProtocol.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 232CB611191E00CC00EF39FC /* NativeThreadProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeThreadProtocol.cpp; path = source/Host/common/NativeThreadProtocol.cpp; sourceTree = "<group>"; };
- 232CB613191E00CC00EF39FC /* SoftwareBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SoftwareBreakpoint.cpp; path = source/Host/common/SoftwareBreakpoint.cpp; sourceTree = "<group>"; };
- 233B007919609DB40090E598 /* ProcessLaunchInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessLaunchInfo.h; path = include/lldb/Target/ProcessLaunchInfo.h; sourceTree = "<group>"; };
- 233B007A1960A0440090E598 /* ProcessInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessInfo.h; path = include/lldb/Target/ProcessInfo.h; sourceTree = "<group>"; };
- 233B007B1960C9E60090E598 /* ProcessInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessInfo.cpp; path = source/Target/ProcessInfo.cpp; sourceTree = "<group>"; };
- 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessLaunchInfo.cpp; path = source/Target/ProcessLaunchInfo.cpp; sourceTree = "<group>"; };
- 233B009D19610D6B0090E598 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
- 2360092C193FB21500189DB1 /* MemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemoryRegionInfo.h; path = include/lldb/Target/MemoryRegionInfo.h; sourceTree = "<group>"; };
- 236102981CF38A2B00B8E0B9 /* AddLLDB.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AddLLDB.cmake; sourceTree = "<group>"; };
- 236102991CF38A2B00B8E0B9 /* LLDBConfig.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LLDBConfig.cmake; sourceTree = "<group>"; };
- 2361029A1CF38A2B00B8E0B9 /* LLDBStandalone.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LLDBStandalone.cmake; sourceTree = "<group>"; };
- 2361029E1CF38A3500B8E0B9 /* Android.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Android.cmake; sourceTree = "<group>"; };
- 236124A21986B4E2004EFC37 /* IOObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOObject.cpp; path = source/Utility/IOObject.cpp; sourceTree = "<group>"; };
- 236124A31986B4E2004EFC37 /* Socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Socket.cpp; sourceTree = "<group>"; };
- 236124A61986B50E004EFC37 /* IOObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IOObject.h; path = include/lldb/Utility/IOObject.h; sourceTree = "<group>"; };
- 236124A71986B50E004EFC37 /* Socket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Socket.h; path = include/lldb/Host/Socket.h; sourceTree = "<group>"; };
2370A37A1D66C57B000E7BE6 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
2370A37C1D66C587000E7BE6 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2370A37D1D66C587000E7BE6 /* GDBRemoteClientBaseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteClientBaseTest.cpp; sourceTree = "<group>"; };
- 2370A37E1D66C587000E7BE6 /* GDBRemoteCommunicationClientTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationClientTest.cpp; sourceTree = "<group>"; };
- 2370A37F1D66C587000E7BE6 /* GDBRemoteTestUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteTestUtils.cpp; sourceTree = "<group>"; };
- 2370A3801D66C587000E7BE6 /* GDBRemoteTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteTestUtils.h; sourceTree = "<group>"; };
2374D7431D4BAA1D005C9575 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 2374D74E1D4BB299005C9575 /* GDBRemoteClientBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteClientBase.cpp; sourceTree = "<group>"; };
- 2374D74F1D4BB299005C9575 /* GDBRemoteClientBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteClientBase.h; sourceTree = "<group>"; };
- 2377C2F719E613C100737875 /* PipePosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipePosix.cpp; sourceTree = "<group>"; };
- 237A8BAB1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_arm64.cpp; path = Utility/RegisterInfoPOSIX_arm64.cpp; sourceTree = "<group>"; };
- 237A8BAC1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_arm64.h; path = Utility/RegisterInfoPOSIX_arm64.h; sourceTree = "<group>"; };
- 237C577A19AF9D9F00213D59 /* HostInfoLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoLinux.h; path = include/lldb/Host/linux/HostInfoLinux.h; sourceTree = SOURCE_ROOT; };
- 238F2B9D1D2C82D0001FF92A /* StructuredDataPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StructuredDataPlugin.cpp; path = source/Target/StructuredDataPlugin.cpp; sourceTree = "<group>"; };
- 238F2B9F1D2C835A001FF92A /* StructuredDataPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StructuredDataPlugin.h; path = include/lldb/Target/StructuredDataPlugin.h; sourceTree = "<group>"; };
- 238F2BA01D2C835A001FF92A /* SystemRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemRuntime.h; path = include/lldb/Target/SystemRuntime.h; sourceTree = "<group>"; };
- 238F2BA61D2C85FA001FF92A /* StructuredDataDarwinLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructuredDataDarwinLog.cpp; sourceTree = "<group>"; };
- 238F2BA71D2C85FA001FF92A /* StructuredDataDarwinLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructuredDataDarwinLog.h; sourceTree = "<group>"; };
- 239481851C59EBDD00DF7168 /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = ../../../../../usr/lib/libncurses.dylib; sourceTree = "<group>"; };
- 239504C21BDD3FD600963CEA /* gtest_common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gtest_common.h; sourceTree = "<group>"; };
- 239504D41BDD451400963CEA /* lldb-gtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-gtest"; sourceTree = BUILT_PRODUCTS_DIR; };
- 23AB052D199FF639003B8084 /* FreeBSDThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FreeBSDThread.cpp; sourceTree = "<group>"; };
- 23AB052E199FF639003B8084 /* FreeBSDThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FreeBSDThread.h; sourceTree = "<group>"; };
- 23AB052F199FF639003B8084 /* ProcessFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessFreeBSD.cpp; sourceTree = "<group>"; };
- 23AB0530199FF639003B8084 /* ProcessFreeBSD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessFreeBSD.h; sourceTree = "<group>"; };
- 23AB0531199FF639003B8084 /* ProcessMonitor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMonitor.cpp; sourceTree = "<group>"; };
- 23AB0532199FF639003B8084 /* ProcessMonitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessMonitor.h; sourceTree = "<group>"; };
- 23CB14E31D66CA2200EDDDE1 /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = usr/lib/libxml2.2.dylib; sourceTree = SDKROOT; };
- 23CB14E61D66CC0E00EDDDE1 /* BroadcasterTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BroadcasterTest.cpp; sourceTree = "<group>"; };
23CB14E71D66CC0E00EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23CB14E81D66CC0E00EDDDE1 /* DataExtractorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataExtractorTest.cpp; sourceTree = "<group>"; };
- 23CB14E91D66CC0E00EDDDE1 /* ScalarTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarTest.cpp; sourceTree = "<group>"; };
23CB14F11D66CC9000EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
23CB14F31D66CC9B00EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
23CB14F61D66CCD600EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
23CB14F91D66CCF100EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23CB14FA1D66CCF100EDDDE1 /* CPlusPlusLanguageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPlusPlusLanguageTest.cpp; sourceTree = "<group>"; };
- 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSpecTest.cpp; sourceTree = "<group>"; };
- 23CB15051D66CDB400EDDDE1 /* TestModule.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TestModule.c; sourceTree = "<group>"; };
- 23CB15061D66CDB400EDDDE1 /* TestModule.so */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestModule.so; sourceTree = "<group>"; };
23CB150B1D66CF5600EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23CB150C1D66CF5600EDDDE1 /* TestClangASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestClangASTContext.cpp; sourceTree = "<group>"; };
23CB15101D66CF6900EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
23CB15131D66CF8700EDDDE1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23CB15141D66CF8700EDDDE1 /* SymbolFilePDBTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFilePDBTests.cpp; sourceTree = "<group>"; };
- 23CB151B1D66CFAC00EDDDE1 /* test-pdb-alt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb-alt.cpp"; sourceTree = "<group>"; };
- 23CB151C1D66CFAC00EDDDE1 /* test-pdb-nested.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "test-pdb-nested.h"; sourceTree = "<group>"; };
- 23CB151D1D66CFAC00EDDDE1 /* test-pdb-types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb-types.cpp"; sourceTree = "<group>"; };
- 23CB151E1D66CFAC00EDDDE1 /* test-pdb-types.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb-types.exe"; sourceTree = "<group>"; };
- 23CB151F1D66CFAC00EDDDE1 /* test-pdb-types.pdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb-types.pdb"; sourceTree = "<group>"; };
- 23CB15201D66CFAC00EDDDE1 /* test-pdb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb.cpp"; sourceTree = "<group>"; };
- 23CB15211D66CFAC00EDDDE1 /* test-pdb.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb.exe"; sourceTree = "<group>"; };
- 23CB15221D66CFAC00EDDDE1 /* test-pdb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "test-pdb.h"; sourceTree = "<group>"; };
- 23CB15231D66CFAC00EDDDE1 /* test-pdb.pdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb.pdb"; sourceTree = "<group>"; };
- 23CB15561D66DA9300EDDDE1 /* lldb-gtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-gtest"; sourceTree = BUILT_PRODUCTS_DIR; };
23D065811D4A7BDA0008EDE6 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23D065821D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptExpressionOpts.cpp; sourceTree = "<group>"; };
- 23D065831D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptExpressionOpts.h; sourceTree = "<group>"; };
- 23D065841D4A7BDA0008EDE6 /* RenderScriptRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptRuntime.cpp; sourceTree = "<group>"; };
- 23D065851D4A7BDA0008EDE6 /* RenderScriptRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptRuntime.h; sourceTree = "<group>"; };
- 23D065861D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptx86ABIFixups.cpp; sourceTree = "<group>"; };
- 23D065871D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptx86ABIFixups.h; sourceTree = "<group>"; };
- 23DCBE971D63E14B0084C36B /* SBLanguageRuntime.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLanguageRuntime.i; sourceTree = "<group>"; };
- 23DCBE981D63E14B0084C36B /* SBStructuredData.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStructuredData.i; sourceTree = "<group>"; };
- 23DCBE991D63E14B0084C36B /* SBTypeEnumMember.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeEnumMember.i; sourceTree = "<group>"; };
- 23DCBE9A1D63E14B0084C36B /* SBUnixSignals.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBUnixSignals.i; sourceTree = "<group>"; };
- 23DCBE9F1D63E3800084C36B /* SBStructuredData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBStructuredData.h; path = include/lldb/API/SBStructuredData.h; sourceTree = "<group>"; };
- 23DCBEA01D63E6440084C36B /* SBStructuredData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStructuredData.cpp; path = source/API/SBStructuredData.cpp; sourceTree = "<group>"; };
- 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBMemoryRegionInfo.cpp; path = source/API/SBMemoryRegionInfo.cpp; sourceTree = "<group>"; };
- 23DCEA431D1C4C6900A602B4 /* SBMemoryRegionInfoList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBMemoryRegionInfoList.cpp; path = source/API/SBMemoryRegionInfoList.cpp; sourceTree = "<group>"; };
- 23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandOptionValidators.cpp; path = source/Interpreter/CommandOptionValidators.cpp; sourceTree = "<group>"; };
- 23E2E5161D903689006F38BB /* ArchSpecTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchSpecTest.cpp; sourceTree = "<group>"; };
23E2E5191D9036F2006F38BB /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23E2E51A1D9036F2006F38BB /* MinidumpParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpParserTest.cpp; sourceTree = "<group>"; };
- 23E2E51E1D903726006F38BB /* fizzbuzz_no_heap.dmp */ = {isa = PBXFileReference; lastKnownFileType = file; path = fizzbuzz_no_heap.dmp; sourceTree = "<group>"; };
- 23E2E51F1D903726006F38BB /* linux-x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "linux-x86_64.cpp"; sourceTree = "<group>"; };
- 23E2E5201D903726006F38BB /* linux-x86_64.dmp */ = {isa = PBXFileReference; lastKnownFileType = file; path = "linux-x86_64.dmp"; sourceTree = "<group>"; };
- 23E2E52D1D90382B006F38BB /* BreakpointIDTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BreakpointIDTest.cpp; sourceTree = "<group>"; };
23E2E5361D9048FB006F38BB /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 23E2E5371D9048FB006F38BB /* MinidumpParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpParser.cpp; sourceTree = "<group>"; };
- 23E2E5381D9048FB006F38BB /* MinidumpParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinidumpParser.h; sourceTree = "<group>"; };
- 23E2E5391D9048FB006F38BB /* MinidumpTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpTypes.cpp; sourceTree = "<group>"; };
- 23E2E53A1D9048FB006F38BB /* MinidumpTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinidumpTypes.h; sourceTree = "<group>"; };
- 23E77CD61C20F29F007192AD /* DWARFDebugMacro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugMacro.cpp; sourceTree = "<group>"; };
- 23E77CD71C20F29F007192AD /* DWARFDebugMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugMacro.h; sourceTree = "<group>"; };
- 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugMacros.cpp; path = source/Symbol/DebugMacros.cpp; sourceTree = "<group>"; };
- 23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Host/common/NativeRegisterContext.cpp; sourceTree = "<group>"; };
- 23EDE3311926843600F6A132 /* NativeRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Host/common/NativeRegisterContext.h; sourceTree = "<group>"; };
- 23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
- 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = "<group>"; };
- 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = "<group>"; };
- 23F403471926C8D50046DC9B /* NativeRegisterContextRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContextRegisterInfo.h; path = Utility/NativeRegisterContextRegisterInfo.h; sourceTree = "<group>"; };
- 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContextRegisterInfo.cpp; path = Utility/NativeRegisterContextRegisterInfo.cpp; sourceTree = "<group>"; };
- 250D6AE11A9679270049CC70 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = "<group>"; };
- 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueChar.cpp; path = source/Interpreter/OptionValueChar.cpp; sourceTree = "<group>"; };
- 25420ECE1A64911B009ADBCB /* OptionValueChar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValueChar.h; path = include/lldb/Interpreter/OptionValueChar.h; sourceTree = "<group>"; };
- 25420ED11A649D88009ADBCB /* PipeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipeBase.cpp; sourceTree = "<group>"; };
- 254FBB921A81AA5200BD6378 /* SBLaunchInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLaunchInfo.i; sourceTree = "<group>"; };
- 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLaunchInfo.cpp; path = source/API/SBLaunchInfo.cpp; sourceTree = "<group>"; };
- 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLaunchInfo.h; path = include/lldb/API/SBLaunchInfo.h; sourceTree = "<group>"; };
- 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAttachInfo.h; path = include/lldb/API/SBAttachInfo.h; sourceTree = "<group>"; };
- 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBAttachInfo.cpp; path = source/API/SBAttachInfo.cpp; sourceTree = "<group>"; };
- 254FBBA61A91672800BD6378 /* SBAttachInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAttachInfo.i; sourceTree = "<group>"; };
- 255EFF6F1AFABA320069F277 /* LockFileWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LockFileWindows.h; path = include/lldb/Host/windows/LockFileWindows.h; sourceTree = "<group>"; };
- 255EFF701AFABA320069F277 /* PipeWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PipeWindows.h; path = include/lldb/Host/windows/PipeWindows.h; sourceTree = "<group>"; };
- 255EFF711AFABA4D0069F277 /* LockFileWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LockFileWindows.cpp; path = source/Host/windows/LockFileWindows.cpp; sourceTree = "<group>"; };
- 255EFF731AFABA720069F277 /* LockFileBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LockFileBase.cpp; sourceTree = "<group>"; };
- 255EFF751AFABA950069F277 /* LockFilePosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LockFilePosix.cpp; sourceTree = "<group>"; };
- 256CBDB21ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_arm.cpp; sourceTree = "<group>"; };
- 256CBDB31ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_arm.h; sourceTree = "<group>"; };
- 256CBDB81ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_mips64.cpp; path = Utility/RegisterContextLinux_mips64.cpp; sourceTree = "<group>"; };
- 256CBDB91ADD107200BC6CDC /* RegisterContextLinux_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_mips64.h; path = Utility/RegisterContextLinux_mips64.h; sourceTree = "<group>"; };
- 256CBDBE1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_arm.cpp; path = Utility/RegisterContextPOSIX_arm.cpp; sourceTree = "<group>"; };
- 256CBDBF1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_arm.h; path = Utility/RegisterContextPOSIX_arm.h; sourceTree = "<group>"; };
- 2579065A1BD0488100178368 /* TCPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TCPSocket.cpp; sourceTree = "<group>"; };
- 2579065B1BD0488100178368 /* UDPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UDPSocket.cpp; sourceTree = "<group>"; };
- 2579065E1BD0488D00178368 /* DomainSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainSocket.cpp; sourceTree = "<group>"; };
- 257906621BD5AFD000178368 /* Acceptor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Acceptor.cpp; path = "tools/lldb-server/Acceptor.cpp"; sourceTree = "<group>"; };
- 257906631BD5AFD000178368 /* Acceptor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Acceptor.h; path = "tools/lldb-server/Acceptor.h"; sourceTree = "<group>"; };
- 25EF23751AC09AD800908DF0 /* AdbClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AdbClient.cpp; sourceTree = "<group>"; };
- 25EF23761AC09AD800908DF0 /* AdbClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdbClient.h; sourceTree = "<group>"; };
- 260157C41885F4FF00F875CF /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = /usr/lib/libpanel.dylib; sourceTree = "<absolute>"; };
- 260223E7115F06D500A601A2 /* SBCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommunication.h; path = include/lldb/API/SBCommunication.h; sourceTree = "<group>"; };
- 260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; };
- 26022531115F27FA00A601A2 /* SBFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpec.h; path = include/lldb/API/SBFileSpec.h; sourceTree = "<group>"; };
- 26022532115F281400A601A2 /* SBFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpec.cpp; path = source/API/SBFileSpec.cpp; sourceTree = "<group>"; };
- 260A248D15D06C4F009981B0 /* OptionValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValues.h; path = include/lldb/Interpreter/OptionValues.h; sourceTree = "<group>"; };
- 260A39A519647A3A004B4130 /* Pipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Pipe.h; path = include/lldb/Host/Pipe.h; sourceTree = "<group>"; };
- 260A63111860FDB600FECF8E /* Queue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Queue.h; path = include/lldb/Target/Queue.h; sourceTree = "<group>"; };
- 260A63121860FDBD00FECF8E /* QueueItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QueueItem.h; path = include/lldb/Target/QueueItem.h; sourceTree = "<group>"; };
- 260A63131860FDC700FECF8E /* QueueList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QueueList.h; path = include/lldb/Target/QueueList.h; sourceTree = "<group>"; };
- 260A63161861008E00FECF8E /* IOHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOHandler.h; path = include/lldb/Core/IOHandler.h; sourceTree = "<group>"; };
- 260A63181861009E00FECF8E /* IOHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOHandler.cpp; path = source/Core/IOHandler.cpp; sourceTree = "<group>"; };
- 260C6EA013011578005E16B0 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = include/lldb/Host/File.h; sourceTree = "<group>"; };
- 260C6EA213011581005E16B0 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
- 260C847110F50EFC00BB2B04 /* ThreadPlanBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanBase.cpp; path = source/Target/ThreadPlanBase.cpp; sourceTree = "<group>"; };
- 260C847210F50EFC00BB2B04 /* ThreadPlanStepInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepInstruction.cpp; path = source/Target/ThreadPlanStepInstruction.cpp; sourceTree = "<group>"; };
- 260C847310F50EFC00BB2B04 /* ThreadPlanStepOut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOut.cpp; path = source/Target/ThreadPlanStepOut.cpp; sourceTree = "<group>"; };
- 260C847410F50EFC00BB2B04 /* ThreadPlanStepOverBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOverBreakpoint.cpp; path = source/Target/ThreadPlanStepOverBreakpoint.cpp; sourceTree = "<group>"; };
- 260C847510F50EFC00BB2B04 /* ThreadPlanStepThrough.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepThrough.cpp; path = source/Target/ThreadPlanStepThrough.cpp; sourceTree = "<group>"; };
- 260C847610F50EFC00BB2B04 /* ThreadPlanStepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepRange.cpp; path = source/Target/ThreadPlanStepRange.cpp; sourceTree = "<group>"; };
- 260C847F10F50F0A00BB2B04 /* ThreadPlanBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanBase.h; path = include/lldb/Target/ThreadPlanBase.h; sourceTree = "<group>"; };
- 260C848010F50F0A00BB2B04 /* ThreadPlanStepInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepInstruction.h; path = include/lldb/Target/ThreadPlanStepInstruction.h; sourceTree = "<group>"; };
- 260C848110F50F0A00BB2B04 /* ThreadPlanStepOut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOut.h; path = include/lldb/Target/ThreadPlanStepOut.h; sourceTree = "<group>"; };
- 260C848210F50F0A00BB2B04 /* ThreadPlanStepOverBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOverBreakpoint.h; path = include/lldb/Target/ThreadPlanStepOverBreakpoint.h; sourceTree = "<group>"; };
- 260C848310F50F0A00BB2B04 /* ThreadPlanStepThrough.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepThrough.h; path = include/lldb/Target/ThreadPlanStepThrough.h; sourceTree = "<group>"; };
- 260C848410F50F0A00BB2B04 /* ThreadPlanStepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepRange.h; path = include/lldb/Target/ThreadPlanStepRange.h; sourceTree = "<group>"; };
- 260C876910F538E700BB2B04 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
- 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOSXDYLD.cpp; sourceTree = "<group>"; };
- 260C897B10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOSXDYLD.h; sourceTree = "<group>"; };
- 260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerUniversalMachO.cpp; sourceTree = "<group>"; };
- 260C898110F57C5600BB2B04 /* ObjectContainerUniversalMachO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectContainerUniversalMachO.h; sourceTree = "<group>"; };
- 260C898510F57C5600BB2B04 /* ObjectFileELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileELF.cpp; sourceTree = "<group>"; };
- 260C898610F57C5600BB2B04 /* ObjectFileELF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileELF.h; sourceTree = "<group>"; };
- 260C898810F57C5600BB2B04 /* ObjectFileMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileMachO.cpp; sourceTree = "<group>"; };
- 260C898910F57C5600BB2B04 /* ObjectFileMachO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileMachO.h; sourceTree = "<group>"; };
+ 2669415B1A6DC2AB0063BE93 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = "tools/lldb-mi/CMakeLists.txt"; sourceTree = SOURCE_ROOT; };
+ 9A1890311F47D5D400394BCA /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = TestingSupport/CMakeLists.txt; sourceTree = "<group>"; };
+ 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPPLanguageRuntime.cpp; path = source/Target/CPPLanguageRuntime.cpp; sourceTree = "<group>"; };
+ 4CB443BB1249920C00C13DC2 /* CPPLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPPLanguageRuntime.h; path = include/lldb/Target/CPPLanguageRuntime.h; sourceTree = "<group>"; };
+ 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CPlusPlusLanguage.cpp; path = Language/CPlusPlus/CPlusPlusLanguage.cpp; sourceTree = "<group>"; };
+ 94B6385C1B8FB174004FE1E4 /* CPlusPlusLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPlusPlusLanguage.h; path = Language/CPlusPlus/CPlusPlusLanguage.h; sourceTree = "<group>"; };
+ 23CB14FA1D66CCF100EDDDE1 /* CPlusPlusLanguageTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CPlusPlusLanguageTest.cpp; sourceTree = "<group>"; };
+ 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPlusPlusNameParser.cpp; path = Language/CPlusPlus/CPlusPlusNameParser.cpp; sourceTree = "<group>"; };
+ 49F811F01E931B1500F4E163 /* CPlusPlusNameParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPlusPlusNameParser.h; path = Language/CPlusPlus/CPlusPlusNameParser.h; sourceTree = "<group>"; };
+ 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXFunctionPointer.cpp; path = source/DataFormatters/CXXFunctionPointer.cpp; sourceTree = "<group>"; };
+ 945261C91B9A14E000BF138D /* CXXFunctionPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CXXFunctionPointer.h; path = include/lldb/DataFormatters/CXXFunctionPointer.h; sourceTree = "<group>"; };
+ 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTContext.cpp; path = source/Symbol/ClangASTContext.cpp; sourceTree = "<group>"; };
+ 26BC7C5610F1B6E900F91463 /* ClangASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTContext.h; path = include/lldb/Symbol/ClangASTContext.h; sourceTree = "<group>"; };
+ 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTImporter.cpp; path = source/Symbol/ClangASTImporter.cpp; sourceTree = "<group>"; };
+ 49D8FB3713B5594900411094 /* ClangASTImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTImporter.h; path = include/lldb/Symbol/ClangASTImporter.h; sourceTree = "<group>"; };
+ 49D7072811B5AD11001AD875 /* ClangASTSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTSource.cpp; path = ExpressionParser/Clang/ClangASTSource.cpp; sourceTree = "<group>"; };
+ 49D7072611B5AD03001AD875 /* ClangASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTSource.h; path = ExpressionParser/Clang/ClangASTSource.h; sourceTree = "<group>"; };
+ 4C3DA2301CA0BFB800CEB1D4 /* ClangDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangDiagnostic.h; path = ExpressionParser/Clang/ClangDiagnostic.h; sourceTree = "<group>"; };
+ 49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionDeclMap.cpp; path = ExpressionParser/Clang/ClangExpressionDeclMap.cpp; sourceTree = "<group>"; };
+ 49F1A74911B338AE003ED505 /* ClangExpressionDeclMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionDeclMap.h; path = ExpressionParser/Clang/ClangExpressionDeclMap.h; sourceTree = "<group>"; };
+ 26BC7DC010F1B79500F91463 /* ClangExpressionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionHelper.h; path = ExpressionParser/Clang/ClangExpressionHelper.h; sourceTree = "<group>"; };
+ 49445C2512245E3600C11A81 /* ClangExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionParser.cpp; path = ExpressionParser/Clang/ClangExpressionParser.cpp; sourceTree = "<group>"; };
+ 49445C2912245E5500C11A81 /* ClangExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionParser.h; path = ExpressionParser/Clang/ClangExpressionParser.h; sourceTree = "<group>"; };
+ 4984BA0E1B978C3E008658D4 /* ClangExpressionVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionVariable.cpp; path = ExpressionParser/Clang/ClangExpressionVariable.cpp; sourceTree = "<group>"; };
+ 4984BA0F1B978C3E008658D4 /* ClangExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionVariable.h; path = ExpressionParser/Clang/ClangExpressionVariable.h; sourceTree = "<group>"; };
+ 26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExternalASTSourceCallbacks.cpp; path = source/Symbol/ClangExternalASTSourceCallbacks.cpp; sourceTree = "<group>"; };
+ 26E6902E129C6BD500DDECD9 /* ClangExternalASTSourceCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExternalASTSourceCallbacks.h; path = include/lldb/Symbol/ClangExternalASTSourceCallbacks.h; sourceTree = "<group>"; };
+ 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExternalASTSourceCommon.cpp; path = source/Symbol/ClangExternalASTSourceCommon.cpp; sourceTree = "<group>"; };
+ 495B38431489714C002708C5 /* ClangExternalASTSourceCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ClangExternalASTSourceCommon.h; path = include/lldb/Symbol/ClangExternalASTSourceCommon.h; sourceTree = "<group>"; };
+ 26BC7D5510F1B77400F91463 /* ClangForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangForward.h; path = include/lldb/Core/ClangForward.h; sourceTree = "<group>"; };
+ 4C98D3DA118FB96F00E575D0 /* ClangFunctionCaller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangFunctionCaller.cpp; path = ExpressionParser/Clang/ClangFunctionCaller.cpp; sourceTree = "<group>"; };
+ 4C98D3E0118FB98F00E575D0 /* ClangFunctionCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangFunctionCaller.h; path = ExpressionParser/Clang/ClangFunctionCaller.h; sourceTree = "<group>"; };
+ 4CD44D5620C603A80003557C /* ClangHost.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ClangHost.cpp; path = ExpressionParser/Clang/ClangHost.cpp; sourceTree = "<group>"; };
+ 4CD44D5720C603A90003557C /* ClangHost.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ClangHost.h; path = ExpressionParser/Clang/ClangHost.h; sourceTree = "<group>"; };
+ 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangModulesDeclVendor.cpp; path = ExpressionParser/Clang/ClangModulesDeclVendor.cpp; sourceTree = "<group>"; };
+ 4959511B1A1BC48100F6F8FC /* ClangModulesDeclVendor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangModulesDeclVendor.h; path = ExpressionParser/Clang/ClangModulesDeclVendor.h; sourceTree = "<group>"; };
+ 49D4FE871210B61C00CDB854 /* ClangPersistentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangPersistentVariables.cpp; path = ExpressionParser/Clang/ClangPersistentVariables.cpp; sourceTree = "<group>"; };
+ 49D4FE821210B5FB00CDB854 /* ClangPersistentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangPersistentVariables.h; path = ExpressionParser/Clang/ClangPersistentVariables.h; sourceTree = "<group>"; };
+ 26BC7ED510F1B86700F91463 /* ClangUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUserExpression.cpp; path = ExpressionParser/Clang/ClangUserExpression.cpp; sourceTree = "<group>"; };
+ 49445E341225AB6A00C11A81 /* ClangUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUserExpression.h; path = ExpressionParser/Clang/ClangUserExpression.h; sourceTree = "<group>"; };
+ 3032B1B61CAAA3D1004BE1AB /* ClangUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUtil.cpp; path = source/Symbol/ClangUtil.cpp; sourceTree = "<group>"; };
+ 3032B1B91CAAA400004BE1AB /* ClangUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUtil.h; path = include/lldb/Symbol/ClangUtil.h; sourceTree = "<group>"; };
+ 497C86BD122823D800B54702 /* ClangUtilityFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUtilityFunction.cpp; path = ExpressionParser/Clang/ClangUtilityFunction.cpp; sourceTree = "<group>"; };
+ 497C86C1122823F300B54702 /* ClangUtilityFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUtilityFunction.h; path = ExpressionParser/Clang/ClangUtilityFunction.h; sourceTree = "<group>"; };
+ 264723A511FA076E00DE380C /* CleanUp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CleanUp.h; path = include/lldb/Utility/CleanUp.h; sourceTree = "<group>"; };
+ 7F94D7172040A13A006EE3EA /* CleanUpTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CleanUpTest.cpp; sourceTree = "<group>"; };
+ 949EEDA11BA76571008C63CF /* Cocoa.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Cocoa.cpp; path = Language/ObjC/Cocoa.cpp; sourceTree = "<group>"; };
+ 949EEDA21BA76571008C63CF /* Cocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Cocoa.h; path = Language/ObjC/Cocoa.h; sourceTree = "<group>"; };
+ 9441816D1C8F5EC900E5A8D9 /* CommandAlias.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandAlias.cpp; path = source/Interpreter/CommandAlias.cpp; sourceTree = "<group>"; };
+ 9441816B1C8F5EB000E5A8D9 /* CommandAlias.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandAlias.h; path = include/lldb/Interpreter/CommandAlias.h; sourceTree = "<group>"; };
+ 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandCompletions.cpp; path = source/Commands/CommandCompletions.cpp; sourceTree = "<group>"; };
+ 4C09CB73116BD98B00C7A725 /* CommandCompletions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandCompletions.h; path = include/lldb/Interpreter/CommandCompletions.h; sourceTree = "<group>"; };
+ 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandHistory.cpp; path = source/Interpreter/CommandHistory.cpp; sourceTree = "<group>"; };
+ 94BA8B71176F97D4005A91B5 /* CommandHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandHistory.h; path = include/lldb/Interpreter/CommandHistory.h; sourceTree = "<group>"; };
+ 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandInterpreter.cpp; path = source/Interpreter/CommandInterpreter.cpp; sourceTree = "<group>"; };
+ 26BC7DE210F1B7F900F91463 /* CommandInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandInterpreter.h; path = include/lldb/Interpreter/CommandInterpreter.h; sourceTree = "<group>"; };
+ 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObject.cpp; path = source/Interpreter/CommandObject.cpp; sourceTree = "<group>"; };
+ 26BC7DE310F1B7F900F91463 /* CommandObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObject.h; path = include/lldb/Interpreter/CommandObject.h; sourceTree = "<group>"; };
+ 4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectApropos.cpp; path = source/Commands/CommandObjectApropos.cpp; sourceTree = "<group>"; };
+ 4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectApropos.h; path = source/Commands/CommandObjectApropos.h; sourceTree = "<group>"; };
+ 26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBreakpoint.cpp; path = source/Commands/CommandObjectBreakpoint.cpp; sourceTree = "<group>"; };
+ 26BC7D1410F1B76300F91463 /* CommandObjectBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectBreakpoint.h; path = source/Commands/CommandObjectBreakpoint.h; sourceTree = "<group>"; };
+ 9A42976211861AA600FE05CD /* CommandObjectBreakpointCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBreakpointCommand.cpp; path = source/Commands/CommandObjectBreakpointCommand.cpp; sourceTree = "<group>"; };
+ 9A42976111861A9F00FE05CD /* CommandObjectBreakpointCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectBreakpointCommand.h; path = source/Commands/CommandObjectBreakpointCommand.h; sourceTree = "<group>"; };
+ 6D86CE9E1B440F6B00A7FBFA /* CommandObjectBugreport.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBugreport.cpp; path = source/Commands/CommandObjectBugreport.cpp; sourceTree = "<group>"; };
+ 6D86CE9F1B440F6B00A7FBFA /* CommandObjectBugreport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectBugreport.h; path = source/Commands/CommandObjectBugreport.h; sourceTree = "<group>"; };
+ 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectCommands.cpp; path = source/Commands/CommandObjectCommands.cpp; sourceTree = "<group>"; };
+ 4C5DBBC711E3FEC60035160F /* CommandObjectCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectCommands.h; path = source/Commands/CommandObjectCommands.h; sourceTree = "<group>"; };
+ 26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectDisassemble.cpp; path = source/Commands/CommandObjectDisassemble.cpp; sourceTree = "<group>"; };
+ 26BC7D1710F1B76300F91463 /* CommandObjectDisassemble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectDisassemble.h; path = source/Commands/CommandObjectDisassemble.h; sourceTree = "<group>"; };
+ 26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectExpression.cpp; path = source/Commands/CommandObjectExpression.cpp; sourceTree = "<group>"; };
+ 26BC7D1810F1B76300F91463 /* CommandObjectExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectExpression.h; path = source/Commands/CommandObjectExpression.h; sourceTree = "<group>"; };
+ 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectFrame.cpp; path = source/Commands/CommandObjectFrame.cpp; sourceTree = "<group>"; };
+ 2672D8471189055500FF4019 /* CommandObjectFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectFrame.h; path = source/Commands/CommandObjectFrame.h; sourceTree = "<group>"; };
+ 26CEB5F018762056008F575A /* CommandObjectGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectGUI.cpp; path = source/Commands/CommandObjectGUI.cpp; sourceTree = "<group>"; };
+ 26CEB5F118762056008F575A /* CommandObjectGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectGUI.h; path = source/Commands/CommandObjectGUI.h; sourceTree = "<group>"; };
+ 26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectHelp.cpp; path = source/Commands/CommandObjectHelp.cpp; sourceTree = "<group>"; };
+ 26BC7D1A10F1B76300F91463 /* CommandObjectHelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectHelp.h; path = source/Commands/CommandObjectHelp.h; sourceTree = "<group>"; };
+ AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectLanguage.cpp; path = source/Commands/CommandObjectLanguage.cpp; sourceTree = "<group>"; };
+ AFC234071AF85CE000CDE8B6 /* CommandObjectLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectLanguage.h; path = source/Commands/CommandObjectLanguage.h; sourceTree = "<group>"; };
+ 264AD83711095BA600E0B039 /* CommandObjectLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectLog.cpp; path = source/Commands/CommandObjectLog.cpp; sourceTree = "<group>"; };
+ 264AD83911095BBD00E0B039 /* CommandObjectLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectLog.h; path = source/Commands/CommandObjectLog.h; sourceTree = "<group>"; };
+ 26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMemory.cpp; path = source/Commands/CommandObjectMemory.cpp; sourceTree = "<group>"; };
+ 26BC7D1D10F1B76300F91463 /* CommandObjectMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMemory.h; path = source/Commands/CommandObjectMemory.h; sourceTree = "<group>"; };
+ 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMultiword.cpp; path = source/Commands/CommandObjectMultiword.cpp; sourceTree = "<group>"; };
+ 26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMultiword.h; path = include/lldb/Interpreter/CommandObjectMultiword.h; sourceTree = "<group>"; };
+ 26879CE71333F58B0012C1F8 /* CommandObjectPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectPlatform.cpp; path = source/Commands/CommandObjectPlatform.cpp; sourceTree = "<group>"; };
+ 26879CE51333F5750012C1F8 /* CommandObjectPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlatform.h; path = source/Commands/CommandObjectPlatform.h; sourceTree = "<group>"; };
+ 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectPlugin.cpp; path = source/Commands/CommandObjectPlugin.cpp; sourceTree = "<group>"; };
+ 947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlugin.h; path = source/Commands/CommandObjectPlugin.h; sourceTree = "<group>"; };
+ 26BC7E3810F1B84700F91463 /* CommandObjectProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectProcess.cpp; path = source/Commands/CommandObjectProcess.cpp; sourceTree = "<group>"; };
+ 26BC7D1F10F1B76300F91463 /* CommandObjectProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectProcess.h; path = source/Commands/CommandObjectProcess.h; sourceTree = "<group>"; };
+ 26BC7E3910F1B84700F91463 /* CommandObjectQuit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectQuit.cpp; path = source/Commands/CommandObjectQuit.cpp; sourceTree = "<group>"; };
+ 26BC7D2010F1B76300F91463 /* CommandObjectQuit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectQuit.h; path = source/Commands/CommandObjectQuit.h; sourceTree = "<group>"; };
+ 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegexCommand.cpp; path = source/Interpreter/CommandObjectRegexCommand.cpp; sourceTree = "<group>"; };
+ 26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegexCommand.h; path = include/lldb/Interpreter/CommandObjectRegexCommand.h; sourceTree = "<group>"; };
+ 26BC7E3B10F1B84700F91463 /* CommandObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegister.cpp; path = source/Commands/CommandObjectRegister.cpp; sourceTree = "<group>"; };
+ 26BC7D2210F1B76300F91463 /* CommandObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegister.h; path = source/Commands/CommandObjectRegister.h; sourceTree = "<group>"; };
+ 26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectScript.cpp; path = source/Interpreter/CommandObjectScript.cpp; sourceTree = "<group>"; };
+ 26BC7D2410F1B76300F91463 /* CommandObjectScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectScript.h; path = source/Interpreter/CommandObjectScript.h; sourceTree = "<group>"; };
+ 26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSettings.cpp; path = source/Commands/CommandObjectSettings.cpp; sourceTree = "<group>"; };
+ 26BC7D2710F1B76300F91463 /* CommandObjectSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSettings.h; path = source/Commands/CommandObjectSettings.h; sourceTree = "<group>"; };
+ 26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSource.cpp; path = source/Commands/CommandObjectSource.cpp; sourceTree = "<group>"; };
+ 26BC7D2910F1B76300F91463 /* CommandObjectSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSource.h; path = source/Commands/CommandObjectSource.h; sourceTree = "<group>"; };
+ 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectStats.cpp; path = source/Commands/CommandObjectStats.cpp; sourceTree = "<group>"; };
+ 6B8894772065AE5C002E5C59 /* CommandObjectStats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectStats.h; path = source/Commands/CommandObjectStats.h; sourceTree = "<group>"; };
+ 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectTarget.cpp; path = source/Commands/CommandObjectTarget.cpp; sourceTree = "<group>"; };
+ 269416AE119A024800FF2715 /* CommandObjectTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectTarget.h; path = source/Commands/CommandObjectTarget.h; sourceTree = "<group>"; };
+ 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectThread.cpp; path = source/Commands/CommandObjectThread.cpp; sourceTree = "<group>"; };
+ 26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectThread.h; path = source/Commands/CommandObjectThread.h; sourceTree = "<group>"; };
+ 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = CommandObjectType.cpp; path = source/Commands/CommandObjectType.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = "<group>"; };
+ B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectVersion.cpp; path = source/Commands/CommandObjectVersion.cpp; sourceTree = "<group>"; };
+ B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectVersion.h; path = source/Commands/CommandObjectVersion.h; sourceTree = "<group>"; };
+ B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpoint.cpp; path = source/Commands/CommandObjectWatchpoint.cpp; sourceTree = "<group>"; };
+ B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpoint.h; path = source/Commands/CommandObjectWatchpoint.h; sourceTree = "<group>"; };
+ B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpointCommand.cpp; path = source/Commands/CommandObjectWatchpointCommand.cpp; sourceTree = "<group>"; };
+ B2B7CCEC15D1BD9600EEFB57 /* CommandObjectWatchpointCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpointCommand.h; path = source/Commands/CommandObjectWatchpointCommand.h; sourceTree = "<group>"; };
+ 23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandOptionValidators.cpp; path = source/Interpreter/CommandOptionValidators.cpp; sourceTree = "<group>"; };
+ 4C719396207D237100FDF430 /* CommandOptionValidators.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandOptionValidators.h; path = include/lldb/Interpreter/CommandOptionValidators.h; sourceTree = "<group>"; };
+ 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandReturnObject.cpp; path = source/Interpreter/CommandReturnObject.cpp; sourceTree = "<group>"; };
+ 26BC7DE410F1B7F900F91463 /* CommandReturnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandReturnObject.h; path = include/lldb/Interpreter/CommandReturnObject.h; sourceTree = "<group>"; };
+ 26BC7E6E10F1B85900F91463 /* Communication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Communication.cpp; path = source/Core/Communication.cpp; sourceTree = "<group>"; };
+ 26BC7D5610F1B77400F91463 /* Communication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Communication.h; path = include/lldb/Core/Communication.h; sourceTree = "<group>"; };
+ 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommunicationKDP.cpp; sourceTree = "<group>"; };
+ 2642FBA913D003B400ED6808 /* CommunicationKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommunicationKDP.h; sourceTree = "<group>"; };
+ 964463EB1A330C0500154ED8 /* CompactUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompactUnwindInfo.cpp; path = source/Symbol/CompactUnwindInfo.cpp; sourceTree = "<group>"; };
+ 964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompactUnwindInfo.h; path = include/lldb/Symbol/CompactUnwindInfo.h; sourceTree = "<group>"; };
+ 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompileUnit.cpp; path = source/Symbol/CompileUnit.cpp; sourceTree = "<group>"; };
+ 26BC7C5710F1B6E900F91463 /* CompileUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompileUnit.h; path = include/lldb/Symbol/CompileUnit.h; sourceTree = "<group>"; };
+ 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerDecl.cpp; path = source/Symbol/CompilerDecl.cpp; sourceTree = "<group>"; };
+ 265192C41BA8E8F8002F08F6 /* CompilerDecl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompilerDecl.h; path = include/lldb/Symbol/CompilerDecl.h; sourceTree = "<group>"; };
+ 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerDeclContext.cpp; path = source/Symbol/CompilerDeclContext.cpp; sourceTree = "<group>"; };
+ 2657AFB51B8690EC00958979 /* CompilerDeclContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompilerDeclContext.h; path = include/lldb/Symbol/CompilerDeclContext.h; sourceTree = "<group>"; };
+ 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerType.cpp; path = source/Symbol/CompilerType.cpp; sourceTree = "<group>"; };
+ 49E45FA911F660DC008F7B28 /* CompilerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompilerType.h; path = include/lldb/Symbol/CompilerType.h; sourceTree = "<group>"; };
+ 58EC744020EAEB5200695209 /* CompletionRequest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompletionRequest.cpp; path = source/Utility/CompletionRequest.cpp; sourceTree = "<group>"; };
+ 58EC744220EAEB6C00695209 /* CompletionRequest.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompletionRequest.h; path = include/lldb/Utility/CompletionRequest.h; sourceTree = "<group>"; };
+ 266F5CBB12FC846200DFCE33 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/Config.h; sourceTree = "<group>"; };
+ 3FDFE53C19A293CA009756A7 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/freebsd/Config.h; sourceTree = "<group>"; };
+ 3FDFE56319AF9B77009756A7 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/linux/Config.h; sourceTree = SOURCE_ROOT; };
+ 6D55BAE31A8CD06000A70529 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/android/Config.h; sourceTree = "<group>"; };
+ 26BC7E6F10F1B85900F91463 /* Connection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Connection.cpp; path = source/Utility/Connection.cpp; sourceTree = "<group>"; };
+ 26BC7D5710F1B77400F91463 /* Connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Connection.h; path = include/lldb/Utility/Connection.h; sourceTree = "<group>"; };
+ AFDFDFD019E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectionFileDescriptorPosix.cpp; sourceTree = "<group>"; };
+ 26764C961E48F482008D3573 /* ConstString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstString.cpp; path = source/Utility/ConstString.cpp; sourceTree = "<group>"; };
+ 26764C951E48F46F008D3573 /* ConstString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConstString.h; path = include/lldb/Utility/ConstString.h; sourceTree = "<group>"; };
+ 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstStringTest.cpp; sourceTree = "<group>"; };
+ 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
+ 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CoreMedia.cpp; path = Language/ObjC/CoreMedia.cpp; sourceTree = "<group>"; };
+ 949EED9F1BA74B64008C63CF /* CoreMedia.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CoreMedia.h; path = Language/ObjC/CoreMedia.h; sourceTree = "<group>"; };
+ AF3F54AE1B3BA59C00186E73 /* CrashReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrashReason.cpp; sourceTree = "<group>"; };
+ AF3F54AF1B3BA59C00186E73 /* CrashReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReason.h; sourceTree = "<group>"; };
+ 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CxxStringTypes.cpp; path = Language/CPlusPlus/CxxStringTypes.cpp; sourceTree = "<group>"; };
+ 945261B41B9A11E800BF138D /* CxxStringTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CxxStringTypes.h; path = Language/CPlusPlus/CxxStringTypes.h; sourceTree = "<group>"; };
+ 6D95DBFD1B9DC057000E318A /* DIERef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DIERef.cpp; sourceTree = "<group>"; };
+ 6D95DC031B9DC06F000E318A /* DIERef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DIERef.h; sourceTree = "<group>"; };
+ 269DDD451B8FD01A00D0DBD8 /* DWARFASTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParser.h; sourceTree = "<group>"; };
+ 269DDD481B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserClang.cpp; sourceTree = "<group>"; };
+ 269DDD491B8FD1C300D0DBD8 /* DWARFASTParserClang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserClang.h; sourceTree = "<group>"; };
+ AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserGo.cpp; sourceTree = "<group>"; };
+ AE6897271B94F6DE0018845D /* DWARFASTParserGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserGo.h; sourceTree = "<group>"; };
+ 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserJava.cpp; sourceTree = "<group>"; };
+ 6D0F61451C80AACF00A4ECEE /* DWARFASTParserJava.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserJava.h; sourceTree = "<group>"; };
+ 4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserOCaml.cpp; sourceTree = "<group>"; };
+ 4CC7C6511D5299140076FF94 /* DWARFASTParserOCaml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserOCaml.h; sourceTree = "<group>"; };
260C89B310F57C5600BB2B04 /* DWARFAbbreviationDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFAbbreviationDeclaration.cpp; sourceTree = "<group>"; };
260C89B410F57C5600BB2B04 /* DWARFAbbreviationDeclaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFAbbreviationDeclaration.h; sourceTree = "<group>"; };
+ 266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFAttribute.cpp; sourceTree = "<group>"; };
260C89B610F57C5600BB2B04 /* DWARFAttribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFAttribute.h; sourceTree = "<group>"; };
+ 4CD44D4020B777850003557C /* DWARFBaseDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFBaseDIE.cpp; sourceTree = "<group>"; };
+ 4CD44D4120B777850003557C /* DWARFBaseDIE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFBaseDIE.h; sourceTree = "<group>"; };
+ 26BC7F1710F1B8EC00F91463 /* DWARFCallFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DWARFCallFrameInfo.cpp; path = source/Symbol/DWARFCallFrameInfo.cpp; sourceTree = "<group>"; };
+ 26BC7C5910F1B6E900F91463 /* DWARFCallFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DWARFCallFrameInfo.h; path = include/lldb/Symbol/DWARFCallFrameInfo.h; sourceTree = "<group>"; };
260C89B710F57C5600BB2B04 /* DWARFCompileUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFCompileUnit.cpp; sourceTree = "<group>"; };
260C89B810F57C5600BB2B04 /* DWARFCompileUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFCompileUnit.h; sourceTree = "<group>"; };
+ 266E82961B8CE3AC008FCA06 /* DWARFDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDIE.cpp; sourceTree = "<group>"; };
+ 266E82951B8CE346008FCA06 /* DWARFDIE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWARFDIE.h; sourceTree = "<group>"; };
+ 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDIECollection.cpp; sourceTree = "<group>"; };
+ 260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDIECollection.h; sourceTree = "<group>"; };
+ 26AB92101819D74600E63F3E /* DWARFDataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDataExtractor.cpp; sourceTree = "<group>"; };
+ 26AB92111819D74600E63F3E /* DWARFDataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDataExtractor.h; sourceTree = "<group>"; };
260C89B910F57C5600BB2B04 /* DWARFDebugAbbrev.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugAbbrev.cpp; sourceTree = "<group>"; };
260C89BA10F57C5600BB2B04 /* DWARFDebugAbbrev.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugAbbrev.h; sourceTree = "<group>"; };
- 260C89BB10F57C5600BB2B04 /* DWARFDebugAranges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugAranges.cpp; sourceTree = "<group>"; };
- 260C89BC10F57C5600BB2B04 /* DWARFDebugAranges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugAranges.h; sourceTree = "<group>"; };
260C89BD10F57C5600BB2B04 /* DWARFDebugArangeSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugArangeSet.cpp; sourceTree = "<group>"; };
260C89BE10F57C5600BB2B04 /* DWARFDebugArangeSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugArangeSet.h; sourceTree = "<group>"; };
+ 260C89BB10F57C5600BB2B04 /* DWARFDebugAranges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugAranges.cpp; sourceTree = "<group>"; };
+ 260C89BC10F57C5600BB2B04 /* DWARFDebugAranges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugAranges.h; sourceTree = "<group>"; };
260C89BF10F57C5600BB2B04 /* DWARFDebugInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugInfo.cpp; sourceTree = "<group>"; };
260C89C010F57C5600BB2B04 /* DWARFDebugInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugInfo.h; sourceTree = "<group>"; };
260C89C110F57C5600BB2B04 /* DWARFDebugInfoEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugInfoEntry.cpp; sourceTree = "<group>"; };
@@ -1493,243 +1684,350 @@
260C89C610F57C5600BB2B04 /* DWARFDebugMacinfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugMacinfo.h; sourceTree = "<group>"; };
260C89C710F57C5600BB2B04 /* DWARFDebugMacinfoEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugMacinfoEntry.cpp; sourceTree = "<group>"; };
260C89C810F57C5600BB2B04 /* DWARFDebugMacinfoEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugMacinfoEntry.h; sourceTree = "<group>"; };
- 260C89C910F57C5600BB2B04 /* DWARFDebugPubnames.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugPubnames.cpp; sourceTree = "<group>"; };
- 260C89CA10F57C5600BB2B04 /* DWARFDebugPubnames.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugPubnames.h; sourceTree = "<group>"; };
- 260C89CB10F57C5600BB2B04 /* DWARFDebugPubnamesSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugPubnamesSet.cpp; sourceTree = "<group>"; };
- 260C89CC10F57C5600BB2B04 /* DWARFDebugPubnamesSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugPubnamesSet.h; sourceTree = "<group>"; };
+ 23E77CD61C20F29F007192AD /* DWARFDebugMacro.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugMacro.cpp; sourceTree = "<group>"; };
+ 23E77CD71C20F29F007192AD /* DWARFDebugMacro.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugMacro.h; sourceTree = "<group>"; };
260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDebugRanges.cpp; sourceTree = "<group>"; };
260C89CE10F57C5600BB2B04 /* DWARFDebugRanges.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDebugRanges.h; sourceTree = "<group>"; };
+ 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDeclContext.cpp; sourceTree = "<group>"; };
+ 26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDeclContext.h; sourceTree = "<group>"; };
260C89CF10F57C5600BB2B04 /* DWARFDefines.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DWARFDefines.cpp; sourceTree = "<group>"; };
260C89D010F57C5600BB2B04 /* DWARFDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDefines.h; sourceTree = "<group>"; };
- 260C89D110F57C5600BB2B04 /* DWARFDIECollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDIECollection.cpp; sourceTree = "<group>"; };
- 260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDIECollection.h; sourceTree = "<group>"; };
+ 26BC7ED810F1B86700F91463 /* DWARFExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DWARFExpression.cpp; path = source/Expression/DWARFExpression.cpp; sourceTree = "<group>"; };
+ 26BC7DC310F1B79500F91463 /* DWARFExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DWARFExpression.h; path = include/lldb/Expression/DWARFExpression.h; sourceTree = "<group>"; };
260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFFormValue.cpp; sourceTree = "<group>"; };
260C89D410F57C5600BB2B04 /* DWARFFormValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFFormValue.h; sourceTree = "<group>"; };
- 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARF.cpp; sourceTree = "<group>"; };
- 260C89DA10F57C5600BB2B04 /* SymbolFileDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARF.h; sourceTree = "<group>"; };
- 260C89DB10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDebugMap.cpp; sourceTree = "<group>"; };
- 260C89DC10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDebugMap.h; sourceTree = "<group>"; };
- 260C89DE10F57C5600BB2B04 /* SymbolFileSymtab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileSymtab.cpp; sourceTree = "<group>"; };
- 260C89DF10F57C5600BB2B04 /* SymbolFileSymtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileSymtab.h; sourceTree = "<group>"; };
- 260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorMacOSX.cpp; sourceTree = "<group>"; };
- 260C89E310F57C5600BB2B04 /* SymbolVendorMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorMacOSX.h; sourceTree = "<group>"; };
- 260CC62115D04377002BF2E0 /* OptionValueArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArgs.h; path = include/lldb/Interpreter/OptionValueArgs.h; sourceTree = "<group>"; };
- 260CC62215D04377002BF2E0 /* OptionValueArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArray.h; path = include/lldb/Interpreter/OptionValueArray.h; sourceTree = "<group>"; };
- 260CC62315D04377002BF2E0 /* OptionValueBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueBoolean.h; path = include/lldb/Interpreter/OptionValueBoolean.h; sourceTree = "<group>"; };
- 260CC62415D04377002BF2E0 /* OptionValueProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueProperties.h; path = include/lldb/Interpreter/OptionValueProperties.h; sourceTree = "<group>"; };
- 260CC62515D04377002BF2E0 /* OptionValueDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueDictionary.h; path = include/lldb/Interpreter/OptionValueDictionary.h; sourceTree = "<group>"; };
- 260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueEnumeration.h; path = include/lldb/Interpreter/OptionValueEnumeration.h; sourceTree = "<group>"; };
- 260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpec.h; path = include/lldb/Interpreter/OptionValueFileSpec.h; sourceTree = "<group>"; };
- 260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpecList.h; path = include/lldb/Interpreter/OptionValueFileSpecList.h; sourceTree = "<group>"; };
- 260CC62915D04377002BF2E0 /* OptionValueFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormat.h; path = include/lldb/Interpreter/OptionValueFormat.h; sourceTree = "<group>"; };
- 260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueSInt64.h; path = include/lldb/Interpreter/OptionValueSInt64.h; sourceTree = "<group>"; };
- 260CC62B15D04377002BF2E0 /* OptionValueString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueString.h; path = include/lldb/Interpreter/OptionValueString.h; sourceTree = "<group>"; };
- 260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUInt64.h; path = include/lldb/Interpreter/OptionValueUInt64.h; sourceTree = "<group>"; };
- 260CC62D15D04377002BF2E0 /* OptionValueUUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUUID.h; path = include/lldb/Interpreter/OptionValueUUID.h; sourceTree = "<group>"; };
- 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArgs.cpp; path = source/Interpreter/OptionValueArgs.cpp; sourceTree = "<group>"; };
- 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArray.cpp; path = source/Interpreter/OptionValueArray.cpp; sourceTree = "<group>"; };
- 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueBoolean.cpp; path = source/Interpreter/OptionValueBoolean.cpp; sourceTree = "<group>"; };
- 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueProperties.cpp; path = source/Interpreter/OptionValueProperties.cpp; sourceTree = "<group>"; };
- 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueDictionary.cpp; path = source/Interpreter/OptionValueDictionary.cpp; sourceTree = "<group>"; };
- 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueEnumeration.cpp; path = source/Interpreter/OptionValueEnumeration.cpp; sourceTree = "<group>"; };
- 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpec.cpp; path = source/Interpreter/OptionValueFileSpec.cpp; sourceTree = "<group>"; };
- 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpecLIst.cpp; path = source/Interpreter/OptionValueFileSpecLIst.cpp; sourceTree = "<group>"; };
- 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormat.cpp; path = source/Interpreter/OptionValueFormat.cpp; sourceTree = "<group>"; };
- 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueSInt64.cpp; path = source/Interpreter/OptionValueSInt64.cpp; sourceTree = "<group>"; };
- 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueString.cpp; path = source/Interpreter/OptionValueString.cpp; sourceTree = "<group>"; };
- 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUInt64.cpp; path = source/Interpreter/OptionValueUInt64.cpp; sourceTree = "<group>"; };
- 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUUID.cpp; path = source/Interpreter/OptionValueUUID.cpp; sourceTree = "<group>"; };
- 260D9B2615EC369500960137 /* ModuleSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleSpec.h; path = include/lldb/Core/ModuleSpec.h; sourceTree = "<group>"; };
- 260E07C3136FA68900CF21D3 /* OptionGroupUUID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUUID.h; path = include/lldb/Interpreter/OptionGroupUUID.h; sourceTree = "<group>"; };
- 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupUUID.cpp; path = source/Interpreter/OptionGroupUUID.cpp; sourceTree = "<group>"; };
- 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFile.cpp; path = source/Interpreter/OptionGroupFile.cpp; sourceTree = "<group>"; };
- 260E07C9136FABAC00CF21D3 /* OptionGroupFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupFile.h; path = include/lldb/Interpreter/OptionGroupFile.h; sourceTree = "<group>"; };
- 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogChannelDWARF.cpp; sourceTree = "<group>"; };
- 26109B3C1155D70100CC3529 /* LogChannelDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogChannelDWARF.h; sourceTree = "<group>"; };
- 2611FEEF142D83060017FEA3 /* SBAddress.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAddress.i; sourceTree = "<group>"; };
- 2611FEF0142D83060017FEA3 /* SBBlock.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBlock.i; sourceTree = "<group>"; };
- 2611FEF1142D83060017FEA3 /* SBBreakpoint.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpoint.i; sourceTree = "<group>"; };
- 2611FEF2142D83060017FEA3 /* SBBreakpointLocation.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpointLocation.i; sourceTree = "<group>"; };
- 2611FEF3142D83060017FEA3 /* SBBroadcaster.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBroadcaster.i; sourceTree = "<group>"; };
- 2611FEF4142D83060017FEA3 /* SBCommandInterpreter.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandInterpreter.i; sourceTree = "<group>"; };
- 2611FEF5142D83060017FEA3 /* SBCommandReturnObject.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandReturnObject.i; sourceTree = "<group>"; };
- 2611FEF6142D83060017FEA3 /* SBCommunication.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommunication.i; sourceTree = "<group>"; };
- 2611FEF7142D83060017FEA3 /* SBCompileUnit.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCompileUnit.i; sourceTree = "<group>"; };
- 2611FEF8142D83060017FEA3 /* SBData.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBData.i; sourceTree = "<group>"; };
- 2611FEF9142D83060017FEA3 /* SBDebugger.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDebugger.i; sourceTree = "<group>"; };
- 2611FEFA142D83060017FEA3 /* SBError.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBError.i; sourceTree = "<group>"; };
- 2611FEFB142D83060017FEA3 /* SBEvent.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBEvent.i; sourceTree = "<group>"; };
- 2611FEFC142D83060017FEA3 /* SBFileSpec.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpec.i; sourceTree = "<group>"; };
- 2611FEFD142D83060017FEA3 /* SBFileSpecList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpecList.i; sourceTree = "<group>"; };
- 2611FEFE142D83060017FEA3 /* SBFrame.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFrame.i; sourceTree = "<group>"; };
- 2611FEFF142D83060017FEA3 /* SBFunction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFunction.i; sourceTree = "<group>"; };
- 2611FF00142D83060017FEA3 /* SBHostOS.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBHostOS.i; sourceTree = "<group>"; };
- 2611FF02142D83060017FEA3 /* SBInstruction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstruction.i; sourceTree = "<group>"; };
- 2611FF03142D83060017FEA3 /* SBInstructionList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstructionList.i; sourceTree = "<group>"; };
- 2611FF04142D83060017FEA3 /* SBLineEntry.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLineEntry.i; sourceTree = "<group>"; };
- 2611FF05142D83060017FEA3 /* SBListener.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBListener.i; sourceTree = "<group>"; };
- 2611FF06142D83060017FEA3 /* SBModule.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBModule.i; sourceTree = "<group>"; };
- 2611FF07142D83060017FEA3 /* SBProcess.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcess.i; sourceTree = "<group>"; };
- 2611FF08142D83060017FEA3 /* SBSection.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSection.i; sourceTree = "<group>"; };
- 2611FF09142D83060017FEA3 /* SBSourceManager.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSourceManager.i; sourceTree = "<group>"; };
- 2611FF0A142D83060017FEA3 /* SBStream.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStream.i; sourceTree = "<group>"; };
- 2611FF0B142D83060017FEA3 /* SBStringList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStringList.i; sourceTree = "<group>"; };
- 2611FF0C142D83060017FEA3 /* SBSymbol.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbol.i; sourceTree = "<group>"; };
- 2611FF0D142D83060017FEA3 /* SBSymbolContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContext.i; sourceTree = "<group>"; };
- 2611FF0E142D83060017FEA3 /* SBSymbolContextList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContextList.i; sourceTree = "<group>"; };
- 2611FF0F142D83060017FEA3 /* SBTarget.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTarget.i; sourceTree = "<group>"; };
- 2611FF10142D83060017FEA3 /* SBThread.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThread.i; sourceTree = "<group>"; };
- 2611FF11142D83060017FEA3 /* SBType.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBType.i; sourceTree = "<group>"; };
- 2611FF12142D83060017FEA3 /* SBValue.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValue.i; sourceTree = "<group>"; };
- 2611FF13142D83060017FEA3 /* SBValueList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValueList.i; sourceTree = "<group>"; };
- 2615DB841208A9C90021781D /* StopInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfo.h; path = include/lldb/Target/StopInfo.h; sourceTree = "<group>"; };
- 2615DB861208A9E40021781D /* StopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfo.cpp; path = source/Target/StopInfo.cpp; sourceTree = "<group>"; };
- 2615DBC81208B5FC0021781D /* StopInfoMachException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfoMachException.cpp; path = Utility/StopInfoMachException.cpp; sourceTree = "<group>"; };
- 2615DBC91208B5FC0021781D /* StopInfoMachException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfoMachException.h; path = Utility/StopInfoMachException.h; sourceTree = "<group>"; };
- 261744771168585B005ADD65 /* SBType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBType.cpp; path = source/API/SBType.cpp; sourceTree = "<group>"; };
- 2617447911685869005ADD65 /* SBType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBType.h; path = include/lldb/API/SBType.h; sourceTree = "<group>"; };
- 2618D78F1240115500F2B8FE /* SectionLoadList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SectionLoadList.h; path = include/lldb/Target/SectionLoadList.h; sourceTree = "<group>"; };
- 2618D7911240116900F2B8FE /* SectionLoadList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionLoadList.cpp; path = source/Target/SectionLoadList.cpp; sourceTree = "<group>"; };
- 2618D957124056C700F2B8FE /* NameToDIE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NameToDIE.h; sourceTree = "<group>"; };
- 2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameToDIE.cpp; sourceTree = "<group>"; };
- 2618EE5B1315B29C001D6D71 /* GDBRemoteCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunication.cpp; sourceTree = "<group>"; };
- 2618EE5C1315B29C001D6D71 /* GDBRemoteCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunication.h; sourceTree = "<group>"; };
- 2618EE5D1315B29C001D6D71 /* GDBRemoteRegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteRegisterContext.cpp; sourceTree = "<group>"; };
- 2618EE5E1315B29C001D6D71 /* GDBRemoteRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteRegisterContext.h; sourceTree = "<group>"; };
- 2618EE5F1315B29C001D6D71 /* ProcessGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessGDBRemote.cpp; sourceTree = "<group>"; };
- 2618EE601315B29C001D6D71 /* ProcessGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessGDBRemote.h; sourceTree = "<group>"; };
- 2618EE611315B29C001D6D71 /* ProcessGDBRemoteLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessGDBRemoteLog.cpp; sourceTree = "<group>"; };
- 2618EE621315B29C001D6D71 /* ProcessGDBRemoteLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessGDBRemoteLog.h; sourceTree = "<group>"; };
- 2618EE631315B29C001D6D71 /* ThreadGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGDBRemote.cpp; sourceTree = "<group>"; };
- 2618EE641315B29C001D6D71 /* ThreadGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGDBRemote.h; sourceTree = "<group>"; };
- 261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharingPtr.cpp; path = source/Utility/SharingPtr.cpp; sourceTree = "<group>"; };
- 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharingPtr.h; path = include/lldb/Utility/SharingPtr.h; sourceTree = "<group>"; };
- 262173A018395D3800C52091 /* SectionLoadHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SectionLoadHistory.h; path = include/lldb/Target/SectionLoadHistory.h; sourceTree = "<group>"; };
- 262173A218395D4600C52091 /* SectionLoadHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionLoadHistory.cpp; path = source/Target/SectionLoadHistory.cpp; sourceTree = "<group>"; };
- 26217930133BC8640083B112 /* lldb-private-types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-private-types.h"; path = "include/lldb/lldb-private-types.h"; sourceTree = "<group>"; };
- 26217932133BCB850083B112 /* lldb-private-enumerations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-private-enumerations.h"; path = "include/lldb/lldb-private-enumerations.h"; sourceTree = "<group>"; };
- 2623096E13D0EFFB006381D9 /* StreamBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamBuffer.h; path = include/lldb/Core/StreamBuffer.h; sourceTree = "<group>"; };
- 2626B6AD143E1BEA00EF935C /* RangeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangeMap.h; path = include/lldb/Core/RangeMap.h; sourceTree = "<group>"; };
- 26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderDarwinKernel.cpp; sourceTree = "<group>"; };
- 26274FA614030F79006BA130 /* DynamicLoaderDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderDarwinKernel.h; sourceTree = "<group>"; };
- 2628A4D313D4977900F5487A /* ThreadKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadKDP.cpp; sourceTree = "<group>"; };
- 2628A4D413D4977900F5487A /* ThreadKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadKDP.h; sourceTree = "<group>"; };
- 262D24E413FB8710002D1960 /* RegisterContextMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMemory.cpp; path = Utility/RegisterContextMemory.cpp; sourceTree = "<group>"; };
- 262D24E513FB8710002D1960 /* RegisterContextMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMemory.h; path = Utility/RegisterContextMemory.h; sourceTree = "<group>"; };
- 262ED0041631FA2800879631 /* OptionGroupString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionGroupString.h; path = include/lldb/Interpreter/OptionGroupString.h; sourceTree = "<group>"; };
- 262ED0071631FA3A00879631 /* OptionGroupString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupString.cpp; path = source/Interpreter/OptionGroupString.cpp; sourceTree = "<group>"; };
- 262F12B41835468600AEB384 /* SBPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBPlatform.cpp; path = source/API/SBPlatform.cpp; sourceTree = "<group>"; };
- 262F12B61835469C00AEB384 /* SBPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBPlatform.h; path = include/lldb/API/SBPlatform.h; sourceTree = "<group>"; };
- 262F12B8183546C900AEB384 /* SBPlatform.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBPlatform.i; sourceTree = "<group>"; };
- 2635879017822E56004C30BA /* SymbolVendorELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorELF.cpp; sourceTree = "<group>"; };
- 2635879117822E56004C30BA /* SymbolVendorELF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorELF.h; sourceTree = "<group>"; };
- 263641151B34AEE200145B2F /* ABISysV_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_mips64.cpp; sourceTree = "<group>"; };
- 263641161B34AEE200145B2F /* ABISysV_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_mips64.h; sourceTree = "<group>"; };
+ 4CD44CF820B37C440003557C /* DWARFIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFIndex.cpp; sourceTree = "<group>"; };
+ 4CD44CFE20B37C570003557C /* DWARFIndex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWARFIndex.h; sourceTree = "<group>"; };
+ 7F2AAA5920601BE000A422D8 /* DWARFUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFUnit.cpp; sourceTree = "<group>"; };
+ 7F2AAA5820601BDF00A422D8 /* DWARFUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFUnit.h; sourceTree = "<group>"; };
+ 26FFC19514FC072100087D58 /* DYLDRendezvous.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DYLDRendezvous.cpp; sourceTree = "<group>"; };
+ 26FFC19614FC072100087D58 /* DYLDRendezvous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYLDRendezvous.h; sourceTree = "<group>"; };
+ 49CA96F01E6AAC8E00C03FEE /* DataBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBuffer.h; path = include/lldb/Utility/DataBuffer.h; sourceTree = "<group>"; };
+ 49CA96E61E6AAC6600C03FEE /* DataBufferHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataBufferHeap.cpp; path = source/Utility/DataBufferHeap.cpp; sourceTree = "<group>"; };
+ 49CA96F11E6AAC8E00C03FEE /* DataBufferHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBufferHeap.h; path = include/lldb/Utility/DataBufferHeap.h; sourceTree = "<group>"; };
+ 49CA96E71E6AAC6600C03FEE /* DataBufferLLVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataBufferLLVM.cpp; path = source/Utility/DataBufferLLVM.cpp; sourceTree = "<group>"; };
+ 49CA96F21E6AAC8E00C03FEE /* DataBufferLLVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBufferLLVM.h; path = include/lldb/Utility/DataBufferLLVM.h; sourceTree = "<group>"; };
+ 49CA96E81E6AAC6600C03FEE /* DataEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataEncoder.cpp; path = source/Utility/DataEncoder.cpp; sourceTree = "<group>"; };
+ 49CA96F31E6AAC8E00C03FEE /* DataEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataEncoder.h; path = include/lldb/Utility/DataEncoder.h; sourceTree = "<group>"; };
+ 49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataExtractor.cpp; path = source/Utility/DataExtractor.cpp; sourceTree = "<group>"; };
+ 49CA96F41E6AAC8E00C03FEE /* DataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataExtractor.h; path = include/lldb/Utility/DataExtractor.h; sourceTree = "<group>"; };
+ 23CB14E81D66CC0E00EDDDE1 /* DataExtractorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DataExtractorTest.cpp; sourceTree = "<group>"; };
+ 94CB255816B069770059775D /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataVisualization.cpp; path = source/DataFormatters/DataVisualization.cpp; sourceTree = "<group>"; };
+ 94CB256016B069800059775D /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; sourceTree = "<group>"; };
+ 3FDFED1E19BA6D55009756A7 /* Debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Debug.h; path = include/lldb/Host/Debug.h; sourceTree = "<group>"; };
+ 23E77CDB1C20F2F2007192AD /* DebugMacros.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DebugMacros.cpp; path = source/Symbol/DebugMacros.cpp; sourceTree = "<group>"; };
+ 6D0F613C1C80AA8900A4ECEE /* DebugMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugMacros.h; path = include/lldb/Symbol/DebugMacros.h; sourceTree = "<group>"; };
+ AF116BED20CF234B0071093F /* DebugNamesDWARFIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DebugNamesDWARFIndex.cpp; sourceTree = "<group>"; };
+ AF116BEE20CF234B0071093F /* DebugNamesDWARFIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DebugNamesDWARFIndex.h; sourceTree = "<group>"; };
+ 265ABF6210F42EE900531910 /* DebugSymbols.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DebugSymbols.framework; path = /System/Library/PrivateFrameworks/DebugSymbols.framework; sourceTree = "<absolute>"; };
263664921140A4930075843B /* Debugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = Debugger.cpp; path = source/Core/Debugger.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
263664941140A4C10075843B /* Debugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = Debugger.h; path = include/lldb/Core/Debugger.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
- 26368A3B126B697600E8659F /* darwin-debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "darwin-debug.cpp"; path = "tools/darwin-debug/darwin-debug.cpp"; sourceTree = "<group>"; };
- 263C4937178B50C40070F12D /* SBModuleSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBModuleSpec.cpp; path = source/API/SBModuleSpec.cpp; sourceTree = "<group>"; };
- 263C4939178B50CF0070F12D /* SBModuleSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBModuleSpec.h; path = include/lldb/API/SBModuleSpec.h; sourceTree = "<group>"; };
- 263C493B178B61CC0070F12D /* SBModuleSpec.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBModuleSpec.i; sourceTree = "<group>"; };
- 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnwindAssembly-x86.cpp"; sourceTree = "<group>"; };
- 263E949E13661AE400E7D1CE /* UnwindAssembly-x86.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnwindAssembly-x86.h"; sourceTree = "<group>"; };
- 263FDE5D1A799F2D00E68013 /* FormatEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FormatEntity.h; path = include/lldb/Core/FormatEntity.h; sourceTree = "<group>"; };
- 263FDE5F1A79A01500E68013 /* FormatEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatEntity.cpp; path = source/Core/FormatEntity.cpp; sourceTree = "<group>"; };
- 263FEDA5112CC1DA00E4C208 /* ThreadSafeSTLMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLMap.h; path = include/lldb/Core/ThreadSafeSTLMap.h; sourceTree = "<group>"; };
- 2640E19E15DC78FD00F23B50 /* Property.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Property.cpp; path = source/Interpreter/Property.cpp; sourceTree = "<group>"; };
- 26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResult.cpp; path = source/Core/ValueObjectConstResult.cpp; sourceTree = "<group>"; };
- 26424E3E125986D30016D82C /* ValueObjectConstResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResult.h; path = include/lldb/Core/ValueObjectConstResult.h; sourceTree = "<group>"; };
- 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfo.h; path = include/lldb/API/SBMemoryRegionInfo.h; sourceTree = "<group>"; };
- 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfoList.h; path = include/lldb/API/SBMemoryRegionInfoList.h; sourceTree = "<group>"; };
- 264297591D1DF2AA003F2BF4 /* SBMemoryRegionInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfo.i; sourceTree = "<group>"; };
- 2642975A1D1DF2AA003F2BF4 /* SBMemoryRegionInfoList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfoList.i; sourceTree = "<group>"; };
- 2642FBA813D003B400ED6808 /* CommunicationKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommunicationKDP.cpp; sourceTree = "<group>"; };
- 2642FBA913D003B400ED6808 /* CommunicationKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommunicationKDP.h; sourceTree = "<group>"; };
- 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessKDP.cpp; sourceTree = "<group>"; };
- 2642FBAB13D003B400ED6808 /* ProcessKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessKDP.h; sourceTree = "<group>"; };
- 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessKDPLog.cpp; sourceTree = "<group>"; };
- 2642FBAD13D003B400ED6808 /* ProcessKDPLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessKDPLog.h; sourceTree = "<group>"; };
- 264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectRegister.cpp; path = source/Core/ValueObjectRegister.cpp; sourceTree = "<group>"; };
- 2643343A1110F63C00CDB6C6 /* ValueObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectRegister.h; path = include/lldb/Core/ValueObjectRegister.h; sourceTree = "<group>"; };
- 264723A511FA076E00DE380C /* CleanUp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CleanUp.h; path = include/lldb/Utility/CleanUp.h; sourceTree = "<group>"; };
- 26474C9F18D0CAEC0073DEBA /* RegisterContext_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_x86.h; path = Utility/RegisterContext_x86.h; sourceTree = "<group>"; };
- 26474CA218D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_i386.cpp; path = Utility/RegisterContextFreeBSD_i386.cpp; sourceTree = "<group>"; };
- 26474CA318D0CB070073DEBA /* RegisterContextFreeBSD_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_i386.h; path = Utility/RegisterContextFreeBSD_i386.h; sourceTree = "<group>"; };
- 26474CA418D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_mips64.cpp; path = Utility/RegisterContextFreeBSD_mips64.cpp; sourceTree = "<group>"; };
- 26474CA518D0CB070073DEBA /* RegisterContextFreeBSD_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_mips64.h; path = Utility/RegisterContextFreeBSD_mips64.h; sourceTree = "<group>"; };
- 26474CA618D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_x86_64.cpp; path = Utility/RegisterContextFreeBSD_x86_64.cpp; sourceTree = "<group>"; };
- 26474CA718D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_x86_64.h; path = Utility/RegisterContextFreeBSD_x86_64.h; sourceTree = "<group>"; };
- 26474CAE18D0CB180073DEBA /* RegisterContextLinux_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_i386.cpp; path = Utility/RegisterContextLinux_i386.cpp; sourceTree = "<group>"; };
- 26474CAF18D0CB180073DEBA /* RegisterContextLinux_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_i386.h; path = Utility/RegisterContextLinux_i386.h; sourceTree = "<group>"; };
- 26474CB018D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_x86_64.cpp; path = Utility/RegisterContextLinux_x86_64.cpp; sourceTree = "<group>"; };
- 26474CB118D0CB180073DEBA /* RegisterContextLinux_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_x86_64.h; path = Utility/RegisterContextLinux_x86_64.h; sourceTree = "<group>"; };
- 26474CB618D0CB2D0073DEBA /* RegisterContextMach_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_arm.cpp; path = Utility/RegisterContextMach_arm.cpp; sourceTree = "<group>"; };
- 26474CB718D0CB2D0073DEBA /* RegisterContextMach_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_arm.h; path = Utility/RegisterContextMach_arm.h; sourceTree = "<group>"; };
- 26474CB818D0CB2D0073DEBA /* RegisterContextMach_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_i386.cpp; path = Utility/RegisterContextMach_i386.cpp; sourceTree = "<group>"; };
- 26474CB918D0CB2D0073DEBA /* RegisterContextMach_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_i386.h; path = Utility/RegisterContextMach_i386.h; sourceTree = "<group>"; };
- 26474CBA18D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_x86_64.cpp; path = Utility/RegisterContextMach_x86_64.cpp; sourceTree = "<group>"; };
- 26474CBB18D0CB2D0073DEBA /* RegisterContextMach_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_x86_64.h; path = Utility/RegisterContextMach_x86_64.h; sourceTree = "<group>"; };
- 26474CC218D0CB5B0073DEBA /* RegisterContextMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMemory.cpp; path = Utility/RegisterContextMemory.cpp; sourceTree = "<group>"; };
- 26474CC318D0CB5B0073DEBA /* RegisterContextMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMemory.h; path = Utility/RegisterContextMemory.h; sourceTree = "<group>"; };
- 26474CC418D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_mips64.cpp; path = Utility/RegisterContextPOSIX_mips64.cpp; sourceTree = "<group>"; };
- 26474CC518D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_mips64.h; path = Utility/RegisterContextPOSIX_mips64.h; sourceTree = "<group>"; };
- 26474CC618D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_x86.cpp; path = Utility/RegisterContextPOSIX_x86.cpp; sourceTree = "<group>"; };
- 26474CC718D0CB5B0073DEBA /* RegisterContextPOSIX_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_x86.h; path = Utility/RegisterContextPOSIX_x86.h; sourceTree = "<group>"; };
- 26474CC818D0CB5B0073DEBA /* RegisterContextPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIX.h; sourceTree = "<group>"; };
- 26474CD018D0CB700073DEBA /* RegisterInfos_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_i386.h; path = Utility/RegisterInfos_i386.h; sourceTree = "<group>"; };
- 26474CD118D0CB710073DEBA /* RegisterInfos_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips64.h; path = Utility/RegisterInfos_mips64.h; sourceTree = "<group>"; };
- 26474CD218D0CB710073DEBA /* RegisterInfos_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_x86_64.h; path = Utility/RegisterInfos_x86_64.h; sourceTree = "<group>"; };
- 26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueRegex.h; path = include/lldb/Interpreter/OptionValueRegex.h; sourceTree = "<group>"; };
- 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueRegex.cpp; path = source/Interpreter/OptionValueRegex.cpp; sourceTree = "<group>"; };
- 264A12FA1372522000875C42 /* EmulateInstructionARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionARM64.cpp; sourceTree = "<group>"; };
- 264A12FB1372522000875C42 /* EmulateInstructionARM64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionARM64.h; sourceTree = "<group>"; };
- 264A12FF137252C700875C42 /* ARM64_DWARF_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM64_DWARF_Registers.h; path = source/Utility/ARM64_DWARF_Registers.h; sourceTree = "<group>"; };
- 264A43BB1320B3B4005B4096 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = include/lldb/Target/Platform.h; sourceTree = "<group>"; };
- 264A43BD1320BCEB005B4096 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = source/Target/Platform.cpp; sourceTree = "<group>"; };
- 264A58EB1A7DBC8C00A6B1B0 /* OptionValueFormatEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormatEntity.h; path = include/lldb/Interpreter/OptionValueFormatEntity.h; sourceTree = "<group>"; };
- 264A58ED1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormatEntity.cpp; path = source/Interpreter/OptionValueFormatEntity.cpp; sourceTree = "<group>"; };
- 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformRemoteGDBServer.cpp; path = "gdb-server/PlatformRemoteGDBServer.cpp"; sourceTree = "<group>"; };
- 264A97BE133918BC0017F0BE /* PlatformRemoteGDBServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformRemoteGDBServer.h; path = "gdb-server/PlatformRemoteGDBServer.h"; sourceTree = "<group>"; };
- 264AD83711095BA600E0B039 /* CommandObjectLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectLog.cpp; path = source/Commands/CommandObjectLog.cpp; sourceTree = "<group>"; };
- 264AD83911095BBD00E0B039 /* CommandObjectLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectLog.h; path = source/Commands/CommandObjectLog.h; sourceTree = "<group>"; };
- 264D8D4E13661BCC003A368F /* UnwindAssembly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UnwindAssembly.h; path = include/lldb/Target/UnwindAssembly.h; sourceTree = "<group>"; };
- 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindAssembly.cpp; path = source/Target/UnwindAssembly.cpp; sourceTree = "<group>"; };
- 265192C41BA8E8F8002F08F6 /* CompilerDecl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompilerDecl.h; path = include/lldb/Symbol/CompilerDecl.h; sourceTree = "<group>"; };
- 265192C51BA8E905002F08F6 /* CompilerDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerDecl.cpp; path = source/Symbol/CompilerDecl.cpp; sourceTree = "<group>"; };
- 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_arm.cpp; sourceTree = "<group>"; };
- 265205A313D3E3F700132FE2 /* RegisterContextKDP_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_arm.h; sourceTree = "<group>"; };
- 265205A413D3E3F700132FE2 /* RegisterContextKDP_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_i386.cpp; sourceTree = "<group>"; };
- 265205A513D3E3F700132FE2 /* RegisterContextKDP_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_i386.h; sourceTree = "<group>"; };
- 265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_x86_64.cpp; sourceTree = "<group>"; };
- 265205A713D3E3F700132FE2 /* RegisterContextKDP_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_x86_64.h; sourceTree = "<group>"; };
- 2654A67F1E54D59400DA1013 /* ModuleCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleCache.cpp; path = source/Target/ModuleCache.cpp; sourceTree = "<group>"; };
- 2654A6811E54D5A200DA1013 /* ModuleCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ModuleCache.h; path = include/lldb/Target/ModuleCache.h; sourceTree = "<group>"; };
- 2654A6821E54D5E200DA1013 /* RegisterNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterNumber.cpp; path = source/Target/RegisterNumber.cpp; sourceTree = "<group>"; };
- 2654A6841E54D5EE00DA1013 /* RegisterNumber.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterNumber.h; path = include/lldb/Target/RegisterNumber.h; sourceTree = "<group>"; };
- 2654A68C1E552D1500DA1013 /* PseudoTerminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PseudoTerminal.cpp; path = source/Host/common/PseudoTerminal.cpp; sourceTree = "<group>"; };
- 2654A68E1E552D2400DA1013 /* PseudoTerminal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PseudoTerminal.h; path = include/lldb/Host/PseudoTerminal.h; sourceTree = "<group>"; };
- 2654A68F1E552ED500DA1013 /* VASprintf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VASprintf.cpp; path = source/Utility/VASprintf.cpp; sourceTree = "<group>"; };
- 2654A6911E552F3C00DA1013 /* UriParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UriParser.h; path = include/lldb/Utility/UriParser.h; sourceTree = "<group>"; };
- 2654A6921E552F4600DA1013 /* VASPrintf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VASPrintf.h; path = include/lldb/Utility/VASPrintf.h; sourceTree = "<group>"; };
- 26579F68126A25920007C5CB /* darwin-debug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwin-debug"; sourceTree = BUILT_PRODUCTS_DIR; };
- 2657AFB51B8690EC00958979 /* CompilerDeclContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CompilerDeclContext.h; path = include/lldb/Symbol/CompilerDeclContext.h; sourceTree = "<group>"; };
- 2657AFB61B86910100958979 /* CompilerDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerDeclContext.cpp; path = source/Symbol/CompilerDeclContext.cpp; sourceTree = "<group>"; };
- 265ABF6210F42EE900531910 /* DebugSymbols.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DebugSymbols.framework; path = /System/Library/PrivateFrameworks/DebugSymbols.framework; sourceTree = "<absolute>"; };
- 265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = debugserver.xcodeproj; path = tools/debugserver/debugserver.xcodeproj; sourceTree = "<group>"; };
- 2660D9F611922A1300958FBD /* StringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractor.cpp; path = source/Utility/StringExtractor.cpp; sourceTree = "<group>"; };
- 2660D9FE11922A7F00958FBD /* ThreadPlanStepUntil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepUntil.cpp; path = source/Target/ThreadPlanStepUntil.cpp; sourceTree = "<group>"; };
- 26651A14133BEC76005B64B7 /* lldb-public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-public.h"; path = "include/lldb/lldb-public.h"; sourceTree = "<group>"; };
- 26651A15133BF9CC005B64B7 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Opcode.h; path = include/lldb/Core/Opcode.h; sourceTree = "<group>"; };
- 26651A17133BF9DF005B64B7 /* Opcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Opcode.cpp; path = source/Core/Opcode.cpp; sourceTree = "<group>"; };
- 2665CD0D15080846002C8FAE /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
+ 49B01A2D15F67B1700666829 /* DeclVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DeclVendor.h; path = include/lldb/Symbol/DeclVendor.h; sourceTree = "<group>"; };
+ 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Declaration.cpp; path = source/Symbol/Declaration.cpp; sourceTree = "<group>"; };
+ 26BC7C5810F1B6E900F91463 /* Declaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Declaration.h; path = include/lldb/Symbol/Declaration.h; sourceTree = "<group>"; };
+ 49E4F6681C9CAD12008487EA /* DiagnosticManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiagnosticManager.cpp; path = source/Expression/DiagnosticManager.cpp; sourceTree = "<group>"; };
+ 49E4F66C1C9CAD2D008487EA /* DiagnosticManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiagnosticManager.h; path = include/lldb/Expression/DiagnosticManager.h; sourceTree = "<group>"; };
+ 26BC7E7610F1B85900F91463 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Disassembler.cpp; path = source/Core/Disassembler.cpp; sourceTree = "<group>"; };
+ 26BC7D5E10F1B77400F91463 /* Disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Disassembler.h; path = include/lldb/Core/Disassembler.h; sourceTree = "<group>"; };
+ B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisassemblerLLVMC.cpp; sourceTree = "<group>"; };
+ B299580C14F2FA1F00050A04 /* DisassemblerLLVMC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisassemblerLLVMC.h; sourceTree = "<group>"; };
+ 2579065E1BD0488D00178368 /* DomainSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DomainSocket.cpp; sourceTree = "<group>"; };
+ 26F5C27310F3D9E4009D5894 /* Driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Driver.cpp; path = tools/driver/Driver.cpp; sourceTree = "<group>"; };
+ 26F5C27410F3D9E4009D5894 /* Driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Driver.h; path = tools/driver/Driver.h; sourceTree = "<group>"; };
+ 4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DumpDataExtractor.cpp; path = source/Core/DumpDataExtractor.cpp; sourceTree = "<group>"; };
+ 4C4EB7821E6A4DE7002035C0 /* DumpDataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DumpDataExtractor.h; path = include/lldb/Core/DumpDataExtractor.h; sourceTree = "<group>"; };
+ AFA585CF2107EB7300D7689A /* DumpRegisterValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DumpRegisterValue.cpp; path = source/Core/DumpRegisterValue.cpp; sourceTree = "<group>"; };
+ 9447DE421BD5963300E67212 /* DumpValueObjectOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DumpValueObjectOptions.cpp; path = source/DataFormatters/DumpValueObjectOptions.cpp; sourceTree = "<group>"; };
+ 9447DE411BD5962900E67212 /* DumpValueObjectOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DumpValueObjectOptions.h; path = include/lldb/DataFormatters/DumpValueObjectOptions.h; sourceTree = "<group>"; };
+ 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicLoader.cpp; path = source/Core/DynamicLoader.cpp; sourceTree = "<group>"; };
+ 26BC7DF110F1B81A00F91463 /* DynamicLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicLoader.h; path = include/lldb/Target/DynamicLoader.h; sourceTree = "<group>"; };
+ AF27AD531D3603EA00CF2833 /* DynamicLoaderDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderDarwin.cpp; sourceTree = "<group>"; };
+ AF27AD541D3603EA00CF2833 /* DynamicLoaderDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderDarwin.h; sourceTree = "<group>"; };
+ 26274FA514030F79006BA130 /* DynamicLoaderDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderDarwinKernel.cpp; sourceTree = "<group>"; };
+ 26274FA614030F79006BA130 /* DynamicLoaderDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderDarwinKernel.h; sourceTree = "<group>"; };
2666ADC11B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderHexagonDYLD.cpp; sourceTree = "<group>"; };
2666ADC21B3CB675001FAFD3 /* DynamicLoaderHexagonDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderHexagonDYLD.h; sourceTree = "<group>"; };
+ AF2907BD1D3F082400E10654 /* DynamicLoaderMacOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOS.cpp; sourceTree = "<group>"; };
+ AF2907BE1D3F082400E10654 /* DynamicLoaderMacOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOS.h; sourceTree = "<group>"; };
+ 260C897A10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOSXDYLD.cpp; sourceTree = "<group>"; };
+ 260C897B10F57C5600BB2B04 /* DynamicLoaderMacOSXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOSXDYLD.h; sourceTree = "<group>"; };
+ 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderPOSIXDYLD.cpp; sourceTree = "<group>"; };
+ 26FFC19814FC072100087D58 /* DynamicLoaderPOSIXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderPOSIXDYLD.h; sourceTree = "<group>"; };
+ 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderStatic.cpp; sourceTree = "<group>"; };
+ 268A683E1321B53B000E3FB8 /* DynamicLoaderStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderStatic.h; sourceTree = "<group>"; };
+ 26F006541B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderWindowsDYLD.cpp; sourceTree = "<group>"; };
+ 26F006551B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderWindowsDYLD.h; sourceTree = "<group>"; };
+ 26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicRegisterInfo.cpp; path = Utility/DynamicRegisterInfo.cpp; sourceTree = "<group>"; };
+ 26954EBD1401EE8B00294D09 /* DynamicRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicRegisterInfo.h; path = Utility/DynamicRegisterInfo.h; sourceTree = "<group>"; };
+ 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ELFHeader.cpp; sourceTree = "<group>"; };
+ 26D27C9E11ED3A4E0024D721 /* ELFHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFHeader.h; sourceTree = "<group>"; };
+ 3FDFE54019A29448009756A7 /* EditLineWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = EditLineWin.cpp; path = source/Host/windows/EditLineWin.cpp; sourceTree = "<group>"; };
+ 26CFDCA2186163A4000E63E5 /* Editline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Editline.cpp; sourceTree = "<group>"; };
+ 26CFDCA01861638D000E63E5 /* Editline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Editline.h; path = include/lldb/Host/Editline.h; sourceTree = "<group>"; };
+ 2326CF511BDD693B00A5CEAC /* EditlineTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditlineTest.cpp; sourceTree = "<group>"; };
+ 9481FE6B1B5F2D9200DED357 /* Either.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Either.h; path = include/lldb/Utility/Either.h; sourceTree = "<group>"; };
+ 26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstruction.cpp; path = source/Core/EmulateInstruction.cpp; sourceTree = "<group>"; };
+ 26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
+ 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionARM.cpp; sourceTree = "<group>"; };
+ 9A22A15E135E30370024DDC3 /* EmulateInstructionARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionARM.h; sourceTree = "<group>"; };
+ 264A12FA1372522000875C42 /* EmulateInstructionARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionARM64.cpp; sourceTree = "<group>"; };
+ 264A12FB1372522000875C42 /* EmulateInstructionARM64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionARM64.h; sourceTree = "<group>"; };
+ E778E99F1B062D1700247609 /* EmulateInstructionMIPS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionMIPS.cpp; sourceTree = "<group>"; };
+ E778E9A01B062D1700247609 /* EmulateInstructionMIPS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionMIPS.h; sourceTree = "<group>"; };
+ 94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstructionMIPS64.cpp; path = MIPS64/EmulateInstructionMIPS64.cpp; sourceTree = "<group>"; };
+ 94A5B3961AB9FE8300A5EE7F /* EmulateInstructionMIPS64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = EmulateInstructionMIPS64.h; path = MIPS64/EmulateInstructionMIPS64.h; sourceTree = "<group>"; };
+ AFDBC36C204663AF00B9C8F2 /* EmulateInstructionPPC64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstructionPPC64.cpp; path = source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp; sourceTree = SOURCE_ROOT; };
+ AFDBC36B204663AF00B9C8F2 /* EmulateInstructionPPC64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstructionPPC64.h; path = source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h; sourceTree = SOURCE_ROOT; };
+ 9A22A15F135E30370024DDC3 /* EmulationStateARM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulationStateARM.cpp; sourceTree = "<group>"; };
+ 9A22A160135E30370024DDC3 /* EmulationStateARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulationStateARM.h; sourceTree = "<group>"; };
+ 26BC7DD310F1B7D500F91463 /* Endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Endian.h; path = include/lldb/Utility/Endian.h; sourceTree = "<group>"; };
+ 22DC561920064C9600A7E9E8 /* Environment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Environment.cpp; path = source/Utility/Environment.cpp; sourceTree = "<group>"; };
+ 6B74D89C2006972D0074051B /* Environment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Environment.h; path = include/lldb/Utility/Environment.h; sourceTree = "<group>"; };
+ 26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = source/Core/Event.cpp; sourceTree = "<group>"; };
+ 26BC7D6110F1B77400F91463 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = include/lldb/Core/Event.h; sourceTree = "<group>"; };
+ 26BC7F3510F1B90C00F91463 /* ExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExecutionContext.cpp; path = source/Target/ExecutionContext.cpp; sourceTree = "<group>"; };
+ 26BC7DF210F1B81A00F91463 /* ExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContext.h; path = include/lldb/Target/ExecutionContext.h; sourceTree = "<group>"; };
+ 26DAFD9711529BC7005A394E /* ExecutionContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContextScope.h; path = include/lldb/Target/ExecutionContextScope.h; sourceTree = "<group>"; };
+ 4C88BC291BA3722B00AA0964 /* Expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Expression.cpp; path = source/Expression/Expression.cpp; sourceTree = "<group>"; };
+ 4C00832C1B9A58A700D5CF24 /* Expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Expression.h; path = include/lldb/Expression/Expression.h; sourceTree = "<group>"; };
+ 4C2479BE1BA39843009C9A7B /* ExpressionParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExpressionParser.h; path = include/lldb/Expression/ExpressionParser.h; sourceTree = "<group>"; };
+ 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionSourceCode.cpp; path = source/Expression/ExpressionSourceCode.cpp; sourceTree = "<group>"; };
+ 49A1CAC11430E21D00306AC9 /* ExpressionSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpressionSourceCode.h; path = include/lldb/Expression/ExpressionSourceCode.h; sourceTree = "<group>"; };
+ 4C29E77D1BA2403F00DFF855 /* ExpressionTypeSystemHelper.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = ExpressionTypeSystemHelper.h; path = include/lldb/Expression/ExpressionTypeSystemHelper.h; sourceTree = "<group>"; };
+ 4984BA151B979973008658D4 /* ExpressionVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionVariable.cpp; path = source/Expression/ExpressionVariable.cpp; sourceTree = "<group>"; };
+ 4984BA171B979C08008658D4 /* ExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpressionVariable.h; path = include/lldb/Expression/ExpressionVariable.h; sourceTree = "<group>"; };
+ AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FastDemangle.cpp; path = source/Utility/FastDemangle.cpp; sourceTree = "<group>"; };
+ AFC2DCED1E6E2F9800283714 /* FastDemangle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FastDemangle.h; path = include/lldb/Utility/FastDemangle.h; sourceTree = "<group>"; };
+ 260C6EA213011581005E16B0 /* File.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = File.cpp; sourceTree = "<group>"; };
+ 260C6EA013011578005E16B0 /* File.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = File.h; path = include/lldb/Host/File.h; sourceTree = "<group>"; };
+ 3FDFDDBC199C3A06009756A7 /* FileAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileAction.cpp; path = source/Target/FileAction.cpp; sourceTree = "<group>"; };
+ 3FDFD6C3199C396E009756A7 /* FileAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileAction.h; path = include/lldb/Target/FileAction.h; sourceTree = "<group>"; };
+ 3FDFDDBE199D345E009756A7 /* FileCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileCache.cpp; path = source/Host/common/FileCache.cpp; sourceTree = "<group>"; };
+ 3FDFDDC0199D34E2009756A7 /* FileCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileCache.h; path = include/lldb/Host/FileCache.h; sourceTree = "<group>"; };
+ 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileLineResolver.cpp; path = source/Core/FileLineResolver.cpp; sourceTree = "<group>"; };
+ 26BD407D135D2AC400237D80 /* FileLineResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileLineResolver.h; path = include/lldb/Core/FileLineResolver.h; sourceTree = "<group>"; };
+ 26FA43171301048600E71120 /* FileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpec.cpp; path = source/Utility/FileSpec.cpp; sourceTree = "<group>"; };
+ 26FA4315130103F400E71120 /* FileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpec.h; path = include/lldb/Utility/FileSpec.h; sourceTree = "<group>"; };
+ 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpecList.cpp; path = source/Core/FileSpecList.cpp; sourceTree = "<group>"; };
+ 26BC7D6310F1B77400F91463 /* FileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpecList.h; path = include/lldb/Core/FileSpecList.h; sourceTree = "<group>"; };
+ 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSpecTest.cpp; sourceTree = "<group>"; };
+ 250D6AE11A9679270049CC70 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = "<group>"; };
+ 3FDFDDC5199D37ED009756A7 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = "<group>"; };
+ 3FDFE54119A29448009756A7 /* FileSystem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = FileSystem.cpp; path = source/Host/windows/FileSystem.cpp; sourceTree = "<group>"; };
+ 3FDFDDC1199D34E2009756A7 /* FileSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileSystem.h; path = include/lldb/Host/FileSystem.h; sourceTree = "<group>"; };
+ 9A20572E1F3B8E7600F6C293 /* FileSystemTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemTest.cpp; sourceTree = "<group>"; };
+ 4CBFF0471F579A36004AFA92 /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flags.h; path = include/lldb/Utility/Flags.h; sourceTree = "<group>"; };
+ 94CB257316B1D3870059775D /* FormatCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatCache.cpp; path = source/DataFormatters/FormatCache.cpp; sourceTree = "<group>"; };
+ 94CB257516B1D3910059775D /* FormatCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatCache.h; path = include/lldb/DataFormatters/FormatCache.h; sourceTree = "<group>"; };
+ 94CB255916B069770059775D /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/DataFormatters/FormatClasses.cpp; sourceTree = "<group>"; };
+ 94CB256116B069800059775D /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/DataFormatters/FormatClasses.h; sourceTree = "<group>"; };
+ 263FDE5F1A79A01500E68013 /* FormatEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatEntity.cpp; path = source/Core/FormatEntity.cpp; sourceTree = "<group>"; };
+ 263FDE5D1A799F2D00E68013 /* FormatEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FormatEntity.h; path = include/lldb/Core/FormatEntity.h; sourceTree = "<group>"; };
+ 94CB255A16B069770059775D /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatManager.cpp; path = source/DataFormatters/FormatManager.cpp; sourceTree = "<group>"; };
+ 94CB256216B069800059775D /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/DataFormatters/FormatManager.h; sourceTree = "<group>"; };
+ 94EE33F218643C6900CD703B /* FormattersContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormattersContainer.h; path = include/lldb/DataFormatters/FormattersContainer.h; sourceTree = "<group>"; };
+ 94D0858B1B9675B8000D24BD /* FormattersHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormattersHelpers.cpp; path = source/DataFormatters/FormattersHelpers.cpp; sourceTree = "<group>"; };
+ 94D0858A1B9675A0000D24BD /* FormattersHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormattersHelpers.h; path = include/lldb/DataFormatters/FormattersHelpers.h; sourceTree = "<group>"; };
+ 2326CF451BDD647400A5CEAC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 260C876910F538E700BB2B04 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
+ AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FreeBSDSignals.cpp; path = Utility/FreeBSDSignals.cpp; sourceTree = "<group>"; };
+ AF23B4DA19009C66003E2A58 /* FreeBSDSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FreeBSDSignals.h; path = Utility/FreeBSDSignals.h; sourceTree = "<group>"; };
+ 23AB052D199FF639003B8084 /* FreeBSDThread.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FreeBSDThread.cpp; sourceTree = "<group>"; };
+ 23AB052E199FF639003B8084 /* FreeBSDThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FreeBSDThread.h; sourceTree = "<group>"; };
+ 961FABB81235DE1600F93A47 /* FuncUnwinders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FuncUnwinders.cpp; path = source/Symbol/FuncUnwinders.cpp; sourceTree = "<group>"; };
+ 269FF07D12494F7D00225026 /* FuncUnwinders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FuncUnwinders.h; path = include/lldb/Symbol/FuncUnwinders.h; sourceTree = "<group>"; };
+ 26BC7F1810F1B8EC00F91463 /* Function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Function.cpp; path = source/Symbol/Function.cpp; sourceTree = "<group>"; };
+ 26BC7C5A10F1B6E900F91463 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Function.h; path = include/lldb/Symbol/Function.h; sourceTree = "<group>"; };
+ 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionCaller.cpp; path = source/Expression/FunctionCaller.cpp; sourceTree = "<group>"; };
+ 4C00832D1B9A58A700D5CF24 /* FunctionCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCaller.h; path = include/lldb/Expression/FunctionCaller.h; sourceTree = "<group>"; };
+ 2374D74E1D4BB299005C9575 /* GDBRemoteClientBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteClientBase.cpp; sourceTree = "<group>"; };
+ 2374D74F1D4BB299005C9575 /* GDBRemoteClientBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteClientBase.h; sourceTree = "<group>"; };
+ 2370A37D1D66C587000E7BE6 /* GDBRemoteClientBaseTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteClientBaseTest.cpp; sourceTree = "<group>"; };
+ 2618EE5B1315B29C001D6D71 /* GDBRemoteCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunication.cpp; sourceTree = "<group>"; };
+ 2618EE5C1315B29C001D6D71 /* GDBRemoteCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunication.h; sourceTree = "<group>"; };
+ 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationClient.cpp; sourceTree = "<group>"; };
+ 26744EEE1338317700EF765A /* GDBRemoteCommunicationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationClient.h; sourceTree = "<group>"; };
+ 2370A37E1D66C587000E7BE6 /* GDBRemoteCommunicationClientTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationClientTest.cpp; sourceTree = "<group>"; };
+ 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServer.cpp; sourceTree = "<group>"; };
+ 26744EF01338317700EF765A /* GDBRemoteCommunicationServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServer.h; sourceTree = "<group>"; };
+ 6D55B28D1A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerCommon.cpp; sourceTree = "<group>"; };
+ 6D55B2931A8A808400A70529 /* GDBRemoteCommunicationServerCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerCommon.h; sourceTree = "<group>"; };
+ 6D55B28E1A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerLLGS.cpp; sourceTree = "<group>"; };
+ 6D55B2941A8A808400A70529 /* GDBRemoteCommunicationServerLLGS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerLLGS.h; sourceTree = "<group>"; };
+ 6D55B28F1A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerPlatform.cpp; sourceTree = "<group>"; };
+ 6D55B2951A8A808400A70529 /* GDBRemoteCommunicationServerPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerPlatform.h; sourceTree = "<group>"; };
+ 2618EE5D1315B29C001D6D71 /* GDBRemoteRegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteRegisterContext.cpp; sourceTree = "<group>"; };
+ 2618EE5E1315B29C001D6D71 /* GDBRemoteRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteRegisterContext.h; sourceTree = "<group>"; };
+ E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GDBRemoteSignals.cpp; path = Utility/GDBRemoteSignals.cpp; sourceTree = "<group>"; };
+ E73A15A51B548EC500786197 /* GDBRemoteSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDBRemoteSignals.h; path = Utility/GDBRemoteSignals.h; sourceTree = "<group>"; };
+ 2370A37F1D66C587000E7BE6 /* GDBRemoteTestUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteTestUtils.cpp; sourceTree = "<group>"; };
+ 2370A3801D66C587000E7BE6 /* GDBRemoteTestUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteTestUtils.h; sourceTree = "<group>"; };
+ AE44FB261BB07DC60033EB62 /* GoAST.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoAST.h; path = ExpressionParser/Go/GoAST.h; sourceTree = "<group>"; };
+ AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoASTContext.cpp; path = source/Symbol/GoASTContext.cpp; sourceTree = "<group>"; };
+ AEEA340F1ACA08A000AB639D /* GoASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoASTContext.h; path = include/lldb/Symbol/GoASTContext.h; sourceTree = "<group>"; };
+ AE44FB4A1BB4BB540033EB62 /* GoFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoFormatterFunctions.cpp; path = Language/Go/GoFormatterFunctions.cpp; sourceTree = "<group>"; };
+ AE44FB4B1BB4BB540033EB62 /* GoFormatterFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoFormatterFunctions.h; path = Language/Go/GoFormatterFunctions.h; sourceTree = "<group>"; };
+ AE44FB451BB4BB090033EB62 /* GoLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLanguage.cpp; path = Language/Go/GoLanguage.cpp; sourceTree = "<group>"; };
+ AE44FB461BB4BB090033EB62 /* GoLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoLanguage.h; path = Language/Go/GoLanguage.h; sourceTree = "<group>"; };
+ AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLanguageRuntime.cpp; path = Go/GoLanguageRuntime.cpp; sourceTree = "<group>"; };
+ AE44FB3C1BB4858A0033EB62 /* GoLanguageRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoLanguageRuntime.h; path = Go/GoLanguageRuntime.h; sourceTree = "<group>"; };
+ AE44FB2A1BB07DD80033EB62 /* GoLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLexer.cpp; path = ExpressionParser/Go/GoLexer.cpp; sourceTree = "<group>"; };
+ AE44FB271BB07DC60033EB62 /* GoLexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoLexer.h; path = ExpressionParser/Go/GoLexer.h; sourceTree = "<group>"; };
+ AE44FB2B1BB07DD80033EB62 /* GoParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoParser.cpp; path = ExpressionParser/Go/GoParser.cpp; sourceTree = "<group>"; };
+ AE44FB281BB07DC60033EB62 /* GoParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoParser.h; path = ExpressionParser/Go/GoParser.h; sourceTree = "<group>"; };
+ AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoParserTest.cpp; sourceTree = "<group>"; };
+ AE44FB2C1BB07DD80033EB62 /* GoUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoUserExpression.cpp; path = ExpressionParser/Go/GoUserExpression.cpp; sourceTree = "<group>"; };
+ AE44FB291BB07DC60033EB62 /* GoUserExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoUserExpression.h; path = ExpressionParser/Go/GoUserExpression.h; sourceTree = "<group>"; };
+ 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HashedNameToDIE.cpp; sourceTree = "<group>"; };
+ 26A0DA4D140F721D006DA411 /* HashedNameToDIE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HashedNameToDIE.h; sourceTree = "<group>"; };
2666ADC31B3CB675001FAFD3 /* HexagonDYLDRendezvous.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HexagonDYLDRendezvous.cpp; sourceTree = "<group>"; };
2666ADC41B3CB675001FAFD3 /* HexagonDYLDRendezvous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HexagonDYLDRendezvous.h; sourceTree = "<group>"; };
+ AF1729D4182C907200E0AB97 /* HistoryThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HistoryThread.cpp; path = Utility/HistoryThread.cpp; sourceTree = "<group>"; };
+ AF061F89182C980000B6A19C /* HistoryThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryThread.h; path = Utility/HistoryThread.h; sourceTree = "<group>"; };
+ AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HistoryUnwind.cpp; path = Utility/HistoryUnwind.cpp; sourceTree = "<group>"; };
+ AF061F8A182C980000B6A19C /* HistoryUnwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryUnwind.h; path = Utility/HistoryUnwind.h; sourceTree = "<group>"; };
+ 233B009D19610D6B0090E598 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
+ 3FDFE54219A29448009756A7 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Host.cpp; path = source/Host/windows/Host.cpp; sourceTree = "<group>"; };
+ 3FDFE55E19AF9B14009756A7 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Host.cpp; path = source/Host/freebsd/Host.cpp; sourceTree = "<group>"; };
+ 69A01E1C1236C5D400C660B5 /* Host.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
+ 26BC7DD410F1B7D500F91463 /* Host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Host.h; path = include/lldb/Host/Host.h; sourceTree = "<group>"; };
+ AFF81FAD20D1CC400010F95E /* Host.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Host.mm; path = source/Host/macosx/objcxx/Host.mm; sourceTree = "<group>"; };
+ 3FDFED1F19BA6D55009756A7 /* HostGetOpt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostGetOpt.h; path = include/lldb/Host/HostGetOpt.h; sourceTree = "<group>"; };
+ 3FDFE53719A2936B009756A7 /* HostInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfo.h; path = include/lldb/Host/HostInfo.h; sourceTree = "<group>"; };
+ 6D55BAE01A8CD03D00A70529 /* HostInfoAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoAndroid.cpp; path = source/Host/android/HostInfoAndroid.cpp; sourceTree = "<group>"; };
+ 6D55BAE41A8CD06000A70529 /* HostInfoAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoAndroid.h; path = include/lldb/Host/android/HostInfoAndroid.h; sourceTree = "<group>"; };
+ 3FDFE53419A29327009756A7 /* HostInfoBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoBase.cpp; sourceTree = "<group>"; };
+ 3FDFE53819A2936B009756A7 /* HostInfoBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoBase.h; path = include/lldb/Host/HostInfoBase.h; sourceTree = "<group>"; };
+ 3FDFE53B19A293B3009756A7 /* HostInfoFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoFreeBSD.cpp; path = source/Host/freebsd/HostInfoFreeBSD.cpp; sourceTree = "<group>"; };
+ 3FDFE53D19A293CA009756A7 /* HostInfoFreeBSD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoFreeBSD.h; path = include/lldb/Host/freebsd/HostInfoFreeBSD.h; sourceTree = "<group>"; };
+ 3FDFE53619A2933E009756A7 /* HostInfoLinux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoLinux.cpp; sourceTree = "<group>"; };
+ 237C577A19AF9D9F00213D59 /* HostInfoLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoLinux.h; path = include/lldb/Host/linux/HostInfoLinux.h; sourceTree = SOURCE_ROOT; };
+ 3FDFE56419AF9B77009756A7 /* HostInfoLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoLinux.h; path = include/lldb/Host/linux/HostInfoLinux.h; sourceTree = SOURCE_ROOT; };
+ 3FDFE52D19A291AF009756A7 /* HostInfoMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfoMacOSX.h; path = include/lldb/Host/macosx/HostInfoMacOSX.h; sourceTree = "<group>"; };
+ AFF81FAB20D1CC400010F95E /* HostInfoMacOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HostInfoMacOSX.mm; path = source/Host/macosx/objcxx/HostInfoMacOSX.mm; sourceTree = "<group>"; };
+ 3FDFE53019A292F0009756A7 /* HostInfoPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoPosix.cpp; sourceTree = "<group>"; };
+ 3FDFE53219A29304009756A7 /* HostInfoPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfoPosix.h; path = ../../../include/lldb/Host/posix/HostInfoPosix.h; sourceTree = "<group>"; };
+ 3FDFE54319A29448009756A7 /* HostInfoWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoWindows.cpp; path = source/Host/windows/HostInfoWindows.cpp; sourceTree = "<group>"; };
+ 3FDFE54919A2946B009756A7 /* HostInfoWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoWindows.h; path = include/lldb/Host/windows/HostInfoWindows.h; sourceTree = "<group>"; };
+ 3FDFED2019BA6D55009756A7 /* HostNativeThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostNativeThread.h; path = include/lldb/Host/HostNativeThread.h; sourceTree = "<group>"; };
+ 3FDFED2419BA6D96009756A7 /* HostNativeThreadBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostNativeThreadBase.cpp; sourceTree = "<group>"; };
+ 3FDFED2119BA6D55009756A7 /* HostNativeThreadBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostNativeThreadBase.h; path = include/lldb/Host/HostNativeThreadBase.h; sourceTree = "<group>"; };
+ 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostProcess.cpp; sourceTree = "<group>"; };
+ 3FDFE57419AFABFD009756A7 /* HostProcess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostProcess.h; path = include/lldb/Host/HostProcess.h; sourceTree = "<group>"; };
+ 3FDFE56A19AF9C44009756A7 /* HostProcessPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostProcessPosix.cpp; sourceTree = "<group>"; };
+ 3FDFE56E19AF9C5A009756A7 /* HostProcessPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostProcessPosix.h; path = ../../../include/lldb/Host/posix/HostProcessPosix.h; sourceTree = "<group>"; };
+ 3FDFE57019AF9CA0009756A7 /* HostProcessWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostProcessWindows.cpp; path = source/Host/windows/HostProcessWindows.cpp; sourceTree = "<group>"; };
+ 3FDFE57219AF9CD3009756A7 /* HostProcessWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostProcessWindows.h; path = include/lldb/Host/windows/HostProcessWindows.h; sourceTree = "<group>"; };
+ 9A20572F1F3B8E7600F6C293 /* HostTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostTest.cpp; sourceTree = "<group>"; };
+ 9A20573C1F3B8EA200F6C293 /* HostTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HostTest.cpp; path = linux/HostTest.cpp; sourceTree = "<group>"; };
+ 3FDFED2519BA6D96009756A7 /* HostThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostThread.cpp; sourceTree = "<group>"; };
+ 3FDFE57519AFABFD009756A7 /* HostThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThread.h; path = include/lldb/Host/HostThread.h; sourceTree = "<group>"; };
+ 3FDFE55F19AF9B14009756A7 /* HostThreadFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostThreadFreeBSD.cpp; path = source/Host/freebsd/HostThreadFreeBSD.cpp; sourceTree = "<group>"; };
+ 3FDFE56019AF9B39009756A7 /* HostThreadFreeBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadFreeBSD.h; path = include/lldb/Host/freebsd/HostThreadFreeBSD.h; sourceTree = "<group>"; };
+ 3FDFE56219AF9B60009756A7 /* HostThreadLinux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HostThreadLinux.cpp; sourceTree = "<group>"; };
+ 3FDFE56519AF9B77009756A7 /* HostThreadLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThreadLinux.h; path = include/lldb/Host/linux/HostThreadLinux.h; sourceTree = SOURCE_ROOT; };
+ 3FDFE56719AF9BB2009756A7 /* HostThreadMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadMacOSX.h; path = include/lldb/Host/macosx/HostThreadMacOSX.h; sourceTree = "<group>"; };
+ AFF81FAC20D1CC400010F95E /* HostThreadMacOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HostThreadMacOSX.mm; path = source/Host/macosx/objcxx/HostThreadMacOSX.mm; sourceTree = "<group>"; };
+ 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostThreadPosix.cpp; sourceTree = "<group>"; };
+ 3FDFE56F19AF9C5A009756A7 /* HostThreadPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadPosix.h; path = ../../../include/lldb/Host/posix/HostThreadPosix.h; sourceTree = "<group>"; };
+ 3FDFE57119AF9CA0009756A7 /* HostThreadWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostThreadWindows.cpp; path = source/Host/windows/HostThreadWindows.cpp; sourceTree = "<group>"; };
+ 3FDFE57319AF9CD3009756A7 /* HostThreadWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThreadWindows.h; path = include/lldb/Host/windows/HostThreadWindows.h; sourceTree = "<group>"; };
+ 260A63181861009E00FECF8E /* IOHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOHandler.cpp; path = source/Core/IOHandler.cpp; sourceTree = "<group>"; };
+ 260A63161861008E00FECF8E /* IOHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOHandler.h; path = include/lldb/Core/IOHandler.h; sourceTree = "<group>"; };
+ 236124A21986B4E2004EFC37 /* IOObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IOObject.cpp; path = source/Utility/IOObject.cpp; sourceTree = "<group>"; };
+ 236124A61986B50E004EFC37 /* IOObject.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IOObject.h; path = include/lldb/Utility/IOObject.h; sourceTree = "<group>"; };
+ 26BC7D6510F1B77400F91463 /* IOStreamMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOStreamMacros.h; path = include/lldb/Core/IOStreamMacros.h; sourceTree = "<group>"; };
+ 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRDynamicChecks.cpp; path = source/Expression/IRDynamicChecks.cpp; sourceTree = "<group>"; };
+ 49CF9833122C718B007A0B96 /* IRDynamicChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRDynamicChecks.h; path = include/lldb/Expression/IRDynamicChecks.h; sourceTree = "<group>"; };
+ 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRExecutionUnit.cpp; path = source/Expression/IRExecutionUnit.cpp; sourceTree = "<group>"; };
+ 4C98D3E1118FB98F00E575D0 /* IRExecutionUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRExecutionUnit.h; path = include/lldb/Expression/IRExecutionUnit.h; sourceTree = "<group>"; };
+ 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRForTarget.cpp; path = ExpressionParser/Clang/IRForTarget.cpp; sourceTree = "<group>"; };
+ 49307AB111DEA4F20081F992 /* IRForTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRForTarget.h; path = ExpressionParser/Clang/IRForTarget.h; sourceTree = "<group>"; };
+ 496B01581406DE8900F830D5 /* IRInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRInterpreter.cpp; path = source/Expression/IRInterpreter.cpp; sourceTree = "<group>"; };
+ 496B015A1406DEB100F830D5 /* IRInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRInterpreter.h; path = include/lldb/Expression/IRInterpreter.h; sourceTree = "<group>"; };
+ 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRMemoryMap.cpp; path = source/Expression/IRMemoryMap.cpp; sourceTree = "<group>"; };
+ 49C66B1C17011A43004D1922 /* IRMemoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IRMemoryMap.h; path = include/lldb/Expression/IRMemoryMap.h; sourceTree = "<group>"; };
+ B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InferiorCallPOSIX.cpp; path = Utility/InferiorCallPOSIX.cpp; sourceTree = "<group>"; };
+ B28058A2139988C6002D96D0 /* InferiorCallPOSIX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InferiorCallPOSIX.h; path = Utility/InferiorCallPOSIX.h; sourceTree = "<group>"; };
+ B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
+ 8CF02ADF19DCBF3B00B14BE0 /* InstrumentationRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = InstrumentationRuntime.cpp; path = source/Target/InstrumentationRuntime.cpp; sourceTree = "<group>"; };
+ 8CF02AE019DCBF3B00B14BE0 /* InstrumentationRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstrumentationRuntime.h; path = include/lldb/Target/InstrumentationRuntime.h; sourceTree = "<group>"; };
+ 8CF02AED19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = InstrumentationRuntimeStopInfo.cpp; path = source/Target/InstrumentationRuntimeStopInfo.cpp; sourceTree = "<group>"; };
+ 8CF02AEE19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstrumentationRuntimeStopInfo.h; path = include/lldb/Target/InstrumentationRuntimeStopInfo.h; sourceTree = "<group>"; };
+ 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ItaniumABILanguageRuntime.cpp; sourceTree = "<group>"; };
+ 4CCA643E13B40B82003BDF98 /* ItaniumABILanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItaniumABILanguageRuntime.h; sourceTree = "<group>"; };
+ 4C73152119B7D71700F865A4 /* Iterable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Iterable.h; path = include/lldb/Utility/Iterable.h; sourceTree = "<group>"; };
+ 26BC179718C7F2B300D2196D /* JITLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JITLoader.cpp; path = source/Target/JITLoader.cpp; sourceTree = "<group>"; };
+ 26BC179B18C7F2CB00D2196D /* JITLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JITLoader.h; path = include/lldb/Target/JITLoader.h; sourceTree = "<group>"; };
+ AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITLoaderGDB.cpp; sourceTree = "<group>"; };
+ AF2BCA6A18C7EFDE005B4526 /* JITLoaderGDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITLoaderGDB.h; sourceTree = "<group>"; };
+ 26BC179818C7F2B300D2196D /* JITLoaderList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JITLoaderList.cpp; path = source/Target/JITLoaderList.cpp; sourceTree = "<group>"; };
+ 26BC179C18C7F2CB00D2196D /* JITLoaderList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JITLoaderList.h; path = include/lldb/Target/JITLoaderList.h; sourceTree = "<group>"; };
+ 942829551A89614C00521B30 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSON.cpp; path = source/Utility/JSON.cpp; sourceTree = "<group>"; };
+ 942829541A89614000521B30 /* JSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSON.h; path = include/lldb/Utility/JSON.h; sourceTree = "<group>"; };
+ 8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSONTest.cpp; sourceTree = "<group>"; };
+ 6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaASTContext.cpp; path = source/Symbol/JavaASTContext.cpp; sourceTree = "<group>"; };
+ 6D0F613D1C80AA8900A4ECEE /* JavaASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaASTContext.h; path = include/lldb/Symbol/JavaASTContext.h; sourceTree = "<group>"; };
+ 6D0F61511C80AB3000A4ECEE /* JavaFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaFormatterFunctions.cpp; path = Language/Java/JavaFormatterFunctions.cpp; sourceTree = "<group>"; };
+ 6D0F61521C80AB3000A4ECEE /* JavaFormatterFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaFormatterFunctions.h; path = Language/Java/JavaFormatterFunctions.h; sourceTree = "<group>"; };
+ 6D0F61531C80AB3000A4ECEE /* JavaLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaLanguage.cpp; path = Language/Java/JavaLanguage.cpp; sourceTree = "<group>"; };
+ 6D0F61541C80AB3000A4ECEE /* JavaLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaLanguage.h; path = Language/Java/JavaLanguage.h; sourceTree = "<group>"; };
+ 6D0F614A1C80AB0400A4ECEE /* JavaLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaLanguageRuntime.cpp; path = Java/JavaLanguageRuntime.cpp; sourceTree = "<group>"; };
+ 6D0F614B1C80AB0400A4ECEE /* JavaLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaLanguageRuntime.h; path = Java/JavaLanguageRuntime.h; sourceTree = "<group>"; };
26680207115FD0ED008E1FE4 /* LLDB.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = LLDB.framework; sourceTree = BUILT_PRODUCTS_DIR; };
- 2669415B1A6DC2AB0063BE93 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = "tools/lldb-mi/CMakeLists.txt"; sourceTree = SOURCE_ROOT; };
- 2669415E1A6DC2AB0063BE93 /* lldb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "lldb-Info.plist"; path = "tools/lldb-mi/lldb-Info.plist"; sourceTree = SOURCE_ROOT; };
- 2669415F1A6DC2AB0063BE93 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = "tools/lldb-mi/Makefile"; sourceTree = SOURCE_ROOT; };
+ 26B42C4C1187ABA50079C8C8 /* LLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLDB.h; path = include/lldb/API/LLDB.h; sourceTree = "<group>"; };
+ 943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLDBAssert.cpp; path = source/Utility/LLDBAssert.cpp; sourceTree = "<group>"; };
+ 943BDEFC1AA7B2DE00789CE8 /* LLDBAssert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLDBAssert.h; path = include/lldb/Utility/LLDBAssert.h; sourceTree = "<group>"; };
+ 236102991CF38A2B00B8E0B9 /* LLDBConfig.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LLDBConfig.cmake; sourceTree = "<group>"; };
+ 6D762BEC1B1605CD006C929D /* LLDBServerUtilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LLDBServerUtilities.cpp; path = "tools/lldb-server/LLDBServerUtilities.cpp"; sourceTree = "<group>"; };
+ 6D762BED1B1605CD006C929D /* LLDBServerUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLDBServerUtilities.h; path = "tools/lldb-server/LLDBServerUtilities.h"; sourceTree = "<group>"; };
+ 2361029A1CF38A2B00B8E0B9 /* LLDBStandalone.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = LLDBStandalone.cmake; sourceTree = "<group>"; };
+ 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = LLDBWrapPython.cpp; sourceTree = BUILT_PRODUCTS_DIR; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLVMUserExpression.cpp; path = source/Expression/LLVMUserExpression.cpp; sourceTree = "<group>"; };
+ AEB0E45A1BD6EA1400B24093 /* LLVMUserExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLVMUserExpression.h; path = include/lldb/Expression/LLVMUserExpression.h; sourceTree = "<group>"; };
+ 94B638521B8F8E6C004FE1E4 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Language.cpp; path = source/Target/Language.cpp; sourceTree = "<group>"; };
+ 94B638511B8F8E53004FE1E4 /* Language.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Language.h; path = include/lldb/Target/Language.h; sourceTree = "<group>"; };
+ 942612F61B95000000EF842E /* LanguageCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageCategory.cpp; path = source/DataFormatters/LanguageCategory.cpp; sourceTree = "<group>"; };
+ 942612F51B94FFE900EF842E /* LanguageCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LanguageCategory.h; path = include/lldb/DataFormatters/LanguageCategory.h; sourceTree = "<group>"; };
+ 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageRuntime.cpp; path = source/Target/LanguageRuntime.cpp; sourceTree = "<group>"; };
+ 4CB4430912491DDA00C13DC2 /* LanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LanguageRuntime.h; path = include/lldb/Target/LanguageRuntime.h; sourceTree = "<group>"; };
+ 26709E311964A34000B94724 /* LaunchServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LaunchServices.framework; path = /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework; sourceTree = "<absolute>"; };
+ 945261B51B9A11E800BF138D /* LibCxx.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxx.cpp; path = Language/CPlusPlus/LibCxx.cpp; sourceTree = "<group>"; };
+ 945261B61B9A11E800BF138D /* LibCxx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibCxx.h; path = Language/CPlusPlus/LibCxx.h; sourceTree = "<group>"; };
+ 9428BC291C6E64DC002A24D7 /* LibCxxAtomic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxAtomic.cpp; path = Language/CPlusPlus/LibCxxAtomic.cpp; sourceTree = "<group>"; };
+ 9428BC2A1C6E64DC002A24D7 /* LibCxxAtomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibCxxAtomic.h; path = Language/CPlusPlus/LibCxxAtomic.h; sourceTree = "<group>"; };
+ AFC67B141FBBB03500860ECB /* LibCxxBitset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxBitset.cpp; path = Language/CPlusPlus/LibCxxBitset.cpp; sourceTree = "<group>"; };
+ 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxInitializerList.cpp; path = Language/CPlusPlus/LibCxxInitializerList.cpp; sourceTree = "<group>"; };
+ 945261B81B9A11E800BF138D /* LibCxxList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxList.cpp; path = Language/CPlusPlus/LibCxxList.cpp; sourceTree = "<group>"; };
+ 945261B91B9A11E800BF138D /* LibCxxMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxMap.cpp; path = Language/CPlusPlus/LibCxxMap.cpp; sourceTree = "<group>"; };
+ AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxQueue.cpp; path = Language/CPlusPlus/LibCxxQueue.cpp; sourceTree = "<group>"; };
+ AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxTuple.cpp; path = Language/CPlusPlus/LibCxxTuple.cpp; sourceTree = "<group>"; };
+ 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxUnorderedMap.cpp; path = Language/CPlusPlus/LibCxxUnorderedMap.cpp; sourceTree = "<group>"; };
+ 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxVector.cpp; path = Language/CPlusPlus/LibCxxVector.cpp; sourceTree = "<group>"; };
+ 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcpp.cpp; path = Language/CPlusPlus/LibStdcpp.cpp; sourceTree = "<group>"; };
+ 945261BD1B9A11E800BF138D /* LibStdcpp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibStdcpp.h; path = Language/CPlusPlus/LibStdcpp.h; sourceTree = "<group>"; };
+ 4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcppTuple.cpp; path = Language/CPlusPlus/LibStdcppTuple.cpp; sourceTree = "<group>"; };
+ 4CDB8D671DBA91A6006C5B13 /* LibStdcppUniquePointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcppUniquePointer.cpp; path = Language/CPlusPlus/LibStdcppUniquePointer.cpp; sourceTree = "<group>"; };
+ 26BC7F1910F1B8EC00F91463 /* LineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineEntry.cpp; path = source/Symbol/LineEntry.cpp; sourceTree = "<group>"; };
+ 26BC7C5B10F1B6E900F91463 /* LineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineEntry.h; path = include/lldb/Symbol/LineEntry.h; sourceTree = "<group>"; };
+ 26BC7F1A10F1B8EC00F91463 /* LineTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineTable.cpp; path = source/Symbol/LineTable.cpp; sourceTree = "<group>"; };
+ 26BC7C5C10F1B6E900F91463 /* LineTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineTable.h; path = include/lldb/Symbol/LineTable.h; sourceTree = "<group>"; };
+ 23059A0519532B96007B8189 /* LinuxSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LinuxSignals.cpp; path = Utility/LinuxSignals.cpp; sourceTree = "<group>"; };
+ 23059A0619532B96007B8189 /* LinuxSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LinuxSignals.h; path = Utility/LinuxSignals.h; sourceTree = "<group>"; };
+ 26BC7E7E10F1B85900F91463 /* Listener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Listener.cpp; path = source/Core/Listener.cpp; sourceTree = "<group>"; };
+ 26BC7D6710F1B77400F91463 /* Listener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Listener.h; path = include/lldb/Core/Listener.h; sourceTree = "<group>"; };
+ 9A3D43E31F3237D500EB767C /* ListenerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListenerTest.cpp; sourceTree = "<group>"; };
+ 255EFF731AFABA720069F277 /* LockFileBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LockFileBase.cpp; sourceTree = "<group>"; };
+ 255EFF751AFABA950069F277 /* LockFilePosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LockFilePosix.cpp; sourceTree = "<group>"; };
+ 255EFF711AFABA4D0069F277 /* LockFileWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LockFileWindows.cpp; path = source/Host/windows/LockFileWindows.cpp; sourceTree = "<group>"; };
+ 255EFF6F1AFABA320069F277 /* LockFileWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LockFileWindows.h; path = include/lldb/Host/windows/LockFileWindows.h; sourceTree = "<group>"; };
+ 26BC7E7F10F1B85900F91463 /* Log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Log.cpp; path = source/Utility/Log.cpp; sourceTree = "<group>"; };
+ 26BC7D6810F1B77400F91463 /* Log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Log.h; path = include/lldb/Utility/Log.h; sourceTree = "<group>"; };
+ 26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogChannelDWARF.cpp; sourceTree = "<group>"; };
+ 26109B3C1155D70100CC3529 /* LogChannelDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogChannelDWARF.h; sourceTree = "<group>"; };
+ 9A3D43C71F3150D200EB767C /* LogTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogTest.cpp; sourceTree = "<group>"; };
+ 3F8160A51AB9F7DD001DA9DF /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Logging.cpp; path = source/Utility/Logging.cpp; sourceTree = "<group>"; };
+ 3F8160A71AB9F809001DA9DF /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = include/lldb/Utility/Logging.h; sourceTree = "<group>"; };
266941601A6DC2AB0063BE93 /* MICmdArgContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgContext.cpp; path = "tools/lldb-mi/MICmdArgContext.cpp"; sourceTree = SOURCE_ROOT; };
266941611A6DC2AB0063BE93 /* MICmdArgContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgContext.h; path = "tools/lldb-mi/MICmdArgContext.h"; sourceTree = SOURCE_ROOT; };
266941621A6DC2AB0063BE93 /* MICmdArgSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgSet.cpp; path = "tools/lldb-mi/MICmdArgSet.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1750,6 +2048,8 @@
266941711A6DC2AC0063BE93 /* MICmdArgValOptionLong.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgValOptionLong.h; path = "tools/lldb-mi/MICmdArgValOptionLong.h"; sourceTree = SOURCE_ROOT; };
266941721A6DC2AC0063BE93 /* MICmdArgValOptionShort.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgValOptionShort.cpp; path = "tools/lldb-mi/MICmdArgValOptionShort.cpp"; sourceTree = SOURCE_ROOT; };
266941731A6DC2AC0063BE93 /* MICmdArgValOptionShort.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgValOptionShort.h; path = "tools/lldb-mi/MICmdArgValOptionShort.h"; sourceTree = SOURCE_ROOT; };
+ 267DFB441B06752A00000FB7 /* MICmdArgValPrintValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgValPrintValues.cpp; path = "tools/lldb-mi/MICmdArgValPrintValues.cpp"; sourceTree = SOURCE_ROOT; };
+ 267DFB451B06752A00000FB7 /* MICmdArgValPrintValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgValPrintValues.h; path = "tools/lldb-mi/MICmdArgValPrintValues.h"; sourceTree = SOURCE_ROOT; };
266941741A6DC2AC0063BE93 /* MICmdArgValString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgValString.cpp; path = "tools/lldb-mi/MICmdArgValString.cpp"; sourceTree = SOURCE_ROOT; };
266941751A6DC2AC0063BE93 /* MICmdArgValString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgValString.h; path = "tools/lldb-mi/MICmdArgValString.h"; sourceTree = SOURCE_ROOT; };
266941761A6DC2AC0063BE93 /* MICmdArgValThreadGrp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgValThreadGrp.cpp; path = "tools/lldb-mi/MICmdArgValThreadGrp.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1772,6 +2072,8 @@
266941871A6DC2AC0063BE93 /* MICmdCmdGdbInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdGdbInfo.h; path = "tools/lldb-mi/MICmdCmdGdbInfo.h"; sourceTree = SOURCE_ROOT; };
266941881A6DC2AC0063BE93 /* MICmdCmdGdbSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdGdbSet.cpp; path = "tools/lldb-mi/MICmdCmdGdbSet.cpp"; sourceTree = SOURCE_ROOT; };
266941891A6DC2AC0063BE93 /* MICmdCmdGdbSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdGdbSet.h; path = "tools/lldb-mi/MICmdCmdGdbSet.h"; sourceTree = SOURCE_ROOT; };
+ AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; sourceTree = SOURCE_ROOT; };
+ AFB3D27F1AC262AB003B4B30 /* MICmdCmdGdbShow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdGdbShow.h; path = "tools/lldb-mi/MICmdCmdGdbShow.h"; sourceTree = SOURCE_ROOT; };
2669418A1A6DC2AC0063BE93 /* MICmdCmdGdbThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdGdbThread.cpp; path = "tools/lldb-mi/MICmdCmdGdbThread.cpp"; sourceTree = SOURCE_ROOT; };
2669418B1A6DC2AC0063BE93 /* MICmdCmdGdbThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdGdbThread.h; path = "tools/lldb-mi/MICmdCmdGdbThread.h"; sourceTree = SOURCE_ROOT; };
2669418C1A6DC2AC0063BE93 /* MICmdCmdMiscellanous.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdMiscellanous.cpp; path = "tools/lldb-mi/MICmdCmdMiscellanous.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1782,6 +2084,8 @@
266941911A6DC2AC0063BE93 /* MICmdCmdSupportInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdSupportInfo.h; path = "tools/lldb-mi/MICmdCmdSupportInfo.h"; sourceTree = SOURCE_ROOT; };
266941921A6DC2AC0063BE93 /* MICmdCmdSupportList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdSupportList.cpp; path = "tools/lldb-mi/MICmdCmdSupportList.cpp"; sourceTree = SOURCE_ROOT; };
266941931A6DC2AC0063BE93 /* MICmdCmdSupportList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdSupportList.h; path = "tools/lldb-mi/MICmdCmdSupportList.h"; sourceTree = SOURCE_ROOT; };
+ 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdSymbol.cpp; path = "tools/lldb-mi/MICmdCmdSymbol.cpp"; sourceTree = SOURCE_ROOT; };
+ 26D52C1E1A980FE300E5D2FB /* MICmdCmdSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdSymbol.h; path = "tools/lldb-mi/MICmdCmdSymbol.h"; sourceTree = SOURCE_ROOT; };
266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdTarget.cpp; path = "tools/lldb-mi/MICmdCmdTarget.cpp"; sourceTree = SOURCE_ROOT; };
266941951A6DC2AC0063BE93 /* MICmdCmdTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdTarget.h; path = "tools/lldb-mi/MICmdCmdTarget.h"; sourceTree = SOURCE_ROOT; };
266941961A6DC2AC0063BE93 /* MICmdCmdThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdThread.cpp; path = "tools/lldb-mi/MICmdCmdThread.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1809,14 +2113,14 @@
266941AC1A6DC2AC0063BE93 /* MICmnConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnConfig.h; path = "tools/lldb-mi/MICmnConfig.h"; sourceTree = SOURCE_ROOT; };
266941AD1A6DC2AC0063BE93 /* MICmnLLDBBroadcaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBBroadcaster.cpp; path = "tools/lldb-mi/MICmnLLDBBroadcaster.cpp"; sourceTree = SOURCE_ROOT; };
266941AE1A6DC2AC0063BE93 /* MICmnLLDBBroadcaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBBroadcaster.h; path = "tools/lldb-mi/MICmnLLDBBroadcaster.h"; sourceTree = SOURCE_ROOT; };
- 266941AF1A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebugger.cpp; path = "tools/lldb-mi/MICmnLLDBDebugger.cpp"; sourceTree = SOURCE_ROOT; };
- 266941B01A6DC2AC0063BE93 /* MICmnLLDBDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebugger.h; path = "tools/lldb-mi/MICmnLLDBDebugger.h"; sourceTree = SOURCE_ROOT; };
- 266941B11A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebuggerHandleEvents.cpp; path = "tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp"; sourceTree = SOURCE_ROOT; };
- 266941B21A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebuggerHandleEvents.h; path = "tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h"; sourceTree = SOURCE_ROOT; };
266941B31A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebugSessionInfo.cpp; path = "tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp"; sourceTree = SOURCE_ROOT; };
266941B41A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebugSessionInfo.h; path = "tools/lldb-mi/MICmnLLDBDebugSessionInfo.h"; sourceTree = SOURCE_ROOT; };
266941B51A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfoVarObj.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebugSessionInfoVarObj.cpp; path = "tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.cpp"; sourceTree = SOURCE_ROOT; };
266941B61A6DC2AC0063BE93 /* MICmnLLDBDebugSessionInfoVarObj.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebugSessionInfoVarObj.h; path = "tools/lldb-mi/MICmnLLDBDebugSessionInfoVarObj.h"; sourceTree = SOURCE_ROOT; };
+ 266941AF1A6DC2AC0063BE93 /* MICmnLLDBDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebugger.cpp; path = "tools/lldb-mi/MICmnLLDBDebugger.cpp"; sourceTree = SOURCE_ROOT; };
+ 266941B01A6DC2AC0063BE93 /* MICmnLLDBDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebugger.h; path = "tools/lldb-mi/MICmnLLDBDebugger.h"; sourceTree = SOURCE_ROOT; };
+ 266941B11A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBDebuggerHandleEvents.cpp; path = "tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.cpp"; sourceTree = SOURCE_ROOT; };
+ 266941B21A6DC2AC0063BE93 /* MICmnLLDBDebuggerHandleEvents.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBDebuggerHandleEvents.h; path = "tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h"; sourceTree = SOURCE_ROOT; };
266941B71A6DC2AC0063BE93 /* MICmnLLDBProxySBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBProxySBValue.cpp; path = "tools/lldb-mi/MICmnLLDBProxySBValue.cpp"; sourceTree = SOURCE_ROOT; };
266941B81A6DC2AC0063BE93 /* MICmnLLDBProxySBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmnLLDBProxySBValue.h; path = "tools/lldb-mi/MICmnLLDBProxySBValue.h"; sourceTree = SOURCE_ROOT; };
266941B91A6DC2AC0063BE93 /* MICmnLLDBUtilSBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmnLLDBUtilSBValue.cpp; path = "tools/lldb-mi/MICmnLLDBUtilSBValue.cpp"; sourceTree = SOURCE_ROOT; };
@@ -1874,1318 +2178,1084 @@
266941F91A6DC2AC0063BE93 /* MIUtilThreadBaseStd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MIUtilThreadBaseStd.h; path = "tools/lldb-mi/MIUtilThreadBaseStd.h"; sourceTree = SOURCE_ROOT; };
266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MIUtilVariant.cpp; path = "tools/lldb-mi/MIUtilVariant.cpp"; sourceTree = SOURCE_ROOT; };
266941FB1A6DC2AC0063BE93 /* MIUtilVariant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MIUtilVariant.h; path = "tools/lldb-mi/MIUtilVariant.h"; sourceTree = SOURCE_ROOT; };
- 266941FD1A6DC2AC0063BE93 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = "tools/lldb-mi/Platform.h"; sourceTree = SOURCE_ROOT; };
- 266960591199F4230075C61A /* build-llvm.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "build-llvm.pl"; sourceTree = "<group>"; };
- 2669605A1199F4230075C61A /* build-swig-wrapper-classes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-wrapper-classes.sh"; sourceTree = "<group>"; };
- 2669605B1199F4230075C61A /* checkpoint-llvm.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "checkpoint-llvm.pl"; sourceTree = "<group>"; };
- 2669605C1199F4230075C61A /* finish-swig-wrapper-classes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "finish-swig-wrapper-classes.sh"; sourceTree = "<group>"; };
- 2669605D1199F4230075C61A /* install-lldb.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-lldb.sh"; sourceTree = "<group>"; };
- 2669605E1199F4230075C61A /* lldb.swig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lldb.swig; sourceTree = "<group>"; };
- 266960601199F4230075C61A /* build-swig-Python.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-Python.sh"; sourceTree = "<group>"; };
- 266960611199F4230075C61A /* edit-swig-python-wrapper-file.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "edit-swig-python-wrapper-file.py"; sourceTree = "<group>"; };
- 266960631199F4230075C61A /* sed-sources */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "sed-sources"; sourceTree = "<group>"; };
- 266DFE9613FD656E00D0C574 /* OperatingSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystem.cpp; path = source/Target/OperatingSystem.cpp; sourceTree = "<group>"; };
- 266DFE9813FD658300D0C574 /* OperatingSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OperatingSystem.h; path = include/lldb/Target/OperatingSystem.h; sourceTree = "<group>"; };
- 266E82951B8CE346008FCA06 /* DWARFDIE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DWARFDIE.h; sourceTree = "<group>"; };
- 266E82961B8CE3AC008FCA06 /* DWARFDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDIE.cpp; sourceTree = "<group>"; };
- 266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFAttribute.cpp; sourceTree = "<group>"; };
- 266F5CBB12FC846200DFCE33 /* Config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/Config.h; sourceTree = "<group>"; };
- 26709E311964A34000B94724 /* LaunchServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = LaunchServices.framework; path = /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework; sourceTree = "<absolute>"; };
- 2670F8111862B44A006B332C /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = /usr/lib/libncurses.dylib; sourceTree = "<absolute>"; };
- 2672D8461189055500FF4019 /* CommandObjectFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectFrame.cpp; path = source/Commands/CommandObjectFrame.cpp; sourceTree = "<group>"; };
- 2672D8471189055500FF4019 /* CommandObjectFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectFrame.h; path = source/Commands/CommandObjectFrame.h; sourceTree = "<group>"; };
- 26744EED1338317700EF765A /* GDBRemoteCommunicationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationClient.cpp; sourceTree = "<group>"; };
- 26744EEE1338317700EF765A /* GDBRemoteCommunicationClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationClient.h; sourceTree = "<group>"; };
- 26744EEF1338317700EF765A /* GDBRemoteCommunicationServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServer.cpp; sourceTree = "<group>"; };
- 26744EF01338317700EF765A /* GDBRemoteCommunicationServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServer.h; sourceTree = "<group>"; };
- 2675F6FE1332BE690067997B /* PlatformRemoteiOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteiOS.cpp; sourceTree = "<group>"; };
- 2675F6FF1332BE690067997B /* PlatformRemoteiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteiOS.h; sourceTree = "<group>"; };
- 26764C951E48F46F008D3573 /* ConstString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ConstString.h; path = include/lldb/Utility/ConstString.h; sourceTree = "<group>"; };
- 26764C961E48F482008D3573 /* ConstString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ConstString.cpp; path = source/Utility/ConstString.cpp; sourceTree = "<group>"; };
- 26764C9B1E48F50C008D3573 /* Stream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Stream.h; path = include/lldb/Utility/Stream.h; sourceTree = "<group>"; };
- 26764C9C1E48F516008D3573 /* RegularExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegularExpression.h; path = include/lldb/Utility/RegularExpression.h; sourceTree = "<group>"; };
- 26764C9D1E48F51E008D3573 /* Stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Stream.cpp; path = source/Utility/Stream.cpp; sourceTree = "<group>"; };
- 26764C9F1E48F528008D3573 /* RegularExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegularExpression.cpp; path = source/Utility/RegularExpression.cpp; sourceTree = "<group>"; };
- 26764CA11E48F547008D3573 /* StreamString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamString.cpp; path = source/Utility/StreamString.cpp; sourceTree = "<group>"; };
- 26764CA31E48F550008D3573 /* StreamString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamString.h; path = include/lldb/Utility/StreamString.h; sourceTree = "<group>"; };
- 26764CA41E48F566008D3573 /* StreamTee.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamTee.h; path = include/lldb/Utility/StreamTee.h; sourceTree = "<group>"; };
- 2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractorGDBRemote.cpp; path = source/Utility/StringExtractorGDBRemote.cpp; sourceTree = "<group>"; };
- 2676A094119C93C8008A98EF /* StringExtractorGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringExtractorGDBRemote.h; path = source/Utility/StringExtractorGDBRemote.h; sourceTree = "<group>"; };
- 267A47F21B14115A0021A5BC /* SoftwareBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SoftwareBreakpoint.h; path = include/lldb/Host/common/SoftwareBreakpoint.h; sourceTree = "<group>"; };
+ D67521351EA17C3900439694 /* MainLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainLoop.cpp; sourceTree = "<group>"; };
+ 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainLoopTest.cpp; sourceTree = "<group>"; };
+ 8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MainThreadCheckerRuntime.cpp; sourceTree = "<group>"; };
+ 8C3BD9931EF45D9B0016C343 /* MainThreadCheckerRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainThreadCheckerRuntime.h; sourceTree = "<group>"; };
+ 2665CD0D15080846002C8FAE /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
+ 2669415F1A6DC2AB0063BE93 /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; name = Makefile; path = "tools/lldb-mi/Makefile"; sourceTree = SOURCE_ROOT; };
+ 26BC7E8010F1B85900F91463 /* Mangled.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mangled.cpp; path = source/Core/Mangled.cpp; sourceTree = "<group>"; };
+ 26BC7D6910F1B77400F91463 /* Mangled.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mangled.h; path = include/lldb/Core/Mangled.h; sourceTree = "<group>"; };
+ 4F29D3CD21010F84003B549A /* MangledTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MangledTest.cpp; sourceTree = "<group>"; };
+ 4CD44CF920B37C440003557C /* ManualDWARFIndex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ManualDWARFIndex.cpp; sourceTree = "<group>"; };
+ 4CD44D0020B37C580003557C /* ManualDWARFIndex.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ManualDWARFIndex.h; sourceTree = "<group>"; };
+ 2682100C143A59AE004BCF2D /* MappedHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MappedHash.h; path = include/lldb/Core/MappedHash.h; sourceTree = "<group>"; };
+ 49DCF700170E70120092F75E /* Materializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Materializer.cpp; path = source/Expression/Materializer.cpp; sourceTree = "<group>"; };
+ 49DCF6FF170E6FD90092F75E /* Materializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Materializer.h; path = include/lldb/Expression/Materializer.h; sourceTree = "<group>"; };
+ 2690B3701381D5C300ECFBAE /* Memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Memory.cpp; path = source/Target/Memory.cpp; sourceTree = "<group>"; };
+ 2690B36F1381D5B600ECFBAE /* Memory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Memory.h; path = include/lldb/Target/Memory.h; sourceTree = "<group>"; };
+ 8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryHistory.cpp; path = source/Target/MemoryHistory.cpp; sourceTree = "<group>"; };
+ 8C2D6A54197A1EBE006989C9 /* MemoryHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MemoryHistory.h; path = include/lldb/Target/MemoryHistory.h; sourceTree = "<group>"; };
+ 8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryHistoryASan.cpp; sourceTree = "<group>"; };
+ 8C2D6A5B197A1FDC006989C9 /* MemoryHistoryASan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryHistoryASan.h; sourceTree = "<group>"; };
+ 2360092C193FB21500189DB1 /* MemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MemoryRegionInfo.h; path = include/lldb/Target/MemoryRegionInfo.h; sourceTree = "<group>"; };
+ 9A2057061F3B818600F6C293 /* MemoryRegionInfoTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryRegionInfoTest.cpp; path = Target/MemoryRegionInfoTest.cpp; sourceTree = "<group>"; };
+ 23E2E5371D9048FB006F38BB /* MinidumpParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpParser.cpp; sourceTree = "<group>"; };
+ 23E2E5381D9048FB006F38BB /* MinidumpParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinidumpParser.h; sourceTree = "<group>"; };
+ 23E2E51A1D9036F2006F38BB /* MinidumpParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpParserTest.cpp; sourceTree = "<group>"; };
+ 23E2E5391D9048FB006F38BB /* MinidumpTypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MinidumpTypes.cpp; sourceTree = "<group>"; };
+ 23E2E53A1D9048FB006F38BB /* MinidumpTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MinidumpTypes.h; sourceTree = "<group>"; };
+ 26B75B421AD6E29A001F7A57 /* MipsLinuxSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MipsLinuxSignals.cpp; path = Utility/MipsLinuxSignals.cpp; sourceTree = "<group>"; };
+ 26B75B431AD6E29A001F7A57 /* MipsLinuxSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MipsLinuxSignals.h; path = Utility/MipsLinuxSignals.h; sourceTree = "<group>"; };
+ 9A1890321F47D5D400394BCA /* MockTildeExpressionResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MockTildeExpressionResolver.cpp; path = TestingSupport/MockTildeExpressionResolver.cpp; sourceTree = "<group>"; };
+ 9A1890331F47D5D400394BCA /* MockTildeExpressionResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockTildeExpressionResolver.h; path = TestingSupport/MockTildeExpressionResolver.h; sourceTree = "<group>"; };
+ 26BC7E8110F1B85900F91463 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Module.cpp; path = source/Core/Module.cpp; sourceTree = "<group>"; };
+ 26BC7D6A10F1B77400F91463 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Module.h; path = include/lldb/Core/Module.h; sourceTree = "<group>"; };
+ 2654A67F1E54D59400DA1013 /* ModuleCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleCache.cpp; path = source/Target/ModuleCache.cpp; sourceTree = "<group>"; };
+ 2654A6811E54D5A200DA1013 /* ModuleCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ModuleCache.h; path = include/lldb/Target/ModuleCache.h; sourceTree = "<group>"; };
+ AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleCacheTest.cpp; path = Target/ModuleCacheTest.cpp; sourceTree = "<group>"; };
+ 26BC7E8210F1B85900F91463 /* ModuleChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleChild.cpp; path = source/Core/ModuleChild.cpp; sourceTree = "<group>"; };
+ 26BC7D6B10F1B77400F91463 /* ModuleChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleChild.h; path = include/lldb/Core/ModuleChild.h; sourceTree = "<group>"; };
+ 26BC7E8310F1B85900F91463 /* ModuleList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleList.cpp; path = source/Core/ModuleList.cpp; sourceTree = "<group>"; };
+ 26BC7D6C10F1B77400F91463 /* ModuleList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleList.h; path = include/lldb/Core/ModuleList.h; sourceTree = "<group>"; };
+ 260D9B2615EC369500960137 /* ModuleSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleSpec.h; path = include/lldb/Core/ModuleSpec.h; sourceTree = "<group>"; };
+ 949EEDA41BA765B5008C63CF /* NSArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSArray.cpp; path = Language/ObjC/NSArray.cpp; sourceTree = "<group>"; };
+ 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSDictionary.cpp; path = Language/ObjC/NSDictionary.cpp; sourceTree = "<group>"; };
+ 94B9E50E1BBEFDFE000A48DC /* NSDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSDictionary.h; path = Language/ObjC/NSDictionary.h; sourceTree = "<group>"; };
+ 940495781BEC497E00926025 /* NSError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSError.cpp; path = Language/ObjC/NSError.cpp; sourceTree = "<group>"; };
+ 940495791BEC497E00926025 /* NSException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSException.cpp; path = Language/ObjC/NSException.cpp; sourceTree = "<group>"; };
+ 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSIndexPath.cpp; path = Language/ObjC/NSIndexPath.cpp; sourceTree = "<group>"; };
+ 949EEDA71BA765B5008C63CF /* NSSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSSet.cpp; path = Language/ObjC/NSSet.cpp; sourceTree = "<group>"; };
+ 94B9E50F1BBF0069000A48DC /* NSSet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSSet.h; path = Language/ObjC/NSSet.h; sourceTree = "<group>"; };
+ 94B9E5111BBF20F4000A48DC /* NSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSString.cpp; path = Language/ObjC/NSString.cpp; sourceTree = "<group>"; };
+ 94B9E5101BBF20B7000A48DC /* NSString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSString.h; path = Language/ObjC/NSString.h; sourceTree = "<group>"; };
+ 3F8169181ABA2419001DA9DF /* NameMatches.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NameMatches.cpp; path = source/Utility/NameMatches.cpp; sourceTree = "<group>"; };
+ 3F81691C1ABA242B001DA9DF /* NameMatches.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NameMatches.h; path = include/lldb/Utility/NameMatches.h; sourceTree = "<group>"; };
+ 9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameMatchesTest.cpp; sourceTree = "<group>"; };
+ 2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameToDIE.cpp; sourceTree = "<group>"; };
+ 2618D957124056C700F2B8FE /* NameToDIE.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NameToDIE.h; sourceTree = "<group>"; };
+ 232CB60B191E00CC00EF39FC /* NativeBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeBreakpoint.cpp; path = source/Host/common/NativeBreakpoint.cpp; sourceTree = "<group>"; };
267A47F31B14116E0021A5BC /* NativeBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeBreakpoint.h; path = include/lldb/Host/common/NativeBreakpoint.h; sourceTree = "<group>"; };
+ 232CB60D191E00CC00EF39FC /* NativeBreakpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeBreakpointList.cpp; path = source/Host/common/NativeBreakpointList.cpp; sourceTree = "<group>"; };
267A47F41B1411750021A5BC /* NativeBreakpointList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeBreakpointList.h; path = include/lldb/Host/common/NativeBreakpointList.h; sourceTree = "<group>"; };
+ 232CB60F191E00CC00EF39FC /* NativeProcessProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = NativeProcessProtocol.cpp; path = source/Host/common/NativeProcessProtocol.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
267A47F51B14117F0021A5BC /* NativeProcessProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeProcessProtocol.h; path = include/lldb/Host/common/NativeProcessProtocol.h; sourceTree = "<group>"; };
+ 23EDE3301926839700F6A132 /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Host/common/NativeRegisterContext.cpp; sourceTree = "<group>"; };
+ 267A47FA1B1411C40021A5BC /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Host/common/NativeRegisterContext.cpp; sourceTree = "<group>"; };
+ 23EDE3311926843600F6A132 /* NativeRegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Host/common/NativeRegisterContext.h; sourceTree = "<group>"; };
267A47F61B14118F0021A5BC /* NativeRegisterContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContext.h; path = include/lldb/Host/common/NativeRegisterContext.h; sourceTree = "<group>"; };
+ 23F403481926CC250046DC9B /* NativeRegisterContextRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContextRegisterInfo.cpp; path = Utility/NativeRegisterContextRegisterInfo.cpp; sourceTree = "<group>"; };
+ 23F403471926C8D50046DC9B /* NativeRegisterContextRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NativeRegisterContextRegisterInfo.h; path = Utility/NativeRegisterContextRegisterInfo.h; sourceTree = "<group>"; };
+ 232CB611191E00CC00EF39FC /* NativeThreadProtocol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeThreadProtocol.cpp; path = source/Host/common/NativeThreadProtocol.cpp; sourceTree = "<group>"; };
267A47F81B1411A40021A5BC /* NativeThreadProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeThreadProtocol.h; path = include/lldb/Host/common/NativeThreadProtocol.h; sourceTree = "<group>"; };
- 267A47F91B1411AC0021A5BC /* NativeWatchpointList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeWatchpointList.h; path = include/lldb/Host/common/NativeWatchpointList.h; sourceTree = "<group>"; };
- 267A47FA1B1411C40021A5BC /* NativeRegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeRegisterContext.cpp; path = source/Host/common/NativeRegisterContext.cpp; sourceTree = "<group>"; };
267A47FE1B1411D90021A5BC /* NativeWatchpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NativeWatchpointList.cpp; path = source/Host/common/NativeWatchpointList.cpp; sourceTree = "<group>"; };
- 267A48001B1411E40021A5BC /* XML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XML.cpp; path = source/Host/common/XML.cpp; sourceTree = "<group>"; };
- 267A48031B1416080021A5BC /* XML.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = XML.h; path = include/lldb/Host/XML.h; sourceTree = "<group>"; };
- 267C0128136880C7006E963E /* OptionGroupValueObjectDisplay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupValueObjectDisplay.h; path = include/lldb/Interpreter/OptionGroupValueObjectDisplay.h; sourceTree = "<group>"; };
- 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupValueObjectDisplay.cpp; path = source/Interpreter/OptionGroupValueObjectDisplay.cpp; sourceTree = "<group>"; };
- 267DFB441B06752A00000FB7 /* MICmdArgValPrintValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdArgValPrintValues.cpp; path = "tools/lldb-mi/MICmdArgValPrintValues.cpp"; sourceTree = SOURCE_ROOT; };
- 267DFB451B06752A00000FB7 /* MICmdArgValPrintValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdArgValPrintValues.h; path = "tools/lldb-mi/MICmdArgValPrintValues.h"; sourceTree = SOURCE_ROOT; };
- 267F68471CC02DED0086832B /* ABISysV_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_s390x.cpp; sourceTree = "<group>"; };
- 267F68481CC02DED0086832B /* ABISysV_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_s390x.h; sourceTree = "<group>"; };
- 267F684D1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_s390x.cpp; sourceTree = "<group>"; };
- 267F684E1CC02E270086832B /* RegisterContextPOSIXCore_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_s390x.h; sourceTree = "<group>"; };
- 267F68511CC02E920086832B /* RegisterContextLinux_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_s390x.cpp; path = Utility/RegisterContextLinux_s390x.cpp; sourceTree = "<group>"; };
- 267F68521CC02E920086832B /* RegisterContextLinux_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_s390x.h; path = Utility/RegisterContextLinux_s390x.h; sourceTree = "<group>"; };
- 267F68551CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_s390x.cpp; path = Utility/RegisterContextPOSIX_s390x.cpp; sourceTree = "<group>"; };
- 267F68561CC02EAE0086832B /* RegisterContextPOSIX_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_s390x.h; path = Utility/RegisterContextPOSIX_s390x.h; sourceTree = "<group>"; };
- 267F68591CC02EBE0086832B /* RegisterInfos_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_s390x.h; path = Utility/RegisterInfos_s390x.h; sourceTree = "<group>"; };
- 2682100C143A59AE004BCF2D /* MappedHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MappedHash.h; path = include/lldb/Core/MappedHash.h; sourceTree = "<group>"; };
- 2682F284115EF3A700CCFF99 /* SBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBError.cpp; path = source/API/SBError.cpp; sourceTree = "<group>"; };
- 2682F286115EF3BD00CCFF99 /* SBError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBError.h; path = include/lldb/API/SBError.h; sourceTree = "<group>"; };
- 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.posix.plist; path = tools/debugserver/source/com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
- 268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.internal.plist; path = tools/debugserver/source/com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
- 268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.internal.plist; path = tools/debugserver/source/com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
+ 267A47F91B1411AC0021A5BC /* NativeWatchpointList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NativeWatchpointList.h; path = include/lldb/Host/common/NativeWatchpointList.h; sourceTree = "<group>"; };
+ AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetBSDSignals.cpp; path = Utility/NetBSDSignals.cpp; sourceTree = "<group>"; };
+ AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetBSDSignals.h; path = Utility/NetBSDSignals.h; sourceTree = "<group>"; };
+ 4CC7C6551D52996C0076FF94 /* OCamlASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OCamlASTContext.cpp; path = source/Symbol/OCamlASTContext.cpp; sourceTree = "<group>"; };
+ 4CC7C64D1D5298E20076FF94 /* OCamlLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OCamlLanguage.cpp; path = Language/OCaml/OCamlLanguage.cpp; sourceTree = "<group>"; };
+ 4CC7C64C1D5298E20076FF94 /* OCamlLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OCamlLanguage.h; path = Language/OCaml/OCamlLanguage.h; sourceTree = "<group>"; };
+ 94B6385E1B8FB7A2004FE1E4 /* ObjCLanguage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguage.cpp; path = Language/ObjC/ObjCLanguage.cpp; sourceTree = "<group>"; };
+ 94B6385F1B8FB7A2004FE1E4 /* ObjCLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ObjCLanguage.h; path = Language/ObjC/ObjCLanguage.h; sourceTree = "<group>"; };
+ 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguageRuntime.cpp; path = source/Target/ObjCLanguageRuntime.cpp; sourceTree = "<group>"; };
+ 4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCLanguageRuntime.h; path = include/lldb/Target/ObjCLanguageRuntime.h; sourceTree = "<group>"; };
+ 94B638621B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCPlusPlusLanguage.cpp; path = Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp; sourceTree = "<group>"; };
+ 94B638611B8FB7E9004FE1E4 /* ObjCPlusPlusLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ObjCPlusPlusLanguage.h; path = Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h; sourceTree = "<group>"; };
+ 26BC7C5D10F1B6E900F91463 /* ObjectContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectContainer.h; path = include/lldb/Symbol/ObjectContainer.h; sourceTree = "<group>"; };
+ 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerBSDArchive.cpp; sourceTree = "<group>"; };
+ 26A3B4AD1181454800381BC2 /* ObjectContainerBSDArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectContainerBSDArchive.h; sourceTree = "<group>"; };
+ 260C898010F57C5600BB2B04 /* ObjectContainerUniversalMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerUniversalMachO.cpp; sourceTree = "<group>"; };
+ 260C898110F57C5600BB2B04 /* ObjectContainerUniversalMachO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectContainerUniversalMachO.h; sourceTree = "<group>"; };
+ 26BC7F4C10F1BC1A00F91463 /* ObjectFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectFile.cpp; path = source/Symbol/ObjectFile.cpp; sourceTree = "<group>"; };
+ 26BC7C5E10F1B6E900F91463 /* ObjectFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectFile.h; path = include/lldb/Symbol/ObjectFile.h; sourceTree = "<group>"; };
+ 260C898510F57C5600BB2B04 /* ObjectFileELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileELF.cpp; sourceTree = "<group>"; };
+ 260C898610F57C5600BB2B04 /* ObjectFileELF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileELF.h; sourceTree = "<group>"; };
+ 26EFC4CA18CFAF0D00865D87 /* ObjectFileJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileJIT.cpp; sourceTree = "<group>"; };
+ 26EFC4CB18CFAF0D00865D87 /* ObjectFileJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileJIT.h; sourceTree = "<group>"; };
+ 260C898810F57C5600BB2B04 /* ObjectFileMachO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileMachO.cpp; sourceTree = "<group>"; };
+ 260C898910F57C5600BB2B04 /* ObjectFileMachO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileMachO.h; sourceTree = "<group>"; };
+ 26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFilePECOFF.cpp; sourceTree = "<group>"; };
+ 26E152241419CACA007967D0 /* ObjectFilePECOFF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectFilePECOFF.h; sourceTree = "<group>"; };
+ 26651A17133BF9DF005B64B7 /* Opcode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Opcode.cpp; path = source/Core/Opcode.cpp; sourceTree = "<group>"; };
+ 26651A15133BF9CC005B64B7 /* Opcode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Opcode.h; path = include/lldb/Core/Opcode.h; sourceTree = "<group>"; };
+ 266DFE9613FD656E00D0C574 /* OperatingSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystem.cpp; path = source/Target/OperatingSystem.cpp; sourceTree = "<group>"; };
+ 266DFE9813FD658300D0C574 /* OperatingSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OperatingSystem.h; path = include/lldb/Target/OperatingSystem.h; sourceTree = "<group>"; };
+ AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystemGo.cpp; path = Go/OperatingSystemGo.cpp; sourceTree = "<group>"; };
+ AE8F624819EF3E1E00326B21 /* OperatingSystemGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OperatingSystemGo.h; path = Go/OperatingSystemGo.h; sourceTree = "<group>"; };
+ 2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OperatingSystemPython.cpp; sourceTree = "<group>"; };
+ 2698699915E6CBD0002415FF /* OperatingSystemPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatingSystemPython.h; sourceTree = "<group>"; };
+ 4C719394207D235400FDF430 /* OptionArgParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionArgParser.cpp; path = source/Interpreter/OptionArgParser.cpp; sourceTree = "<group>"; };
+ 4C719397207D237100FDF430 /* OptionArgParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionArgParser.h; path = include/lldb/Interpreter/OptionArgParser.h; sourceTree = "<group>"; };
+ 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupArchitecture.cpp; path = source/Interpreter/OptionGroupArchitecture.cpp; sourceTree = "<group>"; };
+ 26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupArchitecture.h; path = include/lldb/Interpreter/OptionGroupArchitecture.h; sourceTree = "<group>"; };
2686536B1370ACB200D186A3 /* OptionGroupBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupBoolean.cpp; path = source/Interpreter/OptionGroupBoolean.cpp; sourceTree = "<group>"; };
2686536D1370ACC600D186A3 /* OptionGroupBoolean.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupBoolean.h; path = include/lldb/Interpreter/OptionGroupBoolean.h; sourceTree = "<group>"; };
- 2686536E1370AE5A00D186A3 /* OptionGroupUInt64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUInt64.h; path = include/lldb/Interpreter/OptionGroupUInt64.h; sourceTree = "<group>"; };
+ 260E07C7136FAB9200CF21D3 /* OptionGroupFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFile.cpp; path = source/Interpreter/OptionGroupFile.cpp; sourceTree = "<group>"; };
+ 260E07C9136FABAC00CF21D3 /* OptionGroupFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupFile.h; path = include/lldb/Interpreter/OptionGroupFile.h; sourceTree = "<group>"; };
+ 26BCFC511368AE38006DC050 /* OptionGroupFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFormat.cpp; path = source/Interpreter/OptionGroupFormat.cpp; sourceTree = "<group>"; };
+ 26BCFC4F1368ADF7006DC050 /* OptionGroupFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupFormat.h; path = include/lldb/Interpreter/OptionGroupFormat.h; sourceTree = "<group>"; };
+ 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupOutputFile.cpp; path = source/Interpreter/OptionGroupOutputFile.cpp; sourceTree = "<group>"; };
+ 26BCFC541368B4B8006DC050 /* OptionGroupOutputFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupOutputFile.h; path = include/lldb/Interpreter/OptionGroupOutputFile.h; sourceTree = "<group>"; };
+ 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupPlatform.cpp; path = source/Interpreter/OptionGroupPlatform.cpp; sourceTree = "<group>"; };
+ 26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupPlatform.h; path = include/lldb/Interpreter/OptionGroupPlatform.h; sourceTree = "<group>"; };
+ 262ED0071631FA3A00879631 /* OptionGroupString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupString.cpp; path = source/Interpreter/OptionGroupString.cpp; sourceTree = "<group>"; };
+ 262ED0041631FA2800879631 /* OptionGroupString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionGroupString.h; path = include/lldb/Interpreter/OptionGroupString.h; sourceTree = "<group>"; };
2686536F1370AE7200D186A3 /* OptionGroupUInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupUInt64.cpp; path = source/Interpreter/OptionGroupUInt64.cpp; sourceTree = "<group>"; };
- 26879CE51333F5750012C1F8 /* CommandObjectPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlatform.h; path = source/Commands/CommandObjectPlatform.h; sourceTree = "<group>"; };
- 26879CE71333F58B0012C1F8 /* CommandObjectPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectPlatform.cpp; path = source/Commands/CommandObjectPlatform.cpp; sourceTree = "<group>"; };
- 2689B0A4113EE3CD00A4AEDB /* Symbols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbols.h; path = include/lldb/Host/Symbols.h; sourceTree = "<group>"; };
- 2689B0B5113EE47E00A4AEDB /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symbols.cpp; path = source/Host/macosx/Symbols.cpp; sourceTree = "<group>"; };
- 2689FFCA13353D7A00698AC0 /* liblldb-core.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "liblldb-core.a"; sourceTree = BUILT_PRODUCTS_DIR; };
- 268A683D1321B53B000E3FB8 /* DynamicLoaderStatic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderStatic.cpp; sourceTree = "<group>"; };
- 268A683E1321B53B000E3FB8 /* DynamicLoaderStatic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderStatic.h; sourceTree = "<group>"; };
- 268A813F115B19D000F645B0 /* UniqueCStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UniqueCStringMap.h; path = include/lldb/Core/UniqueCStringMap.h; sourceTree = "<group>"; };
- 268DA871130095D000C9483A /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Terminal.h; path = include/lldb/Host/Terminal.h; sourceTree = "<group>"; };
- 268DA873130095ED00C9483A /* Terminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Terminal.cpp; sourceTree = "<group>"; };
- 268F9D52123AA15200B91E9B /* SBSymbolContextList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbolContextList.h; path = include/lldb/API/SBSymbolContextList.h; sourceTree = "<group>"; };
- 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbolContextList.cpp; path = source/API/SBSymbolContextList.cpp; sourceTree = "<group>"; };
- 2690B36F1381D5B600ECFBAE /* Memory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Memory.h; path = include/lldb/Target/Memory.h; sourceTree = "<group>"; };
- 2690B3701381D5C300ECFBAE /* Memory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Memory.cpp; path = source/Target/Memory.cpp; sourceTree = "<group>"; };
- 2690CD171A6DC0D000E717C8 /* lldb-mi */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-mi"; sourceTree = BUILT_PRODUCTS_DIR; };
- 2692BA13136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnwindAssemblyInstEmulation.cpp; sourceTree = "<group>"; };
- 2692BA14136610C100F9E14D /* UnwindAssemblyInstEmulation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnwindAssemblyInstEmulation.h; sourceTree = "<group>"; };
- 269416AD119A024800FF2715 /* CommandObjectTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectTarget.cpp; path = source/Commands/CommandObjectTarget.cpp; sourceTree = "<group>"; };
- 269416AE119A024800FF2715 /* CommandObjectTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectTarget.h; path = source/Commands/CommandObjectTarget.h; sourceTree = "<group>"; };
+ 2686536E1370AE5A00D186A3 /* OptionGroupUInt64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUInt64.h; path = include/lldb/Interpreter/OptionGroupUInt64.h; sourceTree = "<group>"; };
+ 260E07C5136FA69E00CF21D3 /* OptionGroupUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupUUID.cpp; path = source/Interpreter/OptionGroupUUID.cpp; sourceTree = "<group>"; };
+ 260E07C3136FA68900CF21D3 /* OptionGroupUUID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupUUID.h; path = include/lldb/Interpreter/OptionGroupUUID.h; sourceTree = "<group>"; };
+ 267C012A136880DF006E963E /* OptionGroupValueObjectDisplay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupValueObjectDisplay.cpp; path = source/Interpreter/OptionGroupValueObjectDisplay.cpp; sourceTree = "<group>"; };
+ 267C0128136880C7006E963E /* OptionGroupValueObjectDisplay.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupValueObjectDisplay.h; path = include/lldb/Interpreter/OptionGroupValueObjectDisplay.h; sourceTree = "<group>"; };
+ 26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupVariable.cpp; path = source/Interpreter/OptionGroupVariable.cpp; sourceTree = "<group>"; };
+ 26ED3D6F13C5638A0017D45E /* OptionGroupVariable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupVariable.h; path = include/lldb/Interpreter/OptionGroupVariable.h; sourceTree = "<group>"; };
+ B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupWatchpoint.cpp; path = source/Interpreter/OptionGroupWatchpoint.cpp; sourceTree = "<group>"; };
+ B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupWatchpoint.h; path = include/lldb/Interpreter/OptionGroupWatchpoint.h; sourceTree = "<group>"; };
+ A36FF33B17D8E94600244D40 /* OptionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionParser.cpp; sourceTree = "<group>"; };
+ A36FF33D17D8E98800244D40 /* OptionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionParser.h; path = include/lldb/Host/OptionParser.h; sourceTree = "<group>"; };
+ 26A7A034135E6E4200FB369E /* OptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValue.cpp; path = source/Interpreter/OptionValue.cpp; sourceTree = "<group>"; };
+ 26A7A036135E6E5300FB369E /* OptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValue.h; path = include/lldb/Interpreter/OptionValue.h; sourceTree = "<group>"; };
+ 2697A39215E404B1003E682C /* OptionValueArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArch.cpp; path = source/Interpreter/OptionValueArch.cpp; sourceTree = "<group>"; };
+ 2697A39415E404BA003E682C /* OptionValueArch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArch.h; path = include/lldb/Interpreter/OptionValueArch.h; sourceTree = "<group>"; };
+ 260CC63B15D0440D002BF2E0 /* OptionValueArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArgs.cpp; path = source/Interpreter/OptionValueArgs.cpp; sourceTree = "<group>"; };
+ 260CC62115D04377002BF2E0 /* OptionValueArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArgs.h; path = include/lldb/Interpreter/OptionValueArgs.h; sourceTree = "<group>"; };
+ 260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArray.cpp; path = source/Interpreter/OptionValueArray.cpp; sourceTree = "<group>"; };
+ 260CC62215D04377002BF2E0 /* OptionValueArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArray.h; path = include/lldb/Interpreter/OptionValueArray.h; sourceTree = "<group>"; };
+ 260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueBoolean.cpp; path = source/Interpreter/OptionValueBoolean.cpp; sourceTree = "<group>"; };
+ 260CC62315D04377002BF2E0 /* OptionValueBoolean.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueBoolean.h; path = include/lldb/Interpreter/OptionValueBoolean.h; sourceTree = "<group>"; };
+ 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueChar.cpp; path = source/Interpreter/OptionValueChar.cpp; sourceTree = "<group>"; };
+ 25420ECE1A64911B009ADBCB /* OptionValueChar.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValueChar.h; path = include/lldb/Interpreter/OptionValueChar.h; sourceTree = "<group>"; };
+ 260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueDictionary.cpp; path = source/Interpreter/OptionValueDictionary.cpp; sourceTree = "<group>"; };
+ 260CC62515D04377002BF2E0 /* OptionValueDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueDictionary.h; path = include/lldb/Interpreter/OptionValueDictionary.h; sourceTree = "<group>"; };
+ 260CC64015D0440D002BF2E0 /* OptionValueEnumeration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueEnumeration.cpp; path = source/Interpreter/OptionValueEnumeration.cpp; sourceTree = "<group>"; };
+ 260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueEnumeration.h; path = include/lldb/Interpreter/OptionValueEnumeration.h; sourceTree = "<group>"; };
+ 260CC64115D0440D002BF2E0 /* OptionValueFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpec.cpp; path = source/Interpreter/OptionValueFileSpec.cpp; sourceTree = "<group>"; };
+ 260CC62715D04377002BF2E0 /* OptionValueFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpec.h; path = include/lldb/Interpreter/OptionValueFileSpec.h; sourceTree = "<group>"; };
+ 260CC64215D0440D002BF2E0 /* OptionValueFileSpecLIst.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFileSpecLIst.cpp; path = source/Interpreter/OptionValueFileSpecLIst.cpp; sourceTree = "<group>"; };
+ 260CC62815D04377002BF2E0 /* OptionValueFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFileSpecList.h; path = include/lldb/Interpreter/OptionValueFileSpecList.h; sourceTree = "<group>"; };
+ 260CC64315D0440D002BF2E0 /* OptionValueFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormat.cpp; path = source/Interpreter/OptionValueFormat.cpp; sourceTree = "<group>"; };
+ 260CC62915D04377002BF2E0 /* OptionValueFormat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormat.h; path = include/lldb/Interpreter/OptionValueFormat.h; sourceTree = "<group>"; };
+ 264A58ED1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueFormatEntity.cpp; path = source/Interpreter/OptionValueFormatEntity.cpp; sourceTree = "<group>"; };
+ 264A58EB1A7DBC8C00A6B1B0 /* OptionValueFormatEntity.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueFormatEntity.h; path = include/lldb/Interpreter/OptionValueFormatEntity.h; sourceTree = "<group>"; };
+ 946216C11A97C080006E19CC /* OptionValueLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueLanguage.cpp; path = source/Interpreter/OptionValueLanguage.cpp; sourceTree = "<group>"; };
+ 946216BF1A97C055006E19CC /* OptionValueLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueLanguage.h; path = include/lldb/Interpreter/OptionValueLanguage.h; sourceTree = "<group>"; };
+ 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValuePathMappings.cpp; path = source/Interpreter/OptionValuePathMappings.cpp; sourceTree = "<group>"; };
+ 26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValuePathMappings.h; path = include/lldb/Interpreter/OptionValuePathMappings.h; sourceTree = "<group>"; };
+ 260CC63E15D0440D002BF2E0 /* OptionValueProperties.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueProperties.cpp; path = source/Interpreter/OptionValueProperties.cpp; sourceTree = "<group>"; };
+ 260CC62415D04377002BF2E0 /* OptionValueProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueProperties.h; path = include/lldb/Interpreter/OptionValueProperties.h; sourceTree = "<group>"; };
+ 26491E3D15E1DB9F00CBFFC2 /* OptionValueRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueRegex.cpp; path = source/Interpreter/OptionValueRegex.cpp; sourceTree = "<group>"; };
+ 26491E3A15E1DB8600CBFFC2 /* OptionValueRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueRegex.h; path = include/lldb/Interpreter/OptionValueRegex.h; sourceTree = "<group>"; };
+ 260CC64415D0440D002BF2E0 /* OptionValueSInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueSInt64.cpp; path = source/Interpreter/OptionValueSInt64.cpp; sourceTree = "<group>"; };
+ 260CC62A15D04377002BF2E0 /* OptionValueSInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueSInt64.h; path = include/lldb/Interpreter/OptionValueSInt64.h; sourceTree = "<group>"; };
+ 260CC64515D0440D002BF2E0 /* OptionValueString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueString.cpp; path = source/Interpreter/OptionValueString.cpp; sourceTree = "<group>"; };
+ 260CC62B15D04377002BF2E0 /* OptionValueString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueString.h; path = include/lldb/Interpreter/OptionValueString.h; sourceTree = "<group>"; };
+ 260CC64615D0440D002BF2E0 /* OptionValueUInt64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUInt64.cpp; path = source/Interpreter/OptionValueUInt64.cpp; sourceTree = "<group>"; };
+ 260CC62C15D04377002BF2E0 /* OptionValueUInt64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUInt64.h; path = include/lldb/Interpreter/OptionValueUInt64.h; sourceTree = "<group>"; };
+ 260CC64715D0440D002BF2E0 /* OptionValueUUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueUUID.cpp; path = source/Interpreter/OptionValueUUID.cpp; sourceTree = "<group>"; };
+ 260CC62D15D04377002BF2E0 /* OptionValueUUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueUUID.h; path = include/lldb/Interpreter/OptionValueUUID.h; sourceTree = "<group>"; };
+ 260A248D15D06C4F009981B0 /* OptionValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValues.h; path = include/lldb/Interpreter/OptionValues.h; sourceTree = "<group>"; };
+ 26BC7E8610F1B85900F91463 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Options.cpp; path = source/Interpreter/Options.cpp; sourceTree = "<group>"; };
+ 26BC7D6D10F1B77400F91463 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Options.h; path = include/lldb/Interpreter/Options.h; sourceTree = "<group>"; };
+ 4C562CC21CC07DDD00C52EAC /* PDBASTParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PDBASTParser.cpp; path = PDB/PDBASTParser.cpp; sourceTree = "<group>"; };
+ 4C562CC31CC07DDD00C52EAC /* PDBASTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDBASTParser.h; path = PDB/PDBASTParser.h; sourceTree = "<group>"; };
+ 4CA0C6CA20F929C600CFE6BB /* PDBLocationToDWARFExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PDBLocationToDWARFExpression.cpp; path = PDB/PDBLocationToDWARFExpression.cpp; sourceTree = "<group>"; };
+ 4CA0C6CB20F929C700CFE6BB /* PDBLocationToDWARFExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDBLocationToDWARFExpression.h; path = PDB/PDBLocationToDWARFExpression.h; sourceTree = "<group>"; };
+ AF3F54B21B3BA5D500186E73 /* POSIXStopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = POSIXStopInfo.cpp; sourceTree = "<group>"; };
+ AF3F54B31B3BA5D500186E73 /* POSIXStopInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = POSIXStopInfo.h; sourceTree = "<group>"; };
+ 495BBACB119A0DBE00418BEA /* PathMappingList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathMappingList.cpp; path = source/Target/PathMappingList.cpp; sourceTree = "<group>"; };
+ 495BBACF119A0DE700418BEA /* PathMappingList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathMappingList.h; path = include/lldb/Target/PathMappingList.h; sourceTree = "<group>"; };
+ 2668A2ED20AF417D00D94111 /* PathMappingListTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathMappingListTest.cpp; path = Target/PathMappingListTest.cpp; sourceTree = "<group>"; };
+ 260A39A519647A3A004B4130 /* Pipe.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Pipe.h; path = include/lldb/Host/Pipe.h; sourceTree = "<group>"; };
+ 25420ED11A649D88009ADBCB /* PipeBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipeBase.cpp; sourceTree = "<group>"; };
+ 3F5E8AF31A40D4A500A73232 /* PipeBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PipeBase.h; path = include/lldb/Host/PipeBase.h; sourceTree = "<group>"; };
+ 2377C2F719E613C100737875 /* PipePosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PipePosix.cpp; sourceTree = "<group>"; };
+ 255EFF701AFABA320069F277 /* PipeWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PipeWindows.h; path = include/lldb/Host/windows/PipeWindows.h; sourceTree = "<group>"; };
+ 264A43BD1320BCEB005B4096 /* Platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Platform.cpp; path = source/Target/Platform.cpp; sourceTree = "<group>"; };
+ 264A43BB1320B3B4005B4096 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = include/lldb/Target/Platform.h; sourceTree = "<group>"; };
+ 266941FD1A6DC2AC0063BE93 /* Platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Platform.h; path = "tools/lldb-mi/Platform.h"; sourceTree = SOURCE_ROOT; };
+ 6D55BAE91A8CD08C00A70529 /* PlatformAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAndroid.cpp; sourceTree = "<group>"; };
+ 6D55BAEA1A8CD08C00A70529 /* PlatformAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAndroid.h; sourceTree = "<group>"; };
+ 6D55BAEB1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAndroidRemoteGDBServer.cpp; sourceTree = "<group>"; };
+ 6D55BAEC1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAndroidRemoteGDBServer.h; sourceTree = "<group>"; };
+ 9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleSimulator.cpp; sourceTree = "<group>"; };
+ 9455630B1BEAD0570073F75F /* PlatformAppleSimulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAppleSimulator.h; sourceTree = "<group>"; };
+ AF8AD62A1BEC28A400150209 /* PlatformAppleTVSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleTVSimulator.cpp; sourceTree = "<group>"; };
+ AF8AD62B1BEC28A400150209 /* PlatformAppleTVSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformAppleTVSimulator.h; sourceTree = "<group>"; };
+ AF8AD62C1BEC28A400150209 /* PlatformAppleWatchSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleWatchSimulator.cpp; sourceTree = "<group>"; };
+ AF8AD62D1BEC28A400150209 /* PlatformAppleWatchSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformAppleWatchSimulator.h; sourceTree = "<group>"; };
+ 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwin.cpp; sourceTree = "<group>"; };
+ 2697A54C133A6305004E4240 /* PlatformDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwin.h; sourceTree = "<group>"; };
+ AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwinKernel.cpp; sourceTree = "<group>"; };
+ AF254E30170CCC33007AE5C9 /* PlatformDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwinKernel.h; sourceTree = "<group>"; };
+ 9A20571A1F3B866F00F6C293 /* PlatformDarwinTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformDarwinTest.cpp; path = Platform/PlatformDarwinTest.cpp; sourceTree = "<group>"; };
2694E99A14FC0BB30076DE67 /* PlatformFreeBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformFreeBSD.cpp; sourceTree = "<group>"; };
2694E99B14FC0BB30076DE67 /* PlatformFreeBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformFreeBSD.h; sourceTree = "<group>"; };
+ 23042D101976CA0A00621B2C /* PlatformKalimba.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformKalimba.cpp; sourceTree = "<group>"; };
+ 23042D111976CA0A00621B2C /* PlatformKalimba.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformKalimba.h; sourceTree = "<group>"; };
2694E9A114FC0BBD0076DE67 /* PlatformLinux.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformLinux.cpp; sourceTree = "<group>"; };
2694E9A214FC0BBD0076DE67 /* PlatformLinux.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformLinux.h; sourceTree = "<group>"; };
- 26954EBC1401EE8B00294D09 /* DynamicRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicRegisterInfo.cpp; path = Utility/DynamicRegisterInfo.cpp; sourceTree = "<group>"; };
- 26954EBD1401EE8B00294D09 /* DynamicRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicRegisterInfo.h; path = Utility/DynamicRegisterInfo.h; sourceTree = "<group>"; };
+ 26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMacOSX.cpp; sourceTree = "<group>"; };
+ 26C5577C132575AD008FD8FE /* PlatformMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMacOSX.h; sourceTree = "<group>"; };
+ 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformNetBSD.cpp; sourceTree = "<group>"; };
+ 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformNetBSD.h; sourceTree = "<group>"; };
+ 4CE4EFA61E8999B000A80C06 /* PlatformOpenBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformOpenBSD.cpp; sourceTree = "<group>"; };
+ 4CE4EFA71E8999B000A80C06 /* PlatformOpenBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformOpenBSD.h; sourceTree = "<group>"; };
+ 945759651534941F005A9070 /* PlatformPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformPOSIX.cpp; path = POSIX/PlatformPOSIX.cpp; sourceTree = "<group>"; };
+ 945759661534941F005A9070 /* PlatformPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformPOSIX.h; path = POSIX/PlatformPOSIX.h; sourceTree = "<group>"; };
+ AF8AD6331BEC28C400150209 /* PlatformRemoteAppleTV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteAppleTV.cpp; sourceTree = "<group>"; };
+ AF8AD6341BEC28C400150209 /* PlatformRemoteAppleTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteAppleTV.h; sourceTree = "<group>"; };
+ AF8AD6351BEC28C400150209 /* PlatformRemoteAppleWatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteAppleWatch.cpp; sourceTree = "<group>"; };
+ AF8AD6361BEC28C400150209 /* PlatformRemoteAppleWatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteAppleWatch.h; sourceTree = "<group>"; };
+ AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteDarwinDevice.cpp; sourceTree = "<group>"; };
+ AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteDarwinDevice.h; sourceTree = "<group>"; };
+ 264A97BD133918BC0017F0BE /* PlatformRemoteGDBServer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformRemoteGDBServer.cpp; path = "gdb-server/PlatformRemoteGDBServer.cpp"; sourceTree = "<group>"; };
+ 264A97BE133918BC0017F0BE /* PlatformRemoteGDBServer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformRemoteGDBServer.h; path = "gdb-server/PlatformRemoteGDBServer.h"; sourceTree = "<group>"; };
+ 2675F6FE1332BE690067997B /* PlatformRemoteiOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteiOS.cpp; sourceTree = "<group>"; };
+ 2675F6FF1332BE690067997B /* PlatformRemoteiOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteiOS.h; sourceTree = "<group>"; };
+ 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformWindows.cpp; sourceTree = "<group>"; };
+ 490A36BE180F0E6F00BA31F8 /* PlatformWindows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWindows.h; sourceTree = "<group>"; };
+ 26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformiOSSimulator.cpp; sourceTree = "<group>"; };
+ 26B7564D14F89356008D9CB3 /* PlatformiOSSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformiOSSimulator.h; sourceTree = "<group>"; };
+ AFB1682620D1D4CC00A74F25 /* PlatformiOSSimulatorCoreSimulatorSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PlatformiOSSimulatorCoreSimulatorSupport.h; path = objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h; sourceTree = "<group>"; };
+ AFF81FB220D1CC910010F95E /* PlatformiOSSimulatorCoreSimulatorSupport.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = PlatformiOSSimulatorCoreSimulatorSupport.mm; path = source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm; sourceTree = SOURCE_ROOT; };
+ 26BC7D7010F1B77400F91463 /* PluginInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginInterface.h; path = include/lldb/Core/PluginInterface.h; sourceTree = "<group>"; };
+ 26BC7E8A10F1B85900F91463 /* PluginManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginManager.cpp; path = source/Core/PluginManager.cpp; sourceTree = "<group>"; };
+ 26BC7D7110F1B77400F91463 /* PluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginManager.h; path = include/lldb/Core/PluginManager.h; sourceTree = "<group>"; };
+ 26BC7DD610F1B7D500F91463 /* Predicate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Predicate.h; path = include/lldb/Host/Predicate.h; sourceTree = "<group>"; };
+ 26BC7F3610F1B90C00F91463 /* Process.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Process.cpp; path = source/Target/Process.cpp; sourceTree = "<group>"; };
+ 26BC7DF310F1B81A00F91463 /* Process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Process.h; path = include/lldb/Target/Process.h; sourceTree = "<group>"; };
+ 26BC17A218C7F4CB00D2196D /* ProcessElfCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessElfCore.cpp; sourceTree = "<group>"; };
+ 26BC17A318C7F4CB00D2196D /* ProcessElfCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessElfCore.h; sourceTree = "<group>"; };
+ 23AB052F199FF639003B8084 /* ProcessFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessFreeBSD.cpp; sourceTree = "<group>"; };
+ 23AB0530199FF639003B8084 /* ProcessFreeBSD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessFreeBSD.h; sourceTree = "<group>"; };
+ 2618EE5F1315B29C001D6D71 /* ProcessGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessGDBRemote.cpp; sourceTree = "<group>"; };
+ 2618EE601315B29C001D6D71 /* ProcessGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessGDBRemote.h; sourceTree = "<group>"; };
+ 2618EE611315B29C001D6D71 /* ProcessGDBRemoteLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessGDBRemoteLog.cpp; sourceTree = "<group>"; };
+ 2618EE621315B29C001D6D71 /* ProcessGDBRemoteLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessGDBRemoteLog.h; sourceTree = "<group>"; };
+ 233B007B1960C9E60090E598 /* ProcessInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessInfo.cpp; path = source/Target/ProcessInfo.cpp; sourceTree = "<group>"; };
+ 233B007A1960A0440090E598 /* ProcessInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessInfo.h; path = include/lldb/Target/ProcessInfo.h; sourceTree = "<group>"; };
+ 2642FBAA13D003B400ED6808 /* ProcessKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessKDP.cpp; sourceTree = "<group>"; };
+ 2642FBAB13D003B400ED6808 /* ProcessKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessKDP.h; sourceTree = "<group>"; };
+ 2642FBAC13D003B400ED6808 /* ProcessKDPLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessKDPLog.cpp; sourceTree = "<group>"; };
+ 2642FBAD13D003B400ED6808 /* ProcessKDPLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessKDPLog.h; sourceTree = "<group>"; };
+ 233B007E1960CB280090E598 /* ProcessLaunchInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessLaunchInfo.cpp; path = source/Target/ProcessLaunchInfo.cpp; sourceTree = "<group>"; };
+ 233B007919609DB40090E598 /* ProcessLaunchInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessLaunchInfo.h; path = include/lldb/Target/ProcessLaunchInfo.h; sourceTree = "<group>"; };
+ 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMachCore.cpp; sourceTree = "<group>"; };
+ 26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMachCore.h; sourceTree = "<group>"; };
+ 26BC17BA18C7F4FA00D2196D /* ProcessMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMessage.cpp; sourceTree = "<group>"; };
+ 26BC17BB18C7F4FA00D2196D /* ProcessMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMessage.h; sourceTree = "<group>"; };
+ 947CF7701DC7B1EE00EF980B /* ProcessMinidump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMinidump.cpp; sourceTree = "<group>"; };
+ 947CF76F1DC7B1E300EF980B /* ProcessMinidump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessMinidump.h; sourceTree = "<group>"; };
+ 23AB0531199FF639003B8084 /* ProcessMonitor.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMonitor.cpp; sourceTree = "<group>"; };
+ 23AB0532199FF639003B8084 /* ProcessMonitor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessMonitor.h; sourceTree = "<group>"; };
+ 26BC17BE18C7F4FA00D2196D /* ProcessPOSIXLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessPOSIXLog.cpp; sourceTree = "<group>"; };
+ 26BC17BF18C7F4FA00D2196D /* ProcessPOSIXLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessPOSIXLog.h; sourceTree = "<group>"; };
+ 3FDFE54519A29448009756A7 /* ProcessRunLock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessRunLock.cpp; path = source/Host/windows/ProcessRunLock.cpp; sourceTree = "<group>"; };
+ AF37E10917C861F20061E18E /* ProcessRunLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessRunLock.cpp; sourceTree = "<group>"; };
+ 3FDFED2219BA6D55009756A7 /* ProcessRunLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessRunLock.h; path = include/lldb/Host/ProcessRunLock.h; sourceTree = "<group>"; };
+ 2640E19E15DC78FD00F23B50 /* Property.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Property.cpp; path = source/Interpreter/Property.cpp; sourceTree = "<group>"; };
+ 26ACEC2715E077AE00E94760 /* Property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Property.h; path = include/lldb/Interpreter/Property.h; sourceTree = "<group>"; };
+ 2654A68C1E552D1500DA1013 /* PseudoTerminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PseudoTerminal.cpp; path = source/Host/common/PseudoTerminal.cpp; sourceTree = "<group>"; };
+ 2654A68E1E552D2400DA1013 /* PseudoTerminal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PseudoTerminal.h; path = include/lldb/Host/PseudoTerminal.h; sourceTree = "<group>"; };
+ 2326CF3F1BDD613E00A5CEAC /* Python.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Python.framework; path = System/Library/Frameworks/Python.framework; sourceTree = SDKROOT; };
+ 3FBA69E31B60672A0008F44A /* PythonDataObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonDataObjects.cpp; path = ScriptInterpreter/Python/PythonDataObjects.cpp; sourceTree = "<group>"; };
+ 3FBA69E41B60672A0008F44A /* PythonDataObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PythonDataObjects.h; path = ScriptInterpreter/Python/PythonDataObjects.h; sourceTree = "<group>"; };
+ 2321F94D1BDD360F00BA9A93 /* PythonDataObjectsTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonDataObjectsTests.cpp; sourceTree = "<group>"; };
+ AFCB2BBB1BF577F40018B553 /* PythonExceptionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonExceptionState.cpp; path = ScriptInterpreter/Python/PythonExceptionState.cpp; sourceTree = "<group>"; };
+ AFCB2BBC1BF577F40018B553 /* PythonExceptionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PythonExceptionState.h; path = ScriptInterpreter/Python/PythonExceptionState.h; sourceTree = "<group>"; };
+ 3FA093141BF65D3A0037DD08 /* PythonExceptionStateTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonExceptionStateTests.cpp; sourceTree = "<group>"; };
+ AF45E1FC1BF57C8D000563EB /* PythonTestSuite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonTestSuite.cpp; sourceTree = "<group>"; };
+ AF45E1FD1BF57C8D000563EB /* PythonTestSuite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonTestSuite.h; sourceTree = "<group>"; };
+ AF2670381852D01E00B6CC36 /* Queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Queue.cpp; path = source/Target/Queue.cpp; sourceTree = "<group>"; };
+ 260A63111860FDB600FECF8E /* Queue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Queue.h; path = include/lldb/Target/Queue.h; sourceTree = "<group>"; };
+ AF0C112718580CD800C4C45B /* QueueItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QueueItem.cpp; path = source/Target/QueueItem.cpp; sourceTree = "<group>"; };
+ 260A63121860FDBD00FECF8E /* QueueItem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QueueItem.h; path = include/lldb/Target/QueueItem.h; sourceTree = "<group>"; };
+ AF2670391852D01E00B6CC36 /* QueueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QueueList.cpp; path = source/Target/QueueList.cpp; sourceTree = "<group>"; };
+ 260A63131860FDC700FECF8E /* QueueList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = QueueList.h; path = include/lldb/Target/QueueList.h; sourceTree = "<group>"; };
+ 4939EA8C1BD56B6D00084382 /* REPL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = REPL.cpp; path = source/Expression/REPL.cpp; sourceTree = "<group>"; };
+ 4939EA8B1BD56B3700084382 /* REPL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = REPL.h; path = include/lldb/Expression/REPL.h; sourceTree = "<group>"; };
+ 9A2057451F3B905C00F6C293 /* RNBSocketTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RNBSocketTest.cpp; path = debugserver/RNBSocketTest.cpp; sourceTree = "<group>"; };
+ 94BA8B6C176F8C9B005A91B5 /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Range.cpp; path = source/Utility/Range.cpp; sourceTree = "<group>"; };
+ 94BA8B6E176F8CA0005A91B5 /* Range.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Range.h; path = include/lldb/Utility/Range.h; sourceTree = "<group>"; };
+ 2626B6AD143E1BEA00EF935C /* RangeMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RangeMap.h; path = include/lldb/Core/RangeMap.h; sourceTree = "<group>"; };
+ 26AB54111832DC3400EADFF3 /* RegisterCheckpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterCheckpoint.h; path = include/lldb/Target/RegisterCheckpoint.h; sourceTree = "<group>"; };
+ 26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContext.cpp; path = source/Target/RegisterContext.cpp; sourceTree = "<group>"; };
+ 26BC7DF410F1B81A00F91463 /* RegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext.h; path = include/lldb/Target/RegisterContext.h; sourceTree = "<group>"; };
26957D9213D381C900670048 /* RegisterContextDarwin_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_arm.cpp; path = Utility/RegisterContextDarwin_arm.cpp; sourceTree = "<group>"; };
26957D9313D381C900670048 /* RegisterContextDarwin_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_arm.h; path = Utility/RegisterContextDarwin_arm.h; sourceTree = "<group>"; };
+ AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_arm64.cpp; path = Utility/RegisterContextDarwin_arm64.cpp; sourceTree = "<group>"; };
+ AF9107ED168570D200DBCD3C /* RegisterContextDarwin_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_arm64.h; path = Utility/RegisterContextDarwin_arm64.h; sourceTree = "<group>"; };
26957D9413D381C900670048 /* RegisterContextDarwin_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_i386.cpp; path = Utility/RegisterContextDarwin_i386.cpp; sourceTree = "<group>"; };
26957D9513D381C900670048 /* RegisterContextDarwin_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_i386.h; path = Utility/RegisterContextDarwin_i386.h; sourceTree = "<group>"; };
26957D9613D381C900670048 /* RegisterContextDarwin_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_x86_64.cpp; path = Utility/RegisterContextDarwin_x86_64.cpp; sourceTree = "<group>"; };
26957D9713D381C900670048 /* RegisterContextDarwin_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_x86_64.h; path = Utility/RegisterContextDarwin_x86_64.h; sourceTree = "<group>"; };
- 2697A39215E404B1003E682C /* OptionValueArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueArch.cpp; path = source/Interpreter/OptionValueArch.cpp; sourceTree = "<group>"; };
- 2697A39415E404BA003E682C /* OptionValueArch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueArch.h; path = include/lldb/Interpreter/OptionValueArch.h; sourceTree = "<group>"; };
- 2697A54B133A6305004E4240 /* PlatformDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwin.cpp; sourceTree = "<group>"; };
- 2697A54C133A6305004E4240 /* PlatformDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwin.h; sourceTree = "<group>"; };
- 2698699815E6CBD0002415FF /* OperatingSystemPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OperatingSystemPython.cpp; sourceTree = "<group>"; };
- 2698699915E6CBD0002415FF /* OperatingSystemPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OperatingSystemPython.h; sourceTree = "<group>"; };
- 269DDD451B8FD01A00D0DBD8 /* DWARFASTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParser.h; sourceTree = "<group>"; };
- 269DDD481B8FD1C300D0DBD8 /* DWARFASTParserClang.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserClang.cpp; sourceTree = "<group>"; };
- 269DDD491B8FD1C300D0DBD8 /* DWARFASTParserClang.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserClang.h; sourceTree = "<group>"; };
- 269FF07D12494F7D00225026 /* FuncUnwinders.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FuncUnwinders.h; path = include/lldb/Symbol/FuncUnwinders.h; sourceTree = "<group>"; };
- 269FF07F12494F8E00225026 /* UnwindPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindPlan.h; path = include/lldb/Symbol/UnwindPlan.h; sourceTree = "<group>"; };
- 269FF08112494FC200225026 /* UnwindTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindTable.h; path = include/lldb/Symbol/UnwindTable.h; sourceTree = "<group>"; };
- 26A0DA4D140F721D006DA411 /* HashedNameToDIE.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HashedNameToDIE.h; sourceTree = "<group>"; };
- 26A3757F1D59462700D6CBDB /* SelectHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectHelper.cpp; path = source/Utility/SelectHelper.cpp; sourceTree = "<group>"; };
- 26A375831D59486000D6CBDB /* StringExtractor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringExtractor.h; path = include/lldb/Utility/StringExtractor.h; sourceTree = "<group>"; };
- 26A375841D59487700D6CBDB /* SelectHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SelectHelper.h; path = include/lldb/Utility/SelectHelper.h; sourceTree = "<group>"; };
- 26A3B4AC1181454800381BC2 /* ObjectContainerBSDArchive.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectContainerBSDArchive.cpp; sourceTree = "<group>"; };
- 26A3B4AD1181454800381BC2 /* ObjectContainerBSDArchive.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectContainerBSDArchive.h; sourceTree = "<group>"; };
- 26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = LLDBWrapPython.cpp; sourceTree = BUILT_PRODUCTS_DIR; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 26A527BD14E24F5F00F3A14A /* ProcessMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMachCore.cpp; sourceTree = "<group>"; };
- 26A527BE14E24F5F00F3A14A /* ProcessMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMachCore.h; sourceTree = "<group>"; };
- 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMachCore.cpp; sourceTree = "<group>"; };
- 26A527C014E24F5F00F3A14A /* ThreadMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadMachCore.h; sourceTree = "<group>"; };
- 26A7A034135E6E4200FB369E /* OptionValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValue.cpp; path = source/Interpreter/OptionValue.cpp; sourceTree = "<group>"; };
- 26A7A036135E6E5300FB369E /* OptionValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionValue.h; path = include/lldb/Interpreter/OptionValue.h; sourceTree = "<group>"; };
- 26AB54111832DC3400EADFF3 /* RegisterCheckpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterCheckpoint.h; path = include/lldb/Target/RegisterCheckpoint.h; sourceTree = "<group>"; };
- 26AB92101819D74600E63F3E /* DWARFDataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDataExtractor.cpp; sourceTree = "<group>"; };
- 26AB92111819D74600E63F3E /* DWARFDataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDataExtractor.h; sourceTree = "<group>"; };
- 26ACEC2715E077AE00E94760 /* Property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Property.h; path = include/lldb/Interpreter/Property.h; sourceTree = "<group>"; };
- 26B167A41123BF5500DC7B4F /* ThreadSafeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeValue.h; path = include/lldb/Core/ThreadSafeValue.h; sourceTree = "<group>"; };
- 26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFDeclContext.cpp; sourceTree = "<group>"; };
- 26B1EFAD154638AF00E2DAC7 /* DWARFDeclContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFDeclContext.h; sourceTree = "<group>"; };
- 26B42C4C1187ABA50079C8C8 /* LLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LLDB.h; path = include/lldb/API/LLDB.h; sourceTree = "<group>"; };
- 26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformiOSSimulator.cpp; sourceTree = "<group>"; };
- 26B7564D14F89356008D9CB3 /* PlatformiOSSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformiOSSimulator.h; sourceTree = "<group>"; };
- 26B75B421AD6E29A001F7A57 /* MipsLinuxSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MipsLinuxSignals.cpp; path = Utility/MipsLinuxSignals.cpp; sourceTree = "<group>"; };
- 26B75B431AD6E29A001F7A57 /* MipsLinuxSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MipsLinuxSignals.h; path = Utility/MipsLinuxSignals.h; sourceTree = "<group>"; };
- 26B8283C142D01E9002DBC64 /* SBSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSection.h; path = include/lldb/API/SBSection.h; sourceTree = "<group>"; };
- 26B8283F142D020F002DBC64 /* SBSection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSection.cpp; path = source/API/SBSection.cpp; sourceTree = "<group>"; };
- 26B8B42212EEC52A00A831B2 /* UniqueDWARFASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueDWARFASTType.h; sourceTree = "<group>"; };
- 26B8B42312EEC52A00A831B2 /* UniqueDWARFASTType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueDWARFASTType.cpp; sourceTree = "<group>"; };
- 26BC179718C7F2B300D2196D /* JITLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JITLoader.cpp; path = source/Target/JITLoader.cpp; sourceTree = "<group>"; };
- 26BC179818C7F2B300D2196D /* JITLoaderList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JITLoaderList.cpp; path = source/Target/JITLoaderList.cpp; sourceTree = "<group>"; };
- 26BC179B18C7F2CB00D2196D /* JITLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JITLoader.h; path = include/lldb/Target/JITLoader.h; sourceTree = "<group>"; };
- 26BC179C18C7F2CB00D2196D /* JITLoaderList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JITLoaderList.h; path = include/lldb/Target/JITLoaderList.h; sourceTree = "<group>"; };
- 26BC17A218C7F4CB00D2196D /* ProcessElfCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessElfCore.cpp; sourceTree = "<group>"; };
- 26BC17A318C7F4CB00D2196D /* ProcessElfCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessElfCore.h; sourceTree = "<group>"; };
+ 944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDummy.cpp; path = Utility/RegisterContextDummy.cpp; sourceTree = "<group>"; };
+ 944372DB171F6B4300E57C32 /* RegisterContextDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDummy.h; path = Utility/RegisterContextDummy.h; sourceTree = "<group>"; };
+ 26474CA218D0CB070073DEBA /* RegisterContextFreeBSD_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_i386.cpp; path = Utility/RegisterContextFreeBSD_i386.cpp; sourceTree = "<group>"; };
+ 26474CA318D0CB070073DEBA /* RegisterContextFreeBSD_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_i386.h; path = Utility/RegisterContextFreeBSD_i386.h; sourceTree = "<group>"; };
+ 26474CA418D0CB070073DEBA /* RegisterContextFreeBSD_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_mips64.cpp; path = Utility/RegisterContextFreeBSD_mips64.cpp; sourceTree = "<group>"; };
+ 26474CA518D0CB070073DEBA /* RegisterContextFreeBSD_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_mips64.h; path = Utility/RegisterContextFreeBSD_mips64.h; sourceTree = "<group>"; };
+ AF77E09A1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_powerpc.cpp; path = Utility/RegisterContextFreeBSD_powerpc.cpp; sourceTree = "<group>"; };
+ AF77E09B1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_powerpc.h; path = Utility/RegisterContextFreeBSD_powerpc.h; sourceTree = "<group>"; };
+ 26474CA618D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_x86_64.cpp; path = Utility/RegisterContextFreeBSD_x86_64.cpp; sourceTree = "<group>"; };
+ 26474CA718D0CB070073DEBA /* RegisterContextFreeBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_x86_64.h; path = Utility/RegisterContextFreeBSD_x86_64.h; sourceTree = "<group>"; };
+ AF061F85182C97ED00B6A19C /* RegisterContextHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextHistory.cpp; path = Utility/RegisterContextHistory.cpp; sourceTree = "<group>"; };
+ AF061F86182C97ED00B6A19C /* RegisterContextHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextHistory.h; path = Utility/RegisterContextHistory.h; sourceTree = "<group>"; };
+ 265205A213D3E3F700132FE2 /* RegisterContextKDP_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_arm.cpp; sourceTree = "<group>"; };
+ 265205A313D3E3F700132FE2 /* RegisterContextKDP_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_arm.h; sourceTree = "<group>"; };
+ AF0F6E4E1739A76D009180FE /* RegisterContextKDP_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_arm64.cpp; sourceTree = "<group>"; };
+ AF0F6E4F1739A76D009180FE /* RegisterContextKDP_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_arm64.h; sourceTree = "<group>"; };
+ 265205A413D3E3F700132FE2 /* RegisterContextKDP_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_i386.cpp; sourceTree = "<group>"; };
+ 265205A513D3E3F700132FE2 /* RegisterContextKDP_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_i386.h; sourceTree = "<group>"; };
+ 265205A613D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_x86_64.cpp; sourceTree = "<group>"; };
+ 265205A713D3E3F700132FE2 /* RegisterContextKDP_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_x86_64.h; sourceTree = "<group>"; };
+ AF68D2541255416E002FF25B /* RegisterContextLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLLDB.cpp; path = Utility/RegisterContextLLDB.cpp; sourceTree = "<group>"; };
+ AF68D2551255416E002FF25B /* RegisterContextLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLLDB.h; path = Utility/RegisterContextLLDB.h; sourceTree = "<group>"; };
+ 26474CAE18D0CB180073DEBA /* RegisterContextLinux_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_i386.cpp; path = Utility/RegisterContextLinux_i386.cpp; sourceTree = "<group>"; };
+ 26474CAF18D0CB180073DEBA /* RegisterContextLinux_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_i386.h; path = Utility/RegisterContextLinux_i386.h; sourceTree = "<group>"; };
+ 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_mips.cpp; path = Utility/RegisterContextLinux_mips.cpp; sourceTree = "<group>"; };
+ 9A0FDE981E8EF5010086B2F5 /* RegisterContextLinux_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_mips.h; path = Utility/RegisterContextLinux_mips.h; sourceTree = "<group>"; };
+ 256CBDB81ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_mips64.cpp; path = Utility/RegisterContextLinux_mips64.cpp; sourceTree = "<group>"; };
+ 256CBDB91ADD107200BC6CDC /* RegisterContextLinux_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_mips64.h; path = Utility/RegisterContextLinux_mips64.h; sourceTree = "<group>"; };
+ 267F68511CC02E920086832B /* RegisterContextLinux_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_s390x.cpp; path = Utility/RegisterContextLinux_s390x.cpp; sourceTree = "<group>"; };
+ 267F68521CC02E920086832B /* RegisterContextLinux_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_s390x.h; path = Utility/RegisterContextLinux_s390x.h; sourceTree = "<group>"; };
+ 26474CB018D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_x86_64.cpp; path = Utility/RegisterContextLinux_x86_64.cpp; sourceTree = "<group>"; };
+ 26474CB118D0CB180073DEBA /* RegisterContextLinux_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_x86_64.h; path = Utility/RegisterContextLinux_x86_64.h; sourceTree = "<group>"; };
+ 26E3EEF711A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMacOSXFrameBackchain.cpp; path = Utility/RegisterContextMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
+ AF77E09C1A033D360096C0EA /* RegisterContextMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMacOSXFrameBackchain.cpp; path = Utility/RegisterContextMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
+ 26E3EEF811A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMacOSXFrameBackchain.h; path = Utility/RegisterContextMacOSXFrameBackchain.h; sourceTree = "<group>"; };
+ 26474CB618D0CB2D0073DEBA /* RegisterContextMach_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_arm.cpp; path = Utility/RegisterContextMach_arm.cpp; sourceTree = "<group>"; };
+ 26474CB718D0CB2D0073DEBA /* RegisterContextMach_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_arm.h; path = Utility/RegisterContextMach_arm.h; sourceTree = "<group>"; };
+ 26474CB818D0CB2D0073DEBA /* RegisterContextMach_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_i386.cpp; path = Utility/RegisterContextMach_i386.cpp; sourceTree = "<group>"; };
+ 26474CB918D0CB2D0073DEBA /* RegisterContextMach_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_i386.h; path = Utility/RegisterContextMach_i386.h; sourceTree = "<group>"; };
+ 26474CBA18D0CB2D0073DEBA /* RegisterContextMach_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMach_x86_64.cpp; path = Utility/RegisterContextMach_x86_64.cpp; sourceTree = "<group>"; };
+ 26474CBB18D0CB2D0073DEBA /* RegisterContextMach_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMach_x86_64.h; path = Utility/RegisterContextMach_x86_64.h; sourceTree = "<group>"; };
+ 262D24E413FB8710002D1960 /* RegisterContextMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMemory.cpp; path = Utility/RegisterContextMemory.cpp; sourceTree = "<group>"; };
+ 26474CC218D0CB5B0073DEBA /* RegisterContextMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMemory.cpp; path = Utility/RegisterContextMemory.cpp; sourceTree = "<group>"; };
+ 262D24E513FB8710002D1960 /* RegisterContextMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMemory.h; path = Utility/RegisterContextMemory.h; sourceTree = "<group>"; };
+ 26474CC318D0CB5B0073DEBA /* RegisterContextMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMemory.h; path = Utility/RegisterContextMemory.h; sourceTree = "<group>"; };
+ 947CF7741DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextMinidump_x86_32.cpp; sourceTree = "<group>"; };
+ 947CF7721DC7B20300EF980B /* RegisterContextMinidump_x86_32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegisterContextMinidump_x86_32.h; sourceTree = "<group>"; };
+ AFD65C7F1D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextMinidump_x86_64.cpp; sourceTree = "<group>"; };
+ AFD65C801D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextMinidump_x86_64.h; sourceTree = "<group>"; };
+ 9AD9449B1E8DB267004796ED /* RegisterContextNetBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextNetBSD_x86_64.cpp; path = Utility/RegisterContextNetBSD_x86_64.cpp; sourceTree = "<group>"; };
+ 9AD9449C1E8DB267004796ED /* RegisterContextNetBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextNetBSD_x86_64.h; path = Utility/RegisterContextNetBSD_x86_64.h; sourceTree = "<group>"; };
+ 4CE4EFAB1E899A1200A80C06 /* RegisterContextOpenBSD_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextOpenBSD_i386.cpp; path = Utility/RegisterContextOpenBSD_i386.cpp; sourceTree = "<group>"; };
+ 4CE4EFAC1E899A1200A80C06 /* RegisterContextOpenBSD_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextOpenBSD_i386.h; path = Utility/RegisterContextOpenBSD_i386.h; sourceTree = "<group>"; };
+ 4CE4EFAD1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextOpenBSD_x86_64.cpp; path = Utility/RegisterContextOpenBSD_x86_64.cpp; sourceTree = "<group>"; };
+ 4CE4EFAE1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextOpenBSD_x86_64.h; path = Utility/RegisterContextOpenBSD_x86_64.h; sourceTree = "<group>"; };
+ 26474CC818D0CB5B0073DEBA /* RegisterContextPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIX.h; sourceTree = "<group>"; };
+ 256CBDB21ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_arm.cpp; sourceTree = "<group>"; };
+ 256CBDB31ADD0EFD00BC6CDC /* RegisterContextPOSIXCore_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_arm.h; sourceTree = "<group>"; };
+ E7723D421AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_arm64.cpp; sourceTree = "<group>"; };
+ E7723D431AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_arm64.h; sourceTree = "<group>"; };
26BC17A418C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_mips64.cpp; sourceTree = "<group>"; };
26BC17A518C7F4CB00D2196D /* RegisterContextPOSIXCore_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_mips64.h; sourceTree = "<group>"; };
+ AF77E0A71A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_powerpc.cpp; sourceTree = "<group>"; };
+ AF77E0A81A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_powerpc.h; sourceTree = "<group>"; };
+ AF9113FB1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_ppc64le.cpp; sourceTree = "<group>"; };
+ AF9113FC1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_ppc64le.h; sourceTree = "<group>"; };
+ 267F684D1CC02E270086832B /* RegisterContextPOSIXCore_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_s390x.cpp; sourceTree = "<group>"; };
+ 267F684E1CC02E270086832B /* RegisterContextPOSIXCore_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_s390x.h; sourceTree = "<group>"; };
26BC17A618C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_x86_64.cpp; sourceTree = "<group>"; };
26BC17A718C7F4CB00D2196D /* RegisterContextPOSIXCore_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_x86_64.h; sourceTree = "<group>"; };
- 26BC17A818C7F4CB00D2196D /* ThreadElfCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadElfCore.cpp; sourceTree = "<group>"; };
- 26BC17A918C7F4CB00D2196D /* ThreadElfCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadElfCore.h; sourceTree = "<group>"; };
- 26BC17BA18C7F4FA00D2196D /* ProcessMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMessage.cpp; sourceTree = "<group>"; };
- 26BC17BB18C7F4FA00D2196D /* ProcessMessage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessMessage.h; sourceTree = "<group>"; };
- 26BC17BE18C7F4FA00D2196D /* ProcessPOSIXLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessPOSIXLog.cpp; sourceTree = "<group>"; };
- 26BC17BF18C7F4FA00D2196D /* ProcessPOSIXLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProcessPOSIXLog.h; sourceTree = "<group>"; };
- 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-defines.h"; path = "include/lldb/lldb-defines.h"; sourceTree = "<group>"; };
- 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-enumerations.h"; path = "include/lldb/lldb-enumerations.h"; sourceTree = "<group>"; };
- 26BC7C2810F1B3BC00F91463 /* lldb-private-interfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-private-interfaces.h"; path = "include/lldb/lldb-private-interfaces.h"; sourceTree = "<group>"; };
- 26BC7C2910F1B3BC00F91463 /* lldb-types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-types.h"; path = "include/lldb/lldb-types.h"; sourceTree = "<group>"; };
- 26BC7C2A10F1B3BC00F91463 /* lldb-private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-private.h"; path = "include/lldb/lldb-private.h"; sourceTree = "<group>"; };
- 26BC7C5510F1B6E900F91463 /* Block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Block.h; path = include/lldb/Symbol/Block.h; sourceTree = "<group>"; };
- 26BC7C5610F1B6E900F91463 /* ClangASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTContext.h; path = include/lldb/Symbol/ClangASTContext.h; sourceTree = "<group>"; };
- 26BC7C5710F1B6E900F91463 /* CompileUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompileUnit.h; path = include/lldb/Symbol/CompileUnit.h; sourceTree = "<group>"; };
- 26BC7C5810F1B6E900F91463 /* Declaration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Declaration.h; path = include/lldb/Symbol/Declaration.h; sourceTree = "<group>"; };
- 26BC7C5910F1B6E900F91463 /* DWARFCallFrameInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DWARFCallFrameInfo.h; path = include/lldb/Symbol/DWARFCallFrameInfo.h; sourceTree = "<group>"; };
- 26BC7C5A10F1B6E900F91463 /* Function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Function.h; path = include/lldb/Symbol/Function.h; sourceTree = "<group>"; };
- 26BC7C5B10F1B6E900F91463 /* LineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineEntry.h; path = include/lldb/Symbol/LineEntry.h; sourceTree = "<group>"; };
- 26BC7C5C10F1B6E900F91463 /* LineTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LineTable.h; path = include/lldb/Symbol/LineTable.h; sourceTree = "<group>"; };
- 26BC7C5D10F1B6E900F91463 /* ObjectContainer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectContainer.h; path = include/lldb/Symbol/ObjectContainer.h; sourceTree = "<group>"; };
- 26BC7C5E10F1B6E900F91463 /* ObjectFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjectFile.h; path = include/lldb/Symbol/ObjectFile.h; sourceTree = "<group>"; };
- 26BC7C5F10F1B6E900F91463 /* Symbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbol.h; path = include/lldb/Symbol/Symbol.h; sourceTree = "<group>"; };
- 26BC7C6010F1B6E900F91463 /* SymbolContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolContext.h; path = include/lldb/Symbol/SymbolContext.h; sourceTree = "<group>"; };
- 26BC7C6110F1B6E900F91463 /* SymbolContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolContextScope.h; path = include/lldb/Symbol/SymbolContextScope.h; sourceTree = "<group>"; };
- 26BC7C6210F1B6E900F91463 /* SymbolFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolFile.h; path = include/lldb/Symbol/SymbolFile.h; sourceTree = "<group>"; };
- 26BC7C6310F1B6E900F91463 /* SymbolVendor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolVendor.h; path = include/lldb/Symbol/SymbolVendor.h; sourceTree = "<group>"; };
- 26BC7C6410F1B6E900F91463 /* Symtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symtab.h; path = include/lldb/Symbol/Symtab.h; sourceTree = "<group>"; };
- 26BC7C6510F1B6E900F91463 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Type.h; path = include/lldb/Symbol/Type.h; sourceTree = "<group>"; };
- 26BC7C6610F1B6E900F91463 /* TypeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeList.h; path = include/lldb/Symbol/TypeList.h; sourceTree = "<group>"; };
- 26BC7C6710F1B6E900F91463 /* Variable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Variable.h; path = include/lldb/Symbol/Variable.h; sourceTree = "<group>"; };
- 26BC7C6810F1B6E900F91463 /* VariableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VariableList.h; path = include/lldb/Symbol/VariableList.h; sourceTree = "<group>"; };
- 26BC7CED10F1B71400F91463 /* StoppointCallbackContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StoppointCallbackContext.h; path = include/lldb/Breakpoint/StoppointCallbackContext.h; sourceTree = "<group>"; };
- 26BC7CEE10F1B71400F91463 /* Breakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Breakpoint.h; path = include/lldb/Breakpoint/Breakpoint.h; sourceTree = "<group>"; };
- 26BC7CEF10F1B71400F91463 /* BreakpointID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointID.h; path = include/lldb/Breakpoint/BreakpointID.h; sourceTree = "<group>"; };
- 26BC7CF010F1B71400F91463 /* BreakpointIDList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointIDList.h; path = include/lldb/Breakpoint/BreakpointIDList.h; sourceTree = "<group>"; };
- 26BC7CF110F1B71400F91463 /* BreakpointList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointList.h; path = include/lldb/Breakpoint/BreakpointList.h; sourceTree = "<group>"; };
- 26BC7CF210F1B71400F91463 /* BreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocation.h; path = include/lldb/Breakpoint/BreakpointLocation.h; sourceTree = "<group>"; };
- 26BC7CF310F1B71400F91463 /* BreakpointLocationCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocationCollection.h; path = include/lldb/Breakpoint/BreakpointLocationCollection.h; sourceTree = "<group>"; };
- 26BC7CF410F1B71400F91463 /* BreakpointLocationList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointLocationList.h; path = include/lldb/Breakpoint/BreakpointLocationList.h; sourceTree = "<group>"; };
- 26BC7CF510F1B71400F91463 /* BreakpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointOptions.h; path = include/lldb/Breakpoint/BreakpointOptions.h; sourceTree = "<group>"; };
- 26BC7CF610F1B71400F91463 /* BreakpointResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolver.h; path = include/lldb/Breakpoint/BreakpointResolver.h; sourceTree = "<group>"; };
- 26BC7CF710F1B71400F91463 /* BreakpointSite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointSite.h; path = include/lldb/Breakpoint/BreakpointSite.h; sourceTree = "<group>"; };
- 26BC7CF810F1B71400F91463 /* BreakpointSiteList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointSiteList.h; path = include/lldb/Breakpoint/BreakpointSiteList.h; sourceTree = "<group>"; };
- 26BC7CF910F1B71400F91463 /* SearchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SearchFilter.h; path = include/lldb/Core/SearchFilter.h; sourceTree = "<group>"; };
- 26BC7CFA10F1B71400F91463 /* Stoppoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stoppoint.h; path = include/lldb/Breakpoint/Stoppoint.h; sourceTree = "<group>"; };
- 26BC7CFB10F1B71400F91463 /* StoppointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StoppointLocation.h; path = include/lldb/Breakpoint/StoppointLocation.h; sourceTree = "<group>"; };
- 26BC7CFC10F1B71400F91463 /* Watchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Watchpoint.h; path = include/lldb/Breakpoint/Watchpoint.h; sourceTree = "<group>"; };
- 26BC7D1410F1B76300F91463 /* CommandObjectBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectBreakpoint.h; path = source/Commands/CommandObjectBreakpoint.h; sourceTree = "<group>"; };
- 26BC7D1710F1B76300F91463 /* CommandObjectDisassemble.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectDisassemble.h; path = source/Commands/CommandObjectDisassemble.h; sourceTree = "<group>"; };
- 26BC7D1810F1B76300F91463 /* CommandObjectExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectExpression.h; path = source/Commands/CommandObjectExpression.h; sourceTree = "<group>"; };
- 26BC7D1A10F1B76300F91463 /* CommandObjectHelp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectHelp.h; path = source/Commands/CommandObjectHelp.h; sourceTree = "<group>"; };
- 26BC7D1D10F1B76300F91463 /* CommandObjectMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMemory.h; path = source/Commands/CommandObjectMemory.h; sourceTree = "<group>"; };
- 26BC7D1F10F1B76300F91463 /* CommandObjectProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectProcess.h; path = source/Commands/CommandObjectProcess.h; sourceTree = "<group>"; };
- 26BC7D2010F1B76300F91463 /* CommandObjectQuit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectQuit.h; path = source/Commands/CommandObjectQuit.h; sourceTree = "<group>"; };
- 26BC7D2210F1B76300F91463 /* CommandObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegister.h; path = source/Commands/CommandObjectRegister.h; sourceTree = "<group>"; };
- 26BC7D2410F1B76300F91463 /* CommandObjectScript.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectScript.h; path = source/Interpreter/CommandObjectScript.h; sourceTree = "<group>"; };
- 26BC7D2710F1B76300F91463 /* CommandObjectSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSettings.h; path = source/Commands/CommandObjectSettings.h; sourceTree = "<group>"; };
- 26BC7D2910F1B76300F91463 /* CommandObjectSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSource.h; path = source/Commands/CommandObjectSource.h; sourceTree = "<group>"; };
- 26BC7D2C10F1B76300F91463 /* CommandObjectSyntax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectSyntax.h; path = source/Commands/CommandObjectSyntax.h; sourceTree = "<group>"; };
- 26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectThread.h; path = source/Commands/CommandObjectThread.h; sourceTree = "<group>"; };
- 26BC7D5010F1B77400F91463 /* Address.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Address.h; path = include/lldb/Core/Address.h; sourceTree = "<group>"; };
- 26BC7D5110F1B77400F91463 /* AddressRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressRange.h; path = include/lldb/Core/AddressRange.h; sourceTree = "<group>"; };
- 26BC7D5310F1B77400F91463 /* Args.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Args.h; path = include/lldb/Interpreter/Args.h; sourceTree = "<group>"; };
- 26BC7D5410F1B77400F91463 /* Broadcaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Broadcaster.h; path = include/lldb/Core/Broadcaster.h; sourceTree = "<group>"; };
- 26BC7D5510F1B77400F91463 /* ClangForward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangForward.h; path = include/lldb/Core/ClangForward.h; sourceTree = "<group>"; };
- 26BC7D5610F1B77400F91463 /* Communication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Communication.h; path = include/lldb/Core/Communication.h; sourceTree = "<group>"; };
- 26BC7D5710F1B77400F91463 /* Connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Connection.h; path = include/lldb/Utility/Connection.h; sourceTree = "<group>"; };
- 26BC7D5E10F1B77400F91463 /* Disassembler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Disassembler.h; path = include/lldb/Core/Disassembler.h; sourceTree = "<group>"; };
- 26BC7D5F10F1B77400F91463 /* dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf.h; path = include/lldb/Core/dwarf.h; sourceTree = "<group>"; };
- 26BC7D6110F1B77400F91463 /* Event.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Event.h; path = include/lldb/Core/Event.h; sourceTree = "<group>"; };
- 26BC7D6310F1B77400F91463 /* FileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpecList.h; path = include/lldb/Core/FileSpecList.h; sourceTree = "<group>"; };
- 26BC7D6510F1B77400F91463 /* IOStreamMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IOStreamMacros.h; path = include/lldb/Core/IOStreamMacros.h; sourceTree = "<group>"; };
- 26BC7D6710F1B77400F91463 /* Listener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Listener.h; path = include/lldb/Core/Listener.h; sourceTree = "<group>"; };
- 26BC7D6810F1B77400F91463 /* Log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Log.h; path = include/lldb/Utility/Log.h; sourceTree = "<group>"; };
- 26BC7D6910F1B77400F91463 /* Mangled.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Mangled.h; path = include/lldb/Core/Mangled.h; sourceTree = "<group>"; };
- 26BC7D6A10F1B77400F91463 /* Module.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Module.h; path = include/lldb/Core/Module.h; sourceTree = "<group>"; };
- 26BC7D6B10F1B77400F91463 /* ModuleChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleChild.h; path = include/lldb/Core/ModuleChild.h; sourceTree = "<group>"; };
- 26BC7D6C10F1B77400F91463 /* ModuleList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ModuleList.h; path = include/lldb/Core/ModuleList.h; sourceTree = "<group>"; };
- 26BC7D6D10F1B77400F91463 /* Options.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Options.h; path = include/lldb/Interpreter/Options.h; sourceTree = "<group>"; };
- 26BC7D7010F1B77400F91463 /* PluginInterface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginInterface.h; path = include/lldb/Core/PluginInterface.h; sourceTree = "<group>"; };
- 26BC7D7110F1B77400F91463 /* PluginManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PluginManager.h; path = include/lldb/Core/PluginManager.h; sourceTree = "<group>"; };
+ AF3F54B81B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_arm.cpp; sourceTree = "<group>"; };
+ AF3F54B91B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_arm.h; sourceTree = "<group>"; };
+ AF3F54BA1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_arm64.cpp; sourceTree = "<group>"; };
+ AF3F54BB1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_arm64.h; sourceTree = "<group>"; };
+ AF3F54BC1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_mips64.cpp; sourceTree = "<group>"; };
+ AF3F54BD1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_mips64.h; sourceTree = "<group>"; };
+ AF3F54BE1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_powerpc.cpp; sourceTree = "<group>"; };
+ AF3F54BF1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_powerpc.h; sourceTree = "<group>"; };
+ AF3F54C01B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_x86.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_x86.cpp; sourceTree = "<group>"; };
+ AF3F54C11B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_x86.h; sourceTree = "<group>"; };
+ 256CBDBE1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_arm.cpp; path = Utility/RegisterContextPOSIX_arm.cpp; sourceTree = "<group>"; };
+ 256CBDBF1ADD11C000BC6CDC /* RegisterContextPOSIX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_arm.h; path = Utility/RegisterContextPOSIX_arm.h; sourceTree = "<group>"; };
+ E7723D4A1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_arm64.cpp; path = Utility/RegisterContextPOSIX_arm64.cpp; sourceTree = "<group>"; };
+ E7723D4B1AC4A944002BA082 /* RegisterContextPOSIX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_arm64.h; path = Utility/RegisterContextPOSIX_arm64.h; sourceTree = "<group>"; };
+ 26474CC418D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_mips64.cpp; path = Utility/RegisterContextPOSIX_mips64.cpp; sourceTree = "<group>"; };
+ 26474CC518D0CB5B0073DEBA /* RegisterContextPOSIX_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_mips64.h; path = Utility/RegisterContextPOSIX_mips64.h; sourceTree = "<group>"; };
+ AF77E09D1A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_powerpc.cpp; path = Utility/RegisterContextPOSIX_powerpc.cpp; sourceTree = "<group>"; };
+ AF77E09E1A033D360096C0EA /* RegisterContextPOSIX_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_powerpc.h; path = Utility/RegisterContextPOSIX_powerpc.h; sourceTree = "<group>"; };
+ AF235EAE1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_ppc64le.cpp; path = Utility/RegisterContextPOSIX_ppc64le.cpp; sourceTree = "<group>"; };
+ AF235EAF1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_ppc64le.h; path = Utility/RegisterContextPOSIX_ppc64le.h; sourceTree = "<group>"; };
+ 267F68551CC02EAE0086832B /* RegisterContextPOSIX_s390x.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_s390x.cpp; path = Utility/RegisterContextPOSIX_s390x.cpp; sourceTree = "<group>"; };
+ 267F68561CC02EAE0086832B /* RegisterContextPOSIX_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_s390x.h; path = Utility/RegisterContextPOSIX_s390x.h; sourceTree = "<group>"; };
+ 26474CC618D0CB5B0073DEBA /* RegisterContextPOSIX_x86.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_x86.cpp; path = Utility/RegisterContextPOSIX_x86.cpp; sourceTree = "<group>"; };
+ 26474CC718D0CB5B0073DEBA /* RegisterContextPOSIX_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_x86.h; path = Utility/RegisterContextPOSIX_x86.h; sourceTree = "<group>"; };
+ 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextThreadMemory.cpp; path = Utility/RegisterContextThreadMemory.cpp; sourceTree = "<group>"; };
+ 26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextThreadMemory.h; path = Utility/RegisterContextThreadMemory.h; sourceTree = "<group>"; };
+ 9A0FDE951E8EF5010086B2F5 /* RegisterContext_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_mips.h; path = Utility/RegisterContext_mips.h; sourceTree = "<group>"; };
+ AF77E0991A033D360096C0EA /* RegisterContext_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_powerpc.h; path = Utility/RegisterContext_powerpc.h; sourceTree = "<group>"; };
+ 9A0FDE961E8EF5010086B2F5 /* RegisterContext_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_s390x.h; path = Utility/RegisterContext_s390x.h; sourceTree = "<group>"; };
+ 26474C9F18D0CAEC0073DEBA /* RegisterContext_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_x86.h; path = Utility/RegisterContext_x86.h; sourceTree = "<group>"; };
+ 23EDE3371926AAD500F6A132 /* RegisterInfoInterface.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterInfoInterface.h; path = Utility/RegisterInfoInterface.h; sourceTree = "<group>"; };
+ 9A77AD501E64E24E0025CE04 /* RegisterInfoPOSIX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_arm.cpp; path = Utility/RegisterInfoPOSIX_arm.cpp; sourceTree = "<group>"; };
+ 9A77AD511E64E24E0025CE04 /* RegisterInfoPOSIX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_arm.h; path = Utility/RegisterInfoPOSIX_arm.h; sourceTree = "<group>"; };
+ 237A8BAB1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_arm64.cpp; path = Utility/RegisterInfoPOSIX_arm64.cpp; sourceTree = "<group>"; };
+ 237A8BAC1DEC9BBC00CEBAFF /* RegisterInfoPOSIX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_arm64.h; path = Utility/RegisterInfoPOSIX_arm64.h; sourceTree = "<group>"; };
+ AF235EB31FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_ppc64le.cpp; path = Utility/RegisterInfoPOSIX_ppc64le.cpp; sourceTree = "<group>"; };
+ AF235EB21FBE7857009C5541 /* RegisterInfoPOSIX_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_ppc64le.h; path = Utility/RegisterInfoPOSIX_ppc64le.h; sourceTree = "<group>"; };
+ 9A0FDE991E8EF5010086B2F5 /* RegisterInfos_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm.h; path = Utility/RegisterInfos_arm.h; sourceTree = "<group>"; };
+ 9A0FDE9A1E8EF5010086B2F5 /* RegisterInfos_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm64.h; path = Utility/RegisterInfos_arm64.h; sourceTree = "<group>"; };
+ 26474CD018D0CB700073DEBA /* RegisterInfos_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_i386.h; path = Utility/RegisterInfos_i386.h; sourceTree = "<group>"; };
+ 9A0FDE9B1E8EF5010086B2F5 /* RegisterInfos_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips.h; path = Utility/RegisterInfos_mips.h; sourceTree = "<group>"; };
+ 26474CD118D0CB710073DEBA /* RegisterInfos_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips64.h; path = Utility/RegisterInfos_mips64.h; sourceTree = "<group>"; };
+ AF77E09F1A033D360096C0EA /* RegisterInfos_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_powerpc.h; path = Utility/RegisterInfos_powerpc.h; sourceTree = "<group>"; };
+ 267F68591CC02EBE0086832B /* RegisterInfos_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_s390x.h; path = Utility/RegisterInfos_s390x.h; sourceTree = "<group>"; };
+ 26474CD218D0CB710073DEBA /* RegisterInfos_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_x86_64.h; path = Utility/RegisterInfos_x86_64.h; sourceTree = "<group>"; };
+ 2654A6821E54D5E200DA1013 /* RegisterNumber.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterNumber.cpp; path = source/Target/RegisterNumber.cpp; sourceTree = "<group>"; };
+ 2654A6841E54D5EE00DA1013 /* RegisterNumber.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterNumber.h; path = include/lldb/Target/RegisterNumber.h; sourceTree = "<group>"; };
+ 4CA9D13C1FCE07AF00300E18 /* RegisterUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterUtilities.cpp; sourceTree = "<group>"; };
+ 4CA9D13D1FCE07AF00300E18 /* RegisterUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterUtilities.h; sourceTree = "<group>"; };
+ 26C6886E137880C400407EDF /* RegisterValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterValue.cpp; path = source/Core/RegisterValue.cpp; sourceTree = "<group>"; };
+ 26C6886D137880B900407EDF /* RegisterValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterValue.h; path = include/lldb/Core/RegisterValue.h; sourceTree = "<group>"; };
+ 26764C9F1E48F528008D3573 /* RegularExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegularExpression.cpp; path = source/Utility/RegularExpression.cpp; sourceTree = "<group>"; };
+ 26764C9C1E48F516008D3573 /* RegularExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegularExpression.h; path = include/lldb/Utility/RegularExpression.h; sourceTree = "<group>"; };
+ 23D065821D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptExpressionOpts.cpp; sourceTree = "<group>"; };
+ 23D065831D4A7BDA0008EDE6 /* RenderScriptExpressionOpts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptExpressionOpts.h; sourceTree = "<group>"; };
+ 23D065841D4A7BDA0008EDE6 /* RenderScriptRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptRuntime.cpp; sourceTree = "<group>"; };
+ 23D065851D4A7BDA0008EDE6 /* RenderScriptRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptRuntime.h; sourceTree = "<group>"; };
+ 948554591DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptScriptGroup.cpp; sourceTree = "<group>"; };
+ 948554581DCBAE3200345FF5 /* RenderScriptScriptGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderScriptScriptGroup.h; sourceTree = "<group>"; };
+ 23D065861D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptx86ABIFixups.cpp; sourceTree = "<group>"; };
+ 23D065871D4A7BDA0008EDE6 /* RenderScriptx86ABIFixups.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderScriptx86ABIFixups.h; sourceTree = "<group>"; };
+ 26DE204411618ADA00A093E2 /* SBAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBAddress.cpp; path = source/API/SBAddress.cpp; sourceTree = "<group>"; };
+ 26DE204211618ACA00A093E2 /* SBAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAddress.h; path = include/lldb/API/SBAddress.h; sourceTree = "<group>"; };
+ 2611FEEF142D83060017FEA3 /* SBAddress.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAddress.i; sourceTree = "<group>"; };
+ 254FBBA41A91670E00BD6378 /* SBAttachInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBAttachInfo.cpp; path = source/API/SBAttachInfo.cpp; sourceTree = "<group>"; };
+ 254FBBA21A9166F100BD6378 /* SBAttachInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAttachInfo.h; path = include/lldb/API/SBAttachInfo.h; sourceTree = "<group>"; };
+ 254FBBA61A91672800BD6378 /* SBAttachInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBAttachInfo.i; sourceTree = "<group>"; };
+ 26DE20601161902600A093E2 /* SBBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBlock.cpp; path = source/API/SBBlock.cpp; sourceTree = "<group>"; };
+ 26DE205611618FC500A093E2 /* SBBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBlock.h; path = include/lldb/API/SBBlock.h; sourceTree = "<group>"; };
+ 2611FEF0142D83060017FEA3 /* SBBlock.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBlock.i; sourceTree = "<group>"; };
+ 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpoint.cpp; path = source/API/SBBreakpoint.cpp; sourceTree = "<group>"; };
+ 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpoint.h; path = include/lldb/API/SBBreakpoint.h; sourceTree = "<group>"; };
+ 2611FEF1142D83060017FEA3 /* SBBreakpoint.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpoint.i; sourceTree = "<group>"; };
+ 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = source/API/SBBreakpointLocation.cpp; sourceTree = "<group>"; };
+ 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointLocation.h; path = include/lldb/API/SBBreakpointLocation.h; sourceTree = "<group>"; };
+ 2611FEF2142D83060017FEA3 /* SBBreakpointLocation.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpointLocation.i; sourceTree = "<group>"; };
+ 4C54B27C1F61CE5300D469CA /* SBBreakpointName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointName.cpp; path = source/API/SBBreakpointName.cpp; sourceTree = "<group>"; };
+ 4C54B2781F61CE1200D469CA /* SBBreakpointName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointName.h; path = include/lldb/API/SBBreakpointName.h; sourceTree = "<group>"; };
+ 4C05332C1F63092A00DED368 /* SBBreakpointName.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpointName.i; sourceTree = "<group>"; };
+ 4C0533291F6211FB00DED368 /* SBBreakpointOptionCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointOptionCommon.cpp; path = source/API/SBBreakpointOptionCommon.cpp; sourceTree = "<group>"; };
+ 4C54B2811F62081300D469CA /* SBBreakpointOptionCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBBreakpointOptionCommon.h; path = source/API/SBBreakpointOptionCommon.h; sourceTree = "<group>"; };
+ 9A9830F21125FC5800A56CB0 /* SBBroadcaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBroadcaster.cpp; path = source/API/SBBroadcaster.cpp; sourceTree = "<group>"; };
+ 9A9830F31125FC5800A56CB0 /* SBBroadcaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBroadcaster.h; path = include/lldb/API/SBBroadcaster.h; sourceTree = "<group>"; };
+ 2611FEF3142D83060017FEA3 /* SBBroadcaster.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBroadcaster.i; sourceTree = "<group>"; };
+ 9A9830F61125FC5800A56CB0 /* SBCommandInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommandInterpreter.cpp; path = source/API/SBCommandInterpreter.cpp; sourceTree = "<group>"; };
+ 9A9830F71125FC5800A56CB0 /* SBCommandInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommandInterpreter.h; path = include/lldb/API/SBCommandInterpreter.h; sourceTree = "<group>"; };
+ 2611FEF4142D83060017FEA3 /* SBCommandInterpreter.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandInterpreter.i; sourceTree = "<group>"; };
+ 9A9830F81125FC5800A56CB0 /* SBCommandReturnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommandReturnObject.cpp; path = source/API/SBCommandReturnObject.cpp; sourceTree = "<group>"; };
+ 9A9830F91125FC5800A56CB0 /* SBCommandReturnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommandReturnObject.h; path = include/lldb/API/SBCommandReturnObject.h; sourceTree = "<group>"; };
+ 2611FEF5142D83060017FEA3 /* SBCommandReturnObject.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommandReturnObject.i; sourceTree = "<group>"; };
+ 260223E8115F06E500A601A2 /* SBCommunication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommunication.cpp; path = source/API/SBCommunication.cpp; sourceTree = "<group>"; };
+ 260223E7115F06D500A601A2 /* SBCommunication.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommunication.h; path = include/lldb/API/SBCommunication.h; sourceTree = "<group>"; };
+ 2611FEF6142D83060017FEA3 /* SBCommunication.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCommunication.i; sourceTree = "<group>"; };
+ 26DE205E1161901B00A093E2 /* SBCompileUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCompileUnit.cpp; path = source/API/SBCompileUnit.cpp; sourceTree = "<group>"; };
+ 26DE205411618FB800A093E2 /* SBCompileUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCompileUnit.h; path = include/lldb/API/SBCompileUnit.h; sourceTree = "<group>"; };
+ 2611FEF7142D83060017FEA3 /* SBCompileUnit.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBCompileUnit.i; sourceTree = "<group>"; };
+ 9443B121140C18C10013457C /* SBData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = "<group>"; };
+ 9443B120140C18A90013457C /* SBData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBData.h; path = include/lldb/API/SBData.h; sourceTree = "<group>"; };
+ 2611FEF8142D83060017FEA3 /* SBData.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBData.i; sourceTree = "<group>"; };
+ 9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBDebugger.cpp; path = source/API/SBDebugger.cpp; sourceTree = "<group>"; };
+ 9A9830FB1125FC5800A56CB0 /* SBDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDebugger.h; path = include/lldb/API/SBDebugger.h; sourceTree = "<group>"; };
+ 2611FEF9142D83060017FEA3 /* SBDebugger.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDebugger.i; sourceTree = "<group>"; };
+ 9452573916262D0200325455 /* SBDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBDeclaration.cpp; path = source/API/SBDeclaration.cpp; sourceTree = "<group>"; };
+ 9452573816262CEF00325455 /* SBDeclaration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBDeclaration.h; path = include/lldb/API/SBDeclaration.h; sourceTree = "<group>"; };
+ 9452573616262CD000325455 /* SBDeclaration.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDeclaration.i; sourceTree = "<group>"; };
+ 9A9830FC1125FC5800A56CB0 /* SBDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDefines.h; path = include/lldb/API/SBDefines.h; sourceTree = "<group>"; };
+ 2682F284115EF3A700CCFF99 /* SBError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBError.cpp; path = source/API/SBError.cpp; sourceTree = "<group>"; };
+ 2682F286115EF3BD00CCFF99 /* SBError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBError.h; path = include/lldb/API/SBError.h; sourceTree = "<group>"; };
+ 2611FEFA142D83060017FEA3 /* SBError.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBError.i; sourceTree = "<group>"; };
+ 9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBEvent.cpp; path = source/API/SBEvent.cpp; sourceTree = "<group>"; };
+ 9A9830FE1125FC5800A56CB0 /* SBEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBEvent.h; path = include/lldb/API/SBEvent.h; sourceTree = "<group>"; };
+ 2611FEFB142D83060017FEA3 /* SBEvent.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBEvent.i; sourceTree = "<group>"; };
+ 940B02F519DC96E700AD0F52 /* SBExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBExecutionContext.cpp; path = source/API/SBExecutionContext.cpp; sourceTree = "<group>"; };
+ 940B02F419DC96CB00AD0F52 /* SBExecutionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBExecutionContext.h; path = include/lldb/API/SBExecutionContext.h; sourceTree = "<group>"; };
+ 940B02F719DC970900AD0F52 /* SBExecutionContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBExecutionContext.i; sourceTree = "<group>"; };
+ 4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBExpressionOptions.cpp; path = source/API/SBExpressionOptions.cpp; sourceTree = "<group>"; };
+ 4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBExpressionOptions.h; path = include/lldb/API/SBExpressionOptions.h; sourceTree = "<group>"; };
+ 4CE4F676162CE1E100F75CB3 /* SBExpressionOptions.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBExpressionOptions.i; sourceTree = "<group>"; };
+ 26022532115F281400A601A2 /* SBFileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpec.cpp; path = source/API/SBFileSpec.cpp; sourceTree = "<group>"; };
+ 26022531115F27FA00A601A2 /* SBFileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpec.h; path = include/lldb/API/SBFileSpec.h; sourceTree = "<group>"; };
+ 2611FEFC142D83060017FEA3 /* SBFileSpec.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpec.i; sourceTree = "<group>"; };
+ 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpecList.cpp; path = source/API/SBFileSpecList.cpp; sourceTree = "<group>"; };
+ 4CF52AF41428291E0051E832 /* SBFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpecList.h; path = include/lldb/API/SBFileSpecList.h; sourceTree = "<group>"; };
+ 2611FEFD142D83060017FEA3 /* SBFileSpecList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFileSpecList.i; sourceTree = "<group>"; };
+ 9A633FE7112DCE3C001A7E43 /* SBFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFrame.cpp; path = source/API/SBFrame.cpp; sourceTree = "<group>"; };
+ 9A633FE8112DCE3C001A7E43 /* SBFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFrame.h; path = include/lldb/API/SBFrame.h; sourceTree = "<group>"; };
+ 2611FEFE142D83060017FEA3 /* SBFrame.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFrame.i; sourceTree = "<group>"; };
+ 26DE205C1161901400A093E2 /* SBFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFunction.cpp; path = source/API/SBFunction.cpp; sourceTree = "<group>"; };
+ 26DE205211618FAC00A093E2 /* SBFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFunction.h; path = include/lldb/API/SBFunction.h; sourceTree = "<group>"; };
+ 2611FEFF142D83060017FEA3 /* SBFunction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBFunction.i; sourceTree = "<group>"; };
+ 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBHostOS.cpp; path = source/API/SBHostOS.cpp; sourceTree = "<group>"; };
+ 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBHostOS.h; path = include/lldb/API/SBHostOS.h; sourceTree = "<group>"; };
+ 2611FF00142D83060017FEA3 /* SBHostOS.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBHostOS.i; sourceTree = "<group>"; };
+ 9AC703AE117675410086C050 /* SBInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBInstruction.cpp; path = source/API/SBInstruction.cpp; sourceTree = "<group>"; };
+ 9AC7038D117674EB0086C050 /* SBInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBInstruction.h; path = include/lldb/API/SBInstruction.h; sourceTree = "<group>"; };
+ 2611FF02142D83060017FEA3 /* SBInstruction.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstruction.i; sourceTree = "<group>"; };
+ 9AC703B0117675490086C050 /* SBInstructionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBInstructionList.cpp; path = source/API/SBInstructionList.cpp; sourceTree = "<group>"; };
+ 9AC7038F117675270086C050 /* SBInstructionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBInstructionList.h; path = include/lldb/API/SBInstructionList.h; sourceTree = "<group>"; };
+ 2611FF03142D83060017FEA3 /* SBInstructionList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBInstructionList.i; sourceTree = "<group>"; };
+ AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLanguageRuntime.cpp; path = source/API/SBLanguageRuntime.cpp; sourceTree = "<group>"; };
+ 3392EBB71AFF402200858B9F /* SBLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLanguageRuntime.h; path = include/lldb/API/SBLanguageRuntime.h; sourceTree = "<group>"; };
+ 23DCBE971D63E14B0084C36B /* SBLanguageRuntime.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLanguageRuntime.i; sourceTree = "<group>"; };
+ 254FBB941A81AA7F00BD6378 /* SBLaunchInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLaunchInfo.cpp; path = source/API/SBLaunchInfo.cpp; sourceTree = "<group>"; };
+ 254FBB961A81B03100BD6378 /* SBLaunchInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLaunchInfo.h; path = include/lldb/API/SBLaunchInfo.h; sourceTree = "<group>"; };
+ 254FBB921A81AA5200BD6378 /* SBLaunchInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLaunchInfo.i; sourceTree = "<group>"; };
+ 26DE20621161904200A093E2 /* SBLineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLineEntry.cpp; path = source/API/SBLineEntry.cpp; sourceTree = "<group>"; };
+ 26DE205811618FE700A093E2 /* SBLineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLineEntry.h; path = include/lldb/API/SBLineEntry.h; sourceTree = "<group>"; };
+ 2611FF04142D83060017FEA3 /* SBLineEntry.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBLineEntry.i; sourceTree = "<group>"; };
+ 9A9831011125FC5800A56CB0 /* SBListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBListener.cpp; path = source/API/SBListener.cpp; sourceTree = "<group>"; };
+ 9A9831021125FC5800A56CB0 /* SBListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBListener.h; path = include/lldb/API/SBListener.h; sourceTree = "<group>"; };
+ 2611FF05142D83060017FEA3 /* SBListener.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBListener.i; sourceTree = "<group>"; };
+ 23DCEA421D1C4C6900A602B4 /* SBMemoryRegionInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBMemoryRegionInfo.cpp; path = source/API/SBMemoryRegionInfo.cpp; sourceTree = "<group>"; };
+ 264297531D1DF209003F2BF4 /* SBMemoryRegionInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfo.h; path = include/lldb/API/SBMemoryRegionInfo.h; sourceTree = "<group>"; };
+ 264297591D1DF2AA003F2BF4 /* SBMemoryRegionInfo.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfo.i; sourceTree = "<group>"; };
+ 23DCEA431D1C4C6900A602B4 /* SBMemoryRegionInfoList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBMemoryRegionInfoList.cpp; path = source/API/SBMemoryRegionInfoList.cpp; sourceTree = "<group>"; };
+ 264297541D1DF209003F2BF4 /* SBMemoryRegionInfoList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBMemoryRegionInfoList.h; path = include/lldb/API/SBMemoryRegionInfoList.h; sourceTree = "<group>"; };
+ 2642975A1D1DF2AA003F2BF4 /* SBMemoryRegionInfoList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBMemoryRegionInfoList.i; sourceTree = "<group>"; };
+ 26DE204C11618E7A00A093E2 /* SBModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBModule.cpp; path = source/API/SBModule.cpp; sourceTree = "<group>"; };
+ 26DE204E11618E9800A093E2 /* SBModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBModule.h; path = include/lldb/API/SBModule.h; sourceTree = "<group>"; };
+ 2611FF06142D83060017FEA3 /* SBModule.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBModule.i; sourceTree = "<group>"; };
+ 263C4937178B50C40070F12D /* SBModuleSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBModuleSpec.cpp; path = source/API/SBModuleSpec.cpp; sourceTree = "<group>"; };
+ 263C4939178B50CF0070F12D /* SBModuleSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBModuleSpec.h; path = include/lldb/API/SBModuleSpec.h; sourceTree = "<group>"; };
+ 263C493B178B61CC0070F12D /* SBModuleSpec.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBModuleSpec.i; sourceTree = "<group>"; };
+ 262F12B41835468600AEB384 /* SBPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBPlatform.cpp; path = source/API/SBPlatform.cpp; sourceTree = "<group>"; };
+ 262F12B61835469C00AEB384 /* SBPlatform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBPlatform.h; path = include/lldb/API/SBPlatform.h; sourceTree = "<group>"; };
+ 262F12B8183546C900AEB384 /* SBPlatform.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBPlatform.i; sourceTree = "<group>"; };
+ 9A9831031125FC5800A56CB0 /* SBProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBProcess.cpp; path = source/API/SBProcess.cpp; sourceTree = "<group>"; };
+ 9A9831041125FC5800A56CB0 /* SBProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBProcess.h; path = include/lldb/API/SBProcess.h; sourceTree = "<group>"; };
+ 2611FF07142D83060017FEA3 /* SBProcess.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcess.i; sourceTree = "<group>"; };
+ 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBProcessInfo.cpp; path = source/API/SBProcessInfo.cpp; sourceTree = "<group>"; };
+ 4987FB201F30EC9900E5C17D /* SBProcessInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBProcessInfo.h; path = include/lldb/API/SBProcessInfo.h; sourceTree = "<group>"; };
+ 4987FB1C1F30EC6000E5C17D /* SBProcessInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcessInfo.i; sourceTree = "<group>"; };
+ AF0EBBE6185940FB0059E52F /* SBQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBQueue.cpp; path = source/API/SBQueue.cpp; sourceTree = "<group>"; };
+ AF0EBBEA185941360059E52F /* SBQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueue.h; path = include/lldb/API/SBQueue.h; sourceTree = "<group>"; };
+ AF0EBBEE1859419F0059E52F /* SBQueue.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueue.i; sourceTree = "<group>"; };
+ AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBQueueItem.cpp; path = source/API/SBQueueItem.cpp; sourceTree = "<group>"; };
+ AF0EBBEB185941360059E52F /* SBQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueItem.h; path = include/lldb/API/SBQueueItem.h; sourceTree = "<group>"; };
+ AF0EBBEF1859419F0059E52F /* SBQueueItem.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueueItem.i; sourceTree = "<group>"; };
+ 26B8283F142D020F002DBC64 /* SBSection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSection.cpp; path = source/API/SBSection.cpp; sourceTree = "<group>"; };
+ 26B8283C142D01E9002DBC64 /* SBSection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSection.h; path = include/lldb/API/SBSection.h; sourceTree = "<group>"; };
+ 2611FF08142D83060017FEA3 /* SBSection.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSection.i; sourceTree = "<group>"; };
+ 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSourceManager.cpp; path = source/API/SBSourceManager.cpp; sourceTree = "<group>"; };
+ 9A9831061125FC5800A56CB0 /* SBSourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSourceManager.h; path = include/lldb/API/SBSourceManager.h; sourceTree = "<group>"; };
+ 2611FF09142D83060017FEA3 /* SBSourceManager.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSourceManager.i; sourceTree = "<group>"; };
+ 26C72C951243229A0068DC16 /* SBStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStream.cpp; path = source/API/SBStream.cpp; sourceTree = "<group>"; };
+ 26C72C93124322890068DC16 /* SBStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBStream.h; path = include/lldb/API/SBStream.h; sourceTree = "<group>"; };
+ 2611FF0A142D83060017FEA3 /* SBStream.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStream.i; sourceTree = "<group>"; };
+ 9A357672116E7B6400E8ED2F /* SBStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStringList.cpp; path = source/API/SBStringList.cpp; sourceTree = "<group>"; };
+ 9A357670116E7B5200E8ED2F /* SBStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBStringList.h; path = include/lldb/API/SBStringList.h; sourceTree = "<group>"; };
+ 2611FF0B142D83060017FEA3 /* SBStringList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStringList.i; sourceTree = "<group>"; };
+ 23DCBEA01D63E6440084C36B /* SBStructuredData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStructuredData.cpp; path = source/API/SBStructuredData.cpp; sourceTree = "<group>"; };
+ 23DCBE9F1D63E3800084C36B /* SBStructuredData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBStructuredData.h; path = include/lldb/API/SBStructuredData.h; sourceTree = "<group>"; };
+ 23DCBE981D63E14B0084C36B /* SBStructuredData.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBStructuredData.i; sourceTree = "<group>"; };
+ 26DE20641161904E00A093E2 /* SBSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbol.cpp; path = source/API/SBSymbol.cpp; sourceTree = "<group>"; };
+ 26DE205A11618FF600A093E2 /* SBSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbol.h; path = include/lldb/API/SBSymbol.h; sourceTree = "<group>"; };
+ 2611FF0C142D83060017FEA3 /* SBSymbol.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbol.i; sourceTree = "<group>"; };
+ 26DE204611618AED00A093E2 /* SBSymbolContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbolContext.cpp; path = source/API/SBSymbolContext.cpp; sourceTree = "<group>"; };
+ 26DE204011618AB900A093E2 /* SBSymbolContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbolContext.h; path = include/lldb/API/SBSymbolContext.h; sourceTree = "<group>"; };
+ 2611FF0D142D83060017FEA3 /* SBSymbolContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContext.i; sourceTree = "<group>"; };
+ 268F9D54123AA16600B91E9B /* SBSymbolContextList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbolContextList.cpp; path = source/API/SBSymbolContextList.cpp; sourceTree = "<group>"; };
+ 268F9D52123AA15200B91E9B /* SBSymbolContextList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbolContextList.h; path = include/lldb/API/SBSymbolContextList.h; sourceTree = "<group>"; };
+ 2611FF0E142D83060017FEA3 /* SBSymbolContextList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBSymbolContextList.i; sourceTree = "<group>"; };
+ 9A9831071125FC5800A56CB0 /* SBTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = SBTarget.cpp; path = source/API/SBTarget.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
+ 9A9831081125FC5800A56CB0 /* SBTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTarget.h; path = include/lldb/API/SBTarget.h; sourceTree = "<group>"; };
+ 2611FF0F142D83060017FEA3 /* SBTarget.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTarget.i; sourceTree = "<group>"; };
+ 9A9831091125FC5800A56CB0 /* SBThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBThread.cpp; path = source/API/SBThread.cpp; sourceTree = "<group>"; };
+ 9A98310A1125FC5800A56CB0 /* SBThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBThread.h; path = include/lldb/API/SBThread.h; sourceTree = "<group>"; };
+ 2611FF10142D83060017FEA3 /* SBThread.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThread.i; sourceTree = "<group>"; };
+ 8CCB017F19BA4DD00009FD44 /* SBThreadCollection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBThreadCollection.cpp; path = source/API/SBThreadCollection.cpp; sourceTree = "<group>"; };
+ 8CCB018119BA4E210009FD44 /* SBThreadCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBThreadCollection.h; path = include/lldb/API/SBThreadCollection.h; sourceTree = "<group>"; };
+ 8CCB018419BA54930009FD44 /* SBThreadCollection.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThreadCollection.i; sourceTree = "<group>"; };
+ 4C56543619D22B32002E9C44 /* SBThreadPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBThreadPlan.cpp; path = source/API/SBThreadPlan.cpp; sourceTree = "<group>"; };
+ 4C56543419D2297A002E9C44 /* SBThreadPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBThreadPlan.h; path = include/lldb/API/SBThreadPlan.h; sourceTree = "<group>"; };
+ 4C56543819D22FD9002E9C44 /* SBThreadPlan.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThreadPlan.i; sourceTree = "<group>"; };
+ 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTrace.cpp; path = source/API/SBTrace.cpp; sourceTree = "<group>"; };
+ 9A1E59581EB2B10D002206A5 /* SBTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTrace.h; path = include/lldb/API/SBTrace.h; sourceTree = "<group>"; };
+ 9A1E59531EB2B0B9002206A5 /* SBTraceOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTraceOptions.cpp; path = source/API/SBTraceOptions.cpp; sourceTree = "<group>"; };
+ 9A1E59591EB2B10D002206A5 /* SBTraceOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTraceOptions.h; path = include/lldb/API/SBTraceOptions.h; sourceTree = "<group>"; };
+ 261744771168585B005ADD65 /* SBType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBType.cpp; path = source/API/SBType.cpp; sourceTree = "<group>"; };
+ 2617447911685869005ADD65 /* SBType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBType.h; path = include/lldb/API/SBType.h; sourceTree = "<group>"; };
+ 2611FF11142D83060017FEA3 /* SBType.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBType.i; sourceTree = "<group>"; };
+ 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeCategory.cpp; path = source/API/SBTypeCategory.cpp; sourceTree = "<group>"; };
+ 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeCategory.h; path = include/lldb/API/SBTypeCategory.h; sourceTree = "<group>"; };
+ 9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeCategory.i; sourceTree = "<group>"; };
+ 23EFE38A193D1AEC00E54E54 /* SBTypeEnumMember.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeEnumMember.cpp; path = source/API/SBTypeEnumMember.cpp; sourceTree = "<group>"; };
+ 23EFE388193D1ABC00E54E54 /* SBTypeEnumMember.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeEnumMember.h; path = include/lldb/API/SBTypeEnumMember.h; sourceTree = "<group>"; };
+ 23DCBE991D63E14B0084C36B /* SBTypeEnumMember.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeEnumMember.i; sourceTree = "<group>"; };
+ 9461568A14E35621003A195C /* SBTypeFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFilter.cpp; path = source/API/SBTypeFilter.cpp; sourceTree = "<group>"; };
+ 9461568614E355F2003A195C /* SBTypeFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFilter.h; path = include/lldb/API/SBTypeFilter.h; sourceTree = "<group>"; };
+ 9461569214E3567F003A195C /* SBTypeFilter.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFilter.i; sourceTree = "<group>"; };
+ 9461568B14E35621003A195C /* SBTypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFormat.cpp; path = source/API/SBTypeFormat.cpp; sourceTree = "<group>"; };
+ 9461568714E355F2003A195C /* SBTypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFormat.h; path = include/lldb/API/SBTypeFormat.h; sourceTree = "<group>"; };
+ 9461569314E3567F003A195C /* SBTypeFormat.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFormat.i; sourceTree = "<group>"; };
+ 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeNameSpecifier.cpp; path = source/API/SBTypeNameSpecifier.cpp; sourceTree = "<group>"; };
+ 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeNameSpecifier.h; path = include/lldb/API/SBTypeNameSpecifier.h; sourceTree = "<group>"; };
+ 9475C18B14E5F818001BFC6D /* SBTypeNameSpecifier.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeNameSpecifier.i; sourceTree = "<group>"; };
+ 9461568C14E35621003A195C /* SBTypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSummary.cpp; path = source/API/SBTypeSummary.cpp; sourceTree = "<group>"; };
+ 9461568814E355F2003A195C /* SBTypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSummary.h; path = include/lldb/API/SBTypeSummary.h; sourceTree = "<group>"; };
+ 9461569414E3567F003A195C /* SBTypeSummary.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSummary.i; sourceTree = "<group>"; };
+ 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSynthetic.cpp; path = source/API/SBTypeSynthetic.cpp; sourceTree = "<group>"; };
+ 9461568914E355F2003A195C /* SBTypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSynthetic.h; path = include/lldb/API/SBTypeSynthetic.h; sourceTree = "<group>"; };
+ 9461569514E3567F003A195C /* SBTypeSynthetic.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSynthetic.i; sourceTree = "<group>"; };
+ 23059A0F1958B319007B8189 /* SBUnixSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBUnixSignals.cpp; path = source/API/SBUnixSignals.cpp; sourceTree = "<group>"; };
+ 23059A111958B37B007B8189 /* SBUnixSignals.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBUnixSignals.h; path = include/lldb/API/SBUnixSignals.h; sourceTree = "<group>"; };
+ 23DCBE9A1D63E14B0084C36B /* SBUnixSignals.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBUnixSignals.i; sourceTree = "<group>"; };
+ 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValue.cpp; path = source/API/SBValue.cpp; sourceTree = "<group>"; };
+ 9A19A6A51163BB7E00E0D453 /* SBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValue.h; path = include/lldb/API/SBValue.h; sourceTree = "<group>"; };
+ 2611FF12142D83060017FEA3 /* SBValue.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValue.i; sourceTree = "<group>"; };
+ 9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValueList.cpp; path = source/API/SBValueList.cpp; sourceTree = "<group>"; };
+ 9A357582116CFDEE00E8ED2F /* SBValueList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValueList.h; path = include/lldb/API/SBValueList.h; sourceTree = "<group>"; };
+ 2611FF13142D83060017FEA3 /* SBValueList.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValueList.i; sourceTree = "<group>"; };
+ 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBVariablesOptions.cpp; path = source/API/SBVariablesOptions.cpp; sourceTree = "<group>"; };
+ 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBVariablesOptions.h; path = include/lldb/API/SBVariablesOptions.h; sourceTree = "<group>"; };
+ 94235B9D1A8D601A00EB2EED /* SBVariablesOptions.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBVariablesOptions.i; sourceTree = "<group>"; };
+ B2A58723143119D50092BFBA /* SBWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpoint.cpp; path = source/API/SBWatchpoint.cpp; sourceTree = "<group>"; };
+ B2A58721143119810092BFBA /* SBWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpoint.h; path = include/lldb/API/SBWatchpoint.h; sourceTree = "<group>"; };
+ B2A5872514313B480092BFBA /* SBWatchpoint.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpoint.i; sourceTree = "<group>"; };
+ 26BC7D7810F1B77400F91463 /* STLUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STLUtils.h; path = include/lldb/Core/STLUtils.h; sourceTree = "<group>"; };
+ 4CAB257C18EC9DB800BAD33E /* SafeMachO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SafeMachO.h; path = include/lldb/Utility/SafeMachO.h; sourceTree = "<group>"; };
+ 26BC7E8D10F1B85900F91463 /* Scalar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Scalar.cpp; path = source/Core/Scalar.cpp; sourceTree = "<group>"; };
26BC7D7410F1B77400F91463 /* Scalar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scalar.h; path = include/lldb/Core/Scalar.h; sourceTree = "<group>"; };
+ 23CB14E91D66CC0E00EDDDE1 /* ScalarTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScalarTest.cpp; sourceTree = "<group>"; };
+ 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreter.cpp; path = source/Interpreter/ScriptInterpreter.cpp; sourceTree = "<group>"; };
+ 26BC7DE510F1B7F900F91463 /* ScriptInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreter.h; path = include/lldb/Interpreter/ScriptInterpreter.h; sourceTree = "<group>"; };
+ 3FBA69DD1B6067020008F44A /* ScriptInterpreterNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreterNone.cpp; path = ScriptInterpreter/None/ScriptInterpreterNone.cpp; sourceTree = "<group>"; };
+ 3FBA69DE1B6067020008F44A /* ScriptInterpreterNone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreterNone.h; path = ScriptInterpreter/None/ScriptInterpreterNone.h; sourceTree = "<group>"; };
+ 3FBA69E51B60672A0008F44A /* ScriptInterpreterPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreterPython.cpp; path = ScriptInterpreter/Python/ScriptInterpreterPython.cpp; sourceTree = "<group>"; };
+ 3FBA69E61B60672A0008F44A /* ScriptInterpreterPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreterPython.h; path = ScriptInterpreter/Python/ScriptInterpreterPython.h; sourceTree = "<group>"; };
+ 26BC7E1510F1B83100F91463 /* SearchFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SearchFilter.cpp; path = source/Core/SearchFilter.cpp; sourceTree = "<group>"; };
+ 26BC7CF910F1B71400F91463 /* SearchFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SearchFilter.h; path = include/lldb/Core/SearchFilter.h; sourceTree = "<group>"; };
+ 26BC7E8E10F1B85900F91463 /* Section.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Section.cpp; path = source/Core/Section.cpp; sourceTree = "<group>"; };
26BC7D7510F1B77400F91463 /* Section.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Section.h; path = include/lldb/Core/Section.h; sourceTree = "<group>"; };
+ 262173A218395D4600C52091 /* SectionLoadHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionLoadHistory.cpp; path = source/Target/SectionLoadHistory.cpp; sourceTree = "<group>"; };
+ 262173A018395D3800C52091 /* SectionLoadHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SectionLoadHistory.h; path = include/lldb/Target/SectionLoadHistory.h; sourceTree = "<group>"; };
+ 2618D7911240116900F2B8FE /* SectionLoadList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SectionLoadList.cpp; path = source/Target/SectionLoadList.cpp; sourceTree = "<group>"; };
+ 2618D78F1240115500F2B8FE /* SectionLoadList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SectionLoadList.h; path = include/lldb/Target/SectionLoadList.h; sourceTree = "<group>"; };
+ EDB919B414F6F10D008FF64B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+ 26A3757F1D59462700D6CBDB /* SelectHelper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SelectHelper.cpp; path = source/Utility/SelectHelper.cpp; sourceTree = "<group>"; };
+ 26A375841D59487700D6CBDB /* SelectHelper.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SelectHelper.h; path = include/lldb/Utility/SelectHelper.h; sourceTree = "<group>"; };
+ 4C2FAE2E135E3A70001EDE44 /* SharedCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedCluster.h; path = include/lldb/Utility/SharedCluster.h; sourceTree = "<group>"; };
+ 261B5A5211C3F2AD00AABD0A /* SharingPtr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SharingPtr.cpp; path = source/Utility/SharingPtr.cpp; sourceTree = "<group>"; };
+ 261B5A5311C3F2AD00AABD0A /* SharingPtr.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharingPtr.h; path = include/lldb/Utility/SharingPtr.h; sourceTree = "<group>"; };
+ 236124A31986B4E2004EFC37 /* Socket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Socket.cpp; sourceTree = "<group>"; };
+ 236124A71986B50E004EFC37 /* Socket.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Socket.h; path = include/lldb/Host/Socket.h; sourceTree = "<group>"; };
+ 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
+ 26D7E45B13D5E2F9007FD12B /* SocketAddress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SocketAddress.h; path = include/lldb/Host/SocketAddress.h; sourceTree = "<group>"; };
+ 2321F9391BDD332400BA9A93 /* SocketAddressTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SocketAddressTest.cpp; sourceTree = "<group>"; };
+ 2321F93A1BDD332400BA9A93 /* SocketTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SocketTest.cpp; sourceTree = "<group>"; };
+ 232CB613191E00CC00EF39FC /* SoftwareBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SoftwareBreakpoint.cpp; path = source/Host/common/SoftwareBreakpoint.cpp; sourceTree = "<group>"; };
+ 267A47F21B14115A0021A5BC /* SoftwareBreakpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SoftwareBreakpoint.h; path = include/lldb/Host/common/SoftwareBreakpoint.h; sourceTree = "<group>"; };
+ 26BC7E8F10F1B85900F91463 /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SourceManager.cpp; path = source/Core/SourceManager.cpp; sourceTree = "<group>"; };
26BC7D7610F1B77400F91463 /* SourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SourceManager.h; path = include/lldb/Core/SourceManager.h; sourceTree = "<group>"; };
- 26BC7D7710F1B77400F91463 /* State.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = State.h; path = include/lldb/Core/State.h; sourceTree = "<group>"; };
- 26BC7D7810F1B77400F91463 /* STLUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = STLUtils.h; path = include/lldb/Core/STLUtils.h; sourceTree = "<group>"; };
- 26BC7D7A10F1B77400F91463 /* StreamFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamFile.h; path = include/lldb/Core/StreamFile.h; sourceTree = "<group>"; };
- 26BC7D7E10F1B77400F91463 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = include/lldb/Utility/Timer.h; sourceTree = "<group>"; };
- 26BC7D8110F1B77400F91463 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Value.h; path = include/lldb/Core/Value.h; sourceTree = "<group>"; };
- 26BC7D8210F1B77400F91463 /* ValueObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObject.h; path = include/lldb/Core/ValueObject.h; sourceTree = "<group>"; };
- 26BC7D8310F1B77400F91463 /* ValueObjectChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectChild.h; path = include/lldb/Core/ValueObjectChild.h; sourceTree = "<group>"; };
- 26BC7D8410F1B77400F91463 /* ValueObjectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectList.h; path = include/lldb/Core/ValueObjectList.h; sourceTree = "<group>"; };
- 26BC7D8510F1B77400F91463 /* ValueObjectVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectVariable.h; path = include/lldb/Core/ValueObjectVariable.h; sourceTree = "<group>"; };
- 26BC7DC010F1B79500F91463 /* ClangExpressionHelper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionHelper.h; path = ExpressionParser/Clang/ClangExpressionHelper.h; sourceTree = "<group>"; };
- 26BC7DC310F1B79500F91463 /* DWARFExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DWARFExpression.h; path = include/lldb/Expression/DWARFExpression.h; sourceTree = "<group>"; };
- 26BC7DD310F1B7D500F91463 /* Endian.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Endian.h; path = include/lldb/Utility/Endian.h; sourceTree = "<group>"; };
- 26BC7DD410F1B7D500F91463 /* Host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Host.h; path = include/lldb/Host/Host.h; sourceTree = "<group>"; };
- 26BC7DD610F1B7D500F91463 /* Predicate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Predicate.h; path = include/lldb/Host/Predicate.h; sourceTree = "<group>"; };
- 26BC7DE210F1B7F900F91463 /* CommandInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandInterpreter.h; path = include/lldb/Interpreter/CommandInterpreter.h; sourceTree = "<group>"; };
- 26BC7DE310F1B7F900F91463 /* CommandObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObject.h; path = include/lldb/Interpreter/CommandObject.h; sourceTree = "<group>"; };
- 26BC7DE410F1B7F900F91463 /* CommandReturnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandReturnObject.h; path = include/lldb/Interpreter/CommandReturnObject.h; sourceTree = "<group>"; };
- 26BC7DE510F1B7F900F91463 /* ScriptInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreter.h; path = include/lldb/Interpreter/ScriptInterpreter.h; sourceTree = "<group>"; };
- 26BC7DF110F1B81A00F91463 /* DynamicLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DynamicLoader.h; path = include/lldb/Target/DynamicLoader.h; sourceTree = "<group>"; };
- 26BC7DF210F1B81A00F91463 /* ExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContext.h; path = include/lldb/Target/ExecutionContext.h; sourceTree = "<group>"; };
- 26BC7DF310F1B81A00F91463 /* Process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Process.h; path = include/lldb/Target/Process.h; sourceTree = "<group>"; };
- 26BC7DF410F1B81A00F91463 /* RegisterContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext.h; path = include/lldb/Target/RegisterContext.h; sourceTree = "<group>"; };
+ 26BC7F3810F1B90C00F91463 /* StackFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackFrame.cpp; path = source/Target/StackFrame.cpp; sourceTree = "<group>"; };
26BC7DF510F1B81A00F91463 /* StackFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StackFrame.h; path = include/lldb/Target/StackFrame.h; sourceTree = "<group>"; };
+ 26BC7F3910F1B90C00F91463 /* StackFrameList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackFrameList.cpp; path = source/Target/StackFrameList.cpp; sourceTree = "<group>"; };
26BC7DF610F1B81A00F91463 /* StackFrameList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StackFrameList.h; path = include/lldb/Target/StackFrameList.h; sourceTree = "<group>"; };
+ 26BC7F3A10F1B90C00F91463 /* StackID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackID.cpp; path = source/Target/StackID.cpp; sourceTree = "<group>"; };
26BC7DF710F1B81A00F91463 /* StackID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StackID.h; path = include/lldb/Target/StackID.h; sourceTree = "<group>"; };
- 26BC7DF810F1B81A00F91463 /* Target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Target.h; path = include/lldb/Target/Target.h; sourceTree = "<group>"; };
- 26BC7DF910F1B81A00F91463 /* TargetList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TargetList.h; path = include/lldb/Target/TargetList.h; sourceTree = "<group>"; };
- 26BC7DFA10F1B81A00F91463 /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Thread.h; path = include/lldb/Target/Thread.h; sourceTree = "<group>"; };
- 26BC7DFB10F1B81A00F91463 /* ThreadList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadList.h; path = include/lldb/Target/ThreadList.h; sourceTree = "<group>"; };
- 26BC7DFC10F1B81A00F91463 /* ThreadPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlan.h; path = include/lldb/Target/ThreadPlan.h; sourceTree = "<group>"; };
- 26BC7E0910F1B83100F91463 /* StoppointCallbackContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StoppointCallbackContext.cpp; path = source/Breakpoint/StoppointCallbackContext.cpp; sourceTree = "<group>"; };
- 26BC7E0A10F1B83100F91463 /* Breakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Breakpoint.cpp; path = source/Breakpoint/Breakpoint.cpp; sourceTree = "<group>"; };
- 26BC7E0B10F1B83100F91463 /* BreakpointID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointID.cpp; path = source/Breakpoint/BreakpointID.cpp; sourceTree = "<group>"; };
- 26BC7E0C10F1B83100F91463 /* BreakpointIDList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointIDList.cpp; path = source/Breakpoint/BreakpointIDList.cpp; sourceTree = "<group>"; };
- 26BC7E0D10F1B83100F91463 /* BreakpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointList.cpp; path = source/Breakpoint/BreakpointList.cpp; sourceTree = "<group>"; };
- 26BC7E0E10F1B83100F91463 /* BreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocation.cpp; path = source/Breakpoint/BreakpointLocation.cpp; sourceTree = "<group>"; };
- 26BC7E0F10F1B83100F91463 /* BreakpointLocationCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocationCollection.cpp; path = source/Breakpoint/BreakpointLocationCollection.cpp; sourceTree = "<group>"; };
- 26BC7E1010F1B83100F91463 /* BreakpointLocationList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointLocationList.cpp; path = source/Breakpoint/BreakpointLocationList.cpp; sourceTree = "<group>"; };
- 26BC7E1110F1B83100F91463 /* BreakpointOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointOptions.cpp; path = source/Breakpoint/BreakpointOptions.cpp; sourceTree = "<group>"; };
- 26BC7E1210F1B83100F91463 /* BreakpointResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolver.cpp; path = source/Breakpoint/BreakpointResolver.cpp; sourceTree = "<group>"; };
- 26BC7E1310F1B83100F91463 /* BreakpointSite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointSite.cpp; path = source/Breakpoint/BreakpointSite.cpp; sourceTree = "<group>"; };
- 26BC7E1410F1B83100F91463 /* BreakpointSiteList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointSiteList.cpp; path = source/Breakpoint/BreakpointSiteList.cpp; sourceTree = "<group>"; };
- 26BC7E1510F1B83100F91463 /* SearchFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SearchFilter.cpp; path = source/Core/SearchFilter.cpp; sourceTree = "<group>"; };
+ 26BC7E9010F1B85900F91463 /* State.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = State.cpp; path = source/Core/State.cpp; sourceTree = "<group>"; };
+ 26BC7D7710F1B77400F91463 /* State.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = State.h; path = include/lldb/Core/State.h; sourceTree = "<group>"; };
+ 9A3D43E21F3237D500EB767C /* StateTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StateTest.cpp; sourceTree = "<group>"; };
+ 492DB7E81EC662D100B9E9AF /* Status.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Status.cpp; path = source/Utility/Status.cpp; sourceTree = "<group>"; };
+ 492DB7E61EC662B100B9E9AF /* Status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Status.h; path = include/lldb/Utility/Status.h; sourceTree = "<group>"; };
+ 9A3D43C61F3150D200EB767C /* StatusTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatusTest.cpp; sourceTree = "<group>"; };
+ 2615DB861208A9E40021781D /* StopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfo.cpp; path = source/Target/StopInfo.cpp; sourceTree = "<group>"; };
+ 2615DB841208A9C90021781D /* StopInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfo.h; path = include/lldb/Target/StopInfo.h; sourceTree = "<group>"; };
+ 2615DBC81208B5FC0021781D /* StopInfoMachException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StopInfoMachException.cpp; path = Utility/StopInfoMachException.cpp; sourceTree = "<group>"; };
+ 2615DBC91208B5FC0021781D /* StopInfoMachException.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StopInfoMachException.h; path = Utility/StopInfoMachException.h; sourceTree = "<group>"; };
26BC7E1610F1B83100F91463 /* Stoppoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Stoppoint.cpp; path = source/Breakpoint/Stoppoint.cpp; sourceTree = "<group>"; };
+ 26BC7CFA10F1B71400F91463 /* Stoppoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Stoppoint.h; path = include/lldb/Breakpoint/Stoppoint.h; sourceTree = "<group>"; };
+ 26BC7E0910F1B83100F91463 /* StoppointCallbackContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StoppointCallbackContext.cpp; path = source/Breakpoint/StoppointCallbackContext.cpp; sourceTree = "<group>"; };
+ 26BC7CED10F1B71400F91463 /* StoppointCallbackContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StoppointCallbackContext.h; path = include/lldb/Breakpoint/StoppointCallbackContext.h; sourceTree = "<group>"; };
26BC7E1710F1B83100F91463 /* StoppointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StoppointLocation.cpp; path = source/Breakpoint/StoppointLocation.cpp; sourceTree = "<group>"; };
- 26BC7E1810F1B83100F91463 /* Watchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Watchpoint.cpp; path = source/Breakpoint/Watchpoint.cpp; sourceTree = "<group>"; };
- 26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBreakpoint.cpp; path = source/Commands/CommandObjectBreakpoint.cpp; sourceTree = "<group>"; };
- 26BC7E3010F1B84700F91463 /* CommandObjectDisassemble.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectDisassemble.cpp; path = source/Commands/CommandObjectDisassemble.cpp; sourceTree = "<group>"; };
- 26BC7E3110F1B84700F91463 /* CommandObjectExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectExpression.cpp; path = source/Commands/CommandObjectExpression.cpp; sourceTree = "<group>"; };
- 26BC7E3310F1B84700F91463 /* CommandObjectHelp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectHelp.cpp; path = source/Commands/CommandObjectHelp.cpp; sourceTree = "<group>"; };
- 26BC7E3610F1B84700F91463 /* CommandObjectMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMemory.cpp; path = source/Commands/CommandObjectMemory.cpp; sourceTree = "<group>"; };
- 26BC7E3810F1B84700F91463 /* CommandObjectProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectProcess.cpp; path = source/Commands/CommandObjectProcess.cpp; sourceTree = "<group>"; };
- 26BC7E3910F1B84700F91463 /* CommandObjectQuit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectQuit.cpp; path = source/Commands/CommandObjectQuit.cpp; sourceTree = "<group>"; };
- 26BC7E3B10F1B84700F91463 /* CommandObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegister.cpp; path = source/Commands/CommandObjectRegister.cpp; sourceTree = "<group>"; };
- 26BC7E3D10F1B84700F91463 /* CommandObjectScript.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectScript.cpp; path = source/Interpreter/CommandObjectScript.cpp; sourceTree = "<group>"; };
- 26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSettings.cpp; path = source/Commands/CommandObjectSettings.cpp; sourceTree = "<group>"; };
- 26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSource.cpp; path = source/Commands/CommandObjectSource.cpp; sourceTree = "<group>"; };
- 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectSyntax.cpp; path = source/Commands/CommandObjectSyntax.cpp; sourceTree = "<group>"; };
- 26BC7E4610F1B84700F91463 /* CommandObjectThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectThread.cpp; path = source/Commands/CommandObjectThread.cpp; sourceTree = "<group>"; };
- 26BC7E6910F1B85900F91463 /* Address.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Address.cpp; path = source/Core/Address.cpp; sourceTree = "<group>"; };
- 26BC7E6A10F1B85900F91463 /* AddressRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressRange.cpp; path = source/Core/AddressRange.cpp; sourceTree = "<group>"; };
- 26BC7E6C10F1B85900F91463 /* Args.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Args.cpp; path = source/Interpreter/Args.cpp; sourceTree = "<group>"; };
- 26BC7E6D10F1B85900F91463 /* Broadcaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Broadcaster.cpp; path = source/Core/Broadcaster.cpp; sourceTree = "<group>"; };
- 26BC7E6E10F1B85900F91463 /* Communication.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Communication.cpp; path = source/Core/Communication.cpp; sourceTree = "<group>"; };
- 26BC7E6F10F1B85900F91463 /* Connection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Connection.cpp; path = source/Utility/Connection.cpp; sourceTree = "<group>"; };
- 26BC7E7410F1B85900F91463 /* lldb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lldb.cpp; path = source/lldb.cpp; sourceTree = "<group>"; };
- 26BC7E7610F1B85900F91463 /* Disassembler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Disassembler.cpp; path = source/Core/Disassembler.cpp; sourceTree = "<group>"; };
- 26BC7E7710F1B85900F91463 /* DynamicLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DynamicLoader.cpp; path = source/Core/DynamicLoader.cpp; sourceTree = "<group>"; };
- 26BC7E7910F1B85900F91463 /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = source/Core/Event.cpp; sourceTree = "<group>"; };
- 26BC7E7B10F1B85900F91463 /* FileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpecList.cpp; path = source/Core/FileSpecList.cpp; sourceTree = "<group>"; };
- 26BC7E7E10F1B85900F91463 /* Listener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Listener.cpp; path = source/Core/Listener.cpp; sourceTree = "<group>"; };
- 26BC7E7F10F1B85900F91463 /* Log.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Log.cpp; path = source/Utility/Log.cpp; sourceTree = "<group>"; };
- 26BC7E8010F1B85900F91463 /* Mangled.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Mangled.cpp; path = source/Core/Mangled.cpp; sourceTree = "<group>"; };
- 26BC7E8110F1B85900F91463 /* Module.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Module.cpp; path = source/Core/Module.cpp; sourceTree = "<group>"; };
- 26BC7E8210F1B85900F91463 /* ModuleChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleChild.cpp; path = source/Core/ModuleChild.cpp; sourceTree = "<group>"; };
- 26BC7E8310F1B85900F91463 /* ModuleList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleList.cpp; path = source/Core/ModuleList.cpp; sourceTree = "<group>"; };
- 26BC7E8610F1B85900F91463 /* Options.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Options.cpp; path = source/Interpreter/Options.cpp; sourceTree = "<group>"; };
- 26BC7E8A10F1B85900F91463 /* PluginManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PluginManager.cpp; path = source/Core/PluginManager.cpp; sourceTree = "<group>"; };
- 26BC7E8D10F1B85900F91463 /* Scalar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Scalar.cpp; path = source/Core/Scalar.cpp; sourceTree = "<group>"; };
- 26BC7E8E10F1B85900F91463 /* Section.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Section.cpp; path = source/Core/Section.cpp; sourceTree = "<group>"; };
- 26BC7E8F10F1B85900F91463 /* SourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SourceManager.cpp; path = source/Core/SourceManager.cpp; sourceTree = "<group>"; };
- 26BC7E9010F1B85900F91463 /* State.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = State.cpp; path = source/Core/State.cpp; sourceTree = "<group>"; };
+ 26BC7CFB10F1B71400F91463 /* StoppointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StoppointLocation.h; path = include/lldb/Breakpoint/StoppointLocation.h; sourceTree = "<group>"; };
+ 26764C9D1E48F51E008D3573 /* Stream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Stream.cpp; path = source/Utility/Stream.cpp; sourceTree = "<group>"; };
+ 26764C9B1E48F50C008D3573 /* Stream.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Stream.h; path = include/lldb/Utility/Stream.h; sourceTree = "<group>"; };
+ 9A4F350F1368A51A00823F52 /* StreamAsynchronousIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamAsynchronousIO.cpp; path = source/Core/StreamAsynchronousIO.cpp; sourceTree = "<group>"; };
+ 9A4F35111368A54100823F52 /* StreamAsynchronousIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamAsynchronousIO.h; path = include/lldb/Core/StreamAsynchronousIO.h; sourceTree = "<group>"; };
+ 2623096E13D0EFFB006381D9 /* StreamBuffer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamBuffer.h; path = include/lldb/Core/StreamBuffer.h; sourceTree = "<group>"; };
+ AFC2DCF51E6E316A00283714 /* StreamCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamCallback.cpp; path = source/Utility/StreamCallback.cpp; sourceTree = "<group>"; };
+ AFC2DCF71E6E316F00283714 /* StreamCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamCallback.h; path = include/lldb/Utility/StreamCallback.h; sourceTree = "<group>"; };
+ 9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamCallbackTest.cpp; sourceTree = "<group>"; };
26BC7E9210F1B85900F91463 /* StreamFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamFile.cpp; path = source/Core/StreamFile.cpp; sourceTree = "<group>"; };
- 26BC7E9610F1B85900F91463 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timer.cpp; path = source/Utility/Timer.cpp; sourceTree = "<group>"; };
- 26BC7E9910F1B85900F91463 /* Value.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Value.cpp; path = source/Core/Value.cpp; sourceTree = "<group>"; };
- 26BC7E9A10F1B85900F91463 /* ValueObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObject.cpp; path = source/Core/ValueObject.cpp; sourceTree = "<group>"; };
- 26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectChild.cpp; path = source/Core/ValueObjectChild.cpp; sourceTree = "<group>"; };
- 26BC7E9C10F1B85900F91463 /* ValueObjectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectList.cpp; path = source/Core/ValueObjectList.cpp; sourceTree = "<group>"; };
- 26BC7E9D10F1B85900F91463 /* ValueObjectVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectVariable.cpp; path = source/Core/ValueObjectVariable.cpp; sourceTree = "<group>"; };
- 26BC7ED510F1B86700F91463 /* ClangUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUserExpression.cpp; path = ExpressionParser/Clang/ClangUserExpression.cpp; sourceTree = "<group>"; };
- 26BC7ED810F1B86700F91463 /* DWARFExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DWARFExpression.cpp; path = source/Expression/DWARFExpression.cpp; sourceTree = "<group>"; };
- 26BC7EE810F1B88F00F91463 /* Host.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = Host.mm; path = source/Host/macosx/Host.mm; sourceTree = "<group>"; };
- 26BC7EED10F1B8AD00F91463 /* CFCBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCBundle.cpp; path = source/Host/macosx/cfcpp/CFCBundle.cpp; sourceTree = "<group>"; };
- 26BC7EEE10F1B8AD00F91463 /* CFCBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCBundle.h; path = source/Host/macosx/cfcpp/CFCBundle.h; sourceTree = "<group>"; };
- 26BC7EEF10F1B8AD00F91463 /* CFCData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCData.cpp; path = source/Host/macosx/cfcpp/CFCData.cpp; sourceTree = "<group>"; };
- 26BC7EF010F1B8AD00F91463 /* CFCData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCData.h; path = source/Host/macosx/cfcpp/CFCData.h; sourceTree = "<group>"; };
- 26BC7EF110F1B8AD00F91463 /* CFCMutableArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableArray.cpp; path = source/Host/macosx/cfcpp/CFCMutableArray.cpp; sourceTree = "<group>"; };
- 26BC7EF210F1B8AD00F91463 /* CFCMutableArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableArray.h; path = source/Host/macosx/cfcpp/CFCMutableArray.h; sourceTree = "<group>"; };
- 26BC7EF310F1B8AD00F91463 /* CFCMutableDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableDictionary.cpp; path = source/Host/macosx/cfcpp/CFCMutableDictionary.cpp; sourceTree = "<group>"; };
- 26BC7EF410F1B8AD00F91463 /* CFCMutableDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableDictionary.h; path = source/Host/macosx/cfcpp/CFCMutableDictionary.h; sourceTree = "<group>"; };
- 26BC7EF510F1B8AD00F91463 /* CFCMutableSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCMutableSet.cpp; path = source/Host/macosx/cfcpp/CFCMutableSet.cpp; sourceTree = "<group>"; };
- 26BC7EF610F1B8AD00F91463 /* CFCMutableSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCMutableSet.h; path = source/Host/macosx/cfcpp/CFCMutableSet.h; sourceTree = "<group>"; };
- 26BC7EF710F1B8AD00F91463 /* CFCReleaser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCReleaser.h; path = source/Host/macosx/cfcpp/CFCReleaser.h; sourceTree = "<group>"; };
- 26BC7EF810F1B8AD00F91463 /* CFCString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CFCString.cpp; path = source/Host/macosx/cfcpp/CFCString.cpp; sourceTree = "<group>"; };
- 26BC7EF910F1B8AD00F91463 /* CFCString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CFCString.h; path = source/Host/macosx/cfcpp/CFCString.h; sourceTree = "<group>"; };
- 26BC7F0810F1B8DD00F91463 /* CommandInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandInterpreter.cpp; path = source/Interpreter/CommandInterpreter.cpp; sourceTree = "<group>"; };
- 26BC7F0910F1B8DD00F91463 /* CommandObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObject.cpp; path = source/Interpreter/CommandObject.cpp; sourceTree = "<group>"; };
- 26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandReturnObject.cpp; path = source/Interpreter/CommandReturnObject.cpp; sourceTree = "<group>"; };
- 26BC7F1310F1B8EC00F91463 /* Block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Block.cpp; path = source/Symbol/Block.cpp; sourceTree = "<group>"; };
- 26BC7F1410F1B8EC00F91463 /* ClangASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTContext.cpp; path = source/Symbol/ClangASTContext.cpp; sourceTree = "<group>"; };
- 26BC7F1510F1B8EC00F91463 /* CompileUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompileUnit.cpp; path = source/Symbol/CompileUnit.cpp; sourceTree = "<group>"; };
- 26BC7F1610F1B8EC00F91463 /* Declaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Declaration.cpp; path = source/Symbol/Declaration.cpp; sourceTree = "<group>"; };
- 26BC7F1710F1B8EC00F91463 /* DWARFCallFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DWARFCallFrameInfo.cpp; path = source/Symbol/DWARFCallFrameInfo.cpp; sourceTree = "<group>"; };
- 26BC7F1810F1B8EC00F91463 /* Function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Function.cpp; path = source/Symbol/Function.cpp; sourceTree = "<group>"; };
- 26BC7F1910F1B8EC00F91463 /* LineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineEntry.cpp; path = source/Symbol/LineEntry.cpp; sourceTree = "<group>"; };
- 26BC7F1A10F1B8EC00F91463 /* LineTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LineTable.cpp; path = source/Symbol/LineTable.cpp; sourceTree = "<group>"; };
+ 26BC7D7A10F1B77400F91463 /* StreamFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamFile.h; path = include/lldb/Core/StreamFile.h; sourceTree = "<group>"; };
+ AFC2DCF81E6E318000283714 /* StreamGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamGDBRemote.cpp; path = source/Utility/StreamGDBRemote.cpp; sourceTree = "<group>"; };
+ AFC2DCFA1E6E318600283714 /* StreamGDBRemote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamGDBRemote.h; path = include/lldb/Utility/StreamGDBRemote.h; sourceTree = "<group>"; };
+ 26764CA11E48F547008D3573 /* StreamString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamString.cpp; path = source/Utility/StreamString.cpp; sourceTree = "<group>"; };
+ 26764CA31E48F550008D3573 /* StreamString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamString.h; path = include/lldb/Utility/StreamString.h; sourceTree = "<group>"; };
+ 26764CA41E48F566008D3573 /* StreamTee.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamTee.h; path = include/lldb/Utility/StreamTee.h; sourceTree = "<group>"; };
+ 58EAC73D2106A0740029571E /* StreamTeeTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamTeeTest.cpp; sourceTree = "<group>"; };
+ 33E5E8411A672A240024ED68 /* StringConvert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringConvert.cpp; sourceTree = "<group>"; };
+ 33E5E8451A6736D30024ED68 /* StringConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringConvert.h; path = include/lldb/Host/StringConvert.h; sourceTree = SOURCE_ROOT; };
+ 2660D9F611922A1300958FBD /* StringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractor.cpp; path = source/Utility/StringExtractor.cpp; sourceTree = "<group>"; };
+ 26A375831D59486000D6CBDB /* StringExtractor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringExtractor.h; path = include/lldb/Utility/StringExtractor.h; sourceTree = "<group>"; };
+ 2676A093119C93C8008A98EF /* StringExtractorGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringExtractorGDBRemote.cpp; path = source/Utility/StringExtractorGDBRemote.cpp; sourceTree = "<group>"; };
+ 2676A094119C93C8008A98EF /* StringExtractorGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringExtractorGDBRemote.h; path = source/Utility/StringExtractorGDBRemote.h; sourceTree = "<group>"; };
+ 2321F9441BDD346100BA9A93 /* StringExtractorTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringExtractorTest.cpp; sourceTree = "<group>"; };
+ 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringLexer.cpp; path = source/Utility/StringLexer.cpp; sourceTree = "<group>"; };
+ 94380B8019940B0300BFE4A8 /* StringLexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringLexer.h; path = include/lldb/Utility/StringLexer.h; sourceTree = "<group>"; };
+ 9A35765F116E76B900E8ED2F /* StringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringList.cpp; path = source/Utility/StringList.cpp; sourceTree = "<group>"; };
+ 9A35765E116E76A700E8ED2F /* StringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringList.h; path = include/lldb/Utility/StringList.h; sourceTree = "<group>"; };
+ 94F48F241A01C687005C0EC6 /* StringPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringPrinter.cpp; path = source/DataFormatters/StringPrinter.cpp; sourceTree = "<group>"; };
+ 94F48F231A01C679005C0EC6 /* StringPrinter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringPrinter.h; path = include/lldb/DataFormatters/StringPrinter.h; sourceTree = "<group>"; };
+ 9A3D43DF1F31521200EB767C /* StructuredData-basic.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "StructuredData-basic.json"; sourceTree = "<group>"; };
+ AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StructuredData.cpp; path = source/Utility/StructuredData.cpp; sourceTree = "<group>"; };
+ 26F2F8FD1B156678007857DE /* StructuredData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StructuredData.h; path = include/lldb/Utility/StructuredData.h; sourceTree = "<group>"; };
+ 238F2BA61D2C85FA001FF92A /* StructuredDataDarwinLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructuredDataDarwinLog.cpp; sourceTree = "<group>"; };
+ 238F2BA71D2C85FA001FF92A /* StructuredDataDarwinLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructuredDataDarwinLog.h; sourceTree = "<group>"; };
+ 238F2B9D1D2C82D0001FF92A /* StructuredDataPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StructuredDataPlugin.cpp; path = source/Target/StructuredDataPlugin.cpp; sourceTree = "<group>"; };
+ 238F2B9F1D2C835A001FF92A /* StructuredDataPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StructuredDataPlugin.h; path = include/lldb/Target/StructuredDataPlugin.h; sourceTree = "<group>"; };
+ 9A3D43CA1F3150D200EB767C /* StructuredDataTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructuredDataTest.cpp; sourceTree = "<group>"; };
+ 9A20573D1F3B8EA200F6C293 /* SupportTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SupportTest.cpp; path = linux/SupportTest.cpp; sourceTree = "<group>"; };
26BC7F1B10F1B8EC00F91463 /* Symbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symbol.cpp; path = source/Symbol/Symbol.cpp; sourceTree = "<group>"; };
+ 26BC7C5F10F1B6E900F91463 /* Symbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbol.h; path = include/lldb/Symbol/Symbol.h; sourceTree = "<group>"; };
26BC7F1C10F1B8EC00F91463 /* SymbolContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolContext.cpp; path = source/Symbol/SymbolContext.cpp; sourceTree = "<group>"; };
+ 26BC7C6010F1B6E900F91463 /* SymbolContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolContext.h; path = include/lldb/Symbol/SymbolContext.h; sourceTree = "<group>"; };
+ 26BC7C6110F1B6E900F91463 /* SymbolContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolContextScope.h; path = include/lldb/Symbol/SymbolContextScope.h; sourceTree = "<group>"; };
26BC7F1D10F1B8EC00F91463 /* SymbolFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFile.cpp; path = source/Symbol/SymbolFile.cpp; sourceTree = "<group>"; };
+ 26BC7C6210F1B6E900F91463 /* SymbolFile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolFile.h; path = include/lldb/Symbol/SymbolFile.h; sourceTree = "<group>"; };
+ 260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARF.cpp; sourceTree = "<group>"; };
+ 260C89DA10F57C5600BB2B04 /* SymbolFileDWARF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARF.h; sourceTree = "<group>"; };
+ 260C89DB10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDebugMap.cpp; sourceTree = "<group>"; };
+ 260C89DC10F57C5600BB2B04 /* SymbolFileDWARFDebugMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDebugMap.h; sourceTree = "<group>"; };
+ 6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwo.cpp; sourceTree = "<group>"; };
+ 6D95DC041B9DC06F000E318A /* SymbolFileDWARFDwo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwo.h; sourceTree = "<group>"; };
+ 4C7D481F1F509964005314B4 /* SymbolFileDWARFDwoDwp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwoDwp.cpp; sourceTree = "<group>"; };
+ 4C7D481D1F509964005314B4 /* SymbolFileDWARFDwoDwp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwoDwp.h; sourceTree = "<group>"; };
+ 4C7D481C1F509963005314B4 /* SymbolFileDWARFDwp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwp.cpp; sourceTree = "<group>"; };
+ 4C7D481E1F509964005314B4 /* SymbolFileDWARFDwp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwp.h; sourceTree = "<group>"; };
+ 9A20570A1F3B81F300F6C293 /* SymbolFileDWARFTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFileDWARFTests.cpp; path = DWARF/SymbolFileDWARFTests.cpp; sourceTree = "<group>"; };
+ AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFilePDB.cpp; path = PDB/SymbolFilePDB.cpp; sourceTree = "<group>"; };
+ AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolFilePDB.h; path = PDB/SymbolFilePDB.h; sourceTree = "<group>"; };
+ 23CB15141D66CF8700EDDDE1 /* SymbolFilePDBTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFilePDBTests.cpp; sourceTree = "<group>"; };
+ 260C89DE10F57C5600BB2B04 /* SymbolFileSymtab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileSymtab.cpp; sourceTree = "<group>"; };
+ 260C89DF10F57C5600BB2B04 /* SymbolFileSymtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileSymtab.h; sourceTree = "<group>"; };
+ AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = "<group>"; };
+ 26BC7C6310F1B6E900F91463 /* SymbolVendor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolVendor.h; path = include/lldb/Symbol/SymbolVendor.h; sourceTree = "<group>"; };
+ 2635879017822E56004C30BA /* SymbolVendorELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorELF.cpp; sourceTree = "<group>"; };
+ 2635879117822E56004C30BA /* SymbolVendorELF.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorELF.h; sourceTree = "<group>"; };
+ 260C89E210F57C5600BB2B04 /* SymbolVendorMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolVendorMacOSX.cpp; sourceTree = "<group>"; };
+ 260C89E310F57C5600BB2B04 /* SymbolVendorMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolVendorMacOSX.h; sourceTree = "<group>"; };
+ 2689B0B5113EE47E00A4AEDB /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symbols.cpp; path = source/Host/macosx/Symbols.cpp; sourceTree = "<group>"; };
+ 69A01E1F1236C5D400C660B5 /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Symbols.cpp; sourceTree = "<group>"; };
+ 2689B0A4113EE3CD00A4AEDB /* Symbols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbols.h; path = include/lldb/Host/Symbols.h; sourceTree = "<group>"; };
+ 2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolsTest.cpp; sourceTree = "<group>"; };
26BC7F1F10F1B8EC00F91463 /* Symtab.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Symtab.cpp; path = source/Symbol/Symtab.cpp; sourceTree = "<group>"; };
- 26BC7F2010F1B8EC00F91463 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = source/Symbol/Type.cpp; sourceTree = "<group>"; };
- 26BC7F2110F1B8EC00F91463 /* TypeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeList.cpp; path = source/Symbol/TypeList.cpp; sourceTree = "<group>"; };
- 26BC7F2210F1B8EC00F91463 /* Variable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Variable.cpp; path = source/Symbol/Variable.cpp; sourceTree = "<group>"; };
- 26BC7F2310F1B8EC00F91463 /* VariableList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariableList.cpp; path = source/Symbol/VariableList.cpp; sourceTree = "<group>"; };
- 26BC7F3510F1B90C00F91463 /* ExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExecutionContext.cpp; path = source/Target/ExecutionContext.cpp; sourceTree = "<group>"; };
- 26BC7F3610F1B90C00F91463 /* Process.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Process.cpp; path = source/Target/Process.cpp; sourceTree = "<group>"; };
- 26BC7F3710F1B90C00F91463 /* RegisterContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContext.cpp; path = source/Target/RegisterContext.cpp; sourceTree = "<group>"; };
- 26BC7F3810F1B90C00F91463 /* StackFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackFrame.cpp; path = source/Target/StackFrame.cpp; sourceTree = "<group>"; };
- 26BC7F3910F1B90C00F91463 /* StackFrameList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackFrameList.cpp; path = source/Target/StackFrameList.cpp; sourceTree = "<group>"; };
- 26BC7F3A10F1B90C00F91463 /* StackID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StackID.cpp; path = source/Target/StackID.cpp; sourceTree = "<group>"; };
+ 26BC7C6410F1B6E900F91463 /* Symtab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symtab.h; path = include/lldb/Symbol/Symtab.h; sourceTree = "<group>"; };
+ 3F81692E1ABB7A6D001DA9DF /* SystemInitializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializer.cpp; path = source/Initialization/SystemInitializer.cpp; sourceTree = "<group>"; };
+ 3F8169341ABB7A80001DA9DF /* SystemInitializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializer.h; path = include/lldb/Initialization/SystemInitializer.h; sourceTree = "<group>"; };
+ 3F81692F1ABB7A6D001DA9DF /* SystemInitializerCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializerCommon.cpp; path = source/Initialization/SystemInitializerCommon.cpp; sourceTree = "<group>"; };
+ 3F8169351ABB7A80001DA9DF /* SystemInitializerCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializerCommon.h; path = include/lldb/Initialization/SystemInitializerCommon.h; sourceTree = "<group>"; };
+ 3F81692A1ABB7A16001DA9DF /* SystemInitializerFull.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializerFull.cpp; path = source/API/SystemInitializerFull.cpp; sourceTree = "<group>"; };
+ CDC75CF920B8D1DF002209BC /* SystemInitializerFull.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializerFull.h; path = source/API/SystemInitializerFull.h; sourceTree = "<group>"; };
+ 4CD44D2020B725DA0003557C /* SystemInitializerLLGS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializerLLGS.cpp; path = "tools/lldb-server/SystemInitializerLLGS.cpp"; sourceTree = "<group>"; };
+ 4CD44D2320B725F60003557C /* SystemInitializerLLGS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializerLLGS.h; path = "tools/lldb-server/SystemInitializerLLGS.h"; sourceTree = "<group>"; };
+ 3F8169301ABB7A6D001DA9DF /* SystemLifetimeManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemLifetimeManager.cpp; path = source/Initialization/SystemLifetimeManager.cpp; sourceTree = "<group>"; };
+ 3F8169361ABB7A80001DA9DF /* SystemLifetimeManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemLifetimeManager.h; path = include/lldb/Initialization/SystemLifetimeManager.h; sourceTree = "<group>"; };
+ AF81DEF91828A23F0042CF19 /* SystemRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemRuntime.cpp; path = source/Target/SystemRuntime.cpp; sourceTree = "<group>"; };
+ 238F2BA01D2C835A001FF92A /* SystemRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SystemRuntime.h; path = include/lldb/Target/SystemRuntime.h; sourceTree = "<group>"; };
+ AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemRuntimeMacOSX.cpp; sourceTree = "<group>"; };
+ AF9B8F32182DB52900DA866F /* SystemRuntimeMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemRuntimeMacOSX.h; sourceTree = "<group>"; };
+ 2579065A1BD0488100178368 /* TCPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TCPSocket.cpp; sourceTree = "<group>"; };
+ 8C26C4241C3EA4340031DF7C /* TSanRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TSanRuntime.cpp; path = TSan/TSanRuntime.cpp; sourceTree = "<group>"; };
+ 8C26C4251C3EA4340031DF7C /* TSanRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TSanRuntime.h; path = TSan/TSanRuntime.h; sourceTree = "<group>"; };
+ 49BB309511F79450001A4197 /* TaggedASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaggedASTType.h; path = include/lldb/Symbol/TaggedASTType.h; sourceTree = "<group>"; };
26BC7F3B10F1B90C00F91463 /* Target.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Target.cpp; path = source/Target/Target.cpp; sourceTree = "<group>"; };
+ 26BC7DF810F1B81A00F91463 /* Target.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Target.h; path = include/lldb/Target/Target.h; sourceTree = "<group>"; };
26BC7F3C10F1B90C00F91463 /* TargetList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TargetList.cpp; path = source/Target/TargetList.cpp; sourceTree = "<group>"; };
+ 26BC7DF910F1B81A00F91463 /* TargetList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TargetList.h; path = include/lldb/Target/TargetList.h; sourceTree = "<group>"; };
+ 6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TaskPool.cpp; path = source/Host/common/TaskPool.cpp; sourceTree = "<group>"; };
+ 6DEC6F3A1BD66D950091ABA6 /* TaskPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaskPool.h; path = include/lldb/Host/TaskPool.h; sourceTree = "<group>"; };
+ 2321F9451BDD346100BA9A93 /* TaskPoolTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TaskPoolTest.cpp; sourceTree = "<group>"; };
+ 268DA873130095ED00C9483A /* Terminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Terminal.cpp; sourceTree = "<group>"; };
+ 268DA871130095D000C9483A /* Terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Terminal.h; path = include/lldb/Host/Terminal.h; sourceTree = "<group>"; };
+ 4CEC86A3204738C5009B37B1 /* TestArm64InstEmulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestArm64InstEmulation.cpp; path = UnwindAssembly/ARM64/TestArm64InstEmulation.cpp; sourceTree = "<group>"; };
+ 23CB150C1D66CF5600EDDDE1 /* TestClangASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestClangASTContext.cpp; sourceTree = "<group>"; };
+ 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestCompletion.cpp; sourceTree = "<group>"; };
+ 9A2057131F3B860D00F6C293 /* TestDWARFCallFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestDWARFCallFrameInfo.cpp; sourceTree = "<group>"; };
+ 23CB15051D66CDB400EDDDE1 /* TestModule.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = TestModule.c; sourceTree = "<group>"; };
+ 23CB15061D66CDB400EDDDE1 /* TestModule.so */ = {isa = PBXFileReference; lastKnownFileType = file; path = TestModule.so; sourceTree = "<group>"; };
+ 9A2057251F3B8DD200F6C293 /* TestObjectFileELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestObjectFileELF.cpp; path = ObjectFile/ELF/TestObjectFileELF.cpp; sourceTree = "<group>"; };
+ 4C719398207D23E300FDF430 /* TestOptionArgParser.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = TestOptionArgParser.cpp; sourceTree = "<group>"; };
+ 4CEC86A6204738EA009B37B1 /* TestPPC64InstEmulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestPPC64InstEmulation.cpp; path = UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp; sourceTree = "<group>"; };
+ 9A2057141F3B860D00F6C293 /* TestType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestType.cpp; sourceTree = "<group>"; };
+ 9A1890341F47D5D400394BCA /* TestUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestUtilities.cpp; path = TestingSupport/TestUtilities.cpp; sourceTree = "<group>"; };
+ 9A1890351F47D5D400394BCA /* TestUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestUtilities.h; path = TestingSupport/TestUtilities.h; sourceTree = "<group>"; };
+ AFEC5FD51D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Testx86AssemblyInspectionEngine.cpp; path = UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp; sourceTree = "<group>"; };
26BC7F3D10F1B90C00F91463 /* Thread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Thread.cpp; path = source/Target/Thread.cpp; sourceTree = "<group>"; };
+ 26BC7DFA10F1B81A00F91463 /* Thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Thread.h; path = include/lldb/Target/Thread.h; sourceTree = "<group>"; };
+ 8CCB017A19BA283D0009FD44 /* ThreadCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadCollection.cpp; path = source/Target/ThreadCollection.cpp; sourceTree = "<group>"; };
+ 8CCB017C19BA289B0009FD44 /* ThreadCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadCollection.h; path = include/lldb/Target/ThreadCollection.h; sourceTree = "<group>"; };
+ 26BC17A818C7F4CB00D2196D /* ThreadElfCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadElfCore.cpp; sourceTree = "<group>"; };
+ 26BC17A918C7F4CB00D2196D /* ThreadElfCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadElfCore.h; sourceTree = "<group>"; };
+ 2618EE631315B29C001D6D71 /* ThreadGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadGDBRemote.cpp; sourceTree = "<group>"; };
+ 2618EE641315B29C001D6D71 /* ThreadGDBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadGDBRemote.h; sourceTree = "<group>"; };
+ 2628A4D313D4977900F5487A /* ThreadKDP.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadKDP.cpp; sourceTree = "<group>"; };
+ 2628A4D413D4977900F5487A /* ThreadKDP.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadKDP.h; sourceTree = "<group>"; };
+ 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadLauncher.cpp; sourceTree = "<group>"; };
+ 3FDFED2319BA6D55009756A7 /* ThreadLauncher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadLauncher.h; path = include/lldb/Host/ThreadLauncher.h; sourceTree = "<group>"; };
26BC7F3E10F1B90C00F91463 /* ThreadList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadList.cpp; path = source/Target/ThreadList.cpp; sourceTree = "<group>"; };
- 26BC7F3F10F1B90C00F91463 /* ThreadPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlan.cpp; path = source/Target/ThreadPlan.cpp; sourceTree = "<group>"; };
- 26BC7F4C10F1BC1A00F91463 /* ObjectFile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjectFile.cpp; path = source/Symbol/ObjectFile.cpp; sourceTree = "<group>"; };
- 26BCFC4F1368ADF7006DC050 /* OptionGroupFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupFormat.h; path = include/lldb/Interpreter/OptionGroupFormat.h; sourceTree = "<group>"; };
- 26BCFC511368AE38006DC050 /* OptionGroupFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupFormat.cpp; path = source/Interpreter/OptionGroupFormat.cpp; sourceTree = "<group>"; };
- 26BCFC531368B3E4006DC050 /* OptionGroupOutputFile.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupOutputFile.cpp; path = source/Interpreter/OptionGroupOutputFile.cpp; sourceTree = "<group>"; };
- 26BCFC541368B4B8006DC050 /* OptionGroupOutputFile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupOutputFile.h; path = include/lldb/Interpreter/OptionGroupOutputFile.h; sourceTree = "<group>"; };
- 26BD407D135D2AC400237D80 /* FileLineResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileLineResolver.h; path = include/lldb/Core/FileLineResolver.h; sourceTree = "<group>"; };
- 26BD407E135D2ADF00237D80 /* FileLineResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileLineResolver.cpp; path = source/Core/FileLineResolver.cpp; sourceTree = "<group>"; };
- 26BF51EA1B3C754400016294 /* ABISysV_hexagon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_hexagon.cpp; sourceTree = "<group>"; };
- 26BF51EB1B3C754400016294 /* ABISysV_hexagon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_hexagon.h; sourceTree = "<group>"; };
- 26BF51EF1B3C754400016294 /* ABISysV_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_i386.cpp; sourceTree = "<group>"; };
- 26BF51F01B3C754400016294 /* ABISysV_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_i386.h; sourceTree = "<group>"; };
- 26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformMacOSX.cpp; sourceTree = "<group>"; };
- 26C5577C132575AD008FD8FE /* PlatformMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformMacOSX.h; sourceTree = "<group>"; };
- 26C6886D137880B900407EDF /* RegisterValue.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = RegisterValue.h; path = include/lldb/Core/RegisterValue.h; sourceTree = "<group>"; };
- 26C6886E137880C400407EDF /* RegisterValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterValue.cpp; path = source/Core/RegisterValue.cpp; sourceTree = "<group>"; };
- 26C72C93124322890068DC16 /* SBStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBStream.h; path = include/lldb/API/SBStream.h; sourceTree = "<group>"; };
- 26C72C951243229A0068DC16 /* SBStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStream.cpp; path = source/API/SBStream.cpp; sourceTree = "<group>"; };
- 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowsMiniDump.cpp; sourceTree = "<group>"; };
- 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsMiniDump.h; sourceTree = "<group>"; };
- 26CA979F172B1FD5005DC71B /* RegisterContextThreadMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextThreadMemory.cpp; path = Utility/RegisterContextThreadMemory.cpp; sourceTree = "<group>"; };
- 26CA97A0172B1FD5005DC71B /* RegisterContextThreadMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextThreadMemory.h; path = Utility/RegisterContextThreadMemory.h; sourceTree = "<group>"; };
- 26CEB5F018762056008F575A /* CommandObjectGUI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectGUI.cpp; path = source/Commands/CommandObjectGUI.cpp; sourceTree = "<group>"; };
- 26CEB5F118762056008F575A /* CommandObjectGUI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectGUI.h; path = source/Commands/CommandObjectGUI.h; sourceTree = "<group>"; };
- 26CF992414428766001E4138 /* AnsiTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AnsiTerminal.h; path = include/lldb/Utility/AnsiTerminal.h; sourceTree = "<group>"; };
- 26CFDCA01861638D000E63E5 /* Editline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Editline.h; path = include/lldb/Host/Editline.h; sourceTree = "<group>"; };
- 26CFDCA2186163A4000E63E5 /* Editline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Editline.cpp; sourceTree = "<group>"; };
- 26D0DD5010FE554D00271C65 /* BreakpointResolverAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverAddress.h; path = include/lldb/Breakpoint/BreakpointResolverAddress.h; sourceTree = "<group>"; };
- 26D0DD5110FE554D00271C65 /* BreakpointResolverFileLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileLine.h; path = include/lldb/Breakpoint/BreakpointResolverFileLine.h; sourceTree = "<group>"; };
- 26D0DD5210FE554D00271C65 /* BreakpointResolverName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverName.h; path = include/lldb/Breakpoint/BreakpointResolverName.h; sourceTree = "<group>"; };
- 26D0DD5310FE555900271C65 /* BreakpointResolverAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverAddress.cpp; path = source/Breakpoint/BreakpointResolverAddress.cpp; sourceTree = "<group>"; };
- 26D0DD5410FE555900271C65 /* BreakpointResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileLine.cpp; path = source/Breakpoint/BreakpointResolverFileLine.cpp; sourceTree = "<group>"; };
- 26D0DD5510FE555900271C65 /* BreakpointResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverName.cpp; path = source/Breakpoint/BreakpointResolverName.cpp; sourceTree = "<group>"; };
- 26D27C9D11ED3A4E0024D721 /* ELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ELFHeader.cpp; sourceTree = "<group>"; };
- 26D27C9E11ED3A4E0024D721 /* ELFHeader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ELFHeader.h; sourceTree = "<group>"; };
- 26D52C1D1A980FE300E5D2FB /* MICmdCmdSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdSymbol.cpp; path = "tools/lldb-mi/MICmdCmdSymbol.cpp"; sourceTree = SOURCE_ROOT; };
- 26D52C1E1A980FE300E5D2FB /* MICmdCmdSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdSymbol.h; path = "tools/lldb-mi/MICmdCmdSymbol.h"; sourceTree = SOURCE_ROOT; };
- 26D55234159A7DB100708D8D /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
- 26D5E15E135BAEA2006EA0A7 /* OptionGroupArchitecture.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupArchitecture.cpp; path = source/Interpreter/OptionGroupArchitecture.cpp; sourceTree = "<group>"; };
- 26D5E160135BAEB0006EA0A7 /* OptionGroupArchitecture.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupArchitecture.h; path = include/lldb/Interpreter/OptionGroupArchitecture.h; sourceTree = "<group>"; };
- 26D5E161135BB040006EA0A7 /* OptionGroupPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupPlatform.h; path = include/lldb/Interpreter/OptionGroupPlatform.h; sourceTree = "<group>"; };
- 26D5E162135BB054006EA0A7 /* OptionGroupPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupPlatform.cpp; path = source/Interpreter/OptionGroupPlatform.cpp; sourceTree = "<group>"; };
- 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-gdbserver.cpp"; path = "tools/lldb-server/lldb-gdbserver.cpp"; sourceTree = "<group>"; };
- 26D7E45B13D5E2F9007FD12B /* SocketAddress.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SocketAddress.h; path = include/lldb/Host/SocketAddress.h; sourceTree = "<group>"; };
- 26D7E45C13D5E30A007FD12B /* SocketAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
- 26D9FDC612F784E60003F2EE /* EmulateInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = EmulateInstruction.h; path = include/lldb/Core/EmulateInstruction.h; sourceTree = "<group>"; };
- 26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstruction.cpp; path = source/Core/EmulateInstruction.cpp; sourceTree = "<group>"; };
- 26DAED5F15D327A200E15819 /* OptionValuePathMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValuePathMappings.h; path = include/lldb/Interpreter/OptionValuePathMappings.h; sourceTree = "<group>"; };
- 26DAED6215D327C200E15819 /* OptionValuePathMappings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValuePathMappings.cpp; path = source/Interpreter/OptionValuePathMappings.cpp; sourceTree = "<group>"; };
- 26DAFD9711529BC7005A394E /* ExecutionContextScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExecutionContextScope.h; path = include/lldb/Target/ExecutionContextScope.h; sourceTree = "<group>"; };
- 26DB3E071379E7AD0080DC73 /* ABIMacOSX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm.cpp; sourceTree = "<group>"; };
- 26DB3E081379E7AD0080DC73 /* ABIMacOSX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm.h; sourceTree = "<group>"; };
- 26DB3E0B1379E7AD0080DC73 /* ABIMacOSX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_arm64.cpp; sourceTree = "<group>"; };
- 26DB3E0C1379E7AD0080DC73 /* ABIMacOSX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_arm64.h; sourceTree = "<group>"; };
- 26DB3E0F1379E7AD0080DC73 /* ABIMacOSX_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABIMacOSX_i386.cpp; sourceTree = "<group>"; };
- 26DB3E101379E7AD0080DC73 /* ABIMacOSX_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABIMacOSX_i386.h; sourceTree = "<group>"; };
- 26DB3E131379E7AD0080DC73 /* ABISysV_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ABISysV_x86_64.cpp; sourceTree = "<group>"; };
- 26DB3E141379E7AD0080DC73 /* ABISysV_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ABISysV_x86_64.h; sourceTree = "<group>"; };
- 26DC6A101337FE6900FF7998 /* lldb-server */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-server"; sourceTree = BUILT_PRODUCTS_DIR; };
- 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-platform.cpp"; path = "tools/lldb-server/lldb-platform.cpp"; sourceTree = "<group>"; };
- 26DE1E6A11616C2E00A093E2 /* lldb-forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = "lldb-forward.h"; path = "include/lldb/lldb-forward.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
- 26DE204011618AB900A093E2 /* SBSymbolContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbolContext.h; path = include/lldb/API/SBSymbolContext.h; sourceTree = "<group>"; };
- 26DE204211618ACA00A093E2 /* SBAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBAddress.h; path = include/lldb/API/SBAddress.h; sourceTree = "<group>"; };
- 26DE204411618ADA00A093E2 /* SBAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBAddress.cpp; path = source/API/SBAddress.cpp; sourceTree = "<group>"; };
- 26DE204611618AED00A093E2 /* SBSymbolContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbolContext.cpp; path = source/API/SBSymbolContext.cpp; sourceTree = "<group>"; };
- 26DE204C11618E7A00A093E2 /* SBModule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBModule.cpp; path = source/API/SBModule.cpp; sourceTree = "<group>"; };
- 26DE204E11618E9800A093E2 /* SBModule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBModule.h; path = include/lldb/API/SBModule.h; sourceTree = "<group>"; };
- 26DE205211618FAC00A093E2 /* SBFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFunction.h; path = include/lldb/API/SBFunction.h; sourceTree = "<group>"; };
- 26DE205411618FB800A093E2 /* SBCompileUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCompileUnit.h; path = include/lldb/API/SBCompileUnit.h; sourceTree = "<group>"; };
- 26DE205611618FC500A093E2 /* SBBlock.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBlock.h; path = include/lldb/API/SBBlock.h; sourceTree = "<group>"; };
- 26DE205811618FE700A093E2 /* SBLineEntry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLineEntry.h; path = include/lldb/API/SBLineEntry.h; sourceTree = "<group>"; };
- 26DE205A11618FF600A093E2 /* SBSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSymbol.h; path = include/lldb/API/SBSymbol.h; sourceTree = "<group>"; };
- 26DE205C1161901400A093E2 /* SBFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFunction.cpp; path = source/API/SBFunction.cpp; sourceTree = "<group>"; };
- 26DE205E1161901B00A093E2 /* SBCompileUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCompileUnit.cpp; path = source/API/SBCompileUnit.cpp; sourceTree = "<group>"; };
- 26DE20601161902600A093E2 /* SBBlock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBlock.cpp; path = source/API/SBBlock.cpp; sourceTree = "<group>"; };
- 26DE20621161904200A093E2 /* SBLineEntry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLineEntry.cpp; path = source/API/SBLineEntry.cpp; sourceTree = "<group>"; };
- 26DE20641161904E00A093E2 /* SBSymbol.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSymbol.cpp; path = source/API/SBSymbol.cpp; sourceTree = "<group>"; };
- 26DFBC51113B48D600DD817F /* CommandObjectMultiword.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectMultiword.h; path = include/lldb/Interpreter/CommandObjectMultiword.h; sourceTree = "<group>"; };
- 26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectRegexCommand.h; path = include/lldb/Interpreter/CommandObjectRegexCommand.h; sourceTree = "<group>"; };
- 26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectMultiword.cpp; path = source/Commands/CommandObjectMultiword.cpp; sourceTree = "<group>"; };
- 26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectRegexCommand.cpp; path = source/Interpreter/CommandObjectRegexCommand.cpp; sourceTree = "<group>"; };
- 26E152231419CACA007967D0 /* ObjectFilePECOFF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFilePECOFF.cpp; sourceTree = "<group>"; };
- 26E152241419CACA007967D0 /* ObjectFilePECOFF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ObjectFilePECOFF.h; sourceTree = "<group>"; };
- 26E3EEBD11A9870400FBADB6 /* Unwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Unwind.h; path = include/lldb/Target/Unwind.h; sourceTree = "<group>"; };
- 26E3EEE311A9901300FBADB6 /* UnwindMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindMacOSXFrameBackchain.cpp; path = Utility/UnwindMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
- 26E3EEE411A9901300FBADB6 /* UnwindMacOSXFrameBackchain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindMacOSXFrameBackchain.h; path = Utility/UnwindMacOSXFrameBackchain.h; sourceTree = "<group>"; };
- 26E3EEF711A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMacOSXFrameBackchain.cpp; path = Utility/RegisterContextMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
- 26E3EEF811A994E800FBADB6 /* RegisterContextMacOSXFrameBackchain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextMacOSXFrameBackchain.h; path = Utility/RegisterContextMacOSXFrameBackchain.h; sourceTree = "<group>"; };
- 26E6902E129C6BD500DDECD9 /* ClangExternalASTSourceCallbacks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExternalASTSourceCallbacks.h; path = include/lldb/Symbol/ClangExternalASTSourceCallbacks.h; sourceTree = "<group>"; };
- 26E69030129C6BEF00DDECD9 /* ClangExternalASTSourceCallbacks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExternalASTSourceCallbacks.cpp; path = source/Symbol/ClangExternalASTSourceCallbacks.cpp; sourceTree = "<group>"; };
- 26ED3D6C13C563810017D45E /* OptionGroupVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupVariable.cpp; path = source/Interpreter/OptionGroupVariable.cpp; sourceTree = "<group>"; };
- 26ED3D6F13C5638A0017D45E /* OptionGroupVariable.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupVariable.h; path = include/lldb/Interpreter/OptionGroupVariable.h; sourceTree = "<group>"; };
- 26EFB6181BFE8D3E00544801 /* PlatformNetBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformNetBSD.cpp; sourceTree = "<group>"; };
- 26EFB6191BFE8D3E00544801 /* PlatformNetBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformNetBSD.h; sourceTree = "<group>"; };
- 26EFC4CA18CFAF0D00865D87 /* ObjectFileJIT.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectFileJIT.cpp; sourceTree = "<group>"; };
- 26EFC4CB18CFAF0D00865D87 /* ObjectFileJIT.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjectFileJIT.h; sourceTree = "<group>"; };
- 26F006541B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderWindowsDYLD.cpp; sourceTree = "<group>"; };
- 26F006551B4DD86700B872E5 /* DynamicLoaderWindowsDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderWindowsDYLD.h; sourceTree = "<group>"; };
- 26F2F8FD1B156678007857DE /* StructuredData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StructuredData.h; path = include/lldb/Utility/StructuredData.h; sourceTree = "<group>"; };
+ 26BC7DFB10F1B81A00F91463 /* ThreadList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadList.h; path = include/lldb/Target/ThreadList.h; sourceTree = "<group>"; };
+ 26A527BF14E24F5F00F3A14A /* ThreadMachCore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMachCore.cpp; sourceTree = "<group>"; };
+ 26A527C014E24F5F00F3A14A /* ThreadMachCore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThreadMachCore.h; sourceTree = "<group>"; };
26F4A21A13FBA31A0064B613 /* ThreadMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadMemory.cpp; path = Utility/ThreadMemory.cpp; sourceTree = "<group>"; };
26F4A21B13FBA31A0064B613 /* ThreadMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadMemory.h; path = Utility/ThreadMemory.h; sourceTree = "<group>"; };
- 26F5C26A10F3D9A4009D5894 /* lldb */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = lldb; sourceTree = BUILT_PRODUCTS_DIR; };
- 26F5C27210F3D9E4009D5894 /* lldb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "lldb-Info.plist"; path = "tools/driver/lldb-Info.plist"; sourceTree = "<group>"; };
- 26F5C27310F3D9E4009D5894 /* Driver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Driver.cpp; path = tools/driver/Driver.cpp; sourceTree = "<group>"; };
- 26F5C27410F3D9E4009D5894 /* Driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Driver.h; path = tools/driver/Driver.h; sourceTree = "<group>"; };
- 26F5C32410F3DF23009D5894 /* libpython.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpython.dylib; path = /usr/lib/libpython.dylib; sourceTree = "<absolute>"; };
- 26F5C32A10F3DFDD009D5894 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
- 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtermcap.dylib; path = /usr/lib/libtermcap.dylib; sourceTree = "<absolute>"; };
- 26F5C37410F3F61B009D5894 /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
- 26F5C39010F3FA26009D5894 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = /System/Library/Frameworks/CoreFoundation.framework; sourceTree = "<absolute>"; };
- 26F996A7119B79C300412154 /* ARM_DWARF_Registers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARM_DWARF_Registers.h; path = source/Utility/ARM_DWARF_Registers.h; sourceTree = "<group>"; };
- 26FA4315130103F400E71120 /* FileSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileSpec.h; path = include/lldb/Utility/FileSpec.h; sourceTree = "<group>"; };
- 26FA43171301048600E71120 /* FileSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileSpec.cpp; path = source/Utility/FileSpec.cpp; sourceTree = "<group>"; };
- 26FFC19314FC072100087D58 /* AuxVector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuxVector.cpp; sourceTree = "<group>"; };
- 26FFC19414FC072100087D58 /* AuxVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuxVector.h; sourceTree = "<group>"; };
- 26FFC19514FC072100087D58 /* DYLDRendezvous.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DYLDRendezvous.cpp; sourceTree = "<group>"; };
- 26FFC19614FC072100087D58 /* DYLDRendezvous.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DYLDRendezvous.h; sourceTree = "<group>"; };
- 26FFC19714FC072100087D58 /* DynamicLoaderPOSIXDYLD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderPOSIXDYLD.cpp; sourceTree = "<group>"; };
- 26FFC19814FC072100087D58 /* DynamicLoaderPOSIXDYLD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderPOSIXDYLD.h; sourceTree = "<group>"; };
- 3032B1B61CAAA3D1004BE1AB /* ClangUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUtil.cpp; path = source/Symbol/ClangUtil.cpp; sourceTree = "<group>"; };
- 3032B1B91CAAA400004BE1AB /* ClangUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUtil.h; path = include/lldb/Symbol/ClangUtil.h; sourceTree = "<group>"; };
- 33064C991A5C7A330033D415 /* UriParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UriParser.cpp; path = source/Utility/UriParser.cpp; sourceTree = "<group>"; };
- 3392EBB71AFF402200858B9F /* SBLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBLanguageRuntime.h; path = include/lldb/API/SBLanguageRuntime.h; sourceTree = "<group>"; };
- 33E5E8411A672A240024ED68 /* StringConvert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StringConvert.cpp; sourceTree = "<group>"; };
- 33E5E8451A6736D30024ED68 /* StringConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringConvert.h; path = include/lldb/Host/StringConvert.h; sourceTree = SOURCE_ROOT; };
- 3F5E8AF31A40D4A500A73232 /* PipeBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = PipeBase.h; path = include/lldb/Host/PipeBase.h; sourceTree = "<group>"; };
- 3F8160A51AB9F7DD001DA9DF /* Logging.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Logging.cpp; path = source/Utility/Logging.cpp; sourceTree = "<group>"; };
- 3F8160A71AB9F809001DA9DF /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Logging.h; path = include/lldb/Utility/Logging.h; sourceTree = "<group>"; };
- 3F8169181ABA2419001DA9DF /* NameMatches.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NameMatches.cpp; path = source/Utility/NameMatches.cpp; sourceTree = "<group>"; };
- 3F81691C1ABA242B001DA9DF /* NameMatches.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NameMatches.h; path = include/lldb/Utility/NameMatches.h; sourceTree = "<group>"; };
- 3F81692A1ABB7A16001DA9DF /* SystemInitializerFull.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializerFull.cpp; path = source/API/SystemInitializerFull.cpp; sourceTree = "<group>"; };
- 3F81692D1ABB7A40001DA9DF /* SystemInitializerFull.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializerFull.h; path = include/lldb/API/SystemInitializerFull.h; sourceTree = "<group>"; };
- 3F81692E1ABB7A6D001DA9DF /* SystemInitializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializer.cpp; path = source/Initialization/SystemInitializer.cpp; sourceTree = "<group>"; };
- 3F81692F1ABB7A6D001DA9DF /* SystemInitializerCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemInitializerCommon.cpp; path = source/Initialization/SystemInitializerCommon.cpp; sourceTree = "<group>"; };
- 3F8169301ABB7A6D001DA9DF /* SystemLifetimeManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemLifetimeManager.cpp; path = source/Initialization/SystemLifetimeManager.cpp; sourceTree = "<group>"; };
- 3F8169341ABB7A80001DA9DF /* SystemInitializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializer.h; path = include/lldb/Initialization/SystemInitializer.h; sourceTree = "<group>"; };
- 3F8169351ABB7A80001DA9DF /* SystemInitializerCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemInitializerCommon.h; path = include/lldb/Initialization/SystemInitializerCommon.h; sourceTree = "<group>"; };
- 3F8169361ABB7A80001DA9DF /* SystemLifetimeManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SystemLifetimeManager.h; path = include/lldb/Initialization/SystemLifetimeManager.h; sourceTree = "<group>"; };
- 3FA093141BF65D3A0037DD08 /* PythonExceptionStateTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonExceptionStateTests.cpp; sourceTree = "<group>"; };
- 3FBA69DD1B6067020008F44A /* ScriptInterpreterNone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreterNone.cpp; path = ScriptInterpreter/None/ScriptInterpreterNone.cpp; sourceTree = "<group>"; };
- 3FBA69DE1B6067020008F44A /* ScriptInterpreterNone.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreterNone.h; path = ScriptInterpreter/None/ScriptInterpreterNone.h; sourceTree = "<group>"; };
- 3FBA69E21B60672A0008F44A /* lldb-python.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-python.h"; path = "ScriptInterpreter/Python/lldb-python.h"; sourceTree = "<group>"; };
- 3FBA69E31B60672A0008F44A /* PythonDataObjects.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonDataObjects.cpp; path = ScriptInterpreter/Python/PythonDataObjects.cpp; sourceTree = "<group>"; };
- 3FBA69E41B60672A0008F44A /* PythonDataObjects.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PythonDataObjects.h; path = ScriptInterpreter/Python/PythonDataObjects.h; sourceTree = "<group>"; };
- 3FBA69E51B60672A0008F44A /* ScriptInterpreterPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreterPython.cpp; path = ScriptInterpreter/Python/ScriptInterpreterPython.cpp; sourceTree = "<group>"; };
- 3FBA69E61B60672A0008F44A /* ScriptInterpreterPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ScriptInterpreterPython.h; path = ScriptInterpreter/Python/ScriptInterpreterPython.h; sourceTree = "<group>"; };
- 3FDFD6C3199C396E009756A7 /* FileAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FileAction.h; path = include/lldb/Target/FileAction.h; sourceTree = "<group>"; };
- 3FDFDDBC199C3A06009756A7 /* FileAction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileAction.cpp; path = source/Target/FileAction.cpp; sourceTree = "<group>"; };
- 3FDFDDBE199D345E009756A7 /* FileCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FileCache.cpp; path = source/Host/common/FileCache.cpp; sourceTree = "<group>"; };
- 3FDFDDC0199D34E2009756A7 /* FileCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileCache.h; path = include/lldb/Host/FileCache.h; sourceTree = "<group>"; };
- 3FDFDDC1199D34E2009756A7 /* FileSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FileSystem.h; path = include/lldb/Host/FileSystem.h; sourceTree = "<group>"; };
- 3FDFDDC5199D37ED009756A7 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = "<group>"; };
- 3FDFE52B19A2917A009756A7 /* HostInfoMacOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HostInfoMacOSX.mm; path = source/Host/macosx/HostInfoMacOSX.mm; sourceTree = "<group>"; };
- 3FDFE52D19A291AF009756A7 /* HostInfoMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfoMacOSX.h; path = include/lldb/Host/macosx/HostInfoMacOSX.h; sourceTree = "<group>"; };
- 3FDFE53019A292F0009756A7 /* HostInfoPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoPosix.cpp; sourceTree = "<group>"; };
- 3FDFE53219A29304009756A7 /* HostInfoPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostInfoPosix.h; path = ../../../include/lldb/Host/posix/HostInfoPosix.h; sourceTree = "<group>"; };
- 3FDFE53419A29327009756A7 /* HostInfoBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoBase.cpp; sourceTree = "<group>"; };
- 3FDFE53619A2933E009756A7 /* HostInfoLinux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HostInfoLinux.cpp; sourceTree = "<group>"; };
- 3FDFE53719A2936B009756A7 /* HostInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfo.h; path = include/lldb/Host/HostInfo.h; sourceTree = "<group>"; };
- 3FDFE53819A2936B009756A7 /* HostInfoBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoBase.h; path = include/lldb/Host/HostInfoBase.h; sourceTree = "<group>"; };
- 3FDFE53B19A293B3009756A7 /* HostInfoFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoFreeBSD.cpp; path = source/Host/freebsd/HostInfoFreeBSD.cpp; sourceTree = "<group>"; };
- 3FDFE53C19A293CA009756A7 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/freebsd/Config.h; sourceTree = "<group>"; };
- 3FDFE53D19A293CA009756A7 /* HostInfoFreeBSD.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoFreeBSD.h; path = include/lldb/Host/freebsd/HostInfoFreeBSD.h; sourceTree = "<group>"; };
- 3FDFE54019A29448009756A7 /* EditLineWin.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = EditLineWin.cpp; path = source/Host/windows/EditLineWin.cpp; sourceTree = "<group>"; };
- 3FDFE54119A29448009756A7 /* FileSystem.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = FileSystem.cpp; path = source/Host/windows/FileSystem.cpp; sourceTree = "<group>"; };
- 3FDFE54219A29448009756A7 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Host.cpp; path = source/Host/windows/Host.cpp; sourceTree = "<group>"; };
- 3FDFE54319A29448009756A7 /* HostInfoWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoWindows.cpp; path = source/Host/windows/HostInfoWindows.cpp; sourceTree = "<group>"; };
- 3FDFE54519A29448009756A7 /* ProcessRunLock.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ProcessRunLock.cpp; path = source/Host/windows/ProcessRunLock.cpp; sourceTree = "<group>"; };
- 3FDFE54619A29448009756A7 /* Windows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Windows.cpp; path = source/Host/windows/Windows.cpp; sourceTree = "<group>"; };
- 3FDFE54719A2946B009756A7 /* AutoHandle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = AutoHandle.h; path = include/lldb/Host/windows/AutoHandle.h; sourceTree = "<group>"; };
- 3FDFE54819A2946B009756A7 /* editlinewin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = editlinewin.h; path = include/lldb/Host/windows/editlinewin.h; sourceTree = "<group>"; };
- 3FDFE54919A2946B009756A7 /* HostInfoWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoWindows.h; path = include/lldb/Host/windows/HostInfoWindows.h; sourceTree = "<group>"; };
- 3FDFE54A19A2946B009756A7 /* win32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = win32.h; path = include/lldb/Host/windows/win32.h; sourceTree = "<group>"; };
- 3FDFE54B19A2946B009756A7 /* windows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = windows.h; path = include/lldb/Host/windows/windows.h; sourceTree = "<group>"; };
- 3FDFE55E19AF9B14009756A7 /* Host.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Host.cpp; path = source/Host/freebsd/Host.cpp; sourceTree = "<group>"; };
- 3FDFE55F19AF9B14009756A7 /* HostThreadFreeBSD.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostThreadFreeBSD.cpp; path = source/Host/freebsd/HostThreadFreeBSD.cpp; sourceTree = "<group>"; };
- 3FDFE56019AF9B39009756A7 /* HostThreadFreeBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadFreeBSD.h; path = include/lldb/Host/freebsd/HostThreadFreeBSD.h; sourceTree = "<group>"; };
- 3FDFE56219AF9B60009756A7 /* HostThreadLinux.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = HostThreadLinux.cpp; sourceTree = "<group>"; };
- 3FDFE56319AF9B77009756A7 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/linux/Config.h; sourceTree = SOURCE_ROOT; };
- 3FDFE56419AF9B77009756A7 /* HostInfoLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoLinux.h; path = include/lldb/Host/linux/HostInfoLinux.h; sourceTree = SOURCE_ROOT; };
- 3FDFE56519AF9B77009756A7 /* HostThreadLinux.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThreadLinux.h; path = include/lldb/Host/linux/HostThreadLinux.h; sourceTree = SOURCE_ROOT; };
- 3FDFE56719AF9BB2009756A7 /* HostThreadMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadMacOSX.h; path = include/lldb/Host/macosx/HostThreadMacOSX.h; sourceTree = "<group>"; };
- 3FDFE56A19AF9C44009756A7 /* HostProcessPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostProcessPosix.cpp; sourceTree = "<group>"; };
- 3FDFE56B19AF9C44009756A7 /* HostThreadPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostThreadPosix.cpp; sourceTree = "<group>"; };
- 3FDFE56E19AF9C5A009756A7 /* HostProcessPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostProcessPosix.h; path = ../../../include/lldb/Host/posix/HostProcessPosix.h; sourceTree = "<group>"; };
- 3FDFE56F19AF9C5A009756A7 /* HostThreadPosix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HostThreadPosix.h; path = ../../../include/lldb/Host/posix/HostThreadPosix.h; sourceTree = "<group>"; };
- 3FDFE57019AF9CA0009756A7 /* HostProcessWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostProcessWindows.cpp; path = source/Host/windows/HostProcessWindows.cpp; sourceTree = "<group>"; };
- 3FDFE57119AF9CA0009756A7 /* HostThreadWindows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostThreadWindows.cpp; path = source/Host/windows/HostThreadWindows.cpp; sourceTree = "<group>"; };
- 3FDFE57219AF9CD3009756A7 /* HostProcessWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostProcessWindows.h; path = include/lldb/Host/windows/HostProcessWindows.h; sourceTree = "<group>"; };
- 3FDFE57319AF9CD3009756A7 /* HostThreadWindows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThreadWindows.h; path = include/lldb/Host/windows/HostThreadWindows.h; sourceTree = "<group>"; };
- 3FDFE57419AFABFD009756A7 /* HostProcess.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostProcess.h; path = include/lldb/Host/HostProcess.h; sourceTree = "<group>"; };
- 3FDFE57519AFABFD009756A7 /* HostThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostThread.h; path = include/lldb/Host/HostThread.h; sourceTree = "<group>"; };
- 3FDFED0519B7C898009756A7 /* HostThreadMacOSX.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = HostThreadMacOSX.mm; path = source/Host/macosx/HostThreadMacOSX.mm; sourceTree = "<group>"; };
- 3FDFED1E19BA6D55009756A7 /* Debug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Debug.h; path = include/lldb/Host/Debug.h; sourceTree = "<group>"; };
- 3FDFED1F19BA6D55009756A7 /* HostGetOpt.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostGetOpt.h; path = include/lldb/Host/HostGetOpt.h; sourceTree = "<group>"; };
- 3FDFED2019BA6D55009756A7 /* HostNativeThread.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostNativeThread.h; path = include/lldb/Host/HostNativeThread.h; sourceTree = "<group>"; };
- 3FDFED2119BA6D55009756A7 /* HostNativeThreadBase.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostNativeThreadBase.h; path = include/lldb/Host/HostNativeThreadBase.h; sourceTree = "<group>"; };
- 3FDFED2219BA6D55009756A7 /* ProcessRunLock.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ProcessRunLock.h; path = include/lldb/Host/ProcessRunLock.h; sourceTree = "<group>"; };
- 3FDFED2319BA6D55009756A7 /* ThreadLauncher.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadLauncher.h; path = include/lldb/Host/ThreadLauncher.h; sourceTree = "<group>"; };
- 3FDFED2419BA6D96009756A7 /* HostNativeThreadBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostNativeThreadBase.cpp; sourceTree = "<group>"; };
- 3FDFED2519BA6D96009756A7 /* HostThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostThread.cpp; sourceTree = "<group>"; };
- 3FDFED2619BA6D96009756A7 /* ThreadLauncher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadLauncher.cpp; sourceTree = "<group>"; };
- 3FDFED2C19C257A0009756A7 /* HostProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostProcess.cpp; sourceTree = "<group>"; };
- 4906FD4012F2255300A2A77C /* ASTDumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTDumper.cpp; path = ExpressionParser/Clang/ASTDumper.cpp; sourceTree = "<group>"; };
- 4906FD4412F2257600A2A77C /* ASTDumper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTDumper.h; path = ExpressionParser/Clang/ASTDumper.h; sourceTree = "<group>"; };
- 490A36BD180F0E6F00BA31F8 /* PlatformWindows.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformWindows.cpp; sourceTree = "<group>"; };
- 490A36BE180F0E6F00BA31F8 /* PlatformWindows.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformWindows.h; sourceTree = "<group>"; };
- 4911934B1226383D00578B7F /* ASTStructExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTStructExtractor.h; path = ExpressionParser/Clang/ASTStructExtractor.h; sourceTree = "<group>"; };
- 491193501226386000578B7F /* ASTStructExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTStructExtractor.cpp; path = ExpressionParser/Clang/ASTStructExtractor.cpp; sourceTree = "<group>"; };
- 492DB7E61EC662B100B9E9AF /* Status.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Status.h; path = include/lldb/Utility/Status.h; sourceTree = "<group>"; };
- 492DB7E81EC662D100B9E9AF /* Status.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Status.cpp; path = source/Utility/Status.cpp; sourceTree = "<group>"; };
- 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRForTarget.cpp; path = ExpressionParser/Clang/IRForTarget.cpp; sourceTree = "<group>"; };
- 49307AB111DEA4F20081F992 /* IRForTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRForTarget.h; path = ExpressionParser/Clang/IRForTarget.h; sourceTree = "<group>"; };
- 4939EA8B1BD56B3700084382 /* REPL.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = REPL.h; path = include/lldb/Expression/REPL.h; sourceTree = "<group>"; };
- 4939EA8C1BD56B6D00084382 /* REPL.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = REPL.cpp; path = source/Expression/REPL.cpp; sourceTree = "<group>"; };
- 494260D7145790D5003C1C78 /* VerifyDecl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VerifyDecl.h; path = include/lldb/Symbol/VerifyDecl.h; sourceTree = "<group>"; };
- 494260D914579144003C1C78 /* VerifyDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VerifyDecl.cpp; path = source/Symbol/VerifyDecl.cpp; sourceTree = "<group>"; };
- 49445C2512245E3600C11A81 /* ClangExpressionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionParser.cpp; path = ExpressionParser/Clang/ClangExpressionParser.cpp; sourceTree = "<group>"; };
- 49445C2912245E5500C11A81 /* ClangExpressionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionParser.h; path = ExpressionParser/Clang/ClangExpressionParser.h; sourceTree = "<group>"; };
- 49445E341225AB6A00C11A81 /* ClangUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUserExpression.h; path = ExpressionParser/Clang/ClangUserExpression.h; sourceTree = "<group>"; };
- 4959511B1A1BC48100F6F8FC /* ClangModulesDeclVendor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangModulesDeclVendor.h; path = ExpressionParser/Clang/ClangModulesDeclVendor.h; sourceTree = "<group>"; };
- 4959511E1A1BC4BC00F6F8FC /* ClangModulesDeclVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangModulesDeclVendor.cpp; path = ExpressionParser/Clang/ClangModulesDeclVendor.cpp; sourceTree = "<group>"; };
- 495B38431489714C002708C5 /* ClangExternalASTSourceCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ClangExternalASTSourceCommon.h; path = include/lldb/Symbol/ClangExternalASTSourceCommon.h; sourceTree = "<group>"; };
- 495BBACB119A0DBE00418BEA /* PathMappingList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathMappingList.cpp; path = source/Target/PathMappingList.cpp; sourceTree = "<group>"; };
- 495BBACF119A0DE700418BEA /* PathMappingList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PathMappingList.h; path = include/lldb/Target/PathMappingList.h; sourceTree = "<group>"; };
- 4966DCC3148978A10028481B /* ClangExternalASTSourceCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExternalASTSourceCommon.cpp; path = source/Symbol/ClangExternalASTSourceCommon.cpp; sourceTree = "<group>"; };
- 496B01581406DE8900F830D5 /* IRInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRInterpreter.cpp; path = source/Expression/IRInterpreter.cpp; sourceTree = "<group>"; };
- 496B015A1406DEB100F830D5 /* IRInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRInterpreter.h; path = include/lldb/Expression/IRInterpreter.h; sourceTree = "<group>"; };
- 497C86BD122823D800B54702 /* ClangUtilityFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangUtilityFunction.cpp; path = ExpressionParser/Clang/ClangUtilityFunction.cpp; sourceTree = "<group>"; };
- 497C86C1122823F300B54702 /* ClangUtilityFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangUtilityFunction.h; path = ExpressionParser/Clang/ClangUtilityFunction.h; sourceTree = "<group>"; };
- 497E7B331188ED300065CCA1 /* ABI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABI.h; path = include/lldb/Target/ABI.h; sourceTree = "<group>"; };
- 497E7B9D1188F6690065CCA1 /* ABI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABI.cpp; path = source/Target/ABI.cpp; sourceTree = "<group>"; };
- 4984BA0E1B978C3E008658D4 /* ClangExpressionVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionVariable.cpp; path = ExpressionParser/Clang/ClangExpressionVariable.cpp; sourceTree = "<group>"; };
- 4984BA0F1B978C3E008658D4 /* ClangExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionVariable.h; path = ExpressionParser/Clang/ClangExpressionVariable.h; sourceTree = "<group>"; };
- 4984BA151B979973008658D4 /* ExpressionVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionVariable.cpp; path = source/Expression/ExpressionVariable.cpp; sourceTree = "<group>"; };
- 4984BA171B979C08008658D4 /* ExpressionVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpressionVariable.h; path = include/lldb/Expression/ExpressionVariable.h; sourceTree = "<group>"; };
- 4987FB1C1F30EC6000E5C17D /* SBProcessInfo.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBProcessInfo.i; sourceTree = "<group>"; };
- 4987FB1E1F30EC7E00E5C17D /* SBProcessInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBProcessInfo.cpp; path = source/API/SBProcessInfo.cpp; sourceTree = "<group>"; };
- 4987FB201F30EC9900E5C17D /* SBProcessInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBProcessInfo.h; path = include/lldb/API/SBProcessInfo.h; sourceTree = "<group>"; };
- 499F381E11A5B3F300F5CE02 /* CommandObjectArgs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectArgs.h; path = source/Commands/CommandObjectArgs.h; sourceTree = "<group>"; };
- 499F381F11A5B3F300F5CE02 /* CommandObjectArgs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectArgs.cpp; path = source/Commands/CommandObjectArgs.cpp; sourceTree = "<group>"; };
- 49A1CAC11430E21D00306AC9 /* ExpressionSourceCode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExpressionSourceCode.h; path = include/lldb/Expression/ExpressionSourceCode.h; sourceTree = "<group>"; };
- 49A1CAC31430E8BD00306AC9 /* ExpressionSourceCode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ExpressionSourceCode.cpp; path = source/Expression/ExpressionSourceCode.cpp; sourceTree = "<group>"; };
- 49A8A39F11D568A300AD3B68 /* ASTResultSynthesizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ASTResultSynthesizer.cpp; path = ExpressionParser/Clang/ASTResultSynthesizer.cpp; sourceTree = "<group>"; };
- 49A8A3A311D568BF00AD3B68 /* ASTResultSynthesizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ASTResultSynthesizer.h; path = ExpressionParser/Clang/ASTResultSynthesizer.h; sourceTree = "<group>"; };
- 49B01A2D15F67B1700666829 /* DeclVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DeclVendor.h; path = include/lldb/Symbol/DeclVendor.h; sourceTree = "<group>"; };
- 49BB309511F79450001A4197 /* TaggedASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaggedASTType.h; path = include/lldb/Symbol/TaggedASTType.h; sourceTree = "<group>"; };
- 49C66B1C17011A43004D1922 /* IRMemoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = IRMemoryMap.h; path = include/lldb/Expression/IRMemoryMap.h; sourceTree = "<group>"; };
- 49CA96E61E6AAC6600C03FEE /* DataBufferHeap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataBufferHeap.cpp; path = source/Utility/DataBufferHeap.cpp; sourceTree = "<group>"; };
- 49CA96E71E6AAC6600C03FEE /* DataBufferLLVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataBufferLLVM.cpp; path = source/Utility/DataBufferLLVM.cpp; sourceTree = "<group>"; };
- 49CA96E81E6AAC6600C03FEE /* DataEncoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataEncoder.cpp; path = source/Utility/DataEncoder.cpp; sourceTree = "<group>"; };
- 49CA96E91E6AAC6600C03FEE /* DataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataExtractor.cpp; path = source/Utility/DataExtractor.cpp; sourceTree = "<group>"; };
- 49CA96EA1E6AAC6600C03FEE /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UUID.cpp; path = source/Utility/UUID.cpp; sourceTree = "<group>"; };
- 49CA96F01E6AAC8E00C03FEE /* DataBuffer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBuffer.h; path = include/lldb/Utility/DataBuffer.h; sourceTree = "<group>"; };
- 49CA96F11E6AAC8E00C03FEE /* DataBufferHeap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBufferHeap.h; path = include/lldb/Utility/DataBufferHeap.h; sourceTree = "<group>"; };
- 49CA96F21E6AAC8E00C03FEE /* DataBufferLLVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataBufferLLVM.h; path = include/lldb/Utility/DataBufferLLVM.h; sourceTree = "<group>"; };
- 49CA96F31E6AAC8E00C03FEE /* DataEncoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataEncoder.h; path = include/lldb/Utility/DataEncoder.h; sourceTree = "<group>"; };
- 49CA96F41E6AAC8E00C03FEE /* DataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataExtractor.h; path = include/lldb/Utility/DataExtractor.h; sourceTree = "<group>"; };
- 49CA96F51E6AAC8E00C03FEE /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UUID.h; path = include/lldb/Utility/UUID.h; sourceTree = "<group>"; };
- 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRDynamicChecks.cpp; path = source/Expression/IRDynamicChecks.cpp; sourceTree = "<group>"; };
- 49CF9833122C718B007A0B96 /* IRDynamicChecks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRDynamicChecks.h; path = include/lldb/Expression/IRDynamicChecks.h; sourceTree = "<group>"; };
- 49D4FE821210B5FB00CDB854 /* ClangPersistentVariables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangPersistentVariables.h; path = ExpressionParser/Clang/ClangPersistentVariables.h; sourceTree = "<group>"; };
- 49D4FE871210B61C00CDB854 /* ClangPersistentVariables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangPersistentVariables.cpp; path = ExpressionParser/Clang/ClangPersistentVariables.cpp; sourceTree = "<group>"; };
- 49D7072611B5AD03001AD875 /* ClangASTSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTSource.h; path = ExpressionParser/Clang/ClangASTSource.h; sourceTree = "<group>"; };
- 49D7072811B5AD11001AD875 /* ClangASTSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTSource.cpp; path = ExpressionParser/Clang/ClangASTSource.cpp; sourceTree = "<group>"; };
- 49D8FB3513B558DE00411094 /* ClangASTImporter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangASTImporter.cpp; path = source/Symbol/ClangASTImporter.cpp; sourceTree = "<group>"; };
- 49D8FB3713B5594900411094 /* ClangASTImporter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangASTImporter.h; path = include/lldb/Symbol/ClangASTImporter.h; sourceTree = "<group>"; };
- 49DA65021485C92A005FF180 /* AppleObjCDeclVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCDeclVendor.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 49DA65041485C942005FF180 /* AppleObjCDeclVendor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCDeclVendor.h; sourceTree = "<group>"; };
- 49DCF6FD170E6B4A0092F75E /* IRMemoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRMemoryMap.cpp; path = source/Expression/IRMemoryMap.cpp; sourceTree = "<group>"; };
- 49DCF6FF170E6FD90092F75E /* Materializer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Materializer.h; path = include/lldb/Expression/Materializer.h; sourceTree = "<group>"; };
- 49DCF700170E70120092F75E /* Materializer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Materializer.cpp; path = source/Expression/Materializer.cpp; sourceTree = "<group>"; };
- 49DEF11F1CD7BD90006A7C7D /* BlockPointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BlockPointer.cpp; path = Language/CPlusPlus/BlockPointer.cpp; sourceTree = "<group>"; };
- 49DEF1201CD7BD90006A7C7D /* BlockPointer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BlockPointer.h; path = Language/CPlusPlus/BlockPointer.h; sourceTree = "<group>"; };
- 49E45FA911F660DC008F7B28 /* CompilerType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompilerType.h; path = include/lldb/Symbol/CompilerType.h; sourceTree = "<group>"; };
- 49E45FAD11F660FE008F7B28 /* CompilerType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompilerType.cpp; path = source/Symbol/CompilerType.cpp; sourceTree = "<group>"; };
- 49E4F6681C9CAD12008487EA /* DiagnosticManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DiagnosticManager.cpp; path = source/Expression/DiagnosticManager.cpp; sourceTree = "<group>"; };
- 49E4F66C1C9CAD2D008487EA /* DiagnosticManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DiagnosticManager.h; path = include/lldb/Expression/DiagnosticManager.h; sourceTree = "<group>"; };
+ 947CF7751DC7B20D00EF980B /* ThreadMinidump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMinidump.cpp; sourceTree = "<group>"; };
+ 947CF7731DC7B20300EF980B /* ThreadMinidump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThreadMinidump.h; sourceTree = "<group>"; };
+ 26BC7F3F10F1B90C00F91463 /* ThreadPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlan.cpp; path = source/Target/ThreadPlan.cpp; sourceTree = "<group>"; };
+ 26BC7DFC10F1B81A00F91463 /* ThreadPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlan.h; path = include/lldb/Target/ThreadPlan.h; sourceTree = "<group>"; };
+ 260C847110F50EFC00BB2B04 /* ThreadPlanBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanBase.cpp; path = source/Target/ThreadPlanBase.cpp; sourceTree = "<group>"; };
+ 260C847F10F50F0A00BB2B04 /* ThreadPlanBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanBase.h; path = include/lldb/Target/ThreadPlanBase.h; sourceTree = "<group>"; };
49EC3E98118F90AC00B1265E /* ThreadPlanCallFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallFunction.cpp; path = source/Target/ThreadPlanCallFunction.cpp; sourceTree = "<group>"; };
49EC3E9C118F90D400B1265E /* ThreadPlanCallFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallFunction.h; path = include/lldb/Target/ThreadPlanCallFunction.h; sourceTree = "<group>"; };
- 49F1A74511B3388F003ED505 /* ClangExpressionDeclMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangExpressionDeclMap.cpp; path = ExpressionParser/Clang/ClangExpressionDeclMap.cpp; sourceTree = "<group>"; };
- 49F1A74911B338AE003ED505 /* ClangExpressionDeclMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangExpressionDeclMap.h; path = ExpressionParser/Clang/ClangExpressionDeclMap.h; sourceTree = "<group>"; };
- 49F811EF1E931B1500F4E163 /* CPlusPlusNameParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPlusPlusNameParser.cpp; path = Language/CPlusPlus/CPlusPlusNameParser.cpp; sourceTree = "<group>"; };
- 49F811F01E931B1500F4E163 /* CPlusPlusNameParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPlusPlusNameParser.h; path = Language/CPlusPlus/CPlusPlusNameParser.h; sourceTree = "<group>"; };
- 4C00832C1B9A58A700D5CF24 /* Expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Expression.h; path = include/lldb/Expression/Expression.h; sourceTree = "<group>"; };
- 4C00832D1B9A58A700D5CF24 /* FunctionCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FunctionCaller.h; path = include/lldb/Expression/FunctionCaller.h; sourceTree = "<group>"; };
- 4C00832E1B9A58A700D5CF24 /* UserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserExpression.h; path = include/lldb/Expression/UserExpression.h; sourceTree = "<group>"; };
- 4C0083321B9A5DE200D5CF24 /* FunctionCaller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FunctionCaller.cpp; path = source/Expression/FunctionCaller.cpp; sourceTree = "<group>"; };
- 4C0083331B9A5DE200D5CF24 /* UserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserExpression.cpp; path = source/Expression/UserExpression.cpp; sourceTree = "<group>"; };
- 4C00833D1B9F9B8400D5CF24 /* UtilityFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UtilityFunction.h; path = include/lldb/Expression/UtilityFunction.h; sourceTree = "<group>"; };
- 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UtilityFunction.cpp; path = source/Expression/UtilityFunction.cpp; sourceTree = "<group>"; };
- 4C00986F11500B4300F316B0 /* UnixSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnixSignals.h; path = include/lldb/Target/UnixSignals.h; sourceTree = "<group>"; };
- 4C00987011500B4300F316B0 /* UnixSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnixSignals.cpp; path = source/Target/UnixSignals.cpp; sourceTree = "<group>"; };
- 4C0533291F6211FB00DED368 /* SBBreakpointOptionCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointOptionCommon.cpp; path = source/API/SBBreakpointOptionCommon.cpp; sourceTree = "<group>"; };
- 4C05332C1F63092A00DED368 /* SBBreakpointName.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBBreakpointName.i; sourceTree = "<group>"; };
- 4C08CDE711C81EF8001610A8 /* ThreadSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadSpec.cpp; path = source/Target/ThreadSpec.cpp; sourceTree = "<group>"; };
- 4C08CDEB11C81F1E001610A8 /* ThreadSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSpec.h; path = include/lldb/Target/ThreadSpec.h; sourceTree = "<group>"; };
- 4C09CB73116BD98B00C7A725 /* CommandCompletions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandCompletions.h; path = include/lldb/Interpreter/CommandCompletions.h; sourceTree = "<group>"; };
- 4C09CB74116BD98B00C7A725 /* CommandCompletions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandCompletions.cpp; path = source/Commands/CommandCompletions.cpp; sourceTree = "<group>"; };
- 4C2479BE1BA39843009C9A7B /* ExpressionParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ExpressionParser.h; path = include/lldb/Expression/ExpressionParser.h; sourceTree = "<group>"; };
- 4C29E77D1BA2403F00DFF855 /* ExpressionTypeSystemHelper.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; name = ExpressionTypeSystemHelper.h; path = include/lldb/Expression/ExpressionTypeSystemHelper.h; sourceTree = "<group>"; };
- 4C2FAE2E135E3A70001EDE44 /* SharedCluster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SharedCluster.h; path = include/lldb/Utility/SharedCluster.h; sourceTree = "<group>"; };
- 4C3DA2301CA0BFB800CEB1D4 /* ClangDiagnostic.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangDiagnostic.h; path = ExpressionParser/Clang/ClangDiagnostic.h; sourceTree = "<group>"; };
- 4C43DEF9110641F300E55CBF /* ThreadPlanShouldStopHere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanShouldStopHere.h; path = include/lldb/Target/ThreadPlanShouldStopHere.h; sourceTree = "<group>"; };
- 4C43DEFA110641F300E55CBF /* ThreadPlanShouldStopHere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanShouldStopHere.cpp; path = source/Target/ThreadPlanShouldStopHere.cpp; sourceTree = "<group>"; };
- 4C43DF8511069BFD00E55CBF /* ThreadPlanStepInRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepInRange.h; path = include/lldb/Target/ThreadPlanStepInRange.h; sourceTree = "<group>"; };
- 4C43DF8611069BFD00E55CBF /* ThreadPlanStepOverRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOverRange.h; path = include/lldb/Target/ThreadPlanStepOverRange.h; sourceTree = "<group>"; };
- 4C43DF8911069C3200E55CBF /* ThreadPlanStepInRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepInRange.cpp; path = source/Target/ThreadPlanStepInRange.cpp; sourceTree = "<group>"; };
- 4C43DF8A11069C3200E55CBF /* ThreadPlanStepOverRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOverRange.cpp; path = source/Target/ThreadPlanStepOverRange.cpp; sourceTree = "<group>"; };
- 4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DumpDataExtractor.cpp; path = source/Core/DumpDataExtractor.cpp; sourceTree = "<group>"; };
- 4C4EB7821E6A4DE7002035C0 /* DumpDataExtractor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DumpDataExtractor.h; path = include/lldb/Core/DumpDataExtractor.h; sourceTree = "<group>"; };
- 4C54B2781F61CE1200D469CA /* SBBreakpointName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointName.h; path = include/lldb/API/SBBreakpointName.h; sourceTree = "<group>"; };
- 4C54B27C1F61CE5300D469CA /* SBBreakpointName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointName.cpp; path = source/API/SBBreakpointName.cpp; sourceTree = "<group>"; };
- 4C54B2811F62081300D469CA /* SBBreakpointOptionCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBBreakpointOptionCommon.h; path = include/lldb/API/SBBreakpointOptionCommon.h; sourceTree = "<group>"; };
- 4C562CC21CC07DDD00C52EAC /* PDBASTParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PDBASTParser.cpp; path = PDB/PDBASTParser.cpp; sourceTree = "<group>"; };
- 4C562CC31CC07DDD00C52EAC /* PDBASTParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PDBASTParser.h; path = PDB/PDBASTParser.h; sourceTree = "<group>"; };
+ EB8375E61B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallFunctionUsingABI.cpp; path = source/Target/ThreadPlanCallFunctionUsingABI.cpp; sourceTree = "<group>"; };
+ EB8375E81B553DFE00BA907D /* ThreadPlanCallFunctionUsingABI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallFunctionUsingABI.h; path = include/lldb/Target/ThreadPlanCallFunctionUsingABI.h; sourceTree = "<group>"; };
+ 230EC4581D63C3A7008DF59F /* ThreadPlanCallOnFunctionExit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallOnFunctionExit.cpp; path = source/Target/ThreadPlanCallOnFunctionExit.cpp; sourceTree = "<group>"; };
+ 4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallUserExpression.cpp; path = source/Target/ThreadPlanCallUserExpression.cpp; sourceTree = "<group>"; };
+ 4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = "<group>"; };
4C56543019D1EFAA002E9C44 /* ThreadPlanPython.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanPython.cpp; path = source/Target/ThreadPlanPython.cpp; sourceTree = "<group>"; };
4C56543219D1EFB5002E9C44 /* ThreadPlanPython.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanPython.h; path = include/lldb/Target/ThreadPlanPython.h; sourceTree = "<group>"; };
- 4C56543419D2297A002E9C44 /* SBThreadPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBThreadPlan.h; path = include/lldb/API/SBThreadPlan.h; sourceTree = "<group>"; };
- 4C56543619D22B32002E9C44 /* SBThreadPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBThreadPlan.cpp; path = source/API/SBThreadPlan.cpp; sourceTree = "<group>"; };
- 4C56543819D22FD9002E9C44 /* SBThreadPlan.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThreadPlan.i; sourceTree = "<group>"; };
- 4C5DBBC611E3FEC60035160F /* CommandObjectCommands.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectCommands.cpp; path = source/Commands/CommandObjectCommands.cpp; sourceTree = "<group>"; };
- 4C5DBBC711E3FEC60035160F /* CommandObjectCommands.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectCommands.h; path = source/Commands/CommandObjectCommands.h; sourceTree = "<group>"; };
- 4C73152119B7D71700F865A4 /* Iterable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Iterable.h; path = include/lldb/Utility/Iterable.h; sourceTree = "<group>"; };
- 4C7CF7E31295E10E00B4FBB5 /* ThreadPlanCallUserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallUserExpression.h; path = include/lldb/Target/ThreadPlanCallUserExpression.h; sourceTree = "<group>"; };
- 4C7CF7E51295E12B00B4FBB5 /* ThreadPlanCallUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallUserExpression.cpp; path = source/Target/ThreadPlanCallUserExpression.cpp; sourceTree = "<group>"; };
- 4C7D481C1F509963005314B4 /* SymbolFileDWARFDwp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwp.cpp; sourceTree = "<group>"; };
- 4C7D481D1F509964005314B4 /* SymbolFileDWARFDwoDwp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwoDwp.h; sourceTree = "<group>"; };
- 4C7D481E1F509964005314B4 /* SymbolFileDWARFDwp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwp.h; sourceTree = "<group>"; };
- 4C7D481F1F509964005314B4 /* SymbolFileDWARFDwoDwp.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwoDwp.cpp; sourceTree = "<group>"; };
- 4C7D48281F509CCD005314B4 /* BreakpointName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointName.cpp; path = source/Breakpoint/BreakpointName.cpp; sourceTree = "<group>"; };
- 4C7D482B1F509CF5005314B4 /* BreakpointName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointName.h; path = include/lldb/Breakpoint/BreakpointName.h; sourceTree = "<group>"; };
- 4C88BC291BA3722B00AA0964 /* Expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Expression.cpp; path = source/Expression/Expression.cpp; sourceTree = "<group>"; };
- 4C98D3DA118FB96F00E575D0 /* ClangFunctionCaller.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClangFunctionCaller.cpp; path = ExpressionParser/Clang/ClangFunctionCaller.cpp; sourceTree = "<group>"; };
- 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IRExecutionUnit.cpp; path = source/Expression/IRExecutionUnit.cpp; sourceTree = "<group>"; };
- 4C98D3E0118FB98F00E575D0 /* ClangFunctionCaller.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ClangFunctionCaller.h; path = ExpressionParser/Clang/ClangFunctionCaller.h; sourceTree = "<group>"; };
- 4C98D3E1118FB98F00E575D0 /* IRExecutionUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = IRExecutionUnit.h; path = include/lldb/Expression/IRExecutionUnit.h; sourceTree = "<group>"; };
- 4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectApropos.cpp; path = source/Commands/CommandObjectApropos.cpp; sourceTree = "<group>"; };
- 4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectApropos.h; path = source/Commands/CommandObjectApropos.h; sourceTree = "<group>"; };
- 4CA9D13C1FCE07AF00300E18 /* RegisterUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterUtilities.cpp; sourceTree = "<group>"; };
- 4CA9D13D1FCE07AF00300E18 /* RegisterUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterUtilities.h; sourceTree = "<group>"; };
- 4CAA56121422D96A001FFA01 /* BreakpointResolverFileRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = BreakpointResolverFileRegex.h; path = include/lldb/Breakpoint/BreakpointResolverFileRegex.h; sourceTree = "<group>"; };
- 4CAA56141422D986001FFA01 /* BreakpointResolverFileRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BreakpointResolverFileRegex.cpp; path = source/Breakpoint/BreakpointResolverFileRegex.cpp; sourceTree = "<group>"; };
- 4CAB257C18EC9DB800BAD33E /* SafeMachO.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SafeMachO.h; path = include/lldb/Utility/SafeMachO.h; sourceTree = "<group>"; };
- 4CABA9DC134A8BA700539BDD /* ValueObjectMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectMemory.h; path = include/lldb/Core/ValueObjectMemory.h; sourceTree = "<group>"; };
- 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectMemory.cpp; path = source/Core/ValueObjectMemory.cpp; sourceTree = "<group>"; };
- 4CAFCE001101216B00CA63DB /* ThreadPlanRunToAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanRunToAddress.h; path = include/lldb/Target/ThreadPlanRunToAddress.h; sourceTree = "<group>"; };
4CAFCE031101218900CA63DB /* ThreadPlanRunToAddress.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanRunToAddress.cpp; path = source/Target/ThreadPlanRunToAddress.cpp; sourceTree = "<group>"; };
- 4CB4430912491DDA00C13DC2 /* LanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = LanguageRuntime.h; path = include/lldb/Target/LanguageRuntime.h; sourceTree = "<group>"; };
- 4CB4430A12491DDA00C13DC2 /* LanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageRuntime.cpp; path = source/Target/LanguageRuntime.cpp; sourceTree = "<group>"; };
- 4CB443BB1249920C00C13DC2 /* CPPLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CPPLanguageRuntime.h; path = include/lldb/Target/CPPLanguageRuntime.h; sourceTree = "<group>"; };
- 4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CPPLanguageRuntime.cpp; path = source/Target/CPPLanguageRuntime.cpp; sourceTree = "<group>"; };
- 4CB443F212499B5000C13DC2 /* ObjCLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguageRuntime.cpp; path = source/Target/ObjCLanguageRuntime.cpp; sourceTree = "<group>"; };
- 4CB443F612499B6E00C13DC2 /* ObjCLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ObjCLanguageRuntime.h; path = include/lldb/Target/ObjCLanguageRuntime.h; sourceTree = "<group>"; };
- 4CBFF0471F579A36004AFA92 /* Flags.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Flags.h; path = include/lldb/Utility/Flags.h; sourceTree = "<group>"; };
+ 4CAFCE001101216B00CA63DB /* ThreadPlanRunToAddress.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanRunToAddress.h; path = include/lldb/Target/ThreadPlanRunToAddress.h; sourceTree = "<group>"; };
+ 4C43DEFA110641F300E55CBF /* ThreadPlanShouldStopHere.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanShouldStopHere.cpp; path = source/Target/ThreadPlanShouldStopHere.cpp; sourceTree = "<group>"; };
+ 4C43DEF9110641F300E55CBF /* ThreadPlanShouldStopHere.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanShouldStopHere.h; path = include/lldb/Target/ThreadPlanShouldStopHere.h; sourceTree = "<group>"; };
+ 4C43DF8911069C3200E55CBF /* ThreadPlanStepInRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepInRange.cpp; path = source/Target/ThreadPlanStepInRange.cpp; sourceTree = "<group>"; };
+ 4C43DF8511069BFD00E55CBF /* ThreadPlanStepInRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepInRange.h; path = include/lldb/Target/ThreadPlanStepInRange.h; sourceTree = "<group>"; };
+ 260C847210F50EFC00BB2B04 /* ThreadPlanStepInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepInstruction.cpp; path = source/Target/ThreadPlanStepInstruction.cpp; sourceTree = "<group>"; };
+ 260C848010F50F0A00BB2B04 /* ThreadPlanStepInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepInstruction.h; path = include/lldb/Target/ThreadPlanStepInstruction.h; sourceTree = "<group>"; };
+ 260C847310F50EFC00BB2B04 /* ThreadPlanStepOut.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOut.cpp; path = source/Target/ThreadPlanStepOut.cpp; sourceTree = "<group>"; };
+ 260C848110F50F0A00BB2B04 /* ThreadPlanStepOut.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOut.h; path = include/lldb/Target/ThreadPlanStepOut.h; sourceTree = "<group>"; };
+ 260C847410F50EFC00BB2B04 /* ThreadPlanStepOverBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOverBreakpoint.cpp; path = source/Target/ThreadPlanStepOverBreakpoint.cpp; sourceTree = "<group>"; };
+ 260C848210F50F0A00BB2B04 /* ThreadPlanStepOverBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOverBreakpoint.h; path = include/lldb/Target/ThreadPlanStepOverBreakpoint.h; sourceTree = "<group>"; };
+ 4C43DF8A11069C3200E55CBF /* ThreadPlanStepOverRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepOverRange.cpp; path = source/Target/ThreadPlanStepOverRange.cpp; sourceTree = "<group>"; };
+ 4C43DF8611069BFD00E55CBF /* ThreadPlanStepOverRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepOverRange.h; path = include/lldb/Target/ThreadPlanStepOverRange.h; sourceTree = "<group>"; };
+ 260C847610F50EFC00BB2B04 /* ThreadPlanStepRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepRange.cpp; path = source/Target/ThreadPlanStepRange.cpp; sourceTree = "<group>"; };
+ 260C848410F50F0A00BB2B04 /* ThreadPlanStepRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepRange.h; path = include/lldb/Target/ThreadPlanStepRange.h; sourceTree = "<group>"; };
+ 260C847510F50EFC00BB2B04 /* ThreadPlanStepThrough.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepThrough.cpp; path = source/Target/ThreadPlanStepThrough.cpp; sourceTree = "<group>"; };
+ 260C848310F50F0A00BB2B04 /* ThreadPlanStepThrough.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepThrough.h; path = include/lldb/Target/ThreadPlanStepThrough.h; sourceTree = "<group>"; };
+ 2660D9FE11922A7F00958FBD /* ThreadPlanStepUntil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanStepUntil.cpp; path = source/Target/ThreadPlanStepUntil.cpp; sourceTree = "<group>"; };
+ 4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = "<group>"; };
4CC2A148128C73ED001531C4 /* ThreadPlanTracer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanTracer.cpp; path = source/Target/ThreadPlanTracer.cpp; sourceTree = "<group>"; };
4CC2A14C128C7409001531C4 /* ThreadPlanTracer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanTracer.h; path = include/lldb/Target/ThreadPlanTracer.h; sourceTree = "<group>"; };
- 4CC7C64C1D5298E20076FF94 /* OCamlLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OCamlLanguage.h; path = Language/OCaml/OCamlLanguage.h; sourceTree = "<group>"; };
- 4CC7C64D1D5298E20076FF94 /* OCamlLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OCamlLanguage.cpp; path = Language/OCaml/OCamlLanguage.cpp; sourceTree = "<group>"; };
- 4CC7C6511D5299140076FF94 /* DWARFASTParserOCaml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserOCaml.h; sourceTree = "<group>"; };
- 4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserOCaml.cpp; sourceTree = "<group>"; };
- 4CC7C6551D52996C0076FF94 /* OCamlASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OCamlASTContext.cpp; path = source/Symbol/OCamlASTContext.cpp; sourceTree = "<group>"; };
- 4CCA643D13B40B82003BDF98 /* ItaniumABILanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ItaniumABILanguageRuntime.cpp; sourceTree = "<group>"; };
- 4CCA643E13B40B82003BDF98 /* ItaniumABILanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ItaniumABILanguageRuntime.h; sourceTree = "<group>"; };
- 4CCA644213B40B82003BDF98 /* AppleObjCRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCRuntime.cpp; sourceTree = "<group>"; };
- 4CCA644313B40B82003BDF98 /* AppleObjCRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCRuntime.h; sourceTree = "<group>"; };
- 4CCA644413B40B82003BDF98 /* AppleObjCRuntimeV1.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCRuntimeV1.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 4CCA644513B40B82003BDF98 /* AppleObjCRuntimeV1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AppleObjCRuntimeV1.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
- 4CCA644613B40B82003BDF98 /* AppleObjCRuntimeV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCRuntimeV2.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 4CCA644713B40B82003BDF98 /* AppleObjCRuntimeV2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = AppleObjCRuntimeV2.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
- 4CCA644813B40B82003BDF98 /* AppleObjCTrampolineHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCTrampolineHandler.cpp; sourceTree = "<group>"; };
- 4CCA644913B40B82003BDF98 /* AppleObjCTrampolineHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleObjCTrampolineHandler.h; sourceTree = "<group>"; };
- 4CCA644A13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleThreadPlanStepThroughObjCTrampoline.cpp; sourceTree = "<group>"; };
- 4CCA644B13B40B82003BDF98 /* AppleThreadPlanStepThroughObjCTrampoline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleThreadPlanStepThroughObjCTrampoline.h; sourceTree = "<group>"; };
- 4CD0BD0C134BFAB600CB44D4 /* ValueObjectDynamicValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectDynamicValue.h; path = include/lldb/Core/ValueObjectDynamicValue.h; sourceTree = "<group>"; };
- 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = source/Core/ValueObjectDynamicValue.cpp; sourceTree = "<group>"; };
- 4CDB8D671DBA91A6006C5B13 /* LibStdcppUniquePointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcppUniquePointer.cpp; path = Language/CPlusPlus/LibStdcppUniquePointer.cpp; sourceTree = "<group>"; };
- 4CDB8D681DBA91A6006C5B13 /* LibStdcppTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcppTuple.cpp; path = Language/CPlusPlus/LibStdcppTuple.cpp; sourceTree = "<group>"; };
- 4CE4EFA61E8999B000A80C06 /* PlatformOpenBSD.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformOpenBSD.cpp; sourceTree = "<group>"; };
- 4CE4EFA71E8999B000A80C06 /* PlatformOpenBSD.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformOpenBSD.h; sourceTree = "<group>"; };
- 4CE4EFAB1E899A1200A80C06 /* RegisterContextOpenBSD_i386.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextOpenBSD_i386.cpp; path = Utility/RegisterContextOpenBSD_i386.cpp; sourceTree = "<group>"; };
- 4CE4EFAC1E899A1200A80C06 /* RegisterContextOpenBSD_i386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextOpenBSD_i386.h; path = Utility/RegisterContextOpenBSD_i386.h; sourceTree = "<group>"; };
- 4CE4EFAD1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextOpenBSD_x86_64.cpp; path = Utility/RegisterContextOpenBSD_x86_64.cpp; sourceTree = "<group>"; };
- 4CE4EFAE1E899A1200A80C06 /* RegisterContextOpenBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextOpenBSD_x86_64.h; path = Utility/RegisterContextOpenBSD_x86_64.h; sourceTree = "<group>"; };
- 4CE4F672162C971A00F75CB3 /* SBExpressionOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBExpressionOptions.h; path = include/lldb/API/SBExpressionOptions.h; sourceTree = "<group>"; };
- 4CE4F674162C973F00F75CB3 /* SBExpressionOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBExpressionOptions.cpp; path = source/API/SBExpressionOptions.cpp; sourceTree = "<group>"; };
- 4CE4F676162CE1E100F75CB3 /* SBExpressionOptions.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBExpressionOptions.i; sourceTree = "<group>"; };
- 4CEDAED311754F5E00E875A6 /* ThreadPlanStepUntil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadPlanStepUntil.h; path = include/lldb/Target/ThreadPlanStepUntil.h; sourceTree = "<group>"; };
- 4CF52AF41428291E0051E832 /* SBFileSpecList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFileSpecList.h; path = include/lldb/API/SBFileSpecList.h; sourceTree = "<group>"; };
- 4CF52AF7142829390051E832 /* SBFileSpecList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFileSpecList.cpp; path = source/API/SBFileSpecList.cpp; sourceTree = "<group>"; };
- 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = UBSanRuntime.cpp; sourceTree = "<group>"; };
- 54067BED1DF2034B00749AA5 /* UBSanRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBSanRuntime.h; sourceTree = "<group>"; };
- 69A01E1C1236C5D400C660B5 /* Host.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Host.cpp; sourceTree = "<group>"; };
- 69A01E1F1236C5D400C660B5 /* Symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Symbols.cpp; sourceTree = "<group>"; };
- 6D0F613C1C80AA8900A4ECEE /* DebugMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DebugMacros.h; path = include/lldb/Symbol/DebugMacros.h; sourceTree = "<group>"; };
- 6D0F613D1C80AA8900A4ECEE /* JavaASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaASTContext.h; path = include/lldb/Symbol/JavaASTContext.h; sourceTree = "<group>"; };
- 6D0F61411C80AAAA00A4ECEE /* JavaASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaASTContext.cpp; path = source/Symbol/JavaASTContext.cpp; sourceTree = "<group>"; };
- 6D0F61441C80AACF00A4ECEE /* DWARFASTParserJava.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserJava.cpp; sourceTree = "<group>"; };
- 6D0F61451C80AACF00A4ECEE /* DWARFASTParserJava.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserJava.h; sourceTree = "<group>"; };
- 6D0F614A1C80AB0400A4ECEE /* JavaLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaLanguageRuntime.cpp; path = Java/JavaLanguageRuntime.cpp; sourceTree = "<group>"; };
- 6D0F614B1C80AB0400A4ECEE /* JavaLanguageRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaLanguageRuntime.h; path = Java/JavaLanguageRuntime.h; sourceTree = "<group>"; };
- 6D0F61511C80AB3000A4ECEE /* JavaFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaFormatterFunctions.cpp; path = Language/Java/JavaFormatterFunctions.cpp; sourceTree = "<group>"; };
- 6D0F61521C80AB3000A4ECEE /* JavaFormatterFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaFormatterFunctions.h; path = Language/Java/JavaFormatterFunctions.h; sourceTree = "<group>"; };
- 6D0F61531C80AB3000A4ECEE /* JavaLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JavaLanguage.cpp; path = Language/Java/JavaLanguage.cpp; sourceTree = "<group>"; };
- 6D0F61541C80AB3000A4ECEE /* JavaLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JavaLanguage.h; path = Language/Java/JavaLanguage.h; sourceTree = "<group>"; };
- 6D55B28D1A8A806200A70529 /* GDBRemoteCommunicationServerCommon.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerCommon.cpp; sourceTree = "<group>"; };
- 6D55B28E1A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerLLGS.cpp; sourceTree = "<group>"; };
- 6D55B28F1A8A806200A70529 /* GDBRemoteCommunicationServerPlatform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GDBRemoteCommunicationServerPlatform.cpp; sourceTree = "<group>"; };
- 6D55B2931A8A808400A70529 /* GDBRemoteCommunicationServerCommon.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerCommon.h; sourceTree = "<group>"; };
- 6D55B2941A8A808400A70529 /* GDBRemoteCommunicationServerLLGS.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerLLGS.h; sourceTree = "<group>"; };
- 6D55B2951A8A808400A70529 /* GDBRemoteCommunicationServerPlatform.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GDBRemoteCommunicationServerPlatform.h; sourceTree = "<group>"; };
- 6D55BAE01A8CD03D00A70529 /* HostInfoAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = HostInfoAndroid.cpp; path = source/Host/android/HostInfoAndroid.cpp; sourceTree = "<group>"; };
- 6D55BAE21A8CD06000A70529 /* Android.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Android.h; path = include/lldb/Host/android/Android.h; sourceTree = "<group>"; };
- 6D55BAE31A8CD06000A70529 /* Config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Config.h; path = include/lldb/Host/android/Config.h; sourceTree = "<group>"; };
- 6D55BAE41A8CD06000A70529 /* HostInfoAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = HostInfoAndroid.h; path = include/lldb/Host/android/HostInfoAndroid.h; sourceTree = "<group>"; };
- 6D55BAE91A8CD08C00A70529 /* PlatformAndroid.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAndroid.cpp; sourceTree = "<group>"; };
- 6D55BAEA1A8CD08C00A70529 /* PlatformAndroid.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAndroid.h; sourceTree = "<group>"; };
- 6D55BAEB1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAndroidRemoteGDBServer.cpp; sourceTree = "<group>"; };
- 6D55BAEC1A8CD08C00A70529 /* PlatformAndroidRemoteGDBServer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAndroidRemoteGDBServer.h; sourceTree = "<group>"; };
- 6D762BEC1B1605CD006C929D /* LLDBServerUtilities.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LLDBServerUtilities.cpp; path = "tools/lldb-server/LLDBServerUtilities.cpp"; sourceTree = "<group>"; };
- 6D762BED1B1605CD006C929D /* LLDBServerUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLDBServerUtilities.h; path = "tools/lldb-server/LLDBServerUtilities.h"; sourceTree = "<group>"; };
- 6D86CE9E1B440F6B00A7FBFA /* CommandObjectBugreport.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBugreport.cpp; path = source/Commands/CommandObjectBugreport.cpp; sourceTree = "<group>"; };
- 6D86CE9F1B440F6B00A7FBFA /* CommandObjectBugreport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectBugreport.h; path = source/Commands/CommandObjectBugreport.h; sourceTree = "<group>"; };
- 6D95DBFD1B9DC057000E318A /* DIERef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DIERef.cpp; sourceTree = "<group>"; };
- 6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HashedNameToDIE.cpp; sourceTree = "<group>"; };
- 6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SymbolFileDWARFDwo.cpp; sourceTree = "<group>"; };
- 6D95DC031B9DC06F000E318A /* DIERef.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DIERef.h; sourceTree = "<group>"; };
- 6D95DC041B9DC06F000E318A /* SymbolFileDWARFDwo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SymbolFileDWARFDwo.h; sourceTree = "<group>"; };
- 6D99A3611BBC2F1600979793 /* ArmUnwindInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ArmUnwindInfo.h; path = include/lldb/Symbol/ArmUnwindInfo.h; sourceTree = "<group>"; };
- 6D99A3621BBC2F3200979793 /* ArmUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArmUnwindInfo.cpp; path = source/Symbol/ArmUnwindInfo.cpp; sourceTree = "<group>"; };
- 6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeMap.cpp; path = source/Symbol/TypeMap.cpp; sourceTree = "<group>"; };
- 6D9AB3DE1BB2B76B003F2289 /* TypeMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeMap.h; path = include/lldb/Symbol/TypeMap.h; sourceTree = "<group>"; };
- 6DEC6F381BD66D750091ABA6 /* TaskPool.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TaskPool.cpp; path = source/Host/common/TaskPool.cpp; sourceTree = "<group>"; };
- 6DEC6F3A1BD66D950091ABA6 /* TaskPool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TaskPool.h; path = include/lldb/Host/TaskPool.h; sourceTree = "<group>"; };
- 8C26C4241C3EA4340031DF7C /* TSanRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = TSanRuntime.cpp; path = TSan/TSanRuntime.cpp; sourceTree = "<group>"; };
- 8C26C4251C3EA4340031DF7C /* TSanRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TSanRuntime.h; path = TSan/TSanRuntime.h; sourceTree = "<group>"; };
- 8C2D6A52197A1EAF006989C9 /* MemoryHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryHistory.cpp; path = source/Target/MemoryHistory.cpp; sourceTree = "<group>"; };
- 8C2D6A54197A1EBE006989C9 /* MemoryHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = MemoryHistory.h; path = include/lldb/Target/MemoryHistory.h; sourceTree = "<group>"; };
- 8C2D6A5A197A1FDC006989C9 /* MemoryHistoryASan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MemoryHistoryASan.cpp; sourceTree = "<group>"; };
- 8C2D6A5B197A1FDC006989C9 /* MemoryHistoryASan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MemoryHistoryASan.h; sourceTree = "<group>"; };
- 8C3BD9931EF45D9B0016C343 /* MainThreadCheckerRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MainThreadCheckerRuntime.h; sourceTree = "<group>"; };
- 8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = MainThreadCheckerRuntime.cpp; sourceTree = "<group>"; };
- 8C3BD99F1EF5D1B50016C343 /* JSONTest.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = JSONTest.cpp; sourceTree = "<group>"; };
- 8CCB017A19BA283D0009FD44 /* ThreadCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadCollection.cpp; path = source/Target/ThreadCollection.cpp; sourceTree = "<group>"; };
- 8CCB017C19BA289B0009FD44 /* ThreadCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadCollection.h; path = include/lldb/Target/ThreadCollection.h; sourceTree = "<group>"; };
- 8CCB017F19BA4DD00009FD44 /* SBThreadCollection.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SBThreadCollection.cpp; path = source/API/SBThreadCollection.cpp; sourceTree = "<group>"; };
- 8CCB018119BA4E210009FD44 /* SBThreadCollection.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBThreadCollection.h; path = include/lldb/API/SBThreadCollection.h; sourceTree = "<group>"; };
- 8CCB018419BA54930009FD44 /* SBThreadCollection.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBThreadCollection.i; sourceTree = "<group>"; };
- 8CF02ADF19DCBF3B00B14BE0 /* InstrumentationRuntime.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = InstrumentationRuntime.cpp; path = source/Target/InstrumentationRuntime.cpp; sourceTree = "<group>"; };
- 8CF02AE019DCBF3B00B14BE0 /* InstrumentationRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstrumentationRuntime.h; path = include/lldb/Target/InstrumentationRuntime.h; sourceTree = "<group>"; };
- 8CF02AE519DCBF8400B14BE0 /* ASanRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ASanRuntime.cpp; sourceTree = "<group>"; };
- 8CF02AE619DCBF8400B14BE0 /* ASanRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASanRuntime.h; sourceTree = "<group>"; };
- 8CF02AED19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = InstrumentationRuntimeStopInfo.cpp; path = source/Target/InstrumentationRuntimeStopInfo.cpp; sourceTree = "<group>"; };
- 8CF02AEE19DD15CF00B14BE0 /* InstrumentationRuntimeStopInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InstrumentationRuntimeStopInfo.h; path = include/lldb/Target/InstrumentationRuntimeStopInfo.h; sourceTree = "<group>"; };
- 94005E0313F438DF001EF42D /* python-wrapper.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-wrapper.swig"; sourceTree = "<group>"; };
- 94005E0513F45A1B001EF42D /* embedded_interpreter.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = embedded_interpreter.py; path = source/Interpreter/embedded_interpreter.py; sourceTree = "<group>"; };
- 940495781BEC497E00926025 /* NSError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSError.cpp; path = Language/ObjC/NSError.cpp; sourceTree = "<group>"; };
- 940495791BEC497E00926025 /* NSException.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSException.cpp; path = Language/ObjC/NSException.cpp; sourceTree = "<group>"; };
- 94094C68163B6CCC0083A547 /* ValueObjectCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectCast.h; path = include/lldb/Core/ValueObjectCast.h; sourceTree = "<group>"; };
- 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectCast.cpp; path = source/Core/ValueObjectCast.cpp; sourceTree = "<group>"; };
- 940B01FE1D2D82220058795E /* ThreadSafeSTLVector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLVector.h; path = include/lldb/Core/ThreadSafeSTLVector.h; sourceTree = "<group>"; };
- 940B02F419DC96CB00AD0F52 /* SBExecutionContext.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBExecutionContext.h; path = include/lldb/API/SBExecutionContext.h; sourceTree = "<group>"; };
- 940B02F519DC96E700AD0F52 /* SBExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBExecutionContext.cpp; path = source/API/SBExecutionContext.cpp; sourceTree = "<group>"; };
- 940B02F719DC970900AD0F52 /* SBExecutionContext.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBExecutionContext.i; sourceTree = "<group>"; };
- 940B04D81A8984FF0045D5F7 /* argdumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = argdumper.cpp; path = tools/argdumper/argdumper.cpp; sourceTree = "<group>"; };
- 94145430175D7FDE00284436 /* lldb-versioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-versioning.h"; path = "include/lldb/lldb-versioning.h"; sourceTree = "<group>"; };
- 9418EBCB1AA9108B0058B02E /* VectorType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VectorType.h; path = include/lldb/DataFormatters/VectorType.h; sourceTree = "<group>"; };
- 9418EBCC1AA910910058B02E /* VectorType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorType.cpp; path = source/DataFormatters/VectorType.cpp; sourceTree = "<group>"; };
- 94235B9A1A8D5FD800EB2EED /* SBVariablesOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBVariablesOptions.h; path = include/lldb/API/SBVariablesOptions.h; sourceTree = "<group>"; };
- 94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBVariablesOptions.cpp; path = source/API/SBVariablesOptions.cpp; sourceTree = "<group>"; };
- 94235B9D1A8D601A00EB2EED /* SBVariablesOptions.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBVariablesOptions.i; sourceTree = "<group>"; };
- 942612F51B94FFE900EF842E /* LanguageCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LanguageCategory.h; path = include/lldb/DataFormatters/LanguageCategory.h; sourceTree = "<group>"; };
- 942612F61B95000000EF842E /* LanguageCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LanguageCategory.cpp; path = source/DataFormatters/LanguageCategory.cpp; sourceTree = "<group>"; };
- 942829541A89614000521B30 /* JSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = JSON.h; path = include/lldb/Utility/JSON.h; sourceTree = "<group>"; };
- 942829551A89614C00521B30 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSON.cpp; path = source/Utility/JSON.cpp; sourceTree = "<group>"; };
- 942829C01A89835300521B30 /* lldb-argdumper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-argdumper"; sourceTree = BUILT_PRODUCTS_DIR; };
- 9428BC291C6E64DC002A24D7 /* LibCxxAtomic.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxAtomic.cpp; path = Language/CPlusPlus/LibCxxAtomic.cpp; sourceTree = "<group>"; };
- 9428BC2A1C6E64DC002A24D7 /* LibCxxAtomic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibCxxAtomic.h; path = Language/CPlusPlus/LibCxxAtomic.h; sourceTree = "<group>"; };
- 94380B8019940B0300BFE4A8 /* StringLexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringLexer.h; path = include/lldb/Utility/StringLexer.h; sourceTree = "<group>"; };
- 94380B8119940B0A00BFE4A8 /* StringLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringLexer.cpp; path = source/Utility/StringLexer.cpp; sourceTree = "<group>"; };
- 943B90FC1B991586007BA499 /* VectorIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VectorIterator.h; path = include/lldb/DataFormatters/VectorIterator.h; sourceTree = "<group>"; };
- 943BDEFC1AA7B2DE00789CE8 /* LLDBAssert.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLDBAssert.h; path = include/lldb/Utility/LLDBAssert.h; sourceTree = "<group>"; };
- 943BDEFD1AA7B2F800789CE8 /* LLDBAssert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLDBAssert.cpp; path = source/Utility/LLDBAssert.cpp; sourceTree = "<group>"; };
- 9441816B1C8F5EB000E5A8D9 /* CommandAlias.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandAlias.h; path = include/lldb/Interpreter/CommandAlias.h; sourceTree = "<group>"; };
- 9441816D1C8F5EC900E5A8D9 /* CommandAlias.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandAlias.cpp; path = source/Interpreter/CommandAlias.cpp; sourceTree = "<group>"; };
- 944372DA171F6B4300E57C32 /* RegisterContextDummy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDummy.cpp; path = Utility/RegisterContextDummy.cpp; sourceTree = "<group>"; };
- 944372DB171F6B4300E57C32 /* RegisterContextDummy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDummy.h; path = Utility/RegisterContextDummy.h; sourceTree = "<group>"; };
- 9443B120140C18A90013457C /* SBData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBData.h; path = include/lldb/API/SBData.h; sourceTree = "<group>"; };
- 9443B121140C18C10013457C /* SBData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBData.cpp; path = source/API/SBData.cpp; sourceTree = "<group>"; };
- 9447DE411BD5962900E67212 /* DumpValueObjectOptions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DumpValueObjectOptions.h; path = include/lldb/DataFormatters/DumpValueObjectOptions.h; sourceTree = "<group>"; };
- 9447DE421BD5963300E67212 /* DumpValueObjectOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DumpValueObjectOptions.cpp; path = source/DataFormatters/DumpValueObjectOptions.cpp; sourceTree = "<group>"; };
+ 94ED54A119C8A822007BE2EA /* ThreadSafeDenseMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadSafeDenseMap.h; path = include/lldb/Core/ThreadSafeDenseMap.h; sourceTree = "<group>"; };
9449B8031B30E0690019342B /* ThreadSafeDenseSet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadSafeDenseSet.h; path = include/lldb/Core/ThreadSafeDenseSet.h; sourceTree = "<group>"; };
- 944DC3481774C99000D7D884 /* python-swigsafecast.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-swigsafecast.swig"; sourceTree = "<group>"; };
- 945215DD17F639E600521C0B /* ValueObjectPrinter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectPrinter.h; path = include/lldb/DataFormatters/ValueObjectPrinter.h; sourceTree = "<group>"; };
- 945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectPrinter.cpp; path = source/DataFormatters/ValueObjectPrinter.cpp; sourceTree = "<group>"; };
- 9452573616262CD000325455 /* SBDeclaration.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBDeclaration.i; sourceTree = "<group>"; };
- 9452573816262CEF00325455 /* SBDeclaration.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBDeclaration.h; path = include/lldb/API/SBDeclaration.h; sourceTree = "<group>"; };
- 9452573916262D0200325455 /* SBDeclaration.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBDeclaration.cpp; path = source/API/SBDeclaration.cpp; sourceTree = "<group>"; };
- 945261B31B9A11E800BF138D /* CxxStringTypes.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CxxStringTypes.cpp; path = Language/CPlusPlus/CxxStringTypes.cpp; sourceTree = "<group>"; };
- 945261B41B9A11E800BF138D /* CxxStringTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CxxStringTypes.h; path = Language/CPlusPlus/CxxStringTypes.h; sourceTree = "<group>"; };
- 945261B51B9A11E800BF138D /* LibCxx.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxx.cpp; path = Language/CPlusPlus/LibCxx.cpp; sourceTree = "<group>"; };
- 945261B61B9A11E800BF138D /* LibCxx.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibCxx.h; path = Language/CPlusPlus/LibCxx.h; sourceTree = "<group>"; };
- 945261B71B9A11E800BF138D /* LibCxxInitializerList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxInitializerList.cpp; path = Language/CPlusPlus/LibCxxInitializerList.cpp; sourceTree = "<group>"; };
- 945261B81B9A11E800BF138D /* LibCxxList.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxList.cpp; path = Language/CPlusPlus/LibCxxList.cpp; sourceTree = "<group>"; };
- 945261B91B9A11E800BF138D /* LibCxxMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxMap.cpp; path = Language/CPlusPlus/LibCxxMap.cpp; sourceTree = "<group>"; };
- 945261BA1B9A11E800BF138D /* LibCxxUnorderedMap.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxUnorderedMap.cpp; path = Language/CPlusPlus/LibCxxUnorderedMap.cpp; sourceTree = "<group>"; };
- 945261BB1B9A11E800BF138D /* LibCxxVector.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxVector.cpp; path = Language/CPlusPlus/LibCxxVector.cpp; sourceTree = "<group>"; };
- 945261BC1B9A11E800BF138D /* LibStdcpp.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = LibStdcpp.cpp; path = Language/CPlusPlus/LibStdcpp.cpp; sourceTree = "<group>"; };
- 945261BD1B9A11E800BF138D /* LibStdcpp.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LibStdcpp.h; path = Language/CPlusPlus/LibStdcpp.h; sourceTree = "<group>"; };
- 945261C71B9A14D300BF138D /* CXXFunctionPointer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CXXFunctionPointer.cpp; path = source/DataFormatters/CXXFunctionPointer.cpp; sourceTree = "<group>"; };
- 945261C91B9A14E000BF138D /* CXXFunctionPointer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CXXFunctionPointer.h; path = include/lldb/DataFormatters/CXXFunctionPointer.h; sourceTree = "<group>"; };
- 9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleSimulator.cpp; sourceTree = "<group>"; };
- 9455630B1BEAD0570073F75F /* PlatformAppleSimulator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformAppleSimulator.h; sourceTree = "<group>"; };
- 9455630C1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlatformiOSSimulatorCoreSimulatorSupport.h; sourceTree = "<group>"; };
- 9455630D1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PlatformiOSSimulatorCoreSimulatorSupport.mm; sourceTree = "<group>"; };
- 945759651534941F005A9070 /* PlatformPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformPOSIX.cpp; path = POSIX/PlatformPOSIX.cpp; sourceTree = "<group>"; };
- 945759661534941F005A9070 /* PlatformPOSIX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PlatformPOSIX.h; path = POSIX/PlatformPOSIX.h; sourceTree = "<group>"; };
- 9461568614E355F2003A195C /* SBTypeFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFilter.h; path = include/lldb/API/SBTypeFilter.h; sourceTree = "<group>"; };
- 9461568714E355F2003A195C /* SBTypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeFormat.h; path = include/lldb/API/SBTypeFormat.h; sourceTree = "<group>"; };
- 9461568814E355F2003A195C /* SBTypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSummary.h; path = include/lldb/API/SBTypeSummary.h; sourceTree = "<group>"; };
- 9461568914E355F2003A195C /* SBTypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeSynthetic.h; path = include/lldb/API/SBTypeSynthetic.h; sourceTree = "<group>"; };
- 9461568A14E35621003A195C /* SBTypeFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFilter.cpp; path = source/API/SBTypeFilter.cpp; sourceTree = "<group>"; };
- 9461568B14E35621003A195C /* SBTypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeFormat.cpp; path = source/API/SBTypeFormat.cpp; sourceTree = "<group>"; };
- 9461568C14E35621003A195C /* SBTypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSummary.cpp; path = source/API/SBTypeSummary.cpp; sourceTree = "<group>"; };
- 9461568D14E35621003A195C /* SBTypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeSynthetic.cpp; path = source/API/SBTypeSynthetic.cpp; sourceTree = "<group>"; };
- 9461569214E3567F003A195C /* SBTypeFilter.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFilter.i; sourceTree = "<group>"; };
- 9461569314E3567F003A195C /* SBTypeFormat.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeFormat.i; sourceTree = "<group>"; };
- 9461569414E3567F003A195C /* SBTypeSummary.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSummary.i; sourceTree = "<group>"; };
- 9461569514E3567F003A195C /* SBTypeSynthetic.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeSynthetic.i; sourceTree = "<group>"; };
- 946216BF1A97C055006E19CC /* OptionValueLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionValueLanguage.h; path = include/lldb/Interpreter/OptionValueLanguage.h; sourceTree = "<group>"; };
- 946216C11A97C080006E19CC /* OptionValueLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionValueLanguage.cpp; path = source/Interpreter/OptionValueLanguage.cpp; sourceTree = "<group>"; };
- 9463D4CC13B1798800C230D4 /* CommandObjectType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = CommandObjectType.cpp; path = source/Commands/CommandObjectType.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 9463D4CE13B179A500C230D4 /* CommandObjectType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectType.h; path = source/Commands/CommandObjectType.h; sourceTree = "<group>"; };
- 9475C18514E5E9C5001BFC6D /* SBTypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeCategory.h; path = include/lldb/API/SBTypeCategory.h; sourceTree = "<group>"; };
- 9475C18714E5E9FA001BFC6D /* SBTypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeCategory.cpp; path = source/API/SBTypeCategory.cpp; sourceTree = "<group>"; };
- 9475C18A14E5EA1C001BFC6D /* SBTypeCategory.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeCategory.i; sourceTree = "<group>"; };
- 9475C18B14E5F818001BFC6D /* SBTypeNameSpecifier.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBTypeNameSpecifier.i; sourceTree = "<group>"; };
- 9475C18C14E5F826001BFC6D /* SBTypeNameSpecifier.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SBTypeNameSpecifier.h; path = include/lldb/API/SBTypeNameSpecifier.h; sourceTree = "<group>"; };
- 9475C18D14E5F834001BFC6D /* SBTypeNameSpecifier.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTypeNameSpecifier.cpp; path = source/API/SBTypeNameSpecifier.cpp; sourceTree = "<group>"; };
- 947A1D621616476A0017C8D1 /* CommandObjectPlugin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectPlugin.cpp; path = source/Commands/CommandObjectPlugin.cpp; sourceTree = "<group>"; };
- 947A1D631616476A0017C8D1 /* CommandObjectPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectPlugin.h; path = source/Commands/CommandObjectPlugin.h; sourceTree = "<group>"; };
- 947CF76F1DC7B1E300EF980B /* ProcessMinidump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ProcessMinidump.h; sourceTree = "<group>"; };
- 947CF7701DC7B1EE00EF980B /* ProcessMinidump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessMinidump.cpp; sourceTree = "<group>"; };
- 947CF7721DC7B20300EF980B /* RegisterContextMinidump_x86_32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RegisterContextMinidump_x86_32.h; sourceTree = "<group>"; };
- 947CF7731DC7B20300EF980B /* ThreadMinidump.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThreadMinidump.h; sourceTree = "<group>"; };
- 947CF7741DC7B20D00EF980B /* RegisterContextMinidump_x86_32.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextMinidump_x86_32.cpp; sourceTree = "<group>"; };
- 947CF7751DC7B20D00EF980B /* ThreadMinidump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ThreadMinidump.cpp; sourceTree = "<group>"; };
- 9481FE6B1B5F2D9200DED357 /* Either.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Either.h; path = include/lldb/Utility/Either.h; sourceTree = "<group>"; };
- 948554581DCBAE3200345FF5 /* RenderScriptScriptGroup.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RenderScriptScriptGroup.h; sourceTree = "<group>"; };
- 948554591DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderScriptScriptGroup.cpp; sourceTree = "<group>"; };
- 949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultImpl.h; path = include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = "<group>"; };
- 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = source/Core/ValueObjectConstResultImpl.cpp; sourceTree = "<group>"; };
- 949EED9E1BA74B64008C63CF /* CoreMedia.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CoreMedia.cpp; path = Language/ObjC/CoreMedia.cpp; sourceTree = "<group>"; };
- 949EED9F1BA74B64008C63CF /* CoreMedia.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CoreMedia.h; path = Language/ObjC/CoreMedia.h; sourceTree = "<group>"; };
- 949EEDA11BA76571008C63CF /* Cocoa.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Cocoa.cpp; path = Language/ObjC/Cocoa.cpp; sourceTree = "<group>"; };
- 949EEDA21BA76571008C63CF /* Cocoa.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Cocoa.h; path = Language/ObjC/Cocoa.h; sourceTree = "<group>"; };
- 949EEDA41BA765B5008C63CF /* NSArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSArray.cpp; path = Language/ObjC/NSArray.cpp; sourceTree = "<group>"; };
- 949EEDA51BA765B5008C63CF /* NSDictionary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSDictionary.cpp; path = Language/ObjC/NSDictionary.cpp; sourceTree = "<group>"; };
- 949EEDA61BA765B5008C63CF /* NSIndexPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSIndexPath.cpp; path = Language/ObjC/NSIndexPath.cpp; sourceTree = "<group>"; };
- 949EEDA71BA765B5008C63CF /* NSSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSSet.cpp; path = Language/ObjC/NSSet.cpp; sourceTree = "<group>"; };
- 949EEDAC1BA76719008C63CF /* CF.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CF.cpp; path = Language/ObjC/CF.cpp; sourceTree = "<group>"; };
- 949EEDAD1BA76719008C63CF /* CF.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CF.h; path = Language/ObjC/CF.h; sourceTree = "<group>"; };
- 94A5B3951AB9FE8300A5EE7F /* EmulateInstructionMIPS64.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = EmulateInstructionMIPS64.cpp; path = MIPS64/EmulateInstructionMIPS64.cpp; sourceTree = "<group>"; };
- 94A5B3961AB9FE8300A5EE7F /* EmulateInstructionMIPS64.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = EmulateInstructionMIPS64.h; path = MIPS64/EmulateInstructionMIPS64.h; sourceTree = "<group>"; };
- 94B638511B8F8E53004FE1E4 /* Language.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Language.h; path = include/lldb/Target/Language.h; sourceTree = "<group>"; };
- 94B638521B8F8E6C004FE1E4 /* Language.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Language.cpp; path = source/Target/Language.cpp; sourceTree = "<group>"; };
- 94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = CPlusPlusLanguage.cpp; path = Language/CPlusPlus/CPlusPlusLanguage.cpp; sourceTree = "<group>"; };
- 94B6385C1B8FB174004FE1E4 /* CPlusPlusLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CPlusPlusLanguage.h; path = Language/CPlusPlus/CPlusPlusLanguage.h; sourceTree = "<group>"; };
- 94B6385E1B8FB7A2004FE1E4 /* ObjCLanguage.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCLanguage.cpp; path = Language/ObjC/ObjCLanguage.cpp; sourceTree = "<group>"; };
- 94B6385F1B8FB7A2004FE1E4 /* ObjCLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ObjCLanguage.h; path = Language/ObjC/ObjCLanguage.h; sourceTree = "<group>"; };
- 94B638611B8FB7E9004FE1E4 /* ObjCPlusPlusLanguage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ObjCPlusPlusLanguage.h; path = Language/ObjCPlusPlus/ObjCPlusPlusLanguage.h; sourceTree = "<group>"; };
- 94B638621B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ObjCPlusPlusLanguage.cpp; path = Language/ObjCPlusPlus/ObjCPlusPlusLanguage.cpp; sourceTree = "<group>"; };
- 94B6E76013D8833C005F417F /* ValueObjectSyntheticFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectSyntheticFilter.h; path = include/lldb/Core/ValueObjectSyntheticFilter.h; sourceTree = "<group>"; };
- 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectSyntheticFilter.cpp; path = source/Core/ValueObjectSyntheticFilter.cpp; sourceTree = "<group>"; };
- 94B9E50E1BBEFDFE000A48DC /* NSDictionary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSDictionary.h; path = Language/ObjC/NSDictionary.h; sourceTree = "<group>"; };
- 94B9E50F1BBF0069000A48DC /* NSSet.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSSet.h; path = Language/ObjC/NSSet.h; sourceTree = "<group>"; };
- 94B9E5101BBF20B7000A48DC /* NSString.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = NSString.h; path = Language/ObjC/NSString.h; sourceTree = "<group>"; };
- 94B9E5111BBF20F4000A48DC /* NSString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NSString.cpp; path = Language/ObjC/NSString.cpp; sourceTree = "<group>"; };
- 94BA8B6C176F8C9B005A91B5 /* Range.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Range.cpp; path = source/Utility/Range.cpp; sourceTree = "<group>"; };
- 94BA8B6E176F8CA0005A91B5 /* Range.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Range.h; path = include/lldb/Utility/Range.h; sourceTree = "<group>"; };
- 94BA8B6F176F97CE005A91B5 /* CommandHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandHistory.cpp; path = source/Interpreter/CommandHistory.cpp; sourceTree = "<group>"; };
- 94BA8B71176F97D4005A91B5 /* CommandHistory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandHistory.h; path = include/lldb/Interpreter/CommandHistory.h; sourceTree = "<group>"; };
- 94CB255816B069770059775D /* DataVisualization.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DataVisualization.cpp; path = source/DataFormatters/DataVisualization.cpp; sourceTree = "<group>"; };
- 94CB255916B069770059775D /* FormatClasses.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatClasses.cpp; path = source/DataFormatters/FormatClasses.cpp; sourceTree = "<group>"; };
- 94CB255A16B069770059775D /* FormatManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatManager.cpp; path = source/DataFormatters/FormatManager.cpp; sourceTree = "<group>"; };
- 94CB256016B069800059775D /* DataVisualization.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DataVisualization.h; path = include/lldb/DataFormatters/DataVisualization.h; sourceTree = "<group>"; };
- 94CB256116B069800059775D /* FormatClasses.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatClasses.h; path = include/lldb/DataFormatters/FormatClasses.h; sourceTree = "<group>"; };
- 94CB256216B069800059775D /* FormatManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatManager.h; path = include/lldb/DataFormatters/FormatManager.h; sourceTree = "<group>"; };
+ 263FEDA5112CC1DA00E4C208 /* ThreadSafeSTLMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLMap.h; path = include/lldb/Core/ThreadSafeSTLMap.h; sourceTree = "<group>"; };
+ 940B01FE1D2D82220058795E /* ThreadSafeSTLVector.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadSafeSTLVector.h; path = include/lldb/Core/ThreadSafeSTLVector.h; sourceTree = "<group>"; };
+ 26B167A41123BF5500DC7B4F /* ThreadSafeValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSafeValue.h; path = include/lldb/Core/ThreadSafeValue.h; sourceTree = "<group>"; };
+ 4C08CDE711C81EF8001610A8 /* ThreadSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadSpec.cpp; path = source/Target/ThreadSpec.cpp; sourceTree = "<group>"; };
+ 4C08CDEB11C81F1E001610A8 /* ThreadSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ThreadSpec.h; path = include/lldb/Target/ThreadSpec.h; sourceTree = "<group>"; };
+ AFF8FF0B1E779D4B003830EF /* TildeExpressionResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TildeExpressionResolver.cpp; path = source/Utility/TildeExpressionResolver.cpp; sourceTree = "<group>"; };
+ AFF8FF0D1E779D51003830EF /* TildeExpressionResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TildeExpressionResolver.h; path = include/lldb/Utility/TildeExpressionResolver.h; sourceTree = "<group>"; };
+ 9A3D43C91F3150D200EB767C /* TildeExpressionResolverTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TildeExpressionResolverTest.cpp; sourceTree = "<group>"; };
+ 9A3D43CC1F3150D200EB767C /* TimeoutTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeoutTest.cpp; sourceTree = "<group>"; };
+ 26BC7E9610F1B85900F91463 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timer.cpp; path = source/Utility/Timer.cpp; sourceTree = "<group>"; };
+ 26BC7D7E10F1B77400F91463 /* Timer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Timer.h; path = include/lldb/Utility/Timer.h; sourceTree = "<group>"; };
+ 9A3D43C51F3150D200EB767C /* TimerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimerTest.cpp; sourceTree = "<group>"; };
+ 26BC7F2010F1B8EC00F91463 /* Type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Type.cpp; path = source/Symbol/Type.cpp; sourceTree = "<group>"; };
+ 26BC7C6510F1B6E900F91463 /* Type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Type.h; path = include/lldb/Symbol/Type.h; sourceTree = "<group>"; };
94CB256416B096F10059775D /* TypeCategory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategory.cpp; path = source/DataFormatters/TypeCategory.cpp; sourceTree = "<group>"; };
- 94CB256516B096F10059775D /* TypeCategoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategoryMap.cpp; path = source/DataFormatters/TypeCategoryMap.cpp; sourceTree = "<group>"; };
94CB256816B096F90059775D /* TypeCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategory.h; path = include/lldb/DataFormatters/TypeCategory.h; sourceTree = "<group>"; };
+ 94CB256516B096F10059775D /* TypeCategoryMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeCategoryMap.cpp; path = source/DataFormatters/TypeCategoryMap.cpp; sourceTree = "<group>"; };
94CB256916B096FA0059775D /* TypeCategoryMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeCategoryMap.h; path = include/lldb/DataFormatters/TypeCategoryMap.h; sourceTree = "<group>"; };
- 94CB256A16B0A4030059775D /* TypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeFormat.h; path = include/lldb/DataFormatters/TypeFormat.h; sourceTree = "<group>"; };
- 94CB256B16B0A4030059775D /* TypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSummary.h; path = include/lldb/DataFormatters/TypeSummary.h; sourceTree = "<group>"; };
- 94CB256C16B0A4040059775D /* TypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSynthetic.h; path = include/lldb/DataFormatters/TypeSynthetic.h; sourceTree = "<group>"; };
94CB256D16B0A4260059775D /* TypeFormat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeFormat.cpp; path = source/DataFormatters/TypeFormat.cpp; sourceTree = "<group>"; };
+ 94CB256A16B0A4030059775D /* TypeFormat.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeFormat.h; path = include/lldb/DataFormatters/TypeFormat.h; sourceTree = "<group>"; };
+ 26BC7F2110F1B8EC00F91463 /* TypeList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeList.cpp; path = source/Symbol/TypeList.cpp; sourceTree = "<group>"; };
+ 26BC7C6610F1B6E900F91463 /* TypeList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeList.h; path = include/lldb/Symbol/TypeList.h; sourceTree = "<group>"; };
+ 6D9AB3DC1BB2B74E003F2289 /* TypeMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeMap.cpp; path = source/Symbol/TypeMap.cpp; sourceTree = "<group>"; };
+ 6D9AB3DE1BB2B76B003F2289 /* TypeMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeMap.h; path = include/lldb/Symbol/TypeMap.h; sourceTree = "<group>"; };
94CB256E16B0A4260059775D /* TypeSummary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSummary.cpp; path = source/DataFormatters/TypeSummary.cpp; sourceTree = "<group>"; };
+ 94CB256B16B0A4030059775D /* TypeSummary.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSummary.h; path = include/lldb/DataFormatters/TypeSummary.h; sourceTree = "<group>"; };
94CB256F16B0A4270059775D /* TypeSynthetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSynthetic.cpp; path = source/DataFormatters/TypeSynthetic.cpp; sourceTree = "<group>"; };
- 94CB257316B1D3870059775D /* FormatCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormatCache.cpp; path = source/DataFormatters/FormatCache.cpp; sourceTree = "<group>"; };
- 94CB257516B1D3910059775D /* FormatCache.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormatCache.h; path = include/lldb/DataFormatters/FormatCache.h; sourceTree = "<group>"; };
- 94CD131819BA33A100DB7BED /* TypeValidator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeValidator.h; path = include/lldb/DataFormatters/TypeValidator.h; sourceTree = "<group>"; };
+ 94CB256C16B0A4040059775D /* TypeSynthetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeSynthetic.h; path = include/lldb/DataFormatters/TypeSynthetic.h; sourceTree = "<group>"; };
+ AEEA34041AC88A7400AB639D /* TypeSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSystem.cpp; path = source/Symbol/TypeSystem.cpp; sourceTree = "<group>"; };
+ AEEA33F61AC74FE700AB639D /* TypeSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeSystem.h; path = include/lldb/Symbol/TypeSystem.h; sourceTree = "<group>"; };
94CD131919BA33B400DB7BED /* TypeValidator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeValidator.cpp; path = source/DataFormatters/TypeValidator.cpp; sourceTree = "<group>"; };
- 94CD7D0719A3FB8600908B7C /* AppleObjCClassDescriptorV2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCClassDescriptorV2.h; sourceTree = "<group>"; };
- 94CD7D0819A3FBA300908B7C /* AppleObjCClassDescriptorV2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleObjCClassDescriptorV2.cpp; sourceTree = "<group>"; };
- 94CD7D0A19A3FBC300908B7C /* AppleObjCTypeEncodingParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppleObjCTypeEncodingParser.h; sourceTree = "<group>"; };
- 94CD7D0B19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; path = AppleObjCTypeEncodingParser.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 94D0858A1B9675A0000D24BD /* FormattersHelpers.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormattersHelpers.h; path = include/lldb/DataFormatters/FormattersHelpers.h; sourceTree = "<group>"; };
- 94D0858B1B9675B8000D24BD /* FormattersHelpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FormattersHelpers.cpp; path = source/DataFormatters/FormattersHelpers.cpp; sourceTree = "<group>"; };
- 94E367CC140C4EC4001C7A5A /* modify-python-lldb.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "modify-python-lldb.py"; sourceTree = "<group>"; };
- 94E367CE140C4EEA001C7A5A /* python-typemaps.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-typemaps.swig"; sourceTree = "<group>"; };
- 94ED54A119C8A822007BE2EA /* ThreadSafeDenseMap.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadSafeDenseMap.h; path = include/lldb/Core/ThreadSafeDenseMap.h; sourceTree = "<group>"; };
- 94EE33F218643C6900CD703B /* FormattersContainer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FormattersContainer.h; path = include/lldb/DataFormatters/FormattersContainer.h; sourceTree = "<group>"; };
- 94F48F231A01C679005C0EC6 /* StringPrinter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StringPrinter.h; path = include/lldb/DataFormatters/StringPrinter.h; sourceTree = "<group>"; };
- 94F48F241A01C687005C0EC6 /* StringPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringPrinter.cpp; path = source/DataFormatters/StringPrinter.cpp; sourceTree = "<group>"; };
- 94FA3DDD1405D4E500833217 /* ValueObjectConstResultChild.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultChild.h; path = include/lldb/Core/ValueObjectConstResultChild.h; sourceTree = "<group>"; };
- 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultChild.cpp; path = source/Core/ValueObjectConstResultChild.cpp; sourceTree = "<group>"; };
- 94FE476613FC1DA8001F8475 /* finish-swig-Python-LLDB.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "finish-swig-Python-LLDB.sh"; sourceTree = "<group>"; };
- 961FABB81235DE1600F93A47 /* FuncUnwinders.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FuncUnwinders.cpp; path = source/Symbol/FuncUnwinders.cpp; sourceTree = "<group>"; };
- 961FABB91235DE1600F93A47 /* UnwindPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindPlan.cpp; path = source/Symbol/UnwindPlan.cpp; sourceTree = "<group>"; };
- 961FABBA1235DE1600F93A47 /* UnwindTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindTable.cpp; path = source/Symbol/UnwindTable.cpp; sourceTree = "<group>"; };
- 964463EB1A330C0500154ED8 /* CompactUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CompactUnwindInfo.cpp; path = source/Symbol/CompactUnwindInfo.cpp; sourceTree = "<group>"; };
- 964463ED1A330C1B00154ED8 /* CompactUnwindInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CompactUnwindInfo.h; path = include/lldb/Symbol/CompactUnwindInfo.h; sourceTree = "<group>"; };
- 966C6B7818E6A56A0093F5EC /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
- 9694FA6F1B32AA64005EBB16 /* ABISysV_mips.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_mips.cpp; path = "SysV-mips/ABISysV_mips.cpp"; sourceTree = "<group>"; };
- 9694FA701B32AA64005EBB16 /* ABISysV_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_mips.h; path = "SysV-mips/ABISysV_mips.h"; sourceTree = "<group>"; };
- 9A0FDE951E8EF5010086B2F5 /* RegisterContext_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_mips.h; path = Utility/RegisterContext_mips.h; sourceTree = "<group>"; };
- 9A0FDE961E8EF5010086B2F5 /* RegisterContext_s390x.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_s390x.h; path = Utility/RegisterContext_s390x.h; sourceTree = "<group>"; };
- 9A0FDE971E8EF5010086B2F5 /* RegisterContextLinux_mips.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLinux_mips.cpp; path = Utility/RegisterContextLinux_mips.cpp; sourceTree = "<group>"; };
- 9A0FDE981E8EF5010086B2F5 /* RegisterContextLinux_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLinux_mips.h; path = Utility/RegisterContextLinux_mips.h; sourceTree = "<group>"; };
- 9A0FDE991E8EF5010086B2F5 /* RegisterInfos_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm.h; path = Utility/RegisterInfos_arm.h; sourceTree = "<group>"; };
- 9A0FDE9A1E8EF5010086B2F5 /* RegisterInfos_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_arm64.h; path = Utility/RegisterInfos_arm64.h; sourceTree = "<group>"; };
- 9A0FDE9B1E8EF5010086B2F5 /* RegisterInfos_mips.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_mips.h; path = Utility/RegisterInfos_mips.h; sourceTree = "<group>"; };
- 9A1890311F47D5D400394BCA /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = CMakeLists.txt; path = TestingSupport/CMakeLists.txt; sourceTree = "<group>"; };
- 9A1890321F47D5D400394BCA /* MockTildeExpressionResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MockTildeExpressionResolver.cpp; path = TestingSupport/MockTildeExpressionResolver.cpp; sourceTree = "<group>"; };
- 9A1890331F47D5D400394BCA /* MockTildeExpressionResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MockTildeExpressionResolver.h; path = TestingSupport/MockTildeExpressionResolver.h; sourceTree = "<group>"; };
- 9A1890341F47D5D400394BCA /* TestUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestUtilities.cpp; path = TestingSupport/TestUtilities.cpp; sourceTree = "<group>"; };
- 9A1890351F47D5D400394BCA /* TestUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TestUtilities.h; path = TestingSupport/TestUtilities.h; sourceTree = "<group>"; };
- 9A19A6A51163BB7E00E0D453 /* SBValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValue.h; path = include/lldb/API/SBValue.h; sourceTree = "<group>"; };
- 9A19A6AD1163BB9800E0D453 /* SBValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValue.cpp; path = source/API/SBValue.cpp; sourceTree = "<group>"; };
- 9A1E59521EB2B0B9002206A5 /* SBTrace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTrace.cpp; path = source/API/SBTrace.cpp; sourceTree = "<group>"; };
- 9A1E59531EB2B0B9002206A5 /* SBTraceOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBTraceOptions.cpp; path = source/API/SBTraceOptions.cpp; sourceTree = "<group>"; };
- 9A1E59581EB2B10D002206A5 /* SBTrace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTrace.h; path = include/lldb/API/SBTrace.h; sourceTree = "<group>"; };
- 9A1E59591EB2B10D002206A5 /* SBTraceOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTraceOptions.h; path = include/lldb/API/SBTraceOptions.h; sourceTree = "<group>"; };
- 9A2057061F3B818600F6C293 /* MemoryRegionInfoTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MemoryRegionInfoTest.cpp; path = Target/MemoryRegionInfoTest.cpp; sourceTree = "<group>"; };
- 9A20570A1F3B81F300F6C293 /* SymbolFileDWARFTests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFileDWARFTests.cpp; path = DWARF/SymbolFileDWARFTests.cpp; sourceTree = "<group>"; };
- 9A20570D1F3B821A00F6C293 /* test-dwarf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "test-dwarf.cpp"; path = "DWARF/Inputs/test-dwarf.cpp"; sourceTree = "<group>"; };
- 9A20570E1F3B821A00F6C293 /* test-dwarf.exe */ = {isa = PBXFileReference; lastKnownFileType = file; name = "test-dwarf.exe"; path = "DWARF/Inputs/test-dwarf.exe"; sourceTree = "<group>"; };
- 9A2057131F3B860D00F6C293 /* TestDWARFCallFrameInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestDWARFCallFrameInfo.cpp; sourceTree = "<group>"; };
- 9A2057141F3B860D00F6C293 /* TestType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestType.cpp; sourceTree = "<group>"; };
- 9A20571A1F3B866F00F6C293 /* PlatformDarwinTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PlatformDarwinTest.cpp; path = Platform/PlatformDarwinTest.cpp; sourceTree = "<group>"; };
+ 94CD131819BA33A100DB7BED /* TypeValidator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TypeValidator.h; path = include/lldb/DataFormatters/TypeValidator.h; sourceTree = "<group>"; };
+ 54067BEC1DF2034B00749AA5 /* UBSanRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 2; lastKnownFileType = sourcecode.cpp.cpp; path = UBSanRuntime.cpp; sourceTree = "<group>"; };
+ 54067BED1DF2034B00749AA5 /* UBSanRuntime.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UBSanRuntime.h; sourceTree = "<group>"; };
+ 2579065B1BD0488100178368 /* UDPSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UDPSocket.cpp; sourceTree = "<group>"; };
+ 49CA96EA1E6AAC6600C03FEE /* UUID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UUID.cpp; path = source/Utility/UUID.cpp; sourceTree = "<group>"; };
+ 49CA96F51E6AAC8E00C03FEE /* UUID.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UUID.h; path = include/lldb/Utility/UUID.h; sourceTree = "<group>"; };
+ 268A813F115B19D000F645B0 /* UniqueCStringMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UniqueCStringMap.h; path = include/lldb/Core/UniqueCStringMap.h; sourceTree = "<group>"; };
+ 26B8B42312EEC52A00A831B2 /* UniqueDWARFASTType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UniqueDWARFASTType.cpp; sourceTree = "<group>"; };
+ 26B8B42212EEC52A00A831B2 /* UniqueDWARFASTType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UniqueDWARFASTType.h; sourceTree = "<group>"; };
+ 4C00987011500B4300F316B0 /* UnixSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnixSignals.cpp; path = source/Target/UnixSignals.cpp; sourceTree = "<group>"; };
+ 4C00986F11500B4300F316B0 /* UnixSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnixSignals.h; path = include/lldb/Target/UnixSignals.h; sourceTree = "<group>"; };
9A20571E1F3B8D2100F6C293 /* UnixSignalsTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnixSignalsTest.cpp; path = Signals/UnixSignalsTest.cpp; sourceTree = "<group>"; };
- 9A2057241F3B8DD200F6C293 /* TestELFHeader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestELFHeader.cpp; path = ObjectFile/ELF/TestELFHeader.cpp; sourceTree = "<group>"; };
- 9A2057251F3B8DD200F6C293 /* TestObjectFileELF.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestObjectFileELF.cpp; path = ObjectFile/ELF/TestObjectFileELF.cpp; sourceTree = "<group>"; };
- 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestCompletion.cpp; sourceTree = "<group>"; };
- 9A20572E1F3B8E7600F6C293 /* FileSystemTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystemTest.cpp; sourceTree = "<group>"; };
- 9A20572F1F3B8E7600F6C293 /* HostTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HostTest.cpp; sourceTree = "<group>"; };
- 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainLoopTest.cpp; sourceTree = "<group>"; };
- 9A20573C1F3B8EA200F6C293 /* HostTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HostTest.cpp; path = linux/HostTest.cpp; sourceTree = "<group>"; };
- 9A20573D1F3B8EA200F6C293 /* SupportTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SupportTest.cpp; path = linux/SupportTest.cpp; sourceTree = "<group>"; };
- 9A2057441F3B905C00F6C293 /* debugserver_LogCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debugserver_LogCallback.cpp; path = debugserver/debugserver_LogCallback.cpp; sourceTree = "<group>"; };
- 9A2057451F3B905C00F6C293 /* RNBSocketTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RNBSocketTest.cpp; path = debugserver/RNBSocketTest.cpp; sourceTree = "<group>"; };
- 9A22A15D135E30370024DDC3 /* EmulateInstructionARM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionARM.cpp; sourceTree = "<group>"; };
- 9A22A15E135E30370024DDC3 /* EmulateInstructionARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionARM.h; sourceTree = "<group>"; };
- 9A22A15F135E30370024DDC3 /* EmulationStateARM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulationStateARM.cpp; sourceTree = "<group>"; };
- 9A22A160135E30370024DDC3 /* EmulationStateARM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulationStateARM.h; sourceTree = "<group>"; };
- 9A357582116CFDEE00E8ED2F /* SBValueList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBValueList.h; path = include/lldb/API/SBValueList.h; sourceTree = "<group>"; };
- 9A35758D116CFE0F00E8ED2F /* SBValueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBValueList.cpp; path = source/API/SBValueList.cpp; sourceTree = "<group>"; };
- 9A35765E116E76A700E8ED2F /* StringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StringList.h; path = include/lldb/Utility/StringList.h; sourceTree = "<group>"; };
- 9A35765F116E76B900E8ED2F /* StringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringList.cpp; path = source/Utility/StringList.cpp; sourceTree = "<group>"; };
- 9A357670116E7B5200E8ED2F /* SBStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBStringList.h; path = include/lldb/API/SBStringList.h; sourceTree = "<group>"; };
- 9A357672116E7B6400E8ED2F /* SBStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBStringList.cpp; path = source/API/SBStringList.cpp; sourceTree = "<group>"; };
- 9A3576A7116E9AB700E8ED2F /* SBHostOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBHostOS.h; path = include/lldb/API/SBHostOS.h; sourceTree = "<group>"; };
- 9A3576A9116E9AC700E8ED2F /* SBHostOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBHostOS.cpp; path = source/API/SBHostOS.cpp; sourceTree = "<group>"; };
- 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VASprintfTest.cpp; sourceTree = "<group>"; };
- 9A3D43C51F3150D200EB767C /* TimerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimerTest.cpp; sourceTree = "<group>"; };
- 9A3D43C61F3150D200EB767C /* StatusTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StatusTest.cpp; sourceTree = "<group>"; };
- 9A3D43C71F3150D200EB767C /* LogTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogTest.cpp; sourceTree = "<group>"; };
- 9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConstStringTest.cpp; sourceTree = "<group>"; };
- 9A3D43C91F3150D200EB767C /* TildeExpressionResolverTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TildeExpressionResolverTest.cpp; sourceTree = "<group>"; };
- 9A3D43CA1F3150D200EB767C /* StructuredDataTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StructuredDataTest.cpp; sourceTree = "<group>"; };
- 9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NameMatchesTest.cpp; sourceTree = "<group>"; };
- 9A3D43CC1F3150D200EB767C /* TimeoutTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TimeoutTest.cpp; sourceTree = "<group>"; };
- 9A3D43DF1F31521200EB767C /* StructuredData-basic.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = "StructuredData-basic.json"; sourceTree = "<group>"; };
- 9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StreamCallbackTest.cpp; sourceTree = "<group>"; };
- 9A3D43E21F3237D500EB767C /* StateTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StateTest.cpp; sourceTree = "<group>"; };
- 9A3D43E31F3237D500EB767C /* ListenerTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ListenerTest.cpp; sourceTree = "<group>"; };
- 9A42976111861A9F00FE05CD /* CommandObjectBreakpointCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectBreakpointCommand.h; path = source/Commands/CommandObjectBreakpointCommand.h; sourceTree = "<group>"; };
- 9A42976211861AA600FE05CD /* CommandObjectBreakpointCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectBreakpointCommand.cpp; path = source/Commands/CommandObjectBreakpointCommand.cpp; sourceTree = "<group>"; };
- 9A4633DA11F65D8600955CE1 /* UserSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserSettingsController.h; path = include/lldb/Core/UserSettingsController.h; sourceTree = "<group>"; };
- 9A4633DC11F65D9A00955CE1 /* UserSettingsController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserSettingsController.cpp; path = source/Core/UserSettingsController.cpp; sourceTree = "<group>"; };
- 9A48A3A7124AAA5A00922451 /* python-extensions.swig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "python-extensions.swig"; sourceTree = "<group>"; };
- 9A4F350F1368A51A00823F52 /* StreamAsynchronousIO.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamAsynchronousIO.cpp; path = source/Core/StreamAsynchronousIO.cpp; sourceTree = "<group>"; };
- 9A4F35111368A54100823F52 /* StreamAsynchronousIO.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = StreamAsynchronousIO.h; path = include/lldb/Core/StreamAsynchronousIO.h; sourceTree = "<group>"; };
- 9A633FE7112DCE3C001A7E43 /* SBFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBFrame.cpp; path = source/API/SBFrame.cpp; sourceTree = "<group>"; };
- 9A633FE8112DCE3C001A7E43 /* SBFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBFrame.h; path = include/lldb/API/SBFrame.h; sourceTree = "<group>"; };
- 9A77AD501E64E24E0025CE04 /* RegisterInfoPOSIX_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_arm.cpp; path = Utility/RegisterInfoPOSIX_arm.cpp; sourceTree = "<group>"; };
- 9A77AD511E64E24E0025CE04 /* RegisterInfoPOSIX_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_arm.h; path = Utility/RegisterInfoPOSIX_arm.h; sourceTree = "<group>"; };
- 9A82010B10FFB49800182560 /* ScriptInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScriptInterpreter.cpp; path = source/Interpreter/ScriptInterpreter.cpp; sourceTree = "<group>"; };
- 9A9830F21125FC5800A56CB0 /* SBBroadcaster.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBroadcaster.cpp; path = source/API/SBBroadcaster.cpp; sourceTree = "<group>"; };
- 9A9830F31125FC5800A56CB0 /* SBBroadcaster.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBroadcaster.h; path = include/lldb/API/SBBroadcaster.h; sourceTree = "<group>"; };
- 9A9830F61125FC5800A56CB0 /* SBCommandInterpreter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommandInterpreter.cpp; path = source/API/SBCommandInterpreter.cpp; sourceTree = "<group>"; };
- 9A9830F71125FC5800A56CB0 /* SBCommandInterpreter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommandInterpreter.h; path = include/lldb/API/SBCommandInterpreter.h; sourceTree = "<group>"; };
- 9A9830F81125FC5800A56CB0 /* SBCommandReturnObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBCommandReturnObject.cpp; path = source/API/SBCommandReturnObject.cpp; sourceTree = "<group>"; };
- 9A9830F91125FC5800A56CB0 /* SBCommandReturnObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBCommandReturnObject.h; path = include/lldb/API/SBCommandReturnObject.h; sourceTree = "<group>"; };
- 9A9830FA1125FC5800A56CB0 /* SBDebugger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBDebugger.cpp; path = source/API/SBDebugger.cpp; sourceTree = "<group>"; };
- 9A9830FB1125FC5800A56CB0 /* SBDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDebugger.h; path = include/lldb/API/SBDebugger.h; sourceTree = "<group>"; };
- 9A9830FC1125FC5800A56CB0 /* SBDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBDefines.h; path = include/lldb/API/SBDefines.h; sourceTree = "<group>"; };
- 9A9830FD1125FC5800A56CB0 /* SBEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBEvent.cpp; path = source/API/SBEvent.cpp; sourceTree = "<group>"; };
- 9A9830FE1125FC5800A56CB0 /* SBEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBEvent.h; path = include/lldb/API/SBEvent.h; sourceTree = "<group>"; };
- 9A9831011125FC5800A56CB0 /* SBListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBListener.cpp; path = source/API/SBListener.cpp; sourceTree = "<group>"; };
- 9A9831021125FC5800A56CB0 /* SBListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBListener.h; path = include/lldb/API/SBListener.h; sourceTree = "<group>"; };
- 9A9831031125FC5800A56CB0 /* SBProcess.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBProcess.cpp; path = source/API/SBProcess.cpp; sourceTree = "<group>"; };
- 9A9831041125FC5800A56CB0 /* SBProcess.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBProcess.h; path = include/lldb/API/SBProcess.h; sourceTree = "<group>"; };
- 9A9831051125FC5800A56CB0 /* SBSourceManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBSourceManager.cpp; path = source/API/SBSourceManager.cpp; sourceTree = "<group>"; };
- 9A9831061125FC5800A56CB0 /* SBSourceManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBSourceManager.h; path = include/lldb/API/SBSourceManager.h; sourceTree = "<group>"; };
- 9A9831071125FC5800A56CB0 /* SBTarget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; lineEnding = 0; name = SBTarget.cpp; path = source/API/SBTarget.cpp; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.cpp; };
- 9A9831081125FC5800A56CB0 /* SBTarget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBTarget.h; path = include/lldb/API/SBTarget.h; sourceTree = "<group>"; };
- 9A9831091125FC5800A56CB0 /* SBThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBThread.cpp; path = source/API/SBThread.cpp; sourceTree = "<group>"; };
- 9A98310A1125FC5800A56CB0 /* SBThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBThread.h; path = include/lldb/API/SBThread.h; sourceTree = "<group>"; };
- 9AC7033D11752C4C0086C050 /* AddressResolverFileLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolverFileLine.h; path = include/lldb/Core/AddressResolverFileLine.h; sourceTree = "<group>"; };
- 9AC7033E11752C540086C050 /* AddressResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolver.h; path = include/lldb/Core/AddressResolver.h; sourceTree = "<group>"; };
- 9AC7033F11752C590086C050 /* AddressResolverName.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AddressResolverName.h; path = include/lldb/Core/AddressResolverName.h; sourceTree = "<group>"; };
- 9AC7034011752C6B0086C050 /* AddressResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolver.cpp; path = source/Core/AddressResolver.cpp; sourceTree = "<group>"; };
- 9AC7034211752C720086C050 /* AddressResolverFileLine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolverFileLine.cpp; path = source/Core/AddressResolverFileLine.cpp; sourceTree = "<group>"; };
- 9AC7034411752C790086C050 /* AddressResolverName.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AddressResolverName.cpp; path = source/Core/AddressResolverName.cpp; sourceTree = "<group>"; };
- 9AC7038D117674EB0086C050 /* SBInstruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBInstruction.h; path = include/lldb/API/SBInstruction.h; sourceTree = "<group>"; };
- 9AC7038F117675270086C050 /* SBInstructionList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBInstructionList.h; path = include/lldb/API/SBInstructionList.h; sourceTree = "<group>"; };
- 9AC703AE117675410086C050 /* SBInstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBInstruction.cpp; path = source/API/SBInstruction.cpp; sourceTree = "<group>"; };
- 9AC703B0117675490086C050 /* SBInstructionList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBInstructionList.cpp; path = source/API/SBInstructionList.cpp; sourceTree = "<group>"; };
- 9AD9449B1E8DB267004796ED /* RegisterContextNetBSD_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextNetBSD_x86_64.cpp; path = Utility/RegisterContextNetBSD_x86_64.cpp; sourceTree = "<group>"; };
- 9AD9449C1E8DB267004796ED /* RegisterContextNetBSD_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextNetBSD_x86_64.h; path = Utility/RegisterContextNetBSD_x86_64.h; sourceTree = "<group>"; };
- 9AF16A9C11402D5B007A7B3F /* SBBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpoint.cpp; path = source/API/SBBreakpoint.cpp; sourceTree = "<group>"; };
- 9AF16A9E11402D69007A7B3F /* SBBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpoint.h; path = include/lldb/API/SBBreakpoint.h; sourceTree = "<group>"; };
- 9AF16CC611408686007A7B3F /* SBBreakpointLocation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBBreakpointLocation.h; path = include/lldb/API/SBBreakpointLocation.h; sourceTree = "<group>"; };
- 9AF16CC7114086A1007A7B3F /* SBBreakpointLocation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBBreakpointLocation.cpp; path = source/API/SBBreakpointLocation.cpp; sourceTree = "<group>"; };
- A36FF33B17D8E94600244D40 /* OptionParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OptionParser.cpp; sourceTree = "<group>"; };
- A36FF33D17D8E98800244D40 /* OptionParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OptionParser.h; path = include/lldb/Host/OptionParser.h; sourceTree = "<group>"; };
- AE44FB261BB07DC60033EB62 /* GoAST.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoAST.h; path = ExpressionParser/Go/GoAST.h; sourceTree = "<group>"; };
- AE44FB271BB07DC60033EB62 /* GoLexer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoLexer.h; path = ExpressionParser/Go/GoLexer.h; sourceTree = "<group>"; };
- AE44FB281BB07DC60033EB62 /* GoParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoParser.h; path = ExpressionParser/Go/GoParser.h; sourceTree = "<group>"; };
- AE44FB291BB07DC60033EB62 /* GoUserExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoUserExpression.h; path = ExpressionParser/Go/GoUserExpression.h; sourceTree = "<group>"; };
- AE44FB2A1BB07DD80033EB62 /* GoLexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLexer.cpp; path = ExpressionParser/Go/GoLexer.cpp; sourceTree = "<group>"; };
- AE44FB2B1BB07DD80033EB62 /* GoParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoParser.cpp; path = ExpressionParser/Go/GoParser.cpp; sourceTree = "<group>"; };
- AE44FB2C1BB07DD80033EB62 /* GoUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoUserExpression.cpp; path = ExpressionParser/Go/GoUserExpression.cpp; sourceTree = "<group>"; };
- AE44FB3C1BB4858A0033EB62 /* GoLanguageRuntime.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = GoLanguageRuntime.h; path = Go/GoLanguageRuntime.h; sourceTree = "<group>"; };
- AE44FB3D1BB485960033EB62 /* GoLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLanguageRuntime.cpp; path = Go/GoLanguageRuntime.cpp; sourceTree = "<group>"; };
- AE44FB451BB4BB090033EB62 /* GoLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoLanguage.cpp; path = Language/Go/GoLanguage.cpp; sourceTree = "<group>"; };
- AE44FB461BB4BB090033EB62 /* GoLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoLanguage.h; path = Language/Go/GoLanguage.h; sourceTree = "<group>"; };
- AE44FB4A1BB4BB540033EB62 /* GoFormatterFunctions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoFormatterFunctions.cpp; path = Language/Go/GoFormatterFunctions.cpp; sourceTree = "<group>"; };
- AE44FB4B1BB4BB540033EB62 /* GoFormatterFunctions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoFormatterFunctions.h; path = Language/Go/GoFormatterFunctions.h; sourceTree = "<group>"; };
- AE6897261B94F6DE0018845D /* DWARFASTParserGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DWARFASTParserGo.cpp; sourceTree = "<group>"; };
- AE6897271B94F6DE0018845D /* DWARFASTParserGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DWARFASTParserGo.h; sourceTree = "<group>"; };
- AE8F624719EF3E1E00326B21 /* OperatingSystemGo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OperatingSystemGo.cpp; path = Go/OperatingSystemGo.cpp; sourceTree = "<group>"; };
- AE8F624819EF3E1E00326B21 /* OperatingSystemGo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = OperatingSystemGo.h; path = Go/OperatingSystemGo.h; sourceTree = "<group>"; };
- AEB0E4581BD6E9F800B24093 /* LLVMUserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LLVMUserExpression.cpp; path = source/Expression/LLVMUserExpression.cpp; sourceTree = "<group>"; };
- AEB0E45A1BD6EA1400B24093 /* LLVMUserExpression.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = LLVMUserExpression.h; path = include/lldb/Expression/LLVMUserExpression.h; sourceTree = "<group>"; };
- AEC6FF9F1BE970A2007882C1 /* GoParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GoParserTest.cpp; sourceTree = "<group>"; };
- AEEA33F61AC74FE700AB639D /* TypeSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TypeSystem.h; path = include/lldb/Symbol/TypeSystem.h; sourceTree = "<group>"; };
- AEEA34041AC88A7400AB639D /* TypeSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TypeSystem.cpp; path = source/Symbol/TypeSystem.cpp; sourceTree = "<group>"; };
- AEEA340F1ACA08A000AB639D /* GoASTContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GoASTContext.h; path = include/lldb/Symbol/GoASTContext.h; sourceTree = "<group>"; };
- AEFFBA7C1AC4835D0087B932 /* GoASTContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GoASTContext.cpp; path = source/Symbol/GoASTContext.cpp; sourceTree = "<group>"; };
- AF061F85182C97ED00B6A19C /* RegisterContextHistory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextHistory.cpp; path = Utility/RegisterContextHistory.cpp; sourceTree = "<group>"; };
- AF061F86182C97ED00B6A19C /* RegisterContextHistory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextHistory.h; path = Utility/RegisterContextHistory.h; sourceTree = "<group>"; };
- AF061F89182C980000B6A19C /* HistoryThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryThread.h; path = Utility/HistoryThread.h; sourceTree = "<group>"; };
- AF061F8A182C980000B6A19C /* HistoryUnwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = HistoryUnwind.h; path = Utility/HistoryUnwind.h; sourceTree = "<group>"; };
- AF0C112718580CD800C4C45B /* QueueItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QueueItem.cpp; path = source/Target/QueueItem.cpp; sourceTree = "<group>"; };
- AF0E22EE18A09FB20009B7D1 /* AppleGetItemInfoHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetItemInfoHandler.cpp; sourceTree = "<group>"; };
- AF0E22EF18A09FB20009B7D1 /* AppleGetItemInfoHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetItemInfoHandler.h; sourceTree = "<group>"; };
- AF0EBBE6185940FB0059E52F /* SBQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBQueue.cpp; path = source/API/SBQueue.cpp; sourceTree = "<group>"; };
- AF0EBBE7185940FB0059E52F /* SBQueueItem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBQueueItem.cpp; path = source/API/SBQueueItem.cpp; sourceTree = "<group>"; };
- AF0EBBEA185941360059E52F /* SBQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueue.h; path = include/lldb/API/SBQueue.h; sourceTree = "<group>"; };
- AF0EBBEB185941360059E52F /* SBQueueItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBQueueItem.h; path = include/lldb/API/SBQueueItem.h; sourceTree = "<group>"; };
- AF0EBBEE1859419F0059E52F /* SBQueue.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueue.i; sourceTree = "<group>"; };
- AF0EBBEF1859419F0059E52F /* SBQueueItem.i */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBQueueItem.i; sourceTree = "<group>"; };
- AF0F6E4E1739A76D009180FE /* RegisterContextKDP_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextKDP_arm64.cpp; sourceTree = "<group>"; };
- AF0F6E4F1739A76D009180FE /* RegisterContextKDP_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextKDP_arm64.h; sourceTree = "<group>"; };
- AF1729D4182C907200E0AB97 /* HistoryThread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HistoryThread.cpp; path = Utility/HistoryThread.cpp; sourceTree = "<group>"; };
- AF1729D5182C907200E0AB97 /* HistoryUnwind.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = HistoryUnwind.cpp; path = Utility/HistoryUnwind.cpp; sourceTree = "<group>"; };
- AF1F7B05189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetPendingItemsHandler.cpp; sourceTree = "<group>"; };
- AF1F7B06189C904B0087DB9C /* AppleGetPendingItemsHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetPendingItemsHandler.h; sourceTree = "<group>"; };
- AF20F7641AF18F8500751A6E /* ABISysV_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_arm.cpp; path = "SysV-arm/ABISysV_arm.cpp"; sourceTree = "<group>"; };
- AF20F7651AF18F8500751A6E /* ABISysV_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_arm.h; path = "SysV-arm/ABISysV_arm.h"; sourceTree = "<group>"; };
- AF20F7681AF18F9000751A6E /* ABISysV_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_arm64.cpp; path = "SysV-arm64/ABISysV_arm64.cpp"; sourceTree = "<group>"; };
- AF20F7691AF18F9000751A6E /* ABISysV_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_arm64.h; path = "SysV-arm64/ABISysV_arm64.h"; sourceTree = "<group>"; };
- AF20F76C1AF18FC700751A6E /* SBLanguageRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBLanguageRuntime.cpp; path = source/API/SBLanguageRuntime.cpp; sourceTree = "<group>"; };
- AF235EAE1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_ppc64le.cpp; path = Utility/RegisterContextPOSIX_ppc64le.cpp; sourceTree = "<group>"; };
- AF235EAF1FBE77B6009C5541 /* RegisterContextPOSIX_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_ppc64le.h; path = Utility/RegisterContextPOSIX_ppc64le.h; sourceTree = "<group>"; };
- AF235EB21FBE7857009C5541 /* RegisterInfoPOSIX_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfoPOSIX_ppc64le.h; path = Utility/RegisterInfoPOSIX_ppc64le.h; sourceTree = "<group>"; };
- AF235EB31FBE7858009C5541 /* RegisterInfoPOSIX_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterInfoPOSIX_ppc64le.cpp; path = Utility/RegisterInfoPOSIX_ppc64le.cpp; sourceTree = "<group>"; };
- AF23B4D919009C66003E2A58 /* FreeBSDSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FreeBSDSignals.cpp; path = Utility/FreeBSDSignals.cpp; sourceTree = "<group>"; };
- AF23B4DA19009C66003E2A58 /* FreeBSDSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FreeBSDSignals.h; path = Utility/FreeBSDSignals.h; sourceTree = "<group>"; };
- AF248A4C1DA71C77000B814D /* TestArm64InstEmulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TestArm64InstEmulation.cpp; path = UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp; sourceTree = "<group>"; };
- AF254E2F170CCC33007AE5C9 /* PlatformDarwinKernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformDarwinKernel.cpp; sourceTree = "<group>"; };
- AF254E30170CCC33007AE5C9 /* PlatformDarwinKernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformDarwinKernel.h; sourceTree = "<group>"; };
- AF25AB24188F685C0030DEC3 /* AppleGetQueuesHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetQueuesHandler.cpp; sourceTree = "<group>"; };
- AF25AB25188F685C0030DEC3 /* AppleGetQueuesHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetQueuesHandler.h; sourceTree = "<group>"; };
- AF2670381852D01E00B6CC36 /* Queue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Queue.cpp; path = source/Target/Queue.cpp; sourceTree = "<group>"; };
- AF2670391852D01E00B6CC36 /* QueueList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = QueueList.cpp; path = source/Target/QueueList.cpp; sourceTree = "<group>"; };
- AF27AD531D3603EA00CF2833 /* DynamicLoaderDarwin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderDarwin.cpp; sourceTree = "<group>"; };
- AF27AD541D3603EA00CF2833 /* DynamicLoaderDarwin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderDarwin.h; sourceTree = "<group>"; };
- AF2907BD1D3F082400E10654 /* DynamicLoaderMacOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DynamicLoaderMacOS.cpp; sourceTree = "<group>"; };
- AF2907BE1D3F082400E10654 /* DynamicLoaderMacOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DynamicLoaderMacOS.h; sourceTree = "<group>"; };
- AF2BCA6918C7EFDE005B4526 /* JITLoaderGDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITLoaderGDB.cpp; sourceTree = "<group>"; };
- AF2BCA6A18C7EFDE005B4526 /* JITLoaderGDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITLoaderGDB.h; sourceTree = "<group>"; };
- AF2E02A11FA2CEAF00A86C34 /* ArchitectureArm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ArchitectureArm.cpp; sourceTree = "<group>"; };
- AF2E02A21FA2CEAF00A86C34 /* ArchitectureArm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArchitectureArm.h; sourceTree = "<group>"; };
- AF33B4BC1C1FA441001B28D9 /* NetBSDSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = NetBSDSignals.cpp; path = Utility/NetBSDSignals.cpp; sourceTree = "<group>"; };
- AF33B4BD1C1FA441001B28D9 /* NetBSDSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = NetBSDSignals.h; path = Utility/NetBSDSignals.h; sourceTree = "<group>"; };
- AF37E10917C861F20061E18E /* ProcessRunLock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ProcessRunLock.cpp; sourceTree = "<group>"; };
- AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteDarwinDevice.cpp; sourceTree = "<group>"; };
- AF3A4AD11EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteDarwinDevice.h; sourceTree = "<group>"; };
- AF3F54AE1B3BA59C00186E73 /* CrashReason.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CrashReason.cpp; sourceTree = "<group>"; };
- AF3F54AF1B3BA59C00186E73 /* CrashReason.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CrashReason.h; sourceTree = "<group>"; };
- AF3F54B21B3BA5D500186E73 /* POSIXStopInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = POSIXStopInfo.cpp; sourceTree = "<group>"; };
- AF3F54B31B3BA5D500186E73 /* POSIXStopInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = POSIXStopInfo.h; sourceTree = "<group>"; };
- AF3F54B81B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_arm.cpp; sourceTree = "<group>"; };
- AF3F54B91B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_arm.h; sourceTree = "<group>"; };
- AF3F54BA1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_arm64.cpp; sourceTree = "<group>"; };
- AF3F54BB1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_arm64.h; sourceTree = "<group>"; };
- AF3F54BC1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_mips64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_mips64.cpp; sourceTree = "<group>"; };
- AF3F54BD1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_mips64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_mips64.h; sourceTree = "<group>"; };
- AF3F54BE1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_powerpc.cpp; sourceTree = "<group>"; };
- AF3F54BF1B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_powerpc.h; sourceTree = "<group>"; };
- AF3F54C01B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_x86.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXProcessMonitor_x86.cpp; sourceTree = "<group>"; };
- AF3F54C11B3BA5D500186E73 /* RegisterContextPOSIXProcessMonitor_x86.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXProcessMonitor_x86.h; sourceTree = "<group>"; };
- AF415AE51D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = x86AssemblyInspectionEngine.cpp; sourceTree = "<group>"; };
- AF415AE61D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x86AssemblyInspectionEngine.h; sourceTree = "<group>"; };
- AF45E1FC1BF57C8D000563EB /* PythonTestSuite.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PythonTestSuite.cpp; sourceTree = "<group>"; };
- AF45E1FD1BF57C8D000563EB /* PythonTestSuite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PythonTestSuite.h; sourceTree = "<group>"; };
- AF45FDE318A1F3AC0007051C /* AppleGetThreadItemInfoHandler.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppleGetThreadItemInfoHandler.cpp; sourceTree = "<group>"; };
- AF45FDE418A1F3AC0007051C /* AppleGetThreadItemInfoHandler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppleGetThreadItemInfoHandler.h; sourceTree = "<group>"; };
- AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolFilePDB.cpp; path = PDB/SymbolFilePDB.cpp; sourceTree = "<group>"; };
- AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SymbolFilePDB.h; path = PDB/SymbolFilePDB.h; sourceTree = "<group>"; };
- AF68D2541255416E002FF25B /* RegisterContextLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextLLDB.cpp; path = Utility/RegisterContextLLDB.cpp; sourceTree = "<group>"; };
- AF68D2551255416E002FF25B /* RegisterContextLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextLLDB.h; path = Utility/RegisterContextLLDB.h; sourceTree = "<group>"; };
+ 26E3EEBD11A9870400FBADB6 /* Unwind.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Unwind.h; path = include/lldb/Target/Unwind.h; sourceTree = "<group>"; };
+ 263E949D13661AE400E7D1CE /* UnwindAssembly-x86.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = "UnwindAssembly-x86.cpp"; sourceTree = "<group>"; };
+ 263E949E13661AE400E7D1CE /* UnwindAssembly-x86.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UnwindAssembly-x86.h"; sourceTree = "<group>"; };
+ 264D8D4F13661BD7003A368F /* UnwindAssembly.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindAssembly.cpp; path = source/Target/UnwindAssembly.cpp; sourceTree = "<group>"; };
+ 264D8D4E13661BCC003A368F /* UnwindAssembly.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UnwindAssembly.h; path = include/lldb/Target/UnwindAssembly.h; sourceTree = "<group>"; };
+ 2692BA13136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UnwindAssemblyInstEmulation.cpp; sourceTree = "<group>"; };
+ 2692BA14136610C100F9E14D /* UnwindAssemblyInstEmulation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UnwindAssemblyInstEmulation.h; sourceTree = "<group>"; };
AF68D32F1255A110002FF25B /* UnwindLLDB.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindLLDB.cpp; path = Utility/UnwindLLDB.cpp; sourceTree = "<group>"; };
AF68D3301255A110002FF25B /* UnwindLLDB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindLLDB.h; path = Utility/UnwindLLDB.h; sourceTree = "<group>"; };
- AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ArchSpec.cpp; path = source/Utility/ArchSpec.cpp; sourceTree = "<group>"; };
- AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ArchSpec.h; path = include/lldb/Utility/ArchSpec.h; sourceTree = "<group>"; };
- AF77E08D1A033C700096C0EA /* ABISysV_ppc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_ppc.cpp; path = "SysV-ppc/ABISysV_ppc.cpp"; sourceTree = "<group>"; };
- AF77E08E1A033C700096C0EA /* ABISysV_ppc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_ppc.h; path = "SysV-ppc/ABISysV_ppc.h"; sourceTree = "<group>"; };
- AF77E0911A033C7F0096C0EA /* ABISysV_ppc64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ABISysV_ppc64.cpp; path = "SysV-ppc64/ABISysV_ppc64.cpp"; sourceTree = "<group>"; };
- AF77E0921A033C7F0096C0EA /* ABISysV_ppc64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ABISysV_ppc64.h; path = "SysV-ppc64/ABISysV_ppc64.h"; sourceTree = "<group>"; };
- AF77E0991A033D360096C0EA /* RegisterContext_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContext_powerpc.h; path = Utility/RegisterContext_powerpc.h; sourceTree = "<group>"; };
- AF77E09A1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextFreeBSD_powerpc.cpp; path = Utility/RegisterContextFreeBSD_powerpc.cpp; sourceTree = "<group>"; };
- AF77E09B1A033D360096C0EA /* RegisterContextFreeBSD_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextFreeBSD_powerpc.h; path = Utility/RegisterContextFreeBSD_powerpc.h; sourceTree = "<group>"; };
- AF77E09C1A033D360096C0EA /* RegisterContextMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextMacOSXFrameBackchain.cpp; path = Utility/RegisterContextMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
- AF77E09D1A033D360096C0EA /* RegisterContextPOSIX_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_powerpc.cpp; path = Utility/RegisterContextPOSIX_powerpc.cpp; sourceTree = "<group>"; };
- AF77E09E1A033D360096C0EA /* RegisterContextPOSIX_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_powerpc.h; path = Utility/RegisterContextPOSIX_powerpc.h; sourceTree = "<group>"; };
- AF77E09F1A033D360096C0EA /* RegisterInfos_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterInfos_powerpc.h; path = Utility/RegisterInfos_powerpc.h; sourceTree = "<group>"; };
- AF77E0A71A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_powerpc.cpp; sourceTree = "<group>"; };
- AF77E0A81A033D740096C0EA /* RegisterContextPOSIXCore_powerpc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_powerpc.h; sourceTree = "<group>"; };
- AF81DEF91828A23F0042CF19 /* SystemRuntime.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SystemRuntime.cpp; path = source/Target/SystemRuntime.cpp; sourceTree = "<group>"; };
- AF8AD62A1BEC28A400150209 /* PlatformAppleTVSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleTVSimulator.cpp; sourceTree = "<group>"; };
- AF8AD62B1BEC28A400150209 /* PlatformAppleTVSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformAppleTVSimulator.h; sourceTree = "<group>"; };
- AF8AD62C1BEC28A400150209 /* PlatformAppleWatchSimulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformAppleWatchSimulator.cpp; sourceTree = "<group>"; };
- AF8AD62D1BEC28A400150209 /* PlatformAppleWatchSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformAppleWatchSimulator.h; sourceTree = "<group>"; };
- AF8AD6331BEC28C400150209 /* PlatformRemoteAppleTV.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteAppleTV.cpp; sourceTree = "<group>"; };
- AF8AD6341BEC28C400150209 /* PlatformRemoteAppleTV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteAppleTV.h; sourceTree = "<group>"; };
- AF8AD6351BEC28C400150209 /* PlatformRemoteAppleWatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformRemoteAppleWatch.cpp; sourceTree = "<group>"; };
- AF8AD6361BEC28C400150209 /* PlatformRemoteAppleWatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformRemoteAppleWatch.h; sourceTree = "<group>"; };
- AF90106315AB7C5700FF120D /* lldb.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = lldb.1; path = docs/lldb.1; sourceTree = "<group>"; };
- AF9107EC168570D200DBCD3C /* RegisterContextDarwin_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextDarwin_arm64.cpp; path = Utility/RegisterContextDarwin_arm64.cpp; sourceTree = "<group>"; };
- AF9107ED168570D200DBCD3C /* RegisterContextDarwin_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextDarwin_arm64.h; path = Utility/RegisterContextDarwin_arm64.h; sourceTree = "<group>"; };
- AF9113FB1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_ppc64le.cpp; sourceTree = "<group>"; };
- AF9113FC1FBE78EA004320CD /* RegisterContextPOSIXCore_ppc64le.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_ppc64le.h; sourceTree = "<group>"; };
- AF94005711C03F6500085DB9 /* SymbolVendor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SymbolVendor.cpp; path = source/Symbol/SymbolVendor.cpp; sourceTree = "<group>"; };
- AF94726E1B575E430063D65C /* ValueObjectConstResultCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultCast.cpp; path = source/Core/ValueObjectConstResultCast.cpp; sourceTree = "<group>"; };
- AF9472701B575E5F0063D65C /* ValueObjectConstResultCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultCast.h; path = include/lldb/Core/ValueObjectConstResultCast.h; sourceTree = "<group>"; };
- AF9B8F31182DB52900DA866F /* SystemRuntimeMacOSX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemRuntimeMacOSX.cpp; sourceTree = "<group>"; };
- AF9B8F32182DB52900DA866F /* SystemRuntimeMacOSX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SystemRuntimeMacOSX.h; sourceTree = "<group>"; };
- AF9FF1F41FAA79A400474976 /* LibCxxTuple.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxTuple.cpp; path = Language/CPlusPlus/LibCxxTuple.cpp; sourceTree = "<group>"; };
- AF9FF1F61FAA79FE00474976 /* LibCxxQueue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxQueue.cpp; path = Language/CPlusPlus/LibCxxQueue.cpp; sourceTree = "<group>"; };
- AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ModuleCacheTest.cpp; path = Target/ModuleCacheTest.cpp; sourceTree = "<group>"; };
- AFB3D27E1AC262AB003B4B30 /* MICmdCmdGdbShow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MICmdCmdGdbShow.cpp; path = "tools/lldb-mi/MICmdCmdGdbShow.cpp"; sourceTree = SOURCE_ROOT; };
- AFB3D27F1AC262AB003B4B30 /* MICmdCmdGdbShow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MICmdCmdGdbShow.h; path = "tools/lldb-mi/MICmdCmdGdbShow.h"; sourceTree = SOURCE_ROOT; };
- AFC234061AF85CE000CDE8B6 /* CommandObjectLanguage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectLanguage.cpp; path = source/Commands/CommandObjectLanguage.cpp; sourceTree = "<group>"; };
- AFC234071AF85CE000CDE8B6 /* CommandObjectLanguage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectLanguage.h; path = source/Commands/CommandObjectLanguage.h; sourceTree = "<group>"; };
- AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FastDemangle.cpp; path = source/Utility/FastDemangle.cpp; sourceTree = "<group>"; };
- AFC2DCE81E6E2F2C00283714 /* Baton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Baton.cpp; path = source/Utility/Baton.cpp; sourceTree = "<group>"; };
+ 26E3EEE311A9901300FBADB6 /* UnwindMacOSXFrameBackchain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindMacOSXFrameBackchain.cpp; path = Utility/UnwindMacOSXFrameBackchain.cpp; sourceTree = "<group>"; };
+ 26E3EEE411A9901300FBADB6 /* UnwindMacOSXFrameBackchain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindMacOSXFrameBackchain.h; path = Utility/UnwindMacOSXFrameBackchain.h; sourceTree = "<group>"; };
+ 961FABB91235DE1600F93A47 /* UnwindPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindPlan.cpp; path = source/Symbol/UnwindPlan.cpp; sourceTree = "<group>"; };
+ 269FF07F12494F8E00225026 /* UnwindPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindPlan.h; path = include/lldb/Symbol/UnwindPlan.h; sourceTree = "<group>"; };
+ 961FABBA1235DE1600F93A47 /* UnwindTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UnwindTable.cpp; path = source/Symbol/UnwindTable.cpp; sourceTree = "<group>"; };
+ 269FF08112494FC200225026 /* UnwindTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UnwindTable.h; path = include/lldb/Symbol/UnwindTable.h; sourceTree = "<group>"; };
+ 33064C991A5C7A330033D415 /* UriParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UriParser.cpp; path = source/Utility/UriParser.cpp; sourceTree = "<group>"; };
+ 2654A6911E552F3C00DA1013 /* UriParser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UriParser.h; path = include/lldb/Utility/UriParser.h; sourceTree = "<group>"; };
+ 2321F9461BDD346100BA9A93 /* UriParserTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UriParserTest.cpp; sourceTree = "<group>"; };
+ 4C0083331B9A5DE200D5CF24 /* UserExpression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserExpression.cpp; path = source/Expression/UserExpression.cpp; sourceTree = "<group>"; };
+ 4C00832E1B9A58A700D5CF24 /* UserExpression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserExpression.h; path = include/lldb/Expression/UserExpression.h; sourceTree = "<group>"; };
AFC2DCEA1E6E2F7D00283714 /* UserID.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserID.cpp; path = source/Utility/UserID.cpp; sourceTree = "<group>"; };
AFC2DCEC1E6E2F8C00283714 /* UserID.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = UserID.h; path = include/lldb/Utility/UserID.h; sourceTree = "<group>"; };
- AFC2DCED1E6E2F9800283714 /* FastDemangle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = FastDemangle.h; path = include/lldb/Utility/FastDemangle.h; sourceTree = "<group>"; };
- AFC2DCEE1E6E2FA300283714 /* Baton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Baton.h; path = include/lldb/Utility/Baton.h; sourceTree = "<group>"; };
+ 9A4633DC11F65D9A00955CE1 /* UserSettingsController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UserSettingsController.cpp; path = source/Core/UserSettingsController.cpp; sourceTree = "<group>"; };
+ 9A4633DA11F65D8600955CE1 /* UserSettingsController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UserSettingsController.h; path = include/lldb/Core/UserSettingsController.h; sourceTree = "<group>"; };
+ 4C00833F1B9F9BA900D5CF24 /* UtilityFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = UtilityFunction.cpp; path = source/Expression/UtilityFunction.cpp; sourceTree = "<group>"; };
+ 4C00833D1B9F9B8400D5CF24 /* UtilityFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UtilityFunction.h; path = include/lldb/Expression/UtilityFunction.h; sourceTree = "<group>"; };
+ 2654A6921E552F4600DA1013 /* VASPrintf.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VASPrintf.h; path = include/lldb/Utility/VASPrintf.h; sourceTree = "<group>"; };
+ 2654A68F1E552ED500DA1013 /* VASprintf.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VASprintf.cpp; path = source/Utility/VASprintf.cpp; sourceTree = "<group>"; };
+ 9A3D43C41F3150D200EB767C /* VASprintfTest.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VASprintfTest.cpp; sourceTree = "<group>"; };
AFC2DCEF1E6E2FD200283714 /* VMRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VMRange.cpp; path = source/Utility/VMRange.cpp; sourceTree = "<group>"; };
AFC2DCF11E6E2FDA00283714 /* VMRange.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VMRange.h; path = include/lldb/Utility/VMRange.h; sourceTree = "<group>"; };
- AFC2DCF21E6E30CF00283714 /* History.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = History.cpp; path = source/Utility/History.cpp; sourceTree = "<group>"; };
- AFC2DCF41E6E30D800283714 /* History.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = History.h; path = include/lldb/Utility/History.h; sourceTree = "<group>"; };
- AFC2DCF51E6E316A00283714 /* StreamCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamCallback.cpp; path = source/Utility/StreamCallback.cpp; sourceTree = "<group>"; };
- AFC2DCF71E6E316F00283714 /* StreamCallback.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamCallback.h; path = include/lldb/Utility/StreamCallback.h; sourceTree = "<group>"; };
- AFC2DCF81E6E318000283714 /* StreamGDBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StreamGDBRemote.cpp; path = source/Utility/StreamGDBRemote.cpp; sourceTree = "<group>"; };
- AFC2DCFA1E6E318600283714 /* StreamGDBRemote.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = StreamGDBRemote.h; path = include/lldb/Utility/StreamGDBRemote.h; sourceTree = "<group>"; };
- AFC67B141FBBB03500860ECB /* LibCxxBitset.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LibCxxBitset.cpp; path = Language/CPlusPlus/LibCxxBitset.cpp; sourceTree = "<group>"; };
- AFCB2BBB1BF577F40018B553 /* PythonExceptionState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PythonExceptionState.cpp; path = ScriptInterpreter/Python/PythonExceptionState.cpp; sourceTree = "<group>"; };
- AFCB2BBC1BF577F40018B553 /* PythonExceptionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PythonExceptionState.h; path = ScriptInterpreter/Python/PythonExceptionState.h; sourceTree = "<group>"; };
- AFD65C7F1D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextMinidump_x86_64.cpp; sourceTree = "<group>"; };
- AFD65C801D9B5B2E00D93120 /* RegisterContextMinidump_x86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextMinidump_x86_64.h; sourceTree = "<group>"; };
- AFDFDFD019E34D3400EAE509 /* ConnectionFileDescriptorPosix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ConnectionFileDescriptorPosix.cpp; sourceTree = "<group>"; };
- AFEC3361194A8ABA00FF05C6 /* StructuredData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StructuredData.cpp; path = source/Utility/StructuredData.cpp; sourceTree = "<group>"; };
- AFEC5FD51D94F9380076A480 /* Testx86AssemblyInspectionEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Testx86AssemblyInspectionEngine.cpp; path = UnwindAssembly/x86/Testx86AssemblyInspectionEngine.cpp; sourceTree = "<group>"; };
- AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.plist; path = tools/debugserver/source/com.apple.debugserver.plist; sourceTree = "<group>"; };
- AFF87C8A150FF677000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
- AFF87C8C150FF680000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
- AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
- AFF8FF0B1E779D4B003830EF /* TildeExpressionResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TildeExpressionResolver.cpp; path = source/Utility/TildeExpressionResolver.cpp; sourceTree = "<group>"; };
- AFF8FF0D1E779D51003830EF /* TildeExpressionResolver.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = TildeExpressionResolver.h; path = include/lldb/Utility/TildeExpressionResolver.h; sourceTree = "<group>"; };
- B207C4921429607D00F36E4E /* CommandObjectWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpoint.cpp; path = source/Commands/CommandObjectWatchpoint.cpp; sourceTree = "<group>"; };
- B207C4941429609C00F36E4E /* CommandObjectWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpoint.h; path = source/Commands/CommandObjectWatchpoint.h; sourceTree = "<group>"; };
- B23DD24F12EDFAC1000C3894 /* ARMUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMUtils.h; path = Utility/ARMUtils.h; sourceTree = "<group>"; };
- B2462246141AD37D00F3D409 /* OptionGroupWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = OptionGroupWatchpoint.cpp; path = source/Interpreter/OptionGroupWatchpoint.cpp; sourceTree = "<group>"; };
- B2462248141AD39B00F3D409 /* OptionGroupWatchpoint.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = OptionGroupWatchpoint.h; path = include/lldb/Interpreter/OptionGroupWatchpoint.h; sourceTree = "<group>"; };
+ 26BC7E9910F1B85900F91463 /* Value.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Value.cpp; path = source/Core/Value.cpp; sourceTree = "<group>"; };
+ 26BC7D8110F1B77400F91463 /* Value.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Value.h; path = include/lldb/Core/Value.h; sourceTree = "<group>"; };
+ 26BC7E9A10F1B85900F91463 /* ValueObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObject.cpp; path = source/Core/ValueObject.cpp; sourceTree = "<group>"; };
+ 26BC7D8210F1B77400F91463 /* ValueObject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObject.h; path = include/lldb/Core/ValueObject.h; sourceTree = "<group>"; };
+ 94094C69163B6CD90083A547 /* ValueObjectCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectCast.cpp; path = source/Core/ValueObjectCast.cpp; sourceTree = "<group>"; };
+ 94094C68163B6CCC0083A547 /* ValueObjectCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectCast.h; path = include/lldb/Core/ValueObjectCast.h; sourceTree = "<group>"; };
+ 26BC7E9B10F1B85900F91463 /* ValueObjectChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectChild.cpp; path = source/Core/ValueObjectChild.cpp; sourceTree = "<group>"; };
+ 26BC7D8310F1B77400F91463 /* ValueObjectChild.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectChild.h; path = include/lldb/Core/ValueObjectChild.h; sourceTree = "<group>"; };
+ 26424E3C125986CB0016D82C /* ValueObjectConstResult.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResult.cpp; path = source/Core/ValueObjectConstResult.cpp; sourceTree = "<group>"; };
+ 26424E3E125986D30016D82C /* ValueObjectConstResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResult.h; path = include/lldb/Core/ValueObjectConstResult.h; sourceTree = "<group>"; };
+ AF94726E1B575E430063D65C /* ValueObjectConstResultCast.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultCast.cpp; path = source/Core/ValueObjectConstResultCast.cpp; sourceTree = "<group>"; };
+ AF9472701B575E5F0063D65C /* ValueObjectConstResultCast.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultCast.h; path = include/lldb/Core/ValueObjectConstResultCast.h; sourceTree = "<group>"; };
+ 94FA3DDF1405D50300833217 /* ValueObjectConstResultChild.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultChild.cpp; path = source/Core/ValueObjectConstResultChild.cpp; sourceTree = "<group>"; };
+ 94FA3DDD1405D4E500833217 /* ValueObjectConstResultChild.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultChild.h; path = include/lldb/Core/ValueObjectConstResultChild.h; sourceTree = "<group>"; };
+ 949ADF021406F648004833E1 /* ValueObjectConstResultImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectConstResultImpl.cpp; path = source/Core/ValueObjectConstResultImpl.cpp; sourceTree = "<group>"; };
+ 949ADF001406F62E004833E1 /* ValueObjectConstResultImpl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectConstResultImpl.h; path = include/lldb/Core/ValueObjectConstResultImpl.h; sourceTree = "<group>"; };
+ 4CD0BD0E134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectDynamicValue.cpp; path = source/Core/ValueObjectDynamicValue.cpp; sourceTree = "<group>"; };
+ 4CD0BD0C134BFAB600CB44D4 /* ValueObjectDynamicValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectDynamicValue.h; path = include/lldb/Core/ValueObjectDynamicValue.h; sourceTree = "<group>"; };
+ 26BC7E9C10F1B85900F91463 /* ValueObjectList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectList.cpp; path = source/Core/ValueObjectList.cpp; sourceTree = "<group>"; };
+ 26BC7D8410F1B77400F91463 /* ValueObjectList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectList.h; path = include/lldb/Core/ValueObjectList.h; sourceTree = "<group>"; };
+ 4CABA9DF134A8BCD00539BDD /* ValueObjectMemory.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectMemory.cpp; path = source/Core/ValueObjectMemory.cpp; sourceTree = "<group>"; };
+ 4CABA9DC134A8BA700539BDD /* ValueObjectMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectMemory.h; path = include/lldb/Core/ValueObjectMemory.h; sourceTree = "<group>"; };
+ 945215DE17F639EE00521C0B /* ValueObjectPrinter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectPrinter.cpp; path = source/DataFormatters/ValueObjectPrinter.cpp; sourceTree = "<group>"; };
+ 945215DD17F639E600521C0B /* ValueObjectPrinter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectPrinter.h; path = include/lldb/DataFormatters/ValueObjectPrinter.h; sourceTree = "<group>"; };
+ 264334381110F63100CDB6C6 /* ValueObjectRegister.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectRegister.cpp; path = source/Core/ValueObjectRegister.cpp; sourceTree = "<group>"; };
+ 2643343A1110F63C00CDB6C6 /* ValueObjectRegister.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectRegister.h; path = include/lldb/Core/ValueObjectRegister.h; sourceTree = "<group>"; };
+ 94B6E76113D88362005F417F /* ValueObjectSyntheticFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectSyntheticFilter.cpp; path = source/Core/ValueObjectSyntheticFilter.cpp; sourceTree = "<group>"; };
+ 94B6E76013D8833C005F417F /* ValueObjectSyntheticFilter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ValueObjectSyntheticFilter.h; path = include/lldb/Core/ValueObjectSyntheticFilter.h; sourceTree = "<group>"; };
+ 26BC7E9D10F1B85900F91463 /* ValueObjectVariable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ValueObjectVariable.cpp; path = source/Core/ValueObjectVariable.cpp; sourceTree = "<group>"; };
+ 26BC7D8510F1B77400F91463 /* ValueObjectVariable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ValueObjectVariable.h; path = include/lldb/Core/ValueObjectVariable.h; sourceTree = "<group>"; };
+ 26BC7F2210F1B8EC00F91463 /* Variable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Variable.cpp; path = source/Symbol/Variable.cpp; sourceTree = "<group>"; };
+ 26BC7C6710F1B6E900F91463 /* Variable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Variable.h; path = include/lldb/Symbol/Variable.h; sourceTree = "<group>"; };
+ 26BC7F2310F1B8EC00F91463 /* VariableList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VariableList.cpp; path = source/Symbol/VariableList.cpp; sourceTree = "<group>"; };
+ 26BC7C6810F1B6E900F91463 /* VariableList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VariableList.h; path = include/lldb/Symbol/VariableList.h; sourceTree = "<group>"; };
+ 943B90FC1B991586007BA499 /* VectorIterator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VectorIterator.h; path = include/lldb/DataFormatters/VectorIterator.h; sourceTree = "<group>"; };
+ 9418EBCC1AA910910058B02E /* VectorType.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VectorType.cpp; path = source/DataFormatters/VectorType.cpp; sourceTree = "<group>"; };
+ 9418EBCB1AA9108B0058B02E /* VectorType.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VectorType.h; path = include/lldb/DataFormatters/VectorType.h; sourceTree = "<group>"; };
+ 494260D914579144003C1C78 /* VerifyDecl.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VerifyDecl.cpp; path = source/Symbol/VerifyDecl.cpp; sourceTree = "<group>"; };
+ 494260D7145790D5003C1C78 /* VerifyDecl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = VerifyDecl.h; path = include/lldb/Symbol/VerifyDecl.h; sourceTree = "<group>"; };
+ 26BC7E1810F1B83100F91463 /* Watchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Watchpoint.cpp; path = source/Breakpoint/Watchpoint.cpp; sourceTree = "<group>"; };
+ 26BC7CFC10F1B71400F91463 /* Watchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Watchpoint.h; path = include/lldb/Breakpoint/Watchpoint.h; sourceTree = "<group>"; };
B27318411416AC12006039C8 /* WatchpointList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WatchpointList.cpp; path = source/Breakpoint/WatchpointList.cpp; sourceTree = "<group>"; };
B27318431416AC43006039C8 /* WatchpointList.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = WatchpointList.h; path = include/lldb/Breakpoint/WatchpointList.h; sourceTree = "<group>"; };
- B28058A0139988B0002D96D0 /* InferiorCallPOSIX.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = InferiorCallPOSIX.cpp; path = Utility/InferiorCallPOSIX.cpp; sourceTree = "<group>"; };
- B28058A2139988C6002D96D0 /* InferiorCallPOSIX.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = InferiorCallPOSIX.h; path = Utility/InferiorCallPOSIX.h; sourceTree = "<group>"; };
- B287E63E12EFAE2C00C9BEFE /* ARMDefines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ARMDefines.h; path = Utility/ARMDefines.h; sourceTree = "<group>"; };
- B296983412C2FB2B002D92C3 /* CommandObjectVersion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectVersion.cpp; path = source/Commands/CommandObjectVersion.cpp; sourceTree = "<group>"; };
- B296983512C2FB2B002D92C3 /* CommandObjectVersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CommandObjectVersion.h; path = source/Commands/CommandObjectVersion.h; sourceTree = "<group>"; };
- B299580A14F2FA1400050A04 /* DisassemblerLLVMC.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DisassemblerLLVMC.cpp; sourceTree = "<group>"; };
- B299580C14F2FA1F00050A04 /* DisassemblerLLVMC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DisassemblerLLVMC.h; sourceTree = "<group>"; };
- B2A58721143119810092BFBA /* SBWatchpoint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SBWatchpoint.h; path = include/lldb/API/SBWatchpoint.h; sourceTree = "<group>"; };
- B2A58723143119D50092BFBA /* SBWatchpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SBWatchpoint.cpp; path = source/API/SBWatchpoint.cpp; sourceTree = "<group>"; };
- B2A5872514313B480092BFBA /* SBWatchpoint.i */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; path = SBWatchpoint.i; sourceTree = "<group>"; };
- B2B7CCEA15D1BD6600EEFB57 /* CommandObjectWatchpointCommand.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CommandObjectWatchpointCommand.cpp; path = source/Commands/CommandObjectWatchpointCommand.cpp; sourceTree = "<group>"; };
- B2B7CCEC15D1BD9600EEFB57 /* CommandObjectWatchpointCommand.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = CommandObjectWatchpointCommand.h; path = source/Commands/CommandObjectWatchpointCommand.h; sourceTree = "<group>"; };
- B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchpointOptions.h; path = include/lldb/Breakpoint/WatchpointOptions.h; sourceTree = "<group>"; };
B2B7CCEF15D1C20F00EEFB57 /* WatchpointOptions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WatchpointOptions.cpp; path = source/Breakpoint/WatchpointOptions.cpp; sourceTree = "<group>"; };
- B2D3033612EFA5C500F84EB3 /* InstructionUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = InstructionUtils.h; path = Utility/InstructionUtils.h; sourceTree = "<group>"; };
- D67521351EA17C3900439694 /* MainLoop.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MainLoop.cpp; sourceTree = "<group>"; };
- E73A15A41B548EC500786197 /* GDBRemoteSignals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = GDBRemoteSignals.cpp; path = Utility/GDBRemoteSignals.cpp; sourceTree = "<group>"; };
- E73A15A51B548EC500786197 /* GDBRemoteSignals.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = GDBRemoteSignals.h; path = Utility/GDBRemoteSignals.h; sourceTree = "<group>"; };
+ B2B7CCED15D1BFB700EEFB57 /* WatchpointOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WatchpointOptions.h; path = include/lldb/Breakpoint/WatchpointOptions.h; sourceTree = "<group>"; };
+ 3FDFE54619A29448009756A7 /* Windows.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = Windows.cpp; path = source/Host/windows/Windows.cpp; sourceTree = "<group>"; };
+ 26C7C4811BFFEA7E009BD01F /* WindowsMiniDump.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WindowsMiniDump.cpp; sourceTree = "<group>"; };
+ 26C7C4821BFFEA7E009BD01F /* WindowsMiniDump.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WindowsMiniDump.h; sourceTree = "<group>"; };
+ 267A48001B1411E40021A5BC /* XML.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = XML.cpp; path = source/Host/common/XML.cpp; sourceTree = "<group>"; };
+ 267A48031B1416080021A5BC /* XML.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = XML.h; path = include/lldb/Host/XML.h; sourceTree = "<group>"; };
+ 940B04D81A8984FF0045D5F7 /* argdumper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = argdumper.cpp; path = tools/argdumper/argdumper.cpp; sourceTree = "<group>"; };
+ 266960591199F4230075C61A /* build-llvm.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "build-llvm.pl"; sourceTree = "<group>"; };
+ 266960601199F4230075C61A /* build-swig-Python.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-Python.sh"; sourceTree = "<group>"; };
+ 2669605A1199F4230075C61A /* build-swig-wrapper-classes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "build-swig-wrapper-classes.sh"; sourceTree = "<group>"; };
+ 2669605B1199F4230075C61A /* checkpoint-llvm.pl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "checkpoint-llvm.pl"; sourceTree = "<group>"; };
+ 268648C216531BF800F04704 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.internal.plist; path = tools/debugserver/source/com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
+ AFF87C8A150FF677000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
+ AFF87C8C150FF680000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
+ AFF87C8E150FF688000E1742 /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.applist.plist; path = tools/debugserver/source/com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
+ 268648C316531BF800F04704 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.internal.plist; path = tools/debugserver/source/com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
+ AFF87C86150FF669000E1742 /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.plist; path = tools/debugserver/source/com.apple.debugserver.plist; sourceTree = "<group>"; };
+ 268648C116531BF800F04704 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = com.apple.debugserver.posix.plist; path = tools/debugserver/source/com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
+ AF5CEC87206079A500384F20 /* com.apple.internal.xpc.remote.debugserver.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = com.apple.internal.xpc.remote.debugserver.plist; path = tools/debugserver/source/com.apple.internal.xpc.remote.debugserver.plist; sourceTree = "<group>"; };
+ 26579F68126A25920007C5CB /* darwin-debug */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "darwin-debug"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 26368A3B126B697600E8659F /* darwin-debug.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "darwin-debug.cpp"; path = "tools/darwin-debug/darwin-debug.cpp"; sourceTree = "<group>"; };
+ 265E9BE1115C2BAA00D0DCCB /* debugserver.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = debugserver.xcodeproj; path = tools/debugserver/debugserver.xcodeproj; sourceTree = "<group>"; };
+ 9A2057441F3B905C00F6C293 /* debugserver_LogCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = debugserver_LogCallback.cpp; path = debugserver/debugserver_LogCallback.cpp; sourceTree = "<group>"; };
+ 26BC7D5F10F1B77400F91463 /* dwarf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dwarf.h; path = include/lldb/Core/dwarf.h; sourceTree = "<group>"; };
+ 266960611199F4230075C61A /* edit-swig-python-wrapper-file.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = "edit-swig-python-wrapper-file.py"; sourceTree = "<group>"; };
+ 3FDFE54819A2946B009756A7 /* editlinewin.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = editlinewin.h; path = include/lldb/Host/windows/editlinewin.h; sourceTree = "<group>"; };
+ 94005E0513F45A1B001EF42D /* embedded_interpreter.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; name = embedded_interpreter.py; path = source/Interpreter/embedded_interpreter.py; sourceTree = "<group>"; };
+ 94FE476613FC1DA8001F8475 /* finish-swig-Python-LLDB.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "finish-swig-Python-LLDB.sh"; sourceTree = "<group>"; };
+ 2669605C1199F4230075C61A /* finish-swig-wrapper-classes.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "finish-swig-wrapper-classes.sh"; sourceTree = "<group>"; };
+ 23E2E51E1D903726006F38BB /* fizzbuzz_no_heap.dmp */ = {isa = PBXFileReference; lastKnownFileType = file; path = fizzbuzz_no_heap.dmp; sourceTree = "<group>"; };
+ 239504C21BDD3FD600963CEA /* gtest_common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = gtest_common.h; sourceTree = "<group>"; };
+ 2669605D1199F4230075C61A /* install-lldb.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "install-lldb.sh"; sourceTree = "<group>"; };
+ 2326CF4C1BDD684B00A5CEAC /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = ../../../../../../usr/lib/libedit.dylib; sourceTree = "<group>"; };
+ 26F5C32A10F3DFDD009D5894 /* libedit.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libedit.dylib; path = /usr/lib/libedit.dylib; sourceTree = "<absolute>"; };
+ 2689FFCA13353D7A00698AC0 /* liblldb-core.a */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "liblldb-core.a"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2326CF471BDD67C100A5CEAC /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = ../../../../../../usr/lib/libncurses.dylib; sourceTree = "<group>"; };
+ 239481851C59EBDD00DF7168 /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = ../../../../../usr/lib/libncurses.dylib; sourceTree = "<group>"; };
+ 2670F8111862B44A006B332C /* libncurses.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libncurses.dylib; path = /usr/lib/libncurses.dylib; sourceTree = "<absolute>"; };
+ 26F5C37410F3F61B009D5894 /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
+ 2326CF4E1BDD687800A5CEAC /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = ../../../../../../usr/lib/libpanel.dylib; sourceTree = "<group>"; };
+ 260157C41885F4FF00F875CF /* libpanel.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpanel.dylib; path = /usr/lib/libpanel.dylib; sourceTree = "<absolute>"; };
+ 26F5C32410F3DF23009D5894 /* libpython.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpython.dylib; path = /usr/lib/libpython.dylib; sourceTree = "<absolute>"; };
+ 26F5C32B10F3DFDD009D5894 /* libtermcap.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libtermcap.dylib; path = /usr/lib/libtermcap.dylib; sourceTree = "<absolute>"; };
+ 23CB14E31D66CA2200EDDDE1 /* libxml2.2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.2.dylib; path = usr/lib/libxml2.2.dylib; sourceTree = SDKROOT; };
+ 26D55234159A7DB100708D8D /* libxml2.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libxml2.dylib; path = /usr/lib/libxml2.dylib; sourceTree = "<absolute>"; };
+ 2326CF4A1BDD681800A5CEAC /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = ../../../../../../usr/lib/libz.dylib; sourceTree = "<group>"; };
+ 966C6B7818E6A56A0093F5EC /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = /usr/lib/libz.dylib; sourceTree = "<absolute>"; };
+ 23E2E51F1D903726006F38BB /* linux-x86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "linux-x86_64.cpp"; sourceTree = "<group>"; };
+ 23E2E5201D903726006F38BB /* linux-x86_64.dmp */ = {isa = PBXFileReference; lastKnownFileType = file; path = "linux-x86_64.dmp"; sourceTree = "<group>"; };
+ 26F5C26A10F3D9A4009D5894 /* lldb */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = lldb; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2669415E1A6DC2AB0063BE93 /* lldb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "lldb-Info.plist"; path = "tools/lldb-mi/lldb-Info.plist"; sourceTree = SOURCE_ROOT; };
+ 26F5C27210F3D9E4009D5894 /* lldb-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = "lldb-Info.plist"; path = "tools/driver/lldb-Info.plist"; sourceTree = "<group>"; };
+ 942829C01A89835300521B30 /* lldb-argdumper */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-argdumper"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 26BC7C2510F1B3BC00F91463 /* lldb-defines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-defines.h"; path = "include/lldb/lldb-defines.h"; sourceTree = "<group>"; };
+ 26BC7C2610F1B3BC00F91463 /* lldb-enumerations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-enumerations.h"; path = "include/lldb/lldb-enumerations.h"; sourceTree = "<group>"; };
+ 26DE1E6A11616C2E00A093E2 /* lldb-forward.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; lineEnding = 0; name = "lldb-forward.h"; path = "include/lldb/lldb-forward.h"; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
+ 26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-gdbserver.cpp"; path = "tools/lldb-server/lldb-gdbserver.cpp"; sourceTree = "<group>"; };
+ 239504D41BDD451400963CEA /* lldb-gtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-gtest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 23CB15561D66DA9300EDDDE1 /* lldb-gtest */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-gtest"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 2690CD171A6DC0D000E717C8 /* lldb-mi */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-mi"; sourceTree = BUILT_PRODUCTS_DIR; };
+ 26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-platform.cpp"; path = "tools/lldb-server/lldb-platform.cpp"; sourceTree = "<group>"; };
+ 26217932133BCB850083B112 /* lldb-private-enumerations.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-private-enumerations.h"; path = "include/lldb/lldb-private-enumerations.h"; sourceTree = "<group>"; };
+ 26BC7C2810F1B3BC00F91463 /* lldb-private-interfaces.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-private-interfaces.h"; path = "include/lldb/lldb-private-interfaces.h"; sourceTree = "<group>"; };
+ 26217930133BC8640083B112 /* lldb-private-types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-private-types.h"; path = "include/lldb/lldb-private-types.h"; sourceTree = "<group>"; };
+ 26BC7C2A10F1B3BC00F91463 /* lldb-private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-private.h"; path = "include/lldb/lldb-private.h"; sourceTree = "<group>"; };
+ 26651A14133BEC76005B64B7 /* lldb-public.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-public.h"; path = "include/lldb/lldb-public.h"; sourceTree = "<group>"; };
+ 3FBA69E21B60672A0008F44A /* lldb-python.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-python.h"; path = "ScriptInterpreter/Python/lldb-python.h"; sourceTree = "<group>"; };
+ 26DC6A101337FE6900FF7998 /* lldb-server */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "lldb-server"; sourceTree = BUILT_PRODUCTS_DIR; };
E769331D1A94D18100C73337 /* lldb-server.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "lldb-server.cpp"; path = "tools/lldb-server/lldb-server.cpp"; sourceTree = "<group>"; };
- E7723D421AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterContextPOSIXCore_arm64.cpp; sourceTree = "<group>"; };
- E7723D431AC4A7FB002BA082 /* RegisterContextPOSIXCore_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterContextPOSIXCore_arm64.h; sourceTree = "<group>"; };
- E7723D4A1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegisterContextPOSIX_arm64.cpp; path = Utility/RegisterContextPOSIX_arm64.cpp; sourceTree = "<group>"; };
- E7723D4B1AC4A944002BA082 /* RegisterContextPOSIX_arm64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RegisterContextPOSIX_arm64.h; path = Utility/RegisterContextPOSIX_arm64.h; sourceTree = "<group>"; };
- E778E99F1B062D1700247609 /* EmulateInstructionMIPS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EmulateInstructionMIPS.cpp; sourceTree = "<group>"; };
- E778E9A01B062D1700247609 /* EmulateInstructionMIPS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EmulateInstructionMIPS.h; sourceTree = "<group>"; };
- EB8375E61B553DE800BA907D /* ThreadPlanCallFunctionUsingABI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ThreadPlanCallFunctionUsingABI.cpp; path = source/Target/ThreadPlanCallFunctionUsingABI.cpp; sourceTree = "<group>"; };
- EB8375E81B553DFE00BA907D /* ThreadPlanCallFunctionUsingABI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = ThreadPlanCallFunctionUsingABI.h; path = include/lldb/Target/ThreadPlanCallFunctionUsingABI.h; sourceTree = "<group>"; };
- EDB919B414F6F10D008FF64B /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = /System/Library/Frameworks/Security.framework; sourceTree = "<absolute>"; };
+ 26BC7C2910F1B3BC00F91463 /* lldb-types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-types.h"; path = "include/lldb/lldb-types.h"; sourceTree = "<group>"; };
+ 94145430175D7FDE00284436 /* lldb-versioning.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "lldb-versioning.h"; path = "include/lldb/lldb-versioning.h"; sourceTree = "<group>"; };
+ 23173F8B192BA93F005C708F /* lldb-x86-register-enums.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "lldb-x86-register-enums.h"; path = "Utility/lldb-x86-register-enums.h"; sourceTree = "<group>"; };
+ AF90106315AB7C5700FF120D /* lldb.1 */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.man; name = lldb.1; path = docs/lldb.1; sourceTree = "<group>"; };
+ 26BC7E7410F1B85900F91463 /* lldb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lldb.cpp; path = source/lldb.cpp; sourceTree = "<group>"; };
+ 2669605E1199F4230075C61A /* lldb.swig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = lldb.swig; sourceTree = "<group>"; };
+ 94E367CC140C4EC4001C7A5A /* modify-python-lldb.py */ = {isa = PBXFileReference; lastKnownFileType = text.script.python; path = "modify-python-lldb.py"; sourceTree = "<group>"; };
+ 9A48A3A7124AAA5A00922451 /* python-extensions.swig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "python-extensions.swig"; sourceTree = "<group>"; };
+ 944DC3481774C99000D7D884 /* python-swigsafecast.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-swigsafecast.swig"; sourceTree = "<group>"; };
+ 94E367CE140C4EEA001C7A5A /* python-typemaps.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-typemaps.swig"; sourceTree = "<group>"; };
+ 94005E0313F438DF001EF42D /* python-wrapper.swig */ = {isa = PBXFileReference; lastKnownFileType = text; path = "python-wrapper.swig"; sourceTree = "<group>"; };
+ 266960631199F4230075C61A /* sed-sources */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; path = "sed-sources"; sourceTree = "<group>"; };
+ AFF62FDC2006D4D4003644F9 /* test-dwarf.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = "test-dwarf.cpp"; path = "DWARF/Inputs/test-dwarf.cpp"; sourceTree = "<group>"; };
+ AFF62FDD2006D4D4003644F9 /* test-dwarf.exe */ = {isa = PBXFileReference; lastKnownFileType = file; name = "test-dwarf.exe"; path = "DWARF/Inputs/test-dwarf.exe"; sourceTree = "<group>"; };
+ 23CB151B1D66CFAC00EDDDE1 /* test-pdb-alt.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb-alt.cpp"; sourceTree = "<group>"; };
+ 23CB151C1D66CFAC00EDDDE1 /* test-pdb-nested.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "test-pdb-nested.h"; sourceTree = "<group>"; };
+ 23CB151D1D66CFAC00EDDDE1 /* test-pdb-types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb-types.cpp"; sourceTree = "<group>"; };
+ 23CB151E1D66CFAC00EDDDE1 /* test-pdb-types.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb-types.exe"; sourceTree = "<group>"; };
+ 23CB151F1D66CFAC00EDDDE1 /* test-pdb-types.pdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb-types.pdb"; sourceTree = "<group>"; };
+ 23CB15201D66CFAC00EDDDE1 /* test-pdb.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "test-pdb.cpp"; sourceTree = "<group>"; };
+ 23CB15211D66CFAC00EDDDE1 /* test-pdb.exe */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb.exe"; sourceTree = "<group>"; };
+ 23CB15221D66CFAC00EDDDE1 /* test-pdb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "test-pdb.h"; sourceTree = "<group>"; };
+ 23CB15231D66CFAC00EDDDE1 /* test-pdb.pdb */ = {isa = PBXFileReference; lastKnownFileType = file; path = "test-pdb.pdb"; sourceTree = "<group>"; };
+ 3FDFE54A19A2946B009756A7 /* win32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = win32.h; path = include/lldb/Host/windows/win32.h; sourceTree = "<group>"; };
+ 3FDFE54B19A2946B009756A7 /* windows.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = windows.h; path = include/lldb/Host/windows/windows.h; sourceTree = "<group>"; };
+ AF415AE51D949E4400FCE0D4 /* x86AssemblyInspectionEngine.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = x86AssemblyInspectionEngine.cpp; sourceTree = "<group>"; };
+ AF415AE61D949E4400FCE0D4 /* x86AssemblyInspectionEngine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = x86AssemblyInspectionEngine.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -3200,6 +3270,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
+ 4CEC86A92047395F009B37B1 /* Python.framework in Frameworks */,
23CB15491D66DA9300EDDDE1 /* libxml2.2.dylib in Frameworks */,
23CB154A1D66DA9300EDDDE1 /* libpanel.dylib in Frameworks */,
23CB154B1D66DA9300EDDDE1 /* libedit.dylib in Frameworks */,
@@ -3288,6 +3359,7 @@
08FB7794FE84155DC02AAC07 /* lldb */ = {
isa = PBXGroup;
children = (
+ AF5CEC87206079A500384F20 /* com.apple.internal.xpc.remote.debugserver.plist */,
239481851C59EBDD00DF7168 /* libncurses.dylib */,
2326CF4E1BDD687800A5CEAC /* libpanel.dylib */,
2326CF4C1BDD684B00A5CEAC /* libedit.dylib */,
@@ -3395,7 +3467,6 @@
9A20572F1F3B8E7600F6C293 /* HostTest.cpp */,
9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */,
2321F9381BDD332400BA9A93 /* CMakeLists.txt */,
- 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */,
2321F9391BDD332400BA9A93 /* SocketAddressTest.cpp */,
2321F93A1BDD332400BA9A93 /* SocketTest.cpp */,
2321F93B1BDD332400BA9A93 /* SymbolsTest.cpp */,
@@ -3407,9 +3478,10 @@
2321F93C1BDD339A00BA9A93 /* Interpreter */ = {
isa = PBXGroup;
children = (
- 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */,
2321F93D1BDD33CE00BA9A93 /* CMakeLists.txt */,
- 2321F93E1BDD33CE00BA9A93 /* TestArgs.cpp */,
+ 2321F93E1BDD33CE00BA9A93 /* ArgsTest.cpp */,
+ 9A20572B1F3B8E6200F6C293 /* TestCompletion.cpp */,
+ 4C719398207D23E300FDF430 /* TestOptionArgParser.cpp */,
);
path = Interpreter;
sourceTree = "<group>";
@@ -3426,8 +3498,11 @@
2321F9421BDD343A00BA9A93 /* Utility */ = {
isa = PBXGroup;
children = (
+ 58EAC73D2106A0740029571E /* StreamTeeTest.cpp */,
+ 7F94D7172040A13A006EE3EA /* CleanUpTest.cpp */,
23E2E5161D903689006F38BB /* ArchSpecTest.cpp */,
9A3D43C81F3150D200EB767C /* ConstStringTest.cpp */,
+ 23CB14FD1D66CD2400EDDDE1 /* FileSpecTest.cpp */,
9A3D43C71F3150D200EB767C /* LogTest.cpp */,
9A3D43CB1F3150D200EB767C /* NameMatchesTest.cpp */,
9A3D43C61F3150D200EB767C /* StatusTest.cpp */,
@@ -3584,6 +3659,7 @@
23CB14E51D66CBEB00EDDDE1 /* Core */ = {
isa = PBXGroup;
children = (
+ 4F29D3CD21010F84003B549A /* MangledTest.cpp */,
9A3D43E31F3237D500EB767C /* ListenerTest.cpp */,
9A3D43E21F3237D500EB767C /* StateTest.cpp */,
9A3D43E11F3237D500EB767C /* StreamCallbackTest.cpp */,
@@ -3868,11 +3944,15 @@
260C89B210F57C5600BB2B04 /* DWARF */ = {
isa = PBXGroup;
children = (
+ 4CD44CFA20B37C440003557C /* AppleDWARFIndex.cpp */,
+ 4CD44CFF20B37C580003557C /* AppleDWARFIndex.h */,
6D95DC031B9DC06F000E318A /* DIERef.h */,
6D95DC041B9DC06F000E318A /* SymbolFileDWARFDwo.h */,
6D95DBFD1B9DC057000E318A /* DIERef.cpp */,
6D95DBFE1B9DC057000E318A /* HashedNameToDIE.cpp */,
6D95DBFF1B9DC057000E318A /* SymbolFileDWARFDwo.cpp */,
+ AF116BED20CF234B0071093F /* DebugNamesDWARFIndex.cpp */,
+ AF116BEE20CF234B0071093F /* DebugNamesDWARFIndex.h */,
260C89B310F57C5600BB2B04 /* DWARFAbbreviationDeclaration.cpp */,
260C89B410F57C5600BB2B04 /* DWARFAbbreviationDeclaration.h */,
269DDD451B8FD01A00D0DBD8 /* DWARFASTParser.h */,
@@ -3886,6 +3966,8 @@
4CC7C6521D5299140076FF94 /* DWARFASTParserOCaml.cpp */,
260C89B610F57C5600BB2B04 /* DWARFAttribute.h */,
266E829C1B8E542C008FCA06 /* DWARFAttribute.cpp */,
+ 4CD44D4020B777850003557C /* DWARFBaseDIE.cpp */,
+ 4CD44D4120B777850003557C /* DWARFBaseDIE.h */,
260C89B710F57C5600BB2B04 /* DWARFCompileUnit.cpp */,
260C89B810F57C5600BB2B04 /* DWARFCompileUnit.h */,
26AB92101819D74600E63F3E /* DWARFDataExtractor.cpp */,
@@ -3908,10 +3990,6 @@
260C89C810F57C5600BB2B04 /* DWARFDebugMacinfoEntry.h */,
23E77CD61C20F29F007192AD /* DWARFDebugMacro.cpp */,
23E77CD71C20F29F007192AD /* DWARFDebugMacro.h */,
- 260C89C910F57C5600BB2B04 /* DWARFDebugPubnames.cpp */,
- 260C89CA10F57C5600BB2B04 /* DWARFDebugPubnames.h */,
- 260C89CB10F57C5600BB2B04 /* DWARFDebugPubnamesSet.cpp */,
- 260C89CC10F57C5600BB2B04 /* DWARFDebugPubnamesSet.h */,
260C89CD10F57C5600BB2B04 /* DWARFDebugRanges.cpp */,
260C89CE10F57C5600BB2B04 /* DWARFDebugRanges.h */,
26B1EFAC154638AF00E2DAC7 /* DWARFDeclContext.cpp */,
@@ -3924,9 +4002,15 @@
260C89D210F57C5600BB2B04 /* DWARFDIECollection.h */,
260C89D310F57C5600BB2B04 /* DWARFFormValue.cpp */,
260C89D410F57C5600BB2B04 /* DWARFFormValue.h */,
+ 4CD44CF820B37C440003557C /* DWARFIndex.cpp */,
+ 4CD44CFE20B37C570003557C /* DWARFIndex.h */,
+ 7F2AAA5920601BE000A422D8 /* DWARFUnit.cpp */,
+ 7F2AAA5820601BDF00A422D8 /* DWARFUnit.h */,
26A0DA4D140F721D006DA411 /* HashedNameToDIE.h */,
26109B3B1155D70100CC3529 /* LogChannelDWARF.cpp */,
26109B3C1155D70100CC3529 /* LogChannelDWARF.h */,
+ 4CD44CF920B37C440003557C /* ManualDWARFIndex.cpp */,
+ 4CD44D0020B37C580003557C /* ManualDWARFIndex.h */,
2618D9EA12406FE600F2B8FE /* NameToDIE.cpp */,
2618D957124056C700F2B8FE /* NameToDIE.h */,
260C89D910F57C5600BB2B04 /* SymbolFileDWARF.cpp */,
@@ -4194,8 +4278,8 @@
94235B9B1A8D5FF300EB2EED /* SBVariablesOptions.cpp */,
B2A58721143119810092BFBA /* SBWatchpoint.h */,
B2A58723143119D50092BFBA /* SBWatchpoint.cpp */,
- 3F81692D1ABB7A40001DA9DF /* SystemInitializerFull.h */,
3F81692A1ABB7A16001DA9DF /* SystemInitializerFull.cpp */,
+ CDC75CF920B8D1DF002209BC /* SystemInitializerFull.h */,
);
name = API;
sourceTree = "<group>";
@@ -4372,6 +4456,10 @@
2682F168115ED9C800CCFF99 /* Utility */ = {
isa = PBXGroup;
children = (
+ 58EC744220EAEB6C00695209 /* CompletionRequest.h */,
+ 58EC744020EAEB5200695209 /* CompletionRequest.cpp */,
+ 6B74D89C2006972D0074051B /* Environment.h */,
+ 22DC561920064C9600A7E9E8 /* Environment.cpp */,
AF6CA6651FBBAF27005A0DC3 /* ArchSpec.cpp */,
AF6CA6671FBBAF37005A0DC3 /* ArchSpec.h */,
26BC7D5710F1B77400F91463 /* Connection.h */,
@@ -4400,8 +4488,6 @@
AFC2DCE61E6E2ED000283714 /* FastDemangle.cpp */,
AFC2DCED1E6E2F9800283714 /* FastDemangle.h */,
4CBFF0471F579A36004AFA92 /* Flags.h */,
- AFC2DCF21E6E30CF00283714 /* History.cpp */,
- AFC2DCF41E6E30D800283714 /* History.h */,
236124A61986B50E004EFC37 /* IOObject.h */,
236124A21986B4E2004EFC37 /* IOObject.cpp */,
4C73152119B7D71700F865A4 /* Iterable.h */,
@@ -4895,6 +4981,7 @@
26BC7E7610F1B85900F91463 /* Disassembler.cpp */,
4C4EB7821E6A4DE7002035C0 /* DumpDataExtractor.h */,
4C4EB77F1E6A4DB8002035C0 /* DumpDataExtractor.cpp */,
+ AFA585CF2107EB7300D7689A /* DumpRegisterValue.cpp */,
26BC7D5F10F1B77400F91463 /* dwarf.h */,
26D9FDC612F784E60003F2EE /* EmulateInstruction.h */,
26D9FDC812F784FD0003F2EE /* EmulateInstruction.cpp */,
@@ -5131,8 +5218,6 @@
children = (
4CA9637A11B6E99A00780E28 /* CommandObjectApropos.h */,
4CA9637911B6E99A00780E28 /* CommandObjectApropos.cpp */,
- 499F381E11A5B3F300F5CE02 /* CommandObjectArgs.h */,
- 499F381F11A5B3F300F5CE02 /* CommandObjectArgs.cpp */,
26BC7D1410F1B76300F91463 /* CommandObjectBreakpoint.h */,
26BC7E2D10F1B84700F91463 /* CommandObjectBreakpoint.cpp */,
9A42976111861A9F00FE05CD /* CommandObjectBreakpointCommand.h */,
@@ -5173,8 +5258,8 @@
26BC7E4010F1B84700F91463 /* CommandObjectSettings.cpp */,
26BC7D2910F1B76300F91463 /* CommandObjectSource.h */,
26BC7E4210F1B84700F91463 /* CommandObjectSource.cpp */,
- 26BC7D2C10F1B76300F91463 /* CommandObjectSyntax.h */,
- 26BC7E4510F1B84700F91463 /* CommandObjectSyntax.cpp */,
+ 6B8894782065AE5C002E5C59 /* CommandObjectStats.cpp */,
+ 6B8894772065AE5C002E5C59 /* CommandObjectStats.h */,
269416AE119A024800FF2715 /* CommandObjectTarget.h */,
269416AD119A024800FF2715 /* CommandObjectTarget.cpp */,
26BC7D2D10F1B76300F91463 /* CommandObjectThread.h */,
@@ -5294,8 +5379,6 @@
26BC7DDF10F1B7E200F91463 /* Interpreter */ = {
isa = PBXGroup;
children = (
- 25420ECE1A64911B009ADBCB /* OptionValueChar.h */,
- 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */,
26BC7D5310F1B77400F91463 /* Args.h */,
26BC7E6C10F1B85900F91463 /* Args.cpp */,
26A4EEB511682AAC007A372A /* LLDBWrapPython.cpp */,
@@ -5313,10 +5396,13 @@
26DFBC58113B48F300DD817F /* CommandObjectMultiword.cpp */,
26DFBC52113B48D600DD817F /* CommandObjectRegexCommand.h */,
26DFBC59113B48F300DD817F /* CommandObjectRegexCommand.cpp */,
+ 4C719396207D237100FDF430 /* CommandOptionValidators.h */,
23DDF224196C3EE600BB8417 /* CommandOptionValidators.cpp */,
26BC7DE410F1B7F900F91463 /* CommandReturnObject.h */,
26BC7F0A10F1B8DD00F91463 /* CommandReturnObject.cpp */,
94005E0513F45A1B001EF42D /* embedded_interpreter.py */,
+ 4C719397207D237100FDF430 /* OptionArgParser.h */,
+ 4C719394207D235400FDF430 /* OptionArgParser.cpp */,
26A7A036135E6E5300FB369E /* OptionValue.h */,
26A7A034135E6E4200FB369E /* OptionValue.cpp */,
260A248D15D06C4F009981B0 /* OptionValues.h */,
@@ -5328,6 +5414,8 @@
260CC63C15D0440D002BF2E0 /* OptionValueArray.cpp */,
260CC62315D04377002BF2E0 /* OptionValueBoolean.h */,
260CC63D15D0440D002BF2E0 /* OptionValueBoolean.cpp */,
+ 25420ECE1A64911B009ADBCB /* OptionValueChar.h */,
+ 25420ECC1A6490B8009ADBCB /* OptionValueChar.cpp */,
260CC62515D04377002BF2E0 /* OptionValueDictionary.h */,
260CC63F15D0440D002BF2E0 /* OptionValueDictionary.cpp */,
260CC62615D04377002BF2E0 /* OptionValueEnumeration.h */,
@@ -5524,6 +5612,7 @@
26BC7EE510F1B88100F91463 /* MacOSX */ = {
isa = PBXGroup;
children = (
+ AFF81FAA20D1CC210010F95E /* objcxx */,
26BC7EED10F1B8AD00F91463 /* CFCBundle.cpp */,
26BC7EEE10F1B8AD00F91463 /* CFCBundle.h */,
26BC7EEF10F1B8AD00F91463 /* CFCData.cpp */,
@@ -5537,10 +5626,7 @@
26BC7EF710F1B8AD00F91463 /* CFCReleaser.h */,
26BC7EF810F1B8AD00F91463 /* CFCString.cpp */,
26BC7EF910F1B8AD00F91463 /* CFCString.h */,
- 26BC7EE810F1B88F00F91463 /* Host.mm */,
- 3FDFE52B19A2917A009756A7 /* HostInfoMacOSX.mm */,
3FDFE52D19A291AF009756A7 /* HostInfoMacOSX.h */,
- 3FDFED0519B7C898009756A7 /* HostThreadMacOSX.mm */,
3FDFE56719AF9BB2009756A7 /* HostThreadMacOSX.h */,
2689B0B5113EE47E00A4AEDB /* Symbols.cpp */,
);
@@ -5585,6 +5671,7 @@
26C5577F132575C8008FD8FE /* MacOSX */ = {
isa = PBXGroup;
children = (
+ AFF81FB120D1CC820010F95E /* objcxx */,
9455630A1BEAD0570073F75F /* PlatformAppleSimulator.cpp */,
9455630B1BEAD0570073F75F /* PlatformAppleSimulator.h */,
AF8AD62A1BEC28A400150209 /* PlatformAppleTVSimulator.cpp */,
@@ -5597,8 +5684,6 @@
2697A54C133A6305004E4240 /* PlatformDarwin.h */,
26B7564C14F89356008D9CB3 /* PlatformiOSSimulator.cpp */,
26B7564D14F89356008D9CB3 /* PlatformiOSSimulator.h */,
- 9455630C1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.h */,
- 9455630D1BEAD0570073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm */,
26C5577B132575AD008FD8FE /* PlatformMacOSX.cpp */,
26C5577C132575AD008FD8FE /* PlatformMacOSX.h */,
AF3A4AD01EA05C4700B5DEB4 /* PlatformRemoteDarwinDevice.cpp */,
@@ -5616,6 +5701,7 @@
26D9FDCA12F785120003F2EE /* Instruction */ = {
isa = PBXGroup;
children = (
+ AFDBC36A2046638D00B9C8F2 /* PPC64 */,
E778E99D1B062D1700247609 /* MIPS */,
26D9FDCB12F785270003F2EE /* ARM */,
264A12F91372522000875C42 /* ARM64 */,
@@ -5932,6 +6018,8 @@
4C98D3E0118FB98F00E575D0 /* ClangFunctionCaller.h */,
4C98D3DA118FB96F00E575D0 /* ClangFunctionCaller.cpp */,
26BC7DC010F1B79500F91463 /* ClangExpressionHelper.h */,
+ 4CD44D5720C603A90003557C /* ClangHost.h */,
+ 4CD44D5620C603A80003557C /* ClangHost.cpp */,
49445E341225AB6A00C11A81 /* ClangUserExpression.h */,
26BC7ED510F1B86700F91463 /* ClangUserExpression.cpp */,
497C86C1122823F300B54702 /* ClangUtilityFunction.h */,
@@ -5960,6 +6048,23 @@
name = Clang;
sourceTree = "<group>";
};
+ 4C14CEF52057258D00DEEF94 /* PPC64 */ = {
+ isa = PBXGroup;
+ children = (
+ 4C14CEF72057258D00DEEF94 /* ArchitecturePPC64.h */,
+ 4C14CEF82057258D00DEEF94 /* ArchitecturePPC64.cpp */,
+ 4C14CEF92057258D00DEEF94 /* New Group */,
+ );
+ path = PPC64;
+ sourceTree = "<group>";
+ };
+ 4C14CEF92057258D00DEEF94 /* New Group */ = {
+ isa = PBXGroup;
+ children = (
+ );
+ path = "New Group";
+ sourceTree = "<group>";
+ };
4CC7C64B1D5298AB0076FF94 /* OCaml */ = {
isa = PBXGroup;
children = (
@@ -6038,6 +6143,22 @@
path = OpenBSD;
sourceTree = "<group>";
};
+ 4CEC86A5204738CC009B37B1 /* ARM64 */ = {
+ isa = PBXGroup;
+ children = (
+ 4CEC86A3204738C5009B37B1 /* TestArm64InstEmulation.cpp */,
+ );
+ name = ARM64;
+ sourceTree = "<group>";
+ };
+ 4CEC86A8204738EE009B37B1 /* PPC64 */ = {
+ isa = PBXGroup;
+ children = (
+ 4CEC86A6204738EA009B37B1 /* TestPPC64InstEmulation.cpp */,
+ );
+ name = PPC64;
+ sourceTree = "<group>";
+ };
4CEE62F71145F1C70064CF93 /* GDB Remote */ = {
isa = PBXGroup;
children = (
@@ -6401,8 +6522,8 @@
9A20570C1F3B81F800F6C293 /* Inputs */ = {
isa = PBXGroup;
children = (
- 9A20570D1F3B821A00F6C293 /* test-dwarf.cpp */,
- 9A20570E1F3B821A00F6C293 /* test-dwarf.exe */,
+ AFF62FDC2006D4D4003644F9 /* test-dwarf.cpp */,
+ AFF62FDD2006D4D4003644F9 /* test-dwarf.exe */,
);
name = Inputs;
sourceTree = "<group>";
@@ -6434,7 +6555,6 @@
9A2057231F3B8DC100F6C293 /* ELF */ = {
isa = PBXGroup;
children = (
- 9A2057241F3B8DD200F6C293 /* TestELFHeader.cpp */,
9A2057251F3B8DD200F6C293 /* TestObjectFileELF.cpp */,
);
name = ELF;
@@ -6561,14 +6681,6 @@
name = "SysV-arm64";
sourceTree = "<group>";
};
- AF248A4B1DA71C67000B814D /* InstEmulation */ = {
- isa = PBXGroup;
- children = (
- AF248A4C1DA71C77000B814D /* TestArm64InstEmulation.cpp */,
- );
- name = InstEmulation;
- sourceTree = "<group>";
- };
AF2BCA6518C7EFDE005B4526 /* JITLoader */ = {
isa = PBXGroup;
children = (
@@ -6589,6 +6701,7 @@
AF2E029F1FA2CE8A00A86C34 /* Architecture */ = {
isa = PBXGroup;
children = (
+ 4C14CEF52057258D00DEEF94 /* PPC64 */,
AF2E02A01FA2CE9900A86C34 /* Arm */,
);
path = Architecture;
@@ -6608,6 +6721,8 @@
children = (
4C562CC21CC07DDD00C52EAC /* PDBASTParser.cpp */,
4C562CC31CC07DDD00C52EAC /* PDBASTParser.h */,
+ 4CA0C6CA20F929C600CFE6BB /* PDBLocationToDWARFExpression.cpp */,
+ 4CA0C6CB20F929C700CFE6BB /* PDBLocationToDWARFExpression.h */,
AF6335E01C87B21E00F7D554 /* SymbolFilePDB.cpp */,
AF6335E11C87B21E00F7D554 /* SymbolFilePDB.h */,
);
@@ -6637,14 +6752,26 @@
children = (
9A2057061F3B818600F6C293 /* MemoryRegionInfoTest.cpp */,
AFAFD8091E57E1B90017A14F /* ModuleCacheTest.cpp */,
+ 2668A2ED20AF417D00D94111 /* PathMappingListTest.cpp */,
);
name = Target;
sourceTree = "<group>";
};
+ AFDBC36A2046638D00B9C8F2 /* PPC64 */ = {
+ isa = PBXGroup;
+ children = (
+ AFDBC36C204663AF00B9C8F2 /* EmulateInstructionPPC64.cpp */,
+ AFDBC36B204663AF00B9C8F2 /* EmulateInstructionPPC64.h */,
+ );
+ name = PPC64;
+ path = "New Group";
+ sourceTree = "<group>";
+ };
AFEC5FD31D94F9130076A480 /* UnwindAssembly */ = {
isa = PBXGroup;
children = (
- AF248A4B1DA71C67000B814D /* InstEmulation */,
+ 4CEC86A8204738EE009B37B1 /* PPC64 */,
+ 4CEC86A5204738CC009B37B1 /* ARM64 */,
AFEC5FD41D94F9270076A480 /* x86 */,
);
name = UnwindAssembly;
@@ -6658,6 +6785,25 @@
name = x86;
sourceTree = "<group>";
};
+ AFF81FAA20D1CC210010F95E /* objcxx */ = {
+ isa = PBXGroup;
+ children = (
+ AFF81FAD20D1CC400010F95E /* Host.mm */,
+ AFF81FAB20D1CC400010F95E /* HostInfoMacOSX.mm */,
+ AFF81FAC20D1CC400010F95E /* HostThreadMacOSX.mm */,
+ );
+ name = objcxx;
+ sourceTree = "<group>";
+ };
+ AFF81FB120D1CC820010F95E /* objcxx */ = {
+ isa = PBXGroup;
+ children = (
+ AFF81FB220D1CC910010F95E /* PlatformiOSSimulatorCoreSimulatorSupport.mm */,
+ AFB1682620D1D4CC00A74F25 /* PlatformiOSSimulatorCoreSimulatorSupport.h */,
+ );
+ name = objcxx;
+ sourceTree = "<group>";
+ };
E769331B1A94D10E00C73337 /* lldb-server */ = {
isa = PBXGroup;
children = (
@@ -6668,6 +6814,8 @@
E769331D1A94D18100C73337 /* lldb-server.cpp */,
26DC6A1C1337FECA00FF7998 /* lldb-platform.cpp */,
26D6F3F4183E7F9300194858 /* lldb-gdbserver.cpp */,
+ 4CD44D2020B725DA0003557C /* SystemInitializerLLGS.cpp */,
+ 4CD44D2320B725F60003557C /* SystemInitializerLLGS.h */,
);
name = "lldb-server";
sourceTree = "<group>";
@@ -6808,7 +6956,7 @@
/* Begin PBXLegacyTarget section */
2387551E1C24974600CCE8C3 /* lldb-python-test-suite */ = {
isa = PBXLegacyTarget;
- buildArgumentsString = "-u $(SRCROOT)/test/dotest.py --apple-sdk $(PLATFORM_NAME) --executable=$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lldb -C $(LLDB_PYTHON_TESTSUITE_CC) --arch $(LLDB_PYTHON_TESTSUITE_ARCH) --session-file-format fm --results-formatter lldbsuite.test_event.formatter.xunit.XunitFormatter --results-file $(BUILD_DIR)/test-results-$(LLDB_PYTHON_TESTSUITE_ARCH).xml --rerun-all-issues --env TERM=vt100 -O--xpass=ignore";
+ buildArgumentsString = "-u $(SRCROOT)/test/dotest.py --apple-sdk $(PLATFORM_NAME) --executable=$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lldb -C $(LLDB_PYTHON_TESTSUITE_CC) --arch $(LLDB_PYTHON_TESTSUITE_ARCH) --session-file-format fm --results-formatter lldbsuite.test_event.formatter.xunit.XunitFormatter --build-dir $(BUILD_DIR)/lldb-test-build.noindex --results-file $(BUILD_DIR)/test-results-$(LLDB_PYTHON_TESTSUITE_ARCH).xml --rerun-all-issues --env TERM=vt100 -O--xpass=ignore";
buildConfigurationList = 238755241C24974600CCE8C3 /* Build configuration list for PBXLegacyTarget "lldb-python-test-suite" */;
buildPhases = (
);
@@ -7051,6 +7199,7 @@
26CEF3B114FD592B007286B2 /* desktop */,
26CEF3A914FD58BF007286B2 /* desktop_no_xpc */,
26CEF3BC14FD596A007286B2 /* ios */,
+ AFA9B71120606A13008E86C6 /* ios-mini */,
26F5C26910F3D9A4009D5894 /* lldb-tool */,
26680206115FD0ED008E1FE4 /* LLDB */,
239504D31BDD451400963CEA /* lldb-gtest */,
@@ -7137,7 +7286,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n\t/usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n\t/usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n\tLLDB_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`\n LLDB_REVISION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`\n LLDB_VERSION_STRING=`echo ${CURRENT_PROJECT_VERSION}`\n\t/usr/bin/sed -i '' \"s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |\" \"$file\"\n /usr/bin/sed -i '' \"s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |\" \"$file\"\n /usr/bin/sed -i '' \"s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \\\"$LLDB_VERSION_STRING\\\" |\" \"$file\"\ndone\n";
+ shellScript = "cd \"${TARGET_BUILD_DIR}/${PUBLIC_HEADERS_FOLDER_PATH}\"\nfor file in *.h\ndo\n /usr/bin/sed -i '' 's/\\(#include\\)[ ]*\"lldb\\/\\(API\\/\\)\\{0,1\\}\\(.*\\)\"/\\1 <LLDB\\/\\3>/1' \"$file\"\n /usr/bin/sed -i '' 's|<LLDB/Utility|<LLDB|' \"$file\"\n LLDB_VERSION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\1/g'`\n LLDB_REVISION=`echo ${CURRENT_PROJECT_VERSION} | /usr/bin/sed -E 's/^([0-9]+).([0-9]+).([0-9]+)(.[0-9]+)?$/\\3/g'`\n LLDB_VERSION_STRING=`echo ${CURRENT_PROJECT_VERSION}`\n /usr/bin/sed -i '' \"s|//#define LLDB_VERSION$|#define LLDB_VERSION $LLDB_VERSION |\" \"$file\"\n /usr/bin/sed -i '' \"s|//#define LLDB_REVISION|#define LLDB_REVISION $LLDB_REVISION |\" \"$file\"\n /usr/bin/sed -i '' \"s|//#define LLDB_VERSION_STRING|#define LLDB_VERSION_STRING \\\"$LLDB_VERSION_STRING\\\" |\" \"$file\"\ndone\n";
};
261EECA21337D399001D193C /* Build llvm and clang */ = {
isa = PBXShellScriptBuildPhase;
@@ -7169,7 +7318,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
- shellScript = "/usr/bin/python $SRCROOT/scripts/prepare_bindings.py --find-swig --framework --src-root $SRCROOT --target-dir $TARGET_BUILD_DIR --config-build-dir $BUILT_PRODUCTS_DIR --target-platform Darwin";
+ shellScript = "/usr/bin/python $SRCROOT/scripts/prepare_bindings.py --find-swig --framework --src-root $SRCROOT --target-dir $TARGET_BUILD_DIR --config-build-dir $BUILT_PRODUCTS_DIR --target-platform Darwin\n";
};
4959511A1A1ACE9500F6F8FC /* Install Clang compiler headers */ = {
isa = PBXShellScriptBuildPhase;
@@ -7184,7 +7333,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "/usr/bin/python $SRCROOT/scripts/Xcode/package-clang-headers.py $TARGET_BUILD_DIR $LLVM_BUILD_DIR/$CURRENT_ARCH";
+ shellScript = "/usr/bin/python $SRCROOT/scripts/Xcode/package-clang-headers.py $TARGET_BUILD_DIR $LLVM_BUILD_DIR/$CURRENT_ARCH\n";
};
4C3326CA18B2A2B800EB5DD7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -7197,7 +7346,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
- shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\n if [ \"${DEBUGSERVER_USE_FROM_SYSTEM}\" == \"\" ]\n then\n if [ \"${DEBUGSERVER_DISABLE_CODESIGN}\" == \"\" ]\n then\n codesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n fi\n fi\nfi\n";
+ shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\n if [ \"${DEBUGSERVER_USE_FROM_SYSTEM}\" == \"\" ]\n then\n if [ \"${DEBUGSERVER_DISABLE_CODESIGN}\" == \"\" ]\n then\n codesign -f -s lldb_codesign --entitlements ${SRCROOT}/resources/debugserver-macosx-entitlements.plist \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n fi\n fi\nfi\n";
};
940B04E21A89871F0045D5F7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
@@ -7263,10 +7412,10 @@
files = (
9A3D43D91F3151C400EB767C /* StatusTest.cpp in Sources */,
23CB15331D66DA9300EDDDE1 /* GoParserTest.cpp in Sources */,
- 9A2057281F3B8DDB00F6C293 /* TestELFHeader.cpp in Sources */,
23CB15341D66DA9300EDDDE1 /* CPlusPlusLanguageTest.cpp in Sources */,
9A2057381F3B8E7E00F6C293 /* FileSystemTest.cpp in Sources */,
9A2057201F3B8D2500F6C293 /* UnixSignalsTest.cpp in Sources */,
+ 2668A2EE20AF417D00D94111 /* PathMappingListTest.cpp in Sources */,
AFAFD80A1E57E1B90017A14F /* ModuleCacheTest.cpp in Sources */,
9A3D43DA1F3151C400EB767C /* StructuredDataTest.cpp in Sources */,
9A2057121F3B824B00F6C293 /* SymbolFileDWARFTests.cpp in Sources */,
@@ -7277,16 +7426,19 @@
23E2E5251D90373D006F38BB /* ArchSpecTest.cpp in Sources */,
9A2057081F3B819100F6C293 /* MemoryRegionInfoTest.cpp in Sources */,
9A20572D1F3B8E6600F6C293 /* TestCompletion.cpp in Sources */,
- AF248A4D1DA71C77000B814D /* TestArm64InstEmulation.cpp in Sources */,
+ 4C719399207D23E300FDF430 /* TestOptionArgParser.cpp in Sources */,
23CB15371D66DA9300EDDDE1 /* PythonTestSuite.cpp in Sources */,
23E2E5321D903832006F38BB /* BreakpointIDTest.cpp in Sources */,
+ 4CEC86A7204738EB009B37B1 /* TestPPC64InstEmulation.cpp in Sources */,
+ 58EAC73F2106A07B0029571E /* StreamTeeTest.cpp in Sources */,
23CB15381D66DA9300EDDDE1 /* PythonExceptionStateTests.cpp in Sources */,
9A3D43D81F3151C400EB767C /* NameMatchesTest.cpp in Sources */,
23CB15391D66DA9300EDDDE1 /* DataExtractorTest.cpp in Sources */,
+ 4CEC86A4204738C5009B37B1 /* TestArm64InstEmulation.cpp in Sources */,
9A3D43ED1F3237F900EB767C /* StateTest.cpp in Sources */,
23CB153A1D66DA9300EDDDE1 /* GDBRemoteClientBaseTest.cpp in Sources */,
23CB153B1D66DA9300EDDDE1 /* SocketTest.cpp in Sources */,
- 23CB153C1D66DA9300EDDDE1 /* TestArgs.cpp in Sources */,
+ 23CB153C1D66DA9300EDDDE1 /* ArgsTest.cpp in Sources */,
9A3D43DB1F3151C400EB767C /* TildeExpressionResolverTest.cpp in Sources */,
9A2057291F3B8DDB00F6C293 /* TestObjectFileELF.cpp in Sources */,
23CB153D1D66DA9300EDDDE1 /* GDBRemoteCommunicationClientTest.cpp in Sources */,
@@ -7294,6 +7446,7 @@
9A3D43D71F3151C400EB767C /* LogTest.cpp in Sources */,
9A2057181F3B861400F6C293 /* TestType.cpp in Sources */,
9A2057171F3B861400F6C293 /* TestDWARFCallFrameInfo.cpp in Sources */,
+ 4F29D3CF21010FA3003B549A /* MangledTest.cpp in Sources */,
9A3D43EC1F3237F900EB767C /* ListenerTest.cpp in Sources */,
9A3D43DC1F3151C400EB767C /* TimeoutTest.cpp in Sources */,
9A3D43D61F3151C400EB767C /* ConstStringTest.cpp in Sources */,
@@ -7452,7 +7605,6 @@
AE44FB4C1BB4BB540033EB62 /* GoFormatterFunctions.cpp in Sources */,
8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in Sources */,
23042D121976CA1D00621B2C /* PlatformKalimba.cpp in Sources */,
- 2689001313353DDE00698AC0 /* CommandObjectArgs.cpp in Sources */,
2689001413353DDE00698AC0 /* CommandObjectBreakpoint.cpp in Sources */,
2689001513353DDE00698AC0 /* CommandObjectBreakpointCommand.cpp in Sources */,
2689001613353DDE00698AC0 /* CommandObjectCommands.cpp in Sources */,
@@ -7480,7 +7632,6 @@
2689002313353DDE00698AC0 /* CommandObjectScript.cpp in Sources */,
2689002413353DDE00698AC0 /* CommandObjectSettings.cpp in Sources */,
2689002513353DDE00698AC0 /* CommandObjectSource.cpp in Sources */,
- 2689002613353DDE00698AC0 /* CommandObjectSyntax.cpp in Sources */,
267A48011B1411E40021A5BC /* XML.cpp in Sources */,
AF8AD6371BEC28C400150209 /* PlatformRemoteAppleTV.cpp in Sources */,
6D0F614E1C80AB0700A4ECEE /* JavaLanguageRuntime.cpp in Sources */,
@@ -7536,12 +7687,14 @@
2689004613353E0400698AC0 /* ModuleList.cpp in Sources */,
2689004713353E0400698AC0 /* PluginManager.cpp in Sources */,
AE44FB3E1BB485960033EB62 /* GoLanguageRuntime.cpp in Sources */,
+ AFF81FAF20D1CC400010F95E /* HostThreadMacOSX.mm in Sources */,
AF0C112818580CD800C4C45B /* QueueItem.cpp in Sources */,
AF254E31170CCC33007AE5C9 /* PlatformDarwinKernel.cpp in Sources */,
2689004913353E0400698AC0 /* Scalar.cpp in Sources */,
263FDE601A79A01500E68013 /* FormatEntity.cpp in Sources */,
AF8AD62E1BEC28A400150209 /* PlatformAppleTVSimulator.cpp in Sources */,
2689004A13353E0400698AC0 /* SearchFilter.cpp in Sources */,
+ AFF81FAE20D1CC400010F95E /* HostInfoMacOSX.mm in Sources */,
2689004B13353E0400698AC0 /* Section.cpp in Sources */,
4984BA161B979973008658D4 /* ExpressionVariable.cpp in Sources */,
2689004C13353E0400698AC0 /* SourceManager.cpp in Sources */,
@@ -7575,7 +7728,9 @@
264A58EE1A7DBCAD00A6B1B0 /* OptionValueFormatEntity.cpp in Sources */,
8C2D6A53197A1EAF006989C9 /* MemoryHistory.cpp in Sources */,
6D95DC021B9DC057000E318A /* SymbolFileDWARFDwo.cpp in Sources */,
+ AFF81FB320D1CC910010F95E /* PlatformiOSSimulatorCoreSimulatorSupport.mm in Sources */,
942612F71B95000000EF842E /* LanguageCategory.cpp in Sources */,
+ AF116BEF20CF234B0071093F /* DebugNamesDWARFIndex.cpp in Sources */,
2689005E13353E0E00698AC0 /* ClangASTSource.cpp in Sources */,
2689005F13353E0E00698AC0 /* ClangFunctionCaller.cpp in Sources */,
2689006013353E0E00698AC0 /* ClangExpressionDeclMap.cpp in Sources */,
@@ -7588,6 +7743,7 @@
943BDEFE1AA7B2F800789CE8 /* LLDBAssert.cpp in Sources */,
26474CB418D0CB180073DEBA /* RegisterContextLinux_x86_64.cpp in Sources */,
2689006613353E0E00698AC0 /* DWARFExpression.cpp in Sources */,
+ 4C14CEFB2057258D00DEEF94 /* ArchitecturePPC64.cpp in Sources */,
2689006713353E0E00698AC0 /* ASTDumper.cpp in Sources */,
AFC234091AF85CE100CDE8B6 /* CommandObjectLanguage.cpp in Sources */,
2689006813353E0E00698AC0 /* ASTResultSynthesizer.cpp in Sources */,
@@ -7673,6 +7829,7 @@
268900A013353E4200698AC0 /* ProcessGDBRemoteLog.cpp in Sources */,
AF9FF1F71FAA79FE00474976 /* LibCxxQueue.cpp in Sources */,
268900A113353E4200698AC0 /* ThreadGDBRemote.cpp in Sources */,
+ AFE228832060699D0042D0C8 /* DWARFUnit.cpp in Sources */,
AEEA34051AC88A7400AB639D /* TypeSystem.cpp in Sources */,
AF1729D6182C907200E0AB97 /* HistoryThread.cpp in Sources */,
268900AF13353E5000698AC0 /* UnwindLLDB.cpp in Sources */,
@@ -7683,6 +7840,7 @@
3FDFE56C19AF9C44009756A7 /* HostProcessPosix.cpp in Sources */,
268900B413353E5000698AC0 /* RegisterContextMacOSXFrameBackchain.cpp in Sources */,
AE44FB321BB07EBC0033EB62 /* GoParser.cpp in Sources */,
+ 6B74D89B200696BB0074051B /* Environment.cpp in Sources */,
3F8169311ABB7A6D001DA9DF /* SystemInitializer.cpp in Sources */,
949EEDB21BA76731008C63CF /* NSIndexPath.cpp in Sources */,
3FDFED2D19C257A0009756A7 /* HostProcess.cpp in Sources */,
@@ -7700,19 +7858,15 @@
268900BE13353E5F00698AC0 /* DWARFDebugLine.cpp in Sources */,
268900BF13353E5F00698AC0 /* DWARFDebugMacinfo.cpp in Sources */,
268900C013353E5F00698AC0 /* DWARFDebugMacinfoEntry.cpp in Sources */,
- 268900C113353E5F00698AC0 /* DWARFDebugPubnames.cpp in Sources */,
- 268900C213353E5F00698AC0 /* DWARFDebugPubnamesSet.cpp in Sources */,
268900C313353E5F00698AC0 /* DWARFDebugRanges.cpp in Sources */,
25EF23781AC09B3700908DF0 /* AdbClient.cpp in Sources */,
238F2BA81D2C85FA001FF92A /* StructuredDataDarwinLog.cpp in Sources */,
94380B8219940B0A00BFE4A8 /* StringLexer.cpp in Sources */,
268900C413353E5F00698AC0 /* DWARFDefines.cpp in Sources */,
- 945563101BEAD0650073F75F /* PlatformiOSSimulatorCoreSimulatorSupport.mm in Sources */,
268900C513353E5F00698AC0 /* DWARFDIECollection.cpp in Sources */,
268900C613353E5F00698AC0 /* DWARFFormValue.cpp in Sources */,
3FDFE53119A292F0009756A7 /* HostInfoPosix.cpp in Sources */,
233B007D1960C9F90090E598 /* ProcessInfo.cpp in Sources */,
- 3FDFE52C19A2917A009756A7 /* HostInfoMacOSX.mm in Sources */,
26BC17B118C7F4CB00D2196D /* ThreadElfCore.cpp in Sources */,
947CF7771DC7B20D00EF980B /* ThreadMinidump.cpp in Sources */,
268900C913353E5F00698AC0 /* NameToDIE.cpp in Sources */,
@@ -7741,7 +7895,6 @@
26C7C4831BFFEA7E009BD01F /* WindowsMiniDump.cpp in Sources */,
49CA96FD1E6AACC900C03FEE /* DataBufferLLVM.cpp in Sources */,
268900D813353E6F00698AC0 /* Function.cpp in Sources */,
- AFC2DCF31E6E30CF00283714 /* History.cpp in Sources */,
268900D913353E6F00698AC0 /* FuncUnwinders.cpp in Sources */,
268900DA13353E6F00698AC0 /* LineEntry.cpp in Sources */,
268900DB13353E6F00698AC0 /* LineTable.cpp in Sources */,
@@ -7770,6 +7923,7 @@
4C56543119D1EFAA002E9C44 /* ThreadPlanPython.cpp in Sources */,
26AB92121819D74600E63F3E /* DWARFDataExtractor.cpp in Sources */,
268900E913353E6F00698AC0 /* CPPLanguageRuntime.cpp in Sources */,
+ 4CD44D4220B777850003557C /* DWARFBaseDIE.cpp in Sources */,
9485545A1DCBAE3B00345FF5 /* RenderScriptScriptGroup.cpp in Sources */,
268900EA13353E6F00698AC0 /* DynamicLoader.cpp in Sources */,
945261BF1B9A11FC00BF138D /* CxxStringTypes.cpp in Sources */,
@@ -7797,6 +7951,7 @@
268900F913353E6F00698AC0 /* Thread.cpp in Sources */,
268900FA13353E6F00698AC0 /* ThreadList.cpp in Sources */,
268900FB13353E6F00698AC0 /* ThreadPlan.cpp in Sources */,
+ 4CD44CFD20B37C440003557C /* AppleDWARFIndex.cpp in Sources */,
256CBDBC1ADD107200BC6CDC /* RegisterContextLinux_mips64.cpp in Sources */,
26BF51F31B3C754400016294 /* ABISysV_hexagon.cpp in Sources */,
232CB619191E00CD00EF39FC /* NativeProcessProtocol.cpp in Sources */,
@@ -7812,10 +7967,12 @@
2689010013353E6F00698AC0 /* ThreadPlanStepInstruction.cpp in Sources */,
AFC2DCE71E6E2ED000283714 /* FastDemangle.cpp in Sources */,
232CB61B191E00CD00EF39FC /* NativeThreadProtocol.cpp in Sources */,
+ 4CD44CFB20B37C440003557C /* DWARFIndex.cpp in Sources */,
2689010113353E6F00698AC0 /* ThreadPlanStepOut.cpp in Sources */,
2689010213353E6F00698AC0 /* ThreadPlanStepOverBreakpoint.cpp in Sources */,
3FDFED2919BA6D96009756A7 /* ThreadLauncher.cpp in Sources */,
232CB617191E00CD00EF39FC /* NativeBreakpointList.cpp in Sources */,
+ 4C719395207D235400FDF430 /* OptionArgParser.cpp in Sources */,
942829561A89614C00521B30 /* JSON.cpp in Sources */,
267F68531CC02E920086832B /* RegisterContextLinux_s390x.cpp in Sources */,
232CB615191E00CD00EF39FC /* NativeBreakpoint.cpp in Sources */,
@@ -7843,7 +8000,6 @@
E7723D4C1AC4A944002BA082 /* RegisterContextPOSIX_arm64.cpp in Sources */,
26BC17AB18C7F4CB00D2196D /* ProcessElfCore.cpp in Sources */,
AF1F7B07189C904B0087DB9C /* AppleGetPendingItemsHandler.cpp in Sources */,
- 26B1FCC21338115F002886E2 /* Host.mm in Sources */,
E778E9A21B062D1700247609 /* EmulateInstructionMIPS.cpp in Sources */,
3FDFDDC6199D37ED009756A7 /* FileSystem.cpp in Sources */,
26744EF11338317700EF765A /* GDBRemoteCommunicationClient.cpp in Sources */,
@@ -7856,7 +8012,6 @@
23D065911D4A7BEE0008EDE6 /* RenderScriptx86ABIFixups.cpp in Sources */,
4CE4EFAA1E8999B900A80C06 /* PlatformOpenBSD.cpp in Sources */,
26651A18133BF9E0005B64B7 /* Opcode.cpp in Sources */,
- 3FDFED0B19B7C8DE009756A7 /* HostThreadMacOSX.mm in Sources */,
4CABA9E0134A8BCD00539BDD /* ValueObjectMemory.cpp in Sources */,
4CD0BD0F134BFADF00CB44D4 /* ValueObjectDynamicValue.cpp in Sources */,
946216C21A97C080006E19CC /* OptionValueLanguage.cpp in Sources */,
@@ -7881,6 +8036,7 @@
4CC7C6501D5298F30076FF94 /* OCamlLanguage.cpp in Sources */,
2692BA15136610C100F9E14D /* UnwindAssemblyInstEmulation.cpp in Sources */,
263E949F13661AEA00E7D1CE /* UnwindAssembly-x86.cpp in Sources */,
+ AFA585D02107EB7400D7689A /* DumpRegisterValue.cpp in Sources */,
3FDFDDBD199C3A06009756A7 /* FileAction.cpp in Sources */,
264D8D5013661BD7003A368F /* UnwindAssembly.cpp in Sources */,
AF23B4DB19009C66003E2A58 /* FreeBSDSignals.cpp in Sources */,
@@ -7938,6 +8094,7 @@
265205AA13D3E3F700132FE2 /* RegisterContextKDP_i386.cpp in Sources */,
6DEC6F391BD66D750091ABA6 /* TaskPool.cpp in Sources */,
265205AC13D3E3F700132FE2 /* RegisterContextKDP_x86_64.cpp in Sources */,
+ AFF81FB020D1CC400010F95E /* Host.mm in Sources */,
2628A4D513D4977900F5487A /* ThreadKDP.cpp in Sources */,
26D7E45D13D5E30A007FD12B /* SocketAddress.cpp in Sources */,
94CD7D0C19A3FBCE00908B7C /* AppleObjCTypeEncodingParser.cpp in Sources */,
@@ -7955,6 +8112,7 @@
3FBA69EC1B6067430008F44A /* PythonDataObjects.cpp in Sources */,
26274FA714030F79006BA130 /* DynamicLoaderDarwinKernel.cpp in Sources */,
94FA3DE01405D50400833217 /* ValueObjectConstResultChild.cpp in Sources */,
+ 58EC744120EAEB5200695209 /* CompletionRequest.cpp in Sources */,
3FDFED2819BA6D96009756A7 /* HostThread.cpp in Sources */,
949ADF031406F648004833E1 /* ValueObjectConstResultImpl.cpp in Sources */,
B27318421416AC12006039C8 /* WatchpointList.cpp in Sources */,
@@ -7963,6 +8121,7 @@
B2462247141AD37D00F3D409 /* OptionGroupWatchpoint.cpp in Sources */,
94B638631B8FB7F1004FE1E4 /* ObjCPlusPlusLanguage.cpp in Sources */,
49DEF1251CD7C6DF006A7C7D /* BlockPointer.cpp in Sources */,
+ AFB6B9ED2065BBE90047661E /* CommandObjectStats.cpp in Sources */,
49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */,
23DDF226196C3EE600BB8417 /* CommandOptionValidators.cpp in Sources */,
B207C4931429607D00F36E4E /* CommandObjectWatchpoint.cpp in Sources */,
@@ -8007,12 +8166,14 @@
490A36C0180F0E6F00BA31F8 /* PlatformWindows.cpp in Sources */,
260CC65015D0440D002BF2E0 /* OptionValueFormat.cpp in Sources */,
260CC65115D0440D002BF2E0 /* OptionValueSInt64.cpp in Sources */,
+ 4CD44D5820C603CB0003557C /* ClangHost.cpp in Sources */,
260CC65215D0440D002BF2E0 /* OptionValueString.cpp in Sources */,
6D55B2911A8A806200A70529 /* GDBRemoteCommunicationServerLLGS.cpp in Sources */,
260CC65315D0440D002BF2E0 /* OptionValueUInt64.cpp in Sources */,
260CC65415D0440D002BF2E0 /* OptionValueUUID.cpp in Sources */,
94BA8B6D176F8C9B005A91B5 /* Range.cpp in Sources */,
267F684A1CC02DED0086832B /* ABISysV_s390x.cpp in Sources */,
+ AFDBC36E204663AF00B9C8F2 /* EmulateInstructionPPC64.cpp in Sources */,
26DAED6315D327C200E15819 /* OptionValuePathMappings.cpp in Sources */,
B2B7CCEB15D1BD6700EEFB57 /* CommandObjectWatchpointCommand.cpp in Sources */,
E7E94ABC1B54961F00D0AE30 /* GDBRemoteSignals.cpp in Sources */,
@@ -8037,6 +8198,7 @@
94CB255E16B069770059775D /* FormatManager.cpp in Sources */,
94CB256616B096F10059775D /* TypeCategory.cpp in Sources */,
945261C81B9A14D300BF138D /* CXXFunctionPointer.cpp in Sources */,
+ 4CA0C6CC20F929C700CFE6BB /* PDBLocationToDWARFExpression.cpp in Sources */,
94CB256716B096F10059775D /* TypeCategoryMap.cpp in Sources */,
94CB257016B0A4270059775D /* TypeFormat.cpp in Sources */,
238F2B9E1D2C82D0001FF92A /* StructuredDataPlugin.cpp in Sources */,
@@ -8044,6 +8206,7 @@
94CB257216B0A4270059775D /* TypeSynthetic.cpp in Sources */,
94CB257416B1D3880059775D /* FormatCache.cpp in Sources */,
AF6335E21C87B21E00F7D554 /* SymbolFilePDB.cpp in Sources */,
+ 4CD44CFC20B37C440003557C /* ManualDWARFIndex.cpp in Sources */,
A36FF33C17D8E94600244D40 /* OptionParser.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
@@ -8133,6 +8296,7 @@
buildActionMask = 2147483647;
files = (
E769331C1A94D15400C73337 /* lldb-gdbserver.cpp in Sources */,
+ 4CD44D2220B725DA0003557C /* SystemInitializerLLGS.cpp in Sources */,
26DC6A1D1337FECA00FF7998 /* lldb-platform.cpp in Sources */,
E769331E1A94D18100C73337 /* lldb-server.cpp in Sources */,
);
@@ -8252,6 +8416,11 @@
target = 26DC6A0F1337FE6900FF7998 /* lldb-server */;
targetProxy = 94E829C8152D33B4006F96A3 /* PBXContainerItemProxy */;
};
+ AFA9B71220606A13008E86C6 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ name = "debugserver-mini";
+ targetProxy = AFA9B71320606A13008E86C6 /* PBXContainerItemProxy */;
+ };
AFCA21D21D18E556004386B8 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
name = "debugserver-mini";
@@ -8264,14 +8433,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- "ARCHS[sdk=iphoneos*]" = (
- arm64,
- armv7,
- );
- "ARCHS[sdk=macosx*]" = (
- x86_64,
- i386,
- );
+ "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
+ "ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -8334,7 +8497,6 @@
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
LLVM_CONFIGURATION = "Release+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
@@ -8348,7 +8510,7 @@
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
- PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework;
+ PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
PYTHON_VERSION_MINOR = 7;
SDKROOT = "";
@@ -8362,8 +8524,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- "ARCHS[sdk=iphoneos*]" = arm64;
- "ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
+ "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
+ "ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -8425,7 +8587,6 @@
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
LLVM_CONFIGURATION = "Release+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
@@ -8439,7 +8600,7 @@
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
- PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework;
+ PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
PYTHON_VERSION_MINOR = 7;
SDKROOT = "";
@@ -8733,7 +8894,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/include/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8775,7 +8936,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/include/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8817,7 +8978,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/include/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -8859,7 +9020,7 @@
"$(LLVM_SOURCE_DIR)/tools/clang/include",
"$(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/tools/clang/include",
);
- LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Headers";
+ LLDB_GTESTS_CFLAGS = "-I unittests -I $(LLVM_SOURCE_DIR)/utils/unittest/googlemock/include -I $(LLVM_SOURCE_DIR)/utils/unittest/googletest/include -I $(LLVM_SOURCE_DIR)/include -I $(LLVM_BUILD_DIR)/x86_64/include -DYAML2OBJ=\"\\\"$(LLVM_BUILD_DIR)/x86_64/bin/yaml2obj\\\"\" -I include -I source -I $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/include/python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
LLDB_GTESTS_LDFLAGS = "$(LLVM_BUILD_DIR)/x86_64/lib/libgtest.a -L $(PYTHON_FRAMEWORK_PATH)/Versions/$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)/lib -l python$(PYTHON_VERSION_MAJOR).$(PYTHON_VERSION_MINOR)";
OTHER_CFLAGS = (
"-fno-rtti",
@@ -9169,14 +9330,12 @@
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = (
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
OTHER_LDFLAGS = "";
@@ -9228,14 +9387,12 @@
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = (
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
OTHER_LDFLAGS = "";
@@ -9287,14 +9444,12 @@
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = (
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
OTHER_LDFLAGS = "";
@@ -9311,11 +9466,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- "ARCHS[sdk=iphoneos*]" = arm64;
- "ARCHS[sdk=macosx*]" = (
- x86_64,
- i386,
- );
+ "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
+ "ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -9379,7 +9531,6 @@
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
LLVM_CONFIGURATION = Release;
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
- MACOSX_DEPLOYMENT_TARGET = "";
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ZLIB_CFLAGS)",
@@ -9393,7 +9544,7 @@
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
- PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework;
+ PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
PYTHON_VERSION_MINOR = 7;
SDKROOT = "";
@@ -9423,6 +9574,8 @@
"-sectcreate",
__TEXT,
__info_plist,
+ "-filelist",
+ "$(LLVM_BUILD_DIR)/archives.txt",
"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
"-Wl,-rpath,@loader_path/../../../System/Library/PrivateFrameworks",
);
@@ -9431,6 +9584,8 @@
"-sectcreate",
__TEXT,
__info_plist,
+ "-filelist",
+ "$(LLVM_BUILD_DIR)/archives.txt",
"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
"-Wl,-rpath,@loader_path/../../Library/PrivateFrameworks",
"-Wl,-rpath,@loader_path/../../../SharedFrameworks",
@@ -9985,6 +10140,8 @@
__info_plist,
"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
"-Wl,-rpath,@loader_path",
+ "-filelist",
+ "$(LLVM_BUILD_DIR)/archives.txt",
);
PRODUCT_NAME = lldb;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include";
@@ -10013,6 +10170,8 @@
__info_plist,
"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
"-Wl,-rpath,@loader_path",
+ "-filelist",
+ "$(LLVM_BUILD_DIR)/archives.txt",
);
PRODUCT_NAME = lldb;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include";
@@ -10024,14 +10183,8 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
- "ARCHS[sdk=iphoneos*]" = (
- armv7,
- arm64,
- );
- "ARCHS[sdk=macosx*]" = (
- x86_64,
- i386,
- );
+ "ARCHS[sdk=iphoneos*]" = "$(ARCHS_STANDARD)";
+ "ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD)";
CLANG_CXX_LANGUAGE_STANDARD = "c++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -10094,7 +10247,6 @@
LLVM_BUILD_DIR_ARCH = "$(CURRENT_ARCH)/";
LLVM_CONFIGURATION = "Debug+Asserts";
LLVM_SOURCE_DIR = "$(SRCROOT)/llvm";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-Wparentheses",
@@ -10108,7 +10260,7 @@
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COVERAGE_LDFLAGS)",
);
- PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework;
+ PYTHON_FRAMEWORK_PATH = /System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
PYTHON_VERSION_MINOR = 7;
SDKROOT = "";
@@ -10165,6 +10317,8 @@
__info_plist,
"$(PROJECT_DIR)/tools/driver/lldb-Info.plist",
"-Wl,-rpath,@loader_path",
+ "-filelist",
+ "$(LLVM_BUILD_DIR)/archives.txt",
);
PRODUCT_NAME = lldb;
USER_HEADER_SEARCH_PATHS = "$(SRCROOT)/include $(SRCROOT)/source $(LLVM_SOURCE_DIR)/include $(LLVM_BUILD_DIR)/$(LLVM_BUILD_DIR_ARCH)/include";
@@ -10297,14 +10451,12 @@
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*]" = (
"-fno-rtti",
"-Wglobal-constructors",
"$(OTHER_CFLAGS)",
- "-DLLDB_USE_BUILTIN_DEMANGLER",
"-DLIBXML2_DEFINED",
);
OTHER_LDFLAGS = "";
@@ -10675,6 +10827,38 @@
};
name = BuildAndIntegration;
};
+ AFA9B72020606A13008E86C6 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Debug;
+ };
+ AFA9B72120606A13008E86C6 /* DebugClang */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = DebugClang;
+ };
+ AFA9B72220606A13008E86C6 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = Release;
+ };
+ AFA9B72320606A13008E86C6 /* BuildAndIntegration */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ };
+ name = BuildAndIntegration;
+ };
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
@@ -10843,6 +11027,17 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = BuildAndIntegration;
};
+ AFA9B71F20606A13008E86C6 /* Build configuration list for PBXAggregateTarget "ios-mini" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ AFA9B72020606A13008E86C6 /* Debug */,
+ AFA9B72120606A13008E86C6 /* DebugClang */,
+ AFA9B72220606A13008E86C6 /* Release */,
+ AFA9B72320606A13008E86C6 /* BuildAndIntegration */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = BuildAndIntegration;
+ };
/* End XCConfigurationList section */
};
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
diff --git a/lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme b/lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme
index 7512a2813577..d31912ef4837 100644
--- a/lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme
+++ b/lldb.xcodeproj/xcshareddata/xcschemes/desktop.xcscheme
@@ -26,10 +26,18 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- language = ""
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
+ <MacroExpansion>
+ <BuildableReference
+ BuildableIdentifier = "primary"
+ BlueprintIdentifier = "26F5C26910F3D9A4009D5894"
+ BuildableName = "lldb"
+ BlueprintName = "lldb-tool"
+ ReferencedContainer = "container:lldb.xcodeproj">
+ </BuildableReference>
+ </MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
@@ -37,22 +45,22 @@
buildConfiguration = "DebugClang"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
- language = ""
- launchStyle = "0"
+ launchStyle = "1"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
- <MacroExpansion>
+ <BuildableProductRunnable
+ runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
- BlueprintIdentifier = "26CEF3B114FD592B007286B2"
- BuildableName = "desktop"
- BlueprintName = "desktop"
+ BlueprintIdentifier = "26F5C26910F3D9A4009D5894"
+ BuildableName = "lldb"
+ BlueprintName = "lldb-tool"
ReferencedContainer = "container:lldb.xcodeproj">
</BuildableReference>
- </MacroExpansion>
+ </BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
diff --git a/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py b/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
index c038c0726c27..5eff454c3bfb 100644
--- a/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
+++ b/packages/Python/lldbsuite/test/android/platform/TestDefaultCacheLineSize.py
@@ -19,7 +19,7 @@ class DefaultCacheLineSizeTestCase(TestBase):
@skipUnlessPlatform(['android'])
def test_cache_line_size(self):
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), "Target is valid")
diff --git a/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py b/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
index dd6dbe0a37ed..20fd3030721a 100644
--- a/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
+++ b/packages/Python/lldbsuite/test/api/check_public_api_headers/TestPublicAPIHeaders.py
@@ -16,11 +16,11 @@ from lldbsuite.test import lldbutil
class SBDirCheckerCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
TestBase.setUp(self)
self.source = 'main.cpp'
- self.exe_name = 'a.out'
self.generateSource(self.source)
@skipIfNoSBHeaders
@@ -34,16 +34,19 @@ class SBDirCheckerCase(TestBase):
self.skipTest(
"LLDB is 64-bit and cannot be linked to 32-bit test program.")
- self.buildDriver(self.source, self.exe_name)
- self.sanity_check_executable(self.exe_name)
+ exe_name = self.getBuildArtifact("a.out")
+ self.buildDriver(self.source, exe_name)
+ self.sanity_check_executable(exe_name)
def sanity_check_executable(self, exe_name):
"""Sanity check executable compiled from the auto-generated program."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe_name = self.getBuildArtifact("a.out")
+ exe = self.getBuildArtifact(exe_name)
self.runCmd("file %s" % exe, CURRENT_EXECUTABLE_SET)
+ # This test uses a generated source file, so it's in the build directory.
self.line_to_break = line_number(
- self.source, '// Set breakpoint here.')
+ self.getBuildArtifact(self.source), '// Set breakpoint here.')
env_cmd = "settings set target.env-vars %s=%s" % (
self.dylibPath, self.getLLDBLibraryEnvVal())
diff --git a/packages/Python/lldbsuite/test/api/listeners/TestListener.py b/packages/Python/lldbsuite/test/api/listeners/TestListener.py
index 65232f014102..6b6a37e5a6b8 100644
--- a/packages/Python/lldbsuite/test/api/listeners/TestListener.py
+++ b/packages/Python/lldbsuite/test/api/listeners/TestListener.py
@@ -23,10 +23,10 @@ class ListenToModuleLoadedEvents (TestBase):
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
- self.build()
def test_receiving_breakpoint_added(self):
"""Test that we get breakpoint added events, waiting on event classes on the debugger"""
+ self.build()
my_listener = lldb.SBListener("test_listener")
@@ -35,7 +35,7 @@ class ListenToModuleLoadedEvents (TestBase):
lldb.SBTarget.GetBroadcasterClassName(),
lldb.SBTarget.eBroadcastBitBreakpointChanged)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py b/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
index dc1a0d19f83e..27bd472caf99 100644
--- a/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
+++ b/packages/Python/lldbsuite/test/api/multiple-debuggers/TestMultipleDebuggers.py
@@ -18,26 +18,18 @@ class TestMultipleSimultaneousDebuggers(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ # This test case fails non-deterministically.
@skipIfNoSBHeaders
- @expectedFailureAll(bugnumber="rdar://30564102")
- @expectedFailureAll(
- archs="i[3-6]86",
- bugnumber="multi-process-driver.cpp creates an x64 target")
- @expectedFailureAll(
- oslist=[
- "windows",
- "linux",
- "freebsd"],
- bugnumber="llvm.org/pr20282")
+ @expectedFailureAll(bugnumber="llvm.org/pr20282")
def test_multiple_debuggers(self):
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
- self.driver_exe = os.path.join(os.getcwd(), "multi-process-driver")
+ self.driver_exe = self.getBuildArtifact("multi-process-driver")
self.buildDriver('multi-process-driver.cpp', self.driver_exe)
self.addTearDownHook(lambda: os.remove(self.driver_exe))
self.signBinary(self.driver_exe)
- self.inferior_exe = os.path.join(os.getcwd(), "testprog")
+ self.inferior_exe = self.getBuildArtifact("testprog")
self.buildDriver('testprog.cpp', self.inferior_exe)
self.addTearDownHook(lambda: os.remove(self.inferior_exe))
diff --git a/packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py b/packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py
index decb3fd4f0c5..f4e166955acc 100644
--- a/packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py
+++ b/packages/Python/lldbsuite/test/api/multiple-targets/TestMultipleTargets.py
@@ -26,7 +26,7 @@ class TestMultipleTargets(TestBase):
def test_multiple_targets(self):
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
- self.driver_exe = os.path.join(os.getcwd(), "multi-target")
+ self.driver_exe = self.getBuildArtifact("multi-target")
self.buildDriver('main.cpp', self.driver_exe)
self.addTearDownHook(lambda: os.remove(self.driver_exe))
self.signBinary(self.driver_exe)
diff --git a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
index 0d6a6002d522..4e550c9c24db 100644
--- a/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
+++ b/packages/Python/lldbsuite/test/api/multithreaded/TestMultithreaded.py
@@ -15,6 +15,8 @@ import subprocess
class SBBreakpointCallbackCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
def setUp(self):
TestBase.setUp(self)
self.generateSource('driver.cpp')
@@ -87,16 +89,20 @@ class SBBreakpointCallbackCase(TestBase):
self.inferior = 'inferior_program'
self.buildProgram('inferior.cpp', self.inferior)
- self.addTearDownHook(lambda: os.remove(self.inferior))
+ self.addTearDownHook(lambda:
+ os.remove(self.getBuildArtifact(self.inferior)))
self.buildDriver(sources, test_name)
- self.addTearDownHook(lambda: os.remove(test_name))
+ self.addTearDownHook(lambda:
+ os.remove(self.getBuildArtifact(test_name)))
- test_exe = os.path.join(os.getcwd(), test_name)
+ test_exe = self.getBuildArtifact(test_name)
self.signBinary(test_exe)
- exe = [test_exe, self.inferior]
+ exe = [test_exe, self.getBuildArtifact(self.inferior)]
env = {self.dylibPath: self.getLLDBLibraryEnvVal()}
+ if 'LLDB_DEBUGSERVER_PATH' in os.environ:
+ env['LLDB_DEBUGSERVER_PATH'] = os.environ['LLDB_DEBUGSERVER_PATH']
if self.TraceOn():
print("Running test %s" % " ".join(exe))
check_call(exe, env=env)
diff --git a/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py b/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
index 1abab39b1da3..30510638f096 100644
--- a/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
+++ b/packages/Python/lldbsuite/test/arm/breakpoint-it/TestBreakpointIt.py
@@ -21,7 +21,7 @@ class TestBreakpointIt(TestBase):
@skipIf(archs=no_match(["arm"]))
def test_false(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("target create %s" % exe)
lldbutil.run_break_set_by_symbol(self, "bkpt_false",
@@ -34,7 +34,7 @@ class TestBreakpointIt(TestBase):
@skipIf(archs=no_match(["arm"]))
def test_true(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("target create %s" % exe)
bpid = lldbutil.run_break_set_by_symbol(self, "bkpt_true",
diff --git a/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/Makefile b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/Makefile
new file mode 100644
index 000000000000..ea79c55cd4a9
--- /dev/null
+++ b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+CFLAGS_EXTRAS = -mthumb
+
+include $(LEVEL)/Makefile.rules \ No newline at end of file
diff --git a/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
new file mode 100644
index 000000000000..f020a6538525
--- /dev/null
+++ b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/TestBreakpointThumbCodesection.py
@@ -0,0 +1,35 @@
+"""
+Test that breakpoints correctly work in an thumb function in an arbitrary
+named codesection.
+"""
+from __future__ import print_function
+
+
+import lldb
+import os
+import time
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestBreakpointThumbCodesection(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipIf(archs=no_match(["arm"]))
+ def test_breakpoint(self):
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+ line = line_number('main.c', '// Set break point at this line.')
+
+ self.runCmd("target create %s" % exe)
+ bpid = lldbutil.run_break_set_by_file_and_line(self, "main.c", line)
+
+ self.runCmd("run")
+
+ self.assertIsNotNone(lldbutil.get_one_thread_stopped_at_breakpoint_id(
+ self.process(), bpid), "Process is not stopped at breakpoint")
+
+ self.process().Continue()
+ self.assertEqual(self.process().GetState(), lldb.eStateExited, PROCESS_EXITED)
diff --git a/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/main.c b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/main.c
new file mode 100644
index 000000000000..38ea7be6bfcd
--- /dev/null
+++ b/packages/Python/lldbsuite/test/arm/breakpoint-thumb-codesection/main.c
@@ -0,0 +1,8 @@
+__attribute__((section("__codesection")))
+int f(int a) {
+ return a + 1; // Set break point at this line.
+}
+
+int main() {
+ return f(10);
+}
diff --git a/packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py b/packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py
index 4ddda525537c..8e9244f3a3e9 100644
--- a/packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py
+++ b/packages/Python/lldbsuite/test/arm/emulation/TestEmulations.py
@@ -19,8 +19,7 @@ class ARMEmulationTestCase(TestBase):
@no_debug_info_test
def test_thumb_emulations(self):
- current_dir = os.getcwd()
- test_dir = os.path.join(current_dir, "new-test-files")
+ test_dir = os.path.join(self.getSourceDir(), "new-test-files")
files = os.listdir(test_dir)
thumb_files = list()
for f in files:
@@ -33,8 +32,7 @@ class ARMEmulationTestCase(TestBase):
@no_debug_info_test
def test_arm_emulations(self):
- current_dir = os.getcwd()
- test_dir = os.path.join(current_dir, "new-test-files")
+ test_dir = os.path.join(self.getSourceDir(), "new-test-files")
files = os.listdir(test_dir)
arm_files = list()
for f in files:
diff --git a/packages/Python/lldbsuite/test/bench-history b/packages/Python/lldbsuite/test/bench-history
deleted file mode 100644
index 471332b25221..000000000000
--- a/packages/Python/lldbsuite/test/bench-history
+++ /dev/null
@@ -1,206 +0,0 @@
-config: MacBook Pro (10.7.2)
- 2.8 GHz Intel Core 2 Duo
- 4 GB 1067 MHz DDR3
-
-r142707 (Oct 21, 2011):
-[17:45:55] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.104274 (Laps: 30, Total Elapsed Time: 3.128214)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102216 (Laps: 30, Total Elapsed Time: 3.066470)
-lldb frame variable benchmark: Avg: 1.649162 (Laps: 20, Total Elapsed Time: 32.983245)
-lldb stepping benchmark: Avg: 0.104409 (Laps: 50, Total Elapsed Time: 5.220461)
-lldb expr cmd benchmark: Avg: 0.206774 (Laps: 25, Total Elapsed Time: 5.169350)
-lldb disassembly benchmark: Avg: 0.089086 (Laps: 10, Total Elapsed Time: 0.890859)
-
-r142868 (Oct 24, 2011):
-[15:53:34] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.105384 (Laps: 30, Total Elapsed Time: 3.161530)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102334 (Laps: 30, Total Elapsed Time: 3.070012)
-lldb frame variable benchmark: Avg: 1.661701 (Laps: 20, Total Elapsed Time: 33.234026)
-lldb stepping benchmark: Avg: 0.107101 (Laps: 50, Total Elapsed Time: 5.355043)
-lldb expr cmd benchmark: Avg: 0.209475 (Laps: 25, Total Elapsed Time: 5.236863)
-lldb disassembly benchmark: Avg: 0.005543 (Laps: 10, Total Elapsed Time: 0.055426)
-[16:09:20] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103826 (Laps: 30, Total Elapsed Time: 3.114768)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102312 (Laps: 30, Total Elapsed Time: 3.069371)
-lldb frame variable benchmark: Avg: 1.602898 (Laps: 20, Total Elapsed Time: 32.057950)
-lldb stepping benchmark: Avg: 0.104091 (Laps: 50, Total Elapsed Time: 5.204557)
-lldb expr cmd benchmark: Avg: 0.207095 (Laps: 25, Total Elapsed Time: 5.177363)
-lldb disassembly benchmark: Avg: 0.001531 (Laps: 10, Total Elapsed Time: 0.015311)
-
-r143065 (Oct 26, 2011):
-# Establish a baseline by using a fixed lldb executable as the inferior program
-# for the lldb debugger to operate on. The fixed lldb executable corresponds to
-# r142902.
-[15:50:34] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103774 (Laps: 30, Total Elapsed Time: 3.113226)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102230 (Laps: 30, Total Elapsed Time: 3.066896)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.448635 (Laps: 30, Total Elapsed Time: 13.459048)
-lldb frame variable benchmark: Avg: 1.615647 (Laps: 20, Total Elapsed Time: 32.312934)
-lldb stepping benchmark: Avg: 0.138386 (Laps: 50, Total Elapsed Time: 6.919313)
-lldb expr cmd benchmark: Avg: 0.218967 (Laps: 25, Total Elapsed Time: 5.474171)
-lldb disassembly benchmark: Avg: 0.092677 (Laps: 10, Total Elapsed Time: 0.926766)
-
-# With patch to lldbbench.py to display min and max of samples.
-[17:27:09] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103625 (Laps: 30, Total Elapsed Time: 3.108748, min=0.101225, max=0.136308)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102321 (Laps: 30, Total Elapsed Time: 3.069623, min=0.101270, max=0.102824)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.445943 (Laps: 30, Total Elapsed Time: 13.378290, min=0.438535, max=0.475691)
-lldb frame variable benchmark: Avg: 1.612034 (Laps: 20, Total Elapsed Time: 32.240689, min=1.591328, max=1.649720)
-lldb stepping benchmark: Avg: 0.155064 (Laps: 50, Total Elapsed Time: 7.753182, min=0.101287, max=2.028978)
-lldb expr cmd benchmark: Avg: 0.206160 (Laps: 25, Total Elapsed Time: 5.154005, min=0.203282, max=0.224982)
-lldb disassembly benchmark: Avg: 0.032946 (Laps: 10, Total Elapsed Time: 0.329464, min=0.031380, max=0.039198)
-
-r143118 (Oct 27, 2011):
-# No performance regression.
-[11:30:10] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.109056 (Laps: 30, Total Elapsed Time: 3.271690, min=0.101212, max=0.296496)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102844 (Laps: 30, Total Elapsed Time: 3.085306, min=0.101028, max=0.112504)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.467196 (Laps: 30, Total Elapsed Time: 14.015870, min=0.430639, max=1.059366)
-lldb frame variable benchmark: Avg: 1.615098 (Laps: 20, Total Elapsed Time: 32.301958, min=1.599064, max=1.665124)
-lldb stepping benchmark: Avg: 0.158506 (Laps: 50, Total Elapsed Time: 7.925285, min=0.101469, max=1.724667)
-lldb expr cmd benchmark: Avg: 0.232584 (Laps: 25, Total Elapsed Time: 5.814609, min=0.202931, max=0.782470)
-lldb disassembly benchmark: Avg: 0.090124 (Laps: 10, Total Elapsed Time: 0.901241, min=0.087497, max=0.099313)
-[11:37:23] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103782 (Laps: 30, Total Elapsed Time: 3.113456, min=0.101887, max=0.136767)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102348 (Laps: 30, Total Elapsed Time: 3.070431, min=0.101648, max=0.102756)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.445628 (Laps: 30, Total Elapsed Time: 13.368829, min=0.438276, max=0.455466)
-lldb frame variable benchmark: Avg: 1.583635 (Laps: 20, Total Elapsed Time: 31.672710, min=0.133858, max=2.073698)
-lldb stepping benchmark: Avg: 0.157824 (Laps: 50, Total Elapsed Time: 7.891186, min=0.101352, max=2.172388)
-lldb expr cmd benchmark: Avg: 0.207600 (Laps: 25, Total Elapsed Time: 5.189992, min=0.203037, max=0.241189)
-lldb disassembly benchmark: Avg: 0.006725 (Laps: 10, Total Elapsed Time: 0.067249, min=0.002470, max=0.042690)
-
-r143199 (Oct 28, 2011):
-# No performance regression.
-[11:11:54] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.104717 (Laps: 30, Total Elapsed Time: 3.141521, min=0.101881, max=0.162480)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.116985 (Laps: 30, Total Elapsed Time: 3.509554, min=0.101890, max=0.537634)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.462864 (Laps: 30, Total Elapsed Time: 13.885922, min=0.434867, max=0.877184)
-lldb frame variable benchmark: Avg: 1.749605 (Laps: 20, Total Elapsed Time: 34.992090, min=1.604043, max=2.365440)
-lldb stepping benchmark: Avg: 0.147439 (Laps: 50, Total Elapsed Time: 7.371955, min=0.101088, max=2.360912)
-lldb expr cmd benchmark: Avg: 0.210252 (Laps: 25, Total Elapsed Time: 5.256302, min=0.202591, max=0.258185)
-lldb disassembly benchmark: Avg: 0.028243 (Laps: 10, Total Elapsed Time: 0.282434, min=0.027451, max=0.031222)
-[11:16:16] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103913 (Laps: 30, Total Elapsed Time: 3.117384, min=0.101510, max=0.136605)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102452 (Laps: 30, Total Elapsed Time: 3.073559, min=0.101508, max=0.105250)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.461532 (Laps: 30, Total Elapsed Time: 13.845950, min=0.436977, max=0.676502)
-lldb frame variable benchmark: Avg: 1.640990 (Laps: 20, Total Elapsed Time: 32.819801, min=1.583961, max=2.031209)
-lldb stepping benchmark: Avg: 0.104966 (Laps: 50, Total Elapsed Time: 5.248294, min=0.101296, max=0.240781)
-lldb expr cmd benchmark: Avg: 0.211872 (Laps: 25, Total Elapsed Time: 5.296811, min=0.203827, max=0.259524)
-lldb disassembly benchmark: Avg: 0.104108 (Laps: 10, Total Elapsed Time: 1.041076, min=0.089751, max=0.227173)
-
-r143260
-# No performance regression.
-[16:51:27] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103818 (Laps: 30, Total Elapsed Time: 3.114534, min=0.101654, max=0.135579)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102786 (Laps: 30, Total Elapsed Time: 3.083594, min=0.101567, max=0.115159)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.444478 (Laps: 30, Total Elapsed Time: 13.334348, min=0.429840, max=0.514523)
-lldb frame variable benchmark: Avg: 1.627282 (Laps: 20, Total Elapsed Time: 32.545639, min=1.596098, max=1.768229)
-lldb stepping benchmark: Avg: 0.134925 (Laps: 50, Total Elapsed Time: 6.746272, min=0.101132, max=1.743882)
-lldb expr cmd benchmark: Avg: 0.209595 (Laps: 25, Total Elapsed Time: 5.239863, min=0.203182, max=0.255394)
-lldb disassembly benchmark: Avg: 0.091296 (Laps: 10, Total Elapsed Time: 0.912963, min=0.089690, max=0.103690)
-[17:31:27] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.104030 (Laps: 30, Total Elapsed Time: 3.120891, min=0.101980, max=0.136737)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102375 (Laps: 30, Total Elapsed Time: 3.071264, min=0.101454, max=0.103283)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.443155 (Laps: 30, Total Elapsed Time: 13.294637, min=0.434646, max=0.459273)
-lldb frame variable benchmark: Avg: 1.608266 (Laps: 20, Total Elapsed Time: 32.165314, min=1.596172, max=1.620366)
-lldb stepping benchmark: Avg: 0.104140 (Laps: 50, Total Elapsed Time: 5.207003, min=0.101436, max=0.196166)
-lldb expr cmd benchmark: Avg: 0.208264 (Laps: 25, Total Elapsed Time: 5.206604, min=0.204082, max=0.258287)
-lldb disassembly benchmark: Avg: 0.091677 (Laps: 10, Total Elapsed Time: 0.916773, min=0.090101, max=0.099648)
-
-r143359
-# No performance regression.
-[13:20:01] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.106920 (Laps: 30, Total Elapsed Time: 3.207593, min=0.101197, max=0.197640)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.147324 (Laps: 30, Total Elapsed Time: 4.419733, min=0.101534, max=0.900991)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.463680 (Laps: 30, Total Elapsed Time: 13.910386, min=0.429071, max=0.872424)
-lldb frame variable benchmark: Avg: 1.655778 (Laps: 20, Total Elapsed Time: 33.115570, min=1.597218, max=1.779512)
-lldb stepping benchmark: Avg: 0.145967 (Laps: 50, Total Elapsed Time: 7.298373, min=0.101121, max=2.288423)
-lldb expr cmd benchmark: Avg: 0.207389 (Laps: 25, Total Elapsed Time: 5.184725, min=0.203226, max=0.240773)
-lldb disassembly benchmark: Avg: 0.091902 (Laps: 10, Total Elapsed Time: 0.919019, min=0.088413, max=0.115076)
-[13:24:24] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.150258 (Laps: 30, Total Elapsed Time: 4.507753, min=0.101110, max=1.296165)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.192823 (Laps: 30, Total Elapsed Time: 5.784686, min=0.101897, max=0.697168)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.451879 (Laps: 30, Total Elapsed Time: 13.556380, min=0.428884, max=0.536964)
-lldb frame variable benchmark: Avg: 1.725232 (Laps: 20, Total Elapsed Time: 34.504649, min=1.596926, max=2.303283)
-lldb stepping benchmark: Avg: 0.111959 (Laps: 50, Total Elapsed Time: 5.597941, min=0.101375, max=0.586357)
-lldb expr cmd benchmark: Avg: 0.207557 (Laps: 25, Total Elapsed Time: 5.188913, min=0.203918, max=0.241022)
-lldb disassembly benchmark: Avg: 0.092959 (Laps: 10, Total Elapsed Time: 0.929594, min=0.089094, max=0.109135)
-
-r143469
-# No performance regression.
-[11:45:27] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.112890 (Laps: 30, Total Elapsed Time: 3.386693, min=0.101696, max=0.414717)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.133955 (Laps: 30, Total Elapsed Time: 4.018643, min=0.101611, max=1.050222)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.470838 (Laps: 30, Total Elapsed Time: 14.125148, min=0.425866, max=1.437070)
-lldb frame variable benchmark: Avg: 1.608339 (Laps: 20, Total Elapsed Time: 32.166771, min=1.579538, max=1.721902)
-lldb stepping benchmark: Avg: 0.136881 (Laps: 50, Total Elapsed Time: 6.844043, min=0.101149, max=1.835094)
-lldb expr cmd benchmark: Avg: 0.207529 (Laps: 25, Total Elapsed Time: 5.188236, min=0.203476, max=0.241281)
-lldb disassembly benchmark: Avg: 0.036412 (Laps: 10, Total Elapsed Time: 0.364124, min=0.031895, max=0.069457)
-[12:14:54] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103313 (Laps: 30, Total Elapsed Time: 3.099402, min=0.101813, max=0.126989)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102558 (Laps: 30, Total Elapsed Time: 3.076735, min=0.101576, max=0.107419)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.438302 (Laps: 30, Total Elapsed Time: 13.149063, min=0.431972, max=0.449742)
-lldb frame variable benchmark: Avg: 1.610409 (Laps: 20, Total Elapsed Time: 32.208184, min=1.575063, max=1.724046)
-lldb stepping benchmark: Avg: 0.103874 (Laps: 50, Total Elapsed Time: 5.193698, min=0.101364, max=0.186751)
-lldb expr cmd benchmark: Avg: 0.207476 (Laps: 25, Total Elapsed Time: 5.186895, min=0.203365, max=0.240869)
-lldb disassembly benchmark: Avg: 0.090917 (Laps: 10, Total Elapsed Time: 0.909167, min=0.089431, max=0.099787)
-
-r144546
-# Observed possible performance regression in lldb startup delay (run to breakpoint)?
-# Need more investigation.
-[11:27:23] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.112386 (Laps: 30, Total Elapsed Time: 3.371577, min=0.101772, max=0.393109)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.108774 (Laps: 30, Total Elapsed Time: 3.263209, min=0.101605, max=0.292425)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.529530 (Laps: 30, Total Elapsed Time: 15.885899, min=0.468891, max=1.747227)
-lldb frame variable benchmark: Avg: 1.631610 (Laps: 20, Total Elapsed Time: 32.632193, min=1.575342, max=1.775941)
-lldb stepping benchmark: Avg: 0.146749 (Laps: 50, Total Elapsed Time: 7.337451, min=0.100780, max=2.165057)
-lldb expr cmd benchmark: Avg: 0.217782 (Laps: 25, Total Elapsed Time: 5.444553, min=0.203476, max=0.467801)
-lldb disassembly benchmark: Avg: 0.091264 (Laps: 10, Total Elapsed Time: 0.912644, min=0.088928, max=0.101681)
-[14:58:21] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.105535 (Laps: 30, Total Elapsed Time: 3.166062, min=0.101935, max=0.147107)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102372 (Laps: 30, Total Elapsed Time: 3.071164, min=0.100945, max=0.102721)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.483826 (Laps: 30, Total Elapsed Time: 14.514786, min=0.471770, max=0.532260)
-lldb frame variable benchmark: Avg: 1.576992 (Laps: 20, Total Elapsed Time: 31.539838, min=0.102487, max=2.098732)
-lldb stepping benchmark: Avg: 0.102836 (Laps: 50, Total Elapsed Time: 5.141815, min=0.101461, max=0.122378)
-lldb expr cmd benchmark: Avg: 0.206334 (Laps: 25, Total Elapsed Time: 5.158355, min=0.203804, max=0.241043)
-lldb disassembly benchmark: Avg: 0.033536 (Laps: 10, Total Elapsed Time: 0.335359, min=0.031975, max=0.041612)
-[15:01:59] johnny:/Volumes/data/lldb/svn/trunk/test $
-
-# Redid the r143469 measurements (svn/regress dir) right before the r145371 measurements (svn/trunk dir) on 10.7.2 (build 11C74).
-# The lldb startup delay (run to breakpoint) in avg is not as significant. The min still shows some possible regression.
-# The frame variable benchmark shows some possible regression.
-[10:51:56] johnny:/Volumes/data/lldb/svn/regress/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.109821 (Laps: 30, Total Elapsed Time: 3.294643, min=0.101836, max=0.297468)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.121465 (Laps: 30, Total Elapsed Time: 3.643950, min=0.100776, max=0.665900)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.501870 (Laps: 30, Total Elapsed Time: 15.056112, min=0.469871, max=0.718775)
-lldb frame variable benchmark: Avg: 1.663890 (Laps: 20, Total Elapsed Time: 33.277791, min=1.584265, max=1.999998)
-lldb stepping benchmark: Avg: 0.105434 (Laps: 50, Total Elapsed Time: 5.271683, min=0.101120, max=0.256289)
-lldb expr cmd benchmark: Avg: 0.240440 (Laps: 25, Total Elapsed Time: 6.011000, min=0.203547, max=0.956405)
-lldb disassembly benchmark: Avg: 0.096988 (Laps: 10, Total Elapsed Time: 0.969877, min=0.089511, max=0.147797)
-[10:55:38] johnny:/Volumes/data/lldb/svn/regress/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.107368 (Laps: 30, Total Elapsed Time: 3.221026, min=0.101374, max=0.163785)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.153588 (Laps: 30, Total Elapsed Time: 4.607645, min=0.101554, max=0.776372)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.510726 (Laps: 30, Total Elapsed Time: 15.321779, min=0.468395, max=0.643357)
-lldb frame variable benchmark: Avg: 1.715136 (Laps: 20, Total Elapsed Time: 34.302718, min=1.527872, max=3.125777)
-lldb stepping benchmark: Avg: 0.116140 (Laps: 50, Total Elapsed Time: 5.807012, min=0.100857, max=0.796673)
-lldb expr cmd benchmark: Avg: 0.206397 (Laps: 25, Total Elapsed Time: 5.159914, min=0.203491, max=0.241283)
-lldb disassembly benchmark: Avg: 0.036542 (Laps: 10, Total Elapsed Time: 0.365422, min=0.031872, max=0.060183)
-[10:59:43] johnny:/Volumes/data/lldb/svn/regress/test $ pushd +1
-/Volumes/data/lldb/svn/trunk/test /Volumes/data/lldb/llvm /Volumes/data/lldb/svn/regress/test
-[10:59:48] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103919 (Laps: 30, Total Elapsed Time: 3.117560, min=0.101766, max=0.137548)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.102705 (Laps: 30, Total Elapsed Time: 3.081165, min=0.101311, max=0.114192)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.504830 (Laps: 30, Total Elapsed Time: 15.144906, min=0.483528, max=0.627122)
-lldb frame variable benchmark: Avg: 1.924774 (Laps: 20, Total Elapsed Time: 38.495475, min=1.798745, max=2.248269)
-lldb stepping benchmark: Avg: 0.102595 (Laps: 50, Total Elapsed Time: 5.129757, min=0.100690, max=0.125930)
-lldb expr cmd benchmark: Avg: 0.205395 (Laps: 25, Total Elapsed Time: 5.134883, min=0.202864, max=0.210484)
-lldb disassembly benchmark: Avg: 0.033576 (Laps: 10, Total Elapsed Time: 0.335765, min=0.032021, max=0.039222)
-[11:03:46] johnny:/Volumes/data/lldb/svn/trunk/test $ ./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-lldb startup delay (create fresh target) benchmark: Avg: 0.103371 (Laps: 30, Total Elapsed Time: 3.101121, min=0.101556, max=0.127819)
-lldb startup delay (set first breakpoint) benchmark: Avg: 0.103174 (Laps: 30, Total Elapsed Time: 3.095230, min=0.101763, max=0.114733)
-lldb startup delay (run to breakpoint) benchmark: Avg: 0.513848 (Laps: 30, Total Elapsed Time: 15.415439, min=0.490004, max=0.748310)
-lldb frame variable benchmark: Avg: 1.906068 (Laps: 20, Total Elapsed Time: 38.121364, min=1.872328, max=2.044472)
-lldb stepping benchmark: Avg: 0.254817 (Laps: 50, Total Elapsed Time: 12.740872, min=0.100743, max=7.628899)
-lldb expr cmd benchmark: Avg: 0.207850 (Laps: 25, Total Elapsed Time: 5.196255, min=0.203986, max=0.257482)
-lldb disassembly benchmark: Avg: 0.092003 (Laps: 10, Total Elapsed Time: 0.920026, min=0.089568, max=0.100374)
-[11:07:53] johnny:/Volumes/data/lldb/svn/trunk/test $
diff --git a/packages/Python/lldbsuite/test/bench.py b/packages/Python/lldbsuite/test/bench.py
index 5a0fec7534a8..41d44bad987e 100644
--- a/packages/Python/lldbsuite/test/bench.py
+++ b/packages/Python/lldbsuite/test/bench.py
@@ -10,8 +10,6 @@ test driver.
Use the following to get only the benchmark results in your terminal output:
./bench.py -e /Volumes/data/lldb/svn/regression/build/Debug/lldb -x '-F Driver::MainLoop()' 2>&1 | grep -P '^lldb.*benchmark:'
-
-See also bench-history.
"""
from __future__ import print_function
diff --git a/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py b/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
index 74336693bcb2..acc09224050d 100644
--- a/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
+++ b/packages/Python/lldbsuite/test/benchmarks/continue/TestBenchmarkContinue.py
@@ -30,7 +30,8 @@ class TestBenchmarkContinue(BenchBase):
def data_formatter_commands(self):
"""Benchmark different ways to continue a process"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file "+self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py b/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
index a9899d93bf03..064e7b3f5209 100644
--- a/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
+++ b/packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
@@ -39,7 +39,7 @@ class ExpressionEvaluationCase(BenchBase):
def run_lldb_repeated_exprs(self, exe_name, count):
import pexpect
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
diff --git a/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py b/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
index a223d2cf1fa7..dcbd36cc1387 100644
--- a/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
+++ b/packages/Python/lldbsuite/test/benchmarks/expression/TestRepeatedExprs.py
@@ -44,7 +44,7 @@ class RepeatedExprsCase(BenchBase):
def run_lldb_repeated_exprs(self, exe_name, count):
import pexpect
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Set self.child_prompt, which is "(lldb) ".
self.child_prompt = '(lldb) '
@@ -94,7 +94,7 @@ class RepeatedExprsCase(BenchBase):
def run_gdb_repeated_exprs(self, exe_name, count):
import pexpect
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Set self.child_prompt, which is "(gdb) ".
self.child_prompt = '(gdb) '
diff --git a/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py b/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
index 659382e7311b..4ebb111c8026 100644
--- a/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
+++ b/packages/Python/lldbsuite/test/benchmarks/libcxxlist/TestBenchmarkLibcxxList.py
@@ -30,7 +30,8 @@ class TestBenchmarkLibcxxList(BenchBase):
def data_formatter_commands(self):
"""Benchmark the std::list data formatter (libc++)"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py b/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
index 343f93d95c4e..0c50661c5c70 100644
--- a/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
+++ b/packages/Python/lldbsuite/test/benchmarks/libcxxmap/TestBenchmarkLibcxxMap.py
@@ -30,7 +30,8 @@ class TestBenchmarkLibcxxMap(BenchBase):
def data_formatter_commands(self):
"""Benchmark the std::map data formatter (libc++)"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " +self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/concurrent_base.py b/packages/Python/lldbsuite/test/concurrent_base.py
index 4a7ae0b9c279..574b305afcbe 100644
--- a/packages/Python/lldbsuite/test/concurrent_base.py
+++ b/packages/Python/lldbsuite/test/concurrent_base.py
@@ -32,13 +32,12 @@ class ConcurrentEventsBase(TestBase):
super(ConcurrentEventsBase, self).setUp()
# Find the line number for our breakpoint.
self.filename = 'main.cpp'
- source_relpath = os.path.join(os.path.pardir, self.filename)
self.thread_breakpoint_line = line_number(
- source_relpath, '// Set breakpoint here')
+ self.filename, '// Set breakpoint here')
self.setup_breakpoint_line = line_number(
- source_relpath, '// Break here and adjust num')
+ self.filename, '// Break here and adjust num')
self.finish_breakpoint_line = line_number(
- source_relpath, '// Break here and verify one thread is active')
+ self.filename, '// Break here and verify one thread is active')
def describe_threads(self):
ret = []
@@ -114,7 +113,7 @@ class ConcurrentEventsBase(TestBase):
watchpoint_func. The inferior is continued until exit or a crash takes place, and the number of events seen by LLDB
is verified to match the expected number of events.
"""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Get the target
diff --git a/packages/Python/lldbsuite/test/configuration.py b/packages/Python/lldbsuite/test/configuration.py
index a49948c02050..94781050dc4b 100644
--- a/packages/Python/lldbsuite/test/configuration.py
+++ b/packages/Python/lldbsuite/test/configuration.py
@@ -24,40 +24,6 @@ import unittest2
import lldbsuite
-def __setCrashInfoHook_Mac(text):
- from . import crashinfo
- crashinfo.setCrashReporterDescription(text)
-
-
-def setupCrashInfoHook():
- if platform.system() == "Darwin":
- from . import lock
- test_dir = os.environ['LLDB_TEST']
- if not test_dir or not os.path.exists(test_dir):
- return
- dylib_lock = os.path.join(test_dir, "crashinfo.lock")
- dylib_src = os.path.join(test_dir, "crashinfo.c")
- dylib_dst = os.path.join(test_dir, "crashinfo.so")
- try:
- compile_lock = lock.Lock(dylib_lock)
- compile_lock.acquire()
- if not os.path.isfile(dylib_dst) or os.path.getmtime(
- dylib_dst) < os.path.getmtime(dylib_src):
- # we need to compile
- cmd = "SDKROOT= xcrun clang %s -o %s -framework Python -Xlinker -dylib" % (
- dylib_src, dylib_dst)
- if subprocess.call(
- cmd, shell=True) != 0 or not os.path.isfile(dylib_dst):
- raise Exception('command failed: "{}"'.format(cmd))
- finally:
- compile_lock.release()
- del compile_lock
-
- setCrashInfoHook = __setCrashInfoHook_Mac
-
- else:
- pass
-
# The test suite.
suite = unittest2.TestSuite()
@@ -141,6 +107,9 @@ lldb_platform_name = None
lldb_platform_url = None
lldb_platform_working_dir = None
+# The base directory in which the tests are being built.
+test_build_dir = None
+
# Parallel execution settings
is_inferior_test_runner = False
multiprocess_test_subdir = None
@@ -164,10 +133,6 @@ rerun_max_file_threhold = 0
# same base name.
all_tests = set()
-# safe default
-setCrashInfoHook = lambda x: None
-
-
def shouldSkipBecauseOfCategories(test_categories):
if useCategories:
if len(test_categories) == 0 or len(
diff --git a/packages/Python/lldbsuite/test/crashinfo.c b/packages/Python/lldbsuite/test/crashinfo.c
deleted file mode 100644
index 19013468bb26..000000000000
--- a/packages/Python/lldbsuite/test/crashinfo.c
+++ /dev/null
@@ -1,64 +0,0 @@
-/******************************************************************************
- The LLVM Compiler Infrastructure
-
- This file is distributed under the University of Illinois Open Source
- License. See LICENSE.TXT for details.
- ******************************************************************************
-
-* This C file vends a simple interface to set the Application Specific Info
-* on Mac OS X through Python. To use, compile as a dylib, import crashinfo
-* and call crashinfo.setCrashReporterDescription("hello world")
-* The testCrashReporterDescription() API is simply there to let you test that this
-* is doing what it is intended to do without having to actually cons up a crash
-******************************************************************************/
-
-#include <Python/Python.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-void *__crashreporter_info__ = NULL;
-
-asm(".desc ___crashreporter_info__, 0x10");
-
-static PyObject* setCrashReporterDescription(PyObject* self, PyObject* string)
-{
- if (__crashreporter_info__)
- {
- free(__crashreporter_info__);
- __crashreporter_info__ = NULL;
- }
-
- if (string && PyString_Check(string))
- {
- Py_ssize_t size = PyString_Size(string);
- char* data = PyString_AsString(string);
- if (size > 0 && data)
- {
- ++size; // Include the NULL terminateor in allocation and memcpy()
- __crashreporter_info__ = malloc(size);
- memcpy(__crashreporter_info__, data, size);
- return Py_True;
- }
- }
- return Py_False;
-}
-
-static PyObject* testCrashReporterDescription(PyObject*self, PyObject* arg)
-{
- int* ptr = 0;
- *ptr = 1;
- return Py_None;
-}
-
-static PyMethodDef crashinfo_methods[] = {
- {"setCrashReporterDescription", setCrashReporterDescription, METH_O},
- {"testCrashReporterDescription", testCrashReporterDescription, METH_O},
- {NULL, NULL}
-};
-
-void initcrashinfo()
-{
- (void) Py_InitModule("crashinfo", crashinfo_methods);
-}
-
diff --git a/packages/Python/lldbsuite/test/darwin_log.py b/packages/Python/lldbsuite/test/darwin_log.py
index 3207ef0bccd8..8756eca3016a 100644
--- a/packages/Python/lldbsuite/test/darwin_log.py
+++ b/packages/Python/lldbsuite/test/darwin_log.py
@@ -162,7 +162,7 @@ class DarwinLogTestBase(lldbtest.TestBase):
if enable_options is not None and len(enable_options) > 0:
enable_cmd += ' ' + ' '.join(enable_options)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.run_lldb_to_breakpoint(exe, self.source, self.line,
enable_command=enable_cmd,
settings_commands=settings_commands)
@@ -346,7 +346,7 @@ class DarwinLogEventBasedTestBase(lldbtest.TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -382,7 +382,7 @@ class DarwinLogEventBasedTestBase(lldbtest.TestBase):
# self.runCmd("log enable lldb process")
# Launch the process - doesn't stop at entry.
- process = target.LaunchSimple(None, None, os.getcwd())
+ process = target.LaunchSimple(None, None, self.getBuildDir())
self.assertIsNotNone(process, lldbtest.PROCESS_IS_VALID)
# Keep track of whether we're tracing output.
diff --git a/packages/Python/lldbsuite/test/decorators.py b/packages/Python/lldbsuite/test/decorators.py
index 95455f715cdc..1fdfd2caac00 100644
--- a/packages/Python/lldbsuite/test/decorators.py
+++ b/packages/Python/lldbsuite/test/decorators.py
@@ -4,11 +4,13 @@ from __future__ import print_function
# System modules
from distutils.version import LooseVersion, StrictVersion
from functools import wraps
+import inspect
import os
import platform
import re
import sys
import tempfile
+import subprocess
# Third-party modules
import six
@@ -20,6 +22,7 @@ import use_lldb_suite
import lldb
from . import configuration
from . import test_categories
+from . import lldbtest_config
from lldbsuite.test_event.event_builder import EventBuilder
from lldbsuite.support import funcutils
from lldbsuite.test import lldbplatform
@@ -170,7 +173,7 @@ def _decorateTest(mode,
skip_for_arch = _match_decorator_property(
archs, self.getArchitecture())
skip_for_debug_info = _match_decorator_property(
- debug_info, self.debug_info)
+ debug_info, self.getDebugInfo())
skip_for_triple = _match_decorator_property(
triple, lldb.DBG.GetSelectedPlatform().GetTriple())
skip_for_remote = _match_decorator_property(
@@ -303,9 +306,13 @@ def add_test_categories(cat):
if isinstance(func, type) and issubclass(func, unittest2.TestCase):
raise Exception(
"@add_test_categories can only be used to decorate a test method")
- if hasattr(func, "categories"):
- cat.extend(func.categories)
- func.categories = cat
+ try:
+ if hasattr(func, "categories"):
+ cat.extend(func.categories)
+ setattr(func, "categories", cat)
+ except AttributeError:
+ raise Exception('Cannot assign categories to inline tests.')
+
return func
return impl
@@ -337,6 +344,28 @@ def no_debug_info_test(func):
wrapper.__no_debug_info_test__ = True
return wrapper
+def apple_simulator_test(platform):
+ """
+ Decorate the test as a test requiring a simulator for a specific platform.
+
+ Consider that a simulator is available if you have the corresponding SDK installed.
+ The SDK identifiers for simulators are iphonesimulator, appletvsimulator, watchsimulator
+ """
+ def should_skip_simulator_test():
+ if lldbplatformutil.getHostPlatform() != 'darwin':
+ return "simulator tests are run only on darwin hosts"
+ try:
+ DEVNULL = open(os.devnull, 'w')
+ output = subprocess.check_output(["xcodebuild", "-showsdks"], stderr=DEVNULL)
+ if re.search('%ssimulator' % platform, output):
+ return None
+ else:
+ return "%s simulator is not supported on this system." % platform
+ except subprocess.CalledProcessError:
+ return "%s is not supported on this system (xcodebuild failed)." % feature
+
+ return skipTestIfFn(should_skip_simulator_test)
+
def debugserver_test(func):
"""Decorate the item as a debugserver test."""
@@ -428,15 +457,9 @@ def expectedFlakey(expected_fn, bugnumber=None):
return expectedFailure_impl
-def expectedFlakeyDwarf(bugnumber=None):
- def fn(self):
- return self.debug_info == "dwarf"
- return expectedFlakey(fn, bugnumber)
-
-
def expectedFlakeyDsym(bugnumber=None):
def fn(self):
- return self.debug_info == "dwarf"
+ return self.getDebugInfo() == "dwarf"
return expectedFlakey(fn, bugnumber)
@@ -468,27 +491,6 @@ def expectedFlakeyNetBSD(bugnumber=None, compilers=None):
return expectedFlakeyOS(['netbsd'], bugnumber, compilers)
-def expectedFlakeyCompiler(compiler, compiler_version=None, bugnumber=None):
- if compiler_version is None:
- compiler_version = ['=', None]
-
- def fn(self):
- return compiler in self.getCompiler() and self.expectedCompilerVersion(compiler_version)
- return expectedFlakey(fn, bugnumber)
-
-# @expectedFlakeyClang('bugnumber', ['<=', '3.4'])
-
-
-def expectedFlakeyClang(bugnumber=None, compiler_version=None):
- return expectedFlakeyCompiler('clang', compiler_version, bugnumber)
-
-# @expectedFlakeyGcc('bugnumber', ['<=', '3.4'])
-
-
-def expectedFlakeyGcc(bugnumber=None, compiler_version=None):
- return expectedFlakeyCompiler('gcc', compiler_version, bugnumber)
-
-
def expectedFlakeyAndroid(bugnumber=None, api_levels=None, archs=None):
return expectedFlakey(
_skip_for_android(
@@ -497,6 +499,11 @@ def expectedFlakeyAndroid(bugnumber=None, api_levels=None, archs=None):
archs),
bugnumber)
+def skipIfOutOfTreeDebugserver(func):
+ """Decorate the item to skip tests if using an out-of-tree debugserver."""
+ def is_out_of_tree_debugserver():
+ return "out-of-tree debugserver" if lldbtest_config.out_of_tree_debugserver else None
+ return skipTestIfFn(is_out_of_tree_debugserver)(func)
def skipIfRemote(func):
"""Decorate the item to skip tests if testing remotely."""
@@ -518,7 +525,7 @@ def skipIfNoSBHeaders(func):
'LLDB.h')
if os.path.exists(header):
return None
-
+
header = os.path.join(
os.environ["LLDB_SRC"],
"include",
@@ -667,6 +674,18 @@ def skipIfTargetAndroid(api_levels=None, archs=None):
api_levels,
archs))
+def skipUnlessSupportedTypeAttribute(attr):
+ """Decorate the item to skip test unless Clang supports type __attribute__(attr)."""
+ def compiler_doesnt_support_struct_attribute(self):
+ compiler_path = self.getCompiler()
+ f = tempfile.NamedTemporaryFile()
+ cmd = [self.getCompiler(), "-x", "c++", "-c", "-o", f.name, "-"]
+ p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True)
+ stdout, stderr = p.communicate('struct __attribute__((%s)) Test {};'%attr)
+ if attr in stderr:
+ return "Compiler does not support attribute %s"%(attr)
+ return None
+ return skipTestIfFn(compiler_doesnt_support_struct_attribute)
def skipUnlessThreadSanitizer(func):
"""Decorate the item to skip test unless Clang -fsanitize=thread is supported."""
@@ -696,7 +715,7 @@ def skipUnlessUndefinedBehaviorSanitizer(func):
def is_compiler_clang_with_ubsan(self):
# Write out a temp file which exhibits UB.
- inputf = tempfile.NamedTemporaryFile(suffix='.c')
+ inputf = tempfile.NamedTemporaryFile(suffix='.c', mode='w')
inputf.write('int main() { int x = 0; return x / x; }\n')
inputf.flush()
@@ -755,3 +774,39 @@ def skipUnlessAddressSanitizer(func):
return "Compiler cannot compile with -fsanitize=address"
return None
return skipTestIfFn(is_compiler_with_address_sanitizer)(func)
+
+def skipIfXmlSupportMissing(func):
+ config = lldb.SBDebugger.GetBuildConfiguration()
+ xml = config.GetValueForKey("xml")
+
+ fail_value = True # More likely to notice if something goes wrong
+ have_xml = xml.GetValueForKey("value").GetBooleanValue(fail_value)
+ return unittest2.skipIf(not have_xml, "requires xml support")(func)
+
+def skipIfLLVMTargetMissing(target):
+ config = lldb.SBDebugger.GetBuildConfiguration()
+ targets = config.GetValueForKey("targets").GetValueForKey("value")
+ found = False
+ for i in range(targets.GetSize()):
+ if targets.GetItemAtIndex(i).GetStringValue(99) == target:
+ found = True
+ break
+
+ return unittest2.skipIf(not found, "requires " + target)
+
+# Call sysctl on darwin to see if a specified hardware feature is available on this machine.
+def skipUnlessFeature(feature):
+ def is_feature_enabled(self):
+ if platform.system() == 'Darwin':
+ try:
+ DEVNULL = open(os.devnull, 'w')
+ output = subprocess.check_output(["/usr/sbin/sysctl", feature], stderr=DEVNULL)
+ # If 'feature: 1' was output, then this feature is available and
+ # the test should not be skipped.
+ if re.match('%s: 1\s*' % feature, output):
+ return None
+ else:
+ return "%s is not supported on this system." % feature
+ except subprocess.CalledProcessError:
+ return "%s is not supported on this system." % feature
+ return skipTestIfFn(is_feature_enabled)
diff --git a/packages/Python/lldbsuite/test/dosep.py b/packages/Python/lldbsuite/test/dosep.py
index 763793af93ed..616fbf381edf 100644
--- a/packages/Python/lldbsuite/test/dosep.py
+++ b/packages/Python/lldbsuite/test/dosep.py
@@ -470,20 +470,19 @@ def call_with_timeout(
return process_driver.results
-def process_dir(root, files, dotest_argv, inferior_pid_events):
- """Examine a directory for tests, and invoke any found within it."""
+def process_file(test_file, dotest_argv, inferior_pid_events):
+ """Run tests in the specified file in a subprocess and gather the results."""
results = []
- for (base_name, full_test_path) in files:
- import __main__ as main
- global dotest_options
- if dotest_options.p and not re.search(dotest_options.p, base_name):
- continue
+ base_name = os.path.basename(test_file)
+ import __main__ as main
+ global dotest_options
+ if not dotest_options.p or re.search(dotest_options.p, base_name):
script_file = main.__file__
command = ([sys.executable, script_file] +
dotest_argv +
["-S", dotest_options.session_file_format] +
- ["--inferior", "-p", base_name, root])
+ ["--inferior", "-p", base_name, os.path.dirname(test_file)])
timeout_name = os.path.basename(os.path.splitext(base_name)[0]).upper()
@@ -491,7 +490,7 @@ def process_dir(root, files, dotest_argv, inferior_pid_events):
getDefaultTimeout(dotest_options.lldb_platform_name))
results.append(call_with_timeout(
- command, timeout, base_name, inferior_pid_events, full_test_path))
+ command, timeout, base_name, inferior_pid_events, test_file))
# result = (name, status, passes, failures, unexpected_successes)
timed_out = [name for name, status, _, _, _ in results
@@ -535,7 +534,7 @@ def process_dir_worker_multiprocessing(
while not job_queue.empty():
try:
job = job_queue.get(block=False)
- result = process_dir(job[0], job[1], job[2],
+ result = process_file(job[0], job[1], job[2],
inferior_pid_events)
result_queue.put(result)
except queue.Empty:
@@ -543,11 +542,11 @@ def process_dir_worker_multiprocessing(
pass
-def process_dir_worker_multiprocessing_pool(args):
- return process_dir(*args)
+def process_file_worker_multiprocessing_pool(args):
+ return process_file(*args)
-def process_dir_worker_threading(job_queue, result_queue, inferior_pid_events):
+def process_file_worker_threading(job_queue, result_queue, inferior_pid_events):
"""Worker thread main loop when in threading mode.
This one supports the hand-rolled pooling support.
@@ -558,25 +557,24 @@ def process_dir_worker_threading(job_queue, result_queue, inferior_pid_events):
while not job_queue.empty():
try:
job = job_queue.get(block=False)
- result = process_dir(job[0], job[1], job[2],
- inferior_pid_events)
+ result = process_file(job[0], job[1], inferior_pid_events)
result_queue.put(result)
except queue.Empty:
# Fine, we're done.
pass
-def process_dir_worker_threading_pool(args):
- return process_dir(*args)
+def process_file_worker_threading_pool(args):
+ return process_file(*args)
-def process_dir_mapper_inprocess(args):
+def process_file_mapper_inprocess(args):
"""Map adapter for running the subprocess-based, non-threaded test runner.
@param args the process work item tuple
@return the test result tuple
"""
- return process_dir(*args)
+ return process_file(*args)
def collect_active_pids_from_pid_events(event_queue):
@@ -646,16 +644,12 @@ def kill_all_worker_threads(workers, inferior_pid_events):
worker.join()
-def find_test_files_in_dir_tree(dir_root, found_func):
- """Calls found_func for all the test files in the given dir hierarchy.
+def find_test_files_in_dir_tree(dir_root):
+ """Returns all the test files in the given dir hierarchy.
@param dir_root the path to the directory to start scanning
for test files. All files in this directory and all its children
directory trees will be searched.
-
- @param found_func a callable object that will be passed
- the parent directory (relative to dir_root) and the list of
- test files from within that directory.
"""
for root, _, files in os.walk(dir_root, topdown=False):
def is_test_filename(test_dir, base_filename):
@@ -676,12 +670,9 @@ def find_test_files_in_dir_tree(dir_root, found_func):
return (base_filename.startswith("Test") and
base_filename.endswith(".py"))
- tests = [
- (filename, os.path.join(root, filename))
- for filename in files
- if is_test_filename(root, filename)]
- if tests:
- found_func(root, tests)
+ for f in files:
+ if is_test_filename(root, f):
+ yield os.path.join(root, f)
def initialize_global_vars_common(num_threads, test_work_items, session_dir,
@@ -689,7 +680,7 @@ def initialize_global_vars_common(num_threads, test_work_items, session_dir,
global g_session_dir, g_runner_context, total_tests, test_counter
global test_name_len
- total_tests = sum([len(item[1]) for item in test_work_items])
+ total_tests = len(test_work_items)
test_counter = multiprocessing.Value('i', 0)
test_name_len = multiprocessing.Value('i', 0)
g_session_dir = session_dir
@@ -949,7 +940,7 @@ def multiprocessing_test_runner(num_threads, test_work_items, session_dir,
workers = []
for _ in range(num_threads):
worker = multiprocessing.Process(
- target=process_dir_worker_multiprocessing,
+ target=process_file_worker_multiprocessing,
args=(output_lock,
test_counter,
total_tests,
@@ -1045,7 +1036,7 @@ def multiprocessing_test_runner_pool(num_threads, test_work_items, session_dir,
# Start the map operation (async mode).
map_future = pool.map_async(
- process_dir_worker_multiprocessing_pool, test_work_items)
+ process_file_worker_multiprocessing_pool, test_work_items)
return map_async_run_loop(
map_future, RUNNER_PROCESS_ASYNC_MAP, RESULTS_LISTENER_CHANNEL)
@@ -1092,7 +1083,7 @@ def threading_test_runner(num_threads, test_work_items, session_dir,
workers = []
for _ in range(num_threads):
worker = threading.Thread(
- target=process_dir_worker_threading,
+ target=process_file_worker_threading,
args=(job_queue,
result_queue,
inferior_pid_events))
@@ -1129,7 +1120,7 @@ def threading_test_runner_pool(num_threads, test_work_items, session_dir,
pool = multiprocessing.pool.ThreadPool(num_threads)
map_future = pool.map_async(
- process_dir_worker_threading_pool, test_work_items)
+ process_file_worker_threading_pool, test_work_items)
return map_async_run_loop(
map_future, RUNNER_PROCESS_ASYNC_MAP, RESULTS_LISTENER_CHANNEL)
@@ -1166,7 +1157,7 @@ def inprocess_exec_test_runner(test_work_items, session_dir, runner_context):
socket_thread.start()
# Do the work.
- test_results = list(map(process_dir_mapper_inprocess, test_work_items))
+ test_results = list(map(process_file_mapper_inprocess, test_work_items))
# If we have a listener channel, shut it down here.
if RESULTS_LISTENER_CHANNEL is not None:
@@ -1183,7 +1174,7 @@ def inprocess_exec_test_runner(test_work_items, session_dir, runner_context):
def walk_and_invoke(test_files, dotest_argv, num_workers, test_runner_func):
"""Invokes the test runner on each test file specified by test_files.
- @param test_files a list of (test_subdir, list_of_test_files_in_dir)
+ @param test_files a list of (test_file, full_path_to_test_file)
@param num_workers the number of worker queues working on these test files
@param test_runner_func the test runner configured to run the tests
@@ -1218,8 +1209,8 @@ def walk_and_invoke(test_files, dotest_argv, num_workers, test_runner_func):
# Build the test work items out of the (dir, file_list) entries passed in.
test_work_items = []
- for entry in test_files:
- test_work_items.append((entry[0], entry[1], dotest_argv, None))
+ for test_file in test_files:
+ test_work_items.append((test_file, dotest_argv, None))
# Convert test work items into test results using whatever
# was provided as the test run function.
@@ -1533,31 +1524,15 @@ def rerun_tests(test_subdir, tests_for_rerun, dotest_argv, session_dir,
# Sort rerun files into subdirectories.
print("\nRerunning the following files:")
- rerun_files_by_subdir = {}
+ rerun_files = []
for test_filename in tests_for_rerun.keys():
# Print the file we'll be rerunning
test_relative_path = os.path.relpath(
test_filename, lldbsuite.lldb_test_root)
print(" {}".format(test_relative_path))
- # Store test filenames by subdir.
- test_dir = os.path.dirname(test_filename)
- test_basename = os.path.basename(test_filename)
- if test_dir in rerun_files_by_subdir:
- rerun_files_by_subdir[test_dir].append(
- (test_basename, test_filename))
- else:
- rerun_files_by_subdir[test_dir] = [(test_basename, test_filename)]
-
- # Break rerun work up by subdirectory. We do this since
- # we have an invariant that states only one test file can
- # be run at a time in any given subdirectory (related to
- # rules around built inferior test program lifecycle).
- rerun_work = []
- for files_by_subdir in rerun_files_by_subdir.values():
- rerun_work.append((test_subdir, files_by_subdir))
+ rerun_files.append(test_filename)
- # Run the work with the serial runner.
# Do not update legacy counts, I am getting rid of
# them so no point adding complicated merge logic here.
rerun_thread_count = 1
@@ -1576,7 +1551,7 @@ def rerun_tests(test_subdir, tests_for_rerun, dotest_argv, session_dir,
"function named '{}'".format(rerun_runner_name))
walk_and_invoke(
- rerun_work,
+ rerun_files,
dotest_argv,
rerun_thread_count,
rerun_runner_func)
@@ -1675,15 +1650,9 @@ def main(num_threads, test_subdir, test_runner_name, results_formatter):
list(runner_strategies_by_name.keys())))
test_runner_func = runner_strategies_by_name[test_runner_name]
- # Collect the files on which we'll run the first test run phase.
- test_files = []
- find_test_files_in_dir_tree(
- test_subdir, lambda tdir, tfiles: test_files.append(
- (test_subdir, tfiles)))
-
# Do the first test run phase.
summary_results = walk_and_invoke(
- test_files,
+ find_test_files_in_dir_tree(test_subdir),
dotest_argv,
num_threads,
test_runner_func)
diff --git a/packages/Python/lldbsuite/test/dotest.py b/packages/Python/lldbsuite/test/dotest.py
index 7d739acba952..d28c5ef069b7 100644
--- a/packages/Python/lldbsuite/test/dotest.py
+++ b/packages/Python/lldbsuite/test/dotest.py
@@ -51,6 +51,8 @@ from ..support import seven
def is_exe(fpath):
"""Returns true if fpath is an executable."""
+ if fpath == None:
+ return False
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
@@ -299,12 +301,21 @@ def parseOptionsAndInitTestdirs():
configuration.compiler = candidate
break
+ if args.dsymutil:
+ os.environ['DSYMUTIL'] = args.dsymutil
+ elif platform_system == 'Darwin':
+ os.environ['DSYMUTIL'] = seven.get_command_output(
+ 'xcrun -find -toolchain default dsymutil')
+
if args.channels:
lldbtest_config.channels = args.channels
if args.log_success:
lldbtest_config.log_success = args.log_success
+ if args.out_of_tree_debugserver:
+ lldbtest_config.out_of_tree_debugserver = args.out_of_tree_debugserver
+
# Set SDKROOT if we are using an Apple SDK
if platform_system == 'Darwin' and args.apple_sdk:
os.environ['SDKROOT'] = seven.get_command_output(
@@ -332,7 +343,7 @@ def parseOptionsAndInitTestdirs():
configuration.categoriesList = []
if args.skipCategories:
- configuration.skipCategories = test_categories.validate(
+ configuration.skipCategories += test_categories.validate(
args.skipCategories, False)
if args.E:
@@ -472,6 +483,8 @@ def parseOptionsAndInitTestdirs():
configuration.lldb_platform_url = args.lldb_platform_url
if args.lldb_platform_working_dir:
configuration.lldb_platform_working_dir = args.lldb_platform_working_dir
+ if args.test_build_dir:
+ configuration.test_build_dir = args.test_build_dir
if args.event_add_entries and len(args.event_add_entries) > 0:
entries = {}
@@ -621,6 +634,12 @@ def setupSysPath():
os.environ["LLDB_TEST"] = scriptPath
+ # Set up the root build directory.
+ builddir = configuration.test_build_dir
+ if not configuration.test_build_dir:
+ raise Exception("test_build_dir is not set")
+ os.environ["LLDB_BUILD"] = os.path.abspath(configuration.test_build_dir)
+
# Set up the LLDB_SRC environment variable, so that the tests can locate
# the LLDB source code.
os.environ["LLDB_SRC"] = lldbsuite.lldb_root
@@ -1085,6 +1104,39 @@ def checkLibcxxSupport():
print("Libc++ tests will not be run because: " + reason)
configuration.skipCategories.append("libc++")
+def canRunLibstdcxxTests():
+ from lldbsuite.test import lldbplatformutil
+
+ platform = lldbplatformutil.getPlatform()
+ if platform == "linux":
+ return True, "libstdcxx always present"
+ return False, "Don't know how to build with libstdcxx on %s" % platform
+
+def checkLibstdcxxSupport():
+ result, reason = canRunLibstdcxxTests()
+ if result:
+ return # libstdcxx supported
+ if "libstdcxx" in configuration.categoriesList:
+ return # libstdcxx category explicitly requested, let it run.
+ print("libstdcxx tests will not be run because: " + reason)
+ configuration.skipCategories.append("libstdcxx")
+
+def checkDebugInfoSupport():
+ import lldb
+
+ platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
+ compiler = configuration.compiler
+ skipped = []
+ for cat in test_categories.debug_info_categories:
+ if cat in configuration.categoriesList:
+ continue # Category explicitly requested, let it run.
+ if test_categories.is_supported_on_platform(cat, platform, compiler):
+ continue
+ configuration.skipCategories.append(cat)
+ skipped.append(cat)
+ if skipped:
+ print("Skipping following debug info categories:", skipped)
+
def run_suite():
# On MacOS X, check to make sure that domain for com.apple.DebugSymbols defaults
# does not exist before proceeding to running the test suite.
@@ -1117,7 +1169,6 @@ def run_suite():
signal.signal(signal.SIGINT, signal.SIG_IGN)
setupSysPath()
- configuration.setupCrashInfoHook()
#
# If '-l' is specified, do not skip the long running tests.
@@ -1174,22 +1225,30 @@ def run_suite():
configuration.lldb_platform_working_dir, 448) # 448 = 0o700
if error.Fail():
raise Exception("making remote directory '%s': %s" % (
- remote_test_dir, error))
+ configuration.lldb_platform_working_dir, error))
if not lldb.remote_platform.SetWorkingDirectory(
configuration.lldb_platform_working_dir):
- raise Exception("failed to set working directory '%s'" % remote_test_dir)
+ raise Exception("failed to set working directory '%s'" % configuration.lldb_platform_working_dir)
lldb.DBG.SetSelectedPlatform(lldb.remote_platform)
else:
lldb.remote_platform = None
configuration.lldb_platform_working_dir = None
configuration.lldb_platform_url = None
+ # Set up the working directory.
+ # Note that it's not dotest's job to clean this directory.
+ import lldbsuite.test.lldbutil as lldbutil
+ build_dir = configuration.test_build_dir
+ lldbutil.mkdir_p(build_dir)
+
target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
checkLibcxxSupport()
+ checkLibstdcxxSupport()
+ checkDebugInfoSupport()
- # Don't do debugserver tests on everything except OS X.
+ # Don't do debugserver tests on anything except OS X.
configuration.dont_do_debugserver_test = "linux" in target_platform or "freebsd" in target_platform or "windows" in target_platform
# Don't do lldb-server (llgs) tests on anything except Linux.
diff --git a/packages/Python/lldbsuite/test/dotest_args.py b/packages/Python/lldbsuite/test/dotest_args.py
index bc43a6fc04a9..58190d8c75ee 100644
--- a/packages/Python/lldbsuite/test/dotest_args.py
+++ b/packages/Python/lldbsuite/test/dotest_args.py
@@ -83,6 +83,8 @@ def create_parser():
help=textwrap.dedent('''Specify the extra flags to be passed to the toolchain when building the inferior programs to be debugged
suggestions: do not lump the "-A arch1 -A arch2" together such that the -E option applies to only one of the architectures'''))
+ group.add_argument('--dsymutil', metavar='dsymutil', dest='dsymutil', help=textwrap.dedent('Specify which dsymutil to use.'))
+
# Test filtering options
group = parser.add_argument_group('Test filtering options')
group.add_argument(
@@ -127,6 +129,11 @@ def create_parser():
metavar='server-path',
help='The path to the debug server executable to use')
group.add_argument(
+ '--out-of-tree-debugserver',
+ dest='out_of_tree_debugserver',
+ action='store_true',
+ help='A flag to indicate an out-of-tree debug server is being used')
+ group.add_argument(
'-s',
metavar='name',
help='Specify the name of the dir created to store the session files of tests with errored or failed status. If not specified, the test driver uses the timestamp as the session dir name')
@@ -159,6 +166,12 @@ def create_parser():
metavar='Codesigning identity',
default='lldb_codesign',
help='The codesigning identity to use')
+ group.add_argument(
+ '--build-dir',
+ dest='test_build_dir',
+ metavar='Test build directory',
+ default='lldb-test-build.noindex',
+ help='The root build directory for the tests. It will be removed before running.')
# Configuration options
group = parser.add_argument_group('Remote platform options')
diff --git a/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py b/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
index 8699b31f9929..f2dc5281f137 100644
--- a/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
+++ b/packages/Python/lldbsuite/test/driver/batch_mode/TestBatchMode.py
@@ -46,7 +46,7 @@ class DriverBatchModeTest (TestBase):
self.setTearDownCleanup()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
# Pass CRASH so the process will crash and stop in batch mode.
@@ -86,7 +86,7 @@ class DriverBatchModeTest (TestBase):
self.setTearDownCleanup()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
# Now do it again, and make sure if we don't crash, we quit:
@@ -129,7 +129,7 @@ class DriverBatchModeTest (TestBase):
self.setTearDownCleanup()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
# Finally, start up the process by hand, attach to it, and wait for its completion.
diff --git a/packages/Python/lldbsuite/test/example/TestSequenceFunctions.py b/packages/Python/lldbsuite/test/example/TestSequenceFunctions.py
deleted file mode 100644
index eb3b0bbf8851..000000000000
--- a/packages/Python/lldbsuite/test/example/TestSequenceFunctions.py
+++ /dev/null
@@ -1,34 +0,0 @@
-"""An example unittest copied from python tutorial."""
-
-import random
-import unittest
-import traceback
-
-
-class SequenceFunctionsTestCase(unittest.TestCase):
-
- def setUp(self):
- # traceback.print_stack()
- self.seq = list(range(10))
-
- def tearDown(self):
- # traceback.print_stack()
- pass
-
- def test_shuffle(self):
- # make sure the shuffled sequence does not lose any elements
- random.shuffle(self.seq)
- self.seq.sort()
- self.assertEqual(self.seq, list(range(10)))
-
- def test_choice(self):
- element = random.choice(self.seq)
- self.assertTrue(element in self.seq)
-
- def test_sample(self):
- self.assertRaises(ValueError, random.sample, self.seq, 20)
- for element in random.sample(self.seq, 5):
- self.assertTrue(element in self.seq)
-
-if __name__ == '__main__':
- unittest.main()
diff --git a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
index 2d4504f7ba42..6a8fb5db5439 100644
--- a/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
+++ b/packages/Python/lldbsuite/test/expression_command/anonymous-struct/TestCallUserAnonTypedef.py
@@ -32,7 +32,8 @@ class TestExprLookupAnonStructTypedef(TestBase):
"""Test typedeffed untagged struct arguments for function call expressions"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file "+self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
"main.cpp",
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
index 16736f798528..079ab6d60888 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStdStringFunction.py
@@ -30,7 +30,8 @@ class ExprCommandCallFunctionTestCase(TestBase):
def test_with(self):
"""Test calling std::String member function."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
# Some versions of GCC encode two locations for the 'return' statement
# in main.cpp
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
index a48a38aaf92c..63511779a927 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallStopAndContinue.py
@@ -31,7 +31,7 @@ class ExprCommandCallStopContinueTestCase(TestBase):
def test(self):
"""Test gathering result from interrupted function call."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
# Some versions of GCC encode two locations for the 'return' statement
# in main.cpp
diff --git a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
index fda81ae8c365..ff3bd99ced99 100644
--- a/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
+++ b/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py
@@ -37,7 +37,7 @@ class ExprCommandCallUserDefinedFunction(TestBase):
self.build()
# Set breakpoint in main and run exe
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/expression_command/call-overridden-method/Makefile b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/Makefile
new file mode 100644
index 000000000000..9d4f3b7f1412
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/Makefile
@@ -0,0 +1,8 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
+
+clean::
+ rm -rf $(wildcard *.o *.d *.dSYM)
diff --git a/packages/Python/lldbsuite/test/expression_command/call-overridden-method/TestCallOverriddenMethod.py b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/TestCallOverriddenMethod.py
new file mode 100644
index 000000000000..1e61aa9f46e0
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/TestCallOverriddenMethod.py
@@ -0,0 +1,49 @@
+"""
+Test calling an overriden method.
+
+Note:
+ This verifies that LLDB is correctly building the method overrides table.
+ If this table is not built correctly then calls to overridden methods in
+ derived classes may generate references to non-existant vtable entries,
+ as the compiler treats the overridden method as a totally new virtual
+ method definition.
+ <rdar://problem/14205774>
+
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class ExprCommandCallOverriddenMethod(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Find the line number to break for main.c.
+ self.line = line_number('main.cpp', '// Set breakpoint here')
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
+ def test(self):
+ """Test calls to overridden methods in derived classes."""
+ self.build()
+
+ # Set breakpoint in main and run exe
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # Test call to method in base class (this should always work as the base
+ # class method is never an override).
+ self.expect("expr b->foo()")
+
+ # Test call to overridden method in derived class (this will fail if the
+ # overrides table is not correctly set up, as Derived::foo will be assigned
+ # a vtable entry that does not exist in the compiled program).
+ self.expect("expr d.foo()")
diff --git a/packages/Python/lldbsuite/test/expression_command/call-overridden-method/main.cpp b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/main.cpp
new file mode 100644
index 000000000000..54ae705d2978
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/call-overridden-method/main.cpp
@@ -0,0 +1,16 @@
+class Base {
+public:
+ virtual ~Base() {}
+ virtual void foo() {}
+};
+
+class Derived : public Base {
+public:
+ virtual void foo() {}
+};
+
+int main() {
+ Derived d;
+ Base *b = &d;
+ return 0; // Set breakpoint here
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
index 445979f5c701..2f1406874765 100644
--- a/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
+++ b/packages/Python/lldbsuite/test/expression_command/char/TestExprsChar.py
@@ -49,6 +49,7 @@ class ExprCharTestCase(TestBase):
archs=[
"arm",
"aarch64",
+ "powerpc64le",
"s390x"],
bugnumber="llvm.org/pr23069")
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
diff --git a/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py b/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
index dcfb648ada50..dd31424dbbdc 100644
--- a/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
+++ b/packages/Python/lldbsuite/test/expression_command/expr-in-syscall/TestExpressionInSyscall.py
@@ -22,7 +22,7 @@ class ExprSyscallTestCase(TestBase):
self.expr_syscall()
def expr_syscall(self):
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py b/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
index c4126a329686..f14b02bbd7c4 100644
--- a/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
+++ b/packages/Python/lldbsuite/test/expression_command/formatters/TestFormatters.py
@@ -43,7 +43,7 @@ class ExprFormattersTestCase(TestBase):
self.addTearDownHook(cleanup)
"""Test expr + formatters for good interoperability."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
index 894d0bfaa86e..a5607f195052 100644
--- a/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter-phi-nodes/TestIRInterpreterPHINodes.py
@@ -17,7 +17,7 @@ class IRInterpreterPHINodesTestCase(TestBase):
"""Test support for PHI nodes in the IR interpreter."""
self.build()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
# Break on the first assignment to i
diff --git a/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
index 5c5110b69945..d8a8038c8454 100644
--- a/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
+++ b/packages/Python/lldbsuite/test/expression_command/ir-interpreter/TestIRInterpreter.py
@@ -17,6 +17,7 @@ from lldbsuite.test import lldbutil
class IRInterpreterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
@@ -34,7 +35,7 @@ class IRInterpreterTestCase(TestBase):
"""Test the IR interpreter"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.c", self.line, num_expected_locations=1, loc_exact=False)
@@ -85,3 +86,10 @@ class IRInterpreterTestCase(TestBase):
jit_result,
"While evaluating " +
expression)
+
+ def test_type_conversions(self):
+ target = self.dbg.GetDummyTarget()
+ short_val = target.EvaluateExpression("(short)-1")
+ self.assertEqual(short_val.GetValueAsSigned(), -1)
+ long_val = target.EvaluateExpression("(long) "+ short_val.GetName())
+ self.assertEqual(long_val.GetValueAsSigned(), -1)
diff --git a/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py b/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
index aa369ebeff87..7f639a462201 100644
--- a/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
+++ b/packages/Python/lldbsuite/test/expression_command/multiline/TestMultilineExpressions.py
@@ -28,7 +28,7 @@ class MultilineExpressionsTestCase(TestBase):
"""Test that multiline expressions work correctly"""
self.build()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
# So that the child gets torn down after the test.
diff --git a/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py b/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
index b4e9a8bfeab8..1dbafc36a82a 100644
--- a/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
+++ b/packages/Python/lldbsuite/test/expression_command/options/TestExprOptions.py
@@ -28,7 +28,7 @@ class ExprOptionsTestCase(TestBase):
self.main_source = "main.cpp"
self.main_source_spec = lldb.SBFileSpec(self.main_source)
self.line = line_number('main.cpp', '// breakpoint_in_main')
- self.exe = os.path.join(os.getcwd(), "a.out")
+ self.exe = self.getBuildArtifact("a.out")
def test_expr_options(self):
"""These expression command options should work as expected."""
diff --git a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
index e6c9d43adf04..b6471d0f8972 100644
--- a/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
+++ b/packages/Python/lldbsuite/test/expression_command/persist_objc_pointeetype/TestPersistObjCPointeeType.py
@@ -34,7 +34,7 @@ class PersistObjCPointeeType(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
index 118b9f32c4bd..7b963b5bfcd2 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_ptr_update/TestPersistentPtrUpdate.py
@@ -28,7 +28,7 @@ class PersistentPtrUpdateTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd('break set -p here')
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
index 12452a963772..f4ee1b0fb625 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestNestedPersistentTypes.py
@@ -22,7 +22,7 @@ class NestedPersistentTypesTestCase(TestBase):
"""Test that nested persistent types work."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set --name main")
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
index 3d4df307d1b0..f56cb11a80d8 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_types/TestPersistentTypes.py
@@ -22,7 +22,7 @@ class PersistenttypesTestCase(TestBase):
"""Test that lldb persistent types works correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set --name main")
diff --git a/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py b/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
index b6f027964bab..441a60b5a463 100644
--- a/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
+++ b/packages/Python/lldbsuite/test/expression_command/persistent_variables/TestPersistentVariables.py
@@ -19,7 +19,7 @@ class PersistentVariablesTestCase(TestBase):
"""Test that lldb persistent variables works correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set --source-pattern-regexp break")
diff --git a/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py b/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
index 13f8f58564e8..4530342ea52d 100644
--- a/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
+++ b/packages/Python/lldbsuite/test/expression_command/po_verbosity/TestPoVerbosity.py
@@ -37,7 +37,7 @@ class PoVerbosityTestCase(TestBase):
self.addTearDownHook(cleanup)
"""Test expr + formatters for good interoperability."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/expression_command/pr35310/Makefile b/packages/Python/lldbsuite/test/expression_command/pr35310/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/pr35310/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py b/packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py
new file mode 100644
index 000000000000..9cc9df2b22be
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/pr35310/TestExprsBug35310.py
@@ -0,0 +1,40 @@
+from __future__ import print_function
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class ExprBug35310(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ self.main_source = "main.cpp"
+ self.main_source_spec = lldb.SBFileSpec(self.main_source)
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
+ def test_issue35310(self):
+ """Test invoking functions with non-standard linkage names.
+
+ The GNU abi_tag extension used by libstdc++ is a common source
+ of these, but they could originate from other reasons as well.
+ """
+ self.build()
+
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ '// Break here', self.main_source_spec)
+ frame = thread.GetFrameAtIndex(0)
+
+ value = frame.EvaluateExpression("a.test_abi_tag()")
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Success())
+ self.assertEqual(value.GetValueAsSigned(0), 1)
+
+ value = frame.EvaluateExpression("a.test_asm_name()")
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Success())
+ self.assertEqual(value.GetValueAsSigned(0), 2)
diff --git a/packages/Python/lldbsuite/test/expression_command/pr35310/main.cpp b/packages/Python/lldbsuite/test/expression_command/pr35310/main.cpp
new file mode 100644
index 000000000000..a8e8a5c737a0
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/pr35310/main.cpp
@@ -0,0 +1,19 @@
+#include <stdio.h>
+
+class A {
+public:
+ int __attribute__((abi_tag("cxx11"))) test_abi_tag() {
+ return 1;
+ }
+ int test_asm_name() asm("A_test_asm") {
+ return 2;
+ }
+};
+
+int main(int argc, char **argv) {
+ A a;
+ // Break here
+ a.test_abi_tag();
+ a.test_asm_name();
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py b/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
index ca43585616e5..0027fc226e37 100644
--- a/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
+++ b/packages/Python/lldbsuite/test/expression_command/radar_8638051/Test8638051.py
@@ -19,7 +19,7 @@ class Radar8638051TestCase(TestBase):
"""The following expression commands should not crash."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.runCmd("breakpoint set -n c")
diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
index c4d899cfc1e0..c44cb6fc39da 100644
--- a/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
+++ b/packages/Python/lldbsuite/test/expression_command/radar_9531204/TestPrintfAfterUp.py
@@ -23,7 +23,7 @@ class Radar9531204TestCase(TestBase):
"""The evaluating printf(...) after break stop and then up a stack frame."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_symbol(
self, 'foo', sym_exact=True, num_expected_locations=1)
diff --git a/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py b/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
index 4fc2463b25a8..dfef8735071b 100644
--- a/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
+++ b/packages/Python/lldbsuite/test/expression_command/radar_9673664/TestExprHelpExamples.py
@@ -29,7 +29,7 @@ class Radar9673644TestCase(TestBase):
"""The following expression commands should just work."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/expression_command/rdar42038760/Makefile b/packages/Python/lldbsuite/test/expression_command/rdar42038760/Makefile
new file mode 100644
index 000000000000..f5a47fcc46cc
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/rdar42038760/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/rdar42038760/TestScalarURem.py b/packages/Python/lldbsuite/test/expression_command/rdar42038760/TestScalarURem.py
new file mode 100644
index 000000000000..03424658f3ed
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/rdar42038760/TestScalarURem.py
@@ -0,0 +1,4 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(__file__, globals(), None)
diff --git a/packages/Python/lldbsuite/test/expression_command/rdar42038760/main.c b/packages/Python/lldbsuite/test/expression_command/rdar42038760/main.c
new file mode 100644
index 000000000000..98a957faf8bd
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/rdar42038760/main.c
@@ -0,0 +1,19 @@
+// Make sure we IR-interpret the expression correctly.
+
+typedef unsigned int uint32_t;
+struct S0 {
+ signed f2;
+};
+static g_463 = 0x1561983AL;
+void func_1(void)
+{
+ struct S0 l_19;
+ l_19.f2 = 419;
+ uint32_t l_4037 = 4294967295UL;
+ l_19.f2 = g_463; //%self.expect("expr ((l_4037 % (-(g_463))) | l_19.f2)", substrs=['(unsigned int) $0 = 358717883'])
+}
+int main()
+{
+ func_1();
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py b/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
index f6938b1ea98b..c1a1b375e155 100644
--- a/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
+++ b/packages/Python/lldbsuite/test/expression_command/save_jit_objects/TestSaveJITObjects.py
@@ -11,23 +11,24 @@ from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-def enumerateJITFiles():
- return [f for f in os.listdir(os.getcwd()) if f.startswith("jit")]
-
-def countJITFiles():
- return len(enumerateJITFiles())
-
-def cleanJITFiles():
- for j in enumerateJITFiles():
- os.remove(j)
- return
-
class SaveJITObjectsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ def enumerateJITFiles(self):
+ return [f for f in os.listdir(self.getBuildDir()) if f.startswith("jit")]
+
+ def countJITFiles(self):
+ return len(self.enumerateJITFiles())
+
+ def cleanJITFiles(self):
+ for j in self.enumerateJITFiles():
+ os.remove(j)
+ return
+
@expectedFailureAll(oslist=["windows"])
def test_save_jit_objects(self):
self.build()
+ os.chdir(self.getBuildDir())
src_file = "main.c"
src_file_spec = lldb.SBFileSpec(src_file)
@@ -36,16 +37,17 @@ class SaveJITObjectsTestCase(TestBase):
frame = thread.frames[0]
- cleanJITFiles()
+ self.cleanJITFiles()
frame.EvaluateExpression("(void*)malloc(0x1)")
- self.assertTrue(countJITFiles() == 0,
+ self.assertTrue(self.countJITFiles() == 0,
"No files emitted with save-jit-objects=false")
self.runCmd("settings set target.save-jit-objects true")
frame.EvaluateExpression("(void*)malloc(0x1)")
- jit_files_count = countJITFiles()
- cleanJITFiles()
+ jit_files_count = self.countJITFiles()
+ self.cleanJITFiles()
self.assertTrue(jit_files_count != 0,
"At least one file emitted with save-jit-objects=true")
process.Kill()
+ os.chdir(self.getSourceDir())
diff --git a/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py b/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
index 1cd11a8c2759..3af7d808e128 100644
--- a/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
+++ b/packages/Python/lldbsuite/test/expression_command/test/TestExprs.py
@@ -45,7 +45,7 @@ class BasicExprCommandsTestCase(TestBase):
"""These basic expression commands should work as expected."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
@@ -107,7 +107,7 @@ class BasicExprCommandsTestCase(TestBase):
"""Test SBFrame.EvaluateExpression() API for evaluating an expression."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -208,7 +208,7 @@ class BasicExprCommandsTestCase(TestBase):
"""Throw some expression commands with quotes at lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
diff --git a/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py b/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
index 35ac151a3908..f5ec4f027866 100644
--- a/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
+++ b/packages/Python/lldbsuite/test/expression_command/test/TestExprs2.py
@@ -31,7 +31,7 @@ class ExprCommands2TestCase(TestBase):
"""Test some more expression commands."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
@@ -43,23 +43,38 @@ class ExprCommands2TestCase(TestBase):
startstr="(int *) $0 = 0x")
# (int *) $0 = 0x00007fff5fbff258
- # Do anonymous symbols work?
- self.expect("expression ((char**)environ)[0]",
- startstr="(char *) $1 = 0x")
- # (char *) $1 = 0x00007fff5fbff298 "Apple_PubSub_Socket_Render=/tmp/launch-7AEsUD/Render"
-
# Do return values containing the contents of expression locals work?
self.expect("expression int i = 5; i",
- startstr="(int) $2 = 5")
+ startstr="(int) $1 = 5")
# (int) $2 = 5
- self.expect("expression $2 + 1",
- startstr="(int) $3 = 6")
+ self.expect("expression $1 + 1",
+ startstr="(int) $2 = 6")
# (int) $3 = 6
# Do return values containing the results of static expressions work?
self.expect("expression 20 + 3",
- startstr="(int) $4 = 23")
+ startstr="(int) $3 = 23")
# (int) $4 = 5
- self.expect("expression $4 + 1",
- startstr="(int) $5 = 24")
+ self.expect("expression $3 + 1",
+ startstr="(int) $4 = 24")
# (int) $5 = 6
+
+ @skipIfLinux
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24489: Name lookup not working correctly on Windows")
+ def test_expr_symbols(self):
+ """Test symbols."""
+ self.build()
+
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # Do anonymous symbols work?
+ self.expect("expression ((char**)environ)[0]",
+ startstr="(char *) $0 = 0x")
+ # (char *) $1 = 0x00007fff5fbff298 "Apple_PubSub_Socket_Render=/tmp/launch-7AEsUD/Render"
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/Makefile b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile
index 48eec5c5d268..9e35242c72fa 100644
--- a/packages/Python/lldbsuite/test/expression_command/top-level/Makefile
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/Makefile
@@ -7,7 +7,7 @@ include $(LEVEL)/Makefile.rules
a.out: dummy
dummy:
- $(MAKE) -f dummy.mk
+ $(MAKE) VPATH=$(VPATH) -I $(SRCDIR) -f $(SRCDIR)/dummy.mk
clean::
- $(MAKE) -f dummy.mk clean
+ $(MAKE) VPATH=$(VPATH) -I $(SRCDIR) -f $(SRCDIR)/dummy.mk clean
diff --git a/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
index dfe95a1a9fa7..1a8a619b0ed2 100644
--- a/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
+++ b/packages/Python/lldbsuite/test/expression_command/top-level/TestTopLevelExprs.py
@@ -37,7 +37,7 @@ class TopLevelExpressionsTestCase(TestBase):
"""Test top-level expressions."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=False)
@@ -45,7 +45,8 @@ class TopLevelExpressionsTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
def run_dummy(self):
- self.runCmd("file dummy", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("dummy"),
+ CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py b/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
index 1ce75144017e..bac8e5453e4a 100644
--- a/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
+++ b/packages/Python/lldbsuite/test/expression_command/two-files/TestObjCTypeQueryFromOtherCompileUnit.py
@@ -28,7 +28,7 @@ class ObjCTypeQueryTestCase(TestBase):
def test(self):
"""The expression parser's type search should be wider than the current compilation unit."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/expression_command/xvalue/Makefile b/packages/Python/lldbsuite/test/expression_command/xvalue/Makefile
new file mode 100644
index 000000000000..8a7102e347af
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/xvalue/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/expression_command/xvalue/TestXValuePrinting.py b/packages/Python/lldbsuite/test/expression_command/xvalue/TestXValuePrinting.py
new file mode 100644
index 000000000000..4ad4225a5fe4
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/xvalue/TestXValuePrinting.py
@@ -0,0 +1,37 @@
+from __future__ import print_function
+
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class ExprXValuePrintingTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ self.main_source = "main.cpp"
+ self.main_source_spec = lldb.SBFileSpec(self.main_source)
+
+ def do_test(self, dictionary=None):
+ """Printing an xvalue should work."""
+ self.build(dictionary=dictionary)
+
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ '// Break here', self.main_source_spec)
+ frame = thread.GetFrameAtIndex(0)
+
+ value = frame.EvaluateExpression("foo().data")
+ self.assertTrue(value.IsValid())
+ self.assertTrue(value.GetError().Success())
+ self.assertEqual(value.GetValueAsSigned(), 1234)
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr21765")
+ def test(self):
+ self.do_test()
+
diff --git a/packages/Python/lldbsuite/test/expression_command/xvalue/main.cpp b/packages/Python/lldbsuite/test/expression_command/xvalue/main.cpp
new file mode 100644
index 000000000000..556c63f2b449
--- /dev/null
+++ b/packages/Python/lldbsuite/test/expression_command/xvalue/main.cpp
@@ -0,0 +1,12 @@
+struct Tmp
+{
+ int data = 1234;
+};
+
+Tmp foo() { return Tmp(); }
+
+int main(int argc, char const *argv[])
+{
+ int something = foo().data;
+ return 0; // Break here
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
index aecbab1b363f..aa80c9976eb8 100644
--- a/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
+++ b/packages/Python/lldbsuite/test/functionalities/apropos_with_process/TestAproposWithProcess.py
@@ -1,5 +1,5 @@
"""
-Test that apropos env doesn't crash trying to touch the process plugin commmand
+Test that apropos env doesn't crash trying to touch the process plugin command
"""
from __future__ import print_function
@@ -24,12 +24,12 @@ class AproposWithProcessTestCase(TestBase):
self.line = line_number('main.cpp', '// break here')
def test_apropos_with_process(self):
- """Test that apropos env doesn't crash trying to touch the process plugin commmand."""
+ """Test that apropos env doesn't crash trying to touch the process plugin command."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # Break in main() aftre the variables are assigned values.
+ # Break in main() after the variables are assigned values.
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py b/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
index f825eaa86e85..a0c096865558 100644
--- a/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
+++ b/packages/Python/lldbsuite/test/functionalities/archives/TestBSDArchives.py
@@ -35,7 +35,7 @@ class BSDArchivesTestCase(TestBase):
"""Break inside a() and b() defined within libfoo.a."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside a() by file and line first.
diff --git a/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py b/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
index 7bddc0cadccf..5827dc3b4653 100644
--- a/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
+++ b/packages/Python/lldbsuite/test/functionalities/asan/TestMemoryHistory.py
@@ -37,7 +37,7 @@ class AsanTestCase(TestBase):
self.line_breakpoint = line_number('main.c', '// break line')
def asan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py b/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
index 0943d99ee834..d7c511021863 100644
--- a/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
+++ b/packages/Python/lldbsuite/test/functionalities/asan/TestReportData.py
@@ -24,7 +24,7 @@ class AsanTestReportDataCase(TestBase):
@skipIfFreeBSD # llvm.org/pr21136 runtimes not yet available by default
@skipIfRemote
@skipUnlessAddressSanitizer
- @expectedFailureAll(archs=['i386'], bugnumber="rdar://28658860")
+ @skipIf(archs=['i386'], bugnumber="llvm.org/PR36710")
def test(self):
self.build()
self.asan_tests()
@@ -39,7 +39,7 @@ class AsanTestReportDataCase(TestBase):
self.line_crash = line_number('main.c', '// BOOM line')
def asan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py b/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
index b348e72606ad..ad87796766c3 100644
--- a/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
+++ b/packages/Python/lldbsuite/test/functionalities/attach_resume/TestAttachResume.py
@@ -30,7 +30,7 @@ class AttachResumeTestCase(TestBase):
def process_attach_continue_interrupt_detach(self):
"""Test attach/continue/interrupt/detach"""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
popen = self.spawnSubprocess(exe)
self.addTearDownHook(self.cleanupSubprocesses)
diff --git a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
index a4e3948e81ca..38848e87cc4a 100644
--- a/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
+++ b/packages/Python/lldbsuite/test/functionalities/avoids-fd-leak/TestFdLeak.py
@@ -52,7 +52,7 @@ class AvoidsFdLeakTestCase(TestBase):
def do_test(self, commands):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
for c in commands:
self.runCmd(c)
@@ -81,7 +81,7 @@ class AvoidsFdLeakTestCase(TestBase):
@skipIfDarwinEmbedded # <rdar://problem/33888742> # debugserver on ios has an extra fd open on launch
def test_fd_leak_multitarget(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
breakpoint = target.BreakpointCreateBySourceRegex(
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
index 9b116a0a0a24..46191d85296a 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
@@ -30,7 +30,7 @@ class AddressBreakpointTestCase(TestBase):
def address_breakpoints(self):
"""Test address breakpoints set with shared library of SBAddress work correctly."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
index 6f06ca7770c8..5014c1cd4a24 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
@@ -30,12 +30,13 @@ class BadAddressBreakpointTestCase(TestBase):
def address_breakpoints(self):
"""Test that breakpoints set on a bad address say they are bad."""
+ target, process, thread, bkpt = \
+ lldbutil.run_to_source_breakpoint(self,
+ "Set a breakpoint here",
+ lldb.SBFileSpec("main.c"))
- (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
- "Set a breakpoint here", lldb.SBFileSpec("main.c"))
-
- # Now see if we can read from 0. If I can't do that, I don't have a good way to know
- # what an illegal address is...
+ # Now see if we can read from 0. If I can't do that, I don't
+ # have a good way to know what an illegal address is...
error = lldb.SBError()
ptr = process.ReadPointerFromMemory(0x0, error)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
index 9630e39e0142..0123e732e35d 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
@@ -36,7 +36,7 @@ class BreakpointAutoContinue(TestBase):
def make_target_and_bkpt(self, additional_options=None, num_expected_loc=1,
pattern="Set a breakpoint here"):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target.IsValid(), "Target is not valid")
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
deleted file mode 100644
index 88ccc4644192..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/TestBreakpointCaseSensitivity.py
+++ /dev/null
@@ -1,129 +0,0 @@
-"""
-Test case sensitivity of paths on Windows / POSIX
-llvm.org/pr22667
-"""
-
-import os
-import lldb
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test.decorators import *
-from lldbsuite.test import lldbplatform, lldbplatformutil
-
-
-class BreakpointCaseSensitivityTestCase(TestBase):
- mydir = TestBase.compute_mydir(__file__)
- BREAKPOINT_TEXT = 'Set a breakpoint here'
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
- self.line = line_number('main.c', self.BREAKPOINT_TEXT)
-
- @skipIf(hostoslist=no_match(['windows'])) # Skip for non-windows platforms
- def test_breakpoint_matches_file_with_different_case(self):
- """Set breakpoint on file, should match files with different case on Windows"""
- self.build()
- self.case_sensitivity_breakpoint(True)
-
- @skipIf(hostoslist=['windows']) # Skip for windows platforms
- def test_breakpoint_doesnt_match_file_with_different_case(self):
- """Set breakpoint on file, shouldn't match files with different case on POSIX systems"""
- self.build()
- self.case_sensitivity_breakpoint(False)
-
- def case_sensitivity_breakpoint(self, case_insensitive):
- """Set breakpoint on file, should match files with different case if case_insensitive is True"""
-
- # use different case to check CreateTarget
- exe = 'a.out'
- if case_insensitive:
- exe = exe.upper()
-
- exe = os.path.join(os.getcwd(), exe)
-
- # Create a target by the debugger.
- self.target = self.dbg.CreateTarget(exe)
- self.assertTrue(self.target, VALID_TARGET)
- cwd = os.getcwd()
-
- # try both BreakpointCreateByLocation and BreakpointCreateBySourceRegex
- for regex in [False, True]:
- # should always hit
- self.check_breakpoint('main.c', regex, True)
- # should always hit
- self.check_breakpoint(os.path.join(cwd, 'main.c'), regex, True)
- # different case for directory
- self.check_breakpoint(os.path.join(cwd.upper(), 'main.c'),
- regex,
- case_insensitive)
- # different case for file
- self.check_breakpoint('Main.c',
- regex,
- case_insensitive)
- # different case for both
- self.check_breakpoint(os.path.join(cwd.upper(), 'Main.c'),
- regex,
- case_insensitive)
-
- def check_breakpoint(self, file, source_regex, should_hit):
- """
- Check breakpoint hit at given file set by given method
-
- file:
- File where insert the breakpoint
-
- source_regex:
- True for testing using BreakpointCreateBySourceRegex,
- False for BreakpointCreateByLocation
-
- should_hit:
- True if the breakpoint should hit, False otherwise
- """
-
- desc = ' file %s set by %s' % (
- file, 'regex' if source_regex else 'location')
- if source_regex:
- breakpoint = self.target.BreakpointCreateBySourceRegex(
- self.BREAKPOINT_TEXT, lldb.SBFileSpec(file))
- else:
- breakpoint = self.target.BreakpointCreateByLocation(
- file, self.line)
-
- self.assertEqual(breakpoint and breakpoint.GetNumLocations() == 1,
- should_hit,
- VALID_BREAKPOINT + desc)
-
- # Get the breakpoint location from breakpoint after we verified that,
- # indeed, it has one location.
- location = breakpoint.GetLocationAtIndex(0)
-
- self.assertEqual(location.IsValid(),
- should_hit,
- VALID_BREAKPOINT_LOCATION + desc)
-
- process = self.target.LaunchSimple(
- None, None, self.get_process_working_directory())
- self.assertTrue(process, PROCESS_IS_VALID + desc)
-
- if should_hit:
- # Did we hit our breakpoint?
- from lldbsuite.test.lldbutil import get_threads_stopped_at_breakpoint
- threads = get_threads_stopped_at_breakpoint(process, breakpoint)
- self.assertEqual(
- len(threads),
- 1,
- "There should be a thread stopped at breakpoint" +
- desc)
- # The hit count for the breakpoint should be 1.
- self.assertEqual(breakpoint.GetHitCount(), 1)
-
- else:
- # check the breakpoint was not hit
- self.assertEqual(lldb.eStateExited, process.GetState())
- self.assertEqual(breakpoint.GetHitCount(), 0)
-
- # let process finish
- process.Continue()
-
- # cleanup
- self.target.BreakpointDelete(breakpoint.GetID())
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c
deleted file mode 100644
index 281ddfe7ef67..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/main.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <stdio.h>
-
-int
-main()
-{
- printf("Set a breakpoint here.\n");
- return 0;
-}
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
index 386eafbb0b60..7a2dc61b1b69 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
@@ -11,18 +11,14 @@ import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+import side_effect
class BreakpointCommandTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__file__)
- @classmethod
- def classCleanup(cls):
- """Cleanup the test byproduct of breakpoint_command_sequence(self)."""
- cls.RemoveTempFile("output.txt")
- cls.RemoveTempFile("output2.txt")
-
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
def test_breakpoint_command_sequence(self):
"""Test a sequence of breakpoint command add, list, and delete."""
@@ -49,9 +45,28 @@ class BreakpointCommandTestCase(TestBase):
self.addTearDownHook(
lambda: self.runCmd("settings clear auto-confirm"))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24528")
+ def test_delete_all_breakpoints(self):
+ """Test that deleting all breakpoints works."""
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ lldbutil.run_break_set_by_symbol(self, "main")
+ lldbutil.run_break_set_by_file_and_line(
+ self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ self.runCmd("breakpoint delete")
+ self.runCmd("process continue")
+ self.expect("process status", PROCESS_STOPPED,
+ patterns=['Process .* exited with status = 0'])
+
+
def breakpoint_command_sequence(self):
"""Test a sequence of breakpoint command add, list, and delete."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add three breakpoints on the same line. The first time we don't specify the file,
@@ -66,12 +81,36 @@ class BreakpointCommandTestCase(TestBase):
# setting breakpoint commands on two breakpoints at a time
lldbutil.run_break_set_by_file_and_line(
self, None, self.line, num_expected_locations=1, loc_exact=True)
-
+ # Make sure relative path source breakpoints work as expected. We test
+ # with partial paths with and without "./" prefixes.
+ lldbutil.run_break_set_by_file_and_line(
+ self, "./main.c", self.line,
+ num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "breakpoint_command/main.c", self.line,
+ num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "./breakpoint_command/main.c", self.line,
+ num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "breakpoint/breakpoint_command/main.c", self.line,
+ num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "./breakpoint/breakpoint_command/main.c", self.line,
+ num_expected_locations=1, loc_exact=True)
+ # Test relative breakpoints with incorrect paths and make sure we get
+ # no breakpoint locations
+ lldbutil.run_break_set_by_file_and_line(
+ self, "invalid/main.c", self.line,
+ num_expected_locations=0, loc_exact=True)
+ lldbutil.run_break_set_by_file_and_line(
+ self, "./invalid/main.c", self.line,
+ num_expected_locations=0, loc_exact=True)
# Now add callbacks for the breakpoints just created.
self.runCmd(
"breakpoint command add -s command -o 'frame variable --show-types --scope' 1 4")
self.runCmd(
- "breakpoint command add -s python -o 'here = open(\"output.txt\", \"w\"); here.write(\"lldb\\n\"); here.close()' 2")
+ "breakpoint command add -s python -o 'import side_effect; side_effect.one_liner = \"one liner was here\"' 2")
self.runCmd(
"breakpoint command add --python-function bktptcmd.function 3")
@@ -104,9 +143,8 @@ class BreakpointCommandTestCase(TestBase):
"frame variable --show-types --scope"])
self.expect("breakpoint command list 2", "Breakpoint 2 command ok",
substrs=["Breakpoint commands (Python):",
- "here = open",
- "here.write",
- "here.close()"])
+ "import side_effect",
+ "side_effect.one_liner"])
self.expect("breakpoint command list 3", "Breakpoint 3 command ok",
substrs=["Breakpoint commands (Python):",
"bktptcmd.function(frame, bp_loc, internal_dict)"])
@@ -151,40 +189,14 @@ class BreakpointCommandTestCase(TestBase):
extra_options="-f a.c",
num_expected_locations=1)
- # Run the program. Remove 'output.txt' if it exists.
- self.RemoveTempFile("output.txt")
- self.RemoveTempFile("output2.txt")
+ # Reset our canary variables and run the program.
+ side_effect.one_liner = None
+ side_effect.bktptcmd = None
self.runCmd("run", RUN_SUCCEEDED)
- # Check that the file 'output.txt' exists and contains the string
- # "lldb".
-
- # The 'output.txt' file should now exist.
- self.assertTrue(
- os.path.isfile("output.txt"),
- "'output.txt' exists due to breakpoint command for breakpoint 2.")
- self.assertTrue(
- os.path.isfile("output2.txt"),
- "'output2.txt' exists due to breakpoint command for breakpoint 3.")
-
- # Read the output file produced by running the program.
- with open('output.txt', 'r') as f:
- output = f.read()
-
- self.expect(
- output,
- "File 'output.txt' and the content matches",
- exe=False,
- startstr="lldb")
-
- with open('output2.txt', 'r') as f:
- output = f.read()
-
- self.expect(
- output,
- "File 'output2.txt' and the content matches",
- exe=False,
- startstr="lldb")
+ # Check the value of canary variables.
+ self.assertEquals("one liner was here", side_effect.one_liner)
+ self.assertEquals("function was here", side_effect.bktptcmd)
# Finish the program.
self.runCmd("process continue")
@@ -237,7 +249,7 @@ class BreakpointCommandTestCase(TestBase):
def breakpoint_command_script_parameters(self):
"""Test that the frame and breakpoint location are being properly passed to the script breakpoint command function."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint.
@@ -245,42 +257,20 @@ class BreakpointCommandTestCase(TestBase):
self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
# Now add callbacks for the breakpoints just created.
- self.runCmd("breakpoint command add -s python -o 'here = open(\"output-2.txt\", \"w\"); here.write(str(frame) + \"\\n\"); here.write(str(bp_loc) + \"\\n\"); here.close()' 1")
-
- # Remove 'output-2.txt' if it already exists.
+ self.runCmd("breakpoint command add -s python -o 'import side_effect; side_effect.frame = str(frame); side_effect.bp_loc = str(bp_loc)' 1")
- if (os.path.exists('output-2.txt')):
- os.remove('output-2.txt')
-
- # Run program, hit breakpoint, and hopefully write out new version of
- # 'output-2.txt'
+ # Reset canary variables and run.
+ side_effect.frame = None
+ side_effect.bp_loc = None
self.runCmd("run", RUN_SUCCEEDED)
- # Check that the file 'output.txt' exists and contains the string
- # "lldb".
-
- # The 'output-2.txt' file should now exist.
- self.assertTrue(
- os.path.isfile("output-2.txt"),
- "'output-2.txt' exists due to breakpoint command for breakpoint 1.")
-
- # Read the output file produced by running the program.
- with open('output-2.txt', 'r') as f:
- output = f.read()
-
- self.expect(
- output,
- "File 'output-2.txt' and the content matches",
- exe=False,
- startstr="frame #0:",
- patterns=["1.* where = .*main .* resolved, hit count = 1"])
-
- # Now remove 'output-2.txt'
- os.remove('output-2.txt')
+ self.expect(side_effect.frame, exe=False, startstr="frame #0:")
+ self.expect(side_effect.bp_loc, exe=False,
+ patterns=["1.* where = .*main .* resolved, hit count = 1"])
def breakpoint_commands_on_creation(self):
"""Test that setting breakpoint commands when creating the breakpoint works"""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target.IsValid(), "Created an invalid target.")
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
index 01af8369aaf1..7c7aad0bc81e 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
@@ -12,12 +12,13 @@ import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+import side_effect
class PythonBreakpointCommandSettingTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- my_var = 10
+ NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
def test_step_out_python(self):
@@ -31,7 +32,7 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
self.main_source_spec = lldb.SBFileSpec(self.main_source)
def do_set_python_command_from_python(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
self.target = self.dbg.CreateTarget(exe)
@@ -69,12 +70,9 @@ class PythonBreakpointCommandSettingTestCase(TestBase):
self.assertTrue(got_one_in_B, "Failed to match the pattern in B")
self.target.BreakpointDelete(no_files_bkpt.GetID())
- PythonBreakpointCommandSettingTestCase.my_var = 10
error = lldb.SBError()
- error = body_bkpt.SetScriptCallbackBody("\
-import TestBreakpointCommandsFromPython\n\
-TestBreakpointCommandsFromPython.PythonBreakpointCommandSettingTestCase.my_var = 20\n\
-print('Hit breakpoint')")
+ error = body_bkpt.SetScriptCallbackBody(
+ "import side_effect; side_effect.callback = 'callback was here'")
self.assertTrue(
error.Success(),
"Failed to set the script callback body: %s." %
@@ -84,9 +82,9 @@ print('Hit breakpoint')")
"command script import --allow-reload ./bktptcmd.py")
func_bkpt.SetScriptCallbackFunction("bktptcmd.function")
- # We will use the function that touches a text file, so remove it
- # first:
- self.RemoveTempFile("output2.txt")
+ # Clear out canary variables
+ side_effect.bktptcmd = None
+ side_effect.callback = None
# Now launch the process, and do not stop at entry point.
self.process = self.target.LaunchSimple(
@@ -100,11 +98,5 @@ print('Hit breakpoint')")
self.assertTrue(len(threads) == 1, "Stopped at inner breakpoint.")
self.thread = threads[0]
- self.assertTrue(PythonBreakpointCommandSettingTestCase.my_var == 20)
-
- # Check for the function version as well, which produced this file:
- # Remember to clean up after ourselves...
- self.assertTrue(
- os.path.isfile("output2.txt"),
- "'output2.txt' exists due to breakpoint command for breakpoint function.")
- self.RemoveTempFile("output2.txt")
+ self.assertEquals("callback was here", side_effect.callback)
+ self.assertEquals("function was here", side_effect.bktptcmd)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
index baf237bf0764..d064b75b91cf 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestRegexpBreakCommand.py
@@ -31,7 +31,7 @@ class RegexpBreakCommandTestCase(TestBase):
def regexp_break_command(self):
"""Test the super consie "b" command, which is analias for _regexp-break."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
break_results = lldbutil.run_break_set_command(
@@ -54,7 +54,7 @@ class RegexpBreakCommandTestCase(TestBase):
num_locations=1)
# Check breakpoint with full file path.
- full_path = os.path.join(os.getcwd(), self.source)
+ full_path = os.path.join(self.getSourceDir(), self.source)
break_results = lldbutil.run_break_set_command(
self, "b %s:%d" % (full_path, self.line))
lldbutil.check_breakpoint_result(
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
index cf1fc2cf02c9..ac0f753ccd8d 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
@@ -1,7 +1,5 @@
from __future__ import print_function
-
+import side_effect
def function(frame, bp_loc, dict):
- there = open("output2.txt", "w")
- print("lldb", file=there)
- there.close()
+ side_effect.bktptcmd = "function was here"
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
index 62ec97f43284..702644b692d8 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/main.c
@@ -9,5 +9,9 @@
int main (int argc, char const *argv[])
{
+ // Add a body to the function, so we can set more than one
+ // breakpoint in it.
+ static volatile int var = 0;
+ var++;
return 0; // Set break point at this line.
}
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/side_effect.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/side_effect.py
new file mode 100644
index 000000000000..ef4ab2b159cc
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/side_effect.py
@@ -0,0 +1,5 @@
+"""
+A dummy module for testing the execution of various breakpoint commands. A
+command will modify a global variable in this module and test will check its
+value.
+"""
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
index 3fd9b13c7119..959c7e8f95cc 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
@@ -59,7 +59,7 @@ class BreakpointConditionsTestCase(TestBase):
def breakpoint_conditions(self, inline=False):
"""Exercise breakpoint condition with 'breakpoint modify -c <expr> id'."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
if inline:
@@ -132,7 +132,7 @@ class BreakpointConditionsTestCase(TestBase):
def breakpoint_conditions_python(self):
"""Use Python APIs to set breakpoint conditions."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -200,7 +200,7 @@ class BreakpointConditionsTestCase(TestBase):
def breakpoint_invalid_conditions_python(self):
"""Use Python APIs to set breakpoint conditions."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
index 5d7b6f9169ad..6f696be83249 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_hit_count/TestBreakpointHitCount.py
@@ -22,6 +22,31 @@ class BreakpointHitCountTestCase(TestBase):
self.build()
self.do_test_breakpoint_location_hit_count()
+ def test_breakpoint_one_shot(self):
+ """Check that one-shot breakpoints trigger only once."""
+ self.build()
+
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ self.runCmd("tb a")
+ process = target.LaunchSimple(
+ None, None, self.get_process_working_directory())
+ self.assertTrue(process, PROCESS_IS_VALID)
+
+ from lldbsuite.test.lldbutil import get_stopped_thread
+ thread = get_stopped_thread(process, lldb.eStopReasonBreakpoint)
+ self.assertTrue(
+ thread.IsValid(),
+ "There should be a thread stopped due to breakpoint")
+
+ frame0 = thread.GetFrameAtIndex(0)
+ self.assertTrue(frame0.GetFunctionName() == "a(int)" or frame0.GetFunctionName() == "int a(int)");
+
+ process.Continue()
+ self.assertEqual(process.GetState(), lldb.eStateExited)
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
@@ -32,7 +57,7 @@ class BreakpointHitCountTestCase(TestBase):
def do_test_breakpoint_location_hit_count(self):
"""Use Python APIs to check breakpoint hit count."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
index 621bd4a55f06..02fb1e0f49d4 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ids/TestBreakpointIDs.py
@@ -19,7 +19,7 @@ class BreakpointIDTestCase(TestBase):
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
index 09e20bc5ac35..eb4bac7e6e66 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_ignore_count/TestBreakpointIgnoreCount.py
@@ -46,7 +46,7 @@ class BreakpointIgnoreCountTestCase(TestBase):
def breakpoint_ignore_count(self):
"""Exercise breakpoint ignore count with 'breakpoint set -i <count>'."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Create a breakpoint in main.c at line1.
@@ -101,7 +101,7 @@ class BreakpointIgnoreCountTestCase(TestBase):
def breakpoint_ignore_count_python(self):
"""Use Python APIs to set breakpoint ignore count."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
index 255b6f7fa292..6eaab0c680f5 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_in_delayslot/TestAvoidBreakpointInDelaySlot.py
@@ -21,7 +21,7 @@ class AvoidBreakpointInDelaySlotAPITestCase(TestBase):
@skipIf(archs=no_match(re.compile('mips*')))
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe,
patterns=["Current executable set to .*a.out.*"])
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
index 214c110afcd6..b69007014b10 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
@@ -36,7 +36,7 @@ class TestBreakpointLanguage(TestBase):
self.build()
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
# Don't read in dependencies so we don't come across false matches that
# add unwanted breakpoint hits.
@@ -77,7 +77,7 @@ class TestBreakpointLanguage(TestBase):
self.build()
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
# Don't read in dependencies so we don't come across false matches that
# add unwanted breakpoint hits.
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
index de24d8b002d7..7eb465f29599 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_locations/TestBreakpointLocations.py
@@ -41,7 +41,7 @@ class BreakpointLocationsTestCase(TestBase):
self.line = line_number('main.c', '// Set break point at this line.')
def set_breakpoint (self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, "Target %s is not valid"%(exe))
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
index b95d2cea550a..8b5352866c21 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_names/TestBreakpointNames.py
@@ -58,12 +58,12 @@ class BreakpointNames(TestBase):
self.do_check_configuring_permissions_cli()
def setup_target(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a targets we are making breakpoint in and copying to:
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
- self.main_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "main.c"))
+ self.main_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "main.c"))
def check_name_in_target(self, bkpt_name):
name_list = lldb.SBStringList()
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
index 871363b7aed3..c9ef2a730010 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_options/TestBreakpointOptions.py
@@ -28,7 +28,7 @@ class BreakpointOptionsTestCase(TestBase):
def breakpoint_options_test(self):
"""Test breakpoint command for different options."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint with 1 locations.
@@ -78,7 +78,7 @@ class BreakpointOptionsTestCase(TestBase):
def breakpoint_options_language_test(self):
"""Test breakpoint command for language option."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint with 1 locations.
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
index 2410f2ee82b3..7603bd90ffc5 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
@@ -15,8 +15,7 @@ class BreakpointSetRestart(TestBase):
def test_breakpoint_set_restart(self):
self.build()
- cwd = os.getcwd()
- exe = os.path.join(cwd, 'a.out')
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -33,9 +32,7 @@ class BreakpointSetRestart(TestBase):
break
bp = target.BreakpointCreateBySourceRegex(
- self.BREAKPOINT_TEXT, lldb.SBFileSpec(
- os.path.join(
- cwd, 'main.cpp')))
+ self.BREAKPOINT_TEXT, lldb.SBFileSpec('main.cpp'))
self.assertTrue(
bp.IsValid() and bp.GetNumLocations() == 1,
VALID_BREAKPOINT)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/Makefile
index 0ac34a186b25..2d7f20f43fed 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/Makefile
@@ -1,7 +1,14 @@
LEVEL = ../../../make
-CXX_SOURCES := main.cpp
+CXX_SOURCES := relative.cpp
EXE := CompDirSymLink
include $(LEVEL)/Makefile.rules
+
+# Force relative filenames by copying it into the build directory.
+relative.cpp: main.cpp
+ cp -f $< $@
+
+clean::
+ rm -rf relative.cpp
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
index e4672fbbf1ba..4385304c88b6 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/comp_dir_symlink/TestCompDirSymLink.py
@@ -13,7 +13,7 @@ from lldbsuite.test import lldbutil
_EXE_NAME = 'CompDirSymLink' # Must match Makefile
-_SRC_FILE = 'main.cpp'
+_SRC_FILE = 'relative.cpp'
_COMP_DIR_SYM_LINK_PROP = 'plugin.symbol-file.dwarf.comp-dir-symlink-paths'
@@ -25,8 +25,9 @@ class CompDirSymLinkTestCase(TestBase):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
- self.line = line_number(_SRC_FILE, '// Set break point at this line.')
- self.src_path = os.path.join(os.getcwd(), _SRC_FILE)
+ self.line = line_number(
+ os.path.join(self.getSourceDir(), "main.cpp"),
+ '// Set break point at this line.')
@skipIf(hostoslist=["windows"])
def test_symlink_paths_set(self):
@@ -35,39 +36,43 @@ class CompDirSymLinkTestCase(TestBase):
self.runCmd(
"settings set %s %s" %
(_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
- lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
+ src_path = self.getBuildArtifact(_SRC_FILE)
+ lldbutil.run_break_set_by_file_and_line(self, src_path, self.line)
@skipIf(hostoslist=no_match(["linux"]))
def test_symlink_paths_set_procselfcwd(self):
+ os.chdir(self.getBuildDir())
pwd_symlink = '/proc/self/cwd'
self.doBuild(pwd_symlink)
self.runCmd(
"settings set %s %s" %
(_COMP_DIR_SYM_LINK_PROP, pwd_symlink))
- lldbutil.run_break_set_by_file_and_line(self, self.src_path, self.line)
+ src_path = self.getBuildArtifact(_SRC_FILE)
+ lldbutil.run_break_set_by_file_and_line(self, src_path, self.line)
@skipIf(hostoslist=["windows"])
def test_symlink_paths_unset(self):
pwd_symlink = self.create_src_symlink()
self.doBuild(pwd_symlink)
self.runCmd('settings clear ' + _COMP_DIR_SYM_LINK_PROP)
+ src_path = self.getBuildArtifact(_SRC_FILE)
self.assertRaises(
AssertionError,
lldbutil.run_break_set_by_file_and_line,
self,
- self.src_path,
+ src_path,
self.line)
def create_src_symlink(self):
- pwd_symlink = os.path.join(os.getcwd(), 'pwd_symlink')
+ pwd_symlink = self.getBuildArtifact('pwd_symlink')
if os.path.exists(pwd_symlink):
os.unlink(pwd_symlink)
- os.symlink(os.getcwd(), pwd_symlink)
+ os.symlink(self.getBuildDir(), pwd_symlink)
self.addTearDownHook(lambda: os.remove(pwd_symlink))
return pwd_symlink
def doBuild(self, pwd_symlink):
- self.build(None, None, {'PWD': pwd_symlink}, True)
+ self.build(None, None, {'PWD': pwd_symlink})
- exe = os.path.join(os.getcwd(), _EXE_NAME)
+ exe = self.getBuildArtifact(_EXE_NAME)
self.runCmd('file ' + exe, CURRENT_EXECUTABLE_SET)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
index adec9fa5dddb..e4c19fd0d3da 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp/TestCPPBreakpointLocations.py
@@ -45,7 +45,7 @@ class TestCPPBreakpointLocations(TestBase):
def breakpoint_id_tests(self):
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
bp_dicts = [
@@ -69,7 +69,7 @@ class TestCPPBreakpointLocations(TestBase):
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test_destructors(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
# Don't skip prologue, so we can check the breakpoint address more
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
index 3019e1c1c557..26fe02ba56ce 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/cpp_exception/TestCPPExceptionBreakpoint.py
@@ -32,7 +32,7 @@ class TestCPPExceptionBreakpoint (TestBase):
self.main_source_spec = lldb.SBFileSpec(self.main_source)
def do_cpp_exception_bkpt(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
self.target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
index d044827e0084..11ec67d91097 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/debugbreak/TestDebugBreak.py
@@ -20,7 +20,7 @@ class DebugBreakTestCase(TestBase):
def test_asm_int_3(self):
"""Test that intrinsics like `__debugbreak();` and `asm {"int3"}` are treated like breakpoints."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Run the program.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
index a934ad356ac6..4b595ab7819e 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/dummy_target_breakpoints/TestBreakpointsWithNoTargets.py
@@ -46,7 +46,7 @@ class BreakpointInDummyTarget (TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# The breakpoint list should show 3 locations.
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
index 801c1041bbe1..06ef85cf908d 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/Makefile
@@ -3,6 +3,5 @@ LEVEL = ../../../make
DYLIB_NAME := foo
DYLIB_CXX_SOURCES := foo.cpp
CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS := -fPIC
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
index 4dfa03d5fab4..9551ab278ebf 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/global_constructor/TestBreakpointInGlobalConstructor.py
@@ -17,23 +17,24 @@ class TestBreakpointInGlobalConstructors(TestBase):
mydir = TestBase.compute_mydir(__file__)
NO_DEBUG_INFO_TESTCASE = True
- def setUp(self):
- TestBase.setUp(self)
+ def test(self):
+ self.build()
self.line_foo = line_number('foo.cpp', '// !BR_foo')
self.line_main = line_number('main.cpp', '// !BR_main')
- @expectedFailureAll(bugnumber="llvm.org/pr35480", oslist=["linux"])
- def test(self):
- self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- self.runCmd("file %s" % exe)
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+ self.assertTrue(target, VALID_TARGET)
+
+ env= self.registerSharedLibrariesWithTarget(target, ["foo"])
bp_main = lldbutil.run_break_set_by_file_and_line(
self, 'main.cpp', self.line_main)
+
bp_foo = lldbutil.run_break_set_by_file_and_line(
- self, 'foo.cpp', self.line_foo)
+ self, 'foo.cpp', self.line_foo, num_expected_locations=-2)
- self.runCmd("run")
+ process = target.LaunchSimple(
+ None, env, self.get_process_working_directory())
self.assertIsNotNone(
lldbutil.get_one_thread_stopped_at_breakpoint_id(
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
index 21fe084d3dfb..69dfac225258 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
@@ -47,12 +47,8 @@ class HardwareBreakpointMultiThreadTestCase(TestBase):
def break_multi_thread(self, removal_type):
"""Test that lldb hardware breakpoints work for multiple threads."""
- self.runCmd(
- "file %s" %
- os.path.join(
- os.getcwd(),
- 'a.out'),
- CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
# Stop in main before creating any threads.
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
index fe8f430096d9..ee67dda62420 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/TestInlinedBreakpoints.py
@@ -33,7 +33,7 @@ class InlinedBreakpointsTestCase(TestBase):
def inlined_breakpoints(self):
"""Test 'b basic_types.cpp:176' does break (where int.cpp includes basic_type.cpp)."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# With the inline-breakpoint-strategy, our file+line breakpoint should
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp b/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp
index 5881afe1f395..75d2c3690c89 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/inlined_breakpoints/basic_type.cpp
@@ -20,6 +20,9 @@
#endif
+#include <cstdint>
+#include <cstdio>
+
class a_class
{
public:
@@ -79,12 +82,9 @@ typedef struct a_union_nonzero_tag {
} a_union_nonzero_t;
-#include <stdint.h>
-#include <stdio.h>
-
void Puts(char const *msg)
{
- puts(msg);
+ std::puts(msg);
}
int
@@ -124,53 +124,53 @@ main (int argc, char const *argv[])
a_union_zero_t a_union_zero_array_unbounded[] = {{ T_VALUE_1 }, { T_VALUE_2 }};
#ifdef T_PRINTF_FORMAT
- printf ("%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
- printf ("%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
- printf ("%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
-
- printf ("%s[2]: a_array_bounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[0]);
- printf ("%s[2]: a_array_bounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[1]);
-
- printf ("%s[]: a_array_unbounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[0]);
- printf ("%s[]: a_array_unbounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[1]);
-
- printf ("(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
- printf ("(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
- printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
- printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
- printf ("(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
- printf ("(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
-
- printf ("(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
- printf ("(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
- printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
- printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
- printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
- printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
+ std::printf ("%s: a = '" T_PRINTF_FORMAT "'\n", T_CSTR, a);
+ std::printf ("%s*: %p => *a_ptr = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_ptr, *a_ptr);
+ std::printf ("%s&: @%p => a_ref = '" T_PRINTF_FORMAT "'\n", T_CSTR, &a_ref, a_ref);
+
+ std::printf ("%s[2]: a_array_bounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[0]);
+ std::printf ("%s[2]: a_array_bounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_bounded[1]);
+
+ std::printf ("%s[]: a_array_unbounded[0] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[0]);
+ std::printf ("%s[]: a_array_unbounded[1] = '" T_PRINTF_FORMAT "'\n", T_CSTR, a_array_unbounded[1]);
+
+ std::printf ("(a_class) a_class_instance.m_a = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_a());
+ std::printf ("(a_class) a_class_instance.m_b = '" T_PRINTF_FORMAT "'\n", a_class_instance.get_b());
+ std::printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_a = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_a());
+ std::printf ("(a_class*) a_class_ptr = %p, a_class_ptr->m_b = '" T_PRINTF_FORMAT "'\n", a_class_ptr, a_class_ptr->get_b());
+ std::printf ("(a_class&) a_class_ref = %p, a_class_ref.m_a = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_a());
+ std::printf ("(a_class&) a_class_ref = %p, a_class_ref.m_b = '" T_PRINTF_FORMAT "'\n", &a_class_ref, a_class_ref.get_b());
+
+ std::printf ("(a_struct_t) a_struct.a = '" T_PRINTF_FORMAT "'\n", a_struct.a);
+ std::printf ("(a_struct_t) a_struct.b = '" T_PRINTF_FORMAT "'\n", a_struct.b);
+ std::printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->a = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->a);
+ std::printf ("(a_struct_t*) a_struct_ptr = %p, a_struct_ptr->b = '" T_PRINTF_FORMAT "'\n", a_struct_ptr, a_struct_ptr->b);
+ std::printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.a = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.a);
+ std::printf ("(a_struct_t&) a_struct_ref = %p, a_struct_ref.b = '" T_PRINTF_FORMAT "'\n", &a_struct_ref, a_struct_ref.b);
- printf ("(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
- printf ("(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
- printf ("(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
+ std::printf ("(a_union_zero_t) a_union_zero.a = '" T_PRINTF_FORMAT "'\n", a_union_zero.a);
+ std::printf ("(a_union_zero_t*) a_union_zero_ptr = %p, a_union_zero_ptr->a = '" T_PRINTF_FORMAT "'\n", a_union_zero_ptr, a_union_zero_ptr->a);
+ std::printf ("(a_union_zero_t&) a_union_zero_ref = %p, a_union_zero_ref.a = '" T_PRINTF_FORMAT "'\n", &a_union_zero_ref, a_union_zero_ref.a);
- printf ("(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
- printf ("(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
- printf ("(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
+ std::printf ("(a_union_nonzero_t) a_union_nonzero.u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero.u.a);
+ std::printf ("(a_union_nonzero_t*) a_union_nonzero_ptr = %p, a_union_nonzero_ptr->u.a = '" T_PRINTF_FORMAT "'\n", a_union_nonzero_ptr, a_union_nonzero_ptr->u.a);
+ std::printf ("(a_union_nonzero_t&) a_union_nonzero_ref = %p, a_union_nonzero_ref.u.a = '" T_PRINTF_FORMAT "'\n", &a_union_nonzero_ref, a_union_nonzero_ref.u.a);
- printf ("(a_struct_t[2]) a_struct_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].a);
- printf ("(a_struct_t[2]) a_struct_array_bounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].b);
- printf ("(a_struct_t[2]) a_struct_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].a);
- printf ("(a_struct_t[2]) a_struct_array_bounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].b);
+ std::printf ("(a_struct_t[2]) a_struct_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].a);
+ std::printf ("(a_struct_t[2]) a_struct_array_bounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[0].b);
+ std::printf ("(a_struct_t[2]) a_struct_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].a);
+ std::printf ("(a_struct_t[2]) a_struct_array_bounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_bounded[1].b);
- printf ("(a_struct_t[]) a_struct_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].a);
- printf ("(a_struct_t[]) a_struct_array_unbounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].b);
- printf ("(a_struct_t[]) a_struct_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].a);
- printf ("(a_struct_t[]) a_struct_array_unbounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].b);
+ std::printf ("(a_struct_t[]) a_struct_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].a);
+ std::printf ("(a_struct_t[]) a_struct_array_unbounded[0].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[0].b);
+ std::printf ("(a_struct_t[]) a_struct_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].a);
+ std::printf ("(a_struct_t[]) a_struct_array_unbounded[1].b = '" T_PRINTF_FORMAT "'\n", a_struct_array_unbounded[1].b);
- printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[0].a);
- printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[1].a);
+ std::printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[0].a);
+ std::printf ("(a_union_zero_t[2]) a_union_zero_array_bounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_bounded[1].a);
- printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[0].a);
- printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
+ std::printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[0].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[0].a);
+ std::printf ("(a_union_zero_t[]) a_union_zero_array_unbounded[1].a = '" T_PRINTF_FORMAT "'\n", a_union_zero_array_unbounded[1].a);
#endif
Puts("About to exit, break here to check values..."); // Set break point at this line.
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
index e7a1cab7e195..06ef85cf908d 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/Makefile
@@ -3,6 +3,5 @@ LEVEL = ../../../make
DYLIB_NAME := foo
DYLIB_CXX_SOURCES := foo.cpp
CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS += -fPIC
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
index 26041c313e57..16d5bc75473c 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/TestMoveNearest.py
@@ -24,7 +24,7 @@ class TestMoveNearest(TestBase):
"""Test target.move-to-nearest logic"""
self.build()
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
lldbutil.run_break_set_by_symbol(self, 'main', sym_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
index 060b91f5a5ea..9f0e56dd22ee 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/move_nearest/foo.h
@@ -1,6 +1,5 @@
-LLDB_TEST_API inline int foo1() { return 1; } // !BR1
+inline int foo1() { return 1; } // !BR1
-LLDB_TEST_API inline int foo2() { return 2; } // !BR2
+inline int foo2() { return 2; } // !BR2
LLDB_TEST_API extern int call_foo1();
-LLDB_TEST_API extern int call_foo2();
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
index f43bbb7515c1..e5e8473eedd6 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/objc/TestObjCBreakpoints.py
@@ -22,7 +22,7 @@ class TestObjCBreakpoints(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test_break(self):
- """Test setting Objective C specific breakpoints (DWARF in .o files)."""
+ """Test setting Objective-C specific breakpoints (DWARF in .o files)."""
self.build()
self.setTearDownCleanup()
self.check_objc_breakpoints(False)
@@ -73,7 +73,7 @@ class TestObjCBreakpoints(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
index 6f93994a4664..5c3da17c254e 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/serialize/TestBreakpointSerialization.py
@@ -60,7 +60,7 @@ class BreakpointSerialization(TestBase):
self.addTearDownHook(cleanup)
self.RemoveTempFile(self.bkpts_file_path)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create the targets we are making breakpoints in and copying them to:
self.orig_target = self.dbg.CreateTarget(exe)
@@ -73,7 +73,7 @@ class BreakpointSerialization(TestBase):
# Call super's setUp().
TestBase.setUp(self)
- self.bkpts_file_path = os.path.join(os.getcwd(), "breakpoints.json")
+ self.bkpts_file_path = self.getBuildArtifact("breakpoints.json")
self.bkpts_file_spec = lldb.SBFileSpec(self.bkpts_file_path)
def check_equivalence(self, source_bps, do_write = True):
@@ -119,7 +119,7 @@ class BreakpointSerialization(TestBase):
empty_module_list = lldb.SBFileSpecList()
empty_cu_list = lldb.SBFileSpecList()
- blubby_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "blubby.c"))
+ blubby_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "blubby.c"))
# It isn't actually important for these purposes that these breakpoint
# actually have locations.
@@ -147,7 +147,7 @@ class BreakpointSerialization(TestBase):
cu_list.Append(lldb.SBFileSpec("AnotherCU.c"))
cu_list.Append(lldb.SBFileSpec("ThirdCU.c"))
- blubby_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "blubby.c"))
+ blubby_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "blubby.c"))
# It isn't actually important for these purposes that these breakpoint
# actually have locations.
@@ -174,7 +174,7 @@ class BreakpointSerialization(TestBase):
empty_module_list = lldb.SBFileSpecList()
empty_cu_list = lldb.SBFileSpecList()
- blubby_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "blubby.c"))
+ blubby_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "blubby.c"))
# It isn't actually important for these purposes that these breakpoint
# actually have locations.
@@ -218,7 +218,7 @@ class BreakpointSerialization(TestBase):
empty_module_list = lldb.SBFileSpecList()
empty_cu_list = lldb.SBFileSpecList()
- blubby_file_spec = lldb.SBFileSpec(os.path.join(os.getcwd(), "blubby.c"))
+ blubby_file_spec = lldb.SBFileSpec(os.path.join(self.getSourceDir(), "blubby.c"))
# It isn't actually important for these purposes that these breakpoint
# actually have locations.
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
index 791cc70a7498..4256c70a0265 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/source_regexp/TestSourceRegexBreakpoints.py
@@ -28,7 +28,7 @@ class TestSourceRegexBreakpoints(TestBase):
def source_regex_locations(self):
""" Test that restricting source expressions to files & to functions. """
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -64,7 +64,7 @@ class TestSourceRegexBreakpoints(TestBase):
def source_regex_restrictions(self):
""" Test that restricting source expressions to files & to functions. """
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
index 4dfeae3f5e19..c2084295ef79 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/breakpoint/step_over_breakpoint/TestStepOverBreakpoint.py
@@ -21,7 +21,7 @@ class StepOverBreakpointsTestCase(TestBase):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
src = lldb.SBFileSpec("main.cpp")
# Create a target by the debugger.
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py b/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
index d562cb1511ac..1698c0d0c35f 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/TestCommandScript.py
@@ -8,13 +8,16 @@ from __future__ import print_function
import os
import time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
class CmdPythonTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test(self):
self.build()
self.pycmd_tests()
@@ -27,7 +30,7 @@ class CmdPythonTestCase(TestBase):
self.expect('targetname',
substrs=['a.out'], matching=False, error=True)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe,
patterns=["Current executable set to .*a.out"])
@@ -46,6 +49,7 @@ class CmdPythonTestCase(TestBase):
self.runCmd('command script delete tell_curr', check=False)
self.runCmd('command script delete bug11569', check=False)
self.runCmd('command script delete takes_exe_ctx', check=False)
+ self.runCmd('command script delete decorated', check=False)
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
@@ -64,13 +68,19 @@ class CmdPythonTestCase(TestBase):
substrs=['Just a docstring for welcome_impl',
'A command that says hello to LLDB users'])
+ decorated_commands = ["decorated" + str(n) for n in range(1, 5)]
+ for name in decorated_commands:
+ self.expect(name, substrs=["hello from " + name])
+ self.expect("help " + name,
+ substrs=["Python command defined by @lldb.command"])
+
self.expect("help",
substrs=['For more information run',
- 'welcome'])
+ 'welcome'] + decorated_commands)
self.expect("help -a",
substrs=['For more information run',
- 'welcome'])
+ 'welcome'] + decorated_commands)
self.expect("help -u", matching=False,
substrs=['For more information run'])
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/decorated.py b/packages/Python/lldbsuite/test/functionalities/command_script/decorated.py
new file mode 100644
index 000000000000..f9707a5706ac
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/decorated.py
@@ -0,0 +1,35 @@
+from __future__ import print_function
+
+import lldb
+
+
+@lldb.command()
+def decorated1(debugger, args, exe_ctx, result, dict):
+ """
+ Python command defined by @lldb.command
+ """
+ print("hello from decorated1", file=result)
+
+
+@lldb.command(doc="Python command defined by @lldb.command")
+def decorated2(debugger, args, exe_ctx, result, dict):
+ """
+ This docstring is overridden.
+ """
+ print("hello from decorated2", file=result)
+
+
+@lldb.command()
+def decorated3(debugger, args, result, dict):
+ """
+ Python command defined by @lldb.command
+ """
+ print("hello from decorated3", file=result)
+
+
+@lldb.command("decorated4")
+def _decorated4(debugger, args, exe_ctx, result, dict):
+ """
+ Python command defined by @lldb.command
+ """
+ print("hello from decorated4", file=result)
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script/py_import b/packages/Python/lldbsuite/test/functionalities/command_script/py_import
index 169daacc1a83..6c1f7b8185f6 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script/py_import
+++ b/packages/Python/lldbsuite/test/functionalities/command_script/py_import
@@ -10,3 +10,4 @@ command script add tell_sync --function welcome.check_for_synchro --synchronicit
command script add tell_async --function welcome.check_for_synchro --synchronicity async
command script add tell_curr --function welcome.check_for_synchro --synchronicity curr
command script add takes_exe_ctx --function welcome.takes_exe_ctx
+command script import decorated.py
diff --git a/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
index 975ad32689b2..c6ad75f014ee 100644
--- a/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
+++ b/packages/Python/lldbsuite/test/functionalities/command_script_immediate_output/TestCommandScriptImmediateOutput.py
@@ -32,7 +32,7 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
"""Test that LLDB correctly allows scripted commands to set immediate output to the console."""
self.launch(timeout=10)
- script = os.path.join(os.getcwd(), 'custom_command.py')
+ script = os.path.join(self.getSourceDir(), 'custom_command.py')
prompt = "\(lldb\) "
self.sendline('command script import %s' % script, patterns=[prompt])
@@ -54,12 +54,12 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
"""Test that LLDB correctly allows scripted commands to set immediate output to a file."""
self.launch(timeout=10)
- test_files = {os.path.join(os.getcwd(), 'read.txt'): 'r',
- os.path.join(os.getcwd(), 'write.txt'): 'w',
- os.path.join(os.getcwd(), 'append.txt'): 'a',
- os.path.join(os.getcwd(), 'write_plus.txt'): 'w+',
- os.path.join(os.getcwd(), 'read_plus.txt'): 'r+',
- os.path.join(os.getcwd(), 'append_plus.txt'): 'a+'}
+ test_files = {self.getBuildArtifact('read.txt'): 'r',
+ self.getBuildArtifact('write.txt'): 'w',
+ self.getBuildArtifact('append.txt'): 'a',
+ self.getBuildArtifact('write_plus.txt'): 'w+',
+ self.getBuildArtifact('read_plus.txt'): 'r+',
+ self.getBuildArtifact('append_plus.txt'): 'a+'}
starter_string = 'Starter Garbage\n'
write_string = 'writing to file with mode: '
@@ -68,7 +68,7 @@ class CommandScriptImmediateOutputTestCase (PExpectTest):
with open(path, 'w+') as init:
init.write(starter_string)
- script = os.path.join(os.getcwd(), 'custom_command.py')
+ script = os.path.join(self.getSourceDir(), 'custom_command.py')
prompt = "\(lldb\) "
self.sendline('command script import %s' % script, patterns=[prompt])
diff --git a/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index 9f55f64b2be5..a3b23834ee12 100644
--- a/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -17,6 +17,8 @@ class CommandLineCompletionTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
@classmethod
def classCleanup(cls):
"""Cleanup the test byproducts."""
@@ -26,23 +28,17 @@ class CommandLineCompletionTestCase(TestBase):
except:
pass
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_at(self):
"""Test that 'at' completes to 'attach '."""
self.complete_from_to('at', 'attach ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_de(self):
"""Test that 'de' completes to 'detach '."""
self.complete_from_to('de', 'detach ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_process_attach_dash_dash_con(self):
"""Test that 'process attach --con' completes to 'process attach --continue '."""
self.complete_from_to(
@@ -50,232 +46,157 @@ class CommandLineCompletionTestCase(TestBase):
'process attach --continue ')
# <rdar://problem/11052829>
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_infinite_loop_while_completing(self):
"""Test that 'process print hello\' completes to itself and does not infinite loop."""
self.complete_from_to('process print hello\\', 'process print hello\\',
turn_off_re_match=True)
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_watchpoint_co(self):
"""Test that 'watchpoint co' completes to 'watchpoint command '."""
self.complete_from_to('watchpoint co', 'watchpoint command ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_watchpoint_command_space(self):
- """Test that 'watchpoint command ' completes to ['Available completions:', 'add', 'delete', 'list']."""
+ """Test that 'watchpoint command ' completes to ['add', 'delete', 'list']."""
self.complete_from_to(
'watchpoint command ', [
- 'Available completions:', 'add', 'delete', 'list'])
+ 'add', 'delete', 'list'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_watchpoint_command_a(self):
"""Test that 'watchpoint command a' completes to 'watchpoint command add '."""
self.complete_from_to(
'watchpoint command a',
'watchpoint command add ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
- def test_watchpoint_set_variable_dash_w(self):
- """Test that 'watchpoint set variable -w' completes to 'watchpoint set variable -w '."""
- self.complete_from_to(
- 'watchpoint set variable -w',
- 'watchpoint set variable -w ')
-
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
- @skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
- def test_watchpoint_set_variable_dash_w_space(self):
- """Test that 'watchpoint set variable -w ' completes to ['Available completions:', 'read', 'write', 'read_write']."""
- self.complete_from_to('watchpoint set variable -w ',
- ['Available completions:', 'read', 'write', 'read_write'])
-
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
- @skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_watchpoint_set_ex(self):
"""Test that 'watchpoint set ex' completes to 'watchpoint set expression '."""
self.complete_from_to(
'watchpoint set ex',
'watchpoint set expression ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_watchpoint_set_var(self):
"""Test that 'watchpoint set var' completes to 'watchpoint set variable '."""
self.complete_from_to('watchpoint set var', 'watchpoint set variable ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
- @skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
- def test_watchpoint_set_variable_dash_w_read_underbar(self):
- """Test that 'watchpoint set variable -w read_' completes to 'watchpoint set variable -w read_write'."""
- self.complete_from_to(
- 'watchpoint set variable -w read_',
- 'watchpoint set variable -w read_write')
-
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_help_fi(self):
- """Test that 'help fi' completes to ['Available completions:', 'file', 'finish']."""
+ """Test that 'help fi' completes to ['file', 'finish']."""
self.complete_from_to(
'help fi', [
- 'Available completions:', 'file', 'finish'])
+ 'file', 'finish'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_help_watchpoint_s(self):
"""Test that 'help watchpoint s' completes to 'help watchpoint set '."""
self.complete_from_to('help watchpoint s', 'help watchpoint set ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_append_target_er(self):
"""Test that 'settings append target.er' completes to 'settings append target.error-path'."""
self.complete_from_to(
'settings append target.er',
'settings append target.error-path')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_insert_after_target_en(self):
"""Test that 'settings insert-after target.env' completes to 'settings insert-after target.env-vars'."""
self.complete_from_to(
'settings insert-after target.env',
'settings insert-after target.env-vars')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_insert_before_target_en(self):
"""Test that 'settings insert-before target.env' completes to 'settings insert-before target.env-vars'."""
self.complete_from_to(
'settings insert-before target.env',
'settings insert-before target.env-vars')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_replace_target_ru(self):
"""Test that 'settings replace target.ru' completes to 'settings replace target.run-args'."""
self.complete_from_to(
'settings replace target.ru',
'settings replace target.run-args')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_s(self):
- """Test that 'settings s' completes to ['Available completions:', 'set', 'show']."""
+ """Test that 'settings s' completes to ['set', 'show']."""
self.complete_from_to(
'settings s', [
- 'Available completions:', 'set', 'show'])
+ 'set', 'show'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_th(self):
"""Test that 'settings set thread-f' completes to 'settings set thread-format'."""
self.complete_from_to('settings set thread-f', 'settings set thread-format')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_s_dash(self):
"""Test that 'settings set -' completes to 'settings set -g'."""
self.complete_from_to('settings set -', 'settings set -g')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_clear_th(self):
"""Test that 'settings clear thread-f' completes to 'settings clear thread-format'."""
self.complete_from_to(
'settings clear thread-f',
'settings clear thread-format')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_ta(self):
"""Test that 'settings set ta' completes to 'settings set target.'."""
self.complete_from_to(
'settings set target.ma',
'settings set target.max-')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_target_exec(self):
"""Test that 'settings set target.exec' completes to 'settings set target.exec-search-paths '."""
self.complete_from_to(
'settings set target.exec',
'settings set target.exec-search-paths')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_target_pr(self):
- """Test that 'settings set target.pr' completes to ['Available completions:',
+ """Test that 'settings set target.pr' completes to [
'target.prefer-dynamic-value', 'target.process.']."""
self.complete_from_to('settings set target.pr',
- ['Available completions:',
- 'target.prefer-dynamic-value',
+ ['target.prefer-dynamic-value',
'target.process.'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_target_process(self):
"""Test that 'settings set target.process' completes to 'settings set target.process.'."""
self.complete_from_to(
'settings set target.process',
'settings set target.process.')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_target_process_dot(self):
"""Test that 'settings set target.process.t' completes to 'settings set target.process.thread.'."""
self.complete_from_to(
'settings set target.process.t',
'settings set target.process.thread.')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_settings_set_target_process_thread_dot(self):
- """Test that 'settings set target.process.thread.' completes to ['Available completions:',
+ """Test that 'settings set target.process.thread.' completes to [
'target.process.thread.step-avoid-regexp', 'target.process.thread.trace-thread']."""
self.complete_from_to('settings set target.process.thread.',
- ['Available completions:',
- 'target.process.thread.step-avoid-regexp',
+ ['target.process.thread.step-avoid-regexp',
'target.process.thread.trace-thread'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_target_space(self):
- """Test that 'target ' completes to ['Available completions:', 'create', 'delete', 'list',
+ """Test that 'target ' completes to ['create', 'delete', 'list',
'modules', 'select', 'stop-hook', 'variable']."""
self.complete_from_to('target ',
- ['Available completions:',
- 'create',
+ ['create',
'delete',
'list',
'modules',
@@ -283,35 +204,48 @@ class CommandLineCompletionTestCase(TestBase):
'stop-hook',
'variable'])
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_target_create_dash_co(self):
"""Test that 'target create --co' completes to 'target variable --core '."""
self.complete_from_to('target create --co', 'target create --core ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
- @no_debug_info_test
def test_target_va(self):
"""Test that 'target va' completes to 'target variable '."""
self.complete_from_to('target va', 'target variable ')
- @expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
- @expectedFailureAll(
- oslist=lldbplatform.darwin_all,
- bugnumber="llvm.org/pr25485,<rdar://problem/28573448>")
+ def test_command_argument_completion(self):
+ """Test completion of command arguments"""
+ self.complete_from_to("watchpoint set variable -", ["-w", "-s"])
+ self.complete_from_to('watchpoint set variable -w', 'watchpoint set variable -w ')
+ self.complete_from_to("watchpoint set variable --", ["--watch", "--size"])
+ self.complete_from_to("watchpoint set variable --w", "watchpoint set variable --watch")
+ self.complete_from_to('watchpoint set variable -w ', ['read', 'write', 'read_write'])
+ self.complete_from_to("watchpoint set variable --watch ", ["read", "write", "read_write"])
+ self.complete_from_to("watchpoint set variable --watch w", "watchpoint set variable --watch write")
+ self.complete_from_to('watchpoint set variable -w read_', 'watchpoint set variable -w read_write')
+ # Now try the same thing with a variable name (non-option argument) to
+ # test that getopts arg reshuffling doesn't confuse us.
+ self.complete_from_to("watchpoint set variable foo -", ["-w", "-s"])
+ self.complete_from_to('watchpoint set variable foo -w', 'watchpoint set variable foo -w ')
+ self.complete_from_to("watchpoint set variable foo --", ["--watch", "--size"])
+ self.complete_from_to("watchpoint set variable foo --w", "watchpoint set variable foo --watch")
+ self.complete_from_to('watchpoint set variable foo -w ', ['read', 'write', 'read_write'])
+ self.complete_from_to("watchpoint set variable foo --watch ", ["read", "write", "read_write"])
+ self.complete_from_to("watchpoint set variable foo --watch w", "watchpoint set variable foo --watch write")
+ self.complete_from_to('watchpoint set variable foo -w read_', 'watchpoint set variable foo -w read_write')
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
def test_symbol_name(self):
self.build()
- self.complete_from_to('''file a.out
- breakpoint set -n Fo''',
+ self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+ self.complete_from_to('breakpoint set -n Fo',
'breakpoint set -n Foo::Bar(int,\\ int)',
turn_off_re_match=True)
def complete_from_to(self, str_input, patterns, turn_off_re_match=False):
"""Test that the completion mechanism completes str_input to patterns,
where patterns could be a pattern-string or a list of pattern-strings"""
- import pexpect
# Patterns should not be None in order to proceed.
self.assertFalse(patterns is None)
# And should be either a string or list of strings. Check for list type
@@ -321,53 +255,26 @@ class CommandLineCompletionTestCase(TestBase):
if not isinstance(patterns, list):
patterns = [patterns]
- # The default lldb prompt.
- prompt = "(lldb) "
-
- # So that the child gets torn down after the test.
- self.child = pexpect.spawn(lldbtest_config.lldbExec,
- [self.lldbOption] + ['--no-use-colors'])
- child = self.child
- # Turn on logging for input/output to/from the child.
- with open('child_send.txt', 'w') as f_send:
- with open('child_read.txt', 'w') as f_read:
- child.logfile_send = f_send
- child.logfile_read = f_read
-
- child.expect_exact(prompt)
- child.setecho(True)
- # Sends str_input and a Tab to invoke the completion machinery.
- child.send("%s\t" % str_input)
- child.sendline('')
- child.expect_exact(prompt)
- child.sendline('')
- child.expect_exact(prompt)
-
- # Now that the necessary logging is done, restore logfile to None to
- # stop further logging.
- child.logfile_send = None
- child.logfile_read = None
-
- with open('child_send.txt', 'r') as fs:
- if self.TraceOn():
- print("\n\nContents of child_send.txt:")
- print(fs.read())
- with open('child_read.txt', 'r') as fr:
- from_child = fr.read()
- if self.TraceOn():
- print("\n\nContents of child_read.txt:")
- print(from_child)
-
- # The matching could be verbatim or using generic re pattern.
- for p in patterns:
- # Test that str_input completes to our patterns or substrings.
- # If each pattern/substring matches from_child, the completion
- # mechanism works!
- if turn_off_re_match:
- self.expect(
- from_child, msg=COMPLETION_MSG(
- str_input, p), exe=False, substrs=[p])
- else:
- self.expect(
- from_child, msg=COMPLETION_MSG(
- str_input, p), exe=False, patterns=[p])
+ interp = self.dbg.GetCommandInterpreter()
+ match_strings = lldb.SBStringList()
+ num_matches = interp.HandleCompletion(str_input, len(str_input), 0, -1, match_strings)
+ common_match = match_strings.GetStringAtIndex(0)
+ if num_matches == 0:
+ compare_string = str_input
+ else:
+ if common_match != None and len(common_match) > 0:
+ compare_string = str_input + common_match
+ else:
+ compare_string = ""
+ for idx in range(1, num_matches+1):
+ compare_string += match_strings.GetStringAtIndex(idx) + "\n"
+
+ for p in patterns:
+ if turn_off_re_match:
+ self.expect(
+ compare_string, msg=COMPLETION_MSG(
+ str_input, p), exe=False, substrs=[p])
+ else:
+ self.expect(
+ compare_string, msg=COMPLETION_MSG(
+ str_input, p), exe=False, patterns=[p])
diff --git a/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py b/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
index cec06e48f1cf..904fb4c90372 100644
--- a/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/conditional_break/TestConditionalBreak.py
@@ -39,7 +39,7 @@ class ConditionalBreakTestCase(TestBase):
bugnumber="llvm.org/pr26265: args in frames other than #0 are not evaluated correctly")
def do_conditional_break(self):
"""Exercise some thread and frame APIs to break if c() is called by a()."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -112,9 +112,9 @@ class ConditionalBreakTestCase(TestBase):
if not self.TraceOn():
self.HideStdout()
- # Separate out the "file a.out" command from .lldb file, for the sake of
+ # Separate out the "file " + self.getBuildArtifact("a.out") command from .lldb file, for the sake of
# remote testsuite.
- self.runCmd("file a.out")
+ self.runCmd("file " + self.getBuildArtifact("a.out"))
self.runCmd("command source .lldb")
self.runCmd("break list")
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
index f8ce069478fd..c8f93c1db3a8 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity-chain/TestDarwinLogFilterMatchActivityChain.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterMatchActivityChain(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
index 12a430295a77..32b2623dfb98 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/activity/TestDarwinLogFilterMatchActivity.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterMatchActivity(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
index 8ce4d4135d18..088d1036d1c4 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/category/TestDarwinLogFilterMatchCategory.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterMatchCategory(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
index b7664ddd8071..5a377f99128b 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/message/TestDarwinLogFilterMatchMessage.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterMatchMessage(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
index 5afe649e16a2..f3d4d4de92f0 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/exact_match/subsystem/TestDarwinLogFilterMatchSubsystem.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterMatchSubsystem(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
index 74be57aeef85..16d678aa2417 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity-chain/TestDarwinLogFilterRegexActivityChain.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterRegexActivityChain(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
index 55f015403d1f..e017d56af31c 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/activity/TestDarwinLogFilterRegexActivity.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterRegexActivity(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
index 6786d6f009b0..5a618b11680c 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/category/TestDarwinLogFilterRegexCategory.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterRegexCategory(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
index 28677b54c75d..679db2ea37bb 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/filter/regex/subsystem/TestDarwinLogFilterRegexSubsystem.py
@@ -29,7 +29,7 @@ class TestDarwinLogFilterRegexSubsystem(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
index 65822cab430a..8c9e2875aec5 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/format/TestDarwinLogMessageFormat.py
@@ -28,7 +28,7 @@ class TestDarwinLogMessageFormat(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
index 85b8e30f6064..89791097a3f8 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/source/debug/TestDarwinLogSourceDebug.py
@@ -29,7 +29,7 @@ class TestDarwinLogSourceDebug(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py b/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
index 44348374636d..865eea241981 100644
--- a/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
+++ b/packages/Python/lldbsuite/test/functionalities/darwin_log/source/info/TestDarwinLogSourceInfo.py
@@ -29,7 +29,7 @@ class TestDarwinLogSourceInfo(darwin_log.DarwinLogTestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
index 410da702b93d..18aac237672c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/boolreference/TestFormattersBoolRefPtr.py
@@ -32,7 +32,7 @@ class DataFormatterBoolRefPtr(TestBase):
def boolrefptr_data_formatter_commands(self):
"""Test the formatters we use for BOOL& and BOOL* in Objective-C."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
index 9b430c726e12..891448f00d29 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/compactvectors/TestCompactVectors.py
@@ -27,7 +27,7 @@ class CompactVectorsFormattingTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
index 050f5236445b..6d8a794070d7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-advanced/TestDataFormatterAdv.py
@@ -25,7 +25,7 @@ class AdvDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
index 2d01eb79e188..4e61b7419d5b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-categories/TestDataFormatterCategories.py
@@ -26,7 +26,7 @@ class CategoriesDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
index 0518a75051bb..9749061f42d5 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-cpp/TestDataFormatterCpp.py
@@ -26,10 +26,12 @@ class CppDataFormatterTestCase(TestBase):
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24462: Data formatters have problems on Windows")
+ @skipIf(debug_info="gmodules",
+ bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
index e192943f381e..c451d0f82792 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-disabling/TestDataFormatterDisabling.py
@@ -29,7 +29,7 @@ class DataFormatterDisablingTestCase(TestBase):
def test_with_run_command(self):
"""Check that we can properly disable all data formatter categories."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
index 710cfa8fe12c..2d09be5441ba 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-enum-format/TestDataFormatterEnumFormat.py
@@ -25,7 +25,7 @@ class EnumFormatTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
index d3d93dabc7fb..81ddf597def6 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-globals/TestDataFormatterGlobals.py
@@ -9,6 +9,7 @@ import os
import time
import lldb
from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
@@ -22,10 +23,12 @@ class GlobalsDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
+ @skipIf(debug_info="gmodules",
+ bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
index f4f0a4859896..8b354d764e58 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-named-summaries/TestDataFormatterNamedSummaries.py
@@ -25,7 +25,7 @@ class NamedSummariesDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
index bc39d8d7b152..4643e4738229 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
@@ -96,7 +96,7 @@ class ObjCDataFormatterTestCase(TestBase):
def plain_data_formatter_commands(self):
"""Test basic ObjC formatting behavior."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -162,7 +162,7 @@ class ObjCDataFormatterTestCase(TestBase):
def appkit_common_data_formatters_command(self):
"""Test formatters for AppKit classes."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -186,16 +186,18 @@ class ObjCDataFormatterTestCase(TestBase):
def nsnumber_data_formatter_commands(self):
# Now enable AppKit and check we are displaying Cocoa classes correctly
- self.expect('frame variable num1 num2 num3 num5 num6 num7 num9',
+ self.expect('frame variable num1 num2 num3 num5 num6 num7 num8_Y num8_N num9',
substrs=['(NSNumber *) num1 = ', ' (int)5',
'(NSNumber *) num2 = ', ' (float)3.1',
'(NSNumber *) num3 = ', ' (double)3.14',
'(NSNumber *) num5 = ', ' (char)65',
'(NSNumber *) num6 = ', ' (long)255',
'(NSNumber *) num7 = ', '2000000',
+ '(NSNumber *) num8_Y = ', 'YES',
+ '(NSNumber *) num8_N = ', 'NO',
'(NSNumber *) num9 = ', ' (short)-31616'])
-
+
self.runCmd('frame variable num4', check=True)
output = self.res.GetOutput()
i128_handled_correctly = False
@@ -213,9 +215,17 @@ class ObjCDataFormatterTestCase(TestBase):
'(NSNumber *) num_at3 = ', ' (double)12.5',
'(NSNumber *) num_at4 = ', ' (double)-12.5'])
+ def nsdecimalnumber_data_formatter_commands(self):
+ self.expect('frame variable decimal_number decimal_neg_number decimal_one decimal_zero decimal_nan',
+ substrs=['(NSDecimalNumber *) decimal_number = ', '123456 x 10^-10',
+ '(NSDecimalNumber *) decimal_neg_number = ', '-123456 x 10^10',
+ '(NSDecimalNumber *) decimal_one = ', '1 x 10^0',
+ '(NSDecimalNumber *) decimal_zero = ', '0',
+ '(NSDecimalNumber *) decimal_nan = ', 'NaN'])
+
def nscontainers_data_formatter_commands(self):
self.expect(
- 'frame variable newArray newDictionary newMutableDictionary cfarray_ref mutable_array_ref',
+ 'frame variable newArray nsDictionary newDictionary nscfDictionary cfDictionaryRef newMutableDictionary cfarray_ref mutable_array_ref',
substrs=[
'(NSArray *) newArray = ',
'@"50 elements"',
@@ -223,6 +233,10 @@ class ObjCDataFormatterTestCase(TestBase):
' 12 key/value pairs',
'(NSDictionary *) newMutableDictionary = ',
' 21 key/value pairs',
+ '(NSDictionary *) nsDictionary = ',
+ ' 2 key/value pairs',
+ '(CFDictionaryRef) cfDictionaryRef = ',
+ ' 3 key/value pairs',
'(CFArrayRef) cfarray_ref = ',
'@"3 elements"',
'(CFMutableArrayRef) mutable_array_ref = ',
@@ -243,7 +257,7 @@ class ObjCDataFormatterTestCase(TestBase):
def nsdata_data_formatter_commands(self):
self.expect(
- 'frame variable immutableData mutableData data_ref mutable_data_ref mutable_string_ref',
+ 'frame variable immutableData mutableData data_ref mutable_data_ref mutable_string_ref concreteData concreteMutableData',
substrs=[
'(NSData *) immutableData = ',
' 4 bytes',
@@ -254,7 +268,12 @@ class ObjCDataFormatterTestCase(TestBase):
'(CFMutableDataRef) mutable_data_ref = ',
'@"5 bytes"',
'(CFMutableStringRef) mutable_string_ref = ',
- ' @"Wish ya knew"'])
+ ' @"Wish ya knew"',
+ '(NSData *) concreteData = ',
+ ' 100000 bytes',
+ '(NSMutableData *) concreteMutableData = ',
+ ' 100000 bytes'])
+
def nsurl_data_formatter_commands(self):
self.expect(
@@ -360,7 +379,7 @@ class ObjCDataFormatterTestCase(TestBase):
def expr_objc_data_formatter_commands(self):
"""Test common cases of expression parser <--> formatters interaction."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -408,7 +427,7 @@ class ObjCDataFormatterTestCase(TestBase):
def cf_data_formatter_commands(self):
"""Test formatters for Core OSX frameworks."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -463,7 +482,7 @@ class ObjCDataFormatterTestCase(TestBase):
def kvo_data_formatter_commands(self):
"""Test the behavior of formatters when KVO is in use."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
index 1543ce6edb91..37b34f2ac8b9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -169,7 +169,11 @@ int main (int argc, const char * argv[])
NSNumber* num_at3 = @12.5;
NSNumber* num_at4 = @-12.5;
- NSDecimalNumber* decimal_one = [NSDecimalNumber one];
+ NSDecimalNumber* decimal_number = [NSDecimalNumber decimalNumberWithMantissa:123456 exponent:-10 isNegative:NO];
+ NSDecimalNumber* decimal_number_neg = [NSDecimalNumber decimalNumberWithMantissa:123456 exponent:10 isNegative:YES];
+ NSDecimalNumber* decimal_one = [NSDecimalNumber one];
+ NSDecimalNumber* decimal_zero = [NSDecimalNumber zero];
+ NSDecimalNumber* decimal_nan = [NSDecimalNumber notANumber];
NSString *str0 = [num6 stringValue];
@@ -381,6 +385,11 @@ int main (int argc, const char * argv[])
[newMutableDictionary setObject:@"foo" forKey:@"bar19"];
[newMutableDictionary setObject:@"foo" forKey:@"bar20"];
+ id cfKeys[2] = { @"foo", @"bar", @"baz", @"quux" };
+ id cfValues[2] = { @"foo", @"bar", @"baz", @"quux" };
+ NSDictionary *nsDictionary = CFBridgingRelease(CFDictionaryCreate(nil, (void *)cfKeys, (void *)cfValues, 2, nil, nil));
+ CFDictionaryRef cfDictionaryRef = CFDictionaryCreate(nil, (void *)cfKeys, (void *)cfValues, 3, nil, nil);
+
NSAttributedString* attrString = [[NSAttributedString alloc] initWithString:@"hello world from foo" attributes:newDictionary];
[attrString isEqual:nil];
NSAttributedString* mutableAttrString = [[NSMutableAttributedString alloc] initWithString:@"hello world from foo" attributes:newDictionary];
@@ -396,6 +405,12 @@ int main (int argc, const char * argv[])
NSData *immutableData = [[NSData alloc] initWithBytes:"HELLO" length:4];
NSData *mutableData = [[NSMutableData alloc] initWithBytes:"NODATA" length:6];
+ // No-copy versions of NSData initializers use NSConcreteData if over 2^16 elements are specified.
+ unsigned concreteLength = 100000;
+ void *zeroes = calloc(1, concreteLength);
+ NSData *concreteData = [[NSData alloc] initWithBytesNoCopy:zeroes length:concreteLength];
+ NSMutableData *concreteMutableData = [[NSMutableData alloc] initWithBytesNoCopy:zeroes length:concreteLength];
+
[mutableData appendBytes:"MOREDATA" length:8];
[immutableData length];
@@ -610,6 +625,7 @@ int main (int argc, const char * argv[])
[molecule setAtoms:nil];
[molecule setAtoms:[NSMutableArray new]];
+ free(zeroes);
[pool drain];
return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
index 750e29460732..605b543a1b93 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsindexpath/TestDataFormatterNSIndexPath.py
@@ -21,7 +21,7 @@ class NSIndexPathDataFormatterTestCase(TestBase):
def appkit_tester_impl(self, commands):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
index 12e62f62ee97..41a6def00c49 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/nsstring/TestDataFormatterNSString.py
@@ -21,7 +21,7 @@ class NSStringDataFormatterTestCase(TestBase):
def appkit_tester_impl(self, commands):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
index bf600219bced..2c5041142fa9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-proper-plurals/TestFormattersOneIsSingular.py
@@ -32,7 +32,7 @@ class DataFormatterOneIsSingularTestCase(TestBase):
def oneness_data_formatter_commands(self):
"""Test that 1 item is not as reported as 1 items."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
index ebabe3076611..397a461db683 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-ptr-to-array/TestPtrToArrayFormatting.py
@@ -29,7 +29,7 @@ class PtrToArrayDataFormatterTestCase(TestBase):
def data_formatter_commands(self):
"""Test that LLDB handles the clang typeclass Paren correctly."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
index 75d1853f6a71..cc4cfd2ceb72 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py
@@ -40,7 +40,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
def data_formatter_commands(self):
"""Test using Python synthetic children provider."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -222,7 +222,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
def rdar10960550_formatter_commands(self):
"""Test that synthetic children persist stoppoints."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
# The second breakpoint is on a multi-line expression, so the comment
# can't be on the right line...
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
index 3355ca16305b..1dd1912f4c73 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-script/TestDataFormatterScript.py
@@ -29,7 +29,7 @@ class ScriptDataFormatterTestCase(TestBase):
def data_formatter_commands(self):
"""Test that that file and class static variables display correctly."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
index b0b45cb831b0..4ec7f13d1152 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-skip-summary/TestDataFormatterSkipSummary.py
@@ -36,7 +36,7 @@ class SkipSummaryDataFormatterTestCase(TestBase):
def data_formatter_commands(self):
"""Test that that file and class static variables display correctly."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
#import lldbsuite.test.lldbutil as lldbutil
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
index 9e82f11ff36b..13b38cbfa702 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py
@@ -33,7 +33,7 @@ class SmartArrayDataFormatterTestCase(TestBase):
def data_formatter_commands(self):
"""Test that that file and class static variables display correctly."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
index 8d4132444fbd..1f7a175974f9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/atomic/TestLibCxxAtomic.py
@@ -28,7 +28,7 @@ class LibCxxAtomicTestCase(TestBase):
def test(self):
"""Test that std::atomic as defined by libc++ is correctly printed by LLDB"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py
index 73a1b4e16bf6..4fa115e51655 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/TestDataFormatterLibcxxBitset.py
@@ -35,7 +35,7 @@ class TestDataFormatterLibcxxBitset(TestBase):
"variable: %s, index: %d"%(name, size))
@add_test_categories(["libc++"])
- def test(self):
+ def test_value(self):
"""Test that std::bitset is displayed correctly"""
self.build()
lldbutil.run_to_source_breakpoint(self, '// break here',
@@ -44,3 +44,19 @@ class TestDataFormatterLibcxxBitset(TestBase):
self.check("empty", 0)
self.check("small", 13)
self.check("large", 200)
+
+ @add_test_categories(["libc++"])
+ def test_ptr_and_ref(self):
+ """Test that ref and ptr to std::bitset is displayed correctly"""
+ self.build()
+ (_, process, _, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ 'Check ref and ptr',
+ lldb.SBFileSpec("main.cpp", False))
+
+ self.check("ref", 13)
+ self.check("ptr", 13)
+
+ lldbutil.continue_to_breakpoint(process, bkpt)
+
+ self.check("ref", 200)
+ self.check("ptr", 200)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp
index a80f97b80157..2a1532adb4b2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/bitset/main.cpp
@@ -1,4 +1,5 @@
#include <bitset>
+#include <stdio.h>
template<std::size_t N>
void fill(std::bitset<N> &b) {
@@ -10,11 +11,19 @@ void fill(std::bitset<N> &b) {
}
}
+template<std::size_t N>
+void by_ref_and_ptr(std::bitset<N> &ref, std::bitset<N> *ptr) {
+ // Check ref and ptr
+ return;
+}
+
int main() {
std::bitset<0> empty;
std::bitset<13> small;
fill(small);
std::bitset<200> large;
fill(large);
- return 0; // break here
+ by_ref_and_ptr(small, &small); // break here
+ by_ref_and_ptr(large, &large);
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
index 63eb5e087e14..81a76cc65d63 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/function/TestLibCxxFunction.py
@@ -27,7 +27,7 @@ class LibCxxFunctionTestCase(TestBase):
def test(self):
"""Test that std::function as defined by libc++ is correctly printed by LLDB"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
index f0857f420fc3..9c9b2473aa74 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/initializerlist/TestInitializerList.py
@@ -25,7 +25,7 @@ class InitializerListTestCase(TestBase):
def test(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
index 9b4308f54095..b36fa6ee1dc8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/TestDataFormatterLibccIterator.py
@@ -29,7 +29,7 @@ class LibcxxIteratorDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that libc++ iterators format properly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
index 058a79317d19..9d1cbfd91286 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/iterator/main.cpp
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <map>
#include <vector>
@@ -39,4 +35,4 @@ int main()
svter svI = sv.begin();
return 0; // Set break point at this line.
-} \ No newline at end of file
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
index bb20b0e7d98c..5f48b3541e5a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/TestDataFormatterLibcxxList.py
@@ -31,10 +31,12 @@ class LibcxxListDataFormatterTestCase(TestBase):
'// Set fourth break point at this line.')
@add_test_categories(["libc++"])
+ @skipIf(debug_info="gmodules",
+ bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
@@ -86,8 +88,9 @@ class LibcxxListDataFormatterTestCase(TestBase):
substrs=['list has 0 items',
'{}'])
- self.runCmd("n")
-
+ self.runCmd("n") # This gets up past the printf
+ self.runCmd("n") # Now advance over the first push_back.
+
self.expect("frame variable numbers_list",
substrs=['list has 1 items',
'[0] = ',
@@ -185,6 +188,7 @@ class LibcxxListDataFormatterTestCase(TestBase):
'\"is\"',
'\"smart\"'])
+ self.runCmd("n") # This gets us past the printf
self.runCmd("n")
# check access-by-index
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
index e1ebbd5c226d..f169b448680d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/TestDataFormatterLibcxxListLoop.py
@@ -18,13 +18,14 @@ from lldbsuite.test import lldbutil
class LibcxxListDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(["libc++"])
@expectedFailureAndroid(bugnumber="llvm.org/pr32592")
@skipIfDarwin # rdar://25499635
def test_with_run_command(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), "Target is valid")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp
index 6a1266528d5e..7c623e9a68b5 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/loop/main.cpp
@@ -3,12 +3,8 @@
#define private public
#define protected public
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <list>
-
+#include <stdio.h>
#include <assert.h>
typedef std::list<int> int_list;
@@ -18,7 +14,8 @@ int main()
#ifdef LLDB_USING_LIBCPP
int_list *numbers_list = new int_list{1,2,3,4,5,6,7,8,9,10};
- auto *third_elem = numbers_list->__end_.__next_->__next_->__next_; // Set break point at this line.
+ printf("// Set break point at this line.");
+ auto *third_elem = numbers_list->__end_.__next_->__next_->__next_;
assert(third_elem->__value_ == 3);
auto *fifth_elem = third_elem->__next_->__next_;
assert(fifth_elem->__value_ == 5);
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
index 4f2bd74495a9..56375874f37e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/list/main.cpp
@@ -1,10 +1,6 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <list>
-
+#include <stdio.h>
typedef std::list<int> int_list;
typedef std::list<std::string> string_list;
@@ -13,7 +9,8 @@ int main()
{
int_list numbers_list;
- (numbers_list.push_back(0x12345678)); // Set break point at this line.
+ printf("// Set break point at this line.");
+ (numbers_list.push_back(0x12345678));
(numbers_list.push_back(0x11223344));
(numbers_list.push_back(0xBEEFFEED));
(numbers_list.push_back(0x00ABBA00));
@@ -32,12 +29,15 @@ int main()
(text_list.push_back(std::string("is")));
(text_list.push_back(std::string("smart")));
- (text_list.push_back(std::string("!!!"))); // Set second break point at this line.
+ printf("// Set second break point at this line.");
+ (text_list.push_back(std::string("!!!")));
std::list<int> countingList = {3141, 3142, 3142,3142,3142, 3142, 3142, 3141};
countingList.sort();
- countingList.unique(); // Set third break point at this line.
- countingList.size(); // Set fourth break point at this line.
+ printf("// Set third break point at this line.");
+ countingList.unique();
+ printf("// Set fourth break point at this line.");
+ countingList.size();
return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
index fc4714ea94e2..0f57f0abd9ce 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/map/TestDataFormatterLibccMap.py
@@ -26,7 +26,7 @@ class LibcxxMapDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
index b28a7e6bc31b..cbcce47d364d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multimap/TestDataFormatterLibccMultiMap.py
@@ -27,7 +27,7 @@ class LibcxxMultiMapDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
bkpt = self.target().FindBreakpointByID(
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
index 2f448e8fd115..72a886ff1285 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/TestDataFormatterLibcxxMultiSet.py
@@ -27,22 +27,31 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
self.assertTrue(var.IsValid())
return var.GetType().GetCanonicalType().GetName()
+ def check_ii(self, var_name):
+ """ This checks the value of the bitset stored in ii at the call to by_ref_and_ptr.
+ We use this to make sure we get the same values for ii when we look at the object
+ directly, and when we look at a reference to the object. """
+ self.expect(
+ "frame variable " + var_name,
+ substrs=["size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+ self.expect("frame variable " + var_name + "[2]", substrs=[" = 2"])
+ self.expect(
+ "p " + var_name,
+ substrs=[
+ "size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+
@add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- bkpt = self.target().FindBreakpointByID(
- lldbutil.run_break_set_by_source_regexp(
- self, "Set break point at this line."))
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint'])
+ (self.target, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Set break point at this line.", lldb.SBFileSpec("main.cpp", False))
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -63,7 +72,7 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
"Type: " + ii_type)
self.expect("frame variable ii", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ii",
substrs=[
@@ -74,38 +83,26 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
"[3] = 3",
"[4] = 4",
"[5] = 5"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect(
- "frame variable ii",
- substrs=[
- "size=7",
- "[2] = 2",
- "[3] = 3",
- "[6] = 6"])
- self.expect(
- "p ii",
- substrs=[
- "size=7",
- "[2] = 2",
- "[3] = 3",
- "[6] = 6"])
- self.expect("frame variable ii[2]", substrs=[" = 2"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
+
+ self.check_ii("ii")
+
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
ss_type = self.getVariableType("ss")
self.assertTrue(ss_type.startswith(self.namespace + "::multiset"),
"Type: " + ss_type)
self.expect("frame variable ss", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=[
"size=2",
'[0] = "a"',
'[1] = "a very long string is right here"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=[
@@ -123,7 +120,7 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
'[0] = "a"',
'[1] = "a very long string is right here"'])
self.expect("frame variable ss[2]", substrs=[' = "b"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=[
@@ -131,3 +128,18 @@ class LibcxxMultiSetDataFormatterTestCase(TestBase):
'[0] = "a"',
'[1] = "a very long string is right here"',
'[2] = "c"'])
+
+ @add_test_categories(["libc++"])
+ def test_ref_and_ptr(self):
+ """Test that the data formatters work on ref and ptr."""
+ self.build()
+ (self.target, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Stop here to check by ref and ptr.",
+ lldb.SBFileSpec("main.cpp", False))
+ # The reference should print just like the value:
+ self.check_ii("ref")
+
+ self.expect("frame variable ptr",
+ substrs=["ptr =", "size=7"])
+ self.expect("expr ptr",
+ substrs=["size=7"])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
index 1e1dd3b16039..dd3d8be4ae91 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/multiset/main.cpp
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <set>
typedef std::multiset<int> intset;
@@ -20,6 +16,12 @@ int thefoo_rw(int arg = 1)
return g_the_foo;
}
+void by_ref_and_ptr(intset &ref, intset *ptr)
+{
+ // Stop here to check by ref and ptr
+ return;
+}
+
int main()
{
intset ii;
@@ -35,7 +37,9 @@ int main()
ii.insert(6);
thefoo_rw(1); // Set break point at this line.
-
+
+ by_ref_and_ptr(ii, &ii);
+
ii.clear();
thefoo_rw(1); // Set break point at this line.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
index 2b157f7f6fcc..f9eb4d82025e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/queue/TestDataFormatterLibcxxQueue.py
@@ -32,6 +32,7 @@ class TestDataFormatterLibcxxQueue(TestBase):
self.assertTrue(ch.IsValid())
self.assertEqual(ch.GetValueAsSigned(), i+1)
+ @expectedFailureAll(bugnumber="llvm.org/pr36109", debug_info="gmodules", triple=".*-android")
@add_test_categories(["libc++"])
def test(self):
"""Test that std::queue is displayed correctly"""
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
index ca8928129244..a6f1a3d2f430 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/TestDataFormatterLibcxxSet.py
@@ -27,21 +27,31 @@ class LibcxxSetDataFormatterTestCase(TestBase):
self.assertTrue(var.IsValid())
return var.GetType().GetCanonicalType().GetName()
+ def check_ii(self, var_name):
+ """ This checks the value of the bitset stored in ii at the call to by_ref_and_ptr.
+ We use this to make sure we get the same values for ii when we look at the object
+ directly, and when we look at a reference to the object. """
+ self.expect(
+ "frame variable " + var_name,
+ substrs=["size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+ self.expect("frame variable " + var_name + "[2]", substrs=[" = 2"])
+ self.expect(
+ "p " + var_name,
+ substrs=[
+ "size=7",
+ "[2] = 2",
+ "[3] = 3",
+ "[6] = 6"])
+
@add_test_categories(["libc++"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- bkpt = self.target().FindBreakpointByID(
- lldbutil.run_break_set_by_source_regexp(self, "Set break point at this line."))
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint'])
+ (self.target, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Set break point at this line.", lldb.SBFileSpec("main.cpp", False))
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -62,7 +72,7 @@ class LibcxxSetDataFormatterTestCase(TestBase):
"Type: " + ii_type)
self.expect("frame variable ii", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ii",
substrs=["size=6",
@@ -72,24 +82,12 @@ class LibcxxSetDataFormatterTestCase(TestBase):
"[3] = 3",
"[4] = 4",
"[5] = 5"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
- self.expect(
- "frame variable ii",
- substrs=["size=7",
- "[2] = 2",
- "[3] = 3",
- "[6] = 6"])
- self.expect("frame variable ii[2]", substrs=[" = 2"])
- self.expect(
- "p ii",
- substrs=[
- "size=7",
- "[2] = 2",
- "[3] = 3",
- "[6] = 6"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
+ self.check_ii("ii")
+
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable ii", substrs=["size=0", "{}"])
ss_type = self.getVariableType("ss")
@@ -97,13 +95,13 @@ class LibcxxSetDataFormatterTestCase(TestBase):
"Type: " + ss_type)
self.expect("frame variable ss", substrs=["size=0", "{}"])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=["size=2",
'[0] = "a"',
'[1] = "a very long string is right here"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=["size=4",
@@ -119,10 +117,26 @@ class LibcxxSetDataFormatterTestCase(TestBase):
'[0] = "a"',
'[1] = "a very long string is right here"'])
self.expect("frame variable ss[2]", substrs=[' = "b"'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect(
"frame variable ss",
substrs=["size=3",
'[0] = "a"',
'[1] = "a very long string is right here"',
'[2] = "c"'])
+
+ @add_test_categories(["libc++"])
+ def test_ref_and_ptr(self):
+ """Test that the data formatters work on ref and ptr."""
+ self.build()
+ (self.target, process, _, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Stop here to check by ref and ptr.",
+ lldb.SBFileSpec("main.cpp", False))
+ # The reference should print just like the value:
+ self.check_ii("ref")
+
+ self.expect("frame variable ptr",
+ substrs=["ptr =", "size=7"])
+ self.expect("expr ptr",
+ substrs=["size=7"])
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
index cc3033ef26e4..df39e9746c03 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/set/main.cpp
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <set>
typedef std::set<int> intset;
@@ -20,6 +16,12 @@ int thefoo_rw(int arg = 1)
return g_the_foo;
}
+void by_ref_and_ptr(intset &ref, intset *ptr)
+{
+ // Stop here to check by ref and ptr
+ return;
+}
+
int main()
{
intset ii;
@@ -35,7 +37,9 @@ int main()
ii.insert(6);
thefoo_rw(1); // Set break point at this line.
-
+
+ by_ref_and_ptr(ii, &ii);
+
ii.clear();
thefoo_rw(1); // Set break point at this line.
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
index 5b9b14d549e5..4574a044488c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/string/TestDataFormatterLibcxxString.py
@@ -27,10 +27,11 @@ class LibcxxStringDataFormatterTestCase(TestBase):
self.namespace = 'std::__' + ns + '1'
@add_test_categories(["libc++"])
+ @expectedFailureAll(bugnumber="llvm.org/pr36109", debug_info="gmodules", triple=".*-android")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile
index 1f609a41d908..24d7c220d075 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/Makefile
@@ -2,6 +2,11 @@ LEVEL = ../../../../../make
CXX_SOURCES := main.cpp
+# Work around "exception specification in declaration does not match previous
+# declaration" errors present in older libc++ releases. This error was fixed in
+# the 3.8 release.
+CFLAGS_EXTRAS += -fno-exceptions
+
USE_LIBCPP := 1
include $(LEVEL)/Makefile.rules
CXXFLAGS += -O0
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
index f61a715a4d3e..4c60e403f6b0 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/TestDataFormatterUnordered.py
@@ -25,7 +25,7 @@ class LibcxxUnorderedDataFormatterTestCase(TestBase):
@add_test_categories(["libc++"])
def test_with_run_command(self):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp
index 4e8a1a779c0c..81a5763559d3 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/unordered/main.cpp
@@ -1,8 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <unordered_map>
#include <unordered_set>
@@ -81,4 +77,4 @@ int main()
thefoo_rw(); // Set break point at this line.
return 0;
-} \ No newline at end of file
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
index a7a00068383f..1aa93d718fc9 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/TestDataFormatterLibcxxVBool.py
@@ -27,7 +27,7 @@ class LibcxxVBoolDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp
index 91fe509465e7..026cfc863f2c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vbool/main.cpp
@@ -1,9 +1,4 @@
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
-
#include <vector>
int main()
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
index 9e226a100a10..aeb10984b3b8 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/TestDataFormatterLibcxxVector.py
@@ -17,22 +17,47 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ def check_numbers(self, var_name):
+ self.expect("frame variable " + var_name,
+ substrs=[var_name + ' = size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
+
+ self.expect("p " + var_name,
+ substrs=['$', 'size=7',
+ '[0] = 1',
+ '[1] = 12',
+ '[2] = 123',
+ '[3] = 1234',
+ '[4] = 12345',
+ '[5] = 123456',
+ '[6] = 1234567',
+ '}'])
+
+ # check access-by-index
+ self.expect("frame variable " + var_name + "[0]",
+ substrs=['1'])
+ self.expect("frame variable " + var_name + "[1]",
+ substrs=['12'])
+ self.expect("frame variable " + var_name + "[2]",
+ substrs=['123'])
+ self.expect("frame variable " + var_name + "[3]",
+ substrs=['1234'])
+
@add_test_categories(["libc++"])
+ @skipIf(debug_info="gmodules",
+ bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048")
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
-
- bkpt = self.target().FindBreakpointByID(
- lldbutil.run_break_set_by_source_regexp(
- self, "break here"))
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint'])
+ (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "break here", lldb.SBFileSpec("main.cpp", False))
# This is the function to remove the custom formats in order to have a
# clean slate for the next test case.
@@ -52,7 +77,7 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.expect("frame variable numbers",
substrs=['numbers = size=0'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
# first value added
self.expect("frame variable numbers",
@@ -61,7 +86,7 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
'}'])
# add some more data
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable numbers",
substrs=['numbers = size=4',
@@ -94,47 +119,17 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.runCmd("type summary delete int_vect")
# add some more data
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
- self.expect("frame variable numbers",
- substrs=['numbers = size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
-
- self.expect("p numbers",
- substrs=['$', 'size=7',
- '[0] = 1',
- '[1] = 12',
- '[2] = 123',
- '[3] = 1234',
- '[4] = 12345',
- '[5] = 123456',
- '[6] = 1234567',
- '}'])
-
- # check access-by-index
- self.expect("frame variable numbers[0]",
- substrs=['1'])
- self.expect("frame variable numbers[1]",
- substrs=['12'])
- self.expect("frame variable numbers[2]",
- substrs=['123'])
- self.expect("frame variable numbers[3]",
- substrs=['1234'])
+ self.check_numbers("numbers")
# clear out the vector and see that we do the right thing once again
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable numbers",
substrs=['numbers = size=0'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
# first value added
self.expect("frame variable numbers",
@@ -168,7 +163,7 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
'is',
'smart'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable strings",
substrs=['vector has 4 items'])
@@ -179,7 +174,25 @@ class LibcxxVectorDataFormatterTestCase(TestBase):
self.expect("frame variable strings[1]",
substrs=['is'])
- lldbutil.continue_to_breakpoint(self.process(), bkpt)
+ lldbutil.continue_to_breakpoint(process, bkpt)
self.expect("frame variable strings",
substrs=['vector has 0 items'])
+
+ @add_test_categories(["libc++"])
+ @skipIf(debug_info="gmodules",
+ bugnumber="https://bugs.llvm.org/show_bug.cgi?id=36048")
+ def test_ref_and_ptr(self):
+ """Test that that file and class static variables display correctly."""
+ self.build()
+ (self.target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Stop here to check by ref", lldb.SBFileSpec("main.cpp", False))
+
+ # The reference should display the same was as the value did
+ self.check_numbers("ref")
+
+ # The pointer should just show the right number of elements:
+
+ self.expect("frame variable ptr", substrs=['ptr =', ' size=7'])
+
+ self.expect("p ptr", substrs=['$', 'size=7'])
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp
index a9aeacf90e43..0e1dbe4f03e2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libcxx/vector/main.cpp
@@ -1,12 +1,15 @@
+#include <stdio.h>
#include <string>
-#ifdef _LIBCPP_INLINE_VISIBILITY
-#undef _LIBCPP_INLINE_VISIBILITY
-#endif
-#define _LIBCPP_INLINE_VISIBILITY
#include <vector>
typedef std::vector<int> int_vect;
typedef std::vector<std::string> string_vect;
+template <class T>
+void by_ref_and_ptr(std::vector<T> &ref, std::vector<T> *ptr) {
+ // Stop here to check by ref
+ return;
+}
+
int main()
{
int_vect numbers;
@@ -17,8 +20,10 @@ int main()
(numbers.push_back(12345)); // break here
(numbers.push_back(123456));
(numbers.push_back(1234567));
+ by_ref_and_ptr(numbers, &numbers);
- numbers.clear(); // break here
+ printf("break here");
+ numbers.clear();
(numbers.push_back(7)); // break here
@@ -26,10 +31,11 @@ int main()
(strings.push_back(std::string("goofy")));
(strings.push_back(std::string("is")));
(strings.push_back(std::string("smart")));
-
- (strings.push_back(std::string("!!!"))); // break here
-
- strings.clear(); // break here
+ printf("break here");
+ (strings.push_back(std::string("!!!")));
+
+ printf("break here");
+ strings.clear();
return 0; // break here
}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
index 90a958d7cfe2..463e2a9f190d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
@@ -23,12 +23,11 @@ class StdIteratorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that libstdcpp iterators format properly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
index a8f99f41665f..7f3755660543 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
@@ -27,12 +27,11 @@ class StdListDataFormatterTestCase(TestBase):
self.final_line = line_number(
'main.cpp', '// Set final break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
index e25c410f91ce..267e3beedb4c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
@@ -23,13 +23,11 @@ class StdMapDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfFreeBSD
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
index 6809dd3c356d..1ca4a15d85cc 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
@@ -15,13 +15,10 @@ from lldbsuite.test import lldbutil
class StdSmartPtrDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
index d4e9e4d30f77..042d9fbcd6a0 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
@@ -24,12 +24,11 @@ class StdStringDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
index b38747d0f937..c2e02f546691 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
@@ -15,13 +15,10 @@ from lldbsuite.test import lldbutil
class StdTupleDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
index 23da541120f6..5d05418a8b49 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
@@ -15,13 +15,10 @@ from lldbsuite.test import lldbutil
class StdUniquePtrDataFormatterTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfDarwin # doesn't compile on Darwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
@@ -74,7 +71,7 @@ class StdUniquePtrDataFormatterTestCase(TestBase):
# reference chain and that it correctly handles the different options
# for the frame variable command in this case.
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/TestDataFormatterInvalidStdUniquePtr.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/TestDataFormatterInvalidStdUniquePtr.py
new file mode 100644
index 000000000000..190cf78a3b43
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/TestDataFormatterInvalidStdUniquePtr.py
@@ -0,0 +1,5 @@
+import lldbsuite.test.lldbinline as lldbinline
+from lldbsuite.test.decorators import *
+
+lldbinline.MakeInlineTest(__file__, globals(), [no_debug_info_test])
+
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/main.cpp b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/main.cpp
new file mode 100644
index 000000000000..b12cab231695
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/invalid/main.cpp
@@ -0,0 +1,11 @@
+// Test that we don't crash when trying to pretty-print structures that don't
+// have the layout our data formatters expect.
+namespace std {
+template<typename T, typename Deleter = void>
+class unique_ptr {};
+}
+
+int main() {
+ std::unique_ptr<int> U;
+ return 0; //% self.expect("frame variable U", substrs=["unique_ptr", "{}"])
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
index 57c9e2fe5dc7..fb37838bdaff 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
@@ -23,16 +23,11 @@ class StdVBoolDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @expectedFailureAll(
- oslist=['freebsd'],
- bugnumber='llvm.org/pr20548 fails to build on lab.llvm.org buildbot')
- @skipIfWindows # libstdcpp not ported to Windows.
- @skipIfDarwin
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
index e3f21eb21ec0..712de3d41f74 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
@@ -23,13 +23,11 @@ class StdVectorDataFormatterTestCase(TestBase):
# Find the line number to break at.
self.line = line_number('main.cpp', '// Set break point at this line.')
- @skipIfFreeBSD
- @skipIfWindows # libstdcpp not ported to Windows
- @skipIfwatchOS # libstdcpp not ported to watchos
+ @add_test_categories(["libstdcxx"])
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
index 8fff07d89dca..0e3bcc0e7398 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synth/TestDataFormatterSynth.py
@@ -25,7 +25,7 @@ class SynthDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
index 75d3b4e5f5c2..8bb60b8d679a 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthtype/TestDataFormatterSynthType.py
@@ -27,7 +27,7 @@ class DataFormatterSynthTypeTestCase(TestBase):
def test_with_run_command(self):
"""Test using Python synthetic children provider to provide a typename."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
index 6e7ac2c13f31..08768a61bd9d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-synthval/TestDataFormatterSynthVal.py
@@ -30,7 +30,7 @@ class DataFormatterSynthValueTestCase(TestBase):
def test_with_run_command(self):
"""Test using Python synthetic children provider to provide a value."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
index 0c15c793e1fe..00eb3d00f783 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/format-propagation/TestFormatPropagation.py
@@ -26,7 +26,7 @@ class FormatPropagationTestCase(TestBase):
def test_with_run_command(self):
"""Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
index d6303fe8b73d..d7507626e145 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/frameformat_smallstruct/TestFrameFormatSmallStruct.py
@@ -25,7 +25,7 @@ class FrameFormatSmallStructTestCase(TestBase):
def test_with_run_command(self):
"""Test that the user can input a format but it will not prevail over summary format's choices."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
index 32fbf48dcc68..cc22eca993e2 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/hexcaps/TestDataFormatterHexCaps.py
@@ -25,7 +25,7 @@ class DataFormatterHexCapsTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
index b7f60cfac41d..55855dc8432b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/language_category_updates/TestDataFormatterLanguageCategoryUpdates.py
@@ -38,7 +38,7 @@ class LanguageCategoryUpdatesTestCase(TestBase):
self.addTearDownHook(cleanup)
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
index 87fc2d1802b7..1ae5e40f9780 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsarraysynth/TestNSArraySynthetic.py
@@ -28,7 +28,7 @@ class NSArraySyntheticTestCase(TestBase):
def test_rdar11086338_with_run_command(self):
"""Test that NSArray reports its synthetic children properly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
index 85675d211235..65e32643dde3 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nsdictionarysynth/TestNSDictionarySynthetic.py
@@ -28,7 +28,7 @@ class NSDictionarySyntheticTestCase(TestBase):
def test_rdar11988289_with_run_command(self):
"""Test that NSDictionary reports its synthetic children properly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
index 6affc5a71faf..a3657026faef 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/nssetsynth/TestNSSetSynthetic.py
@@ -28,7 +28,7 @@ class NSSetSyntheticTestCase(TestBase):
def test_rdar12529957_with_run_command(self):
"""Test that NSSet reports its synthetic children properly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
index 7ffddc5ec673..87265087744c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ostypeformatting/TestFormattersOsType.py
@@ -28,7 +28,7 @@ class DataFormatterOSTypeTestCase(TestBase):
def test_ostype_with_run_command(self):
"""Test the formatters we use for OSType."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
index 49cda4ae6cc8..0bfd8df7b44e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/parray/TestPrintArray.py
@@ -31,7 +31,7 @@ class PrintArrayTestCase(TestBase):
def printarray_data_formatter_commands(self):
"""Test that expr -Z works"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
index 83408e7b456e..4326574c254c 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/poarray/TestPrintObjectArray.py
@@ -32,7 +32,7 @@ class PrintObjectArrayTestCase(TestBase):
def printarray_data_formatter_commands(self):
"""Test that expr -O -Z works"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
index 69b9dd048871..862e2b57342d 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/ptr_ref_typedef/TestPtrRef2Typedef.py
@@ -25,7 +25,7 @@ class PtrRef2TypedefTestCase(TestBase):
def test_with_run_command(self):
"""Test that a pointer/reference to a typedef is formatted as we want."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
index 01271b443d17..ba50ccd0ae5e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/pyobjsynthprovider/TestPyObjSynthProvider.py
@@ -33,7 +33,7 @@ class PyObjectSynthProviderTestCase(TestBase):
def provider_data_formatter_commands(self):
"""Test that the PythonObjectSyntheticChildProvider helper class works"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
index 0a039107d842..09888e1b469b 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/refpointer-recursion/TestDataFormatterRefPtrRecursion.py
@@ -25,7 +25,7 @@ class DataFormatterRefPtrRecursionTestCase(TestBase):
def test_with_run_command(self):
"""Test that ValueObjectPrinter does not cause an infinite loop when a reference to a struct that contains a pointer to itself is printed."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
index d7862d2327cf..f766699bd852 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/summary-string-onfail/Test-rdar-9974002.py
@@ -30,7 +30,7 @@ class Radar9974002DataFormatterTestCase(TestBase):
self.skipTest(
"llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
index 6d519761b7bb..e94f6c4cc407 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthcapping/TestSyntheticCapping.py
@@ -26,7 +26,7 @@ class SyntheticCappingTestCase(TestBase):
def test_with_run_command(self):
"""Check for an issue where capping does not work because the Target pointer appears to be changing behind our backs."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
index 29c1214564d8..54e9a3215777 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/synthupdate/TestSyntheticFilterRecompute.py
@@ -28,7 +28,7 @@ class SyntheticFilterRecomputingTestCase(TestBase):
def test_rdar12437442_with_run_command(self):
"""Test that we update SBValues correctly as dynamic types change."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
index 2e66b800b15e..9435e80573e1 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_script/TestTypeSummaryListScript.py
@@ -30,7 +30,7 @@ class TypeSummaryListScriptTestCase(TestBase):
def data_formatter_commands(self):
"""Test printing out Python summary formatters."""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
index d970d11a2bab..d3cc4d98aff7 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/user-format-vs-summary/TestUserFormatVsSummary.py
@@ -25,7 +25,7 @@ class UserFormatVSSummaryTestCase(TestBase):
def test_with_run_command(self):
"""Test that the user can input a format but it will not prevail over summary format's choices."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
index 53073f6d910a..f6dc47f35869 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/var-in-aggregate-misuse/TestVarInAggregateMisuse.py
@@ -25,7 +25,7 @@ class VarInAggregateMisuseTestCase(TestBase):
def test_with_run_command(self):
"""Test that that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
index cde0ef409621..d3c04afe91eb 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/varscript_formatting/TestDataFormatterVarScriptFormatting.py
@@ -28,7 +28,7 @@ class PythonSynthDataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Test using Python synthetic children provider."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
index 2d4cd5782fdd..c1dc15224b1e 100644
--- a/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
+++ b/packages/Python/lldbsuite/test/functionalities/data-formatter/vector-types/TestVectorTypesFormatting.py
@@ -28,7 +28,7 @@ class VectorTypesFormattingTestCase(TestBase):
def test_with_run_command(self):
"""Check that vector types format properly"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py b/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
index 355d60ade90f..9ba3d2d0ac75 100644
--- a/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
+++ b/packages/Python/lldbsuite/test/functionalities/dead-strip/TestDeadStrip.py
@@ -28,7 +28,7 @@ class DeadStripTestCase(TestBase):
def test(self):
"""Test breakpoint works correctly with dead-code stripping."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break by function name f1 (live code).
diff --git a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
index cee472ccb51f..52f9daf6bd45 100644
--- a/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/disassembly/TestDisassembleBreakpoint.py
@@ -16,57 +16,29 @@ from lldbsuite.test import lldbutil
class DisassemblyTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@expectedFailureAll(
oslist=["windows"],
bugnumber="function names print fully demangled instead of name-only")
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- self.expect("file " + exe,
- patterns=["Current executable set to .*a.out.*"])
-
- match_object = lldbutil.run_break_set_command(self, "br s -n sum")
- lldbutil.check_breakpoint_result(
- self,
- match_object,
- symbol_name='sum',
- symbol_match_exact=False,
- num_locations=1)
-
- self.expect("run",
- patterns=["Process .* launched: "])
-
+ target, _, _, bkpt = lldbutil.run_to_source_breakpoint(self,
+ "Set a breakpoint here", lldb.SBFileSpec("main.cpp"))
self.runCmd("dis -f")
- disassembly = self.res.GetOutput()
+ disassembly_with_break = self.res.GetOutput().splitlines()
- # ARCH, if not specified, defaults to x86_64.
- arch = self.getArchitecture()
- if arch in ["", 'x86_64', 'i386', 'i686']:
- breakpoint_opcodes = ["int3"]
- instructions = [' mov', ' addl ', 'ret']
- elif arch in ["arm", "aarch64", "arm64", "armv7", "armv7k"]:
- breakpoint_opcodes = ["brk", "udf"]
- instructions = [' add ', ' ldr ', ' str ']
- elif re.match("mips", arch):
- breakpoint_opcodes = ["break"]
- instructions = ['lw', 'sw']
- elif arch in ["s390x"]:
- breakpoint_opcodes = [".long"]
- instructions = [' l ', ' a ', ' st ']
- else:
- # TODO please add your arch here
- self.fail(
- 'unimplemented for arch = "{arch}"'.format(
- arch=self.getArchitecture()))
+ self.assertTrue(target.BreakpointDelete(bkpt.GetID()))
- # make sure that the software breakpoint has been removed
- for op in breakpoint_opcodes:
- self.assertFalse(op in disassembly)
-
- # make sure a few reasonable assembly instructions are here
- self.expect(
- disassembly,
- exe=False,
- startstr="a.out`sum",
- substrs=instructions)
+ self.runCmd("dis -f")
+ disassembly_without_break = self.res.GetOutput().splitlines()
+
+ # Make sure all assembly instructions are the same as instructions
+ # with the breakpoint removed.
+ self.assertEqual(len(disassembly_with_break),
+ len(disassembly_without_break))
+ for dis_inst_with, dis_inst_without in \
+ zip(disassembly_with_break, disassembly_without_break):
+ inst_with = dis_inst_with.split(':')[-1]
+ inst_without = dis_inst_without.split(':')[-1]
+ self.assertEqual(inst_with, inst_without)
diff --git a/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py b/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
index 47357cf4f71d..c5fec5b02d6b 100644
--- a/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
+++ b/packages/Python/lldbsuite/test/functionalities/disassembly/TestFrameDisassemble.py
@@ -30,7 +30,7 @@ class FrameDisassembleTestCase(TestBase):
def frame_disassemble_test(self):
"""Sample test to ensure SBFrame::Disassemble produces SOME output"""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/disassembly/main.cpp b/packages/Python/lldbsuite/test/functionalities/disassembly/main.cpp
index 93925829ec82..c68e3f1b3212 100644
--- a/packages/Python/lldbsuite/test/functionalities/disassembly/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/disassembly/main.cpp
@@ -10,7 +10,7 @@
int
sum (int a, int b)
{
- int result = a + b;
+ int result = a + b; // Set a breakpoint here
return result;
}
@@ -20,7 +20,7 @@ main(int argc, char const *argv[])
int array[3];
- array[0] = sum (1238, 78392); // Set a breakpoint here
+ array[0] = sum (1238, 78392);
array[1] = sum (379265, 23674);
array[2] = sum (872934, 234);
diff --git a/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py b/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
index 79e4e627592c..aaba15653763 100644
--- a/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
+++ b/packages/Python/lldbsuite/test/functionalities/dynamic_value_child_count/TestDynamicValueChildCount.py
@@ -39,7 +39,7 @@ class DynamicValueChildCountTestCase(TestBase):
"""Test fetching C++ dynamic values from pointers & references."""
"""Get argument vals for the call stack when stopped on a breakpoint."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
index 937ac9270019..0f130b3ecbab 100644
--- a/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
+++ b/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
@@ -29,7 +29,7 @@ class ConvenienceVariablesCase(TestBase):
"""Test convenience variables lldb.debugger, lldb.target, lldb.process, lldb.thread, and lldb.frame."""
self.build()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
python_prompt = ">>> "
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/Makefile b/packages/Python/lldbsuite/test/functionalities/exec/Makefile
index 8a7102e347af..784a53da4776 100644
--- a/packages/Python/lldbsuite/test/functionalities/exec/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/exec/Makefile
@@ -2,4 +2,12 @@ LEVEL = ../../make
CXX_SOURCES := main.cpp
+all: a.out secondprog
+
include $(LEVEL)/Makefile.rules
+
+secondprog:
+ $(MAKE) VPATH=$(VPATH) -f $(SRCDIR)/secondprog.mk
+
+clean::
+ $(MAKE) -f $(SRCDIR)/secondprog.mk clean
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
index 550eae85e1d6..611869932b61 100644
--- a/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
+++ b/packages/Python/lldbsuite/test/functionalities/exec/TestExec.py
@@ -29,44 +29,32 @@ class ExecTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
- @expectedFailureAll(oslist=['macosx'], bugnumber="rdar://36134350") # when building with cmake on green gragon or on ci.swift.org, this test fails.
@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
@expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems
def test_hitting_exec (self):
self.do_test(False)
@skipUnlessDarwin
- @expectedFailureAll(oslist=['macosx'], bugnumber="rdar://36134350") # when building with cmake on green gragon or on ci.swift.org, this test fails.
@expectedFailureAll(archs=['i386'], bugnumber="rdar://28656532")
@expectedFailureAll(oslist=["ios", "tvos", "watchos", "bridgeos"], bugnumber="rdar://problem/34559552") # this exec test has problems on ios systems
def test_skipping_exec (self):
- self.do_test(False)
+ self.do_test(True)
def do_test(self, skip_exec):
- if self.getArchitecture() == 'x86_64':
- source = os.path.join(os.getcwd(), "main.cpp")
- o_file = os.path.join(os.getcwd(), "main.o")
- execute_command(
- "'%s' -g -O0 -arch i386 -arch x86_64 '%s' -c -o '%s'" %
- (os.environ["CC"], source, o_file))
- execute_command(
- "'%s' -g -O0 -arch i386 -arch x86_64 '%s'" %
- (os.environ["CC"], o_file))
- if self.debug_info != "dsym":
- dsym_path = os.path.join(os.getcwd(), "a.out.dSYM")
- execute_command("rm -rf '%s'" % (dsym_path))
- else:
- self.build()
-
- exe = os.path.join(os.getcwd(), "a.out")
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+ secondprog = self.getBuildArtifact("secondprog")
# Create the target
target = self.dbg.CreateTarget(exe)
# Create any breakpoints we need
- breakpoint = target.BreakpointCreateBySourceRegex(
+ breakpoint1 = target.BreakpointCreateBySourceRegex(
'Set breakpoint 1 here', lldb.SBFileSpec("main.cpp", False))
- self.assertTrue(breakpoint, VALID_BREAKPOINT)
+ self.assertTrue(breakpoint1, VALID_BREAKPOINT)
+ breakpoint2 = target.BreakpointCreateBySourceRegex(
+ 'Set breakpoint 2 here', lldb.SBFileSpec("secondprog.cpp", False))
+ self.assertTrue(breakpoint2, VALID_BREAKPOINT)
# Launch the process
process = target.LaunchSimple(
@@ -74,7 +62,7 @@ class ExecTestCase(TestBase):
self.assertTrue(process, PROCESS_IS_VALID)
if skip_exec:
- self.debugger.HandleCommand("settings set target.process.stop-on-exec false")
+ self.dbg.HandleCommand("settings set target.process.stop-on-exec false")
def cleanup():
self.runCmd("settings set target.process.stop-on-exec false",
check=False)
@@ -82,50 +70,48 @@ class ExecTestCase(TestBase):
# Execute the cleanup function during test case tear down.
self.addTearDownHook(cleanup)
-
- for i in range(6):
- # The stop reason of the thread should be breakpoint.
- self.assertTrue(process.GetState() == lldb.eStateStopped,
- STOPPED_DUE_TO_BREAKPOINT)
+ # The stop reason of the thread should be breakpoint.
+ self.assertTrue(process.GetState() == lldb.eStateStopped,
+ STOPPED_DUE_TO_BREAKPOINT)
+
+ threads = lldbutil.get_threads_stopped_at_breakpoint(
+ process, breakpoint1)
+ self.assertTrue(len(threads) == 1)
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
- self.assertTrue(len(threads) == 1)
+ # We had a deadlock tearing down the TypeSystemMap on exec, but only if some
+ # expression had been evaluated. So make sure we do that here so the teardown
+ # is not trivial.
- # We had a deadlock tearing down the TypeSystemMap on exec, but only if some
- # expression had been evaluated. So make sure we do that here so the teardown
- # is not trivial.
+ thread = threads[0]
+ value = thread.frames[0].EvaluateExpression("1 + 2")
+ self.assertTrue(
+ value.IsValid(),
+ "Expression evaluated successfully")
+ int_value = value.GetValueAsSigned()
+ self.assertTrue(int_value == 3, "Expression got the right result.")
- thread = threads[0]
- value = thread.frames[0].EvaluateExpression("1 + 2")
+ # Run and we should stop due to exec
+ process.Continue()
+
+ if not skip_exec:
+ self.assertTrue(process.GetState() == lldb.eStateStopped,
+ "Process should be stopped at __dyld_start")
+
+ threads = lldbutil.get_stopped_threads(
+ process, lldb.eStopReasonExec)
self.assertTrue(
- value.IsValid(),
- "Expression evaluated successfully")
- int_value = value.GetValueAsSigned()
- self.assertTrue(int_value == 3, "Expression got the right result.")
+ len(threads) == 1,
+ "We got a thread stopped for exec.")
- # Run and we should stop due to exec
+ # Run and we should stop at breakpoint in main after exec
process.Continue()
- if not skip_exec:
- self.assertTrue(process.GetState() == lldb.eStateStopped,
- "Process should be stopped at __dyld_start")
-
- threads = lldbutil.get_stopped_threads(
- process, lldb.eStopReasonExec)
- self.assertTrue(
- len(threads) == 1,
- "We got a thread stopped for exec.")
-
- # Run and we should stop at breakpoint in main after exec
- process.Continue()
-
- threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, breakpoint)
- if self.TraceOn():
- for t in process.threads:
- print(t)
- if t.GetStopReason() != lldb.eStopReasonBreakpoint:
- self.runCmd("bt")
- self.assertTrue(len(threads) == 1,
- "Stopped at breakpoint in exec'ed process.")
+ threads = lldbutil.get_threads_stopped_at_breakpoint(
+ process, breakpoint2)
+ if self.TraceOn():
+ for t in process.threads:
+ print(t)
+ if t.GetStopReason() != lldb.eStopReasonBreakpoint:
+ self.runCmd("bt")
+ self.assertTrue(len(threads) == 1,
+ "Stopped at breakpoint in exec'ed process.")
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/main.cpp b/packages/Python/lldbsuite/test/functionalities/exec/main.cpp
index 700c5dd94b28..92206b2d88ef 100644
--- a/packages/Python/lldbsuite/test/functionalities/exec/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/exec/main.cpp
@@ -6,6 +6,8 @@
#include <stdlib.h>
#include <spawn.h>
#include <unistd.h>
+#include <libgen.h>
+#include <string>
static void
exit_with_errno (int err, const char *prefix)
@@ -21,9 +23,9 @@ exit_with_errno (int err, const char *prefix)
}
static pid_t
-spawn_process (const char **argv,
+spawn_process (const char *progname,
+ const char **argv,
const char **envp,
- cpu_type_t cpu_type,
int &err)
{
pid_t pid = 0;
@@ -46,21 +48,12 @@ spawn_process (const char **argv,
posix_spawnattr_setsigmask(&attr, &no_signals);
posix_spawnattr_setsigdefault(&attr, &all_signals);
- if (cpu_type != 0)
- {
- size_t ocount = 0;
- err = posix_spawnattr_setbinpref_np (&attr, 1, &cpu_type, &ocount);
- }
-
- if (err == 0)
- {
- err = posix_spawn (&pid,
- argv[0],
- file_actions,
- &attr,
- (char * const *)argv,
- (char * const *)envp);
- }
+ err = posix_spawn (&pid,
+ progname,
+ file_actions,
+ &attr,
+ (char * const *)argv,
+ (char * const *)envp);
posix_spawnattr_destroy(&attr);
}
@@ -70,25 +63,14 @@ spawn_process (const char **argv,
int
main (int argc, char const **argv)
{
- printf ("pid %i: Pointer size is %zu.\n", getpid(), sizeof(void *));
+ char *buf = (char*) malloc (strlen (argv[0]) + 12);
+ strlcpy (buf, argv[0], strlen (argv[0]) + 1);
+ std::string directory_name (::dirname (buf));
+
+ std::string other_program = directory_name + "/secondprog";
int err = 0; // Set breakpoint 1 here
-#if defined (__x86_64__)
- if (sizeof(void *) == 8)
- {
- spawn_process (argv, NULL, CPU_TYPE_I386, err);
- if (err)
- exit_with_errno (err, "posix_spawn i386 error");
- }
- else
- {
- spawn_process (argv, NULL, CPU_TYPE_X86_64, err);
- if (err)
- exit_with_errno (err, "posix_spawn x86_64 error");
- }
-#else
- spawn_process (argv, NULL, 0, err);
+ spawn_process (other_program.c_str(), argv, NULL, err);
if (err)
exit_with_errno (err, "posix_spawn x86_64 error");
-#endif
return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/secondprog.cpp b/packages/Python/lldbsuite/test/functionalities/exec/secondprog.cpp
new file mode 100644
index 000000000000..5653471c1530
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/exec/secondprog.cpp
@@ -0,0 +1,5 @@
+#include <stdio.h>
+int main ()
+{
+ puts ("I am the second program."); // Set breakpoint 2 here
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk b/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
new file mode 100644
index 000000000000..88f76b5113b4
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/exec/secondprog.mk
@@ -0,0 +1,6 @@
+LEVEL = ../../make
+
+CXX_SOURCES := secondprog.cpp
+EXE = secondprog
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
index 719f3f719934..a498f0a360ee 100644
--- a/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
+++ b/packages/Python/lldbsuite/test/functionalities/expr-doesnt-deadlock/TestExprDoesntBlock.py
@@ -26,7 +26,7 @@ class ExprDoesntDeadlockTestCase(TestBase):
def test_with_run_command(self):
"""Test that expr will time out and allow other threads to run if it blocks."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/fat_archives/Makefile b/packages/Python/lldbsuite/test/functionalities/fat_archives/Makefile
index e1832fdefbee..c7c5ef405459 100644
--- a/packages/Python/lldbsuite/test/functionalities/fat_archives/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/fat_archives/Makefile
@@ -1,12 +1,14 @@
-all: clean
- $(CC) -arch i386 -g -c a.c
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
+all: a.c clean
+ $(CC) -arch i386 -g -c $(SRCDIR)/a.c
ar -q liba-i386.a a.o
ranlib liba-i386.a
- $(CC) -arch x86_64 -g -c a.c
+ $(CC) -arch x86_64 -g -c $(SRCDIR)/a.c
ar -q liba-x86_64.a a.o
ranlib liba-x86_64.a
lipo -create -output liba.a liba-i386.a liba-x86_64.a
- $(CC) -g -c main.c
+ $(CC) -g -c $(SRCDIR)/main.c
$(CC) -o a.out main.o -L. -la
clean:
diff --git a/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py b/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
index d62ccbff87fa..80240534c368 100644
--- a/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
+++ b/packages/Python/lldbsuite/test/functionalities/fat_archives/TestFatArchives.py
@@ -34,7 +34,7 @@ class FatArchiveTestCase(TestBase):
DWARF in .o file debugging. The only thing this test needs to do is to compile and
set a breakpoint in the target and verify any breakpoint locations have valid debug
info for the function, and source file and line.'''
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create the target
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py b/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
index b7592c93704d..f311fac4c0f7 100644
--- a/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
+++ b/packages/Python/lldbsuite/test/functionalities/format/TestFormats.py
@@ -22,11 +22,12 @@ class TestFormats(TestBase):
def test_formats(self):
"""Test format string functionality."""
self.build()
+ exe = self.getBuildArtifact("a.out")
import pexpect
prompt = "(lldb) "
child = pexpect.spawn(
- '%s %s -x -o "b main" -o r a.out' %
- (lldbtest_config.lldbExec, self.lldbOption))
+ '%s %s -x -o "b main" -o r %s' %
+ (lldbtest_config.lldbExec, self.lldbOption, exe))
# Turn on logging for what the child sends back.
if self.TraceOn():
child.logfile_read = sys.stdout
@@ -34,7 +35,7 @@ class TestFormats(TestBase):
self.child = child
# Substitute 'Help!' for 'help' using the 'commands regex' mechanism.
- child.expect_exact(prompt + 'target create "a.out"')
+ child.expect_exact(prompt + 'target create "%s"' % exe)
child.expect_exact(prompt + 'b main')
child.expect_exact(prompt + 'r')
child.expect_exact(prompt)
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
index 276760d30574..4abf1a812963 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/array/TestArray.py
@@ -14,12 +14,14 @@ from lldbsuite.test import lldbutil
class TestArray(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ def setUp(self):
+ TestBase.setUp(self)
+
@skipUnlessDarwin
@skipIfDarwinEmbedded # <rdar://problem/33842388> frame diagnose doesn't work for armv7 or arm64
def test_array(self):
- TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
index 6529e11fafa8..e198720db57d 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/bad-reference/TestBadReference.py
@@ -19,7 +19,7 @@ class TestBadReference(TestBase):
def test_bad_reference(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
index 2e6fad5e1fdb..7823c639572c 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/complicated-expression/TestComplicatedExpression.py
@@ -19,7 +19,7 @@ class TestDiagnoseDereferenceArgument(TestBase):
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
index 7839a47a8f41..335d61767cd8 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-argument/TestDiagnoseDereferenceArgument.py
@@ -19,7 +19,7 @@ class TestDiagnoseDereferenceArgument(TestBase):
def test_diagnose_dereference_argument(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
index 8e5cd430293d..0398a161dcd8 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-function-return/TestDiagnoseDereferenceFunctionReturn.py
@@ -20,7 +20,7 @@ class TestDiagnoseDereferenceFunctionReturn(TestBase):
def test_diagnose_dereference_function_return(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
index 201923fb89d6..272a64e117b9 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/dereference-this/TestDiagnoseDereferenceThis.py
@@ -19,7 +19,7 @@ class TestDiagnoseDereferenceThis(TestBase):
def test_diagnose_dereference_this(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
index 08ef1c7fc5e6..3d9c893bbd40 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/inheritance/TestDiagnoseInheritance.py
@@ -19,7 +19,7 @@ class TestDiagnoseInheritance(TestBase):
def test_diagnose_inheritance(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
index e962c2673faf..da1fd187d142 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/local-variable/TestLocalVariable.py
@@ -19,7 +19,7 @@ class TestLocalVariable(TestBase):
def test_local_variable(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
index bc11bd1afb78..437cdbbc93b7 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-diagnose/virtual-method-call/TestDiagnoseDereferenceVirtualMethodCall.py
@@ -19,7 +19,7 @@ class TestDiagnoseVirtualMethodCall(TestBase):
def test_diagnose_virtual_method_call(self):
TestBase.setUp(self)
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
self.expect("thread list", "Thread should be stopped",
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile b/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile
index 089fc237b054..cb1af719ac35 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/frame-language/Makefile
@@ -6,7 +6,7 @@ C_SOURCES := somefunc.c
include $(LEVEL)/Makefile.rules
other-2.o: other-2.cpp
- $(CXX) $(CFLAGS_NO_DEBUG) -c other-2.cpp
+ $(CXX) $(CFLAGS_NO_DEBUG) -c $(SRCDIR)/other-2.cpp
somefunc.o: somefunc.c
- $(CC) $(CFLAGS) -std=c99 -c somefunc.c \ No newline at end of file
+ $(CC) $(CFLAGS) -std=c99 -c $(SRCDIR)/somefunc.c
diff --git a/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py b/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
index 178e165f3cbe..59af2de836ff 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame-language/TestGuessLanguage.py
@@ -10,6 +10,7 @@ import time
import re
import lldb
import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
@@ -22,6 +23,7 @@ class TestFrameGuessLanguage(TestBase):
# each debug info format.
NO_DEBUG_INFO_TESTCASE = True
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37658")
def test_guess_language(self):
"""Test GuessLanguage for C and C++."""
self.build()
@@ -39,7 +41,7 @@ class TestFrameGuessLanguage(TestBase):
def do_test(self):
"""Test GuessLanguage for C & C++."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py b/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
index b29f94bdb059..960891b9eefc 100644
--- a/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
+++ b/packages/Python/lldbsuite/test/functionalities/frame_var/TestFrameVar.py
@@ -31,7 +31,7 @@ class TestFrameVar(TestBase):
TestBase.setUp(self)
def do_test(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py
new file mode 100644
index 000000000000..3bf0c52edaed
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteClient.py
@@ -0,0 +1,39 @@
+import lldb
+import binascii
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestGDBRemoteClient(GDBRemoteTestBase):
+
+ def test_connect(self):
+ """Test connecting to a remote gdb server"""
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ self.assertPacketLogContains(["qProcessInfo", "qfThreadInfo"])
+
+ def test_attach_fail(self):
+ error_msg = "mock-error-msg"
+
+ class MyResponder(MockGDBServerResponder):
+ # Pretend we don't have any process during the initial queries.
+ def qC(self):
+ return "E42"
+
+ def qfThreadInfo(self):
+ return "OK" # No threads.
+
+ # Then, when we are asked to attach, error out.
+ def vAttach(self, pid):
+ return "E42;" + binascii.hexlify(error_msg.encode()).decode()
+
+ self.server.responder = MyResponder()
+
+ target = self.dbg.CreateTarget("")
+ process = self.connect(target)
+ lldbutil.expect_state_changes(self, self.dbg.GetListener(), process, [lldb.eStateConnected])
+
+ error = lldb.SBError()
+ target.AttachToProcessWithID(lldb.SBListener(), 47, error)
+ self.assertEquals(error_msg, error.GetCString())
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
new file mode 100644
index 000000000000..f70c854ed6d4
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestGDBRemoteLoad.py
@@ -0,0 +1,80 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestGDBRemoteLoad(GDBRemoteTestBase):
+
+ def setUp(self):
+ super(TestGDBRemoteLoad, self).setUp()
+ self._initial_platform = lldb.DBG.GetSelectedPlatform()
+
+ def tearDown(self):
+ lldb.DBG.SetSelectedPlatform(self._initial_platform)
+ super(TestGDBRemoteLoad, self).tearDown()
+
+ def test_module_load_address(self):
+ """Test that setting the load address of a module uses virtual addresses"""
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ module = target.GetModuleAtIndex(0)
+ self.assertTrue(module.IsValid())
+ self.assertTrue(target.SetModuleLoadAddress(module, 0).Success())
+ address = target.ResolveLoadAddress(0x2001)
+ self.assertTrue(address.IsValid())
+ self.assertEqual(".data", address.GetSection().GetName())
+
+ def test_ram_load(self):
+ """Test loading an object file to a target's ram"""
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ self.dbg.HandleCommand("target modules load -l -s0")
+ self.assertPacketLogContains([
+ "M1000,4:c3c3c3c3",
+ "M1004,2:3232"
+ ])
+
+ @skipIfXmlSupportMissing
+ def test_flash_load(self):
+ """Test loading an object file to a target's flash memory"""
+
+ class Responder(MockGDBServerResponder):
+ def qSupported(self, client_supported):
+ return "PacketSize=3fff;QStartNoAckMode+;qXfer:memory-map:read+"
+
+ def qXferRead(self, obj, annex, offset, length):
+ if obj == "memory-map":
+ return (self.MEMORY_MAP[offset:offset + length],
+ offset + length < len(self.MEMORY_MAP))
+ return None, False
+
+ def other(self, packet):
+ if packet[0:11] == "vFlashErase":
+ return "OK"
+ if packet[0:11] == "vFlashWrite":
+ return "OK"
+ if packet == "vFlashDone":
+ return "OK"
+ return ""
+
+ MEMORY_MAP = """<?xml version="1.0"?>
+<memory-map>
+ <memory type="ram" start="0x0" length="0x1000"/>
+ <memory type="flash" start="0x1000" length="0x1000">
+ <property name="blocksize">0x100</property>
+ </memory>
+ <memory type="ram" start="0x2000" length="0x1D400"/>
+</memory-map>
+"""
+
+ self.server.responder = Responder()
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ self.dbg.HandleCommand("target modules load -l -s0")
+ self.assertPacketLogContains([
+ "vFlashErase:1000,100",
+ "vFlashWrite:1000:\xc3\xc3\xc3\xc3",
+ "vFlashWrite:1004:\x32\x32",
+ "vFlashDone"
+ ])
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestRestartBug.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestRestartBug.py
new file mode 100644
index 000000000000..142861a37dff
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestRestartBug.py
@@ -0,0 +1,62 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestRestartBug(GDBRemoteTestBase):
+
+ @expectedFailureAll(bugnumber="llvm.org/pr24530")
+ def test(self):
+ """
+ Test auto-continue behavior when a process is interrupted to deliver
+ an "asynchronous" packet. This simulates the situation when a process
+ stops on its own just as lldb client is about to interrupt it. The
+ client should not auto-continue in this case, unless the user has
+ explicitly requested that we ignore signals of this type.
+ """
+ class MyResponder(MockGDBServerResponder):
+ continueCount = 0
+
+ def setBreakpoint(self, packet):
+ return "OK"
+
+ def interrupt(self):
+ # Simulate process stopping due to a raise(SIGINT) just as lldb
+ # is about to interrupt it.
+ return "T02reason:signal"
+
+ def cont(self):
+ self.continueCount += 1
+ if self.continueCount == 1:
+ # No response, wait for the client to interrupt us.
+ return None
+ return "W00" # Exit
+
+ self.server.responder = MyResponder()
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ self.dbg.SetAsync(True)
+ process.Continue()
+
+ # resume the process and immediately try to set another breakpoint. When using the remote
+ # stub, this will trigger a request to stop the process. Make sure we
+ # do not lose this signal.
+ bkpt = target.BreakpointCreateByAddress(0x1234)
+ self.assertTrue(bkpt.IsValid())
+ self.assertEqual(bkpt.GetNumLocations(), 1)
+
+ event = lldb.SBEvent()
+ while self.dbg.GetListener().WaitForEvent(2, event):
+ if self.TraceOn():
+ print("Process changing state to:",
+ self.dbg.StateAsCString(process.GetStateFromEvent(event)))
+ if process.GetStateFromEvent(event) == lldb.eStateExited:
+ break
+
+ # We should get only one continue packet as the client should not
+ # auto-continue after setting the breakpoint.
+ self.assertEqual(self.server.responder.continueCount, 1)
+ # And the process should end up in the stopped state.
+ self.assertEqual(process.GetState(), lldb.eStateStopped)
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
new file mode 100644
index 000000000000..ef9ce7700963
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestTargetXMLArch.py
@@ -0,0 +1,124 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+class TestTargetXMLArch(GDBRemoteTestBase):
+
+ @skipIfXmlSupportMissing
+ @expectedFailureAll(archs=["i386"])
+ @skipIfRemote
+ def test(self):
+ """
+ Test lldb's parsing of the <architecture> tag in the target.xml register
+ description packet.
+ """
+ class MyResponder(MockGDBServerResponder):
+
+ def qXferRead(self, obj, annex, offset, length):
+ if annex == "target.xml":
+ return """<?xml version="1.0"?>
+ <target version="1.0">
+ <architecture>i386:x86-64</architecture>
+ <feature name="org.gnu.gdb.i386.core">
+
+ <flags id="i386_eflags" size="4">
+ <field name="CF" start="0" end="0"/>
+ <field name="" start="1" end="1"/>
+ <field name="PF" start="2" end="2"/>
+ <field name="AF" start="4" end="4"/>
+ <field name="ZF" start="6" end="6"/>
+ <field name="SF" start="7" end="7"/>
+ <field name="TF" start="8" end="8"/>
+ <field name="IF" start="9" end="9"/>
+ <field name="DF" start="10" end="10"/>
+ <field name="OF" start="11" end="11"/>
+ <field name="NT" start="14" end="14"/>
+ <field name="RF" start="16" end="16"/>
+ <field name="VM" start="17" end="17"/>
+ <field name="AC" start="18" end="18"/>
+ <field name="VIF" start="19" end="19"/>
+ <field name="VIP" start="20" end="20"/>
+ <field name="ID" start="21" end="21"/>
+ </flags>
+
+ <reg name="rax" bitsize="64" regnum="0" type="int" group="general"/>
+ <reg name="rbx" bitsize="64" regnum="1" type="int" group="general"/>
+ <reg name="rcx" bitsize="64" regnum="2" type="int" group="general"/>
+ <reg name="rdx" bitsize="64" regnum="3" type="int" group="general"/>
+ <reg name="rsi" bitsize="64" regnum="4" type="int" group="general"/>
+ <reg name="rdi" bitsize="64" regnum="5" type="int" group="general"/>
+ <reg name="rbp" bitsize="64" regnum="6" type="data_ptr" group="general"/>
+ <reg name="rsp" bitsize="64" regnum="7" type="data_ptr" group="general"/>
+ <reg name="r8" bitsize="64" regnum="8" type="int" group="general"/>
+ <reg name="r9" bitsize="64" regnum="9" type="int" group="general"/>
+ <reg name="r10" bitsize="64" regnum="10" type="int" group="general"/>
+ <reg name="r11" bitsize="64" regnum="11" type="int" group="general"/>
+ <reg name="r12" bitsize="64" regnum="12" type="int" group="general"/>
+ <reg name="r13" bitsize="64" regnum="13" type="int" group="general"/>
+ <reg name="r14" bitsize="64" regnum="14" type="int" group="general"/>
+ <reg name="r15" bitsize="64" regnum="15" type="int" group="general"/>
+ <reg name="rip" bitsize="64" regnum="16" type="code_ptr" group="general"/>
+ <reg name="eflags" bitsize="32" regnum="17" type="i386_eflags" group="general"/>
+
+ <reg name="cs" bitsize="32" regnum="18" type="int" group="general"/>
+ <reg name="ss" bitsize="32" regnum="19" type="int" group="general"/>
+ <reg name="ds" bitsize="32" regnum="20" type="int" group="general"/>
+ <reg name="es" bitsize="32" regnum="21" type="int" group="general"/>
+ <reg name="fs" bitsize="32" regnum="22" type="int" group="general"/>
+ <reg name="gs" bitsize="32" regnum="23" type="int" group="general"/>
+
+ <reg name="st0" bitsize="80" regnum="24" type="i387_ext" group="float"/>
+ <reg name="st1" bitsize="80" regnum="25" type="i387_ext" group="float"/>
+ <reg name="st2" bitsize="80" regnum="26" type="i387_ext" group="float"/>
+ <reg name="st3" bitsize="80" regnum="27" type="i387_ext" group="float"/>
+ <reg name="st4" bitsize="80" regnum="28" type="i387_ext" group="float"/>
+ <reg name="st5" bitsize="80" regnum="29" type="i387_ext" group="float"/>
+ <reg name="st6" bitsize="80" regnum="30" type="i387_ext" group="float"/>
+ <reg name="st7" bitsize="80" regnum="31" type="i387_ext" group="float"/>
+
+ <reg name="fctrl" bitsize="32" regnum="32" type="int" group="float"/>
+ <reg name="fstat" bitsize="32" regnum="33" type="int" group="float"/>
+ <reg name="ftag" bitsize="32" regnum="34" type="int" group="float"/>
+ <reg name="fiseg" bitsize="32" regnum="35" type="int" group="float"/>
+ <reg name="fioff" bitsize="32" regnum="36" type="int" group="float"/>
+ <reg name="foseg" bitsize="32" regnum="37" type="int" group="float"/>
+ <reg name="fooff" bitsize="32" regnum="38" type="int" group="float"/>
+ <reg name="fop" bitsize="32" regnum="39" type="int" group="float"/>
+ </feature>
+ </target>""", False
+ else:
+ return None, False
+
+ def qC(self):
+ return "QC1"
+
+ def haltReason(self):
+ return "T05thread:00000001;06:9038d60f00700000;07:98b4062680ffffff;10:c0d7bf1b80ffffff;"
+
+ def readRegister(self, register):
+ regs = {0x0: "00b0060000610000",
+ 0xa: "68fe471c80ffffff",
+ 0xc: "60574a1c80ffffff",
+ 0xd: "18f3042680ffffff",
+ 0xe: "be8a4d7142000000",
+ 0xf: "50df471c80ffffff",
+ 0x10: "c0d7bf1b80ffffff" }
+ if register in regs:
+ return regs[register]
+ else:
+ return "0000000000000000"
+
+ self.server.responder = MyResponder()
+ interp = self.dbg.GetCommandInterpreter()
+ result = lldb.SBCommandReturnObject()
+ if self.TraceOn():
+ interp.HandleCommand("log enable gdb-remote packets", result)
+ target = self.dbg.CreateTarget('')
+ self.assertEqual('', target.GetTriple())
+ process = self.connect(target)
+ if self.TraceOn():
+ interp.HandleCommand("target list", result)
+ print(result.GetOutput())
+ self.assertTrue(target.GetTriple().startswith('x86_64--'))
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestThreadSelectionBug.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestThreadSelectionBug.py
new file mode 100644
index 000000000000..400a93661033
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/TestThreadSelectionBug.py
@@ -0,0 +1,50 @@
+from __future__ import print_function
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+from gdbclientutils import *
+
+
+class TestThreadSelectionBug(GDBRemoteTestBase):
+ def test(self):
+ class MyResponder(MockGDBServerResponder):
+ def cont(self):
+ # Simulate process stopping due to a raise(SIGINT)
+ return "T01reason:signal"
+
+ self.server.responder = MyResponder()
+ target = self.createTarget("a.yaml")
+ process = self.connect(target)
+ python_os_plugin_path = os.path.join(self.getSourceDir(),
+ 'operating_system.py')
+ command = "settings set target.process.python-os-plugin-path '{}'".format(
+ python_os_plugin_path)
+ self.dbg.HandleCommand(command)
+
+ self.assertTrue(process, PROCESS_IS_VALID)
+ self.assertEqual(process.GetNumThreads(), 3)
+
+ # Verify our OS plug-in threads showed up
+ thread = process.GetThreadByID(0x1)
+ self.assertTrue(
+ thread.IsValid(),
+ "Make sure there is a thread 0x1 after we load the python OS plug-in")
+ thread = process.GetThreadByID(0x2)
+ self.assertTrue(
+ thread.IsValid(),
+ "Make sure there is a thread 0x2 after we load the python OS plug-in")
+ thread = process.GetThreadByID(0x3)
+ self.assertTrue(
+ thread.IsValid(),
+ "Make sure there is a thread 0x3 after we load the python OS plug-in")
+
+ # Verify that a thread other than 3 is selected.
+ thread = process.GetSelectedThread()
+ self.assertNotEqual(thread.GetThreadID(), 0x3)
+
+ # Verify that we select the thread backed by physical thread 1, rather
+ # than virtual thread 1. The mapping comes from the OS plugin, where we
+ # specified that thread 3 is backed by real thread 1.
+ process.Continue()
+ thread = process.GetSelectedThread()
+ self.assertEqual(thread.GetThreadID(), 0x3)
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/a.yaml b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/a.yaml
new file mode 100644
index 000000000000..f4e9ff5d8722
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/a.yaml
@@ -0,0 +1,34 @@
+!ELF
+FileHeader:
+ Class: ELFCLASS32
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_ARM
+Sections:
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x1000
+ AddressAlign: 0x4
+ Content: "c3c3c3c3"
+ - Name: .data
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC ]
+ Address: 0x2000
+ AddressAlign: 0x4
+ Content: "3232"
+ProgramHeaders:
+ - Type: PT_LOAD
+ Flags: [ PF_X, PF_R ]
+ VAddr: 0x1000
+ PAddr: 0x1000
+ Align: 0x4
+ Sections:
+ - Section: .text
+ - Type: PT_LOAD
+ Flags: [ PF_R, PF_W ]
+ VAddr: 0x2000
+ PAddr: 0x1004
+ Align: 0x4
+ Sections:
+ - Section: .data
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
new file mode 100644
index 000000000000..ebafd405e23e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/gdbclientutils.py
@@ -0,0 +1,477 @@
+import os
+import os.path
+import subprocess
+import threading
+import socket
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbtest_config
+
+
+def checksum(message):
+ """
+ Calculate the GDB server protocol checksum of the message.
+
+ The GDB server protocol uses a simple modulo 256 sum.
+ """
+ check = 0
+ for c in message:
+ check += ord(c)
+ return check % 256
+
+
+def frame_packet(message):
+ """
+ Create a framed packet that's ready to send over the GDB connection
+ channel.
+
+ Framing includes surrounding the message between $ and #, and appending
+ a two character hex checksum.
+ """
+ return "$%s#%02x" % (message, checksum(message))
+
+
+def escape_binary(message):
+ """
+ Escape the binary message using the process described in the GDB server
+ protocol documentation.
+
+ Most bytes are sent through as-is, but $, #, and { are escaped by writing
+ a { followed by the original byte mod 0x20.
+ """
+ out = ""
+ for c in message:
+ d = ord(c)
+ if d in (0x23, 0x24, 0x7d):
+ out += chr(0x7d)
+ out += chr(d ^ 0x20)
+ else:
+ out += c
+ return out
+
+
+def hex_encode_bytes(message):
+ """
+ Encode the binary message by converting each byte into a two-character
+ hex string.
+ """
+ out = ""
+ for c in message:
+ out += "%02x" % ord(c)
+ return out
+
+
+def hex_decode_bytes(hex_bytes):
+ """
+ Decode the hex string into a binary message by converting each two-character
+ hex string into a single output byte.
+ """
+ out = ""
+ hex_len = len(hex_bytes)
+ while i < hex_len - 1:
+ out += chr(int(hex_bytes[i:i + 2]), 16)
+ i += 2
+ return out
+
+
+class MockGDBServerResponder:
+ """
+ A base class for handling client packets and issuing server responses for
+ GDB tests.
+
+ This handles many typical situations, while still allowing subclasses to
+ completely customize their responses.
+
+ Most subclasses will be interested in overriding the other() method, which
+ handles any packet not recognized in the common packet handling code.
+ """
+
+ registerCount = 40
+ packetLog = None
+
+ def __init__(self):
+ self.packetLog = []
+
+ def respond(self, packet):
+ """
+ Return the unframed packet data that the server should issue in response
+ to the given packet received from the client.
+ """
+ self.packetLog.append(packet)
+ if packet is MockGDBServer.PACKET_INTERRUPT:
+ return self.interrupt()
+ if packet == "c":
+ return self.cont()
+ if packet == "g":
+ return self.readRegisters()
+ if packet[0] == "G":
+ return self.writeRegisters(packet[1:])
+ if packet[0] == "p":
+ return self.readRegister(int(packet[1:], 16))
+ if packet[0] == "P":
+ register, value = packet[1:].split("=")
+ return self.readRegister(int(register, 16), value)
+ if packet[0] == "m":
+ addr, length = [int(x, 16) for x in packet[1:].split(',')]
+ return self.readMemory(addr, length)
+ if packet[0] == "M":
+ location, encoded_data = packet[1:].split(":")
+ addr, length = [int(x, 16) for x in location.split(',')]
+ return self.writeMemory(addr, encoded_data)
+ if packet[0:7] == "qSymbol":
+ return self.qSymbol(packet[8:])
+ if packet[0:10] == "qSupported":
+ return self.qSupported(packet[11:].split(";"))
+ if packet == "qfThreadInfo":
+ return self.qfThreadInfo()
+ if packet == "qC":
+ return self.qC()
+ if packet == "QEnableErrorStrings":
+ return self.QEnableErrorStrings()
+ if packet == "?":
+ return self.haltReason()
+ if packet[0] == "H":
+ return self.selectThread(packet[1], int(packet[2:], 16))
+ if packet[0:6] == "qXfer:":
+ obj, read, annex, location = packet[6:].split(":")
+ offset, length = [int(x, 16) for x in location.split(',')]
+ data, has_more = self.qXferRead(obj, annex, offset, length)
+ if data is not None:
+ return self._qXferResponse(data, has_more)
+ return ""
+ if packet.startswith("vAttach;"):
+ pid = packet.partition(';')[2]
+ return self.vAttach(int(pid, 16))
+ if packet[0] == "Z":
+ return self.setBreakpoint(packet)
+ return self.other(packet)
+
+ def interrupt(self):
+ raise self.UnexpectedPacketException()
+
+ def cont(self):
+ raise self.UnexpectedPacketException()
+
+ def readRegisters(self):
+ return "00000000" * self.registerCount
+
+ def readRegister(self, register):
+ return "00000000"
+
+ def writeRegisters(self, registers_hex):
+ return "OK"
+
+ def writeRegister(self, register, value_hex):
+ return "OK"
+
+ def readMemory(self, addr, length):
+ return "00" * length
+
+ def writeMemory(self, addr, data_hex):
+ return "OK"
+
+ def qSymbol(self, symbol_args):
+ return "OK"
+
+ def qSupported(self, client_supported):
+ return "qXfer:features:read+;PacketSize=3fff;QStartNoAckMode+"
+
+ def qfThreadInfo(self):
+ return "l"
+
+ def qC(self):
+ return "QC0"
+
+ def QEnableErrorStrings(self):
+ return "OK"
+
+ def haltReason(self):
+ # SIGINT is 2, return type is 2 digit hex string
+ return "S02"
+
+ def qXferRead(self, obj, annex, offset, length):
+ return None, False
+
+ def _qXferResponse(self, data, has_more):
+ return "%s%s" % ("m" if has_more else "l", escape_binary(data))
+
+ def vAttach(self, pid):
+ raise self.UnexpectedPacketException()
+
+ def selectThread(self, op, thread_id):
+ return "OK"
+
+ def setBreakpoint(self, packet):
+ raise self.UnexpectedPacketException()
+
+ def other(self, packet):
+ # empty string means unsupported
+ return ""
+
+ """
+ Raised when we receive a packet for which there is no default action.
+ Override the responder class to implement behavior suitable for the test at
+ hand.
+ """
+ class UnexpectedPacketException(Exception):
+ pass
+
+
+class MockGDBServer:
+ """
+ A simple TCP-based GDB server that can test client behavior by receiving
+ commands and issuing custom-tailored responses.
+
+ Responses are generated via the .responder property, which should be an
+ instance of a class based on MockGDBServerResponder.
+ """
+
+ responder = None
+ port = 0
+ _socket = None
+ _client = None
+ _thread = None
+ _receivedData = None
+ _receivedDataOffset = None
+ _shouldSendAck = True
+
+ def __init__(self, port = 0):
+ self.responder = MockGDBServerResponder()
+ self.port = port
+ self._socket = socket.socket()
+
+ def start(self):
+ # Block until the socket is up, so self.port is available immediately.
+ # Then start a thread that waits for a client connection.
+ addr = ("127.0.0.1", self.port)
+ self._socket.bind(addr)
+ self.port = self._socket.getsockname()[1]
+ self._socket.listen(0)
+ self._thread = threading.Thread(target=self._run)
+ self._thread.start()
+
+ def stop(self):
+ self._socket.close()
+ self._thread.join()
+ self._thread = None
+
+ def _run(self):
+ # For testing purposes, we only need to worry about one client
+ # connecting just one time.
+ try:
+ # accept() is stubborn and won't fail even when the socket is
+ # shutdown, so we'll use a timeout
+ self._socket.settimeout(2.0)
+ client, client_addr = self._socket.accept()
+ self._client = client
+ # The connected client inherits its timeout from self._socket,
+ # but we'll use a blocking socket for the client
+ self._client.settimeout(None)
+ except:
+ return
+ self._shouldSendAck = True
+ self._receivedData = ""
+ self._receivedDataOffset = 0
+ data = None
+ while True:
+ try:
+ data = self._client.recv(4096)
+ if data is None or len(data) == 0:
+ break
+ # In Python 2, sockets return byte strings. In Python 3, sockets return bytes.
+ # If we got bytes (and not a byte string), decode them to a string for later handling.
+ if isinstance(data, bytes) and not isinstance(data, str):
+ data = data.decode()
+ self._receive(data)
+ except Exception as e:
+ self._client.close()
+ break
+
+ def _receive(self, data):
+ """
+ Collects data, parses and responds to as many packets as exist.
+ Any leftover data is kept for parsing the next time around.
+ """
+ self._receivedData += data
+ try:
+ packet = self._parsePacket()
+ while packet is not None:
+ self._handlePacket(packet)
+ packet = self._parsePacket()
+ except self.InvalidPacketException:
+ self._client.close()
+
+ def _parsePacket(self):
+ """
+ Reads bytes from self._receivedData, returning:
+ - a packet's contents if a valid packet is found
+ - the PACKET_ACK unique object if we got an ack
+ - None if we only have a partial packet
+
+ Raises an InvalidPacketException if unexpected data is received
+ or if checksums fail.
+
+ Once a complete packet is found at the front of self._receivedData,
+ its data is removed form self._receivedData.
+ """
+ data = self._receivedData
+ i = self._receivedDataOffset
+ data_len = len(data)
+ if data_len == 0:
+ return None
+ if i == 0:
+ # If we're looking at the start of the received data, that means
+ # we're looking for the start of a new packet, denoted by a $.
+ # It's also possible we'll see an ACK here, denoted by a +
+ if data[0] == '+':
+ self._receivedData = data[1:]
+ return self.PACKET_ACK
+ if ord(data[0]) == 3:
+ self._receivedData = data[1:]
+ return self.PACKET_INTERRUPT
+ if data[0] == '$':
+ i += 1
+ else:
+ raise self.InvalidPacketException(
+ "Unexpected leading byte: %s" % data[0])
+
+ # If we're looking beyond the start of the received data, then we're
+ # looking for the end of the packet content, denoted by a #.
+ # Note that we pick up searching from where we left off last time
+ while i < data_len and data[i] != '#':
+ i += 1
+
+ # If there isn't enough data left for a checksum, just remember where
+ # we left off so we can pick up there the next time around
+ if i > data_len - 3:
+ self._receivedDataOffset = i
+ return None
+
+ # If we have enough data remaining for the checksum, extract it and
+ # compare to the packet contents
+ packet = data[1:i]
+ i += 1
+ try:
+ check = int(data[i:i + 2], 16)
+ except ValueError:
+ raise self.InvalidPacketException("Checksum is not valid hex")
+ i += 2
+ if check != checksum(packet):
+ raise self.InvalidPacketException(
+ "Checksum %02x does not match content %02x" %
+ (check, checksum(packet)))
+ # remove parsed bytes from _receivedData and reset offset so parsing
+ # can start on the next packet the next time around
+ self._receivedData = data[i:]
+ self._receivedDataOffset = 0
+ return packet
+
+ def _handlePacket(self, packet):
+ if packet is self.PACKET_ACK:
+ # Ignore ACKs from the client. For the future, we can consider
+ # adding validation code to make sure the client only sends ACKs
+ # when it's supposed to.
+ return
+ response = ""
+ # We'll handle the ack stuff here since it's not something any of the
+ # tests will be concerned about, and it'll get turned off quickly anyway.
+ if self._shouldSendAck:
+ self._client.sendall('+'.encode())
+ if packet == "QStartNoAckMode":
+ self._shouldSendAck = False
+ response = "OK"
+ elif self.responder is not None:
+ # Delegate everything else to our responder
+ response = self.responder.respond(packet)
+ # Handle packet framing since we don't want to bother tests with it.
+ if response is not None:
+ framed = frame_packet(response)
+ # In Python 2, sockets send byte strings. In Python 3, sockets send bytes.
+ # If we got a string (and not a byte string), encode it before sending.
+ if isinstance(framed, str) and not isinstance(framed, bytes):
+ framed = framed.encode()
+ self._client.sendall(framed)
+
+ PACKET_ACK = object()
+ PACKET_INTERRUPT = object()
+
+ class InvalidPacketException(Exception):
+ pass
+
+
+class GDBRemoteTestBase(TestBase):
+ """
+ Base class for GDB client tests.
+
+ This class will setup and start a mock GDB server for the test to use.
+ It also provides assertPacketLogContains, which simplifies the checking
+ of packets sent by the client.
+ """
+
+ NO_DEBUG_INFO_TESTCASE = True
+ mydir = TestBase.compute_mydir(__file__)
+ server = None
+
+ def setUp(self):
+ TestBase.setUp(self)
+ self.server = MockGDBServer()
+ self.server.start()
+
+ def tearDown(self):
+ # TestBase.tearDown will kill the process, but we need to kill it early
+ # so its client connection closes and we can stop the server before
+ # finally calling the base tearDown.
+ if self.process() is not None:
+ self.process().Kill()
+ self.server.stop()
+ TestBase.tearDown(self)
+
+ def createTarget(self, yaml_path):
+ """
+ Create a target by auto-generating the object based on the given yaml
+ instructions.
+
+ This will track the generated object so it can be automatically removed
+ during tearDown.
+ """
+ yaml_base, ext = os.path.splitext(yaml_path)
+ obj_path = self.getBuildArtifact(yaml_base)
+ self.yaml2obj(yaml_path, obj_path)
+ return self.dbg.CreateTarget(obj_path)
+
+ def connect(self, target):
+ """
+ Create a process by connecting to the mock GDB server.
+
+ Includes assertions that the process was successfully created.
+ """
+ listener = self.dbg.GetListener()
+ error = lldb.SBError()
+ url = "connect://localhost:%d" % self.server.port
+ process = target.ConnectRemote(listener, url, "gdb-remote", error)
+ self.assertTrue(error.Success(), error.description)
+ self.assertTrue(process, PROCESS_IS_VALID)
+ return process
+
+ def assertPacketLogContains(self, packets):
+ """
+ Assert that the mock server's packet log contains the given packets.
+
+ The packet log includes all packets sent by the client and received
+ by the server. This fuction makes it easy to verify that the client
+ sent the expected packets to the server.
+
+ The check does not require that the packets be consecutive, but does
+ require that they are ordered in the log as they ordered in the arg.
+ """
+ i = 0
+ j = 0
+ log = self.server.responder.packetLog
+
+ while i < len(packets) and j < len(log):
+ if log[j] == packets[i]:
+ i += 1
+ j += 1
+ if i < len(packets):
+ self.fail(u"Did not receive: %s\nLast 10 packets:\n\t%s" %
+ (packets[i], u'\n\t'.join(log[-10:])))
diff --git a/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/operating_system.py b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/operating_system.py
new file mode 100644
index 000000000000..ad9b6fd4e55a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/gdb_remote_client/operating_system.py
@@ -0,0 +1,45 @@
+import lldb
+import struct
+
+
+class OperatingSystemPlugIn(object):
+ """Class that provides data for an instance of a LLDB 'OperatingSystemPython' plug-in class"""
+
+ def __init__(self, process):
+ '''Initialization needs a valid.SBProcess object.
+
+ This plug-in will get created after a live process is valid and has stopped for the first time.
+ '''
+ self.process = None
+ self.registers = None
+ self.threads = None
+ if isinstance(process, lldb.SBProcess) and process.IsValid():
+ self.process = process
+ self.threads = None # Will be an dictionary containing info for each thread
+
+ def get_target(self):
+ return self.process.target
+
+ def get_thread_info(self):
+ if not self.threads:
+ self.threads = [{
+ 'tid': 0x1,
+ 'name': 'one',
+ 'queue': 'queue1',
+ 'state': 'stopped',
+ 'stop_reason': 'none'
+ }, {
+ 'tid': 0x2,
+ 'name': 'two',
+ 'queue': 'queue2',
+ 'state': 'stopped',
+ 'stop_reason': 'none'
+ }, {
+ 'tid': 0x3,
+ 'name': 'three',
+ 'queue': 'queue3',
+ 'state': 'stopped',
+ 'stop_reason': 'sigstop',
+ 'core': 0
+ }]
+ return self.threads
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py b/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
index 7b048fedebba..75215f89ef0b 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
@@ -125,7 +125,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting(self):
"""Inferior asserts upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -142,7 +142,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting_python(self):
"""Inferior asserts upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -166,7 +166,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting_registers(self):
"""Test that lldb can read registers after asserting."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -178,7 +178,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting_disassemble(self):
"""Test that lldb can disassemble frames after asserting."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -248,7 +248,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting_expr(self):
"""Test that the lldb expression interpreter can read symbols after asserting."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -272,7 +272,7 @@ class AssertingInferiorTestCase(TestBase):
def inferior_asserting_step(self):
"""Test that lldb functions correctly after stepping through a call to assert()."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py b/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
index 3620de61a2e3..b1b9f4bc04c7 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-changed/TestInferiorChanged.py
@@ -41,7 +41,7 @@ class ChangedInferiorTestCase(TestBase):
def inferior_crashing(self):
"""Inferior crashes upon launching; lldb should catch the event and stop."""
- self.exe = os.path.join(os.getcwd(), "a.out")
+ self.exe = self.getBuildArtifact("a.out")
self.runCmd("file " + self.exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
index b233d2f768e0..4f54f5d4103b 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/TestInferiorCrashing.py
@@ -100,7 +100,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing(self):
"""Inferior crashes upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -122,7 +122,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_python(self):
"""Inferior crashes upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -148,7 +148,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_registers(self):
"""Test that lldb can read registers after crashing."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -160,7 +160,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_expr(self):
"""Test that the lldb expression interpreter can read symbols after crashing."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -176,7 +176,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_step(self):
"""Test that lldb functions correctly after stepping through a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.set_breakpoint(self.line)
@@ -206,7 +206,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_step_after_break(self):
"""Test that lldb behaves correctly when stepping after a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -231,7 +231,7 @@ class CrashingInferiorTestCase(TestBase):
def inferior_crashing_expr_step_expr(self):
"""Test that lldb expressions work before and after stepping after a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
index 9987377a83ec..d8efe65dc7f6 100644
--- a/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
+++ b/packages/Python/lldbsuite/test/functionalities/inferior-crashing/recursive-inferior/TestRecursiveInferior.py
@@ -83,7 +83,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing(self):
"""Inferior crashes upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -117,7 +117,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_python(self):
"""Inferior crashes upon launching; lldb should catch the event and stop."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -143,7 +143,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_registers(self):
"""Test that lldb can read registers after crashing."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -155,7 +155,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_expr(self):
"""Test that the lldb expression interpreter can read symbols after crashing."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -168,7 +168,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_step(self):
"""Test that lldb functions correctly after stepping through a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.set_breakpoint(self.line)
@@ -196,7 +196,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_step_after_break(self):
"""Test that lldb behaves correctly when stepping after a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
@@ -221,7 +221,7 @@ class CrashingRecursiveInferiorTestCase(TestBase):
def recursive_inferior_crashing_expr_step_expr(self):
"""Test that lldb expressions work before and after stepping after a crash."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py b/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
index cb801242aa58..4513db2ccdfc 100644
--- a/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
+++ b/packages/Python/lldbsuite/test/functionalities/inline-stepping/TestInlineStepping.py
@@ -20,6 +20,7 @@ class TestInlineStepping(TestBase):
@expectedFailureAll(
compiler="icc",
bugnumber="# Not really a bug. ICC combines two inlined functions.")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_python_api(self):
"""Test stepping over and into inlined functions."""
self.build()
@@ -32,6 +33,7 @@ class TestInlineStepping(TestBase):
self.inline_stepping_step_over()
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_step_in_template_with_python_api(self):
"""Test stepping in to templated functions."""
self.build()
@@ -145,7 +147,7 @@ class TestInlineStepping(TestBase):
def inline_stepping(self):
"""Use Python APIs to test stepping over and hitting breakpoints."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -257,7 +259,7 @@ class TestInlineStepping(TestBase):
def inline_stepping_step_over(self):
"""Use Python APIs to test stepping over and hitting breakpoints."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -288,7 +290,7 @@ class TestInlineStepping(TestBase):
def step_in_template(self):
"""Use Python APIs to test stepping in to templated functions."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py b/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
index 7ccfaa688b88..07f04b18bb97 100644
--- a/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
+++ b/packages/Python/lldbsuite/test/functionalities/jitloader_gdb/TestJITLoaderGDB.py
@@ -22,7 +22,7 @@ class JITLoaderGDBTestCase(TestBase):
def test_bogus_values(self):
"""Test that we handle inferior misusing the GDB JIT interface"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
index 43fa5f9d33f2..9b485b2235dd 100644
--- a/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
+++ b/packages/Python/lldbsuite/test/functionalities/launch_with_shellexpand/TestLaunchWithShellExpand.py
@@ -25,7 +25,7 @@ class LaunchWithShellExpandTestCase(TestBase):
@skipIfDarwinEmbedded # iOS etc don't launch the binary via a shell, so arg expansion won't happen
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("target create %s" % exe)
@@ -39,7 +39,7 @@ class LaunchWithShellExpandTestCase(TestBase):
self.runCmd(
"process launch -X true -w %s -- fi*.tx? () > <" %
- (os.getcwd()))
+ (self.getSourceDir()))
process = self.process()
@@ -77,7 +77,7 @@ class LaunchWithShellExpandTestCase(TestBase):
self.runCmd(
'process launch -X true -w %s -- "foo bar"' %
- (os.getcwd()))
+ (self.getSourceDir()))
process = self.process()
@@ -99,7 +99,8 @@ class LaunchWithShellExpandTestCase(TestBase):
self.runCmd("process kill")
- self.runCmd('process launch -X true -w %s -- foo\ bar' % (os.getcwd()))
+ self.runCmd('process launch -X true -w %s -- foo\ bar'
+ % (self.getBuildDir()))
process = self.process()
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile b/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
index 9a954a201cf2..0dd9eb41a408 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/Makefile
@@ -7,11 +7,10 @@ CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
-.PHONY:
a.out: lib_a lib_b lib_c lib_d hidden_lib_d install_name_tool
lib_%:
- $(MAKE) -f $*.mk
+ $(MAKE) VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/$*.mk
install_name_tool:
ifeq ($(OS),Darwin)
@@ -20,11 +19,11 @@ endif
hidden_lib_d:
- $(MAKE) -C hidden
+ $(MAKE) VPATH=$(SRCDIR)/hidden -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile
clean::
- $(MAKE) -f a.mk clean
- $(MAKE) -f b.mk clean
- $(MAKE) -f c.mk clean
- $(MAKE) -f d.mk clean
- $(MAKE) -C hidden clean
+ $(MAKE) -f $(SRCDIR)/a.mk clean
+ $(MAKE) -f $(SRCDIR)/b.mk clean
+ $(MAKE) -f $(SRCDIR)/c.mk clean
+ $(MAKE) -f $(SRCDIR)/d.mk clean
+ $(MAKE) -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile clean
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
index 98b0c9ca1971..6302112d2fe9 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
@@ -19,15 +19,23 @@ class LoadUnloadTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
+ self.setup_test()
+ # Invoke the default build rule.
+ self.build()
# Find the line number to break for main.cpp.
self.line = line_number(
'main.cpp',
'// Set break point at this line for test_lldb_process_load_and_unload_commands().')
self.line_d_function = line_number(
'd.cpp', '// Find this line number within d_dunction().')
+
+ def setup_test(self):
+ lldbutil.mkdir_p(self.getBuildArtifact("hidden"))
if not self.platformIsDarwin():
if not lldb.remote_platform and "LD_LIBRARY_PATH" in os.environ:
self.runCmd(
@@ -36,12 +44,12 @@ class LoadUnloadTestCase(TestBase):
"=" +
os.environ["LD_LIBRARY_PATH"] +
":" +
- os.getcwd())
+ self.getBuildDir())
else:
if lldb.remote_platform:
wd = lldb.remote_platform.GetWorkingDirectory()
else:
- wd = os.getcwd()
+ wd = self.getBuildDir()
self.runCmd(
"settings set target.env-vars " +
self.dylibPath +
@@ -63,7 +71,7 @@ class LoadUnloadTestCase(TestBase):
cwd = os.getcwd()
for f in shlibs:
err = lldb.remote_platform.Put(
- lldb.SBFileSpec(os.path.join(cwd, f)),
+ lldb.SBFileSpec(self.getBuildArtifact(f)),
lldb.SBFileSpec(os.path.join(wd, f)))
if err.Fail():
raise RuntimeError(
@@ -78,34 +86,32 @@ class LoadUnloadTestCase(TestBase):
raise RuntimeError(
"Unable to create a directory '%s'." % hidden_dir)
err = lldb.remote_platform.Put(
- lldb.SBFileSpec(os.path.join(cwd, 'hidden', shlib)),
+ lldb.SBFileSpec(os.path.join('hidden', shlib)),
lldb.SBFileSpec(hidden_file))
if err.Fail():
raise RuntimeError(
"Unable copy 'libloadunload_d.so' to '%s'.\n>>> %s" %
(wd, err.GetCString()))
+ # libloadunload_d.so does not appear in the image list because executable
+ # dependencies are resolved relative to the debuggers PWD. Bug?
+ @expectedFailureAll(oslist=["linux"])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@not_remote_testsuite_ready
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_modules_search_paths(self):
"""Test target modules list after loading a different copy of the library libd.dylib, and verifies that it works with 'target modules search-paths add'."""
-
- # Invoke the default build rule.
- self.build()
-
if self.platformIsDarwin():
dylibName = 'libloadunload_d.dylib'
else:
dylibName = 'libloadunload_d.so'
# The directory with the dynamic library we did not link to.
- new_dir = os.path.join(os.getcwd(), "hidden")
+ new_dir = os.path.join(self.getBuildDir(), "hidden")
- old_dylib = os.path.join(os.getcwd(), dylibName)
+ old_dylib = os.path.join(self.getBuildDir(), dylibName)
new_dylib = os.path.join(new_dir, dylibName)
-
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.expect("target modules list",
@@ -115,14 +121,14 @@ class LoadUnloadTestCase(TestBase):
# Add an image search path substitution pair.
self.runCmd(
"target modules search-paths add %s %s" %
- (os.getcwd(), new_dir))
+ (self.getBuildDir(), new_dir))
self.expect("target modules search-paths list",
- substrs=[os.getcwd(), new_dir])
+ substrs=[self.getBuildDir(), new_dir])
self.expect(
"target modules search-paths query %s" %
- os.getcwd(),
+ self.getBuildDir(),
"Image search path successfully transformed",
substrs=[new_dir])
@@ -146,17 +152,17 @@ class LoadUnloadTestCase(TestBase):
"LLDB successfully locates the relocated dynamic library",
substrs=[new_dylib])
+ # libloadunload_d.so does not appear in the image list because executable
+ # dependencies are resolved relative to the debuggers PWD. Bug?
+ @expectedFailureAll(oslist=["linux"])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@expectedFailureAndroid # wrong source file shows up for hidden library
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_dyld_library_path(self):
"""Test (DY)LD_LIBRARY_PATH after moving libd.dylib, which defines d_function, somewhere else."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote(hidden_dir=True)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Shut off ANSI color usage so we don't get ANSI escape sequences
@@ -174,18 +180,19 @@ class LoadUnloadTestCase(TestBase):
if lldb.remote_platform:
wd = lldb.remote_platform.GetWorkingDirectory()
else:
- wd = os.getcwd()
+ wd = self.getBuildDir()
old_dir = wd
new_dir = os.path.join(wd, special_dir)
old_dylib = os.path.join(old_dir, dylibName)
- remove_dyld_path_cmd = "settings remove target.env-vars " + self.dylibPath
+ remove_dyld_path_cmd = "settings remove target.env-vars " \
+ + self.dylibPath
self.addTearDownHook(
lambda: self.dbg.HandleCommand(remove_dyld_path_cmd))
- # For now we don't track (DY)LD_LIBRARY_PATH, so the old library will be in
- # the modules list.
+ # For now we don't track (DY)LD_LIBRARY_PATH, so the old
+ # library will be in the modules list.
self.expect("target modules list",
substrs=[os.path.basename(old_dylib)],
matching=True)
@@ -203,26 +210,21 @@ class LoadUnloadTestCase(TestBase):
if not self.platformIsDarwin():
env_cmd_string += ":" + wd
self.runCmd(env_cmd_string)
-
+
# This time, the hidden library should be picked up.
self.expect("run", substrs=["return", "12345"])
@expectedFailureAll(
bugnumber="llvm.org/pr25805",
hostoslist=["windows"],
- compiler="gcc",
- archs=["i386"],
triple='.*-android')
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_lldb_process_load_and_unload_commands(self):
"""Test that lldb process load/unload command work correctly."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break at main.cpp before the call to dlopen().
@@ -233,15 +235,14 @@ class LoadUnloadTestCase(TestBase):
self.runCmd("run", RUN_SUCCEEDED)
+ ctx = self.platformContext
+ dylibName = ctx.shlib_prefix + 'loadunload_a.' + ctx.shlib_extension
+ localDylibPath = self.getBuildArtifact(dylibName)
if lldb.remote_platform:
- shlib_dir = lldb.remote_platform.GetWorkingDirectory()
- else:
- shlib_dir = self.mydir
-
- if self.platformIsDarwin():
- dylibName = 'libloadunload_a.dylib'
+ wd = lldb.remote_platform.GetWorkingDirectory()
+ remoteDylibPath = lldbutil.join_remote_paths(wd, dylibName)
else:
- dylibName = 'libloadunload_a.so'
+ remoteDylibPath = localDylibPath
# Make sure that a_function does not exist at this point.
self.expect(
@@ -253,13 +254,10 @@ class LoadUnloadTestCase(TestBase):
# Use lldb 'process load' to load the dylib.
self.expect(
- "process load %s --install" %
- dylibName,
- "%s loaded correctly" %
- dylibName,
+ "process load %s --install=%s" % (localDylibPath, remoteDylibPath),
+ "%s loaded correctly" % dylibName,
patterns=[
- 'Loading "%s".*ok' %
- dylibName,
+ 'Loading "%s".*ok' % localDylibPath,
'Image [0-9]+ loaded'])
# Search for and match the "Image ([0-9]+) loaded" pattern.
@@ -295,12 +293,9 @@ class LoadUnloadTestCase(TestBase):
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
def test_load_unload(self):
"""Test breakpoint by name works correctly with dlopen'ing."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break by function name a_function (not yet loaded).
@@ -338,12 +333,9 @@ class LoadUnloadTestCase(TestBase):
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
def test_step_over_load(self):
"""Test stepping over code that loads a shared library works correctly."""
-
- # Invoke the default build rule.
- self.build()
self.copy_shlibs_to_remote()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break by function name a_function (not yet loaded).
@@ -366,16 +358,16 @@ class LoadUnloadTestCase(TestBase):
substrs=['stopped',
'stop reason = step over'])
+ # We can't find a breakpoint location for d_init before launching because
+ # executable dependencies are resolved relative to the debuggers PWD. Bug?
+ @expectedFailureAll(oslist=["linux"])
@skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
@skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
- @unittest2.expectedFailure("llvm.org/pr25806")
def test_static_init_during_load(self):
"""Test that we can set breakpoints correctly in static initializers"""
-
- self.build()
self.copy_shlibs_to_remote()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
a_init_bp_num = lldbutil.run_break_set_by_symbol(
@@ -395,19 +387,19 @@ class LoadUnloadTestCase(TestBase):
self.runCmd("continue")
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
- 'a_init',
- 'stop reason = breakpoint %d' % a_init_bp_num])
+ 'b_init',
+ 'stop reason = breakpoint %d' % b_init_bp_num])
self.expect("thread backtrace",
- substrs=['a_init',
+ substrs=['b_init',
'dlopen',
'main'])
self.runCmd("continue")
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
- 'b_init',
- 'stop reason = breakpoint %d' % b_init_bp_num])
+ 'a_init',
+ 'stop reason = breakpoint %d' % a_init_bp_num])
self.expect("thread backtrace",
- substrs=['b_init',
+ substrs=['a_init',
'dlopen',
'main'])
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk b/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
index 0eb810e21787..fddca925dea2 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/a.mk
@@ -2,22 +2,18 @@ LEVEL := ../../make
LIB_PREFIX := loadunload_
-CFLAGS_EXTRAS := -fPIC
LD_EXTRAS := -L. -l$(LIB_PREFIX)b
DYLIB_NAME := $(LIB_PREFIX)a
DYLIB_CXX_SOURCES := a.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
-.PHONY:
$(DYLIB_FILENAME): lib_b
-lib_b:
- "$(MAKE)" -f b.mk
+.PHONY lib_b:
+ $(MAKE) VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/b.mk
clean::
- "$(MAKE)" -f b.mk clean
+ $(MAKE) -I $(SRCDIR) -f $(SRCDIR)/b.mk clean
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk b/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
index c1b0877d72a4..2fcdbea3a1c4 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/b.mk
@@ -6,6 +6,4 @@ DYLIB_NAME := $(LIB_PREFIX)b
DYLIB_CXX_SOURCES := b.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk b/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
index 5b5691efeef4..d40949b14630 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/c.mk
@@ -6,6 +6,4 @@ DYLIB_NAME := $(LIB_PREFIX)c
DYLIB_CXX_SOURCES := c.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk b/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
index b6b6eeacba26..a5db3c7c31f0 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/d.mk
@@ -8,6 +8,4 @@ DYLIB_NAME := $(LIB_PREFIX)d
DYLIB_CXX_SOURCES := d.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile b/packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile
index f84d8300843f..271117a0ad88 100644
--- a/packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/load_unload/hidden/Makefile
@@ -6,6 +6,4 @@ DYLIB_NAME := $(LIB_PREFIX)d
DYLIB_CXX_SOURCES := d.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/load_using_paths/.categories b/packages/Python/lldbsuite/test/functionalities/load_using_paths/.categories
new file mode 100644
index 000000000000..c00c25822e4c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/.categories
@@ -0,0 +1 @@
+basic_process
diff --git a/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile b/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
new file mode 100644
index 000000000000..c4c3cfe3c18e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/Makefile
@@ -0,0 +1,14 @@
+LEVEL := ../../make
+
+CXX_SOURCES := main.cpp
+LD_EXTRAS := -ldl
+
+include $(LEVEL)/Makefile.rules
+
+all: hidden_lib a.out
+
+hidden_lib:
+ $(MAKE) VPATH=$(SRCDIR)/hidden -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile
+
+clean::
+ $(MAKE) -I $(SRCDIR)/hidden -C hidden -f $(SRCDIR)/hidden/Makefile clean
diff --git a/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py b/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
new file mode 100644
index 000000000000..2050586adfa1
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/TestLoadUsingPaths.py
@@ -0,0 +1,143 @@
+"""
+Test that SBProcess.LoadImageUsingPaths works correctly.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+@skipIfWindows # The Windows platform doesn't implement DoLoadImage.
+class LoadUsingPathsTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+ # Make the hidden directory in the build hierarchy:
+ lldbutil.mkdir_p(self.getBuildArtifact("hidden"))
+
+ # Invoke the default build rule.
+ self.build()
+
+ ext = 'so'
+ if self.platformIsDarwin():
+ ext = 'dylib'
+ self.lib_name = 'libloadunload.' + ext
+
+ self.wd = self.getBuildDir()
+ self.hidden_dir = os.path.join(self.wd, 'hidden')
+ self.hidden_lib = os.path.join(self.hidden_dir, self.lib_name)
+
+ @skipIfFreeBSD # llvm.org/pr14424 - missing FreeBSD Makefiles/testcase support
+ @not_remote_testsuite_ready
+ @skipIfWindows # Windows doesn't have dlopen and friends, dynamic libraries work differently
+ def test_load_using_paths(self):
+ """Test that we can load a module by providing a set of search paths."""
+ if self.platformIsDarwin():
+ dylibName = 'libloadunload_d.dylib'
+ else:
+ dylibName = 'libloadunload_d.so'
+
+ # The directory with the dynamic library we did not link to.
+ path_dir = os.path.join(self.getBuildDir(), "hidden")
+
+ (target, process, thread,
+ _) = lldbutil.run_to_source_breakpoint(self,
+ "Break here to do the load using paths",
+ lldb.SBFileSpec("main.cpp"))
+ error = lldb.SBError()
+ lib_spec = lldb.SBFileSpec(self.lib_name)
+ paths = lldb.SBStringList()
+ paths.AppendString(self.wd)
+ paths.AppendString(os.path.join(self.wd, "no_such_dir"))
+
+ out_spec = lldb.SBFileSpec()
+
+ # First try with no correct directories on the path, and make sure that doesn't blow up:
+ token = process.LoadImageUsingPaths(lib_spec, paths, out_spec, error)
+ self.assertEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Only looked on the provided path.")
+
+ # Now add the correct dir to the paths list and try again:
+ paths.AppendString(self.hidden_dir)
+ token = process.LoadImageUsingPaths(lib_spec, paths, out_spec, error)
+
+ self.assertNotEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Got a valid token")
+ self.assertEqual(out_spec, lldb.SBFileSpec(self.hidden_lib), "Found the expected library")
+
+ # Make sure this really is in the image list:
+ loaded_module = target.FindModule(out_spec)
+
+ self.assertTrue(loaded_module.IsValid(), "The loaded module is in the image list.")
+
+ # Now see that we can call a function in the loaded module.
+ value = thread.frames[0].EvaluateExpression("d_function()", lldb.SBExpressionOptions())
+ self.assertTrue(value.GetError().Success(), "Got a value from the expression")
+ ret_val = value.GetValueAsSigned()
+ self.assertEqual(ret_val, 12345, "Got the right value")
+
+ # Make sure the token works to unload it:
+ process.UnloadImage(token)
+
+ # Make sure this really is no longer in the image list:
+ loaded_module = target.FindModule(out_spec)
+
+ self.assertFalse(loaded_module.IsValid(), "The unloaded module is no longer in the image list.")
+
+ # Make sure a relative path also works:
+ paths.Clear()
+ paths.AppendString(os.path.join(self.wd, "no_such_dir"))
+ paths.AppendString(self.wd)
+ relative_spec = lldb.SBFileSpec(os.path.join("hidden", self.lib_name))
+
+ out_spec = lldb.SBFileSpec()
+ token = process.LoadImageUsingPaths(relative_spec, paths, out_spec, error)
+
+ self.assertNotEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Got a valid token with relative path")
+ self.assertEqual(out_spec, lldb.SBFileSpec(self.hidden_lib), "Found the expected library with relative path")
+
+ process.UnloadImage(token)
+
+ # Make sure the presence of an empty path doesn't mess anything up:
+ paths.Clear()
+ paths.AppendString("")
+ paths.AppendString(os.path.join(self.wd, "no_such_dir"))
+ paths.AppendString(self.wd)
+ relative_spec = lldb.SBFileSpec(os.path.join("hidden", self.lib_name))
+
+ out_spec = lldb.SBFileSpec()
+ token = process.LoadImageUsingPaths(relative_spec, paths, out_spec, error)
+
+ self.assertNotEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Got a valid token with included empty path")
+ self.assertEqual(out_spec, lldb.SBFileSpec(self.hidden_lib), "Found the expected library with included empty path")
+
+ process.UnloadImage(token)
+
+
+
+ # Finally, passing in an absolute path should work like the basename:
+ # This should NOT work because we've taken hidden_dir off the paths:
+ abs_spec = lldb.SBFileSpec(os.path.join(self.hidden_dir, self.lib_name))
+
+ token = process.LoadImageUsingPaths(lib_spec, paths, out_spec, error)
+ self.assertEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Only looked on the provided path.")
+
+ # But it should work when we add the dir:
+ # Now add the correct dir to the paths list and try again:
+ paths.AppendString(self.hidden_dir)
+ token = process.LoadImageUsingPaths(lib_spec, paths, out_spec, error)
+
+ self.assertNotEqual(token, lldb.LLDB_INVALID_IMAGE_TOKEN, "Got a valid token")
+ self.assertEqual(out_spec, lldb.SBFileSpec(self.hidden_lib), "Found the expected library")
+
+
diff --git a/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/Makefile b/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/Makefile
new file mode 100644
index 000000000000..bebfa92ecfb2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/Makefile
@@ -0,0 +1,7 @@
+LEVEL := ../../../make
+
+DYLIB_NAME := loadunload
+DYLIB_CXX_SOURCES := d.cpp
+DYLIB_ONLY := YES
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/d.cpp b/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/d.cpp
new file mode 100644
index 000000000000..6a7642c08b93
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/hidden/d.cpp
@@ -0,0 +1,21 @@
+//===-- c.c -----------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+int d_init()
+{
+ return 456;
+}
+
+int d_global = d_init();
+
+int
+d_function ()
+{ // Find this line number within d_dunction().
+ return 12345;
+}
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/main.cpp b/packages/Python/lldbsuite/test/functionalities/load_using_paths/main.cpp
index 6d725a5759b5..4b3320479c25 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/load_using_paths/main.cpp
@@ -1,4 +1,4 @@
-//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//===-- main.c --------------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -6,13 +6,11 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+#include <stdio.h>
-extern int j;
-extern int gfunc(int i);
-extern int gfunc2(int i);
int
-main()
-{ // FUNC_main
- int i = gfunc(j) + gfunc2(j);
- return i == 0;
+main (int argc, char const *argv[])
+{
+ printf("Break here to do the load using paths.");
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py b/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
index dd4ab4cab2a9..db855f6302dd 100644
--- a/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
+++ b/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
@@ -47,7 +47,7 @@ class LongjmpTestCase(TestBase):
self.step_back_out()
def start_test(self, symbol):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py b/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
index f2126e9ffd5f..f45479bee0bf 100644
--- a/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
+++ b/packages/Python/lldbsuite/test/functionalities/memory/cache/TestMemoryCache.py
@@ -28,7 +28,7 @@ class MemoryCacheTestCase(TestBase):
def test_memory_cache(self):
"""Test the MemoryCache class with a sequence of 'memory read' and 'memory write' operations."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break in main() after the variables are assigned values.
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py b/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
index f8f10a8d4f56..8e0fbaa32018 100644
--- a/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
+++ b/packages/Python/lldbsuite/test/functionalities/memory/find/TestMemoryFind.py
@@ -28,10 +28,10 @@ class MemoryFindTestCase(TestBase):
def test_memory_find(self):
"""Test the 'memory find' command."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # Break in main() aftre the variables are assigned values.
+ # Break in main() after the variables are assigned values.
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py b/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
index 91342fdaf1c3..2e4bbbd53f0f 100644
--- a/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
+++ b/packages/Python/lldbsuite/test/functionalities/memory/read/TestMemoryRead.py
@@ -26,10 +26,10 @@ class MemoryReadTestCase(TestBase):
def test_memory_read(self):
"""Test the 'memory read' command with plain and vector formats."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # Break in main() aftre the variables are assigned values.
+ # Break in main() after the variables are assigned values.
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py b/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
index eb6981d04fad..b871b90961c9 100644
--- a/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
+++ b/packages/Python/lldbsuite/test/functionalities/mtc/simple/TestMTCSimple.py
@@ -33,7 +33,7 @@ class MTCSimpleTestCase(TestBase):
@skipIf(archs=['i386'])
def mtc_tests(self):
# Load the test
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe, patterns=["Current executable set to .*a.out"])
self.runCmd("env DYLD_INSERT_LIBRARIES=%s" % self.mtc_dylib_path)
diff --git a/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py b/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
index 86c5e41b0931..f805b53d3cd4 100644
--- a/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
+++ b/packages/Python/lldbsuite/test/functionalities/nested_alias/TestNestedAlias.py
@@ -26,10 +26,10 @@ class NestedAliasTestCase(TestBase):
def test_nested_alias(self):
"""Test that an alias can reference other aliases without crashing."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # Break in main() aftre the variables are assigned values.
+ # Break in main() after the variables are assigned values.
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py b/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
index bbaba956acfd..59e889e8b0fd 100644
--- a/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
+++ b/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/TestIndexVariable.py
@@ -23,9 +23,8 @@ class NonOverlappingIndexVariableCase(TestBase):
def test_eval_index_variable(self):
"""Test expressions of variable 'i' which appears in two for loops."""
self.build()
- self.exe_name = 'a.out'
- exe = os.path.join(os.getcwd(), self.exe_name)
- self.runCmd("file %s" % exe, CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp b/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
index b4f519cd25a8..2171a2648bde 100644
--- a/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/non-overlapping-index-variable-i/main.cpp
@@ -6,7 +6,6 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
class Point {
public:
@@ -37,15 +36,11 @@ int main(int argc, char const *argv[]) {
ptr[i]->point.y = i+1;
}
- printf("Finished populating data.\n");
for (int i = 0; i < 1000; ++i) {
bool dump = argc > 1; // Set breakpoint here.
// Evaluate a couple of expressions (2*1000 = 2000 exprs):
// expr ptr[i]->point.x
// expr ptr[i]->point.y
- if (dump) {
- printf("data[%d] = %d (%d, %d)\n", i, ptr[i]->id, ptr[i]->point.x, ptr[i]->point.y);
- }
}
return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py b/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
index be89e36b5ce0..fd9812320f2b 100644
--- a/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
+++ b/packages/Python/lldbsuite/test/functionalities/nosucharch/TestNoSuchArch.py
@@ -15,7 +15,7 @@ class NoSuchArchTestCase(TestBase):
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Check that passing an invalid arch via the command-line fails but
# doesn't crash
diff --git a/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py
index 54ea33ad24a9..b81446f5a58f 100644
--- a/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py
+++ b/packages/Python/lldbsuite/test/functionalities/platform/TestPlatformPython.py
@@ -51,6 +51,14 @@ class PlatformPythonTestCase(TestBase):
@add_test_categories(['pyapi'])
@no_debug_info_test
+ def test_host_is_connected(self):
+ # We've already tested that this one IS the host platform.
+ host_platform = self.dbg.GetPlatformAtIndex(0)
+ self.assertTrue(host_platform.IsConnected(), "The host platform is always connected")
+
+
+ @add_test_categories(['pyapi'])
+ @no_debug_info_test
def test_available_platform_list(self):
"""Test SBDebugger::GetNumAvailablePlatforms() and GetAvailablePlatformInfoAtIndex() API"""
num_platforms = self.dbg.GetNumAvailablePlatforms()
diff --git a/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py b/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
index 18fcc41fa9f6..25b83ed5532f 100644
--- a/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
+++ b/packages/Python/lldbsuite/test/functionalities/plugins/commands/TestPluginCommands.py
@@ -45,7 +45,7 @@ class PluginCommandTestCase(TestBase):
retobj = lldb.SBCommandReturnObject()
retval = debugger.GetCommandInterpreter().HandleCommand(
- "plugin load %s" % plugin_lib_name, retobj)
+ "plugin load %s" % self.getBuildArtifact(plugin_lib_name), retobj)
retobj.Clear()
diff --git a/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py b/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
index 9a5d320dce55..4a19a4e77607 100644
--- a/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
+++ b/packages/Python/lldbsuite/test/functionalities/plugins/python_os_plugin/TestPythonOSPlugin.py
@@ -44,9 +44,9 @@ class PluginPythonOSPlugin(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- cwd = os.getcwd()
- exe = os.path.join(cwd, "a.out")
- python_os_plugin_path = os.path.join(cwd, "operating_system.py")
+ exe = self.getBuildArtifact("a.out")
+ python_os_plugin_path = os.path.join(self.getSourceDir(),
+ "operating_system.py")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -128,9 +128,9 @@ class PluginPythonOSPlugin(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- cwd = os.getcwd()
- exe = os.path.join(cwd, "a.out")
- python_os_plugin_path = os.path.join(cwd, "operating_system2.py")
+ exe = self.getBuildArtifact("a.out")
+ python_os_plugin_path = os.path.join(self.getSourceDir(),
+ "operating_system2.py")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
index 63b93340cef3..879f1adebc6a 100644
--- a/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/elf-core/TestLinuxCore.py
@@ -40,73 +40,90 @@ class LinuxCoreTestCase(TestBase):
lldb.DBG.SetSelectedPlatform(self._initial_platform)
super(LinuxCoreTestCase, self).tearDown()
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_i386(self):
"""Test that lldb can read the process information from an i386 linux core file."""
- self.do_test("linux-i386", self._i386_pid, self._i386_regions)
+ self.do_test("linux-i386", self._i386_pid, self._i386_regions, "a.out")
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_o32(self):
"""Test that lldb can read the process information from an MIPS O32 linux core file."""
- self.do_test("linux-mipsel-gnuabio32", self._mips_o32_pid, self._mips_regions)
+ self.do_test("linux-mipsel-gnuabio32", self._mips_o32_pid,
+ self._mips_regions, "linux-mipsel-gn")
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_n32(self):
"""Test that lldb can read the process information from an MIPS N32 linux core file """
- self.do_test("linux-mips64el-gnuabin32", self._mips64_n32_pid, self._mips_regions)
+ self.do_test("linux-mips64el-gnuabin32", self._mips64_n32_pid,
+ self._mips_regions, "linux-mips64el-")
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ @skipIfLLVMTargetMissing("Mips")
def test_mips_n64(self):
"""Test that lldb can read the process information from an MIPS N64 linux core file """
- self.do_test("linux-mips64el-gnuabi64", self._mips64_n64_pid, self._mips_regions)
+ self.do_test("linux-mips64el-gnuabi64", self._mips64_n64_pid,
+ self._mips_regions, "linux-mips64el-")
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("PowerPC")
def test_ppc64le(self):
"""Test that lldb can read the process information from an ppc64le linux core file."""
- self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions)
+ self.do_test("linux-ppc64le", self._ppc64le_pid, self._ppc64le_regions,
+ "linux-ppc64le.ou")
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_x86_64(self):
"""Test that lldb can read the process information from an x86_64 linux core file."""
- self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions)
+ self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions,
+ "a.out")
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("SystemZ")
def test_s390x(self):
"""Test that lldb can read the process information from an s390x linux core file."""
- self.do_test("linux-s390x", self._s390x_pid, self._s390x_regions)
+ self.do_test("linux-s390x", self._s390x_pid, self._s390x_regions,
+ "a.out")
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_same_pid_running(self):
"""Test that we read the information from the core correctly even if we have a running
process with the same PID around"""
- try:
- shutil.copyfile("linux-x86_64.out", "linux-x86_64-pid.out")
- shutil.copyfile("linux-x86_64.core", "linux-x86_64-pid.core")
- with open("linux-x86_64-pid.core", "r+b") as f:
- # These are offsets into the NT_PRSTATUS and NT_PRPSINFO structures in the note
- # segment of the core file. If you update the file, these offsets may need updating
- # as well. (Notes can be viewed with readelf --notes.)
- for pid_offset in [0x1c4, 0x320]:
- f.seek(pid_offset)
- self.assertEqual(
- struct.unpack(
- "<I",
- f.read(4))[0],
- self._x86_64_pid)
-
- # We insert our own pid, and make sure the test still
- # works.
- f.seek(pid_offset)
- f.write(struct.pack("<I", os.getpid()))
- self.do_test("linux-x86_64-pid", os.getpid(), self._x86_64_regions)
- finally:
- self.RemoveTempFile("linux-x86_64-pid.out")
- self.RemoveTempFile("linux-x86_64-pid.core")
-
- @skipIf(oslist=['windows'])
+ exe_file = self.getBuildArtifact("linux-x86_64-pid.out")
+ core_file = self.getBuildArtifact("linux-x86_64-pid.core")
+ shutil.copyfile("linux-x86_64.out", exe_file)
+ shutil.copyfile("linux-x86_64.core", core_file)
+ with open(core_file, "r+b") as f:
+ # These are offsets into the NT_PRSTATUS and NT_PRPSINFO structures in the note
+ # segment of the core file. If you update the file, these offsets may need updating
+ # as well. (Notes can be viewed with readelf --notes.)
+ for pid_offset in [0x1c4, 0x320]:
+ f.seek(pid_offset)
+ self.assertEqual(
+ struct.unpack(
+ "<I",
+ f.read(4))[0],
+ self._x86_64_pid)
+
+ # We insert our own pid, and make sure the test still
+ # works.
+ f.seek(pid_offset)
+ f.write(struct.pack("<I", os.getpid()))
+ self.do_test(self.getBuildArtifact("linux-x86_64-pid"), os.getpid(),
+ self._x86_64_regions, "a.out")
+
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_two_cores_same_pid(self):
"""Test that we handle the situation if we have two core files with the same PID
around"""
@@ -132,10 +149,12 @@ class LinuxCoreTestCase(TestBase):
# without destroying this process, run the test which opens another core file with the
# same pid
- self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions)
+ self.do_test("linux-x86_64", self._x86_64_pid, self._x86_64_regions,
+ "a.out")
- @skipIf(oslist=['windows'])
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
@skipIf(triple='^mips')
+ @skipIfLLVMTargetMissing("X86")
def test_FPR_SSE(self):
# check x86_64 core file
target = self.dbg.CreateTarget(None)
@@ -280,7 +299,7 @@ class LinuxCoreTestCase(TestBase):
self.dbg.SetOutputFileHandle(None, False)
self.dbg.SetErrorFileHandle(None, False)
- def do_test(self, filename, pid, region_count):
+ def do_test(self, filename, pid, region_count, thread_name):
target = self.dbg.CreateTarget(filename + ".out")
process = target.LoadCore(filename + ".core")
self.assertTrue(process, PROCESS_IS_VALID)
@@ -292,6 +311,7 @@ class LinuxCoreTestCase(TestBase):
thread = process.GetSelectedThread()
self.assertTrue(thread)
self.assertEqual(thread.GetThreadID(), pid)
+ self.assertEqual(thread.GetName(), thread_name)
backtrace = ["bar", "foo", "_start"]
self.assertEqual(thread.GetNumFrames(), len(backtrace))
for i in range(len(backtrace)):
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py
new file mode 100644
index 000000000000..a299a4308bc8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/TestMachCore.py
@@ -0,0 +1,69 @@
+"""
+Test basics of mach core file debugging.
+"""
+
+from __future__ import print_function
+
+import shutil
+import struct
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class MachCoreTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ super(MachCoreTestCase, self).setUp()
+ self._initial_platform = lldb.DBG.GetSelectedPlatform()
+
+ def tearDown(self):
+ lldb.DBG.SetSelectedPlatform(self._initial_platform)
+ super(MachCoreTestCase, self).tearDown()
+
+ @expectedFailureAll(bugnumber="llvm.org/pr37371", hostoslist=["windows"])
+ def test_selected_thread(self):
+ """Test that the right thread is selected after a core is loaded."""
+ # Create core form YAML.
+ self.yaml2obj("test.core.yaml", self.getBuildArtifact("test.core"))
+
+ # Set debugger into synchronous mode
+ self.dbg.SetAsync(False)
+
+ # Create a target by the debugger.
+ target = self.dbg.CreateTarget("")
+
+ # Load OS plugin.
+ python_os_plugin_path = os.path.join(self.getSourceDir(),
+ 'operating_system.py')
+ command = "settings set target.process.python-os-plugin-path '{}'".format(
+ python_os_plugin_path)
+ self.dbg.HandleCommand(command)
+
+ # Load core.
+ process = target.LoadCore(self.getBuildArtifact("test.core"))
+ self.assertTrue(process, PROCESS_IS_VALID)
+ self.assertEqual(process.GetNumThreads(), 3)
+
+ # Verify our OS plug-in threads showed up
+ thread = process.GetThreadByID(0x111111111)
+ self.assertTrue(thread.IsValid(
+ ), "Make sure there is a thread 0x111111111 after we load the python OS plug-in"
+ )
+ thread = process.GetThreadByID(0x222222222)
+ self.assertTrue(thread.IsValid(
+ ), "Make sure there is a thread 0x222222222 after we load the python OS plug-in"
+ )
+ thread = process.GetThreadByID(0x333333333)
+ self.assertTrue(thread.IsValid(
+ ), "Make sure there is a thread 0x333333333 after we load the python OS plug-in"
+ )
+
+ # Verify that the correct thread is selected
+ thread = process.GetSelectedThread()
+ self.assertEqual(thread.GetThreadID(), 0x333333333)
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py
new file mode 100644
index 000000000000..de6c3b7dd56f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/operating_system.py
@@ -0,0 +1,45 @@
+import lldb
+import struct
+
+
+class OperatingSystemPlugIn(object):
+ """Class that provides data for an instance of a LLDB 'OperatingSystemPython' plug-in class"""
+
+ def __init__(self, process):
+ '''Initialization needs a valid.SBProcess object.
+
+ This plug-in will get created after a live process is valid and has stopped for the first time.
+ '''
+ self.process = None
+ self.registers = None
+ self.threads = None
+ if isinstance(process, lldb.SBProcess) and process.IsValid():
+ self.process = process
+ self.threads = None # Will be an dictionary containing info for each thread
+
+ def get_target(self):
+ return self.process.target
+
+ def get_thread_info(self):
+ if not self.threads:
+ self.threads = [{
+ 'tid': 0x111111111,
+ 'name': 'one',
+ 'queue': 'queue1',
+ 'state': 'stopped',
+ 'stop_reason': 'none'
+ }, {
+ 'tid': 0x222222222,
+ 'name': 'two',
+ 'queue': 'queue2',
+ 'state': 'stopped',
+ 'stop_reason': 'none'
+ }, {
+ 'tid': 0x333333333,
+ 'name': 'three',
+ 'queue': 'queue3',
+ 'state': 'stopped',
+ 'stop_reason': 'sigstop',
+ 'core': 0
+ }]
+ return self.threads
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml
new file mode 100644
index 000000000000..84ce54e45e1f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/mach-core/test.core.yaml
@@ -0,0 +1,853 @@
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x01000007
+ cpusubtype: 0x00000003
+ filetype: 0x00000004
+ ncmds: 59
+ sizeofcmds: 4384
+ flags: 0x00000000
+ reserved: 0x00000000
+LoadCommands:
+ - cmd: LC_THREAD
+ cmdsize: 208
+ PayloadBytes:
+ - 0x04
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x2A
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x01
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x80
+ - 0xF7
+ - 0xBF
+ - 0xEF
+ - 0xFE
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0x20
+ - 0xF6
+ - 0xBF
+ - 0xEF
+ - 0xFE
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0x01
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x10
+ - 0xF6
+ - 0xBF
+ - 0xEF
+ - 0xFE
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0xF0
+ - 0xF5
+ - 0xBF
+ - 0xEF
+ - 0xFE
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0xF0
+ - 0xF5
+ - 0xBF
+ - 0xEF
+ - 0xFE
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0xFF
+ - 0xFF
+ - 0xFF
+ - 0xFF
+ - 0xC8
+ - 0xB0
+ - 0x70
+ - 0xA7
+ - 0xFF
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0xD0
+ - 0xB0
+ - 0x70
+ - 0xA7
+ - 0xFF
+ - 0x7F
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0xA0
+ - 0x0F
+ - 0x00
+ - 0x00
+ - 0x01
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x46
+ - 0x02
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x2B
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x06
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x04
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x03
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x00
+ - 0x10
+ - 0x00
+ - 0x02
+ - 0xA7
+ - 0xFF
+ - 0x7F
+ - 0x00
+ - 0x00
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4294967296
+ vmsize: 4096
+ fileoff: 8192
+ filesize: 4096
+ maxprot: 5
+ initprot: 5
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4294971392
+ vmsize: 4096
+ fileoff: 12288
+ filesize: 4096
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4294975488
+ vmsize: 307200
+ fileoff: 16384
+ filesize: 307200
+ maxprot: 5
+ initprot: 5
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295282688
+ vmsize: 12288
+ fileoff: 323584
+ filesize: 12288
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295294976
+ vmsize: 217088
+ fileoff: 335872
+ filesize: 217088
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295512064
+ vmsize: 110592
+ fileoff: 552960
+ filesize: 110592
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295622656
+ vmsize: 8192
+ fileoff: 663552
+ filesize: 8192
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295630848
+ vmsize: 8192
+ fileoff: 671744
+ filesize: 8192
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295639040
+ vmsize: 4096
+ fileoff: 679936
+ filesize: 4096
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295643136
+ vmsize: 4096
+ fileoff: 684032
+ filesize: 4096
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295651328
+ vmsize: 24576
+ fileoff: 688128
+ filesize: 24576
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295684096
+ vmsize: 24576
+ fileoff: 712704
+ filesize: 24576
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295712768
+ vmsize: 4096
+ fileoff: 737280
+ filesize: 4096
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4295716864
+ vmsize: 8192
+ fileoff: 741376
+ filesize: 8192
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4296015872
+ vmsize: 1048576
+ fileoff: 749568
+ filesize: 1048576
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4297064448
+ vmsize: 1048576
+ fileoff: 1798144
+ filesize: 1048576
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4298113024
+ vmsize: 1048576
+ fileoff: 2846720
+ filesize: 1048576
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 4303355904
+ vmsize: 8388608
+ fileoff: 3895296
+ filesize: 8388608
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140732912369664
+ vmsize: 8388608
+ fileoff: 12283904
+ filesize: 8388608
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140734252867584
+ vmsize: 811999232
+ fileoff: 20672512
+ filesize: 811999232
+ maxprot: 5
+ initprot: 5
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735863480320
+ vmsize: 20553728
+ fileoff: 832671744
+ filesize: 20553728
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735884034048
+ vmsize: 2097152
+ fileoff: 853225472
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735886131200
+ vmsize: 2097152
+ fileoff: 855322624
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735888228352
+ vmsize: 2097152
+ fileoff: 857419776
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735890325504
+ vmsize: 2097152
+ fileoff: 859516928
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735892422656
+ vmsize: 2097152
+ fileoff: 861614080
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735894519808
+ vmsize: 2097152
+ fileoff: 863711232
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735896616960
+ vmsize: 2097152
+ fileoff: 865808384
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735898714112
+ vmsize: 2097152
+ fileoff: 867905536
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735900811264
+ vmsize: 2097152
+ fileoff: 870002688
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735902908416
+ vmsize: 10485760
+ fileoff: 872099840
+ filesize: 10485760
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735913394176
+ vmsize: 4194304
+ fileoff: 882585600
+ filesize: 4194304
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735917588480
+ vmsize: 2097152
+ fileoff: 886779904
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735919685632
+ vmsize: 2097152
+ fileoff: 888877056
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735921782784
+ vmsize: 4194304
+ fileoff: 890974208
+ filesize: 4194304
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735925977088
+ vmsize: 4194304
+ fileoff: 895168512
+ filesize: 4194304
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735930171392
+ vmsize: 6291456
+ fileoff: 899362816
+ filesize: 6291456
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735936462848
+ vmsize: 2097152
+ fileoff: 905654272
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735938560000
+ vmsize: 2097152
+ fileoff: 907751424
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735940657152
+ vmsize: 2097152
+ fileoff: 909848576
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735942754304
+ vmsize: 2097152
+ fileoff: 911945728
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735944851456
+ vmsize: 6291456
+ fileoff: 914042880
+ filesize: 6291456
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735951142912
+ vmsize: 2097152
+ fileoff: 920334336
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735953240064
+ vmsize: 4194304
+ fileoff: 922431488
+ filesize: 4194304
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735957434368
+ vmsize: 2097152
+ fileoff: 926625792
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735959531520
+ vmsize: 2097152
+ fileoff: 928722944
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735961628672
+ vmsize: 20971520
+ fileoff: 930820096
+ filesize: 20971520
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735982600192
+ vmsize: 6291456
+ fileoff: 951791616
+ filesize: 6291456
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735988891648
+ vmsize: 2097152
+ fileoff: 958083072
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735990988800
+ vmsize: 2097152
+ fileoff: 960180224
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735993085952
+ vmsize: 2097152
+ fileoff: 962277376
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735995183104
+ vmsize: 2097152
+ fileoff: 964374528
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735997280256
+ vmsize: 2097152
+ fileoff: 966471680
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140735999377408
+ vmsize: 2097152
+ fileoff: 968568832
+ filesize: 2097152
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140736001474560
+ vmsize: 1302528
+ fileoff: 970665984
+ filesize: 1302528
+ maxprot: 3
+ initprot: 3
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140736937222144
+ vmsize: 219267072
+ fileoff: 971968512
+ filesize: 219267072
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140737486258176
+ vmsize: 4096
+ fileoff: 1191235584
+ filesize: 4096
+ maxprot: 1
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: ''
+ vmaddr: 140737487028224
+ vmsize: 4096
+ fileoff: 1191239680
+ filesize: 4096
+ maxprot: 5
+ initprot: 5
+ nsects: 0
+ flags: 0
+...
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
index 4e587b92c1d2..5960215f8047 100644
--- a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump-new/TestMiniDumpNew.py
@@ -59,6 +59,24 @@ class MiniDumpNewTestCase(TestBase):
self.dbg.SetOutputFileHandle(None, False)
self.dbg.SetErrorFileHandle(None, False)
+ def test_loadcore_error_status(self):
+ """Test the SBTarget.LoadCore(core, error) overload."""
+ self.dbg.CreateTarget(None)
+ self.target = self.dbg.GetSelectedTarget()
+ error = lldb.SBError()
+ self.process = self.target.LoadCore("linux-x86_64.dmp", error)
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+ self.assertTrue(error.Success())
+
+ def test_loadcore_error_status_failure(self):
+ """Test the SBTarget.LoadCore(core, error) overload."""
+ self.dbg.CreateTarget(None)
+ self.target = self.dbg.GetSelectedTarget()
+ error = lldb.SBError()
+ self.process = self.target.LoadCore("non-existent.dmp", error)
+ self.assertFalse(self.process, PROCESS_IS_VALID)
+ self.assertTrue(error.Fail())
+
def test_process_info_in_minidump(self):
"""Test that lldb can read the process information from the Minidump."""
# target create -c linux-x86_64.dmp
@@ -70,6 +88,57 @@ class MiniDumpNewTestCase(TestBase):
self.assertEqual(self.process.GetProcessID(), self._linux_x86_64_pid)
self.check_state()
+ def test_modules_in_mini_dump(self):
+ """Test that lldb can read the list of modules from the minidump."""
+ # target create -c linux-x86_64.dmp
+ self.dbg.CreateTarget(None)
+ self.target = self.dbg.GetSelectedTarget()
+ self.process = self.target.LoadCore("linux-x86_64.dmp")
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+ expected_modules = [
+ {
+ 'filename' : 'linux-gate.so',
+ 'uuid' : '4EAD28F8-88EF-3520-872B-73C6F2FE7306-C41AF22F',
+ },
+ {
+ 'filename' : 'libm-2.19.so',
+ 'uuid' : 'D144258E-6149-00B2-55A3-1F3FD2283A87-8670D5BC',
+ },
+ {
+ 'filename' : 'libstdc++.so.6.0.19',
+ 'uuid' : '76190E92-2AF7-457D-078F-75C9B15FA184-E83EB506',
+ },
+ {
+ 'filename' : 'libc-2.19.so',
+ 'uuid' : 'CF699A15-CAAE-64F5-0311-FC4655B86DC3-9A479789',
+ },
+ {
+ 'filename' : 'linux-x86_64',
+ 'uuid' : 'E35C283B-C327-C287-62DB-788BF5A4078B-E2351448',
+ },
+ {
+ 'filename' : 'libgcc_s.so.1',
+ 'uuid' : '36311B44-5771-0AE5-578C-4BF00791DED7-359DBB92',
+ },
+ {
+ 'filename' : 'libpthread-2.19.so',
+ 'uuid' : '31E9F21A-E8C1-0396-171F-1E13DA157809-86FA696C',
+ },
+ {
+ 'filename' : 'ld-2.19.so',
+ 'uuid' : 'D0F53790-4076-D73F-29E4-A37341F8A449-E2EF6CD0',
+ },
+ {
+ 'filename' : 'libbreakpad.so',
+ 'uuid' : '784FD549-332D-826E-D23F-18C17C6F320A',
+ },
+ ]
+ self.assertEqual(self.target.GetNumModules(), len(expected_modules))
+ for module, expected in zip(self.target.modules, expected_modules):
+ self.assertTrue(module.IsValid())
+ self.assertEqual(module.file.basename, expected['filename'])
+ self.assertEqual(module.GetUUIDString(), expected['uuid'])
+
def test_thread_info_in_minidump(self):
"""Test that lldb can read the thread information from the Minidump."""
# target create -c linux-x86_64.dmp
@@ -100,6 +169,7 @@ class MiniDumpNewTestCase(TestBase):
self.assertEqual(thread.GetNumFrames(), 2)
frame = thread.GetFrameAtIndex(0)
self.assertTrue(frame.IsValid())
+ self.assertTrue(frame.GetModule().IsValid())
pc = frame.GetPC()
eip = frame.FindRegister("pc")
self.assertTrue(eip.IsValid())
@@ -162,32 +232,25 @@ class MiniDumpNewTestCase(TestBase):
def test_deeper_stack_in_minidump_with_same_pid_running(self):
"""Test that we read the information from the core correctly even if we
have a running process with the same PID"""
- try:
- self.do_change_pid_in_minidump("linux-x86_64_not_crashed.dmp",
- "linux-x86_64_not_crashed-pid.dmp",
- self._linux_x86_64_not_crashed_pid_offset,
- str(self._linux_x86_64_not_crashed_pid),
- str(os.getpid()))
- self.do_test_deeper_stack("linux-x86_64_not_crashed",
- "linux-x86_64_not_crashed-pid.dmp",
- os.getpid())
- finally:
- self.RemoveTempFile("linux-x86_64_not_crashed-pid.dmp")
+ new_core = self.getBuildArtifact("linux-x86_64_not_crashed-pid.dmp")
+ self.do_change_pid_in_minidump("linux-x86_64_not_crashed.dmp",
+ new_core,
+ self._linux_x86_64_not_crashed_pid_offset,
+ str(self._linux_x86_64_not_crashed_pid),
+ str(os.getpid()))
+ self.do_test_deeper_stack("linux-x86_64_not_crashed", new_core, os.getpid())
def test_two_cores_same_pid(self):
"""Test that we handle the situation if we have two core files with the same PID """
- try:
- self.do_change_pid_in_minidump("linux-x86_64_not_crashed.dmp",
- "linux-x86_64_not_crashed-pid.dmp",
- self._linux_x86_64_not_crashed_pid_offset,
- str(self._linux_x86_64_not_crashed_pid),
- str(self._linux_x86_64_pid))
- self.do_test_deeper_stack("linux-x86_64_not_crashed",
- "linux-x86_64_not_crashed-pid.dmp",
- self._linux_x86_64_pid)
- self.test_stack_info_in_minidump()
- finally:
- self.RemoveTempFile("linux-x86_64_not_crashed-pid.dmp")
+ new_core = self.getBuildArtifact("linux-x86_64_not_crashed-pid.dmp")
+ self.do_change_pid_in_minidump("linux-x86_64_not_crashed.dmp",
+ new_core,
+ self._linux_x86_64_not_crashed_pid_offset,
+ str(self._linux_x86_64_not_crashed_pid),
+ str(self._linux_x86_64_pid))
+ self.do_test_deeper_stack("linux-x86_64_not_crashed",
+ new_core, self._linux_x86_64_pid)
+ self.test_stack_info_in_minidump()
def test_local_variables_in_minidump(self):
"""Test that we can examine local variables in a Minidump."""
diff --git a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
index c7b64d783c71..61e2adee41d5 100644
--- a/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
+++ b/packages/Python/lldbsuite/test/functionalities/postmortem/minidump/TestMiniDump.py
@@ -41,6 +41,45 @@ class MiniDumpTestCase(TestBase):
stop_description = thread.GetStopDescription(256)
self.assertTrue("0xc0000005" in stop_description)
+ def test_modules_in_mini_dump(self):
+ """Test that lldb can read the list of modules from the minidump."""
+ # target create -c fizzbuzz_no_heap.dmp
+ self.dbg.CreateTarget("")
+ self.target = self.dbg.GetSelectedTarget()
+ self.process = self.target.LoadCore("fizzbuzz_no_heap.dmp")
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+ expected_modules = [
+ {
+ 'filename' : r"C:\Windows\System32/MSVCP120D.dll",
+ 'uuid' : '6E51053C-E757-EB40-8D3F-9722C5BD80DD-01000000',
+ },
+ {
+ 'filename' : r"C:\Windows\SysWOW64/kernel32.dll",
+ 'uuid' : '1B7ECBE5-5E00-1341-AB98-98D6913B52D8-02000000',
+ },
+ {
+ 'filename' : r"C:\Users\amccarth\Documents\Visual Studio 2013\Projects\fizzbuzz\Debug/fizzbuzz.exe",
+ 'uuid' : '91B7450F-969A-F946-BF8F-2D6076EA421A-11000000',
+ },
+ {
+ 'filename' : r"C:\Windows\System32/MSVCR120D.dll",
+ 'uuid' : '86FB8263-C446-4640-AE42-8D97B3F91FF2-01000000',
+ },
+ {
+ 'filename' : r"C:\Windows\SysWOW64/KERNELBASE.dll",
+ 'uuid' : '4152F90B-0DCB-D44B-AC5D-186A6452E522-01000000',
+ },
+ {
+ 'filename' : r"C:\Windows\SysWOW64/ntdll.dll",
+ 'uuid' : '6A84B0BB-2C40-5240-A16B-67650BBFE6B0-02000000',
+ },
+ ]
+ self.assertEqual(self.target.GetNumModules(), len(expected_modules))
+ for module, expected in zip(self.target.modules, expected_modules):
+ self.assertTrue(module.IsValid())
+ self.assertEqual(module.file.fullpath, expected['filename'])
+ self.assertEqual(module.GetUUIDString(), expected['uuid'])
+
@expectedFailureAll(bugnumber="llvm.org/pr35193", hostoslist=["windows"])
def test_stack_info_in_mini_dump(self):
"""Test that we can see a trivial stack in a VS-generate mini dump."""
@@ -58,13 +97,15 @@ class MiniDumpTestCase(TestBase):
frame = thread.GetFrameAtIndex(i)
self.assertTrue(frame.IsValid())
self.assertEqual(frame.GetPC(), pc_list[i])
+ self.assertTrue(frame.GetModule().IsValid())
@skipUnlessWindows # Minidump saving works only on windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_deeper_stack_in_mini_dump(self):
"""Test that we can examine a more interesting stack in a mini dump."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- core = os.path.join(os.getcwd(), "core.dmp")
+ exe = self.getBuildArtifact("a.out")
+ core = self.getBuildArtifact("core.dmp")
try:
# Set a breakpoint and capture a mini dump.
target = self.dbg.CreateTarget(exe)
@@ -96,11 +137,12 @@ class MiniDumpTestCase(TestBase):
os.unlink(core)
@skipUnlessWindows # Minidump saving works only on windows
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_local_variables_in_mini_dump(self):
"""Test that we can examine local variables in a mini dump."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- core = os.path.join(os.getcwd(), "core.dmp")
+ exe = self.getBuildArtifact("a.out")
+ core = self.getBuildArtifact("core.dmp")
try:
# Set a breakpoint and capture a mini dump.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile b/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile
index c4855ca9b12d..624a6e1584e4 100644
--- a/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/Makefile
@@ -3,6 +3,4 @@ LEVEL = ../../make
DYLIB_NAME := unlikely_name
DYLIB_CXX_SOURCES := foo.cpp
CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py b/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
index 258c3d3fbb9f..befb42186112 100644
--- a/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
+++ b/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
@@ -20,7 +20,7 @@ class TestPreRunLibraries(TestBase):
"""Test that we find directly linked dylib pre-run."""
self.build()
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# I don't know what the name of a shared library
diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py b/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
index c4d372cd3d30..617b4bcfaec3 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
+++ b/packages/Python/lldbsuite/test/functionalities/process_attach/TestProcessAttach.py
@@ -27,7 +27,7 @@ class ProcessAttachTestCase(TestBase):
def test_attach_to_process_by_id(self):
"""Test attach by process id"""
self.build()
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Spawn a new process
popen = self.spawnSubprocess(exe)
@@ -43,13 +43,13 @@ class ProcessAttachTestCase(TestBase):
@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_attach_to_process_from_different_dir_by_id(self):
"""Test attach by process id"""
+ newdir = self.getBuildArtifact("newdir")
try:
- os.mkdir(os.path.join(os.getcwd(),'newdir'))
- except OSError, e:
+ os.mkdir(newdir)
+ except OSError as e:
if e.errno != os.errno.EEXIST:
raise
- testdir = os.getcwd()
- newdir = os.path.join(testdir,'newdir')
+ testdir = self.getBuildDir()
exe = os.path.join(newdir, 'proc_attach')
self.buildProgram('main.cpp', exe)
self.addTearDownHook(lambda: shutil.rmtree(newdir))
@@ -58,7 +58,7 @@ class ProcessAttachTestCase(TestBase):
popen = self.spawnSubprocess(exe)
self.addTearDownHook(self.cleanupSubprocesses)
- os.chdir('newdir')
+ os.chdir(newdir)
self.addTearDownHook(lambda: os.chdir(testdir))
self.runCmd("process attach -p " + str(popen.pid))
@@ -71,7 +71,7 @@ class ProcessAttachTestCase(TestBase):
def test_attach_to_process_by_name(self):
"""Test attach by process name"""
self.build()
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Spawn a new process
popen = self.spawnSubprocess(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/Makefile b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/Makefile
index 87600bbccf9d..3c1f73515eb7 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/Makefile
@@ -4,4 +4,11 @@ CXX_SOURCES := main.cpp
EXE := AttachDenied
+all: AttachDenied sign
+
include $(LEVEL)/Makefile.rules
+
+sign: entitlements.plist AttachDenied
+ifeq ($(OS),Darwin)
+ codesign -s - -f --entitlements $^
+endif
diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
index 5465b7155f50..b915b541fb4b 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
+++ b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/TestAttachDenied.py
@@ -18,6 +18,7 @@ exe_name = 'AttachDenied' # Must match Makefile
class AttachDeniedTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@skipIfWindows
@skipIfiOSSimulator
@@ -25,10 +26,10 @@ class AttachDeniedTestCase(TestBase):
def test_attach_to_process_by_id_denied(self):
"""Test attach by process id denied"""
self.build()
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Use a file as a synchronization point between test and inferior.
- pid_file_path = lldbutil.append_to_process_working_directory(
+ pid_file_path = lldbutil.append_to_process_working_directory(self,
"pid_file_%d" % (int(time.time())))
self.addTearDownHook(
lambda: self.run_platform_command(
diff --git a/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/entitlements.plist b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/entitlements.plist
new file mode 100644
index 000000000000..3d60e8bd0b94
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/process_attach/attach_denied/entitlements.plist
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.cs.debugger</key>
+ <true/>
+</dict>
+</plist>
diff --git a/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py b/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
index 91436446ad99..8496ce6c04d7 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
+++ b/packages/Python/lldbsuite/test/functionalities/process_group/TestChangeProcessGroup.py
@@ -13,6 +13,7 @@ from lldbsuite.test import lldbutil
class ChangeProcessGroupTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
@@ -26,10 +27,10 @@ class ChangeProcessGroupTestCase(TestBase):
@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_setpgid(self):
self.build()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
# Use a file as a synchronization point between test and inferior.
- pid_file_path = lldbutil.append_to_process_working_directory(
+ pid_file_path = lldbutil.append_to_process_working_directory(self,
"pid_file_%d" % (int(time.time())))
self.addTearDownHook(
lambda: self.run_platform_command(
diff --git a/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py b/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
index 5929a352b615..9d1cac90d856 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
+++ b/packages/Python/lldbsuite/test/functionalities/process_launch/TestProcessLaunch.py
@@ -19,6 +19,7 @@ import six
class ProcessLaunchTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
@@ -33,13 +34,13 @@ class ProcessLaunchTestCase(TestBase):
def test_io(self):
"""Test that process launch I/O redirection flags work properly."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe,
patterns=["Current executable set to .*a.out"])
- in_file = "input-file.txt"
- out_file = "output-test.out"
- err_file = "output-test.err"
+ in_file = os.path.join(self.getSourceDir(), "input-file.txt")
+ out_file = lldbutil.append_to_process_working_directory(self, "output-test.out")
+ err_file = lldbutil.append_to_process_working_directory(self, "output-test.err")
# Make sure the output files do not exist before launching the process
try:
@@ -52,8 +53,8 @@ class ProcessLaunchTestCase(TestBase):
except OSError:
pass
- launch_command = "process launch -i " + \
- in_file + " -o " + out_file + " -e " + err_file
+ launch_command = "process launch -i '{0}' -o '{1}' -e '{2}' -w '{3}'".format(
+ in_file, out_file, err_file, self.get_process_working_directory())
if lldb.remote_platform:
self.runCmd('platform put-file "{local}" "{remote}"'.format(
@@ -62,55 +63,19 @@ class ProcessLaunchTestCase(TestBase):
self.expect(launch_command,
patterns=["Process .* launched: .*a.out"])
- if lldb.remote_platform:
- self.runCmd('platform get-file "{remote}" "{local}"'.format(
- remote=out_file, local=out_file))
- self.runCmd('platform get-file "{remote}" "{local}"'.format(
- remote=err_file, local=err_file))
-
success = True
err_msg = ""
- # Check to see if the 'stdout' file was created
- try:
- out_f = open(out_file)
- except IOError:
+ out = lldbutil.read_file_on_target(self, out_file)
+ if out != "This should go to stdout.\n":
success = False
- err_msg = err_msg + " ERROR: stdout file was not created.\n"
- else:
- # Check to see if the 'stdout' file contains the right output
- line = out_f.readline()
- if line != "This should go to stdout.\n":
- success = False
- err_msg = err_msg + " ERROR: stdout file does not contain correct output.\n"
- out_f.close()
+ err_msg = err_msg + " ERROR: stdout file does not contain correct output.\n"
- # Try to delete the 'stdout' file
- try:
- os.remove(out_file)
- except OSError:
- pass
- # Check to see if the 'stderr' file was created
- try:
- err_f = open(err_file)
- except IOError:
+ err = lldbutil.read_file_on_target(self, err_file)
+ if err != "This should go to stderr.\n":
success = False
- err_msg = err_msg + " ERROR: stderr file was not created.\n"
- else:
- # Check to see if the 'stderr' file contains the right output
- line = err_f.readline()
- if line != "This should go to stderr.\n":
- success = False
- err_msg = err_msg + " ERROR: stderr file does not contain correct output.\n\
-"
- err_f.close()
-
- # Try to delete the 'stderr' file
- try:
- os.remove(err_file)
- except OSError:
- pass
+ err_msg = err_msg + " ERROR: stderr file does not contain correct output.\n"
if not success:
self.fail(err_msg)
@@ -120,19 +85,47 @@ class ProcessLaunchTestCase(TestBase):
# not working?
@not_remote_testsuite_ready
@expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20265")
- def test_set_working_dir(self):
+ def test_set_working_dir_nonexisting(self):
+ """Test that '-w dir' fails to set the working dir when running the inferior with a dir which doesn't exist."""
+ d = {'CXX_SOURCES': 'print_cwd.cpp'}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(d)
+ exe = self.getBuildArtifact("a.out")
+ self.runCmd("file " + exe)
+
+ mywd = 'my_working_dir'
+ out_file_name = "my_working_dir_test.out"
+ err_file_name = "my_working_dir_test.err"
+
+ my_working_dir_path = self.getBuildArtifact(mywd)
+ out_file_path = os.path.join(my_working_dir_path, out_file_name)
+ err_file_path = os.path.join(my_working_dir_path, err_file_name)
+
+ # Check that we get an error when we have a nonexisting path
+ invalid_dir_path = mywd + 'z'
+ launch_command = "process launch -w %s -o %s -e %s" % (
+ invalid_dir_path, out_file_path, err_file_path)
+
+ self.expect(
+ launch_command, error=True, patterns=[
+ "error:.* No such file or directory: %s" %
+ invalid_dir_path])
+
+ @not_remote_testsuite_ready
+ def test_set_working_dir_existing(self):
"""Test that '-w dir' sets the working dir when running the inferior."""
d = {'CXX_SOURCES': 'print_cwd.cpp'}
self.build(dictionary=d)
self.setTearDownCleanup(d)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe)
mywd = 'my_working_dir'
out_file_name = "my_working_dir_test.out"
err_file_name = "my_working_dir_test.err"
- my_working_dir_path = os.path.join(os.getcwd(), mywd)
+ my_working_dir_path = self.getBuildArtifact(mywd)
+ lldbutil.mkdir_p(my_working_dir_path)
out_file_path = os.path.join(my_working_dir_path, out_file_name)
err_file_path = os.path.join(my_working_dir_path, err_file_name)
@@ -143,16 +136,6 @@ class ProcessLaunchTestCase(TestBase):
except OSError:
pass
- # Check that we get an error when we have a nonexisting path
- launch_command = "process launch -w %s -o %s -e %s" % (
- my_working_dir_path + 'z', out_file_path, err_file_path)
-
- self.expect(
- launch_command, error=True, patterns=[
- "error:.* No such file or directory: %sz" %
- my_working_dir_path])
-
- # Really launch the process
launch_command = "process launch -w %s -o %s -e %s" % (
my_working_dir_path, out_file_path, err_file_path)
@@ -195,7 +178,7 @@ class ProcessLaunchTestCase(TestBase):
d = {'CXX_SOURCES': source}
self.build(dictionary=d)
self.setTearDownCleanup(d)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
evil_var = 'INIT*MIDDLE}TAIL'
diff --git a/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py b/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
index ee1f82b14f7b..55dbc4223711 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
+++ b/packages/Python/lldbsuite/test/functionalities/process_save_core/TestProcessSaveCore.py
@@ -21,8 +21,8 @@ class ProcessSaveCoreTestCase(TestBase):
def test_cannot_save_core_unless_process_stopped(self):
"""Test that SaveCore fails if the process isn't stopped."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- core = os.path.join(os.getcwd(), "core.dmp")
+ exe = self.getBuildArtifact("a.out")
+ core = self.getBuildArtifact("core.dmp")
target = self.dbg.CreateTarget(exe)
process = target.LaunchSimple(
None, None, self.get_process_working_directory())
@@ -35,8 +35,8 @@ class ProcessSaveCoreTestCase(TestBase):
def test_save_windows_mini_dump(self):
"""Test that we can save a Windows mini dump."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- core = os.path.join(os.getcwd(), "core.dmp")
+ exe = self.getBuildArtifact("a.out")
+ core = self.getBuildArtifact("core.dmp")
try:
target = self.dbg.CreateTarget(exe)
breakpoint = target.BreakpointCreateByName("bar")
diff --git a/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py b/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
index 5085b8cce99a..80ace219aeb1 100644
--- a/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
+++ b/packages/Python/lldbsuite/test/functionalities/ptr_refs/TestPtrRefs.py
@@ -19,8 +19,7 @@ class TestPtrRefs(TestBase):
def test_ptr_refs(self):
"""Test format string functionality."""
self.build()
- exe_name = 'a.out'
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py b/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
index 5b72d383f141..569ecd249b21 100644
--- a/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
+++ b/packages/Python/lldbsuite/test/functionalities/recursion/TestValueObjectRecursion.py
@@ -25,7 +25,7 @@ class ValueObjectRecursionTestCase(TestBase):
def test_with_run_command(self):
"""Test that deeply nested ValueObjects still work."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
index 6dccaa55a103..d362e6a8ae3d 100644
--- a/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
+++ b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestYMMRegister.py
@@ -21,11 +21,13 @@ class TestYMMRegister(TestBase):
@skipIfiOSSimulator
@skipIfTargetAndroid()
@skipIf(archs=no_match(['i386', 'x86_64']))
+ @expectedFailureAll(oslist=["linux"], bugnumber="rdar://30523153")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
def test(self):
- self.build()
+ self.build(dictionary={"CFLAGS_EXTRAS": "-march=haswell"})
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -56,9 +58,10 @@ class TestYMMRegister(TestBase):
else:
register_range = 8
for i in range(register_range):
+ j = i - ((i / 8) * 8)
self.runCmd("thread step-inst")
- register_byte = (byte_pattern1 | i)
+ register_byte = (byte_pattern1 | j)
pattern = "ymm" + str(i) + " = " + str('{') + (
str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}')
@@ -66,7 +69,7 @@ class TestYMMRegister(TestBase):
"register read ymm" + str(i),
substrs=[pattern])
- register_byte = (byte_pattern2 | i)
+ register_byte = (byte_pattern2 | j)
pattern = "ymm" + str(i) + " = " + str('{') + (
str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}')
diff --git a/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py
new file mode 100644
index 000000000000..823e40155ff5
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/TestZMMRegister.py
@@ -0,0 +1,126 @@
+"""
+Test that we correctly read the YMM registers.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestYMMRegister(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ @skipUnlessDarwin
+ @skipIfiOSSimulator
+ @skipIf(archs=no_match(['i386', 'x86_64']))
+ @debugserver_test
+ @skipUnlessFeature('hw.optional.avx512f')
+ def test(self):
+ self.build(dictionary={"CFLAGS_EXTRAS": "-mavx512f"})
+ self.setTearDownCleanup()
+
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
+
+ self.assertTrue(target, VALID_TARGET)
+
+ byte_pattern1 = 0x80
+ byte_pattern2 = 0xFF
+
+ # This test is working with assembly instructions; it'll make
+ # it easier to debug the console output if the assembly is
+ # displayed.
+ self.runCmd("settings set stop-disassembly-display always")
+
+ # Launch the process and stop.
+ self.expect("run", PROCESS_STOPPED, substrs=['stopped'])
+
+ # Check stop reason; Should be either signal SIGTRAP or EXC_BREAKPOINT
+ output = self.res.GetOutput()
+ matched = False
+ substrs = [
+ 'stop reason = EXC_BREAKPOINT',
+ 'stop reason = signal SIGTRAP']
+ for str1 in substrs:
+ matched = output.find(str1) != -1
+ with recording(self, False) as sbuf:
+ print("%s sub string: %s" % ('Expecting', str1), file=sbuf)
+ print("Matched" if matched else "Not Matched", file=sbuf)
+ if matched:
+ break
+ self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)
+
+ if self.getArchitecture() == 'x86_64':
+ register_range = 16
+ else:
+ register_range = 8
+ for i in range(register_range):
+ j = i - ((i / 8) * 8)
+ self.runCmd("thread step-inst")
+
+ register_byte = (byte_pattern1 | j)
+ pattern = "ymm" + str(i) + " = " + str('{') + (
+ str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}')
+
+ self.expect(
+ "register read ymm" + str(i),
+ substrs=[pattern])
+
+ register_byte = (byte_pattern2 | j)
+ pattern = "ymm" + str(i) + " = " + str('{') + (
+ str(hex(register_byte)) + ' ') * 31 + str(hex(register_byte)) + str('}')
+
+ self.runCmd("thread step-inst")
+ self.expect(
+ "register read ymm" + str(i),
+ substrs=[pattern])
+
+ self.expect("continue", PROCESS_STOPPED, substrs=['stopped'])
+
+ # Check stop reason; Should be either signal SIGTRAP or EXC_BREAKPOINT
+ output = self.res.GetOutput()
+ matched = False
+ substrs = [
+ 'stop reason = EXC_BREAKPOINT',
+ 'stop reason = signal SIGTRAP']
+ for str1 in substrs:
+ matched = output.find(str1) != -1
+ with recording(self, False) as sbuf:
+ print("%s sub string: %s" % ('Expecting', str1), file=sbuf)
+ print("Matched" if matched else "Not Matched", file=sbuf)
+ if matched:
+ break
+ self.assertTrue(matched, STOPPED_DUE_TO_SIGNAL)
+
+ if self.getArchitecture() == 'x86_64':
+ register_range = 32
+ else:
+ register_range = 8
+ for i in range(register_range):
+ j = i - ((i / 8) * 8)
+ self.runCmd("thread step-inst")
+ self.runCmd("thread step-inst")
+
+ register_byte = (byte_pattern2 | j)
+ pattern = "zmm" + str(i) + " = " + str('{') + (
+ str(hex(register_byte)) + ' ') * 63 + str(hex(register_byte)) + str('}')
+
+ self.expect(
+ "register read zmm" + str(i),
+ substrs=[pattern])
+
+ register_byte = (byte_pattern2 | j)
+ pattern = "zmm" + str(i) + " = " + str('{') + (
+ str(hex(register_byte)) + ' ') * 63 + str(hex(register_byte)) + str('}')
+
+ self.runCmd("thread step-inst")
+ self.expect(
+ "register read zmm" + str(i),
+ substrs=[pattern])
diff --git a/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c
index 4cfb2239c06f..671331fe450f 100644
--- a/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c
+++ b/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c
@@ -9,15 +9,14 @@
void func() {
unsigned int ymmvalues[16];
- unsigned char val;
- unsigned char i;
- for (i = 0 ; i < 16 ; i++)
+ for (int i = 0 ; i < 16 ; i++)
{
- val = (0x80 | i);
+ unsigned char val = (0x80 | i);
ymmvalues[i] = (val << 24) | (val << 16) | (val << 8) | val;
}
unsigned int ymmallones = 0xFFFFFFFF;
+#if defined(__AVX__)
__asm__("int3;"
"vbroadcastss %1, %%ymm0;"
"vbroadcastss %0, %%ymm0;"
@@ -36,32 +35,109 @@ void func() {
"vbroadcastss %8, %%ymm7;"
"vbroadcastss %0, %%ymm7;"
#if defined(__x86_64__)
- "vbroadcastss %9, %%ymm8;"
+ "vbroadcastss %1, %%ymm8;"
"vbroadcastss %0, %%ymm8;"
- "vbroadcastss %10, %%ymm9;"
+ "vbroadcastss %2, %%ymm9;"
"vbroadcastss %0, %%ymm9;"
- "vbroadcastss %11, %%ymm10;"
+ "vbroadcastss %3, %%ymm10;"
"vbroadcastss %0, %%ymm10;"
- "vbroadcastss %12, %%ymm11;"
+ "vbroadcastss %4, %%ymm11;"
"vbroadcastss %0, %%ymm11;"
- "vbroadcastss %13, %%ymm12;"
+ "vbroadcastss %5, %%ymm12;"
"vbroadcastss %0, %%ymm12;"
- "vbroadcastss %14, %%ymm13;"
+ "vbroadcastss %6, %%ymm13;"
"vbroadcastss %0, %%ymm13;"
- "vbroadcastss %15, %%ymm14;"
+ "vbroadcastss %7, %%ymm14;"
"vbroadcastss %0, %%ymm14;"
- "vbroadcastss %16, %%ymm15;"
+ "vbroadcastss %8, %%ymm15;"
"vbroadcastss %0, %%ymm15;"
#endif
::"m"(ymmallones),
"m"(ymmvalues[0]), "m"(ymmvalues[1]), "m"(ymmvalues[2]), "m"(ymmvalues[3]),
"m"(ymmvalues[4]), "m"(ymmvalues[5]), "m"(ymmvalues[6]), "m"(ymmvalues[7])
+ );
+#endif
+
+#if defined(__AVX512F__)
+ unsigned int zmmvalues[32];
+ for (int i = 0 ; i < 32 ; i++)
+ {
+ unsigned char val = (0x80 | i);
+ zmmvalues[i] = (val << 24) | (val << 16) | (val << 8) | val;
+ }
+
+ __asm__("int3;"
+ "vbroadcastss %1, %%zmm0;"
+ "vbroadcastss %0, %%zmm0;"
+ "vbroadcastss %2, %%zmm1;"
+ "vbroadcastss %0, %%zmm1;"
+ "vbroadcastss %3, %%zmm2;"
+ "vbroadcastss %0, %%zmm2;"
+ "vbroadcastss %4, %%zmm3;"
+ "vbroadcastss %0, %%zmm3;"
+ "vbroadcastss %5, %%zmm4;"
+ "vbroadcastss %0, %%zmm4;"
+ "vbroadcastss %6, %%zmm5;"
+ "vbroadcastss %0, %%zmm5;"
+ "vbroadcastss %7, %%zmm6;"
+ "vbroadcastss %0, %%zmm6;"
+ "vbroadcastss %8, %%zmm7;"
+ "vbroadcastss %0, %%zmm7;"
#if defined(__x86_64__)
- ,
- "m"(ymmvalues[8]), "m"(ymmvalues[9]), "m"(ymmvalues[10]), "m"(ymmvalues[11]),
- "m"(ymmvalues[12]), "m"(ymmvalues[13]), "m"(ymmvalues[14]), "m"(ymmvalues[15])
+ "vbroadcastss %1, %%zmm8;"
+ "vbroadcastss %0, %%zmm8;"
+ "vbroadcastss %2, %%zmm9;"
+ "vbroadcastss %0, %%zmm9;"
+ "vbroadcastss %3, %%zmm10;"
+ "vbroadcastss %0, %%zmm10;"
+ "vbroadcastss %4, %%zmm11;"
+ "vbroadcastss %0, %%zmm11;"
+ "vbroadcastss %5, %%zmm12;"
+ "vbroadcastss %0, %%zmm12;"
+ "vbroadcastss %6, %%zmm13;"
+ "vbroadcastss %0, %%zmm13;"
+ "vbroadcastss %7, %%zmm14;"
+ "vbroadcastss %0, %%zmm14;"
+ "vbroadcastss %8, %%zmm15;"
+ "vbroadcastss %0, %%zmm15;"
+ "vbroadcastss %1, %%zmm16;"
+ "vbroadcastss %0, %%zmm16;"
+ "vbroadcastss %2, %%zmm17;"
+ "vbroadcastss %0, %%zmm17;"
+ "vbroadcastss %3, %%zmm18;"
+ "vbroadcastss %0, %%zmm18;"
+ "vbroadcastss %4, %%zmm19;"
+ "vbroadcastss %0, %%zmm19;"
+ "vbroadcastss %5, %%zmm20;"
+ "vbroadcastss %0, %%zmm20;"
+ "vbroadcastss %6, %%zmm21;"
+ "vbroadcastss %0, %%zmm21;"
+ "vbroadcastss %7, %%zmm22;"
+ "vbroadcastss %0, %%zmm22;"
+ "vbroadcastss %8, %%zmm23;"
+ "vbroadcastss %0, %%zmm23;"
+ "vbroadcastss %1, %%zmm24;"
+ "vbroadcastss %0, %%zmm24;"
+ "vbroadcastss %2, %%zmm25;"
+ "vbroadcastss %0, %%zmm25;"
+ "vbroadcastss %3, %%zmm26;"
+ "vbroadcastss %0, %%zmm26;"
+ "vbroadcastss %4, %%zmm27;"
+ "vbroadcastss %0, %%zmm27;"
+ "vbroadcastss %5, %%zmm28;"
+ "vbroadcastss %0, %%zmm28;"
+ "vbroadcastss %6, %%zmm29;"
+ "vbroadcastss %0, %%zmm29;"
+ "vbroadcastss %7, %%zmm30;"
+ "vbroadcastss %0, %%zmm30;"
+ "vbroadcastss %8, %%zmm31;"
+ "vbroadcastss %0, %%zmm31;"
+#endif
+ ::"m"(ymmallones),
+ "m"(zmmvalues[0]), "m"(zmmvalues[1]), "m"(zmmvalues[2]), "m"(zmmvalues[3]),
+ "m"(zmmvalues[4]), "m"(zmmvalues[5]), "m"(zmmvalues[6]), "m"(zmmvalues[7])
+ );
#endif
- );
}
int main(int argc, char const *argv[]) { func(); }
diff --git a/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py b/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
index 96f3655542c8..00802ff89505 100644
--- a/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
+++ b/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/TestMPXRegisters.py
@@ -35,7 +35,7 @@ class RegisterCommandsTestCase(TestBase):
"""Test Intel(R) MPX registers after running example code."""
self.line = line_number('main.cpp', '// Set a break point here.')
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line, num_expected_locations=1)
diff --git a/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py b/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
index 45721dd260d9..2fd2dab0184c 100644
--- a/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
+++ b/packages/Python/lldbsuite/test/functionalities/register/intel_xtended_registers/mpx_bound_violation/TestBoundViolation.py
@@ -29,7 +29,7 @@ class RegisterCommandsTestCase(TestBase):
self.mpx_boundary_violation()
def mpx_boundary_violation(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("run", RUN_SUCCEEDED)
diff --git a/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py b/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
index 83cc48847c99..41e566438724 100644
--- a/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ b/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -59,6 +59,7 @@ class RegisterCommandsTestCase(TestBase):
# problem
@skipIfTargetAndroid(archs=["i386"])
@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
def test_fp_register_write(self):
"""Test commands that write to registers, in particular floating-point registers."""
self.build()
@@ -69,6 +70,8 @@ class RegisterCommandsTestCase(TestBase):
@expectedFailureAndroid(archs=["i386"])
@skipIfFreeBSD # llvm.org/pr25057
@skipIf(archs=no_match(['amd64', 'i386', 'x86_64']))
+ @skipIfOutOfTreeDebugserver
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
def test_fp_special_purpose_register_read(self):
"""Test commands that read fpu special purpose registers."""
self.build()
@@ -76,6 +79,7 @@ class RegisterCommandsTestCase(TestBase):
@skipIfiOSSimulator
@skipIf(archs=no_match(['amd64', 'arm', 'i386', 'x86_64']))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37683")
def test_register_expressions(self):
"""Test expression evaluation with commands related to registers."""
self.build()
@@ -104,6 +108,7 @@ class RegisterCommandsTestCase(TestBase):
@skipIfiOSSimulator
@skipIf(archs=no_match(['amd64', 'x86_64']))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37683")
def test_convenience_registers(self):
"""Test convenience registers."""
self.build()
@@ -111,6 +116,7 @@ class RegisterCommandsTestCase(TestBase):
@skipIfiOSSimulator
@skipIf(archs=no_match(['amd64', 'x86_64']))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37683")
def test_convenience_registers_with_process_attach(self):
"""Test convenience registers after a 'process attach'."""
self.build()
@@ -118,13 +124,14 @@ class RegisterCommandsTestCase(TestBase):
@skipIfiOSSimulator
@skipIf(archs=no_match(['amd64', 'x86_64']))
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37683")
def test_convenience_registers_16bit_with_process_attach(self):
"""Test convenience registers after a 'process attach'."""
self.build()
self.convenience_registers_with_process_attach(test_16bit_regs=True)
def common_setup(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
@@ -149,7 +156,7 @@ class RegisterCommandsTestCase(TestBase):
self.platform = "posix"
if self.platform != "":
- self.log_file = os.path.join(os.getcwd(), 'TestRegisters.log')
+ self.log_file = self.getBuildArtifact('TestRegisters.log')
self.runCmd(
"log enable " +
self.platform +
@@ -185,7 +192,7 @@ class RegisterCommandsTestCase(TestBase):
new_value])
def fp_special_purpose_register_read(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -266,7 +273,7 @@ class RegisterCommandsTestCase(TestBase):
1 << fstat_top_pointer_initial)
def fp_register_write(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -371,6 +378,8 @@ class RegisterCommandsTestCase(TestBase):
self.write_and_read(currentFrame, reg, val, must)
if self.getArchitecture() in ['amd64', 'i386', 'x86_64']:
+ if st0regname is None:
+ self.fail("st0regname could not be determined")
self.runCmd(
"register write " +
st0regname +
@@ -441,7 +450,7 @@ class RegisterCommandsTestCase(TestBase):
def convenience_registers_with_process_attach(self, test_16bit_regs):
"""Test convenience registers after a 'process attach'."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Spawn a new process
pid = self.spawnSubprocess(exe, ['wait_for_attach']).pid
diff --git a/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py b/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
index 20d64b38f0ca..044d3d25b724 100644
--- a/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
+++ b/packages/Python/lldbsuite/test/functionalities/rerun/TestRerun.py
@@ -18,7 +18,7 @@ class TestRerun(TestBase):
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("target create %s" % exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py b/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
index 606a71ff5019..b7d0d8170b3b 100644
--- a/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
+++ b/packages/Python/lldbsuite/test/functionalities/return-value/TestReturnValue.py
@@ -40,28 +40,10 @@ class ReturnValueTestCase(TestBase):
def test_with_python(self):
"""Test getting return values from stepping out."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- error = lldb.SBError()
-
- self.target = self.dbg.CreateTarget(exe)
- self.assertTrue(self.target, VALID_TARGET)
-
- inner_sint_bkpt = self.target.BreakpointCreateByName("inner_sint", exe)
- self.assertTrue(inner_sint_bkpt, VALID_BREAKPOINT)
-
- # Now launch the process, and do not stop at entry point.
- self.process = self.target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(self.process, PROCESS_IS_VALID)
+ exe = self.getBuildArtifact("a.out")
+ (self.target, self.process, thread, inner_sint_bkpt) = lldbutil.run_to_name_breakpoint(self, "inner_sint", exe_name = exe)
- # The stop reason of the thread should be breakpoint.
- self.assertTrue(self.process.GetState() == lldb.eStateStopped,
- STOPPED_DUE_TO_BREAKPOINT)
-
- # Now finish, and make sure the return value is correct.
- thread = lldbutil.get_stopped_thread(
- self.process, lldb.eStopReasonBreakpoint)
+ error = lldb.SBError()
# inner_sint returns the variable value, so capture that here:
in_int = thread.GetFrameAtIndex(0).FindVariable(
@@ -86,10 +68,8 @@ class ReturnValueTestCase(TestBase):
# Run again and we will stop in inner_sint the second time outer_sint is called.
# Then test stepping out two frames at once:
-
- self.process.Continue()
- thread_list = lldbutil.get_threads_stopped_at_breakpoint(
- self.process, inner_sint_bkpt)
+
+ thread_list = lldbutil.continue_to_breakpoint(self.process, inner_sint_bkpt)
self.assertTrue(len(thread_list) == 1)
thread = thread_list[0]
@@ -189,7 +169,7 @@ class ReturnValueTestCase(TestBase):
@skipIfDarwinEmbedded # <rdar://problem/33976032> ABIMacOSX_arm64 doesn't get structs this big correctly
def test_vector_values(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
self.target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py b/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
index 2fc31a4e78ae..6e4dbf40e467 100644
--- a/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
+++ b/packages/Python/lldbsuite/test/functionalities/set-data/TestSetData.py
@@ -21,7 +21,7 @@ class SetDataTestCase(TestBase):
def test_set_data(self):
"""Test setting the contents of variables and registers using raw data."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("br s -p First")
diff --git a/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py b/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
index 0a2756d87fbe..316233b909e7 100644
--- a/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/signal/TestSendSignal.py
@@ -29,7 +29,7 @@ class SendSignalTestCase(TestBase):
def test_with_run_command(self):
"""Test that lldb command 'process signal SIGUSR1' sends a signal to the inferior process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py b/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
index 97de99640f50..1ebab8837b92 100644
--- a/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
+++ b/packages/Python/lldbsuite/test/functionalities/signal/handle-segv/TestHandleSegv.py
@@ -20,7 +20,7 @@ class HandleSegvTestCase(TestBase):
@skipIfDarwin
def test_inferior_handle_sigsegv(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py b/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
index 79175562fe7a..dfc54a639ea0 100644
--- a/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
+++ b/packages/Python/lldbsuite/test/functionalities/signal/raise/TestRaise.py
@@ -58,7 +58,7 @@ class RaiseTestCase(TestBase):
def signal_test(self, signal, test_passing):
"""Test that we handle inferior raising signals"""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -188,92 +188,3 @@ class RaiseTestCase(TestBase):
# reset signal handling to default
self.set_handle(signal, default_pass, default_stop, default_notify)
-
- @expectedFailureAll(
- oslist=["linux"] +
- getDarwinOSTriples(),
- bugnumber="llvm.org/pr20231")
- def test_restart_bug(self):
- """Test that we catch a signal in the edge case where the process receives it while we are
- about to interrupt it"""
- self.build()
- exe = os.path.join(os.getcwd(), "a.out")
-
- # Create a target by the debugger.
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
- bkpt = target.BreakpointCreateByName("main")
- self.assertTrue(bkpt.IsValid(), VALID_BREAKPOINT)
-
- # launch the inferior and don't wait for it to stop
- self.dbg.SetAsync(True)
- error = lldb.SBError()
- listener = lldb.SBListener("my listener")
- process = target.Launch(listener,
- ["SIGSTOP"], # argv
- None, # envp
- None, # stdin_path
- None, # stdout_path
- None, # stderr_path
- None, # working directory
- 0, # launch flags
- False, # Stop at entry
- error) # error
-
- self.assertTrue(process and process.IsValid(), PROCESS_IS_VALID)
-
- event = lldb.SBEvent()
-
- # Give the child enough time to reach the breakpoint,
- # while clearing out all the pending events.
- # The last WaitForEvent call will time out after 2 seconds.
- while listener.WaitForEvent(2, event):
- if self.TraceOn():
- print(
- "Process changing state to:",
- self.dbg.StateAsCString(
- process.GetStateFromEvent(event)))
-
- # now the process should be stopped
- self.assertEqual(
- process.GetState(),
- lldb.eStateStopped,
- PROCESS_STOPPED)
- self.assertEqual(len(lldbutil.get_threads_stopped_at_breakpoint(
- process, bkpt)), 1, "A thread should be stopped at breakpoint")
-
- # Remove all breakpoints. This makes sure we don't have to single-step over them when we
- # resume the process below
- target.DeleteAllBreakpoints()
-
- # resume the process and immediately try to set another breakpoint. When using the remote
- # stub, this will trigger a request to stop the process just as it is about to stop
- # naturally due to a SIGSTOP signal it raises. Make sure we do not lose
- # this signal.
- process.Continue()
- self.assertTrue(target.BreakpointCreateByName(
- "handler").IsValid(), VALID_BREAKPOINT)
-
- # Clear the events again
- while listener.WaitForEvent(2, event):
- if self.TraceOn():
- print(
- "Process changing state to:",
- self.dbg.StateAsCString(
- process.GetStateFromEvent(event)))
-
- # The process should be stopped due to a signal
- self.assertEqual(process.GetState(), lldb.eStateStopped)
- thread = lldbutil.get_stopped_thread(process, lldb.eStopReasonSignal)
- self.assertTrue(
- thread.IsValid(),
- "Thread should be stopped due to a signal")
- self.assertTrue(
- thread.GetStopReasonDataCount() >= 1,
- "There was data in the event.")
- signo = process.GetUnixSignals().GetSignalNumberFromName("SIGSTOP")
- self.assertEqual(thread.GetStopReasonDataAtIndex(0), signo,
- "The stop signal was %s" % signal)
-
- # We are done
- process.Kill()
diff --git a/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py b/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
index ad08c6a9e952..984e802fdaa0 100644
--- a/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
+++ b/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/TestSingleQuoteInFilename.py
@@ -10,7 +10,7 @@ import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-
+import six
class SingleQuoteInCommandLineTestCase(TestBase):
@@ -35,7 +35,10 @@ class SingleQuoteInCommandLineTestCase(TestBase):
"""Test that 'lldb my_file_name' works where my_file_name is a string with a single quote char in it."""
import pexpect
self.buildDefault()
- system([["cp", "a.out", "\"%s\"" % self.myexe]])
+ lldbutil.mkdir_p(self.getBuildArtifact("path with '09"))
+ system([["cp",
+ self.getBuildArtifact("a.out"),
+ "\"%s\"" % self.getBuildArtifact(self.myexe)]])
# The default lldb prompt.
prompt = "(lldb) "
@@ -43,35 +46,28 @@ class SingleQuoteInCommandLineTestCase(TestBase):
# So that the child gets torn down after the test.
self.child = pexpect.spawn(
'%s %s "%s"' %
- (lldbtest_config.lldbExec, self.lldbOption, self.myexe))
+ (lldbtest_config.lldbExec, self.lldbOption,
+ self.getBuildArtifact(self.myexe)))
child = self.child
child.setecho(True)
- # Turn on logging for input/output to/from the child.
- with open('child_send.txt', 'w') as f_send:
- with open('child_read.txt', 'w') as f_read:
- child.logfile_send = f_send
- child.logfile_read = f_read
-
- child.expect_exact(prompt)
+ child.logfile_send = send = six.StringIO()
+ child.logfile_read = read = six.StringIO()
+ child.expect_exact(prompt)
- child.send("help watchpoint")
- child.sendline('')
- child.expect_exact(prompt)
+ child.send("help watchpoint")
+ child.sendline('')
+ child.expect_exact(prompt)
# Now that the necessary logging is done, restore logfile to None to
# stop further logging.
child.logfile_send = None
child.logfile_read = None
- with open('child_send.txt', 'r') as fs:
- if self.TraceOn():
- print("\n\nContents of child_send.txt:")
- print(fs.read())
- with open('child_read.txt', 'r') as fr:
- from_child = fr.read()
- if self.TraceOn():
- print("\n\nContents of child_read.txt:")
- print(from_child)
+ if self.TraceOn():
+ print("\n\nContents of send")
+ print(send.getvalue())
+ print("\n\nContents of read")
+ print(read.getvalue())
- self.expect(from_child, exe=False,
- substrs=["Current executable set to"])
+ self.expect(read.getvalue(), exe=False,
+ substrs=["Current executable set to"])
diff --git a/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py b/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py
new file mode 100644
index 000000000000..6bcd9c92f8ce
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/source-map/TestTargetSourceMap.py
@@ -0,0 +1,41 @@
+import lldb
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
+
+
+class TestTargetSourceMap(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test
+ def test_source_map(self):
+ """Test target.source-map' functionality."""
+ # Set the target soure map to map "./" to the current test directory
+ src_dir = self.getSourceDir()
+ src_path = os.path.join(src_dir, "main.c")
+ yaml_path = os.path.join(src_dir, "a.yaml")
+ yaml_base, ext = os.path.splitext(yaml_path)
+ obj_path = self.getBuildArtifact(yaml_base)
+ self.yaml2obj(yaml_path, obj_path)
+
+ def cleanup():
+ if os.path.exists(obj_path):
+ os.unlink(obj_path)
+
+ # Execute the cleanup function during test case tear down.
+ self.addTearDownHook(cleanup)
+
+ # Create a target with the object file we just created from YAML
+ target = self.dbg.CreateTarget(obj_path)
+
+ # Set a breakpoint before we remap source and verify that it fails
+ bp = target.BreakpointCreateByLocation(src_path, 2)
+ self.assertTrue(bp.GetNumLocations() == 0,
+ "make sure no breakpoints were resolved without map")
+ src_map_cmd = 'settings set target.source-map ./ "%s"' % (src_dir)
+ self.dbg.HandleCommand(src_map_cmd)
+
+ # Set a breakpoint after we remap source and verify that it succeeds
+ bp = target.BreakpointCreateByLocation(src_path, 2)
+ self.assertTrue(bp.GetNumLocations() == 1,
+ "make sure breakpoint was resolved with map")
diff --git a/packages/Python/lldbsuite/test/functionalities/source-map/a.yaml b/packages/Python/lldbsuite/test/functionalities/source-map/a.yaml
new file mode 100644
index 000000000000..2ffb94cb7754
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/source-map/a.yaml
@@ -0,0 +1,396 @@
+--- !mach-o
+FileHeader:
+ magic: 0xFEEDFACF
+ cputype: 0x01000007
+ cpusubtype: 0x00000003
+ filetype: 0x0000000A
+ ncmds: 6
+ sizeofcmds: 1376
+ flags: 0x00000000
+ reserved: 0x00000000
+LoadCommands:
+ - cmd: LC_UUID
+ cmdsize: 24
+ uuid: D37CC773-C218-3F97-99C9-CE4E77DDF2CE
+ - cmd: LC_SYMTAB
+ cmdsize: 24
+ symoff: 4096
+ nsyms: 2
+ stroff: 4128
+ strsize: 28
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: __PAGEZERO
+ vmaddr: 0
+ vmsize: 4294967296
+ fileoff: 0
+ filesize: 0
+ maxprot: 0
+ initprot: 0
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 232
+ segname: __TEXT
+ vmaddr: 4294967296
+ vmsize: 4096
+ fileoff: 0
+ filesize: 0
+ maxprot: 7
+ initprot: 5
+ nsects: 2
+ flags: 0
+ Sections:
+ - sectname: __text
+ segname: __TEXT
+ addr: 0x0000000100000FA0
+ size: 15
+ offset: 0x00000000
+ align: 4
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x80000400
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __unwind_info
+ segname: __TEXT
+ addr: 0x0000000100000FB0
+ size: 72
+ offset: 0x00000000
+ align: 2
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - cmd: LC_SEGMENT_64
+ cmdsize: 72
+ segname: __LINKEDIT
+ vmaddr: 4294971392
+ vmsize: 4096
+ fileoff: 4096
+ filesize: 60
+ maxprot: 7
+ initprot: 1
+ nsects: 0
+ flags: 0
+ - cmd: LC_SEGMENT_64
+ cmdsize: 952
+ segname: __DWARF
+ vmaddr: 4294975488
+ vmsize: 4096
+ fileoff: 8192
+ filesize: 563
+ maxprot: 7
+ initprot: 3
+ nsects: 11
+ flags: 0
+ Sections:
+ - sectname: __debug_line
+ segname: __DWARF
+ addr: 0x0000000100002000
+ size: 60
+ offset: 0x00002000
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_pubnames
+ segname: __DWARF
+ addr: 0x000000010000203C
+ size: 27
+ offset: 0x0000203C
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_pubtypes
+ segname: __DWARF
+ addr: 0x0000000100002057
+ size: 26
+ offset: 0x00002057
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_aranges
+ segname: __DWARF
+ addr: 0x0000000100002071
+ size: 48
+ offset: 0x00002071
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_info
+ segname: __DWARF
+ addr: 0x00000001000020A1
+ size: 75
+ offset: 0x000020A1
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_abbrev
+ segname: __DWARF
+ addr: 0x00000001000020EC
+ size: 52
+ offset: 0x000020EC
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __debug_str
+ segname: __DWARF
+ addr: 0x0000000100002120
+ size: 28
+ offset: 0x00002120
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __apple_names
+ segname: __DWARF
+ addr: 0x0000000100002160
+ size: 60
+ offset: 0x00002160
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __apple_namespac
+ segname: __DWARF
+ addr: 0x000000010000219C
+ size: 36
+ offset: 0x0000219C
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __apple_types
+ segname: __DWARF
+ addr: 0x00000001000021C0
+ size: 79
+ offset: 0x000021C0
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+ - sectname: __apple_objc
+ segname: __DWARF
+ addr: 0x000000010000220F
+ size: 36
+ offset: 0x0000220F
+ align: 0
+ reloff: 0x00000000
+ nreloc: 0
+ flags: 0x00000000
+ reserved1: 0x00000000
+ reserved2: 0x00000000
+ reserved3: 0x00000000
+LinkEditData:
+ NameList:
+ - n_strx: 2
+ n_type: 0x0F
+ n_sect: 1
+ n_desc: 16
+ n_value: 4294967296
+ - n_strx: 22
+ n_type: 0x0F
+ n_sect: 1
+ n_desc: 0
+ n_value: 4294971296
+ StringTable:
+ - ''
+ - ''
+ - __mh_execute_header
+ - _main
+DWARF:
+ debug_str:
+ - ''
+ - obj2yaml
+ - main.c
+ - .
+ - main
+ - int
+ debug_abbrev:
+ - Code: 0x00000001
+ Tag: DW_TAG_compile_unit
+ Children: DW_CHILDREN_yes
+ Attributes:
+ - Attribute: DW_AT_producer
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_language
+ Form: DW_FORM_data2
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_stmt_list
+ Form: DW_FORM_sec_offset
+ - Attribute: DW_AT_comp_dir
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_low_pc
+ Form: DW_FORM_addr
+ - Attribute: DW_AT_high_pc
+ Form: DW_FORM_data4
+ - Code: 0x00000002
+ Tag: DW_TAG_subprogram
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_low_pc
+ Form: DW_FORM_addr
+ - Attribute: DW_AT_high_pc
+ Form: DW_FORM_data4
+ - Attribute: DW_AT_frame_base
+ Form: DW_FORM_exprloc
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_decl_file
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_decl_line
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_type
+ Form: DW_FORM_ref4
+ - Attribute: DW_AT_external
+ Form: DW_FORM_flag_present
+ - Code: 0x00000003
+ Tag: DW_TAG_base_type
+ Children: DW_CHILDREN_no
+ Attributes:
+ - Attribute: DW_AT_name
+ Form: DW_FORM_strp
+ - Attribute: DW_AT_encoding
+ Form: DW_FORM_data1
+ - Attribute: DW_AT_byte_size
+ Form: DW_FORM_data1
+ debug_aranges:
+ - Length:
+ TotalLength: 44
+ Version: 2
+ CuOffset: 0
+ AddrSize: 8
+ SegSize: 0
+ Descriptors:
+ - Address: 0x0000000100000FA0
+ Length: 15
+ debug_pubnames:
+ Length:
+ TotalLength: 23
+ Version: 2
+ UnitOffset: 0
+ UnitSize: 75
+ Entries:
+ - DieOffset: 0x0000002A
+ Name: main
+ debug_pubtypes:
+ Length:
+ TotalLength: 22
+ Version: 2
+ UnitOffset: 0
+ UnitSize: 75
+ Entries:
+ - DieOffset: 0x00000043
+ Name: int
+ debug_info:
+ - Length:
+ TotalLength: 71
+ Version: 4
+ AbbrOffset: 0
+ AddrSize: 8
+ Entries:
+ - AbbrCode: 0x00000001
+ Values:
+ - Value: 0x0000000000000001
+ - Value: 0x000000000000000C
+ - Value: 0x000000000000000A
+ - Value: 0x0000000000000000
+ - Value: 0x0000000000000011
+ - Value: 0x0000000100000FA0
+ - Value: 0x000000000000000F
+ - AbbrCode: 0x00000002
+ Values:
+ - Value: 0x0000000100000FA0
+ - Value: 0x000000000000000F
+ - Value: 0x0000000000000001
+ BlockData:
+ - 0x56
+ - Value: 0x0000000000000013
+ - Value: 0x0000000000000001
+ - Value: 0x0000000000000001
+ - Value: 0x0000000000000043
+ - Value: 0x0000000000000001
+ - AbbrCode: 0x00000003
+ Values:
+ - Value: 0x0000000000000018
+ - Value: 0x0000000000000005
+ - Value: 0x0000000000000004
+ - AbbrCode: 0x00000000
+ Values:
+ debug_line:
+ - Length:
+ TotalLength: 56
+ Version: 2
+ PrologueLength: 29
+ MinInstLength: 1
+ DefaultIsStmt: 1
+ LineBase: 251
+ LineRange: 14
+ OpcodeBase: 13
+ StandardOpcodeLengths: [ 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1 ]
+ IncludeDirs:
+ Files:
+ - Name: main.c
+ DirIdx: 0
+ ModTime: 0
+ Length: 0
+ Opcodes:
+ - Opcode: DW_LNS_extended_op
+ ExtLen: 9
+ SubOpcode: DW_LNE_set_address
+ Data: 4294971296
+ - Opcode: DW_LNS_copy
+ Data: 4294971296
+ - Opcode: DW_LNS_set_column
+ Data: 2
+ - Opcode: DW_LNS_set_prologue_end
+ Data: 2
+ - Opcode: 0xC9
+ Data: 2
+ - Opcode: DW_LNS_advance_pc
+ Data: 2
+ - Opcode: DW_LNS_extended_op
+ ExtLen: 1
+ SubOpcode: DW_LNE_end_sequence
+ Data: 2
+...
diff --git a/packages/Python/lldbsuite/test/functionalities/stats/Makefile b/packages/Python/lldbsuite/test/functionalities/stats/Makefile
new file mode 100644
index 000000000000..f5a47fcc46cc
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/stats/TestStats.py b/packages/Python/lldbsuite/test/functionalities/stats/TestStats.py
new file mode 100644
index 000000000000..48e49ed009ba
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats/TestStats.py
@@ -0,0 +1,5 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(
+ __file__, globals(), [])
diff --git a/packages/Python/lldbsuite/test/functionalities/stats/main.c b/packages/Python/lldbsuite/test/functionalities/stats/main.c
new file mode 100644
index 000000000000..9adb3a09a080
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats/main.c
@@ -0,0 +1,18 @@
+// Test that the lldb command `statistics` works.
+
+int main(void) {
+ int patatino = 27;
+ //%self.expect("statistics disable", substrs=['need to enable statistics before disabling'], error=True)
+ //%self.expect("statistics enable")
+ //%self.expect("statistics enable", substrs=['already enabled'], error=True)
+ //%self.expect("expr patatino", substrs=['27'])
+ //%self.expect("statistics disable")
+ //%self.expect("statistics dump", substrs=['expr evaluation successes : 1', 'expr evaluation failures : 0'])
+ //%self.expect("frame var", substrs=['27'])
+ //%self.expect("statistics enable")
+ //%self.expect("frame var", substrs=['27'])
+ //%self.expect("statistics disable")
+ //%self.expect("statistics dump", substrs=['frame var successes : 1', 'frame var failures : 0'])
+
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/stats_api/Makefile b/packages/Python/lldbsuite/test/functionalities/stats_api/Makefile
new file mode 100644
index 000000000000..f5a47fcc46cc
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats_api/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py b/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py
new file mode 100644
index 000000000000..a6c38ca1d091
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py
@@ -0,0 +1,28 @@
+# Test the SBAPI for GetStatistics()
+
+import json
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestStatsAPI(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ TestBase.setUp(self)
+
+ def test_stats_api(self):
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
+ stats = target.GetStatistics()
+ stream = lldb.SBStream()
+ res = stats.GetAsJSON(stream)
+ stats_json = sorted(json.loads(stream.GetData()))
+ self.assertEqual(len(stats_json), 4)
+ self.assertTrue("Number of expr evaluation failures" in stats_json)
+ self.assertTrue("Number of expr evaluation successes" in stats_json)
+ self.assertTrue("Number of frame var failures" in stats_json)
+ self.assertTrue("Number of frame var successes" in stats_json)
diff --git a/packages/Python/lldbsuite/test/functionalities/stats_api/main.c b/packages/Python/lldbsuite/test/functionalities/stats_api/main.c
new file mode 100644
index 000000000000..03b2213bb9a3
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/stats_api/main.c
@@ -0,0 +1,3 @@
+int main(void) {
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/Makefile b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/Makefile
index 45b69a5bb6eb..4f71dc87646d 100644
--- a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/Makefile
@@ -5,4 +5,4 @@ C_SOURCES := with-debug.c without-debug.c
include $(LEVEL)/Makefile.rules
without-debug.o: without-debug.c
- $(CC) $(CFLAGS_NO_DEBUG) -c without-debug.c
+ $(CC) $(CFLAGS_NO_DEBUG) -c $<
diff --git a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
index 7ec934f26e0b..446c2675f884 100644
--- a/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
+++ b/packages/Python/lldbsuite/test/functionalities/step-avoids-no-debug/TestStepNoDebug.py
@@ -15,11 +15,12 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class ReturnValueTestCase(TestBase):
+class StepAvoidsNoDebugTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_step_out_with_python(self):
"""Test stepping out using avoid-no-debug with dsyms."""
self.build()
@@ -36,6 +37,7 @@ class ReturnValueTestCase(TestBase):
"3.9"],
archs=["i386"],
bugnumber="llvm.org/pr28549")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_step_over_with_python(self):
"""Test stepping over using avoid-no-debug with dwarf."""
self.build()
@@ -53,6 +55,7 @@ class ReturnValueTestCase(TestBase):
archs=["i386"],
bugnumber="llvm.org/pr28549")
@expectedFailureAll(oslist=["ios", "tvos", "bridgeos"], bugnumber="<rdar://problem/34026777>") # lldb doesn't step past last source line in function on arm64
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_step_in_with_python(self):
"""Test stepping in using avoid-no-debug with dwarf."""
self.build()
@@ -92,7 +95,7 @@ class ReturnValueTestCase(TestBase):
(name, pattern))
def get_to_starting_point(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
error = lldb.SBError()
self.target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
index 3d23f644554b..767b368cc7dc 100644
--- a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
+++ b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookCmd.py
@@ -38,7 +38,7 @@ class StopHookCmdTestCase(TestBase):
def test(self):
"""Test a sequence of target stop-hook commands."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
index 74088581bad4..b76d98a333c2 100644
--- a/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
+++ b/packages/Python/lldbsuite/test/functionalities/stop-hook/TestStopHookMechanism.py
@@ -45,7 +45,7 @@ class StopHookMechanismTestCase(TestBase):
self.build()
import pexpect
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
prompt = "(lldb) "
add_prompt = "Enter your stop hook command(s). Type 'DONE' to end."
add_prompt1 = "> "
diff --git a/packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py b/packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
index 3a18877ef2d0..88267b60b978 100644
--- a/packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/stop-hook/multiple_threads/TestStopHookMultipleThreads.py
@@ -46,7 +46,7 @@ class StopHookForMultipleThreadsTestCase(TestBase):
self.setTearDownCleanup(dictionary=self.d)
import pexpect
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
prompt = "(lldb) "
# So that the child gets torn down after the test.
diff --git a/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py b/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
index 7d2900d61718..71bfff1d05d4 100644
--- a/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
+++ b/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
@@ -25,15 +25,15 @@ class targetCommandTestCase(TestBase):
def test_target_command(self):
"""Test some target commands: create, list, select."""
- da = {'C_SOURCES': 'a.c', 'EXE': 'a.out'}
+ da = {'C_SOURCES': 'a.c', 'EXE': self.getBuildArtifact('a.out')}
self.build(dictionary=da)
self.addTearDownCleanup(dictionary=da)
- db = {'C_SOURCES': 'b.c', 'EXE': 'b.out'}
+ db = {'C_SOURCES': 'b.c', 'EXE': self.getBuildArtifact('b.out')}
self.build(dictionary=db)
self.addTearDownCleanup(dictionary=db)
- dc = {'C_SOURCES': 'c.c', 'EXE': 'c.out'}
+ dc = {'C_SOURCES': 'c.c', 'EXE': self.getBuildArtifact('c.out')}
self.build(dictionary=dc)
self.addTearDownCleanup(dictionary=dc)
@@ -44,7 +44,7 @@ class targetCommandTestCase(TestBase):
@expectedFailureAndroid(archs=['aarch64'])
def test_target_variable_command(self):
"""Test 'target variable' command before and after starting the inferior."""
- d = {'C_SOURCES': 'globals.c', 'EXE': 'globals'}
+ d = {'C_SOURCES': 'globals.c', 'EXE': self.getBuildArtifact('globals')}
self.build(dictionary=d)
self.addTearDownCleanup(dictionary=d)
@@ -53,7 +53,7 @@ class targetCommandTestCase(TestBase):
@expectedFailureAndroid(archs=['aarch64'])
def test_target_variable_command_no_fail(self):
"""Test 'target variable' command before and after starting the inferior."""
- d = {'C_SOURCES': 'globals.c', 'EXE': 'globals'}
+ d = {'C_SOURCES': 'globals.c', 'EXE': self.getBuildArtifact('globals')}
self.build(dictionary=d)
self.addTearDownCleanup(dictionary=d)
@@ -61,9 +61,9 @@ class targetCommandTestCase(TestBase):
def do_target_command(self):
"""Exercise 'target create', 'target list', 'target select' commands."""
- exe_a = os.path.join(os.getcwd(), "a.out")
- exe_b = os.path.join(os.getcwd(), "b.out")
- exe_c = os.path.join(os.getcwd(), "c.out")
+ exe_a = self.getBuildArtifact("a.out")
+ exe_b = self.getBuildArtifact("b.out")
+ exe_c = self.getBuildArtifact("c.out")
self.runCmd("target list")
output = self.res.GetOutput()
@@ -114,7 +114,8 @@ class targetCommandTestCase(TestBase):
def do_target_variable_command(self, exe_name):
"""Exercise 'target variable' command before and after starting the inferior."""
- self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact(exe_name),
+ CURRENT_EXECUTABLE_SET)
self.expect(
"target variable my_global_char",
@@ -206,7 +207,8 @@ class targetCommandTestCase(TestBase):
def do_target_variable_command_no_fail(self, exe_name):
"""Exercise 'target variable' command before and after starting the inferior."""
- self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact(exe_name),
+ CURRENT_EXECUTABLE_SET)
self.expect(
"target variable my_global_char",
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp
index 71fb8e3bb565..8e0f76f691b9 100755
--- a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/ParallelTask.cpp
@@ -2,6 +2,7 @@
#include <thread>
#include <vector>
#include <queue>
+#include <functional>
#include <future>
#include <iostream>
#include <cassert>
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
index ba5094f6de3e..e2026267c60e 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/backtrace_all/TestBacktraceAll.py
@@ -30,7 +30,7 @@ class BreakpointAfterJoinTestCase(TestBase):
"""Test breakpoint handling after a thread join."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py b/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
index d1d70c58c4c7..cef24d688bf9 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/break_after_join/TestBreakAfterJoin.py
@@ -36,7 +36,7 @@ class BreakpointAfterJoinTestCase(TestBase):
"""Test breakpoint handling after a thread join."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/Makefile
index 4b5e0ee94222..469c0809aa24 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/Makefile
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/Makefile
@@ -1,9 +1,7 @@
-LEVEL = ../../../../make
+LEVEL = ../../../make
CXX_SOURCES := main.cpp
ENABLE_THREADS := YES
-VPATH = ..
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointDelayBreakpointOneSignal.py
index 2506a8231883..2506a8231883 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/TestConcurrentBreakpointDelayBreakpointOneSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointDelayBreakpointOneSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py
index 8712342e5811..8712342e5811 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/TestConcurrentBreakpointOneDelayBreakpointThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointOneDelayBreakpointThreads.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
index 275d54d2149c..275d54d2149c 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentBreakpointsDelayedBreakpointOneWatchpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
index 33d1074211ee..33d1074211ee 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_break/TestConcurrentCrashWithBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
index 560c79ed8a8f..560c79ed8a8f 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/TestConcurrentCrashWithSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
index c9cc6db96004..c9cc6db96004 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/TestConcurrentCrashWithWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
index d99107b6e9b6..d99107b6e9b6 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/TestConcurrentCrashWithWatchpointBreakpointSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentCrashWithWatchpointBreakpointSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py
index 442134f4a0c7..442134f4a0c7 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/TestConcurrentDelaySignalBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py
index 28c5c68d4506..28c5c68d4506 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/TestConcurrentDelaySignalWatch.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelaySignalWatch.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
index 2d7c984e0e1c..2d7c984e0e1c 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/TestConcurrentDelayWatchBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayWatchBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py
index 2b7e1b457268..2b7e1b457268 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/TestConcurrentDelayedCrashWithBreakpointSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
index 0564c86dfcbd..0564c86dfcbd 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentDelayedCrashWithBreakpointWatchpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
index a9f3fbb799f1..a9f3fbb799f1 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/TestConcurrentManyBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyBreakpoints.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
index 88ab1d5e204c..88ab1d5e204c 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/TestConcurrentManyCrash.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyCrash.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py
index 232b694c80f4..232b694c80f4 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/TestConcurrentManySignals.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManySignals.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
index 96b610f2b90b..96b610f2b90b 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/TestConcurrentManyWatchpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentManyWatchpoints.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
index b921ac04ccc5..b921ac04ccc5 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/TestConcurrentNWatchNBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentNWatchNBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py
index b8819f286984..b8819f286984 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/TestConcurrentSignalBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayBreak.py
index b7d8cb174d24..b7d8cb174d24 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/TestConcurrentSignalDelayBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayWatch.py
index 2f3b858854b8..2f3b858854b8 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/TestConcurrentSignalDelayWatch.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalDelayWatch.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalNWatchNBreak.py
index ebb13d99fb3c..ebb13d99fb3c 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/TestConcurrentSignalNWatchNBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalNWatchNBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
index 0fbaf364045d..0fbaf364045d 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/TestConcurrentSignalWatch.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatch.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatchBreak.py
index 53da6658550d..53da6658550d 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/TestConcurrentSignalWatchBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentSignalWatchBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py
index 4e6bed2d5cbc..4e6bed2d5cbc 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/TestConcurrentTwoBreakpointThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointThreads.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneDelaySignal.py
index d7630575cb34..d7630575cb34 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/TestConcurrentTwoBreakpointsOneDelaySignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneDelaySignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py
index 4c4caa533734..4c4caa533734 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/TestConcurrentTwoBreakpointsOneSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py
index 687be17ddc5a..687be17ddc5a 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/TestConcurrentTwoBreakpointsOneWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoBreakpointsOneWatchpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
index 025d91169451..025d91169451 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/TestConcurrentTwoWatchpointThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointThreads.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
index 5e95531ae09a..5e95531ae09a 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/TestConcurrentTwoWatchpointsOneBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneBreakpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
index aa57e816bb58..aa57e816bb58 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneDelayBreakpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneSignal.py
index 31b583c1a65a..31b583c1a65a 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/TestConcurrentTwoWatchpointsOneSignal.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentTwoWatchpointsOneSignal.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py
index 241ea5b64a03..241ea5b64a03 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/TestConcurrentWatchBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreak.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py
index 79a54b620e53..79a54b620e53 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/TestConcurrentWatchBreakDelay.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchBreakDelay.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
index 6a37abdbcbb8..6a37abdbcbb8 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointDelayWatchpointOneBreakpoint.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py
index 67ac92b853cd..67ac92b853cd 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/TestConcurrentWatchpointWithDelayWatchpointThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/TestConcurrentWatchpointWithDelayWatchpointThreads.py
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_delay_breakpoint_one_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoint_one_delay_breakpoint_threads/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/breakpoints_delayed_breakpoint_one_watchpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/crash_with_watchpoint_breakpoint_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_signal_watch/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delay_watch_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/delayed_crash_with_breakpoint_watchpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_breakpoints/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_crash/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_signals/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/many_watchpoints/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/n_watch_n_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_delay_watch/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_n_watch_n_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/signal_watch_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoint_threads/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_delay_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_breakpoints_one_watchpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoint_threads/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_breakpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_delay_breakpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/two_watchpoints_one_signal/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watch_break_delay/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_delay_watchpoint_one_breakpoint/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/Makefile b/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/Makefile
deleted file mode 100644
index 4b5e0ee94222..000000000000
--- a/packages/Python/lldbsuite/test/functionalities/thread/concurrent_events/watchpoint_with_delay_watchpoint_threads/Makefile
+++ /dev/null
@@ -1,9 +0,0 @@
-LEVEL = ../../../../make
-
-CXX_SOURCES := main.cpp
-
-ENABLE_THREADS := YES
-
-VPATH = ..
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py b/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
index 5343e19ee203..b20b738825a2 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/crash_during_step/TestCrashDuringStep.py
@@ -12,7 +12,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class CreateDuringStepTestCase(TestBase):
+class CrashDuringStepTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,7 +26,7 @@ class CreateDuringStepTestCase(TestBase):
def test_step_inst_with(self):
"""Test thread creation during step-inst handling."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), "Target is valid")
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
index 442887ed4e13..3f26d8c76579 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/create_after_attach/TestCreateAfterAttach.py
@@ -51,7 +51,7 @@ class CreateAfterAttachTestCase(TestBase):
def create_after_attach(self, use_fork):
"""Test thread creation after process attach."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Spawn a new process
if use_fork:
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py b/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
index f6d6197e1f11..3998db6d3256 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/create_during_step/TestCreateDuringStep.py
@@ -83,7 +83,7 @@ class CreateDuringStepTestCase(TestBase):
def create_during_step_base(self, step_cmd, step_stop_reason):
"""Test thread creation while using step-in."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Get the target process
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
index 456c890673cc..c62990ccc93a 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/TestExitDuringBreak.py
@@ -29,7 +29,7 @@ class ExitDuringBreakpointTestCase(TestBase):
def test(self):
"""Test thread exit during breakpoint handling."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp
index e41fbebf380d..8fc1e42e96d0 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_break/main.cpp
@@ -86,7 +86,7 @@ int main ()
// last in the internal list maintained by the debugger.
pseudo_barrier_init(g_barrier1, 5);
- // The second break synchronyizes thread exection with the breakpoint.
+ // The second break synchronizes thread execution with the breakpoint.
pseudo_barrier_init(g_barrier2, 5);
// The third barrier keeps the waiting threads around until the breakpoint
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
index 4ba04953d6f1..0343a888a0f1 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/exit_during_step/TestExitDuringStep.py
@@ -53,7 +53,7 @@ class ExitDuringStepTestCase(TestBase):
def exit_during_step_base(self, step_cmd, step_stop_reason, by_instruction):
"""Test thread exit during step handling."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py b/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
index 26ee5d4084eb..3300078e8c60 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/jump/TestThreadJump.py
@@ -17,10 +17,11 @@ class ThreadJumpTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test(self):
"""Test thread jump handling."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Find the line numbers for our breakpoints.
@@ -50,8 +51,10 @@ class ThreadJumpTestCase(TestBase):
self.do_min_test(self.mark3, self.mark2, "i", "5")
# Try the double path, force it to return 'a'
self.do_min_test(self.mark4, self.mark1, "j", "7")
- # Try the double path, force it to return 'b'
- self.do_min_test(self.mark4, self.mark2, "j", "8")
+ # Expected to fail on powerpc64le architecture
+ if not self.isPPC64le():
+ # Try the double path, force it to return 'b'
+ self.do_min_test(self.mark4, self.mark2, "j", "8")
# Try jumping to another function in a different file.
self.runCmd(
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py b/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
index 18d88cb52113..cff9b5a8d5e5 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/multi_break/TestMultipleBreakpoints.py
@@ -38,7 +38,7 @@ class MultipleBreakpointTestCase(TestBase):
def test(self):
"""Test simultaneous breakpoints in multiple threads."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
index 75a9b8873dda..4c4e645635c1 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/TestNumThreads.py
@@ -16,18 +16,19 @@ import lldbsuite.test.lldbutil as lldbutil
class NumberOfThreadsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line numbers for our break points.
self.thread3_notify_all_line = line_number('main.cpp', '// Set thread3 break point on notify_all at this line.')
- self.thread3_before_lock_line = line_number('main.cpp', '// Set thread3 break point on lock at this line.')
+ self.thread3_before_lock_line = line_number('main.cpp', '// thread3-before-lock')
def test_number_of_threads(self):
"""Test number of threads."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint with 1 location.
@@ -63,10 +64,11 @@ class NumberOfThreadsTestCase(TestBase):
'Number of expected threads and actual threads do not match.')
@skipIfDarwin # rdar://33462362
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37658")
def test_unique_stacks(self):
"""Test backtrace unique with multiple threads executing the same stack."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Set a break point on the thread3 notify all (should get hit on threads 4-13).
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp
index 42a07f353030..fdc060d135dc 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/thread/num_threads/main.cpp
@@ -12,7 +12,10 @@ void *
thread3(void *input)
{
pseudo_barrier_wait(thread3_barrier);
- std::unique_lock<std::mutex> lock(mutex); // Set thread3 break point on lock at this line.
+
+ int dummy = 47; // thread3-before-lock
+
+ std::unique_lock<std::mutex> lock(mutex);
cond.notify_all(); // Set thread3 break point on notify_all at this line.
return NULL;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py b/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
index 1fb52155c266..0cbd94e199dc 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/state/TestThreadStates.py
@@ -21,9 +21,7 @@ class ThreadStateTestCase(TestBase):
@expectedFailureAll(
oslist=["linux"],
bugnumber="llvm.org/pr15824 thread states not properly maintained")
- @expectedFailureAll(
- oslist=lldbplatformutil.getDarwinOSTriples(),
- bugnumber="llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>")
+ @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>
@expectedFailureAll(
oslist=["freebsd"],
bugnumber="llvm.org/pr18190 thread states not properly maintained")
@@ -58,6 +56,7 @@ class ThreadStateTestCase(TestBase):
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
+ @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>
def test_process_interrupt(self):
"""Test process interrupt."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
@@ -68,6 +67,7 @@ class ThreadStateTestCase(TestBase):
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24668: Breakpoints not resolved correctly")
+ @skipIfDarwin # llvm.org/pr15824 thread states not properly maintained and <rdar://problem/28557237>
def test_process_state(self):
"""Test thread states (comprehensive)."""
self.build(dictionary=self.getBuildFlags(use_cpp11=False))
@@ -82,7 +82,7 @@ class ThreadStateTestCase(TestBase):
def thread_state_after_breakpoint_test(self):
"""Test thread state after breakpoint."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
@@ -122,7 +122,7 @@ class ThreadStateTestCase(TestBase):
def thread_state_after_continue_test(self):
"""Test thread state after continue."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
@@ -164,7 +164,7 @@ class ThreadStateTestCase(TestBase):
def thread_state_after_expression_test(self):
"""Test thread state after expression."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
@@ -200,7 +200,7 @@ class ThreadStateTestCase(TestBase):
def process_interrupt_test(self):
"""Test process interrupt and continue."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
@@ -240,7 +240,7 @@ class ThreadStateTestCase(TestBase):
def thread_states_test(self):
"""Test thread states (comprehensive)."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
index 9c8bbf1eb081..238b18837884 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/step_out/TestThreadStepOut.py
@@ -125,7 +125,7 @@ class ThreadStepOutTestCase(TestBase):
def step_out_test(self, step_out_func):
"""Test single thread step out of a function."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint in the main thread.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py b/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
index d63d5c55bc82..3bace5780639 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/step_until/TestStepUntil.py
@@ -11,7 +11,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class TestCStepping(TestBase):
+class StepUntilTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -26,7 +26,7 @@ class TestCStepping(TestBase):
def do_until (self, args, until_lines, expected_linenum):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
index deedc4b7507a..07ceb3f5f6b7 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/TestThreadExit.py
@@ -28,7 +28,7 @@ class ThreadExitTestCase(TestBase):
def test(self):
"""Test thread exit handling."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# This should create a breakpoint with 1 location.
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp
index f9508cf6ecca..432adc0ea00e 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_exit/main.cpp
@@ -64,7 +64,8 @@ int main ()
thread_1.join();
// Synchronize with the remaining thread
- pseudo_barrier_wait(g_barrier3); // Set third breakpoint here
+ int dummy = 47; // Set third breakpoint here
+ pseudo_barrier_wait(g_barrier3);
// Wait for the second thread to finish
thread_2.join();
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
index 8f004e6d319b..9fdf42ac4e3c 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/TestThreadSpecificBreakpoint.py
@@ -13,68 +13,57 @@ from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+def set_thread_id(thread, breakpoint):
+ id = thread.id
+ breakpoint.SetThreadID(id)
+
+def set_thread_name(thread, breakpoint):
+ breakpoint.SetThreadName("main-thread")
class ThreadSpecificBreakTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
@add_test_categories(['pyapi'])
+
@expectedFailureAll(oslist=["windows"])
@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working
- def test_python(self):
+ def test_thread_id(self):
+ self.do_test(set_thread_id)
+
+ @skipUnlessDarwin
+ @expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], archs=['armv7', 'armv7k'], bugnumber='rdar://problem/34563920') # armv7 ios problem - breakpoint with tid qualifier isn't working
+ def test_thread_name(self):
+ self.do_test(set_thread_name)
+
+ def do_test(self, setter_method):
"""Test that we obey thread conditioned breakpoints."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ main_source_spec = lldb.SBFileSpec("main.cpp")
+ (target, process, main_thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
+ "Set main breakpoint here", main_source_spec)
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
+ main_thread_id = main_thread.GetThreadID()
# This test works by setting a breakpoint in a function conditioned to stop only on
# the main thread, and then calling this function on a secondary thread, joining,
# and then calling again on the main thread. If the thread specific breakpoint works
# then it should not be hit on the secondary thread, only on the main
# thread.
-
- main_source_spec = lldb.SBFileSpec("main.cpp")
-
- main_breakpoint = target.BreakpointCreateBySourceRegex(
- "Set main breakpoint here", main_source_spec)
thread_breakpoint = target.BreakpointCreateBySourceRegex(
"Set thread-specific breakpoint here", main_source_spec)
-
- self.assertTrue(
- main_breakpoint.IsValid(),
- "Failed to set main breakpoint.")
- self.assertGreater(
- main_breakpoint.GetNumLocations(),
- 0,
- "main breakpoint has no locations associated with it.")
- self.assertTrue(
- thread_breakpoint.IsValid(),
- "Failed to set thread breakpoint.")
self.assertGreater(
thread_breakpoint.GetNumLocations(),
0,
"thread breakpoint has no locations associated with it.")
- process = target.LaunchSimple(
- None, None, self.get_process_working_directory())
-
- self.assertTrue(process, PROCESS_IS_VALID)
-
- stopped_threads = lldbutil.get_threads_stopped_at_breakpoint(
- process, main_breakpoint)
- self.assertEqual(
- len(stopped_threads),
- 1,
- "main breakpoint stopped at unexpected number of threads")
- main_thread = stopped_threads[0]
- main_thread_id = main_thread.GetThreadID()
-
# Set the thread-specific breakpoint to only stop on the main thread. The run the function
# on another thread and join on it. If the thread-specific breakpoint works, the next
# stop should be on the main thread.
- thread_breakpoint.SetThreadID(main_thread_id)
+
+ main_thread_id = main_thread.GetThreadID()
+ setter_method(main_thread, thread_breakpoint)
process.Continue()
next_stop_state = process.GetState()
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/main.cpp b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/main.cpp
index 7721b5d84322..0509b3d37a7f 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break/main.cpp
@@ -12,6 +12,11 @@ int
main ()
{
// Set main breakpoint here.
+
+ #ifdef __APPLE__
+ pthread_setname_np("main-thread");
+ #endif
+
std::thread t(thread_function);
t.join();
diff --git a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
index 3eddaca3e30d..8bf897f0bba7 100644
--- a/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
+++ b/packages/Python/lldbsuite/test/functionalities/thread/thread_specific_break_plus_condition/TestThreadSpecificBpPlusCondition.py
@@ -21,6 +21,7 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase):
# test frequently times out or hangs
@skipIf(oslist=['windows', 'freebsd'])
+ @skipIfDarwin
# hits break in another thread in testrun
@expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr18522')
@add_test_categories(['pyapi'])
@@ -28,7 +29,7 @@ class ThreadSpecificBreakPlusConditionTestCase(TestBase):
def test_python(self):
"""Test that we obey thread conditioned breakpoints."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py b/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
index f1689a8fda00..c91ed41a2478 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/basic/TestTsanBasic.py
@@ -33,7 +33,7 @@ class TsanBasicTestCase(TestBase):
self.line_thread2 = line_number('main.c', '// thread2 line')
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py b/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
index 8baba9beed36..7451dde1fa59 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
@@ -30,7 +30,7 @@ class TsanCPPGlobalLocationTestCase(TestBase):
TestBase.setUp(self)
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py b/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
index 3f0cae6a54c9..c68c2efff4cd 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
@@ -30,7 +30,7 @@ class TsanGlobalLocationTestCase(TestBase):
TestBase.setUp(self)
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py b/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
index 436fcf63d07d..93b06f6502a1 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
@@ -30,7 +30,7 @@ class TsanMultipleTestCase(TestBase):
TestBase.setUp(self)
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py b/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
index f4380cf7749a..6e6587387ea9 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/thread_leak/TestTsanThreadLeak.py
@@ -26,7 +26,7 @@ class TsanThreadLeakTestCase(TestBase):
self.tsan_tests()
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py b/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
index 684e6f71d931..6565a2336563 100644
--- a/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
+++ b/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
@@ -30,7 +30,7 @@ class TsanThreadNumbersTestCase(TestBase):
TestBase.setUp(self)
def tsan_tests(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py b/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
index f0ecd464de1d..c4d31df0989b 100644
--- a/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
+++ b/packages/Python/lldbsuite/test/functionalities/tty/TestTerminal.py
@@ -35,7 +35,7 @@ class LaunchInTerminalTestCase(TestBase):
@no_debug_info_test
def test_launch_in_terminal(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
launch_info = lldb.SBLaunchInfo(["-lAF", "/tmp/"])
diff --git a/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py b/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
index 8d6311e42b93..2c7fb01f2f26 100644
--- a/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
+++ b/packages/Python/lldbsuite/test/functionalities/type_completion/TestTypeCompletion.py
@@ -25,7 +25,7 @@ class TypeCompletionTestCase(TestBase):
def test_with_run_command(self):
"""Check that types only get completed when necessary."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
self, "// Set break point at this line.")
diff --git a/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py b/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
index b0f52923cc1f..272634fcab91 100644
--- a/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
+++ b/packages/Python/lldbsuite/test/functionalities/type_lookup/TestTypeLookup.py
@@ -29,7 +29,7 @@ class TypeLookupTestCase(TestBase):
def test_type_lookup(self):
"""Test type lookup command."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.mm", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py b/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
index 8dcee97e32f5..5dfa08e78308 100644
--- a/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
+++ b/packages/Python/lldbsuite/test/functionalities/ubsan/basic/TestUbsanBasic.py
@@ -27,7 +27,7 @@ class UbsanBasicTestCase(TestBase):
def ubsan_tests(self):
# Load the test
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
@@ -84,7 +84,7 @@ class UbsanBasicTestCase(TestBase):
self.assertEqual(data["instrumentation_class"], "UndefinedBehaviorSanitizer")
self.assertEqual(data["description"], "misaligned-pointer-use")
- self.assertEqual(data["filename"], "main.c")
+ self.assertEqual(os.path.basename(data["filename"]), "main.c")
self.assertEqual(data["line"], self.line_align)
self.runCmd("continue")
diff --git a/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py b/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
index a5e5f572a979..d0502cc052a5 100644
--- a/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
+++ b/packages/Python/lldbsuite/test/functionalities/ubsan/user-expression/TestUbsanUserExpression.py
@@ -27,7 +27,7 @@ class UbsanUserExpressionTestCase(TestBase):
def ubsan_tests(self):
# Load the test
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect(
"file " + exe,
patterns=["Current executable set to .*a.out"])
diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py b/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
index a855be7536ca..9c87d1759f8c 100644
--- a/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
+++ b/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/TestEhFrameUnwind.py
@@ -23,7 +23,7 @@ class EHFrameBasedUnwind(TestBase):
self.build()
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c b/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
index ae8060124ab2..46de1efe6265 100644
--- a/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
+++ b/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
@@ -1,6 +1,18 @@
void func() {
-#ifndef __mips__
+#ifdef __powerpc64__
+ __asm__ (
+ "mflr 0;"
+ "std 0,16(1);"
+ "addi 1,1,-24;"
+ "mr 31,1;"
+ ".cfi_def_cfa_offset 24;"
+ "addi 0,0,0;"
+ "addi 1,1,24;"
+ "ld 0,16(1);"
+ ".cfi_def_cfa_offset 0;"
+ );
+#elif !defined __mips__
__asm__ (
"pushq $0x10;"
".cfi_def_cfa_offset 16;"
diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py b/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
index c41600462561..a2558c77789b 100644
--- a/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
+++ b/packages/Python/lldbsuite/test/functionalities/unwind/noreturn/TestNoreturnUnwind.py
@@ -25,7 +25,7 @@ class NoreturnUnwind(TestBase):
self.build()
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py b/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
index 598efbc5e030..f971942322b1 100644
--- a/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
+++ b/packages/Python/lldbsuite/test/functionalities/unwind/sigtramp/TestSigtrampUnwind.py
@@ -25,7 +25,7 @@ class SigtrampUnwind(TestBase):
self.build()
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py b/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
index 2416128d2efa..4bacb0bd9884 100644
--- a/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
+++ b/packages/Python/lldbsuite/test/functionalities/unwind/standard/TestStandardUnwind.py
@@ -84,7 +84,7 @@ class StandardUnwindTest(TestBase):
else:
self.skipTest("No expectations for the current architecture")
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py b/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
index 8e3ab853e27d..1a8fbdf5e2ba 100644
--- a/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
+++ b/packages/Python/lldbsuite/test/functionalities/value_md5_crash/TestValueMD5Crash.py
@@ -27,7 +27,7 @@ class ValueMD5CrashTestCase(TestBase):
def test_with_run_command(self):
"""Verify that the hash computing logic for ValueObject's values can't crash us."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
index 9fac249936ea..d39d35f76883 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchlocation/TestWatchLocation.py
@@ -39,14 +39,14 @@ class HelloWatchLocationTestCase(TestBase):
# Most of the MIPS boards provide only one H/W watchpoints, and S/W
# watchpoints are not supported yet
@expectedFailureAll(triple=re.compile('^mips'))
- # SystemZ also currently supports only one H/W watchpoint
- @expectedFailureAll(archs=['s390x'])
+ # SystemZ and PowerPC also currently supports only one H/W watchpoint
+ @expectedFailureAll(archs=['powerpc64le', 's390x'])
@skipIfDarwin
def test_hello_watchlocation(self):
"""Test watching a location with '-s size' option."""
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
index 2cfba398bac9..8e19f9b3b5b8 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/hello_watchpoint/TestMyFirstWatchpoint.py
@@ -28,7 +28,7 @@ class HelloWatchpointTestCase(TestBase):
# And the watchpoint variable declaration line number.
self.decl = line_number(self.source,
'// Watchpoint variable declaration.')
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact('a.out')
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
@expectedFailureAll(
@@ -40,7 +40,7 @@ class HelloWatchpointTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
index ac2c2fb8ec5a..b51cab38aa86 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
@@ -27,7 +27,7 @@ class WatchpointSlotsTestCase(TestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
# This is a arm and aarch64 specific test case. No other architectures tested.
@@ -37,7 +37,7 @@ class WatchpointSlotsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Detect line number after which we are going to increment arrayName.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
index c21355a2e8f9..7302f76c1fbc 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_hits/TestMultipleHits.py
@@ -21,10 +21,10 @@ class MultipleHitsTestCase(TestBase):
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
- @skipIf(bugnumber="llvm.org/pr30758", oslist=["linux"], archs=["arm", "aarch64"])
+ @skipIf(bugnumber="llvm.org/pr30758", oslist=["linux"], archs=["arm", "aarch64", "powerpc64le"])
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
index 0c5798fdddfe..85d6c84d68ff 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
@@ -17,55 +17,26 @@ from lldbsuite.test import lldbutil
class WatchpointForMultipleThreadsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+ main_spec = lldb.SBFileSpec("main.cpp", False)
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
- def test_watchpoint_multiple_threads(self):
- """Test that lldb watchpoint works for multiple threads."""
- self.build()
- self.setTearDownCleanup()
- self.hello_multiple_threads()
+ def test_watchpoint_before_thread_start(self):
+ """Test that we can hit a watchpoint we set before starting another thread"""
+ self.do_watchpoint_test("Before running the thread")
@expectedFailureAll(
oslist=["windows"],
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
- def test_watchpoint_multiple_threads_wp_set_and_then_delete(self):
- """Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""
+ def test_watchpoint_after_thread_start(self):
+ """Test that we can hit a watchpoint we set after starting another thread"""
+ self.do_watchpoint_test("After running the thread")
+
+ def do_watchpoint_test(self, line):
self.build()
- self.setTearDownCleanup()
- self.hello_multiple_threads_wp_set_and_then_delete()
-
- def setUp(self):
- # Call super's setUp().
- TestBase.setUp(self)
- # Our simple source filename.
- self.source = 'main.cpp'
- # Find the line number to break inside main().
- self.first_stop = line_number(
- self.source, '// Set break point at this line')
-
- def hello_multiple_threads(self):
- """Test that lldb watchpoint works for multiple threads."""
- self.runCmd(
- "file %s" %
- os.path.join(
- os.getcwd(),
- 'a.out'),
- CURRENT_EXECUTABLE_SET)
-
- # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
- lldbutil.run_break_set_by_file_and_line(
- self, None, self.first_stop, num_expected_locations=1)
-
- # Run the program.
- self.runCmd("run", RUN_SUCCEEDED)
-
- # We should be stopped again due to the breakpoint.
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint'])
+ lldbutil.run_to_source_breakpoint(self, line, self.main_spec)
# Now let's set a write-type watchpoint for variable 'g_val'.
self.expect(
@@ -81,43 +52,29 @@ class WatchpointForMultipleThreadsTestCase(TestBase):
self.expect("watchpoint list -v",
substrs=['hit_count = 0'])
- while True:
- self.runCmd("process continue")
+ self.runCmd("process continue")
- self.runCmd("thread list")
- if "stop reason = watchpoint" in self.res.GetOutput():
- # Good, we verified that the watchpoint works!
- self.runCmd("thread backtrace all")
- break
- else:
- self.fail("The stop reason should be either break or watchpoint")
+ self.runCmd("thread list")
+ if "stop reason = watchpoint" in self.res.GetOutput():
+ # Good, we verified that the watchpoint works!
+ self.runCmd("thread backtrace all")
+ else:
+ self.fail("The stop reason should be either break or watchpoint")
# Use the '-v' option to do verbose listing of the watchpoint.
# The hit count should now be 1.
self.expect("watchpoint list -v",
substrs=['hit_count = 1'])
- def hello_multiple_threads_wp_set_and_then_delete(self):
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
+ def test_watchpoint_multiple_threads_wp_set_and_then_delete(self):
"""Test that lldb watchpoint works for multiple threads, and after the watchpoint is deleted, the watchpoint event should no longer fires."""
- self.runCmd(
- "file %s" %
- os.path.join(
- os.getcwd(),
- 'a.out'),
- CURRENT_EXECUTABLE_SET)
-
- # Add a breakpoint to set a watchpoint when stopped on the breakpoint.
- lldbutil.run_break_set_by_file_and_line(
- self, None, self.first_stop, num_expected_locations=1)
-
- # Run the program.
- self.runCmd("run", RUN_SUCCEEDED)
-
- # We should be stopped again due to the breakpoint.
- # The stop reason of the thread should be breakpoint.
- self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
- substrs=['stopped',
- 'stop reason = breakpoint'])
+ self.build()
+ self.setTearDownCleanup()
+
+ lldbutil.run_to_source_breakpoint(self, "After running the thread", self.main_spec)
# Now let's set a write-type watchpoint for variable 'g_val'.
self.expect(
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp
index 7f2e5e6e6cb5..1bfc3b2538b2 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/main.cpp
@@ -7,73 +7,29 @@
//
//===----------------------------------------------------------------------===//
-#include <chrono>
+#include "pseudo_barrier.h"
#include <cstdio>
-#include <mutex>
-#include <random>
#include <thread>
-std::default_random_engine g_random_engine{std::random_device{}()};
-std::uniform_int_distribution<> g_distribution{0, 3000000};
+volatile uint32_t g_val = 0;
+pseudo_barrier_t g_barrier;
-uint32_t g_val = 0;
-
-
-uint32_t
-access_pool (bool flag = false)
-{
- static std::mutex g_access_mutex;
- g_access_mutex.lock();
-
- uint32_t old_val = g_val;
- if (flag)
- {
- printf("changing g_val to %d...\n", old_val + 1);
- g_val = old_val + 1;
- }
-
- g_access_mutex.unlock();
- return g_val;
-}
-
-void
-thread_func (uint32_t thread_index)
-{
- printf ("%s (thread index = %u) starting...\n", __FUNCTION__, thread_index);
-
- uint32_t count = 0;
- uint32_t val;
- while (count++ < 15)
- {
- // random micro second sleep from zero to 3 seconds
- int usec = g_distribution(g_random_engine);
- printf ("%s (thread = %u) doing a usleep (%d)...\n", __FUNCTION__, thread_index, usec);
- std::this_thread::sleep_for(std::chrono::microseconds{usec});
-
- if (count < 7)
- val = access_pool ();
- else
- val = access_pool (true);
-
- printf ("%s (thread = %u) after usleep access_pool returns %d (count=%d)...\n", __FUNCTION__, thread_index, val, count);
- }
- printf ("%s (thread index = %u) exiting...\n", __FUNCTION__, thread_index);
+void thread_func() {
+ pseudo_barrier_wait(g_barrier);
+ printf("%s starting...\n", __FUNCTION__);
+ for (uint32_t i = 0; i < 10; ++i)
+ g_val = i;
}
+int main(int argc, char const *argv[]) {
+ printf("Before running the thread\n");
+ pseudo_barrier_init(g_barrier, 2);
+ std::thread thread(thread_func);
-int main (int argc, char const *argv[])
-{
- std::thread threads[3];
-
- printf ("Before turning all three threads loose...\n"); // Set break point at this line,
- // in order to set our watchpoint.
- // Create 3 threads
- for (auto &thread : threads)
- thread = std::thread{thread_func, std::distance(threads, &thread)};
+ printf("After running the thread\n");
+ pseudo_barrier_wait(g_barrier);
- // Join all of our threads
- for (auto &thread : threads)
- thread.join();
+ thread.join();
- return 0;
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
index 71686a5f5c49..e0c77b4ea6be 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/step_over_watchpoint/TestStepOverWatchpoint.py
@@ -29,7 +29,7 @@ class TestStepOverWatchpoint(TestBase):
def test(self):
"""Test stepping over watchpoints."""
self.build()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
@@ -81,7 +81,7 @@ class TestStepOverWatchpoint(TestBase):
# Most of the MIPS boards provide only one H/W watchpoints, and S/W
# watchpoints are not supported yet
arch = self.getArchitecture()
- if re.match("^mips", arch):
+ if re.match("^mips", arch) or re.match("powerpc64le", arch):
self.runCmd("watchpoint delete 1")
# resolve_location=True, read=False, write=True
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
index 47454498e70e..b2f267364dd0 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/variable_out_of_scope/TestWatchedVarHitWhenInScope.py
@@ -18,13 +18,11 @@ class WatchedVariableHitWhenInScopeTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- #
# This test depends on not tracking watchpoint expression hits if we have
# left the watchpoint scope. We will provide such an ability at some point
# but the way this was done was incorrect, and it is unclear that for the
# most part that's not what folks mostly want, so we have to provide a
# clearer API to express this.
- #
def setUp(self):
# Call super's setUp().
@@ -36,13 +34,13 @@ class WatchedVariableHitWhenInScopeTestCase(TestBase):
# Test hangs due to a kernel bug, see fdfeff0f in the linux kernel for details
@skipIfTargetAndroid(api_levels=list(range(25+1)), archs=["aarch64", "arm"])
- @unittest2.expectedFailure("rdar://problem/18685649")
+ @skipIf
def test_watched_var_should_only_hit_when_in_scope(self):
"""Test that a variable watchpoint should only hit when in scope."""
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped in main.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
index 82865e646be5..5bb683934c1b 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/TestWatchpointCommands.py
@@ -46,7 +46,7 @@ class WatchpointCommandsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -117,7 +117,7 @@ class WatchpointCommandsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -174,7 +174,7 @@ class WatchpointCommandsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -234,7 +234,7 @@ class WatchpointCommandsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -304,7 +304,7 @@ class WatchpointCommandsTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
index a4ceca34c086..cd819f27ec5f 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
@@ -45,7 +45,7 @@ class WatchpointLLDBCommandTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -113,7 +113,7 @@ class WatchpointLLDBCommandTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
index 50cd88bd8625..d9edd05d3a76 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
@@ -46,7 +46,7 @@ class WatchpointPythonCommandTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -116,7 +116,7 @@ class WatchpointPythonCommandTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
@@ -144,7 +144,8 @@ class WatchpointPythonCommandTestCase(TestBase):
(self.source,
self.decl)])
- cmd_script_file = os.path.join(os.getcwd(), "watchpoint_command.py")
+ cmd_script_file = os.path.join(self.getSourceDir(),
+ "watchpoint_command.py")
self.runCmd("command script import '%s'" % (cmd_script_file))
self.runCmd(
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
index 34502a6d1d36..a77b1e70e3dd 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
@@ -45,7 +45,7 @@ class WatchpointConditionCmdTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
index dad633f052c6..587dcabb2ba3 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_disable/TestWatchpointDisable.py
@@ -35,16 +35,12 @@ class TestWatchpointSetEnable(TestBase):
def do_test(self, test_enable):
"""Set a watchpoint, disable it and make sure it doesn't get hit."""
- exe = 'a.out'
-
- exe = os.path.join(os.getcwd(), exe)
+ exe = self.getBuildArtifact("a.out")
main_file_spec = lldb.SBFileSpec("main.c")
# Create a target by the debugger.
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
- cwd = os.getcwd()
-
bkpt_before = self.target.BreakpointCreateBySourceRegex("Set a breakpoint here", main_file_spec)
self.assertEqual(bkpt_before.GetNumLocations(), 1, "Failed setting the before breakpoint.")
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
index ea2580382520..cedfad9b566f 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
@@ -33,7 +33,7 @@ class TestWatchpointEvents (TestBase):
"""Test that adding, deleting and modifying watchpoints sends the appropriate events."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
index ee4b05c12659..5b72f5edda74 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_on_vectors/TestValueOfVectorVariable.py
@@ -22,8 +22,10 @@ class TestValueOfVectorVariableTestCase(TestBase):
bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not supported on Windows")
def test_value_of_vector_variable_using_watchpoint_set(self):
"""Test verify displayed value of vector variable."""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
+ exe = self.getBuildArtifact("a.out")
+ d = {'C_SOURCES': self.source, 'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
self.value_of_vector_variable_with_watchpoint_set()
def setUp(self):
@@ -31,12 +33,10 @@ class TestValueOfVectorVariableTestCase(TestBase):
TestBase.setUp(self)
# Our simple source filename.
self.source = 'main.c'
- self.exe_name = 'a.out'
- self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
def value_of_vector_variable_with_watchpoint_set(self):
"""Test verify displayed value of vector variable"""
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Set break to get a frame
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
index b53e323cf4bd..c7f7d02392eb 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchLocationWithWatchSet.py
@@ -44,7 +44,7 @@ class WatchLocationUsingWatchpointSetTestCase(TestBase):
self.build()
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
index 7460a1c09476..e6718f0bc6f0 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_set_command/TestWatchpointSetErrorCases.py
@@ -33,7 +33,7 @@ class WatchpointSetErrorTestCase(TestBase):
self.build()
self.setTearDownCleanup()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Add a breakpoint to set a watchpoint when stopped on the breakpoint.
diff --git a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
index ee6402489330..d4f78a5f3ecc 100644
--- a/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
+++ b/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_size/TestWatchpointSizes.py
@@ -28,7 +28,7 @@ class WatchpointSizeTestCase(TestBase):
self.source = 'main.c'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'C_SOURCES': self.source, 'EXE': self.exe_name}
@expectedFailureAll(
@@ -62,7 +62,7 @@ class WatchpointSizeTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Detect line number after which we are going to increment arrayName.
diff --git a/packages/Python/lldbsuite/test/functionalities/wrong_commands/.categories b/packages/Python/lldbsuite/test/functionalities/wrong_commands/.categories
new file mode 100644
index 000000000000..3a3f4df6416b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/wrong_commands/.categories
@@ -0,0 +1 @@
+cmdline
diff --git a/packages/Python/lldbsuite/test/functionalities/wrong_commands/TestWrongCommands.py b/packages/Python/lldbsuite/test/functionalities/wrong_commands/TestWrongCommands.py
new file mode 100644
index 000000000000..c25f9afbfa4e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/functionalities/wrong_commands/TestWrongCommands.py
@@ -0,0 +1,39 @@
+"""
+Test how lldb reacts to wrong commands
+"""
+
+from __future__ import print_function
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class UnknownCommandTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test
+ def test_ambiguous_command(self):
+ command_interpreter = self.dbg.GetCommandInterpreter()
+ self.assertTrue(command_interpreter, VALID_COMMAND_INTERPRETER)
+ result = lldb.SBCommandReturnObject()
+
+ command_interpreter.HandleCommand("g", result)
+ self.assertFalse(result.Succeeded())
+ self.assertRegexpMatches(result.GetError(), "Ambiguous command 'g'. Possible matches:")
+ self.assertRegexpMatches(result.GetError(), "gui")
+ self.assertRegexpMatches(result.GetError(), "gdb-remote")
+ self.assertEquals(1, result.GetError().count("gdb-remote"))
+
+ @no_debug_info_test
+ def test_unknown_command(self):
+ command_interpreter = self.dbg.GetCommandInterpreter()
+ self.assertTrue(command_interpreter, VALID_COMMAND_INTERPRETER)
+ result = lldb.SBCommandReturnObject()
+
+ command_interpreter.HandleCommand("qbert", result)
+ self.assertFalse(result.Succeeded())
+ self.assertEquals(result.GetError(), "error: 'qbert' is not a valid command.\n")
diff --git a/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py b/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
index 6d5f61ebb8bb..930a09412eab 100644
--- a/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
+++ b/packages/Python/lldbsuite/test/lang/c/anonymous/TestAnonymous.py
@@ -88,7 +88,7 @@ class AnonymousTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -150,7 +150,7 @@ class AnonymousTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py b/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
index d4716de907c7..d14534db69cf 100644
--- a/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
+++ b/packages/Python/lldbsuite/test/lang/c/array_types/TestArrayTypes.py
@@ -24,7 +24,7 @@ class ArrayTypesTestCase(TestBase):
def test_and_run_command(self):
"""Test 'frame variable var_name' on some variables with array types."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
@@ -85,7 +85,7 @@ class ArrayTypesTestCase(TestBase):
def test_and_python_api(self):
"""Use Python APIs to inspect variables with array types."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py b/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
index 4d0eb48c3b5b..22b8a2991001 100644
--- a/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
+++ b/packages/Python/lldbsuite/test/lang/c/bitfields/TestBitfields.py
@@ -27,7 +27,7 @@ class BitfieldsTestCase(TestBase):
def test_and_run_command(self):
"""Test 'frame variable ...' on a variable with bitfields."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
@@ -123,7 +123,7 @@ class BitfieldsTestCase(TestBase):
def test_and_python_api(self):
"""Use Python APIs to inspect a bitfields variable."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py b/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
index 4025635eec6f..c7693c98f545 100644
--- a/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
+++ b/packages/Python/lldbsuite/test/lang/c/blocks/TestBlocks.py
@@ -26,7 +26,7 @@ class BlocksTestCase(TestBase):
def launch_common(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.is_started = False
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile
index f8a04bd32b90..979cefe9b7fe 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile
@@ -1,18 +1,16 @@
LEVEL := ../../../make
-LD_EXTRAS := -L. -l$(LIB_PREFIX)One -l$(LIB_PREFIX)Two
+LD_EXTRAS := -L. -LOne -l$(LIB_PREFIX)One -LTwo -l$(LIB_PREFIX)Two
C_SOURCES := main.c
-main.o : CFLAGS_EXTRAS += -g -O0
-
include $(LEVEL)/Makefile.rules
.PHONY:
a.out: lib_One lib_Two
lib_%:
- $(MAKE) -f $*.mk
+ $(MAKE) VPATH=$(SRCDIR)/$* -I $(SRCDIR) -f $(SRCDIR)/$*.mk
clean::
- $(MAKE) -f One.mk clean
- $(MAKE) -f Two.mk clean
+ $(MAKE) -f $(SRCDIR)/One.mk clean
+ $(MAKE) -f $(SRCDIR)/Two.mk clean
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk
index 04f894c595e8..130c7dd511bb 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One.mk
@@ -1,12 +1,10 @@
LEVEL := ../../../make
DYLIB_NAME := One
-DYLIB_C_SOURCES := One/One.c One/OneConstant.c
+DYLIB_C_SOURCES := One.c OneConstant.c
DYLIB_ONLY := YES
include $(LEVEL)/Makefile.rules
-CFLAGS_EXTRAS += -fPIC
-
-One/OneConstant.o: One/OneConstant.c
+OneConstant.o: OneConstant.c
$(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h
index b59f5ad13f22..aae27571bb9c 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/One/One.h
@@ -1,4 +1,4 @@
#ifndef ONE_H
#define ONE_H
-void one();
+LLDB_TEST_API void one();
#endif
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
index 328c383b38fb..fa14e5ef62e6 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/TestConflictingSymbol.py
@@ -18,15 +18,14 @@ class TestConflictingSymbols(TestBase):
def setUp(self):
TestBase.setUp(self)
+ lldbutil.mkdir_p(self.getBuildArtifact("One"))
+ lldbutil.mkdir_p(self.getBuildArtifact("Two"))
- self.One_line = line_number('One/One.c', '// break here')
- self.Two_line = line_number('Two/Two.c', '// break here')
- self.main_line = line_number('main.c', '// break here')
-
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
def test_conflicting_symbols(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- target = self.dbg.CreateTarget("a.out")
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# Register our shared libraries for remote targets so they get
@@ -34,12 +33,12 @@ class TestConflictingSymbols(TestBase):
environment = self.registerSharedLibrariesWithTarget(
target, ['One', 'Two'])
- lldbutil.run_break_set_command(
- self, 'breakpoint set -f One.c -l %s' % (self.One_line))
- lldbutil.run_break_set_command(
- self, 'breakpoint set -f Two.c -l %s' % (self.Two_line))
- lldbutil.run_break_set_by_file_and_line(
- self, 'main.c', self.main_line, num_expected_locations=1, loc_exact=True)
+ lldbutil.run_break_set_by_source_regexp(self, '// break here',
+ extra_options='-f One.c', num_expected_locations=-2)
+ lldbutil.run_break_set_by_source_regexp(self, '// break here',
+ extra_options='-f Two.c', num_expected_locations=-2)
+ lldbutil.run_break_set_by_source_regexp(self, '// break here',
+ extra_options='-f main.c', num_expected_locations=1)
process = target.LaunchSimple(
None, environment, self.get_process_working_directory())
@@ -96,8 +95,8 @@ class TestConflictingSymbols(TestBase):
@expectedFailureAll(bugnumber="llvm.org/pr35043")
def test_shadowed(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
- target = self.dbg.CreateTarget("a.out")
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
# Register our shared libraries for remote targets so they get
@@ -105,7 +104,8 @@ class TestConflictingSymbols(TestBase):
environment = self.registerSharedLibrariesWithTarget(
target, ['One', 'Two'])
- lldbutil.run_break_set_by_file_and_line(self, 'main.c', self.main_line)
+ lldbutil.run_break_set_by_source_regexp(self, '// break here',
+ extra_options='-f main.c', num_expected_locations=1)
process = target.LaunchSimple(
None, environment, self.get_process_working_directory())
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk
index 117d9e00d443..ebe58cc743fc 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two.mk
@@ -1,12 +1,10 @@
LEVEL := ../../../make
DYLIB_NAME := Two
-DYLIB_C_SOURCES := Two/Two.c Two/TwoConstant.c
+DYLIB_C_SOURCES := Two.c TwoConstant.c
DYLIB_ONLY := YES
include $(LEVEL)/Makefile.rules
-CFLAGS_EXTRAS += -fPIC
-
-Two/TwoConstant.o: Two/TwoConstant.c
+TwoConstant.o: TwoConstant.c
$(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@
diff --git a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h
index 8d5bd6a32330..450fe5a3551f 100644
--- a/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h
+++ b/packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Two/Two.h
@@ -1,4 +1,4 @@
#ifndef TWO_H
#define TWO_H
-void two();
+LLDB_TEST_API void two();
#endif
diff --git a/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py b/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
index d54435a4c677..bf86e03035ff 100644
--- a/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
+++ b/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
@@ -38,7 +38,7 @@ class ConstVariableTestCase(TestBase):
def test_and_run_command(self):
"""Test interpreted and JITted expressions on constant values."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py b/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
index b4ea9fae043b..53ee2196aa42 100644
--- a/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
+++ b/packages/Python/lldbsuite/test/lang/c/enum_types/TestEnumTypes.py
@@ -24,7 +24,7 @@ class EnumTypesTestCase(TestBase):
def test(self):
"""Test 'image lookup -t days' and check for correct display and enum value printing."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py b/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
index bbe5be67c08d..75aef291cc49 100644
--- a/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
+++ b/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
@@ -33,7 +33,7 @@ class TestFindTypesOnStructType(TestBase):
def do_test(self):
"""Make sure FindTypes actually finds 'struct typename' not just 'typename'."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py b/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
index 60e7073f146d..2537beb87df7 100644
--- a/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
+++ b/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
@@ -7,6 +7,7 @@ import os
import time
import lldb
from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
import lldbsuite.test.lldbutil as lldbutil
@@ -14,10 +15,10 @@ class ForwardDeclarationTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- def test_and_run_command(self):
+ def do_test(self, dictionary=None):
"""Display *bar_ptr when stopped on a function with forward declaration of struct bar."""
- self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ self.build(dictionary=dictionary)
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
@@ -53,3 +54,15 @@ class ForwardDeclarationTestCase(TestBase):
'(bar)',
'(int) a = 1',
'(int) b = 2'])
+
+ def test(self):
+ self.do_test()
+
+ @no_debug_info_test
+ @skipIfDarwin
+ @skipIf(compiler=no_match("clang"))
+ @skipIf(compiler_version=["<", "7.0"])
+ def test_debug_names(self):
+ """Test that we are able to find complete types when using DWARF v5
+ accelerator tables"""
+ self.do_test(dict(CFLAGS_EXTRAS="-mllvm -accel-tables=Dwarf"))
diff --git a/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py b/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
index 35e902e5bdcb..7ed8a28546cb 100644
--- a/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
+++ b/packages/Python/lldbsuite/test/lang/c/function_types/TestFunctionTypes.py
@@ -66,7 +66,7 @@ class FunctionTypesTestCase(TestBase):
startstr='(int) $2 = 12')
def runToBreakpoint(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py b/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
index dd4da061fdcf..36b684b60fb2 100644
--- a/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ b/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -22,12 +22,28 @@ class GlobalVariablesTestCase(TestBase):
self.shlib_names = ["a"]
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
+ @expectedFailureAll(oslist=["linux"], archs=["aarch64"], bugnumber="llvm.org/pr37301")
+ def test_without_process(self):
+ """Test that static initialized variables can be inspected without
+ process."""
+ self.build()
+
+ # Create a target by the debugger.
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+
+ self.assertTrue(target, VALID_TARGET)
+ self.expect("target variable g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int *)'])
+ self.expect("target variable *g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['42'])
+
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test_c_global_variables(self):
"""Test 'frame variable --scope --no-args' which omits args and shows scopes."""
self.build()
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Break inside the main.
@@ -53,18 +69,28 @@ class GlobalVariablesTestCase(TestBase):
self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
substrs=[' resolved, hit count = 1'])
+ # Test that the statically initialized variable can also be
+ # inspected *with* a process.
+ self.expect("target variable g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int *)'])
+ self.expect("target variable *g_ptr", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['42'])
+
# Check that GLOBAL scopes are indicated for the variables.
self.expect(
"frame variable --show-types --scope --show-globals --no-args",
VARIABLES_DISPLAYED_CORRECTLY,
substrs=[
- 'GLOBAL: (int) g_file_global_int = 42',
'STATIC: (const int) g_file_static_int = 2',
+ 'STATIC: (const char *) g_func_static_cstr',
'GLOBAL: (const char *) g_file_global_cstr',
'"g_file_global_cstr"',
+ 'GLOBAL: (int) g_file_global_int = 42',
+ 'GLOBAL: (int) g_common_1 = 21',
+ 'GLOBAL: (int *) g_ptr',
'STATIC: (const char *) g_file_static_cstr',
- '"g_file_static_cstr"',
- 'GLOBAL: (int) g_common_1 = 21'])
+ '"g_file_static_cstr"'
+ ])
# 'frame variable' should support address-of operator.
self.runCmd("frame variable &g_file_global_int")
@@ -95,3 +121,4 @@ class GlobalVariablesTestCase(TestBase):
VARIABLES_DISPLAYED_CORRECTLY,
matching=False,
substrs=["can't be resolved"])
+
diff --git a/packages/Python/lldbsuite/test/lang/c/global_variables/main.c b/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
index 499b2504774f..b37c97bad9db 100644
--- a/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ b/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -13,6 +13,7 @@ int g_file_global_int = 42;
static const int g_file_static_int = 2;
const char *g_file_global_cstr = "g_file_global_cstr";
static const char *g_file_static_cstr = "g_file_static_cstr";
+int *g_ptr = &g_file_global_int;
extern int g_a;
int main (int argc, char const *argv[])
@@ -20,5 +21,5 @@ int main (int argc, char const *argv[])
g_common_1 = g_file_global_int / g_file_static_int;
static const char *g_func_static_cstr = "g_func_static_cstr";
printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
- return g_file_global_int + g_a + g_common_1; // Set break point at this line. //// break $source:$line; continue; var -global g_a -global g_global_int
+ return g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point at this line. //// break $source:$line; continue; var -global g_a -global g_global_int
}
diff --git a/packages/Python/lldbsuite/test/lang/c/inlines/main.c b/packages/Python/lldbsuite/test/lang/c/inlines/main.c
index 415f97aedbd4..8fe49180800b 100644
--- a/packages/Python/lldbsuite/test/lang/c/inlines/main.c
+++ b/packages/Python/lldbsuite/test/lang/c/inlines/main.c
@@ -21,4 +21,5 @@ void test1(int a) {
int main() {
test2(42);
test1(23);
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py b/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
index af6c3a722e40..8d8d57bc9ca3 100644
--- a/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
+++ b/packages/Python/lldbsuite/test/lang/c/modules/TestCModules.py
@@ -28,7 +28,7 @@ class CModulesTestCase(TestBase):
@skipIf(macos_version=["<", "10.12"])
def test_expr(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py b/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
index 1f3ae3ffcb59..8221148c29af 100644
--- a/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
+++ b/packages/Python/lldbsuite/test/lang/c/register_variables/TestRegisterVariables.py
@@ -114,7 +114,7 @@ class RegisterVariableTestCase(TestBase):
register_variables_count = 0
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/c/register_variables/test.c b/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
index f7fb1af13220..2c69039d40a2 100644
--- a/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
+++ b/packages/Python/lldbsuite/test/lang/c/register_variables/test.c
@@ -1,6 +1,6 @@
#include <stdio.h>
-#if defined(__arm__) || defined(__aarch64__) || defined (__mips__)
+#if defined(__arm__) || defined(__aarch64__) || defined (__mips__) || defined(__powerpc64__)
// Clang does not accept regparm attribute on these platforms.
// Fortunately, the default calling convention passes arguments in registers
// anyway.
diff --git a/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py b/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
index bb94f1c4182b..14677fc548a2 100644
--- a/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
+++ b/packages/Python/lldbsuite/test/lang/c/set_values/TestSetValues.py
@@ -28,7 +28,7 @@ class SetValuesTestCase(TestBase):
def test(self):
"""Test settings and readings of program variables."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Set breakpoints on several places to set program variables.
diff --git a/packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile b/packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile
index 854002e64708..35d712c3f17f 100644
--- a/packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile
+++ b/packages/Python/lldbsuite/test/lang/c/shared_lib/Makefile
@@ -3,6 +3,5 @@ LEVEL = ../../../make
DYLIB_NAME := foo
DYLIB_C_SOURCES := foo.c
C_SOURCES := main.c
-CFLAGS_EXTRAS += -fPIC
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py b/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
index 5505d15854d1..f53a19138356 100644
--- a/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
+++ b/packages/Python/lldbsuite/test/lang/c/shared_lib/TestSharedLib.py
@@ -45,7 +45,7 @@ class SharedLibTestCase(TestBase):
"""Test that types work when defined in a shared library and forward-declared in the main executable, but with preloading disabled"""
self.common_test_expr(False)
- @unittest2.expectedFailure("rdar://problem/10704639")
+ @unittest2.expectedFailure("llvm.org/PR36712")
def test_frame_variable(self):
"""Test that types work when defined in a shared library and forward-declared in the main executable"""
self.build()
@@ -73,7 +73,7 @@ class SharedLibTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
self.runCmd("settings set target.preload-symbols " + str(preload_symbols).lower())
diff --git a/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile b/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile
index 51347d73f09c..6d1f1071bf2f 100644
--- a/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile
+++ b/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/Makefile
@@ -3,7 +3,6 @@ LEVEL = ../../../make
DYLIB_NAME := foo
DYLIB_C_SOURCES := foo.c
C_SOURCES := main.c
-CFLAGS_EXTRAS += -fPIC
SPLIT_DEBUG_SYMBOLS = YES
diff --git a/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py b/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
index 7b371a2a9a99..3731d1a1eb65 100644
--- a/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
+++ b/packages/Python/lldbsuite/test/lang/c/shared_lib_stripped_symbols/TestSharedLibStrippedSymbols.py
@@ -16,7 +16,7 @@ class SharedLibStrippedTestCase(TestBase):
@expectedFailureAll(oslist=["windows"])
def test_expr(self):
- """Test that types work when defined in a shared library and forward-declared in the main executable"""
+ """Test that types work when defined in a shared library and forwa/d-declared in the main executable"""
if "clang" in self.getCompiler() and "3.4" in self.getCompilerVersion():
self.skipTest(
"llvm.org/pr16214 -- clang emits partial DWARF for structures referenced via typedef")
@@ -34,7 +34,7 @@ class SharedLibStrippedTestCase(TestBase):
"other_element = 3"])
@expectedFailureAll(oslist=["windows"])
- @unittest2.expectedFailure("rdar://problem/10381325")
+ @unittest2.expectedFailure("llvm.org/PR36712")
def test_frame_variable(self):
"""Test that types work when defined in a shared library and forward-declared in the main executable"""
self.build()
@@ -62,7 +62,7 @@ class SharedLibStrippedTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py b/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
index 90f07860afa7..aeda9ff41eb2 100644
--- a/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
+++ b/packages/Python/lldbsuite/test/lang/c/step-target/TestStepTarget.py
@@ -24,7 +24,7 @@ class TestStepTarget(TestBase):
@add_test_categories(['pyapi'])
def get_to_start(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -52,6 +52,7 @@ class TestStepTarget(TestBase):
thread = threads[0]
return thread
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_end_line(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
@@ -63,6 +64,7 @@ class TestStepTarget(TestBase):
self.assertTrue(frame.name == "lotsOfArgs", "Stepped to lotsOfArgs.")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_end_line_bad_name(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
@@ -75,6 +77,7 @@ class TestStepTarget(TestBase):
frame.line_entry.line == self.end_line,
"Stepped to the block end.")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_end_line_deeper(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
@@ -85,6 +88,7 @@ class TestStepTarget(TestBase):
frame = thread.frames[0]
self.assertTrue(frame.name == "modifyInt", "Stepped to modifyInt.")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_command_and_block(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
@@ -100,6 +104,7 @@ class TestStepTarget(TestBase):
frame = thread.frames[0]
self.assertTrue(frame.name == "lotsOfArgs", "Stepped to lotsOfArgs.")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr32343")
def test_with_command_and_block_and_bad_name(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
diff --git a/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py b/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
index e1916a550a12..4a4052cfa335 100644
--- a/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
+++ b/packages/Python/lldbsuite/test/lang/c/stepping/TestStepAndBreakpoints.py
@@ -28,7 +28,7 @@ class TestCStepping(TestBase):
def test_and_python_api(self):
"""Test stepping over vrs. hitting breakpoints & subsequent stepping in various forms."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py b/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
index c436000d882f..62a0bf8e33eb 100644
--- a/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
+++ b/packages/Python/lldbsuite/test/lang/c/stepping/TestThreadStepping.py
@@ -34,7 +34,7 @@ class ThreadSteppingTestCase(TestBase):
def test_step_out_with_run_command(self):
"""Exercise thread step-out and frame select followed by thread step-out."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Create a breakpoint inside function 'c'.
diff --git a/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py b/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
index 27821845e280..b1c8a5ecf4bf 100644
--- a/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
+++ b/packages/Python/lldbsuite/test/lang/c/strings/TestCStrings.py
@@ -15,7 +15,7 @@ class CStringsTestCase(TestBase):
def test_with_run_command(self):
"""Tests that C strings work as expected in expressions"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
line = line_number('main.c', '// breakpoint 1')
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile b/packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile
index 90affed8e3ad..0faad10b24af 100644
--- a/packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile
+++ b/packages/Python/lldbsuite/test/lang/c/tls_globals/Makefile
@@ -1,7 +1,6 @@
LEVEL = ../../../make
C_SOURCES := main.c
-CFLAGS_EXTRAS += -fPIC
DYLIB_NAME := a
DYLIB_C_SOURCES := a.c
diff --git a/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py b/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
index 4388d95840eb..b76cd411b5ca 100644
--- a/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
+++ b/packages/Python/lldbsuite/test/lang/c/tls_globals/TestTlsGlobals.py
@@ -29,10 +29,10 @@ class TlsGlobalTestCase(TestBase):
"=" +
os.environ["LD_LIBRARY_PATH"] +
":" +
- os.getcwd())
+ self.getBuildDir())
else:
self.runCmd("settings set target.env-vars " +
- self.dylibPath + "=" + os.getcwd())
+ self.dylibPath + "=" + self.getBuildDir())
self.addTearDownHook(
lambda: self.runCmd(
"settings remove target.env-vars " +
@@ -48,7 +48,7 @@ class TlsGlobalTestCase(TestBase):
def test(self):
"""Test thread-local storage."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
if self.platformIsDarwin():
self.registerSharedLibrariesWithTarget(target, ['liba.dylib'])
diff --git a/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py b/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
index 71d00c5a9a67..bbae76b5752a 100644
--- a/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
+++ b/packages/Python/lldbsuite/test/lang/c/typedef/Testtypedef.py
@@ -26,7 +26,7 @@ class TypedefTestCase(TestBase):
def image_lookup_for_multiple_typedefs(self):
"""Test 'image lookup -t a' at different scopes and check for correct display."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
typearray = (
"float",
diff --git a/packages/Python/lldbsuite/test/lang/c/unicode/Makefile b/packages/Python/lldbsuite/test/lang/c/unicode/Makefile
new file mode 100644
index 000000000000..efabc4d4335c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/c/unicode/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+C_SOURCES := main.c
+CFLAGS_EXTRAS += -finput-charset=UTF-8 -fextended-identifiers -std=c99
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py b/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
new file mode 100644
index 000000000000..b2c9bbb83c0f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/c/unicode/TestUnicodeSymbols.py
@@ -0,0 +1,20 @@
+# coding=utf8
+import lldb
+from lldbsuite.test.lldbtest import *
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.decorators import *
+
+
+class TestUnicodeSymbols(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_union_members(self):
+ self.build()
+ spec = lldb.SBModuleSpec()
+ spec.SetFileSpec(lldb.SBFileSpec(self.getBuildArtifact("a.out")))
+ module = lldb.SBModule(spec)
+ self.assertTrue(module.IsValid())
+ mytype = module.FindFirstType("foobár")
+ self.assertTrue(mytype.IsValid())
+ self.assertTrue(mytype.IsPointerType())
diff --git a/packages/Python/lldbsuite/test/lang/c/unicode/main.c b/packages/Python/lldbsuite/test/lang/c/unicode/main.c
new file mode 100644
index 000000000000..ae44dd0edfa8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/c/unicode/main.c
@@ -0,0 +1,5 @@
+typedef void *foob\u00E1r;
+foob\u00E1r X = 0;
+int main() {
+ return (long)X;
+}
diff --git a/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py b/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
index 496398b1d0ac..4965df2d8091 100644
--- a/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
+++ b/packages/Python/lldbsuite/test/lang/c/unions/TestUnionMembers.py
@@ -40,14 +40,12 @@ class TestUnionMembers(TestBase):
def _load_exe(self):
self.build()
- cwd = os.getcwd()
-
- src_file = os.path.join(cwd, "main.c")
+ src_file = os.path.join(self.getSourceDir(), "main.c")
self.src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(self.src_file_spec.IsValid(), "breakpoint file")
# Get the path of the executable
- exe_path = os.path.join(cwd, 'a.out')
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
self.target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py b/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
index 1fb7a5217495..b10b4986d378 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/auto/TestCPPAuto.py
@@ -18,7 +18,7 @@ class CPPAutoTestCase(TestBase):
def test_with_run_command(self):
"""Test that auto types work in the expression parser"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
line = line_number('main.cpp', '// break here')
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp
index 76fb95e0a34c..6aee25c21608 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/auto/main.cpp
@@ -12,5 +12,10 @@
int main()
{
std::string helloworld("hello world");
+
+ // Ensure std::string copy constructor is present in the binary, as we will
+ // use it in an expression.
+ std::string other = helloworld;
+
return 0; // break here
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py b/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
index 01f8cbacc360..27ea773c5dbf 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/bool/TestCPPBool.py
@@ -13,7 +13,7 @@ class CPPBoolTestCase(TestBase):
def test_with_run_command(self):
"""Test that bool types work in the expression parser"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
line = line_number('main.cpp', '// breakpoint 1')
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py b/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
index 81787e1e2260..a12051014dab 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/breakpoint-commands/TestCPPBreakpointCommands.py
@@ -35,7 +35,7 @@ class CPPBreakpointCommandsTestCase(TestBase):
"""Test a sequence of breakpoint command add, list, and delete."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py b/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
index b86cd2ac9c77..9b227bc8d3c8 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/call-function/TestCallCPPFunction.py
@@ -22,7 +22,7 @@ class CallCPPFunctionTestCase(TestBase):
def test_with_run_command(self):
"""Test calling a function by basename"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py b/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
index 0145bee3fc5c..a344c4f7d18a 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/chained-calls/TestCppChainedCalls.py
@@ -18,9 +18,7 @@ class TestCppChainedCalls(TestBase):
self.assertTrue(src_file_spec.IsValid(), "Main source file")
# Get the path of the executable
- cwd = os.getcwd()
- exe_file = "a.out"
- exe_path = os.path.join(cwd, exe_file)
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py b/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
index bf8605106adb..e37e76ae9c0d 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/char1632_t/TestChar1632T.py
@@ -32,7 +32,7 @@ class Char1632TestCase(TestBase):
def test(self):
"""Test that the C++11 support for char16_t and char32_t works correctly."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py b/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
index d167f0a5591d..97b0bfd8aee0 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/class_static/TestStaticVariables.py
@@ -27,7 +27,7 @@ class StaticVariableTestCase(TestBase):
def test_with_run_command(self):
"""Test that file and class static variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -39,7 +39,7 @@ class StaticVariableTestCase(TestBase):
substrs=['stopped',
'stop reason = breakpoint'])
- # global variables are no longer displayed with the "frame variable"
+ # Global variables are no longer displayed with the "frame variable"
# command.
self.expect(
'target variable A::g_points',
@@ -63,11 +63,57 @@ class StaticVariableTestCase(TestBase):
compiler=["clang"],
compiler_version=["<", "3.9"],
bugnumber='llvm.org/pr20550')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
+ def test_with_run_command_complete(self):
+ """
+ Test that file and class static variables display correctly with
+ complete debug information.
+ """
+ self.build()
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
+ self.assertTrue(target, VALID_TARGET)
+
+ # Global variables are no longer displayed with the "frame variable"
+ # command.
+ self.expect(
+ 'target variable A::g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ patterns=[
+ '\(PointType \[[1-9]*\]\) A::g_points = {', '(x = 1, y = 2)',
+ '(x = 11, y = 22)'
+ ])
+
+ # Ensure that we take the context into account and only print
+ # A::g_points.
+ self.expect(
+ 'target variable A::g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ matching=False,
+ patterns=['(x = 3, y = 4)', '(x = 33, y = 44)'])
+
+ # Finally, ensure that we print both points when not specifying a
+ # context.
+ self.expect(
+ 'target variable g_points',
+ VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=[
+ '(PointType [2]) g_points', '(x = 1, y = 2)',
+ '(x = 11, y = 22)', '(x = 3, y = 4)', '(x = 33, y = 44)'
+ ])
+
+ @expectedFailureAll(
+ compiler=["gcc"],
+ bugnumber="Compiler emits incomplete debug info")
+ @expectedFailureAll(
+ compiler=["clang"],
+ compiler_version=["<", "3.9"],
+ bugnumber='llvm.org/pr20550')
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
def test_with_python_api(self):
"""Test Python APIs on file and class static variables."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py b/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
index c915e4b32fad..759da716b187 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypes.py
@@ -24,7 +24,7 @@ class ClassTypesTestCase(TestBase):
def test_with_run_command(self):
"""Test 'frame variable this' when stopped on a class constructor."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break on the ctor function of class C.
@@ -61,7 +61,7 @@ class ClassTypesTestCase(TestBase):
def test_with_python_api(self):
"""Use Python APIs to create a breakpoint by (filespec, line)."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -72,7 +72,8 @@ class ClassTypesTestCase(TestBase):
fsDir = os.path.normpath(filespec.GetDirectory())
fsFile = filespec.GetFilename()
- self.assertTrue(fsDir == os.getcwd() and fsFile == "a.out",
+ self.assertTrue(fsDir == os.path.dirname(self.getBuildArtifact())
+ and fsFile == "a.out",
"FileSpec matches the executable")
bpfilespec = lldb.SBFileSpec("main.cpp", False)
@@ -119,7 +120,7 @@ class ClassTypesTestCase(TestBase):
def test_with_expr_parser(self):
"""Test 'frame variable this' and 'expr this' when stopped inside a constructor."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# rdar://problem/8516141
@@ -176,7 +177,7 @@ class ClassTypesTestCase(TestBase):
def test_with_constructor_name(self):
"""Test 'frame variable this' and 'expr this' when stopped inside a constructor."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -187,7 +188,8 @@ class ClassTypesTestCase(TestBase):
fsDir = os.path.normpath(filespec.GetDirectory())
fsFile = filespec.GetFilename()
- self.assertTrue(fsDir == os.getcwd() and fsFile == "a.out",
+ self.assertTrue(fsDir == os.path.dirname(self.getBuildArtifact())
+ and fsFile == "a.out",
"FileSpec matches the executable")
bpfilespec = lldb.SBFileSpec("main.cpp", False)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py b/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
index bc85ba5181e5..c83817874753 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/class_types/TestClassTypesDisassembly.py
@@ -78,7 +78,7 @@ class IterateFrameAndDisassembleTestCase(TestBase):
def breakOnCtor(self):
"""Setup/run the program so it stops on C's constructor."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break on the ctor function of class C.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
index 251e66c3c9f7..2d02cbe0f055 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/class_types/main.cpp
@@ -90,7 +90,7 @@ public:
B(ai, bi),
m_c_int(ci)
{
- printf("Within C::ctor() m_c_int=%d\n", m_c_int); // Set break point at this line.
+ std::printf("Within C::ctor() m_c_int=%d\n", m_c_int); // Set break point at this line.
}
//virtual
diff --git a/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py b/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
index c6f9d85cd2c8..c1d0d2362684 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/diamond/TestDiamond.py
@@ -13,7 +13,7 @@ class CPPTestDiamondInheritance(TestBase):
def test_with_run_command(self):
"""Test that virtual base classes work in when SBValue objects are used to explore the variable value"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/Makefile b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/Makefile
index aa3a0fcdcea4..314f1cb2f077 100644
--- a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/Makefile
+++ b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/Makefile
@@ -1,6 +1,5 @@
LEVEL = ../../../make
-C_SOURCES := main.c
-MAKE_DSYM := NO
+CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
new file mode 100644
index 000000000000..358b3b2d93ae
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
@@ -0,0 +1,66 @@
+"""
+Make sure if we have two classes with the same base name the
+dynamic value calculator doesn't confuse them
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import re
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+
+
+class DynamicValueSameBaseTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ # If your test case doesn't stress debug info, the
+ # set this to true. That way it won't be run once for
+ # each debug info format.
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_same_basename_this(self):
+ """Test that the we use the full name to resolve dynamic types."""
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.cpp")
+ self.sample_test()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def sample_test(self):
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ "Break here to get started", self.main_source_file)
+
+ # Set breakpoints in the two class methods and run to them:
+ namesp_bkpt = target.BreakpointCreateBySourceRegex("namesp function did something.", self.main_source_file)
+ self.assertEqual(namesp_bkpt.GetNumLocations(), 1, "Namespace breakpoint invalid")
+
+ virtual_bkpt = target.BreakpointCreateBySourceRegex("Virtual function did something.", self.main_source_file)
+ self.assertEqual(virtual_bkpt.GetNumLocations(), 1, "Virtual breakpoint invalid")
+
+ threads = lldbutil.continue_to_breakpoint(process, namesp_bkpt)
+ self.assertEqual(len(threads), 1, "Didn't stop at namespace breakpoint")
+
+ frame = threads[0].frame[0]
+ namesp_this = frame.FindVariable("this", lldb.eDynamicCanRunTarget)
+ # Clang specifies the type of this as "T *", gcc as "T * const". This
+ # erases the difference.
+ namesp_type = namesp_this.GetType().GetUnqualifiedType()
+ self.assertEqual(namesp_type.GetName(), "namesp::Virtual *", "Didn't get the right dynamic type")
+
+ threads = lldbutil.continue_to_breakpoint(process, virtual_bkpt)
+ self.assertEqual(len(threads), 1, "Didn't stop at virtual breakpoint")
+
+ frame = threads[0].frame[0]
+ virtual_this = frame.FindVariable("this", lldb.eDynamicCanRunTarget)
+ virtual_type = virtual_this.GetType().GetUnqualifiedType()
+ self.assertEqual(virtual_type.GetName(), "Virtual *", "Didn't get the right dynamic type")
+
+
+
diff --git a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/main.cpp
new file mode 100644
index 000000000000..38e46c03f41e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/main.cpp
@@ -0,0 +1,32 @@
+#include <stdio.h>
+
+namespace namesp
+{
+ class Virtual {
+ public:
+ virtual void doSomething() {
+ printf ("namesp function did something.\n");
+ }
+ };
+}
+
+class Virtual {
+ public:
+ virtual void doSomething() {
+ printf("Virtual function did something.\n");
+ }
+};
+
+int
+main()
+{
+ namesp::Virtual my_outer;
+ Virtual my_virtual;
+
+ // Break here to get started
+ my_outer.doSomething();
+ my_virtual.doSomething();
+
+ return 0;
+}
+
diff --git a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py
index 74b94517fa0f..497f17f4454c 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestCppValueCast.py
@@ -19,8 +19,7 @@ class CppValueCastTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- @unittest2.expectedFailure(
- "rdar://problem/10808472 SBValue::Cast test case is failing (virtual inheritance)")
+ @skipIf(bugnumber="llvm.org/PR36714")
@add_test_categories(['pyapi'])
def test_value_cast_with_virtual_inheritance(self):
"""Test SBValue::Cast(SBType) API for C++ types with virtual inheritance."""
@@ -51,7 +50,7 @@ class CppValueCastTestCase(TestBase):
def do_sbvalue_cast(self, exe_name):
"""Test SBValue::Cast(SBType) API for C++ types."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
index 42db14f21e0c..acda4261b113 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/dynamic-value/TestDynamicValue.py
@@ -37,7 +37,7 @@ class DynamicValueTestCase(TestBase):
def test_get_dynamic_vals(self):
"""Test fetching C++ dynamic values from pointers & references."""
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py b/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
index 82e44fb1759f..b6bb2e8f3091 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/enum_types/TestCPP11EnumTypes.py
@@ -6,6 +6,7 @@ from __future__ import print_function
import os
import time
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
@@ -14,6 +15,7 @@ class CPP11EnumTypesTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_int8_t(self):
"""Test C++11 enumeration class types as int8_t types."""
self.build(
@@ -21,6 +23,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int8_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_int16_t(self):
"""Test C++11 enumeration class types as int16_t types."""
self.build(
@@ -28,6 +31,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int16_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_int32_t(self):
"""Test C++11 enumeration class types as int32_t types."""
self.build(
@@ -35,6 +39,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int32_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_int64_t(self):
"""Test C++11 enumeration class types as int64_t types."""
self.build(
@@ -42,6 +47,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=int64_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_uint8_t(self):
"""Test C++11 enumeration class types as uint8_t types."""
self.build(
@@ -49,6 +55,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint8_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_uint16_t(self):
"""Test C++11 enumeration class types as uint16_t types."""
self.build(
@@ -56,6 +63,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint16_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_uint32_t(self):
"""Test C++11 enumeration class types as uint32_t types."""
self.build(
@@ -63,6 +71,7 @@ class CPP11EnumTypesTestCase(TestBase):
'CFLAGS_EXTRAS': '"-DTEST_BLOCK_CAPTURED_VARS=uint32_t"'})
self.image_lookup_for_enum_type()
+ @expectedFailureAll(oslist=['freebsd'], bugnumber='llvm.org/pr36527')
def test_uint64_t(self):
"""Test C++11 enumeration class types as uint64_t types."""
self.build(
@@ -78,7 +87,7 @@ class CPP11EnumTypesTestCase(TestBase):
def image_lookup_for_enum_type(self):
"""Test C++11 enumeration class types."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py b/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
index 4bc33205319c..d1aea00b0e8f 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/exceptions/TestCPPExceptionBreakpoints.py
@@ -30,7 +30,7 @@ class CPPBreakpointTestCase(TestBase):
def test(self):
"""Test lldb exception breakpoint command for CPP."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py b/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
index c37107e898c2..6352b68e7d75 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py
@@ -13,7 +13,7 @@ class FrameVariableAnonymousUnionsTestCase(TestBase):
def test_with_run_command(self):
"""Tests that frame variable looks into anonymous unions"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
line = line_number('main.cpp', '// break here')
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py b/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
index 810aefee0f07..b90f74656cdf 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/function-template-parameter-pack/TestFunctionTemplateParameterPack.py
@@ -1,6 +1,12 @@
from lldbsuite.test import lldbinline
from lldbsuite.test import decorators
+# https://bugs.llvm.org/show_bug.cgi?id=35920
+# This test stresses expression evaluation support for template functions.
+# Currently the support is rudimentary, and running this test causes assertion
+# failures in clang. This test cannot be XFAIL'ed because the test harness
+# treats assertion failures as unexpected events. For now, the test must be
+# skipped.
lldbinline.MakeInlineTest(
__file__, globals(), [
- decorators.expectedFailureAll(bugnumber="rdar://problem/32096064")])
+ decorators.skipIf])
diff --git a/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py b/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
index 21d86f973a35..fa68d0a15021 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/global_operators/TestCppGlobalOperators.py
@@ -20,9 +20,7 @@ class TestCppGlobalOperators(TestBase):
self.assertTrue(src_file_spec.IsValid(), "Main source file")
# Get the path of the executable
- cwd = os.getcwd()
- exe_file = "a.out"
- exe_path = os.path.join(cwd, exe_file)
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile
new file mode 100644
index 000000000000..0497d78fec3c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+CXX_SOURCES = main.cpp
+# CFLAGS_EXTRAS += $(MODULE_DEBUG_INFO_FLAGS)
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
new file mode 100644
index 000000000000..69d04636d86b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/TestGModules.py
@@ -0,0 +1,6 @@
+import lldbsuite.test.lldbinline as lldbinline
+from lldbsuite.test.decorators import *
+
+lldbinline.MakeInlineTest(__file__, globals(), [
+ expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr36107",
+ debug_info="gmodules")])
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h
new file mode 100644
index 000000000000..7384f230801a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/a.h
@@ -0,0 +1,7 @@
+#include "memory.h"
+
+class MemoryBuffer { int buffer = 42; };
+
+struct SrcBuffer {
+ my_std::unique_ptr<MemoryBuffer> Buffer;
+};
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h
new file mode 100644
index 000000000000..b777e8e34739
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/b.h
@@ -0,0 +1,6 @@
+#include "a.h"
+#include "memory.h"
+
+class Module {
+ my_std::unique_ptr<MemoryBuffer> MBptr;
+};
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp
new file mode 100644
index 000000000000..df7526165700
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/main.cpp
@@ -0,0 +1,9 @@
+#include "b.h"
+
+int main(int argc, const char * argv[])
+{
+ Module m;
+ // Test that the type Module which contains a field that is a
+ // template instantiation can be fully resolved.
+ return 0; //% self.assertTrue(self.frame().FindVariable('m').GetChildAtIndex(0).GetChildAtIndex(0).GetChildAtIndex(0).GetName() == 'buffer', 'find template specializations in imported modules')
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h
new file mode 100644
index 000000000000..1d59dc0bbf0b
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/memory.h
@@ -0,0 +1,8 @@
+#ifndef MEMORY_H
+#define MEMORY_H
+namespace my_std {
+ template<class T> class unique_ptr {
+ T t;
+ };
+}
+#endif
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap
new file mode 100644
index 000000000000..2f05073a0b85
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules-templates/module.modulemap
@@ -0,0 +1,11 @@
+module A {
+ header "a.h"
+}
+
+module B {
+ header "b.h"
+}
+
+module std {
+ header "memory.h"
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py b/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
index dcc9206867b3..20207c54db90 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules/TestWithModuleDebugging.py
@@ -9,17 +9,17 @@ class TestWithGmodulesDebugInfo(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ @skipIf(bugnumber="llvm.org/pr36146", oslist=["linux"], archs=["i386"])
@add_test_categories(["gmodules"])
def test_specialized_typedef_from_pch(self):
self.build()
- cwd = os.getcwd()
- src_file = os.path.join(cwd, "main.cpp")
+ src_file = os.path.join(self.getSourceDir(), "main.cpp")
src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(src_file_spec.IsValid(), "breakpoint file")
# Get the path of the executable
- exe_path = os.path.join(cwd, 'a.out')
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
@@ -69,3 +69,26 @@ class TestWithGmodulesDebugInfo(TestBase):
42,
memberValue.GetValueAsSigned(),
"Member value incorrect")
+
+ testValue = frame.EvaluateExpression("bar")
+ self.assertTrue(
+ testValue.GetError().Success(),
+ "Test expression value invalid: %s" %
+ (testValue.GetError().GetCString()))
+ self.assertTrue(
+ testValue.GetTypeName() == "Foo::Bar",
+ "Test expression type incorrect")
+
+ memberValue = testValue.GetChildMemberWithName("i")
+ self.assertTrue(
+ memberValue.GetError().Success(),
+ "Member value missing or invalid: %s" %
+ (testValue.GetError().GetCString()))
+ self.assertTrue(
+ memberValue.GetTypeName() == "int",
+ "Member type incorrect")
+ self.assertEqual(
+ 123,
+ memberValue.GetValueAsSigned(),
+ "Member value incorrect")
+
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
index aa4013685171..588a3a8e01fe 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules/main.cpp
@@ -1,5 +1,8 @@
+class Foo::Bar { int i = 123; };
+
int main(int argc, const char * argv[])
{
IntContainer test(42);
+ Foo::Bar bar;
return 0; // break here
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h b/packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
index a6c59b94c896..dba4fee9a8c2 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
+++ b/packages/Python/lldbsuite/test/lang/cpp/gmodules/pch.h
@@ -10,3 +10,8 @@ class GenericContainer {
};
typedef GenericContainer<int> IntContainer;
+
+struct Foo {
+ class Bar;
+ Bar *bar;
+};
diff --git a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile
index bea4bf96e601..2ce96e90d2d8 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile
+++ b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/Makefile
@@ -19,16 +19,16 @@ nolimit: main.o length_nolimit.o a.o
$(CXX) main.o length_nolimit.o a.o -o nolimit $(LDFLAGS)
main.o: main.cpp
- $(CXX) $(CFLAGS_LIMIT) main.cpp -o main.o
+ $(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/main.cpp -o main.o
length_limit.o: length.cpp
- $(CXX) $(CFLAGS_LIMIT) length.cpp -o length_limit.o
+ $(CXX) $(CFLAGS_LIMIT) $(SRCDIR)/length.cpp -o length_limit.o
length_nolimit.o: length.cpp
- $(CXX) $(CFLAGS_NO_LIMIT) length.cpp -o length_nolimit.o
+ $(CXX) $(CFLAGS_NO_LIMIT) $(SRCDIR)/length.cpp -o length_nolimit.o
a.o: a.cpp
- $(CXX) $(CFLAGS_NO_DEBUG) -c a.cpp -o a.o
+ $(CXX) $(CFLAGS_NO_DEBUG) -c $(SRCDIR)/a.cpp -o a.o
clean: OBJECTS += limit nolimit length_limit.o length_nolimit.o length_limit.dwo length_nolimit.dwo
diff --git a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
index 505a27a0a67a..92b58ce11d77 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/incomplete-types/TestCppIncompleteTypes.py
@@ -48,36 +48,8 @@ class TestCppIncompleteTypes(TestBase):
# Get main source file
src_file = "main.cpp"
src_file_spec = lldb.SBFileSpec(src_file)
- self.assertTrue(src_file_spec.IsValid(), "Main source file")
-
- # Get the path of the executable
- cwd = os.getcwd()
- exe_path = os.path.join(cwd, exe)
-
- # Load the executable
- target = self.dbg.CreateTarget(exe_path)
- self.assertTrue(target.IsValid(), VALID_TARGET)
-
- # Break on main function
- main_breakpoint = target.BreakpointCreateBySourceRegex(
- "break here", src_file_spec)
- self.assertTrue(
- main_breakpoint.IsValid() and main_breakpoint.GetNumLocations() >= 1,
- VALID_BREAKPOINT)
-
- # Launch the process
- args = None
- env = None
- process = target.LaunchSimple(
- args, env, self.get_process_working_directory())
- self.assertTrue(process.IsValid(), PROCESS_IS_VALID)
-
- # Get the thread of the process
- self.assertTrue(
- process.GetState() == lldb.eStateStopped,
- PROCESS_STOPPED)
- thread = lldbutil.get_stopped_thread(
- process, lldb.eStopReasonBreakpoint)
+ (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
+ "break here", src_file_spec, exe_name = exe)
# Get frame for current thread
return thread.GetSelectedFrame()
diff --git a/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py b/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
index 2dc72981c14f..f7b92e8328e8 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/inlines/TestInlines.py
@@ -39,7 +39,7 @@ class InlinesTestCase(TestBase):
startstr='(int) $0 =')
def runToBreakpoint(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the main.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py b/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
index 89086e7a64bc..ae50d3d39660 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/limit-debug-info/TestWithLimitDebugInfo.py
@@ -12,14 +12,12 @@ class TestWithLimitDebugInfo(TestBase):
def test_limit_debug_info(self):
self.build()
- cwd = os.getcwd()
-
- src_file = os.path.join(cwd, "main.cpp")
+ src_file = os.path.join(self.getSourceDir(), "main.cpp")
src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(src_file_spec.IsValid(), "breakpoint file")
# Get the path of the executable
- exe_path = os.path.join(cwd, 'a.out')
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py b/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
index 977ad7ddea11..011cf4992915 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/member-and-local-vars-with-same-name/TestMembersAndLocalsWithSameName.py
@@ -221,7 +221,7 @@ class TestMembersAndLocalsWithSameName(TestBase):
self.assertTrue(self.src_file_spec.IsValid(), "breakpoint file")
# Get the path of the executable
- exe_path = os.path.join(cwd, 'a.out')
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
self.target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py b/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
index f0bc12ce9832..593911b15dd2 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespace.py
@@ -31,7 +31,7 @@ class NamespaceBreakpointTestCase(TestBase):
"A::func(int)"]
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
module_list = lldb.SBFileSpecList()
@@ -48,6 +48,7 @@ class NamespaceBreakpointTestCase(TestBase):
"make sure breakpoint locations are correct for 'func' with eFunctionNameTypeAuto")
@expectedFailureAll(bugnumber="llvm.org/pr28548", compiler="gcc")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
def test_breakpoints_func_full(self):
"""Test that we can set breakpoints correctly by fullname to find all functions whose fully qualified name is "func"
(no namespaces)."""
@@ -56,7 +57,7 @@ class NamespaceBreakpointTestCase(TestBase):
names = ["func()", "func(int)"]
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
module_list = lldb.SBFileSpecList()
@@ -81,7 +82,7 @@ class NamespaceBreakpointTestCase(TestBase):
names = ["A::func()", "A::func(int)"]
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
module_list = lldb.SBFileSpecList()
@@ -132,7 +133,7 @@ class NamespaceTestCase(TestBase):
def test_with_run_command(self):
"""Test that anonymous and named namespace variables display correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py b/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
index 18e45d9798ae..2837cfd9244e 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/TestNamespaceLookup.py
@@ -50,7 +50,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_lookup_with_run_command(self):
"""Test scope lookup of functions in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -151,7 +151,7 @@ class NamespaceLookupTestCase(TestBase):
def test_function_scope_lookup_with_run_command(self):
"""Test scope lookup of functions in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -188,7 +188,7 @@ class NamespaceLookupTestCase(TestBase):
def test_file_scope_lookup_with_run_command(self):
"""Test file scope lookup in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -208,7 +208,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_lookup_before_using_with_run_command(self):
"""Test scope lookup before using in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -238,7 +238,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_after_using_directive_lookup_with_run_command(self):
"""Test scope lookup after using directive in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -260,7 +260,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_after_using_declaration_lookup_with_run_command(self):
"""Test scope lookup after using declaration in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -279,7 +279,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_ambiguity_after_using_lookup_with_run_command(self):
"""Test scope lookup ambiguity after using in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
@@ -305,7 +305,7 @@ class NamespaceLookupTestCase(TestBase):
def test_scope_lookup_shadowed_by_using_with_run_command(self):
"""Test scope lookup shadowed by using in lldb."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
index 560ec40f4733..9f5eb06cccd4 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/main.cpp
@@ -8,6 +8,7 @@
//===----------------------------------------------------------------------===//
#include <cstdarg>
+#include <cstdlib>
#include "ns.h"
namespace {
@@ -23,7 +24,7 @@ namespace {
variadic_sum (int arg_count...)
{
int sum = 0;
- va_list args;
+ std::va_list args;
va_start(args, arg_count);
for (int i = 0; i < arg_count; i++)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
index 9e5637d02b4b..bb7731cf87b8 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.cpp
@@ -11,22 +11,22 @@
int foo()
{
- printf("global foo()\n");
- return 42;
+ std::printf("global foo()\n");
+ return 42;
}
int func()
{
- printf("global func()\n");
- return 1;
+ std::printf("global func()\n");
+ return 1;
}
int func(int a)
{
- printf("global func(int)\n");
- return a + 1;
+ std::printf("global func(int)\n");
+ return a + 1;
}
void test_lookup_at_global_scope()
{
- // BP_global_scope
- printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42
- printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1
+ // BP_global_scope
+ std::printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42
+ std::printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
index a07b600efa30..a0f9be88216a 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns.h
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#include <stdio.h>
+#include <cstdio>
void test_lookup_at_global_scope();
void test_lookup_at_file_scope();
@@ -15,22 +15,20 @@ void test_lookup_before_using_directive();
void test_lookup_after_using_directive();
int func(int a);
namespace A {
- int foo();
- int func(int a);
- inline int func()
- {
- printf("A::func()\n");
- return 3;
- }
- inline int func2()
- {
- printf("A::func2()\n");
- return 3;
- }
- void test_lookup_at_ns_scope();
- namespace B {
- int func();
- void test_lookup_at_nested_ns_scope();
- void test_lookup_at_nested_ns_scope_after_using();
- }
+int foo();
+int func(int a);
+inline int func() {
+ std::printf("A::func()\n");
+ return 3;
+}
+inline int func2() {
+ std::printf("A::func2()\n");
+ return 3;
}
+void test_lookup_at_ns_scope();
+namespace B {
+int func();
+void test_lookup_at_nested_ns_scope();
+void test_lookup_at_nested_ns_scope_after_using();
+} // namespace B
+} // namespace A
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
index 04046ad9b7f4..0051d478395d 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns2.cpp
@@ -11,26 +11,26 @@
static int func()
{
- printf("static m2.cpp func()\n");
- return 2;
+ std::printf("static m2.cpp func()\n");
+ return 2;
}
void test_lookup_at_file_scope()
{
- // BP_file_scope
- printf("at file scope: func() = %d\n", func()); // eval func(), exp: 2
- printf("at file scope: func(10) = %d\n", func(10)); // eval func(10), exp: 11
+ // BP_file_scope
+ std::printf("at file scope: func() = %d\n", func()); // eval func(), exp: 2
+ std::printf("at file scope: func(10) = %d\n", func(10)); // eval func(10), exp: 11
}
namespace A {
namespace B {
int func()
{
- printf("A::B::func()\n");
- return 4;
+ std::printf("A::B::func()\n");
+ return 4;
}
void test_lookup_at_nested_ns_scope()
{
// BP_nested_ns_scope
- printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 4
+ std::printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 4
//printf("func(10) = %d\n", func(10)); // eval func(10), exp: 13
// NOTE: Under the rules of C++, this test would normally get an error
@@ -42,24 +42,24 @@ namespace A {
{
// BP_nested_ns_scope_after_using
using A::func;
- printf("at nested ns scope after using: func() = %d\n", func()); // eval func(), exp: 3
+ std::printf("at nested ns scope after using: func() = %d\n", func()); // eval func(), exp: 3
}
}
}
int A::foo()
{
- printf("A::foo()\n");
- return 42;
+ std::printf("A::foo()\n");
+ return 42;
}
int A::func(int a)
{
- printf("A::func(int)\n");
- return a + 3;
+ std::printf("A::func(int)\n");
+ return a + 3;
}
void A::test_lookup_at_ns_scope()
{
- // BP_ns_scope
- printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 3
- printf("at nested ns scope: func(10) = %d\n", func(10)); // eval func(10), exp: 13
- printf("at nested ns scope: foo() = %d\n", foo()); // eval foo(), exp: 42
+ // BP_ns_scope
+ std::printf("at nested ns scope: func() = %d\n", func()); // eval func(), exp: 3
+ std::printf("at nested ns scope: func(10) = %d\n", func(10)); // eval func(10), exp: 13
+ std::printf("at nested ns scope: foo() = %d\n", foo()); // eval foo(), exp: 42
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
index 10b0df784225..205e1931f3e0 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace/ns3.cpp
@@ -13,15 +13,15 @@ extern int func();
// Note: the following function must be before the using.
void test_lookup_before_using_directive()
{
- // BP_before_using_directive
- printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1
+ // BP_before_using_directive
+ std::printf("before using directive: func() = %d\n", func()); // eval func(), exp: 1
}
using namespace A;
void test_lookup_after_using_directive()
{
- // BP_after_using_directive
- //printf("func() = %d\n", func()); // eval func(), exp: error, amiguous
- printf("after using directive: func2() = %d\n", func2()); // eval func2(), exp: 3
- printf("after using directive: ::func() = %d\n", ::func()); // eval ::func(), exp: 1
- printf("after using directive: B::func() = %d\n", B::func()); // eval B::func(), exp: 4
+ // BP_after_using_directive
+ //printf("func() = %d\n", func()); // eval func(), exp: error, amiguous
+ std::printf("after using directive: func2() = %d\n", func2()); // eval func2(), exp: 3
+ std::printf("after using directive: ::func() = %d\n", ::func()); // eval ::func(), exp: 1
+ std::printf("after using directive: B::func() = %d\n", B::func()); // eval B::func(), exp: 4
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
index 0041add935a6..9e52bacd5fc9 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/Makefile
@@ -9,11 +9,11 @@ include $(LEVEL)/Makefile.rules
a.out: lib_a lib_b
lib_%:
- $(MAKE) -f $*.mk
+ $(MAKE) VPATH=$(VPATH) -f $(SRCDIR)/$*.mk
hidden_lib_d:
$(MAKE) -C hidden
clean::
- $(MAKE) -f a.mk clean
- $(MAKE) -f b.mk clean
+ $(MAKE) -f $(SRCDIR)/a.mk clean
+ $(MAKE) -f $(SRCDIR)/b.mk clean
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
index 7160dddf4548..1f3fbd8b7f73 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/TestNamespaceDefinitions.py
@@ -46,7 +46,7 @@ class NamespaceDefinitionsTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
index 5943e5077c54..e53570873a3a 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/a.mk
@@ -4,6 +4,4 @@ DYLIB_NAME := a
DYLIB_CXX_SOURCES := a.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
index 8ee2a13b1291..54a1d8dea5a6 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
+++ b/packages/Python/lldbsuite/test/lang/cpp/namespace_definitions/b.mk
@@ -4,6 +4,4 @@ DYLIB_NAME := b
DYLIB_CXX_SOURCES := b.cpp
DYLIB_ONLY := YES
-CXXFLAGS += -fPIC
-
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py b/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
index fd19de7086da..f42d194cd620 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/nsimport/TestCppNsImport.py
@@ -16,14 +16,12 @@ class TestCppNsImport(TestBase):
self.build()
# Get main source file
- src_file = "main.cpp"
+ src_file = os.path.join(self.getSourceDir(), "main.cpp")
src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(src_file_spec.IsValid(), "Main source file")
# Get the path of the executable
- cwd = os.getcwd()
- exe_file = "a.out"
- exe_path = os.path.join(cwd, exe_file)
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/operator-overload/Makefile b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/Makefile
new file mode 100644
index 000000000000..bd8116b91c3c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/Makefile
@@ -0,0 +1,8 @@
+LEVEL = ../../../make
+
+CXX_SOURCES = a.cpp b.cpp
+
+include $(LEVEL)/Makefile.rules
+
+a.o: a.cpp
+ $(CC) $(CFLAGS_NO_DEBUG) -c $< -o $@
diff --git a/packages/Python/lldbsuite/test/lang/cpp/operator-overload/TestOperatorOverload.py b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/TestOperatorOverload.py
new file mode 100644
index 000000000000..f541a6617e3a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/TestOperatorOverload.py
@@ -0,0 +1,22 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestOperatorOverload(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ def test_overload(self):
+ self.build()
+ (target, process, thread,
+ main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
+ "break here", lldb.SBFileSpec("b.cpp"))
+ frame = thread.GetSelectedFrame()
+ value = frame.EvaluateExpression("x == nil")
+ self.assertTrue(str(value.GetError())
+ .find("comparison between NULL and non-pointer ('Tinky' and NULL)")
+ != -1)
+ self.assertTrue(str(value.GetError())
+ .find("invalid operands to binary expression ('Tinky' and")
+ != -1)
+ self.assertFalse(value.GetError().Success())
diff --git a/packages/Python/lldbsuite/test/lang/cpp/operator-overload/a.cpp b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/a.cpp
new file mode 100644
index 000000000000..77b2f6ace82e
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/a.cpp
@@ -0,0 +1,9 @@
+class Patatino {
+public:
+ double _blah;
+ Patatino(int blah) : _blah(blah) {}
+};
+
+bool operator==(const Patatino& a, const Patatino& b) {
+ return a._blah < b._blah;
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/operator-overload/b.cpp b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/b.cpp
new file mode 100644
index 000000000000..c0eb29bb79f8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/operator-overload/b.cpp
@@ -0,0 +1,10 @@
+class Tinky {
+public:
+ int _meh;
+ Tinky(int meh) : _meh(meh) {}
+};
+
+int main(void) {
+ Tinky x(12);
+ return 0; // break here
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py b/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
index 3d8788fa7907..7f68eb8923eb 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/overloaded-functions/TestOverloadedFunctions.py
@@ -8,7 +8,7 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
-class CPPStaticMethodsTestCase(TestBase):
+class OverloadedFunctionsTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -22,7 +22,7 @@ class CPPStaticMethodsTestCase(TestBase):
def test_with_run_command(self):
"""Test that functions with the same name are resolved correctly"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py b/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py
index 38ebe1a9a9c4..3dfe4f29d18c 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/printf/TestPrintf.py
@@ -4,4 +4,4 @@ from lldbsuite.test import decorators
lldbinline.MakeInlineTest(
__file__, globals(), [
decorators.expectedFailureAll(
- bugnumber="rdar://problem/24599697")])
+ bugnumber="llvm.org/PR36715")])
diff --git a/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py b/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
index 11d221e171a9..cc79366c7149 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/rvalue-references/TestRvalueReferences.py
@@ -22,7 +22,7 @@ class RvalueReferencesTestCase(TestBase):
def test_with_run_command(self):
"""Test that rvalues are supported in the C++ expression parser"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py b/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
index d5ff93f0cc1f..5cd9e4ed1b4f 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/scope/TestCppScope.py
@@ -23,14 +23,12 @@ class TestCppScopes(TestBase):
self.build()
# Get main source file
- src_file = "main.cpp"
+ src_file = os.path.join(self.getSourceDir(), "main.cpp")
src_file_spec = lldb.SBFileSpec(src_file)
self.assertTrue(src_file_spec.IsValid(), "Main source file")
# Get the path of the executable
- cwd = os.getcwd()
- exe_file = "a.out"
- exe_path = os.path.join(cwd, exe_file)
+ exe_path = self.getBuildArtifact("a.out")
# Load the executable
target = self.dbg.CreateTarget(exe_path)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py b/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
index 5925b10143e0..2b67bb4c35e5 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/signed_types/TestSignedTypes.py
@@ -9,6 +9,7 @@ import os
import time
import re
import lldb
+from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbsuite.test.lldbutil as lldbutil
@@ -25,6 +26,7 @@ class SignedTypesTestCase(TestBase):
self.line = line_number(
self.source, '// Set break point at this line.')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
def test(self):
"""Test that variables with signed types display correctly."""
self.build()
@@ -33,7 +35,7 @@ class SignedTypesTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py b/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
index 16b567588161..b8c777f417a9 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/static_members/TestCPPStaticMembers.py
@@ -21,7 +21,7 @@ class CPPStaticMembersTestCase(TestBase):
def test_with_run_command(self):
"""Test that member variables have the correct layout, scope and qualifiers when stopped inside and outside C++ methods"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py b/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
index 9c263053879e..404ef22a0b8c 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/static_methods/TestCPPStaticMethods.py
@@ -20,7 +20,7 @@ class CPPStaticMethodsTestCase(TestBase):
def test_with_run_command(self):
"""Test that static methods are properly distinguished from regular methods"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py b/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
index ce5869742f47..42c372489c63 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/stl/TestSTL.py
@@ -26,11 +26,11 @@ class STLTestCase(TestBase):
self.line = line_number(
self.source, '// Set break point at this line.')
- @expectedFailureAll(bugnumber="rdar://problem/10400981")
+ @expectedFailureAll(bugnumber="llvm.org/PR36713")
def test(self):
"""Test some expressions involving STL data types."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# The following two lines, if uncommented, will enable loggings.
#self.ci.HandleCommand("log enable -f /tmp/lldb.log lldb default", res)
@@ -38,9 +38,6 @@ class STLTestCase(TestBase):
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- # rdar://problem/8543077
- # test/stl: clang built binaries results in the breakpoint locations = 3,
- # is this a problem with clang generated debug info?
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
@@ -60,8 +57,6 @@ class STLTestCase(TestBase):
self.runCmd(
'expr for (int i = 0; i < hello_world.length(); ++i) { (void)printf("%c\\n", hello_world[i]); }')
- # rdar://problem/10373783
- # rdar://problem/10400981
self.expect('expr associative_array.size()',
substrs=[' = 3'])
self.expect('expr associative_array.count(hello_world)',
@@ -78,7 +73,7 @@ class STLTestCase(TestBase):
def test_SBType_template_aspects(self):
"""Test APIs for getting template arguments from an SBType."""
self.build()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py b/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
index 47fdf59a27ee..23e94e9addc0 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/stl/TestStdCXXDisassembly.py
@@ -31,7 +31,7 @@ class StdCXXDisassembleTestCase(TestBase):
def test_stdcxx_disasm(self):
"""Do 'disassemble' on each and every 'Code' symbol entry from the std c++ lib."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# rdar://problem/8543077
diff --git a/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py b/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
index b59f966236bb..054bc93c3189 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/template/TestTemplateArgs.py
@@ -19,7 +19,7 @@ class TemplateArgsTestCase(TestBase):
self.build()
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -83,6 +83,35 @@ class TemplateArgsTestCase(TestBase):
expr_result.GetType().GetName() == "int",
'expr_result.GetType().GetName() == "int"')
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24489")
+ def test_template_template_args(self):
+ frame = self.prepareProcess()
+
+ c1 = frame.FindVariable('c1')
+ self.assertTrue(
+ c1.IsValid(),
+ 'make sure we find a local variabble named "c1"')
+ self.assertTrue(c1.GetType().GetName() == 'C<float, T1>')
+ f1 = c1.GetChildMemberWithName("V").GetChildAtIndex(0).GetChildMemberWithName("f")
+ self.assertTrue(f1.GetType().GetName() == 'float')
+ self.assertTrue(f1.GetValue() == '1.5')
+
+ c2 = frame.FindVariable('c2')
+ self.assertTrue(
+ c2.IsValid(),
+ 'make sure we find a local variabble named "c2"')
+ self.assertTrue(c2.GetType().GetName() == 'C<double, T1, T2>')
+ f2 = c2.GetChildMemberWithName("V").GetChildAtIndex(0).GetChildMemberWithName("f")
+ self.assertTrue(f2.GetType().GetName() == 'double')
+ self.assertTrue(f2.GetValue() == '1.5')
+ f3 = c2.GetChildMemberWithName("V").GetChildAtIndex(1).GetChildMemberWithName("f")
+ self.assertTrue(f3.GetType().GetName() == 'double')
+ self.assertTrue(f3.GetValue() == '2.5')
+ f4 = c2.GetChildMemberWithName("V").GetChildAtIndex(1).GetChildMemberWithName("i")
+ self.assertTrue(f4.GetType().GetName() == 'int')
+ self.assertTrue(f4.GetValue() == '42')
+
+
# Gcc does not generate the necessary DWARF attribute for enum template
# parameters.
@expectedFailureAll(bugnumber="llvm.org/pr28354", compiler="gcc")
diff --git a/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
index 9c33a6420912..40825cd7c1a6 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
+++ b/packages/Python/lldbsuite/test/lang/cpp/template/main.cpp
@@ -6,6 +6,7 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
+#include <tuple>
template <int Arg>
class TestObj
@@ -62,11 +63,17 @@ public:
}
};
+template <typename FLOAT> struct T1 { FLOAT f = 1.5; };
+template <typename FLOAT> struct T2 { FLOAT f = 2.5; int i = 42; };
+template <typename FLOAT, template <typename> class ...Args> class C { std::tuple<Args<FLOAT>...> V; };
+
int main(int argc, char **argv)
{
TestObj<1> testpos;
TestObj<-1> testneg;
EnumTemplate<EnumType::Member> member(123);
EnumTemplate<EnumType::Subclass> subclass(123*2);
+ C<float, T1> c1;
+ C<double, T1, T2> c2;
return testpos.getArg() - testneg.getArg() + member.getMember()*2 - subclass.getMember(); // Breakpoint 1
}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py b/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
index ed2e257dc310..43b00f97d8fe 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/this/TestCPPThis.py
@@ -24,7 +24,7 @@ class CPPThisTestCase(TestBase):
def test_with_run_command(self):
"""Test that the appropriate member variables are available when stopped in C++ static, inline, and const methods"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.set_breakpoint(line_number('main.cpp', '// breakpoint 1'))
self.set_breakpoint(line_number('main.cpp', '// breakpoint 2'))
diff --git a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/Makefile
index 6067ee45e984..314f1cb2f077 100644
--- a/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_case_sensitivity/Makefile
+++ b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/Makefile
@@ -1,6 +1,5 @@
LEVEL = ../../../make
-C_SOURCES := main.c
-CFLAGS_EXTRAS += -std=c99
+CXX_SOURCES := main.cpp
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py
new file mode 100644
index 000000000000..2aae7dc89d34
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py
@@ -0,0 +1,74 @@
+"""
+Test that we work properly with classes with the trivial_abi attribute
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTrivialABI(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ @skipUnlessSupportedTypeAttribute("trivial_abi")
+ @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr37995")
+ def test_call_trivial(self):
+ """Test that we can print a variable & call a function with a trivial ABI class."""
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.cpp")
+ self.expr_test(True)
+
+ @skipUnlessSupportedTypeAttribute("trivial_abi")
+ @expectedFailureAll(bugnumber="llvm.org/pr36870")
+ def test_call_nontrivial(self):
+ """Test that we can print a variable & call a function on the same class w/o the trivial ABI marker."""
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.cpp")
+ self.expr_test(False)
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def check_value(self, test_var, ivar_value):
+ self.assertTrue(test_var.GetError().Success(), "Invalid valobj: %s"%(test_var.GetError().GetCString()))
+ ivar = test_var.GetChildMemberWithName("ivar")
+ self.assertTrue(test_var.GetError().Success(), "Failed to fetch ivar")
+ self.assertEqual(ivar_value, ivar.GetValueAsSigned(), "Got the right value for ivar")
+
+ def check_frame(self, thread):
+ frame = thread.frames[0]
+ inVal_var = frame.FindVariable("inVal")
+ self.check_value(inVal_var, 10)
+
+ options = lldb.SBExpressionOptions()
+ inVal_expr = frame.EvaluateExpression("inVal", options)
+ self.check_value(inVal_expr, 10)
+
+ thread.StepOut()
+ outVal_ret = thread.GetStopReturnValue()
+ self.check_value(outVal_ret, 30)
+
+ def expr_test(self, trivial):
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(self,
+ "Set a breakpoint here", self.main_source_file)
+
+ # Stop in a function that takes a trivial value, and try both frame var & expr to get its value:
+ if trivial:
+ self.check_frame(thread)
+ return
+
+ # Now continue to the same thing without the trivial_abi and see if we get that right:
+ threads = lldbutil.continue_to_breakpoint(process, bkpt)
+ self.assertEqual(len(threads), 1, "Hit my breakpoint the second time.")
+
+ self.check_frame(threads[0])
diff --git a/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/main.cpp
new file mode 100644
index 000000000000..cdf593e8b403
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/main.cpp
@@ -0,0 +1,35 @@
+struct __attribute__((trivial_abi)) S_Trivial {
+ ~S_Trivial() {}
+ int ivar = 10;
+};
+
+S_Trivial takeTrivial(S_Trivial inVal)
+{
+ S_Trivial ret_val = inVal;
+ ret_val.ivar = 30;
+ return ret_val; // Set a breakpoint here
+}
+
+struct S_NotTrivial {
+ ~S_NotTrivial() {}
+ int ivar = 10;
+};
+
+S_NotTrivial takeNotTrivial(S_NotTrivial inVal)
+{
+ S_NotTrivial ret_val = inVal;
+ ret_val.ivar = 30;
+ return ret_val; // Set a breakpoint here
+}
+
+int
+main()
+{
+ S_Trivial inVal, outVal;
+ outVal = takeTrivial(inVal);
+
+ S_NotTrivial inNotVal, outNotVal;
+ outNotVal = takeNotTrivial(outNotVal);
+
+ return 0; // Set another for return value
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile
new file mode 100644
index 000000000000..99bfa7e03b47
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+CXX_SOURCES := main.cpp
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py
new file mode 100644
index 000000000000..94d52e368e8c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/TestCppTypeLookup.py
@@ -0,0 +1,94 @@
+"""
+Test that we can lookup types correctly in the expression parser
+"""
+
+from __future__ import print_function
+
+
+import lldb
+import lldbsuite.test.lldbutil as lldbutil
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import decorators
+
+class TestCppTypeLookup(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def check_value(self, value, ivar_name, ivar_value):
+ self.assertTrue(value.GetError().Success(),
+ "Invalid valobj: %s" % (
+ value.GetError().GetCString()))
+ ivar = value.GetChildMemberWithName(ivar_name)
+ self.assertTrue(ivar.GetError().Success(),
+ "Failed to fetch ivar named '%s'" % (ivar_name))
+ self.assertEqual(ivar_value,
+ ivar.GetValueAsSigned(),
+ "Got the right value for ivar")
+
+ def test_namespace_only(self):
+ """
+ Test that we fail to lookup a struct type that exists only in a
+ namespace.
+ """
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.cpp")
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Set a breakpoint here", self.main_source_file)
+
+ # Get frame for current thread
+ frame = thread.GetSelectedFrame()
+
+ # We are testing LLDB's type lookup machinery, but if we inject local
+ # variables, the types for those will be found because they have been
+ # imported through the variable, not because the type lookup worked.
+ self.runCmd("settings set target.experimental.inject-local-vars false")
+
+ # Make sure we don't accidentally accept structures that exist only
+ # in namespaces when evaluating expressions with top level types.
+ # Prior to the revision that added this test, we would accidentally
+ # accept types from namespaces, so this will ensure we don't regress
+ # to that behavior again
+ expr_result = frame.EvaluateExpression("*((namespace_only *)&i)")
+ self.assertTrue(expr_result.GetError().Fail(),
+ "'namespace_only' exists in namespace only")
+
+ # Make sure we can find the correct type in a namespace "a"
+ expr_result = frame.EvaluateExpression("*((a::namespace_only *)&i)")
+ self.check_value(expr_result, "a", 123)
+ # Make sure we can find the correct type in a namespace "b"
+ expr_result = frame.EvaluateExpression("*((b::namespace_only *)&i)")
+ self.check_value(expr_result, "b", 123)
+
+ # Make sure we can find the correct type in the root namespace
+ expr_result = frame.EvaluateExpression("*((namespace_and_file *)&i)")
+ self.check_value(expr_result, "ff", 123)
+ # Make sure we can find the correct type in a namespace "a"
+ expr_result = frame.EvaluateExpression(
+ "*((a::namespace_and_file *)&i)")
+ self.check_value(expr_result, "aa", 123)
+ # Make sure we can find the correct type in a namespace "b"
+ expr_result = frame.EvaluateExpression(
+ "*((b::namespace_and_file *)&i)")
+ self.check_value(expr_result, "bb", 123)
+
+ # Make sure we don't accidentally accept structures that exist only
+ # in namespaces when evaluating expressions with top level types.
+ # Prior to the revision that added this test, we would accidentally
+ # accept types from namespaces, so this will ensure we don't regress
+ # to that behavior again
+ expr_result = frame.EvaluateExpression("*((in_contains_type *)&i)")
+ self.assertTrue(expr_result.GetError().Fail(),
+ "'in_contains_type' exists in struct only")
+
+ # Make sure we can find the correct type in the root namespace
+ expr_result = frame.EvaluateExpression(
+ "*((contains_type::in_contains_type *)&i)")
+ self.check_value(expr_result, "fff", 123)
+ # Make sure we can find the correct type in a namespace "a"
+ expr_result = frame.EvaluateExpression(
+ "*((a::contains_type::in_contains_type *)&i)")
+ self.check_value(expr_result, "aaa", 123)
+ # Make sure we can find the correct type in a namespace "b"
+ expr_result = frame.EvaluateExpression(
+ "*((b::contains_type::in_contains_type *)&i)")
+ self.check_value(expr_result, "bbb", 123)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp
new file mode 100644
index 000000000000..b244e80962c8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/type_lookup/main.cpp
@@ -0,0 +1,67 @@
+//===-- main.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+// In this test, we define struct that exist might exist at the different
+// levels in the code and test that we can properly locate these types with
+// a varienty of different expressions.
+
+namespace a {
+ struct namespace_only {
+ int a;
+ };
+ struct namespace_and_file {
+ int aa;
+ };
+ struct contains_type {
+ struct in_contains_type {
+ int aaa;
+ };
+ };
+};
+namespace b {
+ struct namespace_only {
+ int b;
+ };
+ struct namespace_and_file {
+ int bb;
+ };
+ struct contains_type {
+ struct in_contains_type {
+ int bbb;
+ };
+ };
+};
+
+struct namespace_and_file {
+ int ff;
+};
+
+struct contains_type {
+ struct in_contains_type {
+ int fff;
+ };
+};
+
+
+int main (int argc, char const *argv[]) {
+ a::namespace_only a_namespace_only = { 1 };
+ a::namespace_and_file a_namespace_and_file = { 2 };
+ a::contains_type::in_contains_type a_in_contains_type = { 3 };
+ b::namespace_only b_namespace_only = { 11 };
+ b::namespace_and_file b_namespace_and_file = { 22 };
+ b::contains_type::in_contains_type b_in_contains_type = { 33 };
+ namespace_and_file file_namespace_and_file = { 44 };
+ contains_type::in_contains_type file_in_contains_type = { 55 };
+ int i = 123; // Provide an integer that can be used for casting
+ // Take address of "i" to ensure it is in memory
+ if (&i == &argc) {
+ i = -1;
+ }
+ return i == -1; // Set a breakpoint here
+}
diff --git a/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py b/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
index 842d03ae5197..216f86064dca 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/unicode-literals/TestUnicodeLiterals.py
@@ -69,7 +69,7 @@ class UnicodeLiteralsTestCase(TestBase):
self.skipTest(
"Skipping because this test is known to crash on i386")
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py b/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
index 3afac33ab39f..3e4fee0b49bc 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/unique-types/TestUniqueTypes.py
@@ -28,12 +28,8 @@ class UniqueTypesTestCase(TestBase):
compiler = self.getCompiler()
compiler_basename = os.path.basename(compiler)
- if "clang" in compiler_basename and int(
- self.getCompilerVersion().split('.')[0]) < 3:
- self.skipTest(
- "rdar://problem/9173060 lldb hangs while running unique-types for clang version < 3")
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=-1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py b/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
index 0189a65bec39..27b2a0b357af 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/unsigned_types/TestUnsignedTypes.py
@@ -27,13 +27,13 @@ class UnsignedTypesTestCase(TestBase):
def test(self):
"""Test that variables with unsigned types display correctly."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# GCC puts a breakpoint on the last line of a multi-line expression, so
# if GCC is the target compiler, we cannot rely on an exact line match.
need_exact = "gcc" not in self.getCompiler()
- # Break on line 19 in main() aftre the variables are assigned values.
+ # Break on line 19 in main() after the variables are assigned values.
lldbutil.run_break_set_by_file_and_line(
self,
"main.cpp",
diff --git a/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile
new file mode 100644
index 000000000000..314f1cb2f077
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py
new file mode 100644
index 000000000000..1311a1493262
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/TestVirtualOverload.py
@@ -0,0 +1,3 @@
+from lldbsuite.test import lldbinline
+
+lldbinline.MakeInlineTest(__file__, globals())
diff --git a/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp
new file mode 100644
index 000000000000..79c482352f93
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/cpp/virtual-overload/main.cpp
@@ -0,0 +1,17 @@
+// Test that lldb doesn't get confused by an overload of a virtual
+// function of the same name.
+struct Base {
+ virtual void f(int i) {}
+ virtual ~Base() {}
+};
+
+struct Derived : Base {
+ virtual void f(int i, int j) {}
+};
+
+int main(int argc, char **argv) {
+ Derived obj;
+ obj.f(1, 2); //% self.expect("fr var", "not crashing", substrs = ["obj"])
+ return 0;
+}
+
diff --git a/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py b/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
index 7356484e69a4..b3fe9c40c198 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/virtual/TestVirtual.py
@@ -45,7 +45,7 @@ class CppVirtualMadness(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Create the breakpoint inside function 'main'.
diff --git a/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py b/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
index f17ba6f4a229..f31ba9b5c8b4 100644
--- a/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
+++ b/packages/Python/lldbsuite/test/lang/cpp/wchar_t/TestCxxWCharT.py
@@ -28,7 +28,7 @@ class CxxWCharTTestCase(TestBase):
def test(self):
"""Test that C++ supports wchar_t correctly."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py b/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
index 306b00840dfd..963e0676100d 100644
--- a/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
+++ b/packages/Python/lldbsuite/test/lang/go/expressions/TestExpressions.py
@@ -15,6 +15,7 @@ class TestGoUserExpression(TestBase):
@add_test_categories(['pyapi'])
@skipIfRemote # Not remote test suit ready
+ @skipIfFreeBSD # Test hanging on FreeBSD - llvm.org/pr37194
@skipUnlessGoInstalled
def test_with_dsym_and_python_api(self):
"""Test GoASTUserExpress."""
@@ -40,7 +41,7 @@ class TestGoUserExpression(TestBase):
self.assertEqual(size, t.size)
def launchProcess(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py b/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
index c48cd1f6af08..b31ac35be46c 100644
--- a/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
+++ b/packages/Python/lldbsuite/test/lang/go/formatters/TestGoFormatters.py
@@ -31,7 +31,7 @@ class TestGoLanguage(TestBase):
self.break_line = line_number(self.main_source, '// stop here')
def launchProcess(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py b/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
index e0cf9e8d7759..027fb3adc0cf 100644
--- a/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
+++ b/packages/Python/lldbsuite/test/lang/go/goroutines/TestGoroutines.py
@@ -36,7 +36,7 @@ class TestGoASTContext(TestBase):
self.break_line3 = line_number(self.main_source, '// stop3')
def launchProcess(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime b/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
index 30381ccd24c0..b06aa656aaa3 100644
--- a/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
+++ b/packages/Python/lldbsuite/test/lang/go/runtime/TestGoLanguageRuntime
@@ -30,7 +30,7 @@ class TestGoLanguageRuntime(TestBase):
def launchProcess(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py b/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
index 9571e259629f..8fb56b9577af 100644
--- a/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
+++ b/packages/Python/lldbsuite/test/lang/go/types/TestGoASTContext.py
@@ -46,7 +46,7 @@ class TestGoASTContext(TestBase):
self.assertEqual(size, t.size)
def launchProcess(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py b/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
index e7615c8e9d8f..2ba57e61349f 100644
--- a/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
+++ b/packages/Python/lldbsuite/test/lang/mixed/TestMixedLanguages.py
@@ -17,7 +17,7 @@ class MixedLanguagesTestCase(TestBase):
def test_language_of_frame(self):
"""Test that the language defaults to the language of the current frame."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Execute the cleanup function during test case tear down
diff --git a/packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py b/packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py
index 4a3311fb5f6d..c0d006ee53a8 100644
--- a/packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py
+++ b/packages/Python/lldbsuite/test/lang/objc/bitfield_ivars/TestBitfieldIvars.py
@@ -5,8 +5,8 @@ lldbinline.MakeInlineTest(
__file__,
globals(),
[
- decorators.skipIfFreeBSD,
- decorators.skipIfLinux,
- decorators.skipIfWindows,
+ # This is a Darwin-only failure related to incorrect expression-
+ # evaluation for single-bit ObjC bitfields.
+ decorators.skipUnlessDarwin,
decorators.expectedFailureAll(
bugnumber="rdar://problem/17990991")])
diff --git a/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py b/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
index 74e4f3bc880d..d69a171bc7b8 100644
--- a/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
+++ b/packages/Python/lldbsuite/test/lang/objc/blocks/TestObjCIvarsInBlocks.py
@@ -31,7 +31,7 @@ class TestObjCIvarsInBlocks(TestBase):
def test_with_python_api(self):
"""Test printing the ivars of the self when captured in blocks"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
index 2d6de6f1514b..346fc4b1fbc5 100644
--- a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Makefile
@@ -1,38 +1,23 @@
LEVEL = ../../../make
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
+LD_EXTRAS = -lobjc -framework Foundation
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+include $(LEVEL)/Makefile.rules
-CFLAGS ?= -g -O0
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
-
-LDFLAGS = $(CFLAGS) -lobjc -framework Foundation
-
-all: a.out libTest.dylib libTestExt.dylib
+all: a.out
libTest.dylib: Test/Test.m
- $(CC) $(CFLAGS) -I. -c -o Test.o Test/Test.m
- $(CC) $(LDFLAGS) -shared -o libTest.dylib Test.o
- dsymutil libTest.dylib
+ mkdir -p Test
+ $(MAKE) MAKE_DSYM=YES VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/Test/Test.mk all
libTestExt.dylib: TestExt/TestExt.m
- $(CC) $(CFLAGS) -I. -c -o TestExt.o TestExt/TestExt.m
- $(CC) $(LDFLAGS) -L. -lTest -shared -o libTestExt.dylib TestExt.o
- dsymutil libTestExt.dylib
+ mkdir -p TestExt
+ $(MAKE) MAKE_DSYM=YES VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/TestExt/TestExt.mk all
a.out: main.m libTest.dylib libTestExt.dylib
- $(CC) $(LDFLAGS) -I. -L. -lTest -lTestExt -o a.out main.m
-
-.PHONY: clean
+ $(CC) $(LDFLAGS) -I$(SRCDIR) -L. -lTest -lTestExt -o a.out $<
-clean:
- rm -rf libTest.dylib libTestExt.dylib a.out Test.o TestExt.o libTest.dylib.dSYM libTest.dylib.dSYM
+clean::
+ rm -rf libTest.dylib libTestExt.dylib a.out Test.o TestExt.o libTest.dylib.dSYM libTestExt.dylib.dSYM
+ $(MAKE) MAKE_DSYM=YES VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/Test/Test.mk clean
+ $(MAKE) MAKE_DSYM=YES VPATH=$(SRCDIR) -I $(SRCDIR) -f $(SRCDIR)/TestExt/TestExt.mk clean
diff --git a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk
new file mode 100644
index 000000000000..be758ac07d85
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/Test/Test.mk
@@ -0,0 +1,10 @@
+LEVEL = ../../../make
+
+DYLIB_NAME := Test
+DYLIB_ONLY := YES
+CFLAGS_EXTRAS = -I$(SRCDIR)/..
+LD_EXTRAS = -lobjc -framework Foundation
+
+DYLIB_OBJC_SOURCES = Test/Test.m
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
index df3a41fedf60..264a17c37960 100644
--- a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
+++ b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestConflictingDefinition.py
@@ -46,7 +46,7 @@ class TestRealDefinition(TestBase):
"42"])
def common_setup(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.registerSharedLibrariesWithTarget(target, self.shlib_names)
diff --git a/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk
new file mode 100644
index 000000000000..285d7262ce82
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/conflicting-definition/TestExt/TestExt.mk
@@ -0,0 +1,10 @@
+LEVEL = ../../../make
+
+DYLIB_NAME := TestExt
+DYLIB_ONLY := YES
+CFLAGS_EXTRAS = -I$(SRCDIR)/..
+LD_EXTRAS = -L. -lTest -lobjc -framework Foundation
+
+DYLIB_OBJC_SOURCES = TestExt/TestExt.m
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py b/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
index aa2b659b84b3..218d73c72fdb 100644
--- a/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
+++ b/packages/Python/lldbsuite/test/lang/objc/forward-decl/TestForwardDecl.py
@@ -23,12 +23,11 @@ class ForwardDeclTestCase(TestBase):
self.line = line_number(self.source, '// Set breakpoint 0 here.')
self.shlib_names = ["Container"]
- @skipUnlessDarwin
- def test_expr(self):
- self.build()
+ def do_test(self, dictionary=None):
+ self.build(dictionary=dictionary)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Create the breakpoint inside function 'main'.
@@ -57,3 +56,17 @@ class ForwardDeclTestCase(TestBase):
# This should display correctly.
self.expect("expression [j getMember]", VARIABLES_DISPLAYED_CORRECTLY,
substrs=["= 0x"])
+
+ @skipUnlessDarwin
+ def test_expr(self):
+ self.do_test()
+
+ @no_debug_info_test
+ @skipUnlessDarwin
+ @skipIf(compiler=no_match("clang"))
+ @skipIf(compiler_version=["<", "7.0"])
+ def test_debug_names(self):
+ """Test that we are able to find complete types when using DWARF v5
+ accelerator tables"""
+ self.do_test(
+ dict(CFLAGS_EXTRAS="-dwarf-version=5 -mllvm -accel-tables=Dwarf"))
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
index 2a81c42eb503..95c5575385c5 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestConstStrings.py
@@ -32,7 +32,7 @@ class ConstStringTestCase(TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(self.d)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
index 51d9d22bf44a..345e41b2b04e 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestFoundationDisassembly.py
@@ -32,7 +32,7 @@ class FoundationDisassembleTestCase(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Now launch the process, and do not stop at entry point.
@@ -76,7 +76,7 @@ class FoundationDisassembleTestCase(TestBase):
self.build()
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
print(target)
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
index d636458ce1aa..42535ca44af0 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods.py
@@ -35,7 +35,7 @@ class FoundationTestCase(TestBase):
def test_break(self):
"""Test setting objc breakpoints using '_regexp-break' and 'breakpoint set'."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Stop at +[NSString stringWithFormat:].
@@ -117,7 +117,7 @@ class FoundationTestCase(TestBase):
def test_data_type_and_expr(self):
"""Lookup objective-c data types and evaluate expressions."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Stop at -[MyString description].
@@ -230,7 +230,7 @@ class FoundationTestCase(TestBase):
self.build()
# See: <rdar://problem/8717050> lldb needs to use the ObjC runtime symbols for ivar offsets
# Only fails for the ObjC 2.0 runtime.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -280,7 +280,7 @@ class FoundationTestCase(TestBase):
def test_expression_lookups_objc(self):
"""Test running an expression detect spurious debug info lookups (DWARF)."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Stop at -[MyString initWithNSString:].
@@ -296,7 +296,7 @@ class FoundationTestCase(TestBase):
# Log any DWARF lookups
++file_index
logfile = os.path.join(
- os.getcwd(),
+ self.getBuildDir(),
"dwarf-lookups-" +
self.getArchitecture() +
"-" +
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
index ce7e7742bfe8..2b967e988856 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjCMethods2.py
@@ -47,7 +47,7 @@ class FoundationTestCase2(TestBase):
def test_more_expr_commands(self):
"""More expression commands for objective-c."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Create a bunch of breakpoints.
@@ -84,7 +84,7 @@ class FoundationTestCase2(TestBase):
def test_NSArray_expr_commands(self):
"""Test expression commands for NSArray."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside Test_NSArray:
@@ -111,7 +111,7 @@ class FoundationTestCase2(TestBase):
def test_NSString_expr_commands(self):
"""Test expression commands for NSString."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside Test_NSString:
@@ -141,7 +141,7 @@ class FoundationTestCase2(TestBase):
def test_MyString_dump_with_runtime(self):
"""Test dump of a known Objective-C object by dereferencing it."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
line = self.lines[4]
@@ -162,7 +162,7 @@ class FoundationTestCase2(TestBase):
def test_runtime_types(self):
"""Test commands that require runtime types"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside Test_NSString:
@@ -190,7 +190,7 @@ class FoundationTestCase2(TestBase):
def test_NSError_p(self):
"""Test that p of the result of an unknown method does require a cast."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
line = self.lines[4]
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py
index 8ef9f39434e3..82e08584702f 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestObjectDescriptionAPI.py
@@ -34,7 +34,7 @@ class ObjectDescriptionAPITestCase(TestBase):
d = {'EXE': 'b.out'}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), 'b.out')
+ exe = self.getBuildArtifact('b.out')
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
index 334ebba8e642..c52ac8c2e6d0 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestRuntimeTypes.py
@@ -28,7 +28,7 @@ class RuntimeTypesTestCase(TestBase):
self.skipTest("This only applies to the v2 runtime")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Stop at -[MyString description].
diff --git a/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py b/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
index 6e5bc4d9fb0f..bfb9e0b4479d 100644
--- a/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
+++ b/packages/Python/lldbsuite/test/lang/objc/foundation/TestSymbolTable.py
@@ -36,7 +36,7 @@ class FoundationSymtabTestCase(TestBase):
def test_with_python_api(self):
"""Test symbol table access with Python APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py b/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
index bcd4a41e0df3..dcabd72dd0c0 100644
--- a/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
+++ b/packages/Python/lldbsuite/test/lang/objc/global_ptrs/TestGlobalObjects.py
@@ -25,7 +25,7 @@ class TestObjCGlobalVar(TestBase):
def test_with_python_api(self):
"""Test that a global ObjC object found before the process is started updates correctly."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py b/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
index ee21189ab7c0..2fad51eefd57 100644
--- a/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
+++ b/packages/Python/lldbsuite/test/lang/objc/hidden-ivars/TestHiddenIvars.py
@@ -84,15 +84,19 @@ class HiddenIvarsTestCase(TestBase):
if strip:
self.assertTrue(subprocess.call(
- ['/usr/bin/strip', '-Sx', 'libInternalDefiner.dylib']) == 0, 'stripping dylib succeeded')
- self.assertTrue(subprocess.call(['/bin/rm',
- '-rf',
- 'libInternalDefiner.dylib.dSYM']) == 0,
- 'remove dylib dSYM file succeeded')
+ ['/usr/bin/strip', '-Sx',
+ self.getBuildArtifact('libInternalDefiner.dylib')]) == 0,
+ 'stripping dylib succeeded')
self.assertTrue(subprocess.call(
- ['/usr/bin/strip', '-Sx', 'a.out']) == 0, 'stripping a.out succeeded')
+ ['/bin/rm', '-rf',
+ self.getBuildArtifact('libInternalDefiner.dylib.dSYM')]) == 0,
+ 'remove dylib dSYM file succeeded')
+ self.assertTrue(subprocess.call(['/usr/bin/strip', '-Sx',
+ self.getBuildArtifact("a.out")
+ ]) == 0,
+ 'stripping a.out succeeded')
# Create a target by the debugger.
- target = self.dbg.CreateTarget("a.out")
+ target = self.dbg.CreateTarget(self.getBuildArtifact("a.out"))
self.assertTrue(target, VALID_TARGET)
# Create the breakpoint inside function 'main'.
@@ -109,7 +113,7 @@ class HiddenIvarsTestCase(TestBase):
None, environment, self.get_process_working_directory())
self.assertTrue(process, PROCESS_IS_VALID)
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile b/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
index bd940ab148c9..f69da9a64be0 100644
--- a/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/Makefile
@@ -19,8 +19,8 @@ endif
all: aout
aout:
- $(CC) $(CFLAGS_NO_DEBUG) myclass.m -c -o myclass.o
- $(CC) $(CFLAGS) myclass.o repro.m -framework Foundation
+ $(CC) $(CFLAGS_NO_DEBUG) $(SRCDIR)/myclass.m -c -o myclass.o
+ $(CC) $(CFLAGS) myclass.o $(SRCDIR)/repro.m -framework Foundation
clean::
rm -f myclass.o
diff --git a/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py b/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
index d29476727bd6..ad7f96c0ac8b 100644
--- a/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
+++ b/packages/Python/lldbsuite/test/lang/objc/ivar-IMP/TestObjCiVarIMP.py
@@ -35,7 +35,7 @@ class ObjCiVarIMPTestCase(TestBase):
def test_imp_ivar_type(self):
"""Test that dynamically discovered ivars of type IMP do not crash LLDB"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile b/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile
index e42b59f9518c..ca099e1e9611 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/Makefile
@@ -1,6 +1,6 @@
LEVEL = ../../../make
OBJC_SOURCES := main.m
-CFLAGS += -fmodules -gmodules -g
+CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py b/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
index f01cc12bb4a6..264631805ed2 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-auto-import/TestModulesAutoImport.py
@@ -29,7 +29,7 @@ class ObjCModulesAutoImportTestCase(TestBase):
@skipIf(macos_version=["<", "10.12"])
def test_expr(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile b/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile
new file mode 100644
index 000000000000..00cb9b6be34a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-cache/Makefile
@@ -0,0 +1,3 @@
+LEVEL = ../../../make
+OBJC_SOURCES := main.m
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py b/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
new file mode 100644
index 000000000000..0cff6916e7f1
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
@@ -0,0 +1,41 @@
+"""Test that the clang modules cache directory can be controlled."""
+
+from __future__ import print_function
+
+
+import unittest2
+import os
+import time
+import platform
+import shutil
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class ObjCModulesTestCase(TestBase):
+ NO_DEBUG_INFO_TESTCASE = True
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ TestBase.setUp(self)
+
+ @skipUnlessDarwin
+ def test_expr(self):
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.m")
+ self.runCmd("settings set target.auto-import-clang-modules true")
+ mod_cache = self.getBuildArtifact("my-clang-modules-cache")
+ if os.path.isdir(mod_cache):
+ shutil.rmtree(mod_cache)
+ self.assertFalse(os.path.isdir(mod_cache),
+ "module cache should not exist")
+ self.runCmd('settings set symbols.clang-modules-cache-path "%s"' % mod_cache)
+ self.runCmd('settings set target.clang-module-search-paths "%s"'
+ % self.getSourceDir())
+ (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
+ self, "Set breakpoint here", self.main_source_file)
+ self.runCmd("expr @import Foo")
+ self.assertTrue(os.path.isdir(mod_cache), "module cache exists")
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h b/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h
new file mode 100644
index 000000000000..56757a701bf5
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-cache/f.h
@@ -0,0 +1 @@
+void f() {}
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m b/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m
new file mode 100644
index 000000000000..6009d28d81b9
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-cache/main.m
@@ -0,0 +1,5 @@
+#include "f.h"
+int main() {
+ f(); // Set breakpoint here.
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap b/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap
new file mode 100644
index 000000000000..f54534a1c070
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-cache/module.modulemap
@@ -0,0 +1,3 @@
+module Foo {
+ header "f.h"
+}
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile
index cbd95de007d8..b8462bc818ca 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/Makefile
@@ -4,5 +4,5 @@ OBJC_SOURCES := main.m myModule.m
include $(LEVEL)/Makefile.rules
-CFLAGS += -fmodules -I$(PWD)
+CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
LDFLAGS += -framework Foundation
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
index 367eeb2638d1..7bde8fc96896 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/TestIncompleteModules.py
@@ -23,14 +23,11 @@ class IncompleteModulesTestCase(TestBase):
self.line = line_number('main.m', '// Set breakpoint 0 here.')
@skipUnlessDarwin
- @unittest2.expectedFailure("rdar://20416388")
- @skipIf(macos_version=["<", "10.12"])
+ @skipIf(debug_info=no_match(["gmodules"]))
def test_expr(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
-
- # Break inside the foo function which takes a bar_ptr argument.
lldbutil.run_break_set_by_file_and_line(
self, "main.m", self.line, num_expected_locations=1, loc_exact=True)
@@ -47,21 +44,21 @@ class IncompleteModulesTestCase(TestBase):
self.runCmd(
"settings set target.clang-module-search-paths \"" +
- os.getcwd() +
+ self.getSourceDir() +
"\"")
self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY,
substrs=["int", "3"])
self.expect(
- "expr [myObject privateMethod]",
+ "expr private_func()",
VARIABLES_DISPLAYED_CORRECTLY,
substrs=[
"int",
"5"])
- self.expect("expr MIN(2,3)", "#defined macro was found",
+ self.expect("expr MY_MIN(2,3)", "#defined macro was found",
substrs=["int", "2"])
- self.expect("expr MAX(2,3)", "#undefd macro was correcltly not found",
+ self.expect("expr MY_MAX(2,3)", "#undefd macro was correctly not found",
error=True)
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/main.m b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/main.m
index 8ebfb0c1f11a..bfa0b06f1a14 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/main.m
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/main.m
@@ -1,11 +1,7 @@
-@import Foundation;
@import myModule;
+@import minmax;
-int main()
-{
- @autoreleasepool
- {
- MyClass *myObject = [MyClass alloc];
- [myObject publicMethod]; // Set breakpoint 0 here.
- }
+int main(int argc, char **argv) {
+ public_func(); // Set breakpoint 0 here.
+ return 0;
}
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/minmax.h b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/minmax.h
new file mode 100644
index 000000000000..efad1201695f
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/minmax.h
@@ -0,0 +1,2 @@
+#define MY_MIN(A, B) (((A) < (B)) ? (A) : (B))
+#define MY_MAX(A, B) (((A) < (B)) ? (B) : (A))
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/module.map b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/module.map
index 2ef8064d15b4..0dd9fadb2621 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/module.map
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/module.map
@@ -2,3 +2,8 @@ module myModule {
header "myModule.h"
export *
}
+
+module minmax {
+ header "minmax.h"
+ export *
+}
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h
index d03dde0d07aa..04ec3885c838 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h
@@ -1,8 +1,5 @@
-@import Foundation;
+@import minmax;
-#undef MAX
+#undef MY_MAX
-@interface MyClass : NSObject {
-};
--(void)publicMethod;
-@end
+extern void public_func();
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.m b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.m
index d6a2619d8016..372a32889322 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.m
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.m
@@ -1,14 +1,8 @@
#include "myModule.h"
-#include "stdio.h"
-@implementation MyClass {
-};
--(void)publicMethod {
- printf("Hello public!\n");
-}
--(int)privateMethod {
- printf("Hello private!\n");
+void public_func() {}
+
+int private_func() {
return 5;
}
-@end
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile b/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile
index 6ad9e0010bb0..320e13ed5c5f 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/Makefile
@@ -6,4 +6,4 @@ OBJC_SOURCES := main.m
include $(LEVEL)/Makefile.rules
-CFLAGS += -fmodules -I$(PWD)
+CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS) -I$(PWD)
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py b/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
index 328335dfe2c9..29d386253fb4 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
+++ b/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
@@ -27,10 +27,10 @@ class ModulesInlineFunctionsTestCase(TestBase):
self.line = line_number('main.m', '// Set breakpoint here.')
@skipUnlessDarwin
- @skipIf(macos_version=["<", "10.12"])
+ @skipIf(macos_version=["<", "10.12"], debug_info=no_match(["gmodules"]))
def test_expr(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
@@ -50,7 +50,7 @@ class ModulesInlineFunctionsTestCase(TestBase):
self.runCmd(
"settings set target.clang-module-search-paths \"" +
- os.getcwd() +
+ self.getSourceDir() +
"\"")
self.expect("expr @import myModule; 3", VARIABLES_DISPLAYED_CORRECTLY,
diff --git a/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py b/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
index 526b4a70e60c..8f5c407000c8 100644
--- a/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
+++ b/packages/Python/lldbsuite/test/lang/objc/modules/TestObjCModules.py
@@ -26,14 +26,10 @@ class ObjCModulesTestCase(TestBase):
self.line = line_number('main.m', '// Set breakpoint 0 here.')
@skipUnlessDarwin
- @unittest2.expectedFailure("rdar://20416388")
@skipIf(macos_version=["<", "10.12"])
def test_expr(self):
- if not self.applies():
- return
-
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py b/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
index 5b91f9848a92..996ec6ccdac8 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc++/TestObjCXX.py
@@ -24,7 +24,7 @@ class ObjCXXTestCase(TestBase):
self.skipTest("requires Objective-C 2.0 runtime")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py b/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
index 0f82cc68df85..7bba071922ce 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-baseclass-sbtype/TestObjCBaseClassSBType.py
@@ -33,7 +33,7 @@ class ObjCDynamicValueTestCase(TestBase):
self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py b/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
index d92daab80351..0aa831850198 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-builtin-types/TestObjCBuiltinTypes.py
@@ -29,7 +29,7 @@ class TestObjCBuiltinTypes(TestBase):
def test_with_python_api(self):
"""Test expression parser respect for ObjC built-in types."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py b/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
index 1bd8f1af2300..644cd87305e9 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-checker/TestObjCCheckers.py
@@ -33,7 +33,7 @@ class ObjCCheckerTestCase(TestBase):
self.skipTest("requires Objective-C 2.0 runtime")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py b/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
index 562c0cfc1e7a..8470d77db9b2 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-class-method/TestObjCClassMethod.py
@@ -28,7 +28,7 @@ class TestObjCClassMethod(TestBase):
def test_with_python_api(self):
"""Test calling functions in class methods."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py b/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
index 8b3f444b27af..6e95b4fa4b96 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-dyn-sbtype/TestObjCDynamicSBType.py
@@ -34,7 +34,7 @@ class ObjCDynamicSBTypeTestCase(TestBase):
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py b/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
index a115d4f15733..e9df6be81cdb 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
@@ -43,7 +43,7 @@ class ObjCDynamicValueTestCase(TestBase):
self.skipTest("Dynamic types for ObjC V1 runtime not implemented")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/TestNSDictionary0.py b/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/TestNSDictionary0.py
new file mode 100644
index 000000000000..804905106dfc
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/TestNSDictionary0.py
@@ -0,0 +1,6 @@
+from lldbsuite.test import lldbinline
+from lldbsuite.test import decorators
+
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ decorators.skipIfFreeBSD, decorators.skipIfLinux, decorators.skipIfWindows])
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/main.m b/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/main.m
new file mode 100644
index 000000000000..14a792b3776d
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-foundation-dictionary-empty/main.m
@@ -0,0 +1,7 @@
+#import <Foundation/Foundation.h>
+
+int main(void)
+{
+ NSDictionary *emptyDictionary = [[NSDictionary alloc] init];
+ return 0; //% self.expect("frame var emptyDictionary", substrs = ["0 key/value pairs"]);
+}
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
index 03121e6f956a..6b928450ceae 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
@@ -28,7 +28,7 @@ class TestObjCIvarOffsets(TestBase):
def test_with_python_api(self):
"""Test printing ObjC objects that use unbacked properties"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/Makefile b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/Makefile
index 4365ed9ae936..b93a8a13379d 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/Makefile
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/Makefile
@@ -3,7 +3,7 @@ LEVEL = ../../../make
OBJC_SOURCES := main.m
LDFLAGS = $(CFLAGS) -lobjc -framework Foundation
-default: a.out.stripped
+all: a.out.stripped
a.out.stripped: a.out.dSYM
strip -o a.out.stripped a.out
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
index dde9ebadba4f..f5997eb389fd 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-ivar-stripped/TestObjCIvarStripped.py
@@ -31,12 +31,12 @@ class TestObjCIvarStripped(TestBase):
def test_with_python_api(self):
"""Test that we can find stripped Objective-C ivars in the runtime"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out.stripped")
+ exe = self.getBuildArtifact("a.out.stripped")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
- self.dbg.HandleCommand("add-dsym a.out.dSYM")
+ self.dbg.HandleCommand("add-dsym "+self.getBuildArtifact("a.out.dSYM"))
breakpoint = target.BreakpointCreateByLocation(
self.main_source, self.stop_line)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py b/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
index 84b12579166d..74256345a0d5 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-new-syntax/TestObjCNewSyntax.py
@@ -28,7 +28,7 @@ class ObjCNewSyntaxTestCase(TestBase):
def runToBreakpoint(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py b/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
index 08e9594be69f..340d8849efa9 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-optimized/TestObjcOptimized.py
@@ -34,7 +34,7 @@ class ObjcOptimizedTestCase(TestBase):
def test_break(self):
"""Test 'expr member' continues to work for optimized build."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_symbol(
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py b/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
index 790bc9c08619..2a9a5afc3503 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-property/TestObjCProperty.py
@@ -33,7 +33,7 @@ class ObjCPropertyTestCase(TestBase):
self.skipTest("requires modern objc runtime")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target from the debugger.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py b/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
index 65dc5ace544e..ed969414c122 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-static-method-stripped/TestObjCStaticMethodStripped.py
@@ -34,7 +34,7 @@ class TestObjCStaticMethodStripped(TestBase):
if self.getArchitecture() == 'i386':
self.skipTest("requires modern objc runtime")
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py b/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
index 9f74d86d6336..37b41cd13fda 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-static-method/TestObjCStaticMethod.py
@@ -29,7 +29,7 @@ class TestObjCStaticMethod(TestBase):
def test_with_python_api(self):
"""Test calling functions in static methods."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py b/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
index 95eb6e5a212d..9e949dc627b2 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-stepping/TestObjCStepping.py
@@ -36,7 +36,7 @@ class TestObjCStepping(TestBase):
def test_with_python_api(self):
"""Test stepping through ObjC method dispatch in various forms."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py b/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
index 650923a729e4..4195f60cf60e 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/TestObjCStructArgument.py
@@ -29,7 +29,7 @@ class TestObjCStructArgument(TestBase):
def test_with_python_api(self):
"""Test passing structs to Objective-C methods."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m b/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
index 337ab3408ce2..6b13a3a3d595 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-struct-argument/test.m
@@ -32,7 +32,7 @@ int main()
struct things_to_sum tts = { 2, 3, 4 };
int ret = [summer sumThings:tts];
NSRect rect = {{0, 0}, {10, 20}};
- // The Objective C V1 runtime won't read types from metadata so we need
+ // The Objective-C V1 runtime won't read types from metadata so we need
// NSValue in our debug info to use it in our test.
NSValue *v = [NSValue valueWithRect:rect];
return rect.origin.x; // Set breakpoint here.
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py b/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
index 6e56c06e8ae8..6f6fd92992f9 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-struct-return/TestObjCStructReturn.py
@@ -28,7 +28,7 @@ class TestObjCClassMethod(TestBase):
def test_with_python_api(self):
"""Test calling functions in class methods."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py b/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
index d1d755e289cd..5b10bc5b81d6 100644
--- a/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
+++ b/packages/Python/lldbsuite/test/lang/objc/objc-super/TestObjCSuper.py
@@ -28,7 +28,7 @@ class TestObjCSuperMethod(TestBase):
def test_with_python_api(self):
"""Test calling methods on super."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/orderedset/Makefile b/packages/Python/lldbsuite/test/lang/objc/orderedset/Makefile
new file mode 100644
index 000000000000..a1608fe5a664
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/orderedset/Makefile
@@ -0,0 +1,6 @@
+LEVEL = ../../../make
+
+OBJC_SOURCES := main.m
+LDFLAGS = $(CFLAGS) -lobjc -framework Foundation
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/lang/objc/orderedset/TestOrderedSet.py b/packages/Python/lldbsuite/test/lang/objc/orderedset/TestOrderedSet.py
new file mode 100644
index 000000000000..90c6bc32f772
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/orderedset/TestOrderedSet.py
@@ -0,0 +1,18 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestOrderedSet(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ @skipUnlessDarwin
+ def test_ordered_set(self):
+ self.build()
+ src_file = "main.m"
+ src_file_spec = lldb.SBFileSpec(src_file)
+ (target, process, thread, main_breakpoint) = lldbutil.run_to_source_breakpoint(self,
+ "break here", src_file_spec, exe_name = "a.out")
+ frame = thread.GetSelectedFrame()
+ self.expect("expr -d run -- orderedSet", substrs=["3 elements"])
+ self.expect("expr -d run -- *orderedSet", substrs=["(int)1", "(int)2", "(int)3"])
diff --git a/packages/Python/lldbsuite/test/lang/objc/orderedset/main.m b/packages/Python/lldbsuite/test/lang/objc/orderedset/main.m
new file mode 100644
index 000000000000..e3f016226932
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objc/orderedset/main.m
@@ -0,0 +1,8 @@
+#import <Foundation/Foundation.h>
+
+int main() {
+ NSOrderedSet *orderedSet =
+ [NSOrderedSet orderedSetWithArray:@[@1,@2,@3,@1]];
+ NSLog(@"%@",orderedSet);
+ return 0; // break here
+}
diff --git a/packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py b/packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py
index 288f912dc79e..57a572c6bb4b 100644
--- a/packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py
+++ b/packages/Python/lldbsuite/test/lang/objc/print-obj/TestPrintObj.py
@@ -38,7 +38,7 @@ class PrintObjTestCase(TestBase):
d = {'EXE': 'b.out'}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), 'b.out')
+ exe = self.getBuildArtifact('b.out')
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py b/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
index e5633156cd18..74d08f70cafa 100644
--- a/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
+++ b/packages/Python/lldbsuite/test/lang/objc/ptr_refs/TestPtrRefsObjC.py
@@ -19,8 +19,7 @@ class TestPtrRefsObjC(TestBase):
def test_ptr_refs(self):
"""Test the ptr_refs tool on Darwin with Objective-C"""
self.build()
- exe_name = 'a.out'
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py b/packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
index fe7d5d48ca7e..737b0dc32867 100644
--- a/packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
+++ b/packages/Python/lldbsuite/test/lang/objc/radar-9691614/TestObjCMethodReturningBOOL.py
@@ -33,7 +33,7 @@ class MethodReturningBOOLTestCase(TestBase):
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py b/packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py
index 1375a78f87a5..ed60e5f98c2f 100644
--- a/packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py
+++ b/packages/Python/lldbsuite/test/lang/objc/rdar-10967107/TestRdar10967107.py
@@ -33,7 +33,7 @@ class Rdar10967107TestCase(TestBase):
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py b/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
index d1956d46e7b6..8619ce1ebd38 100644
--- a/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
+++ b/packages/Python/lldbsuite/test/lang/objc/rdar-11355592/TestRdar11355592.py
@@ -33,7 +33,7 @@ class Rdar10967107TestCase(TestBase):
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py b/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
index d431e98ba797..00fffc8176ab 100644
--- a/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
+++ b/packages/Python/lldbsuite/test/lang/objc/rdar-12408181/TestRdar12408181.py
@@ -13,6 +13,11 @@ from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+# TODO: The Jenkins testers on OS X fail running this test because they don't
+# have access to WindowServer so NSWindow doesn't work. We should disable this
+# test if WindowServer isn't available.
+# Note: Simply applying the @skipIf decorator here confuses the test harness
+# and gives a spurious failure.
@skipUnlessDarwin
class Rdar12408181TestCase(TestBase):
@@ -29,11 +34,14 @@ class Rdar12408181TestCase(TestBase):
def test_nswindow_count(self):
"""Test that we are able to find out how many children NSWindow has."""
+
+ self.skipTest("Skipping this test due to timeout flakiness")
+
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
diff --git a/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py b/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
index 820ddcd9ec6a..d4760079814a 100644
--- a/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
+++ b/packages/Python/lldbsuite/test/lang/objc/real-definition/TestRealDefinition.py
@@ -92,7 +92,7 @@ class TestRealDefinition(TestBase):
"foo->_bar->_hidden_ivar = 0x"])
def common_setup(self):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py b/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
index 48c4313375c1..81d6b79ad535 100644
--- a/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
+++ b/packages/Python/lldbsuite/test/lang/objc/self/TestObjCSelf.py
@@ -15,7 +15,7 @@ class ObjCSelfTestCase(TestBase):
def test_with_run_command(self):
"""Test that the appropriate member variables are available when stopped in Objective-C class and instance methods"""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
self.set_breakpoint(line_number('main.m', '// breakpoint 1'))
self.set_breakpoint(line_number('main.m', '// breakpoint 2'))
diff --git a/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py b/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
index 54011db1a120..21f0892044ad 100644
--- a/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
+++ b/packages/Python/lldbsuite/test/lang/objc/single-entry-dictionary/TestObjCSingleEntryDictionary.py
@@ -30,7 +30,7 @@ class ObjCSingleEntryDictionaryTestCase(TestBase):
@expectedFailureAll(oslist=['watchos'], bugnumber="rdar://problem/34642736") # bug in NSDictionary formatting on watchos
def test_single_entry_dict(self):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Break inside the foo function which takes a bar_ptr argument.
diff --git a/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile
new file mode 100644
index 000000000000..579600704dcd
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/Makefile
@@ -0,0 +1,7 @@
+LEVEL = ../../../make
+OBJCXX_SOURCES := main.mm myobject.mm
+include $(LEVEL)/Makefile.rules
+
+# myobject.o needs to be built without debug info
+myobject.o: myobject.mm
+ $(CXX) -c -o $@ $<
diff --git a/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/TestNameClash.py b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/TestNameClash.py
new file mode 100644
index 000000000000..9b0c1f5eaef1
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/TestNameClash.py
@@ -0,0 +1,6 @@
+from lldbsuite.test import decorators
+from lldbsuite.test import lldbinline
+
+lldbinline.MakeInlineTest(
+ __file__, globals(), [
+ decorators.skipIfFreeBSD, decorators.skipIfLinux, decorators.skipIfWindows])
diff --git a/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/main.mm b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/main.mm
new file mode 100644
index 000000000000..b74871f42705
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/main.mm
@@ -0,0 +1,21 @@
+#import <Foundation/Foundation.h>
+
+namespace NS {
+ class MyObject { int i = 42; };
+ NS::MyObject globalObject;
+}
+
+@interface MyObject: NSObject
+@end
+
+int main ()
+{
+ @autoreleasepool
+ {
+ MyObject *o = [MyObject alloc];
+ return 0; //% self.expect("fr var o", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["(MyObject"]);
+ //% self.expect("fr var globalObject", DATA_TYPES_DISPLAYED_CORRECTLY, substrs = ["42"]);
+ }
+}
+
+
diff --git a/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm
new file mode 100644
index 000000000000..051c4e5eb1d5
--- /dev/null
+++ b/packages/Python/lldbsuite/test/lang/objcxx/class-name-clash/myobject.mm
@@ -0,0 +1,7 @@
+#import <Foundation/Foundation.h>
+
+@interface MyObject : NSObject
+@end
+
+@implementation MyObject
+@end
diff --git a/packages/Python/lldbsuite/test/linux/add-symbols/Makefile b/packages/Python/lldbsuite/test/linux/add-symbols/Makefile
index c701797f0a7d..71a5c11a83d1 100644
--- a/packages/Python/lldbsuite/test/linux/add-symbols/Makefile
+++ b/packages/Python/lldbsuite/test/linux/add-symbols/Makefile
@@ -2,11 +2,12 @@ LEVEL = ../../make
CXX_SOURCES := main.cpp
LD_EXTRAS += -Wl,--build-id=none
-localall : stripped.out all
+all: stripped.out
+
stripped.out : a.out
- $(OBJCOPY) --remove-section=.note.gnu.build-id --remove-section=.gnu_debuglink --strip-debug a.out stripped.out
+ $(OBJCOPY) --remove-section=.note.gnu.build-id --remove-section=.gnu_debuglink --strip-debug $< $@
clean::
- $(RM) stripped.out
+ $(RM) stripped.out
-include $(LEVEL)/Makefile.rules \ No newline at end of file
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py b/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
index 477ddf9c15b1..946c151bb8fa 100644
--- a/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
+++ b/packages/Python/lldbsuite/test/linux/add-symbols/TestTargetSymbolsAddCommand.py
@@ -22,8 +22,8 @@ class TargetSymbolsAddCommand(TestBase):
"""Test that 'target symbols add' can load the symbols
even if gnu.build-id and gnu_debuglink are not present in the module.
Similar to test_add_dsym_mid_execution test for macos."""
- self.build(clean=True)
- exe = os.path.join(os.getcwd(), "stripped.out")
+ self.build()
+ exe = self.getBuildArtifact("stripped.out")
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
@@ -46,7 +46,8 @@ class TargetSymbolsAddCommand(TestBase):
self.expect("frame select", substrs=['main.c'], matching=False)
# Tell LLDB that a.out has symbols for stripped.out
- self.runCmd("target symbols add -s stripped.out a.out")
+ self.runCmd("target symbols add -s %s %s" %
+ (exe, self.getBuildArtifact("a.out")))
# Check that symbols are now loaded and main.c is in the output.
self.expect("frame select", substrs=['main.c'])
diff --git a/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py b/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
index f24cae9ee0d9..7ffc29fd4981 100644
--- a/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
+++ b/packages/Python/lldbsuite/test/linux/builtin_trap/TestBuiltinTrap.py
@@ -30,7 +30,7 @@ class BuiltinTrapTestCase(TestBase):
def test_with_run_command(self):
"""Test that LLDB handles a function with __builtin_trap correctly."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(self, "main.cpp", self.line,
num_expected_locations=1,
diff --git a/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/Makefile b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/Makefile
new file mode 100644
index 000000000000..7cfad32f8272
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/Makefile
@@ -0,0 +1,10 @@
+LEVEL := ../../make
+
+C_SOURCES := a.c b.c
+a.o: CFLAGS_EXTRAS += -gsplit-dwarf
+
+include $(LEVEL)/Makefile.rules
+
+.PHONY: clean
+clean::
+ $(RM) -f a.dwo a.o b.o main
diff --git a/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
new file mode 100644
index 000000000000..db91c39c3983
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/TestMixedDwarfBinary.py
@@ -0,0 +1,46 @@
+""" Testing debugging of a binary with "mixed" dwarf (with/without fission). """
+import os
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestMixedDwarfBinary(TestBase):
+ mydir = TestBase.compute_mydir(__file__)
+
+ def setUp(self):
+ TestBase.setUp(self)
+
+ @no_debug_info_test # Prevent the genaration of the dwarf version of this test
+ @add_test_categories(["dwo"])
+ @skipUnlessPlatform(["linux"])
+ def test_mixed_dwarf(self):
+ """Test that 'frame variable' works
+ for the executable built from two source files compiled
+ with/whithout -gsplit-dwarf correspondingly."""
+
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+
+ self.target = self.dbg.CreateTarget(exe)
+ self.assertTrue(self.target, VALID_TARGET)
+
+ main_bp = self.target.BreakpointCreateByName("g", "a.out")
+ self.assertTrue(main_bp, VALID_BREAKPOINT)
+
+ self.process = self.target.LaunchSimple(
+ None, None, self.get_process_working_directory())
+ self.assertTrue(self.process, PROCESS_IS_VALID)
+
+ # The stop reason of the thread should be breakpoint.
+ self.assertTrue(self.process.GetState() == lldb.eStateStopped,
+ STOPPED_DUE_TO_BREAKPOINT)
+
+ frame = self.process.GetThreadAtIndex(0).GetFrameAtIndex(0)
+ x = frame.FindVariable("x")
+ self.assertTrue(x.IsValid(), "x is not valid")
+ y = frame.FindVariable("y")
+ self.assertTrue(y.IsValid(), "y is not valid")
+
diff --git a/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/a.c b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/a.c
new file mode 100644
index 000000000000..047e78a9b295
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/a.c
@@ -0,0 +1,3 @@
+int f() {
+ return 1;
+}
diff --git a/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/b.c b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/b.c
new file mode 100644
index 000000000000..d79970e13d49
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/mix-dwo-and-regular-objects/b.c
@@ -0,0 +1,11 @@
+extern int f();
+
+void g() {
+ int y = 14;
+ int x = f();
+}
+
+int main() {
+ g();
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/linux/sepdebugsymlink/Makefile b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/Makefile
new file mode 100644
index 000000000000..3fd14a74bf36
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/Makefile
@@ -0,0 +1,20 @@
+LEVEL = ../../make
+C_SOURCES := main.c
+
+all: dirsymlink
+
+dirreal: a.out
+ $(RM) -r $@
+ mkdir $@
+ $(OBJCOPY) --only-keep-debug $< $@/stripped.debug
+ $(OBJCOPY) --strip-all --add-gnu-debuglink=$@/stripped.debug $< $@/stripped.out
+
+dirsymlink: dirreal
+ $(RM) -r $@
+ mkdir $@
+ ln -s ../$</stripped.out $@/stripped.symlink
+
+clean::
+ $(RM) -r dirreal dirsymlink
+
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
new file mode 100644
index 000000000000..12506811c5e2
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/TestTargetSymbolsSepDebugSymlink.py
@@ -0,0 +1,23 @@
+""" Testing separate debug info loading for base binary with a symlink. """
+import os
+import time
+import lldb
+import sys
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestTargetSymbolsSepDebugSymlink(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test # Prevent the genaration of the dwarf version of this test
+ @skipUnlessPlatform(['linux'])
+ @skipIf(hostoslist=["windows"])
+ @skipIfRemote # llvm.org/pr36237
+ def test_target_symbols_sepdebug_symlink_case(self):
+ self.build()
+ exe = self.getBuildArtifact("dirsymlink/stripped.symlink")
+
+ lldbutil.run_to_name_breakpoint(self, "main", exe_name = exe)
diff --git a/packages/Python/lldbsuite/test/linux/sepdebugsymlink/main.c b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/main.c
new file mode 100644
index 000000000000..4cce7f667ff7
--- /dev/null
+++ b/packages/Python/lldbsuite/test/linux/sepdebugsymlink/main.c
@@ -0,0 +1,3 @@
+int main() {
+ return 0;
+}
diff --git a/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py b/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
index 068594701507..702d124834b2 100644
--- a/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
+++ b/packages/Python/lldbsuite/test/linux/thread/create_during_instruction_step/TestCreateDuringInstructionStep.py
@@ -26,7 +26,7 @@ class CreateDuringInstructionStepTestCase(TestBase):
bugnumber="llvm.org/pr24737")
def test_step_inst(self):
self.build(dictionary=self.getBuildFlags())
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target and target.IsValid(), "Target is valid")
diff --git a/packages/Python/lldbsuite/test/lldbinline.py b/packages/Python/lldbsuite/test/lldbinline.py
index 70a0dda5343b..bb925ef908f5 100644
--- a/packages/Python/lldbsuite/test/lldbinline.py
+++ b/packages/Python/lldbsuite/test/lldbinline.py
@@ -84,25 +84,14 @@ class CommandParser:
class InlineTest(TestBase):
# Internal implementation
- def getRerunArgs(self):
- # The -N option says to NOT run a if it matches the option argument, so
- # if we are using dSYM we say to NOT run dwarf (-N dwarf) and vice
- # versa.
- if self.using_dsym is None:
- # The test was skipped altogether.
- return ""
- elif self.using_dsym:
- return "-N dwarf %s" % (self.mydir)
- else:
- return "-N dsym %s" % (self.mydir)
-
def BuildMakefile(self):
- if os.path.exists("Makefile"):
+ makefilePath = self.getBuildArtifact("Makefile")
+ if os.path.exists(makefilePath):
return
categories = {}
- for f in os.listdir(os.getcwd()):
+ for f in os.listdir(self.getSourceDir()):
t = source_type(f)
if t:
if t in list(categories.keys()):
@@ -110,7 +99,7 @@ class InlineTest(TestBase):
else:
categories[t] = [f]
- makefile = open("Makefile", 'w+')
+ makefile = open(makefilePath, 'w+')
level = os.sep.join(
[".."] * len(self.mydir.split(os.sep))) + os.sep + "make"
@@ -134,56 +123,42 @@ class InlineTest(TestBase):
makefile.flush()
makefile.close()
- @add_test_categories(["dsym"])
- def __test_with_dsym(self):
- self.using_dsym = True
+ def _test(self):
self.BuildMakefile()
- self.buildDsym()
- self.do_test()
-
- @add_test_categories(["dwarf"])
- def __test_with_dwarf(self):
- self.using_dsym = False
- self.BuildMakefile()
- self.buildDwarf()
- self.do_test()
-
- @add_test_categories(["dwo"])
- def __test_with_dwo(self):
- self.using_dsym = False
- self.BuildMakefile()
- self.buildDwo()
- self.do_test()
-
- @add_test_categories(["gmodules"])
- def __test_with_gmodules(self):
- self.using_dsym = False
- self.BuildMakefile()
- self.buildGModules()
+ self.build()
self.do_test()
def execute_user_command(self, __command):
exec(__command, globals(), locals())
def do_test(self):
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
- source_files = [f for f in os.listdir(os.getcwd()) if source_type(f)]
+ exe = self.getBuildArtifact("a.out")
+ source_files = [f for f in os.listdir(self.getSourceDir())
+ if source_type(f)]
target = self.dbg.CreateTarget(exe)
parser = CommandParser()
parser.parse_source_files(source_files)
parser.set_breakpoints(target)
- process = target.LaunchSimple(None, None, os.getcwd())
+ process = target.LaunchSimple(None, None, self.get_process_working_directory())
+ hit_breakpoints = 0
while lldbutil.get_stopped_thread(process, lldb.eStopReasonBreakpoint):
+ hit_breakpoints += 1
thread = lldbutil.get_stopped_thread(
process, lldb.eStopReasonBreakpoint)
breakpoint_id = thread.GetStopReasonDataAtIndex(0)
parser.handle_breakpoint(self, breakpoint_id)
process.Continue()
+ self.assertTrue(hit_breakpoints > 0,
+ "inline test did not hit a single breakpoint")
+ # Either the process exited or the stepping plan is complete.
+ self.assertTrue(process.GetState() in [lldb.eStateStopped,
+ lldb.eStateExited],
+ PROCESS_EXITED)
+
# Utilities for testcases
def check_expression(self, expression, expected_result, use_summary=True):
@@ -223,32 +198,15 @@ def MakeInlineTest(__file, __globals, decorators=None):
InlineTest.mydir = TestBase.compute_mydir(__file)
test_name, _ = os.path.splitext(file_basename)
+
+ test_func = ApplyDecoratorsToFunction(InlineTest._test, decorators)
# Build the test case
- test = type(test_name, (InlineTest,), {'using_dsym': None})
- test.name = test_name
-
- target_platform = lldb.DBG.GetSelectedPlatform().GetTriple().split('-')[2]
- if test_categories.is_supported_on_platform(
- "dsym", target_platform, configuration.compiler):
- test.test_with_dsym = ApplyDecoratorsToFunction(
- test._InlineTest__test_with_dsym, decorators)
- if test_categories.is_supported_on_platform(
- "dwarf", target_platform, configuration.compiler):
- test.test_with_dwarf = ApplyDecoratorsToFunction(
- test._InlineTest__test_with_dwarf, decorators)
- if test_categories.is_supported_on_platform(
- "dwo", target_platform, configuration.compiler):
- test.test_with_dwo = ApplyDecoratorsToFunction(
- test._InlineTest__test_with_dwo, decorators)
- if test_categories.is_supported_on_platform(
- "gmodules", target_platform, configuration.compiler):
- test.test_with_gmodules = ApplyDecoratorsToFunction(
- test._InlineTest__test_with_gmodules, decorators)
+ test_class = type(test_name, (InlineTest,), dict(test=test_func, name=test_name))
# Add the test case to the globals, and hide InlineTest
- __globals.update({test_name: test})
+ __globals.update({test_name: test_class})
# Keep track of the original test filename so we report it
# correctly in test results.
- test.test_filename = __file
- return test
+ test_class.test_filename = __file
+ return test_class
diff --git a/packages/Python/lldbsuite/test/lldbplatformutil.py b/packages/Python/lldbsuite/test/lldbplatformutil.py
index f7da58bd5259..940b01e2fccb 100644
--- a/packages/Python/lldbsuite/test/lldbplatformutil.py
+++ b/packages/Python/lldbsuite/test/lldbplatformutil.py
@@ -33,6 +33,8 @@ def check_first_register_readable(test_case):
test_case.expect("register read zero", substrs=['zero = 0x'])
elif arch in ['s390x']:
test_case.expect("register read r0", substrs=['r0 = 0x'])
+ elif arch in ['powerpc64le']:
+ test_case.expect("register read r0", substrs=['r0 = 0x'])
else:
# TODO: Add check for other architectures
test_case.fail(
@@ -109,7 +111,7 @@ def getHostPlatform():
# Attempts to return a platform name matching a target Triple platform.
if sys.platform.startswith('linux'):
return 'linux'
- elif sys.platform.startswith('win32'):
+ elif sys.platform.startswith('win32') or sys.platform.startswith('cygwin'):
return 'windows'
elif sys.platform.startswith('darwin'):
return 'darwin'
diff --git a/packages/Python/lldbsuite/test/lldbtest.py b/packages/Python/lldbsuite/test/lldbtest.py
index ecc38f355436..d5dd90a86517 100644
--- a/packages/Python/lldbsuite/test/lldbtest.py
+++ b/packages/Python/lldbsuite/test/lldbtest.py
@@ -44,12 +44,14 @@ import inspect
import io
import os.path
import re
+import shutil
import signal
from subprocess import *
import sys
import time
import traceback
import types
+import distutils.spawn
# Third-party modules
import unittest2
@@ -69,15 +71,6 @@ from . import test_categories
from lldbsuite.support import encoded_file
from lldbsuite.support import funcutils
-# dosep.py starts lots and lots of dotest instances
-# This option helps you find if two (or more) dotest instances are using the same
-# directory at the same time
-# Enable it to cause test failures and stderr messages if dotest instances try to run in
-# the same directory simultaneously
-# it is disabled by default because it litters the test directories with
-# ".dirlock" files
-debug_confirm_directory_exclusivity = False
-
# See also dotest.parseOptionsAndInitTestdirs(), where the environment variables
# LLDB_COMMAND_TRACE and LLDB_DO_CLEANUP are set from '-t' and '-r dir'
# options.
@@ -368,8 +361,8 @@ class _RemoteProcess(_BaseProcess):
def launch(self, executable, args):
if self._install_remote:
src_path = executable
- dst_path = lldbutil.append_to_process_working_directory(
- os.path.basename(executable))
+ dst_path = lldbutil.join_remote_paths(
+ lldb.remote_platform.GetWorkingDirectory(), os.path.basename(executable))
dst_file_spec = lldb.SBFileSpec(dst_path, False)
err = lldb.remote_platform.Install(
@@ -497,6 +490,8 @@ def getsource_if_available(obj):
def builder_module():
if sys.platform.startswith("freebsd"):
return __import__("builder_freebsd")
+ if sys.platform.startswith("openbsd"):
+ return __import__("builder_openbsd")
if sys.platform.startswith("netbsd"):
return __import__("builder_netbsd")
if sys.platform.startswith("linux"):
@@ -522,11 +517,14 @@ class Base(unittest2.TestCase):
@staticmethod
def compute_mydir(test_file):
- '''Subclasses should call this function to correctly calculate the required "mydir" attribute as follows:
+ '''Subclasses should call this function to correctly calculate the
+ required "mydir" attribute as follows:
- mydir = TestBase.compute_mydir(__file__)'''
- test_dir = os.path.dirname(test_file)
- return test_dir[len(os.environ["LLDB_TEST"]) + 1:]
+ mydir = TestBase.compute_mydir(__file__)
+ '''
+ # /abs/path/to/packages/group/subdir/mytest.py -> group/subdir
+ rel_prefix = test_file[len(os.environ["LLDB_TEST"]) + 1:]
+ return os.path.dirname(rel_prefix)
def TraceOn(self):
"""Returns True if we are in trace mode (tracing detailed test execution)."""
@@ -548,31 +546,11 @@ class Base(unittest2.TestCase):
# Change current working directory if ${LLDB_TEST} is defined.
# See also dotest.py which sets up ${LLDB_TEST}.
if ("LLDB_TEST" in os.environ):
- full_dir = os.path.join(os.environ["LLDB_TEST"], cls.mydir)
+ full_dir = os.path.join(os.environ["LLDB_TEST"],
+ cls.mydir)
if traceAlways:
print("Change dir to:", full_dir, file=sys.stderr)
- os.chdir(os.path.join(os.environ["LLDB_TEST"], cls.mydir))
-
- if debug_confirm_directory_exclusivity:
- import lock
- cls.dir_lock = lock.Lock(os.path.join(full_dir, ".dirlock"))
- try:
- cls.dir_lock.try_acquire()
- # write the class that owns the lock into the lock file
- cls.dir_lock.handle.write(cls.__name__)
- except IOError as ioerror:
- # nothing else should have this directory lock
- # wait here until we get a lock
- cls.dir_lock.acquire()
- # read the previous owner from the lock file
- lock_id = cls.dir_lock.handle.read()
- print(
- "LOCK ERROR: {} wants to lock '{}' but it is already locked by '{}'".format(
- cls.__name__,
- full_dir,
- lock_id),
- file=sys.stderr)
- raise ioerror
+ os.chdir(full_dir)
# Set platform context.
cls.platformContext = lldbplatformutil.createPlatformContext()
@@ -602,10 +580,6 @@ class Base(unittest2.TestCase):
exc_type, exc_value, exc_tb = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_tb)
- if debug_confirm_directory_exclusivity:
- cls.dir_lock.release()
- del cls.dir_lock
-
# Restore old working directory.
if traceAlways:
print("Restore dir to:", cls.oldcwd, file=sys.stderr)
@@ -692,7 +666,7 @@ class Base(unittest2.TestCase):
if not lldb.remote_platform or not configuration.lldb_platform_working_dir:
return
- components = [str(self.test_number)] + self.mydir.split(os.path.sep)
+ components = self.mydir.split(os.path.sep) + [str(self.test_number), self.getBuildDirBasename()]
remote_test_dir = configuration.lldb_platform_working_dir
for c in components:
remote_test_dir = lldbutil.join_remote_paths(remote_test_dir, c)
@@ -717,6 +691,36 @@ class Base(unittest2.TestCase):
lldb.remote_platform.Run(shell_cmd)
self.addTearDownHook(clean_working_directory)
+ def getSourceDir(self):
+ """Return the full path to the current test."""
+ return os.path.join(os.environ["LLDB_TEST"], self.mydir)
+
+ def getBuildDirBasename(self):
+ return self.__class__.__module__ + "." + self.testMethodName
+
+ def getBuildDir(self):
+ """Return the full path to the current test."""
+ return os.path.join(os.environ["LLDB_BUILD"], self.mydir,
+ self.getBuildDirBasename())
+
+
+ def makeBuildDir(self):
+ """Create the test-specific working directory, deleting any previous
+ contents."""
+ # See also dotest.py which sets up ${LLDB_BUILD}.
+ bdir = self.getBuildDir()
+ if os.path.isdir(bdir):
+ shutil.rmtree(bdir)
+ lldbutil.mkdir_p(bdir)
+
+ def getBuildArtifact(self, name="a.out"):
+ """Return absolute path to an artifact in the test's build directory."""
+ return os.path.join(self.getBuildDir(), name)
+
+ def getSourcePath(self, name):
+ """Return absolute path to a file in the test's source directory."""
+ return os.path.join(self.getSourceDir(), name)
+
def setUp(self):
"""Fixture for unittest test case setup.
@@ -825,9 +829,6 @@ class Base(unittest2.TestCase):
self.setPlatformWorkingDir()
self.enableLogChannelsForCurrentTest()
- # Initialize debug_info
- self.debug_info = None
-
lib_dir = os.environ["LLDB_LIB_DIR"]
self.dsym = None
self.framework_dir = None
@@ -850,6 +851,7 @@ class Base(unittest2.TestCase):
self.framework_dir = None
self.dsym = None
self.darwinWithFramework = False
+ self.makeBuildDir()
def setAsync(self, value):
""" Sets async mode to True/False and ensures it is reset after the testcase completes."""
@@ -1236,6 +1238,13 @@ class Base(unittest2.TestCase):
return True
return False
+ def isPPC64le(self):
+ """Returns true if the architecture is PPC64LE."""
+ arch = self.getArchitecture()
+ if re.match("powerpc64le", arch):
+ return True
+ return False
+
def getArchitecture(self):
"""Returns the architecture in effect the test suite is running with."""
module = builder_module()
@@ -1378,13 +1387,17 @@ class Base(unittest2.TestCase):
option_str += " -C " + comp
return option_str
+ def getDebugInfo(self):
+ method = getattr(self, self.testMethodName)
+ return getattr(method, "debug_info", None)
+
# ==================================================
# Build methods supported through a plugin interface
# ==================================================
def getstdlibFlag(self):
""" Returns the proper -stdlib flag, or empty if not required."""
- if self.platformIsDarwin() or self.getPlatform() == "freebsd":
+ if self.platformIsDarwin() or self.getPlatform() == "freebsd" or self.getPlatform() == "openbsd":
stdlibflag = "-stdlib=libc++"
else: # this includes NetBSD
stdlibflag = ""
@@ -1402,7 +1415,6 @@ class Base(unittest2.TestCase):
""" Platform-specific way to build a program that links with LLDB (via the liblldb.so
or LLDB.framework).
"""
-
stdflag = self.getstdFlag()
stdlibflag = self.getstdlibFlag()
@@ -1414,7 +1426,7 @@ class Base(unittest2.TestCase):
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
'LD_EXTRAS': "%s -Wl,-rpath,%s" % (self.dsym, self.framework_dir),
}
- elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+ elif sys.platform.startswith('win'):
d = {
'CXX_SOURCES': sources,
'EXE': exe_name,
@@ -1423,8 +1435,8 @@ class Base(unittest2.TestCase):
os.path.join(
os.environ["LLDB_SRC"],
"include")),
- 'LD_EXTRAS': "-L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
- elif sys.platform.startswith('win'):
+ 'LD_EXTRAS': "-L%s -lliblldb" % os.environ["LLDB_IMPLIB_DIR"]}
+ else:
d = {
'CXX_SOURCES': sources,
'EXE': exe_name,
@@ -1433,7 +1445,7 @@ class Base(unittest2.TestCase):
os.path.join(
os.environ["LLDB_SRC"],
"include")),
- 'LD_EXTRAS': "-L%s -lliblldb" % os.environ["LLDB_IMPLIB_DIR"]}
+ 'LD_EXTRAS': "-L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
if self.TraceOn():
print(
"Building LLDB Driver (%s) from sources %s" %
@@ -1454,16 +1466,16 @@ class Base(unittest2.TestCase):
'FRAMEWORK_INCLUDES': "-F%s" % self.framework_dir,
'LD_EXTRAS': "%s -Wl,-rpath,%s -dynamiclib" % (self.dsym, self.framework_dir),
}
- elif sys.platform.rstrip('0123456789') in ('freebsd', 'linux', 'netbsd', 'darwin') or os.environ.get('LLDB_BUILD_TYPE') == 'Makefile':
+ elif self.getPlatform() == 'windows':
d = {
'DYLIB_CXX_SOURCES': sources,
'DYLIB_NAME': lib_name,
- 'CFLAGS_EXTRAS': "%s -I%s -fPIC" % (stdflag,
- os.path.join(
- os.environ["LLDB_SRC"],
- "include")),
- 'LD_EXTRAS': "-shared -L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
- elif self.getPlatform() == 'windows':
+ 'CFLAGS_EXTRAS': "%s -I%s " % (stdflag,
+ os.path.join(
+ os.environ["LLDB_SRC"],
+ "include")),
+ 'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]}
+ else:
d = {
'DYLIB_CXX_SOURCES': sources,
'DYLIB_NAME': lib_name,
@@ -1471,7 +1483,7 @@ class Base(unittest2.TestCase):
os.path.join(
os.environ["LLDB_SRC"],
"include")),
- 'LD_EXTRAS': "-shared -l%s\liblldb.lib" % self.os.environ["LLDB_IMPLIB_DIR"]}
+ 'LD_EXTRAS': "-shared -L%s/../lib -llldb -Wl,-rpath,%s/../lib" % (lib_dir, lib_dir)}
if self.TraceOn():
print(
"Building LLDB Library (%s) from sources %s" %
@@ -1489,91 +1501,91 @@ class Base(unittest2.TestCase):
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build the default binaries."""
+ testdir = self.mydir
+ testname = self.getBuildDirBasename()
+ if self.getDebugInfo():
+ raise Exception("buildDefault tests must set NO_DEBUG_INFO_TESTCASE")
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if not module.buildDefault(
- self,
- architecture,
- compiler,
- dictionary,
- clean):
+ if not module.buildDefault(self, architecture, compiler,
+ dictionary, testdir, testname):
raise Exception("Don't know how to build default binary")
def buildDsym(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dsym info."""
+ testdir = self.mydir
+ testname = self.getBuildDirBasename()
+ if self.getDebugInfo() != "dsym":
+ raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
+
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if not module.buildDsym(
- self,
- architecture,
- compiler,
- dictionary,
- clean):
+ if not module.buildDsym(self, architecture, compiler,
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dsym")
def buildDwarf(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dwarf maps."""
+ testdir = self.mydir
+ testname = self.getBuildDirBasename()
+ if self.getDebugInfo() != "dwarf":
+ raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
+
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if not module.buildDwarf(
- self,
- architecture,
- compiler,
- dictionary,
- clean):
+ if not module.buildDwarf(self, architecture, compiler,
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dwarf")
def buildDwo(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with dwarf maps."""
+ testdir = self.mydir
+ testname = self.getBuildDirBasename()
+ if self.getDebugInfo() != "dwo":
+ raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
+
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if not module.buildDwo(
- self,
- architecture,
- compiler,
- dictionary,
- clean):
+ if not module.buildDwo(self, architecture, compiler,
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with dwo")
def buildGModules(
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build binaries with gmodules info."""
+ testdir = self.mydir
+ testname = self.getBuildDirBasename()
+ if self.getDebugInfo() != "gmodules":
+ raise Exception("NO_DEBUG_INFO_TESTCASE must build with buildDefault")
+
module = builder_module()
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if not module.buildGModules(
- self,
- architecture,
- compiler,
- dictionary,
- clean):
+ if not module.buildGModules(self, architecture, compiler,
+ dictionary, testdir, testname):
raise Exception("Don't know how to build binary with gmodules")
def buildGo(self):
"""Build the default go binary.
"""
- system([[which('go'), 'build -gcflags "-N -l" -o a.out main.go']])
+ exe = self.getBuildArtifact("a.out")
+ system([[which('go'), 'build -gcflags "-N -l" -o %s main.go' % exe]])
def signBinary(self, binary_path):
if sys.platform.startswith("darwin"):
@@ -1584,10 +1596,10 @@ class Base(unittest2.TestCase):
def findBuiltClang(self):
"""Tries to find and use Clang from the build directory as the compiler (instead of the system compiler)."""
paths_to_try = [
- "llvm-build/Release+Asserts/x86_64/Release+Asserts/bin/clang",
- "llvm-build/Debug+Asserts/x86_64/Debug+Asserts/bin/clang",
- "llvm-build/Release/x86_64/Release/bin/clang",
- "llvm-build/Debug/x86_64/Debug/bin/clang",
+ "llvm-build/Release+Asserts/x86_64/bin/clang",
+ "llvm-build/Debug+Asserts/x86_64/bin/clang",
+ "llvm-build/Release/x86_64/bin/clang",
+ "llvm-build/Debug/x86_64/bin/clang",
]
lldb_root_path = os.path.join(
os.path.dirname(__file__), "..", "..", "..", "..")
@@ -1597,12 +1609,38 @@ class Base(unittest2.TestCase):
return path
# Tries to find clang at the same folder as the lldb
- path = os.path.join(os.path.dirname(lldbtest_config.lldbExec), "clang")
- if os.path.exists(path):
+ lldb_dir = os.path.dirname(lldbtest_config.lldbExec)
+ path = distutils.spawn.find_executable("clang", lldb_dir)
+ if path is not None:
return path
return os.environ["CC"]
+ def findYaml2obj(self):
+ """
+ Get the path to the yaml2obj executable, which can be used to create
+ test object files from easy to write yaml instructions.
+
+ Throws an Exception if the executable cannot be found.
+ """
+ # Tries to find yaml2obj at the same folder as clang
+ clang_dir = os.path.dirname(self.findBuiltClang())
+ path = distutils.spawn.find_executable("yaml2obj", clang_dir)
+ if path is not None:
+ return path
+ raise Exception("yaml2obj executable not found")
+
+
+ def yaml2obj(self, yaml_path, obj_path):
+ """
+ Create an object file at the given path from a yaml file.
+
+ Throws subprocess.CalledProcessError if the object could not be created.
+ """
+ yaml2obj = self.findYaml2obj()
+ command = [yaml2obj, "-o=%s" % obj_path, yaml_path]
+ system([command])
+
def getBuildFlags(
self,
use_cpp11=True,
@@ -1636,6 +1674,8 @@ class Base(unittest2.TestCase):
cflags += "c++11"
if self.platformIsDarwin() or self.getPlatform() == "freebsd":
cflags += " -stdlib=libc++"
+ elif self.getPlatform() == "openbsd":
+ cflags += " -stdlib=libc++"
elif self.getPlatform() == "netbsd":
cflags += " -stdlib=libstdc++"
elif "clang" in self.getCompiler():
@@ -1670,7 +1710,7 @@ class Base(unittest2.TestCase):
return lib_dir
def getLibcPlusPlusLibs(self):
- if self.getPlatform() in ('freebsd', 'linux', 'netbsd'):
+ if self.getPlatform() in ('freebsd', 'linux', 'netbsd', 'openbsd'):
return ['libc++.so.1']
else:
return ['libc++.1.dylib', 'libc++abi.dylib']
@@ -1696,14 +1736,11 @@ class LLDBTestCaseFactory(type):
for attrname, attrvalue in attrs.items():
if attrname.startswith("test") and not getattr(
attrvalue, "__no_debug_info_test__", False):
- target_platform = lldb.DBG.GetSelectedPlatform(
- ).GetTriple().split('-')[2]
# If any debug info categories were explicitly tagged, assume that list to be
# authoritative. If none were specified, try with all debug
# info formats.
- all_dbginfo_categories = set(
- test_categories.debug_info_categories)
+ all_dbginfo_categories = set(test_categories.debug_info_categories)
categories = set(
getattr(
attrvalue,
@@ -1712,48 +1749,16 @@ class LLDBTestCaseFactory(type):
if not categories:
categories = all_dbginfo_categories
- supported_categories = [
- x for x in categories if test_categories.is_supported_on_platform(
- x, target_platform, configuration.compiler)]
- if "dsym" in supported_categories:
- @decorators.add_test_categories(["dsym"])
- @wraps(attrvalue)
- def dsym_test_method(self, attrvalue=attrvalue):
- self.debug_info = "dsym"
- return attrvalue(self)
- dsym_method_name = attrname + "_dsym"
- dsym_test_method.__name__ = dsym_method_name
- newattrs[dsym_method_name] = dsym_test_method
-
- if "dwarf" in supported_categories:
- @decorators.add_test_categories(["dwarf"])
+ for cat in categories:
+ @decorators.add_test_categories([cat])
@wraps(attrvalue)
- def dwarf_test_method(self, attrvalue=attrvalue):
- self.debug_info = "dwarf"
+ def test_method(self, attrvalue=attrvalue):
return attrvalue(self)
- dwarf_method_name = attrname + "_dwarf"
- dwarf_test_method.__name__ = dwarf_method_name
- newattrs[dwarf_method_name] = dwarf_test_method
- if "dwo" in supported_categories:
- @decorators.add_test_categories(["dwo"])
- @wraps(attrvalue)
- def dwo_test_method(self, attrvalue=attrvalue):
- self.debug_info = "dwo"
- return attrvalue(self)
- dwo_method_name = attrname + "_dwo"
- dwo_test_method.__name__ = dwo_method_name
- newattrs[dwo_method_name] = dwo_test_method
-
- if "gmodules" in supported_categories:
- @decorators.add_test_categories(["gmodules"])
- @wraps(attrvalue)
- def gmodules_test_method(self, attrvalue=attrvalue):
- self.debug_info = "gmodules"
- return attrvalue(self)
- gmodules_method_name = attrname + "_gmodules"
- gmodules_test_method.__name__ = gmodules_method_name
- newattrs[gmodules_method_name] = gmodules_test_method
+ method_name = attrname + "_" + cat
+ test_method.__name__ = method_name
+ test_method.debug_info = cat
+ newattrs[method_name] = test_method
else:
newattrs[attrname] = attrvalue
@@ -1828,7 +1833,7 @@ class TestBase(Base):
# Maximum allowed attempts when launching the inferior process.
# Can be overridden by the LLDB_MAX_LAUNCH_COUNT environment variable.
- maxLaunchCount = 3
+ maxLaunchCount = 1
# Time to wait before the next launching attempt in second(s).
# Can be overridden by the LLDB_TIME_WAIT_NEXT_LAUNCH environment variable.
@@ -1836,7 +1841,7 @@ class TestBase(Base):
def generateSource(self, source):
template = source + '.template'
- temp = os.path.join(os.getcwd(), template)
+ temp = os.path.join(self.getSourceDir(), template)
with open(temp, 'r') as f:
content = f.read()
@@ -1855,7 +1860,7 @@ class TestBase(Base):
header.startswith("SB") and header.endswith(".h"))]
includes = '\n'.join(list)
new_content = content.replace('%include_SB_APIs%', includes)
- src = os.path.join(os.getcwd(), source)
+ src = os.path.join(self.getBuildDir(), source)
with open(src, 'w') as f:
f.write(new_content)
@@ -1869,6 +1874,19 @@ class TestBase(Base):
# decorators.
Base.setUp(self)
+ if self.child:
+ # Set the clang modules cache path.
+ assert(self.getDebugInfo() == 'default')
+ mod_cache = os.path.join(self.getBuildDir(), "module-cache")
+ self.runCmd('settings set symbols.clang-modules-cache-path "%s"'
+ % mod_cache)
+
+ # Disable Spotlight lookup. The testsuite creates
+ # different binaries with the same UUID, because they only
+ # differ in the debug info, which is not being hashed.
+ self.runCmd('settings set symbols.enable-external-lookup false')
+
+
if "LLDB_MAX_LAUNCH_COUNT" in os.environ:
self.maxLaunchCount = int(os.environ["LLDB_MAX_LAUNCH_COUNT"])
@@ -1916,12 +1934,12 @@ class TestBase(Base):
else:
# Check relative names
local_shlib_path = os.path.join(
- os.getcwd(), shlib_prefix + name + shlib_extension)
+ self.getBuildDir(), shlib_prefix + name + shlib_extension)
if not os.path.exists(local_shlib_path):
local_shlib_path = os.path.join(
- os.getcwd(), name + shlib_extension)
+ self.getBuildDir(), name + shlib_extension)
if not os.path.exists(local_shlib_path):
- local_shlib_path = os.path.join(os.getcwd(), name)
+ local_shlib_path = os.path.join(self.getBuildDir(), name)
# Make sure we found the local shared library in the above code
self.assertTrue(os.path.exists(local_shlib_path))
@@ -1931,7 +1949,7 @@ class TestBase(Base):
if lldb.remote_platform:
# We must set the remote install location if we want the shared library
# to get uploaded to the remote target
- remote_shlib_path = lldbutil.append_to_process_working_directory(
+ remote_shlib_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(local_shlib_path))
shlib_module.SetRemoteInstallFileSpec(
lldb.SBFileSpec(remote_shlib_path, False))
@@ -1968,7 +1986,7 @@ class TestBase(Base):
return lldb.remote_platform.GetWorkingDirectory()
else:
# local tests change directory into each test subdirectory
- return os.getcwd()
+ return self.getBuildDir()
def tearDown(self):
#import traceback
@@ -2249,24 +2267,23 @@ class TestBase(Base):
self,
architecture=None,
compiler=None,
- dictionary=None,
- clean=True):
+ dictionary=None):
"""Platform specific way to build the default binaries."""
module = builder_module()
+
dictionary = lldbplatformutil.finalize_build_dictionary(dictionary)
- if self.debug_info is None:
- return self.buildDefault(architecture, compiler, dictionary, clean)
- elif self.debug_info == "dsym":
- return self.buildDsym(architecture, compiler, dictionary, clean)
- elif self.debug_info == "dwarf":
- return self.buildDwarf(architecture, compiler, dictionary, clean)
- elif self.debug_info == "dwo":
- return self.buildDwo(architecture, compiler, dictionary, clean)
- elif self.debug_info == "gmodules":
- return self.buildGModules(
- architecture, compiler, dictionary, clean)
+ if self.getDebugInfo() is None:
+ return self.buildDefault(architecture, compiler, dictionary)
+ elif self.getDebugInfo() == "dsym":
+ return self.buildDsym(architecture, compiler, dictionary)
+ elif self.getDebugInfo() == "dwarf":
+ return self.buildDwarf(architecture, compiler, dictionary)
+ elif self.getDebugInfo() == "dwo":
+ return self.buildDwo(architecture, compiler, dictionary)
+ elif self.getDebugInfo() == "gmodules":
+ return self.buildGModules(architecture, compiler, dictionary)
else:
- self.fail("Can't build for debug info: %s" % self.debug_info)
+ self.fail("Can't build for debug info: %s" % self.getDebugInfo())
def run_platform_command(self, cmd):
platform = self.dbg.GetSelectedPlatform()
diff --git a/packages/Python/lldbsuite/test/lldbtest_config.py b/packages/Python/lldbsuite/test/lldbtest_config.py
index 2e8e302fc7aa..30546afe17bd 100644
--- a/packages/Python/lldbsuite/test/lldbtest_config.py
+++ b/packages/Python/lldbsuite/test/lldbtest_config.py
@@ -16,5 +16,8 @@ channels = []
# leave logs/traces even for successful test runs
log_success = False
+# Indicate whether we're testing with an out-of-tree debugserver
+out_of_tree_debugserver = False
+
# path to the lldb command line executable tool
lldbExec = None
diff --git a/packages/Python/lldbsuite/test/lldbutil.py b/packages/Python/lldbsuite/test/lldbutil.py
index 58a1ead1ea0b..90ac799f4897 100644
--- a/packages/Python/lldbsuite/test/lldbutil.py
+++ b/packages/Python/lldbsuite/test/lldbutil.py
@@ -9,6 +9,7 @@ from __future__ import absolute_import
# System modules
import collections
+import errno
import os
import re
import sys
@@ -44,6 +45,14 @@ def which(program):
return exe_file
return None
+def mkdir_p(path):
+ try:
+ os.makedirs(path)
+ except OSError as e:
+ if e.errno != errno.EEXIST:
+ raise
+ if not os.path.isdir(path):
+ raise OSError(errno.ENOTDIR, "%s is not a directory"%path)
# ===================================================
# Disassembly for an SBFunction or an SBSymbol object
# ===================================================
@@ -334,7 +343,8 @@ def run_break_set_by_file_and_line(
If extra_options is not None, then we append it to the breakpoint set command.
- If num_expected_locations is -1 we check that we got AT LEAST one location, otherwise we check that num_expected_locations equals the number of locations.
+ If num_expected_locations is -1, we check that we got AT LEAST one location. If num_expected_locations is -2, we don't
+ check the actual number at all. Otherwise, we check that num_expected_locations equals the number of locations.
If loc_exact is true, we check that there is one location, and that location must be at the input file and line number."""
@@ -554,7 +564,7 @@ def check_breakpoint_result(
if num_locations == -1:
test.assertTrue(out_num_locations > 0,
"Expecting one or more locations, got none.")
- else:
+ elif num_locations != -2:
test.assertTrue(
num_locations == out_num_locations,
"Expecting %d locations, got %d." %
@@ -566,7 +576,7 @@ def check_breakpoint_result(
if 'file' in break_results:
out_file_name = break_results['file']
test.assertTrue(
- file_name == out_file_name,
+ file_name.endswith(out_file_name),
"Breakpoint file name '%s' doesn't match resultant name '%s'." %
(file_name,
out_file_name))
@@ -725,29 +735,18 @@ def get_crashed_threads(test, process):
threads.append(thread)
return threads
-def run_to_source_breakpoint(test, bkpt_pattern, source_spec, launch_info = None, exe_name = "a.out", in_cwd = True):
- """Start up a target, using exe_name as the executable, and run it to
- a breakpoint set by source regex bkpt_pattern.
- If you want to pass in launch arguments or environment variables, you can optionally pass in
- an SBLaunchInfo. If you do that, remember to set the working directory as well.
- If your executable isn't called a.out, you can pass that in. And if your executable isn't
- in the CWD, pass in the absolute path to the executable in exe_name, and set in_cwd to False.
- If the target isn't valid, the breakpoint isn't found, or hit, the
- function will cause a testsuite failure.
- If successful it returns a tuple with the target process and thread that hit the breakpoint."""
+# Helper functions for run_to_{source,name}_breakpoint:
+def run_to_breakpoint_make_target(test, exe_name, in_cwd):
if in_cwd:
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = test.getBuildArtifact(exe_name)
# Create the target
target = test.dbg.CreateTarget(exe)
test.assertTrue(target, "Target: %s is not valid."%(exe_name))
+ return target
- # Set the breakpoints
- breakpoint = target.BreakpointCreateBySourceRegex(
- bkpt_pattern, source_spec)
- test.assertTrue(breakpoint.GetNumLocations() > 0,
- 'No locations found for source breakpoint: "%s"'%(bkpt_pattern))
+def run_to_breakpoint_do_run(test, target, bkpt, launch_info):
# Launch the process, and do not stop at the entry point.
if not launch_info:
@@ -757,15 +756,71 @@ def run_to_source_breakpoint(test, bkpt_pattern, source_spec, launch_info = None
error = lldb.SBError()
process = target.Launch(launch_info, error)
- test.assertTrue(process, "Could not create a valid process for %s: %s"%(exe_name, error.GetCString()))
+ test.assertTrue(process,
+ "Could not create a valid process for %s: %s"%(target.GetExecutable().GetFilename(),
+ error.GetCString()))
# Frame #0 should be at our breakpoint.
threads = get_threads_stopped_at_breakpoint(
- process, breakpoint)
+ process, bkpt)
test.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads)))
thread = threads[0]
- return (target, process, thread, breakpoint)
+ return (target, process, thread, bkpt)
+
+def run_to_name_breakpoint (test, bkpt_name, launch_info = None,
+ exe_name = "a.out",
+ bkpt_module = None,
+ in_cwd = True):
+ """Start up a target, using exe_name as the executable, and run it to
+ a breakpoint set by name on bkpt_name restricted to bkpt_module.
+
+ If you want to pass in launch arguments or environment
+ variables, you can optionally pass in an SBLaunchInfo. If you
+ do that, remember to set the working directory as well.
+
+ If your executable isn't called a.out, you can pass that in.
+ And if your executable isn't in the CWD, pass in the absolute
+ path to the executable in exe_name, and set in_cwd to False.
+
+ If you need to restrict the breakpoint to a particular module,
+ pass the module name (a string not a FileSpec) in bkpt_module. If
+ nothing is passed in setting will be unrestricted.
+
+ If the target isn't valid, the breakpoint isn't found, or hit, the
+ function will cause a testsuite failure.
+
+ If successful it returns a tuple with the target process and
+ thread that hit the breakpoint, and the breakpoint that we set
+ for you.
+ """
+
+ target = run_to_breakpoint_make_target(test, exe_name, in_cwd)
+
+ breakpoint = target.BreakpointCreateByName(bkpt_name, bkpt_module)
+
+
+ test.assertTrue(breakpoint.GetNumLocations() > 0,
+ "No locations found for name breakpoint: '%s'."%(bkpt_name))
+ return run_to_breakpoint_do_run(test, target, breakpoint, launch_info)
+
+def run_to_source_breakpoint(test, bkpt_pattern, source_spec,
+ launch_info = None, exe_name = "a.out",
+ bkpt_module = None,
+ in_cwd = True):
+ """Start up a target, using exe_name as the executable, and run it to
+ a breakpoint set by source regex bkpt_pattern.
+
+ The rest of the behavior is the same as run_to_name_breakpoint.
+ """
+
+ target = run_to_breakpoint_make_target(test, exe_name, in_cwd)
+ # Set the breakpoints
+ breakpoint = target.BreakpointCreateBySourceRegex(
+ bkpt_pattern, source_spec, bkpt_module)
+ test.assertTrue(breakpoint.GetNumLocations() > 0,
+ 'No locations found for source breakpoint: "%s", file: "%s", dir: "%s"'%(bkpt_pattern, source_spec.GetFilename(), source_spec.GetDirectory()))
+ return run_to_breakpoint_do_run(test, target, breakpoint, launch_info)
def continue_to_breakpoint(process, bkpt):
""" Continues the process, if it stops, returns the threads stopped at bkpt; otherwise, returns None"""
@@ -1195,11 +1250,11 @@ def join_remote_paths(*paths):
return os.path.join(*paths).replace(os.path.sep, '/')
-def append_to_process_working_directory(*paths):
+def append_to_process_working_directory(test, *paths):
remote = lldb.remote_platform
if remote:
return join_remote_paths(remote.GetWorkingDirectory(), *paths)
- return os.path.join(os.getcwd(), *paths)
+ return os.path.join(test.getBuildDir(), *paths)
# ==================================================
# Utility functions to get the correct signal number
@@ -1266,6 +1321,21 @@ def skip_if_library_missing(test, target, library):
target))
+def read_file_on_target(test, remote):
+ if lldb.remote_platform:
+ local = test.getBuildArtifact("file_from_target")
+ error = lldb.remote_platform.Get(lldb.SBFileSpec(remote, False),
+ lldb.SBFileSpec(local, True))
+ test.assertTrue(error.Success(), "Reading file {0} failed: {1}".format(remote, error))
+ else:
+ local = remote
+ with open(local, 'r') as f:
+ return f.read()
+
+def read_file_from_process_wd(test, name):
+ path = append_to_process_working_directory(test, name)
+ return read_file_on_target(test, path)
+
def wait_for_file_on_target(testcase, file_path, max_attempts=6):
for i in range(max_attempts):
err, retcode, msg = testcase.run_platform_command("ls %s" % file_path)
@@ -1280,9 +1350,4 @@ def wait_for_file_on_target(testcase, file_path, max_attempts=6):
"File %s not found even after %d attempts." %
(file_path, max_attempts))
- err, retcode, data = testcase.run_platform_command("cat %s" % (file_path))
-
- testcase.assertTrue(
- err.Success() and retcode == 0, "Failed to read file %s: %s, retcode: %d" %
- (file_path, err.GetCString(), retcode))
- return data
+ return read_file_on_target(testcase, file_path)
diff --git a/packages/Python/lldbsuite/test/logging/TestLogging.py b/packages/Python/lldbsuite/test/logging/TestLogging.py
index 690c4f6ea69e..cafbe437d84d 100644
--- a/packages/Python/lldbsuite/test/logging/TestLogging.py
+++ b/packages/Python/lldbsuite/test/logging/TestLogging.py
@@ -17,34 +17,19 @@ from lldbsuite.test import lldbutil
class LogTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- append_log_file = "lldb-commands-log-append.txt"
- truncate_log_file = "lldb-commands-log-truncate.txt"
+ NO_DEBUG_INFO_TESTCASE = True
- @classmethod
- def classCleanup(cls):
- """Cleanup the test byproducts."""
- cls.RemoveTempFile(cls.truncate_log_file)
- cls.RemoveTempFile(cls.append_log_file)
+ def setUp(self):
+ super(LogTestCase, self).setUp()
+ self.log_file = self.getBuildArtifact("log-file.txt")
def test(self):
self.build()
- if self.debug_info == "dsym":
- self.command_log_tests("dsym")
- else:
- self.command_log_tests("dwarf")
-
- def command_log_tests(self, type):
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.expect("file " + exe,
patterns=["Current executable set to .*a.out"])
- log_file = os.path.join(
- os.getcwd(),
- "lldb-commands-log-%s-%s-%s.txt" %
- (type,
- os.path.basename(
- self.getCompiler()),
- self.getArchitecture()))
+ log_file = os.path.join(self.getBuildDir(), "lldb-commands-log.txt")
if (os.path.exists(log_file)):
os.remove(log_file)
@@ -75,47 +60,35 @@ class LogTestCase(TestBase):
"Something was written to the log file.")
# Check that lldb truncates its log files
- @no_debug_info_test
def test_log_truncate(self):
- if (os.path.exists(self.truncate_log_file)):
- os.remove(self.truncate_log_file)
-
# put something in our log file
- with open(self.truncate_log_file, "w") as f:
+ with open(self.log_file, "w") as f:
for i in range(1, 1000):
f.write("bacon\n")
- self.runCmd(
- "log enable -t -f '%s' lldb commands" %
- (self.truncate_log_file))
+ self.runCmd("log enable -t -f '%s' lldb commands" % self.log_file)
self.runCmd("help log")
self.runCmd("log disable lldb")
- self.assertTrue(os.path.isfile(self.truncate_log_file))
- with open(self.truncate_log_file, "r") as f:
+ self.assertTrue(os.path.isfile(self.log_file))
+ with open(self.log_file, "r") as f:
contents = f.read()
# check that it got removed
self.assertEquals(contents.find("bacon"), -1)
# Check that lldb can append to a log file
- @no_debug_info_test
def test_log_append(self):
- if (os.path.exists(self.append_log_file)):
- os.remove(self.append_log_file)
-
# put something in our log file
- with open(self.append_log_file, "w") as f:
+ with open(self.log_file, "w") as f:
f.write("bacon\n")
- self.runCmd(
- "log enable -t -a -f '%s' lldb commands" %
- (self.append_log_file))
+ self.runCmd( "log enable -t -a -f '%s' lldb commands" % self.log_file)
self.runCmd("help log")
self.runCmd("log disable lldb")
- self.assertTrue(os.path.isfile(self.append_log_file))
- with open(self.append_log_file, "r") as f:
+ self.assertTrue(os.path.isfile(self.log_file))
+ with open(self.log_file, "r") as f:
contents = f.read()
# check that it is still there
diff --git a/packages/Python/lldbsuite/test/macosx/add-dsym/Makefile b/packages/Python/lldbsuite/test/macosx/add-dsym/Makefile
index 3a363ab98c17..5abcf02738c4 100644
--- a/packages/Python/lldbsuite/test/macosx/add-dsym/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/add-dsym/Makefile
@@ -13,10 +13,10 @@ ifeq "$(OS)" "Darwin"
CFLAGS += -arch $(ARCH)
endif
-all: clean
+all: main.c clean
mkdir hide.app
mkdir hide.app/Contents
- $(CC) $(CFLAGS) -g main.c
+ $(CC) $(CFLAGS) -g $<
mv a.out.dSYM hide.app/Contents
strip -x a.out
diff --git a/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py b/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
index ec20ee2a24c0..be122f4f500d 100644
--- a/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
+++ b/packages/Python/lldbsuite/test/macosx/add-dsym/TestAddDsymMidExecutionCommand.py
@@ -25,8 +25,8 @@ class AddDsymMidExecutionCommandCase(TestBase):
@no_debug_info_test # Prevent the genaration of the dwarf version of this test
def test_add_dsym_mid_execution(self):
"""Test that add-dsym mid-execution loads the symbols at the right place for a slid binary."""
- self.buildDsym(clean=True)
- exe = os.path.join(os.getcwd(), "a.out")
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
+ exe = self.getBuildArtifact("a.out")
self.target = self.dbg.CreateTarget(exe)
self.assertTrue(self.target, VALID_TARGET)
@@ -43,7 +43,8 @@ class AddDsymMidExecutionCommandCase(TestBase):
self.assertTrue(self.process.GetState() == lldb.eStateStopped,
STOPPED_DUE_TO_BREAKPOINT)
- self.runCmd("add-dsym hide.app/Contents/a.out.dSYM")
+ self.runCmd("add-dsym " +
+ self.getBuildArtifact("hide.app/Contents/a.out.dSYM"))
self.expect("frame select",
substrs=['a.out`main at main.c'])
diff --git a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py b/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
deleted file mode 100644
index ff1ca2a9381e..000000000000
--- a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/TestAppleTypesIsProduced.py
+++ /dev/null
@@ -1,71 +0,0 @@
-"""
-Test that clang produces the __apple accelerator tables, for example, __apple_types, correctly.
-"""
-
-from __future__ import print_function
-
-
-import os
-import time
-import lldb
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-from lldbsuite.test.lldbutil import symbol_type_to_str
-
-
-class AppleTypesTestCase(TestBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- # rdar://problem/11166975
- @skipUnlessDarwin
- def test_debug_info_for_apple_types(self):
- """Test that __apple_types section does get produced by clang."""
-
- if not self.getCompiler().endswith('clang'):
- self.skipTest("clang compiler only test")
-
- self.build()
- if self.debug_info == "dsym":
- exe = os.path.join(os.getcwd(),
- "a.out.dSYM/Contents/Resources/DWARF/a.out")
- else:
- exe = os.path.join(os.getcwd(), "main.o")
-
- target = self.dbg.CreateTarget(exe)
- self.assertTrue(target, VALID_TARGET)
- self.assertTrue(target.GetNumModules() > 0)
-
- # Hide stdout if not running with '-t' option.
- if not self.TraceOn():
- self.HideStdout()
-
- print("Number of modules for the target: %d" % target.GetNumModules())
- for module in target.module_iter():
- print(module)
-
- # Get the executable module at index 0.
- exe_module = target.GetModuleAtIndex(0)
-
- dwarf_section = exe_module.FindSection("__DWARF")
- self.assertTrue(dwarf_section)
- print("__DWARF section:", dwarf_section)
- print("Number of sub-sections: %d" % dwarf_section.GetNumSubSections())
- INDENT = ' ' * 4
- for subsec in dwarf_section:
- print(INDENT + str(subsec))
-
- debug_str_sub_section = dwarf_section.FindSubSection("__debug_str")
- self.assertTrue(debug_str_sub_section)
- print("__debug_str sub-section:", debug_str_sub_section)
-
- # Find our __apple_types section by name.
- apple_types_sub_section = dwarf_section.FindSubSection("__apple_types")
- self.assertTrue(apple_types_sub_section)
- print("__apple_types sub-section:", apple_types_sub_section)
-
- # These other three all important subsections should also be present.
- self.assertTrue(dwarf_section.FindSubSection("__apple_names") and
- dwarf_section.FindSubSection("__apple_namespac") and
- dwarf_section.FindSubSection("__apple_objc"))
diff --git a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c b/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c
deleted file mode 100644
index cb4bdb9c16b4..000000000000
--- a/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c
+++ /dev/null
@@ -1,27 +0,0 @@
-//===-- main.c --------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-int main (int argc, char const *argv[])
-{
- struct point_tag {
- int x;
- int y;
- }; // Set break point at this line.
-
- struct rect_tag {
- struct point_tag bottom_left;
- struct point_tag top_right;
- };
- struct point_tag pt = { 2, 3 }; // This is the first executable statement.
- struct rect_tag rect = {{1,2}, {3,4}};
- pt.x = argc;
- pt.y = argc * argc;
- rect.top_right.x = rect.top_right.x + argc;
- rect.top_right.y = rect.top_right.y + argc;
- return 0;
-}
diff --git a/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile
new file mode 100644
index 000000000000..5bb3a3ce3f10
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/Makefile
@@ -0,0 +1,22 @@
+LEVEL = ../../make
+
+C_SOURCES := main.c
+
+# Make an archive that has two object files with the same name, but
+# different timestamps. Do it all in one rule so that the timestamps
+# can be controlled without confusing Make.
+libfoo.a: a.c sub1/a.c
+ $(CC) $(CFLAGS) -c $(<D)/a.c -o a.o
+ mkdir -p sub1
+ $(CC) $(CFLAGS) -c $(<D)/sub1/a.c -o sub1/a.o
+ touch -t '198001010000.00' a.o
+ touch -t '198001010000.01' sub1/a.o
+ $(AR) $(ARFLAGS) $@ a.o sub1/a.o
+ rm a.o sub1/a.o
+
+include $(LEVEL)/Makefile.rules
+
+# Needs to come after include
+OBJECTS += libfoo.a
+$(EXE) : libfoo.a
+.DEFAULT_GOAL := $(EXE)
diff --git a/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/TestDuplicateMembers.py b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/TestDuplicateMembers.py
new file mode 100644
index 000000000000..1af2463fe7b8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/TestDuplicateMembers.py
@@ -0,0 +1,55 @@
+"""Test breaking inside functions defined within a BSD archive file libfoo.a."""
+
+from __future__ import print_function
+
+
+import os
+import time
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class BSDArchivesTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @expectedFailureAll(
+ oslist=["windows"],
+ bugnumber="llvm.org/pr24527. Makefile.rules doesn't know how to build static libs on Windows")
+ def test(self):
+ """Break inside a() and b() defined within libfoo.a."""
+ self.build()
+
+ exe = self.getBuildArtifact("a.out")
+ self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+ # Break on a() and b() symbols
+ lldbutil.run_break_set_by_symbol(
+ self, "a", sym_exact=True)
+ lldbutil.run_break_set_by_symbol(
+ self, "b", sym_exact=True)
+
+ self.runCmd("run", RUN_SUCCEEDED)
+
+ # The stop reason of the thread should be breakpoint.
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+ # Break at a(int) first.
+ self.expect("frame variable", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int) arg = 1'])
+ self.expect("frame variable __a_global", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int) __a_global = 1'])
+
+ # Continue the program, we should break at b(int) next.
+ self.runCmd("continue")
+ self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+ substrs=['stopped',
+ 'stop reason = breakpoint'])
+ self.expect("frame variable", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int) arg = 2'])
+ self.expect("frame variable __b_global", VARIABLES_DISPLAYED_CORRECTLY,
+ substrs=['(int) __b_global = 2'])
diff --git a/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/a.c b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/a.c
new file mode 100644
index 000000000000..402a6270c9c7
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/a.c
@@ -0,0 +1,14 @@
+//===-- a.c -----------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+int __a_global = 1;
+
+int a(int arg) {
+ int result = arg + __a_global;
+ return result;
+}
diff --git a/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/main.c b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/main.c
new file mode 100644
index 000000000000..c5b1cc2f0d1c
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/main.c
@@ -0,0 +1,17 @@
+//===-- main.c --------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include <stdio.h>
+
+extern int a(int);
+extern int b(int);
+int main (int argc, char const *argv[])
+{
+ printf ("a(1) returns %d\n", a(1));
+ printf ("b(2) returns %d\n", b(2));
+}
diff --git a/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c
new file mode 100644
index 000000000000..814d4e8b44e8
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/duplicate-archive-members/sub1/a.c
@@ -0,0 +1,14 @@
+//===-- a.c -----------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+static int __b_global = 2;
+
+int b(int arg) {
+ int result = arg + __b_global;
+ return result;
+}
diff --git a/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/Makefile b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/Makefile
new file mode 100644
index 000000000000..18a4934cca37
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/Makefile
@@ -0,0 +1,21 @@
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
+CC ?= clang
+
+ifeq "$(ARCH)" ""
+ ARCH = x86_64
+endif
+
+CFLAGS ?= -g -O0 -arch $(ARCH)
+
+all: TestApp.app/Contents/MacOS/TestApp
+
+TestApp.app/Contents/MacOS/TestApp: $(SRCDIR)/main.c
+ $(CC) $(CFLAGS) -o TestApp $<
+ rm -rf TestApp.app
+ cp -r $(SRCDIR)/TestApp.app .
+ mv TestApp TestApp.app/Contents/MacOS/TestApp
+ mv TestApp.dSYM TestApp.app.dSYM
+
+clean:
+ rm -rf TestApp.app/Contents/MacOS/TestApp TestApp.app.dSYM
diff --git a/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Info.plist b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Info.plist
new file mode 100644
index 000000000000..a47f72bb14da
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Info.plist
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>CFBundleDevelopmentRegion</key>
+ <string>en</string>
+ <key>CFBundleExecutable</key>
+ <string>TestApp</string>
+ <key>CFBundleIdentifier</key>
+ <string>com.lldb.TestApp</string>
+ <key>CFBundleInfoDictionaryVersion</key>
+ <string>6.0</string>
+ <key>CFBundleName</key>
+ <string>TestApp</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleShortVersionString</key>
+ <string>1.0</string>
+ <key>CFBundleSupportedPlatforms</key>
+ <array>
+ <string>MacOSX</string>
+ </array>
+ <key>CFBundleVersion</key>
+ <string>1</string>
+ <key>LSMinimumSystemVersion</key>
+ <string>10.8</string>
+ <key>NSHumanReadableCopyright</key>
+ <string>Copyright © 2018 Jim Ingham. All rights reserved.</string>
+</dict>
+</plist>
diff --git a/packages/Python/lldbsuite/test/functionalities/process_launch/my_working_dir/.keep b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/MacOS/.empty
index e69de29bb2d1..e69de29bb2d1 100644
--- a/packages/Python/lldbsuite/test/functionalities/process_launch/my_working_dir/.keep
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/MacOS/.empty
diff --git a/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/path with '09/.keep b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Resources/.empty
index e69de29bb2d1..e69de29bb2d1 100644
--- a/packages/Python/lldbsuite/test/functionalities/single-quote-in-filename-to-lldb/path with '09/.keep
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestApp.app/Contents/Resources/.empty
diff --git a/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py
new file mode 100644
index 000000000000..af6beeefd391
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/TestFindAppInBundle.py
@@ -0,0 +1,66 @@
+"""
+Make sure we can find the binary inside an app bundle.
+"""
+
+from __future__ import print_function
+
+
+import os
+import time
+import re
+import lldb
+from lldbsuite.test.decorators import *
+import lldbsuite.test.lldbutil as lldbutil
+import lldbsuite.test.lldbplatformutil as lldbplatformutil
+from lldbsuite.test.lldbtest import *
+
+@decorators.skipUnlessDarwin
+class FindAppInMacOSAppBundle(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_find_app_in_bundle(self):
+ """There can be many tests in a test case - describe this test here."""
+ self.build()
+ self.main_source_file = lldb.SBFileSpec("main.c")
+ self.find_app_in_bundle_test()
+
+ def setUp(self):
+ # Call super's setUp().
+ TestBase.setUp(self)
+
+ def find_app_in_bundle_test(self):
+ """This reads in the .app, makes sure we get the right binary and can run it."""
+
+ # This function starts a process, "a.out" by default, sets a source
+ # breakpoint, runs to it, and returns the thread, process & target.
+ # It optionally takes an SBLaunchOption argument if you want to pass
+ # arguments or environment variables.
+ exe = self.getBuildArtifact("TestApp.app")
+ error = lldb.SBError()
+ target = self.dbg.CreateTarget(exe, None, None, False, error)
+ self.assertTrue(error.Success(), "Could not create target: %s"%(error.GetCString()))
+ self.assertTrue(target.IsValid(), "Target: TestApp.app is not valid.")
+ exe_module_spec = target.GetExecutable()
+ self.assertTrue(exe_module_spec.GetFilename(), "TestApp")
+
+ bkpt = target.BreakpointCreateBySourceRegex("Set a breakpoint here", self.main_source_file)
+ self.assertTrue(bkpt.GetNumLocations() == 1, "Couldn't set a breakpoint in the main app")
+
+ if lldbplatformutil.getPlatform() == "macosx":
+ launch_info = lldb.SBLaunchInfo(None)
+ launch_info.SetWorkingDirectory(self.get_process_working_directory())
+
+ error = lldb.SBError()
+ process = target.Launch(launch_info, error)
+
+ self.assertTrue(process.IsValid(), "Could not create a valid process for TestApp: %s"%(error.GetCString()))
+
+ # Frame #0 should be at our breakpoint.
+ threads = lldbutil.get_threads_stopped_at_breakpoint(process, bkpt)
+
+ self.assertTrue(len(threads) == 1, "Expected 1 thread to stop at breakpoint, %d did."%(len(threads)))
+
+
diff --git a/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/main.c b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/main.c
new file mode 100644
index 000000000000..27a0cdc01a9a
--- /dev/null
+++ b/packages/Python/lldbsuite/test/macosx/find-app-in-bundle/main.c
@@ -0,0 +1,9 @@
+#include <stdio.h>
+
+int
+main()
+{
+ printf("Set a breakpoint here.\n");
+ return 0;
+}
+
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
index 7b321e3deae0..313c83e990d5 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/Makefile
@@ -1,3 +1,5 @@
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
CC ?= clang
ifeq "$(ARCH)" ""
@@ -7,7 +9,7 @@ endif
CFLAGS ?= -g -O0 -arch $(ARCH)
all: clean
- $(CC) $(CFLAGS) -dynamiclib -o com.apple.sbd bundle.c
+ $(CC) $(CFLAGS) -dynamiclib -o com.apple.sbd $(SRCDIR)/bundle.c
mkdir com.apple.sbd.xpc
mv com.apple.sbd com.apple.sbd.xpc/
mkdir -p com.apple.sbd.xpc.dSYM/Contents/Resources/DWARF
@@ -15,7 +17,7 @@ all: clean
rm -rf com.apple.sbd.dSYM
mkdir hide.app
tar cf - com.apple.sbd.xpc com.apple.sbd.xpc.dSYM | ( cd hide.app;tar xBpf -)
- $(CC) $(CFLAGS) -o find-bundle-with-dots-in-fn main.c
+ $(CC) $(CFLAGS) -o find-bundle-with-dots-in-fn $(SRCDIR)/main.c
clean:
rm -rf a.out a.out.dSYM hide.app com.apple.sbd com.apple.sbd.dSYM com.apple.sbd.xpc com.apple.sbd.xpc.dSYM find-bundle-with-dots-in-fn find-bundle-with-dots-in-fn.dSYM
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
index 104e88752ec2..9a046cf0b294 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/bundle-with-dot-in-filename/TestBundleWithDotInFilename.py
@@ -37,8 +37,9 @@ class BundleWithDotInFilenameTestCase(TestBase):
def test_attach_and_check_dsyms(self):
"""Test attach to binary, see if the bundle dSYM is found"""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
self.build()
+ os.chdir(self.getBuildDir());
popen = self.spawnSubprocess(exe)
self.addTearDownHook(self.cleanupSubprocesses)
@@ -66,6 +67,7 @@ class BundleWithDotInFilenameTestCase(TestBase):
dsym_name = mod.GetSymbolFileSpec().GetFilename()
self.assertTrue (dsym_name == 'com.apple.sbd', "Check that we found the dSYM for the bundle that was loaded")
i=i+1
+ os.chdir(self.getSourceDir());
if __name__ == '__main__':
unittest.main()
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
index 33b09502378c..d52d6f1f0d37 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/Makefile
@@ -1,3 +1,5 @@
+SRCDIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+
CC ?= clang
ifeq "$(ARCH)" ""
@@ -7,12 +9,12 @@ endif
CFLAGS ?= -g -O0 -arch $(ARCH)
all: clean
- $(CC) $(CFLAGS) -install_name $(PWD)/MyFramework.framework/Versions/A/MyFramework -dynamiclib -o MyFramework myframework.c
+ $(CC) $(CFLAGS) -install_name $(shell pwd)/MyFramework.framework/Versions/A/MyFramework -dynamiclib -o MyFramework $(SRCDIR)/myframework.c
mkdir -p MyFramework.framework/Versions/A/Headers
mkdir -p MyFramework.framework/Versions/A/Resources
cp MyFramework MyFramework.framework/Versions/A
- cp MyFramework.h MyFramework.framework/Versions/A/Headers
- cp Info.plist MyFramework.framework/Versions/A/Resources
+ cp $(SRCDIR)/MyFramework.h MyFramework.framework/Versions/A/Headers
+ cp $(SRCDIR)/Info.plist MyFramework.framework/Versions/A/Resources
( cd MyFramework.framework/Versions ; ln -s A Current )
( cd MyFramework.framework/ ; ln -s Versions/Current/Headers . )
( cd MyFramework.framework/ ; ln -s Versions/Current/MyFramework . )
@@ -21,8 +23,8 @@ all: clean
mkdir hide.app
rm -f MyFramework
tar cf - MyFramework.framework MyFramework.framework.dSYM | ( cd hide.app;tar xBpf -)
- $(CC) $(CFLAGS) -o deep-bundle main.c -F. -framework MyFramework
-
+ $(CC) $(CFLAGS) -o deep-bundle $(SRCDIR)/main.c -F. -framework MyFramework
+
clean:
rm -rf a.out a.out.dSYM deep-bundle deep-bundle.dSYM MyFramework.framework MyFramework.framework.dSYM MyFramework MyFramework.dSYM hide.app
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
index 493c4b99d094..d6123e39c3fe 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/TestDeepBundle.py
@@ -37,9 +37,9 @@ class DeepBundleTestCase(TestBase):
def test_attach_and_check_dsyms(self):
"""Test attach to binary, see if the framework dSYM is found"""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
self.build()
- popen = self.spawnSubprocess(exe)
+ popen = self.spawnSubprocess(exe, [self.getBuildDir()])
self.addTearDownHook(self.cleanupSubprocesses)
# Give the inferior time to start up, dlopen a bundle, remove the bundle it linked in
@@ -49,7 +49,6 @@ class DeepBundleTestCase(TestBase):
# binary & dSYM via target.exec-search-paths
settings_str = "settings set target.exec-search-paths " + self.get_process_working_directory() + "/hide.app"
self.runCmd(settings_str)
-
self.runCmd("process attach -p " + str(popen.pid))
target = self.dbg.GetSelectedTarget()
diff --git a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
index 19715216d6cf..b5ef5cff74a3 100644
--- a/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
+++ b/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
@@ -1,12 +1,17 @@
#include <MyFramework/MyFramework.h>
#include <unistd.h>
+#include <stdio.h>
#include <stdlib.h>
int setup_is_complete = 0;
-int main()
+int main(int argc, const char **argv)
{
- system ("/bin/rm -rf MyFramework MyFramework.framework MyFramework.framework.dSYM");
+ char command[8192];
+ sprintf (command,
+ "/bin/rm -rf %s/MyFramework %s/MyFramework.framework %s/MyFramework.framework.dSYM",
+ argv[1], argv[1], argv[1]);
+ system (command);
setup_is_complete = 1;
diff --git a/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile b/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
index 07aa39eac3be..69fd86e575e6 100644
--- a/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/indirect_symbol/Makefile
@@ -1,14 +1,6 @@
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
-
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+LEVEL = ../../make
-CFLAGS ?= -g -O0
-CWD := $(shell pwd)
+include $(LEVEL)/Makefile.rules
LIB_PREFIX := lib
@@ -28,21 +20,21 @@ all: a.out $(LIB_INDIRECT) $(LIB_REEXPORT)
a.out: main.o $(LIB_INDIRECT) $(LIB_REEXPORT)
$(CC) $(CFLAGS) -o a.out main.o -L. $(LIB_INDIRECT) $(LIB_REEXPORT)
-main.o: main.c
- $(CC) $(CFLAGS) -c main.c
+main.o: $(SRCDIR)/main.c
+ $(CC) $(CFLAGS) -c $(SRCDIR)/main.c
$(LIB_INDIRECT): indirect.o
$(CC) $(CFLAGS) $(LD_FLAGS) $(EXEC_PATH_INDIRECT) -o $(LIB_INDIRECT) indirect.o
if [ "$(OS)" = "Darwin" ]; then dsymutil $(LIB_INDIRECT); fi
-indirect.o: indirect.c
- $(CC) $(CFLAGS) -c indirect.c
+indirect.o: $(SRCDIR)/indirect.c
+ $(CC) $(CFLAGS) -c $(SRCDIR)/indirect.c
$(LIB_REEXPORT): reexport.o $(LIB_INDIRECT)
- $(CC) $(CFLAGS) $(LD_FLAGS) $(EXEC_PATH_REEXPORT) -o $(LIB_REEXPORT) reexport.o -L. -lindirect -Wl,-alias_list,$(CWD)/alias.list
+ $(CC) $(CFLAGS) $(LD_FLAGS) $(EXEC_PATH_REEXPORT) -o $(LIB_REEXPORT) reexport.o -L. -lindirect -Wl,-alias_list,$(SRCDIR)/alias.list
if [ "$(OS)" = "Darwin" ]; then dsymutil $(LIB_REEXPORT); fi
-reexport.o: reexport.c
- $(CC) $(CFLAGS) -c reexport.c
-clean:
+reexport.o: $(SRCDIR)/reexport.c
+ $(CC) $(CFLAGS) -c $(SRCDIR)/reexport.c
+clean::
rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
diff --git a/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py b/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
index afca8bcc0ded..a87a62893109 100644
--- a/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
+++ b/packages/Python/lldbsuite/test/macosx/indirect_symbol/TestIndirectSymbols.py
@@ -26,14 +26,14 @@ class TestIndirectFunctions(TestBase):
def test_with_python_api(self):
"""Test stepping and setting breakpoints in indirect and re-exported symbols."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
if self.platformIsDarwin():
- lib1 = os.path.join(os.getcwd(), 'libindirect.dylib')
- lib2 = os.path.join(os.getcwd(), 'libreexport.dylib')
+ lib1 = self.getBuildArtifact('libindirect.dylib')
+ lib2 = self.getBuildArtifact('libreexport.dylib')
self.registerSharedLibrariesWithTarget(target, [lib1, lib2])
self.main_source_spec = lldb.SBFileSpec(self.main_source)
diff --git a/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py b/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
index c2a27c570898..59b325f57984 100644
--- a/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
+++ b/packages/Python/lldbsuite/test/macosx/nslog/TestDarwinNSLogOutput.py
@@ -15,21 +15,20 @@ import re
import sys
from lldbsuite.test.decorators import *
-from lldbsuite.test import lldbtest
+from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbtest_config
-class DarwinNSLogOutputTestCase(lldbtest.TestBase):
+class DarwinNSLogOutputTestCase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
-
- mydir = lldbtest.TestBase.compute_mydir(__file__)
+ mydir = TestBase.compute_mydir(__file__)
@skipUnlessDarwin
@skipIfRemote # this test is currently written using lldb commands & assumes running on local system
def setUp(self):
# Call super's setUp().
- super(DarwinNSLogOutputTestCase, self).setUp()
+ TestBase.setUp(self)
self.child = None
self.child_prompt = '(lldb) '
self.strict_sources = False
@@ -38,11 +37,11 @@ class DarwinNSLogOutputTestCase(lldbtest.TestBase):
self.source = 'main.m'
# Output filename.
- self.exe_name = 'a.out'
+ self.exe_name = self.getBuildArtifact("a.out")
self.d = {'OBJC_SOURCES': self.source, 'EXE': self.exe_name}
# Locate breakpoint.
- self.line = lldbtest.line_number(self.source, '// break here')
+ self.line = line_number(self.source, '// break here')
def tearDown(self):
# Shut down the process if it's still running.
@@ -111,7 +110,7 @@ class DarwinNSLogOutputTestCase(lldbtest.TestBase):
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
self.run_lldb_to_breakpoint(exe, self.source, self.line,
settings_commands=settings_commands)
self.expect_prompt()
diff --git a/packages/Python/lldbsuite/test/macosx/order/Makefile b/packages/Python/lldbsuite/test/macosx/order/Makefile
index 52fae2d2ca34..ff5f1886ef56 100644
--- a/packages/Python/lldbsuite/test/macosx/order/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/order/Makefile
@@ -1,7 +1,7 @@
LEVEL = ../../make
C_SOURCES := main.c
-LDFLAGS = $(CFLAGS) -Xlinker -order_file -Xlinker ./order-file
+LDFLAGS = $(CFLAGS) -Xlinker -order_file -Xlinker $(SRCDIR)/order-file
MAKE_DSYM := NO
include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py b/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
index a70878f73e2c..e7a4b20cd6bc 100644
--- a/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
+++ b/packages/Python/lldbsuite/test/macosx/order/TestOrderFile.py
@@ -22,12 +22,12 @@ class OrderFileTestCase(TestBase):
def test(self):
"""Test debug symbols follow the correct order by the order file."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Test that the debug symbols have Function f3 before Function f1.
# Use "-s address" option to sort by address.
- self.runCmd("image dump symtab -s address a.out")
+ self.runCmd("image dump symtab -s address %s" % exe)
output = self.res.GetOutput()
mo_f3 = re.search("Code +.+f3", output)
mo_f1 = re.search("Code +.+f1", output)
diff --git a/packages/Python/lldbsuite/test/macosx/queues/Makefile b/packages/Python/lldbsuite/test/macosx/queues/Makefile
index 93f2f7b2f340..0d70f2595019 100644
--- a/packages/Python/lldbsuite/test/macosx/queues/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/queues/Makefile
@@ -1,28 +1,5 @@
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
+LEVEL = ../../make
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+C_SOURCES := main.c
-CFLAGS ?= -g -O0
-CWD := $(shell pwd)
-
-LIB_PREFIX := lib
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
-
-all: a.out
-
-a.out: main.o
- $(CC) $(CFLAGS) -o a.out main.o
-
-main.o: main.c
- $(CC) $(CFLAGS) -c main.c
-
-clean:
- rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py b/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
index 8eabe9a76637..ba58372ce5b7 100644
--- a/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
+++ b/packages/Python/lldbsuite/test/macosx/queues/TestQueues.py
@@ -105,7 +105,7 @@ class TestQueues(TestBase):
def queues(self):
"""Test queues inspection SB APIs without libBacktraceRecording."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -246,7 +246,7 @@ class TestQueues(TestBase):
def queues_with_libBacktraceRecording(self):
"""Test queues inspection SB APIs with libBacktraceRecording present."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
if not os.path.isfile(
'/Applications/Xcode.app/Contents/Developer/usr/lib/libBacktraceRecording.dylib'):
diff --git a/packages/Python/lldbsuite/test/macosx/safe-to-func-call/Makefile b/packages/Python/lldbsuite/test/macosx/safe-to-func-call/Makefile
index 93f2f7b2f340..0d70f2595019 100644
--- a/packages/Python/lldbsuite/test/macosx/safe-to-func-call/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/safe-to-func-call/Makefile
@@ -1,28 +1,5 @@
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
+LEVEL = ../../make
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+C_SOURCES := main.c
-CFLAGS ?= -g -O0
-CWD := $(shell pwd)
-
-LIB_PREFIX := lib
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
-
-all: a.out
-
-a.out: main.o
- $(CC) $(CFLAGS) -o a.out main.o
-
-main.o: main.c
- $(CC) $(CFLAGS) -c main.c
-
-clean:
- rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py b/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
index 096064896eaa..314084d0b158 100644
--- a/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
+++ b/packages/Python/lldbsuite/test/macosx/safe-to-func-call/TestSafeFuncCalls.py
@@ -26,7 +26,7 @@ class TestSafeFuncCalls(TestBase):
def test_with_python_api(self):
"""Test function call thread safety."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/macosx/thread-names/Makefile b/packages/Python/lldbsuite/test/macosx/thread-names/Makefile
index 93f2f7b2f340..0d70f2595019 100644
--- a/packages/Python/lldbsuite/test/macosx/thread-names/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/thread-names/Makefile
@@ -1,28 +1,5 @@
-CC ?= clang
-ifeq "$(ARCH)" ""
- ARCH = x86_64
-endif
+LEVEL = ../../make
-ifeq "$(OS)" ""
- OS = $(shell uname -s)
-endif
+C_SOURCES := main.c
-CFLAGS ?= -g -O0
-CWD := $(shell pwd)
-
-LIB_PREFIX := lib
-
-ifeq "$(OS)" "Darwin"
- CFLAGS += -arch $(ARCH)
-endif
-
-all: a.out
-
-a.out: main.o
- $(CC) $(CFLAGS) -o a.out main.o
-
-main.o: main.c
- $(CC) $(CFLAGS) -c main.c
-
-clean:
- rm -rf $(wildcard *.o *~ *.dylib *.so a.out *.dSYM)
+include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py b/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
index ae2916c92de9..925dc92951ce 100644
--- a/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
+++ b/packages/Python/lldbsuite/test/macosx/thread-names/TestInterruptThreadNames.py
@@ -23,7 +23,7 @@ class TestInterruptThreadNames(TestBase):
def test_with_python_api(self):
"""Test that we get thread names when interrupting a process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/macosx/universal/Makefile b/packages/Python/lldbsuite/test/macosx/universal/Makefile
index 854c78ed8c29..d74ed26f50ab 100644
--- a/packages/Python/lldbsuite/test/macosx/universal/Makefile
+++ b/packages/Python/lldbsuite/test/macosx/universal/Makefile
@@ -1,19 +1,21 @@
CC ?= clang
+all: testit
+
testit: testit.i386 testit.x86_64
- lipo -create -o testit testit.i386 testit.x86_64
+ lipo -create -o testit $^
testit.i386: testit.i386.o
- $(CC) -arch i386 -o testit.i386 testit.i386.o
+ $(CC) -arch i386 -o testit.i386 $<
testit.x86_64: testit.x86_64.o
- $(CC) -arch x86_64 -o testit.x86_64 testit.x86_64.o
+ $(CC) -arch x86_64 -o testit.x86_64 $<
testit.i386.o: main.c
- $(CC) -g -O0 -arch i386 -c -o testit.i386.o main.c
+ $(CC) -g -O0 -arch i386 -c -o testit.i386.o $<
testit.x86_64.o: main.c
- $(CC) -g -O0 -arch x86_64 -c -o testit.x86_64.o main.c
+ $(CC) -g -O0 -arch x86_64 -c -o testit.x86_64.o $<
clean:
rm -rf $(wildcard testit* *~)
diff --git a/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py b/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py
index 9a690e3ebb0b..ca4f3ce9b137 100644
--- a/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py
+++ b/packages/Python/lldbsuite/test/macosx/universal/TestUniversal.py
@@ -33,7 +33,7 @@ class UniversalTestCase(TestBase):
self.build()
# Note that "testit" is a universal binary.
- exe = os.path.join(os.getcwd(), "testit")
+ exe = self.getBuildArtifact("testit")
# Create a target by the debugger.
target = self.dbg.CreateTargetWithFileAndTargetTriple(
@@ -57,7 +57,7 @@ class UniversalTestCase(TestBase):
self.build()
# Note that "testit" is a universal binary.
- exe = os.path.join(os.getcwd(), "testit")
+ exe = self.getBuildArtifact("testit")
# By default, x86_64 is assumed if no architecture is specified.
self.expect("file " + exe, CURRENT_EXECUTABLE_SET,
@@ -130,7 +130,7 @@ class UniversalTestCase(TestBase):
self.build()
# Note that "testit" is a universal binary.
- exe = os.path.join(os.getcwd(), "testit")
+ exe = self.getBuildArtifact("testit")
# Create a target by the debugger.
target = self.dbg.CreateTargetWithFileAndTargetTriple(
diff --git a/packages/Python/lldbsuite/test/make/Android.rules b/packages/Python/lldbsuite/test/make/Android.rules
index f7b8e2459611..fab956e23641 100644
--- a/packages/Python/lldbsuite/test/make/Android.rules
+++ b/packages/Python/lldbsuite/test/make/Android.rules
@@ -75,8 +75,15 @@ ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
-D__ANDROID_API__=$(API_LEVEL)
ARCH_LDFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
-ifeq (1,$(USE_LIBCPP))
+ifeq (1,$(USE_LIBSTDCPP))
ARCH_CFLAGS += \
+ -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
+ -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
+ -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
+
+ ARCH_LDFLAGS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a
+else
+ ARCH_CXXFLAGS += \
-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
-isystem $(NDK_ROOT)/sources/android/support/include \
-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
@@ -84,11 +91,4 @@ ifeq (1,$(USE_LIBCPP))
ARCH_LDFLAGS += \
-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++.a
-else
- ARCH_CFLAGS += \
- -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
- -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
- -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
-
- ARCH_LDFLAGS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a
endif
diff --git a/packages/Python/lldbsuite/test/make/Makefile.rules b/packages/Python/lldbsuite/test/make/Makefile.rules
index 4870cd95f80a..32f41b24d5dc 100644
--- a/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -6,6 +6,7 @@
# OBJC_SOURCES :=
# OBJCXX_SOURCES :=
# DYLIB_C_SOURCES :=
+# DYLIB_OBJC_SOURCES :=
# DYLIB_CXX_SOURCES :=
#
# Specifying DYLIB_ONLY has the effect of building dylib only, skipping
@@ -27,20 +28,21 @@
# Uncomment line below for debugging shell commands
# SHELL = /bin/sh -x
-THIS_FILE_DIR := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))/
+SRCDIR := $(shell dirname $(firstword $(MAKEFILE_LIST)))/
+THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/
LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
#----------------------------------------------------------------------
# If OS is not defined, use 'uname -s' to determine the OS name.
#
-# uname on Windows gives "windows32", but most environments standardize
-# on "Windows_NT", so we'll make it consistent here. When running
-# tests from Visual Studio, the environment variable isn't inherited
-# all the way down to the process spawned for make.
+# uname on Windows gives "windows32" or "server version windows32", but most
+# environments standardize on "Windows_NT", so we'll make it consistent here.
+# When running tests from Visual Studio, the environment variable isn't
+# inherited all the way down to the process spawned for make.
#----------------------------------------------------------------------
HOST_OS = $(shell uname -s)
-ifeq "$(HOST_OS)" "windows32"
+ifneq (,$(findstring windows32,$(HOST_OS)))
HOST_OS = Windows_NT
endif
ifeq "$(OS)" ""
@@ -145,7 +147,7 @@ ARCHFLAG ?= -arch
# Change any build/tool options needed
#----------------------------------------------------------------------
ifeq "$(OS)" "Darwin"
- DS := $(shell xcrun -find -toolchain default dsymutil)
+ DS := $(DSYMUTIL)
DSFLAGS =
DSYM = $(EXE).dSYM
AR := $(CROSS_COMPILE)libtool
@@ -223,7 +225,7 @@ else
CFLAGS += $(ARCHFLAG)$(ARCH) $(FRAMEWORK_INCLUDES) -I$(LLDB_BASE_DIR)include
endif
-CFLAGS += -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR)
+CFLAGS += -I$(SRCDIR) -include $(THIS_FILE_DIR)test_common.h -I$(THIS_FILE_DIR)
CFLAGS += $(NO_LIMIT_DEBUG_INFO_FLAGS) $(ARCH_CFLAGS) $(CFLAGS_EXTRAS)
# Use this one if you want to build one part of the result without debug information:
@@ -237,13 +239,15 @@ ifeq "$(MAKE_DWO)" "YES"
CFLAGS += -gsplit-dwarf
endif
+CLANG_MODULE_CACHE_DIR := module-cache
+
+MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules -fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
+
ifeq "$(MAKE_GMODULES)" "YES"
- CFLAGS += -fmodules -gmodules
+ CFLAGS += $(MANDATORY_MODULE_BUILD_CFLAGS)
endif
-CXXFLAGS += -std=c++11
-# FIXME: C++ modules aren't supported on all platforms.
-CXXFLAGS += $(subst -fmodules,, $(CFLAGS))
+CXXFLAGS += -std=c++11 $(CFLAGS) $(ARCH_CXXFLAGS)
LD = $(CC)
LDFLAGS ?= $(CFLAGS)
LDFLAGS += $(LD_EXTRAS) $(ARCH_LDFLAGS)
@@ -492,23 +496,6 @@ endif
#----------------------------------------------------------------------
#----------------------------------------------------------------------
-# Make the dSYM file from the executable if $(MAKE_DSYM) != "NO"
-#----------------------------------------------------------------------
-ifneq "$(DYLIB_ONLY)" "YES"
-$(DSYM) : $(EXE)
-ifeq "$(OS)" "Darwin"
-ifneq "$(MAKE_DSYM)" "NO"
- "$(DS)" $(DSFLAGS) -o "$(DSYM)" "$(EXE)"
-endif
-else
-ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
- $(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)"
- $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)"
-endif
-endif
-endif
-
-#----------------------------------------------------------------------
# Compile the executable from all the objects.
#----------------------------------------------------------------------
ifneq "$(DYLIB_NAME)" ""
@@ -524,6 +511,22 @@ $(EXE) : $(OBJECTS) $(ARCHIVE_NAME)
endif
#----------------------------------------------------------------------
+# Make the dSYM file from the executable if $(MAKE_DSYM) != "NO"
+#----------------------------------------------------------------------
+$(DSYM) : $(EXE)
+ifeq "$(OS)" "Darwin"
+ifneq "$(MAKE_DSYM)" "NO"
+ "$(DS)" $(DSFLAGS) -o "$(DSYM)" "$(EXE)"
+else
+endif
+else
+ifeq "$(SPLIT_DEBUG_SYMBOLS)" "YES"
+ $(OBJCOPY) --only-keep-debug "$(EXE)" "$(DSYM)"
+ $(OBJCOPY) --strip-debug --add-gnu-debuglink="$(DSYM)" "$(EXE)" "$(EXE)"
+endif
+endif
+
+#----------------------------------------------------------------------
# Make the archive
#----------------------------------------------------------------------
ifneq "$(ARCHIVE_NAME)" ""
@@ -541,6 +544,11 @@ endif
#----------------------------------------------------------------------
$(DYLIB_OBJECTS) : CFLAGS += -DCOMPILING_LLDB_TEST_DLL
+ifneq "$(OS)" "Windows_NT"
+$(DYLIB_OBJECTS) : CFLAGS += -fPIC
+$(DYLIB_OBJECTS) : CXXFLAGS += -fPIC
+endif
+
$(DYLIB_FILENAME) : $(DYLIB_OBJECTS)
ifeq "$(OS)" "Darwin"
$(LD) $(DYLIB_OBJECTS) $(LDFLAGS) -install_name "$(DYLIB_EXECUTABLE_PATH)/$(DYLIB_FILENAME)" -dynamiclib -o "$(DYLIB_FILENAME)"
@@ -563,7 +571,7 @@ endif
#ifneq "$(PCH_OUTPUT)" ""
$(PCH_OUTPUT) : $(PCH_CXX_SOURCE)
- $(CXX) $(CXXFLAGS) -x c++-header -o $(PCH_OUTPUT) $(PCH_CXX_SOURCE)
+ $(CXX) $(CXXFLAGS) -x c++-header -o $@ $<
%.o : %.cpp $(PCH_OUTPUT)
$(CXX) $(PCHFLAGS) $(CXXFLAGS) -c -o $@ $<
#endif
@@ -636,7 +644,7 @@ endif
dsym: $(DSYM)
all: $(EXE) $(DSYM)
clean::
- $(RM) $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS)
+ $(RM) -rf $(OBJECTS) $(PREREQS) $(PREREQS:.d=.d.tmp) $(DWOS) $(ARCHIVE_NAME) $(ARCHIVE_OBJECTS) $(CLANG_MODULE_CACHE_DIR)
ifneq "$(DYLIB_NAME)" ""
$(RM) -r $(DYLIB_FILENAME).dSYM
$(RM) $(DYLIB_OBJECTS) $(DYLIB_PREREQS) $(DYLIB_PREREQS:.d=.d.tmp) $(DYLIB_DWOS) $(DYLIB_FILENAME) $(DYLIB_FILENAME).debug
@@ -660,7 +668,7 @@ endif
#----------------------------------------------------------------------
# From http://blog.melski.net/tag/debugging-makefiles/
-#
+#
# Usage: make print-CC print-CXX print-LD
#----------------------------------------------------------------------
print-%:
diff --git a/packages/Python/lldbsuite/test/plugins/builder_base.py b/packages/Python/lldbsuite/test/plugins/builder_base.py
index bd6656bd5e87..be891da2d086 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_base.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -50,13 +50,32 @@ def getArchFlag():
return ("ARCHFLAG=" + archflag) if archflag else ""
-
-def getMake():
- """Returns the name for GNU make"""
+def getMake(test_subdir, test_name):
+ """Returns the invocation for GNU make.
+ The first argument is a tuple of the relative path to the testcase
+ and its filename stem."""
if platform.system() == "FreeBSD" or platform.system() == "NetBSD":
- return "gmake"
+ make = "gmake"
else:
- return "make"
+ make = "make"
+
+ # Construct the base make invocation.
+ lldb_test = os.environ["LLDB_TEST"]
+ lldb_build = os.environ["LLDB_BUILD"]
+ if not (lldb_test and lldb_build and test_subdir and test_name and
+ (not os.path.isabs(test_subdir))):
+ raise Exception("Could not derive test directories")
+ build_dir = os.path.join(lldb_build, test_subdir, test_name)
+ src_dir = os.path.join(lldb_test, test_subdir)
+ # This is a bit of a hack to make inline testcases work.
+ makefile = os.path.join(src_dir, "Makefile")
+ if not os.path.isfile(makefile):
+ makefile = os.path.join(build_dir, "Makefile")
+ return [make,
+ "VPATH="+src_dir,
+ "-C", build_dir,
+ "-I", src_dir,
+ "-f", makefile]
def getArchSpec(architecture):
@@ -121,12 +140,11 @@ def buildDefault(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None,
+ testname=None):
"""Build the binaries the default way."""
commands = []
- if clean:
- commands.append([getMake(), "clean", getCmdLine(dictionary)])
- commands.append([getMake(), getArchSpec(architecture),
+ commands.append(getMake(testdir, testname) + ["all", getArchSpec(architecture),
getCCSpec(compiler), getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
@@ -140,13 +158,13 @@ def buildDwarf(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None,
+ testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append([getMake(), "clean", getCmdLine(dictionary)])
- commands.append([getMake(), "MAKE_DSYM=NO", getArchSpec(
- architecture), getCCSpec(compiler), getCmdLine(dictionary)])
+ commands.append(getMake(testdir, testname) +
+ ["MAKE_DSYM=NO", getArchSpec(architecture),
+ getCCSpec(compiler), getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
# True signifies that we can handle building dwarf.
@@ -158,13 +176,15 @@ def buildDwo(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None,
+ testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append([getMake(), "clean", getCmdLine(dictionary)])
- commands.append([getMake(), "MAKE_DSYM=NO", "MAKE_DWO=YES", getArchSpec(
- architecture), getCCSpec(compiler), getCmdLine(dictionary)])
+ commands.append(getMake(testdir, testname) +
+ ["MAKE_DSYM=NO", "MAKE_DWO=YES",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
# True signifies that we can handle building dwo.
@@ -176,13 +196,12 @@ def buildGModules(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None,
+ testname=None):
"""Build the binaries with dwarf debug info."""
commands = []
- if clean:
- commands.append([getMake(), "clean", getCmdLine(dictionary)])
- commands.append([getMake(),
- "MAKE_DSYM=NO",
+ commands.append(getMake(testdir, testname) +
+ ["MAKE_DSYM=NO",
"MAKE_GMODULES=YES",
getArchSpec(architecture),
getCCSpec(compiler),
@@ -195,12 +214,4 @@ def buildGModules(
def cleanup(sender=None, dictionary=None):
"""Perform a platform-specific cleanup after the test."""
- #import traceback
- # traceback.print_stack()
- commands = []
- if os.path.isfile("Makefile"):
- commands.append([getMake(), "clean", getCmdLine(dictionary)])
-
- runBuildCommands(commands, sender=sender)
- # True signifies that we can handle cleanup.
return True
diff --git a/packages/Python/lldbsuite/test/plugins/builder_darwin.py b/packages/Python/lldbsuite/test/plugins/builder_darwin.py
index 06a2a86d47a4..1cee39bbb4cb 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_darwin.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_darwin.py
@@ -5,20 +5,20 @@ import lldbsuite.test.lldbtest as lldbtest
from builder_base import *
-
def buildDsym(
sender=None,
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None,
+ testname=None):
"""Build the binaries with dsym debug info."""
commands = []
-
- if clean:
- commands.append(["make", "clean", getCmdLine(dictionary)])
- commands.append(["make", "MAKE_DSYM=YES", getArchSpec(
- architecture), getCCSpec(compiler), getCmdLine(dictionary)])
+ commands.append(getMake(testdir, testname) +
+ ["MAKE_DSYM=YES",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ "all", getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
diff --git a/packages/Python/lldbsuite/test/plugins/builder_freebsd.py b/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
index d9e654dc32f2..c3df36b5a36d 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_freebsd.py
@@ -6,5 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None):
return False
diff --git a/packages/Python/lldbsuite/test/plugins/builder_linux.py b/packages/Python/lldbsuite/test/plugins/builder_linux.py
index d9e654dc32f2..c3df36b5a36d 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_linux.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_linux.py
@@ -6,5 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None):
return False
diff --git a/packages/Python/lldbsuite/test/plugins/builder_netbsd.py b/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
index d9e654dc32f2..c3df36b5a36d 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_netbsd.py
@@ -6,5 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None):
return False
diff --git a/packages/Python/lldbsuite/test/plugins/builder_openbsd.py b/packages/Python/lldbsuite/test/plugins/builder_openbsd.py
new file mode 100644
index 000000000000..c3df36b5a36d
--- /dev/null
+++ b/packages/Python/lldbsuite/test/plugins/builder_openbsd.py
@@ -0,0 +1,10 @@
+from builder_base import *
+
+
+def buildDsym(
+ sender=None,
+ architecture=None,
+ compiler=None,
+ dictionary=None,
+ testdir=None):
+ return False
diff --git a/packages/Python/lldbsuite/test/plugins/builder_win32.py b/packages/Python/lldbsuite/test/plugins/builder_win32.py
index d9e654dc32f2..c3df36b5a36d 100644
--- a/packages/Python/lldbsuite/test/plugins/builder_win32.py
+++ b/packages/Python/lldbsuite/test/plugins/builder_win32.py
@@ -6,5 +6,5 @@ def buildDsym(
architecture=None,
compiler=None,
dictionary=None,
- clean=True):
+ testdir=None):
return False
diff --git a/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py b/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
index 4bd4781c7ef5..5e21471e7c15 100644
--- a/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/breakpoint/TestBreakpointAPI.py
@@ -23,7 +23,7 @@ class BreakpointAPITestCase(TestBase):
def test_breakpoint_is_valid(self):
"""Make sure that if an SBBreakpoint gets deleted its IsValid returns false."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -57,7 +57,7 @@ class BreakpointAPITestCase(TestBase):
Breakpoint's IsValid returns false."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py b/packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py
index a9e896f2579f..074bbc76fd19 100644
--- a/packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py
+++ b/packages/Python/lldbsuite/test/python_api/class_members/TestSBTypeClassMembers.py
@@ -34,7 +34,7 @@ class SBTypeMemberFunctionsTest(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py b/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
index 97261c70ec96..deb0c7a9fcbb 100644
--- a/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
+++ b/packages/Python/lldbsuite/test/python_api/disassemble-raw-data/TestDisassembleRawData.py
@@ -31,6 +31,9 @@ class DisassembleRawDataTestCase(TestBase):
elif re.match("mips", arch):
target = self.dbg.CreateTargetWithFileAndTargetTriple("", "mips")
raw_bytes = bytearray([0x03, 0xa0, 0xf0, 0x21])
+ elif re.match("powerpc64le", arch):
+ target = self.dbg.CreateTargetWithFileAndTargetTriple("", "powerpc64le")
+ raw_bytes = bytearray([0x00, 0x00, 0x80, 0x38])
else:
target = self.dbg.CreateTargetWithFileAndTargetTriple("", "x86_64")
raw_bytes = bytearray([0x48, 0x89, 0xe5])
@@ -48,6 +51,9 @@ class DisassembleRawDataTestCase(TestBase):
self.assertTrue(inst.GetMnemonic(target) == "move")
self.assertTrue(inst.GetOperands(target) ==
'$' + "fp, " + '$' + "sp")
+ elif re.match("powerpc64le", arch):
+ self.assertTrue(inst.GetMnemonic(target) == "li")
+ self.assertTrue(inst.GetOperands(target) == "4, 0")
else:
self.assertTrue(inst.GetMnemonic(target) == "movq")
self.assertTrue(inst.GetOperands(target) ==
diff --git a/packages/Python/lldbsuite/test/python_api/event/TestEvents.py b/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
index e9ea0bd00879..8a9e456f3458 100644
--- a/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
+++ b/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
@@ -15,6 +15,7 @@ from lldbsuite.test import lldbutil
@skipIfLinux # llvm.org/pr25924, sometimes generating SIGSEGV
+@skipIfDarwin
class EventAPITestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
@@ -33,7 +34,7 @@ class EventAPITestCase(TestBase):
def test_listen_for_and_print_event(self):
"""Exercise SBEvent API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.dbg.SetAsync(True)
@@ -122,7 +123,7 @@ class EventAPITestCase(TestBase):
def test_wait_for_event(self):
"""Exercise SBListener.WaitForEvent() API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.dbg.SetAsync(True)
@@ -201,7 +202,7 @@ class EventAPITestCase(TestBase):
def test_add_listener_to_broadcaster(self):
"""Exercise some SBBroadcaster APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.dbg.SetAsync(True)
diff --git a/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py b/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
index 0a0ac2d05770..c066dc58003d 100644
--- a/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
+++ b/packages/Python/lldbsuite/test/python_api/findvalue_duplist/TestSBFrameFindValue.py
@@ -22,8 +22,7 @@ class SBFrameFindValueTestCase(TestBase):
self.build()
self.setTearDownCleanup()
- exe_name = "a.out"
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact("a.out")
# Create the target
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py b/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
index 667bd58adcee..8548506fdc46 100644
--- a/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/formatters/TestFormattersSBAPI.py
@@ -28,10 +28,12 @@ class SBFormattersAPITestCase(TestBase):
self.setTearDownCleanup()
"""Test Python APIs for working with formatters"""
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"),
+ CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
- self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
+ self, "main.cpp", self.line, num_expected_locations=1,
+ loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
@@ -439,7 +441,8 @@ class SBFormattersAPITestCase(TestBase):
self.build(dictionary={'EXE': 'no_synth'})
self.setTearDownCleanup()
- self.runCmd("file no_synth", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("no_synth"),
+ CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py b/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
index a2d2cf12cdca..85e915ad3a48 100644
--- a/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
+++ b/packages/Python/lldbsuite/test/python_api/frame/TestFrames.py
@@ -24,7 +24,7 @@ class FrameAPITestCase(TestBase):
def test_get_arg_vals_for_call_stack(self):
"""Exercise SBFrame.GetVariables() API to get argument vals."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -127,7 +127,7 @@ class FrameAPITestCase(TestBase):
def test_frame_api_boundary_condition(self):
"""Exercise SBFrame APIs with boundary condition inputs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -169,7 +169,7 @@ class FrameAPITestCase(TestBase):
def test_frame_api_IsEqual(self):
"""Exercise SBFrame API IsEqual."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py b/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
index 86585d8d02e2..1bd54c39fa0b 100644
--- a/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
+++ b/packages/Python/lldbsuite/test/python_api/frame/get-variables/TestGetVariables.py
@@ -51,7 +51,7 @@ class TestGetVariables(TestBase):
self.dbg.SetAsync(False)
# Create a target by the debugger.
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py b/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
index caa2696be7cd..8b8f81ff4c4b 100644
--- a/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
+++ b/packages/Python/lldbsuite/test/python_api/frame/inlines/TestInlinedFrame.py
@@ -32,7 +32,7 @@ class InlinedFrameAPITestCase(TestBase):
def test_stop_at_outer_inline(self):
"""Exercise SBFrame.IsInlined() and SBFrame.GetFunctionName()."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py b/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
index 4511da94437b..f657d19764ba 100644
--- a/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/function_symbol/TestDisasmAPI.py
@@ -28,10 +28,11 @@ class DisasmAPITestCase(TestBase):
'main.c', '// Find the line number for breakpoint 2 here.')
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr21765')
def test(self):
"""Exercise getting SBAddress objects, disassembly, and SBAddress APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py b/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
index 9919375abb59..6644b81ef2a9 100644
--- a/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/function_symbol/TestSymbolAPI.py
@@ -28,10 +28,11 @@ class SymbolAPITestCase(TestBase):
'main.c', '// Find the line number for breakpoint 2 here.')
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr21765')
def test(self):
"""Exercise some SBSymbol and SBAddress APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py b/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
index fb4e54aa0bc5..b0f09d2fa7b5 100644
--- a/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
+++ b/packages/Python/lldbsuite/test/python_api/hello_world/TestHelloWorld.py
@@ -14,15 +14,12 @@ from lldbsuite.test import lldbutil
class HelloWorldTestCase(TestBase):
-
+ NO_DEBUG_INFO_TESTCASE = True
mydir = TestBase.compute_mydir(__file__)
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
- # Get the full path to our executable to be attached/debugged.
- self.exe = os.path.join(os.getcwd(), self.testMethodName)
- self.d = {'EXE': self.testMethodName}
# Find a couple of the line numbers within main.c.
self.line1 = line_number('main.c', '// Set break point at this line.')
self.line2 = line_number('main.c', '// Waiting to be attached...')
@@ -37,9 +34,12 @@ class HelloWorldTestCase(TestBase):
@skipIfiOSSimulator
def test_with_process_launch_api(self):
"""Create target, breakpoint, launch a process, and then kill it."""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- target = self.dbg.CreateTarget(self.exe)
+ # Get the full path to our executable to be attached/debugged.
+ exe = self.getBuildArtifact(self.testMethodName)
+ d = {'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ target = self.dbg.CreateTarget(exe)
breakpoint = target.BreakpointCreateByLocation("main.c", self.line1)
@@ -82,12 +82,14 @@ class HelloWorldTestCase(TestBase):
@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_id_api(self):
"""Create target, spawn a process, and attach to it with process id."""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- target = self.dbg.CreateTarget(self.exe)
+ exe = self.getBuildArtifact(self.testMethodName)
+ d = {'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ target = self.dbg.CreateTarget(exe)
# Spawn a new process
- popen = self.spawnSubprocess(self.exe, ["abc", "xyz"])
+ popen = self.spawnSubprocess(exe, ["abc", "xyz"])
self.addTearDownHook(self.cleanupSubprocesses)
# Give the subprocess time to start and wait for user input
@@ -112,12 +114,14 @@ class HelloWorldTestCase(TestBase):
@expectedFailureAll(oslist=['ios', 'watchos', 'tvos', 'bridgeos'], bugnumber="<rdar://problem/34538611>") # old lldb-server has race condition, launching an inferior and then launching debugserver in quick succession sometimes fails
def test_with_attach_to_process_with_name_api(self):
"""Create target, spawn a process, and attach to it with process name."""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- target = self.dbg.CreateTarget(self.exe)
+ exe = self.getBuildArtifact(self.testMethodName)
+ d = {'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ target = self.dbg.CreateTarget(exe)
# Spawn a new process
- popen = self.spawnSubprocess(self.exe, ["abc", "xyz"])
+ popen = self.spawnSubprocess(exe, ["abc", "xyz"])
self.addTearDownHook(self.cleanupSubprocesses)
# Give the subprocess time to start and wait for user input
@@ -127,7 +131,7 @@ class HelloWorldTestCase(TestBase):
error = lldb.SBError()
# Pass 'False' since we don't want to wait for new instance of
# "hello_world" to be launched.
- name = os.path.basename(self.exe)
+ name = os.path.basename(exe)
# While we're at it, make sure that passing a None as the process name
# does not hang LLDB.
diff --git a/packages/Python/lldbsuite/test/python_api/hello_world/main.c b/packages/Python/lldbsuite/test/python_api/hello_world/main.c
index 001e9c01e6e5..32b0446517c5 100644
--- a/packages/Python/lldbsuite/test/python_api/hello_world/main.c
+++ b/packages/Python/lldbsuite/test/python_api/hello_world/main.c
@@ -1,5 +1,11 @@
#include <stdio.h>
+#ifdef _MSC_VER
+#include <windows.h>
+#define sleep(x) Sleep((x) * 1000)
+#else
#include <unistd.h>
+#endif
+
int main(int argc, char const *argv[])
{
lldb_enable_attach();
diff --git a/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py b/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
index 7f5781f5cd8e..2f31b0aebaa2 100644
--- a/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/interpreter/TestCommandInterpreterAPI.py
@@ -24,7 +24,7 @@ class CommandInterpreterAPICase(TestBase):
def test_with_process_launch_api(self):
"""Test the SBCommandInterpreter APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py b/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
index bcbaa68ed928..4db6322e7513 100644
--- a/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
+++ b/packages/Python/lldbsuite/test/python_api/lldbutil/frame/TestFrameUtils.py
@@ -27,7 +27,7 @@ class FrameUtilsTestCase(TestBase):
def test_frame_utils(self):
"""Test utility functions for the frame object."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
index ae7ec3dfc3cc..6816b0d1ee95 100644
--- a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
+++ b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestLLDBIterator.py
@@ -30,7 +30,7 @@ class LLDBIteratorTestCase(TestBase):
def test_lldb_iter_module(self):
"""Test module_iter works correctly for SBTarget -> SBModule."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -66,7 +66,7 @@ class LLDBIteratorTestCase(TestBase):
def test_lldb_iter_breakpoint(self):
"""Test breakpoint_iter works correctly for SBTarget -> SBBreakpoint."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -98,7 +98,7 @@ class LLDBIteratorTestCase(TestBase):
def test_lldb_iter_frame(self):
"""Test iterator works correctly for SBProcess->SBThread->SBFrame."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
index a19cc5c375f5..bd46749d6e64 100644
--- a/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
+++ b/packages/Python/lldbsuite/test/python_api/lldbutil/iter/TestRegistersIterator.py
@@ -30,7 +30,7 @@ class RegistersIteratorTestCase(TestBase):
def test_iter_registers(self):
"""Test iterator works correctly for lldbutil.iter_registers()."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py b/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
index b447bb797a0f..dcdade25d46f 100644
--- a/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
+++ b/packages/Python/lldbsuite/test/python_api/lldbutil/process/TestPrintStackTraces.py
@@ -37,7 +37,7 @@ class ThreadsStackTracesTestCase(TestBase):
def test_stack_traces(self):
"""Test SBprocess and SBThread APIs with printing of the stack traces."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py b/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
index 79b988465d7e..65b159974c08 100644
--- a/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
+++ b/packages/Python/lldbsuite/test/python_api/module_section/TestModuleAndSection.py
@@ -26,7 +26,7 @@ class ModuleAndSectionAPIsTestCase(TestBase):
def test_module_and_section(self):
"""Test module and section APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -77,7 +77,7 @@ class ModuleAndSectionAPIsTestCase(TestBase):
def test_module_and_section_boundary_condition(self):
"""Test module and section APIs by passing None when it expects a Python string."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -118,7 +118,7 @@ class ModuleAndSectionAPIsTestCase(TestBase):
def test_module_compile_unit_iter(self):
"""Test module's compile unit iterator APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -141,3 +141,29 @@ class ModuleAndSectionAPIsTestCase(TestBase):
INDENT2 = INDENT * 2
for cu in exe_module.compile_unit_iter():
print(cu)
+
+ @add_test_categories(['pyapi'])
+ def test_find_compile_units(self):
+ """Exercise SBModule.FindCompileUnits() API."""
+ d = {'EXE': 'b.out'}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ self.find_compile_units(self.getBuildArtifact('b.out'))
+
+ def find_compile_units(self, exe):
+ """Exercise SBModule.FindCompileUnits() API."""
+ source_name_list = ["main.cpp", "b.cpp", "c.cpp"]
+
+ # Create a target by the debugger.
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ num_modules = target.GetNumModules()
+ for i in range(num_modules):
+ module = target.GetModuleAtIndex(i)
+ for source_name in source_name_list:
+ list = module.FindCompileUnits(lldb.SBFileSpec(source_name, False))
+ for sc in list:
+ self.assertTrue(
+ sc.GetCompileUnit().GetFileSpec().GetFilename() ==
+ source_name)
diff --git a/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py b/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
index b7a683f25f62..6511ff865bd9 100644
--- a/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
+++ b/packages/Python/lldbsuite/test/python_api/name_lookup/TestNameLookup.py
@@ -20,6 +20,7 @@ class TestNameLookup(TestBase):
mydir = TestBase.compute_mydir(__file__)
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr21765')
def test_target(self):
"""Exercise SBTarget.FindFunctions() with various name masks.
@@ -28,7 +29,7 @@ class TestNameLookup(TestBase):
and that using a function basename with eFunctionNameTypeFull works for all
C++ functions that are at the global namespace level."""
self.build();
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py b/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
index 89dfebde1af7..fd3bfa858e12 100644
--- a/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
+++ b/packages/Python/lldbsuite/test/python_api/objc_type/TestObjCType.py
@@ -28,7 +28,7 @@ class ObjCSBTypeTestCase(TestBase):
def test(self):
"""Test SBType for ObjC classes."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py b/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
index 065c70744890..fc17e4a76c54 100644
--- a/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/process/TestProcessAPI.py
@@ -29,7 +29,7 @@ class ProcessAPITestCase(TestBase):
def test_read_memory(self):
"""Test Python SBProcess.ReadMemory() API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -127,7 +127,7 @@ class ProcessAPITestCase(TestBase):
def test_write_memory(self):
"""Test Python SBProcess.WriteMemory() API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -186,7 +186,7 @@ class ProcessAPITestCase(TestBase):
def test_access_my_int(self):
"""Test access 'my_int' using Python SBProcess.GetByteOrder() and other APIs."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -284,7 +284,7 @@ class ProcessAPITestCase(TestBase):
def test_remote_launch(self):
"""Test SBProcess.RemoteLaunch() API with a process not in eStateConnected, and it should fail."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -308,7 +308,7 @@ class ProcessAPITestCase(TestBase):
def test_get_num_supported_hardware_watchpoints(self):
"""Test SBProcess.GetNumSupportedHardwareWatchpoints() API with a process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
@@ -331,7 +331,7 @@ class ProcessAPITestCase(TestBase):
def test_get_process_info(self):
"""Test SBProcess::GetProcessInfo() API with a locally launched process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py b/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
index 71f77b368809..e25083d6efb2 100644
--- a/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
+++ b/packages/Python/lldbsuite/test/python_api/process/io/TestProcessIO.py
@@ -19,11 +19,13 @@ class ProcessIOTestCase(TestBase):
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
+
+ def setup_test(self):
# Get the full path to our executable to be debugged.
- self.exe = os.path.join(os.getcwd(), "process_io")
- self.local_input_file = os.path.join(os.getcwd(), "input.txt")
- self.local_output_file = os.path.join(os.getcwd(), "output.txt")
- self.local_error_file = os.path.join(os.getcwd(), "error.txt")
+ self.exe = self.getBuildArtifact("process_io")
+ self.local_input_file = self.getBuildArtifact("input.txt")
+ self.local_output_file = self.getBuildArtifact("output.txt")
+ self.local_error_file = self.getBuildArtifact("error.txt")
self.input_file = os.path.join(
self.get_process_working_directory(), "input.txt")
@@ -38,6 +40,7 @@ class ProcessIOTestCase(TestBase):
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
def test_stdin_by_api(self):
"""Exercise SBProcess.PutSTDIN()."""
+ self.setup_test()
self.build()
self.create_target()
self.run_process(True)
@@ -49,6 +52,7 @@ class ProcessIOTestCase(TestBase):
@expectedFlakeyLinux(bugnumber="llvm.org/pr26437")
def test_stdin_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDIN without specifying STDOUT or STDERR."""
+ self.setup_test()
self.build()
self.create_target()
self.redirect_stdin()
@@ -62,6 +66,7 @@ class ProcessIOTestCase(TestBase):
@skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT without specifying STDIN or STDERR."""
+ self.setup_test()
self.build()
self.create_target()
self.redirect_stdout()
@@ -76,6 +81,7 @@ class ProcessIOTestCase(TestBase):
@skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDERR without specifying STDIN or STDOUT."""
+ self.setup_test()
self.build()
self.create_target()
self.redirect_stderr()
@@ -90,6 +96,7 @@ class ProcessIOTestCase(TestBase):
@skipIfDarwinEmbedded # debugserver can't create/write files on the device
def test_stdout_stderr_redirection(self):
"""Exercise SBLaunchInfo::AddOpenFileAction() for STDOUT and STDERR without redirecting STDIN."""
+ self.setup_test()
self.build()
self.create_target()
self.redirect_stdout()
diff --git a/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py b/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
index 6302711606c5..b03cebce48c1 100644
--- a/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
+++ b/packages/Python/lldbsuite/test/python_api/process/read-mem-cstring/TestReadMemCString.py
@@ -17,17 +17,19 @@ class TestReadMemCString(TestBase):
def test_read_memory_c_string(self):
"""Test corner case behavior of SBProcess::ReadCStringFromMemory"""
self.build()
- self.dbg.SetAsync(False)
+ self.dbg.SetAsync(False)
self.main_source = "main.c"
- self.main_source_spec = lldb.SBFileSpec(self.main_source)
- self.exe = os.path.join(os.getcwd(), "read-mem-cstring")
+ self.main_source_path = os.path.join(self.getSourceDir(),
+ self.main_source)
+ self.main_source_spec = lldb.SBFileSpec(self.main_source_path)
+ self.exe = self.getBuildArtifact("read-mem-cstring")
(target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint(
self, 'breakpoint here', self.main_source_spec, None, self.exe)
- frame = thread.GetFrameAtIndex(0)
-
+ frame = thread.GetFrameAtIndex(0)
+
err = lldb.SBError()
empty_str_addr = frame.FindVariable("empty_string").GetValueAsUnsigned(err)
diff --git a/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py b/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
index a84d0004c18b..1d042b69287f 100644
--- a/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
+++ b/packages/Python/lldbsuite/test/python_api/rdar-12481949/Test-rdar-12481949.py
@@ -26,7 +26,7 @@ class Radar12481949DataFormatterTestCase(TestBase):
def test_with_run_command(self):
"""Check that SBValue.GetValueAsSigned() does the right thing for a 32-bit -1."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py b/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
index 0560ac502dcf..a1a400a076b5 100644
--- a/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
+++ b/packages/Python/lldbsuite/test/python_api/sbdata/TestSBData.py
@@ -25,7 +25,7 @@ class SBDataAPICase(TestBase):
def test_byte_order_and_address_byte_size(self):
"""Test the SBData::SetData() to ensure the byte order and address
byte size are obeyed"""
- addr_data = '\x11\x22\x33\x44\x55\x66\x77\x88'
+ addr_data = b'\x11\x22\x33\x44\x55\x66\x77\x88'
error = lldb.SBError()
data = lldb.SBData()
data.SetData(error, addr_data, lldb.eByteOrderBig, 4)
@@ -45,7 +45,7 @@ class SBDataAPICase(TestBase):
def test_with_run_command(self):
"""Test the SBData APIs."""
self.build()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self, "main.cpp", self.line, num_expected_locations=1, loc_exact=True)
diff --git a/packages/Python/lldbsuite/test/python_api/sblaunchinfo/TestSBLaunchInfo.py b/packages/Python/lldbsuite/test/python_api/sblaunchinfo/TestSBLaunchInfo.py
new file mode 100644
index 000000000000..ee4a102fc145
--- /dev/null
+++ b/packages/Python/lldbsuite/test/python_api/sblaunchinfo/TestSBLaunchInfo.py
@@ -0,0 +1,31 @@
+"""
+Test SBLaunchInfo
+"""
+
+from __future__ import print_function
+
+
+from lldbsuite.test.lldbtest import *
+
+
+def lookup(info, key):
+ for i in range(info.GetNumEnvironmentEntries()):
+ KeyEqValue = info.GetEnvironmentEntryAtIndex(i)
+ Key, Value = KeyEqValue.split("=")
+ if Key == key:
+ return Value
+ return ""
+
+class TestSBLaunchInfo(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
+
+ def test_environment_getset(self):
+ info = lldb.SBLaunchInfo(None)
+ info.SetEnvironmentEntries(["FOO=BAR"], False)
+ self.assertEquals(1, info.GetNumEnvironmentEntries())
+ info.SetEnvironmentEntries(["BAR=BAZ"], True)
+ self.assertEquals(2, info.GetNumEnvironmentEntries())
+ self.assertEquals("BAR", lookup(info, "FOO"))
+ self.assertEquals("BAZ", lookup(info, "BAR"))
diff --git a/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py b/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
index eab3cbb30ddc..3d0c72146d5c 100644
--- a/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
+++ b/packages/Python/lldbsuite/test/python_api/sbvalue_persist/TestSBValuePersist.py
@@ -22,7 +22,7 @@ class SBValuePersistTestCase(TestBase):
"""Test SBValue::Persist"""
self.build()
self.setTearDownCleanup()
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_source_regexp(self, "break here")
diff --git a/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py b/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
index 5893dfb8f7f2..088a66c71c5c 100644
--- a/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/section/TestSectionAPI.py
@@ -19,7 +19,7 @@ class SectionAPITestCase(TestBase):
d = {'EXE': 'b.out'}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), 'b.out')
+ exe = self.getBuildArtifact('b.out')
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py b/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
index 76b1d603f55f..482f4a829b20 100644
--- a/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/signals/TestSignalsAPI.py
@@ -22,7 +22,7 @@ class SignalsAPITestCase(TestBase):
def test_ignore_signal(self):
"""Test Python SBUnixSignals.Suppress/Stop/Notify() API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py b/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
index 85ecb69a91fc..2b783fb90e56 100644
--- a/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
+++ b/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py
@@ -31,7 +31,7 @@ class SymbolContextAPITestCase(TestBase):
def test(self):
"""Exercise SBSymbolContext API extensively."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -66,17 +66,14 @@ class SymbolContextAPITestCase(TestBase):
module = context.GetModule()
desc = lldbutil.get_description(module)
self.expect(desc, "The module should match", exe=False,
- substrs=[os.path.join(self.mydir, 'a.out')])
+ substrs=[self.getBuildArtifact("a.out")])
compileUnit = context.GetCompileUnit()
self.expect(
str(compileUnit),
"The compile unit should match",
exe=False,
- substrs=[
- os.path.join(
- self.mydir,
- 'main.c')])
+ substrs=[self.getSourcePath('main.c')])
function = context.GetFunction()
self.assertTrue(function)
@@ -92,8 +89,7 @@ class SymbolContextAPITestCase(TestBase):
lineEntry.GetFileSpec().GetDirectory(),
"The line entry should have the correct directory",
exe=False,
- substrs=[
- self.mydir])
+ substrs=[self.mydir])
self.expect(
lineEntry.GetFileSpec().GetFilename(),
"The line entry should have the correct filename",
diff --git a/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py b/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
index 429e9c4da34a..8640abe5625b 100644
--- a/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
+++ b/packages/Python/lldbsuite/test/python_api/symbol-context/two-files/TestSymbolContextTwoFiles.py
@@ -21,8 +21,7 @@ class SymbolContextTwoFilesTestCase(TestBase):
def test_lookup_by_address(self):
"""Test lookup by address in a module with multiple compilation units"""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
-
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -44,8 +43,7 @@ class SymbolContextTwoFilesTestCase(TestBase):
"""This test verifies that we correctly handle the case when multiple
compile unit contains DW_AT_ranges and DW_AT_ranges_base attributes."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
-
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py b/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
index adbdc524949d..224dca77daa3 100644
--- a/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/target/TestTargetAPI.py
@@ -46,6 +46,14 @@ class TargetAPITestCase(TestBase):
self.find_global_variables('b.out')
@add_test_categories(['pyapi'])
+ def test_find_compile_units(self):
+ """Exercise SBTarget.FindCompileUnits() API."""
+ d = {'EXE': 'b.out'}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ self.find_compile_units(self.getBuildArtifact('b.out'))
+
+ @add_test_categories(['pyapi'])
@expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
def test_find_functions(self):
"""Exercise SBTarget.FindFunctions() API."""
@@ -61,12 +69,7 @@ class TargetAPITestCase(TestBase):
self.get_description()
@add_test_categories(['pyapi'])
- def test_launch_new_process_and_redirect_stdout(self):
- """Exercise SBTarget.Launch() API."""
- self.build()
- self.launch_new_process_and_redirect_stdout()
-
- @add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr21765')
def test_resolve_symbol_context_with_address(self):
"""Exercise SBTarget.ResolveSymbolContextForAddress() API."""
self.build()
@@ -149,7 +152,7 @@ class TargetAPITestCase(TestBase):
self.assertEqual(len(content), 1)
def create_simple_target(self, fn):
- exe = os.path.join(os.getcwd(), fn)
+ exe = self.getBuildArtifact(fn)
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
return target
@@ -175,7 +178,7 @@ class TargetAPITestCase(TestBase):
def find_global_variables(self, exe_name):
"""Exercise SBTaget.FindGlobalVariables() API."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -216,8 +219,7 @@ class TargetAPITestCase(TestBase):
# While we are at it, let's also exercise the similar
# SBModule.FindGlobalVariables() API.
for m in target.module_iter():
- if os.path.normpath(m.GetFileSpec().GetDirectory()) == os.getcwd(
- ) and m.GetFileSpec().GetFilename() == exe_name:
+ if os.path.normpath(m.GetFileSpec().GetDirectory()) == self.getBuildDir() and m.GetFileSpec().GetFilename() == exe_name:
value_list = m.FindGlobalVariables(
target, 'my_global_var_of_char_type', 3)
self.assertTrue(value_list.GetSize() == 1)
@@ -225,9 +227,23 @@ class TargetAPITestCase(TestBase):
value_list.GetValueAtIndex(0).GetValue() == "'X'")
break
+ def find_compile_units(self, exe):
+ """Exercise SBTarget.FindCompileUnits() API."""
+ source_name = "main.c"
+
+ # Create a target by the debugger.
+ target = self.dbg.CreateTarget(exe)
+ self.assertTrue(target, VALID_TARGET)
+
+ list = target.FindCompileUnits(lldb.SBFileSpec(source_name, False))
+ # Executable has been built just from one source file 'main.c',
+ # so we may check only the first element of list.
+ self.assertTrue(
+ list[0].GetCompileUnit().GetFileSpec().GetFilename() == source_name)
+
def find_functions(self, exe_name):
"""Exercise SBTaget.FindFunctions() API."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -243,7 +259,7 @@ class TargetAPITestCase(TestBase):
def get_description(self):
"""Exercise SBTaget.GetDescription() API."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -269,9 +285,12 @@ class TargetAPITestCase(TestBase):
substrs=['a.out', 'Target', 'Module', 'Breakpoint'])
@not_remote_testsuite_ready
- def launch_new_process_and_redirect_stdout(self):
+ @add_test_categories(['pyapi'])
+ @no_debug_info_test
+ def test_launch_new_process_and_redirect_stdout(self):
"""Exercise SBTaget.Launch() API with redirected stdout."""
- exe = os.path.join(os.getcwd(), "a.out")
+ self.build()
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -286,9 +305,12 @@ class TargetAPITestCase(TestBase):
# Now launch the process, do not stop at entry point, and redirect stdout to "stdout.txt" file.
# The inferior should run to completion after "process.Continue()"
# call.
- local_path = "stdout.txt"
+ local_path = self.getBuildArtifact("stdout.txt")
+ if os.path.exists(local_path):
+ os.remove(local_path)
+
if lldb.remote_platform:
- stdout_path = lldbutil.append_to_process_working_directory(
+ stdout_path = lldbutil.append_to_process_working_directory(self,
"lldb-stdout-redirect.txt")
else:
stdout_path = local_path
@@ -314,26 +336,19 @@ class TargetAPITestCase(TestBase):
# The 'stdout.txt' file should now exist.
self.assertTrue(
- os.path.isfile("stdout.txt"),
+ os.path.isfile(local_path),
"'stdout.txt' exists due to redirected stdout via SBTarget.Launch() API.")
# Read the output file produced by running the program.
- with open('stdout.txt', 'r') as f:
+ with open(local_path, 'r') as f:
output = f.read()
- # Let's delete the 'stdout.txt' file as a cleanup step.
- try:
- os.remove("stdout.txt")
- pass
- except OSError:
- pass
-
self.expect(output, exe=False,
substrs=["a(1)", "b(2)", "a(3)"])
def resolve_symbol_context_with_address(self):
"""Exercise SBTaget.ResolveSymbolContextForAddress() API."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py b/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
index a1272cbcbce1..11740b1cf4df 100644
--- a/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/thread/TestThreadAPI.py
@@ -51,6 +51,7 @@ class ThreadAPITestCase(TestBase):
self.step_out_of_malloc_into_function_b(self.exe_name)
@add_test_categories(['pyapi'])
+ @expectedFailureAll(oslist=["windows"], bugnumber='llvm.org/pr32343')
def test_step_over_3_times(self):
"""Test Python SBThread.StepOver() API."""
# We build a different executable than the default build() does.
@@ -78,7 +79,7 @@ class ThreadAPITestCase(TestBase):
def get_process(self):
"""Test Python SBThread.GetProcess() API."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -105,7 +106,7 @@ class ThreadAPITestCase(TestBase):
def get_stop_description(self):
"""Test Python SBThread.GetStopDescription() API."""
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -134,7 +135,7 @@ class ThreadAPITestCase(TestBase):
def step_out_of_malloc_into_function_b(self, exe_name):
"""Test Python SBThread.StepOut() API to step out of a malloc call where the call site is at function b()."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -181,7 +182,7 @@ class ThreadAPITestCase(TestBase):
def step_over_3_times(self, exe_name):
"""Test Python SBThread.StepOver() API."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
@@ -227,7 +228,7 @@ class ThreadAPITestCase(TestBase):
def run_to_address(self, exe_name):
"""Test Python SBThread.RunToAddress() API."""
- exe = os.path.join(os.getcwd(), exe_name)
+ exe = self.getBuildArtifact(exe_name)
target = self.dbg.CreateTarget(exe)
self.assertTrue(target, VALID_TARGET)
diff --git a/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py b/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
index 5ab742dac7c7..40128d3ce94e 100644
--- a/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
+++ b/packages/Python/lldbsuite/test/python_api/type/TestTypeList.py
@@ -34,7 +34,7 @@ class TypeAndTypeListTestCase(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
index 632244e8b9e6..8a4af0cc2b94 100644
--- a/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/value/TestValueAPI.py
@@ -33,7 +33,7 @@ class ValueAPITestCase(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -61,9 +61,23 @@ class ValueAPITestCase(TestBase):
list = target.FindGlobalVariables('days_of_week', 1)
days_of_week = list.GetValueAtIndex(0)
self.assertTrue(days_of_week, VALID_VARIABLE)
- self.assertTrue(days_of_week.GetNumChildren() == 7, VALID_VARIABLE)
+ self.assertEqual(days_of_week.GetNumChildren(), 7, VALID_VARIABLE)
self.DebugSBValue(days_of_week)
+ # Use this to test the "child" and "children" accessors:
+ children = days_of_week.children
+ self.assertEqual(len(children), 7, VALID_VARIABLE)
+ for i in range(0, len(children)):
+ day = days_of_week.child[i]
+ list_day = children[i]
+ self.assertNotEqual(day, None)
+ self.assertNotEqual(list_day, None)
+ self.assertEqual(day.GetSummary(), list_day.GetSummary(), VALID_VARIABLE)
+
+ # Spot check the actual value:
+ first_day = days_of_week.child[1]
+ self.assertEqual(first_day.GetSummary(), '"Monday"', VALID_VARIABLE)
+
# Get global variable 'weekdays'.
list = target.FindGlobalVariables('weekdays', 1)
weekdays = list.GetValueAtIndex(0)
diff --git a/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py b/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
index 64c7fde22670..18d39d9675c8 100644
--- a/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/value/change_values/TestChangeValueAPI.py
@@ -38,7 +38,7 @@ class ChangeValueAPITestCase(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py b/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
index c4b1e282590c..6fa72837484e 100644
--- a/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
+++ b/packages/Python/lldbsuite/test/python_api/value/empty_class/TestValueAPIEmptyClass.py
@@ -15,7 +15,7 @@ class ValueAPIEmptyClassTestCase(TestBase):
@add_test_categories(['pyapi'])
def test(self):
self.build()
- exe = os.path.join(os.getcwd(), 'a.out')
+ exe = self.getBuildArtifact("a.out")
line = line_number('main.cpp', '// Break at this line')
# Create a target by the debugger.
diff --git a/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py b/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py
index d5f53d712e7d..1b009521d253 100644
--- a/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py
+++ b/packages/Python/lldbsuite/test/python_api/value/linked_list/TestValueAPILinkedList.py
@@ -36,7 +36,7 @@ class ValueAsLinkedListTestCase(TestBase):
d = {'EXE': self.exe_name}
self.build(dictionary=d)
self.setTearDownCleanup(dictionary=d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py b/packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py
index f4789877f34e..a83fd6e12390 100644
--- a/packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py
+++ b/packages/Python/lldbsuite/test/python_api/value_var_update/TestValueVarUpdate.py
@@ -20,16 +20,16 @@ class HelloWorldTestCase(TestBase):
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
- # Get the full path to our executable to be attached/debugged.
- self.exe = os.path.join(os.getcwd(), self.testMethodName)
- self.d = {'EXE': self.testMethodName}
@add_test_categories(['pyapi'])
def test_with_process_launch_api(self):
"""Test SBValue::GetValueDidChange"""
- self.build(dictionary=self.d)
- self.setTearDownCleanup(dictionary=self.d)
- target = self.dbg.CreateTarget(self.exe)
+ # Get the full path to our executable to be attached/debugged.
+ exe = self.getBuildArtifact(self.testMethodName)
+ d = {'EXE': exe}
+ self.build(dictionary=d)
+ self.setTearDownCleanup(dictionary=d)
+ target = self.dbg.CreateTarget(exe)
breakpoint = target.BreakpointCreateBySourceRegex(
"break here", lldb.SBFileSpec("main.c"))
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
index cef8a0c4e81f..0236d4b2c6d8 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestSetWatchpoint.py
@@ -36,7 +36,7 @@ class SetWatchpointAPITestCase(TestBase):
def test_watch_val(self):
"""Exercise SBValue.Watch() API to set a watchpoint."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
index 0d1ef809d291..603b7a805008 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIgnoreCount.py
@@ -36,7 +36,7 @@ class WatchpointIgnoreCountTestCase(TestBase):
def test_set_watch_ignore_count(self):
"""Test SBWatchpoint.SetIgnoreCount() API."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
index ca5fca3acf9a..b9fc7ceb1af6 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/TestWatchpointIter.py
@@ -39,7 +39,7 @@ class WatchpointIteratorTestCase(TestBase):
def test_watch_iter(self):
"""Exercise SBTarget.watchpoint_iter() API to iterate on the available watchpoints."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py b/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
index 4b0216d7a602..bb32869543c7 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -42,7 +42,7 @@ class WatchpointConditionAPITestCase(TestBase):
"""Test watchpoint condition API."""
self.build(dictionary=self.d)
self.setTearDownCleanup(dictionary=self.d)
- exe = os.path.join(os.getcwd(), self.exe_name)
+ exe = self.getBuildArtifact(self.exe_name)
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
index e6bc9c0a7654..fdc8ac053d76 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestSetWatchlocation.py
@@ -37,7 +37,7 @@ class SetWatchlocationAPITestCase(TestBase):
def test_watch_location(self):
"""Exercise SBValue.WatchPointee() API to set a watchpoint."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
index 80595060b42d..d5862d274ceb 100644
--- a/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
+++ b/packages/Python/lldbsuite/test/python_api/watchpoint/watchlocation/TestTargetWatchAddress.py
@@ -36,7 +36,7 @@ class TargetWatchAddressAPITestCase(TestBase):
def test_watch_address(self):
"""Exercise SBTarget.WatchAddress() API to set a watchpoint."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
@@ -112,7 +112,7 @@ class TargetWatchAddressAPITestCase(TestBase):
def test_watch_address_with_invalid_watch_size(self):
"""Exercise SBTarget.WatchAddress() API but pass an invalid watch_size."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
# Create a target by the debugger.
target = self.dbg.CreateTarget(exe)
diff --git a/packages/Python/lldbsuite/test/quit/TestQuit.py b/packages/Python/lldbsuite/test/quit/TestQuit.py
new file mode 100644
index 000000000000..28c05b833d64
--- /dev/null
+++ b/packages/Python/lldbsuite/test/quit/TestQuit.py
@@ -0,0 +1,32 @@
+"""
+Test lldb's quit command.
+"""
+
+from __future__ import print_function
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class QuitCommandTestCase(TestBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ @no_debug_info_test
+ def test_quit_exit_code_disallow(self):
+ self.ci.AllowExitCodeOnQuit(False)
+ self.expect(
+ "quit 20",
+ substrs=[
+ "error: The current driver doesn't allow custom exit codes for the quit command"],
+ error=True)
+ self.assertFalse(self.ci.HasCustomQuitExitCode())
+
+ @no_debug_info_test
+ def test_quit_exit_code_allow(self):
+ self.ci.AllowExitCodeOnQuit(True)
+ self.runCmd("quit 10", check=False)
+ self.assertTrue(self.ci.HasCustomQuitExitCode())
+ self.assertEqual(self.ci.GetQuitStatus(), 10)
diff --git a/packages/Python/lldbsuite/test/settings/TestSettings.py b/packages/Python/lldbsuite/test/settings/TestSettings.py
index 5e1cd44c01b9..6b8ac7c3d5d5 100644
--- a/packages/Python/lldbsuite/test/settings/TestSettings.py
+++ b/packages/Python/lldbsuite/test/settings/TestSettings.py
@@ -17,16 +17,8 @@ from lldbsuite.test import lldbutil
class SettingsCommandTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
+ NO_DEBUG_INFO_TESTCASE = True
- @classmethod
- def classCleanup(cls):
- """Cleanup the test byproducts."""
- cls.RemoveTempFile("output1.txt")
- cls.RemoveTempFile("output2.txt")
- cls.RemoveTempFile("stderr.txt")
- cls.RemoveTempFile("stdout.txt")
-
- @no_debug_info_test
def test_apropos_should_also_search_settings_description(self):
"""Test that 'apropos' command should also search descriptions for the settings variables."""
@@ -35,7 +27,6 @@ class SettingsCommandTestCase(TestBase):
"environment variables",
"executable's environment"])
- @no_debug_info_test
def test_append_target_env_vars(self):
"""Test that 'append target.run-args' works."""
# Append the env-vars.
@@ -48,7 +39,6 @@ class SettingsCommandTestCase(TestBase):
self.expect('settings show target.env-vars',
substrs=['MY_ENV_VAR=YES'])
- @no_debug_info_test
def test_insert_before_and_after_target_run_args(self):
"""Test that 'insert-before/after target.run-args' works."""
# Set the run-args first.
@@ -70,7 +60,6 @@ class SettingsCommandTestCase(TestBase):
'[3]: "b"',
'[4]: "c"'])
- @no_debug_info_test
def test_replace_target_run_args(self):
"""Test that 'replace target.run-args' works."""
# Set the run-args and then replace the index-0 element.
@@ -88,7 +77,6 @@ class SettingsCommandTestCase(TestBase):
'[1]: "b"',
'[2]: "c"'])
- @no_debug_info_test
def test_set_prompt(self):
"""Test that 'set prompt' actually changes the prompt."""
@@ -106,7 +94,6 @@ class SettingsCommandTestCase(TestBase):
# Use '-r' option to reset to the original default prompt.
self.runCmd("settings clear prompt")
- @no_debug_info_test
def test_set_term_width(self):
"""Test that 'set term-width' actually changes the term-width."""
@@ -125,7 +112,7 @@ class SettingsCommandTestCase(TestBase):
"""Test that 'set frame-format' with a backtick char in the format string works as well as fullpath."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
def cleanup():
@@ -153,15 +140,16 @@ class SettingsCommandTestCase(TestBase):
substrs=[format_string])
self.runCmd("breakpoint set -n main")
- self.runCmd("run")
+ self.runCmd("process launch --working-dir '{0}'".format(self.get_process_working_directory()),
+ RUN_SUCCEEDED)
self.expect("thread backtrace",
- substrs=["`main", os.getcwd()])
+ substrs=["`main", self.getSourceDir()])
def test_set_auto_confirm(self):
"""Test that after 'set auto-confirm true', manual confirmation should not kick in."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
self.runCmd("settings set auto-confirm true")
@@ -186,7 +174,7 @@ class SettingsCommandTestCase(TestBase):
"""Test that user options for the disassembler take effect."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# AT&T syntax
@@ -219,7 +207,7 @@ class SettingsCommandTestCase(TestBase):
def test_run_args_and_env_vars(self):
"""Test that run-args and env-vars are passed to the launched process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Set the run-args and the env-vars.
@@ -231,13 +219,11 @@ class SettingsCommandTestCase(TestBase):
self.addTearDownHook(
lambda: self.runCmd("settings clear target.env-vars"))
- self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("process launch --working-dir '{0}'".format(self.get_process_working_directory()),
+ RUN_SUCCEEDED)
# Read the output file produced by running the program.
- if lldb.remote_platform:
- self.runCmd('platform get-file "output2.txt" "output2.txt"')
- with open('output2.txt', 'r') as f:
- output = f.read()
+ output = lldbutil.read_file_from_process_wd(self, "output2.txt")
self.expect(
output,
@@ -253,7 +239,7 @@ class SettingsCommandTestCase(TestBase):
"""Test that the host env vars are passed to the launched process."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# By default, inherit-env is 'true'.
@@ -272,13 +258,11 @@ class SettingsCommandTestCase(TestBase):
os.environ.pop("MY_HOST_ENV_VAR2")
self.addTearDownHook(unset_env_variables)
- self.runCmd("run", RUN_SUCCEEDED)
+ self.runCmd("process launch --working-dir '{0}'".format(self.get_process_working_directory()),
+ RUN_SUCCEEDED)
# Read the output file produced by running the program.
- if lldb.remote_platform:
- self.runCmd('platform get-file "output1.txt" "output1.txt"')
- with open('output1.txt', 'r') as f:
- output = f.read()
+ output = lldbutil.read_file_from_process_wd(self, "output1.txt")
self.expect(
output,
@@ -292,12 +276,14 @@ class SettingsCommandTestCase(TestBase):
"""Test that setting target.error/output-path for the launched process works."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Set the error-path and output-path and verify both are set.
- self.runCmd("settings set target.error-path stderr.txt")
- self.runCmd("settings set target.output-path stdout.txt")
+ self.runCmd("settings set target.error-path '{0}'".format(
+ lldbutil.append_to_process_working_directory(self, "stderr.txt")))
+ self.runCmd("settings set target.output-path '{0}".format(
+ lldbutil.append_to_process_working_directory(self, "stdout.txt")))
# And add hooks to restore the original settings during tearDown().
self.addTearDownHook(
lambda: self.runCmd("settings clear target.output-path"))
@@ -306,44 +292,26 @@ class SettingsCommandTestCase(TestBase):
self.expect("settings show target.error-path",
SETTING_MSG("target.error-path"),
- substrs=['target.error-path (file) = "stderr.txt"'])
+ substrs=['target.error-path (file)', 'stderr.txt"'])
self.expect("settings show target.output-path",
SETTING_MSG("target.output-path"),
- substrs=['target.output-path (file) = "stdout.txt"'])
-
- self.runCmd("run", RUN_SUCCEEDED)
-
- if lldb.remote_platform:
- self.runCmd('platform get-file "stderr.txt" "stderr.txt"')
- self.runCmd('platform get-file "stdout.txt" "stdout.txt"')
+ substrs=['target.output-path (file)', 'stdout.txt"'])
- # The 'stderr.txt' file should now exist.
- self.assertTrue(os.path.isfile("stderr.txt"),
- "'stderr.txt' exists due to target.error-path.")
-
- # Read the output file produced by running the program.
- with open('stderr.txt', 'r') as f:
- output = f.read()
+ self.runCmd("process launch --working-dir '{0}'".format(self.get_process_working_directory()),
+ RUN_SUCCEEDED)
+ output = lldbutil.read_file_from_process_wd(self, "stderr.txt")
message = "This message should go to standard error."
if lldbplatformutil.hasChattyStderr(self):
self.expect(output, exe=False, substrs=[message])
else:
self.expect(output, exe=False, startstr=message)
- # The 'stdout.txt' file should now exist.
- self.assertTrue(os.path.isfile("stdout.txt"),
- "'stdout.txt' exists due to target.output-path.")
-
- # Read the output file produced by running the program.
- with open('stdout.txt', 'r') as f:
- output = f.read()
-
+ output = lldbutil.read_file_from_process_wd(self, "stdout.txt")
self.expect(output, exe=False,
startstr="This message should go to standard out.")
- @no_debug_info_test
def test_print_dictionary_setting(self):
self.runCmd("settings clear target.env-vars")
self.runCmd("settings set target.env-vars [\"MY_VAR\"]=some-value")
@@ -351,7 +319,6 @@ class SettingsCommandTestCase(TestBase):
substrs=["MY_VAR=some-value"])
self.runCmd("settings clear target.env-vars")
- @no_debug_info_test
def test_print_array_setting(self):
self.runCmd("settings clear target.run-args")
self.runCmd("settings set target.run-args gobbledy-gook")
@@ -359,7 +326,6 @@ class SettingsCommandTestCase(TestBase):
substrs=['[0]: "gobbledy-gook"'])
self.runCmd("settings clear target.run-args")
- @no_debug_info_test
def test_settings_with_quotes(self):
self.runCmd("settings clear target.run-args")
self.runCmd("settings set target.run-args a b c")
@@ -392,7 +358,6 @@ class SettingsCommandTestCase(TestBase):
'thread-format (format-string) = "abc def "')
self.runCmd('settings clear thread-format')
- @no_debug_info_test
def test_settings_with_trailing_whitespace(self):
# boolean
@@ -421,8 +386,8 @@ class SettingsCommandTestCase(TestBase):
startstr='target.arg0 (string) = "cde"')
self.runCmd("settings clear target.arg0", check=False)
# file
- path1 = os.path.join(os.getcwd(), "path1.txt")
- path2 = os.path.join(os.getcwd(), "path2.txt")
+ path1 = self.getBuildArtifact("path1.txt")
+ path2 = self.getBuildArtifact("path2.txt")
self.runCmd(
"settings set target.output-path %s" %
path1) # Set to known value
@@ -517,7 +482,6 @@ class SettingsCommandTestCase(TestBase):
substrs=['disassembly-format (format-string) = "foo "'])
self.runCmd("settings clear disassembly-format", check=False)
- @no_debug_info_test
def test_all_settings_exist(self):
self.expect("settings show",
substrs=["auto-confirm",
@@ -560,3 +524,41 @@ class SettingsCommandTestCase(TestBase):
"target.process.extra-startup-command",
"target.process.thread.step-avoid-regexp",
"target.process.thread.trace-thread"])
+
+ # settings under an ".experimental" domain should have two properties:
+ # 1. If the name does not exist with "experimental" in the name path,
+ # the name lookup should try to find it without "experimental". So
+ # a previously-experimental setting that has been promoted to a
+ # "real" setting will still be set by the original name.
+ # 2. Changing a setting with .experimental., name, where the setting
+ # does not exist either with ".experimental." or without, should
+ # not generate an error. So if an experimental setting is removed,
+ # people who may have that in their ~/.lldbinit files should not see
+ # any errors.
+ def test_experimental_settings(self):
+ cmdinterp = self.dbg.GetCommandInterpreter()
+ result = lldb.SBCommandReturnObject()
+
+ # Set target.arg0 to a known value, check that we can retrieve it via
+ # the actual name and via .experimental.
+ self.expect('settings set target.arg0 first-value')
+ self.expect('settings show target.arg0', substrs=['first-value'])
+ self.expect('settings show target.experimental.arg0', substrs=['first-value'], error=False)
+
+ # Set target.arg0 to a new value via a target.experimental.arg0 name,
+ # verify that we can read it back via both .experimental., and not.
+ self.expect('settings set target.experimental.arg0 second-value', error=False)
+ self.expect('settings show target.arg0', substrs=['second-value'])
+ self.expect('settings show target.experimental.arg0', substrs=['second-value'], error=False)
+
+ # showing & setting an undefined .experimental. setting should generate no errors.
+ self.expect('settings show target.experimental.setting-which-does-not-exist', patterns=['^\s$'], error=False)
+ self.expect('settings set target.experimental.setting-which-does-not-exist true', error=False)
+
+ # A domain component before .experimental. which does not exist should give an error
+ # But the code does not yet do that.
+ # self.expect('settings set target.setting-which-does-not-exist.experimental.arg0 true', error=True)
+
+ # finally, confirm that trying to set a setting that does not exist still fails.
+ # (SHOWING a setting that does not exist does not currently yield an error.)
+ self.expect('settings set target.setting-which-does-not-exist true', error=True)
diff --git a/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py b/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
index 02110d1684f8..9265b47962b1 100644
--- a/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
+++ b/packages/Python/lldbsuite/test/settings/quoting/TestQuoting.py
@@ -79,19 +79,25 @@ class SettingsCommandTestCase(TestBase):
to stdout. Compare the stdout with args_out."""
self.buildDefault()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
- self.runCmd("process launch -- " + args_in)
+ local_outfile = self.getBuildArtifact("output.txt")
+ if lldb.remote_platform:
+ remote_outfile = "output.txt" # Relative to platform's PWD
+ else:
+ remote_outfile = local_outfile
+
+ self.runCmd("process launch -- %s %s" %(remote_outfile, args_in))
if lldb.remote_platform:
- src_file_spec = lldb.SBFileSpec('output.txt', False)
- dst_file_spec = lldb.SBFileSpec('output.txt', True)
+ src_file_spec = lldb.SBFileSpec(remote_outfile, False)
+ dst_file_spec = lldb.SBFileSpec(local_outfile, True)
lldb.remote_platform.Get(src_file_spec, dst_file_spec)
- with open('output.txt', 'r') as f:
+ with open(local_outfile, 'r') as f:
output = f.read()
- self.RemoveTempFile("output.txt")
+ self.RemoveTempFile(local_outfile)
self.assertEqual(output, args_out)
diff --git a/packages/Python/lldbsuite/test/settings/quoting/main.c b/packages/Python/lldbsuite/test/settings/quoting/main.c
index 5e3e34f84a67..2ebaa142bc5c 100644
--- a/packages/Python/lldbsuite/test/settings/quoting/main.c
+++ b/packages/Python/lldbsuite/test/settings/quoting/main.c
@@ -8,11 +8,11 @@ main(int argc, char const *argv[])
{
int i;
- FILE *output = fopen ("output.txt", "w");
+ FILE *output = fopen (argv[1], "w");
if (output == NULL)
exit (1);
- for (i = 1; i < argc; ++i)
+ for (i = 2; i < argc; ++i)
fwrite(argv[i], strlen(argv[i])+1, 1, output);
fclose (output);
diff --git a/packages/Python/lldbsuite/test/source-manager/Makefile b/packages/Python/lldbsuite/test/source-manager/Makefile
index d6cd0db0506f..5d19a27a2df2 100644
--- a/packages/Python/lldbsuite/test/source-manager/Makefile
+++ b/packages/Python/lldbsuite/test/source-manager/Makefile
@@ -1,5 +1,13 @@
LEVEL = ../make
-C_SOURCES := main.c
+C_SOURCES := main-copy.c
include $(LEVEL)/Makefile.rules
+
+# Copy file into the build folder to enable the test to modify it.
+main-copy.c: main.c
+ cp -f $< $@
+
+
+clean::
+ $(RM) main-copy.c
diff --git a/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py b/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
index 31fe5437d1d2..0df4f8b2d2a8 100644
--- a/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
+++ b/packages/Python/lldbsuite/test/source-manager/TestSourceManager.py
@@ -27,20 +27,19 @@ class SourceManagerTestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
- SOURCE_FILE = 'main.c'
-
NO_DEBUG_INFO_TESTCASE = True
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
# Find the line number to break inside main().
- self.line = line_number(self.SOURCE_FILE, '// Set break point at this line.')
+ self.file = self.getBuildArtifact("main-copy.c")
+ self.line = line_number("main.c", '// Set break point at this line.')
def get_expected_stop_column_number(self):
"""Return the 1-based column number of the first non-whitespace
character in the breakpoint source line."""
- stop_line = get_line(self.SOURCE_FILE, self.line)
+ stop_line = get_line(self.file, self.line)
# The number of spaces that must be skipped to get to the first non-
# whitespace character --- where we expect the debugger breakpoint
# column to be --- is equal to the number of characters that get
@@ -50,7 +49,7 @@ class SourceManagerTestCase(TestBase):
def do_display_source_python_api(self, use_color, column_marker_regex):
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
target = self.dbg.CreateTarget(exe)
@@ -71,8 +70,7 @@ class SourceManagerTestCase(TestBase):
# and styles such as underline.
self.dbg.SetUseColor(use_color)
- # Create the filespec for 'main.c'.
- filespec = lldb.SBFileSpec('main.c', False)
+ filespec = lldb.SBFileSpec(self.file, False)
source_mgr = self.dbg.GetSourceManager()
# Use a string stream as the destination.
stream = lldb.SBStream()
@@ -116,16 +114,14 @@ class SourceManagerTestCase(TestBase):
def test_move_and_then_display_source(self):
"""Test that target.source-map settings work by moving main.c to hidden/main.c."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
# Move main.c to hidden/main.c.
- main_c = "main.c"
- main_c_hidden = os.path.join("hidden", main_c)
- os.rename(main_c, main_c_hidden)
-
- # Restore main.c after the test.
- self.addTearDownHook(lambda: os.rename(main_c_hidden, main_c))
+ hidden = self.getBuildArtifact("hidden")
+ lldbutil.mkdir_p(hidden)
+ main_c_hidden = os.path.join(hidden, "main-copy.c")
+ os.rename(self.file, main_c_hidden)
if self.TraceOn():
system([["ls"]])
@@ -140,10 +136,10 @@ class SourceManagerTestCase(TestBase):
# Set target.source-map settings.
self.runCmd("settings set target.source-map %s %s" %
- (os.getcwd(), os.path.join(os.getcwd(), "hidden")))
+ (self.getBuildDir(), hidden))
# And verify that the settings work.
self.expect("settings show target.source-map",
- substrs=[os.getcwd(), os.path.join(os.getcwd(), "hidden")])
+ substrs=[self.getBuildDir(), hidden])
# Display main() and verify that the source mapping has been kicked in.
self.expect("source list -n main", SOURCE_DISPLAYED_CORRECTLY,
@@ -152,23 +148,23 @@ class SourceManagerTestCase(TestBase):
def test_modify_source_file_while_debugging(self):
"""Modify a source file while debugging the executable."""
self.build()
- exe = os.path.join(os.getcwd(), "a.out")
+ exe = self.getBuildArtifact("a.out")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
- self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
+ self, "main-copy.c", self.line, num_expected_locations=1, loc_exact=True)
self.runCmd("run", RUN_SUCCEEDED)
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
- 'main.c:%d' % self.line,
+ 'main-copy.c:%d' % self.line,
'stop reason = breakpoint'])
# Display some source code.
self.expect(
- "source list -f main.c -l %d" %
+ "source list -f main-copy.c -l %d" %
self.line,
SOURCE_DISPLAYED_CORRECTLY,
substrs=['Hello world'])
@@ -189,7 +185,7 @@ class SourceManagerTestCase(TestBase):
self.assertTrue(int(m.group(1)) > 0)
# Read the main.c file content.
- with io.open('main.c', 'r', newline='\n') as f:
+ with io.open(self.file, 'r', newline='\n') as f:
original_content = f.read()
if self.TraceOn():
print("original content:", original_content)
@@ -197,48 +193,32 @@ class SourceManagerTestCase(TestBase):
# Modify the in-memory copy of the original source code.
new_content = original_content.replace('Hello world', 'Hello lldb', 1)
- # This is the function to restore the original content.
- def restore_file():
- #print("os.path.getmtime() before restore:", os.path.getmtime('main.c'))
- time.sleep(1)
- with io.open('main.c', 'w', newline='\n') as f:
- f.write(original_content)
- if self.TraceOn():
- with open('main.c', 'r') as f:
- print("content restored to:", f.read())
- # Touch the file just to be sure.
- os.utime('main.c', None)
- if self.TraceOn():
- print(
- "os.path.getmtime() after restore:",
- os.path.getmtime('main.c'))
-
# Modify the source code file.
- with io.open('main.c', 'w', newline='\n') as f:
+ with io.open(self.file, 'w', newline='\n') as f:
time.sleep(1)
f.write(new_content)
if self.TraceOn():
print("new content:", new_content)
print(
"os.path.getmtime() after writing new content:",
- os.path.getmtime('main.c'))
- # Add teardown hook to restore the file to the original content.
- self.addTearDownHook(restore_file)
+ os.path.getmtime(self.file))
# Display the source code again. We should see the updated line.
self.expect(
- "source list -f main.c -l %d" %
+ "source list -f main-copy.c -l %d" %
self.line,
SOURCE_DISPLAYED_CORRECTLY,
substrs=['Hello lldb'])
def test_set_breakpoint_with_absolute_path(self):
self.build()
+ hidden = self.getBuildArtifact("hidden")
+ lldbutil.mkdir_p(hidden)
self.runCmd("settings set target.source-map %s %s" %
- (os.getcwd(), os.path.join(os.getcwd(), "hidden")))
+ (self.getBuildDir(), hidden))
- exe = os.path.join(os.getcwd(), "a.out")
- main = os.path.join(os.getcwd(), "hidden", "main.c")
+ exe = self.getBuildArtifact("a.out")
+ main = os.path.join(self.getBuildDir(), "hidden", "main-copy.c")
self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
@@ -249,5 +229,5 @@ class SourceManagerTestCase(TestBase):
# The stop reason of the thread should be breakpoint.
self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
substrs=['stopped',
- 'main.c:%d' % self.line,
+ 'main-copy.c:%d' % self.line,
'stop reason = breakpoint'])
diff --git a/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py b/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
index e442509c471e..e34fc3416d7e 100644
--- a/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
+++ b/packages/Python/lldbsuite/test/terminal/TestSTTYBeforeAndAfter.py
@@ -7,6 +7,7 @@ from __future__ import print_function
import os
import lldb
+import six
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
@@ -58,13 +59,10 @@ class TestSTTYBeforeAndAfter(TestBase):
child.expect(expect_prompt)
# Turn on loggings for input/output to/from the child.
- with open('child_send1.txt', 'w') as f_send1:
- with open('child_read1.txt', 'w') as f_read1:
- child.logfile_send = f_send1
- child.logfile_read = f_read1
-
- child.sendline('stty -a')
- child.expect(expect_prompt)
+ child.logfile_send = child_send1 = six.StringIO()
+ child.logfile_read = child_read1 = six.StringIO()
+ child.sendline('stty -a')
+ child.expect(expect_prompt)
# Now that the stage1 logging is done, restore logfile to None to
# stop further logging.
@@ -79,43 +77,30 @@ class TestSTTYBeforeAndAfter(TestBase):
child.sendline('quit')
child.expect(expect_prompt)
- with open('child_send2.txt', 'w') as f_send2:
- with open('child_read2.txt', 'w') as f_read2:
- child.logfile_send = f_send2
- child.logfile_read = f_read2
-
- child.sendline('stty -a')
- child.expect(expect_prompt)
+ child.logfile_send = child_send2 = six.StringIO()
+ child.logfile_read = child_read2 = six.StringIO()
+ child.sendline('stty -a')
+ child.expect(expect_prompt)
- child.sendline('exit')
+ child.sendline('exit')
# Now that the stage2 logging is done, restore logfile to None to
# stop further logging.
child.logfile_send = None
child.logfile_read = None
- with open('child_send1.txt', 'r') as fs:
- if self.TraceOn():
- print("\n\nContents of child_send1.txt:")
- print(fs.read())
- with open('child_read1.txt', 'r') as fr:
- from_child1 = fr.read()
- if self.TraceOn():
- print("\n\nContents of child_read1.txt:")
- print(from_child1)
-
- with open('child_send2.txt', 'r') as fs:
- if self.TraceOn():
- print("\n\nContents of child_send2.txt:")
- print(fs.read())
- with open('child_read2.txt', 'r') as fr:
- from_child2 = fr.read()
- if self.TraceOn():
- print("\n\nContents of child_read2.txt:")
- print(from_child2)
-
- stty_output1_lines = from_child1.splitlines()
- stty_output2_lines = from_child2.splitlines()
+ if self.TraceOn():
+ print("\n\nContents of child_send1:")
+ print(child_send1.getvalue())
+ print("\n\nContents of child_read1:")
+ print(child_read1.getvalue())
+ print("\n\nContents of child_send2:")
+ print(child_send2.getvalue())
+ print("\n\nContents of child_read2:")
+ print(child_read2.getvalue())
+
+ stty_output1_lines = child_read1.getvalue().splitlines()
+ stty_output2_lines = child_read2.getvalue().splitlines()
zipped = list(zip(stty_output1_lines, stty_output2_lines))
for tuple in zipped:
if self.TraceOn():
diff --git a/packages/Python/lldbsuite/test/test_categories.py b/packages/Python/lldbsuite/test/test_categories.py
index 46e3f3409dfc..8a9fd7421118 100644
--- a/packages/Python/lldbsuite/test/test_categories.py
+++ b/packages/Python/lldbsuite/test/test_categories.py
@@ -26,6 +26,7 @@ all_categories = {
'gmodules': 'Tests that can be run with -gmodules debug information',
'expression': 'Tests related to the expression parser',
'libc++': 'Test for libc++ data formatters',
+ 'libstdcxx': 'Test for libstdcxx data formatters',
'objc': 'Tests related to the Objective-C programming language support',
'pyapi': 'Tests related to the Python API',
'basic_process': 'Basic process execution sniff tests.',
@@ -58,7 +59,7 @@ def is_supported_on_platform(category, platform, compiler_path):
return platform in ["darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]
elif category == "gmodules":
# First, check to see if the platform can even support gmodules.
- if platform not in ["linux", "freebsd", "darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]:
+ if platform not in ["freebsd", "darwin", "macosx", "ios", "watchos", "tvos", "bridgeos"]:
return False
return gmodules.is_compiler_clang_with_gmodules(compiler_path)
return True
diff --git a/packages/Python/lldbsuite/test/test_result.py b/packages/Python/lldbsuite/test/test_result.py
index 3f5e556040b2..e5bac0cc4aab 100644
--- a/packages/Python/lldbsuite/test/test_result.py
+++ b/packages/Python/lldbsuite/test/test_result.py
@@ -166,14 +166,7 @@ class LLDBTestResult(unittest2.TextTestResult):
configuration.skip_tests, test.id()):
self.hardMarkAsSkipped(test)
- configuration.setCrashInfoHook(
- "%s at %s" %
- (str(test), inspect.getfile(
- test.__class__)))
self.counter += 1
- # if self.counter == 4:
- # import crashinfo
- # crashinfo.testCrashReporterDescription(None)
test.test_number = self.counter
if self.showAll:
self.stream.write(self.fmt % self.counter)
diff --git a/packages/Python/lldbsuite/test/test_runner/process_control.py b/packages/Python/lldbsuite/test/test_runner/process_control.py
index 720f5112a4cd..0b25874c24cf 100644
--- a/packages/Python/lldbsuite/test/test_runner/process_control.py
+++ b/packages/Python/lldbsuite/test/test_runner/process_control.py
@@ -9,7 +9,7 @@ within the LLDB test suite.
This module provides process-management support for the LLDB test
-running infrasructure.
+running infrastructure.
"""
# System imports
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py
deleted file mode 100644
index 4f3562d42de8..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiExit.py
+++ /dev/null
@@ -1,94 +0,0 @@
-"""
-Test that the lldb-mi driver exits properly.
-"""
-
-from __future__ import print_function
-
-import lldbmi_testcase
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class MiExitTestCase(lldbmi_testcase.MiTestCaseBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_exit(self):
- """Test that '-gdb-exit' terminates local debug session and exits."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test -gdb-exit: try to exit and check that program is finished
- self.runCmd("-gdb-exit")
- self.expect("\^exit")
- import pexpect
- self.expect(pexpect.EOF)
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_quit(self):
- """Test that 'quit' exits immediately."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test quit: try to exit and check that program is finished
- self.runCmd("quit")
- import pexpect
- self.expect(pexpect.EOF)
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_q(self):
- """Test that 'q' exits immediately."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test q: try to exit and check that program is finished
- self.runCmd("q")
- import pexpect
- self.expect(pexpect.EOF)
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
index 1eea89f4fff4..b650eb89d812 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiFile.py
@@ -41,9 +41,7 @@ class MiFileTestCase(lldbmi_testcase.MiTestCaseBase):
self.spawnLldbMi(args=None)
# Test that -file-exec-and-symbols works for absolute path
- import os
- path = os.path.join(os.getcwd(), self.myexe)
- self.runCmd("-file-exec-and-symbols \"%s\"" % path)
+ self.runCmd("-file-exec-and-symbols \"%s\"" % self.myexe)
self.expect("\^done")
# Run
@@ -60,7 +58,8 @@ class MiFileTestCase(lldbmi_testcase.MiTestCaseBase):
self.spawnLldbMi(args=None)
# Test that -file-exec-and-symbols works for relative path
- path = "./%s" % self.myexe
+ import os
+ path = os.path.relpath(self.myexe, self.getBuildDir())
self.runCmd("-file-exec-and-symbols %s" % path)
self.expect("\^done")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
deleted file mode 100644
index 6bb7619e60b8..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiGdbSetShow.py
+++ /dev/null
@@ -1,260 +0,0 @@
-"""
-Test lldb-mi -gdb-set and -gdb-show commands.
-"""
-
-from __future__ import print_function
-
-
-import unittest2
-import lldbmi_testcase
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_target_async_default(self):
- """Test that 'lldb-mi --interpreter' switches to async mode by default."""
-
- self.spawnLldbMi(args=None)
-
- # Switch to sync mode
- self.runCmd("-gdb-set target-async off")
- self.expect("\^done")
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"off\"")
-
- # Test that -gdb-set switches to async by default
- self.runCmd("-gdb-set target-async")
- self.expect("\^done")
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"on\"")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @expectedFlakeyLinux("llvm.org/pr26028") # Fails in ~1% of cases
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_target_async_on(self):
- """Test that 'lldb-mi --interpreter' can execute commands in async mode."""
-
- self.spawnLldbMi(args=None)
-
- # Switch to sync mode
- self.runCmd("-gdb-set target-async off")
- self.expect("\^done")
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"off\"")
-
- # Test that -gdb-set can switch to async mode
- self.runCmd("-gdb-set target-async on")
- self.expect("\^done")
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"on\"")
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Test that program is executed in async mode
- self.runCmd("-exec-run")
- self.expect("\*running")
- self.expect("@\"argc=1")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="Failing in ~11/600 dosep runs (build 3120-3122)")
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_target_async_off(self):
- """Test that 'lldb-mi --interpreter' can execute commands in sync mode."""
-
- self.spawnLldbMi(args=None)
-
- # Test that -gdb-set can switch to sync mode
- self.runCmd("-gdb-set target-async off")
- self.expect("\^done")
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"off\"")
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Test that program is executed in async mode
- self.runCmd("-exec-run")
- unexpected = ["\*running"] # "\*running" is async notification
- it = self.expect(unexpected + ["@\"argc=1\\\\r\\\\n"])
- if it < len(unexpected):
- self.fail("unexpected found: %s" % unexpected[it])
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_show_target_async(self):
- """Test that 'lldb-mi --interpreter' in async mode by default."""
-
- self.spawnLldbMi(args=None)
-
- # Test that default target-async value is "on"
- self.runCmd("-gdb-show target-async")
- self.expect("\^done,value=\"on\"")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_show_language(self):
- """Test that 'lldb-mi --interpreter' can get current language."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -gdb-show language gets current language
- self.runCmd("-gdb-show language")
- self.expect("\^done,value=\"c\+\+\"")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @unittest2.expectedFailure("-gdb-set ignores unknown properties")
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_unknown(self):
- """Test that 'lldb-mi --interpreter' fails when setting an unknown property."""
-
- self.spawnLldbMi(args=None)
-
- # Test that -gdb-set fails if property is unknown
- self.runCmd("-gdb-set unknown some_value")
- self.expect("\^error")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @unittest2.expectedFailure("-gdb-show ignores unknown properties")
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_show_unknown(self):
- """Test that 'lldb-mi --interpreter' fails when showing an unknown property."""
-
- self.spawnLldbMi(args=None)
-
- # Test that -gdb-show fails if property is unknown
- self.runCmd("-gdb-show unknown")
- self.expect("\^error")
-
- @expectedFailureAll(
- oslist=["windows"],
- bugnumber="llvm.org/pr22274: need a pexpect replacement for windows")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_ouptut_radix(self):
- """Test that 'lldb-mi --interpreter' works for -gdb-set output-radix."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to BP_printf
- line = line_number('main.cpp', '// BP_printf')
- self.runCmd("-break-insert main.cpp:%d" % line)
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Setup variable
- self.runCmd("-var-create var_a * a")
- self.expect(
- "\^done,name=\"var_a\",numchild=\"0\",value=\"10\",type=\"int\",thread-id=\"1\",has_more=\"0\"")
-
- # Test default output
- self.runCmd("-var-evaluate-expression var_a")
- self.expect("\^done,value=\"10\"")
-
- # Test hex output
- self.runCmd("-gdb-set output-radix 16")
- self.expect("\^done")
- self.runCmd("-var-evaluate-expression var_a")
- self.expect("\^done,value=\"0xa\"")
-
- # Test octal output
- self.runCmd("-gdb-set output-radix 8")
- self.expect("\^done")
- self.runCmd("-var-evaluate-expression var_a")
- self.expect("\^done,value=\"012\"")
-
- # Test decimal output
- self.runCmd("-gdb-set output-radix 10")
- self.expect("\^done")
- self.runCmd("-var-evaluate-expression var_a")
- self.expect("\^done,value=\"10\"")
-
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @expectedFailureAll(
- bugnumber="llvm.org/pr31485: data-disassemble doesn't follow flavor settings")
- def test_lldbmi_gdb_set_disassembly_flavor(self):
- """Test that 'lldb-mi --interpreter' works for -gdb-set disassembly-flavor."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to BP_printf
- line = line_number('main.cpp', '// BP_printf')
- self.runCmd("-break-insert main.cpp:%d" % line)
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\".+addr=\"(0x[0-9a-f]+)\"")
-
- # Get starting and ending address from $pc
- pc = int(self.child.match.group(1), base=16)
- s_addr, e_addr = pc, pc + 1
-
- # Test default output (att)
- self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
- self.expect("movl ")
-
- # Test intel style
- self.runCmd("-gdb-set disassembly-flavor intel")
- self.expect("\^done")
- self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
- self.expect("mov ")
-
- # Test AT&T style
- self.runCmd("-gdb-set disassembly-flavor intel")
- self.expect("\^done")
- self.runCmd("-data-disassemble -s %d -e %d -- 0" % (s_addr, e_addr))
- self.expect("movl ")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
index a597ae1397ad..92b7fdaca662 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/TestMiLibraryLoaded.py
@@ -18,6 +18,7 @@ class MiLibraryLoadedTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_library_loaded(self):
"""Test that 'lldb-mi --interpreter' shows the =library-loaded notifications."""
@@ -29,13 +30,13 @@ class MiLibraryLoadedTestCase(lldbmi_testcase.MiTestCaseBase):
# Test =library-loaded
import os
- path = os.path.join(os.getcwd(), self.myexe)
+ path = self.getBuildArtifact(self.myexe)
symbols_path = os.path.join(
path + ".dSYM",
"Contents",
"Resources",
"DWARF",
- self.myexe)
+ "a.out")
def add_slashes(x): return x.replace(
"\\",
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
index 16f71fe8130c..c8bb89e07f6b 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
@@ -200,7 +200,7 @@ class MiBreakTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\*stopped,reason=\"breakpoint-hit\"")
import os
- path = os.path.join(os.getcwd(), "main.cpp")
+ path = os.path.join(self.getSourceDir(), "main.cpp")
line = line_number('main.cpp', '// BP_return')
self.runCmd("-break-insert %s:%d" % (path, line))
self.expect("\^done,bkpt={number=\"2\"")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py b/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
index 80ceadb6f268..00c52dbe97aa 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/control/TestMiExec.py
@@ -18,29 +18,6 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="llvm.org/pr25000: lldb-mi does not receive broadcasted notification from Core/Process about process stopped")
- def test_lldbmi_exec_run(self):
- """Test that 'lldb-mi --interpreter' can stop at entry."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Test that program is stopped at entry
- self.runCmd("-exec-run --start")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"signal-received\",signal-name=\"SIGSTOP\",signal-meaning=\"Stop\",.*?thread-id=\"1\",stopped-threads=\"all\"")
- # Test that lldb-mi is ready to execute next commands
- self.expect(self.child_prompt, exactly=True)
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_exec_abort(self):
"""Test that 'lldb-mi --interpreter' works for -exec-abort."""
@@ -162,351 +139,3 @@ class MiExecTestCase(lldbmi_testcase.MiTestCaseBase):
# Check argc to see if arg passed
self.runCmd("-data-evaluate-expression argc")
self.expect("\^done,value=\"1\"")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_exec_next(self):
- """Test that 'lldb-mi --interpreter' works for stepping."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Warning: the following is sensitive to the lines in the source
-
- # Test -exec-next
- self.runCmd("-exec-next --thread 1 --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"")
-
- # Test that --thread is optional
- self.runCmd("-exec-next --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"")
-
- # Test that --frame is optional
- self.runCmd("-exec-next --thread 1")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"31\"")
-
- # Test that both --thread and --frame are optional
- self.runCmd("-exec-next")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"32\"")
-
- # Test that an invalid --thread is handled
- self.runCmd("-exec-next --thread 0")
- self.expect("\^error,message=\"error: Thread index 0 is out of range")
- self.runCmd("-exec-next --thread 10")
- self.expect("\^error,message=\"error: Thread index 10 is out of range")
-
- # Test that an invalid --frame is handled
- # FIXME: no error is returned
- self.runCmd("-exec-next --frame 10")
- #self.expect("\^error: Frame index 10 is out of range")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_exec_next_instruction(self):
- """Test that 'lldb-mi --interpreter' works for instruction stepping."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Warning: the following is sensitive to the lines in the
- # source and optimizations
-
- # Test -exec-next-instruction
- self.runCmd("-exec-next-instruction --thread 1 --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"28\"")
-
- # Test that --thread is optional
- self.runCmd("-exec-next-instruction --frame 0")
- self.expect("\^running")
- # Depending on compiler, it can stop at different line
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29)\"")
-
- # Test that --frame is optional
- self.runCmd("-exec-next-instruction --thread 1")
- self.expect("\^running")
- # Depending on compiler, it can stop at different line
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29|30)\"")
-
- # Test that both --thread and --frame are optional
- self.runCmd("-exec-next-instruction")
- self.expect("\^running")
- # Depending on compiler, it can stop at different line
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"(28|29|30|31)\"")
-
- # Test that an invalid --thread is handled
- self.runCmd("-exec-next-instruction --thread 0")
- self.expect("\^error,message=\"error: Thread index 0 is out of range")
- self.runCmd("-exec-next-instruction --thread 10")
- self.expect("\^error,message=\"error: Thread index 10 is out of range")
-
- # Test that an invalid --frame is handled
- # FIXME: no error is returned
- self.runCmd("-exec-next-instruction --frame 10")
- #self.expect("\^error: Frame index 10 is out of range")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_exec_step(self):
- """Test that 'lldb-mi --interpreter' works for stepping into."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Warning: the following is sensitive to the lines in the source
-
- # Test that -exec-step steps into (or not) printf depending on debug info
- # Note that message is different in Darwin and Linux:
- # Darwin: "*stopped,reason=\"end-stepping-range\",frame={addr=\"0x[0-9a-f]+\",func=\"main\",args=[{name=\"argc\",value=\"1\"},{name=\"argv\",value="0x[0-9a-f]+\"}],file=\"main.cpp\",fullname=\".+main.cpp\",line=\"\d\"},thread-id=\"1\",stopped-threads=\"all\"
- # Linux:
- # "*stopped,reason=\"end-stepping-range\",frame={addr="0x[0-9a-f]+\",func=\"__printf\",args=[{name=\"format\",value=\"0x[0-9a-f]+\"}],file=\"printf.c\",fullname=\".+printf.c\",line="\d+"},thread-id=\"1\",stopped-threads=\"all\"
- self.runCmd("-exec-step --thread 1 --frame 0")
- self.expect("\^running")
- it = self.expect(["\*stopped,reason=\"end-stepping-range\".+?func=\"main\"",
- "\*stopped,reason=\"end-stepping-range\".+?func=\"(?!main).+?\""])
- # Exit from printf if needed
- if it == 1:
- self.runCmd("-exec-finish")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
-
- # Test that -exec-step steps into g_MyFunction and back out
- # (and that --thread is optional)
- self.runCmd("-exec-step --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"")
- # Use -exec-finish here to make sure that control reaches the caller.
- # -exec-step can keep us in the g_MyFunction for gcc
- self.runCmd("-exec-finish --frame 0")
- self.expect("\^running")
- it = self.expect(["\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"",
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\""])
-
- if it == 1:
- # Call to s_MyFunction may not follow immediately after g_MyFunction.
- # There might be some instructions in between to restore caller-saved registers.
- # We need to get past these instructions with a next to reach call to s_MyFunction.
- self.runCmd("-exec-next --thread 1")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"30\"")
-
- # Test that -exec-step steps into s_MyFunction
- # (and that --frame is optional)
- self.runCmd("-exec-step --thread 1")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"")
-
- # Test that -exec-step steps into g_MyFunction from inside
- # s_MyFunction (and that both --thread and --frame are optional)
- self.runCmd("-exec-step")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"")
-
- # Test that an invalid --thread is handled
- self.runCmd("-exec-step --thread 0")
- self.expect("\^error,message=\"error: Thread index 0 is out of range")
- self.runCmd("-exec-step --thread 10")
- self.expect("\^error,message=\"error: Thread index 10 is out of range")
-
- # Test that an invalid --frame is handled
- # FIXME: no error is returned
- self.runCmd("-exec-step --frame 10")
- #self.expect("\^error: Frame index 10 is out of range")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_exec_step_instruction(self):
- """Test that 'lldb-mi --interpreter' works for instruction stepping into."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Warning: the following is sensitive to the lines in the
- # source and optimizations
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -exec-next steps over printf
- self.runCmd("-exec-next --thread 1 --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?main\.cpp\",line=\"29\"")
-
- # Test that -exec-step-instruction steps over non branching
- # instruction
- self.runCmd("-exec-step-instruction --thread 1 --frame 0")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"end-stepping-range\".+?main\.cpp\"")
-
- # Test that -exec-step-instruction steps into g_MyFunction
- # instruction (and that --thread is optional)
-
- # In case of MIPS, there might be more than one instruction
- # before actual call instruction (like load, move and call instructions).
- # The -exec-step-instruction would step one assembly instruction.
- # Thus we may not enter into g_MyFunction function. The -exec-step would definitely
- # step into the function.
-
- if self.isMIPS():
- self.runCmd("-exec-step --frame 0")
- else:
- self.runCmd("-exec-step-instruction --frame 0")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"")
-
- # Test that -exec-step-instruction steps over non branching
- # (and that --frame is optional)
- self.runCmd("-exec-step-instruction --thread 1")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"")
-
- # Test that -exec-step-instruction steps into g_MyFunction
- # (and that both --thread and --frame are optional)
- self.runCmd("-exec-step-instruction")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\"g_MyFunction.*?\"")
-
- # Test that an invalid --thread is handled
- self.runCmd("-exec-step-instruction --thread 0")
- self.expect("\^error,message=\"error: Thread index 0 is out of range")
- self.runCmd("-exec-step-instruction --thread 10")
- self.expect("\^error,message=\"error: Thread index 10 is out of range")
-
- # Test that an invalid --frame is handled
- # FIXME: no error is returned
- self.runCmd("-exec-step-instruction --frame 10")
- #self.expect("\^error: Frame index 10 is out of range")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_exec_finish(self):
- """Test that 'lldb-mi --interpreter' works for -exec-finish."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Set BP at g_MyFunction and run to BP
- self.runCmd("-break-insert -f g_MyFunction")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -exec-finish returns from g_MyFunction
- self.runCmd("-exec-finish --thread 1 --frame 0")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
-
- # Run to BP inside s_MyFunction call
- self.runCmd("-break-insert s_MyFunction")
- self.expect("\^done,bkpt={number=\"2\"")
- self.runCmd("-exec-continue")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -exec-finish hits BP at g_MyFunction call inside
- # s_MyFunction (and that --thread is optional)
- self.runCmd("-exec-finish --frame 0")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -exec-finish returns from g_MyFunction call inside
- # s_MyFunction (and that --frame is optional)
- self.runCmd("-exec-finish --thread 1")
- self.expect("\^running")
- self.expect(
- "\*stopped,reason=\"end-stepping-range\".+?func=\".*?s_MyFunction.*?\"")
-
- # Test that -exec-finish returns from s_MyFunction
- # (and that both --thread and --frame are optional)
- self.runCmd("-exec-finish")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
-
- # Test that an invalid --thread is handled
- self.runCmd("-exec-finish --thread 0")
- self.expect("\^error,message=\"error: Thread index 0 is out of range")
- self.runCmd("-exec-finish --thread 10")
- self.expect("\^error,message=\"error: Thread index 10 is out of range")
-
- # Test that an invalid --frame is handled
- # FIXME: no error is returned
- #self.runCmd("-exec-finish --frame 10")
- #self.expect("\^error: Frame index 10 is out of range")
-
- # Set BP at printf and run to BP
- self.runCmd("-break-insert -f printf")
- self.expect("\^done,bkpt={number=\"3\"")
- self.runCmd("-exec-continue")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that -exec-finish returns from printf
- self.runCmd("-exec-finish --thread 1 --frame 0")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"end-stepping-range\".+?func=\"main\"")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py b/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
index f3a277246862..5e6b3f20dde7 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/data/TestMiData.py
@@ -18,6 +18,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_disassemble(self):
"""Test that 'lldb-mi --interpreter' works for -data-disassemble."""
@@ -79,8 +80,8 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
# To match the escaped characters in the ouptut, we must use four backslashes per matches backslash
# See https://docs.python.org/2/howto/regex.html#the-backslash-plague
- # The MIPS disassembler never prints stub name
- if self.isMIPS():
+ # The MIPS and PPC64le disassemblers never print stub name
+ if self.isMIPS() or self.isPPC64le():
self.expect(["{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?; \\\\\"Hello, World!\\\\\\\\n\\\\\"\"}",
"{address=\"0x[0-9a-f]+\",func-name=\"hello_world\(\)\",offset=\"[0-9]+\",size=\"[0-9]+\",inst=\".+?\"}"])
else:
@@ -89,6 +90,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_read_memory_bytes_global(self):
"""Test that -data-read-memory-bytes can access global buffers."""
@@ -132,6 +134,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_read_memory_bytes_local(self):
"""Test that -data-read-memory-bytes can access local buffers."""
@@ -272,6 +275,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_list_register_names(self):
"""Test that 'lldb-mi --interpreter' works for -data-list-register-names."""
@@ -299,6 +303,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_list_register_values(self):
"""Test that 'lldb-mi --interpreter' works for -data-list-register-values."""
@@ -328,61 +333,7 @@ class MiDataTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- def test_lldbmi_data_info_line(self):
- """Test that 'lldb-mi --interpreter' works for -data-info-line."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Get the address of main and its line
- self.runCmd("-data-evaluate-expression main")
- self.expect(
- "\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"")
- addr = int(self.child.after.split("\"")[1].split(" ")[0], 16)
- line = line_number('main.cpp', '// FUNC_main')
-
- # Test that -data-info-line works for address
- self.runCmd("-data-info-line *%#x" % addr)
- self.expect(
- "\^done,start=\"0x0*%x\",end=\"0x[0-9a-f]+\",file=\".+?main.cpp\",line=\"%d\"" %
- (addr, line))
-
- # Test that -data-info-line works for file:line
- self.runCmd("-data-info-line main.cpp:%d" % line)
- self.expect(
- "\^done,start=\"0x0*%x\",end=\"0x[0-9a-f]+\",file=\".+?main.cpp\",line=\"%d\"" %
- (addr, line))
-
- # Test that -data-info-line fails when invalid address is specified
- self.runCmd("-data-info-line *0x0")
- self.expect(
- "\^error,msg=\"Command 'data-info-line'\. Error: The LineEntry is absent or has an unknown format\.\"")
-
- # Test that -data-info-line fails when file is unknown
- self.runCmd("-data-info-line unknown_file:1")
- self.expect(
- "\^error,msg=\"Command 'data-info-line'\. Error: The LineEntry is absent or has an unknown format\.\"")
-
- # Test that -data-info-line fails when line has invalid format
- self.runCmd("-data-info-line main.cpp:bad_line")
- self.expect(
- "\^error,msg=\"error: invalid line number string 'bad_line'")
- self.runCmd("-data-info-line main.cpp:0")
- self.expect("\^error,msg=\"error: zero is an invalid line number")
-
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
def test_lldbmi_data_evaluate_expression(self):
"""Test that 'lldb-mi --interpreter' works for -data-evaluate-expression."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
index 7a28f297a1c8..21c08ab74f17 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiCliSupport.py
@@ -34,6 +34,26 @@ class MiCliSupportTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")
+ @skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows.
+ @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races.
+ def test_lldbmi_target_list(self):
+ """Test that 'lldb-mi --interpreter' can list targets by 'target list' command."""
+
+ self.spawnLldbMi(args=None)
+
+ # Test that initially there are no targets.
+ self.runCmd("target list")
+ self.expect(r"~\"No targets.\\n\"")
+ self.expect("\^done")
+
+ # Add target.
+ self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+
+ # Test that "target list" lists added target.
+ self.runCmd("target list")
+ self.expect(r"~\"Current targets:\\n\* target #0: %s" % self.myexe)
+
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
index 2f207928db7d..ccd7eba8bfe3 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
@@ -36,6 +36,25 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\^running")
self.expect("\*stopped,reason=\"breakpoint-hit\"")
+ @skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows.
+ @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races.
+ def test_lldbmi_target_list(self):
+ """Test that 'lldb-mi --interpreter' can list targets by 'target list' command."""
+
+ self.spawnLldbMi(args=None)
+
+ # Test that initially there are no targets.
+ self.runCmd("-interpreter-exec console \"target list\"")
+ self.expect(r"~\"No targets.\\n\"")
+
+ # Add target.
+ self.runCmd("-file-exec-and-symbols %s" % self.myexe)
+
+ # Test that "target list" lists added target.
+ self.runCmd("-interpreter-exec console \"target list\"")
+ self.expect(r"~\"Current targets:\\n\* target #0: %s" % self.myexe)
+
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
@@ -95,53 +114,6 @@ class MiInterpreterExecTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="Failing in ~9/600 dosep runs (build 3120-3122)")
- @skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_settings_set_target_run_args_after(self):
- """Test that 'lldb-mi --interpreter' can set target arguments by 'setting set target.run-args' command after than target was created."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Test that "settings set target.run-args" passes arguments to executable
- # FIXME: --arg1 causes an error
- self.runCmd(
- "-interpreter-exec console \"setting set target.run-args arg1 \\\"2nd arg\\\" third_arg fourth=\\\"4th arg\\\"\"")
- self.expect("\^done")
-
- # Run to BP_printf
- line = line_number('main.cpp', '// BP_printf')
- self.runCmd("-break-insert main.cpp:%d" % line)
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Run to BP_return
- line = line_number('main.cpp', '// BP_return')
- self.runCmd("-break-insert main.cpp:%d" % line)
- self.expect("\^done,bkpt={number=\"2\"")
- self.runCmd("-exec-continue")
- self.expect("\^running")
-
- # Test that arguments were passed properly
- self.expect("@\"argc=5\\\\r\\\\n\"")
- self.expect("@\"argv.0.=.*lldb-mi")
- self.expect("@\"argv.1.=arg1\\\\r\\\\n\"")
- self.expect("@\"argv.2.=2nd arg\\\\r\\\\n\"")
- self.expect("@\"argv.3.=third_arg\\\\r\\\\n\"")
- self.expect("@\"argv.4.=fourth=4th arg\\\\r\\\\n\"")
-
- # Hit BP_return
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_process_launch(self):
"""Test that 'lldb-mi --interpreter' can launch process by "process launch" command."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py b/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
index 2226395dcf2e..7b6ee55b250e 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/lldbmi_testcase.py
@@ -11,18 +11,25 @@ from lldbsuite.test.lldbtest import *
class MiTestCaseBase(Base):
mydir = None
- myexe = "a.out"
- mylog = "child.log"
+ myexe = None
+ mylog = None
+ NO_DEBUG_INFO_TESTCASE = True
@classmethod
def classCleanup(cls):
- TestBase.RemoveTempFile(cls.myexe)
- TestBase.RemoveTempFile(cls.mylog)
+ if cls.myexe:
+ TestBase.RemoveTempFile(cls.myexe)
+ if cls.mylog:
+ TestBase.RemoveTempFile(cls.mylog)
def setUp(self):
+ if not self.mydir:
+ raise("mydir is empty")
+
Base.setUp(self)
self.buildDefault()
self.child_prompt = "(gdb)"
+ self.myexe = self.getBuildArtifact("a.out")
def tearDown(self):
if self.TraceOn():
@@ -36,8 +43,9 @@ class MiTestCaseBase(Base):
def spawnLldbMi(self, args=None):
import pexpect
self.child = pexpect.spawn("%s --interpreter %s" % (
- self.lldbMiExec, args if args else ""))
+ self.lldbMiExec, args if args else ""), cwd=self.getBuildDir())
self.child.setecho(True)
+ self.mylog = self.getBuildArtifact("child.log")
self.child.logfile_read = open(self.mylog, "w")
# wait until lldb-mi has started up and is ready to go
self.expect(self.child_prompt, exactly=True)
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py b/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
index cea5e6f96e9c..13800de634f1 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/signal/TestMiSignal.py
@@ -89,7 +89,7 @@ class MiSignalTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("\*stopped,reason=\"breakpoint-hit\"")
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipUnlessDarwin
+ @skipIfDarwin # pexpect is known to be unreliable on Darwin
@skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_stopped_when_stopatentry_remote(self):
"""Test that 'lldb-mi --interpreter' notifies after it was stopped on entry (remote)."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
index 80b925993d31..7c225ab87a3c 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
@@ -9,6 +9,7 @@ from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
+import os
class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@@ -17,6 +18,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_executable_option_file(self):
"""Test that 'lldb-mi --interpreter %s' loads executable file."""
@@ -43,6 +45,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_executable_option_unknown_file(self):
"""Test that 'lldb-mi --interpreter %s' fails on unknown executable file."""
@@ -63,18 +66,16 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_executable_option_absolute_path(self):
"""Test that 'lldb-mi --interpreter %s' loads executable which is specified via absolute path."""
# Prepare path to executable
- import os
- path = os.path.join(os.getcwd(), self.myexe)
-
- self.spawnLldbMi(args="%s" % path)
+ self.spawnLldbMi(args="%s" % self.myexe)
# Test that the executable is loaded when file was specified using
# absolute path
- self.expect("-file-exec-and-symbols \"%s\"" % path)
+ self.expect("-file-exec-and-symbols \"%s\"" % self.myexe)
self.expect("\^done")
# Test that lldb-mi is ready when executable was loaded
@@ -88,12 +89,12 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_executable_option_relative_path(self):
"""Test that 'lldb-mi --interpreter %s' loads executable which is specified via relative path."""
# Prepare path to executable
- path = "./%s" % self.myexe
-
+ path = os.path.relpath(self.myexe, self.getBuildDir())
self.spawnLldbMi(args="%s" % path)
# Test that the executable is loaded when file was specified using
@@ -111,11 +112,12 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_executable_option_unknown_path(self):
"""Test that 'lldb-mi --interpreter %s' fails on executable file which is specified via unknown path."""
# Prepare path to executable
- path = "unknown_dir/%s" % self.myexe
+ path = "unknown_dir" + self.myexe
self.spawnLldbMi(args="%s" % path)
@@ -129,16 +131,25 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that lldb-mi is ready when executable was loaded
self.expect(self.child_prompt, exactly=True)
+ def copyScript(self, sourceFile):
+ """copy the script to builddir and replace a.out with the full path"""
+ destFile = os.path.join(os.path.dirname(self.myexe),
+ sourceFile+'.script')
+ with open(sourceFile, 'r') as src:
+ with open(destFile, 'w+') as dest:
+ dest.write(src.read().replace("a.out", self.myexe))
+ return destFile
+
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
+ @skipIfDarwin
def test_lldbmi_source_option_start_script(self):
"""Test that 'lldb-mi --interpreter' can execute user's commands after initial commands were executed."""
# Prepared source file
- sourceFile = "start_script"
-
+ sourceFile = self.copyScript("start_script")
self.spawnLldbMi(args="--source %s" % sourceFile)
# After '-file-exec-and-symbols a.out'
@@ -171,17 +182,18 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
self.runCmd("-data-evaluate-expression a")
self.expect("\^done,value=\"10\"")
self.expect(self.child_prompt, exactly=True)
+ os.unlink(sourceFile)
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
+ @skipIfDarwin
def test_lldbmi_source_option_start_script_exit(self):
"""Test that 'lldb-mi --interpreter' can execute a prepared file which passed via --source option."""
# Prepared source file
- sourceFile = "start_script_exit"
-
+ sourceFile = self.copyScript("start_script_exit")
self.spawnLldbMi(args="--source %s" % sourceFile)
# After '-file-exec-and-symbols a.out'
@@ -215,15 +227,16 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
self.expect("-gdb-exit")
self.expect("\^exit")
self.expect("\*stopped,reason=\"exited-normally\"")
+ os.unlink(sourceFile)
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_source_option_start_script_error(self):
"""Test that 'lldb-mi --interpreter' stops execution of initial commands in case of error."""
# Prepared source file
- sourceFile = "start_script_error"
-
+ sourceFile = self.copyScript("start_script_error")
self.spawnLldbMi(args="--source %s" % sourceFile)
# After '-file-exec-and-symbols a.out'
@@ -236,14 +249,16 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
# Test that lldb-mi is ready after execution of --source start_script
self.expect(self.child_prompt, exactly=True)
+ os.unlink(sourceFile)
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_log_option(self):
"""Test that 'lldb-mi --log' creates a log file in the current directory."""
- logDirectory = "."
+ logDirectory = self.getBuildDir()
self.spawnLldbMi(args="%s --log" % self.myexe)
# Test that the executable is loaded when file was specified
@@ -273,6 +288,7 @@ class MiStartupOptionsTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfRemote # We do not currently support remote debugging via the MI.
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
def test_lldbmi_log_directory_option(self):
"""Test that 'lldb-mi --log --log-dir' creates a log file in the directory specified by --log-dir."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/Makefile b/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/Makefile
deleted file mode 100644
index dde38f4e486c..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-LEVEL = ../../../make
-
-CXX_SOURCES := main.cpp symbol_list_lines_inline_test.cpp symbol_list_lines_inline_test2.cpp
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py b/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
deleted file mode 100644
index 6ac9bf813563..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/TestMiSymbol.py
+++ /dev/null
@@ -1,104 +0,0 @@
-"""
-Test lldb-mi -symbol-xxx commands.
-"""
-
-from __future__ import print_function
-
-
-import lldbmi_testcase
-from lldbsuite.test.decorators import *
-from lldbsuite.test.lldbtest import *
-from lldbsuite.test import lldbutil
-
-
-class MiSymbolTestCase(lldbmi_testcase.MiTestCaseBase):
-
- mydir = TestBase.compute_mydir(__file__)
-
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="new failure after r256863")
- def test_lldbmi_symbol_list_lines_file(self):
- """Test that 'lldb-mi --interpreter' works for -symbol-list-lines when file exists."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to main
- self.runCmd("-break-insert -f main")
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Get address of main and its line
- self.runCmd("-data-evaluate-expression main")
- self.expect(
- "\^done,value=\"0x[0-9a-f]+ \(a.out`main at main.cpp:[0-9]+\)\"")
- addr = int(self.child.after.split("\"")[1].split(" ")[0], 16)
- line = line_number('main.cpp', '// FUNC_main')
-
- # Test that -symbol-list-lines works on valid data
- self.runCmd("-symbol-list-lines main.cpp")
- self.expect(
- "\^done,lines=\[\{pc=\"0x0*%x\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d+\"\})+\]" %
- (addr, line))
-
- # Test that -symbol-list-lines doesn't include lines from other sources
- # by checking the first and last line, and making sure the other lines
- # are between 30 and 39.
- sline = line_number(
- 'symbol_list_lines_inline_test2.cpp',
- '// FUNC_gfunc2')
- eline = line_number(
- 'symbol_list_lines_inline_test2.cpp',
- '// END_gfunc2')
- self.runCmd("-symbol-list-lines symbol_list_lines_inline_test2.cpp")
- self.expect(
- "\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*\]" %
- (sline, eline))
- # FIXME: This doesn't work for symbol_list_lines_inline_test.cpp due to clang bug llvm.org/pr24716 (fixed in newer versions of clang)
- ##sline = line_number('symbol_list_lines_inline_test.cpp', '// FUNC_gfunc')
- ##eline = line_number('symbol_list_lines_inline_test.cpp', '// STRUCT_s')
- ##self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.cpp")
- ##self.expect("\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"3\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}\]" % (sline, eline))
-
- # Test that -symbol-list-lines works on header files by checking the first
- # and last line, and making sure the other lines are under 29.
- sline = line_number('symbol_list_lines_inline_test.h', '// FUNC_ifunc')
- eline = line_number('symbol_list_lines_inline_test.h', '// FUNC_mfunc')
- self.runCmd("-symbol-list-lines symbol_list_lines_inline_test.h")
- self.expect(
- "\^done,lines=\[\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d\"\})*(,\{pc=\"0x[0-9a-f]+\",line=\"1\d\"\})*,\{pc=\"0x[0-9a-f]+\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"2\d\"\})*\]" %
- (sline, eline))
-
- # Test that -symbol-list-lines fails when file doesn't exist
- self.runCmd("-symbol-list-lines unknown_file")
- self.expect(
- "\^error,message=\"error: No source filenames matched 'unknown_file'\. \"")
-
- # Test that -symbol-list-lines fails when file is specified using
- # relative path
- self.runCmd("-symbol-list-lines ./main.cpp")
- self.expect(
- "\^error,message=\"error: No source filenames matched '\./main\.cpp'\. \"")
-
- # Test that -symbol-list-lines works when file is specified using
- # absolute path
- import os
- path = os.path.join(os.getcwd(), "main.cpp")
- self.runCmd("-symbol-list-lines \"%s\"" % path)
- self.expect(
- "\^done,lines=\[\{pc=\"0x0*%x\",line=\"%d\"\}(,\{pc=\"0x[0-9a-f]+\",line=\"\d+\"\})+\]" %
- (addr, line))
-
- # Test that -symbol-list-lines fails when file doesn't exist
- self.runCmd("-symbol-list-lines unknown_dir/main.cpp")
- self.expect(
- "\^error,message=\"error: No source filenames matched 'unknown_dir/main\.cpp'\. \"")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp b/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
deleted file mode 100644
index c432ba8c477c..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-// Skip lines so we can make sure we're not seeing any lines from
-// symbol_list_lines_inline_test.h included in -symbol-list-lines
-// symbol_list_lines_inline_test.cpp, by checking that all the lines
-// are between 30 and 39.
-// line 5
-// line 6
-// line 7
-// line 8
-// line 9
-// line 10
-// line 11
-// line 12
-// line 13
-// line 14
-// line 15
-// line 16
-// line 17
-// line 18
-// line 19
-// line 20
-// line 21
-// line 22
-// line 23
-// line 24
-// line 25
-// line 26
-// line 27
-// line 28
-// line 29
-#include "symbol_list_lines_inline_test.h"
-int
-gfunc(int i)
-{ // FUNC_gfunc
- return ns::ifunc(i);
-}
-namespace ns
-{
-S s; // STRUCT_s
-}
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h b/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
deleted file mode 100644
index 4b986dc69321..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
+++ /dev/null
@@ -1,24 +0,0 @@
-namespace ns
-{
-inline int
-ifunc(int i)
-{ // FUNC_ifunc
- return i;
-}
-struct S
-{
- int a;
- int b;
- S()
- : a(3)
- , b(4)
- {
- }
- int
- mfunc()
- { // FUNC_mfunc
- return a + b;
- }
-};
-extern S s;
-}
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp b/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp
deleted file mode 100644
index cfedf47ad6b1..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test2.cpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Skip lines so we can make sure we're not seeing any lines from
-// symbol_list_lines_inline_test.h included in -symbol-list-lines
-// symbol_list_lines_inline_test2.cpp, by checking that all the lines
-// are between 30 and 39.
-// line 5
-// line 6
-// line 7
-// line 8
-// line 9
-// line 10
-// line 11
-// line 12
-// line 13
-// line 14
-// line 15
-// line 16
-// line 17
-// line 18
-// line 19
-// line 20
-// line 21
-// line 22
-// line 23
-// line 24
-// line 25
-// line 26
-// line 27
-// line 28
-// line 29
-#include "symbol_list_lines_inline_test.h"
-int j = 2;
-int
-gfunc2(int i)
-{ // FUNC_gfunc2
- i += ns::s.mfunc();
- i += ns::ifunc(i);
- return i == 0; // END_gfunc2
-}
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py b/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
index 93f599317c6c..50a94b53a18b 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/syntax/TestMiSyntax.py
@@ -19,6 +19,7 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_tokens(self):
"""Test that 'lldb-mi --interpreter' prints command tokens."""
@@ -43,11 +44,12 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_specialchars(self):
"""Test that 'lldb-mi --interpreter' handles complicated strings."""
# Create an alias for myexe
- complicated_myexe = "C--mpl-x file's`s @#$%^&*()_+-={}[]| name"
+ complicated_myexe = self.getBuildArtifact("C--mpl-x file's`s @#$%^&*()_+-={}[]| name")
os.symlink(self.myexe, complicated_myexe)
self.addTearDownHook(lambda: os.unlink(complicated_myexe))
@@ -68,31 +70,8 @@ class MiSyntaxTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
+ @skipIfDarwin
@skipIfRemote # We do not currently support remote debugging via the MI.
- @expectedFailureAll(
- oslist=["linux"],
- bugnumber="Failing in ~6/600 dosep runs (build 3120-3122)")
- def test_lldbmi_process_output(self):
- """Test that 'lldb-mi --interpreter' wraps process output correctly."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run
- self.runCmd("-exec-run")
- self.expect("\^running")
-
- # Test that a process output is wrapped correctly
- self.expect("\@\"'\\\\r\\\\n\"")
- self.expect("\@\"` - it's \\\\\\\\n\\\\x12\\\\\"\\\\\\\\\\\\\"")
-
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
- @expectedFailureAll(oslist=["macosx"], bugnumber="rdar://28805064")
def test_lldbmi_output_grammar(self):
"""Test that 'lldb-mi --interpreter' uses standard output syntax."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py b/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
index 137408a2bd2b..db6f9b2a820a 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/target/TestMiTarget.py
@@ -18,6 +18,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # cannot attach to process on linux
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_target_attach_wait_for(self):
"""Test that 'lldb-mi --interpreter' works for -target-attach -n <name> --waitfor."""
@@ -32,7 +33,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
# Load executable
# FIXME: -file-exec-and-sybmols is not required for target attach, but
# the test will not pass without this
- self.runCmd("-file-exec-and-symbols %s" % exeName)
+ self.runCmd("-file-exec-and-symbols %s" % self.getBuildArtifact(exeName))
self.expect("\^done")
# Set up attach
@@ -40,7 +41,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
time.sleep(4) # Give attach time to setup
# Start target process
- self.spawnSubprocess(os.path.join(os.path.dirname(__file__), exeName))
+ self.spawnSubprocess(self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.expect("\^done")
@@ -61,6 +62,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # cannot attach to process on linux
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_target_attach_name(self):
"""Test that 'lldb-mi --interpreter' works for -target-attach -n <name>."""
@@ -71,8 +73,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
self.addTearDownCleanup(dictionary=d)
# Start target process
- targetProcess = self.spawnSubprocess(
- os.path.join(os.path.dirname(__file__), exeName))
+ targetProcess = self.spawnSubprocess(self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.spawnLldbMi(args=None)
@@ -98,6 +99,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # cannot attach to process on linux
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_target_attach_pid(self):
"""Test that 'lldb-mi --interpreter' works for -target-attach <pid>."""
@@ -109,7 +111,7 @@ class MiTargetTestCase(lldbmi_testcase.MiTestCaseBase):
# Start target process
targetProcess = self.spawnSubprocess(
- os.path.join(os.path.dirname(__file__), exeName))
+ self.getBuildArtifact(exeName))
self.addTearDownHook(self.cleanupSubprocesses)
self.spawnLldbMi(args=None)
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py b/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
index 4384c79fc845..cf1da5bae9ce 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiGdbSetShowPrint.py
@@ -175,81 +175,6 @@ class MiGdbSetShowTestCase(lldbmi_testcase.MiTestCaseBase):
@expectedFailureAll(compiler="gcc", bugnumber="llvm.org/pr23357")
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
- def test_lldbmi_gdb_set_show_print_expand_aggregates(self):
- """Test that 'lldb-mi --interpreter' can expand aggregates everywhere."""
-
- self.spawnLldbMi(args=None)
-
- # Load executable
- self.runCmd("-file-exec-and-symbols %s" % self.myexe)
- self.expect("\^done")
-
- # Run to BP_gdb_set_show_print_expand_aggregates
- line = line_number(
- 'main.cpp',
- '// BP_gdb_set_show_print_expand_aggregates')
- self.runCmd("-break-insert main.cpp:%d" % line)
- self.expect("\^done,bkpt={number=\"1\"")
- self.runCmd("-exec-run")
- self.expect("\^running")
- self.expect("\*stopped,reason=\"breakpoint-hit\"")
-
- # Test that default print expand-aggregates value is "off"
- self.runCmd("-gdb-show print expand-aggregates")
- self.expect("\^done,value=\"off\"")
-
- # Test that composite type isn't expanded when print expand-aggregates
- # is "off"
- self.runCmd("-var-create var1 * complx")
- self.expect(
- "\^done,name=\"var1\",numchild=\"3\",value=\"{\.\.\.}\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"")
-
- # Test that composite type[] isn't expanded when print
- # expand-aggregates is "off"
- self.eval_and_check_array("complx_array", "complex_type", 2)
-
- # Test that a struct with a char first element is not formatted as a
- # string
- self.runCmd("-var-create - * &nstr")
- self.expect(
- "\^done,name=\"var\d+\",numchild=\"2\",value=\"0x[0-9a-f]+\",type=\"not_str \*\",thread-id=\"1\",has_more=\"0\"")
-
- # Test that -gdb-set can set print expand-aggregates flag
- self.runCmd("-gdb-set print expand-aggregates on")
- self.expect("\^done")
- self.runCmd("-gdb-set print expand-aggregates 1")
- self.expect("\^done")
- self.runCmd("-gdb-show print expand-aggregates")
- self.expect("\^done,value=\"on\"")
-
- # Test that composite type is expanded when print expand-aggregates is
- # "on"
- self.runCmd("-var-create var3 * complx")
- self.expect(
- "\^done,name=\"var3\",numchild=\"3\",value=\"{i = 3, inner = {l = 3}, complex_ptr = 0x[0-9a-f]+}\",type=\"complex_type\",thread-id=\"1\",has_more=\"0\"")
-
- # Test that composite type[] is expanded when print expand-aggregates
- # is "on"
- self.runCmd("-var-create var4 * complx_array")
- self.expect(
- "\^done,name=\"var4\",numchild=\"2\",value=\"{\[0\] = {i = 4, inner = {l = 4}, complex_ptr = 0x[0-9a-f]+}, \[1\] = {i = 5, inner = {l = 5}, complex_ptr = 0x[0-9a-f]+}}\",type=\"complex_type \[2\]\",thread-id=\"1\",has_more=\"0\"")
-
- # Test that -gdb-set print expand-aggregates fails if "on"/"off" isn't
- # specified
- self.runCmd("-gdb-set print expand-aggregates")
- self.expect(
- "\^error,msg=\"The request ''print' expects option-name and \"on\" or \"off\"' failed.\"")
-
- # Test that -gdb-set print expand-aggregates fails when option is
- # unknown
- self.runCmd("-gdb-set print expand-aggregates unknown")
- self.expect(
- "\^error,msg=\"The request ''print' expects option-name and \"on\" or \"off\"' failed.\"")
-
- @skipIfWindows # llvm.org/pr24452: Get lldb-mi working on Windows
- @expectedFailureAll(compiler="gcc", bugnumber="llvm.org/pr23357")
- @skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
- @skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_gdb_set_show_print_aggregate_field_names(self):
"""Test that 'lldb-mi --interpreter' can expand aggregates everywhere."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py b/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
index 6155858cf112..5ef7d11b8ac0 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-mi/variable/TestMiVar.py
@@ -18,6 +18,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_eval(self):
"""Test that 'lldb-mi --interpreter' works for evaluating."""
@@ -159,7 +160,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
- @skipIfDarwin # rdar://33462982
+ @skipIfDarwin
@skipIfRemote # We do not currently support remote debugging via the MI.
def test_lldbmi_var_update(self):
"""Test that 'lldb-mi --interpreter' works for -var-update."""
@@ -231,6 +232,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfWindows # llvm.org/pr24452: Get lldb-mi tests working on Windows
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_var_create_register(self):
"""Test that 'lldb-mi --interpreter' works for -var-create $regname."""
@@ -275,6 +277,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_var_list_children(self):
"""Test that 'lldb-mi --interpreter' works for -var-list-children."""
@@ -395,6 +398,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_var_create_for_stl_types(self):
"""Test that 'lldb-mi --interpreter' print summary for STL types."""
@@ -421,6 +425,7 @@ class MiVarTestCase(lldbmi_testcase.MiTestCaseBase):
@skipIfFreeBSD # llvm.org/pr22411: Failure presumably due to known thread races
@skipIfLinux # llvm.org/pr22841: lldb-mi tests fail on all Linux buildbots
@skipIfRemote # We do not currently support remote debugging via the MI.
+ @skipIfDarwin
def test_lldbmi_var_create_for_unnamed_objects(self):
"""Test that 'lldb-mi --interpreter' can expand unnamed structures and unions."""
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py
new file mode 100644
index 000000000000..8c8fed8e44e0
--- /dev/null
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestAppleSimulatorOSType.py
@@ -0,0 +1,112 @@
+from __future__ import print_function
+
+
+import gdbremote_testcase
+import lldbgdbserverutils
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+import json
+
+class TestAppleSimulatorOSType(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def check_simulator_ostype(self, sdk, platform, arch='x86_64'):
+ sim_devices_str = subprocess.check_output(['xcrun', 'simctl', 'list',
+ '-j', 'devices'])
+ sim_devices = json.loads(sim_devices_str)['devices']
+ # Find an available simulator for the requested platform
+ deviceUDID = None
+ for (runtime,devices) in sim_devices.items():
+ if not platform in runtime.lower():
+ continue
+ for device in devices:
+ if device['availability'] != '(available)':
+ continue
+ deviceUDID = device['udid']
+ break
+ if deviceUDID != None:
+ break
+
+ # Launch the process using simctl
+ self.assertIsNotNone(deviceUDID)
+ exe_name = 'test_simulator_platform_{}'.format(platform)
+ sdkroot = subprocess.check_output(['xcrun', '--show-sdk-path', '--sdk',
+ sdk])
+ self.build(dictionary={ 'EXE': exe_name, 'SDKROOT': sdkroot.strip(),
+ 'ARCH': arch })
+ exe_path = self.getBuildArtifact(exe_name)
+ sim_launcher = subprocess.Popen(['xcrun', 'simctl', 'spawn',
+ deviceUDID, exe_path,
+ 'print-pid', 'sleep:10'],
+ stderr=subprocess.PIPE)
+ # Get the PID from the process output
+ pid = None
+ while not pid:
+ stderr = sim_launcher.stderr.readline()
+ if stderr == '':
+ continue
+ m = re.match(r"PID: (.*)", stderr)
+ self.assertIsNotNone(m)
+ pid = int(m.group(1))
+
+ # Launch debug monitor attaching to the simulated process
+ self.init_debugserver_test()
+ server = self.connect_to_debug_monitor(attach_pid=pid)
+
+ # Setup packet sequences
+ self.add_no_ack_remote_stream()
+ self.add_process_info_collection_packets()
+ self.test_sequence.add_log_lines(
+ ["read packet: " +
+ "$jGetLoadedDynamicLibrariesInfos:{\"fetch_all_solibs\" : true}]#ce",
+ {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$",
+ "capture": {1: "dylib_info_raw"}}],
+ True)
+
+ # Run the stream
+ context = self.expect_gdbremote_sequence()
+ self.assertIsNotNone(context)
+
+ # Gather process info response
+ process_info = self.parse_process_info_response(context)
+ self.assertIsNotNone(process_info)
+
+ # Check that ostype is correct
+ self.assertEquals(process_info['ostype'], platform)
+
+ # Now for dylibs
+ dylib_info_raw = context.get("dylib_info_raw")
+ dylib_info = json.loads(self.decode_gdbremote_binary(dylib_info_raw))
+ images = dylib_info['images']
+
+ image_info = None
+ for image in images:
+ if image['pathname'] != exe_path:
+ continue
+ image_info = image
+ break
+
+ self.assertIsNotNone(image_info)
+ self.assertEquals(image['min_version_os_name'], platform)
+
+
+ @apple_simulator_test('iphone')
+ @debugserver_test
+ def test_simulator_ostype_ios(self):
+ self.check_simulator_ostype(sdk='iphonesimulator',
+ platform='ios')
+
+ @apple_simulator_test('appletv')
+ @debugserver_test
+ def test_simulator_ostype_tvos(self):
+ self.check_simulator_ostype(sdk='appletvsimulator',
+ platform='tvos')
+
+ @apple_simulator_test('watch')
+ @debugserver_test
+ def test_simulator_ostype_watchos(self):
+ self.check_simulator_ostype(sdk='watchsimulator',
+ platform='watchos', arch='i386')
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExitCode.py
index 5ef4249bd241..5ef4249bd241 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/TestGdbRemoteExitCode.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExitCode.py
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
index 94e81963483a..7d8e28c745c9 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteExpeditedRegisters.py
@@ -125,6 +125,8 @@ class TestGdbRemoteExpeditedRegisters(
self.set_inferior_startup_launch()
self.stop_notification_contains_pc_register()
+ # powerpc64 has no FP register
+ @skipIf(triple='^powerpc64')
def stop_notification_contains_fp_register(self):
self.stop_notification_contains_generic_register("fp")
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
new file mode 100644
index 000000000000..76910758fa91
--- /dev/null
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteGPacket.py
@@ -0,0 +1,40 @@
+from __future__ import print_function
+
+
+import gdbremote_testcase
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class TestGdbRemoteGPacket(gdbremote_testcase.GdbRemoteTestCaseBase):
+
+ mydir = TestBase.compute_mydir(__file__)
+
+ def run_test_g_packet(self):
+ self.build()
+ self.prep_debug_monitor_and_inferior()
+ self.test_sequence.add_log_lines(
+ ["read packet: $g#67",
+ {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$",
+ "capture": {1: "register_bank"}}],
+ True)
+ self.connect_to_debug_monitor()
+ context = self.expect_gdbremote_sequence()
+ register_bank = context.get("register_bank")
+ self.assertTrue(register_bank[0] != 'E')
+
+ self.test_sequence.add_log_lines(
+ ["read packet: $G" + register_bank + "#00",
+ {"direction": "send", "regex": r"^\$(.+)#[0-9a-fA-F]{2}$",
+ "capture": {1: "G_reply"}}],
+ True)
+ context = self.expect_gdbremote_sequence()
+ self.assertTrue(context.get("G_reply")[0] != 'E')
+
+
+ @skipIfOutOfTreeDebugserver
+ @debugserver_test
+ def test_g_packet_debugserver(self):
+ self.init_debugserver_test()
+ self.run_test_g_packet()
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py
index cab8a9cedfa0..41205302f3bc 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py
@@ -20,7 +20,7 @@ class TestGdbRemoteModuleInfo(gdbremote_testcase.GdbRemoteTestCaseBase):
self.test_sequence.add_log_lines([
'read packet: $jModulesInfo:[{"file":"%s","triple":"%s"}]]#00' % (
- lldbutil.append_to_process_working_directory("a.out"),
+ lldbutil.append_to_process_working_directory(self, "a.out"),
info["triple"].decode('hex')),
{"direction": "send",
"regex": r'^\$\[{(.*)}\]\]#[0-9A-Fa-f]{2}',
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py b/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
index a4f306efdc98..82e76ca125bb 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -261,7 +261,6 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcod
lldbgdbserverutils.parse_reg_info_response(reg_info_packet))
@debugserver_test
- @expectedFailureDarwin("llvm.org/pr25486")
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_returns_one_valid_result_debugserver(self):
self.init_debugserver_test()
@@ -294,7 +293,6 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcod
self.assert_valid_reg_info(reg_info)
@debugserver_test
- @expectedFailureDarwin("llvm.org/pr25486")
@skipIfDarwinEmbedded # <rdar://problem/34539270> lldb-server tests not updated to work on ios etc yet
def test_qRegisterInfo_returns_all_valid_results_debugserver(self):
self.init_debugserver_test()
@@ -332,8 +330,9 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcod
# Ensure we have a program counter register.
self.assertTrue('pc' in generic_regs)
- # Ensure we have a frame pointer register.
- self.assertTrue('fp' in generic_regs)
+ # Ensure we have a frame pointer register. PPC64le's FP is the same as SP
+ if self.getArchitecture() != 'powerpc64le':
+ self.assertTrue('fp' in generic_regs)
# Ensure we have a stack pointer register.
self.assertTrue('sp' in generic_regs)
@@ -558,7 +557,7 @@ class LldbGdbServerTestCase(gdbremote_testcase.GdbRemoteTestCaseBase, DwarfOpcod
self.assertIsNotNone(reg_infos)
self.assertTrue(len(reg_infos) > 0)
- inferior_exe_path = os.path.abspath("a.out")
+ inferior_exe_path = self.getBuildArtifact("a.out")
Target = self.dbg.CreateTarget(inferior_exe_path)
byte_order = Target.GetByteOrder()
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile b/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile
deleted file mode 100644
index 6ff66a3ab5d9..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-LEVEL = ../../../make
-
-override CFLAGS_EXTRAS += -D__STDC_LIMIT_MACROS -D__STDC_FORMAT_MACROS
-ENABLE_THREADS := YES
-CXX_SOURCES := main.cpp
-MAKE_DSYM :=NO
-
-include $(LEVEL)/Makefile.rules
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp b/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp
deleted file mode 100644
index a3691a8d42b9..000000000000
--- a/packages/Python/lldbsuite/test/tools/lldb-server/exit-code/main.cpp
+++ /dev/null
@@ -1,355 +0,0 @@
-#include <cstdlib>
-#include <cstring>
-#include <errno.h>
-#include <inttypes.h>
-#include <memory>
-#include <pthread.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <time.h>
-#include <unistd.h>
-#include <vector>
-
-#if defined(__APPLE__)
-__OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2)
-int pthread_threadid_np(pthread_t, __uint64_t *);
-#elif defined(__linux__)
-#include <sys/syscall.h>
-#elif defined(__NetBSD__)
-#include <lwp.h>
-#endif
-
-static const char *const RETVAL_PREFIX = "retval:";
-static const char *const SLEEP_PREFIX = "sleep:";
-static const char *const STDERR_PREFIX = "stderr:";
-static const char *const SET_MESSAGE_PREFIX = "set-message:";
-static const char *const PRINT_MESSAGE_COMMAND = "print-message:";
-static const char *const GET_DATA_ADDRESS_PREFIX = "get-data-address-hex:";
-static const char *const GET_STACK_ADDRESS_COMMAND = "get-stack-address-hex:";
-static const char *const GET_HEAP_ADDRESS_COMMAND = "get-heap-address-hex:";
-
-static const char *const GET_CODE_ADDRESS_PREFIX = "get-code-address-hex:";
-static const char *const CALL_FUNCTION_PREFIX = "call-function:";
-
-static const char *const THREAD_PREFIX = "thread:";
-static const char *const THREAD_COMMAND_NEW = "new";
-static const char *const THREAD_COMMAND_PRINT_IDS = "print-ids";
-static const char *const THREAD_COMMAND_SEGFAULT = "segfault";
-
-static bool g_print_thread_ids = false;
-static pthread_mutex_t g_print_mutex = PTHREAD_MUTEX_INITIALIZER;
-static bool g_threads_do_segfault = false;
-
-static pthread_mutex_t g_jump_buffer_mutex = PTHREAD_MUTEX_INITIALIZER;
-static jmp_buf g_jump_buffer;
-static bool g_is_segfaulting = false;
-
-static char g_message[256];
-
-static volatile char g_c1 = '0';
-static volatile char g_c2 = '1';
-
-static void print_thread_id() {
-// Put in the right magic here for your platform to spit out the thread id (tid)
-// that debugserver/lldb-gdbserver would see as a TID. Otherwise, let the else
-// clause print out the unsupported text so that the unit test knows to skip
-// verifying thread ids.
-#if defined(__APPLE__)
- __uint64_t tid = 0;
- pthread_threadid_np(pthread_self(), &tid);
- printf("%" PRIx64, tid);
-#elif defined(__linux__)
- // This is a call to gettid() via syscall.
- printf("%" PRIx64, static_cast<uint64_t>(syscall(__NR_gettid)));
-#elif defined(__NetBSD__)
- // Technically lwpid_t is 32-bit signed integer
- printf("%" PRIx64, static_cast<uint64_t>(_lwp_self()));
-#else
- printf("{no-tid-support}");
-#endif
-}
-
-static void signal_handler(int signo) {
- const char *signal_name = nullptr;
- switch (signo) {
- case SIGUSR1:
- signal_name = "SIGUSR1";
- break;
- case SIGSEGV:
- signal_name = "SIGSEGV";
- break;
- default:
- signal_name = nullptr;
- }
-
- // Print notice that we received the signal on a given thread.
- pthread_mutex_lock(&g_print_mutex);
- if (signal_name)
- printf("received %s on thread id: ", signal_name);
- else
- printf("received signo %d (%s) on thread id: ", signo, strsignal(signo));
- print_thread_id();
- printf("\n");
- pthread_mutex_unlock(&g_print_mutex);
-
- // Reset the signal handler if we're one of the expected signal handlers.
- switch (signo) {
- case SIGSEGV:
- if (g_is_segfaulting) {
- // Fix up the pointer we're writing to. This needs to happen if nothing
- // intercepts the SIGSEGV (i.e. if somebody runs this from the command
- // line).
- longjmp(g_jump_buffer, 1);
- }
- break;
- case SIGUSR1:
- if (g_is_segfaulting) {
- // Fix up the pointer we're writing to. This is used to test gdb remote
- // signal delivery. A SIGSEGV will be raised when the thread is created,
- // switched out for a SIGUSR1, and then this code still needs to fix the
- // seg fault. (i.e. if somebody runs this from the command line).
- longjmp(g_jump_buffer, 1);
- }
- break;
- }
-
- // Reset the signal handler.
- sig_t sig_result = signal(signo, signal_handler);
- if (sig_result == SIG_ERR) {
- fprintf(stderr, "failed to set signal handler: errno=%d\n", errno);
- exit(1);
- }
-}
-
-static void swap_chars() {
- g_c1 = '1';
- g_c2 = '0';
-
- g_c1 = '0';
- g_c2 = '1';
-}
-
-static void hello() {
- pthread_mutex_lock(&g_print_mutex);
- printf("hello, world\n");
- pthread_mutex_unlock(&g_print_mutex);
-}
-
-static void *thread_func(void *arg) {
- static pthread_mutex_t s_thread_index_mutex = PTHREAD_MUTEX_INITIALIZER;
- static int s_thread_index = 1;
-
- pthread_mutex_lock(&s_thread_index_mutex);
- const int this_thread_index = s_thread_index++;
- pthread_mutex_unlock(&s_thread_index_mutex);
-
- if (g_print_thread_ids) {
- pthread_mutex_lock(&g_print_mutex);
- printf("thread %d id: ", this_thread_index);
- print_thread_id();
- printf("\n");
- pthread_mutex_unlock(&g_print_mutex);
- }
-
- if (g_threads_do_segfault) {
- // Sleep for a number of seconds based on the thread index.
- // TODO add ability to send commands to test exe so we can
- // handle timing more precisely. This is clunky. All we're
- // trying to do is add predictability as to the timing of
- // signal generation by created threads.
- int sleep_seconds = 2 * (this_thread_index - 1);
- while (sleep_seconds > 0)
- sleep_seconds = sleep(sleep_seconds);
-
- // Test creating a SEGV.
- pthread_mutex_lock(&g_jump_buffer_mutex);
- g_is_segfaulting = true;
- int *bad_p = nullptr;
- if (setjmp(g_jump_buffer) == 0) {
- // Force a seg fault signal on this thread.
- *bad_p = 0;
- } else {
- // Tell the system we're no longer seg faulting.
- // Used by the SIGUSR1 signal handler that we inject
- // in place of the SIGSEGV so it only tries to
- // recover from the SIGSEGV if this seg fault code
- // was in play.
- g_is_segfaulting = false;
- }
- pthread_mutex_unlock(&g_jump_buffer_mutex);
-
- pthread_mutex_lock(&g_print_mutex);
- printf("thread ");
- print_thread_id();
- printf(": past SIGSEGV\n");
- pthread_mutex_unlock(&g_print_mutex);
- }
-
- int sleep_seconds_remaining = 60;
- while (sleep_seconds_remaining > 0) {
- sleep_seconds_remaining = sleep(sleep_seconds_remaining);
- }
-
- return nullptr;
-}
-
-int main(int argc, char **argv) {
- lldb_enable_attach();
-
- std::vector<pthread_t> threads;
- std::unique_ptr<uint8_t[]> heap_array_up;
- int return_value = 0;
-
- // Set the signal handler.
- sig_t sig_result = signal(SIGALRM, signal_handler);
- if (sig_result == SIG_ERR) {
- fprintf(stderr, "failed to set SIGALRM signal handler: errno=%d\n", errno);
- exit(1);
- }
-
- sig_result = signal(SIGUSR1, signal_handler);
- if (sig_result == SIG_ERR) {
- fprintf(stderr, "failed to set SIGUSR1 handler: errno=%d\n", errno);
- exit(1);
- }
-
- sig_result = signal(SIGSEGV, signal_handler);
- if (sig_result == SIG_ERR) {
- fprintf(stderr, "failed to set SIGUSR1 handler: errno=%d\n", errno);
- exit(1);
- }
-
- // Process command line args.
- for (int i = 1; i < argc; ++i) {
- if (std::strstr(argv[i], STDERR_PREFIX)) {
- // Treat remainder as text to go to stderr.
- fprintf(stderr, "%s\n", (argv[i] + strlen(STDERR_PREFIX)));
- } else if (std::strstr(argv[i], RETVAL_PREFIX)) {
- // Treat as the return value for the program.
- return_value = std::atoi(argv[i] + strlen(RETVAL_PREFIX));
- } else if (std::strstr(argv[i], SLEEP_PREFIX)) {
- // Treat as the amount of time to have this process sleep (in seconds).
- int sleep_seconds_remaining = std::atoi(argv[i] + strlen(SLEEP_PREFIX));
-
- // Loop around, sleeping until all sleep time is used up. Note that
- // signals will cause sleep to end early with the number of seconds
- // remaining.
- for (int i = 0; sleep_seconds_remaining > 0; ++i) {
- sleep_seconds_remaining = sleep(sleep_seconds_remaining);
- // std::cout << "sleep result (call " << i << "): " <<
- // sleep_seconds_remaining << std::endl;
- }
- } else if (std::strstr(argv[i], SET_MESSAGE_PREFIX)) {
- // Copy the contents after "set-message:" to the g_message buffer.
- // Used for reading inferior memory and verifying contents match
- // expectations.
- strncpy(g_message, argv[i] + strlen(SET_MESSAGE_PREFIX),
- sizeof(g_message));
-
- // Ensure we're null terminated.
- g_message[sizeof(g_message) - 1] = '\0';
-
- } else if (std::strstr(argv[i], PRINT_MESSAGE_COMMAND)) {
- pthread_mutex_lock(&g_print_mutex);
- printf("message: %s\n", g_message);
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i], GET_DATA_ADDRESS_PREFIX)) {
- volatile void *data_p = nullptr;
-
- if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_message"))
- data_p = &g_message[0];
- else if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_c1"))
- data_p = &g_c1;
- else if (std::strstr(argv[i] + strlen(GET_DATA_ADDRESS_PREFIX), "g_c2"))
- data_p = &g_c2;
-
- pthread_mutex_lock(&g_print_mutex);
- printf("data address: %p\n", data_p);
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i], GET_HEAP_ADDRESS_COMMAND)) {
- // Create a byte array if not already present.
- if (!heap_array_up)
- heap_array_up.reset(new uint8_t[32]);
-
- pthread_mutex_lock(&g_print_mutex);
- printf("heap address: %p\n", heap_array_up.get());
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i], GET_STACK_ADDRESS_COMMAND)) {
- pthread_mutex_lock(&g_print_mutex);
- printf("stack address: %p\n", &return_value);
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i], GET_CODE_ADDRESS_PREFIX)) {
- void (*func_p)() = nullptr;
-
- if (std::strstr(argv[i] + strlen(GET_CODE_ADDRESS_PREFIX), "hello"))
- func_p = hello;
- else if (std::strstr(argv[i] + strlen(GET_CODE_ADDRESS_PREFIX),
- "swap_chars"))
- func_p = swap_chars;
-
- pthread_mutex_lock(&g_print_mutex);
- printf("code address: %p\n", func_p);
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i], CALL_FUNCTION_PREFIX)) {
- // Defaut to providing the address of main.
- if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX), "hello") == 0)
- hello();
- else if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX),
- "swap_chars") == 0)
- swap_chars();
- else {
- pthread_mutex_lock(&g_print_mutex);
- printf("unknown function: %s\n",
- argv[i] + strlen(CALL_FUNCTION_PREFIX));
- pthread_mutex_unlock(&g_print_mutex);
- }
- } else if (std::strstr(argv[i], THREAD_PREFIX)) {
- // Check if we're creating a new thread.
- if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_NEW)) {
- // Create a new thread.
- pthread_t new_thread;
- const int err =
- ::pthread_create(&new_thread, nullptr, thread_func, nullptr);
- if (err) {
- fprintf(stderr, "pthread_create() failed with error code %d\n", err);
- exit(err);
- }
- threads.push_back(new_thread);
- } else if (std::strstr(argv[i] + strlen(THREAD_PREFIX),
- THREAD_COMMAND_PRINT_IDS)) {
- // Turn on thread id announcing.
- g_print_thread_ids = true;
-
- // And announce us.
- pthread_mutex_lock(&g_print_mutex);
- printf("thread 0 id: ");
- print_thread_id();
- printf("\n");
- pthread_mutex_unlock(&g_print_mutex);
- } else if (std::strstr(argv[i] + strlen(THREAD_PREFIX),
- THREAD_COMMAND_SEGFAULT)) {
- g_threads_do_segfault = true;
- } else {
- // At this point we don't do anything else with threads.
- // Later use thread index and send command to thread.
- }
- } else {
- // Treat the argument as text for stdout.
- printf("%s\n", argv[i]);
- }
- }
-
- // If we launched any threads, join them
- for (std::vector<pthread_t>::iterator it = threads.begin();
- it != threads.end(); ++it) {
- void *thread_retval = nullptr;
- const int err = ::pthread_join(*it, &thread_retval);
- if (err != 0)
- fprintf(stderr, "pthread_join() failed with error code %d\n", err);
- }
-
- return return_value;
-}
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py b/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
index 67887256d97d..c5d21a9c9b7a 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/gdbremote_testcase.py
@@ -32,7 +32,7 @@ class GdbRemoteTestCaseBase(TestBase):
NO_DEBUG_INFO_TESTCASE = True
- _TIMEOUT_SECONDS = 7
+ _TIMEOUT_SECONDS = 120
_GDBREMOTE_KILL_PACKET = "$k#6b"
@@ -483,7 +483,7 @@ class GdbRemoteTestCaseBase(TestBase):
# This process needs to be started so that it just hangs around for a while. We'll
# have it sleep.
if not exe_path:
- exe_path = os.path.abspath("a.out")
+ exe_path = self.getBuildArtifact("a.out")
args = []
if inferior_args:
@@ -546,10 +546,10 @@ class GdbRemoteTestCaseBase(TestBase):
if self._inferior_startup == self._STARTUP_LAUNCH:
# Build launch args
if not inferior_exe_path:
- inferior_exe_path = os.path.abspath("a.out")
+ inferior_exe_path = self.getBuildArtifact("a.out")
if lldb.remote_platform:
- remote_path = lldbutil.append_to_process_working_directory(
+ remote_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(inferior_exe_path))
remote_file_spec = lldb.SBFileSpec(remote_path, False)
err = lldb.remote_platform.Install(lldb.SBFileSpec(
@@ -1008,9 +1008,10 @@ class GdbRemoteTestCaseBase(TestBase):
reg_info["name"] in PREFERRED_REGISTER_NAMES):
# We found a preferred register. Use it.
return reg_info["lldb_register_index"]
- if ("generic" in reg_info) and (reg_info["generic"] == "fp"):
- # A frame pointer register will do as a register to modify
- # temporarily.
+ if ("generic" in reg_info) and (reg_info["generic"] == "fp" or
+ reg_info["generic"] == "arg1"):
+ # A frame pointer or first arg register will do as a
+ # register to modify temporarily.
alternative_register_index = reg_info["lldb_register_index"]
# We didn't find a preferred register. Return whatever alternative register
@@ -1076,6 +1077,18 @@ class GdbRemoteTestCaseBase(TestBase):
auxv_dict = {}
+ # PowerPC64le's auxvec has a special key that must be ignored.
+ # This special key may be used multiple times, resulting in
+ # multiple key/value pairs with the same key, which would otherwise
+ # break this test check for repeated keys.
+ #
+ # AT_IGNOREPPC = 22
+ ignored_keys_for_arch = { 'powerpc64le' : [22] }
+ arch = self.getArchitecture()
+ ignore_keys = None
+ if arch in ignored_keys_for_arch:
+ ignore_keys = ignored_keys_for_arch[arch]
+
while len(auxv_data) > 0:
# Chop off key.
raw_key = auxv_data[:word_size]
@@ -1089,6 +1102,9 @@ class GdbRemoteTestCaseBase(TestBase):
key = unpack_endian_binary_string(endian, raw_key)
value = unpack_endian_binary_string(endian, raw_value)
+ if ignore_keys and key in ignore_keys:
+ continue
+
# Handle ending entry.
if key == 0:
self.assertEqual(value, 0)
@@ -1607,10 +1623,10 @@ class GdbRemoteTestCaseBase(TestBase):
'.*' if lldbplatformutil.hasChattyStderr(self) else '^' + regex + '$'
def install_and_create_launch_args(self):
- exe_path = os.path.abspath('a.out')
+ exe_path = self.getBuildArtifact("a.out")
if not lldb.remote_platform:
return [exe_path]
- remote_path = lldbutil.append_to_process_working_directory(
+ remote_path = lldbutil.append_to_process_working_directory(self,
os.path.basename(exe_path))
remote_file_spec = lldb.SBFileSpec(remote_path, False)
err = lldb.remote_platform.Install(lldb.SBFileSpec(exe_path, True),
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp b/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
index a574b41abf67..ca032c120beb 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/main.cpp
@@ -48,6 +48,8 @@ static const char *const THREAD_COMMAND_NEW = "new";
static const char *const THREAD_COMMAND_PRINT_IDS = "print-ids";
static const char *const THREAD_COMMAND_SEGFAULT = "segfault";
+static const char *const PRINT_PID_COMMAND = "print-pid";
+
static bool g_print_thread_ids = false;
static pthread_mutex_t g_print_mutex = PTHREAD_MUTEX_INITIALIZER;
static bool g_threads_do_segfault = false;
@@ -61,6 +63,10 @@ static char g_message[256];
static volatile char g_c1 = '0';
static volatile char g_c2 = '1';
+static void print_pid() {
+ fprintf(stderr, "PID: %d\n", getpid());
+}
+
static void print_thread_id() {
// Put in the right magic here for your platform to spit out the thread id (tid)
// that debugserver/lldb-gdbserver would see as a TID. Otherwise, let the else
@@ -303,18 +309,22 @@ int main(int argc, char **argv) {
printf("code address: %p\n", func_p);
pthread_mutex_unlock(&g_print_mutex);
} else if (std::strstr(argv[i], CALL_FUNCTION_PREFIX)) {
+ void (*func_p)() = nullptr;
+
// Defaut to providing the address of main.
if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX), "hello") == 0)
- hello();
+ func_p = hello;
else if (std::strcmp(argv[i] + strlen(CALL_FUNCTION_PREFIX),
"swap_chars") == 0)
- swap_chars();
+ func_p = swap_chars;
else {
pthread_mutex_lock(&g_print_mutex);
printf("unknown function: %s\n",
argv[i] + strlen(CALL_FUNCTION_PREFIX));
pthread_mutex_unlock(&g_print_mutex);
}
+ if (func_p)
+ func_p();
} else if (std::strstr(argv[i], THREAD_PREFIX)) {
// Check if we're creating a new thread.
if (std::strstr(argv[i] + strlen(THREAD_PREFIX), THREAD_COMMAND_NEW)) {
@@ -345,6 +355,8 @@ int main(int argc, char **argv) {
// At this point we don't do anything else with threads.
// Later use thread index and send command to thread.
}
+ } else if (std::strstr(argv[i], PRINT_PID_COMMAND)) {
+ print_pid();
} else {
// Treat the argument as text for stdout.
printf("%s\n", argv[i]);
diff --git a/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py b/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
index 7e4190b7fe95..aa4b3dee7921 100644
--- a/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
+++ b/packages/Python/lldbsuite/test/tools/lldb-server/platform-process-connect/TestPlatformProcessConnect.py
@@ -20,12 +20,9 @@ class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
self.init_llgs_test(False)
working_dir = lldb.remote_platform.GetWorkingDirectory()
- err = lldb.remote_platform.Put(
- lldb.SBFileSpec(
- os.path.join(
- os.getcwd(), "a.out")), lldb.SBFileSpec(
- os.path.join(
- working_dir, "a.out")))
+ src = lldb.SBFileSpec(self.getBuildArtifact("a.out"))
+ dest = lldb.SBFileSpec(os.path.join(working_dir, "a.out"))
+ err = lldb.remote_platform.Put(src, dest)
if err.Fail():
raise RuntimeError(
"Unable copy '%s' to '%s'.\n>>> %s" %
@@ -37,9 +34,9 @@ class TestPlatformProcessConnect(gdbremote_testcase.GdbRemoteTestCaseBase):
unix_protocol = protocol.startswith("unix-")
if unix_protocol:
p = re.search("^(.*)-connect", protocol)
- listen_url = "%s://%s" % (p.group(1),
- os.path.join(working_dir,
- "platform-%d.sock" % int(time.time())))
+ path = lldbutil.join_remote_paths(configuration.lldb_platform_working_dir,
+ self.getBuildDirBasename(), "platform-%d.sock" % int(time.time()))
+ listen_url = "%s://%s" % (p.group(1), path)
else:
listen_url = "*:0"
diff --git a/packages/Python/lldbsuite/test/types/AbstractBase.py b/packages/Python/lldbsuite/test/types/AbstractBase.py
index ee548954a741..37ddfb756bb0 100644
--- a/packages/Python/lldbsuite/test/types/AbstractBase.py
+++ b/packages/Python/lldbsuite/test/types/AbstractBase.py
@@ -34,7 +34,7 @@ class GenericTester(TestBase):
# module cacheing subsystem to be confused with executable name "a.out"
# used for all the test cases.
self.exe_name = self.testMethodName
- self.golden_filename = os.path.join(os.getcwd(), "golden-output.txt")
+ self.golden_filename = self.getBuildArtifact("golden-output.txt")
def tearDown(self):
"""Cleanup the test byproducts."""
@@ -95,7 +95,7 @@ class GenericTester(TestBase):
if lldb.remote_platform:
# process launch -o requires a path that is valid on the target
self.assertIsNotNone(lldb.remote_platform.GetWorkingDirectory())
- remote_path = lldbutil.append_to_process_working_directory(
+ remote_path = lldbutil.append_to_process_working_directory(self,
"lldb-stdout-redirect.txt")
self.runCmd(
'process launch -- {remote}'.format(remote=remote_path))
@@ -113,8 +113,8 @@ class GenericTester(TestBase):
quotedDisplay=False,
blockCaptured=False):
"""Test that variables with basic types are displayed correctly."""
-
- self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
+ self.runCmd("file %s" % self.getBuildArtifact(exe_name),
+ CURRENT_EXECUTABLE_SET)
# First, capture the golden output emitted by the oracle, i.e., the
# series of printf statements.
@@ -210,7 +210,8 @@ class GenericTester(TestBase):
blockCaptured=False):
"""Test that variable expressions with basic types are evaluated correctly."""
- self.runCmd("file %s" % exe_name, CURRENT_EXECUTABLE_SET)
+ self.runCmd("file %s" % self.getBuildArtifact(exe_name),
+ CURRENT_EXECUTABLE_SET)
# First, capture the golden output emitted by the oracle, i.e., the
# series of printf statements.
diff --git a/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py b/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
index 4735bcee5128..40c028f3e6dc 100644
--- a/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
+++ b/packages/Python/lldbsuite/test/types/TestRecursiveTypes.py
@@ -44,7 +44,7 @@ class RecursiveTypesTestCase(TestBase):
self.print_struct()
def print_struct(self):
- self.runCmd("file a.out", CURRENT_EXECUTABLE_SET)
+ self.runCmd("file " + self.getBuildArtifact("a.out"), CURRENT_EXECUTABLE_SET)
lldbutil.run_break_set_by_file_and_line(
self,
diff --git a/packages/Python/lldbsuite/test/types/basic_type.cpp b/packages/Python/lldbsuite/test/types/basic_type.cpp
index 3102806ab5bc..2d7e7b2e21bf 100644
--- a/packages/Python/lldbsuite/test/types/basic_type.cpp
+++ b/packages/Python/lldbsuite/test/types/basic_type.cpp
@@ -23,6 +23,9 @@
#ifdef TEST_BLOCK_CAPTURED_VARS
#include <dispatch/dispatch.h>
#endif
+#include <cstdint>
+#include <cstdio>
+#include <cstdlib>
class a_class
{
@@ -83,9 +86,6 @@ typedef struct a_union_nonzero_tag {
} a_union_nonzero_t;
-#include <stdint.h>
-#include <stdio.h>
-
int
main (int argc, char const *argv[])
{
diff --git a/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py b/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
index 5df4c701ad9f..11c3bc86a6ed 100644
--- a/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
+++ b/packages/Python/lldbsuite/test/warnings/uuid/TestAddDsymCommand.py
@@ -28,14 +28,14 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDsym(clean=True)
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
# Insert some delay and then call the program generator to produce
# main.cpp, version 2.
time.sleep(5)
self.generate_main_cpp(version=101)
# Now call make again, but this time don't generate the dSYM.
- self.buildDwarf(clean=False)
+ self.buildDefault(dictionary={'MAKE_DSYM':'NO'})
self.exe_name = 'a.out'
self.do_add_dsym_with_error(self.exe_name)
@@ -46,7 +46,7 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDsym(clean=True)
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
self.exe_name = 'a.out'
self.do_add_dsym_with_success(self.exe_name)
@@ -57,14 +57,14 @@ class AddDsymCommandCase(TestBase):
# Call the program generator to produce main.cpp, version 1.
self.generate_main_cpp(version=1)
- self.buildDsym(clean=True)
+ self.buildDefault(dictionary={'MAKE_DSYM':'YES'})
self.exe_name = 'a.out'
self.do_add_dsym_with_dSYM_bundle(self.exe_name)
def generate_main_cpp(self, version=0):
"""Generate main.cpp from main.cpp.template."""
- temp = os.path.join(os.getcwd(), self.template)
+ temp = os.path.join(self.getSourceDir(), self.template)
with open(temp, 'r') as f:
content = f.read()
@@ -72,7 +72,7 @@ class AddDsymCommandCase(TestBase):
'%ADD_EXTRA_CODE%',
'printf("This is version %d\\n");' %
version)
- src = os.path.join(os.getcwd(), self.source)
+ src = os.path.join(self.getBuildDir(), self.source)
with open(src, 'w') as f:
f.write(new_content)
@@ -83,15 +83,18 @@ class AddDsymCommandCase(TestBase):
def do_add_dsym_with_error(self, exe_name):
"""Test that the 'add-dsym' command informs the user about failures."""
- self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+ exe_path = self.getBuildArtifact(exe_name)
+ self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
- wrong_path = os.path.join("%s.dSYM" % exe_name, "Contents")
+ wrong_path = os.path.join(self.getBuildDir(),
+ "%s.dSYM" % exe_name, "Contents")
self.expect("add-dsym " + wrong_path, error=True,
substrs=['invalid module path'])
right_path = os.path.join(
+ self.getBuildDir(),
"%s.dSYM" %
- exe_name,
+ exe_path,
"Contents",
"Resources",
"DWARF",
@@ -101,13 +104,15 @@ class AddDsymCommandCase(TestBase):
def do_add_dsym_with_success(self, exe_name):
"""Test that the 'add-dsym' command informs the user about success."""
- self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+ exe_path = self.getBuildArtifact(exe_name)
+ self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
# This time, the UUID should match and we expect some feedback from
# lldb.
right_path = os.path.join(
+ self.getBuildDir(),
"%s.dSYM" %
- exe_name,
+ exe_path,
"Contents",
"Resources",
"DWARF",
@@ -117,9 +122,10 @@ class AddDsymCommandCase(TestBase):
def do_add_dsym_with_dSYM_bundle(self, exe_name):
"""Test that the 'add-dsym' command informs the user about success when loading files in bundles."""
- self.runCmd("file " + exe_name, CURRENT_EXECUTABLE_SET)
+ exe_path = self.getBuildArtifact(exe_name)
+ self.runCmd("file " + exe_path, CURRENT_EXECUTABLE_SET)
# This time, the UUID should be found inside the bundle
- right_path = "%s.dSYM" % exe_name
+ right_path = "%s.dSYM" % exe_path
self.expect("add-dsym " + right_path,
substrs=['symbol file', 'has been added to'])
diff --git a/packages/Python/lldbsuite/test_event/formatter/xunit.py b/packages/Python/lldbsuite/test_event/formatter/xunit.py
index 91487cd2c3a1..4c53ff8062d7 100644
--- a/packages/Python/lldbsuite/test_event/formatter/xunit.py
+++ b/packages/Python/lldbsuite/test_event/formatter/xunit.py
@@ -84,7 +84,9 @@ class XunitFormatter(ResultsFormatter):
"""
# Get the content into unicode
if isinstance(str_or_unicode, str):
- unicode_content = str_or_unicode.decode('utf-8')
+ # If we hit decoding errors due to data corruption, replace the
+ # invalid characters with U+FFFD REPLACEMENT CHARACTER.
+ unicode_content = str_or_unicode.decode('utf-8', 'replace')
else:
unicode_content = str_or_unicode
return self.invalid_xml_re.sub(
diff --git a/resources/LLDB-Info.plist b/resources/LLDB-Info.plist
index 4a8bcaa96a7b..77330e2929cb 100644
--- a/resources/LLDB-Info.plist
+++ b/resources/LLDB-Info.plist
@@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
- <string>com.apple.${PRODUCT_NAME:rfc1034identifier}.framework</string>
+ <string>com.apple.${PRODUCT_NAME}.framework</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
diff --git a/resources/debugserver-macosx-entitlements.plist b/resources/debugserver-macosx-entitlements.plist
new file mode 100644
index 000000000000..3d60e8bd0b94
--- /dev/null
+++ b/resources/debugserver-macosx-entitlements.plist
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>com.apple.security.cs.debugger</key>
+ <true/>
+</dict>
+</plist>
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 1fe34115244b..be5c3db53556 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -30,10 +30,12 @@ if(LLDB_BUILD_FRAMEWORK)
${LLDB_FRAMEWORK_INSTALL_DIR}/${LLDB_FRAMEWORK_RESOURCE_DIR})
endif()
+get_filename_component(CFGBLDDIR ${LLDB_WRAP_PYTHON} DIRECTORY)
+
find_package(SWIG REQUIRED)
add_custom_command(
OUTPUT ${LLDB_WRAP_PYTHON}
- OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
+ OUTPUT ${LLDB_PYTHON_TARGET_DIR}/lldb.py
DEPENDS ${SWIG_SOURCES}
DEPENDS ${SWIG_INTERFACES}
DEPENDS ${SWIG_HEADERS}
@@ -43,7 +45,7 @@ add_custom_command(
${framework_arg}
--srcRoot=${LLDB_SOURCE_DIR}
--targetDir=${LLDB_PYTHON_TARGET_DIR}
- --cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}
+ --cfgBldDir=${CFGBLDDIR}
--prefix=${CMAKE_BINARY_DIR}
--swigExecutable=${SWIG_EXECUTABLE}
VERBATIM
diff --git a/scripts/Python/modules/readline/CMakeLists.txt b/scripts/Python/modules/readline/CMakeLists.txt
index 0a4376c1c324..876ab341682b 100644
--- a/scripts/Python/modules/readline/CMakeLists.txt
+++ b/scripts/Python/modules/readline/CMakeLists.txt
@@ -6,11 +6,13 @@ SET(PYTHON_DIRECTORY python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-
# Build the readline python module
include_directories(${PYTHON_INCLUDE_DIR})
add_library(readline SHARED readline.cpp)
+target_link_libraries(readline ${PYTHON_LIBRARY})
if (NOT LLDB_DISABLE_LIBEDIT)
- target_link_libraries(readline ${PYTHON_LIBRARY} edit)
-else()
- target_link_libraries(readline ${PYTHON_LIBRARY})
+ target_include_directories(readline
+ PRIVATE
+ ${libedit_INCLUDE_DIRS})
+ target_link_libraries(readline ${libedit_LIBRARIES})
endif()
# FIXME: the LIBRARY_OUTPUT_PATH seems to be ignored - this is not a
diff --git a/scripts/Python/python-extensions.swig b/scripts/Python/python-extensions.swig
index d79917b92158..5543bee95d47 100644
--- a/scripts/Python/python-extensions.swig
+++ b/scripts/Python/python-extensions.swig
@@ -839,29 +839,18 @@
%pythoncode %{
-def command(*args, **kwargs):
+def command(command_name=None, doc=None):
import lldb
- import inspect
"""A decorator function that registers an LLDB command line
command that is bound to the function it is attached to."""
- class obj(object):
- """The object that tracks adding the command to LLDB one time and handles
- calling the function on subsequent calls."""
- def __init__(self, function, command_name, doc = None):
- if doc:
- function.__doc__ = doc
- command = "command script add -f %s.%s %s" % (function.__module__, function.__name__, command_name)
- lldb.debugger.HandleCommand(command)
- self.function = function
- def __call__(self, debugger, command, exe_ctx, result, dict):
- if len(inspect.getargspec(self.function).args) == 5:
- self.function(debugger, command, exe_ctx, result, dict)
- else:
- self.function(debugger, command, result, dict)
def callable(function):
- """Creates a callable object that gets used."""
- f = obj(function, *args, **kwargs)
- return f.__call__
+ """Registers an lldb command for the decorated function."""
+ command = "command script add -f %s.%s %s" % (function.__module__, function.__name__, command_name or function.__name__)
+ lldb.debugger.HandleCommand(command)
+ if doc:
+ function.__doc__ = doc
+ return function
+
return callable
class declaration(object):
diff --git a/scripts/interface/SBAddress.i b/scripts/interface/SBAddress.i
index 735b42c1d5b6..d996aa5b7aca 100644
--- a/scripts/interface/SBAddress.i
+++ b/scripts/interface/SBAddress.i
@@ -89,12 +89,8 @@ public:
SBAddress::GetOffset ();
void
- SetAddress (lldb::SBSection section,
+ SetAddress (lldb::SBSection section,
lldb::addr_t offset);
-
-
- lldb::AddressClass
- GetAddressClass ();
%feature("docstring", "
//------------------------------------------------------------------
diff --git a/scripts/interface/SBCommandInterpreter.i b/scripts/interface/SBCommandInterpreter.i
index 255e8ba4496a..09e7c9df736a 100644
--- a/scripts/interface/SBCommandInterpreter.i
+++ b/scripts/interface/SBCommandInterpreter.i
@@ -156,6 +156,15 @@ public:
SetPromptOnQuit(bool b);
void
+ AllowExitCodeOnQuit(bool b);
+
+ bool
+ HasCustomQuitExitCode();
+
+ int
+ GetQuitStatus();
+
+ void
ResolveCommand(const char *command_line, SBCommandReturnObject &result);
bool
diff --git a/scripts/interface/SBDebugger.i b/scripts/interface/SBDebugger.i
index 9f746d36348c..8ac2c51e12fe 100644
--- a/scripts/interface/SBDebugger.i
+++ b/scripts/interface/SBDebugger.i
@@ -320,6 +320,8 @@ public:
static const char *
StateAsCString (lldb::StateType state);
+ static SBStructuredData GetBuildConfiguration();
+
static bool
StateIsRunningState (lldb::StateType state);
diff --git a/scripts/interface/SBInstruction.i b/scripts/interface/SBInstruction.i
index c78799c6fe69..e235002cfaf3 100644
--- a/scripts/interface/SBInstruction.i
+++ b/scripts/interface/SBInstruction.i
@@ -30,8 +30,6 @@ public:
lldb::SBAddress
GetAddress();
- lldb::AddressClass
- GetAddressClass ();
const char *
GetMnemonic (lldb::SBTarget target);
diff --git a/scripts/interface/SBModule.i b/scripts/interface/SBModule.i
index 71a2198609d6..adda954e5bfb 100644
--- a/scripts/interface/SBModule.i
+++ b/scripts/interface/SBModule.i
@@ -179,6 +179,23 @@ public:
lldb::SBCompileUnit
GetCompileUnitAtIndex (uint32_t);
+ %feature("docstring", "
+ //------------------------------------------------------------------
+ /// Find compile units related to *this module and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ ") FindCompileUnits;
+ lldb::SBSymbolContextList
+ FindCompileUnits (const lldb::SBFileSpec &sb_file_spec);
+
size_t
GetNumSymbols ();
diff --git a/scripts/interface/SBProcess.i b/scripts/interface/SBProcess.i
index 55d39f826b7d..24b67565437a 100644
--- a/scripts/interface/SBProcess.i
+++ b/scripts/interface/SBProcess.i
@@ -373,6 +373,19 @@ public:
uint32_t
LoadImage (lldb::SBFileSpec &image_spec, lldb::SBError &error);
+ %feature("autodoc", "
+ Load the library whose filename is given by image_spec looking in all the
+ paths supplied in the paths argument. If successful, return a token that
+ can be passed to UnloadImage and fill loaded_path with the path that was
+ successfully loaded. On failure, return
+ lldb.LLDB_INVALID_IMAGE_TOKEN.
+ ") LoadImageUsingPaths;
+ uint32_t
+ LoadImageUsingPaths(const lldb::SBFileSpec &image_spec,
+ SBStringList &paths,
+ lldb::SBFileSpec &loaded_path,
+ SBError &error);
+
lldb::SBError
UnloadImage (uint32_t image_token);
diff --git a/scripts/interface/SBSymbolContext.i b/scripts/interface/SBSymbolContext.i
index fa405842d6e5..5bfee9c8b846 100644
--- a/scripts/interface/SBSymbolContext.i
+++ b/scripts/interface/SBSymbolContext.i
@@ -12,7 +12,7 @@ namespace lldb {
%feature("docstring",
"A context object that provides access to core debugger entities.
-Manay debugger functions require a context when doing lookups. This class
+Many debugger functions require a context when doing lookups. This class
provides a common structure that can be used as the result of a query that
can contain a single result.
diff --git a/scripts/interface/SBTarget.i b/scripts/interface/SBTarget.i
index bcec606005f4..08fb268c08bf 100644
--- a/scripts/interface/SBTarget.i
+++ b/scripts/interface/SBTarget.i
@@ -77,7 +77,7 @@ public:
static const char *
GetBroadcasterClassName ();
-
+
bool
IsValid() const;
@@ -145,7 +145,7 @@ public:
/// An optional listener that will receive all process events.
/// If \a listener is valid then \a listener will listen to all
/// process events. If not valid, then this target's debugger
- /// (SBTarget::GetDebugger()) will listen to all process events.
+ /// (SBTarget::GetDebugger()) will listen to all process events.
///
/// @param[in] argv
/// The argument array.
@@ -175,7 +175,7 @@ public:
/// The working directory to have the child process run in
///
/// @param[in] launch_flags
- /// Some launch options specified by logical OR'ing
+ /// Some launch options specified by logical OR'ing
/// lldb::LaunchFlags enumeration values together.
///
/// @param[in] stop_at_entry
@@ -203,7 +203,7 @@ public:
run to completion if no user interaction is required.
") Launch;
lldb::SBProcess
- Launch (SBListener &listener,
+ Launch (SBListener &listener,
char const **argv,
char const **envp,
const char *stdin_path,
@@ -213,7 +213,7 @@ public:
uint32_t launch_flags, // See LaunchFlags
bool stop_at_entry,
lldb::SBError& error);
-
+
%feature("docstring", "
//------------------------------------------------------------------
/// Launch a new process with sensible defaults.
@@ -250,10 +250,10 @@ public:
executable.
") LaunchSimple;
lldb::SBProcess
- LaunchSimple (const char **argv,
+ LaunchSimple (const char **argv,
const char **envp,
const char *working_directory);
-
+
lldb::SBProcess
Launch (lldb::SBLaunchInfo &launch_info, lldb::SBError& error);
@@ -264,6 +264,10 @@ public:
/// @param[in] core_file
/// File path of the core dump.
///
+ /// @param[out] error
+ /// An error explaining what went wrong if the operation fails.
+ /// (Optional)
+ ///
/// @return
/// A process object for the newly created core file.
//------------------------------------------------------------------
@@ -276,10 +280,12 @@ public:
") LoadCore;
lldb::SBProcess
LoadCore(const char *core_file);
-
+
lldb::SBProcess
- Attach (lldb::SBAttachInfo &attach_info, lldb::SBError& error);
-
+ LoadCore(const char *core_file, lldb::SBError &error);
+
+ lldb::SBProcess
+ Attach(lldb::SBAttachInfo &attach_info, lldb::SBError& error);
%feature("docstring", "
//------------------------------------------------------------------
@@ -363,7 +369,7 @@ public:
const char *url,
const char *plugin_name,
SBError& error);
-
+
lldb::SBFileSpec
GetExecutable ();
@@ -399,12 +405,29 @@ public:
lldb::SBModule
FindModule (const lldb::SBFileSpec &file_spec);
+ %feature("docstring", "
+ //------------------------------------------------------------------
+ /// Find compile units related to *this target and passed source
+ /// file.
+ ///
+ /// @param[in] sb_file_spec
+ /// A lldb::SBFileSpec object that contains source file
+ /// specification.
+ ///
+ /// @return
+ /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// the symbol contexts for all the matches.
+ //------------------------------------------------------------------
+ ") FindCompileUnits;
+ lldb::SBSymbolContextList
+ FindCompileUnits (const lldb::SBFileSpec &sb_file_spec);
+
lldb::ByteOrder
GetByteOrder ();
-
+
uint32_t
GetAddressByteSize();
-
+
const char *
GetTriple ();
@@ -457,21 +480,21 @@ public:
/// A logical OR of one or more FunctionNameType enum bits that
/// indicate what kind of names should be used when doing the
/// lookup. Bits include fully qualified names, base names,
- /// C++ methods, or ObjC selectors.
+ /// C++ methods, or ObjC selectors.
/// See FunctionNameType for more details.
///
/// @return
- /// A lldb::SBSymbolContextList that gets filled in with all of
+ /// A lldb::SBSymbolContextList that gets filled in with all of
/// the symbol contexts for all the matches.
//------------------------------------------------------------------
") FindFunctions;
lldb::SBSymbolContextList
- FindFunctions (const char *name,
+ FindFunctions (const char *name,
uint32_t name_type_mask = lldb::eFunctionNameTypeAny);
-
+
lldb::SBType
FindFirstType (const char* type);
-
+
lldb::SBTypeList
FindTypes (const char* type);
@@ -497,7 +520,7 @@ public:
//------------------------------------------------------------------
") FindGlobalVariables;
lldb::SBValueList
- FindGlobalVariables (const char *name,
+ FindGlobalVariables (const char *name,
uint32_t max_matches);
%feature("docstring", "
@@ -515,7 +538,7 @@ public:
lldb::SBValue
FindFirstGlobalVariable (const char* name);
-
+
lldb::SBValueList
FindGlobalVariables(const char *name,
uint32_t max_matches,
@@ -544,26 +567,26 @@ public:
lldb::SBAddress
ResolveLoadAddress (lldb::addr_t vm_addr);
-
+
lldb::SBAddress
ResolvePastLoadAddress (uint32_t stop_id, lldb::addr_t vm_addr);
SBSymbolContext
- ResolveSymbolContextForAddress (const SBAddress& addr,
+ ResolveSymbolContextForAddress (const SBAddress& addr,
uint32_t resolve_scope);
%feature("docstring", "
//------------------------------------------------------------------
- /// Read target memory. If a target process is running then memory
+ /// Read target memory. If a target process is running then memory
/// is read from here. Otherwise the memory is read from the object
/// files. For a target whose bytes are sized as a multiple of host
/// bytes, the data read back will preserve the target's byte order.
///
/// @param[in] addr
- /// A target address to read from.
+ /// A target address to read from.
///
/// @param[out] buf
- /// The buffer to read memory into.
+ /// The buffer to read memory into.
///
/// @param[in] size
/// The maximum number of host bytes to read in the buffer passed
@@ -589,7 +612,7 @@ public:
BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line, lldb::addr_t offset);
lldb::SBBreakpoint
- BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line,
+ BreakpointCreateByLocation (const lldb::SBFileSpec &file_spec, uint32_t line,
lldb::addr_t offset, SBFileSpecList &module_list);
lldb::SBBreakpoint
@@ -598,14 +621,14 @@ public:
lldb::SBBreakpoint
BreakpointCreateByName (const char *symbol_name,
uint32_t func_name_type, // Logical OR one or more FunctionNameType enum bits
- const SBFileSpecList &module_list,
+ const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
lldb::SBBreakpoint
BreakpointCreateByName (const char *symbol_name,
uint32_t func_name_type, // Logical OR one or more FunctionNameType enum bits
lldb::LanguageType symbol_language,
- const SBFileSpecList &module_list,
+ const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
%typemap(in) (const char **symbol_name, uint32_t num_names) {
@@ -670,7 +693,7 @@ public:
lldb::SBBreakpoint
BreakpointCreateByRegex (const char *symbol_name_regex,
lldb::LanguageType symbol_language,
- const SBFileSpecList &module_list,
+ const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list);
lldb::SBBreakpoint
@@ -708,7 +731,7 @@ public:
lldb::SBBreakpoint
FindBreakpointByID (break_id_t break_id);
-
+
bool FindBreakpointsByName(const char *name, SBBreakpointList &bkpt_list);
void DeleteBreakpointName(const char *name);
@@ -726,12 +749,12 @@ public:
%feature("docstring", "
//------------------------------------------------------------------
- /// Read breakpoints from source_file and return the newly created
+ /// Read breakpoints from source_file and return the newly created
/// breakpoints in bkpt_list.
///
/// @param[in] source_file
/// The file from which to read the breakpoints
- ///
+ ///
/// @param[out] bkpt_list
/// A list of the newly created breakpoints.
///
@@ -740,12 +763,12 @@ public:
//------------------------------------------------------------------
") BreakpointsCreateFromFile;
lldb::SBError
- BreakpointsCreateFromFile(SBFileSpec &source_file,
+ BreakpointsCreateFromFile(SBFileSpec &source_file,
SBBreakpointList &bkpt_list);
%feature("docstring", "
//------------------------------------------------------------------
- /// Read breakpoints from source_file and return the newly created
+ /// Read breakpoints from source_file and return the newly created
/// breakpoints in bkpt_list.
///
/// @param[in] source_file
@@ -754,7 +777,7 @@ public:
/// @param[in] matching_names
/// Only read in breakpoints whose names match one of the names in this
/// list.
- ///
+ ///
/// @param[out] bkpt_list
/// A list of the newly created breakpoints.
///
@@ -779,7 +802,7 @@ public:
") BreakpointsCreateFromFile;
lldb::SBError
BreakpointsWriteToFile(SBFileSpec &dest_file);
-
+
%feature("docstring", "
//------------------------------------------------------------------
/// Write breakpoints listed in bkpt_list to dest_file.
@@ -800,42 +823,42 @@ public:
//------------------------------------------------------------------
") BreakpointsCreateFromFile;
lldb::SBError
- BreakpointsWriteToFile(SBFileSpec &dest_file,
+ BreakpointsWriteToFile(SBFileSpec &dest_file,
SBBreakpointList &bkpt_list,
bool append = false);
uint32_t
GetNumWatchpoints () const;
-
+
lldb::SBWatchpoint
GetWatchpointAtIndex (uint32_t idx) const;
-
+
bool
DeleteWatchpoint (lldb::watch_id_t watch_id);
-
+
lldb::SBWatchpoint
FindWatchpointByID (lldb::watch_id_t watch_id);
-
+
bool
EnableAllWatchpoints ();
-
+
bool
DisableAllWatchpoints ();
-
+
bool
DeleteAllWatchpoints ();
lldb::SBWatchpoint
- WatchAddress (lldb::addr_t addr,
- size_t size,
- bool read,
+ WatchAddress (lldb::addr_t addr,
+ size_t size,
+ bool read,
bool write,
SBError &error);
-
+
lldb::SBBroadcaster
GetBroadcaster () const;
-
+
%feature("docstring", "
//------------------------------------------------------------------
/// Create an SBValue with the given name by treating the memory starting at addr as an entity of type.
@@ -859,20 +882,20 @@ public:
lldb::SBValue
CreateValueFromData (const char *name, lldb::SBData data, lldb::SBType type);
-
+
lldb::SBValue
CreateValueFromExpression (const char *name, const char* expr);
-
+
%feature("docstring", "
Disassemble a specified number of instructions starting at an address.
Parameters:
base_addr -- the address to start disassembly from
count -- the number of instructions to disassemble
flavor_string -- may be 'intel' or 'att' on x86 targets to specify that style of disassembly
- Returns an SBInstructionList.")
+ Returns an SBInstructionList.")
ReadInstructions;
lldb::SBInstructionList
- ReadInstructions (lldb::SBAddress base_addr, uint32_t count);
+ ReadInstructions (lldb::SBAddress base_addr, uint32_t count);
lldb::SBInstructionList
ReadInstructions (lldb::SBAddress base_addr, uint32_t count, const char *flavor_string);
@@ -883,7 +906,7 @@ public:
base_addr -- used for symbolicating the offsets in the byte stream when disassembling
buf -- bytes to be disassembled
size -- (C++) size of the buffer
- Returns an SBInstructionList.")
+ Returns an SBInstructionList.")
GetInstructions;
lldb::SBInstructionList
GetInstructions (lldb::SBAddress base_addr, const void *buf, size_t size);
@@ -895,17 +918,17 @@ public:
flavor -- may be 'intel' or 'att' on x86 targets to specify that style of disassembly
buf -- bytes to be disassembled
size -- (C++) size of the buffer
- Returns an SBInstructionList.")
+ Returns an SBInstructionList.")
GetInstructionsWithFlavor;
lldb::SBInstructionList
GetInstructionsWithFlavor (lldb::SBAddress base_addr, const char *flavor_string, const void *buf, size_t size);
-
+
lldb::SBSymbolContextList
FindSymbols (const char *name, lldb::SymbolType type = eSymbolTypeAny);
bool
GetDescription (lldb::SBStream &description, lldb::DescriptionLevel description_level);
-
+
lldb::addr_t
GetStackRedZoneSize();
@@ -915,6 +938,8 @@ public:
void
SetLaunchInfo (const lldb::SBLaunchInfo &launch_info);
+ lldb::SBStructuredData GetStatistics();
+
bool
operator == (const lldb::SBTarget &rhs) const;
@@ -932,12 +957,12 @@ public:
'''A helper object that will lazily hand out lldb.SBModule objects for a target when supplied an index, or by full or partial path.'''
def __init__(self, sbtarget):
self.sbtarget = sbtarget
-
+
def __len__(self):
if self.sbtarget:
return int(self.sbtarget.GetNumModules())
return 0
-
+
def __getitem__(self, key):
num_modules = self.sbtarget.GetNumModules()
if type(key) is int:
@@ -980,11 +1005,11 @@ public:
else:
print("error: unsupported item type: %s" % type(key))
return None
-
+
def get_modules_access_object(self):
'''An accessor function that returns a modules_access() object which allows lazy module access from a lldb.SBTarget object.'''
return self.modules_access (self)
-
+
def get_modules_array(self):
'''An accessor function that returns a list() that contains all modules in a lldb.SBTarget object.'''
modules = []
@@ -1015,13 +1040,13 @@ public:
__swig_getmethods__["broadcaster"] = GetBroadcaster
if _newclass: broadcaster = property(GetBroadcaster, None, doc='''A read only property that an lldb object that represents the broadcaster (lldb.SBBroadcaster) for this target.''')
-
+
__swig_getmethods__["byte_order"] = GetByteOrder
if _newclass: byte_order = property(GetByteOrder, None, doc='''A read only property that returns an lldb enumeration value (lldb.eByteOrderLittle, lldb.eByteOrderBig, lldb.eByteOrderInvalid) that represents the byte order for this target.''')
-
+
__swig_getmethods__["addr_size"] = GetAddressByteSize
if _newclass: addr_size = property(GetAddressByteSize, None, doc='''A read only property that returns the size in bytes of an address for this target.''')
-
+
__swig_getmethods__["triple"] = GetTriple
if _newclass: triple = property(GetTriple, None, doc='''A read only property that returns the target triple (arch-vendor-os) for this target as a string.''')
diff --git a/scripts/interface/SBThread.i b/scripts/interface/SBThread.i
index c36b1b519e66..60d77c783bb9 100644
--- a/scripts/interface/SBThread.i
+++ b/scripts/interface/SBThread.i
@@ -211,6 +211,11 @@ public:
void
StepOver (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
+ %feature("autodoc",
+ "Do a source level single step over in the currently selected thread.") StepOver;
+ void
+ StepOver (lldb::RunMode stop_other_threads, SBError &error);
+
void
StepInto (lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
@@ -218,7 +223,7 @@ public:
StepInto (const char *target_name, lldb::RunMode stop_other_threads = lldb::eOnlyDuringStepping);
%feature("autodoc", "
- Step the current thread from the current source line to the line given by end_line, stopping if
+ Step the current thread from the current source line to the line given by end_line, stopping if
the thread steps into the function given by target_name. If target_name is None, then stepping will stop
in any of the places we would normally stop.
") StepInto;
@@ -231,12 +236,28 @@ public:
void
StepOut ();
+ %feature("autodoc",
+ "Step out of the currently selected thread.") StepOut;
+ void
+ StepOut (SBError &error);
+
void
- StepOutOfFrame (lldb::SBFrame &frame);
+ StepOutOfFrame (SBFrame &frame);
+
+ %feature("autodoc",
+ "Step out of the specified frame.") StepOutOfFrame;
+ void
+ StepOutOfFrame (SBFrame &frame, SBError &error);
void
StepInstruction(bool step_over);
+ %feature("autodoc",
+ "Do an instruction level single step in the currently selected thread.
+ ") StepInstruction;
+ void
+ StepInstruction(bool step_over, SBError &error);
+
SBError
StepOverUntil (lldb::SBFrame &frame,
lldb::SBFileSpec &file_spec,
@@ -254,6 +275,9 @@ public:
void
RunToAddress (lldb::addr_t addr);
+ void
+ RunToAddress (lldb::addr_t addr, SBError &error);
+
%feature("autodoc", "
Force a return from the frame passed in (and any frames younger than it)
without executing any more code in those frames. If return_value contains
@@ -297,9 +321,15 @@ public:
") Suspend;
bool
Suspend();
+
+ bool
+ Suspend(SBError &error);
bool
Resume ();
+
+ bool
+ Resume (SBError &error);
bool
IsSuspended();
@@ -329,7 +359,7 @@ public:
//--------------------------------------------------------------------------
/// Get the description strings for this thread that match what the
/// lldb driver will present, using the thread-format (stop_format==false)
- /// or thread-stop-format (stop_format = true).
+ /// or thread-stop-format (stop_format = true).
//--------------------------------------------------------------------------
") GetDescription;
bool GetDescription(lldb::SBStream &description, bool stop_format) const;
diff --git a/scripts/interface/SBValue.i b/scripts/interface/SBValue.i
index 2063626fc240..6d06c6ab67c9 100644
--- a/scripts/interface/SBValue.i
+++ b/scripts/interface/SBValue.i
@@ -265,10 +265,10 @@ public:
lldb::SBValue
CreateValueFromAddress(const char* name, lldb::addr_t address, lldb::SBType type);
- lldb::SBValue
- CreateValueFromData (const char* name,
- lldb::SBData data,
- lldb::SBType type);
+ lldb::SBValue
+ CreateValueFromData (const char* name,
+ lldb::SBData data,
+ lldb::SBType type);
lldb::SBType
GetType();
@@ -391,8 +391,8 @@ public:
bool
GetExpressionPath (lldb::SBStream &description);
- %feature("docstring", "
- //------------------------------------------------------------------
+ %feature("docstring", "
+ //------------------------------------------------------------------
/// Get an SBData wrapping what this SBValue points to.
///
/// This method will dereference the current SBValue, if its
@@ -413,13 +413,13 @@ public:
/// An SBData with the contents of the copied items, on success.
/// An empty SBData otherwise.
//------------------------------------------------------------------
- ") GetPointeeData;
- lldb::SBData
- GetPointeeData (uint32_t item_idx = 0,
- uint32_t item_count = 1);
+ ") GetPointeeData;
+ lldb::SBData
+ GetPointeeData (uint32_t item_idx = 0,
+ uint32_t item_count = 1);
%feature("docstring", "
- //------------------------------------------------------------------
+ //------------------------------------------------------------------
/// Get an SBData wrapping the contents of this SBValue.
///
/// This method will read the contents of this object in memory
@@ -429,18 +429,18 @@ public:
/// An SBData with the contents of this SBValue, on success.
/// An empty SBData otherwise.
//------------------------------------------------------------------
- ") GetData;
+ ") GetData;
lldb::SBData
GetData ();
bool
SetData (lldb::SBData &data, lldb::SBError& error);
- lldb::addr_t
- GetLoadAddress();
+ lldb::addr_t
+ GetLoadAddress();
- lldb::SBAddress
- GetAddress();
+ lldb::SBAddress
+ GetAddress();
lldb::SBValue
Persist ();
@@ -455,6 +455,40 @@ public:
'''Helper function for the "SBValue.dynamic" property.'''
return self.GetDynamicValue (eDynamicCanRunTarget)
+ class children_access(object):
+ '''A helper object that will lazily hand out thread for a process when supplied an index.'''
+
+ def __init__(self, sbvalue):
+ self.sbvalue = sbvalue
+
+ def __len__(self):
+ if self.sbvalue:
+ return int(self.sbvalue.GetNumChildren())
+ return 0
+
+ def __getitem__(self, key):
+ if type(key) is int and key < len(self):
+ return self.sbvalue.GetChildAtIndex(key)
+ return None
+
+ def get_child_access_object(self):
+ '''An accessor function that returns a children_access() object which allows lazy member variable access from a lldb.SBValue object.'''
+ return self.children_access (self)
+
+ def get_value_child_list(self):
+ '''An accessor function that returns a list() that contains all children in a lldb.SBValue object.'''
+ children = []
+ accessor = self.get_child_access_object()
+ for idx in range(len(accessor)):
+ children.append(accessor[idx])
+ return children
+
+ __swig_getmethods__["children"] = get_value_child_list
+ if _newclass: children = property(get_value_child_list, None, doc='''A read only property that returns a list() of lldb.SBValue objects for the children of the value.''')
+
+ __swig_getmethods__["child"] = get_child_access_object
+ if _newclass: child = property(get_child_access_object, None, doc='''A read only property that returns an object that can access children of a variable by index (child_value = value.children[12]).''')
+
__swig_getmethods__["name"] = GetName
if _newclass: name = property(GetName, None, doc='''A read only property that returns the name of this value as a string.''')
diff --git a/scripts/macos-setup-codesign.sh b/scripts/macos-setup-codesign.sh
new file mode 100755
index 000000000000..6e8ad768d5fe
--- /dev/null
+++ b/scripts/macos-setup-codesign.sh
@@ -0,0 +1,57 @@
+#!/bin/bash
+
+CERT="lldb_codesign"
+
+function error() {
+ echo error: "$@"
+ exit 1
+}
+
+function cleanup {
+ # Remove generated files
+ rm -f "$TMPDIR/$CERT.tmpl" "$TMPDIR/$CERT.cer" "$TMPDIR/$CERT.key" > /dev/null 2>&1
+}
+
+trap cleanup EXIT
+
+# Check if the certificate is already present in the system keychain
+security find-certificate -Z -p -c "$CERT" /Library/Keychains/System.keychain > /dev/null 2>&1
+if [ $? -eq 0 ]; then
+ echo Certificate has already been generated and installed
+ exit 0
+fi
+
+# Create the certificate template
+cat <<EOF >$TMPDIR/$CERT.tmpl
+[ req ]
+default_bits = 2048 # RSA key size
+encrypt_key = no # Protect private key
+default_md = sha512 # MD to use
+prompt = no # Prompt for DN
+distinguished_name = codesign_dn # DN template
+[ codesign_dn ]
+commonName = "$CERT"
+[ codesign_reqext ]
+keyUsage = critical,digitalSignature
+extendedKeyUsage = critical,codeSigning
+EOF
+
+echo Generating and installing lldb_codesign certificate
+
+# Generate a new certificate
+openssl req -new -newkey rsa:2048 -x509 -days 3650 -nodes -config "$TMPDIR/$CERT.tmpl" -extensions codesign_reqext -batch -out "$TMPDIR/$CERT.cer" -keyout "$TMPDIR/$CERT.key" > /dev/null 2>&1
+[ $? -eq 0 ] || error Something went wrong when generating the certificate
+
+# Install the certificate in the system keychain
+sudo security add-trusted-cert -d -r trustRoot -p codeSign -k /Library/Keychains/System.keychain "$TMPDIR/$CERT.cer" > /dev/null 2>&1
+[ $? -eq 0 ] || error Something went wrong when installing the certificate
+
+# Install the key for the certificate in the system keychain
+sudo security import "$TMPDIR/$CERT.key" -A -k /Library/Keychains/System.keychain > /dev/null 2>&1
+[ $? -eq 0 ] || error Something went wrong when installing the key
+
+# Kill task_for_pid access control daemon
+sudo pkill -f /usr/libexec/taskgated > /dev/null 2>&1
+
+# Exit indicating the certificate is now generated and installed
+exit 0
diff --git a/scripts/sort-pbxproj.rb b/scripts/sort-pbxproj.rb
new file mode 100755
index 000000000000..78bb2a97e957
--- /dev/null
+++ b/scripts/sort-pbxproj.rb
@@ -0,0 +1,251 @@
+#! /usr/bin/ruby
+#
+
+# A script to impose order on the Xcode project file, to make merging
+# across branches were many additional files are present, easier.
+
+
+
+
+## Sort the BuildFile and FileReference sections of an Xcode project file,
+## putting Apple/github-local files at the front to avoid merge conflicts.
+#
+## Run this in a directory with a project.pbxproj file. The sorted version
+## is printed on standard output.
+#
+
+
+# Files with these words in the names will be sorted into a separate section;
+# they are only present in some repositories and so having them intermixed
+# can lead to merge failures.
+segregated_filenames = ["Swift", "repl", "RPC"]
+
+def read_pbxproj(fn)
+ beginning = Array.new # All lines before "PBXBuildFile section"
+ files = Array.new # PBXBuildFile section lines -- sort these
+ middle = Array.new # All lines between PBXBuildFile and PBXFileReference sections
+ refs = Array.new # PBXFileReference section lines -- sort these
+ ending = Array.new # All lines after PBXFileReference section
+
+ all_lines = File.readlines fn
+
+ state = 1 # "begin"
+ all_lines.each do |l|
+ l.chomp
+ if state == 1 && l =~ /Begin PBXBuildFile section/
+ beginning.push(l)
+ state = 2
+ next
+ end
+ if state == 2 && l =~ /End PBXBuildFile section/
+ middle.push(l)
+ state = 3
+ next
+ end
+ if state == 3 && l =~ /Begin PBXFileReference section/
+ middle.push(l)
+ state = 4
+ next
+ end
+ if state == 4 && l =~ /End PBXFileReference section/
+ ending.push(l)
+ state = 5
+ next
+ end
+
+ if state == 1
+ beginning.push(l)
+ elsif state == 2
+ files.push(l)
+ elsif state == 3
+ middle.push(l)
+ elsif state == 4
+ refs.push(l)
+ else
+ ending.push(l)
+ end
+ end
+
+ return beginning, files, middle, refs, ending
+end
+
+xcodeproj_filename = nil
+[ "../lldb.xcodeproj/project.pbxproj", "lldb.xcodeproj/project.pbxproj", "project.pbxproj" ].each do |ent|
+ if File.exists?(ent)
+ xcodeproj_filename = ent
+ break
+ end
+end
+
+if xcodeproj_filename.nil?
+ STDERR.puts "Could not find xcode project file to sort."
+ exit(1)
+end
+
+beginning, files, middle, refs, ending = read_pbxproj(xcodeproj_filename)
+
+
+### If we're given a "canonical" project.pbxproj file, get the uuid and fileref ids for
+### every source file in this project.pbxproj and the canonical one, and fix any of
+### the identifiers that don't match in the project file we're updating.
+### this comes up when people add the file independently on different branches and it
+### gets different identifiers.
+
+if ARGV.size() > 0
+ canonical_pbxproj = nil
+ if ARGV.size == 2 && ARGV[0] == "--canonical"
+ canonical_pbxproj = ARGV[1]
+ elsif ARGV.size == 1 && ARGV[0] =~ /--canonical=(.+)/
+ canonical_pbxproj = $1
+ end
+
+ if File.exists?(canonical_pbxproj)
+ ignore1, canon_files, ignore2, ignore3, ignore4 = read_pbxproj(canonical_pbxproj)
+ canon_files_by_filename = Hash.new { |k, v| k[v] = Array.new }
+
+ canon_files.each do |l|
+ # 2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp */; };
+
+ if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\sin.*?\*\/.*?fileRef = ([A-F0-9]{24})\s.*$/
+ uuid = $1
+ filename = $2
+ fileref = $3
+ canon_files_by_filename[filename].push({ :uuid => uuid, :fileref => fileref })
+ end
+ end
+
+ this_project_files = Hash.new { |k, v| k[v] = Array.new }
+
+ files.each do |l|
+ # 2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp */; };
+
+ if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\sin.*?\*\/.*?fileRef = ([A-F0-9]{24})\s.*$/
+ uuid = $1
+ filename = $2
+ fileref = $3
+ this_project_files[filename].push({ :uuid => uuid, :fileref => fileref })
+ end
+ end
+
+ this_project_files.keys.each do |fn|
+ next if !canon_files_by_filename.has_key?(fn)
+ next if this_project_files[fn].size() > 1 || canon_files_by_filename[fn].size() > 1
+ this_ent = this_project_files[fn][0]
+ canon_ent = canon_files_by_filename[fn][0]
+ if this_ent[:uuid] != canon_ent[:uuid]
+ STDERR.puts "#{fn} has uuid #{this_ent[:uuid]} in this project file, #{canon_ent[:uuid]} in the canonical"
+ [ beginning, files, middle, refs, ending ].each do |arr|
+ arr.each { |l| l.gsub!(this_ent[:uuid], canon_ent[:uuid]) }
+ end
+ end
+ if this_ent[:fileref] != canon_ent[:fileref]
+ STDERR.puts "#{fn} has fileref #{this_ent[:fileref]} in this project file, #{canon_ent[:fileref]} in the canonical"
+ [ beginning, files, middle, refs, ending ].each do |arr|
+ arr.each { |l| l.gsub!(this_ent[:fileref], canon_ent[:fileref]) }
+ end
+ end
+
+ end
+ end
+end
+
+
+
+######### Sort FILES by the filename, putting swift etc in front
+
+# key is filename
+# value is array of text lines for that filename in the FILES text
+# (libraries like libz.dylib seem to occur multiple times, probably
+# once each for different targets).
+
+files_by_filename = Hash.new { |k, v| k[v] = Array.new }
+
+files.each do |l|
+ # 2669421A1A6DC2AC0063BE93 /* MICmdCmdTarget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266941941A6DC2AC0063BE93 /* MICmdCmdTarget.cpp */; };
+
+ if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\sin.*?\*\/.*?fileRef = ([A-F0-9]{24})\s.*$/
+ uuid = $1
+ filename = $2
+ fileref = $3
+ files_by_filename[filename].push(l)
+ end
+
+end
+
+# clear the FILES array
+
+files = Array.new
+
+# add the lines in sorted order. First swift/etc, then everything else.
+
+segregated_filenames.each do |keyword|
+ filenames = files_by_filename.keys
+ filenames.select {|l| l.include?(keyword) }.sort.each do |fn|
+ # re-add all the lines for the filename FN to our FILES array that we'll
+ # be outputting.
+ files_by_filename[fn].sort.each do |l|
+ files.push(l)
+ end
+ files_by_filename.delete(fn)
+ end
+end
+
+# All segregated filenames have been added to the FILES output array.
+# Now add all the other lines, sorted by filename.
+
+files_by_filename.keys.sort.each do |fn|
+ files_by_filename[fn].sort.each do |l|
+ files.push(l)
+ end
+end
+
+######### Sort REFS by the filename, putting swift etc in front
+
+refs_by_filename = Hash.new { |k, v| k[v] = Array.new }
+refs.each do |l|
+ # 2611FF12142D83060017FEA3 /* SBValue.i */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c.preprocessed; path = SBValue.i; sourceTree = "<group>"; };
+
+ if l =~ /^\s+([A-F0-9]{24})\s+\/\*\s+(.*?)\s\*\/.*$/
+ uuid = $1
+ filename = $2
+ refs_by_filename[filename].push(l)
+ end
+end
+
+# clear the refs array
+
+refs = Array.new
+
+# add the lines in sorted order. First swift/etc, then everything else.
+
+
+segregated_filenames.each do |keyword|
+ filenames = refs_by_filename.keys
+ filenames.select {|l| l.include?(keyword) }.sort.each do |fn|
+ # re-add all the lines for the filename FN to our refs array that we'll
+ # be outputting.
+ refs_by_filename[fn].sort.each do |l|
+ refs.push(l)
+ end
+ refs_by_filename.delete(fn)
+ end
+end
+
+# All segregated filenames have been added to the refs output array.
+# Now add all the other lines, sorted by filename.
+
+refs_by_filename.keys.sort.each do |fn|
+ refs_by_filename[fn].sort.each do |l|
+ refs.push(l)
+ end
+end
+
+
+
+####### output the sorted pbxproj
+
+File.open(xcodeproj_filename, 'w') do |outfile|
+ [ beginning, files, middle, refs, ending ].each do |arr|
+ arr.each {|l| outfile.puts l}
+ end
+end
diff --git a/scripts/utilsOsType.py b/scripts/utilsOsType.py
index 5f4a0528bf09..5595541e1a19 100644
--- a/scripts/utilsOsType.py
+++ b/scripts/utilsOsType.py
@@ -44,6 +44,7 @@ else:
"FreeBSD",
"Linux",
"NetBSD",
+ "OpenBSD",
"Windows",
"kFreeBSD"]
@@ -91,6 +92,8 @@ def determine_os_type():
eOSType = EnumOsType.Linux
elif strOS.startswith("netbsd"):
eOSType = EnumOsType.NetBSD
+ elif strOS.startswith("openbsd"):
+ eOSType = EnumOsType.OpenBSD
elif strOS == "win32":
eOSType = EnumOsType.Windows
elif strOS.startswith("gnukfreebsd"):
diff --git a/source/API/CMakeLists.txt b/source/API/CMakeLists.txt
index c96e59be5a44..be9d4115cecc 100644
--- a/source/API/CMakeLists.txt
+++ b/source/API/CMakeLists.txt
@@ -2,16 +2,6 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DEXPORT_LIBLLDB )
endif()
-option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
-
-if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7)
- message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
-endif()
-
-if (LLDB_BUILD_FRAMEWORK AND NOT APPLE)
- message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.")
-endif()
-
get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
add_lldb_library(liblldb SHARED
@@ -101,13 +91,14 @@ add_lldb_library(liblldb SHARED
Support
)
-if (LLVM_ENABLE_WERROR)
- if (MSVC)
- set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
- else()
- set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
- endif()
+add_dependencies(lldb-suite liblldb)
+
+if (MSVC)
+ set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
+else()
+ set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
endif()
+
set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
if (CLANG_CL)
set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING
@@ -119,15 +110,10 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND
PROPERTY COMPILE_FLAGS " -Wno-sequence-point -Wno-cast-qual")
endif ()
-target_link_libraries(liblldb PRIVATE
- lldbPluginScriptInterpreterNone
- lldbPluginScriptInterpreterPython
- )
-
set_target_properties(liblldb
PROPERTIES
VERSION ${LLDB_VERSION}
- )
+)
if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
if (NOT LLDB_EXPORT_ALL_SYMBOLS)
@@ -154,51 +140,9 @@ else()
set_target_properties(liblldb
PROPERTIES
OUTPUT_NAME lldb
- )
+ )
endif()
if (LLDB_WRAP_PYTHON)
add_dependencies(liblldb swig_wrapper)
endif()
-
-if(LLDB_BUILD_FRAMEWORK)
- file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h
- ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
- file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
- file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
- list(REMOVE_ITEM root_public_headers ${root_private_headers})
-
- foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
- get_filename_component(basename ${header} NAME)
- add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
- DEPENDS ${header}
- COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
- list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
- endforeach()
-
- add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}
- COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION})
- add_dependencies(liblldb lldb-framework-headers)
-
- set_target_properties(liblldb PROPERTIES
- OUTPUT_NAME LLDB
- FRAMEWORK On
- FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
- LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
- PUBLIC_HEADER "${framework_headers}")
-
- if(NOT IOS)
- add_custom_command(TARGET liblldb POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
- COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
- COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $<TARGET_FILE_DIR:liblldb>/Resources/Clang
- )
- else()
- add_custom_command(TARGET liblldb POST_BUILD
- COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $<TARGET_FILE_DIR:liblldb>/Headers
- )
- endif()
-
-endif()
-
diff --git a/source/API/SBAddress.cpp b/source/API/SBAddress.cpp
index a3493d7c743f..d12197e66ddd 100644
--- a/source/API/SBAddress.cpp
+++ b/source/API/SBAddress.cpp
@@ -120,10 +120,9 @@ void SBAddress::SetLoadAddress(lldb::addr_t load_addr, lldb::SBTarget &target) {
else
m_opaque_ap->Clear();
- // Check if we weren't were able to resolve a section offset address.
- // If we weren't it is ok, the load address might be a location on the
- // stack or heap, so we should just have an address with no section and
- // a valid offset
+ // Check if we weren't were able to resolve a section offset address. If we
+ // weren't it is ok, the load address might be a location on the stack or
+ // heap, so we should just have an address with no section and a valid offset
if (!m_opaque_ap->IsValid())
m_opaque_ap->SetOffset(load_addr);
}
@@ -163,9 +162,8 @@ Address &SBAddress::ref() {
}
const Address &SBAddress::ref() const {
- // This object should already have checked with "IsValid()"
- // prior to calling this function. In case you didn't we will assert
- // and die to let you know.
+ // This object should already have checked with "IsValid()" prior to calling
+ // this function. In case you didn't we will assert and die to let you know.
assert(m_opaque_ap.get());
return *m_opaque_ap;
}
@@ -242,9 +240,3 @@ SBLineEntry SBAddress::GetLineEntry() {
}
return sb_line_entry;
}
-
-AddressClass SBAddress::GetAddressClass() {
- if (m_opaque_ap->IsValid())
- return m_opaque_ap->GetAddressClass();
- return eAddressClassInvalid;
-}
diff --git a/source/API/SBAttachInfo.cpp b/source/API/SBAttachInfo.cpp
index e6500c468ec5..d6cb212dedf8 100644
--- a/source/API/SBAttachInfo.cpp
+++ b/source/API/SBAttachInfo.cpp
@@ -26,14 +26,16 @@ SBAttachInfo::SBAttachInfo(lldb::pid_t pid)
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for)
: m_opaque_sp(new ProcessAttachInfo()) {
if (path && path[0])
- m_opaque_sp->GetExecutableFile().SetFile(path, false);
+ m_opaque_sp->GetExecutableFile().SetFile(path, false,
+ FileSpec::Style::native);
m_opaque_sp->SetWaitForLaunch(wait_for);
}
SBAttachInfo::SBAttachInfo(const char *path, bool wait_for, bool async)
: m_opaque_sp(new ProcessAttachInfo()) {
if (path && path[0])
- m_opaque_sp->GetExecutableFile().SetFile(path, false);
+ m_opaque_sp->GetExecutableFile().SetFile(path, false,
+ FileSpec::Style::native);
m_opaque_sp->SetWaitForLaunch(wait_for);
m_opaque_sp->SetAsync(async);
}
@@ -77,7 +79,8 @@ void SBAttachInfo::SetProcessPluginName(const char *plugin_name) {
void SBAttachInfo::SetExecutable(const char *path) {
if (path && path[0])
- m_opaque_sp->GetExecutableFile().SetFile(path, false);
+ m_opaque_sp->GetExecutableFile().SetFile(path, false,
+ FileSpec::Style::native);
else
m_opaque_sp->GetExecutableFile().Clear();
}
diff --git a/source/API/SBBreakpointName.cpp b/source/API/SBBreakpointName.cpp
index 2205280b9e5f..a6742e3b89ec 100644
--- a/source/API/SBBreakpointName.cpp
+++ b/source/API/SBBreakpointName.cpp
@@ -52,8 +52,8 @@ public:
bool operator==(const SBBreakpointNameImpl &rhs);
bool operator!=(const SBBreakpointNameImpl &rhs);
- // For now we take a simple approach and only keep the name, and relook
- // up the location when we need it.
+ // For now we take a simple approach and only keep the name, and relook up
+ // the location when we need it.
TargetSP GetTarget() const {
return m_target_wp.lock();
@@ -115,8 +115,7 @@ SBBreakpointName::SBBreakpointName() {}
SBBreakpointName::SBBreakpointName(SBTarget &sb_target, const char *name)
{
m_impl_up.reset(new SBBreakpointNameImpl(sb_target, name));
- // Call FindBreakpointName here to make sure the name is valid, reset if
- // not:
+ // Call FindBreakpointName here to make sure the name is valid, reset if not:
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name)
m_impl_up.reset();
@@ -133,8 +132,7 @@ SBBreakpointName::SBBreakpointName(SBBreakpoint &sb_bkpt, const char *name)
m_impl_up.reset(new SBBreakpointNameImpl(target.shared_from_this(), name));
- // Call FindBreakpointName here to make sure the name is valid, reset if
- // not:
+ // Call FindBreakpointName here to make sure the name is valid, reset if not:
BreakpointName *bp_name = GetBreakpointName();
if (!bp_name) {
m_impl_up.reset();
diff --git a/source/API/SBCommandInterpreter.cpp b/source/API/SBCommandInterpreter.cpp
index c9bb8f65fa2e..cbb514abb6fe 100644
--- a/source/API/SBCommandInterpreter.cpp
+++ b/source/API/SBCommandInterpreter.cpp
@@ -272,8 +272,8 @@ int SBCommandInterpreter::HandleCompletion(
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
int num_completions = 0;
- // Sanity check the arguments that are passed in:
- // cursor & last_char have to be within the current_line.
+ // Sanity check the arguments that are passed in: cursor & last_char have to
+ // be within the current_line.
if (current_line == nullptr || cursor == nullptr || last_char == nullptr)
return 0;
@@ -379,6 +379,23 @@ void SBCommandInterpreter::SetPromptOnQuit(bool b) {
m_opaque_ptr->SetPromptOnQuit(b);
}
+void SBCommandInterpreter::AllowExitCodeOnQuit(bool allow) {
+ if (m_opaque_ptr)
+ m_opaque_ptr->AllowExitCodeOnQuit(allow);
+}
+
+bool SBCommandInterpreter::HasCustomQuitExitCode() {
+ bool exited = false;
+ if (m_opaque_ptr)
+ m_opaque_ptr->GetQuitExitCode(exited);
+ return exited;
+}
+
+int SBCommandInterpreter::GetQuitStatus() {
+ bool exited = false;
+ return (m_opaque_ptr ? m_opaque_ptr->GetQuitExitCode(exited) : 0);
+}
+
void SBCommandInterpreter::ResolveCommand(const char *command_line,
SBCommandReturnObject &result) {
result.Clear();
diff --git a/source/API/SBDebugger.cpp b/source/API/SBDebugger.cpp
index d3294dab582d..a651141003a4 100644
--- a/source/API/SBDebugger.cpp
+++ b/source/API/SBDebugger.cpp
@@ -11,6 +11,9 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+
+#include "SystemInitializerFull.h"
+
#include "lldb/API/SBDebugger.h"
#include "lldb/lldb-private.h"
@@ -35,7 +38,6 @@
#include "lldb/API/SBTypeNameSpecifier.h"
#include "lldb/API/SBTypeSummary.h"
#include "lldb/API/SBTypeSynthetic.h"
-#include "lldb/API/SystemInitializerFull.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
@@ -43,12 +45,14 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/DataFormatters/DataVisualization.h"
+#include "lldb/Host/XML.h"
#include "lldb/Initialization/SystemLifetimeManager.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupPlatform.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/TargetList.h"
+#include "lldb/Utility/Args.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
@@ -166,14 +170,10 @@ SBDebugger SBDebugger::Create(bool source_init_files,
SBDebugger debugger;
// Currently we have issues if this function is called simultaneously on two
- // different
- // threads. The issues mainly revolve around the fact that the
- // lldb_private::FormatManager
- // uses global collections and having two threads parsing the .lldbinit files
- // can cause
- // mayhem. So to get around this for now we need to use a mutex to prevent bad
- // things
- // from happening.
+ // different threads. The issues mainly revolve around the fact that the
+ // lldb_private::FormatManager uses global collections and having two threads
+ // parsing the .lldbinit files can cause mayhem. So to get around this for
+ // now we need to use a mutex to prevent bad things from happening.
static std::recursive_mutex g_mutex;
std::lock_guard<std::recursive_mutex> guard(g_mutex);
@@ -218,10 +218,10 @@ void SBDebugger::Destroy(SBDebugger &debugger) {
}
void SBDebugger::MemoryPressureDetected() {
- // Since this function can be call asynchronously, we allow it to be
- // non-mandatory. We have seen deadlocks with this function when called
- // so we need to safeguard against this until we can determine what is
- // causing the deadlocks.
+ // Since this function can be call asynchronously, we allow it to be non-
+ // mandatory. We have seen deadlocks with this function when called so we
+ // need to safeguard against this until we can determine what is causing the
+ // deadlocks.
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
const bool mandatory = false;
@@ -254,9 +254,9 @@ void SBDebugger::SkipAppInitFiles(bool b) {
m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
}
-// Shouldn't really be settable after initialization as this could cause lots of
-// problems; don't want users
-// trying to switch modes in the middle of a debugging session.
+// Shouldn't really be settable after initialization as this could cause lots
+// of problems; don't want users trying to switch modes in the middle of a
+// debugging session.
void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
@@ -479,8 +479,8 @@ bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
ScriptLanguage
SBDebugger::GetScriptingLanguage(const char *script_language_name) {
if (!script_language_name) return eScriptLanguageDefault;
- return Args::StringToScriptLanguage(llvm::StringRef(script_language_name),
- eScriptLanguageDefault, nullptr);
+ return OptionArgParser::ToScriptLanguage(
+ llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr);
}
const char *SBDebugger::GetVersionString() {
@@ -491,6 +491,38 @@ const char *SBDebugger::StateAsCString(StateType state) {
return lldb_private::StateAsCString(state);
}
+static void AddBoolConfigEntry(StructuredData::Dictionary &dict,
+ llvm::StringRef name, bool value,
+ llvm::StringRef description) {
+ auto entry_up = llvm::make_unique<StructuredData::Dictionary>();
+ entry_up->AddBooleanItem("value", value);
+ entry_up->AddStringItem("description", description);
+ dict.AddItem(name, std::move(entry_up));
+}
+
+static void AddLLVMTargets(StructuredData::Dictionary &dict) {
+ auto array_up = llvm::make_unique<StructuredData::Array>();
+#define LLVM_TARGET(target) \
+ array_up->AddItem(llvm::make_unique<StructuredData::String>(#target));
+#include "llvm/Config/Targets.def"
+ auto entry_up = llvm::make_unique<StructuredData::Dictionary>();
+ entry_up->AddItem("value", std::move(array_up));
+ entry_up->AddStringItem("description", "A list of configured LLVM targets.");
+ dict.AddItem("targets", std::move(entry_up));
+}
+
+SBStructuredData SBDebugger::GetBuildConfiguration() {
+ auto config_up = llvm::make_unique<StructuredData::Dictionary>();
+ AddBoolConfigEntry(
+ *config_up, "xml", XMLDocument::XMLEnabled(),
+ "A boolean value that indicates if XML support is enabled in LLDB");
+ AddLLVMTargets(*config_up);
+
+ SBStructuredData data;
+ data.m_impl_up->SetObjectSP(std::move(config_up));
+ return data;
+}
+
bool SBDebugger::StateIsRunningState(StateType state) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
diff --git a/source/API/SBEvent.cpp b/source/API/SBEvent.cpp
index 17a16ffd0481..65eb71c09285 100644
--- a/source/API/SBEvent.cpp
+++ b/source/API/SBEvent.cpp
@@ -146,8 +146,8 @@ void SBEvent::reset(Event *event_ptr) {
}
bool SBEvent::IsValid() const {
- // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get()
- // accessor. See comments in SBEvent::get()....
+ // Do NOT use m_opaque_ptr directly!!! Must use the SBEvent::get() accessor.
+ // See comments in SBEvent::get()....
return SBEvent::get() != NULL;
}
diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp
index 684a707dda94..5762a75f33d6 100644
--- a/source/API/SBFrame.cpp
+++ b/source/API/SBFrame.cpp
@@ -419,7 +419,7 @@ addr_t SBFrame::GetPC() const {
frame = exe_ctx.GetFramePtr();
if (frame) {
addr = frame->GetFrameCodeAddress().GetOpcodeLoadAddress(
- target, eAddressClassCode);
+ target, AddressClass::eCode);
} else {
if (log)
log->Printf("SBFrame::GetPC () => error: could not reconstruct frame "
diff --git a/source/API/SBHostOS.cpp b/source/API/SBHostOS.cpp
index 90b75a6ecd7b..e56951df43be 100644
--- a/source/API/SBHostOS.cpp
+++ b/source/API/SBHostOS.cpp
@@ -7,6 +7,10 @@
//
//===----------------------------------------------------------------------===//
+#ifndef LLDB_DISABLE_PYTHON
+#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
+#endif
+
#include "lldb/API/SBHostOS.h"
#include "lldb/API/SBError.h"
#include "lldb/Host/Host.h"
@@ -17,6 +21,11 @@
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
+#include "Plugins/ExpressionParser/Clang/ClangHost.h"
+#ifndef LLDB_DISABLE_PYTHON
+#include "Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h"
+#endif
+
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
@@ -30,19 +39,45 @@ SBFileSpec SBHostOS::GetProgramFileSpec() {
}
SBFileSpec SBHostOS::GetLLDBPythonPath() {
- SBFileSpec sb_lldb_python_filespec;
- FileSpec lldb_python_spec;
- if (HostInfo::GetLLDBPath(ePathTypePythonDir, lldb_python_spec)) {
- sb_lldb_python_filespec.SetFileSpec(lldb_python_spec);
- }
- return sb_lldb_python_filespec;
+ return GetLLDBPath(ePathTypePythonDir);
}
SBFileSpec SBHostOS::GetLLDBPath(lldb::PathType path_type) {
- SBFileSpec sb_fspec;
FileSpec fspec;
- if (HostInfo::GetLLDBPath(path_type, fspec))
- sb_fspec.SetFileSpec(fspec);
+ switch (path_type) {
+ case ePathTypeLLDBShlibDir:
+ fspec = HostInfo::GetShlibDir();
+ break;
+ case ePathTypeSupportExecutableDir:
+ fspec = HostInfo::GetSupportExeDir();
+ break;
+ case ePathTypeHeaderDir:
+ fspec = HostInfo::GetHeaderDir();
+ break;
+ case ePathTypePythonDir:
+#ifndef LLDB_DISABLE_PYTHON
+ fspec = ScriptInterpreterPython::GetPythonDir();
+#endif
+ break;
+ case ePathTypeLLDBSystemPlugins:
+ fspec = HostInfo::GetSystemPluginDir();
+ break;
+ case ePathTypeLLDBUserPlugins:
+ fspec = HostInfo::GetUserPluginDir();
+ break;
+ case ePathTypeLLDBTempSystemDir:
+ fspec = HostInfo::GetProcessTempDir();
+ break;
+ case ePathTypeGlobalLLDBTempSystemDir:
+ fspec = HostInfo::GetGlobalTempDir();
+ break;
+ case ePathTypeClangDir:
+ fspec = GetClangResourceDir();
+ break;
+ }
+
+ SBFileSpec sb_fspec;
+ sb_fspec.SetFileSpec(fspec);
return sb_fspec;
}
diff --git a/source/API/SBInstruction.cpp b/source/API/SBInstruction.cpp
index 1cca8db2afe8..462f08288092 100644
--- a/source/API/SBInstruction.cpp
+++ b/source/API/SBInstruction.cpp
@@ -27,12 +27,11 @@
#include "lldb/Utility/DataExtractor.h"
//----------------------------------------------------------------------
-// We recently fixed a leak in one of the Instruction subclasses where
-// the instruction will only hold a weak reference to the disassembler
-// to avoid a cycle that was keeping both objects alive (leak) and we
-// need the InstructionImpl class to make sure our public API behaves
-// as users would expect. Calls in our public API allow clients to do
-// things like:
+// We recently fixed a leak in one of the Instruction subclasses where the
+// instruction will only hold a weak reference to the disassembler to avoid a
+// cycle that was keeping both objects alive (leak) and we need the
+// InstructionImpl class to make sure our public API behaves as users would
+// expect. Calls in our public API allow clients to do things like:
//
// 1 lldb::SBInstruction inst;
// 2 inst = target.ReadInstructions(pc, 1).GetInstructionAtIndex(0)
@@ -40,12 +39,12 @@
// 4 ...
//
// There was a temporary lldb::DisassemblerSP object created in the
-// SBInstructionList that was returned by lldb.target.ReadInstructions()
-// that will go away after line 2 but the "inst" object should be able
-// to still answer questions about itself. So we make sure that any
-// SBInstruction objects that are given out have a strong reference to
-// the disassembler and the instruction so that the object can live and
-// successfully respond to all queries.
+// SBInstructionList that was returned by lldb.target.ReadInstructions() that
+// will go away after line 2 but the "inst" object should be able to still
+// answer questions about itself. So we make sure that any SBInstruction
+// objects that are given out have a strong reference to the disassembler and
+// the instruction so that the object can live and successfully respond to all
+// queries.
//----------------------------------------------------------------------
class InstructionImpl {
public:
@@ -275,10 +274,3 @@ bool SBInstruction::TestEmulation(lldb::SBStream &output_stream,
return inst_sp->TestEmulation(output_stream.get(), test_file);
return false;
}
-
-lldb::AddressClass SBInstruction::GetAddressClass() {
- lldb::InstructionSP inst_sp(GetOpaque());
- if (inst_sp)
- return inst_sp->GetAddressClass();
- return eAddressClassInvalid;
-}
diff --git a/source/API/SBInstructionList.cpp b/source/API/SBInstructionList.cpp
index 3edb9eae98c1..29e0c96075fd 100644
--- a/source/API/SBInstructionList.cpp
+++ b/source/API/SBInstructionList.cpp
@@ -92,8 +92,8 @@ bool SBInstructionList::GetDescription(lldb::SBStream &description) {
if (m_opaque_sp) {
size_t num_instructions = GetSize();
if (num_instructions) {
- // Call the ref() to make sure a stream is created if one deesn't
- // exist already inside description...
+ // Call the ref() to make sure a stream is created if one deesn't exist
+ // already inside description...
Stream &sref = description.ref();
const uint32_t max_opcode_byte_size =
m_opaque_sp->GetInstructionList().GetMaxOpcocdeByteSize();
diff --git a/source/API/SBLaunchInfo.cpp b/source/API/SBLaunchInfo.cpp
index 5f5afccee680..aa1759ab3d00 100644
--- a/source/API/SBLaunchInfo.cpp
+++ b/source/API/SBLaunchInfo.cpp
@@ -16,8 +16,26 @@
using namespace lldb;
using namespace lldb_private;
+class lldb_private::SBLaunchInfoImpl : public ProcessLaunchInfo {
+public:
+ SBLaunchInfoImpl()
+ : ProcessLaunchInfo(), m_envp(GetEnvironment().getEnvp()) {}
+
+ const char *const *GetEnvp() const { return m_envp; }
+ void RegenerateEnvp() { m_envp = GetEnvironment().getEnvp(); }
+
+ SBLaunchInfoImpl &operator=(const ProcessLaunchInfo &rhs) {
+ ProcessLaunchInfo::operator=(rhs);
+ RegenerateEnvp();
+ return *this;
+ }
+
+private:
+ Environment::Envp m_envp;
+};
+
SBLaunchInfo::SBLaunchInfo(const char **argv)
- : m_opaque_sp(new ProcessLaunchInfo()) {
+ : m_opaque_sp(new SBLaunchInfoImpl()) {
m_opaque_sp->GetFlags().Reset(eLaunchFlagDebug | eLaunchFlagDisableASLR);
if (argv && argv[0])
m_opaque_sp->GetArguments().SetArguments(argv);
@@ -25,12 +43,14 @@ SBLaunchInfo::SBLaunchInfo(const char **argv)
SBLaunchInfo::~SBLaunchInfo() {}
-lldb_private::ProcessLaunchInfo &SBLaunchInfo::ref() { return *m_opaque_sp; }
-
const lldb_private::ProcessLaunchInfo &SBLaunchInfo::ref() const {
return *m_opaque_sp;
}
+void SBLaunchInfo::set_ref(const ProcessLaunchInfo &info) {
+ *m_opaque_sp = info;
+}
+
lldb::pid_t SBLaunchInfo::GetProcessID() { return m_opaque_sp->GetProcessID(); }
uint32_t SBLaunchInfo::GetUserID() { return m_opaque_sp->GetUserID(); }
@@ -83,23 +103,22 @@ void SBLaunchInfo::SetArguments(const char **argv, bool append) {
}
uint32_t SBLaunchInfo::GetNumEnvironmentEntries() {
- return m_opaque_sp->GetEnvironmentEntries().GetArgumentCount();
+ return m_opaque_sp->GetEnvironment().size();
}
const char *SBLaunchInfo::GetEnvironmentEntryAtIndex(uint32_t idx) {
- return m_opaque_sp->GetEnvironmentEntries().GetArgumentAtIndex(idx);
+ if (idx > GetNumEnvironmentEntries())
+ return nullptr;
+ return m_opaque_sp->GetEnvp()[idx];
}
void SBLaunchInfo::SetEnvironmentEntries(const char **envp, bool append) {
- if (append) {
- if (envp)
- m_opaque_sp->GetEnvironmentEntries().AppendArguments(envp);
- } else {
- if (envp)
- m_opaque_sp->GetEnvironmentEntries().SetArguments(envp);
- else
- m_opaque_sp->GetEnvironmentEntries().Clear();
- }
+ Environment env(envp);
+ if (append)
+ m_opaque_sp->GetEnvironment().insert(env.begin(), env.end());
+ else
+ m_opaque_sp->GetEnvironment() = env;
+ m_opaque_sp->RegenerateEnvp();
}
void SBLaunchInfo::Clear() { m_opaque_sp->Clear(); }
@@ -129,8 +148,8 @@ void SBLaunchInfo::SetProcessPluginName(const char *plugin_name) {
}
const char *SBLaunchInfo::GetShell() {
- // Constify this string so that it is saved in the string pool. Otherwise
- // it would be freed when this function goes out of scope.
+ // Constify this string so that it is saved in the string pool. Otherwise it
+ // would be freed when this function goes out of scope.
ConstString shell(m_opaque_sp->GetShell().GetPath().c_str());
return shell.AsCString();
}
diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp
index 17f3dcc5656d..3dd99d5321b4 100644
--- a/source/API/SBModule.cpp
+++ b/source/API/SBModule.cpp
@@ -144,7 +144,7 @@ const uint8_t *SBModule::GetUUIDBytes() const {
const uint8_t *uuid_bytes = NULL;
ModuleSP module_sp(GetSP());
if (module_sp)
- uuid_bytes = (const uint8_t *)module_sp->GetUUID().GetBytes();
+ uuid_bytes = module_sp->GetUUID().GetBytes().data();
if (log) {
if (uuid_bytes) {
@@ -165,11 +165,10 @@ const char *SBModule::GetUUIDString() const {
const char *uuid_cstr = NULL;
ModuleSP module_sp(GetSP());
if (module_sp) {
- // We are going to return a "const char *" value through the public
- // API, so we need to constify it so it gets added permanently the
- // string pool and then we don't need to worry about the lifetime of the
- // string as it will never go away once it has been put into the ConstString
- // string pool
+ // We are going to return a "const char *" value through the public API, so
+ // we need to constify it so it gets added permanently the string pool and
+ // then we don't need to worry about the lifetime of the string as it will
+ // never go away once it has been put into the ConstString string pool
uuid_cstr = ConstString(module_sp->GetUUID().GetAsString()).GetCString();
}
@@ -254,6 +253,17 @@ SBCompileUnit SBModule::GetCompileUnitAtIndex(uint32_t index) {
return sb_cu;
}
+SBSymbolContextList
+SBModule::FindCompileUnits(const SBFileSpec &sb_file_spec) {
+ SBSymbolContextList sb_sc_list;
+ const ModuleSP module_sp(GetSP());
+ if (sb_file_spec.IsValid() && module_sp) {
+ const bool append = true;
+ module_sp->FindCompileUnits(*sb_file_spec, append, *sb_sc_list);
+ }
+ return sb_sc_list;
+}
+
static Symtab *GetUnifiedSymbolTable(const lldb::ModuleSP &module_sp) {
if (module_sp) {
SymbolVendor *symbols = module_sp->GetSymbolVendor();
@@ -368,7 +378,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, false, max_matches, variable_list);
+ ConstString(name), NULL, max_matches, variable_list);
if (match_count > 0) {
for (uint32_t i = 0; i < match_count; ++i) {
@@ -515,9 +525,9 @@ const char *SBModule::GetTriple() {
ModuleSP module_sp(GetSP());
if (module_sp) {
std::string triple(module_sp->GetArchitecture().GetTriple().str());
- // Unique the string so we don't run into ownership issues since
- // the const strings put the string into the string pool once and
- // the strings never comes out
+ // Unique the string so we don't run into ownership issues since the const
+ // strings put the string into the string pool once and the strings never
+ // comes out
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
@@ -532,16 +542,29 @@ uint32_t SBModule::GetAddressByteSize() {
}
uint32_t SBModule::GetVersion(uint32_t *versions, uint32_t num_versions) {
- ModuleSP module_sp(GetSP());
- if (module_sp)
- return module_sp->GetVersion(versions, num_versions);
- else {
- if (versions && num_versions) {
- for (uint32_t i = 0; i < num_versions; ++i)
- versions[i] = UINT32_MAX;
- }
- return 0;
- }
+ llvm::VersionTuple version;
+ if (ModuleSP module_sp = GetSP())
+ version = module_sp->GetVersion();
+ uint32_t result = 0;
+ if (!version.empty())
+ ++result;
+ if (version.getMinor())
+ ++result;
+ if(version.getSubminor())
+ ++result;
+
+ if (!versions)
+ return result;
+
+ if (num_versions > 0)
+ versions[0] = version.empty() ? UINT32_MAX : version.getMajor();
+ if (num_versions > 1)
+ versions[1] = version.getMinor().getValueOr(UINT32_MAX);
+ if (num_versions > 2)
+ versions[2] = version.getSubminor().getValueOr(UINT32_MAX);
+ for (uint32_t i = 3; i < num_versions; ++i)
+ versions[i] = UINT32_MAX;
+ return result;
}
lldb::SBFileSpec SBModule::GetSymbolFileSpec() const {
diff --git a/source/API/SBModuleSpec.cpp b/source/API/SBModuleSpec.cpp
index a1c08865c6a4..afabd9ace2b9 100644
--- a/source/API/SBModuleSpec.cpp
+++ b/source/API/SBModuleSpec.cpp
@@ -70,9 +70,9 @@ void SBModuleSpec::SetObjectName(const char *name) {
const char *SBModuleSpec::GetTriple() {
std::string triple(m_opaque_ap->GetArchitecture().GetTriple().str());
- // Unique the string so we don't run into ownership issues since
- // the const strings put the string into the string pool once and
- // the strings never comes out
+ // Unique the string so we don't run into ownership issues since the const
+ // strings put the string into the string pool once and the strings never
+ // comes out
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
@@ -82,15 +82,16 @@ void SBModuleSpec::SetTriple(const char *triple) {
}
const uint8_t *SBModuleSpec::GetUUIDBytes() {
- return (const uint8_t *)m_opaque_ap->GetUUID().GetBytes();
+ return m_opaque_ap->GetUUID().GetBytes().data();
}
size_t SBModuleSpec::GetUUIDLength() {
- return m_opaque_ap->GetUUID().GetByteSize();
+ return m_opaque_ap->GetUUID().GetBytes().size();
}
bool SBModuleSpec::SetUUIDBytes(const uint8_t *uuid, size_t uuid_len) {
- return m_opaque_ap->GetUUID().SetBytes(uuid, uuid_len);
+ m_opaque_ap->GetUUID() = UUID::fromOptionalData(uuid, uuid_len);
+ return m_opaque_ap->GetUUID().IsValid();
}
bool SBModuleSpec::GetDescription(lldb::SBStream &description) {
diff --git a/source/API/SBPlatform.cpp b/source/API/SBPlatform.cpp
index 7ec43f13021f..5f29f0033988 100644
--- a/source/API/SBPlatform.cpp
+++ b/source/API/SBPlatform.cpp
@@ -13,10 +13,10 @@
#include "lldb/API/SBLaunchInfo.h"
#include "lldb/API/SBUnixSignals.h"
#include "lldb/Host/File.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Status.h"
#include "llvm/Support/FileSystem.h"
@@ -53,8 +53,7 @@ struct PlatformConnectOptions {
//----------------------------------------------------------------------
struct PlatformShellCommand {
PlatformShellCommand(const char *shell_command = NULL)
- : m_command(), m_working_dir(), m_status(0), m_signo(0),
- m_timeout_sec(UINT32_MAX) {
+ : m_command(), m_working_dir(), m_status(0), m_signo(0) {
if (shell_command && shell_command[0])
m_command = shell_command;
}
@@ -66,7 +65,7 @@ struct PlatformShellCommand {
std::string m_output;
int m_status;
int m_signo;
- uint32_t m_timeout_sec;
+ Timeout<std::ratio<1>> m_timeout = llvm::None;
};
//----------------------------------------------------------------------
// SBPlatformConnectOptions
@@ -182,11 +181,16 @@ void SBPlatformShellCommand::SetWorkingDirectory(const char *path) {
}
uint32_t SBPlatformShellCommand::GetTimeoutSeconds() {
- return m_opaque_ptr->m_timeout_sec;
+ if (m_opaque_ptr->m_timeout)
+ return m_opaque_ptr->m_timeout->count();
+ return UINT32_MAX;
}
void SBPlatformShellCommand::SetTimeoutSeconds(uint32_t sec) {
- m_opaque_ptr->m_timeout_sec = sec;
+ if (sec == UINT32_MAX)
+ m_opaque_ptr->m_timeout = llvm::None;
+ else
+ m_opaque_ptr->m_timeout = std::chrono::seconds(sec);
}
int SBPlatformShellCommand::GetSignal() { return m_opaque_ptr->m_signo; }
@@ -271,7 +275,7 @@ void SBPlatform::DisconnectRemote() {
bool SBPlatform::IsConnected() {
PlatformSP platform_sp(GetSP());
if (platform_sp)
- platform_sp->IsConnected();
+ return platform_sp->IsConnected();
return false;
}
@@ -326,27 +330,24 @@ const char *SBPlatform::GetHostname() {
}
uint32_t SBPlatform::GetOSMajorVersion() {
- uint32_t major, minor, update;
- PlatformSP platform_sp(GetSP());
- if (platform_sp && platform_sp->GetOSVersion(major, minor, update))
- return major;
- return UINT32_MAX;
+ llvm::VersionTuple version;
+ if (PlatformSP platform_sp = GetSP())
+ version = platform_sp->GetOSVersion();
+ return version.empty() ? UINT32_MAX : version.getMajor();
}
uint32_t SBPlatform::GetOSMinorVersion() {
- uint32_t major, minor, update;
- PlatformSP platform_sp(GetSP());
- if (platform_sp && platform_sp->GetOSVersion(major, minor, update))
- return minor;
- return UINT32_MAX;
+ llvm::VersionTuple version;
+ if (PlatformSP platform_sp = GetSP())
+ version = platform_sp->GetOSVersion();
+ return version.getMinor().getValueOr(UINT32_MAX);
}
uint32_t SBPlatform::GetOSUpdateVersion() {
- uint32_t major, minor, update;
- PlatformSP platform_sp(GetSP());
- if (platform_sp && platform_sp->GetOSVersion(major, minor, update))
- return update;
- return UINT32_MAX;
+ llvm::VersionTuple version;
+ if (PlatformSP platform_sp = GetSP())
+ version = platform_sp->GetOSVersion();
+ return version.getSubminor().getValueOr(UINT32_MAX);
}
SBError SBPlatform::Get(SBFileSpec &src, SBFileSpec &dst) {
@@ -405,18 +406,20 @@ SBError SBPlatform::Run(SBPlatformShellCommand &shell_command) {
if (working_dir)
shell_command.SetWorkingDirectory(working_dir);
}
- return platform_sp->RunShellCommand(
- command, FileSpec{working_dir, false},
- &shell_command.m_opaque_ptr->m_status,
- &shell_command.m_opaque_ptr->m_signo,
- &shell_command.m_opaque_ptr->m_output,
- shell_command.m_opaque_ptr->m_timeout_sec);
+ return platform_sp->RunShellCommand(command, FileSpec{working_dir, false},
+ &shell_command.m_opaque_ptr->m_status,
+ &shell_command.m_opaque_ptr->m_signo,
+ &shell_command.m_opaque_ptr->m_output,
+ shell_command.m_opaque_ptr->m_timeout);
});
}
SBError SBPlatform::Launch(SBLaunchInfo &launch_info) {
return ExecuteConnected([&](const lldb::PlatformSP &platform_sp) {
- return platform_sp->LaunchProcess(launch_info.ref());
+ ProcessLaunchInfo info = launch_info.ref();
+ Status error = platform_sp->LaunchProcess(info);
+ launch_info.set_ref(info);
+ return error;
});
}
diff --git a/source/API/SBProcess.cpp b/source/API/SBProcess.cpp
index e08a7f4b08e0..4d5ddc86ccf9 100644
--- a/source/API/SBProcess.cpp
+++ b/source/API/SBProcess.cpp
@@ -20,13 +20,13 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/State.h"
#include "lldb/Core/StreamFile.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Stream.h"
@@ -140,7 +140,7 @@ bool SBProcess::RemoteLaunch(char const **argv, char const **envp,
if (argv)
launch_info.GetArguments().AppendArguments(argv);
if (envp)
- launch_info.GetEnvironmentEntries().SetArguments(envp);
+ launch_info.GetEnvironment() = Environment(envp);
error.SetError(process_sp->Launch(launch_info));
} else {
error.SetErrorString("must be in eStateConnected to call RemoteLaunch");
@@ -896,8 +896,7 @@ SBProcess SBProcess::GetProcessFromEvent(const SBEvent &event) {
ProcessSP process_sp =
Process::ProcessEventData::GetProcessFromEvent(event.get());
if (!process_sp) {
- // StructuredData events also know the process they come from.
- // Try that.
+ // StructuredData events also know the process they come from. Try that.
process_sp = EventDataStructuredData::GetProcessFromEvent(event.get());
}
@@ -1188,6 +1187,57 @@ uint32_t SBProcess::LoadImage(const lldb::SBFileSpec &sb_local_image_spec,
return LLDB_INVALID_IMAGE_TOKEN;
}
+uint32_t SBProcess::LoadImageUsingPaths(const lldb::SBFileSpec &image_spec,
+ SBStringList &paths,
+ lldb::SBFileSpec &loaded_path,
+ lldb::SBError &error) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
+ ProcessSP process_sp(GetSP());
+ if (process_sp) {
+ Process::StopLocker stop_locker;
+ if (stop_locker.TryLock(&process_sp->GetRunLock())) {
+ if (log)
+ log->Printf("SBProcess(%p)::LoadImageUsingPaths() => "
+ "calling Platform::LoadImageUsingPaths for: %s",
+ static_cast<void *>(process_sp.get()),
+ image_spec.GetFilename());
+
+ std::lock_guard<std::recursive_mutex> guard(
+ process_sp->GetTarget().GetAPIMutex());
+ PlatformSP platform_sp = process_sp->GetTarget().GetPlatform();
+ size_t num_paths = paths.GetSize();
+ std::vector<std::string> paths_vec;
+ paths_vec.reserve(num_paths);
+ for (size_t i = 0; i < num_paths; i++)
+ paths_vec.push_back(paths.GetStringAtIndex(i));
+ FileSpec loaded_spec;
+
+ uint32_t token = platform_sp->LoadImageUsingPaths(process_sp.get(),
+ *image_spec,
+ paths_vec,
+ error.ref(),
+ &loaded_spec);
+ if (token != LLDB_INVALID_IMAGE_TOKEN)
+ loaded_path = loaded_spec;
+ return token;
+ } else {
+ if (log)
+ log->Printf("SBProcess(%p)::LoadImageUsingPaths() => error: "
+ "process is running",
+ static_cast<void *>(process_sp.get()));
+ error.SetErrorString("process is running");
+ }
+ } else {
+ if (log)
+ log->Printf("SBProcess(%p)::LoadImageUsingPaths() => error: "
+ "called with invalid process",
+ static_cast<void *>(process_sp.get()));
+ error.SetErrorString("process is invalid");
+ }
+
+ return LLDB_INVALID_IMAGE_TOKEN;
+}
+
lldb::SBError SBProcess::UnloadImage(uint32_t image_token) {
lldb::SBError sb_error;
ProcessSP process_sp(GetSP());
diff --git a/source/API/SBQueueItem.cpp b/source/API/SBQueueItem.cpp
index 87ba73f9e6d3..aac5844240fb 100644
--- a/source/API/SBQueueItem.cpp
+++ b/source/API/SBQueueItem.cpp
@@ -112,8 +112,7 @@ SBThread SBQueueItem::GetExtendedBacktraceThread(const char *type) {
thread_sp = m_queue_item_sp->GetExtendedBacktraceThread(type_const);
if (thread_sp) {
// Save this in the Process' ExtendedThreadList so a strong pointer
- // retains the
- // object
+ // retains the object
process_sp->GetExtendedThreadList().AddThread(thread_sp);
result.SetThread(thread_sp);
if (log) {
diff --git a/source/API/SBStream.cpp b/source/API/SBStream.cpp
index 159ec07e4e02..d1af77a40fa3 100644
--- a/source/API/SBStream.cpp
+++ b/source/API/SBStream.cpp
@@ -26,8 +26,8 @@ SBStream::~SBStream() {}
bool SBStream::IsValid() const { return (m_opaque_ap.get() != NULL); }
-// If this stream is not redirected to a file, it will maintain a local
-// cache for the stream data which can be accessed using this accessor.
+// If this stream is not redirected to a file, it will maintain a local cache
+// for the stream data which can be accessed using this accessor.
const char *SBStream::GetData() {
if (m_is_file || m_opaque_ap.get() == NULL)
return NULL;
@@ -35,9 +35,8 @@ const char *SBStream::GetData() {
return static_cast<StreamString *>(m_opaque_ap.get())->GetData();
}
-// If this stream is not redirected to a file, it will maintain a local
-// cache for the stream output whose length can be accessed using this
-// accessor.
+// If this stream is not redirected to a file, it will maintain a local cache
+// for the stream output whose length can be accessed using this accessor.
size_t SBStream::GetSize() {
if (m_is_file || m_opaque_ap.get() == NULL)
return 0;
diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp
index 2c1c6bcac71b..550d336906d3 100644
--- a/source/API/SBTarget.cpp
+++ b/source/API/SBTarget.cpp
@@ -23,6 +23,7 @@
#include "lldb/API/SBSourceManager.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
+#include "lldb/API/SBStructuredData.h"
#include "lldb/API/SBSymbolContextList.h"
#include "lldb/Breakpoint/BreakpointID.h"
#include "lldb/Breakpoint/BreakpointIDList.h"
@@ -38,11 +39,11 @@
#include "lldb/Core/STLUtils.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Section.h"
+#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectList.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Host/Host.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/DeclVendor.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -58,11 +59,12 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegularExpression.h"
-#include "../source/Commands/CommandObjectBreakpoint.h"
+#include "Commands/CommandObjectBreakpoint.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Regex.h"
@@ -82,8 +84,8 @@ Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target) {
const auto state = process_sp->GetState();
if (process_sp->IsAlive() && state == eStateConnected) {
// If we are already connected, then we have already specified the
- // listener, so if a valid listener is supplied, we need to error out
- // to let the client know.
+ // listener, so if a valid listener is supplied, we need to error out to
+ // let the client know.
if (attach_info.GetListener())
return Status("process is connected and already has a listener, pass "
"empty listener");
@@ -181,7 +183,31 @@ SBDebugger SBTarget::GetDebugger() const {
return debugger;
}
+SBStructuredData SBTarget::GetStatistics() {
+ SBStructuredData data;
+ TargetSP target_sp(GetSP());
+ if (!target_sp)
+ return data;
+
+ auto stats_up = llvm::make_unique<StructuredData::Dictionary>();
+ int i = 0;
+ for (auto &Entry : target_sp->GetStatistics()) {
+ std::string Desc = lldb_private::GetStatDescription(
+ static_cast<lldb_private::StatisticKind>(i));
+ stats_up->AddIntegerItem(Desc, Entry);
+ i += 1;
+ }
+
+ data.m_impl_up->SetObjectSP(std::move(stats_up));
+ return data;
+}
+
SBProcess SBTarget::LoadCore(const char *core_file) {
+ lldb::SBError error; // Ignored
+ return LoadCore(core_file, error);
+}
+
+SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) {
SBProcess sb_process;
TargetSP target_sp(GetSP());
if (target_sp) {
@@ -189,9 +215,14 @@ SBProcess SBTarget::LoadCore(const char *core_file) {
ProcessSP process_sp(target_sp->CreateProcess(
target_sp->GetDebugger().GetListener(), "", &filespec));
if (process_sp) {
- process_sp->LoadCore();
- sb_process.SetSP(process_sp);
+ error.SetError(process_sp->LoadCore());
+ if (error.Success())
+ sb_process.SetSP(process_sp);
+ } else {
+ error.SetErrorString("Failed to create the process");
}
+ } else {
+ error.SetErrorString("SBTarget is invalid");
}
return sb_process;
}
@@ -267,8 +298,8 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
if (state == eStateConnected) {
// If we are already connected, then we have already specified the
- // listener, so if a valid listener is supplied, we need to error out
- // to let the client know.
+ // listener, so if a valid listener is supplied, we need to error out to
+ // let the client know.
if (listener.IsValid()) {
error.SetErrorString("process is connected and already has a listener, "
"pass empty listener");
@@ -290,7 +321,7 @@ SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
if (argv)
launch_info.GetArguments().AppendArguments(argv);
if (envp)
- launch_info.GetEnvironmentEntries().SetArguments(envp);
+ launch_info.GetEnvironment() = Environment(envp);
if (listener.IsValid())
launch_info.SetListener(listener.GetSP());
@@ -340,7 +371,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
}
}
- lldb_private::ProcessLaunchInfo &launch_info = sb_launch_info.ref();
+ lldb_private::ProcessLaunchInfo launch_info = sb_launch_info.ref();
if (!launch_info.GetExecutableFile()) {
Module *exe_module = target_sp->GetExecutableModulePointer();
@@ -353,6 +384,7 @@ SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) {
launch_info.GetArchitecture() = arch_spec;
error.SetError(target_sp->Launch(launch_info, NULL));
+ sb_launch_info.set_ref(launch_info);
sb_process.SetSP(target_sp->GetProcessSP());
} else {
error.SetErrorString("SBTarget is invalid");
@@ -469,7 +501,8 @@ lldb::SBProcess SBTarget::AttachToProcessWithName(
if (name && target_sp) {
ProcessAttachInfo attach_info;
- attach_info.GetExecutableFile().SetFile(name, false);
+ attach_info.GetExecutableFile().SetFile(name, false,
+ FileSpec::Style::native);
attach_info.SetWaitForLaunch(wait_for);
if (listener.IsValid())
attach_info.SetListener(listener.GetSP());
@@ -1436,10 +1469,10 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
if (target_sp) {
ModuleSpec module_spec;
if (path)
- module_spec.GetFileSpec().SetFile(path, false);
+ module_spec.GetFileSpec().SetFile(path, false, FileSpec::Style::native);
if (uuid_cstr)
- module_spec.GetUUID().SetFromCString(uuid_cstr);
+ module_spec.GetUUID().SetFromStringRef(uuid_cstr);
if (triple)
module_spec.GetArchitecture() = Platform::GetAugmentedArchSpec(
@@ -1448,7 +1481,8 @@ lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
module_spec.GetArchitecture() = target_sp->GetArchitecture();
if (symfile)
- module_spec.GetSymbolFileSpec().SetFile(symfile, false);
+ module_spec.GetSymbolFileSpec().SetFile(symfile, false,
+ FileSpec::Style::native);
sb_module.SetSP(target_sp->GetSharedModule(module_spec));
}
@@ -1510,6 +1544,18 @@ SBModule SBTarget::FindModule(const SBFileSpec &sb_file_spec) {
return sb_module;
}
+SBSymbolContextList
+SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) {
+ SBSymbolContextList sb_sc_list;
+ const TargetSP target_sp(GetSP());
+ if (target_sp && sb_file_spec.IsValid()) {
+ const bool append = true;
+ target_sp->GetImages().FindCompileUnits(*sb_file_spec,
+ append, *sb_sc_list);
+ }
+ return sb_sc_list;
+}
+
lldb::ByteOrder SBTarget::GetByteOrder() {
TargetSP target_sp(GetSP());
if (target_sp)
@@ -1521,9 +1567,9 @@ const char *SBTarget::GetTriple() {
TargetSP target_sp(GetSP());
if (target_sp) {
std::string triple(target_sp->GetArchitecture().GetTriple().str());
- // Unique the string so we don't run into ownership issues since
- // the const strings put the string into the string pool once and
- // the strings never comes out
+ // Unique the string so we don't run into ownership issues since the const
+ // strings put the string into the string pool once and the strings never
+ // comes out
ConstString const_triple(triple.c_str());
return const_triple.GetCString();
}
@@ -1673,8 +1719,8 @@ lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) {
}
}
- // Didn't find the type in the symbols; try the Objective-C runtime
- // if one is installed
+ // Didn't find the type in the symbols; try the Objective-C runtime if one
+ // is installed
ProcessSP process_sp(target_sp->GetProcessSP());
@@ -1782,9 +1828,8 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
TargetSP target_sp(GetSP());
if (name && target_sp) {
VariableList variable_list;
- const bool append = true;
const uint32_t match_count = target_sp->GetImages().FindGlobalVariables(
- ConstString(name), append, max_matches, variable_list);
+ ConstString(name), max_matches, variable_list);
if (match_count > 0) {
ExecutionContextScope *exe_scope = target_sp->GetProcessSP().get();
@@ -1811,23 +1856,22 @@ SBValueList SBTarget::FindGlobalVariables(const char *name,
if (name && target_sp) {
llvm::StringRef name_ref(name);
VariableList variable_list;
- const bool append = true;
std::string regexstr;
uint32_t match_count;
switch (matchtype) {
case eMatchTypeNormal:
match_count = target_sp->GetImages().FindGlobalVariables(
- ConstString(name), append, max_matches, variable_list);
+ ConstString(name), max_matches, variable_list);
break;
case eMatchTypeRegex:
match_count = target_sp->GetImages().FindGlobalVariables(
- RegularExpression(name_ref), append, max_matches, variable_list);
+ RegularExpression(name_ref), max_matches, variable_list);
break;
case eMatchTypeStartsWith:
regexstr = llvm::Regex::escape(name) + ".*";
match_count = target_sp->GetImages().FindGlobalVariables(
- RegularExpression(regexstr), append, max_matches, variable_list);
+ RegularExpression(regexstr), max_matches, variable_list);
break;
}
@@ -2195,7 +2239,7 @@ lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const {
lldb::SBLaunchInfo launch_info(NULL);
TargetSP target_sp(GetSP());
if (target_sp)
- launch_info.ref() = m_opaque_sp->GetProcessLaunchInfo();
+ launch_info.set_ref(m_opaque_sp->GetProcessLaunchInfo());
return launch_info;
}
diff --git a/source/API/SBThread.cpp b/source/API/SBThread.cpp
index b34489603c8a..0d25b85f57d2 100644
--- a/source/API/SBThread.cpp
+++ b/source/API/SBThread.cpp
@@ -615,8 +615,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.
+ // plans executed, and then a "continue" will resume the plan.
if (new_plan != NULL) {
new_plan->SetIsMasterPlan(true);
new_plan->SetOkayToDiscard(false);
@@ -634,6 +633,11 @@ SBError SBThread::ResumeNewPlan(ExecutionContext &exe_ctx,
}
void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+ SBError error; // Ignored
+ StepOver(stop_other_threads, error);
+}
+
+void SBThread::StepOver(lldb::RunMode stop_other_threads, SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
@@ -644,28 +648,29 @@ void SBThread::StepOver(lldb::RunMode stop_other_threads) {
static_cast<void *>(exe_ctx.GetThreadPtr()),
Thread::RunModeAsCString(stop_other_threads));
- if (exe_ctx.HasThreadScope()) {
- Thread *thread = exe_ctx.GetThreadPtr();
- bool abort_other_plans = false;
- StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-
- ThreadPlanSP new_plan_sp;
- if (frame_sp) {
- if (frame_sp->HasDebugInformation()) {
- const LazyBool avoid_no_debug = eLazyBoolCalculate;
- SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
- new_plan_sp = thread->QueueThreadPlanForStepOverRange(
- abort_other_plans, sc.line_entry, sc, stop_other_threads,
- avoid_no_debug);
- } else {
- new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
- true, abort_other_plans, stop_other_threads);
- }
- }
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
+ }
+
+ Thread *thread = exe_ctx.GetThreadPtr();
+ bool abort_other_plans = false;
+ StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
- // This returns an error, we should use it!
- ResumeNewPlan(exe_ctx, new_plan_sp.get());
+ ThreadPlanSP new_plan_sp;
+ if (frame_sp) {
+ if (frame_sp->HasDebugInformation()) {
+ const LazyBool avoid_no_debug = eLazyBoolCalculate;
+ SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+ new_plan_sp = thread->QueueThreadPlanForStepOverRange(
+ abort_other_plans, sc.line_entry, sc, stop_other_threads,
+ avoid_no_debug);
+ } else {
+ new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
+ true, abort_other_plans, stop_other_threads);
+ }
}
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
void SBThread::StepInto(lldb::RunMode stop_other_threads) {
@@ -674,7 +679,7 @@ void SBThread::StepInto(lldb::RunMode stop_other_threads) {
void SBThread::StepInto(const char *target_name,
lldb::RunMode stop_other_threads) {
- SBError error;
+ SBError error; // Ignored
StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads);
}
@@ -692,41 +697,48 @@ void SBThread::StepInto(const char *target_name, uint32_t end_line,
target_name ? target_name : "<NULL>",
Thread::RunModeAsCString(stop_other_threads));
- if (exe_ctx.HasThreadScope()) {
- bool abort_other_plans = false;
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
+ }
- Thread *thread = exe_ctx.GetThreadPtr();
- StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
- ThreadPlanSP new_plan_sp;
+ bool abort_other_plans = false;
- if (frame_sp && frame_sp->HasDebugInformation()) {
- SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
- AddressRange range;
- if (end_line == LLDB_INVALID_LINE_NUMBER)
- range = sc.line_entry.range;
- else {
- if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
- return;
- }
-
- const LazyBool step_out_avoids_code_without_debug_info =
- eLazyBoolCalculate;
- const LazyBool step_in_avoids_code_without_debug_info =
- eLazyBoolCalculate;
- new_plan_sp = thread->QueueThreadPlanForStepInRange(
- abort_other_plans, range, sc, target_name, stop_other_threads,
- step_in_avoids_code_without_debug_info,
- step_out_avoids_code_without_debug_info);
- } else {
- new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
- false, abort_other_plans, stop_other_threads);
+ Thread *thread = exe_ctx.GetThreadPtr();
+ StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
+ ThreadPlanSP new_plan_sp;
+
+ if (frame_sp && frame_sp->HasDebugInformation()) {
+ SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+ AddressRange range;
+ if (end_line == LLDB_INVALID_LINE_NUMBER)
+ range = sc.line_entry.range;
+ else {
+ if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
+ return;
}
- error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+ const LazyBool step_out_avoids_code_without_debug_info =
+ eLazyBoolCalculate;
+ const LazyBool step_in_avoids_code_without_debug_info =
+ eLazyBoolCalculate;
+ new_plan_sp = thread->QueueThreadPlanForStepInRange(
+ abort_other_plans, range, sc, target_name, stop_other_threads,
+ step_in_avoids_code_without_debug_info,
+ step_out_avoids_code_without_debug_info);
+ } else {
+ new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
+ false, abort_other_plans, stop_other_threads);
}
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
void SBThread::StepOut() {
+ SBError error; // Ignored
+ StepOut(error);
+}
+
+void SBThread::StepOut(SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
@@ -736,23 +748,30 @@ void SBThread::StepOut() {
log->Printf("SBThread(%p)::StepOut ()",
static_cast<void *>(exe_ctx.GetThreadPtr()));
- if (exe_ctx.HasThreadScope()) {
- bool abort_other_plans = false;
- bool stop_other_threads = false;
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
+ }
- Thread *thread = exe_ctx.GetThreadPtr();
+ bool abort_other_plans = false;
+ bool stop_other_threads = false;
+
+ Thread *thread = exe_ctx.GetThreadPtr();
- const LazyBool avoid_no_debug = eLazyBoolCalculate;
- ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
- abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
- eVoteNoOpinion, 0, avoid_no_debug));
+ const LazyBool avoid_no_debug = eLazyBoolCalculate;
+ ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
+ abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
+ eVoteNoOpinion, 0, avoid_no_debug));
- // This returns an error, we should use it!
- ResumeNewPlan(exe_ctx, new_plan_sp.get());
- }
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
-void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
+void SBThread::StepOutOfFrame(SBFrame &sb_frame) {
+ SBError error; // Ignored
+ StepOutOfFrame(sb_frame, error);
+}
+
+void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
@@ -763,6 +782,7 @@ void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
log->Printf(
"SBThread(%p)::StepOutOfFrame passed an invalid frame, returning.",
static_cast<void *>(exe_ctx.GetThreadPtr()));
+ error.SetErrorString("passed invalid SBFrame object");
return;
}
@@ -775,27 +795,36 @@ void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
static_cast<void *>(frame_sp.get()), frame_desc_strm.GetData());
}
- if (exe_ctx.HasThreadScope()) {
- bool abort_other_plans = false;
- bool stop_other_threads = false;
- Thread *thread = exe_ctx.GetThreadPtr();
- if (sb_frame.GetThread().GetThreadID() != thread->GetID()) {
- log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another "
- "thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
- static_cast<void *>(exe_ctx.GetThreadPtr()),
- sb_frame.GetThread().GetThreadID(), thread->GetID());
- }
-
- ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
- abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
- eVoteNoOpinion, frame_sp->GetFrameIndex()));
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
+ }
- // This returns an error, we should use it!
- ResumeNewPlan(exe_ctx, new_plan_sp.get());
+ bool abort_other_plans = false;
+ bool stop_other_threads = false;
+ Thread *thread = exe_ctx.GetThreadPtr();
+ if (sb_frame.GetThread().GetThreadID() != thread->GetID()) {
+ log->Printf("SBThread(%p)::StepOutOfFrame passed a frame from another "
+ "thread (0x%" PRIx64 " vrs. 0x%" PRIx64 ", returning.",
+ static_cast<void *>(exe_ctx.GetThreadPtr()),
+ sb_frame.GetThread().GetThreadID(), thread->GetID());
+ error.SetErrorString("passed a frame from another thread");
+ return;
}
+
+ ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
+ abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
+ eVoteNoOpinion, frame_sp->GetFrameIndex()));
+
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
void SBThread::StepInstruction(bool step_over) {
+ SBError error; // Ignored
+ StepInstruction(step_over, error);
+}
+
+void SBThread::StepInstruction(bool step_over, SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
@@ -805,17 +834,24 @@ void SBThread::StepInstruction(bool step_over) {
log->Printf("SBThread(%p)::StepInstruction (step_over=%i)",
static_cast<void *>(exe_ctx.GetThreadPtr()), step_over);
- if (exe_ctx.HasThreadScope()) {
- Thread *thread = exe_ctx.GetThreadPtr();
- ThreadPlanSP new_plan_sp(
- thread->QueueThreadPlanForStepSingleInstruction(step_over, true, true));
-
- // This returns an error, we should use it!
- ResumeNewPlan(exe_ctx, new_plan_sp.get());
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
}
+
+ Thread *thread = exe_ctx.GetThreadPtr();
+ ThreadPlanSP new_plan_sp(
+ thread->QueueThreadPlanForStepSingleInstruction(step_over, true, true));
+
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
void SBThread::RunToAddress(lldb::addr_t addr) {
+ SBError error; // Ignored
+ RunToAddress(addr, error);
+}
+
+void SBThread::RunToAddress(lldb::addr_t addr, SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
@@ -825,20 +861,22 @@ void SBThread::RunToAddress(lldb::addr_t addr) {
log->Printf("SBThread(%p)::RunToAddress (addr=0x%" PRIx64 ")",
static_cast<void *>(exe_ctx.GetThreadPtr()), addr);
- if (exe_ctx.HasThreadScope()) {
- bool abort_other_plans = false;
- bool stop_other_threads = true;
+ if (!exe_ctx.HasThreadScope()) {
+ error.SetErrorString("this SBThread object is invalid");
+ return;
+ }
- Address target_addr(addr);
+ bool abort_other_plans = false;
+ bool stop_other_threads = true;
- Thread *thread = exe_ctx.GetThreadPtr();
+ Address target_addr(addr);
+
+ Thread *thread = exe_ctx.GetThreadPtr();
- ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForRunToAddress(
- abort_other_plans, target_addr, stop_other_threads));
+ ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForRunToAddress(
+ abort_other_plans, target_addr, stop_other_threads));
- // This returns an error, we should use it!
- ResumeNewPlan(exe_ctx, new_plan_sp.get());
- }
+ error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
}
SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame,
@@ -911,8 +949,7 @@ SBError SBThread::StepOverUntil(lldb::SBFrame &sb_frame,
// Grab the current function, then we will make sure the "until" address is
// within the function. We discard addresses that are out of the current
// function, and then if there are no addresses remaining, give an
- // appropriate
- // error message.
+ // appropriate error message.
bool all_in_function = true;
AddressRange fun_range = frame_sc.function->GetAddressRange();
@@ -1084,6 +1121,11 @@ SBError SBThread::UnwindInnermostExpression() {
}
bool SBThread::Suspend() {
+ SBError error; // Ignored
+ return Suspend(error);
+}
+
+bool SBThread::Suspend(SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -1095,11 +1137,13 @@ bool SBThread::Suspend() {
exe_ctx.GetThreadPtr()->SetResumeState(eStateSuspended);
result = true;
} else {
+ error.SetErrorString("process is running");
if (log)
log->Printf("SBThread(%p)::Suspend() => error: process is running",
static_cast<void *>(exe_ctx.GetThreadPtr()));
}
- }
+ } else
+ error.SetErrorString("this SBThread object is invalid");
if (log)
log->Printf("SBThread(%p)::Suspend() => %i",
static_cast<void *>(exe_ctx.GetThreadPtr()), result);
@@ -1107,6 +1151,11 @@ bool SBThread::Suspend() {
}
bool SBThread::Resume() {
+ SBError error; // Ignored
+ return Resume(error);
+}
+
+bool SBThread::Resume(SBError &error) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
std::unique_lock<std::recursive_mutex> lock;
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
@@ -1119,11 +1168,13 @@ bool SBThread::Resume() {
exe_ctx.GetThreadPtr()->SetResumeState(eStateRunning, override_suspend);
result = true;
} else {
+ error.SetErrorString("process is running");
if (log)
log->Printf("SBThread(%p)::Resume() => error: process is running",
static_cast<void *>(exe_ctx.GetThreadPtr()));
}
- }
+ } else
+ error.SetErrorString("this SBThread object is invalid");
if (log)
log->Printf("SBThread(%p)::Resume() => %i",
static_cast<void *>(exe_ctx.GetThreadPtr()), result);
@@ -1374,8 +1425,7 @@ SBThread SBThread::GetExtendedBacktraceThread(const char *type) {
runtime->GetExtendedBacktraceThread(real_thread, type_const));
if (new_thread_sp) {
// Save this in the Process' ExtendedThreadList so a strong
- // pointer retains the
- // object.
+ // pointer retains the object.
process->GetExtendedThreadList().AddThread(new_thread_sp);
sb_origin_thread.SetThread(new_thread_sp);
if (log) {
diff --git a/source/API/SBThreadPlan.cpp b/source/API/SBThreadPlan.cpp
index a19023f66de2..131f84195908 100644
--- a/source/API/SBThreadPlan.cpp
+++ b/source/API/SBThreadPlan.cpp
@@ -138,8 +138,7 @@ bool SBThreadPlan::IsValid() {
// plans...
//
// FIXME, you should only be able to queue thread plans from inside the methods
-// of a
-// Scripted Thread Plan. Need a way to enforce that.
+// of a Scripted Thread Plan. Need a way to enforce that.
SBThreadPlan
SBThreadPlan::QueueThreadPlanForStepOverRange(SBAddress &sb_start_address,
diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp
index 80d48754c89b..e199b7a33e48 100644
--- a/source/API/SBType.cpp
+++ b/source/API/SBType.cpp
@@ -88,9 +88,9 @@ TypeImpl &SBType::ref() {
}
const TypeImpl &SBType::ref() const {
- // "const SBAddress &addr" should already have checked "addr.IsValid()"
- // prior to calling this function. In case you didn't we will assert
- // and die to let you know.
+ // "const SBAddress &addr" should already have checked "addr.IsValid()" prior
+ // to calling this function. In case you didn't we will assert and die to let
+ // you know.
assert(m_opaque_sp.get());
return *m_opaque_sp;
}
diff --git a/source/API/SBTypeCategory.cpp b/source/API/SBTypeCategory.cpp
index 38e7cca35dfd..30414bd728cb 100644
--- a/source/API/SBTypeCategory.cpp
+++ b/source/API/SBTypeCategory.cpp
@@ -341,9 +341,9 @@ bool SBTypeCategory::AddTypeSummary(SBTypeNameSpecifier type_name,
// FIXME: we need to iterate over all the Debugger objects and have each of
// them contain a copy of the function
// since we currently have formatters live in a global space, while Python
- // code lives in a specific Debugger-related environment
- // this should eventually be fixed by deciding a final location in the LLDB
- // object space for formatters
+ // code lives in a specific Debugger-related environment this should
+ // eventually be fixed by deciding a final location in the LLDB object space
+ // for formatters
if (summary.IsFunctionCode()) {
const void *name_token =
(const void *)ConstString(type_name.GetName()).GetCString();
@@ -453,9 +453,9 @@ bool SBTypeCategory::AddTypeSynthetic(SBTypeNameSpecifier type_name,
// FIXME: we need to iterate over all the Debugger objects and have each of
// them contain a copy of the function
// since we currently have formatters live in a global space, while Python
- // code lives in a specific Debugger-related environment
- // this should eventually be fixed by deciding a final location in the LLDB
- // object space for formatters
+ // code lives in a specific Debugger-related environment this should
+ // eventually be fixed by deciding a final location in the LLDB object space
+ // for formatters
if (synth.IsClassCode()) {
const void *name_token =
(const void *)ConstString(type_name.GetName()).GetCString();
diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp
index b6f044c61a78..a270c0471e9f 100644
--- a/source/API/SBValue.cpp
+++ b/source/API/SBValue.cpp
@@ -89,16 +89,13 @@ public:
// FIXME: This check is necessary but not sufficient. We for sure don't
// want to touch SBValues whose owning
// targets have gone away. This check is a little weak in that it
- // enforces that restriction when you call
- // IsValid, but since IsValid doesn't lock the target, you have no
- // guarantee that the SBValue won't go
- // invalid after you call this...
- // Also, an SBValue could depend on data from one of the modules in the
- // target, and those could go away
- // independently of the target, for instance if a module is unloaded. But
- // right now, neither SBValues
- // nor ValueObjects know which modules they depend on. So I have no good
- // way to make that check without
+ // enforces that restriction when you call IsValid, but since IsValid
+ // doesn't lock the target, you have no guarantee that the SBValue won't
+ // go invalid after you call this... Also, an SBValue could depend on
+ // data from one of the modules in the target, and those could go away
+ // independently of the target, for instance if a module is unloaded.
+ // But right now, neither SBValues nor ValueObjects know which modules
+ // they depend on. So I have no good way to make that check without
// tracking that in all the ValueObject subclasses.
TargetSP target_sp = m_valobj_sp->GetTargetSP();
if (target_sp && target_sp->IsValid())
@@ -129,9 +126,9 @@ public:
ProcessSP process_sp(value_sp->GetProcessSP());
if (process_sp && !stop_locker.TryLock(&process_sp->GetRunLock())) {
- // We don't allow people to play around with ValueObject if the process is
- // running.
- // If you want to look at values, pause the process, then look.
+ // We don't allow people to play around with ValueObject if the process
+ // is running. If you want to look at values, pause the process, then
+ // look.
if (log)
log->Printf("SBValue(%p)::GetSP() => error: process is running",
static_cast<void *>(value_sp.get()));
@@ -171,10 +168,8 @@ public:
// All the derived values that we would make from the m_valobj_sp will share
// the ExecutionContext with m_valobj_sp, so we don't need to do the
- // calculations
- // in GetSP to return the Target, Process, Thread or Frame. It is convenient
- // to
- // provide simple accessors for these, which I do here.
+ // calculations in GetSP to return the Target, Process, Thread or Frame. It
+ // is convenient to provide simple accessors for these, which I do here.
TargetSP GetTargetSP() {
if (m_valobj_sp)
return m_valobj_sp->GetTargetSP();
@@ -242,9 +237,9 @@ SBValue &SBValue::operator=(const SBValue &rhs) {
SBValue::~SBValue() {}
bool SBValue::IsValid() {
- // 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.
+ // 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;
}
@@ -1397,11 +1392,9 @@ lldb::SBAddress SBValue::GetAddress() {
if (module_sp)
module_sp->ResolveFileAddress(value, addr);
} else if (addr_type == eAddressTypeLoad) {
- // no need to check the return value on this.. if it can actually do the
- // resolve
- // addr will be in the form (section,offset), otherwise it will simply
- // be returned
- // as (NULL, value)
+ // no need to check the return value on this.. if it can actually do
+ // the resolve addr will be in the form (section,offset), otherwise it
+ // will simply be returned as (NULL, value)
addr.SetLoadAddress(value, target_sp.get());
}
}
diff --git a/source/API/SystemInitializerFull.cpp b/source/API/SystemInitializerFull.cpp
index 977ebe62353e..18de376183c7 100644
--- a/source/API/SystemInitializerFull.cpp
+++ b/source/API/SystemInitializerFull.cpp
@@ -11,7 +11,7 @@
#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
#endif
-#include "lldb/API/SystemInitializerFull.h"
+#include "SystemInitializerFull.h"
#include "lldb/API/SBCommandInterpreter.h"
@@ -43,6 +43,7 @@
#include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h"
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
#include "Plugins/Architecture/Arm/ArchitectureArm.h"
+#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h"
#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h"
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
@@ -50,6 +51,7 @@
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
+#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
@@ -68,6 +70,9 @@
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
+#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#include "Plugins/OperatingSystem/Go/OperatingSystemGo.h"
#include "Plugins/OperatingSystem/Python/OperatingSystemPython.h"
#include "Plugins/Platform/Android/PlatformAndroid.h"
@@ -82,6 +87,7 @@
#include "Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h"
#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemote.h"
+#include "Plugins/Process/mach-core/ProcessMachCore.h"
#include "Plugins/Process/minidump/ProcessMinidump.h"
#include "Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
@@ -102,7 +108,6 @@
#include "Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.h"
#include "Plugins/Platform/MacOSX/PlatformiOSSimulator.h"
#include "Plugins/Process/MacOSX-Kernel/ProcessKDP.h"
-#include "Plugins/Process/mach-core/ProcessMachCore.h"
#include "Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.h"
#endif
#include "Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h"
@@ -136,11 +141,10 @@ extern "C" void init_lldb(void);
#define LLDBSwigPyInit init_lldb
#endif
-// these are the Pythonic implementations of the required callbacks
-// these are scripting-language specific, which is why they belong here
-// we still need to use function pointers to them instead of relying
-// on linkage-time resolution because the SWIG stuff and this file
-// get built at different times
+// these are the Pythonic implementations of the required callbacks these are
+// scripting-language specific, which is why they belong here we still need to
+// use function pointers to them instead of relying on linkage-time resolution
+// because the SWIG stuff and this file get built at different times
extern "C" bool LLDBSwigPythonBreakpointCallbackFunction(
const char *python_function_name, const char *session_dictionary_name,
const lldb::StackFrameSP &sb_frame,
@@ -250,6 +254,11 @@ SystemInitializerFull::~SystemInitializerFull() {}
void SystemInitializerFull::Initialize() {
SystemInitializerCommon::Initialize();
+
+ ObjectFileELF::Initialize();
+ ObjectFileMachO::Initialize();
+ ObjectFilePECOFF::Initialize();
+
ScriptInterpreterNone::Initialize();
#ifndef LLDB_DISABLE_PYTHON
@@ -260,10 +269,9 @@ void SystemInitializerFull::Initialize() {
#if !defined(LLDB_DISABLE_PYTHON)
InitializeSWIG();
- // ScriptInterpreterPython::Initialize() depends on things like HostInfo being
- // initialized
- // so it can compute the python directory etc, so we need to do this after
- // SystemInitializerCommon::Initialize().
+ // ScriptInterpreterPython::Initialize() depends on things like HostInfo
+ // being initialized so it can compute the python directory etc, so we need
+ // to do this after SystemInitializerCommon::Initialize().
ScriptInterpreterPython::Initialize();
#endif
@@ -307,11 +315,13 @@ void SystemInitializerFull::Initialize() {
ABISysV_s390x::Initialize();
ArchitectureArm::Initialize();
+ ArchitecturePPC64::Initialize();
DisassemblerLLVMC::Initialize();
JITLoaderGDB::Initialize();
ProcessElfCore::Initialize();
+ ProcessMachCore::Initialize();
minidump::ProcessMinidump::Initialize();
MemoryHistoryASan::Initialize();
AddressSanitizerRuntime::Initialize();
@@ -326,6 +336,7 @@ void SystemInitializerFull::Initialize() {
UnwindAssemblyInstEmulation::Initialize();
UnwindAssembly_x86::Initialize();
EmulateInstructionARM64::Initialize();
+ EmulateInstructionPPC64::Initialize();
SymbolFileDWARFDebugMap::Initialize();
ItaniumABILanguageRuntime::Initialize();
AppleObjCRuntimeV2::Initialize();
@@ -351,7 +362,6 @@ void SystemInitializerFull::Initialize() {
#if defined(__APPLE__)
SymbolVendorMacOSX::Initialize();
ProcessKDP::Initialize();
- ProcessMachCore::Initialize();
PlatformAppleTVSimulator::Initialize();
PlatformAppleWatchSimulator::Initialize();
PlatformRemoteAppleTV::Initialize();
@@ -359,8 +369,8 @@ void SystemInitializerFull::Initialize() {
DynamicLoaderDarwinKernel::Initialize();
#endif
- // This plugin is valid on any host that talks to a Darwin remote.
- // It shouldn't be limited to __APPLE__.
+ // This plugin is valid on any host that talks to a Darwin remote. It
+ // shouldn't be limited to __APPLE__.
StructuredDataDarwinLog::Initialize();
//----------------------------------------------------------------------
@@ -378,8 +388,8 @@ void SystemInitializerFull::Initialize() {
// Scan for any system or user LLDB plug-ins
PluginManager::Initialize();
- // The process settings need to know about installed plug-ins, so the Settings
- // must be initialized
+ // The process settings need to know about installed plug-ins, so the
+ // Settings must be initialized
// AFTER PluginManager::Initialize is called.
Debugger::SettingsInitialize();
@@ -438,6 +448,7 @@ void SystemInitializerFull::Terminate() {
JITLoaderGDB::Terminate();
ProcessElfCore::Terminate();
+ ProcessMachCore::Terminate();
minidump::ProcessMinidump::Terminate();
MemoryHistoryASan::Terminate();
AddressSanitizerRuntime::Terminate();
@@ -451,6 +462,7 @@ void SystemInitializerFull::Terminate() {
UnwindAssembly_x86::Terminate();
UnwindAssemblyInstEmulation::Terminate();
EmulateInstructionARM64::Terminate();
+ EmulateInstructionPPC64::Terminate();
SymbolFileDWARFDebugMap::Terminate();
ItaniumABILanguageRuntime::Terminate();
AppleObjCRuntimeV2::Terminate();
@@ -468,7 +480,6 @@ void SystemInitializerFull::Terminate() {
#if defined(__APPLE__)
DynamicLoaderDarwinKernel::Terminate();
- ProcessMachCore::Terminate();
ProcessKDP::Terminate();
SymbolVendorMacOSX::Terminate();
PlatformAppleTVSimulator::Terminate();
@@ -511,6 +522,10 @@ void SystemInitializerFull::Terminate() {
PlatformDarwinKernel::Terminate();
#endif
+ ObjectFileELF::Terminate();
+ ObjectFileMachO::Terminate();
+ ObjectFilePECOFF::Terminate();
+
// Now shutdown the common parts, in reverse order.
SystemInitializerCommon::Terminate();
}
diff --git a/include/lldb/API/SystemInitializerFull.h b/source/API/SystemInitializerFull.h
index 9cfc6896da61..9cfc6896da61 100644
--- a/include/lldb/API/SystemInitializerFull.h
+++ b/source/API/SystemInitializerFull.h
diff --git a/source/Breakpoint/Breakpoint.cpp b/source/Breakpoint/Breakpoint.cpp
index 3f6c63e1e5ba..1dc029654bfc 100644
--- a/source/Breakpoint/Breakpoint.cpp
+++ b/source/Breakpoint/Breakpoint.cpp
@@ -23,6 +23,7 @@
#include "lldb/Core/ModuleList.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Section.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
@@ -284,13 +285,13 @@ void Breakpoint::RemoveInvalidLocations(const ArchSpec &arch) {
m_locations.RemoveInvalidLocations(arch);
}
-// For each of the overall options we need to decide how they propagate to
-// the location options. This will determine the precedence of options on
-// the breakpoint vs. its locations.
+// For each of the overall options we need to decide how they propagate to the
+// location options. This will determine the precedence of options on the
+// breakpoint vs. its locations.
-// Disable at the breakpoint level should override the location settings.
-// That way you can conveniently turn off a whole breakpoint without messing
-// up the individual settings.
+// Disable at the breakpoint level should override the location settings. That
+// way you can conveniently turn off a whole breakpoint without messing up the
+// individual settings.
void Breakpoint::SetEnabled(bool enable) {
if (enable == m_options_up->IsEnabled())
@@ -330,10 +331,8 @@ bool Breakpoint::IgnoreCountShouldStop() {
uint32_t ignore = GetIgnoreCount();
if (ignore != 0) {
// When we get here we know the location that caused the stop doesn't have
- // an ignore count,
- // since by contract we call it first... So we don't have to find &
- // decrement it, we only have
- // to decrement our own ignore count.
+ // an ignore count, since by contract we call it first... So we don't have
+ // to find & decrement it, we only have to decrement our own ignore count.
DecrementIgnoreCount();
return false;
} else
@@ -430,8 +429,8 @@ const char *Breakpoint::GetConditionText() const {
// This function is used when "baton" doesn't need to be freed
void Breakpoint::SetCallback(BreakpointHitCallback callback, void *baton,
bool is_synchronous) {
- // The default "Baton" class will keep a copy of "baton" and won't free
- // or delete it when it goes goes out of scope.
+ // The default "Baton" class will keep a copy of "baton" and won't free or
+ // delete it when it goes goes out of scope.
m_options_up->SetCallback(callback, std::make_shared<UntypedBaton>(baton),
is_synchronous);
@@ -477,8 +476,7 @@ void Breakpoint::ResolveBreakpointInModules(ModuleList &module_list,
bool send_event) {
if (m_resolver_sp) {
// If this is not an internal breakpoint, set up to record the new
- // locations, then dispatch
- // an event with the new locations.
+ // locations, then dispatch an event with the new locations.
if (!IsInternal() && send_event) {
BreakpointEventData *new_locations_event = new BreakpointEventData(
eBreakpointEventTypeLocationsAdded, shared_from_this());
@@ -516,8 +514,8 @@ void Breakpoint::ModulesChanged(ModuleList &module_list, bool load,
std::lock_guard<std::recursive_mutex> guard(module_list.GetMutex());
if (load) {
// The logic for handling new modules is:
- // 1) If the filter rejects this module, then skip it.
- // 2) Run through the current location list and if there are any locations
+ // 1) If the filter rejects this module, then skip it. 2) Run through the
+ // current location list and if there are any locations
// for that module, we mark the module as "seen" and we don't try to
// re-resolve
// breakpoint locations for that module.
@@ -527,20 +525,37 @@ void Breakpoint::ModulesChanged(ModuleList &module_list, bool load,
ModuleList new_modules; // We'll stuff the "unseen" modules in this list,
// and then resolve
- // them after the locations pass. Have to do it this way because
- // resolving breakpoints will add new locations potentially.
+ // them after the locations pass. Have to do it this way because resolving
+ // breakpoints will add new locations potentially.
for (ModuleSP module_sp : module_list.ModulesNoLocking()) {
bool seen = false;
if (!m_filter_sp->ModulePasses(module_sp))
continue;
+ BreakpointLocationCollection locations_with_no_section;
for (BreakpointLocationSP break_loc_sp :
m_locations.BreakpointLocations()) {
+
+ // If the section for this location was deleted, that means it's Module
+ // has gone away but somebody forgot to tell us. Let's clean it up
+ // here.
+ Address section_addr(break_loc_sp->GetAddress());
+ if (section_addr.SectionWasDeleted()) {
+ locations_with_no_section.Add(break_loc_sp);
+ continue;
+ }
+
if (!break_loc_sp->IsEnabled())
continue;
- SectionSP section_sp(break_loc_sp->GetAddress().GetSection());
- if (!section_sp || section_sp->GetModule() == module_sp) {
+
+ SectionSP section_sp(section_addr.GetSection());
+
+ // If we don't have a Section, that means this location is a raw
+ // address that we haven't resolved to a section yet. So we'll have to
+ // look in all the new modules to resolve this location. Otherwise, if
+ // it was set in this module, re-resolve it here.
+ if (section_sp && section_sp->GetModule() == module_sp) {
if (!seen)
seen = true;
@@ -552,6 +567,11 @@ void Breakpoint::ModulesChanged(ModuleList &module_list, bool load,
}
}
}
+
+ size_t num_to_delete = locations_with_no_section.GetSize();
+
+ for (size_t i = 0; i < num_to_delete; i++)
+ m_locations.RemoveLocation(locations_with_no_section.GetByIndex(i));
if (!seen)
new_modules.AppendIfNeeded(module_sp);
@@ -583,10 +603,9 @@ void Breakpoint::ModulesChanged(ModuleList &module_list, bool load,
BreakpointLocationSP break_loc_sp(m_locations.GetByIndex(loc_idx));
SectionSP section_sp(break_loc_sp->GetAddress().GetSection());
if (section_sp && section_sp->GetModule() == module_sp) {
- // Remove this breakpoint since the shared library is
- // unloaded, but keep the breakpoint location around
- // so we always get complete hit count and breakpoint
- // lifetime info
+ // Remove this breakpoint since the shared library is unloaded, but
+ // keep the breakpoint location around so we always get complete
+ // hit count and breakpoint lifetime info
break_loc_sp->ClearBreakpointSite();
if (removed_locations_event) {
removed_locations_event->GetBreakpointLocationCollection().Add(
@@ -614,7 +633,8 @@ static bool SymbolContextsMightBeEquivalent(SymbolContext &old_sc,
bool equivalent_scs = false;
if (old_sc.module_sp.get() == new_sc.module_sp.get()) {
- // If these come from the same module, we can directly compare the pointers:
+ // If these come from the same module, we can directly compare the
+ // pointers:
if (old_sc.comp_unit && new_sc.comp_unit &&
(old_sc.comp_unit == new_sc.comp_unit)) {
if (old_sc.function && new_sc.function &&
@@ -671,15 +691,13 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
temp_list.Append(new_module_sp);
ResolveBreakpointInModules(temp_list);
} else {
- // First search the new module for locations.
- // Then compare this with the old list, copy over locations that "look the
- // same"
- // Then delete the old locations.
- // Finally remember to post the creation event.
+ // First search the new module for locations. Then compare this with the
+ // old list, copy over locations that "look the same" Then delete the old
+ // locations. Finally remember to post the creation event.
//
- // Two locations are the same if they have the same comp unit & function (by
- // name) and there are the same number
- // of locations in the old function as in the new one.
+ // Two locations are the same if they have the same comp unit & function
+ // (by name) and there are the same number of locations in the old function
+ // as in the new one.
ModuleList temp_list;
temp_list.Append(new_module_sp);
@@ -692,8 +710,8 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
if (num_new_locations > 0) {
// Break out the case of one location -> one location since that's the
- // most common one, and there's no need
- // to build up the structures needed for the merge in that case.
+ // most common one, and there's no need to build up the structures needed
+ // for the merge in that case.
if (num_new_locations == 1 && num_old_locations == 1) {
bool equivalent_locations = false;
SymbolContext old_sc, new_sc;
@@ -716,8 +734,7 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
}
} else {
// We don't want to have to keep computing the SymbolContexts for these
- // addresses over and over,
- // so lets get them up front:
+ // addresses over and over, so lets get them up front:
typedef std::map<lldb::break_id_t, SymbolContext> IDToSCMap;
IDToSCMap old_sc_map;
@@ -740,7 +757,8 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
lldb::break_id_t old_id = old_sc_map.begin()->first;
SymbolContext &old_sc = old_sc_map.begin()->second;
- // Count the number of entries equivalent to this SC for the old list:
+ // Count the number of entries equivalent to this SC for the old
+ // list:
std::vector<lldb::break_id_t> old_id_vec;
old_id_vec.push_back(old_id);
@@ -760,17 +778,15 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
}
// Alright, if we have the same number of potentially equivalent
- // locations in the old
- // and new modules, we'll just map them one to one in ascending ID
- // order (assuming the
- // resolver's order would match the equivalent ones.
- // Otherwise, we'll dump all the old ones, and just take the new ones,
- // erasing the elements
- // from both maps as we go.
+ // locations in the old and new modules, we'll just map them one to
+ // one in ascending ID order (assuming the resolver's order would
+ // match the equivalent ones. Otherwise, we'll dump all the old ones,
+ // and just take the new ones, erasing the elements from both maps as
+ // we go.
if (old_id_vec.size() == new_id_vec.size()) {
- sort(old_id_vec.begin(), old_id_vec.end());
- sort(new_id_vec.begin(), new_id_vec.end());
+ llvm::sort(old_id_vec.begin(), old_id_vec.end());
+ llvm::sort(new_id_vec.begin(), new_id_vec.end());
size_t num_elements = old_id_vec.size();
for (size_t idx = 0; idx < num_elements; idx++) {
BreakpointLocationSP old_loc_sp =
@@ -798,11 +814,9 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
}
// Now remove the remaining old locations, and cons up a removed locations
- // event.
- // Note, we don't put the new locations that were swapped with an old
- // location on the locations_to_remove
- // list, so we don't need to worry about telling the world about removing a
- // location we didn't tell them
+ // event. Note, we don't put the new locations that were swapped with an
+ // old location on the locations_to_remove list, so we don't need to worry
+ // about telling the world about removing a location we didn't tell them
// about adding.
BreakpointEventData *locations_event;
@@ -838,8 +852,8 @@ void Breakpoint::ModuleReplaced(ModuleSP old_module_sp,
void Breakpoint::Dump(Stream *) {}
size_t Breakpoint::GetNumResolvedLocations() const {
- // Return the number of breakpoints that are actually resolved and set
- // down in the inferior process.
+ // Return the number of breakpoints that are actually resolved and set down
+ // in the inferior process.
return m_locations.GetNumResolvedLocations();
}
@@ -866,9 +880,8 @@ void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level,
const size_t num_resolved_locations = GetNumResolvedLocations();
// They just made the breakpoint, they don't need to be told HOW they made
- // it...
- // Also, we'll print the breakpoint number differently depending on whether
- // there is 1 or more locations.
+ // it... Also, we'll print the breakpoint number differently depending on
+ // whether there is 1 or more locations.
if (level != eDescriptionLevelInitial) {
s->Printf("%i: ", GetID());
GetResolverDescription(s);
@@ -885,8 +898,7 @@ void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level,
(uint64_t)num_resolved_locations, GetHitCount());
} else {
// Don't print the pending notification for exception resolvers since we
- // don't generally
- // know how to set them until the target is run.
+ // don't generally know how to set them until the target is run.
if (m_resolver_sp->getResolverID() !=
BreakpointResolver::ExceptionResolver)
s->Printf(", locations = 0 (pending)");
@@ -942,8 +954,7 @@ void Breakpoint::GetDescription(Stream *s, lldb::DescriptionLevel level,
}
// The brief description is just the location name (1.2 or whatever). That's
- // pointless to
- // show in the breakpoint's description, so suppress it.
+ // pointless to show in the breakpoint's description, so suppress it.
if (show_locations && level != lldb::eDescriptionLevelBrief) {
s->IndentMore();
for (size_t i = 0; i < num_locations; ++i) {
diff --git a/source/Breakpoint/BreakpointID.cpp b/source/Breakpoint/BreakpointID.cpp
index b80106546822..3f72f2052b52 100644
--- a/source/Breakpoint/BreakpointID.cpp
+++ b/source/Breakpoint/BreakpointID.cpp
@@ -29,10 +29,9 @@ BreakpointID::~BreakpointID() = default;
static llvm::StringRef g_range_specifiers[] = {"-", "to", "To", "TO"};
// Tells whether or not STR is valid to use between two strings representing
-// breakpoint IDs, to
-// indicate a range of breakpoint IDs. This is broken out into a separate
-// function so that we can
-// easily change or add to the format for specifying ID ranges at a later date.
+// breakpoint IDs, to indicate a range of breakpoint IDs. This is broken out
+// into a separate function so that we can easily change or add to the format
+// for specifying ID ranges at a later date.
bool BreakpointID::IsRangeIdentifier(llvm::StringRef str) {
for (auto spec : g_range_specifiers) {
diff --git a/source/Breakpoint/BreakpointIDList.cpp b/source/Breakpoint/BreakpointIDList.cpp
index 6d610d512f3b..bc4c2a111fd4 100644
--- a/source/Breakpoint/BreakpointIDList.cpp
+++ b/source/Breakpoint/BreakpointIDList.cpp
@@ -16,9 +16,9 @@
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -89,14 +89,13 @@ bool BreakpointIDList::FindBreakpointID(const char *bp_id_str,
return FindBreakpointID(*bp_id, position);
}
-void BreakpointIDList::InsertStringArray(const char **string_array,
- size_t array_size,
- CommandReturnObject &result) {
- if (string_array == nullptr)
+void BreakpointIDList::InsertStringArray(
+ llvm::ArrayRef<const char *> string_array, CommandReturnObject &result) {
+ if(string_array.empty())
return;
- for (uint32_t i = 0; i < array_size; ++i) {
- auto bp_id = BreakpointID::ParseCanonicalReference(string_array[i]);
+ for (const char *str : string_array) {
+ auto bp_id = BreakpointID::ParseCanonicalReference(str);
if (bp_id.hasValue())
m_breakpoint_ids.push_back(*bp_id);
}
@@ -237,13 +236,13 @@ void BreakpointIDList::FindAndReplaceIDRanges(Args &old_args, Target *target,
}
// We have valid range starting & ending breakpoint IDs. Go through all
- // the breakpoints in the target and find all the breakpoints that fit
- // into this range, and add them to new_args.
+ // the breakpoints in the target and find all the breakpoints that fit into
+ // this range, and add them to new_args.
// Next check to see if we have location id's. If so, make sure the
- // start_bp_id and end_bp_id are for the same breakpoint; otherwise we
- // have an illegal range: breakpoint id ranges that specify bp locations
- // are NOT allowed to cross major bp id numbers.
+ // start_bp_id and end_bp_id are for the same breakpoint; otherwise we have
+ // an illegal range: breakpoint id ranges that specify bp locations are NOT
+ // allowed to cross major bp id numbers.
if ((start_loc_id != LLDB_INVALID_BREAK_ID) ||
(end_loc_id != LLDB_INVALID_BREAK_ID)) {
diff --git a/source/Breakpoint/BreakpointList.cpp b/source/Breakpoint/BreakpointList.cpp
index 01ac59f0a903..4a49b1e105ab 100644
--- a/source/Breakpoint/BreakpointList.cpp
+++ b/source/Breakpoint/BreakpointList.cpp
@@ -99,7 +99,7 @@ void BreakpointList::RemoveAll(bool notify) {
void BreakpointList::RemoveAllowed(bool notify) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
-
+
bp_collection::iterator pos, end = m_breakpoints.end();
if (notify) {
for (pos = m_breakpoints.begin(); pos != end; ++pos) {
@@ -116,10 +116,12 @@ void BreakpointList::RemoveAllowed(bool notify) {
}
pos = m_breakpoints.begin();
while ( pos != end) {
- if((*pos)->AllowDelete())
- pos = m_breakpoints.erase(pos);
- else
- pos++;
+ auto bp = *pos;
+ if (bp->AllowDelete()) {
+ bp->ClearAllBreakpointSites();
+ pos = m_breakpoints.erase(pos);
+ } else
+ pos++;
}
}
diff --git a/source/Breakpoint/BreakpointLocation.cpp b/source/Breakpoint/BreakpointLocation.cpp
index f59c334fe5c8..932147703304 100644
--- a/source/Breakpoint/BreakpointLocation.cpp
+++ b/source/Breakpoint/BreakpointLocation.cpp
@@ -110,8 +110,8 @@ void BreakpointLocation::SetThreadID(lldb::tid_t thread_id) {
if (thread_id != LLDB_INVALID_THREAD_ID)
GetLocationOptions()->SetThreadID(thread_id);
else {
- // If we're resetting this to an invalid thread id, then
- // don't make an options pointer just to do that.
+ // If we're resetting this to an invalid thread id, then don't make an
+ // options pointer just to do that.
if (m_options_ap.get() != nullptr)
m_options_ap->SetThreadID(thread_id);
}
@@ -132,8 +132,8 @@ void BreakpointLocation::SetThreadIndex(uint32_t index) {
if (index != 0)
GetLocationOptions()->GetThreadSpec()->SetIndex(index);
else {
- // If we're resetting this to an invalid thread id, then
- // don't make an options pointer just to do that.
+ // If we're resetting this to an invalid thread id, then don't make an
+ // options pointer just to do that.
if (m_options_ap.get() != nullptr)
m_options_ap->GetThreadSpec()->SetIndex(index);
}
@@ -154,8 +154,8 @@ void BreakpointLocation::SetThreadName(const char *thread_name) {
if (thread_name != nullptr)
GetLocationOptions()->GetThreadSpec()->SetName(thread_name);
else {
- // If we're resetting this to an invalid thread id, then
- // don't make an options pointer just to do that.
+ // If we're resetting this to an invalid thread id, then don't make an
+ // options pointer just to do that.
if (m_options_ap.get() != nullptr)
m_options_ap->GetThreadSpec()->SetName(thread_name);
}
@@ -176,8 +176,8 @@ void BreakpointLocation::SetQueueName(const char *queue_name) {
if (queue_name != nullptr)
GetLocationOptions()->GetThreadSpec()->SetQueueName(queue_name);
else {
- // If we're resetting this to an invalid thread id, then
- // don't make an options pointer just to do that.
+ // If we're resetting this to an invalid thread id, then don't make an
+ // options pointer just to do that.
if (m_options_ap.get() != nullptr)
m_options_ap->GetThreadSpec()->SetQueueName(queue_name);
}
@@ -203,8 +203,8 @@ bool BreakpointLocation::InvokeCallback(StoppointCallbackContext *context) {
void BreakpointLocation::SetCallback(BreakpointHitCallback callback,
void *baton, bool is_synchronous) {
- // The default "Baton" class will keep a copy of "baton" and won't free
- // or delete it when it goes goes out of scope.
+ // The default "Baton" class will keep a copy of "baton" and won't free or
+ // delete it when it goes goes out of scope.
GetLocationOptions()->SetCallback(
callback, std::make_shared<UntypedBaton>(baton), is_synchronous);
SendBreakpointLocationChangedEvent(eBreakpointEventTypeCommandChanged);
@@ -283,8 +283,7 @@ bool BreakpointLocation::ConditionSaysStop(ExecutionContext &exe_ctx,
}
// We need to make sure the user sees any parse errors in their condition, so
- // we'll hook the
- // constructor errors up to the debugger's Async I/O.
+ // we'll hook the constructor errors up to the debugger's Async I/O.
ValueObjectSP result_value_sp;
@@ -372,9 +371,9 @@ bool BreakpointLocation::IgnoreCountShouldStop() {
}
BreakpointOptions *BreakpointLocation::GetLocationOptions() {
- // If we make the copy we don't copy the callbacks because that is potentially
- // expensive and we don't want to do that for the simple case where someone is
- // just disabling the location.
+ // If we make the copy we don't copy the callbacks because that is
+ // potentially expensive and we don't want to do that for the simple case
+ // where someone is just disabling the location.
if (m_options_ap.get() == nullptr)
m_options_ap.reset(
new BreakpointOptions(false));
@@ -479,9 +478,8 @@ bool BreakpointLocation::ClearBreakpointSite() {
if (m_bp_site_sp.get()) {
ProcessSP process_sp(m_owner.GetTarget().GetProcessSP());
// If the process exists, get it to remove the owner, it will remove the
- // physical implementation
- // of the breakpoint as well if there are no more owners. Otherwise just
- // remove this owner.
+ // physical implementation of the breakpoint as well if there are no more
+ // owners. Otherwise just remove this owner.
if (process_sp)
process_sp->RemoveOwnerFromBreakpointSite(GetBreakpoint().GetID(),
GetID(), m_bp_site_sp);
@@ -499,8 +497,8 @@ void BreakpointLocation::GetDescription(Stream *s,
SymbolContext sc;
// If the description level is "initial" then the breakpoint is printing out
- // our initial state,
- // and we should let it decide how it wants to print our label.
+ // our initial state, and we should let it decide how it wants to print our
+ // label.
if (level != eDescriptionLevelInitial) {
s->Indent();
BreakpointID::GetCanonicalReference(s, m_owner.GetID(), GetID());
diff --git a/source/Breakpoint/BreakpointLocationList.cpp b/source/Breakpoint/BreakpointLocationList.cpp
index 1e4b4412a427..23ca89da6ce1 100644
--- a/source/Breakpoint/BreakpointLocationList.cpp
+++ b/source/Breakpoint/BreakpointLocationList.cpp
@@ -49,12 +49,12 @@ bool BreakpointLocationList::ShouldStop(StoppointCallbackContext *context,
BreakpointLocationSP bp = FindByID(break_id);
if (bp) {
// Let the BreakpointLocation decide if it should stop here (could not have
- // reached it's target hit count yet, or it could have a callback
- // that decided it shouldn't stop (shared library loads/unloads).
+ // reached it's target hit count yet, or it could have a callback that
+ // decided it shouldn't stop (shared library loads/unloads).
return bp->ShouldStop(context);
}
- // We should stop here since this BreakpointLocation isn't valid anymore or it
- // doesn't exist.
+ // We should stop here since this BreakpointLocation isn't valid anymore or
+ // it doesn't exist.
return true;
}
@@ -246,10 +246,10 @@ bool BreakpointLocationList::RemoveLocation(
m_address_to_location.erase(bp_loc_sp->GetAddress());
- collection::iterator pos, end = m_locations.end();
- for (pos = m_locations.begin(); pos != end; ++pos) {
- if ((*pos).get() == bp_loc_sp.get()) {
- m_locations.erase(pos);
+ size_t num_locations = m_locations.size();
+ for (size_t idx = 0; idx < num_locations; idx++) {
+ if (m_locations[idx].get() == bp_loc_sp.get()) {
+ RemoveLocationByIndex(idx);
return true;
}
}
@@ -257,17 +257,23 @@ bool BreakpointLocationList::RemoveLocation(
return false;
}
+void BreakpointLocationList::RemoveLocationByIndex(size_t idx) {
+ assert (idx < m_locations.size());
+ m_address_to_location.erase(m_locations[idx]->GetAddress());
+ m_locations.erase(m_locations.begin() + idx);
+}
+
void BreakpointLocationList::RemoveInvalidLocations(const ArchSpec &arch) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
size_t idx = 0;
- // Don't cache m_location.size() as it will change since we might
- // remove locations from our vector...
+ // Don't cache m_location.size() as it will change since we might remove
+ // locations from our vector...
while (idx < m_locations.size()) {
BreakpointLocation *bp_loc = m_locations[idx].get();
if (bp_loc->GetAddress().SectionWasDeleted()) {
// Section was deleted which means this breakpoint comes from a module
// that is no longer valid, so we should remove it.
- m_locations.erase(m_locations.begin() + idx);
+ RemoveLocationByIndex(idx);
continue;
}
if (arch.IsValid()) {
@@ -276,12 +282,13 @@ void BreakpointLocationList::RemoveInvalidLocations(const ArchSpec &arch) {
if (!arch.IsCompatibleMatch(module_sp->GetArchitecture())) {
// The breakpoint was in a module whose architecture is no longer
// compatible with "arch", so we need to remove it
- m_locations.erase(m_locations.begin() + idx);
+ RemoveLocationByIndex(idx);
continue;
}
}
}
- // Only increment the index if we didn't remove the locations at index "idx"
+ // Only increment the index if we didn't remove the locations at index
+ // "idx"
++idx;
}
}
diff --git a/source/Breakpoint/BreakpointOptions.cpp b/source/Breakpoint/BreakpointOptions.cpp
index 662b288794d3..b5869fc34dfc 100644
--- a/source/Breakpoint/BreakpointOptions.cpp
+++ b/source/Breakpoint/BreakpointOptions.cpp
@@ -425,10 +425,9 @@ void BreakpointOptions::SetCallback(BreakpointHitCallback callback,
const lldb::BatonSP &callback_baton_sp,
bool callback_is_synchronous) {
// FIXME: This seems unsafe. If BatonSP actually *is* a CommandBaton, but
- // in a shared_ptr<Baton> instead of a shared_ptr<CommandBaton>, then we
- // will set m_baton_is_command_baton to false, which is incorrect.
- // One possible solution is to make the base Baton class provide a method
- // such as:
+ // in a shared_ptr<Baton> instead of a shared_ptr<CommandBaton>, then we will
+ // set m_baton_is_command_baton to false, which is incorrect. One possible
+ // solution is to make the base Baton class provide a method such as:
// virtual StringRef getBatonId() const { return ""; }
// and have CommandBaton override this to return something unique, and then
// check for it here. Another option might be to make Baton using the llvm
@@ -470,12 +469,18 @@ const Baton *BreakpointOptions::GetBaton() const {
bool BreakpointOptions::InvokeCallback(StoppointCallbackContext *context,
lldb::user_id_t break_id,
lldb::user_id_t break_loc_id) {
- if (m_callback && context->is_synchronous == IsCallbackSynchronous()) {
- return m_callback(m_callback_baton_sp ? m_callback_baton_sp->data()
+ if (m_callback) {
+ if (context->is_synchronous == IsCallbackSynchronous()) {
+ return m_callback(m_callback_baton_sp ? m_callback_baton_sp->data()
: nullptr,
context, break_id, break_loc_id);
- } else
- return true;
+ } else if (IsCallbackSynchronous()) {
+ // If a synchronous callback is called at async time, it should not say
+ // to stop.
+ return false;
+ }
+ }
+ return true;
}
bool BreakpointOptions::HasCallback() const {
@@ -526,7 +531,10 @@ const ThreadSpec *BreakpointOptions::GetThreadSpecNoCreate() const {
ThreadSpec *BreakpointOptions::GetThreadSpec() {
if (m_thread_spec_ap.get() == nullptr)
+ {
+ m_set_flags.Set(eThreadSpec);
m_thread_spec_ap.reset(new ThreadSpec());
+ }
return m_thread_spec_ap.get();
}
@@ -545,8 +553,7 @@ void BreakpointOptions::SetThreadSpec(
void BreakpointOptions::GetDescription(Stream *s,
lldb::DescriptionLevel level) const {
// Figure out if there are any options not at their default value, and only
- // print
- // anything if there are:
+ // print anything if there are:
if (m_ignore_count != 0 || !m_enabled || m_one_shot || m_auto_continue ||
(GetThreadSpecNoCreate() != nullptr &&
@@ -651,8 +658,7 @@ bool BreakpointOptions::BreakpointOptionsCallbackFunction(
CommandReturnObject result;
Debugger &debugger = target->GetDebugger();
// Rig up the results secondary output stream to the debugger's, so the
- // output will come out synchronously
- // if the debugger is set up that way.
+ // output will come out synchronously if the debugger is set up that way.
StreamSP output_stream(debugger.GetAsyncOutputStream());
StreamSP error_stream(debugger.GetAsyncErrorStream());
diff --git a/source/Breakpoint/BreakpointResolver.cpp b/source/Breakpoint/BreakpointResolver.cpp
index 31aefb08f976..6ab578dd8576 100644
--- a/source/Breakpoint/BreakpointResolver.cpp
+++ b/source/Breakpoint/BreakpointResolver.cpp
@@ -15,8 +15,8 @@
// Project includes
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
-// Have to include the other breakpoint resolver types here so the static create
-// from StructuredData can call them.
+// Have to include the other breakpoint resolver types here so the static
+// create from StructuredData can call them.
#include "lldb/Breakpoint/BreakpointResolverAddress.h"
#include "lldb/Breakpoint/BreakpointResolverFileLine.h"
#include "lldb/Breakpoint/BreakpointResolverFileRegex.h"
@@ -212,8 +212,7 @@ void BreakpointResolver::SetSCMatchesByLine(SearchFilter &filter,
sc_list.RemoveContextAtIndex(current_idx);
// ResolveSymbolContext will always return a number that is >= the line
- // number you pass in.
- // So the smaller line number is always better.
+ // number you pass in. So the smaller line number is always better.
if (sc.line_entry.line < closest_line_number)
closest_line_number = sc.line_entry.line;
} else
@@ -234,8 +233,7 @@ void BreakpointResolver::SetSCMatchesByLine(SearchFilter &filter,
}
// Next go through and see if there are line table entries that are
- // contiguous, and if so keep only the
- // first of the contiguous range:
+ // contiguous, and if so keep only the first of the contiguous range:
current_idx = 0;
std::map<Block *, lldb::addr_t> blocks_with_breakpoints;
diff --git a/source/Breakpoint/BreakpointResolverAddress.cpp b/source/Breakpoint/BreakpointResolverAddress.cpp
index 32f2045ed59a..d4647e2c589d 100644
--- a/source/Breakpoint/BreakpointResolverAddress.cpp
+++ b/source/Breakpoint/BreakpointResolverAddress.cpp
@@ -66,7 +66,7 @@ BreakpointResolver *BreakpointResolverAddress::CreateFromStructuredData(
error.SetErrorString("BRA::CFSD: Couldn't read module name entry.");
return nullptr;
}
- module_filespec.SetFile(module_name, false);
+ module_filespec.SetFile(module_name, false, FileSpec::Style::native);
}
return new BreakpointResolverAddress(bkpt, address, module_filespec);
}
@@ -100,11 +100,10 @@ BreakpointResolverAddress::SerializeToStructuredData() {
}
void BreakpointResolverAddress::ResolveBreakpoint(SearchFilter &filter) {
- // If the address is not section relative, then we should not try to
- // re-resolve it, it is just some
- // random address and we wouldn't know what to do on reload. But if it is
- // section relative, we need to
- // re-resolve it since the section it's in may have shifted on re-run.
+ // If the address is not section relative, then we should not try to re-
+ // resolve it, it is just some random address and we wouldn't know what to do
+ // on reload. But if it is section relative, we need to re-resolve it since
+ // the section it's in may have shifted on re-run.
bool re_resolve = false;
if (m_addr.GetSection() || m_module_filespec)
re_resolve = true;
@@ -137,8 +136,8 @@ BreakpointResolverAddress::SearchCallback(SearchFilter &filter,
if (filter.AddressPasses(m_addr)) {
if (m_breakpoint->GetNumLocations() == 0) {
// If the address is just an offset, and we're given a module, see if we
- // can find the appropriate module
- // loaded in the binary, and fix up m_addr to use that.
+ // can find the appropriate module loaded in the binary, and fix up
+ // m_addr to use that.
if (!m_addr.IsSectionOffset() && m_module_filespec) {
Target &target = m_breakpoint->GetTarget();
ModuleSpec module_spec(m_module_filespec);
diff --git a/source/Breakpoint/BreakpointResolverFileLine.cpp b/source/Breakpoint/BreakpointResolverFileLine.cpp
index 780d25db9ccb..ecef88eb9989 100644
--- a/source/Breakpoint/BreakpointResolverFileLine.cpp
+++ b/source/Breakpoint/BreakpointResolverFileLine.cpp
@@ -110,20 +110,40 @@ BreakpointResolverFileLine::SerializeToStructuredData() {
// Filter the symbol context list to remove contexts where the line number was
// moved into a new function. We do this conservatively, so if e.g. we cannot
-// resolve the function in the context (which can happen in case of
-// line-table-only debug info), we leave the context as is. The trickiest part
-// here is handling inlined functions -- in this case we need to make sure we
-// look at the declaration line of the inlined function, NOT the function it was
+// resolve the function in the context (which can happen in case of line-table-
+// only debug info), we leave the context as is. The trickiest part here is
+// handling inlined functions -- in this case we need to make sure we look at
+// the declaration line of the inlined function, NOT the function it was
// inlined into.
-void BreakpointResolverFileLine::FilterContexts(SymbolContextList &sc_list) {
+void BreakpointResolverFileLine::FilterContexts(SymbolContextList &sc_list,
+ bool is_relative) {
if (m_exact_match)
return; // Nothing to do. Contexts are precise.
+ llvm::StringRef relative_path;
+ if (is_relative)
+ relative_path = m_file_spec.GetDirectory().GetStringRef();
+
Log * log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS);
for(uint32_t i = 0; i < sc_list.GetSize(); ++i) {
SymbolContext sc;
sc_list.GetContextAtIndex(i, sc);
- if (! sc.block)
+ if (is_relative) {
+ // If the path was relative, make sure any matches match as long as the
+ // relative parts of the path match the path from support files
+ auto sc_dir = sc.line_entry.file.GetDirectory().GetStringRef();
+ if (!sc_dir.endswith(relative_path)) {
+ // We had a relative path specified and the relative directory doesn't
+ // match so remove this one
+ LLDB_LOG(log, "removing not matching relative path {0} since it "
+ "doesn't end with {1}", sc_dir, relative_path);
+ sc_list.RemoveContextAtIndex(i);
+ --i;
+ continue;
+ }
+ }
+
+ if (!sc.block)
continue;
FileSpec file;
@@ -179,33 +199,38 @@ BreakpointResolverFileLine::SearchCallback(SearchFilter &filter,
assert(m_breakpoint != NULL);
// 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 is
- // used (and so code and a line entry for it is generated) but in the other it
- // isn't. If we considered the CU's independently, then in the second
- // inclusion, we'd move the breakpoint to the next function that actually
- // generated code in the header file. That would end up being confusing. So
- // instead, we do the CU iterations by hand here, then scan through the
- // complete list of matches, and figure out the closest line number match, and
- // only set breakpoints on that match.
-
- // Note also that if file_spec only had a file name and not a directory, there
- // may be many different file spec's in the resultant list. The closest line
- // match for one will not be right for some totally different file. So we go
- // through the match list and pull out the sets that have the same file spec
- // in their line_entry and treat each set separately.
+ // #include the same file, and in one of them the function at m_line_number
+ // is used (and so code and a line entry for it is generated) but in the
+ // other it isn't. If we considered the CU's independently, then in the
+ // second inclusion, we'd move the breakpoint to the next function that
+ // actually generated code in the header file. That would end up being
+ // confusing. So instead, we do the CU iterations by hand here, then scan
+ // through the complete list of matches, and figure out the closest line
+ // number match, and only set breakpoints on that match.
+
+ // Note also that if file_spec only had a file name and not a directory,
+ // there may be many different file spec's in the resultant list. The
+ // closest line match for one will not be right for some totally different
+ // file. So we go through the match list and pull out the sets that have the
+ // same file spec in their line_entry and treat each set separately.
+
+ FileSpec search_file_spec = m_file_spec;
+ const bool is_relative = m_file_spec.IsRelative();
+ if (is_relative)
+ search_file_spec.GetDirectory().Clear();
const size_t num_comp_units = context.module_sp->GetNumCompileUnits();
for (size_t i = 0; i < num_comp_units; i++) {
CompUnitSP cu_sp(context.module_sp->GetCompileUnitAtIndex(i));
if (cu_sp) {
if (filter.CompUnitPasses(*cu_sp))
- cu_sp->ResolveSymbolContext(m_file_spec, m_line_number, m_inlines,
+ cu_sp->ResolveSymbolContext(search_file_spec, m_line_number, m_inlines,
m_exact_match, eSymbolContextEverything,
sc_list);
}
}
- FilterContexts(sc_list);
+ FilterContexts(sc_list, is_relative);
StreamString s;
s.Printf("for %s:%d ", m_file_spec.GetFilename().AsCString("<Unknown>"),
diff --git a/source/Breakpoint/BreakpointResolverName.cpp b/source/Breakpoint/BreakpointResolverName.cpp
index 468de35db0ee..ba277ae2655e 100644
--- a/source/Breakpoint/BreakpointResolverName.cpp
+++ b/source/Breakpoint/BreakpointResolverName.cpp
@@ -16,11 +16,13 @@
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
+#include "lldb/Core/Architecture.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/Block.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
@@ -239,9 +241,8 @@ void BreakpointResolverName::AddNameLookup(const ConstString &name,
// FIXME: Right now we look at the module level, and call the module's
// "FindFunctions".
// Greg says he will add function tables, maybe at the CompileUnit level to
-// accelerate function
-// lookup. At that point, we should switch the depth to CompileUnit, and look
-// in these tables.
+// accelerate function lookup. At that point, we should switch the depth to
+// CompileUnit, and look in these tables.
Searcher::CallbackReturn
BreakpointResolverName::SearchCallback(SearchFilter &filter,
@@ -299,8 +300,8 @@ BreakpointResolverName::SearchCallback(SearchFilter &filter,
break;
}
- // If the filter specifies a Compilation Unit, remove the ones that don't pass
- // at this point.
+ // If the filter specifies a Compilation Unit, remove the ones that don't
+ // pass at this point.
if (filter_by_cu || filter_by_language) {
uint32_t num_functions = func_list.GetSize();
@@ -365,6 +366,12 @@ BreakpointResolverName::SearchCallback(SearchFilter &filter,
sc.symbol->GetPrologueByteSize();
if (prologue_byte_size)
break_addr.SetOffset(break_addr.GetOffset() + prologue_byte_size);
+ else {
+ const Architecture *arch =
+ m_breakpoint->GetTarget().GetArchitecturePlugin();
+ if (arch)
+ arch->AdjustBreakpointAddress(*sc.symbol, break_addr);
+ }
}
}
diff --git a/source/Breakpoint/BreakpointSiteList.cpp b/source/Breakpoint/BreakpointSiteList.cpp
index 87ce292feb8e..9bb9aa366106 100644
--- a/source/Breakpoint/BreakpointSiteList.cpp
+++ b/source/Breakpoint/BreakpointSiteList.cpp
@@ -24,8 +24,7 @@ BreakpointSiteList::BreakpointSiteList() : m_mutex(), m_bp_site_list() {}
BreakpointSiteList::~BreakpointSiteList() {}
// Add breakpoint site to the list. However, if the element already exists in
-// the
-// list, then we don't add it, and return LLDB_INVALID_BREAK_ID.
+// the list, then we don't add it, and return LLDB_INVALID_BREAK_ID.
lldb::break_id_t BreakpointSiteList::Add(const BreakpointSiteSP &bp) {
lldb::addr_t bp_site_load_addr = bp->GetLoadAddress();
@@ -45,8 +44,8 @@ bool BreakpointSiteList::ShouldStop(StoppointCallbackContext *context,
BreakpointSiteSP site_sp(FindByID(site_id));
if (site_sp) {
// Let the BreakpointSite decide if it should stop here (could not have
- // reached it's target hit count yet, or it could have a callback
- // that decided it shouldn't stop (shared library loads/unloads).
+ // reached it's target hit count yet, or it could have a callback that
+ // decided it shouldn't stop (shared library loads/unloads).
return site_sp->ShouldStop(context);
}
// We should stop here since this BreakpointSite isn't valid anymore or it
@@ -60,7 +59,8 @@ lldb::break_id_t BreakpointSiteList::FindIDByAddress(lldb::addr_t addr) {
// PRIx64 " ) => %u", __FUNCTION__, (uint64_t)addr, bp->GetID());
return bp.get()->GetID();
}
- // DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8" PRIx64
+ // DBLogIf(PD_LOG_BREAKPOINTS, "BreakpointSiteList::%s ( addr = 0x%8.8"
+ // PRIx64
// " ) => NONE", __FUNCTION__, (uint64_t)addr);
return LLDB_INVALID_BREAK_ID;
}
@@ -185,10 +185,9 @@ bool BreakpointSiteList::FindInRange(lldb::addr_t lower_bound,
if (lower == m_bp_site_list.end() || (*lower).first >= upper_bound)
return false;
- // This is one tricky bit. The breakpoint might overlap the bottom end of the
- // range. So we grab the
- // breakpoint prior to the lower bound, and check that that + its byte size
- // isn't in our range.
+ // This is one tricky bit. The breakpoint might overlap the bottom end of
+ // the range. So we grab the breakpoint prior to the lower bound, and check
+ // that that + its byte size isn't in our range.
if (lower != m_bp_site_list.begin()) {
collection::const_iterator prev_pos = lower;
prev_pos--;
diff --git a/source/Breakpoint/Watchpoint.cpp b/source/Breakpoint/Watchpoint.cpp
index a141a6b5c2f9..7a936d1fb130 100644
--- a/source/Breakpoint/Watchpoint.cpp
+++ b/source/Breakpoint/Watchpoint.cpp
@@ -59,8 +59,8 @@ Watchpoint::~Watchpoint() = default;
// This function is used when "baton" doesn't need to be freed
void Watchpoint::SetCallback(WatchpointHitCallback callback, void *baton,
bool is_synchronous) {
- // The default "Baton" class will keep a copy of "baton" and won't free
- // or delete it when it goes goes out of scope.
+ // The default "Baton" class will keep a copy of "baton" and won't free or
+ // delete it when it goes goes out of scope.
m_options.SetCallback(callback, std::make_shared<UntypedBaton>(baton),
is_synchronous);
@@ -103,8 +103,8 @@ bool Watchpoint::CaptureWatchedValue(const ExecutionContext &exe_ctx) {
Address watch_address(GetLoadAddress());
if (!m_type.IsValid()) {
// Don't know how to report new & old values, since we couldn't make a
- // scalar type for this watchpoint.
- // This works around an assert in ValueObjectMemory::Create.
+ // scalar type for this watchpoint. This works around an assert in
+ // ValueObjectMemory::Create.
// FIXME: This should not happen, but if it does in some case we care about,
// we can go grab the value raw and print it as unsigned.
return false;
@@ -217,11 +217,9 @@ void Watchpoint::DumpWithLevel(Stream *s,
bool Watchpoint::IsEnabled() const { return m_enabled; }
// Within StopInfo.cpp, we purposely turn on the ephemeral mode right before
-// temporarily disable the watchpoint
-// in order to perform possible watchpoint actions without triggering further
-// watchpoint events.
-// After the temporary disabled watchpoint is enabled, we then turn off the
-// ephemeral mode.
+// temporarily disable the watchpoint in order to perform possible watchpoint
+// actions without triggering further watchpoint events. After the temporary
+// disabled watchpoint is enabled, we then turn off the ephemeral mode.
void Watchpoint::TurnOnEphemeralMode() { m_is_ephemeral = true; }
diff --git a/source/Breakpoint/WatchpointList.cpp b/source/Breakpoint/WatchpointList.cpp
index 6ec3bd09c142..6497780084d9 100644
--- a/source/Breakpoint/WatchpointList.cpp
+++ b/source/Breakpoint/WatchpointList.cpp
@@ -203,9 +203,9 @@ bool WatchpointList::ShouldStop(StoppointCallbackContext *context,
WatchpointSP wp_sp = FindByID(watch_id);
if (wp_sp) {
- // Let the Watchpoint decide if it should stop here (could not have
- // reached it's target hit count yet, or it could have a callback
- // that decided it shouldn't stop.
+ // Let the Watchpoint decide if it should stop here (could not have reached
+ // it's target hit count yet, or it could have a callback that decided it
+ // shouldn't stop.
return wp_sp->ShouldStop(context);
}
// We should stop here since this Watchpoint isn't valid anymore or it
diff --git a/source/Breakpoint/WatchpointOptions.cpp b/source/Breakpoint/WatchpointOptions.cpp
index 558ebc51008c..402fee943a02 100644
--- a/source/Breakpoint/WatchpointOptions.cpp
+++ b/source/Breakpoint/WatchpointOptions.cpp
@@ -143,8 +143,7 @@ void WatchpointOptions::GetCallbackDescription(
void WatchpointOptions::GetDescription(Stream *s,
lldb::DescriptionLevel level) const {
// Figure out if there are any options not at their default value, and only
- // print
- // anything if there are:
+ // print anything if there are:
if ((GetThreadSpecNoCreate() != nullptr &&
GetThreadSpecNoCreate()->HasSpecification())) {
diff --git a/source/Commands/CMakeLists.txt b/source/Commands/CMakeLists.txt
index 55b41b1050c5..1dbaab5174e0 100644
--- a/source/Commands/CMakeLists.txt
+++ b/source/Commands/CMakeLists.txt
@@ -1,7 +1,6 @@
add_lldb_library(lldbCommands
CommandCompletions.cpp
CommandObjectApropos.cpp
- CommandObjectArgs.cpp
CommandObjectBreakpoint.cpp
CommandObjectBreakpointCommand.cpp
CommandObjectBugreport.cpp
@@ -21,7 +20,7 @@ add_lldb_library(lldbCommands
CommandObjectRegister.cpp
CommandObjectSettings.cpp
CommandObjectSource.cpp
- CommandObjectSyntax.cpp
+ CommandObjectStats.cpp
CommandObjectTarget.cpp
CommandObjectThread.cpp
CommandObjectType.cpp
diff --git a/source/Commands/CommandCompletions.cpp b/source/Commands/CommandCompletions.cpp
index 34cad970ff6e..bdfdbb83219b 100644
--- a/source/Commands/CommandCompletions.cpp
+++ b/source/Commands/CommandCompletions.cpp
@@ -23,14 +23,13 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/FileSystem.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Target/Target.h"
-#include "lldb/Utility/CleanUp.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/TildeExpressionResolver.h"
@@ -58,9 +57,7 @@ CommandCompletions::CommonCompletionElement
bool CommandCompletions::InvokeCommonCompletionCallbacks(
CommandInterpreter &interpreter, uint32_t completion_mask,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, SearchFilter *searcher, bool &word_complete,
- StringList &matches) {
+ CompletionRequest &request, SearchFilter *searcher) {
bool handled = false;
if (completion_mask & eCustomCompletion)
@@ -73,25 +70,18 @@ bool CommandCompletions::InvokeCommonCompletionCallbacks(
g_common_completions[i].type &&
g_common_completions[i].callback != nullptr) {
handled = true;
- g_common_completions[i].callback(interpreter, completion_str,
- match_start_point, max_return_elements,
- searcher, word_complete, matches);
+ g_common_completions[i].callback(interpreter, request, searcher);
}
}
return handled;
}
int CommandCompletions::SourceFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches) {
- word_complete = true;
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ request.SetWordComplete(true);
// Find some way to switch "include support files..."
- SourceFileCompleter completer(interpreter, false, partial_file_name,
- match_start_point, max_return_elements,
- matches);
+ SourceFileCompleter completer(interpreter, false, request);
if (searcher == nullptr) {
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
@@ -100,12 +90,11 @@ int CommandCompletions::SourceFiles(CommandInterpreter &interpreter,
} else {
completer.DoCompletion(searcher);
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
- bool only_directories, bool &saw_directory,
- StringList &matches,
+ bool only_directories, StringList &matches,
TildeExpressionResolver &Resolver) {
matches.Clear();
@@ -139,24 +128,22 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
// but after that, we're done regardless of any matches.
if (FirstSep == llvm::StringRef::npos) {
llvm::StringSet<> MatchSet;
- saw_directory = Resolver.ResolvePartial(Username, MatchSet);
+ Resolver.ResolvePartial(Username, MatchSet);
for (const auto &S : MatchSet) {
Resolved = S.getKey();
path::append(Resolved, path::get_separator());
matches.AppendString(Resolved);
}
- saw_directory = (matches.GetSize() > 0);
}
return matches.GetSize();
}
- // If there was no trailing slash, then we're done as soon as we resolve the
- // expression to the correct directory. Otherwise we need to continue
+ // If there was no trailing slash, then we're done as soon as we resolve
+ // the expression to the correct directory. Otherwise we need to continue
// looking for matches within that directory.
if (FirstSep == llvm::StringRef::npos) {
// Make sure it ends with a separator.
path::append(CompletionBuffer, path::get_separator());
- saw_directory = true;
matches.AppendString(CompletionBuffer);
return 1;
}
@@ -165,7 +152,13 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
// search in the fully resolved directory, but CompletionBuffer keeps the
// unmodified form that the user typed.
Storage = Resolved;
- SearchDir = Resolved;
+ llvm::StringRef RemainderDir = path::parent_path(Remainder);
+ if (!RemainderDir.empty()) {
+ // Append the remaining path to the resolved directory.
+ Storage.append(path::get_separator());
+ Storage.append(RemainderDir);
+ }
+ SearchDir = Storage;
} else {
SearchDir = path::parent_path(CompletionBuffer);
}
@@ -222,7 +215,6 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
CompletionBuffer.append(Name);
if (is_dir) {
- saw_directory = true;
path::append(CompletionBuffer, path::get_separator());
}
@@ -233,51 +225,40 @@ static int DiskFilesOrDirectories(const llvm::Twine &partial_name,
}
int CommandCompletions::DiskFiles(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point,
- int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches) {
- word_complete = false;
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ request.SetWordComplete(false);
StandardTildeExpressionResolver Resolver;
- return DiskFiles(partial_file_name, matches, Resolver);
+ return DiskFiles(request.GetCursorArgumentPrefix(), request.GetMatches(),
+ Resolver);
}
int CommandCompletions::DiskFiles(const llvm::Twine &partial_file_name,
StringList &matches,
TildeExpressionResolver &Resolver) {
- bool word_complete;
- int ret_val = DiskFilesOrDirectories(partial_file_name, false, word_complete,
- matches, Resolver);
- return ret_val;
+ return DiskFilesOrDirectories(partial_file_name, false, matches, Resolver);
}
-int CommandCompletions::DiskDirectories(
- CommandInterpreter &interpreter, llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements, SearchFilter *searcher,
- bool &word_complete, StringList &matches) {
- word_complete = false;
+int CommandCompletions::DiskDirectories(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ request.SetWordComplete(false);
StandardTildeExpressionResolver Resolver;
- return DiskDirectories(partial_file_name, matches, Resolver);
+ return DiskDirectories(request.GetCursorArgumentPrefix(),
+ request.GetMatches(), Resolver);
}
int CommandCompletions::DiskDirectories(const llvm::Twine &partial_file_name,
StringList &matches,
TildeExpressionResolver &Resolver) {
- bool word_complete;
- int ret_val = DiskFilesOrDirectories(partial_file_name, true, word_complete,
- matches, Resolver);
- return ret_val;
+ return DiskFilesOrDirectories(partial_file_name, true, matches, Resolver);
}
int CommandCompletions::Modules(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches) {
- word_complete = true;
- ModuleCompleter completer(interpreter, partial_file_name, match_start_point,
- max_return_elements, matches);
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ request.SetWordComplete(true);
+ ModuleCompleter completer(interpreter, request);
if (searcher == nullptr) {
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
@@ -286,17 +267,14 @@ int CommandCompletions::Modules(CommandInterpreter &interpreter,
} else {
completer.DoCompletion(searcher);
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
int CommandCompletions::Symbols(CommandInterpreter &interpreter,
- llvm::StringRef partial_file_name,
- int match_start_point, int max_return_elements,
- SearchFilter *searcher, bool &word_complete,
- StringList &matches) {
- word_complete = true;
- SymbolCompleter completer(interpreter, partial_file_name, match_start_point,
- max_return_elements, matches);
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ request.SetWordComplete(true);
+ SymbolCompleter completer(interpreter, request);
if (searcher == nullptr) {
lldb::TargetSP target_sp = interpreter.GetDebugger().GetSelectedTarget();
@@ -305,13 +283,12 @@ int CommandCompletions::Symbols(CommandInterpreter &interpreter,
} else {
completer.DoCompletion(searcher);
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
-int CommandCompletions::SettingsNames(
- CommandInterpreter &interpreter, llvm::StringRef partial_setting_name,
- int match_start_point, int max_return_elements, SearchFilter *searcher,
- bool &word_complete, StringList &matches) {
+int CommandCompletions::SettingsNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
// Cache the full setting name list
static StringList g_property_names;
if (g_property_names.GetSize() == 0) {
@@ -327,47 +304,39 @@ int CommandCompletions::SettingsNames(
}
size_t exact_matches_idx = SIZE_MAX;
- const size_t num_matches = g_property_names.AutoComplete(
- partial_setting_name, matches, exact_matches_idx);
- word_complete = exact_matches_idx != SIZE_MAX;
+ const size_t num_matches =
+ g_property_names.AutoComplete(request.GetCursorArgumentPrefix(),
+ request.GetMatches(), exact_matches_idx);
+ request.SetWordComplete(exact_matches_idx != SIZE_MAX);
return num_matches;
}
-int CommandCompletions::PlatformPluginNames(
- CommandInterpreter &interpreter, llvm::StringRef partial_name,
- int match_start_point, int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches) {
- const uint32_t num_matches =
- PluginManager::AutoCompletePlatformName(partial_name, matches);
- word_complete = num_matches == 1;
+int CommandCompletions::PlatformPluginNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ const uint32_t num_matches = PluginManager::AutoCompletePlatformName(
+ request.GetCursorArgumentPrefix(), request.GetMatches());
+ request.SetWordComplete(num_matches == 1);
return num_matches;
}
-int CommandCompletions::ArchitectureNames(
- CommandInterpreter &interpreter, llvm::StringRef partial_name,
- int match_start_point, int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches) {
- const uint32_t num_matches = ArchSpec::AutoComplete(partial_name, matches);
- word_complete = num_matches == 1;
+int CommandCompletions::ArchitectureNames(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ const uint32_t num_matches = ArchSpec::AutoComplete(request);
+ request.SetWordComplete(num_matches == 1);
return num_matches;
}
-int CommandCompletions::VariablePath(
- CommandInterpreter &interpreter, llvm::StringRef partial_name,
- int match_start_point, int max_return_elements, SearchFilter *searcher,
- bool &word_complete, lldb_private::StringList &matches) {
- return Variable::AutoComplete(interpreter.GetExecutionContext(), partial_name,
- matches, word_complete);
+int CommandCompletions::VariablePath(CommandInterpreter &interpreter,
+ CompletionRequest &request,
+ SearchFilter *searcher) {
+ return Variable::AutoComplete(interpreter.GetExecutionContext(), request);
}
CommandCompletions::Completer::Completer(CommandInterpreter &interpreter,
- llvm::StringRef completion_str,
- int match_start_point,
- int max_return_elements,
- StringList &matches)
- : m_interpreter(interpreter), m_completion_str(completion_str),
- m_match_start_point(match_start_point),
- m_max_return_elements(max_return_elements), m_matches(matches) {}
+ CompletionRequest &request)
+ : m_interpreter(interpreter), m_request(request) {}
CommandCompletions::Completer::~Completer() = default;
@@ -377,13 +346,10 @@ CommandCompletions::Completer::~Completer() = default;
CommandCompletions::SourceFileCompleter::SourceFileCompleter(
CommandInterpreter &interpreter, bool include_support_files,
- llvm::StringRef completion_str, int match_start_point,
- int max_return_elements, StringList &matches)
- : CommandCompletions::Completer(interpreter, completion_str,
- match_start_point, max_return_elements,
- matches),
+ CompletionRequest &request)
+ : CommandCompletions::Completer(interpreter, request),
m_include_support_files(include_support_files), m_matching_files() {
- FileSpec partial_spec(m_completion_str, false);
+ FileSpec partial_spec(m_request.GetCursorArgumentPrefix(), false);
m_file_name = partial_spec.GetFilename().GetCString();
m_dir_name = partial_spec.GetDirectory().GetCString();
}
@@ -443,10 +409,10 @@ CommandCompletions::SourceFileCompleter::DoCompletion(SearchFilter *filter) {
filter->Search(*this);
// Now convert the filelist to completions:
for (size_t i = 0; i < m_matching_files.GetSize(); i++) {
- m_matches.AppendString(
+ m_request.GetMatches().AppendString(
m_matching_files.GetFileSpecAtIndex(i).GetFilename().GetCString());
}
- return m_matches.GetSize();
+ return m_request.GetMatches().GetSize();
}
//----------------------------------------------------------------------
@@ -461,15 +427,12 @@ static bool regex_chars(const char comp) {
}
CommandCompletions::SymbolCompleter::SymbolCompleter(
- CommandInterpreter &interpreter, llvm::StringRef completion_str,
- int match_start_point, int max_return_elements, StringList &matches)
- : CommandCompletions::Completer(interpreter, completion_str,
- match_start_point, max_return_elements,
- matches) {
+ CommandInterpreter &interpreter, CompletionRequest &request)
+ : CommandCompletions::Completer(interpreter, request) {
std::string regex_str;
- if (!completion_str.empty()) {
+ if (!m_request.GetCursorArgumentPrefix().empty()) {
regex_str.append("^");
- regex_str.append(completion_str);
+ regex_str.append(m_request.GetCursorArgumentPrefix());
} else {
// Match anything since the completion string is empty
regex_str.append(".");
@@ -515,21 +478,18 @@ size_t CommandCompletions::SymbolCompleter::DoCompletion(SearchFilter *filter) {
filter->Search(*this);
collection::iterator pos = m_match_set.begin(), end = m_match_set.end();
for (pos = m_match_set.begin(); pos != end; pos++)
- m_matches.AppendString((*pos).GetCString());
+ m_request.GetMatches().AppendString((*pos).GetCString());
- return m_matches.GetSize();
+ return m_request.GetMatches().GetSize();
}
//----------------------------------------------------------------------
// ModuleCompleter
//----------------------------------------------------------------------
CommandCompletions::ModuleCompleter::ModuleCompleter(
- CommandInterpreter &interpreter, llvm::StringRef completion_str,
- int match_start_point, int max_return_elements, StringList &matches)
- : CommandCompletions::Completer(interpreter, completion_str,
- match_start_point, max_return_elements,
- matches) {
- FileSpec partial_spec(m_completion_str, false);
+ CommandInterpreter &interpreter, CompletionRequest &request)
+ : CommandCompletions::Completer(interpreter, request) {
+ FileSpec partial_spec(m_request.GetCursorArgumentPrefix(), false);
m_file_name = partial_spec.GetFilename().GetCString();
m_dir_name = partial_spec.GetDirectory().GetCString();
}
@@ -557,7 +517,7 @@ Searcher::CallbackReturn CommandCompletions::ModuleCompleter::SearchCallback(
match = false;
if (match) {
- m_matches.AppendString(cur_file_name);
+ m_request.GetMatches().AppendString(cur_file_name);
}
}
return Searcher::eCallbackReturnContinue;
@@ -565,5 +525,5 @@ Searcher::CallbackReturn CommandCompletions::ModuleCompleter::SearchCallback(
size_t CommandCompletions::ModuleCompleter::DoCompletion(SearchFilter *filter) {
filter->Search(*this);
- return m_matches.GetSize();
+ return m_request.GetMatches().GetSize();
}
diff --git a/source/Commands/CommandObjectApropos.cpp b/source/Commands/CommandObjectApropos.cpp
index 1114a511aa07..047575278faa 100644
--- a/source/Commands/CommandObjectApropos.cpp
+++ b/source/Commands/CommandObjectApropos.cpp
@@ -13,11 +13,11 @@
// Other libraries and framework includes
// Project includes
#include "CommandObjectApropos.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/Property.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -53,8 +53,8 @@ bool CommandObjectApropos::DoExecute(Args &args, CommandReturnObject &result) {
if (argc == 1) {
auto search_word = args[0].ref;
if (!search_word.empty()) {
- // The bulk of the work must be done inside the Command Interpreter, since
- // the command dictionary is private.
+ // The bulk of the work must be done inside the Command Interpreter,
+ // since the command dictionary is private.
StringList commands_found;
StringList commands_help;
diff --git a/source/Commands/CommandObjectArgs.cpp b/source/Commands/CommandObjectArgs.cpp
deleted file mode 100644
index 92c2107dc33c..000000000000
--- a/source/Commands/CommandObjectArgs.cpp
+++ /dev/null
@@ -1,234 +0,0 @@
-//===-- CommandObjectArgs.cpp -----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "CommandObjectArgs.h"
-#include "Plugins/ExpressionParser/Clang/ClangExpressionVariable.h"
-#include "lldb/Core/Debugger.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/Value.h"
-#include "lldb/Host/Host.h"
-#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Symbol/ClangASTContext.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Symbol/Variable.h"
-#include "lldb/Target/ABI.h"
-#include "lldb/Target/Process.h"
-#include "lldb/Target/StackFrame.h"
-#include "lldb/Target/Target.h"
-#include "lldb/Target/Thread.h"
-
-#include "llvm/ADT/StringSwitch.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-// This command is a toy. I'm just using it to have a way to construct the
-// arguments to
-// calling functions.
-//
-
-static OptionDefinition g_arg_options[] = {
- // clang-format off
- { LLDB_OPT_SET_1, false, "debug", 'g', OptionParser::eNoArgument, nullptr, nullptr, 0, eArgTypeNone, "Enable verbose debug logging of the expression parsing and evaluation." },
- // clang-format on
-};
-
-CommandObjectArgs::CommandOptions::CommandOptions(
- CommandInterpreter &interpreter)
- : Options() {
- // Keep only one place to reset the values to their defaults
- OptionParsingStarting(nullptr);
-}
-
-CommandObjectArgs::CommandOptions::~CommandOptions() = default;
-
-Status CommandObjectArgs::CommandOptions::SetOptionValue(
- uint32_t option_idx, llvm::StringRef option_arg,
- ExecutionContext *execution_context) {
- Status error;
-
- const int short_option = m_getopt_table[option_idx].val;
- error.SetErrorStringWithFormat("invalid short option character '%c'",
- short_option);
-
- return error;
-}
-
-void CommandObjectArgs::CommandOptions::OptionParsingStarting(
- ExecutionContext *execution_context) {}
-
-llvm::ArrayRef<OptionDefinition>
-CommandObjectArgs::CommandOptions::GetDefinitions() {
- return llvm::makeArrayRef(g_arg_options);
-}
-
-CommandObjectArgs::CommandObjectArgs(CommandInterpreter &interpreter)
- : CommandObjectParsed(interpreter, "args",
- "When stopped at the start of a function, reads "
- "function arguments of type (u?)int(8|16|32|64)_t, "
- "(void|char)*",
- "args"),
- m_options(interpreter) {}
-
-CommandObjectArgs::~CommandObjectArgs() = default;
-
-Options *CommandObjectArgs::GetOptions() { return &m_options; }
-
-bool CommandObjectArgs::DoExecute(Args &args, CommandReturnObject &result) {
- ConstString target_triple;
-
- Process *process = m_exe_ctx.GetProcessPtr();
- if (!process) {
- result.AppendError("Args found no process.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- const ABI *abi = process->GetABI().get();
- if (!abi) {
- result.AppendError("The current process has no ABI.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- if (args.empty()) {
- result.AppendError("args requires at least one argument");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- Thread *thread = m_exe_ctx.GetThreadPtr();
-
- if (!thread) {
- result.AppendError("args found no thread.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- lldb::StackFrameSP thread_cur_frame = thread->GetSelectedFrame();
- if (!thread_cur_frame) {
- result.AppendError("The current thread has no current frame.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- ModuleSP thread_module_sp(
- thread_cur_frame->GetFrameCodeAddress().GetModule());
- if (!thread_module_sp) {
- result.AppendError("The PC has no associated module.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- TypeSystem *type_system =
- thread_module_sp->GetTypeSystemForLanguage(eLanguageTypeC);
- if (type_system == nullptr) {
- result.AppendError("Unable to create C type system.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- ValueList value_list;
-
- for (auto &arg_entry : args.entries()) {
- llvm::StringRef arg_type = arg_entry.ref;
- Value value;
- value.SetValueType(Value::eValueTypeScalar);
- CompilerType compiler_type;
-
- std::size_t int_pos = arg_type.find("int");
- if (int_pos != llvm::StringRef::npos) {
- Encoding encoding = eEncodingSint;
-
- int width = 0;
-
- if (int_pos > 1) {
- result.AppendErrorWithFormat("Invalid format: %s.\n",
- arg_entry.c_str());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- if (int_pos == 1 && arg_type[0] != 'u') {
- result.AppendErrorWithFormat("Invalid format: %s.\n",
- arg_entry.c_str());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- if (arg_type[0] == 'u') {
- encoding = eEncodingUint;
- }
-
- llvm::StringRef width_spec = arg_type.drop_front(int_pos + 3);
-
- auto exp_result = llvm::StringSwitch<llvm::Optional<int>>(width_spec)
- .Case("8_t", 8)
- .Case("16_t", 16)
- .Case("32_t", 32)
- .Case("64_t", 64)
- .Default(llvm::None);
- if (!exp_result.hasValue()) {
- result.AppendErrorWithFormat("Invalid format: %s.\n",
- arg_entry.c_str());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- width = *exp_result;
-
- compiler_type =
- type_system->GetBuiltinTypeForEncodingAndBitSize(encoding, width);
-
- if (!compiler_type.IsValid()) {
- result.AppendErrorWithFormat(
- "Couldn't get Clang type for format %s (%s integer, width %d).\n",
- arg_entry.c_str(),
- (encoding == eEncodingSint ? "signed" : "unsigned"), width);
-
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- } else if (arg_type == "void*") {
- compiler_type =
- type_system->GetBasicTypeFromAST(eBasicTypeVoid).GetPointerType();
- } else if (arg_type == "char*") {
- compiler_type =
- type_system->GetBasicTypeFromAST(eBasicTypeChar).GetPointerType();
- } else {
- result.AppendErrorWithFormat("Invalid format: %s.\n", arg_entry.c_str());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- value.SetCompilerType(compiler_type);
- value_list.PushValue(value);
- }
-
- if (!abi->GetArgumentValues(*thread, value_list)) {
- result.AppendError("Couldn't get argument values");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- result.GetOutputStream().Printf("Arguments : \n");
-
- for (auto entry : llvm::enumerate(args.entries())) {
- result.GetOutputStream().Printf(
- "%" PRIu64 " (%s): ", (uint64_t)entry.index(), entry.value().c_str());
- value_list.GetValueAtIndex(entry.index())->Dump(&result.GetOutputStream());
- result.GetOutputStream().Printf("\n");
- }
-
- return result.Succeeded();
-}
diff --git a/source/Commands/CommandObjectArgs.h b/source/Commands/CommandObjectArgs.h
deleted file mode 100644
index aa7d2411adc8..000000000000
--- a/source/Commands/CommandObjectArgs.h
+++ /dev/null
@@ -1,52 +0,0 @@
-//===-- CommandObjectArgs.h -------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_CommandObjectArgs_h_
-#define liblldb_CommandObjectArgs_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Interpreter/CommandObject.h"
-#include "lldb/Interpreter/Options.h"
-
-namespace lldb_private {
-
-class CommandObjectArgs : public CommandObjectParsed {
-public:
- class CommandOptions : public Options {
- public:
- CommandOptions(CommandInterpreter &interpreter);
-
- ~CommandOptions() override;
-
- Status SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg,
- ExecutionContext *execution_context) override;
-
- void OptionParsingStarting(ExecutionContext *execution_context) override;
-
- llvm::ArrayRef<OptionDefinition> GetDefinitions() override;
- };
-
- CommandObjectArgs(CommandInterpreter &interpreter);
-
- ~CommandObjectArgs() override;
-
- Options *GetOptions() override;
-
-protected:
- CommandOptions m_options;
-
- bool DoExecute(Args &command, CommandReturnObject &result) override;
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_CommandObjectArgs_h_
diff --git a/source/Commands/CommandObjectBreakpoint.cpp b/source/Commands/CommandObjectBreakpoint.cpp
index 5a175d61060e..fb0553e482db 100644
--- a/source/Commands/CommandObjectBreakpoint.cpp
+++ b/source/Commands/CommandObjectBreakpoint.cpp
@@ -22,6 +22,7 @@
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/OptionValueUInt64.h"
@@ -84,8 +85,8 @@ public:
switch (short_option) {
case 'c':
- // Normally an empty breakpoint condition marks is as unset.
- // But we need to say it was passed in.
+ // Normally an empty breakpoint condition marks is as unset. But we need
+ // to say it was passed in.
m_bp_opts.SetCondition(option_arg.str().c_str());
m_bp_opts.m_set_flags.Set(BreakpointOptions::eCondition);
break;
@@ -100,7 +101,7 @@ public:
break;
case 'G': {
bool value, success;
- value = Args::StringToBoolean(option_arg, false, &success);
+ value = OptionArgParser::ToBoolean(option_arg, false, &success);
if (success) {
m_bp_opts.SetAutoContinue(value);
} else
@@ -121,7 +122,7 @@ public:
break;
case 'o': {
bool value, success;
- value = Args::StringToBoolean(option_arg, false, &success);
+ value = OptionArgParser::ToBoolean(option_arg, false, &success);
if (success) {
m_bp_opts.SetOneShot(value);
} else
@@ -262,8 +263,9 @@ static OptionDefinition g_breakpoint_set_options[] = {
"#included, set target.inline-breakpoint-strategy to \"always\"." },
{ LLDB_OPT_SET_1, true, "line", 'l', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeLineNum, "Specifies the line number on which to set this breakpoint." },
- // Comment out this option for the moment, as we don't actually use it, but will in the future.
- // This way users won't see it, but the infrastructure is left in place.
+ // Comment out this option for the moment, as we don't actually use it, but
+ // will in the future. This way users won't see it, but the infrastructure is
+ // left in place.
// { 0, false, "column", 'C', OptionParser::eRequiredArgument, nullptr, "<column>",
// "Set the breakpoint by source location at this particular column."},
@@ -281,7 +283,7 @@ static OptionDefinition g_breakpoint_set_options[] = {
{ LLDB_OPT_SET_9, false, "source-regexp-function", 'X', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFunctionName, "When used with '-p' limits the source regex to source contained in the named "
"functions. Can be repeated multiple times." },
{ LLDB_OPT_SET_4, true, "fullname", 'F', OptionParser::eRequiredArgument, nullptr, nullptr, CommandCompletions::eSymbolCompletion, eArgTypeFullName, "Set the breakpoint by fully qualified function names. For C++ this means "
- "namespaces and all arguments, and for Objective C this means a full function "
+ "namespaces and all arguments, and for Objective-C this means a full function "
"prototype with class and selector. Can be repeated multiple times to make "
"one breakpoint for multiple names." },
{ LLDB_OPT_SET_5, true, "selector", 'S', OptionParser::eRequiredArgument, nullptr, nullptr, 0, eArgTypeSelector, "Set the breakpoint by ObjC selector name. Can be repeated multiple times to "
@@ -377,8 +379,8 @@ public:
switch (short_option) {
case 'a': {
- m_load_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ m_load_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
} break;
case 'A':
@@ -442,7 +444,7 @@ public:
case 'h': {
bool success;
- m_catch_bp = Args::StringToBoolean(option_arg, true, &success);
+ m_catch_bp = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat(
"Invalid boolean value for on-catch option: '%s'",
@@ -456,7 +458,7 @@ public:
case 'K': {
bool success;
bool value;
- value = Args::StringToBoolean(option_arg, true, &success);
+ value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (value)
m_skip_prologue = eLazyBoolYes;
else
@@ -485,7 +487,7 @@ public:
case 'm': {
bool success;
bool value;
- value = Args::StringToBoolean(option_arg, true, &success);
+ value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (value)
m_move_to_nearest_code = eLazyBoolYes;
else
@@ -519,8 +521,8 @@ public:
case 'R': {
lldb::addr_t tmp_offset_addr;
- tmp_offset_addr =
- Args::StringToAddress(execution_context, option_arg, 0, &error);
+ tmp_offset_addr = OptionArgParser::ToAddress(execution_context,
+ option_arg, 0, &error);
if (error.Success())
m_offset_addr = tmp_offset_addr;
} break;
@@ -549,7 +551,7 @@ public:
case 'w': {
bool success;
- m_throw_bp = Args::StringToBoolean(option_arg, true, &success);
+ m_throw_bp = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat(
"Invalid boolean value for on-throw option: '%s'",
@@ -853,9 +855,9 @@ protected:
output_stream.Printf("Breakpoint set in dummy target, will get copied "
"into future targets.\n");
else {
- // Don't print out this warning for exception breakpoints. They can get
- // set before the target is set, but we won't know how to actually set
- // the breakpoint till we run.
+ // Don't print out this warning for exception breakpoints. They can
+ // get set before the target is set, but we won't know how to actually
+ // set the breakpoint till we run.
if (bp_sp->GetNumLocations() == 0 && break_type != eSetTypeException) {
output_stream.Printf("WARNING: Unable to resolve breakpoint to any "
"actual locations.\n");
@@ -874,8 +876,8 @@ private:
bool GetDefaultFile(Target *target, FileSpec &file,
CommandReturnObject &result) {
uint32_t default_line;
- // First use the Source Manager's default file.
- // Then use the current stack frame's file.
+ // First use the Source Manager's default file. Then use the current stack
+ // frame's file.
if (!target->GetSourceManager().GetDefaultFileAndLine(file, default_line)) {
StackFrame *cur_frame = m_exe_ctx.GetFramePtr();
if (cur_frame == nullptr) {
@@ -1451,7 +1453,8 @@ protected:
return false;
}
- // The following are the various types of breakpoints that could be cleared:
+ // The following are the various types of breakpoints that could be
+ // cleared:
// 1). -f -l (clearing breakpoint by source location)
BreakpointClearType break_type = eClearTypeInvalid;
@@ -1783,7 +1786,7 @@ public:
switch (short_option) {
case 'L': {
bool value, success;
- value = Args::StringToBoolean(option_arg, false, &success);
+ value = OptionArgParser::ToBoolean(option_arg, false, &success);
if (success) {
m_permissions.SetAllowList(value);
} else
@@ -1793,7 +1796,7 @@ public:
} break;
case 'A': {
bool value, success;
- value = Args::StringToBoolean(option_arg, false, &success);
+ value = OptionArgParser::ToBoolean(option_arg, false, &success);
if (success) {
m_permissions.SetAllowDisable(value);
} else
@@ -1803,7 +1806,7 @@ public:
} break;
case 'D': {
bool value, success;
- value = Args::StringToBoolean(option_arg, false, &success);
+ value = OptionArgParser::ToBoolean(option_arg, false, &success);
if (success) {
m_permissions.SetAllowDelete(value);
} else
@@ -1897,8 +1900,8 @@ protected:
return false;
}
}
- // Now configure them, we already pre-checked the names so we don't need
- // to check the error:
+ // Now configure them, we already pre-checked the names so we don't need to
+ // check the error:
BreakpointSP bp_sp;
if (m_bp_id.m_breakpoint.OptionWasSet())
{
@@ -2559,11 +2562,10 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target,
}
// Create a new Args variable to use; copy any non-breakpoint-id-ranges stuff
- // directly from the old ARGS to
- // the new TEMP_ARGS. Do not copy breakpoint id range strings over; instead
- // generate a list of strings for
- // all the breakpoint ids in the range, and shove all of those breakpoint id
- // strings into TEMP_ARGS.
+ // directly from the old ARGS to the new TEMP_ARGS. Do not copy breakpoint
+ // id range strings over; instead generate a list of strings for all the
+ // breakpoint ids in the range, and shove all of those breakpoint id strings
+ // into TEMP_ARGS.
BreakpointIDList::FindAndReplaceIDRanges(args, target, allow_locations,
purpose, result, temp_args);
@@ -2571,18 +2573,15 @@ void CommandObjectMultiwordBreakpoint::VerifyIDs(Args &args, Target *target,
// NOW, convert the list of breakpoint id strings in TEMP_ARGS into an actual
// BreakpointIDList:
- valid_ids->InsertStringArray(temp_args.GetConstArgumentVector(),
- temp_args.GetArgumentCount(), result);
+ valid_ids->InsertStringArray(temp_args.GetArgumentArrayRef(), result);
- // At this point, all of the breakpoint ids that the user passed in have been
- // converted to breakpoint IDs
- // and put into valid_ids.
+ // At this point, all of the breakpoint ids that the user passed in have
+ // been converted to breakpoint IDs and put into valid_ids.
if (result.Succeeded()) {
// Now that we've converted everything from args into a list of breakpoint
- // ids, go through our tentative list
- // of breakpoint id's and verify that they correspond to valid/currently set
- // breakpoints.
+ // ids, go through our tentative list of breakpoint id's and verify that
+ // they correspond to valid/currently set breakpoints.
const size_t count = valid_ids->GetSize();
for (size_t i = 0; i < count; ++i) {
diff --git a/source/Commands/CommandObjectBreakpointCommand.cpp b/source/Commands/CommandObjectBreakpointCommand.cpp
index 170cb8513116..f2546cbed848 100644
--- a/source/Commands/CommandObjectBreakpointCommand.cpp
+++ b/source/Commands/CommandObjectBreakpointCommand.cpp
@@ -22,6 +22,7 @@
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
@@ -293,7 +294,7 @@ are no syntax errors may indicate that a function was declared but never called.
break;
case 's':
- m_script_language = (lldb::ScriptLanguage)Args::StringToOptionEnum(
+ m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum(
option_arg, g_breakpoint_add_options[option_idx].enum_values,
eScriptLanguageNone, error);
@@ -307,7 +308,8 @@ are no syntax errors may indicate that a function was declared but never called.
case 'e': {
bool success = false;
- m_stop_on_error = Args::StringToBoolean(option_arg, false, &success);
+ m_stop_on_error =
+ OptionArgParser::ToBoolean(option_arg, false, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid value for stop-on-error: \"%s\"",
@@ -410,8 +412,8 @@ protected:
} else {
BreakpointLocationSP bp_loc_sp(
bp->FindLocationByID(cur_bp_id.GetLocationID()));
- // This breakpoint does have an associated location.
- // Get its breakpoint options.
+ // This breakpoint does have an associated location. Get its
+ // breakpoint options.
if (bp_loc_sp)
bp_options = bp_loc_sp->GetLocationOptions();
}
@@ -420,9 +422,9 @@ protected:
}
}
- // If we are using script language, get the script interpreter
- // in order to set or collect command callback. Otherwise, call
- // the methods associated with this object.
+ // If we are using script language, get the script interpreter in order
+ // to set or collect command callback. Otherwise, call the methods
+ // associated with this object.
if (m_options.m_use_script_language) {
ScriptInterpreter *script_interp = m_interpreter.GetScriptInterpreter();
// Special handling for one-liner specified inline.
@@ -454,16 +456,15 @@ private:
std::vector<BreakpointOptions *> m_bp_options_vec; // This stores the
// breakpoint options that
// we are currently
- // collecting commands for. In the CollectData... calls we need
- // to hand this off to the IOHandler, which may run asynchronously.
- // So we have to have some way to keep it alive, and not leak it.
- // Making it an ivar of the command object, which never goes away
- // achieves this. Note that if we were able to run
- // the same command concurrently in one interpreter we'd have to
- // make this "per invocation". But there are many more reasons
- // why it is not in general safe to do that in lldb at present,
- // so it isn't worthwhile to come up with a more complex mechanism
- // to address this particular weakness right now.
+ // collecting commands for. In the CollectData... calls we need to hand this
+ // off to the IOHandler, which may run asynchronously. So we have to have
+ // some way to keep it alive, and not leak it. Making it an ivar of the
+ // command object, which never goes away achieves this. Note that if we were
+ // able to run the same command concurrently in one interpreter we'd have to
+ // make this "per invocation". But there are many more reasons why it is not
+ // in general safe to do that in lldb at present, so it isn't worthwhile to
+ // come up with a more complex mechanism to address this particular weakness
+ // right now.
static const char *g_reader_instructions;
};
diff --git a/source/Commands/CommandObjectCommands.cpp b/source/Commands/CommandObjectCommands.cpp
index c9d71a65754b..3012ee4a188d 100644
--- a/source/Commands/CommandObjectCommands.cpp
+++ b/source/Commands/CommandObjectCommands.cpp
@@ -18,16 +18,17 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/IOHandler.h"
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandHistory.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObjectRegexCommand.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/OptionValueUInt64.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/StringList.h"
using namespace lldb;
@@ -234,20 +235,13 @@ public:
return "";
}
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- auto completion_str = input[cursor_index].ref;
- completion_str = completion_str.take_front(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str, match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
Options *GetOptions() override { return &m_options; }
@@ -330,9 +324,8 @@ protected:
m_interpreter.HandleCommandsFromFile(cmd_file, exe_ctx, options, result);
} else {
- // No options were set, inherit any settings from nested "command
- // source" commands,
- // or set to sane default settings...
+ // No options were set, inherit any settings from nested "command source"
+ // commands, or set to sane default settings...
CommandInterpreterRunOptions options;
m_interpreter.HandleCommandsFromFile(cmd_file, exe_ctx, options, result);
}
@@ -543,9 +536,9 @@ rather than using a positional placeholder:"
~CommandObjectCommandsAlias() override = default;
protected:
- bool DoExecute(const char *raw_command_line,
+ bool DoExecute(llvm::StringRef raw_command_line,
CommandReturnObject &result) override {
- if (!raw_command_line || !raw_command_line[0]) {
+ if (raw_command_line.empty()) {
result.AppendError("'command alias' requires at least two arguments");
return false;
}
@@ -553,42 +546,13 @@ protected:
ExecutionContext exe_ctx = GetCommandInterpreter().GetExecutionContext();
m_option_group.NotifyOptionParsingStarting(&exe_ctx);
- const char *remainder = nullptr;
-
- if (raw_command_line[0] == '-') {
- // We have some options and these options MUST end with --.
- const char *end_options = nullptr;
- const char *s = raw_command_line;
- while (s && s[0]) {
- end_options = ::strstr(s, "--");
- if (end_options) {
- end_options += 2; // Get past the "--"
- if (::isspace(end_options[0])) {
- remainder = end_options;
- while (::isspace(*remainder))
- ++remainder;
- break;
- }
- }
- s = end_options;
- }
-
- if (end_options) {
- Args args(
- llvm::StringRef(raw_command_line, end_options - raw_command_line));
- if (!ParseOptions(args, result))
- return false;
+ OptionsWithRaw args_with_suffix(raw_command_line);
+ const char *remainder = args_with_suffix.GetRawPart().c_str();
- Status error(m_option_group.NotifyOptionParsingFinished(&exe_ctx));
- if (error.Fail()) {
- result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- }
- }
- if (nullptr == remainder)
- remainder = raw_command_line;
+ if (args_with_suffix.HasArgs())
+ if (!ParseOptionsAndNotify(args_with_suffix.GetArgs(), result,
+ m_option_group, exe_ctx))
+ return false;
llvm::StringRef raw_command_string(remainder);
Args args(raw_command_string);
@@ -613,8 +577,7 @@ protected:
}
// Strip the new alias name off 'raw_command_string' (leave it on args,
- // which gets passed to 'Execute', which
- // does the stripping itself.
+ // which gets passed to 'Execute', which does the stripping itself.
size_t pos = raw_command_string.find(alias_command);
if (pos == 0) {
raw_command_string = raw_command_string.substr(alias_command.size());
@@ -652,9 +615,8 @@ protected:
return false;
} else if (!cmd_obj->WantsRawCommandString()) {
// Note that args was initialized with the original command, and has not
- // been updated to this point.
- // Therefore can we pass it to the version of Execute that does not
- // need/expect raw input in the alias.
+ // been updated to this point. Therefore can we pass it to the version of
+ // Execute that does not need/expect raw input in the alias.
return HandleAliasingNormalCommand(args, result);
} else {
return HandleAliasingRawCommand(alias_command, raw_command_string,
@@ -1128,8 +1090,8 @@ protected:
return error;
}
const size_t first_separator_char_pos = 1;
- // use the char that follows 's' as the regex separator character
- // so we can have "s/<regex>/<subst>/" or "s|<regex>|<subst>|"
+ // use the char that follows 's' as the regex separator character so we can
+ // have "s/<regex>/<subst>/" or "s|<regex>|<subst>|"
const char separator_char = regex_sed[first_separator_char_pos];
const size_t second_separator_char_pos =
regex_sed.find(separator_char, first_separator_char_pos + 1);
@@ -1158,8 +1120,7 @@ protected:
}
if (third_separator_char_pos != regex_sed_size - 1) {
- // Make sure that everything that follows the last regex
- // separator char
+ // Make sure that everything that follows the last regex separator char
if (regex_sed.find_first_not_of("\t\n\v\f\r ",
third_separator_char_pos + 1) !=
std::string::npos) {
@@ -1307,7 +1268,7 @@ public:
}
protected:
- bool DoExecute(const char *raw_command_line,
+ bool DoExecute(llvm::StringRef raw_command_line,
CommandReturnObject &result) override {
ScriptInterpreter *scripter = m_interpreter.GetScriptInterpreter();
@@ -1396,7 +1357,7 @@ public:
}
protected:
- bool DoExecute(const char *raw_command_line,
+ bool DoExecute(llvm::StringRef raw_command_line,
CommandReturnObject &result) override {
ScriptInterpreter *scripter = m_interpreter.GetScriptInterpreter();
@@ -1462,20 +1423,13 @@ public:
~CommandObjectCommandsScriptImport() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- llvm::StringRef completion_str = input[cursor_index].ref;
- completion_str = completion_str.take_front(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str, match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
Options *GetOptions() override { return &m_options; }
@@ -1540,10 +1494,11 @@ protected:
// FIXME: this is necessary because CommandObject::CheckRequirements()
// assumes that commands won't ever be recursively invoked, but it's
// actually possible to craft a Python script that does other "command
- // script imports" in __lldb_init_module the real fix is to have recursive
- // commands possible with a CommandInvocation object separate from the
- // CommandObject itself, so that recursive command invocations won't stomp
- // on each other (wrt to execution contents, options, and more)
+ // script imports" in __lldb_init_module the real fix is to have
+ // recursive commands possible with a CommandInvocation object separate
+ // from the CommandObject itself, so that recursive command invocations
+ // won't stomp on each other (wrt to execution contents, options, and
+ // more)
m_exe_ctx.Clear();
if (m_interpreter.GetScriptInterpreter()->LoadScriptingModule(
entry.c_str(), m_options.m_allow_reload, init_session, error)) {
@@ -1639,7 +1594,7 @@ protected:
break;
case 's':
m_synchronicity =
- (ScriptedCommandSynchronicity)Args::StringToOptionEnum(
+ (ScriptedCommandSynchronicity)OptionArgParser::ToOptionEnum(
option_arg, GetDefinitions()[option_idx].enum_values, 0, error);
if (!error.Success())
error.SetErrorStringWithFormat(
diff --git a/source/Commands/CommandObjectDisassemble.cpp b/source/Commands/CommandObjectDisassemble.cpp
index 31c54b7d433b..519e5e2dcdb0 100644
--- a/source/Commands/CommandObjectDisassemble.cpp
+++ b/source/Commands/CommandObjectDisassemble.cpp
@@ -20,6 +20,7 @@
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
@@ -101,14 +102,14 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue(
break;
case 's': {
- start_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ start_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
if (start_addr != LLDB_INVALID_ADDRESS)
some_location_specified = true;
} break;
case 'e': {
- end_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ end_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
if (end_addr != LLDB_INVALID_ADDRESS)
some_location_specified = true;
} break;
@@ -125,8 +126,8 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue(
case 'l':
frame_line = true;
- // Disassemble the current source line kind of implies showing mixed
- // source code context.
+ // Disassemble the current source line kind of implies showing mixed source
+ // code context.
show_mixed = true;
some_location_specified = true;
break;
@@ -160,15 +161,14 @@ Status CommandObjectDisassemble::CommandOptions::SetOptionValue(
case 'A':
if (execution_context) {
- auto target_sp =
- execution_context ? execution_context->GetTargetSP() : TargetSP();
- auto platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP();
- arch = Platform::GetAugmentedArchSpec(platform_sp.get(), option_arg);
+ const auto &target_sp = execution_context->GetTargetSP();
+ auto platform_ptr = target_sp ? target_sp->GetPlatform().get() : nullptr;
+ arch = Platform::GetAugmentedArchSpec(platform_ptr, option_arg);
}
break;
case 'a': {
- symbol_containing_addr = Args::StringToAddress(
+ symbol_containing_addr = OptionArgParser::ToAddress(
execution_context, option_arg, LLDB_INVALID_ADDRESS, &error);
if (symbol_containing_addr != LLDB_INVALID_ADDRESS) {
some_location_specified = true;
@@ -204,10 +204,9 @@ void CommandObjectDisassemble::CommandOptions::OptionParsingStarting(
execution_context ? execution_context->GetTargetPtr() : nullptr;
// This is a hack till we get the ability to specify features based on
- // architecture. For now GetDisassemblyFlavor
- // is really only valid for x86 (and for the llvm assembler plugin, but I'm
- // papering over that since that is the
- // only disassembler plugin we have...
+ // architecture. For now GetDisassemblyFlavor is really only valid for x86
+ // (and for the llvm assembler plugin, but I'm papering over that since that
+ // is the only disassembler plugin we have...
if (target) {
if (target->GetArchitecture().GetTriple().getArch() == llvm::Triple::x86 ||
target->GetArchitecture().GetTriple().getArch() ==
@@ -374,8 +373,8 @@ bool CommandObjectDisassemble::DoExecute(Args &command,
}
}
- // Did the "m_options.frame_line" find a valid range already? If so
- // skip the rest...
+ // Did the "m_options.frame_line" find a valid range already? If so skip
+ // the rest...
if (range.GetByteSize() == 0) {
if (m_options.at_pc) {
if (frame == nullptr) {
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 01ca31111555..08959ff8473d 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -27,6 +27,7 @@
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/Variable.h"
#include "lldb/Target/Language.h"
@@ -88,7 +89,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
case 'a': {
bool success;
bool result;
- result = Args::StringToBoolean(option_arg, true, &success);
+ result = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid all-threads value setting: \"%s\"",
@@ -99,7 +100,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
case 'i': {
bool success;
- bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+ bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
ignore_breakpoints = tmp_value;
else
@@ -111,7 +112,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
case 'j': {
bool success;
- bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+ bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
allow_jit = tmp_value;
else
@@ -131,7 +132,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
case 'u': {
bool success;
- bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+ bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
unwind_on_error = tmp_value;
else
@@ -146,8 +147,8 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
m_verbosity = eLanguageRuntimeDescriptionDisplayVerbosityFull;
break;
}
- m_verbosity =
- (LanguageRuntimeDescriptionDisplayVerbosity)Args::StringToOptionEnum(
+ m_verbosity = (LanguageRuntimeDescriptionDisplayVerbosity)
+ OptionArgParser::ToOptionEnum(
option_arg, GetDefinitions()[option_idx].enum_values, 0, error);
if (!error.Success())
error.SetErrorStringWithFormat(
@@ -167,7 +168,7 @@ Status CommandObjectExpression::CommandOptions::SetOptionValue(
case 'X': {
bool success;
- bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+ bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
auto_apply_fixits = tmp_value ? eLazyBoolYes : eLazyBoolNo;
else
@@ -317,13 +318,13 @@ CanBeUsedForElementCountPrinting(ValueObject &valobj) {
return Status();
}
-bool CommandObjectExpression::EvaluateExpression(const char *expr,
+bool CommandObjectExpression::EvaluateExpression(llvm::StringRef expr,
Stream *output_stream,
Stream *error_stream,
CommandReturnObject *result) {
- // Don't use m_exe_ctx as this might be called asynchronously
- // after the command object DoExecute has finished when doing
- // multi-line expression that use an input reader...
+ // Don't use m_exe_ctx as this might be called asynchronously after the
+ // command object DoExecute has finished when doing multi-line expression
+ // that use an input reader...
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
Target *target = exe_ctx.GetTargetPtr();
@@ -362,8 +363,8 @@ bool CommandObjectExpression::EvaluateExpression(const char *expr,
if (m_command_options.top_level)
options.SetExecutionPolicy(eExecutionPolicyTopLevel);
- // If there is any chance we are going to stop and want to see
- // what went wrong with our expression, we should generate debug info
+ // If there is any chance we are going to stop and want to see what went
+ // wrong with our expression, we should generate debug info
if (!m_command_options.ignore_breakpoints ||
!m_command_options.unwind_on_error)
options.SetGenerateDebugInfo(true);
@@ -474,9 +475,8 @@ bool CommandObjectExpression::IOHandlerIsInputComplete(IOHandler &io_handler,
// An empty lines is used to indicate the end of input
const size_t num_lines = lines.GetSize();
if (num_lines > 0 && lines[num_lines - 1].empty()) {
- // Remove the last empty line from "lines" so it doesn't appear
- // in our resulting input and return true to indicate we are done
- // getting lines
+ // Remove the last empty line from "lines" so it doesn't appear in our
+ // resulting input and return true to indicate we are done getting lines
lines.PopBack();
return true;
}
@@ -508,125 +508,91 @@ void CommandObjectExpression::GetMultilineExpression() {
debugger.PushIOHandler(io_handler_sp);
}
-bool CommandObjectExpression::DoExecute(const char *command,
+bool CommandObjectExpression::DoExecute(llvm::StringRef command,
CommandReturnObject &result) {
m_fixed_expression.clear();
auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
m_option_group.NotifyOptionParsingStarting(&exe_ctx);
- const char *expr = nullptr;
-
- if (command[0] == '\0') {
+ if (command.empty()) {
GetMultilineExpression();
return result.Succeeded();
}
- if (command[0] == '-') {
- // We have some options and these options MUST end with --.
- const char *end_options = nullptr;
- const char *s = command;
- while (s && s[0]) {
- end_options = ::strstr(s, "--");
- if (end_options) {
- end_options += 2; // Get past the "--"
- if (::isspace(end_options[0])) {
- expr = end_options;
- while (::isspace(*expr))
- ++expr;
- break;
- }
- }
- s = end_options;
- }
-
- if (end_options) {
- Args args(llvm::StringRef(command, end_options - command));
- if (!ParseOptions(args, result))
- return false;
-
- Status error(m_option_group.NotifyOptionParsingFinished(&exe_ctx));
- if (error.Fail()) {
- result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- if (m_repl_option.GetOptionValue().GetCurrentValue()) {
- Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
- if (target) {
- // Drop into REPL
- m_expr_lines.clear();
- m_expr_line_count = 0;
-
- Debugger &debugger = target->GetDebugger();
-
- // Check if the LLDB command interpreter is sitting on top of a REPL
- // that
- // launched it...
- if (debugger.CheckTopIOHandlerTypes(
- IOHandler::Type::CommandInterpreter, IOHandler::Type::REPL)) {
- // the LLDB command interpreter is sitting on top of a REPL that
- // launched it,
- // so just say the command interpreter is done and fall back to the
- // existing REPL
- m_interpreter.GetIOHandler(false)->SetIsDone(true);
- } else {
- // We are launching the REPL on top of the current LLDB command
- // interpreter,
- // so just push one
- bool initialize = false;
- Status repl_error;
- REPLSP repl_sp(target->GetREPL(
- repl_error, m_command_options.language, nullptr, false));
-
- if (!repl_sp) {
- initialize = true;
- repl_sp = target->GetREPL(repl_error, m_command_options.language,
- nullptr, true);
- if (!repl_error.Success()) {
- result.SetError(repl_error);
- return result.Succeeded();
- }
+ OptionsWithRaw args(command);
+ llvm::StringRef expr = args.GetRawPart();
+
+ if (args.HasArgs()) {
+ if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group, exe_ctx))
+ return false;
+
+ if (m_repl_option.GetOptionValue().GetCurrentValue()) {
+ Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
+ if (target) {
+ // Drop into REPL
+ m_expr_lines.clear();
+ m_expr_line_count = 0;
+
+ Debugger &debugger = target->GetDebugger();
+
+ // Check if the LLDB command interpreter is sitting on top of a REPL
+ // that launched it...
+ if (debugger.CheckTopIOHandlerTypes(IOHandler::Type::CommandInterpreter,
+ IOHandler::Type::REPL)) {
+ // the LLDB command interpreter is sitting on top of a REPL that
+ // launched it, so just say the command interpreter is done and
+ // fall back to the existing REPL
+ m_interpreter.GetIOHandler(false)->SetIsDone(true);
+ } else {
+ // We are launching the REPL on top of the current LLDB command
+ // interpreter, so just push one
+ bool initialize = false;
+ Status repl_error;
+ REPLSP repl_sp(target->GetREPL(repl_error, m_command_options.language,
+ nullptr, false));
+
+ if (!repl_sp) {
+ initialize = true;
+ repl_sp = target->GetREPL(repl_error, m_command_options.language,
+ nullptr, true);
+ if (!repl_error.Success()) {
+ result.SetError(repl_error);
+ return result.Succeeded();
}
+ }
- if (repl_sp) {
- if (initialize) {
- repl_sp->SetCommandOptions(m_command_options);
- repl_sp->SetFormatOptions(m_format_options);
- repl_sp->SetValueObjectDisplayOptions(m_varobj_options);
- }
+ if (repl_sp) {
+ if (initialize) {
+ repl_sp->SetCommandOptions(m_command_options);
+ repl_sp->SetFormatOptions(m_format_options);
+ repl_sp->SetValueObjectDisplayOptions(m_varobj_options);
+ }
- IOHandlerSP io_handler_sp(repl_sp->GetIOHandler());
+ IOHandlerSP io_handler_sp(repl_sp->GetIOHandler());
- io_handler_sp->SetIsDone(false);
+ io_handler_sp->SetIsDone(false);
- debugger.PushIOHandler(io_handler_sp);
- } else {
- repl_error.SetErrorStringWithFormat(
- "Couldn't create a REPL for %s",
- Language::GetNameForLanguageType(m_command_options.language));
- result.SetError(repl_error);
- return result.Succeeded();
- }
+ debugger.PushIOHandler(io_handler_sp);
+ } else {
+ repl_error.SetErrorStringWithFormat(
+ "Couldn't create a REPL for %s",
+ Language::GetNameForLanguageType(m_command_options.language));
+ result.SetError(repl_error);
+ return result.Succeeded();
}
}
}
- // No expression following options
- else if (expr == nullptr || expr[0] == '\0') {
- GetMultilineExpression();
- return result.Succeeded();
- }
+ }
+ // No expression following options
+ else if (expr.empty()) {
+ GetMultilineExpression();
+ return result.Succeeded();
}
}
- if (expr == nullptr)
- expr = command;
-
+ Target *target = GetSelectedOrDummyTarget();
if (EvaluateExpression(expr, &(result.GetOutputStream()),
&(result.GetErrorStream()), &result)) {
- Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
- if (!target)
- target = GetDummyTarget();
if (!m_fixed_expression.empty() && target->GetEnableNotifyAboutFixIts()) {
CommandHistory &history = m_interpreter.GetCommandHistory();
@@ -634,18 +600,21 @@ bool CommandObjectExpression::DoExecute(const char *command,
// for expr???)
// If we can it would be nice to show that.
std::string fixed_command("expression ");
- if (expr == command)
- fixed_command.append(m_fixed_expression);
- else {
+ if (args.HasArgs()) {
// Add in any options that might have been in the original command:
- fixed_command.append(command, expr - command);
+ fixed_command.append(args.GetArgStringWithDelimiter());
+ fixed_command.append(m_fixed_expression);
+ } else
fixed_command.append(m_fixed_expression);
- }
history.AppendString(fixed_command);
}
+ // Increment statistics to record this expression evaluation success.
+ target->IncrementStats(StatisticKind::ExpressionSuccessful);
return true;
}
+ // Increment statistics to record this expression evaluation failure.
+ target->IncrementStats(StatisticKind::ExpressionFailure);
result.SetStatus(eReturnStatusFailed);
return false;
}
diff --git a/source/Commands/CommandObjectExpression.h b/source/Commands/CommandObjectExpression.h
index 0cf2a7263d52..710f87140977 100644
--- a/source/Commands/CommandObjectExpression.h
+++ b/source/Commands/CommandObjectExpression.h
@@ -72,9 +72,9 @@ protected:
bool IOHandlerIsInputComplete(IOHandler &io_handler,
StringList &lines) override;
- bool DoExecute(const char *command, CommandReturnObject &result) override;
+ bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
- bool EvaluateExpression(const char *expr, Stream *output_stream,
+ bool EvaluateExpression(llvm::StringRef expr, Stream *output_stream,
Stream *error_stream,
CommandReturnObject *result = NULL);
diff --git a/source/Commands/CommandObjectFrame.cpp b/source/Commands/CommandObjectFrame.cpp
index 0bcc35062968..0183c43f85b5 100644
--- a/source/Commands/CommandObjectFrame.cpp
+++ b/source/Commands/CommandObjectFrame.cpp
@@ -24,7 +24,6 @@
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
@@ -44,6 +43,7 @@
#include "lldb/Target/StopInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
@@ -342,8 +342,8 @@ protected:
frame_idx += m_options.relative_frame_offset;
else {
if (frame_idx == 0) {
- // If you are already at the bottom of the stack, then just warn and
- // don't reset the frame.
+ // If you are already at the bottom of the stack, then just warn
+ // and don't reset the frame.
result.AppendError("Already at the bottom of the stack.");
result.SetStatus(eReturnStatusFailed);
return false;
@@ -463,21 +463,14 @@ public:
Options *GetOptions() override { return &m_option_group; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Arguments are the standard source file completer.
- auto completion_str = input[cursor_index].ref;
- completion_str = completion_str.take_front(cursor_char_position);
-
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eVariablePathCompletion,
- completion_str, match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
@@ -504,16 +497,15 @@ protected:
}
bool DoExecute(Args &command, CommandReturnObject &result) override {
- // No need to check "frame" for validity as eCommandRequiresFrame ensures it
- // is valid
+ // No need to check "frame" for validity as eCommandRequiresFrame ensures
+ // it is valid
StackFrame *frame = m_exe_ctx.GetFramePtr();
Stream &s = result.GetOutputStream();
// Be careful about the stack frame, if any summary formatter runs code, it
- // might clear the StackFrameList
- // for the thread. So hold onto a shared pointer to the frame so it stays
- // alive.
+ // might clear the StackFrameList for the thread. So hold onto a shared
+ // pointer to the frame so it stays alive.
VariableList *variable_list =
frame->GetVariableList(m_option_variable.show_globals);
@@ -547,8 +539,8 @@ protected:
if (!command.empty()) {
VariableList regex_var_list;
- // If we have any args to the variable command, we will make
- // variable objects from them...
+ // If we have any args to the variable command, we will make variable
+ // objects from them...
for (auto &entry : command) {
if (m_option_variable.use_regex) {
const size_t regex_start_index = regex_var_list.GetSize();
@@ -620,9 +612,6 @@ protected:
if (!scope_string.empty())
s.PutCString(scope_string);
-
- // if (format != eFormatDefault)
- // valobj_sp->SetFormat (format);
if (m_option_variable.show_decl && var_sp &&
var_sp->GetDeclaration().GetFile()) {
var_sp->GetDeclaration().DumpStopContext(&s, false);
@@ -680,14 +669,13 @@ protected:
if (m_option_variable.show_scope)
scope_string = GetScopeString(var_sp).str();
- // Use the variable object code to make sure we are
- // using the same APIs as the public API will be
- // using...
+ // Use the variable object code to make sure we are using the same
+ // APIs as the public API will be using...
valobj_sp = frame->GetValueObjectForFrameVariable(
var_sp, m_varobj_options.use_dynamic);
if (valobj_sp) {
- // When dumping all variables, don't print any variables
- // that are not in scope to avoid extra unneeded output
+ // When dumping all variables, don't print any variables that are
+ // not in scope to avoid extra unneeded output
if (valobj_sp->IsInScope()) {
if (!valobj_sp->GetTargetSP()
->GetDisplayRuntimeSupportValues() &&
@@ -723,7 +711,14 @@ protected:
m_interpreter.TruncationWarningGiven();
}
- return result.Succeeded();
+ // Increment statistics.
+ bool res = result.Succeeded();
+ Target *target = GetSelectedOrDummyTarget();
+ if (res)
+ target->IncrementStats(StatisticKind::FrameVarSuccess);
+ else
+ target->IncrementStats(StatisticKind::FrameVarFailure);
+ return res;
}
protected:
diff --git a/source/Commands/CommandObjectHelp.cpp b/source/Commands/CommandObjectHelp.cpp
index 99e9d7b3abd4..903c6011b03f 100644
--- a/source/Commands/CommandObjectHelp.cpp
+++ b/source/Commands/CommandObjectHelp.cpp
@@ -89,10 +89,9 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
CommandObject *cmd_obj;
const size_t argc = command.GetArgumentCount();
- // 'help' doesn't take any arguments, other than command names. If argc is 0,
- // we show the user
- // all commands (aliases and user commands if asked for). Otherwise every
- // argument must be the name of a command or a sub-command.
+ // 'help' doesn't take any arguments, other than command names. If argc is
+ // 0, we show the user all commands (aliases and user commands if asked for).
+ // Otherwise every argument must be the name of a command or a sub-command.
if (argc == 0) {
uint32_t cmd_types = CommandInterpreter::eCommandTypesBuiltin;
if (m_options.m_show_aliases)
@@ -210,34 +209,24 @@ bool CommandObjectHelp::DoExecute(Args &command, CommandReturnObject &result) {
return result.Succeeded();
}
-int CommandObjectHelp::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements,
- bool &word_complete,
- StringList &matches) {
+int CommandObjectHelp::HandleCompletion(CompletionRequest &request) {
// Return the completions of the commands in the help system:
- if (cursor_index == 0) {
- return m_interpreter.HandleCompletionMatches(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ if (request.GetCursorIndex() == 0) {
+ return m_interpreter.HandleCompletionMatches(request);
} else {
- CommandObject *cmd_obj = m_interpreter.GetCommandObject(input[0].ref);
+ CommandObject *cmd_obj =
+ m_interpreter.GetCommandObject(request.GetParsedLine()[0].ref);
// The command that they are getting help on might be ambiguous, in which
- // case we should complete that,
- // otherwise complete with the command the user is getting help on...
+ // case we should complete that, otherwise complete with the command the
+ // user is getting help on...
if (cmd_obj) {
- input.Shift();
- cursor_index--;
- return cmd_obj->HandleCompletion(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ return cmd_obj->HandleCompletion(request);
} else {
- return m_interpreter.HandleCompletionMatches(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ return m_interpreter.HandleCompletionMatches(request);
}
}
}
diff --git a/source/Commands/CommandObjectHelp.h b/source/Commands/CommandObjectHelp.h
index f1f87f8e63cc..c78682dead1f 100644
--- a/source/Commands/CommandObjectHelp.h
+++ b/source/Commands/CommandObjectHelp.h
@@ -30,10 +30,7 @@ public:
~CommandObjectHelp() override;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override;
+ int HandleCompletion(CompletionRequest &request) override;
static void GenerateAdditionalHelpAvenuesMessage(
Stream *s, llvm::StringRef command, llvm::StringRef prefix,
diff --git a/source/Commands/CommandObjectLog.cpp b/source/Commands/CommandObjectLog.cpp
index ef82d07f15fb..1389ff2bde02 100644
--- a/source/Commands/CommandObjectLog.cpp
+++ b/source/Commands/CommandObjectLog.cpp
@@ -16,9 +16,9 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/StreamFile.h"
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -26,6 +26,7 @@
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/RegularExpression.h"
@@ -100,7 +101,7 @@ public:
switch (short_option) {
case 'f':
- log_file.SetFile(option_arg, true);
+ log_file.SetFile(option_arg, true, FileSpec::Style::native);
break;
case 't':
log_options |= LLDB_LOG_OPTION_THREADSAFE;
@@ -345,7 +346,7 @@ protected:
}
} else if (sub_command.equals_lower("increment")) {
bool success;
- bool increment = Args::StringToBoolean(param, false, &success);
+ bool increment = OptionArgParser::ToBoolean(param, false, &success);
if (success) {
Timer::SetQuiet(!increment);
result.SetStatus(eReturnStatusSuccessFinishNoResult);
diff --git a/source/Commands/CommandObjectMemory.cpp b/source/Commands/CommandObjectMemory.cpp
index 8f4c186a8d69..e4a49e55857d 100644
--- a/source/Commands/CommandObjectMemory.cpp
+++ b/source/Commands/CommandObjectMemory.cpp
@@ -24,9 +24,9 @@
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionGroupOutputFile.h"
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
@@ -40,6 +40,7 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/StreamString.h"
@@ -553,8 +554,8 @@ protected:
lldb::addr_t addr;
size_t total_byte_size = 0;
if (argc == 0) {
- // Use the last address and byte size and all options as they were
- // if no options have been set
+ // Use the last address and byte size and all options as they were if no
+ // options have been set
addr = m_next_addr;
total_byte_size = m_prev_byte_size;
clang_ast_type = m_prev_clang_ast_type;
@@ -573,8 +574,8 @@ protected:
// TODO For non-8-bit byte addressable architectures this needs to be
// revisited to fully support all lldb's range of formatting options.
- // Furthermore code memory reads (for those architectures) will not
- // be correctly formatted even w/o formatting options.
+ // Furthermore code memory reads (for those architectures) will not be
+ // correctly formatted even w/o formatting options.
size_t item_byte_size =
target->GetArchitecture().GetDataByteSize() > 1
? target->GetArchitecture().GetDataByteSize()
@@ -590,8 +591,8 @@ protected:
}
if (argc > 0)
- addr = Args::StringToAddress(&m_exe_ctx, command[0].ref,
- LLDB_INVALID_ADDRESS, &error);
+ addr = OptionArgParser::ToAddress(&m_exe_ctx, command[0].ref,
+ LLDB_INVALID_ADDRESS, &error);
if (addr == LLDB_INVALID_ADDRESS) {
result.AppendError("invalid start address expression.");
@@ -601,7 +602,7 @@ protected:
}
if (argc == 2) {
- lldb::addr_t end_addr = Args::StringToAddress(
+ lldb::addr_t end_addr = OptionArgParser::ToAddress(
&m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, nullptr);
if (end_addr == LLDB_INVALID_ADDRESS) {
result.AppendError("invalid end address expression.");
@@ -843,16 +844,14 @@ protected:
if (!m_format_options.GetCountValue().OptionWasSet() || item_count == 1) {
// this turns requests such as
// memory read -fc -s10 -c1 *charPtrPtr
- // which make no sense (what is a char of size 10?)
- // into a request for fetching 10 chars of size 1 from the same memory
- // location
+ // which make no sense (what is a char of size 10?) into a request for
+ // fetching 10 chars of size 1 from the same memory location
format = eFormatCharArray;
item_count = item_byte_size;
item_byte_size = 1;
} else {
- // here we passed a count, and it was not 1
- // so we have a byte_size and a count
- // we could well multiply those, but instead let's just fail
+ // here we passed a count, and it was not 1 so we have a byte_size and
+ // a count we could well multiply those, but instead let's just fail
result.AppendErrorWithFormat(
"reading memory as characters of size %" PRIu64 " is not supported",
(uint64_t)item_byte_size);
@@ -1036,13 +1035,13 @@ protected:
}
Status error;
- lldb::addr_t low_addr = Args::StringToAddress(&m_exe_ctx, command[0].ref,
- LLDB_INVALID_ADDRESS, &error);
+ lldb::addr_t low_addr = OptionArgParser::ToAddress(
+ &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error);
if (low_addr == LLDB_INVALID_ADDRESS || error.Fail()) {
result.AppendError("invalid low address");
return false;
}
- lldb::addr_t high_addr = Args::StringToAddress(
+ lldb::addr_t high_addr = OptionArgParser::ToAddress(
&m_exe_ctx, command[1].ref, LLDB_INVALID_ADDRESS, &error);
if (high_addr == LLDB_INVALID_ADDRESS || error.Fail()) {
result.AppendError("invalid high address");
@@ -1210,7 +1209,7 @@ public:
switch (short_option) {
case 'i':
- m_infile.SetFile(option_value, true);
+ m_infile.SetFile(option_value, true, FileSpec::Style::native);
if (!m_infile.Exists()) {
m_infile.Clear();
error.SetErrorStringWithFormat("input file does not exist: '%s'",
@@ -1345,8 +1344,8 @@ protected:
size_t item_byte_size = byte_size_value.GetCurrentValue();
Status error;
- lldb::addr_t addr = Args::StringToAddress(&m_exe_ctx, command[0].ref,
- LLDB_INVALID_ADDRESS, &error);
+ lldb::addr_t addr = OptionArgParser::ToAddress(
+ &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error);
if (addr == LLDB_INVALID_ADDRESS) {
result.AppendError("invalid address expression\n");
@@ -1469,7 +1468,7 @@ protected:
break;
}
case eFormatBoolean:
- uval64 = Args::StringToBoolean(entry.ref, false, &success);
+ uval64 = OptionArgParser::ToBoolean(entry.ref, false, &success);
if (!success) {
result.AppendErrorWithFormat(
"'%s' is not a valid boolean string value.\n", entry.c_str());
@@ -1642,8 +1641,8 @@ protected:
}
Status error;
- lldb::addr_t addr = Args::StringToAddress(&m_exe_ctx, command[0].ref,
- LLDB_INVALID_ADDRESS, &error);
+ lldb::addr_t addr = OptionArgParser::ToAddress(
+ &m_exe_ctx, command[0].ref, LLDB_INVALID_ADDRESS, &error);
if (addr == LLDB_INVALID_ADDRESS) {
result.AppendError("invalid address expression");
@@ -1709,10 +1708,10 @@ protected:
m_cmd_name.c_str(), m_cmd_syntax.c_str());
result.SetStatus(eReturnStatusFailed);
} else {
- auto load_addr_str = command[0].ref;
if (command.GetArgumentCount() == 1) {
- load_addr = Args::StringToAddress(&m_exe_ctx, load_addr_str,
- LLDB_INVALID_ADDRESS, &error);
+ auto load_addr_str = command[0].ref;
+ load_addr = OptionArgParser::ToAddress(&m_exe_ctx, load_addr_str,
+ LLDB_INVALID_ADDRESS, &error);
if (error.Fail() || load_addr == LLDB_INVALID_ADDRESS) {
result.AppendErrorWithFormat(
"invalid address argument \"%s\": %s\n", command[0].c_str(),
diff --git a/source/Commands/CommandObjectMultiword.cpp b/source/Commands/CommandObjectMultiword.cpp
index 0d0aa108a4ce..ade1a2d01f38 100644
--- a/source/Commands/CommandObjectMultiword.cpp
+++ b/source/Commands/CommandObjectMultiword.cpp
@@ -55,8 +55,7 @@ CommandObjectSP CommandObjectMultiword::GetSubcommandSP(llvm::StringRef sub_cmd,
if (num_matches == 1) {
// Cleaner, but slightly less efficient would be to call back into this
- // function, since I now
- // know I have an exact match...
+ // function, since I now know I have an exact match...
sub_cmd = matches->GetStringAtIndex(0);
pos = m_subcommand_dict.find(sub_cmd);
@@ -121,8 +120,8 @@ bool CommandObjectMultiword::Execute(const char *args_string,
CommandObject *sub_cmd_obj = GetSubcommandObject(sub_command, &matches);
if (sub_cmd_obj != nullptr) {
// Now call CommandObject::Execute to process options in `rest_of_line`.
- // From there the command-specific version of Execute will be called,
- // with the processed arguments.
+ // From there the command-specific version of Execute will be called, with
+ // the processed arguments.
args.Shift();
sub_cmd_obj->Execute(args_string, result);
@@ -156,8 +155,8 @@ bool CommandObjectMultiword::Execute(const char *args_string,
}
void CommandObjectMultiword::GenerateHelpText(Stream &output_stream) {
- // First time through here, generate the help text for the object and
- // push it to the return result object as well
+ // First time through here, generate the help text for the object and push it
+ // to the return result object as well
CommandObject::GenerateHelpText(output_stream);
output_stream.PutCString("\nThe following subcommands are supported:\n\n");
@@ -187,18 +186,14 @@ void CommandObjectMultiword::GenerateHelpText(Stream &output_stream) {
"'help <command> <subcommand>'.\n");
}
-int CommandObjectMultiword::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements,
- bool &word_complete,
- StringList &matches) {
+int CommandObjectMultiword::HandleCompletion(CompletionRequest &request) {
// Any of the command matches will provide a complete word, otherwise the
// individual completers will override this.
- word_complete = true;
+ request.SetWordComplete(true);
+ auto &matches = request.GetMatches();
- auto arg0 = input[0].ref;
- if (cursor_index == 0) {
+ auto arg0 = request.GetParsedLine()[0].ref;
+ if (request.GetCursorIndex() == 0) {
AddNamesMatchingPartialString(m_subcommand_dict, arg0, matches);
if (matches.GetSize() == 1 && matches.GetStringAtIndex(0) != nullptr &&
@@ -206,16 +201,14 @@ int CommandObjectMultiword::HandleCompletion(Args &input, int &cursor_index,
StringList temp_matches;
CommandObject *cmd_obj = GetSubcommandObject(arg0, &temp_matches);
if (cmd_obj != nullptr) {
- if (input.GetArgumentCount() == 1) {
- word_complete = true;
+ if (request.GetParsedLine().GetArgumentCount() == 1) {
+ request.SetWordComplete(true);
} else {
matches.DeleteStringAtIndex(0);
- input.Shift();
- cursor_char_position = 0;
- input.AppendArgument(llvm::StringRef());
- return cmd_obj->HandleCompletion(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ request.GetParsedLine().Shift();
+ request.SetCursorCharPosition(0);
+ request.GetParsedLine().AppendArgument(llvm::StringRef());
+ return cmd_obj->HandleCompletion(request);
}
}
}
@@ -227,11 +220,9 @@ int CommandObjectMultiword::HandleCompletion(Args &input, int &cursor_index,
} else {
// Remove the one match that we got from calling GetSubcommandObject.
matches.DeleteStringAtIndex(0);
- input.Shift();
- cursor_index--;
- return sub_command_object->HandleCompletion(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ return sub_command_object->HandleCompletion(request);
}
}
}
@@ -371,31 +362,20 @@ Options *CommandObjectProxy::GetOptions() {
return nullptr;
}
-int CommandObjectProxy::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements,
- bool &word_complete,
- StringList &matches) {
+int CommandObjectProxy::HandleCompletion(CompletionRequest &request) {
CommandObject *proxy_command = GetProxyCommandObject();
if (proxy_command)
- return proxy_command->HandleCompletion(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
- matches.Clear();
+ return proxy_command->HandleCompletion(request);
+ request.GetMatches().Clear();
return 0;
}
int CommandObjectProxy::HandleArgumentCompletion(
- Args &input, int &cursor_index, int &cursor_char_position,
- OptionElementVector &opt_element_vector, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
+ CompletionRequest &request, OptionElementVector &opt_element_vector) {
CommandObject *proxy_command = GetProxyCommandObject();
if (proxy_command)
- return proxy_command->HandleArgumentCompletion(
- input, cursor_index, cursor_char_position, opt_element_vector,
- match_start_point, max_return_elements, word_complete, matches);
- matches.Clear();
+ return proxy_command->HandleArgumentCompletion(request, opt_element_vector);
+ request.GetMatches().Clear();
return 0;
}
diff --git a/source/Commands/CommandObjectPlatform.cpp b/source/Commands/CommandObjectPlatform.cpp
index 8ed003767d58..f822a8b54cb0 100644
--- a/source/Commands/CommandObjectPlatform.cpp
+++ b/source/Commands/CommandObjectPlatform.cpp
@@ -18,7 +18,6 @@
#include "lldb/Core/PluginManager.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandOptionValidators.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -27,6 +26,7 @@
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataExtractor.h"
#include "llvm/ADT/SmallString.h"
@@ -178,17 +178,10 @@ public:
~CommandObjectPlatformSelect() override = default;
- int HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
- CommandCompletions::PlatformPluginNames(
- GetCommandInterpreter(), completion_str.c_str(), match_start_point,
- max_return_elements, nullptr, word_complete, matches);
- return matches.GetSize();
+ int HandleCompletion(CompletionRequest &request) override {
+ CommandCompletions::PlatformPluginNames(GetCommandInterpreter(), request,
+ nullptr);
+ return request.GetMatches().GetSize();
}
Options *GetOptions() override { return &m_option_group; }
@@ -385,8 +378,8 @@ protected:
Status error;
if (platform_sp->IsConnected()) {
- // Cache the instance name if there is one since we are
- // about to disconnect and the name might go with it.
+ // Cache the instance name if there is one since we are about to
+ // disconnect and the name might go with it.
const char *hostname_cstr = platform_sp->GetHostname();
std::string hostname;
if (hostname_cstr)
@@ -867,8 +860,8 @@ public:
// argument entry.
arg2.push_back(file_arg_host);
- // Push the data for the first and the second arguments into the m_arguments
- // vector.
+ // Push the data for the first and the second arguments into the
+ // m_arguments vector.
m_arguments.push_back(arg1);
m_arguments.push_back(arg2);
}
@@ -1059,8 +1052,8 @@ protected:
if (argc > 0) {
if (m_options.launch_info.GetExecutableFile()) {
- // We already have an executable file, so we will use this
- // and all arguments to this function are extra arguments
+ // We already have an executable file, so we will use this and all
+ // arguments to this function are extra arguments
m_options.launch_info.GetArguments().AppendArguments(args);
} else {
// We don't have any file yet, so the first argument is our
@@ -1342,32 +1335,32 @@ protected:
} break;
case 'n':
- match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
- false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ option_arg, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::Equals);
break;
case 'e':
- match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
- false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ option_arg, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::EndsWith);
break;
case 's':
- match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
- false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ option_arg, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::StartsWith);
break;
case 'c':
- match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
- false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ option_arg, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::Contains);
break;
case 'r':
- match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
- false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ option_arg, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::RegularExpression);
break;
@@ -1536,7 +1529,8 @@ public:
break;
case 'n':
- attach_info.GetExecutableFile().SetFile(option_arg, false);
+ attach_info.GetExecutableFile().SetFile(option_arg, false,
+ FileSpec::Style::native);
break;
case 'w':
@@ -1560,11 +1554,8 @@ public:
}
bool HandleOptionArgumentCompletion(
- Args &input, int cursor_index, int char_pos,
- OptionElementVector &opt_element_vector, int opt_element_index,
- int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter, bool &word_complete,
- StringList &matches) override {
+ CompletionRequest &request, OptionElementVector &opt_element_vector,
+ int opt_element_index, CommandInterpreter &interpreter) override {
int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index;
@@ -1574,11 +1565,10 @@ public:
// Are we in the name?
// Look to see if there is a -P argument provided, and if so use that
- // plugin, otherwise
- // use the default plugin.
+ // plugin, otherwise use the default plugin.
const char *partial_name = nullptr;
- partial_name = input.GetArgumentAtIndex(opt_arg_pos);
+ partial_name = request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos);
PlatformSP platform_sp(interpreter.GetPlatform(true));
if (platform_sp) {
@@ -1586,14 +1576,14 @@ public:
ProcessInstanceInfoMatch match_info;
if (partial_name) {
match_info.GetProcessInfo().GetExecutableFile().SetFile(
- partial_name, false);
+ partial_name, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::StartsWith);
}
platform_sp->FindProcesses(match_info, process_infos);
const uint32_t num_matches = process_infos.GetSize();
if (num_matches > 0) {
for (uint32_t i = 0; i < num_matches; ++i) {
- matches.AppendString(
+ request.GetMatches().AppendString(
process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i));
}
@@ -1693,7 +1683,7 @@ class CommandObjectPlatformShell : public CommandObjectRaw {
public:
class CommandOptions : public Options {
public:
- CommandOptions() : Options(), timeout(10) {}
+ CommandOptions() : Options() {}
~CommandOptions() override = default;
@@ -1709,11 +1699,13 @@ public:
switch (short_option) {
case 't':
- timeout = 10;
- if (option_arg.getAsInteger(10, timeout))
+ uint32_t timeout_sec;
+ if (option_arg.getAsInteger(10, timeout_sec))
error.SetErrorStringWithFormat(
"could not convert \"%s\" to a numeric value.",
option_arg.str().c_str());
+ else
+ timeout = std::chrono::seconds(timeout_sec);
break;
default:
error.SetErrorStringWithFormat("invalid short option character '%c'",
@@ -1726,7 +1718,7 @@ public:
void OptionParsingStarting(ExecutionContext *execution_context) override {}
- uint32_t timeout;
+ Timeout<std::micro> timeout = std::chrono::seconds(10);
};
CommandObjectPlatformShell(CommandInterpreter &interpreter)
@@ -1739,47 +1731,24 @@ public:
Options *GetOptions() override { return &m_options; }
- bool DoExecute(const char *raw_command_line,
+ bool DoExecute(llvm::StringRef raw_command_line,
CommandReturnObject &result) override {
ExecutionContext exe_ctx = GetCommandInterpreter().GetExecutionContext();
m_options.NotifyOptionParsingStarting(&exe_ctx);
- const char *expr = nullptr;
// Print out an usage syntax on an empty command line.
- if (raw_command_line[0] == '\0') {
+ if (raw_command_line.empty()) {
result.GetOutputStream().Printf("%s\n", this->GetSyntax().str().c_str());
return true;
}
- if (raw_command_line[0] == '-') {
- // We have some options and these options MUST end with --.
- const char *end_options = nullptr;
- const char *s = raw_command_line;
- while (s && s[0]) {
- end_options = ::strstr(s, "--");
- if (end_options) {
- end_options += 2; // Get past the "--"
- if (::isspace(end_options[0])) {
- expr = end_options;
- while (::isspace(*expr))
- ++expr;
- break;
- }
- }
- s = end_options;
- }
-
- if (end_options) {
- Args args(
- llvm::StringRef(raw_command_line, end_options - raw_command_line));
- if (!ParseOptions(args, result))
- return false;
- }
- }
+ OptionsWithRaw args(raw_command_line);
+ const char *expr = args.GetRawPart().c_str();
- if (expr == nullptr)
- expr = raw_command_line;
+ if (args.HasArgs())
+ if (!ParseOptions(args.GetArgs(), result))
+ return false;
PlatformSP platform_sp(
m_interpreter.GetDebugger().GetPlatformList().GetSelectedPlatform());
diff --git a/source/Commands/CommandObjectPlugin.cpp b/source/Commands/CommandObjectPlugin.cpp
index 7e1b7f61f766..1f379a2660ed 100644
--- a/source/Commands/CommandObjectPlugin.cpp
+++ b/source/Commands/CommandObjectPlugin.cpp
@@ -42,20 +42,13 @@ public:
~CommandObjectPluginLoad() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- auto completion_str = input[cursor_index].ref;
- completion_str = completion_str.take_front(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str, match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
diff --git a/source/Commands/CommandObjectProcess.cpp b/source/Commands/CommandObjectProcess.cpp
index 9fbdd7630548..3ac27918df4c 100644
--- a/source/Commands/CommandObjectProcess.cpp
+++ b/source/Commands/CommandObjectProcess.cpp
@@ -21,9 +21,9 @@
#include "lldb/Host/Host.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
@@ -31,6 +31,7 @@
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -133,20 +134,14 @@ public:
~CommandObjectProcessLaunch() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
Options *GetOptions() override { return &m_options; }
@@ -179,18 +174,18 @@ protected:
llvm::StringRef target_settings_argv0 = target->GetArg0();
// Determine whether we will disable ASLR or leave it in the default state
- // (i.e. enabled if the platform supports it).
- // First check if the process launch options explicitly turn on/off
+ // (i.e. enabled if the platform supports it). First check if the process
+ // launch options explicitly turn on/off
// disabling ASLR. If so, use that setting;
// otherwise, use the 'settings target.disable-aslr' setting.
bool disable_aslr = false;
if (m_options.disable_aslr != eLazyBoolCalculate) {
- // The user specified an explicit setting on the process launch line. Use
- // it.
+ // The user specified an explicit setting on the process launch line.
+ // Use it.
disable_aslr = (m_options.disable_aslr == eLazyBoolYes);
} else {
- // The user did not explicitly specify whether to disable ASLR. Fall back
- // to the target.disable-aslr setting.
+ // The user did not explicitly specify whether to disable ASLR. Fall
+ // back to the target.disable-aslr setting.
disable_aslr = target->GetDisableASLR();
}
@@ -205,11 +200,7 @@ protected:
if (target->GetDisableSTDIO())
m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
- Args environment;
- target->GetEnvironmentAsArgs(environment);
- if (environment.GetArgumentCount() > 0)
- m_options.launch_info.GetEnvironmentEntries().AppendArguments(
- environment);
+ m_options.launch_info.GetEnvironment() = target->GetEnvironment();
if (!target_settings_argv0.empty()) {
m_options.launch_info.GetArguments().AppendArgument(
@@ -237,11 +228,10 @@ protected:
ProcessSP process_sp(target->GetProcessSP());
if (process_sp) {
// There is a race condition where this thread will return up the call
- // stack to the main command
- // handler and show an (lldb) prompt before HandlePrivateEvent (from
- // PrivateStateThread) has
- // a chance to call PushProcessIOHandler().
- process_sp->SyncIOHandler(0, 2000);
+ // stack to the main command handler and show an (lldb) prompt before
+ // HandlePrivateEvent (from PrivateStateThread) has a chance to call
+ // PushProcessIOHandler().
+ process_sp->SyncIOHandler(0, std::chrono::seconds(2));
llvm::StringRef data = stream.GetString();
if (!data.empty())
@@ -362,7 +352,8 @@ public:
break;
case 'n':
- attach_info.GetExecutableFile().SetFile(option_arg, false);
+ attach_info.GetExecutableFile().SetFile(option_arg, false,
+ FileSpec::Style::native);
break;
case 'w':
@@ -390,11 +381,8 @@ public:
}
bool HandleOptionArgumentCompletion(
- Args &input, int cursor_index, int char_pos,
- OptionElementVector &opt_element_vector, int opt_element_index,
- int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter, bool &word_complete,
- StringList &matches) override {
+ CompletionRequest &request, OptionElementVector &opt_element_vector,
+ int opt_element_index, CommandInterpreter &interpreter) override {
int opt_arg_pos = opt_element_vector[opt_element_index].opt_arg_pos;
int opt_defs_index = opt_element_vector[opt_element_index].opt_defs_index;
@@ -404,11 +392,10 @@ public:
// Are we in the name?
// Look to see if there is a -P argument provided, and if so use that
- // plugin, otherwise
- // use the default plugin.
+ // plugin, otherwise use the default plugin.
const char *partial_name = nullptr;
- partial_name = input.GetArgumentAtIndex(opt_arg_pos);
+ partial_name = request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos);
PlatformSP platform_sp(interpreter.GetPlatform(true));
if (platform_sp) {
@@ -416,14 +403,14 @@ public:
ProcessInstanceInfoMatch match_info;
if (partial_name) {
match_info.GetProcessInfo().GetExecutableFile().SetFile(
- partial_name, false);
+ partial_name, false, FileSpec::Style::native);
match_info.SetNameMatchType(NameMatch::StartsWith);
}
platform_sp->FindProcesses(match_info, process_infos);
const size_t num_matches = process_infos.GetSize();
if (num_matches > 0) {
for (size_t i = 0; i < num_matches; ++i) {
- matches.AppendString(
+ request.GetMatches().AppendString(
process_infos.GetProcessNameAtIndex(i),
process_infos.GetProcessNameLengthAtIndex(i));
}
@@ -456,10 +443,9 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
// N.B. The attach should be synchronous. It doesn't help much to get the
- // prompt back between initiating the attach
- // and the target actually stopping. So even if the interpreter is set to
- // be asynchronous, we wait for the stop
- // ourselves here.
+ // prompt back between initiating the attach and the target actually
+ // stopping. So even if the interpreter is set to be asynchronous, we wait
+ // for the stop ourselves here.
StateType state = eStateInvalid;
Process *process = m_exe_ctx.GetProcessPtr();
@@ -485,9 +471,8 @@ protected:
}
// Record the old executable module, we want to issue a warning if the
- // process of attaching changed the
- // current executable (like somebody said "file foo" then attached to a PID
- // whose executable was bar.)
+ // process of attaching changed the current executable (like somebody said
+ // "file foo" then attached to a PID whose executable was bar.)
ModuleSP old_exec_module_sp = target->GetExecutableModule();
ArchSpec old_arch_spec = target->GetArchitecture();
@@ -556,8 +541,8 @@ protected:
target->GetArchitecture().GetTriple().getTriple().c_str());
}
- // This supports the use-case scenario of immediately continuing the process
- // once attached.
+ // This supports the use-case scenario of immediately continuing the
+ // process once attached.
if (m_options.attach_info.GetContinueOnceAttached())
m_interpreter.HandleCommand("process continue", eLazyBoolNo, result);
@@ -695,11 +680,10 @@ protected:
if (error.Success()) {
// There is a race condition where this thread will return up the call
- // stack to the main command
- // handler and show an (lldb) prompt before HandlePrivateEvent (from
- // PrivateStateThread) has
- // a chance to call PushProcessIOHandler().
- process->SyncIOHandler(iohandler_id, 2000);
+ // stack to the main command handler and show an (lldb) prompt before
+ // HandlePrivateEvent (from PrivateStateThread) has a chance to call
+ // PushProcessIOHandler().
+ process->SyncIOHandler(iohandler_id, std::chrono::seconds(2));
result.AppendMessageWithFormat("Process %" PRIu64 " resuming\n",
process->GetID());
@@ -760,7 +744,7 @@ public:
case 's':
bool tmp_result;
bool success;
- tmp_result = Args::StringToBoolean(option_arg, false, &success);
+ tmp_result = OptionArgParser::ToBoolean(option_arg, false, &success);
if (!success)
error.SetErrorStringWithFormat("invalid boolean option: \"%s\"",
option_arg.str().c_str());
@@ -991,7 +975,7 @@ public:
case 'i':
do_install = true;
if (!option_arg.empty())
- install_path.SetFile(option_arg, false);
+ install_path.SetFile(option_arg, false, FileSpec::Style::native);
break;
default:
error.SetErrorStringWithFormat("invalid short option character '%c'",
@@ -1444,7 +1428,7 @@ public:
bool VerifyCommandOptionValue(const std::string &option, int &real_value) {
bool okay = true;
bool success = false;
- bool tmp_value = Args::StringToBoolean(option, false, &success);
+ bool tmp_value = OptionArgParser::ToBoolean(option, false, &success);
if (success && tmp_value)
real_value = 1;
@@ -1563,8 +1547,7 @@ protected:
int32_t signo = signals_sp->GetSignalNumberFromName(arg.c_str());
if (signo != LLDB_INVALID_SIGNAL_NUMBER) {
// Casting the actions as bools here should be okay, because
- // VerifyCommandOptionValue guarantees
- // the value is either 0 or 1.
+ // VerifyCommandOptionValue guarantees the value is either 0 or 1.
if (stop_action != -1)
signals_sp->SetShouldStop(signo, stop_action);
if (pass_action != -1) {
diff --git a/source/Commands/CommandObjectQuit.cpp b/source/Commands/CommandObjectQuit.cpp
index be55dab61683..37ed12be358f 100644
--- a/source/Commands/CommandObjectQuit.cpp
+++ b/source/Commands/CommandObjectQuit.cpp
@@ -16,6 +16,7 @@
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Target/Process.h"
+#include "lldb/Utility/StreamString.h"
using namespace lldb;
using namespace lldb_private;
@@ -26,14 +27,13 @@ using namespace lldb_private;
CommandObjectQuit::CommandObjectQuit(CommandInterpreter &interpreter)
: CommandObjectParsed(interpreter, "quit", "Quit the LLDB debugger.",
- "quit") {}
+ "quit [exit-code]") {}
CommandObjectQuit::~CommandObjectQuit() {}
-// returns true if there is at least one alive process
-// is_a_detach will be true if all alive processes will be detached when you
-// quit
-// and false if at least one process will be killed instead
+// returns true if there is at least one alive process is_a_detach will be true
+// if all alive processes will be detached when you quit and false if at least
+// one process will be killed instead
bool CommandObjectQuit::ShouldAskForConfirmation(bool &is_a_detach) {
if (m_interpreter.GetPromptOnQuit() == false)
return false;
@@ -78,6 +78,41 @@ bool CommandObjectQuit::DoExecute(Args &command, CommandReturnObject &result) {
return false;
}
}
+
+ if (command.GetArgumentCount() > 1) {
+ result.AppendError("Too many arguments for 'quit'. Only an optional exit "
+ "code is allowed");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+
+ if (command.GetArgumentCount() > 1) {
+ result.AppendError("Too many arguments for 'quit'. Only an optional exit "
+ "code is allowed");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+
+ // We parse the exit code argument if there is one.
+ if (command.GetArgumentCount() == 1) {
+ llvm::StringRef arg = command.GetArgumentAtIndex(0);
+ int exit_code;
+ if (arg.getAsInteger(/*autodetect radix*/ 0, exit_code)) {
+ lldb_private::StreamString s;
+ std::string arg_str = arg.str();
+ s.Printf("Couldn't parse '%s' as integer for exit code.", arg_str.data());
+ result.AppendError(s.GetString());
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+ if (!m_interpreter.SetQuitExitCode(exit_code)) {
+ result.AppendError("The current driver doesn't allow custom exit codes"
+ " for the quit command.");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+ }
+
const uint32_t event_type =
CommandInterpreter::eBroadcastBitQuitCommandReceived;
m_interpreter.BroadcastEvent(event_type);
diff --git a/source/Commands/CommandObjectRegister.cpp b/source/Commands/CommandObjectRegister.cpp
index d535742016ac..4dadc5d68d20 100644
--- a/source/Commands/CommandObjectRegister.cpp
+++ b/source/Commands/CommandObjectRegister.cpp
@@ -9,10 +9,10 @@
#include "CommandObjectRegister.h"
#include "lldb/Core/Debugger.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
@@ -25,6 +25,7 @@
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataExtractor.h"
#include "llvm/Support/Errno.h"
@@ -92,8 +93,8 @@ public:
bool prefix_with_altname = (bool)m_command_options.alternate_name;
bool prefix_with_name = !prefix_with_altname;
- reg_value.Dump(&strm, reg_info, prefix_with_name, prefix_with_altname,
- m_format_options.GetFormat(), 8);
+ DumpRegisterValue(reg_value, &strm, reg_info, prefix_with_name,
+ prefix_with_altname, m_format_options.GetFormat(), 8);
if ((reg_info->encoding == eEncodingUint) ||
(reg_info->encoding == eEncodingSint)) {
Process *process = exe_ctx.GetProcessPtr();
@@ -192,8 +193,8 @@ protected:
num_register_sets = reg_ctx->GetRegisterSetCount();
for (set_idx = 0; set_idx < num_register_sets; ++set_idx) {
- // When dump_all_sets option is set, dump primitive as well as derived
- // registers.
+ // When dump_all_sets option is set, dump primitive as well as
+ // derived registers.
DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx,
!m_command_options.dump_all_sets.GetCurrentValue());
}
@@ -209,8 +210,8 @@ protected:
result.SetStatus(eReturnStatusFailed);
} else {
for (auto &entry : command) {
- // in most LLDB commands we accept $rbx as the name for register RBX -
- // and here we would reject it and non-existant. we should be more
+ // in most LLDB commands we accept $rbx as the name for register RBX
+ // - and here we would reject it and non-existant. we should be more
// consistent towards the user and allow them to say reg read $rbx -
// internally, however, we should be strict and not allow ourselves
// to call our registers $rbx in our own API
@@ -350,11 +351,11 @@ protected:
auto reg_name = command[0].ref;
auto value_str = command[1].ref;
- // in most LLDB commands we accept $rbx as the name for register RBX - and
- // here we would reject it and non-existant. we should be more consistent
- // towards the user and allow them to say reg write $rbx - internally,
- // however, we should be strict and not allow ourselves to call our
- // registers $rbx in our own API
+ // in most LLDB commands we accept $rbx as the name for register RBX -
+ // and here we would reject it and non-existant. we should be more
+ // consistent towards the user and allow them to say reg write $rbx -
+ // internally, however, we should be strict and not allow ourselves to
+ // call our registers $rbx in our own API
reg_name.consume_front("$");
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoByName(reg_name);
@@ -365,8 +366,8 @@ protected:
Status error(reg_value.SetValueFromString(reg_info, value_str));
if (error.Success()) {
if (reg_ctx->WriteRegister(reg_info, reg_value)) {
- // Toss all frames and anything else in the thread
- // after a register has been written.
+ // Toss all frames and anything else in the thread after a register
+ // has been written.
m_exe_ctx.GetThreadRef().Flush();
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return true;
diff --git a/source/Commands/CommandObjectSettings.cpp b/source/Commands/CommandObjectSettings.cpp
index d42466cd13b1..f259f2fe200d 100644
--- a/source/Commands/CommandObjectSettings.cpp
+++ b/source/Commands/CommandObjectSettings.cpp
@@ -133,32 +133,27 @@ insert-before or insert-after.");
bool m_global;
};
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
- const size_t argc = input.GetArgumentCount();
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+
+ const size_t argc = request.GetParsedLine().GetArgumentCount();
const char *arg = nullptr;
int setting_var_idx;
- for (setting_var_idx = 1; setting_var_idx < static_cast<int>(argc);
+ for (setting_var_idx = 0; setting_var_idx < static_cast<int>(argc);
++setting_var_idx) {
- arg = input.GetArgumentAtIndex(setting_var_idx);
+ arg = request.GetParsedLine().GetArgumentAtIndex(setting_var_idx);
if (arg && arg[0] != '-')
break; // We found our setting variable name index
}
- if (cursor_index == setting_var_idx) {
+ if (request.GetCursorIndex() == setting_var_idx) {
// Attempting to complete setting variable name
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
} else {
- arg = input.GetArgumentAtIndex(cursor_index);
+ arg =
+ request.GetParsedLine().GetArgumentAtIndex(request.GetCursorIndex());
if (arg) {
if (arg[0] == '-') {
@@ -166,24 +161,23 @@ insert-before or insert-after.");
} else {
// Complete setting value
const char *setting_var_name =
- input.GetArgumentAtIndex(setting_var_idx);
+ request.GetParsedLine().GetArgumentAtIndex(setting_var_idx);
Status error;
lldb::OptionValueSP value_sp(
m_interpreter.GetDebugger().GetPropertyValue(
&m_exe_ctx, setting_var_name, false, error));
if (value_sp) {
- value_sp->AutoComplete(m_interpreter, completion_str.c_str(),
- match_start_point, max_return_elements,
- word_complete, matches);
+ value_sp->AutoComplete(m_interpreter, request);
}
}
}
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
Args cmd_args(command);
// Process possible options.
@@ -220,10 +214,8 @@ protected:
if (error.Success()) {
// FIXME this is the same issue as the one in commands script import
// we could be setting target.load-script-from-symbol-file which would
- // cause
- // Python scripts to be loaded, which could run LLDB commands
- // (e.g. settings set target.process.python-os-plugin-path) and cause a
- // crash
+ // cause Python scripts to be loaded, which could run LLDB commands (e.g.
+ // settings set target.process.python-os-plugin-path) and cause a crash
// if we did not clear the command's exe_ctx first
ExecutionContext exe_ctx(m_exe_ctx);
m_exe_ctx.Clear();
@@ -274,20 +266,13 @@ public:
~CommandObjectSettingsShow() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
@@ -347,20 +332,13 @@ public:
~CommandObjectSettingsList() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
@@ -442,26 +420,19 @@ public:
~CommandObjectSettingsRemove() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
- // Attempting to complete variable name
- if (cursor_index < 2)
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
Args cmd_args(command);
@@ -564,27 +535,21 @@ public:
// !WantsRawCommandString.
bool WantsCompletion() override { return true; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Attempting to complete variable name
- if (cursor_index < 2)
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
Args cmd_args(command);
@@ -670,27 +635,21 @@ public:
// !WantsRawCommandString.
bool WantsCompletion() override { return true; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Attempting to complete variable name
- if (cursor_index < 2)
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
Args cmd_args(command);
@@ -781,27 +740,21 @@ public:
// !WantsRawCommandString.
bool WantsCompletion() override { return true; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Attempting to complete variable name
- if (cursor_index < 2)
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
Args cmd_args(command);
@@ -881,27 +834,21 @@ public:
// !WantsRawCommandString.
bool WantsCompletion() override { return true; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Attempting to complete variable name
- if (cursor_index < 2)
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
Args cmd_args(command);
const size_t argc = cmd_args.GetArgumentCount();
@@ -920,8 +867,8 @@ protected:
return false;
}
- // Do not perform cmd_args.Shift() since StringRef is manipulating the
- // raw character string later on.
+ // Do not perform cmd_args.Shift() since StringRef is manipulating the raw
+ // character string later on.
// Split the raw command into var_name and value pair.
llvm::StringRef raw_str(command);
@@ -968,23 +915,16 @@ public:
~CommandObjectSettingsClear() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
// Attempting to complete variable name
- if (cursor_index < 2)
+ if (request.GetCursorIndex() < 2)
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSettingsNameCompletion,
- completion_str.c_str(), match_start_point, max_return_elements,
- nullptr, word_complete, matches);
+ request, nullptr);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
protected:
diff --git a/source/Commands/CommandObjectSource.cpp b/source/Commands/CommandObjectSource.cpp
index 066cc59c5c31..19e2e441c241 100644
--- a/source/Commands/CommandObjectSource.cpp
+++ b/source/Commands/CommandObjectSource.cpp
@@ -22,6 +22,7 @@
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
@@ -91,8 +92,8 @@ class CommandObjectSourceInfo : public CommandObjectParsed {
break;
case 'a': {
- address = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ address = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
} break;
case 's':
modules.push_back(std::string(option_arg));
@@ -147,16 +148,13 @@ public:
Options *GetOptions() override { return &m_options; }
protected:
- // Dump the line entries in each symbol context.
- // Return the number of entries found.
- // If module_list is set, only dump lines contained in one of the modules.
- // If file_spec is set, only dump lines in the file.
- // If the start_line option was specified, don't print lines less than
- // start_line.
+ // Dump the line entries in each symbol context. Return the number of entries
+ // found. If module_list is set, only dump lines contained in one of the
+ // modules. If file_spec is set, only dump lines in the file. If the
+ // start_line option was specified, don't print lines less than start_line.
// If the end_line option was specified, don't print lines greater than
- // end_line.
- // If the num_lines option was specified, dont print more than num_lines
- // entries.
+ // end_line. If the num_lines option was specified, dont print more than
+ // num_lines entries.
uint32_t DumpLinesInSymbolContexts(Stream &strm,
const SymbolContextList &sc_list,
const ModuleList &module_list,
@@ -221,14 +219,11 @@ protected:
}
// Dump the requested line entries for the file in the compilation unit.
- // Return the number of entries found.
- // If module_list is set, only dump lines contained in one of the modules.
- // If the start_line option was specified, don't print lines less than
- // start_line.
- // If the end_line option was specified, don't print lines greater than
- // end_line.
- // If the num_lines option was specified, dont print more than num_lines
- // entries.
+ // Return the number of entries found. If module_list is set, only dump lines
+ // contained in one of the modules. If the start_line option was specified,
+ // don't print lines less than start_line. If the end_line option was
+ // specified, don't print lines greater than end_line. If the num_lines
+ // option was specified, dont print more than num_lines entries.
uint32_t DumpFileLinesInCompUnit(Stream &strm, Module *module,
CompileUnit *cu, const FileSpec &file_spec) {
uint32_t start_line = m_options.start_line;
@@ -258,8 +253,8 @@ protected:
while (true) {
LineEntry line_entry;
- // Find the lowest index of a line entry with a line equal to
- // or higher than 'line'.
+ // Find the lowest index of a line entry with a line equal to or
+ // higher than 'line'.
uint32_t start_idx = 0;
start_idx = cu->FindLineEntry(start_idx, line, &cu_file_spec,
/*exact=*/false, &line_entry);
@@ -270,7 +265,8 @@ protected:
if (end_line > 0 && line_entry.line > end_line)
break;
- // Loop through to find any other entries for this line, dumping each.
+ // Loop through to find any other entries for this line, dumping
+ // each.
line = line_entry.line;
do {
num_matches++;
@@ -304,22 +300,18 @@ protected:
return num_matches;
}
- // Dump the requested line entries for the file in the module.
- // Return the number of entries found.
- // If module_list is set, only dump lines contained in one of the modules.
- // If the start_line option was specified, don't print lines less than
- // start_line.
- // If the end_line option was specified, don't print lines greater than
- // end_line.
- // If the num_lines option was specified, dont print more than num_lines
- // entries.
+ // Dump the requested line entries for the file in the module. Return the
+ // number of entries found. If module_list is set, only dump lines contained
+ // in one of the modules. If the start_line option was specified, don't print
+ // lines less than start_line. If the end_line option was specified, don't
+ // print lines greater than end_line. If the num_lines option was specified,
+ // dont print more than num_lines entries.
uint32_t DumpFileLinesInModule(Stream &strm, Module *module,
const FileSpec &file_spec) {
uint32_t num_matches = 0;
if (module) {
// Look through all the compilation units (CUs) in this module for ones
- // that
- // contain lines of code from this source file.
+ // that contain lines of code from this source file.
for (size_t i = 0; i < module->GetNumCompileUnits(); i++) {
// Look for a matching source file in this CU.
CompUnitSP cu_sp(module->GetCompileUnitAtIndex(i));
@@ -333,10 +325,8 @@ protected:
}
// Given an address and a list of modules, append the symbol contexts of all
- // line entries
- // containing the address found in the modules and return the count of
- // matches. If none
- // is found, return an error in 'error_strm'.
+ // line entries containing the address found in the modules and return the
+ // count of matches. If none is found, return an error in 'error_strm'.
size_t GetSymbolContextsForAddress(const ModuleList &module_list,
lldb::addr_t addr,
SymbolContextList &sc_list,
@@ -346,8 +336,8 @@ protected:
assert(module_list.GetSize() > 0);
Target *target = m_exe_ctx.GetTargetPtr();
if (target->GetSectionLoadList().IsEmpty()) {
- // The target isn't loaded yet, we need to lookup the file address in
- // all modules. Note: the module list option does not apply to addresses.
+ // The target isn't loaded yet, we need to lookup the file address in all
+ // modules. Note: the module list option does not apply to addresses.
const size_t num_modules = module_list.GetSize();
for (size_t i = 0; i < num_modules; ++i) {
ModuleSP module_sp(module_list.GetModuleAtIndex(i));
@@ -369,8 +359,8 @@ protected:
" not found in any modules.\n",
addr);
} else {
- // The target has some things loaded, resolve this address to a
- // compile unit + file + line and display
+ // The target has some things loaded, resolve this address to a compile
+ // unit + file + line and display
if (target->GetSectionLoadList().ResolveLoadAddress(addr, so_addr)) {
ModuleSP module_sp(so_addr.GetModule());
// Check to make sure this module is in our list.
@@ -408,8 +398,8 @@ protected:
return num_matches;
}
- // Dump the line entries found in functions matching the name specified in the
- // option.
+ // Dump the line entries found in functions matching the name specified in
+ // the option.
bool DumpLinesInFunctions(CommandReturnObject &result) {
SymbolContextList sc_list_funcs;
ConstString name(m_options.symbol_name.c_str());
@@ -709,8 +699,8 @@ class CommandObjectSourceList : public CommandObjectParsed {
break;
case 'a': {
- address = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ address = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
} break;
case 's':
modules.push_back(std::string(option_arg));
@@ -773,9 +763,9 @@ public:
const char *GetRepeatCommand(Args &current_command_args,
uint32_t index) override {
- // This is kind of gross, but the command hasn't been parsed yet so we can't
- // look at the option values for this invocation... I have to scan the
- // arguments directly.
+ // This is kind of gross, but the command hasn't been parsed yet so we
+ // can't look at the option values for this invocation... I have to scan
+ // the arguments directly.
auto iter =
llvm::find_if(current_command_args, [](const Args::ArgEntry &e) {
return e.ref == "-r" || e.ref == "--reverse";
@@ -863,11 +853,9 @@ protected:
}
// This is a little hacky, but the first line table entry for a function
- // points to the "{" that
- // starts the function block. It would be nice to actually get the
- // function
- // declaration in there too. So back up a bit, but not further than what
- // you're going to display.
+ // points to the "{" that starts the function block. It would be nice to
+ // actually get the function declaration in there too. So back up a bit,
+ // but not further than what you're going to display.
uint32_t extra_lines;
if (m_options.num_lines >= 10)
extra_lines = 5;
@@ -880,8 +868,7 @@ protected:
line_no = start_line - extra_lines;
// For fun, if the function is shorter than the number of lines we're
- // supposed to display,
- // only display the function...
+ // supposed to display, only display the function...
if (end_line != 0) {
if (m_options.num_lines > end_line - line_no)
m_options.num_lines = end_line - line_no + extra_lines;
@@ -912,14 +899,13 @@ protected:
return 0;
}
- // From Jim: The FindMatchingFunctions / FindMatchingFunctionSymbols functions
- // "take a possibly empty vector of strings which are names of modules, and
- // run the two search functions on the subset of the full module list that
- // matches the strings in the input vector". If we wanted to put these
- // somewhere,
- // there should probably be a module-filter-list that can be passed to the
- // various ModuleList::Find* calls, which would either be a vector of string
- // names or a ModuleSpecList.
+ // From Jim: The FindMatchingFunctions / FindMatchingFunctionSymbols
+ // functions "take a possibly empty vector of strings which are names of
+ // modules, and run the two search functions on the subset of the full module
+ // list that matches the strings in the input vector". If we wanted to put
+ // these somewhere, there should probably be a module-filter-list that can be
+ // passed to the various ModuleList::Find* calls, which would either be a
+ // vector of string names or a ModuleSpecList.
size_t FindMatchingFunctions(Target *target, const ConstString &name,
SymbolContextList &sc_list) {
// Displaying the source for a symbol:
@@ -996,8 +982,7 @@ protected:
size_t num_matches = FindMatchingFunctions(target, name, sc_list);
if (!num_matches) {
// If we didn't find any functions with that name, try searching for
- // symbols
- // that line up exactly with function addresses.
+ // symbols that line up exactly with function addresses.
SymbolContextList sc_list_symbols;
size_t num_symbol_matches =
FindMatchingFunctionSymbols(target, name, sc_list_symbols);
@@ -1064,8 +1049,8 @@ protected:
SymbolContextList sc_list;
if (target->GetSectionLoadList().IsEmpty()) {
- // The target isn't loaded yet, we need to lookup the file address
- // in all modules
+ // The target isn't loaded yet, we need to lookup the file address in
+ // all modules
const ModuleList &module_list = target->GetImages();
const size_t num_modules = module_list.GetSize();
for (size_t i = 0; i < num_modules; ++i) {
@@ -1090,8 +1075,8 @@ protected:
return false;
}
} else {
- // The target has some things loaded, resolve this address to a
- // compile unit + file + line and display
+ // The target has some things loaded, resolve this address to a compile
+ // unit + file + line and display
if (target->GetSectionLoadList().ResolveLoadAddress(m_options.address,
so_addr)) {
ModuleSP module_sp(so_addr.GetModule());
@@ -1168,11 +1153,10 @@ protected:
}
}
} else if (m_options.file_name.empty()) {
- // Last valid source manager context, or the current frame if no
- // valid last context in source manager.
- // One little trick here, if you type the exact same list command twice in
- // a row, it is
- // more likely because you typed it once, then typed it again
+ // Last valid source manager context, or the current frame if no valid
+ // last context in source manager. One little trick here, if you type the
+ // exact same list command twice in a row, it is more likely because you
+ // typed it once, then typed it again
if (m_options.start_line == 0) {
if (target->GetSourceManager().DisplayMoreWithLineNumbers(
&result.GetOutputStream(), m_options.num_lines,
diff --git a/source/Commands/CommandObjectStats.cpp b/source/Commands/CommandObjectStats.cpp
new file mode 100644
index 000000000000..9225a94b70d3
--- /dev/null
+++ b/source/Commands/CommandObjectStats.cpp
@@ -0,0 +1,107 @@
+//===-- CommandObjectStats.cpp ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "CommandObjectStats.h"
+#include "lldb/Host/Host.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Target/Target.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+class CommandObjectStatsEnable : public CommandObjectParsed {
+public:
+ CommandObjectStatsEnable(CommandInterpreter &interpreter)
+ : CommandObjectParsed(interpreter, "enable",
+ "Enable statistics collection", nullptr,
+ eCommandProcessMustBePaused) {}
+
+ ~CommandObjectStatsEnable() override = default;
+
+protected:
+ bool DoExecute(Args &command, CommandReturnObject &result) override {
+ Target *target = GetSelectedOrDummyTarget();
+
+ if (target->GetCollectingStats()) {
+ result.AppendError("statistics already enabled");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+
+ target->SetCollectingStats(true);
+ result.SetStatus(eReturnStatusSuccessFinishResult);
+ return true;
+ }
+};
+
+class CommandObjectStatsDisable : public CommandObjectParsed {
+public:
+ CommandObjectStatsDisable(CommandInterpreter &interpreter)
+ : CommandObjectParsed(interpreter, "disable",
+ "Disable statistics collection", nullptr,
+ eCommandProcessMustBePaused) {}
+
+ ~CommandObjectStatsDisable() override = default;
+
+protected:
+ bool DoExecute(Args &command, CommandReturnObject &result) override {
+ Target *target = GetSelectedOrDummyTarget();
+
+ if (!target->GetCollectingStats()) {
+ result.AppendError("need to enable statistics before disabling them");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+
+ target->SetCollectingStats(false);
+ result.SetStatus(eReturnStatusSuccessFinishResult);
+ return true;
+ }
+};
+
+class CommandObjectStatsDump : public CommandObjectParsed {
+public:
+ CommandObjectStatsDump(CommandInterpreter &interpreter)
+ : CommandObjectParsed(interpreter, "dump", "Dump statistics results",
+ nullptr, eCommandProcessMustBePaused) {}
+
+ ~CommandObjectStatsDump() override = default;
+
+protected:
+ bool DoExecute(Args &command, CommandReturnObject &result) override {
+ Target *target = GetSelectedOrDummyTarget();
+
+ uint32_t i = 0;
+ for (auto &stat : target->GetStatistics()) {
+ result.AppendMessageWithFormat(
+ "%s : %u\n",
+ lldb_private::GetStatDescription(static_cast<lldb_private::StatisticKind>(i))
+ .c_str(),
+ stat);
+ i += 1;
+ }
+ result.SetStatus(eReturnStatusSuccessFinishResult);
+ return true;
+ }
+};
+
+CommandObjectStats::CommandObjectStats(CommandInterpreter &interpreter)
+ : CommandObjectMultiword(interpreter, "statistics",
+ "Print statistics about a debugging session",
+ "statistics <subcommand> [<subcommand-options>]") {
+ LoadSubCommand("enable",
+ CommandObjectSP(new CommandObjectStatsEnable(interpreter)));
+ LoadSubCommand("disable",
+ CommandObjectSP(new CommandObjectStatsDisable(interpreter)));
+ LoadSubCommand("dump",
+ CommandObjectSP(new CommandObjectStatsDump(interpreter)));
+}
+
+CommandObjectStats::~CommandObjectStats() = default;
diff --git a/source/Commands/CommandObjectStats.h b/source/Commands/CommandObjectStats.h
new file mode 100644
index 000000000000..3c5c2c04db1f
--- /dev/null
+++ b/source/Commands/CommandObjectStats.h
@@ -0,0 +1,25 @@
+//===-- CommandObjectStats.h ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef liblldb_CommandObjectStats_h_
+#define liblldb_CommandObjectStats_h_
+
+#include "lldb/Interpreter/CommandObject.h"
+#include "lldb/Interpreter/CommandObjectMultiword.h"
+
+namespace lldb_private {
+class CommandObjectStats : public CommandObjectMultiword {
+public:
+ CommandObjectStats(CommandInterpreter &interpreter);
+
+ ~CommandObjectStats() override;
+};
+} // namespace lldb_private
+
+#endif // liblldb_CommandObjectLanguage_h_
diff --git a/source/Commands/CommandObjectSyntax.cpp b/source/Commands/CommandObjectSyntax.cpp
deleted file mode 100644
index 2b83b1b8786b..000000000000
--- a/source/Commands/CommandObjectSyntax.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//===-- CommandObjectSyntax.cpp ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "CommandObjectSyntax.h"
-#include "CommandObjectHelp.h"
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandObjectMultiword.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/Options.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-//-------------------------------------------------------------------------
-// CommandObjectSyntax
-//-------------------------------------------------------------------------
-
-CommandObjectSyntax::CommandObjectSyntax(CommandInterpreter &interpreter)
- : CommandObjectParsed(
- interpreter, "syntax",
- "Shows the correct syntax for a given debugger command.",
- "syntax <command>") {
- CommandArgumentEntry arg;
- CommandArgumentData command_arg;
-
- // Define the first (and only) variant of this arg.
- command_arg.arg_type = eArgTypeCommandName;
- command_arg.arg_repetition = eArgRepeatPlain;
-
- // There is only one variant this argument could be; put it into the argument
- // entry.
- arg.push_back(command_arg);
-
- // Push the data for the first argument into the m_arguments vector.
- m_arguments.push_back(arg);
-}
-
-CommandObjectSyntax::~CommandObjectSyntax() = default;
-
-bool CommandObjectSyntax::DoExecute(Args &command,
- CommandReturnObject &result) {
- CommandObject::CommandMap::iterator pos;
- CommandObject *cmd_obj;
- const size_t argc = command.GetArgumentCount();
-
- if (argc == 0) {
- result.AppendError("Must call 'syntax' with a valid command.");
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- cmd_obj = m_interpreter.GetCommandObject(command[0].ref);
- bool all_okay = llvm::all_of(
- command.entries().drop_front(), [&cmd_obj](const Args::ArgEntry &e) {
- if (!cmd_obj || !cmd_obj->IsMultiwordObject())
- return false;
-
- if (!(cmd_obj = cmd_obj->GetSubcommandObject(e.ref)))
- return false;
-
- return true;
- });
-
- if (!all_okay) {
- std::string cmd_string;
- command.GetCommandString(cmd_string);
-
- StreamString error_msg_stream;
- const bool generate_apropos = true;
- const bool generate_type_lookup = false;
- CommandObjectHelp::GenerateAdditionalHelpAvenuesMessage(
- &error_msg_stream, cmd_string, "", "", generate_apropos,
- generate_type_lookup);
- result.AppendErrorWithFormat("%s", error_msg_stream.GetData());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
-
- Stream &output_strm = result.GetOutputStream();
- if (cmd_obj->GetOptions() != nullptr) {
- output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax().str().c_str());
- output_strm.Printf(
- "(Try 'help %s' for more information on command options syntax.)\n",
- cmd_obj->GetCommandName().str().c_str());
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- } else {
- output_strm.Printf("\nSyntax: %s\n", cmd_obj->GetSyntax().str().c_str());
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- }
-
- return result.Succeeded();
-}
diff --git a/source/Commands/CommandObjectSyntax.h b/source/Commands/CommandObjectSyntax.h
deleted file mode 100644
index b65e9b1b750b..000000000000
--- a/source/Commands/CommandObjectSyntax.h
+++ /dev/null
@@ -1,37 +0,0 @@
-//===-- CommandObjectSyntax.h -----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef liblldb_CommandObjectSyntax_h_
-#define liblldb_CommandObjectSyntax_h_
-
-// C Includes
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Interpreter/CommandObject.h"
-
-namespace lldb_private {
-
-//-------------------------------------------------------------------------
-// CommandObjectSyntax
-//-------------------------------------------------------------------------
-
-class CommandObjectSyntax : public CommandObjectParsed {
-public:
- CommandObjectSyntax(CommandInterpreter &interpreter);
-
- ~CommandObjectSyntax() override;
-
-protected:
- bool DoExecute(Args &command, CommandReturnObject &result) override;
-};
-
-} // namespace lldb_private
-
-#endif // liblldb_CommandObjectSyntax_h_
diff --git a/source/Commands/CommandObjectTarget.cpp b/source/Commands/CommandObjectTarget.cpp
index c83061d8de74..a9062c14b367 100644
--- a/source/Commands/CommandObjectTarget.cpp
+++ b/source/Commands/CommandObjectTarget.cpp
@@ -21,9 +21,9 @@
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Host/Symbols.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupArchitecture.h"
#include "lldb/Interpreter/OptionGroupBoolean.h"
#include "lldb/Interpreter/OptionGroupFile.h"
@@ -45,10 +45,12 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/Process.h"
+#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Timer.h"
#include "llvm/Support/FileSystem.h"
@@ -193,20 +195,13 @@ public:
Options *GetOptions() override { return &m_option_group; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
@@ -256,7 +251,7 @@ protected:
FileSpec file_spec;
if (file_path)
- file_spec.SetFile(file_path, true);
+ file_spec.SetFile(file_path, true, FileSpec::Style::native);
bool must_set_platform_path = false;
@@ -272,10 +267,8 @@ protected:
if (target_sp) {
// Only get the platform after we create the target because we might
- // have
- // switched platforms depending on what the arguments were to
- // CreateTarget()
- // we can't rely on the selected platform.
+ // have switched platforms depending on what the arguments were to
+ // CreateTarget() we can't rely on the selected platform.
PlatformSP platform_sp = target_sp->GetPlatform();
@@ -366,8 +359,8 @@ protected:
&core_file));
if (process_sp) {
- // Seems weird that we Launch a core file, but that is
- // what we do!
+ // Seems weird that we Launch a core file, but that is what we
+ // do!
error = process_sp->LoadCore();
if (error.Fail()) {
@@ -616,8 +609,8 @@ protected:
target_list.DeleteTarget(target_sp);
target_sp->Destroy();
}
- // If "--clean" was specified, prune any orphaned shared modules from
- // the global shared module list
+ // If "--clean" was specified, prune any orphaned shared modules from the
+ // global shared module list
if (m_cleanup_option.GetOptionValue()) {
const bool mandatory = true;
ModuleList::RemoveOrphanSharedModules(mandatory);
@@ -752,7 +745,7 @@ public:
VariableList &variable_list) {
Target *target = static_cast<Target *>(baton);
if (target) {
- return target->GetImages().FindGlobalVariables(ConstString(name), true,
+ return target->GetImages().FindGlobalVariables(ConstString(name),
UINT32_MAX, variable_list);
}
return 0;
@@ -818,8 +811,8 @@ protected:
return false;
}
use_var_name = true;
- matches = target->GetImages().FindGlobalVariables(
- regex, true, UINT32_MAX, variable_list);
+ matches = target->GetImages().FindGlobalVariables(regex, UINT32_MAX,
+ variable_list);
} else {
Status error(Variable::GetValuesForVariableExpressionPath(
arg, m_exe_ctx.GetBestExecutionContextScope(),
@@ -947,8 +940,8 @@ protected:
llvm::StringRef(
".")); // Any global with at least one character
VariableList variable_list;
- sc.module_sp->FindGlobalVariables(all_globals_regex, append,
- UINT32_MAX, variable_list);
+ sc.module_sp->FindGlobalVariables(all_globals_regex, UINT32_MAX,
+ variable_list);
DumpGlobalVariableList(m_exe_ctx, sc, variable_list, s);
}
}
@@ -995,10 +988,9 @@ public:
new_prefix_arg.arg_type = eArgTypeNewPathPrefix;
new_prefix_arg.arg_repetition = eArgRepeatPairPlus;
- // There are two required arguments that must always occur together, i.e. an
- // argument "pair". Because they
- // must always occur together, they are treated as two variants of one
- // argument rather than two independent
+ // There are two required arguments that must always occur together, i.e.
+ // an argument "pair". Because they must always occur together, they are
+ // treated as two variants of one argument rather than two independent
// arguments. Push them both into the first argument position for
// m_arguments...
@@ -1109,10 +1101,9 @@ public:
new_prefix_arg.arg_type = eArgTypeNewPathPrefix;
new_prefix_arg.arg_repetition = eArgRepeatPairPlus;
- // There are two required arguments that must always occur together, i.e. an
- // argument "pair". Because they
- // must always occur together, they are treated as two variants of one
- // argument rather than two independent
+ // There are two required arguments that must always occur together, i.e.
+ // an argument "pair". Because they must always occur together, they are
+ // treated as two variants of one argument rather than two independent
// arguments. Push them both into the same argument position for
// m_arguments...
@@ -1386,7 +1377,12 @@ static size_t DumpModuleObjfileHeaders(Stream &strm, ModuleList &module_list) {
strm.EOL();
}
ObjectFile *objfile = module->GetObjectFile();
- objfile->Dump(&strm);
+ if (objfile)
+ objfile->Dump(&strm);
+ else {
+ strm.Format("No object file for module: {0:F}\n",
+ module->GetFileSpec());
+ }
}
}
strm.IndentLess();
@@ -1632,8 +1628,8 @@ static size_t LookupTypeInModule(CommandInterpreter &interpreter, Stream &strm,
strm.PutCString(":\n");
for (TypeSP type_sp : type_list.Types()) {
if (type_sp) {
- // Resolve the clang type so that any forward references
- // to types that haven't yet been parsed will get parsed.
+ // Resolve the clang type so that any forward references to types
+ // that haven't yet been parsed will get parsed.
type_sp->GetFullCompilerType();
type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
// Print all typedef chains
@@ -1683,8 +1679,8 @@ static size_t LookupTypeHere(CommandInterpreter &interpreter, Stream &strm,
TypeSP type_sp(type_list.GetTypeAtIndex(0));
if (type_sp) {
- // Resolve the clang type so that any forward references
- // to types that haven't yet been parsed will get parsed.
+ // Resolve the clang type so that any forward references to types that
+ // haven't yet been parsed will get parsed.
type_sp->GetFullCompilerType();
type_sp->GetDescription(&strm, eDescriptionLevelFull, true);
// Print all typedef chains
@@ -1762,9 +1758,8 @@ static size_t FindModulesByName(Target *target, const char *module_name,
const size_t num_matches =
target->GetImages().FindModules(module_spec, module_list);
- // Not found in our module list for our target, check the main
- // shared module list in case it is a extra file used somewhere
- // else
+ // Not found in our module list for our target, check the main shared
+ // module list in case it is a extra file used somewhere else
if (num_matches == 0) {
module_spec.GetArchitecture() = target->GetArchitecture();
ModuleList::FindSharedModules(module_spec, module_list);
@@ -1809,21 +1804,13 @@ public:
~CommandObjectTargetModulesModuleAutoComplete() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- // Arguments are the standard module completer.
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
- GetCommandInterpreter(), CommandCompletions::eModuleCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ GetCommandInterpreter(), CommandCompletions::eModuleCompletion, request,
+ nullptr);
+ return request.GetMatches().GetSize();
}
};
@@ -1858,21 +1845,13 @@ public:
~CommandObjectTargetModulesSourceFileAutoComplete() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- // Arguments are the standard source file completer.
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eSourceFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
};
@@ -1982,7 +1961,7 @@ public:
switch (short_option) {
case 's':
- m_sort_order = (SortOrder)Args::StringToOptionEnum(
+ m_sort_order = (SortOrder)OptionArgParser::ToOptionEnum(
option_arg, GetDefinitions()[option_idx].enum_values,
eSortOrderNone, error);
break;
@@ -2408,20 +2387,13 @@ public:
Options *GetOptions() override { return &m_option_group; }
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
protected:
@@ -2604,8 +2576,7 @@ protected:
ModuleSpec module_spec;
bool search_using_module_spec = false;
- // Allow "load" option to work without --file or --uuid
- // option.
+ // Allow "load" option to work without --file or --uuid option.
if (load) {
if (!m_file_option.GetOptionValue().OptionWasSet() &&
!m_uuid_option_group.GetOptionValue().OptionWasSet()) {
@@ -2746,11 +2717,34 @@ protected:
process->Flush();
}
if (load) {
- Status error = module->LoadInMemory(*target, set_pc);
+ ProcessSP process = target->CalculateProcess();
+ Address file_entry = objfile->GetEntryPointAddress();
+ if (!process) {
+ result.AppendError("No process");
+ return false;
+ }
+ if (set_pc && !file_entry.IsValid()) {
+ result.AppendError("No entry address in object file");
+ return false;
+ }
+ std::vector<ObjectFile::LoadableData> loadables(
+ objfile->GetLoadableData(*target));
+ if (loadables.size() == 0) {
+ result.AppendError("No loadable sections");
+ return false;
+ }
+ Status error = process->WriteObjectFile(std::move(loadables));
if (error.Fail()) {
result.AppendError(error.AsCString());
return false;
}
+ if (set_pc) {
+ ThreadList &thread_list = process->GetThreadList();
+ ThreadSP curr_thread(thread_list.GetSelectedThread());
+ RegisterContextSP reg_context(
+ curr_thread->GetRegisterContext());
+ reg_context->SetPC(file_entry.GetLoadAddress(target));
+ }
}
} else {
module->GetFileSpec().GetPath(path, sizeof(path));
@@ -2861,8 +2855,8 @@ public:
if (short_option == 'g') {
m_use_global_module_list = true;
} else if (short_option == 'a') {
- m_module_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ m_module_addr = OptionArgParser::ToAddress(
+ execution_context, option_arg, LLDB_INVALID_ADDRESS, &error);
} else {
unsigned long width = 0;
option_arg.getAsInteger(0, width);
@@ -2904,9 +2898,8 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
const bool use_global_module_list = m_options.m_use_global_module_list;
// Define a local module list here to ensure it lives longer than any
- // "locker"
- // object which might lock its contents below (through the "module_list_ptr"
- // variable).
+ // "locker" object which might lock its contents below (through the
+ // "module_list_ptr" variable).
ModuleList module_list;
if (target == nullptr && !use_global_module_list) {
result.AppendError("invalid target, create a debug target using the "
@@ -2954,10 +2947,9 @@ protected:
size_t num_modules = 0;
// This locker will be locked on the mutex in module_list_ptr if it is
- // non-nullptr.
- // Otherwise it will lock the AllocationModuleCollectionMutex when
- // accessing
- // the global module list directly.
+ // non-nullptr. Otherwise it will lock the
+ // AllocationModuleCollectionMutex when accessing the global module list
+ // directly.
std::unique_lock<std::recursive_mutex> guard(
Module::GetAllocationModuleCollectionMutex(), std::defer_lock);
@@ -3227,8 +3219,8 @@ public:
case 'a': {
m_str = option_arg;
m_type = eLookupTypeAddress;
- m_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ m_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
if (m_addr == LLDB_INVALID_ADDRESS)
error.SetErrorStringWithFormat("invalid address string '%s'",
option_arg.str().c_str());
@@ -3543,8 +3535,8 @@ public:
switch (short_option) {
case 'a': {
m_type = eLookupTypeAddress;
- m_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ m_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
} break;
case 'o':
@@ -3559,7 +3551,7 @@ public:
break;
case 'f':
- m_file.SetFile(option_arg, false);
+ m_file.SetFile(option_arg, false, FileSpec::Style::native);
m_type = eLookupTypeFileLine;
break;
@@ -3805,9 +3797,9 @@ protected:
if (command.GetArgumentCount() == 0) {
ModuleSP current_module;
- // Where it is possible to look in the current symbol context
- // first, try that. If this search was successful and --all
- // was not passed, don't print anything else.
+ // Where it is possible to look in the current symbol context first,
+ // try that. If this search was successful and --all was not passed,
+ // don't print anything else.
if (LookupHere(m_interpreter, result, syntax_error)) {
result.GetOutputStream().EOL();
num_successful_lookups++;
@@ -3989,20 +3981,13 @@ public:
~CommandObjectTargetSymbolsAdd() override = default;
- int HandleArgumentCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- OptionElementVector &opt_element_vector,
- int match_start_point, int max_return_elements,
- bool &word_complete,
- StringList &matches) override {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index));
- completion_str.erase(cursor_char_position);
-
+ int HandleArgumentCompletion(
+ CompletionRequest &request,
+ OptionElementVector &opt_element_vector) override {
CommandCompletions::InvokeCommonCompletionCallbacks(
GetCommandInterpreter(), CommandCompletions::eDiskFileCompletion,
- completion_str.c_str(), match_start_point, max_return_elements, nullptr,
- word_complete, matches);
- return matches.GetSize();
+ request, nullptr);
+ return request.GetMatches().GetSize();
}
Options *GetOptions() override { return &m_option_group; }
@@ -4019,10 +4004,9 @@ protected:
if (!module_spec.GetFileSpec() && !module_spec.GetPlatformFileSpec())
module_spec.GetFileSpec().GetFilename() = symbol_fspec.GetFilename();
}
- // We now have a module that represents a symbol file
- // that can be used for a module that might exist in the
- // current target, so we need to find that module in the
- // target
+ // We now have a module that represents a symbol file that can be used
+ // for a module that might exist in the current target, so we need to
+ // find that module in the target
ModuleList matching_module_list;
size_t num_matches = 0;
@@ -4048,8 +4032,7 @@ protected:
if (num_matches == 0) {
// No matches yet, iterate through the module specs to find a UUID
- // value that
- // we can match up to an image in our target
+ // value that we can match up to an image in our target
const size_t num_symfile_module_specs =
symfile_module_specs.GetSize();
for (size_t i = 0; i < num_symfile_module_specs && num_matches == 0;
@@ -4069,8 +4052,8 @@ protected:
}
}
- // Just try to match up the file by basename if we have no matches at this
- // point
+ // Just try to match up the file by basename if we have no matches at
+ // this point
if (num_matches == 0)
num_matches =
target->GetImages().FindModules(module_spec, matching_module_list);
@@ -4082,7 +4065,8 @@ protected:
if (!filename_no_extension)
break;
- // Check if there was no extension to strip and the basename is the same
+ // Check if there was no extension to strip and the basename is the
+ // same
if (filename_no_extension == module_spec.GetFileSpec().GetFilename())
break;
@@ -4101,9 +4085,9 @@ protected:
} else if (num_matches == 1) {
ModuleSP module_sp(matching_module_list.GetModuleAtIndex(0));
- // The module has not yet created its symbol vendor, we can just
- // give the existing target module the symfile path to use for
- // when it decides to create it!
+ // The module has not yet created its symbol vendor, we can just give
+ // the existing target module the symfile path to use for when it
+ // decides to create it!
module_sp->SetSymbolFileFileSpec(symbol_fspec);
SymbolVendor *symbol_vendor =
@@ -4121,8 +4105,8 @@ protected:
"symbol file '%s' has been added to '%s'\n", symfile_path,
module_fs.GetPath().c_str());
- // Let clients know something changed in the module
- // if it is currently loaded
+ // Let clients know something changed in the module if it is
+ // currently loaded
ModuleList module_list;
module_list.Append(module_sp);
target->SymbolsDidLoad(module_list);
@@ -4298,7 +4282,8 @@ protected:
for (auto &entry : args.entries()) {
if (!entry.ref.empty()) {
- module_spec.GetSymbolFileSpec().SetFile(entry.ref, true);
+ module_spec.GetSymbolFileSpec().SetFile(entry.ref, true,
+ FileSpec::Style::native);
if (file_option_set) {
module_spec.GetFileSpec() =
m_file_option.GetOptionValue().GetCurrentValue();
diff --git a/source/Commands/CommandObjectThread.cpp b/source/Commands/CommandObjectThread.cpp
index b68aa920b582..3be559963df1 100644
--- a/source/Commands/CommandObjectThread.cpp
+++ b/source/Commands/CommandObjectThread.cpp
@@ -21,6 +21,7 @@
#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/Function.h"
@@ -103,8 +104,8 @@ public:
}
// Use tids instead of ThreadSPs to prevent deadlocking problems which
- // result from JIT-ing
- // code while iterating over the (locked) ThreadSP list.
+ // result from JIT-ing code while iterating over the (locked) ThreadSP
+ // list.
std::vector<lldb::tid_t> tids;
if (all_threads || m_unique_stacks) {
@@ -195,11 +196,10 @@ protected:
//
// If you return false, the iteration will stop, otherwise it will proceed.
// The result is set to m_success_return (defaults to
- // eReturnStatusSuccessFinishResult) before the iteration,
- // so you only need to set the return status in HandleOneThread if you want to
- // indicate an error.
- // If m_add_return is true, a blank line will be inserted between each of the
- // listings (except the last one.)
+ // eReturnStatusSuccessFinishResult) before the iteration, so you only need
+ // to set the return status in HandleOneThread if you want to indicate an
+ // error. If m_add_return is true, a blank line will be inserted between each
+ // of the listings (except the last one.)
virtual bool HandleOneThread(lldb::tid_t, CommandReturnObject &result) = 0;
@@ -290,7 +290,7 @@ public:
case 'e': {
bool success;
m_extended_backtrace =
- Args::StringToBoolean(option_arg, false, &success);
+ OptionArgParser::ToBoolean(option_arg, false, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid boolean value for option '%c'", short_option);
@@ -447,7 +447,8 @@ public:
switch (short_option) {
case 'a': {
bool success;
- bool avoid_no_debug = Args::StringToBoolean(option_arg, true, &success);
+ bool avoid_no_debug =
+ OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid boolean value for option '%c'", short_option);
@@ -459,7 +460,8 @@ public:
case 'A': {
bool success;
- bool avoid_no_debug = Args::StringToBoolean(option_arg, true, &success);
+ bool avoid_no_debug =
+ OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid boolean value for option '%c'", short_option);
@@ -483,7 +485,7 @@ public:
case 'm': {
OptionEnumValueElement *enum_values =
GetDefinitions()[option_idx].enum_values;
- m_run_mode = (lldb::RunMode)Args::StringToOptionEnum(
+ m_run_mode = (lldb::RunMode)OptionArgParser::ToOptionEnum(
option_arg, enum_values, eOnlyDuringStepping, error);
} break;
@@ -644,8 +646,7 @@ protected:
const lldb::RunMode stop_other_threads = m_options.m_run_mode;
// This is a bit unfortunate, but not all the commands in this command
- // object support
- // only while stepping, so I use the bool for them.
+ // object support only while stepping, so I use the bool for them.
bool bool_stop_other_threads;
if (m_options.m_run_mode == eAllThreads)
bool_stop_other_threads = false;
@@ -750,8 +751,8 @@ protected:
}
// If we got a new plan, then set it to be a master plan (User level Plans
- // should be master plans
- // so that they can be interruptible). Then resume the process.
+ // should be master plans so that they can be interruptible). Then resume
+ // the process.
if (new_plan_sp) {
new_plan_sp->SetIsMasterPlan(true);
@@ -782,11 +783,10 @@ protected:
}
// There is a race condition where this thread will return up the call
- // stack to the main command handler
- // and show an (lldb) prompt before HandlePrivateEvent (from
- // PrivateStateThread) has
- // a chance to call PushProcessIOHandler().
- process->SyncIOHandler(iohandler_id, 2000);
+ // stack to the main command handler and show an (lldb) prompt before
+ // HandlePrivateEvent (from PrivateStateThread) has a chance to call
+ // PushProcessIOHandler().
+ process->SyncIOHandler(iohandler_id, std::chrono::seconds(2));
if (synchronous_execution) {
// If any state changed events had anything to say, add that to the
@@ -867,9 +867,9 @@ public:
(state == eStateSuspended)) {
const size_t argc = command.GetArgumentCount();
if (argc > 0) {
- // These two lines appear at the beginning of both blocks in
- // this if..else, but that is because we need to release the
- // lock before calling process->Resume below.
+ // These two lines appear at the beginning of both blocks in this
+ // if..else, but that is because we need to release the lock before
+ // calling process->Resume below.
std::lock_guard<std::recursive_mutex> guard(
process->GetThreadList().GetMutex());
const uint32_t num_threads = process->GetThreadList().GetSize();
@@ -928,9 +928,9 @@ public:
process->GetID());
}
} else {
- // These two lines appear at the beginning of both blocks in
- // this if..else, but that is because we need to release the
- // lock before calling process->Resume below.
+ // These two lines appear at the beginning of both blocks in this
+ // if..else, but that is because we need to release the lock before
+ // calling process->Resume below.
std::lock_guard<std::recursive_mutex> guard(
process->GetThreadList().GetMutex());
const uint32_t num_threads = process->GetThreadList().GetSize();
@@ -1030,7 +1030,7 @@ public:
switch (short_option) {
case 'a': {
- lldb::addr_t tmp_addr = Args::StringToAddress(
+ lldb::addr_t tmp_addr = OptionArgParser::ToAddress(
execution_context, option_arg, LLDB_INVALID_ADDRESS, &error);
if (error.Success())
m_until_addrs.push_back(tmp_addr);
@@ -1052,7 +1052,7 @@ public:
case 'm': {
OptionEnumValueElement *enum_values =
GetDefinitions()[option_idx].enum_values;
- lldb::RunMode run_mode = (lldb::RunMode)Args::StringToOptionEnum(
+ lldb::RunMode run_mode = (lldb::RunMode)OptionArgParser::ToOptionEnum(
option_arg, enum_values, eOnlyDuringStepping, error);
if (error.Success()) {
@@ -1192,8 +1192,8 @@ protected:
ThreadPlanSP new_plan_sp;
if (frame->HasDebugInformation()) {
- // Finally we got here... Translate the given line number to a bunch of
- // addresses:
+ // Finally we got here... Translate the given line number to a bunch
+ // of addresses:
SymbolContext sc(frame->GetSymbolContext(eSymbolContextCompUnit));
LineTable *line_table = nullptr;
if (sc.comp_unit)
@@ -1272,10 +1272,9 @@ protected:
abort_other_plans, &address_list.front(), address_list.size(),
m_options.m_stop_others, m_options.m_frame_idx);
// User level plans should be master plans so they can be interrupted
- // (e.g. by hitting a breakpoint)
- // and other plans executed by the user (stepping around the breakpoint)
- // and then a "continue"
- // will resume the original plan.
+ // (e.g. by hitting a breakpoint) and other plans executed by the user
+ // (stepping around the breakpoint) and then a "continue" will resume
+ // the original plan.
new_plan_sp->SetIsMasterPlan(true);
new_plan_sp->SetOkayToDiscard(false);
} else {
@@ -1541,7 +1540,8 @@ public:
switch (short_option) {
case 'x': {
bool success;
- bool tmp_value = Args::StringToBoolean(option_arg, false, &success);
+ bool tmp_value =
+ OptionArgParser::ToBoolean(option_arg, false, &success);
if (success)
m_from_expression = tmp_value;
else {
@@ -1603,12 +1603,13 @@ public:
Options *GetOptions() override { return &m_options; }
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
// I am going to handle this by hand, because I don't want you to have to
// say:
// "thread return -- -5".
- if (command[0] == '-' && command[1] == 'x') {
- if (command && command[2] != '\0')
+ if (command.startswith("-x")) {
+ if (command.size() != 2U)
result.AppendWarning("Return values ignored when returning from user "
"called expressions");
@@ -1645,7 +1646,7 @@ protected:
return false;
}
- if (command && command[0] != '\0') {
+ if (!command.empty()) {
Target *target = m_exe_ctx.GetTargetPtr();
EvaluateExpressionOptions options;
@@ -1737,8 +1738,8 @@ public:
return Status("invalid line offset: '%s'.", option_arg.str().c_str());
break;
case 'a':
- m_load_addr = Args::StringToAddress(execution_context, option_arg,
- LLDB_INVALID_ADDRESS, &error);
+ m_load_addr = OptionArgParser::ToAddress(execution_context, option_arg,
+ LLDB_INVALID_ADDRESS, &error);
break;
case 'r':
m_force = true;
diff --git a/source/Commands/CommandObjectType.cpp b/source/Commands/CommandObjectType.cpp
index 2d4271cab362..6bcc334198fc 100644
--- a/source/Commands/CommandObjectType.cpp
+++ b/source/Commands/CommandObjectType.cpp
@@ -24,6 +24,7 @@
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Interpreter/OptionValueLanguage.h"
@@ -329,7 +330,7 @@ private:
switch (short_option) {
case 'C':
- m_cascade = Args::StringToBoolean(option_arg, true, &success);
+ m_cascade = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat("invalid value for cascade: %s",
option_arg.str().c_str());
@@ -571,7 +572,7 @@ private:
switch (short_option) {
case 'C':
- m_cascade = Args::StringToBoolean(option_value, true, &success);
+ m_cascade = OptionArgParser::ToBoolean(option_value, true, &success);
if (!success)
error.SetErrorStringWithFormat("invalid value for cascade: %s",
option_value.str().c_str());
@@ -1252,7 +1253,7 @@ Status CommandObjectTypeSummaryAdd::CommandOptions::SetOptionValue(
switch (short_option) {
case 'C':
- m_flags.SetCascades(Args::StringToBoolean(option_arg, true, &success));
+ m_flags.SetCascades(OptionArgParser::ToBoolean(option_arg, true, &success));
if (!success)
error.SetErrorStringWithFormat("invalid value for cascade: %s",
option_arg.str().c_str());
@@ -1420,8 +1421,8 @@ bool CommandObjectTypeSummaryAdd::Execute_ScriptSummary(
return result.Succeeded();
}
- // if I am here, script_format must point to something good, so I can add that
- // as a script summary to all interested parties
+ // if I am here, script_format must point to something good, so I can add
+ // that as a script summary to all interested parties
Status error;
@@ -2520,7 +2521,7 @@ private:
switch (short_option) {
case 'C':
- m_cascade = Args::StringToBoolean(option_arg, true, &success);
+ m_cascade = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat("invalid value for cascade: %s",
option_arg.str().c_str());
@@ -2756,9 +2757,8 @@ static OptionDefinition g_type_lookup_options[] = {
class CommandObjectTypeLookup : public CommandObjectRaw {
protected:
// this function is allowed to do a more aggressive job at guessing languages
- // than the expression parser
- // is comfortable with - so leave the original call alone and add one that is
- // specific to type lookup
+ // than the expression parser is comfortable with - so leave the original
+ // call alone and add one that is specific to type lookup
lldb::LanguageType GuessLanguage(StackFrame *frame) {
lldb::LanguageType lang_type = lldb::eLanguageTypeUnknown;
@@ -2862,9 +2862,9 @@ public:
return m_cmd_help_long;
}
- bool DoExecute(const char *raw_command_line,
+ bool DoExecute(llvm::StringRef raw_command_line,
CommandReturnObject &result) override {
- if (!raw_command_line || !raw_command_line[0]) {
+ if (raw_command_line.empty()) {
result.SetError(
"type lookup cannot be invoked without a type name as argument");
return false;
@@ -2873,42 +2873,13 @@ public:
auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
m_option_group.NotifyOptionParsingStarting(&exe_ctx);
- const char *name_of_type = nullptr;
-
- if (raw_command_line[0] == '-') {
- // We have some options and these options MUST end with --.
- const char *end_options = nullptr;
- const char *s = raw_command_line;
- while (s && s[0]) {
- end_options = ::strstr(s, "--");
- if (end_options) {
- end_options += 2; // Get past the "--"
- if (::isspace(end_options[0])) {
- name_of_type = end_options;
- while (::isspace(*name_of_type))
- ++name_of_type;
- break;
- }
- }
- s = end_options;
- }
+ OptionsWithRaw args(raw_command_line);
+ const char *name_of_type = args.GetRawPart().c_str();
- if (end_options) {
- Args args(
- llvm::StringRef(raw_command_line, end_options - raw_command_line));
- if (!ParseOptions(args, result))
- return false;
-
- Status error(m_option_group.NotifyOptionParsingFinished(&exe_ctx));
- if (error.Fail()) {
- result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- }
- }
- if (nullptr == name_of_type)
- name_of_type = raw_command_line;
+ if (args.HasArgs())
+ if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group,
+ exe_ctx))
+ return false;
// TargetSP
// target_sp(GetCommandInterpreter().GetDebugger().GetSelectedTarget());
@@ -2933,9 +2904,8 @@ public:
}
// This is not the most efficient way to do this, but we support very few
- // languages
- // so the cost of the sort is going to be dwarfed by the actual lookup
- // anyway
+ // languages so the cost of the sort is going to be dwarfed by the actual
+ // lookup anyway
if (StackFrame *frame = m_exe_ctx.GetFramePtr()) {
guessed_language = GuessLanguage(frame);
if (guessed_language != eLanguageTypeUnknown) {
@@ -3024,7 +2994,8 @@ public:
~CommandObjectFormatterInfo() override = default;
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
TargetSP target_sp = m_interpreter.GetDebugger().GetSelectedTarget();
Thread *thread = GetDefaultThread();
if (!thread) {
@@ -3047,16 +3018,16 @@ protected:
m_discovery_function(*result_valobj_sp);
if (formatter_sp) {
std::string description(formatter_sp->GetDescription());
- result.AppendMessageWithFormat(
- "%s applied to (%s) %s is: %s\n", m_formatter_name.c_str(),
- result_valobj_sp->GetDisplayTypeName().AsCString("<unknown>"),
- command, description.c_str());
+ result.GetOutputStream()
+ << m_formatter_name << " applied to ("
+ << result_valobj_sp->GetDisplayTypeName().AsCString("<unknown>")
+ << ") " << command << " is: " << description << "\n";
result.SetStatus(lldb::eReturnStatusSuccessFinishResult);
} else {
- result.AppendMessageWithFormat(
- "no %s applies to (%s) %s\n", m_formatter_name.c_str(),
- result_valobj_sp->GetDisplayTypeName().AsCString("<unknown>"),
- command);
+ result.GetOutputStream()
+ << "no " << m_formatter_name << " applies to ("
+ << result_valobj_sp->GetDisplayTypeName().AsCString("<unknown>")
+ << ") " << command << "\n";
result.SetStatus(lldb::eReturnStatusSuccessFinishNoResult);
}
return true;
diff --git a/source/Commands/CommandObjectWatchpoint.cpp b/source/Commands/CommandObjectWatchpoint.cpp
index 9c84c992e715..96ae18b35743 100644
--- a/source/Commands/CommandObjectWatchpoint.cpp
+++ b/source/Commands/CommandObjectWatchpoint.cpp
@@ -74,8 +74,8 @@ static int32_t WithRSAIndex(llvm::StringRef Arg) {
return -1;
}
-// Return true if wp_ids is successfully populated with the watch ids.
-// False otherwise.
+// Return true if wp_ids is successfully populated with the watch ids. False
+// otherwise.
bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(
Target *target, Args &args, std::vector<uint32_t> &wp_ids) {
// Pre-condition: args.GetArgumentCount() > 0.
@@ -111,8 +111,8 @@ bool CommandObjectMultiwordWatchpoint::VerifyWatchpointIDs(
if (!second.empty())
StrRefArgs.push_back(second);
}
- // Now process the canonical list and fill in the vector of uint32_t's.
- // If there is any error, return false and the client should ignore wp_ids.
+ // Now process the canonical list and fill in the vector of uint32_t's. If
+ // there is any error, return false and the client should ignore wp_ids.
uint32_t beg, end, id;
size_t size = StrRefArgs.size();
bool in_range = false;
@@ -838,7 +838,7 @@ protected:
VariableList &variable_list) {
Target *target = static_cast<Target *>(baton);
if (target) {
- return target->GetImages().FindGlobalVariables(ConstString(name), true,
+ return target->GetImages().FindGlobalVariables(ConstString(name),
UINT32_MAX, variable_list);
}
return 0;
@@ -848,8 +848,8 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
StackFrame *frame = m_exe_ctx.GetFramePtr();
- // If no argument is present, issue an error message. There's no way to set
- // a watchpoint.
+ // If no argument is present, issue an error message. There's no way to
+ // set a watchpoint.
if (command.GetArgumentCount() <= 0) {
result.GetErrorStream().Printf("error: required argument missing; "
"specify your program variable to watch "
@@ -863,8 +863,8 @@ protected:
m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchWrite;
}
- // We passed the sanity check for the command.
- // Proceed to set the watchpoint now.
+ // We passed the sanity check for the command. Proceed to set the
+ // watchpoint now.
lldb::addr_t addr = 0;
size_t size = 0;
@@ -1026,7 +1026,7 @@ Examples:
Options *GetOptions() override { return &m_option_group; }
protected:
- bool DoExecute(const char *raw_command,
+ bool DoExecute(llvm::StringRef raw_command,
CommandReturnObject &result) override {
auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
m_option_group.NotifyOptionParsingStarting(
@@ -1035,46 +1035,18 @@ protected:
Target *target = m_interpreter.GetDebugger().GetSelectedTarget().get();
StackFrame *frame = m_exe_ctx.GetFramePtr();
- Args command(raw_command);
- const char *expr = nullptr;
- if (raw_command[0] == '-') {
- // We have some options and these options MUST end with --.
- const char *end_options = nullptr;
- const char *s = raw_command;
- while (s && s[0]) {
- end_options = ::strstr(s, "--");
- if (end_options) {
- end_options += 2; // Get past the "--"
- if (::isspace(end_options[0])) {
- expr = end_options;
- while (::isspace(*expr))
- ++expr;
- break;
- }
- }
- s = end_options;
- }
+ OptionsWithRaw args(raw_command);
- if (end_options) {
- Args args(llvm::StringRef(raw_command, end_options - raw_command));
- if (!ParseOptions(args, result))
- return false;
-
- Status error(m_option_group.NotifyOptionParsingFinished(&exe_ctx));
- if (error.Fail()) {
- result.AppendError(error.AsCString());
- result.SetStatus(eReturnStatusFailed);
- return false;
- }
- }
- }
+ llvm::StringRef expr = args.GetRawPart();
- if (expr == nullptr)
- expr = raw_command;
+ if (args.HasArgs())
+ if (!ParseOptionsAndNotify(args.GetArgs(), result, m_option_group,
+ exe_ctx))
+ return false;
- // If no argument is present, issue an error message. There's no way to set
- // a watchpoint.
- if (command.GetArgumentCount() == 0) {
+ // If no argument is present, issue an error message. There's no way to
+ // set a watchpoint.
+ if (raw_command.trim().empty()) {
result.GetErrorStream().Printf("error: required argument missing; "
"specify an expression to evaulate into "
"the address to watch for\n");
@@ -1087,8 +1059,8 @@ protected:
m_option_watchpoint.watch_type = OptionGroupWatchpoint::eWatchWrite;
}
- // We passed the sanity check for the command.
- // Proceed to set the watchpoint now.
+ // We passed the sanity check for the command. Proceed to set the
+ // watchpoint now.
lldb::addr_t addr = 0;
size_t size = 0;
@@ -1107,7 +1079,7 @@ protected:
if (expr_result != eExpressionCompleted) {
result.GetErrorStream().Printf(
"error: expression evaluation of address to watch failed\n");
- result.GetErrorStream().Printf("expression evaluated: %s\n", expr);
+ result.GetErrorStream() << "expression evaluated: \n" << expr << "\n";
result.SetStatus(eReturnStatusFailed);
return false;
}
diff --git a/source/Commands/CommandObjectWatchpointCommand.cpp b/source/Commands/CommandObjectWatchpointCommand.cpp
index ec7e4a1f9cde..74015a433831 100644
--- a/source/Commands/CommandObjectWatchpointCommand.cpp
+++ b/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -22,6 +22,7 @@
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
@@ -253,11 +254,10 @@ are no syntax errors may indicate that a function was declared but never called.
std::unique_ptr<WatchpointOptions::CommandData> data_ap(
new WatchpointOptions::CommandData());
- // It's necessary to set both user_source and script_source to the oneliner.
- // The former is used to generate callback description (as in watchpoint
- // command list)
- // while the latter is used for Python to interpret during the actual
- // callback.
+ // It's necessary to set both user_source and script_source to the
+ // oneliner. The former is used to generate callback description (as in
+ // watchpoint command list) while the latter is used for Python to
+ // interpret during the actual callback.
data_ap->user_source.AppendString(oneliner);
data_ap->script_source.assign(oneliner);
data_ap->stop_on_error = m_options.m_stop_on_error;
@@ -286,8 +286,8 @@ are no syntax errors may indicate that a function was declared but never called.
CommandReturnObject result;
Debugger &debugger = target->GetDebugger();
// Rig up the results secondary output stream to the debugger's, so the
- // output will come out synchronously
- // if the debugger is set up that way.
+ // output will come out synchronously if the debugger is set up that
+ // way.
StreamSP output_stream(debugger.GetAsyncOutputStream());
StreamSP error_stream(debugger.GetAsyncErrorStream());
@@ -331,7 +331,7 @@ are no syntax errors may indicate that a function was declared but never called.
break;
case 's':
- m_script_language = (lldb::ScriptLanguage)Args::StringToOptionEnum(
+ m_script_language = (lldb::ScriptLanguage)OptionArgParser::ToOptionEnum(
option_arg, GetDefinitions()[option_idx].enum_values,
eScriptLanguageNone, error);
@@ -341,7 +341,8 @@ are no syntax errors may indicate that a function was declared but never called.
case 'e': {
bool success = false;
- m_stop_on_error = Args::StringToBoolean(option_arg, false, &success);
+ m_stop_on_error =
+ OptionArgParser::ToBoolean(option_arg, false, &success);
if (!success)
error.SetErrorStringWithFormat(
"invalid value for stop-on-error: \"%s\"",
@@ -439,20 +440,19 @@ protected:
if (wp_options == nullptr)
continue;
- // If we are using script language, get the script interpreter
- // in order to set or collect command callback. Otherwise, call
- // the methods associated with this object.
+ // If we are using script language, get the script interpreter in order
+ // to set or collect command callback. Otherwise, call the methods
+ // associated with this object.
if (m_options.m_use_script_language) {
// Special handling for one-liner specified inline.
if (m_options.m_use_one_liner) {
m_interpreter.GetScriptInterpreter()->SetWatchpointCommandCallback(
wp_options, m_options.m_one_liner.c_str());
}
- // Special handling for using a Python function by name
- // instead of extending the watchpoint callback data structures, we
- // just automatize
- // what the user would do manually: make their watchpoint command be a
- // function call
+ // Special handling for using a Python function by name instead of
+ // extending the watchpoint callback data structures, we just
+ // automatize what the user would do manually: make their watchpoint
+ // command be a function call
else if (!m_options.m_function_name.empty()) {
std::string oneliner(m_options.m_function_name);
oneliner += "(frame, wp, internal_dict)";
@@ -669,7 +669,7 @@ CommandObjectWatchpointCommand::CommandObjectWatchpointCommand(
: CommandObjectMultiword(
interpreter, "command",
"Commands for adding, removing and examining LLDB commands "
- "executed when the watchpoint is hit (watchpoint 'commmands').",
+ "executed when the watchpoint is hit (watchpoint 'commands').",
"command <sub-command> [<sub-command-options>] <watchpoint-id>") {
CommandObjectSP add_command_object(
new CommandObjectWatchpointCommandAdd(interpreter));
diff --git a/source/Core/Address.cpp b/source/Core/Address.cpp
index 54b485ce0354..f183245f7d36 100644
--- a/source/Core/Address.cpp
+++ b/source/Core/Address.cpp
@@ -141,8 +141,8 @@ static bool ReadAddress(ExecutionContextScope *exe_scope,
deref_so_addr))
return true;
} else {
- // If we were not running, yet able to read an integer, we must
- // have a module
+ // If we were not running, yet able to read an integer, we must have a
+ // module
ModuleSP module_sp(address.GetModule());
assert(module_sp);
@@ -151,8 +151,8 @@ static bool ReadAddress(ExecutionContextScope *exe_scope,
}
// We couldn't make "deref_addr" into a section offset value, but we were
- // able to read the address, so we return a section offset address with
- // no section and "deref_addr" as the offset (address).
+ // able to read the address, so we return a section offset address with no
+ // section and "deref_addr" as the offset (address).
deref_so_addr.SetRawAddress(deref_addr);
return true;
}
@@ -278,12 +278,12 @@ addr_t Address::GetFileAddress() const {
// Section isn't resolved, we can't return a valid file address
return LLDB_INVALID_ADDRESS;
}
- // We have a valid file range, so we can return the file based
- // address by adding the file base address to our offset
+ // We have a valid file range, so we can return the file based address by
+ // adding the file base address to our offset
return sect_file_addr + m_offset;
} else if (SectionWasDeletedPrivate()) {
- // Used to have a valid section but it got deleted so the
- // offset doesn't mean anything without the section
+ // Used to have a valid section but it got deleted so the offset doesn't
+ // mean anything without the section
return LLDB_INVALID_ADDRESS;
}
// No section, we just return the offset since it is the value in this case
@@ -297,21 +297,21 @@ addr_t Address::GetLoadAddress(Target *target) const {
addr_t sect_load_addr = section_sp->GetLoadBaseAddress(target);
if (sect_load_addr != LLDB_INVALID_ADDRESS) {
- // We have a valid file range, so we can return the file based
- // address by adding the file base address to our offset
+ // We have a valid file range, so we can return the file based address
+ // by adding the file base address to our offset
return sect_load_addr + m_offset;
}
}
} else if (SectionWasDeletedPrivate()) {
- // Used to have a valid section but it got deleted so the
- // offset doesn't mean anything without the section
+ // Used to have a valid section but it got deleted so the offset doesn't
+ // mean anything without the section
return LLDB_INVALID_ADDRESS;
} else {
// We don't have a section so the offset is the load address
return m_offset;
}
- // The section isn't resolved or an invalid target was passed in
- // so we can't return a valid load address.
+ // The section isn't resolved or an invalid target was passed in so we can't
+ // return a valid load address.
return LLDB_INVALID_ADDRESS;
}
@@ -351,7 +351,7 @@ addr_t Address::GetOpcodeLoadAddress(Target *target,
AddressClass addr_class) const {
addr_t code_addr = GetLoadAddress(target);
if (code_addr != LLDB_INVALID_ADDRESS) {
- if (addr_class == eAddressClassInvalid)
+ if (addr_class == AddressClass::eInvalid)
addr_class = GetAddressClass();
code_addr = target->GetOpcodeLoadAddress(code_addr, addr_class);
}
@@ -363,7 +363,7 @@ bool Address::SetOpcodeLoadAddress(lldb::addr_t load_addr, Target *target,
bool allow_section_end) {
if (SetLoadAddress(load_addr, target, allow_section_end)) {
if (target) {
- if (addr_class == eAddressClassInvalid)
+ if (addr_class == AddressClass::eInvalid)
addr_class = GetAddressClass();
m_offset = target->GetOpcodeLoadAddress(m_offset, addr_class);
}
@@ -375,16 +375,15 @@ bool Address::SetOpcodeLoadAddress(lldb::addr_t load_addr, Target *target,
bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style,
DumpStyle fallback_style, uint32_t addr_size) const {
// If the section was nullptr, only load address is going to work unless we
- // are
- // trying to deref a pointer
+ // are trying to deref a pointer
SectionSP section_sp(GetSection());
if (!section_sp && style != DumpStyleResolvedPointerDescription)
style = DumpStyleLoadAddress;
ExecutionContext exe_ctx(exe_scope);
Target *target = exe_ctx.GetTargetPtr();
- // If addr_byte_size is UINT32_MAX, then determine the correct address
- // byte size for the process or default to the size of addr_t
+ // If addr_byte_size is UINT32_MAX, then determine the correct address byte
+ // size for the process or default to the size of addr_t
if (addr_size == UINT32_MAX) {
if (target)
addr_size = target->GetArchitecture().GetAddressByteSize();
@@ -439,7 +438,7 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style,
/*
* MIPS:
* Display address in compressed form for MIPS16 or microMIPS
- * if the address belongs to eAddressClassCodeAlternateISA.
+ * if the address belongs to AddressClass::eCodeAlternateISA.
*/
if (target) {
const llvm::Triple::ArchType llvm_arch =
@@ -651,15 +650,15 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style,
}
}
if (show_stop_context) {
- // We have a function or a symbol from the same
- // sections as this address.
+ // We have a function or a symbol from the same sections as this
+ // address.
sc.DumpStopContext(s, exe_scope, *this, show_fullpaths,
show_module, show_inlined_frames,
show_function_arguments, show_function_name);
} else {
- // We found a symbol but it was in a different
- // section so it isn't the symbol we should be
- // showing, just show the section name + offset
+ // We found a symbol but it was in a different section so it
+ // isn't the symbol we should be showing, just show the section
+ // name + offset
Dump(s, exe_scope, DumpStyleSectionNameOffset);
}
}
@@ -680,10 +679,10 @@ bool Address::Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style,
module_sp->ResolveSymbolContextForAddress(
*this, eSymbolContextEverything | eSymbolContextVariable, sc);
if (sc.symbol) {
- // If we have just a symbol make sure it is in the same section
- // as our address. If it isn't, then we might have just found
- // the last symbol that came before the address that we are
- // looking up that has nothing to do with our address lookup.
+ // If we have just a symbol make sure it is in the same section as
+ // our address. If it isn't, then we might have just found the last
+ // symbol that came before the address that we are looking up that
+ // has nothing to do with our address lookup.
if (sc.symbol->ValueIsAddress() &&
sc.symbol->GetAddressRef().GetSection() != GetSection())
sc.symbol = nullptr;
@@ -771,14 +770,11 @@ bool Address::SectionWasDeletedPrivate() const {
lldb::SectionWP empty_section_wp;
// If either call to "std::weak_ptr::owner_before(...) value returns true,
- // this
- // indicates that m_section_wp once contained (possibly still does) a
- // reference
- // to a valid shared pointer. This helps us know if we had a valid reference
- // to
- // a section which is now invalid because the module it was in was
- // unloaded/deleted,
- // or if the address doesn't have a valid reference to a section.
+ // this indicates that m_section_wp once contained (possibly still does) a
+ // reference to a valid shared pointer. This helps us know if we had a valid
+ // reference to a section which is now invalid because the module it was in
+ // was unloaded/deleted, or if the address doesn't have a valid reference to
+ // a section.
return empty_section_wp.owner_before(m_section_wp) ||
m_section_wp.owner_before(empty_section_wp);
}
@@ -914,8 +910,8 @@ int Address::CompareModulePointerAndOffset(const Address &a, const Address &b) {
return -1;
if (a_module > b_module)
return +1;
- // Modules are the same, just compare the file address since they should
- // be unique
+ // Modules are the same, just compare the file address since they should be
+ // unique
addr_t a_file_addr = a.GetFileAddress();
addr_t b_file_addr = b.GetFileAddress();
if (a_file_addr < b_file_addr)
@@ -926,24 +922,23 @@ int Address::CompareModulePointerAndOffset(const Address &a, const Address &b) {
}
size_t Address::MemorySize() const {
- // Noting special for the memory size of a single Address object,
- // it is just the size of itself.
+ // Noting special for the memory size of a single Address object, it is just
+ // the size of itself.
return sizeof(Address);
}
//----------------------------------------------------------------------
// NOTE: Be careful using this operator. It can correctly compare two
-// addresses from the same Module correctly. It can't compare two
-// addresses from different modules in any meaningful way, but it will
-// compare the module pointers.
+// addresses from the same Module correctly. It can't compare two addresses
+// from different modules in any meaningful way, but it will compare the module
+// pointers.
//
// To sum things up:
-// - works great for addresses within the same module
-// - it works for addresses across multiple modules, but don't expect the
+// - works great for addresses within the same module - it works for addresses
+// across multiple modules, but don't expect the
// address results to make much sense
//
-// This basically lets Address objects be used in ordered collection
-// classes.
+// This basically lets Address objects be used in ordered collection classes.
//----------------------------------------------------------------------
bool lldb_private::operator<(const Address &lhs, const Address &rhs) {
@@ -955,8 +950,8 @@ bool lldb_private::operator<(const Address &lhs, const Address &rhs) {
// Addresses are in the same module, just compare the file addresses
return lhs.GetFileAddress() < rhs.GetFileAddress();
} else {
- // The addresses are from different modules, just use the module
- // pointer value to get consistent ordering
+ // The addresses are from different modules, just use the module pointer
+ // value to get consistent ordering
return lhs_module < rhs_module;
}
}
@@ -970,8 +965,8 @@ bool lldb_private::operator>(const Address &lhs, const Address &rhs) {
// Addresses are in the same module, just compare the file addresses
return lhs.GetFileAddress() > rhs.GetFileAddress();
} else {
- // The addresses are from different modules, just use the module
- // pointer value to get consistent ordering
+ // The addresses are from different modules, just use the module pointer
+ // value to get consistent ordering
return lhs_module > rhs_module;
}
}
@@ -997,7 +992,7 @@ AddressClass Address::GetAddressClass() const {
return obj_file->GetAddressClass(GetFileAddress());
}
}
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
}
bool Address::SetLoadAddress(lldb::addr_t load_addr, Target *target,
diff --git a/source/Core/AddressResolverName.cpp b/source/Core/AddressResolverName.cpp
index 9935362e0e98..c3dab6d10810 100644
--- a/source/Core/AddressResolverName.cpp
+++ b/source/Core/AddressResolverName.cpp
@@ -62,9 +62,8 @@ AddressResolverName::~AddressResolverName() = default;
// FIXME: Right now we look at the module level, and call the module's
// "FindFunctions".
// Greg says he will add function tables, maybe at the CompileUnit level to
-// accelerate function
-// lookup. At that point, we should switch the depth to CompileUnit, and look
-// in these tables.
+// accelerate function lookup. At that point, we should switch the depth to
+// CompileUnit, and look in these tables.
Searcher::CallbackReturn
AddressResolverName::SearchCallback(SearchFilter &filter,
diff --git a/source/Core/Broadcaster.cpp b/source/Core/Broadcaster.cpp
index 7a4932c4987e..198434b46c29 100644
--- a/source/Core/Broadcaster.cpp
+++ b/source/Core/Broadcaster.cpp
@@ -74,9 +74,8 @@ Broadcaster::BroadcasterImpl::GetListeners() {
void Broadcaster::BroadcasterImpl::Clear() {
std::lock_guard<std::recursive_mutex> guard(m_listeners_mutex);
- // Make sure the listener forgets about this broadcaster. We do
- // this in the broadcaster in case the broadcaster object initiates
- // the removal.
+ // Make sure the listener forgets about this broadcaster. We do this in the
+ // broadcaster in case the broadcaster object initiates the removal.
for (auto &pair : GetListeners())
pair.first->BroadcasterWillDestruct(&m_broadcaster);
diff --git a/source/Core/CMakeLists.txt b/source/Core/CMakeLists.txt
index cac56e29fc19..927a0dcc2ec1 100644
--- a/source/Core/CMakeLists.txt
+++ b/source/Core/CMakeLists.txt
@@ -18,6 +18,7 @@ add_lldb_library(lldbCore
Debugger.cpp
Disassembler.cpp
DumpDataExtractor.cpp
+ DumpRegisterValue.cpp
DynamicLoader.cpp
EmulateInstruction.cpp
Event.cpp
@@ -69,7 +70,6 @@ add_lldb_library(lldbCore
lldbPluginProcessUtility
lldbPluginCPlusPlusLanguage
lldbPluginObjCLanguage
- lldbPluginObjectFileJIT
${LLDB_CURSES_LIBS}
LINK_COMPONENTS
diff --git a/source/Core/Communication.cpp b/source/Core/Communication.cpp
index 38ab902ab4b7..5ca338639de0 100644
--- a/source/Core/Communication.cpp
+++ b/source/Core/Communication.cpp
@@ -97,15 +97,15 @@ ConnectionStatus Communication::Disconnect(Status *error_ptr) {
lldb::ConnectionSP connection_sp(m_connection_sp);
if (connection_sp) {
ConnectionStatus status = connection_sp->Disconnect(error_ptr);
- // We currently don't protect connection_sp with any mutex for
- // multi-threaded environments. So lets not nuke our connection class
- // without putting some multi-threaded protections in. We also probably
- // don't want to pay for the overhead it might cause if every time we
- // access the connection we have to take a lock.
+ // We currently don't protect connection_sp with any mutex for multi-
+ // threaded environments. So lets not nuke our connection class without
+ // putting some multi-threaded protections in. We also probably don't want
+ // to pay for the overhead it might cause if every time we access the
+ // connection we have to take a lock.
//
- // This unique pointer will cleanup after itself when this object goes away,
- // so there is no need to currently have it destroy itself immediately
- // upon disconnnect.
+ // This unique pointer will cleanup after itself when this object goes
+ // away, so there is no need to currently have it destroy itself
+ // immediately upon disconnect.
// connection_sp.reset();
return status;
}
@@ -240,8 +240,8 @@ bool Communication::JoinReadThread(Status *error_ptr) {
size_t Communication::GetCachedBytes(void *dst, size_t dst_len) {
std::lock_guard<std::recursive_mutex> guard(m_bytes_mutex);
if (!m_bytes.empty()) {
- // If DST is nullptr and we have a thread, then return the number
- // of bytes that are available so the caller can call again
+ // If DST is nullptr and we have a thread, then return the number of bytes
+ // that are available so the caller can call again
if (dst == nullptr)
return m_bytes.size();
@@ -337,8 +337,7 @@ lldb::thread_result_t Communication::ReadThread(lldb::thread_arg_t p) {
case eConnectionStatusInterrupted: // Synchronization signal from
// SynchronizeWithReadThread()
// The connection returns eConnectionStatusInterrupted only when there is
- // no
- // input pending to be read, so we can signal that.
+ // no input pending to be read, so we can signal that.
comm->BroadcastEvent(eBroadcastBitNoMorePendingInput);
break;
case eConnectionStatusNoConnection: // No connection
diff --git a/source/Core/Debugger.cpp b/source/Core/Debugger.cpp
index a4d78151c75f..972d0bc0a6d7 100644
--- a/source/Core/Debugger.cpp
+++ b/source/Core/Debugger.cpp
@@ -14,6 +14,7 @@
#include "lldb/Core/FormatEntity.h"
#include "lldb/Core/Listener.h" // for Listener
#include "lldb/Core/Mangled.h" // for Mangled
+#include "lldb/Core/ModuleList.h" // for Mangled
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/State.h"
#include "lldb/Core/StreamAsynchronousIO.h"
@@ -47,7 +48,7 @@
#include "lldb/Utility/StreamCallback.h"
#include "lldb/Utility/StreamString.h"
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif
@@ -166,13 +167,15 @@ OptionEnumValueElement g_language_enumerators[] = {
"}${addr-file-or-load}{ " \
"<${function.concrete-only-addr-offset-no-padding}>}: "
-// gdb's disassembly format can be emulated with
-// ${current-pc-arrow}${addr-file-or-load}{
-// <${function.name-without-args}${function.concrete-only-addr-offset-no-padding}>}:
+// gdb's disassembly format can be emulated with ${current-pc-arrow}${addr-
+// file-or-load}{ <${function.name-without-args}${function.concrete-only-addr-
+// offset-no-padding}>}:
// lldb's original format for disassembly would look like this format string -
-// {${function.initial-function}{${module.file.basename}`}{${function.name-without-args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-without-args}}:\n}{${current-pc-arrow}
-// }{${addr-file-or-load}}:
+// {${function.initial-function}{${module.file.basename}`}{${function.name-
+// without-
+// args}}:\n}{${function.changed}\n{${module.file.basename}`}{${function.name-
+// without-args}}:\n}{${current-pc-arrow} }{${addr-file-or-load}}:
#define DEFAULT_STOP_SHOW_COLUMN_ANSI_PREFIX "${ansi.underline}"
#define DEFAULT_STOP_SHOW_COLUMN_ANSI_SUFFIX "${ansi.normal}"
@@ -589,9 +592,9 @@ bool Debugger::LoadPlugin(const FileSpec &spec, Status &error) {
return true;
}
} else {
- // The g_load_plugin_callback is registered in SBDebugger::Initialize()
- // and if the public API layer isn't available (code is linking against
- // all of the internal LLDB static libraries), then we can't load plugins
+ // The g_load_plugin_callback is registered in SBDebugger::Initialize() and
+ // if the public API layer isn't available (code is linking against all of
+ // the internal LLDB static libraries), then we can't load plugins
error.SetErrorString("Public API layer is not available");
}
return false;
@@ -602,8 +605,8 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
const FileSpec &file_spec) {
Status error;
- static ConstString g_dylibext("dylib");
- static ConstString g_solibext("so");
+ static ConstString g_dylibext(".dylib");
+ static ConstString g_solibext(".so");
if (!baton)
return FileSpec::eEnumerateDirectoryResultQuit;
@@ -611,8 +614,8 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
Debugger *debugger = (Debugger *)baton;
namespace fs = llvm::sys::fs;
- // If we have a regular file, a symbolic link or unknown file type, try
- // and process the file. We must handle unknown as sometimes the directory
+ // If we have a regular file, a symbolic link or unknown file type, try and
+ // process the file. We must handle unknown as sometimes the directory
// enumeration might be enumerating a file system that doesn't have correct
// file type information.
if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
@@ -632,9 +635,9 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
} else if (ft == fs::file_type::directory_file ||
ft == fs::file_type::symlink_file ||
ft == fs::file_type::type_unknown) {
- // Try and recurse into anything that a directory or symbolic link.
- // We must also do this for unknown as sometimes the directory enumeration
- // might be enumerating a file system that doesn't have correct file type
+ // Try and recurse into anything that a directory or symbolic link. We must
+ // also do this for unknown as sometimes the directory enumeration might be
+ // enumerating a file system that doesn't have correct file type
// information.
return FileSpec::eEnumerateDirectoryResultEnter;
}
@@ -643,19 +646,18 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
}
void Debugger::InstanceInitialize() {
- FileSpec dir_spec;
const bool find_directories = true;
const bool find_files = true;
const bool find_other = true;
char dir_path[PATH_MAX];
- if (HostInfo::GetLLDBPath(ePathTypeLLDBSystemPlugins, dir_spec)) {
+ if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSpec::EnumerateDirectory(dir_path, find_directories, find_files,
find_other, LoadPluginCallback, this);
}
}
- if (HostInfo::GetLLDBPath(ePathTypeLLDBUserPlugins, dir_spec)) {
+ if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSpec::EnumerateDirectory(dir_path, find_directories, find_files,
find_other, LoadPluginCallback, this);
@@ -774,6 +776,9 @@ Debugger::Debugger(lldb::LogOutputCallback log_callback, void *baton)
m_collection_sp->AppendProperty(
ConstString("platform"), ConstString("Platform settings."), true,
Platform::GetGlobalPlatformProperties()->GetValueProperties());
+ m_collection_sp->AppendProperty(
+ ConstString("symbols"), ConstString("Symbol lookup and cache settings."),
+ true, ModuleList::GetGlobalModuleListProperties().GetValueProperties());
if (m_command_interpreter_ap) {
m_collection_sp->AppendProperty(
ConstString("interpreter"),
@@ -796,10 +801,9 @@ Debugger::~Debugger() { Clear(); }
void Debugger::Clear() {
//----------------------------------------------------------------------
- // Make sure we call this function only once. With the C++ global
- // destructor chain having a list of debuggers and with code that can be
- // running on other threads, we need to ensure this doesn't happen
- // multiple times.
+ // Make sure we call this function only once. With the C++ global destructor
+ // chain having a list of debuggers and with code that can be running on
+ // other threads, we need to ensure this doesn't happen multiple times.
//
// The following functions call Debugger::Clear():
// Debugger::~Debugger();
@@ -824,8 +828,7 @@ void Debugger::Clear() {
m_broadcaster_manager_sp->Clear();
// Close the input file _before_ we close the input read communications
- // class
- // as it does NOT own the input file, our m_input_file does.
+ // class as it does NOT own the input file, our m_input_file does.
m_terminal_state.Clear();
if (m_input_file_sp)
m_input_file_sp->GetFile().Close();
@@ -861,8 +864,8 @@ void Debugger::SetInputFileHandle(FILE *fh, bool tranfer_ownership) {
if (!in_file.IsValid())
in_file.SetStream(stdin, true);
- // Save away the terminal state if that is relevant, so that we can restore it
- // in RestoreInputState.
+ // Save away the terminal state if that is relevant, so that we can restore
+ // it in RestoreInputState.
SaveInputTerminalState();
}
@@ -876,8 +879,8 @@ void Debugger::SetOutputFileHandle(FILE *fh, bool tranfer_ownership) {
if (!out_file.IsValid())
out_file.SetStream(stdout, false);
- // do not create the ScriptInterpreter just for setting the output file handle
- // as the constructor will know how to do the right thing on its own
+ // do not create the ScriptInterpreter just for setting the output file
+ // handle as the constructor will know how to do the right thing on its own
const bool can_create = false;
ScriptInterpreter *script_interpreter =
GetCommandInterpreter().GetScriptInterpreter(can_create);
@@ -1023,11 +1026,10 @@ void Debugger::RunIOHandler(const IOHandlerSP &reader_sp) {
void Debugger::AdoptTopIOHandlerFilesIfInvalid(StreamFileSP &in,
StreamFileSP &out,
StreamFileSP &err) {
- // Before an IOHandler runs, it must have in/out/err streams.
- // This function is called when one ore more of the streams
- // are nullptr. We use the top input reader's in/out/err streams,
- // or fall back to the debugger file handles, or we fall back
- // onto stdin/stdout/stderr as a last resort.
+ // Before an IOHandler runs, it must have in/out/err streams. This function
+ // is called when one ore more of the streams are nullptr. We use the top
+ // input reader's in/out/err streams, or fall back to the debugger file
+ // handles, or we fall back onto stdin/stdout/stderr as a last resort.
std::lock_guard<std::recursive_mutex> guard(m_input_reader_stack.GetMutex());
IOHandlerSP top_reader_sp(m_input_reader_stack.Top());
@@ -1083,8 +1085,8 @@ void Debugger::PushIOHandler(const IOHandlerSP &reader_sp) {
m_input_reader_stack.Push(reader_sp);
reader_sp->Activate();
- // Interrupt the top input reader to it will exit its Run() function
- // and let this new input reader take over
+ // Interrupt the top input reader to it will exit its Run() function and let
+ // this new input reader take over
if (top_reader_sp) {
top_reader_sp->Deactivate();
top_reader_sp->Cancel();
@@ -1097,8 +1099,8 @@ bool Debugger::PopIOHandler(const IOHandlerSP &pop_reader_sp) {
std::lock_guard<std::recursive_mutex> guard(m_input_reader_stack.GetMutex());
- // The reader on the stop of the stack is done, so let the next
- // read on the stack refresh its prompt and if there is one...
+ // The reader on the stop of the stack is done, so let the next read on the
+ // stack refresh its prompt and if there is one...
if (m_input_reader_stack.IsEmpty())
return false;
@@ -1162,75 +1164,6 @@ DebuggerSP Debugger::FindDebuggerWithID(lldb::user_id_t id) {
return debugger_sp;
}
-#if 0
-static void
-TestPromptFormats (StackFrame *frame)
-{
- if (frame == nullptr)
- return;
-
- StreamString s;
- const char *prompt_format =
- "{addr = '${addr}'\n}"
- "{addr-file-or-load = '${addr-file-or-load}'\n}"
- "{current-pc-arrow = '${current-pc-arrow}'\n}"
- "{process.id = '${process.id}'\n}"
- "{process.name = '${process.name}'\n}"
- "{process.file.basename = '${process.file.basename}'\n}"
- "{process.file.fullpath = '${process.file.fullpath}'\n}"
- "{thread.id = '${thread.id}'\n}"
- "{thread.index = '${thread.index}'\n}"
- "{thread.name = '${thread.name}'\n}"
- "{thread.queue = '${thread.queue}'\n}"
- "{thread.stop-reason = '${thread.stop-reason}'\n}"
- "{target.arch = '${target.arch}'\n}"
- "{module.file.basename = '${module.file.basename}'\n}"
- "{module.file.fullpath = '${module.file.fullpath}'\n}"
- "{file.basename = '${file.basename}'\n}"
- "{file.fullpath = '${file.fullpath}'\n}"
- "{frame.index = '${frame.index}'\n}"
- "{frame.pc = '${frame.pc}'\n}"
- "{frame.sp = '${frame.sp}'\n}"
- "{frame.fp = '${frame.fp}'\n}"
- "{frame.flags = '${frame.flags}'\n}"
- "{frame.reg.rdi = '${frame.reg.rdi}'\n}"
- "{frame.reg.rip = '${frame.reg.rip}'\n}"
- "{frame.reg.rsp = '${frame.reg.rsp}'\n}"
- "{frame.reg.rbp = '${frame.reg.rbp}'\n}"
- "{frame.reg.rflags = '${frame.reg.rflags}'\n}"
- "{frame.reg.xmm0 = '${frame.reg.xmm0}'\n}"
- "{frame.reg.carp = '${frame.reg.carp}'\n}"
- "{function.id = '${function.id}'\n}"
- "{function.changed = '${function.changed}'\n}"
- "{function.initial-function = '${function.initial-function}'\n}"
- "{function.name = '${function.name}'\n}"
- "{function.name-without-args = '${function.name-without-args}'\n}"
- "{function.name-with-args = '${function.name-with-args}'\n}"
- "{function.addr-offset = '${function.addr-offset}'\n}"
- "{function.concrete-only-addr-offset-no-padding = '${function.concrete-only-addr-offset-no-padding}'\n}"
- "{function.line-offset = '${function.line-offset}'\n}"
- "{function.pc-offset = '${function.pc-offset}'\n}"
- "{line.file.basename = '${line.file.basename}'\n}"
- "{line.file.fullpath = '${line.file.fullpath}'\n}"
- "{line.number = '${line.number}'\n}"
- "{line.start-addr = '${line.start-addr}'\n}"
- "{line.end-addr = '${line.end-addr}'\n}"
-;
-
- SymbolContext sc (frame->GetSymbolContext(eSymbolContextEverything));
- ExecutionContext exe_ctx;
- frame->CalculateExecutionContext(exe_ctx);
- if (Debugger::FormatPrompt (prompt_format, &sc, &exe_ctx, &sc.line_entry.range.GetBaseAddress(), s))
- {
- printf("%s\n", s.GetData());
- }
- else
- {
- printf ("what we got: %s\n", s.GetData());
- }
-}
-#endif
-
bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
const SymbolContext *sc,
const SymbolContext *prev_sc,
@@ -1262,8 +1195,8 @@ bool Debugger::FormatDisassemblerAddress(const FormatEntity::Entry *format,
}
}
}
- // The first context on a list of instructions will have a prev_sc that
- // has no Function or Symbol -- if SymbolContext had an IsValid() method, it
+ // The first context on a list of instructions will have a prev_sc that has
+ // no Function or Symbol -- if SymbolContext had an IsValid() method, it
// would return false. But we do get a prev_sc pointer.
if ((sc && (sc->function || sc->symbol)) && prev_sc &&
(prev_sc->function == nullptr && prev_sc->symbol == nullptr)) {
@@ -1307,8 +1240,8 @@ bool Debugger::EnableLog(llvm::StringRef channel,
if (log_options & LLDB_LOG_OPTION_APPEND)
flags |= llvm::sys::fs::F_Append;
int FD;
- if (std::error_code ec =
- llvm::sys::fs::openFileForWrite(log_file, FD, flags)) {
+ if (std::error_code ec = llvm::sys::fs::openFileForWrite(
+ log_file, FD, llvm::sys::fs::CD_CreateAlways, flags)) {
error_stream << "Unable to open log file: " << ec.message();
return false;
}
@@ -1529,8 +1462,8 @@ void Debugger::HandleProcessEvent(const EventSP &event_sp) {
}
void Debugger::HandleThreadEvent(const EventSP &event_sp) {
- // At present the only thread event we handle is the Frame Changed event,
- // and all we do for that is just reprint the thread status for that thread.
+ // At present the only thread event we handle is the Frame Changed event, and
+ // all we do for that is just reprint the thread status for that thread.
using namespace lldb;
const uint32_t event_type = event_sp->GetType();
const bool stop_format = true;
@@ -1583,8 +1516,8 @@ void Debugger::DefaultEventHandler() {
CommandInterpreter::eBroadcastBitAsynchronousOutputData |
CommandInterpreter::eBroadcastBitAsynchronousErrorData);
- // Let the thread that spawned us know that we have started up and
- // that we are now listening to all required events so no events get missed
+ // Let the thread that spawned us know that we have started up and that we
+ // are now listening to all required events so no events get missed
m_sync_broadcaster.BroadcastEvent(eBroadcastBitEventThreadIsListening);
bool done = false;
@@ -1649,27 +1582,28 @@ lldb::thread_result_t Debugger::EventHandlerThread(lldb::thread_arg_t arg) {
bool Debugger::StartEventHandlerThread() {
if (!m_event_handler_thread.IsJoinable()) {
- // We must synchronize with the DefaultEventHandler() thread to ensure
- // it is up and running and listening to events before we return from
- // this function. We do this by listening to events for the
+ // We must synchronize with the DefaultEventHandler() thread to ensure it
+ // is up and running and listening to events before we return from this
+ // function. We do this by listening to events for the
// eBroadcastBitEventThreadIsListening from the m_sync_broadcaster
- ListenerSP listener_sp(
- Listener::MakeListener("lldb.debugger.event-handler"));
+ ConstString full_name("lldb.debugger.event-handler");
+ ListenerSP listener_sp(Listener::MakeListener(full_name.AsCString()));
listener_sp->StartListeningForEvents(&m_sync_broadcaster,
eBroadcastBitEventThreadIsListening);
+ auto thread_name =
+ full_name.GetLength() < llvm::get_max_thread_name_length() ?
+ full_name.AsCString() : "dbg.evt-handler";
+
// Use larger 8MB stack for this thread
- m_event_handler_thread = ThreadLauncher::LaunchThread(
- "lldb.debugger.event-handler", EventHandlerThread, this, nullptr,
- g_debugger_event_thread_stack_bytes);
-
- // Make sure DefaultEventHandler() is running and listening to events before
- // we return
- // from this function. We are only listening for events of type
- // eBroadcastBitEventThreadIsListening so we don't need to check the event,
- // we just need
- // to wait an infinite amount of time for it (nullptr timeout as the first
- // parameter)
+ m_event_handler_thread = ThreadLauncher::LaunchThread(thread_name,
+ EventHandlerThread, this, nullptr, g_debugger_event_thread_stack_bytes);
+
+ // Make sure DefaultEventHandler() is running and listening to events
+ // before we return from this function. We are only listening for events of
+ // type eBroadcastBitEventThreadIsListening so we don't need to check the
+ // event, we just need to wait an infinite amount of time for it (nullptr
+ // timeout as the first parameter)
lldb::EventSP event_sp;
listener_sp->GetEvent(event_sp, llvm::None);
}
diff --git a/source/Core/Disassembler.cpp b/source/Core/Disassembler.cpp
index 6d463d552da6..d41a19465280 100644
--- a/source/Core/Disassembler.cpp
+++ b/source/Core/Disassembler.cpp
@@ -96,8 +96,8 @@ DisassemblerSP Disassembler::FindPluginForTarget(const TargetSP target_sp,
const char *plugin_name) {
if (target_sp && flavor == nullptr) {
// FIXME - we don't have the mechanism in place to do per-architecture
- // settings. But since we know that for now
- // we only support flavors on x86 & x86_64,
+ // settings. But since we know that for now we only support flavors on x86
+ // & x86_64,
if (arch.GetTriple().getArch() == llvm::Triple::x86 ||
arch.GetTriple().getArch() == llvm::Triple::x86_64)
flavor = target_sp->GetDisassemblyFlavor();
@@ -108,19 +108,19 @@ DisassemblerSP Disassembler::FindPluginForTarget(const TargetSP target_sp,
static void ResolveAddress(const ExecutionContext &exe_ctx, const Address &addr,
Address &resolved_addr) {
if (!addr.IsSectionOffset()) {
- // If we weren't passed in a section offset address range,
- // try and resolve it to something
+ // If we weren't passed in a section offset address range, try and resolve
+ // it to something
Target *target = exe_ctx.GetTargetPtr();
if (target) {
- if (target->GetSectionLoadList().IsEmpty()) {
- target->GetImages().ResolveFileAddress(addr.GetOffset(), resolved_addr);
- } else {
- target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
- resolved_addr);
- }
- // We weren't able to resolve the address, just treat it as a
- // raw address
- if (resolved_addr.IsValid())
+ bool is_resolved =
+ target->GetSectionLoadList().IsEmpty() ?
+ target->GetImages().ResolveFileAddress(addr.GetOffset(),
+ resolved_addr) :
+ target->GetSectionLoadList().ResolveLoadAddress(addr.GetOffset(),
+ resolved_addr);
+
+ // We weren't able to resolve the address, just treat it as a raw address
+ if (is_resolved && resolved_addr.IsValid())
return;
}
}
@@ -410,15 +410,13 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
disassembly_format = &format;
}
- // First pass: step through the list of instructions,
- // find how long the initial addresses strings are, insert padding
- // in the second pass so the opcodes all line up nicely.
+ // First pass: step through the list of instructions, find how long the
+ // initial addresses strings are, insert padding in the second pass so the
+ // opcodes all line up nicely.
// Also build up the source line mapping if this is mixed source & assembly
- // mode.
- // Calculate the source line for each assembly instruction (eliding inlined
- // functions
- // which the user wants to skip).
+ // mode. Calculate the source line for each assembly instruction (eliding
+ // inlined functions which the user wants to skip).
std::map<FileSpec, std::set<uint32_t>> source_lines_seen;
Symbol *previous_symbol = nullptr;
@@ -495,17 +493,13 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
if (mixed_source_and_assembly) {
// If we've started a new function (non-inlined), print all of the
- // source lines from the
- // function declaration until the first line table entry - typically
- // the opening curly brace of
- // the function.
+ // source lines from the function declaration until the first line
+ // table entry - typically the opening curly brace of the function.
if (previous_symbol != sc.symbol) {
- // The default disassembly format puts an extra blank line between
- // functions - so
- // when we're displaying the source context for a function, we
- // don't want to add
- // a blank line after the source context or we'll end up with two
- // of them.
+ // The default disassembly format puts an extra blank line
+ // between functions - so when we're displaying the source
+ // context for a function, we don't want to add a blank line
+ // after the source context or we'll end up with two of them.
if (previous_symbol != nullptr)
source_lines_to_display.print_source_context_end_eol = false;
@@ -520,9 +514,9 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
func_decl_line);
if (func_decl_file == prologue_end_line.file ||
func_decl_file == prologue_end_line.original_file) {
- // Add all the lines between the function declaration
- // and the first non-prologue source line to the list
- // of lines to print.
+ // Add all the lines between the function declaration and
+ // the first non-prologue source line to the list of lines
+ // to print.
for (uint32_t lineno = func_decl_line;
lineno <= prologue_end_line.line; lineno++) {
SourceLine this_line;
@@ -530,8 +524,8 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
this_line.line = lineno;
source_lines_to_display.lines.push_back(this_line);
}
- // Mark the last line as the "current" one. Usually
- // this is the open curly brace.
+ // Mark the last line as the "current" one. Usually this
+ // is the open curly brace.
if (source_lines_to_display.lines.size() > 0)
source_lines_to_display.current_source_line =
source_lines_to_display.lines.size() - 1;
@@ -542,8 +536,8 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
current_source_line_range);
}
- // If we've left a previous source line's address range, print a new
- // source line
+ // If we've left a previous source line's address range, print a
+ // new source line
if (!current_source_line_range.ContainsFileAddress(addr)) {
sc.GetAddressRange(scope, 0, use_inline_block_range,
current_source_line_range);
@@ -558,8 +552,8 @@ bool Disassembler::PrintInstructions(Disassembler *disasm_ptr,
// Only print this source line if it is different from the
// last source line we printed. There may have been inlined
// functions between these lines that we elided, resulting in
- // the same line being printed twice in a row for a contiguous
- // block of assembly instructions.
+ // the same line being printed twice in a row for a
+ // contiguous block of assembly instructions.
if (this_line != previous_line) {
std::vector<uint32_t> previous_lines;
@@ -683,7 +677,7 @@ Instruction::Instruction(const Address &address, AddressClass addr_class)
Instruction::~Instruction() = default;
AddressClass Instruction::GetAddressClass() {
- if (m_address_class == eAddressClassInvalid)
+ if (m_address_class == AddressClass::eInvalid)
m_address_class = m_address.GetAddressClass();
return m_address_class;
}
@@ -710,16 +704,16 @@ void Instruction::Dump(lldb_private::Stream *s, uint32_t max_opcode_byte_size,
if (show_bytes) {
if (m_opcode.GetType() == Opcode::eTypeBytes) {
- // x86_64 and i386 are the only ones that use bytes right now so
- // pad out the byte dump to be able to always show 15 bytes (3 chars each)
- // plus a space
+ // x86_64 and i386 are the only ones that use bytes right now so pad out
+ // the byte dump to be able to always show 15 bytes (3 chars each) plus a
+ // space
if (max_opcode_byte_size > 0)
m_opcode.Dump(&ss, max_opcode_byte_size * 3 + 1);
else
m_opcode.Dump(&ss, 15 * 3 + 1);
} else {
- // Else, we have ARM or MIPS which can show up to a uint32_t
- // 0x00000000 (10 spaces) plus two for padding...
+ // Else, we have ARM or MIPS which can show up to a uint32_t 0x00000000
+ // (10 spaces) plus two for padding...
if (max_opcode_byte_size > 0)
m_opcode.Dump(&ss, max_opcode_byte_size * 3 + 1);
else
@@ -903,7 +897,8 @@ OptionValueSP Instruction::ReadDictionary(FILE *in_file, Stream *out_stream) {
option_value_sp.reset();
return option_value_sp;
}
- // We've used the data_type to read an array; re-set the type to Invalid
+ // We've used the data_type to read an array; re-set the type to
+ // Invalid
data_type = OptionValue::eTypeInvalid;
} else if ((value[0] == '0') && (value[1] == 'x')) {
value_sp = std::make_shared<OptionValueUInt64>(0, 0);
@@ -1107,9 +1102,9 @@ InstructionList::GetIndexOfNextBranchInstruction(uint32_t start,
}
}
- // Hexagon needs the first instruction of the packet with the branch.
- // Go backwards until we find an instruction marked end-of-packet, or
- // until we hit start.
+ // Hexagon needs the first instruction of the packet with the branch. Go
+ // backwards until we find an instruction marked end-of-packet, or until we
+ // hit start.
if (target.GetArchitecture().GetTriple().getArch() == llvm::Triple::hexagon) {
// If we didn't find a branch, find the last packet start.
if (next_branch == UINT32_MAX) {
@@ -1128,8 +1123,8 @@ InstructionList::GetIndexOfNextBranchInstruction(uint32_t start,
// If we have an error reading memory, return start
if (!error.Success())
return start;
- // check if this is the last instruction in a packet
- // bits 15:14 will be 11b or 00b for a duplex
+ // check if this is the last instruction in a packet bits 15:14 will be
+ // 11b or 00b for a duplex
if (((inst_bytes & 0xC000) == 0xC000) ||
((inst_bytes & 0xC000) == 0x0000)) {
// instruction after this should be the start of next packet
@@ -1257,8 +1252,7 @@ Disassembler::Disassembler(const ArchSpec &arch, const char *flavor)
m_flavor.assign(flavor);
// If this is an arm variant that can only include thumb (T16, T32)
- // instructions, force the arch triple to be "thumbv.." instead of
- // "armv..."
+ // instructions, force the arch triple to be "thumbv.." instead of "armv..."
if (arch.IsAlwaysThumbInstructions()) {
std::string thumb_arch_name(arch.GetTriple().getArchName().str());
// Replace "arm" with "thumb" so we get all thumb variants correct
@@ -1285,7 +1279,7 @@ const InstructionList &Disassembler::GetInstructionList() const {
//----------------------------------------------------------------------
PseudoInstruction::PseudoInstruction()
- : Instruction(Address(), eAddressClassUnknown), m_description() {}
+ : Instruction(Address(), AddressClass::eUnknown), m_description() {}
PseudoInstruction::~PseudoInstruction() = default;
diff --git a/source/Core/DumpDataExtractor.cpp b/source/Core/DumpDataExtractor.cpp
index e564e86478fc..049f4d3805a1 100644
--- a/source/Core/DumpDataExtractor.cpp
+++ b/source/Core/DumpDataExtractor.cpp
@@ -239,8 +239,8 @@ lldb::offset_t lldb_private::DumpDataExtractor(
if (item_byte_size <= 8) {
uint64_t uval64 = DE.GetMaxU64Bitfield(&offset, item_byte_size,
item_bit_size, item_bit_offset);
- // Avoid std::bitset<64>::to_string() since it is missing in
- // earlier C++ libraries
+ // Avoid std::bitset<64>::to_string() since it is missing in earlier
+ // C++ libraries
std::string binary_value(64, '0');
std::bitset<64> bits(uval64);
for (uint32_t i = 0; i < 64; ++i)
@@ -263,8 +263,8 @@ lldb::offset_t lldb_private::DumpDataExtractor(
s->Printf("%2.2x", DE.GetU8(&offset));
}
- // Put an extra space between the groups of bytes if more than one
- // is being dumped in a group (item_byte_size is more than 1).
+ // Put an extra space between the groups of bytes if more than one is
+ // being dumped in a group (item_byte_size is more than 1).
if (item_byte_size > 1)
s->PutChar(' ');
break;
@@ -279,8 +279,7 @@ lldb::offset_t lldb_private::DumpDataExtractor(
return offset;
}
- // If we are only printing one character surround it with single
- // quotes
+ // If we are only printing one character surround it with single quotes
if (item_count == 1 && item_format == eFormatChar)
s->PutChar('\'');
@@ -583,8 +582,10 @@ lldb::offset_t lldb_private::DumpDataExtractor(
} else if (item_bit_size == ast->getTypeSize(ast->LongDoubleTy)) {
const auto &semantics =
ast->getFloatTypeSemantics(ast->LongDoubleTy);
- const auto byte_size =
- (llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
+
+ offset_t byte_size = item_byte_size;
+ if (&semantics == &llvm::APFloatBase::x87DoubleExtended())
+ byte_size = (llvm::APFloat::getSizeInBits(semantics) + 7) / 8;
llvm::APInt apint;
if (GetAPInt(DE, &offset, byte_size, apint)) {
@@ -691,10 +692,9 @@ lldb::offset_t lldb_private::DumpDataExtractor(
break;
// please keep the single-item formats below in sync with
- // FormatManager::GetSingleItemFormat
- // if you fail to do so, users will start getting different outputs
- // depending on internal
- // implementation details they should not care about ||
+ // FormatManager::GetSingleItemFormat if you fail to do so, users will
+ // start getting different outputs depending on internal implementation
+ // details they should not care about ||
case eFormatVectorOfChar: // ||
s->PutChar('{'); // \/
offset =
diff --git a/source/Core/DumpRegisterValue.cpp b/source/Core/DumpRegisterValue.cpp
new file mode 100644
index 000000000000..99334ca78a6d
--- /dev/null
+++ b/source/Core/DumpRegisterValue.cpp
@@ -0,0 +1,79 @@
+//===-- DumpRegisterValue.cpp -----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Core/DumpRegisterValue.h"
+#include "lldb/Core/DumpDataExtractor.h"
+#include "lldb/Core/RegisterValue.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "lldb/Utility/StreamString.h"
+#include "lldb/lldb-private-types.h"
+
+using namespace lldb;
+
+bool lldb_private::DumpRegisterValue(const RegisterValue &reg_val, Stream *s,
+ const RegisterInfo *reg_info,
+ bool prefix_with_name,
+ bool prefix_with_alt_name, Format format,
+ uint32_t reg_name_right_align_at) {
+ DataExtractor data;
+ if (reg_val.GetData(data)) {
+ bool name_printed = false;
+ // For simplicity, alignment of the register name printing applies only in
+ // the most common case where:
+ //
+ // prefix_with_name^prefix_with_alt_name is true
+ //
+ StreamString format_string;
+ if (reg_name_right_align_at && (prefix_with_name ^ prefix_with_alt_name))
+ format_string.Printf("%%%us", reg_name_right_align_at);
+ else
+ format_string.Printf("%%s");
+ std::string fmt = format_string.GetString();
+ if (prefix_with_name) {
+ if (reg_info->name) {
+ s->Printf(fmt.c_str(), reg_info->name);
+ name_printed = true;
+ } else if (reg_info->alt_name) {
+ s->Printf(fmt.c_str(), reg_info->alt_name);
+ prefix_with_alt_name = false;
+ name_printed = true;
+ }
+ }
+ if (prefix_with_alt_name) {
+ if (name_printed)
+ s->PutChar('/');
+ if (reg_info->alt_name) {
+ s->Printf(fmt.c_str(), reg_info->alt_name);
+ name_printed = true;
+ } else if (!name_printed) {
+ // No alternate name but we were asked to display a name, so show the
+ // main name
+ s->Printf(fmt.c_str(), reg_info->name);
+ name_printed = true;
+ }
+ }
+ if (name_printed)
+ s->PutCString(" = ");
+
+ if (format == eFormatDefault)
+ format = reg_info->format;
+
+ DumpDataExtractor(data, s,
+ 0, // Offset in "data"
+ format, // Format to use when dumping
+ reg_info->byte_size, // item_byte_size
+ 1, // item_count
+ UINT32_MAX, // num_per_line
+ LLDB_INVALID_ADDRESS, // base_addr
+ 0, // item_bit_size
+ 0); // item_bit_offset
+ return true;
+ }
+ return false;
+}
diff --git a/source/Core/DynamicLoader.cpp b/source/Core/DynamicLoader.cpp
index 5477498dadc8..16f1ffca1a20 100644
--- a/source/Core/DynamicLoader.cpp
+++ b/source/Core/DynamicLoader.cpp
@@ -64,8 +64,8 @@ DynamicLoader::DynamicLoader(Process *process) : m_process(process) {}
DynamicLoader::~DynamicLoader() = default;
//----------------------------------------------------------------------
-// Accessosors to the global setting as to whether to stop at image
-// (shared library) loading/unloading.
+// Accessosors to the global setting as to whether to stop at image (shared
+// library) loading/unloading.
//----------------------------------------------------------------------
bool DynamicLoader::GetStopWhenImagesChange() const {
@@ -86,8 +86,8 @@ ModuleSP DynamicLoader::GetTargetExecutable() {
executable->GetArchitecture());
auto module_sp = std::make_shared<Module>(module_spec);
- // Check if the executable has changed and set it to the target executable
- // if they differ.
+ // Check if the executable has changed and set it to the target
+ // executable if they differ.
if (module_sp && module_sp->GetUUID().IsValid() &&
executable->GetUUID().IsValid()) {
if (module_sp->GetUUID() != executable->GetUUID())
@@ -99,8 +99,8 @@ ModuleSP DynamicLoader::GetTargetExecutable() {
if (!executable) {
executable = target.GetSharedModule(module_spec);
if (executable.get() != target.GetExecutableModulePointer()) {
- // Don't load dependent images since we are in dyld where we will know
- // and find out about all images that are loaded
+ // Don't load dependent images since we are in dyld where we will
+ // know and find out about all images that are loaded
const bool get_dependent_images = false;
target.SetExecutableModule(executable, get_dependent_images);
}
@@ -177,8 +177,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file,
bool check_alternative_file_name = true;
if (base_addr_is_offset) {
// Try to fetch the load address of the file from the process as we need
- // absolute load
- // address to read the file out of the memory instead of a load bias.
+ // absolute load address to read the file out of the memory instead of a
+ // load bias.
bool is_loaded = false;
lldb::addr_t load_addr;
Status error = m_process->GetFileLoadAddress(file, is_loaded, load_addr);
@@ -188,9 +188,8 @@ ModuleSP DynamicLoader::LoadModuleAtAddress(const FileSpec &file,
}
}
- // We failed to find the module based on its name. Lets try to check if we can
- // find a
- // different name based on the memory region info.
+ // We failed to find the module based on its name. Lets try to check if we
+ // can find a different name based on the memory region info.
if (check_alternative_file_name) {
MemoryRegionInfo memory_info;
Status error = m_process->GetMemoryRegionInfo(base_addr, memory_info);
diff --git a/source/Core/EmulateInstruction.cpp b/source/Core/EmulateInstruction.cpp
index 2ee2c79de270..469022119c9e 100644
--- a/source/Core/EmulateInstruction.cpp
+++ b/source/Core/EmulateInstruction.cpp
@@ -10,6 +10,7 @@
#include "lldb/Core/EmulateInstruction.h"
#include "lldb/Core/Address.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/StreamFile.h"
@@ -361,7 +362,7 @@ bool EmulateInstruction::WriteRegisterDefault(EmulateInstruction *instruction,
const RegisterValue &reg_value) {
StreamFile strm(stdout, false);
strm.Printf(" Write to Register (name = %s, value = ", reg_info->name);
- reg_value.Dump(&strm, reg_info, false, false, eFormatDefault);
+ DumpRegisterValue(reg_value, &strm, reg_info, false, false, eFormatDefault);
strm.PutCString(", context = ");
context.Dump(strm, instruction);
strm.EOL();
diff --git a/source/Core/Event.cpp b/source/Core/Event.cpp
index 8d351d8ba1a5..3ebad7acdef7 100644
--- a/source/Core/Event.cpp
+++ b/source/Core/Event.cpp
@@ -10,7 +10,6 @@
#include "lldb/Core/Event.h"
#include "lldb/Core/Broadcaster.h"
-#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/Stream.h"
@@ -134,14 +133,13 @@ const ConstString &EventDataBytes::GetFlavor() const {
void EventDataBytes::Dump(Stream *s) const {
size_t num_printable_chars =
std::count_if(m_bytes.begin(), m_bytes.end(), isprint);
- if (num_printable_chars == m_bytes.size()) {
- s->Printf("\"%s\"", m_bytes.c_str());
- } else if (!m_bytes.empty()) {
- DataExtractor data;
- data.SetData(m_bytes.data(), m_bytes.size(), endian::InlHostByteOrder());
- DumpDataExtractor(data, s, 0, eFormatBytes, 1, m_bytes.size(), 32,
- LLDB_INVALID_ADDRESS, 0, 0);
- }
+ if (num_printable_chars == m_bytes.size())
+ s->Format("\"{0}\"", m_bytes);
+ else
+ s->Format("{0:$[ ]@[x-2]}", llvm::make_range(
+ reinterpret_cast<const uint8_t *>(m_bytes.data()),
+ reinterpret_cast<const uint8_t *>(m_bytes.data() +
+ m_bytes.size())));
}
const void *EventDataBytes::GetBytes() const {
diff --git a/source/Core/FileLineResolver.cpp b/source/Core/FileLineResolver.cpp
index 36f37f4a14d5..7f0f440252e7 100644
--- a/source/Core/FileLineResolver.cpp
+++ b/source/Core/FileLineResolver.cpp
@@ -54,8 +54,8 @@ FileLineResolver::SearchCallback(SearchFilter &filter, SymbolContext &context,
while (file_idx != UINT32_MAX) {
line_table->FineLineEntriesForFileIndex(file_idx, append,
m_sc_list);
- // Get the next file index in case we have multiple file
- // entries for the same file
+ // Get the next file index in case we have multiple file entries
+ // for the same file
file_idx = cu->GetSupportFiles().FindFileIndex(file_idx + 1,
m_file_spec, false);
}
diff --git a/source/Core/FileSpecList.cpp b/source/Core/FileSpecList.cpp
index 5b0bdac654e1..66e27b197447 100644
--- a/source/Core/FileSpecList.cpp
+++ b/source/Core/FileSpecList.cpp
@@ -42,11 +42,10 @@ void FileSpecList::Append(const FileSpec &file_spec) {
}
//------------------------------------------------------------------
-// Only append the "file_spec" if this list doesn't already contain
-// it.
+// Only append the "file_spec" if this list doesn't already contain it.
//
-// Returns true if "file_spec" was added, false if this list already
-// contained a copy of "file_spec".
+// Returns true if "file_spec" was added, false if this list already contained
+// a copy of "file_spec".
//------------------------------------------------------------------
bool FileSpecList::AppendIfUnique(const FileSpec &file_spec) {
collection::iterator end = m_files.end();
@@ -75,18 +74,18 @@ void FileSpecList::Dump(Stream *s, const char *separator_cstr) const {
}
//------------------------------------------------------------------
-// Find the index of the file in the file spec list that matches
-// "file_spec" starting "start_idx" entries into the file spec list.
+// Find the index of the file in the file spec list that matches "file_spec"
+// starting "start_idx" entries into the file spec list.
//
-// Returns the valid index of the file that matches "file_spec" if
-// it is found, else std::numeric_limits<uint32_t>::max() is returned.
+// Returns the valid index of the file that matches "file_spec" if it is found,
+// else std::numeric_limits<uint32_t>::max() is returned.
//------------------------------------------------------------------
size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec,
- bool full, bool remove_dots) const {
+ bool full) const {
const size_t num_files = m_files.size();
- // When looking for files, we will compare only the filename if the
- // FILE_SPEC argument is empty
+ // When looking for files, we will compare only the filename if the FILE_SPEC
+ // argument is empty
bool compare_filename_only = file_spec.GetDirectory().IsEmpty();
for (size_t idx = start_idx; idx < num_files; ++idx) {
@@ -96,7 +95,7 @@ size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec,
file_spec.IsCaseSensitive() || m_files[idx].IsCaseSensitive()))
return idx;
} else {
- if (FileSpec::Equal(m_files[idx], file_spec, full, remove_dots))
+ if (FileSpec::Equal(m_files[idx], file_spec, full))
return idx;
}
}
@@ -106,8 +105,8 @@ size_t FileSpecList::FindFileIndex(size_t start_idx, const FileSpec &file_spec,
}
//------------------------------------------------------------------
-// Returns the FileSpec object at index "idx". If "idx" is out of
-// range, then an empty FileSpec object will be returned.
+// Returns the FileSpec object at index "idx". If "idx" is out of range, then
+// an empty FileSpec object will be returned.
//------------------------------------------------------------------
const FileSpec &FileSpecList::GetFileSpecAtIndex(size_t idx) const {
if (idx < m_files.size())
@@ -123,11 +122,10 @@ const FileSpec *FileSpecList::GetFileSpecPointerAtIndex(size_t idx) const {
}
//------------------------------------------------------------------
-// Return the size in bytes that this object takes in memory. This
-// returns the size in bytes of this object's member variables and
-// any FileSpec objects its member variables contain, the result
-// doesn't not include the string values for the directories any
-// filenames as those are in shared string pools.
+// Return the size in bytes that this object takes in memory. This returns the
+// size in bytes of this object's member variables and any FileSpec objects its
+// member variables contain, the result doesn't not include the string values
+// for the directories any filenames as those are in shared string pools.
//------------------------------------------------------------------
size_t FileSpecList::MemorySize() const {
size_t mem_size = sizeof(FileSpecList);
diff --git a/source/Core/FormatEntity.cpp b/source/Core/FormatEntity.cpp
index 0cb74cc7658d..2257b7e273e8 100644
--- a/source/Core/FormatEntity.cpp
+++ b/source/Core/FormatEntity.cpp
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h"
#include "lldb/Core/AddressRange.h" // for AddressRange
#include "lldb/Core/Debugger.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/RegisterValue.h" // for RegisterValue
#include "lldb/Core/ValueObject.h"
@@ -467,10 +468,9 @@ static bool DumpAddressOffsetFromFunction(Stream &s, const SymbolContext *sc,
if (sc->function) {
func_addr = sc->function->GetAddressRange().GetBaseAddress();
if (sc->block && !concrete_only) {
- // Check to make sure we aren't in an inline
- // function. If we are, use the inline block
- // range that contains "format_addr" since
- // blocks can be discontiguous.
+ // Check to make sure we aren't in an inline function. If we are, use
+ // the inline block range that contains "format_addr" since blocks
+ // can be discontiguous.
Block *inline_block = sc->block->GetContainingInlinedBlock();
AddressRange inline_range;
if (inline_block &&
@@ -622,7 +622,7 @@ static bool DumpRegister(Stream &s, StackFrame *frame, RegisterKind reg_kind,
if (reg_info) {
RegisterValue reg_value;
if (reg_ctx->ReadRegister(reg_info, reg_value)) {
- reg_value.Dump(&s, reg_info, false, false, format);
+ DumpRegisterValue(reg_value, &s, reg_info, false, false, format);
return true;
}
}
@@ -822,8 +822,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
if (do_deref_pointer && !is_array_range) {
// I have not deref-ed yet, let's do it
// this happens when we are not going through
- // GetValueForVariableExpressionPath
- // to get to the target ValueObject
+ // GetValueForVariableExpressionPath to get to the target ValueObject
Status error;
target = target->Dereference(error).get();
if (error.Fail()) {
@@ -842,9 +841,9 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
return false;
}
- // we do not want to use the summary for a bitfield of type T:n
- // if we were originally dealing with just a T - that would get
- // us into an endless recursion
+ // we do not want to use the summary for a bitfield of type T:n if we were
+ // originally dealing with just a T - that would get us into an endless
+ // recursion
if (target->IsBitfield() && was_var_indexed) {
// TODO: check for a (T:n)-specific summary - we should still obey that
StreamString bitfield_name;
@@ -905,8 +904,7 @@ static bool DumpValue(Stream &s, const SymbolContext *sc,
}
// if directly trying to print ${var}, and this is an aggregate, display a
- // nice
- // type @ location message
+ // nice type @ location message
if (is_aggregate && was_plain_var) {
s << target->GetTypeName() << " @ " << target->GetLocationAsCString();
return true;
@@ -1021,7 +1019,7 @@ static bool DumpRegister(Stream &s, StackFrame *frame, const char *reg_name,
if (reg_info) {
RegisterValue reg_value;
if (reg_ctx->ReadRegister(reg_info, reg_value)) {
- reg_value.Dump(&s, reg_info, false, false, format);
+ DumpRegisterValue(reg_value, &s, reg_info, false, false, format);
return true;
}
}
@@ -1142,8 +1140,8 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
if (!success)
break;
}
- // Only if all items in a scope succeed, then do we
- // print the output into the main stream
+ // Only if all items in a scope succeed, then do we print the output into
+ // the main stream
if (success)
s.Write(scope_stream.GetString().data(), scope_stream.GetString().size());
}
@@ -1206,9 +1204,8 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
// Watch for the special "tid" format...
if (entry.printf_format == "tid") {
// TODO(zturner): Rather than hardcoding this to be platform
- // specific, it should be controlled by a
- // setting and the default value of the setting can be different
- // depending on the platform.
+ // specific, it should be controlled by a setting and the default
+ // value of the setting can be different depending on the platform.
Target &target = thread->GetProcess()->GetTarget();
ArchSpec arch(target.GetArchitecture());
llvm::Triple::OSType ostype = arch.IsValid()
@@ -1914,9 +1911,9 @@ static Status ParseEntry(const llvm::StringRef &format_str,
error.SetErrorStringWithFormat("%s", error_strm.GetData());
} else if (sep_char == ':') {
// Any value whose separator is a with a ':' means this value has a
- // string argument
- // that needs to be stored in the entry (like "${script.var:}").
- // In this case the string value is the empty string which is ok.
+ // string argument that needs to be stored in the entry (like
+ // "${script.var:}"). In this case the string value is the empty
+ // string which is ok.
} else {
error.SetErrorStringWithFormat("%s", "invalid entry definitions");
}
@@ -1926,8 +1923,7 @@ static Status ParseEntry(const llvm::StringRef &format_str,
error = ParseEntry(value, entry_def, entry);
} else if (sep_char == ':') {
// Any value whose separator is a with a ':' means this value has a
- // string argument
- // that needs to be stored in the entry (like
+ // string argument that needs to be stored in the entry (like
// "${script.var:modulename.function}")
entry.string = value.str();
} else {
@@ -2065,17 +2061,17 @@ Status FormatEntity::ParseInternal(llvm::StringRef &format, Entry &parent_entry,
case '0':
// 1 to 3 octal chars
{
- // Make a string that can hold onto the initial zero char,
- // up to 3 octal digits, and a terminating NULL.
+ // Make a string that can hold onto the initial zero char, up to 3
+ // octal digits, and a terminating NULL.
char oct_str[5] = {0, 0, 0, 0, 0};
int i;
for (i = 0; (format[i] >= '0' && format[i] <= '7') && i < 4; ++i)
oct_str[i] = format[i];
- // We don't want to consume the last octal character since
- // the main for loop will do this for us, so we advance p by
- // one less than i (even if i is zero)
+ // We don't want to consume the last octal character since the main
+ // for loop will do this for us, so we advance p by one less than i
+ // (even if i is zero)
format = format.drop_front(i);
unsigned long octal_value = ::strtoul(oct_str, nullptr, 8);
if (octal_value <= UINT8_MAX) {
@@ -2115,8 +2111,8 @@ Status FormatEntity::ParseInternal(llvm::StringRef &format, Entry &parent_entry,
break;
default:
- // Just desensitize any other character by just printing what
- // came after the '\'
+ // Just desensitize any other character by just printing what came
+ // after the '\'
parent_entry.AppendChar(desens_char);
break;
}
@@ -2142,10 +2138,9 @@ Status FormatEntity::ParseInternal(llvm::StringRef &format, Entry &parent_entry,
if (!variable_format.empty()) {
entry.printf_format = variable_format.str();
- // If the format contains a '%' we are going to assume this is
- // a printf style format. So if you want to format your thread ID
- // using "0x%llx" you can use:
- // ${thread.id%0x%llx}
+ // If the format contains a '%' we are going to assume this is a
+ // printf style format. So if you want to format your thread ID
+ // using "0x%llx" you can use: ${thread.id%0x%llx}
//
// If there is no '%' in the format, then it is assumed to be a
// LLDB format name, or one of the extended formats specified in
@@ -2264,9 +2259,9 @@ Status FormatEntity::ParseInternal(llvm::StringRef &format, Entry &parent_entry,
return error;
}
}
- // Check if this entry just wants to insert a constant string
- // value into the parent_entry, if so, insert the string with
- // AppendText, else append the entry to the parent_entry.
+ // Check if this entry just wants to insert a constant string value
+ // into the parent_entry, if so, insert the string with AppendText,
+ // else append the entry to the parent_entry.
if (entry.type == Entry::Type::InsertString)
parent_entry.AppendText(entry.string.c_str());
else
@@ -2350,12 +2345,12 @@ static void AddMatches(const FormatEntity::Entry::Definition *def,
}
}
-size_t FormatEntity::AutoComplete(llvm::StringRef str, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) {
- word_complete = false;
- str = str.drop_front(match_start_point);
- matches.Clear();
+size_t FormatEntity::AutoComplete(CompletionRequest &request) {
+ llvm::StringRef str = request.GetCursorArgumentPrefix().str();
+
+ request.SetWordComplete(false);
+ str = str.drop_front(request.GetMatchStartPoint());
+ request.GetMatches().Clear();
const size_t dollar_pos = str.rfind('$');
if (dollar_pos == llvm::StringRef::npos)
@@ -2365,7 +2360,7 @@ size_t FormatEntity::AutoComplete(llvm::StringRef str, int match_start_point,
if (dollar_pos == str.size() - 1) {
std::string match = str.str();
match.append("{");
- matches.AppendString(match);
+ request.GetMatches().AppendString(match);
return 1;
}
@@ -2383,8 +2378,8 @@ size_t FormatEntity::AutoComplete(llvm::StringRef str, int match_start_point,
llvm::StringRef partial_variable(str.substr(dollar_pos + 2));
if (partial_variable.empty()) {
// Suggest all top level entites as we are just past "${"
- AddMatches(&g_root, str, llvm::StringRef(), matches);
- return matches.GetSize();
+ AddMatches(&g_root, str, llvm::StringRef(), request.GetMatches());
+ return request.GetMatches().GetSize();
}
// We have a partially specified variable, find it
@@ -2400,19 +2395,19 @@ size_t FormatEntity::AutoComplete(llvm::StringRef str, int match_start_point,
// Exact match
if (n > 0) {
// "${thread.info" <TAB>
- matches.AppendString(MakeMatch(str, "."));
+ request.GetMatches().AppendString(MakeMatch(str, "."));
} else {
// "${thread.id" <TAB>
- matches.AppendString(MakeMatch(str, "}"));
- word_complete = true;
+ request.GetMatches().AppendString(MakeMatch(str, "}"));
+ request.SetWordComplete(true);
}
} else if (remainder.equals(".")) {
// "${thread." <TAB>
- AddMatches(entry_def, str, llvm::StringRef(), matches);
+ AddMatches(entry_def, str, llvm::StringRef(), request.GetMatches());
} else {
// We have a partial match
// "${thre" <TAB>
- AddMatches(entry_def, str, remainder, matches);
+ AddMatches(entry_def, str, remainder, request.GetMatches());
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
diff --git a/source/Core/IOHandler.cpp b/source/Core/IOHandler.cpp
index 103b5ecde94a..8474e4b8c564 100644
--- a/source/Core/IOHandler.cpp
+++ b/source/Core/IOHandler.cpp
@@ -67,6 +67,7 @@
#include <assert.h> // for assert
#include <ctype.h> // for isspace
#include <errno.h> // for EINTR, errno
+#include <locale.h> // for setlocale
#include <stdint.h> // for uint32_t, UINT32_MAX
#include <stdio.h> // for size_t, fprintf, feof
#include <string.h> // for strlen
@@ -238,27 +239,21 @@ int IOHandlerDelegate::IOHandlerComplete(IOHandler &io_handler,
matches);
case Completion::Expression: {
- bool word_complete = false;
- const char *word_start = cursor;
- if (cursor > current_line)
- --word_start;
- while (word_start > current_line && !isspace(*word_start))
- --word_start;
+ CompletionRequest request(current_line, current_line - cursor,
+ skip_first_n_matches, max_matches, matches);
CommandCompletions::InvokeCommonCompletionCallbacks(
io_handler.GetDebugger().GetCommandInterpreter(),
- CommandCompletions::eVariablePathCompletion, word_start,
- skip_first_n_matches, max_matches, nullptr, word_complete, matches);
+ CommandCompletions::eVariablePathCompletion, request, nullptr);
- size_t num_matches = matches.GetSize();
+ size_t num_matches = request.GetMatches().GetSize();
if (num_matches > 0) {
std::string common_prefix;
- matches.LongestCommonPrefix(common_prefix);
- const size_t partial_name_len = strlen(word_start);
+ request.GetMatches().LongestCommonPrefix(common_prefix);
+ const size_t partial_name_len = request.GetCursorArgumentPrefix().size();
- // If we matched a unique single command, add a space...
- // Only do this if the completer told us this was a complete word,
- // however...
- if (num_matches == 1 && word_complete) {
+ // If we matched a unique single command, add a space... Only do this if
+ // the completer told us this was a complete word, however...
+ if (num_matches == 1 && request.GetWordComplete()) {
common_prefix.push_back(' ');
}
common_prefix.erase(0, partial_name_len);
@@ -320,8 +315,7 @@ IOHandlerEditline::IOHandlerEditline(
const char *indent_chars = delegate.IOHandlerGetFixIndentationCharacters();
if (indent_chars) {
// The delegate does support indentation, hook it up so when any
- // indentation
- // character is typed, the delegate gets a chance to fix it
+ // indentation character is typed, the delegate gets a chance to fix it
m_editline_ap->SetFixIndentationCallback(FixIndentationCallback, this,
indent_chars);
}
@@ -407,8 +401,8 @@ bool IOHandlerEditline::GetLine(std::string &line, bool &interrupted) {
}
}
m_editing = false;
- // We might have gotten a newline on a line by itself
- // make sure to return true in this case.
+ // We might have gotten a newline on a line by itself make sure to return
+ // true in this case.
return got_line;
} else {
// No more input file, we are done...
@@ -544,9 +538,8 @@ bool IOHandlerEditline::GetLines(StringList &lines, bool &interrupted) {
return success;
}
-// Each IOHandler gets to run until it is done. It should read data
-// from the "in" and place output into "out" and "err and return
-// when done.
+// Each IOHandler gets to run until it is done. It should read data from the
+// "in" and place output into "out" and "err and return when done.
void IOHandlerEditline::Run() {
std::string line;
while (IsActive()) {
@@ -634,8 +627,7 @@ void IOHandlerEditline::PrintAsync(Stream *stream, const char *s, size_t len) {
}
}
-// we may want curses to be disabled for some builds
-// for instance, windows
+// we may want curses to be disabled for some builds for instance, windows
#ifndef LLDB_DISABLE_CURSES
#define KEY_RETURN 10
@@ -737,9 +729,8 @@ struct Rect {
origin.y += h;
}
- // Return a status bar rectangle which is the last line of
- // this rectangle. This rectangle will be modified to not
- // include the status bar area.
+ // Return a status bar rectangle which is the last line of this rectangle.
+ // This rectangle will be modified to not include the status bar area.
Rect MakeStatusBar() {
Rect status_bar;
if (size.height > 1) {
@@ -752,9 +743,8 @@ struct Rect {
return status_bar;
}
- // Return a menubar rectangle which is the first line of
- // this rectangle. This rectangle will be modified to not
- // include the menubar area.
+ // Return a menubar rectangle which is the first line of this rectangle. This
+ // rectangle will be modified to not include the menubar area.
Rect MakeMenuBar() {
Rect menubar;
if (size.height > 1) {
@@ -1203,12 +1193,10 @@ public:
return result;
}
- // Then check for any windows that want any keys
- // that weren't handled. This is typically only
- // for a menubar.
- // Make a copy of the subwindows in case any HandleChar()
- // functions muck with the subwindows. If we don't do this,
- // we can crash when iterating over the subwindows.
+ // Then check for any windows that want any keys that weren't handled. This
+ // is typically only for a menubar. Make a copy of the subwindows in case
+ // any HandleChar() functions muck with the subwindows. If we don't do
+ // this, we can crash when iterating over the subwindows.
Windows subwindows(m_subwindows);
for (auto subwindow_sp : subwindows) {
if (!subwindow_sp->m_can_activate) {
@@ -1395,8 +1383,8 @@ public:
}
MenuActionResult Action() {
- // Call the recursive action so it can try to handle it
- // with the menu delegate, and if not, try our parent menu
+ // Call the recursive action so it can try to handle it with the menu
+ // delegate, and if not, try our parent menu
return ActionPrivate(*this);
}
@@ -1665,9 +1653,9 @@ HandleCharResult Menu::WindowDelegateHandleChar(Window &window, int key) {
}
if (run_menu_sp) {
- // Run the action on this menu in case we need to populate the
- // menu with dynamic content and also in case check marks, and
- // any other menu decorations need to be calculated
+ // Run the action on this menu in case we need to populate the menu with
+ // dynamic content and also in case check marks, and any other menu
+ // decorations need to be calculated
if (run_menu_sp->Action() == MenuActionResult::Quit)
return eQuitApplication;
@@ -1781,12 +1769,11 @@ public:
bool done = false;
int delay_in_tenths_of_a_second = 1;
- // Alas the threading model in curses is a bit lame so we need to
- // resort to polling every 0.5 seconds. We could poll for stdin
- // ourselves and then pass the keys down but then we need to
- // translate all of the escape sequences ourselves. So we resort to
- // polling for input because we need to receive async process events
- // while in this loop.
+ // Alas the threading model in curses is a bit lame so we need to resort to
+ // polling every 0.5 seconds. We could poll for stdin ourselves and then
+ // pass the keys down but then we need to translate all of the escape
+ // sequences ourselves. So we resort to polling for input because we need
+ // to receive async process events while in this loop.
halfdelay(delay_in_tenths_of_a_second); // Poll using some number of tenths
// of seconds seconds when calling
@@ -1807,9 +1794,9 @@ public:
while (!done) {
if (update) {
m_window_sp->Draw(false);
- // All windows should be calling Window::DeferredRefresh() instead
- // of Window::Refresh() so we can do a single update and avoid
- // any screen blinking
+ // All windows should be calling Window::DeferredRefresh() instead of
+ // Window::Refresh() so we can do a single update and avoid any screen
+ // blinking
update_panels();
// Cursor hiding isn't working on MacOSX, so hide it in the top left
@@ -1821,8 +1808,8 @@ public:
}
#if defined(__APPLE__)
- // Terminal.app doesn't map its function keys correctly, F1-F4 default to:
- // \033OP, \033OQ, \033OR, \033OS, so lets take care of this here if
+ // Terminal.app doesn't map its function keys correctly, F1-F4 default
+ // to: \033OP, \033OQ, \033OR, \033OS, so lets take care of this here if
// possible
int ch;
if (escape_chars.empty())
@@ -1985,8 +1972,8 @@ struct Row {
parent->DrawTreeForChild(window, this, 0);
if (might_have_children) {
- // It we can get UTF8 characters to work we should try to use the "symbol"
- // UTF8 string below
+ // It we can get UTF8 characters to work we should try to use the
+ // "symbol" UTF8 string below
// const char *symbol = "";
// if (row.expanded)
// symbol = "\xe2\x96\xbd ";
@@ -1994,14 +1981,14 @@ struct Row {
// symbol = "\xe2\x96\xb7 ";
// window.PutCString (symbol);
- // The ACS_DARROW and ACS_RARROW don't look very nice they are just a
- // 'v' or '>' character...
+ // The ACS_DARROW and ACS_RARROW don't look very nice they are just a 'v'
+ // or '>' character...
// if (expanded)
// window.PutChar (ACS_DARROW);
// else
// window.PutChar (ACS_RARROW);
- // Since we can't find any good looking right arrow/down arrow
- // symbols, just use a diamond...
+ // Since we can't find any good looking right arrow/down arrow symbols,
+ // just use a diamond...
window.PutChar(ACS_DIAMOND);
window.PutChar(ACS_HLINE);
}
@@ -2101,9 +2088,8 @@ public:
const bool expanded = IsExpanded();
- // The root item must calculate its children,
- // or we must calculate the number of children
- // if the item is expanded
+ // The root item must calculate its children, or we must calculate the
+ // number of children if the item is expanded
if (m_parent == nullptr || expanded)
GetNumChildren();
@@ -2136,8 +2122,7 @@ public:
if (m_might_have_children) {
// It we can get UTF8 characters to work we should try to use the
- // "symbol"
- // UTF8 string below
+ // "symbol" UTF8 string below
// const char *symbol = "";
// if (row.expanded)
// symbol = "\xe2\x96\xbd ";
@@ -2151,8 +2136,8 @@ public:
// window.PutChar (ACS_DARROW);
// else
// window.PutChar (ACS_RARROW);
- // Since we can't find any good looking right arrow/down arrow
- // symbols, just use a diamond...
+ // Since we can't find any good looking right arrow/down arrow symbols,
+ // just use a diamond...
window.PutChar(ACS_DIAMOND);
window.PutChar(ACS_HLINE);
}
@@ -2175,8 +2160,8 @@ public:
if (IsExpanded()) {
for (auto &item : m_children) {
- // If we displayed all the rows and item.Draw() returns
- // false we are done drawing and can exit this for loop
+ // If we displayed all the rows and item.Draw() returns false we are
+ // done drawing and can exit this for loop
if (!item.Draw(window, first_visible_row, selected_row_idx, row_idx,
num_rows_left))
break;
@@ -2286,10 +2271,9 @@ public:
m_num_rows = 0;
m_root.CalculateRowIndexes(m_num_rows);
- // If we unexpanded while having something selected our
- // total number of rows is less than the num visible rows,
- // then make sure we show all the rows by setting the first
- // visible row accordingly.
+ // If we unexpanded while having something selected our total number of
+ // rows is less than the num visible rows, then make sure we show all the
+ // rows by setting the first visible row accordingly.
if (m_first_visible_row > 0 && m_num_rows < num_visible_rows)
m_first_visible_row = 0;
@@ -2695,10 +2679,9 @@ public:
const int num_visible_rows = NumVisibleRows();
const int num_rows = CalculateTotalNumberRows(m_rows);
- // If we unexpanded while having something selected our
- // total number of rows is less than the num visible rows,
- // then make sure we show all the rows by setting the first
- // visible row accordingly.
+ // If we unexpanded while having something selected our total number of
+ // rows is less than the num visible rows, then make sure we show all the
+ // rows by setting the first visible row accordingly.
if (m_first_visible_row > 0 && num_rows < num_visible_rows)
m_first_visible_row = 0;
@@ -2714,8 +2697,8 @@ public:
// Get the selected row
m_selected_row = GetRowForRowIndex(m_selected_row_idx);
- // Keep the cursor on the selected row so the highlight and the cursor
- // are always on the same line
+ // Keep the cursor on the selected row so the highlight and the cursor are
+ // always on the same line
if (m_selected_row)
window.MoveCursor(m_selected_row->x, m_selected_row->y);
@@ -3127,8 +3110,8 @@ public:
if (process && process->IsAlive())
return true; // Don't do any updating if we are running
else {
- // Update the values with an empty list if there
- // is no process or the process isn't alive anymore
+ // Update the values with an empty list if there is no process or the
+ // process isn't alive anymore
SetValues(value_list);
}
}
@@ -3392,8 +3375,8 @@ HandleCharResult HelpDialogDelegate::WindowDelegateHandleChar(Window &window,
if (num_lines <= num_visible_lines) {
done = true;
- // If we have all lines visible and don't need scrolling, then any
- // key press will cause us to exit
+ // If we have all lines visible and don't need scrolling, then any key
+ // press will cause us to exit
} else {
switch (key) {
case KEY_UP:
@@ -3606,8 +3589,8 @@ public:
case eMenuID_Process: {
// Populate the menu with all of the threads if the process is stopped
- // when
- // the Process menu gets selected and is about to display its submenu.
+ // when the Process menu gets selected and is about to display its
+ // submenu.
Menus &submenus = menu.GetSubmenus();
ExecutionContext exe_ctx =
m_debugger.GetCommandInterpreter().GetExecutionContext();
@@ -3642,8 +3625,8 @@ public:
nullptr, menu_char, thread_sp->GetID())));
}
} else if (submenus.size() > 7) {
- // Remove the separator and any other thread submenu items
- // that were previously added
+ // Remove the separator and any other thread submenu items that were
+ // previously added
submenus.erase(submenus.begin() + 7, submenus.end());
}
// Since we are adding and removing items we need to recalculate the name
@@ -3671,8 +3654,8 @@ public:
registers_bounds.size.width = source_bounds.size.width;
registers_window_sp->SetBounds(registers_bounds);
} else {
- // We have no registers window showing so give the bottom
- // area back to the source view
+ // We have no registers window showing so give the bottom area back
+ // to the source view
source_window_sp->Resize(source_bounds.size.width,
source_bounds.size.height +
variables_bounds.size.height);
@@ -3721,8 +3704,8 @@ public:
registers_window_sp->GetWidth(),
variables_bounds.size.height);
} else {
- // We have no variables window showing so give the bottom
- // area back to the source view
+ // We have no variables window showing so give the bottom area back
+ // to the source view
source_window_sp->Resize(source_bounds.size.width,
source_bounds.size.height +
registers_window_sp->GetHeight());
@@ -3731,9 +3714,9 @@ public:
} else {
Rect new_regs_rect;
if (variables_window_sp) {
- // We have a variables window, split it into two columns
- // where the left hand side will be the variables and the
- // right hand side will be the registers
+ // We have a variables window, split it into two columns where the
+ // left hand side will be the variables and the right hand side will
+ // be the registers
const Rect variables_bounds = variables_window_sp->GetBounds();
Rect new_vars_rect;
variables_bounds.VerticalSplitPercentage(0.50, new_vars_rect,
@@ -3945,8 +3928,8 @@ public:
m_selected_line = m_pc_line;
if (m_file_sp && m_file_sp->FileSpecMatches(m_sc.line_entry.file)) {
- // Same file, nothing to do, we should either have the
- // lines or not (source file missing)
+ // Same file, nothing to do, we should either have the lines or not
+ // (source file missing)
if (m_selected_line >= static_cast<size_t>(m_first_visible_line)) {
if (m_selected_line >= m_first_visible_line + num_visible_lines)
m_first_visible_line = m_selected_line - 10;
@@ -4627,8 +4610,8 @@ void IOHandlerCursesGUI::Activate() {
WindowSP menubar_window_sp =
main_window_sp->CreateSubWindow("Menubar", menubar_bounds, false);
- // Let the menubar get keys if the active window doesn't handle the
- // keys that are typed so it can respond to menubar key presses.
+ // Let the menubar get keys if the active window doesn't handle the keys
+ // that are typed so it can respond to menubar key presses.
menubar_window_sp->SetCanBeActive(
false); // Don't let the menubar become the active window
menubar_window_sp->SetDelegate(menubar_sp);
diff --git a/source/Core/Listener.cpp b/source/Core/Listener.cpp
index 1afa11649b59..a39ce6121b32 100644
--- a/source/Core/Listener.cpp
+++ b/source/Core/Listener.cpp
@@ -304,11 +304,9 @@ bool Listener::FindNextEventInternal(
if (remove) {
m_events.erase(pos);
- // Unlock the event queue here. We've removed this event and are about to
- // return
- // it so it should be okay to get the next event off the queue here - and
- // it might
- // be useful to do that in the "DoOnRemoval".
+ // Unlock the event queue here. We've removed this event and are about
+ // to return it so it should be okay to get the next event off the queue
+ // here - and it might be useful to do that in the "DoOnRemoval".
lock.unlock();
event_sp->DoOnRemoval();
}
@@ -434,8 +432,8 @@ Listener::StartListeningForEventSpec(BroadcasterManagerSP manager_sp,
if (!manager_sp)
return 0;
- // The BroadcasterManager mutex must be locked before m_broadcasters_mutex
- // to avoid violating the lock hierarchy (manager before broadcasters).
+ // The BroadcasterManager mutex must be locked before m_broadcasters_mutex to
+ // avoid violating the lock hierarchy (manager before broadcasters).
std::lock_guard<std::recursive_mutex> manager_guard(
manager_sp->m_manager_mutex);
std::lock_guard<std::recursive_mutex> guard(m_broadcasters_mutex);
diff --git a/source/Core/Mangled.cpp b/source/Core/Mangled.cpp
index 211a0c32cee7..545ac51c870f 100644
--- a/source/Core/Mangled.cpp
+++ b/source/Core/Mangled.cpp
@@ -16,34 +16,24 @@
#pragma comment(lib, "dbghelp.lib")
#endif
-#ifdef LLDB_USE_BUILTIN_DEMANGLER
-// Provide a fast-path demangler implemented in FastDemangle.cpp until it can
-// replace the existing C++ demangler with a complete implementation
-#include "lldb/Utility/FastDemangle.h"
-#include "llvm/Demangle/Demangle.h"
-#else
-// FreeBSD9-STABLE requires this to know about size_t in cxxabi.
-#include <cstddef>
-#include <cxxabi.h>
-#endif
-
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h"
-#include "lldb/lldb-enumerations.h" // for LanguageType
+#include "lldb/lldb-enumerations.h"
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
-#include "llvm/ADT/StringRef.h" // for StringRef
-#include "llvm/Support/Compiler.h" // for LLVM_PRETT...
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Demangle/Demangle.h"
+#include "llvm/Support/Compiler.h"
-#include <mutex> // for mutex, loc...
-#include <string> // for string
-#include <utility> // for pair
+#include <mutex>
+#include <string>
+#include <utility>
#include <stdlib.h>
#include <string.h>
@@ -90,10 +80,8 @@ get_demangled_name_without_arguments(ConstString mangled,
g_most_recent_mangled_to_name_sans_args;
// Need to have the mangled & demangled names we're currently examining as
- // statics
- // so we can return a const ref to them at the end of the func if we don't
- // have
- // anything better.
+ // statics so we can return a const ref to them at the end of the func if we
+ // don't have anything better.
static ConstString g_last_mangled;
static ConstString g_last_demangled;
@@ -142,8 +130,8 @@ get_demangled_name_without_arguments(ConstString mangled,
Mangled::Mangled() : m_mangled(), m_demangled() {}
//----------------------------------------------------------------------
-// Constructor with an optional string and a boolean indicating if it is
-// the mangled version.
+// Constructor with an optional string and a boolean indicating if it is the
+// mangled version.
//----------------------------------------------------------------------
Mangled::Mangled(const ConstString &s, bool mangled)
: m_mangled(), m_demangled() {
@@ -172,8 +160,8 @@ Mangled::Mangled(llvm::StringRef name) {
Mangled::~Mangled() {}
//----------------------------------------------------------------------
-// Convert to pointer operator. This allows code to check any Mangled
-// objects to see if they contain anything valid using code such as:
+// Convert to pointer operator. This allows code to check any Mangled objects
+// to see if they contain anything valid using code such as:
//
// Mangled mangled(...);
// if (mangled)
@@ -184,8 +172,8 @@ Mangled::operator void *() const {
}
//----------------------------------------------------------------------
-// Logical NOT operator. This allows code to check any Mangled
-// objects to see if they are invalid using code such as:
+// Logical NOT operator. This allows code to check any Mangled objects to see
+// if they are invalid using code such as:
//
// Mangled mangled(...);
// if (!file_spec)
@@ -211,9 +199,8 @@ int Mangled::Compare(const Mangled &a, const Mangled &b) {
}
//----------------------------------------------------------------------
-// Set the string value in this objects. If "mangled" is true, then
-// the mangled named is set with the new value in "s", else the
-// demangled name is set.
+// Set the string value in this objects. If "mangled" is true, then the mangled
+// named is set with the new value in "s", else the demangled name is set.
//----------------------------------------------------------------------
void Mangled::SetValue(const ConstString &s, bool mangled) {
if (s) {
@@ -246,16 +233,15 @@ void Mangled::SetValue(const ConstString &name) {
}
//----------------------------------------------------------------------
-// Generate the demangled name on demand using this accessor. Code in
-// this class will need to use this accessor if it wishes to decode
-// the demangled name. The result is cached and will be kept until a
-// new string value is supplied to this object, or until the end of the
-// object's lifetime.
+// Generate the demangled name on demand using this accessor. Code in this
+// class will need to use this accessor if it wishes to decode the demangled
+// name. The result is cached and will be kept until a new string value is
+// supplied to this object, or until the end of the object's lifetime.
//----------------------------------------------------------------------
const ConstString &
Mangled::GetDemangledName(lldb::LanguageType language) const {
- // Check to make sure we have a valid mangled name and that we
- // haven't already decoded our mangled name.
+ // Check to make sure we have a valid mangled name and that we haven't
+ // already decoded our mangled name.
if (m_mangled && !m_demangled) {
// We need to generate and cache the demangled name.
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
@@ -299,19 +285,15 @@ Mangled::GetDemangledName(lldb::LanguageType language) const {
break;
}
case eManglingSchemeItanium: {
-#ifdef LLDB_USE_BUILTIN_DEMANGLER
- if (log)
- log->Printf("demangle itanium: %s", mangled_name);
- // Try to use the fast-path demangler first for the
- // performance win, falling back to the full demangler only
- // when necessary
- demangled_name = FastDemangle(mangled_name, m_mangled.GetLength());
- if (!demangled_name)
- demangled_name =
- llvm::itaniumDemangle(mangled_name, NULL, NULL, NULL);
-#else
- demangled_name = abi::__cxa_demangle(mangled_name, NULL, NULL, NULL);
-#endif
+ llvm::ItaniumPartialDemangler IPD;
+ bool demangle_err = IPD.partialDemangle(mangled_name);
+ if (!demangle_err) {
+ // Default buffer and size (realloc is used in case it's too small).
+ size_t demangled_size = 80;
+ demangled_name = static_cast<char *>(::malloc(demangled_size));
+ demangled_name = IPD.finishDemangle(demangled_name, &demangled_size);
+ }
+
if (log) {
if (demangled_name)
log->Printf("demangled itanium: %s -> \"%s\"", mangled_name,
@@ -331,8 +313,8 @@ Mangled::GetDemangledName(lldb::LanguageType language) const {
}
}
if (!m_demangled) {
- // Set the demangled string to the empty string to indicate we
- // tried to parse it once and failed.
+ // Set the demangled string to the empty string to indicate we tried to
+ // parse it once and failed.
m_demangled.SetCString("");
}
}
@@ -370,8 +352,8 @@ ConstString Mangled::GetName(lldb::LanguageType language,
return get_demangled_name_without_arguments(m_mangled, demangled);
}
if (preference == ePreferDemangled) {
- // Call the accessor to make sure we get a demangled name in case
- // it hasn't been demangled yet...
+ // Call the accessor to make sure we get a demangled name in case it hasn't
+ // been demangled yet...
if (demangled)
return demangled;
return m_mangled;
@@ -380,8 +362,8 @@ ConstString Mangled::GetName(lldb::LanguageType language,
}
//----------------------------------------------------------------------
-// Dump a Mangled object to stream "s". We don't force our
-// demangled name to be computed currently (we don't use the accessor).
+// Dump a Mangled object to stream "s". We don't force our demangled name to be
+// computed currently (we don't use the accessor).
//----------------------------------------------------------------------
void Mangled::Dump(Stream *s) const {
if (m_mangled) {
@@ -394,8 +376,8 @@ void Mangled::Dump(Stream *s) const {
}
//----------------------------------------------------------------------
-// Dumps a debug version of this string with extra object and state
-// information to stream "s".
+// Dumps a debug version of this string with extra object and state information
+// to stream "s".
//----------------------------------------------------------------------
void Mangled::DumpDebug(Stream *s) const {
s->Printf("%*p: Mangled mangled = ", static_cast<int>(sizeof(void *) * 2),
@@ -406,21 +388,21 @@ void Mangled::DumpDebug(Stream *s) const {
}
//----------------------------------------------------------------------
-// Return the size in byte that this object takes in memory. The size
-// includes the size of the objects it owns, and not the strings that
-// it references because they are shared strings.
+// Return the size in byte that this object takes in memory. The size includes
+// the size of the objects it owns, and not the strings that it references
+// because they are shared strings.
//----------------------------------------------------------------------
size_t Mangled::MemorySize() const {
return m_mangled.MemorySize() + m_demangled.MemorySize();
}
//----------------------------------------------------------------------
-// We "guess" the language because we can't determine a symbol's language
-// from it's name. For example, a Pascal symbol can be mangled using the
-// C++ Itanium scheme, and defined in a compilation unit within the same
-// module as other C++ units. In addition, different targets could have
-// different ways of mangling names from a given language, likewise the
-// compilation units within those targets.
+// We "guess" the language because we can't determine a symbol's language from
+// it's name. For example, a Pascal symbol can be mangled using the C++
+// Itanium scheme, and defined in a compilation unit within the same module as
+// other C++ units. In addition, different targets could have different ways
+// of mangling names from a given language, likewise the compilation units
+// within those targets.
//----------------------------------------------------------------------
lldb::LanguageType Mangled::GuessLanguage() const {
ConstString mangled = GetMangledName();
@@ -433,7 +415,7 @@ lldb::LanguageType Mangled::GuessLanguage() const {
return lldb::eLanguageTypeObjC;
}
} else {
- // ObjC names aren't really mangled, so they won't necessarily be in the
+ // ObjC names aren't really mangled, so they won't necessarily be in the
// mangled name slot.
ConstString demangled_name = GetDemangledName(lldb::eLanguageTypeUnknown);
if (demangled_name
diff --git a/source/Core/Module.cpp b/source/Core/Module.cpp
index 8f80be45f1b0..3b1a4fd7be0f 100644
--- a/source/Core/Module.cpp
+++ b/source/Core/Module.cpp
@@ -38,6 +38,7 @@
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h" // for GetLogIfAn...
#include "lldb/Utility/RegularExpression.h"
@@ -46,13 +47,12 @@
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/Timer.h"
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/Language/ObjC/ObjCLanguage.h"
-#include "Plugins/ObjectFile/JIT/ObjectFileJIT.h"
#include "llvm/ADT/STLExtras.h" // for make_unique
#include "llvm/Support/Compiler.h" // for LLVM_PRETT...
@@ -79,21 +79,17 @@ class VariableList;
using namespace lldb;
using namespace lldb_private;
-// Shared pointers to modules track module lifetimes in
-// targets and in the global module, but this collection
-// will track all module objects that are still alive
+// Shared pointers to modules track module lifetimes in targets and in the
+// global module, but this collection will track all module objects that are
+// still alive
typedef std::vector<Module *> ModuleCollection;
static ModuleCollection &GetModuleCollection() {
// This module collection needs to live past any module, so we could either
- // make it a
- // shared pointer in each module or just leak is. Since it is only an empty
- // vector by
- // the time all the modules have gone away, we just leak it for now. If we
- // decide this
- // is a big problem we can introduce a Finalize method that will tear
- // everything down in
- // a predictable order.
+ // make it a shared pointer in each module or just leak is. Since it is only
+ // an empty vector by the time all the modules have gone away, we just leak
+ // it for now. If we decide this is a big problem we can introduce a
+ // Finalize method that will tear everything down in a predictable order.
static ModuleCollection *g_module_collection = nullptr;
if (g_module_collection == nullptr)
@@ -104,9 +100,9 @@ static ModuleCollection &GetModuleCollection() {
std::recursive_mutex &Module::GetAllocationModuleCollectionMutex() {
// NOTE: The mutex below must be leaked since the global module list in
- // the ModuleList class will get torn at some point, and we can't know
- // if it will tear itself down before the "g_module_collection_mutex" below
- // will. So we leak a Mutex object below to safeguard against that
+ // the ModuleList class will get torn at some point, and we can't know if it
+ // will tear itself down before the "g_module_collection_mutex" below will.
+ // So we leak a Mutex object below to safeguard against that
static std::recursive_mutex *g_module_collection_mutex = nullptr;
if (g_module_collection_mutex == nullptr)
@@ -151,8 +147,8 @@ Module::Module(const ModuleSpec &module_spec)
: module_spec.GetObjectName().AsCString(""),
module_spec.GetObjectName().IsEmpty() ? "" : ")");
- // First extract all module specifications from the file using the local
- // file path. If there are no specifications, then don't fill anything in
+ // First extract all module specifications from the file using the local file
+ // path. If there are no specifications, then don't fill anything in
ModuleSpecList modules_specs;
if (ObjectFile::GetModuleSpecifications(module_spec.GetFileSpec(), 0, 0,
modules_specs) == 0)
@@ -160,9 +156,8 @@ Module::Module(const ModuleSpec &module_spec)
// Now make sure that one of the module specifications matches what we just
// extract. We might have a module specification that specifies a file
- // "/usr/lib/dyld"
- // with UUID XXX, but we might have a local version of "/usr/lib/dyld" that
- // has
+ // "/usr/lib/dyld" with UUID XXX, but we might have a local version of
+ // "/usr/lib/dyld" that has
// UUID YYY and we don't want those to match. If they don't match, just don't
// fill any ivars in so we don't accidentally grab the wrong file later since
// they don't match...
@@ -177,8 +172,8 @@ Module::Module(const ModuleSpec &module_spec)
m_mod_time =
FileSystem::GetModificationTime(matching_module_spec.GetFileSpec());
- // Copy the architecture from the actual spec if we got one back, else use the
- // one that was specified
+ // Copy the architecture from the actual spec if we got one back, else use
+ // the one that was specified
if (matching_module_spec.GetArchitecture().IsValid())
m_arch = matching_module_spec.GetArchitecture();
else if (module_spec.GetArchitecture().IsValid())
@@ -210,9 +205,9 @@ Module::Module(const ModuleSpec &module_spec)
else
m_object_name = module_spec.GetObjectName();
- // Always trust the object offset (file offset) and object modification
- // time (for mod time in a BSD static archive) of from the matching
- // module specification
+ // Always trust the object offset (file offset) and object modification time
+ // (for mod time in a BSD static archive) of from the matching module
+ // specification
m_object_offset = matching_module_spec.GetObjectOffset();
m_object_mod_time = matching_module_spec.GetObjectModificationTime();
}
@@ -253,8 +248,8 @@ Module::Module()
}
Module::~Module() {
- // Lock our module down while we tear everything down to make sure
- // we don't get any access to the module while it is being destroyed
+ // Lock our module down while we tear everything down to make sure we don't
+ // get any access to the module while it is being destroyed
std::lock_guard<std::recursive_mutex> guard(m_mutex);
// Scope for locker below...
{
@@ -308,9 +303,8 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
m_object_name.SetString(s.GetString());
// Once we get the object file, update our module with the object
- // file's
- // architecture since it might differ in vendor/os if some parts were
- // unknown.
+ // file's architecture since it might differ in vendor/os if some
+ // parts were unknown.
m_objfile_sp->GetArchitecture(m_arch);
} else {
error.SetErrorString("unable to find suitable object file plug-in");
@@ -327,20 +321,30 @@ ObjectFile *Module::GetMemoryObjectFile(const lldb::ProcessSP &process_sp,
}
const lldb_private::UUID &Module::GetUUID() {
- if (!m_did_parse_uuid.load()) {
+ if (!m_did_set_uuid.load()) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- if (!m_did_parse_uuid.load()) {
+ if (!m_did_set_uuid.load()) {
ObjectFile *obj_file = GetObjectFile();
if (obj_file != nullptr) {
obj_file->GetUUID(&m_uuid);
- m_did_parse_uuid = true;
+ m_did_set_uuid = true;
}
}
}
return m_uuid;
}
+void Module::SetUUID(const lldb_private::UUID &uuid) {
+ std::lock_guard<std::recursive_mutex> guard(m_mutex);
+ if (!m_did_set_uuid) {
+ m_uuid = uuid;
+ m_did_set_uuid = true;
+ } else {
+ lldbassert(0 && "Attempting to overwrite the existing module UUID");
+ }
+}
+
TypeSystem *Module::GetTypeSystemForLanguage(LanguageType language) {
return m_type_system_map.GetTypeSystemForLanguage(language, this, true);
}
@@ -441,8 +445,8 @@ uint32_t Module::ResolveSymbolContextForAddress(
// Make sure the section matches this module before we try and match anything
if (section_sp && section_sp->GetModule().get() == this) {
- // If the section offset based address resolved itself, then this
- // is the right module.
+ // If the section offset based address resolved itself, then this is the
+ // right module.
sc.module_sp = shared_from_this();
resolved_flags |= eSymbolContextModule;
@@ -450,8 +454,8 @@ uint32_t Module::ResolveSymbolContextForAddress(
if (!sym_vendor)
return resolved_flags;
- // Resolve the compile unit, function, block, line table or line
- // entry if requested.
+ // Resolve the compile unit, function, block, line table or line entry if
+ // requested.
if (resolve_scope & eSymbolContextCompUnit ||
resolve_scope & eSymbolContextFunction ||
resolve_scope & eSymbolContextBlock ||
@@ -461,8 +465,8 @@ uint32_t Module::ResolveSymbolContextForAddress(
sym_vendor->ResolveSymbolContext(so_addr, resolve_scope, sc);
}
- // Resolve the symbol if requested, but don't re-look it up if we've already
- // found it.
+ // Resolve the symbol if requested, but don't re-look it up if we've
+ // already found it.
if (resolve_scope & eSymbolContextSymbol &&
!(resolved_flags & eSymbolContextSymbol)) {
Symtab *symtab = sym_vendor->GetSymtab();
@@ -491,12 +495,11 @@ uint32_t Module::ResolveSymbolContextForAddress(
if (sc.symbol) {
if (sc.symbol->IsSynthetic()) {
- // We have a synthetic symbol so lets check if the object file
- // from the symbol file in the symbol vendor is different than
- // the object file for the module, and if so search its symbol
- // table to see if we can come up with a better symbol. For example
- // dSYM files on MacOSX have an unstripped symbol table inside of
- // them.
+ // We have a synthetic symbol so lets check if the object file from
+ // the symbol file in the symbol vendor is different than the
+ // object file for the module, and if so search its symbol table to
+ // see if we can come up with a better symbol. For example dSYM
+ // files on MacOSX have an unstripped symbol table inside of them.
ObjectFile *symtab_objfile = symtab->GetObjectFile();
if (symtab_objfile && symtab_objfile->IsStripped()) {
SymbolFile *symfile = sym_vendor->GetSymbolFile();
@@ -522,10 +525,8 @@ uint32_t Module::ResolveSymbolContextForAddress(
}
// For function symbols, so_addr may be off by one. This is a convention
- // consistent
- // with FDE row indices in eh_frame sections, but requires extra logic here
- // to permit
- // symbol lookup for disassembly and unwind.
+ // consistent with FDE row indices in eh_frame sections, but requires extra
+ // logic here to permit symbol lookup for disassembly and unwind.
if (resolve_scope & eSymbolContextSymbol &&
!(resolved_flags & eSymbolContextSymbol) && resolve_tail_call_address &&
so_addr.IsSectionOffset()) {
@@ -542,10 +543,9 @@ uint32_t Module::ResolveSymbolContextForAddress(
if (addr_range.GetBaseAddress().GetSection() ==
so_addr.GetSection()) {
// If the requested address is one past the address range of a
- // function (i.e. a tail call),
- // or the decremented address is the start of a function (i.e. some
- // forms of trampoline),
- // indicate that the symbol has been resolved.
+ // function (i.e. a tail call), or the decremented address is the
+ // start of a function (i.e. some forms of trampoline), indicate
+ // that the symbol has been resolved.
if (so_addr.GetOffset() ==
addr_range.GetBaseAddress().GetOffset() ||
so_addr.GetOffset() ==
@@ -599,21 +599,21 @@ uint32_t Module::ResolveSymbolContextsForFileSpec(const FileSpec &file_spec,
size_t Module::FindGlobalVariables(const ConstString &name,
const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variables) {
SymbolVendor *symbols = GetSymbolVendor();
if (symbols)
- return symbols->FindGlobalVariables(name, parent_decl_ctx, append,
- max_matches, variables);
+ return symbols->FindGlobalVariables(name, parent_decl_ctx, max_matches,
+ variables);
return 0;
}
-size_t Module::FindGlobalVariables(const RegularExpression &regex, bool append,
+size_t Module::FindGlobalVariables(const RegularExpression &regex,
size_t max_matches,
VariableList &variables) {
SymbolVendor *symbols = GetSymbolVendor();
if (symbols)
- return symbols->FindGlobalVariables(regex, append, max_matches, variables);
+ return symbols->FindGlobalVariables(regex, max_matches, variables);
return 0;
}
@@ -677,25 +677,22 @@ Module::LookupInfo::LookupInfo(const ConstString &name, uint32_t name_type_mask,
if (name_type_mask & eFunctionNameTypeMethod ||
name_type_mask & eFunctionNameTypeBase) {
// If they've asked for a CPP method or function name and it can't be
- // that, we don't
- // even need to search for CPP methods or names.
+ // that, we don't even need to search for CPP methods or names.
CPlusPlusLanguage::MethodName cpp_method(name);
if (cpp_method.IsValid()) {
basename = cpp_method.GetBasename();
if (!cpp_method.GetQualifiers().empty()) {
// There is a "const" or other qualifier following the end of the
- // function parens,
- // this can't be a eFunctionNameTypeBase
+ // function parens, this can't be a eFunctionNameTypeBase
m_name_type_mask &= ~(eFunctionNameTypeBase);
if (m_name_type_mask == eFunctionNameTypeNone)
return;
}
} else {
// If the CPP method parser didn't manage to chop this up, try to fill
- // in the base name if we can.
- // If a::b::c is passed in, we need to just look up "c", and then we'll
- // filter the result later.
+ // in the base name if we can. If a::b::c is passed in, we need to just
+ // look up "c", and then we'll filter the result later.
CPlusPlusLanguage::ExtractContextAndIdentifier(name_cstr, context,
basename);
}
@@ -724,19 +721,15 @@ Module::LookupInfo::LookupInfo(const ConstString &name, uint32_t name_type_mask,
}
if (!basename.empty()) {
- // The name supplied was a partial C++ path like "a::count". In this case we
- // want to do a
- // lookup on the basename "count" and then make sure any matching results
- // contain "a::count"
- // so that it would match "b::a::count" and "a::count". This is why we set
- // "match_name_after_lookup"
- // to true
+ // The name supplied was a partial C++ path like "a::count". In this case
+ // we want to do a lookup on the basename "count" and then make sure any
+ // matching results contain "a::count" so that it would match "b::a::count"
+ // and "a::count". This is why we set "match_name_after_lookup" to true
m_lookup_name.SetString(basename);
m_match_name_after_lookup = true;
} else {
// The name is already correct, just use the exact name as supplied, and we
- // won't need
- // to check if any matches contain "name"
+ // won't need to check if any matches contain "name"
m_lookup_name = name;
m_match_name_after_lookup = false;
}
@@ -770,8 +763,8 @@ void Module::LookupInfo::Prune(SymbolContextList &sc_list,
while (i < sc_list.GetSize()) {
if (!sc_list.GetContextAtIndex(i, sc))
break;
- // Make sure the mangled and demangled names don't match before we try
- // to pull anything out
+ // Make sure the mangled and demangled names don't match before we try to
+ // pull anything out
ConstString mangled_name(sc.GetFunctionName(Mangled::ePreferMangled));
ConstString full_name(sc.GetFunctionName());
if (mangled_name != m_name && full_name != m_name)
@@ -867,7 +860,8 @@ size_t Module::FindFunctions(const RegularExpression &regex,
if (symbols) {
symbols->FindFunctions(regex, include_inlines, append, sc_list);
- // Now check our symbol table for symbols that are code symbols if requested
+ // Now check our symbol table for symbols that are code symbols if
+ // requested
if (include_symbols) {
Symtab *symtab = symbols->GetSymtab();
if (symtab) {
@@ -882,7 +876,8 @@ size_t Module::FindFunctions(const RegularExpression &regex,
size_t num_functions_added_to_sc_list =
end_functions_added_index - start_size;
if (num_functions_added_to_sc_list == 0) {
- // No functions were added, just symbols, so we can just append them
+ // No functions were added, just symbols, so we can just append
+ // them
for (size_t i = 0; i < num_matches; ++i) {
sc.symbol = symtab->SymbolAtIndex(symbol_indexes[i]);
SymbolType sym_type = sc.symbol->GetType();
@@ -1001,6 +996,7 @@ size_t Module::FindTypes(
const bool append = true;
TypeClass type_class = eTypeClassAny;
TypeMap typesmap;
+
if (Type::GetTypeScopeAndBasename(type_name_cstr, type_scope, type_basename,
type_class)) {
// Check if "name" starts with "::" which means the qualified type starts
@@ -1019,17 +1015,23 @@ size_t Module::FindTypes(
} else {
// The type is not in a namespace/class scope, just search for it by
// basename
- if (type_class != eTypeClassAny) {
+ if (type_class != eTypeClassAny && !type_basename.empty()) {
// The "type_name_cstr" will have been modified if we have a valid type
- // class
- // prefix (like "struct", "class", "union", "typedef" etc).
+ // class prefix (like "struct", "class", "union", "typedef" etc).
FindTypes_Impl(sc, ConstString(type_basename), nullptr, append,
- max_matches, searched_symbol_files, typesmap);
- typesmap.RemoveMismatchedTypes(type_class);
+ UINT_MAX, searched_symbol_files, typesmap);
+ typesmap.RemoveMismatchedTypes(type_scope, type_basename, type_class,
+ exact_match);
num_matches = typesmap.GetSize();
} else {
- num_matches = FindTypes_Impl(sc, name, nullptr, append, max_matches,
+ num_matches = FindTypes_Impl(sc, name, nullptr, append, UINT_MAX,
searched_symbol_files, typesmap);
+ if (exact_match) {
+ std::string name_str(name.AsCString(""));
+ typesmap.RemoveMismatchedTypes(type_scope, name_str, type_class,
+ exact_match);
+ num_matches = typesmap.GetSize();
+ }
}
}
if (num_matches > 0)
@@ -1057,8 +1059,8 @@ SymbolVendor *Module::GetSymbolVendor(bool can_create,
void Module::SetFileSpecAndObjectName(const FileSpec &file,
const ConstString &object_name) {
- // Container objects whose paths do not specify a file directly can call
- // this function to correct the file and object names.
+ // Container objects whose paths do not specify a file directly can call this
+ // function to correct the file and object names.
m_file = file;
m_mod_time = FileSystem::GetModificationTime(file);
m_object_name = object_name;
@@ -1258,12 +1260,10 @@ ObjectFile *Module::GetObjectFile() {
file_size - m_object_offset, data_sp, data_offset);
if (m_objfile_sp) {
// Once we get the object file, update our module with the object
- // file's
- // architecture since it might differ in vendor/os if some parts were
- // unknown. But since the matching arch might already be more
- // specific
- // than the generic COFF architecture, only merge in those values that
- // overwrite unspecified unknown values.
+ // file's architecture since it might differ in vendor/os if some
+ // parts were unknown. But since the matching arch might already be
+ // more specific than the generic COFF architecture, only merge in
+ // those values that overwrite unspecified unknown values.
ArchSpec new_arch;
m_objfile_sp->GetArchitecture(new_arch);
m_arch.MergeFrom(new_arch);
@@ -1278,7 +1278,7 @@ ObjectFile *Module::GetObjectFile() {
}
SectionList *Module::GetSectionList() {
- // Populate m_unified_sections_ap with sections from objfile.
+ // Populate m_sections_ap with sections from objfile.
if (!m_sections_ap) {
ObjectFile *obj_file = GetObjectFile();
if (obj_file != nullptr)
@@ -1297,7 +1297,6 @@ void Module::SectionFileAddressesChanged() {
}
SectionList *Module::GetUnifiedSectionList() {
- // Populate m_unified_sections_ap with sections from objfile.
if (!m_sections_ap)
m_sections_ap = llvm::make_unique<SectionList>();
return m_sections_ap.get();
@@ -1428,9 +1427,8 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
if (section_list && symbol_file) {
ObjectFile *obj_file = symbol_file->GetObjectFile();
// Make sure we have an object file and that the symbol vendor's objfile
- // isn't
- // the same as the module's objfile before we remove any sections for
- // it...
+ // isn't the same as the module's objfile before we remove any sections
+ // for it...
if (obj_file) {
// Check to make sure we aren't trying to specify the file we already
// have
@@ -1445,8 +1443,7 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
obj_file->ClearSymtab();
// The symbol file might be a directory bundle ("/tmp/a.out.dSYM")
- // instead
- // of a full path to the symbol file within the bundle
+ // instead of a full path to the symbol file within the bundle
// ("/tmp/a.out.dSYM/Contents/Resources/DWARF/a.out"). So we need to
// check this
@@ -1473,8 +1470,7 @@ void Module::SetSymbolFileFileSpec(const FileSpec &file) {
}
}
// Keep all old symbol files around in case there are any lingering type
- // references in
- // any SBValue objects that might have been handed out.
+ // references in any SBValue objects that might have been handed out.
m_old_symfiles.push_back(std::move(m_symfile_ap));
}
m_symfile_spec = file;
@@ -1644,37 +1640,10 @@ bool Module::RemapSourceFile(llvm::StringRef path,
return m_source_mappings.RemapPath(path, new_path);
}
-uint32_t Module::GetVersion(uint32_t *versions, uint32_t num_versions) {
- ObjectFile *obj_file = GetObjectFile();
- if (obj_file)
- return obj_file->GetVersion(versions, num_versions);
-
- if (versions != nullptr && num_versions != 0) {
- for (uint32_t i = 0; i < num_versions; ++i)
- versions[i] = LLDB_INVALID_MODULE_VERSION;
- }
- return 0;
-}
-
-ModuleSP
-Module::CreateJITModule(const lldb::ObjectFileJITDelegateSP &delegate_sp) {
- if (delegate_sp) {
- // Must create a module and place it into a shared pointer before
- // we can create an object file since it has a std::weak_ptr back
- // to the module, so we need to control the creation carefully in
- // this static function
- ModuleSP module_sp(new Module());
- module_sp->m_objfile_sp =
- std::make_shared<ObjectFileJIT>(module_sp, delegate_sp);
- if (module_sp->m_objfile_sp) {
- // Once we get the object file, update our module with the object file's
- // architecture since it might differ in vendor/os if some parts were
- // unknown.
- module_sp->m_objfile_sp->GetArchitecture(module_sp->m_arch);
- }
- return module_sp;
- }
- return ModuleSP();
+llvm::VersionTuple Module::GetVersion() {
+ if (ObjectFile *obj_file = GetObjectFile())
+ return obj_file->GetVersion();
+ return llvm::VersionTuple();
}
bool Module::GetIsDynamicLinkEditor() {
@@ -1685,7 +1654,3 @@ bool Module::GetIsDynamicLinkEditor() {
return false;
}
-
-Status Module::LoadInMemory(Target &target, bool set_pc) {
- return m_objfile_sp->LoadInMemory(target, set_pc);
-}
diff --git a/source/Core/ModuleList.cpp b/source/Core/ModuleList.cpp
index 3970052b7bf3..d2896da1adca 100644
--- a/source/Core/ModuleList.cpp
+++ b/source/Core/ModuleList.cpp
@@ -13,6 +13,9 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Symbols.h"
+#include "lldb/Interpreter/OptionValueProperties.h"
+#include "lldb/Interpreter/OptionValueFileSpec.h"
+#include "lldb/Interpreter/Property.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h" // for SymbolContextList, SymbolCon...
#include "lldb/Symbol/VariableList.h"
@@ -23,7 +26,7 @@
#include "lldb/Utility/UUID.h" // for UUID, operator!=, operator==
#include "lldb/lldb-defines.h" // for LLDB_INVALID_INDEX32
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif
@@ -31,6 +34,7 @@
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Threading.h"
#include "llvm/Support/raw_ostream.h" // for fs
+#include "clang/Driver/Driver.h"
#include <chrono> // for operator!=, time_point
#include <memory> // for shared_ptr
@@ -60,6 +64,51 @@ class TypeList;
using namespace lldb;
using namespace lldb_private;
+namespace {
+
+PropertyDefinition g_properties[] = {
+ {"enable-external-lookup", OptionValue::eTypeBoolean, true, true, nullptr,
+ nullptr,
+ "Control the use of external tools or libraries to locate symbol files. "
+ "On macOS, Spotlight is used to locate a matching .dSYM bundle based on "
+ "the UUID of the executable."},
+ {"clang-modules-cache-path", OptionValue::eTypeFileSpec, true, 0, nullptr,
+ nullptr,
+ "The path to the clang modules cache directory (-fmodules-cache-path)."},
+ {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
+
+enum { ePropertyEnableExternalLookup, ePropertyClangModulesCachePath };
+
+} // namespace
+
+ModuleListProperties::ModuleListProperties() {
+ m_collection_sp.reset(new OptionValueProperties(ConstString("symbols")));
+ m_collection_sp->Initialize(g_properties);
+
+ llvm::SmallString<128> path;
+ clang::driver::Driver::getDefaultModuleCachePath(path);
+ SetClangModulesCachePath(path);
+}
+
+bool ModuleListProperties::GetEnableExternalLookup() const {
+ const uint32_t idx = ePropertyEnableExternalLookup;
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(
+ nullptr, idx, g_properties[idx].default_uint_value != 0);
+}
+
+FileSpec ModuleListProperties::GetClangModulesCachePath() const {
+ return m_collection_sp
+ ->GetPropertyAtIndexAsOptionValueFileSpec(nullptr, false,
+ ePropertyClangModulesCachePath)
+ ->GetCurrentValue();
+}
+
+bool ModuleListProperties::SetClangModulesCachePath(llvm::StringRef path) {
+ return m_collection_sp->SetPropertyAtIndexAsString(
+ nullptr, ePropertyClangModulesCachePath, path);
+}
+
+
ModuleList::ModuleList()
: m_modules(), m_modules_mutex(), m_notifier(nullptr) {}
@@ -83,8 +132,8 @@ const ModuleList &ModuleList::operator=(const ModuleList &rhs) {
// in thread A: | in thread B:
// x = y; | y = x;
//
- // This establishes correct(same) lock taking order and thus
- // avoids priority inversion.
+ // This establishes correct(same) lock taking order and thus avoids
+ // priority inversion.
if (uintptr_t(this) > uintptr_t(&rhs)) {
std::lock_guard<std::recursive_mutex> lhs_guard(m_modules_mutex);
std::lock_guard<std::recursive_mutex> rhs_guard(rhs.m_modules_mutex);
@@ -383,27 +432,26 @@ size_t ModuleList::FindCompileUnits(const FileSpec &path, bool append,
return sc_list.GetSize();
}
-size_t ModuleList::FindGlobalVariables(const ConstString &name, bool append,
+size_t ModuleList::FindGlobalVariables(const ConstString &name,
size_t max_matches,
VariableList &variable_list) const {
size_t initial_size = variable_list.GetSize();
std::lock_guard<std::recursive_mutex> guard(m_modules_mutex);
collection::const_iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos) {
- (*pos)->FindGlobalVariables(name, nullptr, append, max_matches,
- variable_list);
+ (*pos)->FindGlobalVariables(name, nullptr, max_matches, variable_list);
}
return variable_list.GetSize() - initial_size;
}
size_t ModuleList::FindGlobalVariables(const RegularExpression &regex,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variable_list) const {
size_t initial_size = variable_list.GetSize();
std::lock_guard<std::recursive_mutex> guard(m_modules_mutex);
collection::const_iterator pos, end = m_modules.end();
for (pos = m_modules.begin(); pos != end; ++pos) {
- (*pos)->FindGlobalVariables(regex, append, max_matches, variable_list);
+ (*pos)->FindGlobalVariables(regex, max_matches, variable_list);
}
return variable_list.GetSize() - initial_size;
}
@@ -496,8 +544,8 @@ ModuleList::FindTypes(const SymbolContext &sc, const ConstString &name,
size_t total_matches = 0;
collection::const_iterator pos, end = m_modules.end();
if (sc.module_sp) {
- // The symbol context "sc" contains a module so we want to search that
- // one first if it is in our list...
+ // The symbol context "sc" contains a module so we want to search that one
+ // first if it is in our list...
for (pos = m_modules.begin(); pos != end; ++pos) {
if (sc.module_sp.get() == (*pos).get()) {
total_matches +=
@@ -514,8 +562,8 @@ ModuleList::FindTypes(const SymbolContext &sc, const ConstString &name,
SymbolContext world_sc;
for (pos = m_modules.begin(); pos != end; ++pos) {
// Search the module if the module is not equal to the one in the symbol
- // context "sc". If "sc" contains a empty module shared pointer, then
- // the comparison will always be true (valid_module_ptr != nullptr).
+ // context "sc". If "sc" contains a empty module shared pointer, then the
+ // comparison will always be true (valid_module_ptr != nullptr).
if (sc.module_sp.get() != (*pos).get())
total_matches +=
(*pos)->FindTypes(world_sc, name, name_is_fully_qualified,
@@ -673,17 +721,32 @@ size_t ModuleList::GetIndexForModule(const Module *module) const {
return LLDB_INVALID_INDEX32;
}
-static ModuleList &GetSharedModuleList() {
- static ModuleList *g_shared_module_list = nullptr;
+namespace {
+struct SharedModuleListInfo {
+ ModuleList module_list;
+ ModuleListProperties module_list_properties;
+};
+}
+static SharedModuleListInfo &GetSharedModuleListInfo()
+{
+ static SharedModuleListInfo *g_shared_module_list_info = nullptr;
static llvm::once_flag g_once_flag;
llvm::call_once(g_once_flag, []() {
// NOTE: Intentionally leak the module list so a program doesn't have to
// cleanup all modules and object files as it exits. This just wastes time
// doing a bunch of cleanup that isn't required.
- if (g_shared_module_list == nullptr)
- g_shared_module_list = new ModuleList(); // <--- Intentional leak!!!
+ if (g_shared_module_list_info == nullptr)
+ g_shared_module_list_info = new SharedModuleListInfo();
});
- return *g_shared_module_list;
+ return *g_shared_module_list_info;
+}
+
+static ModuleList &GetSharedModuleList() {
+ return GetSharedModuleListInfo().module_list;
+}
+
+ModuleListProperties &ModuleList::GetGlobalModuleListProperties() {
+ return GetSharedModuleListInfo().module_list_properties;
}
bool ModuleList::ModuleIsInCache(const Module *module_ptr) {
@@ -727,8 +790,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
const ArchSpec &arch = module_spec.GetArchitecture();
// Make sure no one else can try and get or create a module while this
- // function is actively working on it by doing an extra lock on the
- // global mutex list.
+ // function is actively working on it by doing an extra lock on the global
+ // mutex list.
if (!always_create) {
ModuleList matching_module_list;
const size_t num_matching_modules =
@@ -751,8 +814,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
shared_module_list.Remove(module_sp);
module_sp.reset();
} else {
- // The module matches and the module was not modified from
- // when it was last loaded.
+ // The module matches and the module was not modified from when it
+ // was last loaded.
return error;
}
}
@@ -763,12 +826,12 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
return error;
module_sp.reset(new Module(module_spec));
- // Make sure there are a module and an object file since we can specify
- // a valid file path with an architecture that might not be in that file.
- // By getting the object file we can guarantee that the architecture matches
+ // Make sure there are a module and an object file since we can specify a
+ // valid file path with an architecture that might not be in that file. By
+ // getting the object file we can guarantee that the architecture matches
if (module_sp->GetObjectFile()) {
- // If we get in here we got the correct arch, now we just need
- // to verify the UUID if one was given
+ // If we get in here we got the correct arch, now we just need to verify
+ // the UUID if one was given
if (uuid_ptr && *uuid_ptr != module_sp->GetUUID()) {
module_sp.reset();
} else {
@@ -807,8 +870,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
resolved_module_spec.GetFileSpec() = search_path_spec;
module_sp.reset(new Module(resolved_module_spec));
if (module_sp->GetObjectFile()) {
- // If we get in here we got the correct arch, now we just need
- // to verify the UUID if one was given
+ // If we get in here we got the correct arch, now we just need to
+ // verify the UUID if one was given
if (uuid_ptr && *uuid_ptr != module_sp->GetUUID()) {
module_sp.reset();
} else {
@@ -833,8 +896,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
// we now have to use more extreme measures to try and find the appropriate
// module.
- // Fixup the incoming path in case the path points to a valid file, yet
- // the arch or UUID (if one was passed in) don't match.
+ // Fixup the incoming path in case the path points to a valid file, yet the
+ // arch or UUID (if one was passed in) don't match.
ModuleSpec located_binary_modulespec =
Symbols::LocateExecutableObjectFile(module_spec);
@@ -871,8 +934,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
}
// Make sure no one else can try and get or create a module while this
- // function is actively working on it by doing an extra lock on the
- // global mutex list.
+ // function is actively working on it by doing an extra lock on the global
+ // mutex list.
ModuleSpec platform_module_spec(module_spec);
platform_module_spec.GetFileSpec() =
located_binary_modulespec.GetFileSpec();
@@ -903,8 +966,8 @@ Status ModuleList::GetSharedModule(const ModuleSpec &module_spec,
if (!module_sp) {
module_sp.reset(new Module(platform_module_spec));
- // Make sure there are a module and an object file since we can specify
- // a valid file path with an architecture that might not be in that file.
+ // Make sure there are a module and an object file since we can specify a
+ // valid file path with an architecture that might not be in that file.
// By getting the object file we can guarantee that the architecture
// matches
if (module_sp && module_sp->GetObjectFile()) {
diff --git a/source/Core/Opcode.cpp b/source/Core/Opcode.cpp
index b4e691c1ddcd..d15fdb3b17be 100644
--- a/source/Core/Opcode.cpp
+++ b/source/Core/Opcode.cpp
@@ -52,8 +52,8 @@ int Opcode::Dump(Stream *s, uint32_t min_byte_width) {
break;
}
- // Add spaces to make sure bytes dispay comes out even in case opcodes
- // aren't all the same size
+ // Add spaces to make sure bytes dispay comes out even in case opcodes aren't
+ // all the same size
if (static_cast<uint32_t>(bytes_written) < min_byte_width)
bytes_written = s->Printf("%*s", min_byte_width - bytes_written, "");
return bytes_written;
diff --git a/source/Core/PluginManager.cpp b/source/Core/PluginManager.cpp
index a49fbc3f90fe..55affb6a1030 100644
--- a/source/Core/PluginManager.cpp
+++ b/source/Core/PluginManager.cpp
@@ -17,7 +17,7 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StringList.h" // for StringList
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include "lldb/Host/windows/PosixApi.h" // for PATH_MAX
#endif
@@ -96,8 +96,8 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
Status error;
namespace fs = llvm::sys::fs;
- // If we have a regular file, a symbolic link or unknown file type, try
- // and process the file. We must handle unknown as sometimes the directory
+ // If we have a regular file, a symbolic link or unknown file type, try and
+ // process the file. We must handle unknown as sometimes the directory
// enumeration might be enumerating a file system that doesn't have correct
// file type information.
if (ft == fs::file_type::regular_file || ft == fs::file_type::symlink_file ||
@@ -128,17 +128,14 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
plugin_info.library.getAddressOfSymbol("LLDBPluginTerminate"));
} else {
// The initialize function returned FALSE which means the plug-in
- // might not be
- // compatible, or might be too new or too old, or might not want to
- // run on this
- // machine. Set it to a default-constructed instance to invalidate
- // it.
+ // might not be compatible, or might be too new or too old, or might
+ // not want to run on this machine. Set it to a default-constructed
+ // instance to invalidate it.
plugin_info = PluginInfo();
}
- // Regardless of success or failure, cache the plug-in load
- // in our plug-in info so we don't try to load it again and
- // again.
+ // Regardless of success or failure, cache the plug-in load in our
+ // plug-in info so we don't try to load it again and again.
SetPluginInfo(plugin_file_spec, plugin_info);
return FileSpec::eEnumerateDirectoryResultNext;
@@ -148,9 +145,9 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
if (ft == fs::file_type::directory_file ||
ft == fs::file_type::symlink_file || ft == fs::file_type::type_unknown) {
- // Try and recurse into anything that a directory or symbolic link.
- // We must also do this for unknown as sometimes the directory enumeration
- // might be enumerating a file system that doesn't have correct file type
+ // Try and recurse into anything that a directory or symbolic link. We must
+ // also do this for unknown as sometimes the directory enumeration might be
+ // enumerating a file system that doesn't have correct file type
// information.
return FileSpec::eEnumerateDirectoryResultEnter;
}
@@ -160,19 +157,18 @@ LoadPluginCallback(void *baton, llvm::sys::fs::file_type ft,
void PluginManager::Initialize() {
#if 1
- FileSpec dir_spec;
const bool find_directories = true;
const bool find_files = true;
const bool find_other = true;
char dir_path[PATH_MAX];
- if (HostInfo::GetLLDBPath(ePathTypeLLDBSystemPlugins, dir_spec)) {
+ if (FileSpec dir_spec = HostInfo::GetSystemPluginDir()) {
if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSpec::EnumerateDirectory(dir_path, find_directories, find_files,
find_other, LoadPluginCallback, nullptr);
}
}
- if (HostInfo::GetLLDBPath(ePathTypeLLDBUserPlugins, dir_spec)) {
+ if (FileSpec dir_spec = HostInfo::GetUserPluginDir()) {
if (dir_spec.Exists() && dir_spec.GetPath(dir_path, sizeof(dir_path))) {
FileSpec::EnumerateDirectory(dir_path, find_directories, find_files,
find_other, LoadPluginCallback, nullptr);
@@ -187,8 +183,8 @@ void PluginManager::Terminate() {
PluginTerminateMap::const_iterator pos, end = plugin_map.end();
for (pos = plugin_map.begin(); pos != end; ++pos) {
- // Call the plug-in "void LLDBPluginTerminate (void)" function if there
- // is one (if the symbol was not nullptr).
+ // Call the plug-in "void LLDBPluginTerminate (void)" function if there is
+ // one (if the symbol was not nullptr).
if (pos->second.library.isValid()) {
if (pos->second.plugin_term_callback)
pos->second.plugin_term_callback();
@@ -2397,8 +2393,8 @@ static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPlugins(
}
// This is deprecated way to register plugin specific settings. e.g.
-// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME"
-// and Platform generic settings would be under "platform.SETTINGNAME".
+// "<plugin_type_name>.plugin.<plugin_type_desc>.SETTINGNAME" and Platform
+// generic settings would be under "platform.SETTINGNAME".
static lldb::OptionValuePropertiesSP GetDebuggerPropertyForPluginsOldStyle(
Debugger &debugger, const ConstString &plugin_type_name,
const ConstString &plugin_type_desc, bool can_create) {
diff --git a/source/Core/RegisterValue.cpp b/source/Core/RegisterValue.cpp
index f64c14019cc6..4f908609dde9 100644
--- a/source/Core/RegisterValue.cpp
+++ b/source/Core/RegisterValue.cpp
@@ -9,9 +9,8 @@
#include "lldb/Core/RegisterValue.h"
-#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/Core/Scalar.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/Stream.h"
@@ -34,67 +33,6 @@
using namespace lldb;
using namespace lldb_private;
-bool RegisterValue::Dump(Stream *s, const RegisterInfo *reg_info,
- bool prefix_with_name, bool prefix_with_alt_name,
- Format format,
- uint32_t reg_name_right_align_at) const {
- DataExtractor data;
- if (GetData(data)) {
- bool name_printed = false;
- // For simplicity, alignment of the register name printing applies only
- // in the most common case where:
- //
- // prefix_with_name^prefix_with_alt_name is true
- //
- StreamString format_string;
- if (reg_name_right_align_at && (prefix_with_name ^ prefix_with_alt_name))
- format_string.Printf("%%%us", reg_name_right_align_at);
- else
- format_string.Printf("%%s");
- std::string fmt = format_string.GetString();
- if (prefix_with_name) {
- if (reg_info->name) {
- s->Printf(fmt.c_str(), reg_info->name);
- name_printed = true;
- } else if (reg_info->alt_name) {
- s->Printf(fmt.c_str(), reg_info->alt_name);
- prefix_with_alt_name = false;
- name_printed = true;
- }
- }
- if (prefix_with_alt_name) {
- if (name_printed)
- s->PutChar('/');
- if (reg_info->alt_name) {
- s->Printf(fmt.c_str(), reg_info->alt_name);
- name_printed = true;
- } else if (!name_printed) {
- // No alternate name but we were asked to display a name, so show the
- // main name
- s->Printf(fmt.c_str(), reg_info->name);
- name_printed = true;
- }
- }
- if (name_printed)
- s->PutCString(" = ");
-
- if (format == eFormatDefault)
- format = reg_info->format;
-
- DumpDataExtractor(data, s,
- 0, // Offset in "data"
- format, // Format to use when dumping
- reg_info->byte_size, // item_byte_size
- 1, // item_count
- UINT32_MAX, // num_per_line
- LLDB_INVALID_ADDRESS, // base_addr
- 0, // item_bit_size
- 0); // item_bit_offset
- return true;
- }
- return false;
-}
-
bool RegisterValue::GetData(DataExtractor &data) const {
return data.SetData(GetBytes(), GetByteSize(), GetByteOrder()) > 0;
}
@@ -375,9 +313,9 @@ static bool ParseVectorEncoding(const RegisterInfo *reg_info,
std::vector<uint8_t> bytes;
unsigned byte = 0;
- // Using radix auto-sensing by passing 0 as the radix.
- // Keep on processing the vector elements as long as the parsing succeeds and
- // the vector size is < byte_size.
+ // Using radix auto-sensing by passing 0 as the radix. Keep on processing the
+ // vector elements as long as the parsing succeeds and the vector size is <
+ // byte_size.
while (!car.getAsInteger(0, byte) && bytes.size() < byte_size) {
bytes.push_back(byte);
std::tie(car, cdr) = cdr.split(Sep);
@@ -812,10 +750,9 @@ bool RegisterValue::SetUInt(uint64_t uint, uint32_t byte_size) {
void RegisterValue::SetBytes(const void *bytes, size_t length,
lldb::ByteOrder byte_order) {
- // If this assertion fires off we need to increase the size of
- // buffer.bytes, or make it something that is allocated on
- // the heap. Since the data buffer is in a union, we can't make it
- // a collection class like SmallVector...
+ // If this assertion fires off we need to increase the size of buffer.bytes,
+ // or make it something that is allocated on the heap. Since the data buffer
+ // is in a union, we can't make it a collection class like SmallVector...
if (bytes && length > 0) {
assert(length <= sizeof(buffer.bytes) &&
"Storing too many bytes in a RegisterValue.");
diff --git a/source/Core/Scalar.cpp b/source/Core/Scalar.cpp
index 630083bae930..6a7186969ef2 100644
--- a/source/Core/Scalar.cpp
+++ b/source/Core/Scalar.cpp
@@ -9,7 +9,6 @@
#include "lldb/Core/Scalar.h"
-#include "lldb/Host/StringConvert.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/Status.h"
@@ -25,8 +24,8 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Promote to max type currently follows the ANSI C rule for type
-// promotion in expressions.
+// Promote to max type currently follows the ANSI C rule for type promotion in
+// expressions.
//----------------------------------------------------------------------
static Scalar::Type PromoteToMaxType(
const Scalar &lhs, // The const left hand side object
@@ -41,10 +40,9 @@ static Scalar::Type PromoteToMaxType(
// lhs/rhs will get promoted)
) {
Scalar result;
- // Initialize the promoted values for both the right and left hand side values
- // to be the objects themselves. If no promotion is needed (both right and
- // left
- // have the same type), then the temp_value will not get used.
+ // Initialize the promoted values for both the right and left hand side
+ // values to be the objects themselves. If no promotion is needed (both right
+ // and left have the same type), then the temp_value will not get used.
promoted_lhs_ptr = &lhs;
promoted_rhs_ptr = &rhs;
// Extract the types of both the right and left hand side values
@@ -128,14 +126,13 @@ bool Scalar::GetData(DataExtractor &data, size_t limit_byte_size) const {
if (limit_byte_size < byte_size) {
if (endian::InlHostByteOrder() == eByteOrderLittle) {
- // On little endian systems if we want fewer bytes from the
- // current type we just specify fewer bytes since the LSByte
- // is first...
+ // On little endian systems if we want fewer bytes from the current
+ // type we just specify fewer bytes since the LSByte is first...
byte_size = limit_byte_size;
} else if (endian::InlHostByteOrder() == eByteOrderBig) {
- // On big endian systems if we want fewer bytes from the
- // current type have to advance our initial byte pointer and
- // trim down the number of bytes since the MSByte is first
+ // On big endian systems if we want fewer bytes from the current type
+ // have to advance our initial byte pointer and trim down the number of
+ // bytes since the MSByte is first
bytes += byte_size - limit_byte_size;
byte_size = limit_byte_size;
}
@@ -164,9 +161,8 @@ const void *Scalar::GetBytes() const {
case e_slonglong:
case e_ulonglong:
bytes = reinterpret_cast<const uint8_t *>(m_integer.getRawData());
- // getRawData always returns a pointer to an uint64_t. If we have a smaller
- // type,
- // we need to update the pointer on big-endian systems.
+ // getRawData always returns a pointer to an uint64_t. If we have a
+ // smaller type, we need to update the pointer on big-endian systems.
if (endian::InlHostByteOrder() == eByteOrderBig) {
size_t byte_size = m_integer.getBitWidth() / 8;
if (byte_size < 8)
@@ -491,20 +487,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -551,20 +551,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -607,20 +611,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -659,20 +667,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -707,20 +719,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -751,20 +767,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -795,20 +815,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -835,20 +859,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -875,20 +903,24 @@ bool Scalar::Promote(Scalar::Type type) {
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, true,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -911,20 +943,24 @@ bool Scalar::Promote(Scalar::Type type) {
success = true;
break;
case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEsingle());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
+ m_float = llvm::APFloat(llvm::APFloat::IEEEdouble());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
+ m_float = llvm::APFloat(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended());
+ m_float.convertFromAPInt(m_integer, false,
+ llvm::APFloat::rmNearestTiesToEven);
success = true;
break;
}
@@ -948,20 +984,19 @@ bool Scalar::Promote(Scalar::Type type) {
success = true;
break;
case e_double:
- m_float = llvm::APFloat((float_t)m_float.convertToFloat());
+ m_float = llvm::APFloat((double_t)m_float.convertToFloat());
success = true;
break;
- case e_long_double:
- if (m_ieee_quad)
- m_float =
- llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
- m_float.bitcastToAPInt());
+ case e_long_double: {
+ bool ignore;
+ m_float.convert(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended(),
+ llvm::APFloat::rmNearestTiesToEven, &ignore);
success = true;
break;
}
+ }
break;
case e_double:
@@ -982,16 +1017,15 @@ bool Scalar::Promote(Scalar::Type type) {
case e_double:
success = true;
break;
- case e_long_double:
- if (m_ieee_quad)
- m_float =
- llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
- m_float.bitcastToAPInt());
+ case e_long_double: {
+ bool ignore;
+ m_float.convert(m_ieee_quad ? llvm::APFloat::IEEEquad()
+ : llvm::APFloat::x87DoubleExtended(),
+ llvm::APFloat::rmNearestTiesToEven, &ignore);
success = true;
break;
}
+ }
break;
case e_long_double:
@@ -1088,253 +1122,6 @@ Scalar::Type Scalar::GetValueTypeForFloatWithByteSize(size_t byte_size) {
return e_void;
}
-bool Scalar::Cast(Scalar::Type type) {
- bool success = false;
- switch (m_type) {
- case e_void:
- break;
-
- case e_sint:
- case e_uint:
- case e_slong:
- case e_ulong:
- case e_slonglong:
- case e_ulonglong:
- case e_sint128:
- case e_uint128:
- case e_sint256:
- case e_uint256:
- switch (type) {
- case e_void:
- break;
- case e_sint:
- m_integer = m_integer.sextOrTrunc(sizeof(sint_t) * 8);
- success = true;
- break;
-
- case e_uint:
- m_integer = m_integer.zextOrTrunc(sizeof(sint_t) * 8);
- success = true;
- break;
-
- case e_slong:
- m_integer = m_integer.sextOrTrunc(sizeof(slong_t) * 8);
- success = true;
- break;
-
- case e_ulong:
- m_integer = m_integer.zextOrTrunc(sizeof(slong_t) * 8);
- success = true;
- break;
-
- case e_slonglong:
- m_integer = m_integer.sextOrTrunc(sizeof(slonglong_t) * 8);
- success = true;
- break;
-
- case e_ulonglong:
- m_integer = m_integer.zextOrTrunc(sizeof(slonglong_t) * 8);
- success = true;
- break;
-
- case e_sint128:
- m_integer = m_integer.sextOrTrunc(BITWIDTH_INT128);
- success = true;
- break;
-
- case e_uint128:
- m_integer = m_integer.zextOrTrunc(BITWIDTH_INT128);
- success = true;
- break;
-
- case e_sint256:
- m_integer = m_integer.sextOrTrunc(BITWIDTH_INT256);
- success = true;
- break;
-
- case e_uint256:
- m_integer = m_integer.zextOrTrunc(BITWIDTH_INT256);
- success = true;
- break;
-
- case e_float:
- m_float = llvm::APFloat(m_integer.bitsToFloat());
- success = true;
- break;
-
- case e_double:
- m_float = llvm::APFloat(m_integer.bitsToDouble());
- success = true;
- break;
-
- case e_long_double:
- if (m_ieee_quad)
- m_float = llvm::APFloat(llvm::APFloat::IEEEquad(), m_integer);
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(), m_integer);
- success = true;
- break;
- }
- break;
-
- case e_float:
- switch (type) {
- case e_void:
- break;
- case e_sint:
- case e_uint:
- case e_slong:
- case e_ulong:
- case e_slonglong:
- case e_ulonglong:
- case e_sint128:
- case e_uint128:
- case e_sint256:
- case e_uint256:
- m_integer = m_float.bitcastToAPInt();
- success = true;
- break;
- case e_float:
- m_float = llvm::APFloat(m_float.convertToFloat());
- success = true;
- break;
- case e_double:
- m_float = llvm::APFloat(m_float.convertToFloat());
- success = true;
- break;
- case e_long_double:
- if (m_ieee_quad)
- m_float =
- llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
- m_float.bitcastToAPInt());
- success = true;
- break;
- }
- break;
-
- case e_double:
- switch (type) {
- case e_void:
- break;
- case e_sint:
- case e_uint:
- case e_slong:
- case e_ulong:
- case e_slonglong:
- case e_ulonglong:
- case e_sint128:
- case e_uint128:
- case e_sint256:
- case e_uint256:
- m_integer = m_float.bitcastToAPInt();
- success = true;
- break;
- case e_float:
- m_float = llvm::APFloat(m_float.convertToDouble());
- success = true;
- break;
- case e_double:
- m_float = llvm::APFloat(m_float.convertToDouble());
- success = true;
- break;
- case e_long_double:
- if (m_ieee_quad)
- m_float =
- llvm::APFloat(llvm::APFloat::IEEEquad(), m_float.bitcastToAPInt());
- else
- m_float = llvm::APFloat(llvm::APFloat::x87DoubleExtended(),
- m_float.bitcastToAPInt());
- success = true;
- break;
- }
- break;
-
- case e_long_double:
- switch (type) {
- case e_void:
- break;
- case e_sint:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.sextOrTrunc(sizeof(sint_t) * 8);
- success = true;
- break;
-
- case e_uint:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.zextOrTrunc(sizeof(sint_t) * 8);
- success = true;
- break;
-
- case e_slong:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.sextOrTrunc(sizeof(slong_t) * 8);
- success = true;
- break;
-
- case e_ulong:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.zextOrTrunc(sizeof(slong_t) * 8);
- success = true;
- break;
-
- case e_slonglong:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.sextOrTrunc(sizeof(slonglong_t) * 8);
- success = true;
- break;
-
- case e_ulonglong:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.zextOrTrunc(sizeof(slonglong_t) * 8);
- success = true;
- break;
-
- case e_sint128:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.sextOrTrunc(BITWIDTH_INT128);
- success = true;
- break;
-
- case e_uint128:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.zextOrTrunc(BITWIDTH_INT128);
- success = true;
- break;
-
- case e_sint256:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.sextOrTrunc(BITWIDTH_INT256);
- success = true;
- break;
-
- case e_uint256:
- m_integer = m_float.bitcastToAPInt();
- m_integer = m_integer.zextOrTrunc(BITWIDTH_INT256);
- success = true;
- break;
-
- case e_float:
- m_float = llvm::APFloat(m_float.convertToFloat());
- success = true;
- break;
- case e_double:
- m_float = llvm::APFloat(m_float.convertToFloat());
- success = true;
- break;
- case e_long_double:
- success = true;
- break;
- }
- break;
- }
-
- if (success)
- m_type = type;
- return success;
-}
-
bool Scalar::MakeSigned() {
bool success = false;
@@ -1397,38 +1184,38 @@ bool Scalar::MakeUnsigned() {
case e_void:
break;
case e_sint:
+ m_type = e_uint;
success = true;
break;
case e_uint:
- m_type = e_uint;
success = true;
break;
case e_slong:
+ m_type = e_ulong;
success = true;
break;
case e_ulong:
- m_type = e_ulong;
success = true;
break;
case e_slonglong:
+ m_type = e_ulonglong;
success = true;
break;
case e_ulonglong:
- m_type = e_ulonglong;
success = true;
break;
case e_sint128:
+ m_type = e_uint128;
success = true;
break;
case e_uint128:
- m_type = e_uint128;
success = true;
break;
case e_sint256:
+ m_type = e_uint256;
success = true;
break;
case e_uint256:
- m_type = e_uint256;
success = true;
break;
case e_float:
@@ -1819,7 +1606,7 @@ float Scalar::Float(float fail_value) const {
case e_uint128:
case e_sint256:
case e_uint256:
- return m_integer.bitsToFloat();
+ return llvm::APIntOps::RoundAPIntToFloat(m_integer);
case e_float:
return m_float.convertToFloat();
case e_double:
@@ -1845,7 +1632,7 @@ double Scalar::Double(double fail_value) const {
case e_uint128:
case e_sint256:
case e_uint256:
- return m_integer.bitsToDouble();
+ return llvm::APIntOps::RoundAPIntToDouble(m_integer);
case e_float:
return (double_t)m_float.convertToFloat();
case e_double:
@@ -1871,7 +1658,7 @@ long double Scalar::LongDouble(long double fail_value) const {
case e_uint128:
case e_sint256:
case e_uint256:
- return (long_double_t)m_integer.bitsToDouble();
+ return (long_double_t)llvm::APIntOps::RoundAPIntToDouble(m_integer);
case e_float:
return (long_double_t)m_float.convertToFloat();
case e_double:
@@ -2266,7 +2053,7 @@ const Scalar lldb_private::operator/(const Scalar &lhs, const Scalar &rhs) {
case Scalar::e_float:
case Scalar::e_double:
case Scalar::e_long_double:
- if (b->m_float.isZero()) {
+ if (!b->m_float.isZero()) {
result.m_float = a->m_float / b->m_float;
return result;
}
@@ -2274,8 +2061,7 @@ const Scalar lldb_private::operator/(const Scalar &lhs, const Scalar &rhs) {
}
}
// For division only, the only way it should make it here is if a promotion
- // failed,
- // or if we are trying to do a divide by zero.
+ // failed, or if we are trying to do a divide by zero.
result.m_type = Scalar::e_void;
return result;
}
@@ -2467,17 +2253,15 @@ Status Scalar::SetValueFromCString(const char *value_str, Encoding encoding,
error.SetErrorString("Invalid c-string value string.");
return error;
}
- bool success = false;
switch (encoding) {
case eEncodingInvalid:
error.SetErrorString("Invalid encoding.");
break;
case eEncodingUint:
- if (byte_size <= sizeof(unsigned long long)) {
- uint64_t uval64 =
- StringConvert::ToUInt64(value_str, UINT64_MAX, 0, &success);
- if (!success)
+ if (byte_size <= sizeof(uint64_t)) {
+ uint64_t uval64;
+ if (!llvm::to_integer(value_str, uval64))
error.SetErrorStringWithFormat(
"'%s' is not a valid unsigned integer string value", value_str);
else if (!UIntValueIsValidForSize(uval64, byte_size))
@@ -2513,10 +2297,9 @@ Status Scalar::SetValueFromCString(const char *value_str, Encoding encoding,
break;
case eEncodingSint:
- if (byte_size <= sizeof(long long)) {
- uint64_t sval64 =
- StringConvert::ToSInt64(value_str, INT64_MAX, 0, &success);
- if (!success)
+ if (byte_size <= sizeof(int64_t)) {
+ int64_t sval64;
+ if (!llvm::to_integer(value_str, sval64))
error.SetErrorStringWithFormat(
"'%s' is not a valid signed integer string value", value_str);
else if (!SIntValueIsValidForSize(sval64, byte_size))
diff --git a/source/Core/Section.cpp b/source/Core/Section.cpp
index c9faf9f89157..d9c5d32ee13c 100644
--- a/source/Core/Section.cpp
+++ b/source/Core/Section.cpp
@@ -27,8 +27,8 @@ class DataExtractor;
using namespace lldb;
using namespace lldb_private;
-static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
- switch (sect_type) {
+const char *Section::GetTypeAsCString() const {
+ switch (m_type) {
case eSectionTypeInvalid:
return "invalid";
case eSectionTypeCode:
@@ -89,6 +89,10 @@ static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
return "dwarf-str";
case eSectionTypeDWARFDebugStrOffsets:
return "dwarf-str-offsets";
+ case eSectionTypeDWARFDebugTypes:
+ return "dwarf-types";
+ case eSectionTypeDWARFDebugNames:
+ return "dwarf-names";
case eSectionTypeELFSymbolTable:
return "elf-symbol-table";
case eSectionTypeELFDynamicSymbols:
@@ -117,6 +121,8 @@ static const char *GetSectionTypeAsCString(lldb::SectionType sect_type) {
return "go-symtab";
case eSectionTypeAbsoluteAddress:
return "absolute";
+ case eSectionTypeDWARFGNUDebugAltLink:
+ return "dwarf-gnu-debugaltlink";
case eSectionTypeOther:
return "regular";
}
@@ -175,9 +181,9 @@ Section::~Section() {
addr_t Section::GetFileAddress() const {
SectionSP parent_sp(GetParent());
if (parent_sp) {
- // This section has a parent which means m_file_addr is an offset into
- // the parent section, so the file address for this section is the file
- // address of the parent plus the offset
+ // This section has a parent which means m_file_addr is an offset into the
+ // parent section, so the file address for this section is the file address
+ // of the parent plus the offset
return parent_sp->GetFileAddress() + m_file_addr;
}
// This section has no parent, so m_file_addr is the file base address
@@ -283,8 +289,7 @@ int Section::Compare(const Section &a, const Section &b) {
void Section::Dump(Stream *s, Target *target, uint32_t depth) const {
// s->Printf("%.*p: ", (int)sizeof(void*) * 2, this);
s->Indent();
- s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(),
- GetSectionTypeAsCString(m_type));
+ s->Printf("0x%8.8" PRIx64 " %-16s ", GetID(), GetTypeAsCString());
bool resolved = true;
addr_t addr = LLDB_INVALID_ADDRESS;
@@ -326,10 +331,11 @@ void Section::DumpName(Stream *s) const {
// The top most section prints the module basename
const char *name = NULL;
ModuleSP module_sp(GetModule());
- const FileSpec &file_spec = m_obj_file->GetFileSpec();
- if (m_obj_file)
+ if (m_obj_file) {
+ const FileSpec &file_spec = m_obj_file->GetFileSpec();
name = file_spec.GetFilename().AsCString();
+ }
if ((!name || !name[0]) && module_sp)
name = module_sp->GetFileSpec().GetFilename().AsCString();
if (name && name[0])
@@ -556,10 +562,8 @@ SectionSP SectionList::FindSectionContainingFileAddress(addr_t vm_addr,
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
- // child
- // sections doesn't contain this address as well as obeying the depth
- // limit
- // that was passed in.
+ // child sections doesn't contain this address as well as obeying the
+ // depth limit that was passed in.
if (depth > 0)
sect_sp = sect->GetChildren().FindSectionContainingFileAddress(
vm_addr, depth - 1);
diff --git a/source/Core/SourceManager.cpp b/source/Core/SourceManager.cpp
index b284ff1dbaaa..a6afd64f3054 100644
--- a/source/Core/SourceManager.cpp
+++ b/source/Core/SourceManager.cpp
@@ -109,8 +109,8 @@ static bool should_show_stop_column_with_ansi(DebuggerSP debugger_sp) {
if (!debugger_sp)
return false;
- // We don't use ANSI stop column formatting if the debugger doesn't think
- // it should be using color.
+ // We don't use ANSI stop column formatting if the debugger doesn't think it
+ // should be using color.
if (!debugger_sp->GetUseColor())
return false;
@@ -128,8 +128,8 @@ static bool should_show_stop_column_with_caret(DebuggerSP debugger_sp) {
if (!debugger_sp)
return false;
- // If we're asked to show the first available of ANSI or caret, then
- // we do show the caret when ANSI is not available.
+ // If we're asked to show the first available of ANSI or caret, then we do
+ // show the caret when ANSI is not available.
const auto value = debugger_sp->GetStopShowColumn();
if ((value == eStopShowColumnAnsiOrCaret) && !debugger_sp->GetUseColor())
return true;
@@ -255,9 +255,9 @@ size_t SourceManager::DisplayMoreWithLineNumbers(
if (m_last_line > 0) {
if (reverse) {
- // If this is the first time we've done a reverse, then back up one more
- // time so we end
- // up showing the chunk before the last one we've shown:
+ // If this is the first time we've done a reverse, then back up one
+ // more time so we end up showing the chunk before the last one we've
+ // shown:
if (m_last_line > m_last_count)
m_last_line -= m_last_count;
else
@@ -299,10 +299,9 @@ bool SourceManager::GetDefaultFileAndLine(FileSpec &file_spec, uint32_t &line) {
if (target_sp) {
// If nobody has set the default file and line then try here. If there's
- // no executable, then we
- // will try again later when there is one. Otherwise, if we can't find it
- // we won't look again,
- // somebody will have to set it (for instance when we stop somewhere...)
+ // no executable, then we will try again later when there is one.
+ // Otherwise, if we can't find it we won't look again, somebody will have
+ // to set it (for instance when we stop somewhere...)
Module *executable_ptr = target_sp->GetExecutableModulePointer();
if (executable_ptr) {
SymbolContextList sc_list;
@@ -410,9 +409,7 @@ void SourceManager::File::CommonInitializer(const FileSpec &file_spec,
FileSpec new_file_spec;
// Check target specific source remappings first, then fall back to
// modules objects can have individual path remappings that were
- // detected
- // when the debug info for a module was found.
- // then
+ // detected when the debug info for a module was found. then
if (target->GetSourcePathMap().FindFile(m_file_spec, new_file_spec) ||
target->GetImages().FindSourceFile(m_file_spec, new_file_spec)) {
m_file_spec = new_file_spec;
@@ -538,8 +535,8 @@ size_t SourceManager::File::DisplaySourceLines(uint32_t line, uint32_t column,
if (column && (column < count)) {
auto debugger_sp = m_debugger_wp.lock();
if (should_show_stop_column_with_ansi(debugger_sp) && debugger_sp) {
- // Check if we have any ANSI codes with which to mark this column.
- // If not, no need to do this work.
+ // Check if we have any ANSI codes with which to mark this column. If
+ // not, no need to do this work.
auto ansi_prefix_entry = debugger_sp->GetStopShowColumnAnsiPrefix();
auto ansi_suffix_entry = debugger_sp->GetStopShowColumnAnsiSuffix();
diff --git a/source/Core/Value.cpp b/source/Core/Value.cpp
index d415f1b09eb7..254c9008babb 100644
--- a/source/Core/Value.cpp
+++ b/source/Core/Value.cpp
@@ -365,11 +365,10 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
if (process == NULL || !process->IsAlive()) {
Target *target = exe_ctx->GetTargetPtr();
if (target) {
- // Allow expressions to run and evaluate things when the target
- // has memory sections loaded. This allows you to use "target modules
- // load"
- // to load your executable and any shared libraries, then execute
- // commands where you can look at types in data sections.
+ // Allow expressions to run and evaluate things when the target has
+ // memory sections loaded. This allows you to use "target modules
+ // load" to load your executable and any shared libraries, then
+ // execute commands where you can look at types in data sections.
const SectionLoadList &target_sections = target->GetSectionLoadList();
if (!target_sections.IsEmpty()) {
address = m_value.ULongLong(LLDB_INVALID_ADDRESS);
@@ -406,8 +405,8 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
error.SetErrorString("invalid file address");
} else {
if (module == NULL) {
- // The only thing we can currently lock down to a module so that
- // we can resolve a file address, is a variable.
+ // 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();
if (variable) {
SymbolContext var_sc;
@@ -541,12 +540,11 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
} else if ((address_type == eAddressTypeLoad) ||
(address_type == eAddressTypeFile)) {
if (file_so_addr.IsValid()) {
- // We have a file address that we were able to translate into a
- // section offset address so we might be able to read this from
- // the object files if we don't have a live process. Lets always
- // try and read from the process if we have one though since we
- // want to read the actual value by setting "prefer_file_cache"
- // to false.
+ // We have a file address that we were able to translate into a section
+ // offset address so we might be able to read this from the object
+ // files if we don't have a live process. Lets always try and read from
+ // the process if we have one though since we want to read the actual
+ // value by setting "prefer_file_cache" to false.
const bool prefer_file_cache = false;
if (exe_ctx->GetTargetRef().ReadMemory(file_so_addr, prefer_file_cache,
dst, byte_size,
@@ -555,10 +553,10 @@ Status Value::GetValueAsData(ExecutionContext *exe_ctx, DataExtractor &data,
"read memory from 0x%" PRIx64 " failed", (uint64_t)address);
}
} else {
- // The execution context might have a NULL process, but it
- // might have a valid process in the exe_ctx->target, so use
- // the ExecutionContext::GetProcess accessor to ensure we
- // get the process if there is one.
+ // The execution context might have a NULL process, but it might have a
+ // valid process in the exe_ctx->target, so use the
+ // ExecutionContext::GetProcess accessor to ensure we get the process
+ // if there is one.
Process *process = exe_ctx->GetProcessPtr();
if (process) {
@@ -671,6 +669,25 @@ const char *Value::GetContextTypeAsCString(ContextType context_type) {
return "???";
}
+void Value::ConvertToLoadAddress(Module *module, Target *target) {
+ if (!module || !target || (GetValueType() != eValueTypeFileAddress))
+ return;
+
+ lldb::addr_t file_addr = GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
+ if (file_addr == LLDB_INVALID_ADDRESS)
+ return;
+
+ Address so_addr;
+ if (!module->ResolveFileAddress(file_addr, so_addr))
+ return;
+ lldb::addr_t load_addr = so_addr.GetLoadAddress(target);
+ if (load_addr == LLDB_INVALID_ADDRESS)
+ return;
+
+ SetValueType(Value::eValueTypeLoadAddress);
+ GetScalar() = load_addr;
+}
+
ValueList::ValueList(const ValueList &rhs) { m_values = rhs.m_values; }
const ValueList &ValueList::operator=(const ValueList &rhs) {
diff --git a/source/Core/ValueObject.cpp b/source/Core/ValueObject.cpp
index c09139fe2b09..244ea2936fb4 100644
--- a/source/Core/ValueObject.cpp
+++ b/source/Core/ValueObject.cpp
@@ -19,6 +19,7 @@
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/Core/ValueObjectSyntheticFilter.h"
#include "lldb/DataFormatters/DataVisualization.h"
+#include "lldb/DataFormatters/DumpValueObjectOptions.h" // for DumpValueObj...
#include "lldb/DataFormatters/FormatManager.h" // for FormatManager
#include "lldb/DataFormatters/StringPrinter.h"
#include "lldb/DataFormatters/TypeFormat.h" // for TypeFormatImpl_F...
@@ -146,16 +147,15 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {
if (update_format)
did_change_formats = UpdateFormatsIfNeeded();
- // If this is a constant value, then our success is predicated on whether
- // we have an error or not
+ // If this is a constant value, then our success is predicated on whether we
+ // have an error or not
if (GetIsConstant()) {
// if you are constant, things might still have changed behind your back
// (e.g. you are a frozen object and things have changed deeper than you
- // cared to freeze-dry yourself)
- // in this case, your value has not changed, but "computed" entries might
- // have, so you might now have
- // a different summary, or a different object description. clear these so we
- // will recompute them
+ // cared to freeze-dry yourself) in this case, your value has not changed,
+ // but "computed" entries might have, so you might now have a different
+ // summary, or a different object description. clear these so we will
+ // recompute them
if (update_format && !did_change_formats)
ClearUserVisibleData(eClearUserVisibleDataItemsSummary |
eClearUserVisibleDataItemsDescription);
@@ -167,8 +167,8 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {
if (NeedsUpdating()) {
m_update_point.SetUpdated();
- // Save the old value using swap to avoid a string copy which
- // also will clear our m_value_str
+ // Save the old value using swap to avoid a string copy which also will
+ // clear our m_value_str
if (m_value_str.empty()) {
m_old_value_valid = false;
} else {
@@ -215,8 +215,8 @@ bool ValueObject::UpdateValueIfNeeded(bool update_format) {
if (first_update)
SetValueDidChange(false);
else if (!m_value_did_change && success == false) {
- // The value wasn't gotten successfully, so we mark this
- // as changed if the value used to be valid and now isn't
+ // The value wasn't gotten successfully, so we mark this as changed if
+ // the value used to be valid and now isn't
SetValueDidChange(value_was_valid);
} else if (need_compare_checksums) {
SetValueDidChange(memcmp(&old_checksum[0], &m_value_checksum[0],
@@ -261,8 +261,7 @@ bool ValueObject::UpdateFormatsIfNeeded() {
void ValueObject::SetNeedsUpdate() {
m_update_point.SetNeedsUpdate();
// We have to clear the value string here so ConstResult children will notice
- // if their values are
- // changed by hand (i.e. with SetValueAsCString).
+ // if their values are changed by hand (i.e. with SetValueAsCString).
ClearUserVisibleData(eClearUserVisibleDataItemsValue);
}
@@ -556,9 +555,9 @@ size_t ValueObject::GetIndexOfChildWithName(const ConstString &name) {
ValueObjectSP ValueObject::GetChildMemberWithName(const ConstString &name,
bool can_create) {
- // when getting a child by name, it could be buried inside some base
- // classes (which really aren't part of the expression path), so we
- // need a vector of indexes that can get us down to the correct child
+ // when getting a child by name, it could be buried inside some base classes
+ // (which really aren't part of the expression path), so we need a vector of
+ // indexes that can get us down to the correct child
ValueObjectSP child_sp;
// We may need to update our value if we are dynamic
@@ -682,8 +681,8 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl *summary_ptr,
const TypeSummaryOptions &options) {
destination.clear();
- // ideally we would like to bail out if passing NULL, but if we do so
- // we end up not providing the summary for function pointers anymore
+ // ideally we would like to bail out if passing NULL, but if we do so we end
+ // up not providing the summary for function pointers anymore
if (/*summary_ptr == NULL ||*/ m_is_getting_summary)
return false;
@@ -695,9 +694,8 @@ bool ValueObject::GetSummaryAsCString(TypeSummaryImpl *summary_ptr,
actual_options.SetLanguage(GetPreferredDisplayLanguage());
// this is a hot path in code and we prefer to avoid setting this string all
- // too often also clearing out other
- // information that we might care to see in a crash log. might be useful in
- // very specific situations though.
+ // too often also clearing out other information that we might care to see in
+ // a crash log. might be useful in very specific situations though.
/*Host::SetCrashDescriptionWithFormat("Trying to fetch a summary for %s %s.
Summary provider's description is %s",
GetTypeName().GetCString(),
@@ -925,7 +923,8 @@ bool ValueObject::SetData(DataExtractor &data, Status &error) {
break;
}
- // If we have reached this point, then we have successfully changed the value.
+ // If we have reached this point, then we have successfully changed the
+ // value.
SetNeedsUpdate();
return true;
}
@@ -1010,9 +1009,9 @@ ValueObject::ReadPointedString(lldb::DataBufferSP &buffer_sp, Status &error,
DataExtractor data;
if (cstr_len > 0 && honor_array) {
// I am using GetPointeeData() here to abstract the fact that some
- // ValueObjects are actually frozen pointers in the host
- // but the pointed-to data lives in the debuggee, and GetPointeeData()
- // automatically takes care of this
+ // ValueObjects are actually frozen pointers in the host but the pointed-
+ // to data lives in the debuggee, and GetPointeeData() automatically
+ // takes care of this
GetPointeeData(data, 0, cstr_len);
if ((bytes_read = data.GetByteSize()) > 0) {
@@ -1031,9 +1030,9 @@ ValueObject::ReadPointedString(lldb::DataBufferSP &buffer_sp, Status &error,
int cstr_len_displayed = -1;
bool capped_cstr = false;
// I am using GetPointeeData() here to abstract the fact that some
- // ValueObjects are actually frozen pointers in the host
- // but the pointed-to data lives in the debuggee, and GetPointeeData()
- // automatically takes care of this
+ // ValueObjects are actually frozen pointers in the host but the pointed-
+ // to data lives in the debuggee, and GetPointeeData() automatically
+ // takes care of this
while ((bytes_read = GetPointeeData(data, offset, k_max_buf_size)) > 0) {
total_bytes_read += bytes_read;
const char *cstr = data.PeekCStr(0);
@@ -1175,8 +1174,8 @@ const char *ValueObject::GetValueAsCString() {
format_sp.reset(new TypeFormatImpl_Format(my_format));
if (GetValueAsCString(*format_sp.get(), m_value_str)) {
if (!m_value_did_change && m_old_value_valid) {
- // The value was gotten successfully, so we consider the
- // value as changed if the value string differs
+ // The value was gotten successfully, so we consider the value as
+ // changed if the value string differs
SetValueDidChange(m_old_value_str != m_value_str);
}
}
@@ -1187,8 +1186,8 @@ const char *ValueObject::GetValueAsCString() {
return m_value_str.c_str();
}
-// if > 8bytes, 0 is returned. this method should mostly be used
-// to read address values out of pointers
+// if > 8bytes, 0 is returned. this method should mostly be used to read
+// address values out of pointers
uint64_t ValueObject::GetValueAsUnsigned(uint64_t fail_value, bool *success) {
// If our byte size is zero this is an aggregate type that has children
if (CanProvideValue()) {
@@ -1224,10 +1223,9 @@ int64_t ValueObject::GetValueAsSigned(int64_t fail_value, bool *success) {
}
// if any more "special cases" are added to
-// ValueObject::DumpPrintableRepresentation() please keep
-// this call up to date by returning true for your new special cases. We will
-// eventually move
-// to checking this call result before trying to display special cases
+// ValueObject::DumpPrintableRepresentation() please keep this call up to date
+// by returning true for your new special cases. We will eventually move to
+// checking this call result before trying to display special cases
bool ValueObject::HasSpecialPrintableRepresentation(
ValueObjectRepresentationStyle val_obj_display, Format custom_format) {
Flags flags(GetTypeInfo());
@@ -1276,8 +1274,7 @@ bool ValueObject::DumpPrintableRepresentation(
if (flags.AnySet(eTypeIsArray | eTypeIsPointer) &&
val_obj_display == ValueObject::eValueObjectRepresentationStyleValue) {
// when being asked to get a printable display an array or pointer type
- // directly,
- // try to "do the right thing"
+ // directly, try to "do the right thing"
if (IsCStringContainer(true) &&
(custom_format == eFormatCString ||
@@ -1309,8 +1306,8 @@ bool ValueObject::DumpPrintableRepresentation(
if (custom_format == eFormatEnum)
return false;
- // this only works for arrays, because I have no way to know when
- // the pointed memory ends, and no special \0 end of data marker
+ // this only works for arrays, because I have no way to know when the
+ // pointed memory ends, and no special \0 end of data marker
if (flags.Test(eTypeIsArray)) {
if ((custom_format == eFormatBytes) ||
(custom_format == eFormatBytesWithASCII)) {
@@ -1406,8 +1403,8 @@ bool ValueObject::DumpPrintableRepresentation(
llvm::StringRef str;
// this is a local stream that we are using to ensure that the data pointed
- // to by cstr survives long enough for us to copy it to its destination - it
- // is necessary to have this temporary storage area for cases where our
+ // to by cstr survives long enough for us to copy it to its destination -
+ // it is necessary to have this temporary storage area for cases where our
// desired output is not backed by some other longer-term storage
StreamString strm;
@@ -1485,9 +1482,9 @@ bool ValueObject::DumpPrintableRepresentation(
s.PutCString("<no printable representation>");
}
- // we should only return false here if we could not do *anything*
- // even if we have an error message as output, that's a success
- // from our callers' perspective, so return true
+ // we should only return false here if we could not do *anything* even if
+ // we have an error message as output, that's a success from our callers'
+ // perspective, so return true
var_success = true;
if (custom_format != eFormatInvalid)
@@ -1590,9 +1587,8 @@ bool ValueObject::SetValueFromCString(const char *value_str, Status &error) {
switch (value_type) {
case Value::eValueTypeLoadAddress: {
// If it is a load address, then the scalar value is the storage
- // location
- // of the data, and we have to shove this value down to that load
- // location.
+ // location of the data, and we have to shove this value down to that
+ // load location.
ExecutionContext exe_ctx(GetExecutionContextRef());
Process *process = exe_ctx.GetProcessPtr();
if (process) {
@@ -1639,7 +1635,8 @@ bool ValueObject::SetValueFromCString(const char *value_str, Status &error) {
return false;
}
- // If we have reached this point, then we have successfully changed the value.
+ // If we have reached this point, then we have successfully changed the
+ // value.
SetNeedsUpdate();
return true;
}
@@ -1734,16 +1731,14 @@ bool ValueObject::IsUninitializedReference() {
return false;
}
-// This allows you to create an array member using and index
-// that doesn't not fall in the normal bounds of the array.
-// Many times structure can be defined as:
-// struct Collection
-// {
+// This allows you to create an array member using and index that doesn't not
+// fall in the normal bounds of the array. Many times structure can be defined
+// as: struct Collection {
// uint32_t item_count;
// Item item_array[0];
// };
-// The size of the "item_array" is 1, but many times in practice
-// there are more items in "item_array".
+// The size of the "item_array" is 1, but many times in practice there are more
+// items in "item_array".
ValueObjectSP ValueObject::GetSyntheticArrayMember(size_t index,
bool can_create) {
@@ -1752,13 +1747,13 @@ ValueObjectSP ValueObject::GetSyntheticArrayMember(size_t index,
char index_str[64];
snprintf(index_str, sizeof(index_str), "[%" PRIu64 "]", (uint64_t)index);
ConstString index_const_str(index_str);
- // Check if we have already created a synthetic array member in this
- // valid object. If we have we will re-use it.
+ // Check if we have already created a synthetic array member in this valid
+ // object. If we have we will re-use it.
synthetic_child_sp = GetSyntheticChild(index_const_str);
if (!synthetic_child_sp) {
ValueObject *synthetic_child;
- // We haven't made a synthetic array member for INDEX yet, so
- // lets make one and cache it for any future reference.
+ // We haven't made a synthetic array member for INDEX yet, so lets make
+ // one and cache it for any future reference.
synthetic_child = CreateChildAtIndex(0, true, index);
// Cache the value if we got one back...
@@ -1780,8 +1775,8 @@ ValueObjectSP ValueObject::GetSyntheticBitFieldChild(uint32_t from, uint32_t to,
char index_str[64];
snprintf(index_str, sizeof(index_str), "[%i-%i]", from, to);
ConstString index_const_str(index_str);
- // Check if we have already created a synthetic array member in this
- // valid object. If we have we will re-use it.
+ // Check if we have already created a synthetic array member in this valid
+ // object. If we have we will re-use it.
synthetic_child_sp = GetSyntheticChild(index_const_str);
if (!synthetic_child_sp) {
uint32_t bit_field_size = to - from + 1;
@@ -1789,8 +1784,8 @@ ValueObjectSP ValueObject::GetSyntheticBitFieldChild(uint32_t from, uint32_t to,
if (GetDataExtractor().GetByteOrder() == eByteOrderBig)
bit_field_offset =
GetByteSize() * 8 - bit_field_size - bit_field_offset;
- // We haven't made a synthetic array member for INDEX yet, so
- // lets make one and cache it for any future reference.
+ // We haven't made a synthetic array member for INDEX yet, so lets make
+ // one and cache it for any future reference.
ValueObjectChild *synthetic_child = new ValueObjectChild(
*this, GetCompilerType(), index_const_str, GetByteSize(), 0,
bit_field_size, bit_field_offset, false, false, eAddressTypeInvalid,
@@ -1820,8 +1815,8 @@ ValueObjectSP ValueObject::GetSyntheticChildAtOffset(
name_const_str.SetCString(name_str);
}
- // Check if we have already created a synthetic array member in this
- // valid object. If we have we will re-use it.
+ // Check if we have already created a synthetic array member in this valid
+ // object. If we have we will re-use it.
synthetic_child_sp = GetSyntheticChild(name_const_str);
if (synthetic_child_sp.get())
@@ -1858,8 +1853,8 @@ ValueObjectSP ValueObject::GetSyntheticBase(uint32_t offset,
name_const_str.SetCString(name_str);
}
- // Check if we have already created a synthetic array member in this
- // valid object. If we have we will re-use it.
+ // Check if we have already created a synthetic array member in this valid
+ // object. If we have we will re-use it.
synthetic_child_sp = GetSyntheticChild(name_const_str);
if (synthetic_child_sp.get())
@@ -1884,11 +1879,10 @@ ValueObjectSP ValueObject::GetSyntheticBase(uint32_t offset,
return synthetic_child_sp;
}
-// your expression path needs to have a leading . or ->
-// (unless it somehow "looks like" an array, in which case it has
-// a leading [ symbol). while the [ is meaningful and should be shown
-// to the user, . and -> are just parser design, but by no means
-// added information for the user.. strip them off
+// your expression path needs to have a leading . or -> (unless it somehow
+// "looks like" an array, in which case it has a leading [ symbol). while the [
+// is meaningful and should be shown to the user, . and -> are just parser
+// design, but by no means added information for the user.. strip them off
static const char *SkipLeadingExpressionPathSeparators(const char *expression) {
if (!expression || !expression[0])
return expression;
@@ -1904,12 +1898,12 @@ ValueObject::GetSyntheticExpressionPathChild(const char *expression,
bool can_create) {
ValueObjectSP synthetic_child_sp;
ConstString name_const_string(expression);
- // Check if we have already created a synthetic array member in this
- // valid object. If we have we will re-use it.
+ // Check if we have already created a synthetic array member in this valid
+ // object. If we have we will re-use it.
synthetic_child_sp = GetSyntheticChild(name_const_string);
if (!synthetic_child_sp) {
- // We haven't made a synthetic array member for expression yet, so
- // lets make one and cache it for any future reference.
+ // 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,
GetValueForExpressionPathOptions().SetSyntheticChildrenTraversal(
@@ -2055,10 +2049,9 @@ bool ValueObject::IsBaseClass(uint32_t &depth) {
void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
GetExpressionPathFormat epformat) {
// synthetic children do not actually "exist" as part of the hierarchy, and
- // sometimes they are consed up in ways
- // that don't make sense from an underlying language/API standpoint. So, use a
- // special code path here to return
- // something that can hopefully be used in expression
+ // sometimes they are consed up in ways that don't make sense from an
+ // underlying language/API standpoint. So, use a special code path here to
+ // return something that can hopefully be used in expression
if (m_is_synthetic_children_generated) {
UpdateValueIfNeeded();
@@ -2092,11 +2085,10 @@ void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
if (is_deref_of_parent &&
epformat == eGetExpressionPathFormatDereferencePointers) {
// this is the original format of GetExpressionPath() producing code like
- // *(a_ptr).memberName, which is entirely
- // fine, until you put this into
+ // *(a_ptr).memberName, which is entirely fine, until you put this into
// StackFrame::GetValueForVariableExpressionPath() which prefers to see
- // a_ptr->memberName.
- // the eHonorPointers mode is meant to produce strings in this latter format
+ // a_ptr->memberName. the eHonorPointers mode is meant to produce strings
+ // in this latter format
s.PutCString("*(");
}
@@ -2105,9 +2097,9 @@ void ValueObject::GetExpressionPath(Stream &s, bool qualify_cxx_base_classes,
if (parent)
parent->GetExpressionPath(s, qualify_cxx_base_classes, epformat);
- // if we are a deref_of_parent just because we are synthetic array
- // members made up to allow ptr[%d] syntax to work in variable
- // printing, then add our name ([%d]) to the expression path
+ // if we are a deref_of_parent just because we are synthetic array members
+ // made up to allow ptr[%d] syntax to work in variable printing, then add our
+ // name ([%d]) to the expression path
if (m_is_array_item_for_pointer &&
epformat == eGetExpressionPathFormatHonorPointers)
s.PutCString(m_name.AsCString());
@@ -2355,8 +2347,8 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
}
// if we are here and options.m_no_synthetic_children is true,
- // child_valobj_sp is going to be a NULL SP,
- // so we hit the "else" branch, and return an error
+ // child_valobj_sp is going to be a NULL SP, so we hit the "else"
+ // branch, and return an error
if (child_valobj_sp.get()) // if it worked, just return
{
*reason_to_stop =
@@ -2424,8 +2416,8 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
}
// if we are here and options.m_no_synthetic_children is true,
- // child_valobj_sp is going to be a NULL SP,
- // so we hit the "else" branch, and return an error
+ // child_valobj_sp is going to be a NULL SP, so we hit the "else"
+ // branch, and return an error
if (child_valobj_sp.get()) // if it worked, move on
{
root = child_valobj_sp;
@@ -2506,8 +2498,8 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
assert(!bracket_expr.empty());
if (!bracket_expr.contains('-')) {
- // if no separator, this is of the form [N]. Note that this cannot
- // be an unbounded range of the form [], because that case was handled
+ // if no separator, this is of the form [N]. Note that this cannot be
+ // an unbounded range of the form [], because that case was handled
// above with an unconditional return.
unsigned long index = 0;
if (bracket_expr.getAsInteger(0, index)) {
@@ -2631,8 +2623,8 @@ ValueObjectSP ValueObject::GetValueForExpressionPath_Impl(
*final_result = ValueObject::eExpressionPathEndResultTypeInvalid;
return nullptr;
}
- // if we are here, then root itself is a synthetic VO.. should be good
- // to go
+ // if we are here, then root itself is a synthetic VO.. should be
+ // good to go
if (!root) {
*reason_to_stop =
@@ -3031,20 +3023,17 @@ ValueObject::EvaluationPoint::EvaluationPoint(
ValueObject::EvaluationPoint::~EvaluationPoint() {}
// This function checks the EvaluationPoint against the current process state.
-// If the current
-// state matches the evaluation point, or the evaluation point is already
-// invalid, then we return
-// false, meaning "no change". If the current state is different, we update our
-// state, and return
-// true meaning "yes, change". If we did see a change, we also set
-// m_needs_update to true, so
-// future calls to NeedsUpdate will return true.
-// exe_scope will be set to the current execution context scope.
+// If the current state matches the evaluation point, or the evaluation point
+// is already invalid, then we return false, meaning "no change". If the
+// current state is different, we update our state, and return true meaning
+// "yes, change". If we did see a change, we also set m_needs_update to true,
+// so future calls to NeedsUpdate will return true. exe_scope will be set to
+// the current execution context scope.
bool ValueObject::EvaluationPoint::SyncWithProcessState(
bool accept_invalid_exe_ctx) {
- // Start with the target, if it is NULL, then we're obviously not going to get
- // any further:
+ // Start with the target, if it is NULL, then we're obviously not going to
+ // get any further:
const bool thread_and_frame_only_if_stopped = true;
ExecutionContext exe_ctx(
m_exe_ctx_ref.Lock(thread_and_frame_only_if_stopped));
@@ -3061,8 +3050,8 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState(
ProcessModID current_mod_id = process->GetModID();
// If the current stop id is 0, either we haven't run yet, or the process
- // state has been cleared.
- // In either case, we aren't going to be able to sync with the process state.
+ // state has been cleared. In either case, we aren't going to be able to sync
+ // with the process state.
if (current_mod_id.GetStopID() == 0)
return false;
@@ -3070,8 +3059,8 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState(
const bool was_valid = m_mod_id.IsValid();
if (was_valid) {
if (m_mod_id == current_mod_id) {
- // Everything is already up to date in this object, no need to
- // update the execution context scope.
+ // Everything is already up to date in this object, no need to update the
+ // execution context scope.
changed = false;
} else {
m_mod_id = current_mod_id;
@@ -3081,10 +3070,9 @@ bool ValueObject::EvaluationPoint::SyncWithProcessState(
}
// Now re-look up the thread and frame in case the underlying objects have
- // gone away & been recreated.
- // That way we'll be sure to return a valid exe_scope.
- // If we used to have a thread or a frame but can't find it anymore, then mark
- // ourselves as invalid.
+ // gone away & been recreated. That way we'll be sure to return a valid
+ // exe_scope. If we used to have a thread or a frame but can't find it
+ // anymore, then mark ourselves as invalid.
if (!accept_invalid_exe_ctx) {
if (m_exe_ctx_ref.HasThreadRef()) {
@@ -3299,11 +3287,9 @@ void ValueObject::SetPreferredDisplayLanguageIfNeeded(lldb::LanguageType lt) {
}
bool ValueObject::CanProvideValue() {
- // we need to support invalid types as providers of values because some
- // bare-board
- // debugging scenarios have no notion of types, but still manage to have raw
- // numeric
- // values for things like registers. sigh.
+ // we need to support invalid types as providers of values because some bare-
+ // board debugging scenarios have no notion of types, but still manage to
+ // have raw numeric values for things like registers. sigh.
const CompilerType &type(GetCompilerType());
return (false == type.IsValid()) ||
(0 != (type.GetTypeInfo() & eTypeHasValue));
@@ -3326,7 +3312,9 @@ ValueObjectSP ValueObject::Persist() {
if (!persistent_state)
return nullptr;
- ConstString name(persistent_state->GetNextPersistentVariableName());
+ auto prefix = persistent_state->GetPersistentVariablePrefix();
+ ConstString name =
+ persistent_state->GetNextPersistentVariableName(*target_sp, prefix);
ValueObjectSP const_result_sp =
ValueObjectConstResult::Create(target_sp.get(), GetValue(), name);
diff --git a/source/Core/ValueObjectCast.cpp b/source/Core/ValueObjectCast.cpp
index a489bdc74f5f..e0978f692bc5 100644
--- a/source/Core/ValueObjectCast.cpp
+++ b/source/Core/ValueObjectCast.cpp
@@ -71,9 +71,9 @@ bool ValueObjectCast::UpdateValue() {
m_value.SetCompilerType(compiler_type);
SetAddressTypeOfChildren(m_parent->GetAddressTypeOfChildren());
if (!CanProvideValue()) {
- // this value object represents an aggregate type whose
- // children have values, but this object does not. So we
- // say we are changed if our location has changed.
+ // this value object represents an aggregate type whose children have
+ // values, but this object does not. So we say we are changed if our
+ // location has changed.
SetValueDidChange(m_value.GetValueType() != old_value.GetValueType() ||
m_value.GetScalar() != old_value.GetScalar());
}
diff --git a/source/Core/ValueObjectChild.cpp b/source/Core/ValueObjectChild.cpp
index 591bc21711ae..019daa2fd3d2 100644
--- a/source/Core/ValueObjectChild.cpp
+++ b/source/Core/ValueObjectChild.cpp
@@ -172,8 +172,8 @@ bool ValueObjectChild::UpdateValue() {
} else if (addr == 0) {
m_error.SetErrorString("parent is NULL");
} else {
- // Set this object's scalar value to the address of its
- // value by adding its byte offset to the parent address
+ // Set this object's scalar value to the address of its value by
+ // adding its byte offset to the parent address
m_value.GetScalar() += GetByteOffset();
}
} break;
diff --git a/source/Core/ValueObjectDynamicValue.cpp b/source/Core/ValueObjectDynamicValue.cpp
index 0013d0dbf740..e9b48310b0c6 100644
--- a/source/Core/ValueObjectDynamicValue.cpp
+++ b/source/Core/ValueObjectDynamicValue.cpp
@@ -122,8 +122,8 @@ bool ValueObjectDynamicValue::UpdateValue() {
return false;
}
- // Setting our type_sp to NULL will route everything back through our
- // parent which is equivalent to not using dynamic values.
+ // Setting our type_sp to NULL will route everything back through our parent
+ // which is equivalent to not using dynamic values.
if (m_use_dynamic == lldb::eNoDynamicValues) {
m_dynamic_type_info.Clear();
return true;
@@ -173,8 +173,7 @@ bool ValueObjectDynamicValue::UpdateValue() {
}
// Getting the dynamic value may have run the program a bit, and so marked us
- // as needing updating, but we really
- // don't...
+ // as needing updating, but we really don't...
m_update_point.SetUpdated();
@@ -192,8 +191,8 @@ bool ValueObjectDynamicValue::UpdateValue() {
}
// If we don't have a dynamic type, then make ourselves just a echo of our
- // parent.
- // Or we could return false, and make ourselves an echo of our parent?
+ // parent. Or we could return false, and make ourselves an echo of our
+ // parent?
if (!found_dynamic_type) {
if (m_dynamic_type_info)
SetValueDidChange(true);
@@ -248,14 +247,14 @@ bool ValueObjectDynamicValue::UpdateValue() {
static_cast<void *>(this), GetTypeName().GetCString());
if (m_address.IsValid() && m_dynamic_type_info) {
- // The variable value is in the Scalar value inside the m_value.
- // We can point our m_data right to it.
+ // The variable value is in the Scalar value inside the m_value. We can
+ // point our m_data right to it.
m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
if (m_error.Success()) {
if (!CanProvideValue()) {
- // this value object represents an aggregate type whose
- // children have values, but this object does not. So we
- // say we are changed if our location has changed.
+ // this value object represents an aggregate type whose children have
+ // values, but this object does not. So we say we are changed if our
+ // location has changed.
SetValueDidChange(m_value.GetValueType() != old_value.GetValueType() ||
m_value.GetScalar() != old_value.GetScalar());
}
@@ -287,13 +286,11 @@ bool ValueObjectDynamicValue::SetValueFromCString(const char *value_str,
return false;
}
- // if we are at an offset from our parent, in order to set ourselves correctly
- // we would need
- // to change the new value so that it refers to the correct dynamic type. we
- // choose not to deal
- // with that - if anything more than a value overwrite is required, you should
- // be using the
- // expression parser instead of the value editing facility
+ // if we are at an offset from our parent, in order to set ourselves
+ // correctly we would need to change the new value so that it refers to the
+ // correct dynamic type. we choose not to deal with that - if anything more
+ // than a value overwrite is required, you should be using the expression
+ // parser instead of the value editing facility
if (my_value != parent_value) {
// but NULL'ing out a value should always be allowed
if (strcmp(value_str, "0")) {
@@ -322,13 +319,11 @@ bool ValueObjectDynamicValue::SetData(DataExtractor &data, Status &error) {
return false;
}
- // if we are at an offset from our parent, in order to set ourselves correctly
- // we would need
- // to change the new value so that it refers to the correct dynamic type. we
- // choose not to deal
- // with that - if anything more than a value overwrite is required, you should
- // be using the
- // expression parser instead of the value editing facility
+ // if we are at an offset from our parent, in order to set ourselves
+ // correctly we would need to change the new value so that it refers to the
+ // correct dynamic type. we choose not to deal with that - if anything more
+ // than a value overwrite is required, you should be using the expression
+ // parser instead of the value editing facility
if (my_value != parent_value) {
// but NULL'ing out a value should always be allowed
lldb::offset_t offset = 0;
diff --git a/source/Core/ValueObjectList.cpp b/source/Core/ValueObjectList.cpp
index 00aee798c0e3..0dd07252888f 100644
--- a/source/Core/ValueObjectList.cpp
+++ b/source/Core/ValueObjectList.cpp
@@ -87,8 +87,8 @@ ValueObjectSP ValueObjectList::FindValueObjectByUID(lldb::user_id_t uid) {
collection::iterator pos, end = m_value_objects.end();
for (pos = m_value_objects.begin(); pos != end; ++pos) {
- // Watch out for NULL objects in our list as the list
- // might get resized to a specific size and lazily filled in
+ // Watch out for NULL objects in our list as the list might get resized to
+ // a specific size and lazily filled in
ValueObject *valobj = (*pos).get();
if (valobj && valobj->GetID() == uid) {
valobj_sp = *pos;
diff --git a/source/Core/ValueObjectMemory.cpp b/source/Core/ValueObjectMemory.cpp
index e26900014c9d..3e71fea6bb35 100644
--- a/source/Core/ValueObjectMemory.cpp
+++ b/source/Core/ValueObjectMemory.cpp
@@ -165,21 +165,20 @@ bool ValueObjectMemory::UpdateValue() {
llvm_unreachable("Unhandled expression result value kind...");
case Value::eValueTypeScalar:
- // The variable value is in the Scalar value inside the m_value.
- // We can point our m_data right to it.
+ // The variable value is in the Scalar value inside the m_value. We can
+ // point our m_data right to it.
m_error = m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
break;
case Value::eValueTypeFileAddress:
case Value::eValueTypeLoadAddress:
case Value::eValueTypeHostAddress:
- // The DWARF expression result was an address in the inferior
- // process. If this variable is an aggregate type, we just need
- // the address as the main value as all child variable objects
- // will rely upon this location and add an offset and then read
- // their own values as needed. If this variable is a simple
- // type, we read all data for it into m_data.
- // Make sure this type has a value before we try and read it
+ // The DWARF expression result was an address in the inferior process. If
+ // this variable is an aggregate type, we just need the address as the
+ // main value as all child variable objects will rely upon this location
+ // and add an offset and then read their own values as needed. If this
+ // variable is a simple type, we read all data for it into m_data. Make
+ // sure this type has a value before we try and read it
// If we have a file address, convert it to a load address if we can.
if (value_type == Value::eValueTypeFileAddress &&
@@ -192,14 +191,14 @@ bool ValueObjectMemory::UpdateValue() {
}
if (!CanProvideValue()) {
- // this value object represents an aggregate type whose
- // children have values, but this object does not. So we
- // say we are changed if our location has changed.
+ // this value object represents an aggregate type whose children have
+ // values, but this object does not. So we say we are changed if our
+ // location has changed.
SetValueDidChange(value_type != old_value.GetValueType() ||
m_value.GetScalar() != old_value.GetScalar());
} else {
- // Copy the Value and set the context to use our Variable
- // so it can extract read its value into m_data appropriately
+ // Copy the Value and set the context to use our Variable so it can
+ // extract read its value into m_data appropriately
Value value(m_value);
if (m_type_sp)
value.SetContext(Value::eContextTypeLLDBType, m_type_sp.get());
diff --git a/source/Core/ValueObjectSyntheticFilter.cpp b/source/Core/ValueObjectSyntheticFilter.cpp
index 87310c423cb8..044387a4ae12 100644
--- a/source/Core/ValueObjectSyntheticFilter.cpp
+++ b/source/Core/ValueObjectSyntheticFilter.cpp
@@ -129,7 +129,19 @@ lldb::ValueType ValueObjectSynthetic::GetValueType() const {
}
void ValueObjectSynthetic::CreateSynthFilter() {
- m_synth_filter_ap = (m_synth_sp->GetFrontEnd(*m_parent));
+ ValueObject *valobj_for_frontend = m_parent;
+ if (m_synth_sp->WantsDereference())
+ {
+ CompilerType type = m_parent->GetCompilerType();
+ if (type.IsValid() && type.IsPointerOrReferenceType())
+ {
+ Status error;
+ lldb::ValueObjectSP deref_sp = m_parent->Dereference(error);
+ if (error.Success())
+ valobj_for_frontend = deref_sp.get();
+ }
+ }
+ m_synth_filter_ap = (m_synth_sp->GetFrontEnd(*valobj_for_frontend));
if (!m_synth_filter_ap.get())
m_synth_filter_ap = llvm::make_unique<DummySyntheticFrontEnd>(*m_parent);
}
@@ -171,10 +183,9 @@ bool ValueObjectSynthetic::UpdateValue() {
m_children_byindex.Clear();
m_name_toindex.Clear();
// usually, an object's value can change but this does not alter its
- // children count
- // for a synthetic VO that might indeed happen, so we need to tell the upper
- // echelons
- // that they need to come back to us asking for children
+ // children count for a synthetic VO that might indeed happen, so we need
+ // to tell the upper echelons that they need to come back to us asking for
+ // children
m_children_count_valid = false;
m_synthetic_children_cache.Clear();
m_synthetic_children_count = UINT32_MAX;
diff --git a/source/Core/ValueObjectVariable.cpp b/source/Core/ValueObjectVariable.cpp
index 8436ba529a54..bfe5c3de7fbf 100644
--- a/source/Core/ValueObjectVariable.cpp
+++ b/source/Core/ValueObjectVariable.cpp
@@ -175,9 +175,8 @@ bool ValueObjectVariable::UpdateValue() {
switch (value_type) {
case Value::eValueTypeFileAddress:
// If this type is a pointer, then its children will be considered load
- // addresses
- // if the pointer or reference is dereferenced, but only if the process
- // is alive.
+ // addresses if the pointer or reference is dereferenced, but only if
+ // the process is alive.
//
// There could be global variables like in the following code:
// struct LinkedListNode { Foo* foo; LinkedListNode* next; };
@@ -187,14 +186,11 @@ bool ValueObjectVariable::UpdateValue() {
// LinkedListNode g_first_node = { &g_foo1, &g_second_node };
//
// When we aren't running, we should be able to look at these variables
- // using
- // the "target variable" command. Children of the "g_first_node" always
- // will
- // be of the same address type as the parent. But children of the "next"
- // member of
- // LinkedListNode will become load addresses if we have a live process,
- // or remain
- // what a file address if it what a file address.
+ // using the "target variable" command. Children of the "g_first_node"
+ // always will be of the same address type as the parent. But children
+ // of the "next" member of LinkedListNode will become load addresses if
+ // we have a live process, or remain what a file address if it what a
+ // file address.
if (process_is_alive && is_pointer_or_ref)
SetAddressTypeOfChildren(eAddressTypeLoad);
else
@@ -202,12 +198,10 @@ bool ValueObjectVariable::UpdateValue() {
break;
case Value::eValueTypeHostAddress:
// Same as above for load addresses, except children of pointer or refs
- // are always
- // load addresses. Host addresses are used to store freeze dried
- // variables. If this
- // type is a struct, the entire struct contents will be copied into the
- // heap of the
- // LLDB process, but we do not currrently follow any pointers.
+ // are always load addresses. Host addresses are used to store freeze
+ // dried variables. If this type is a struct, the entire struct
+ // contents will be copied into the heap of the
+ // LLDB process, but we do not currently follow any pointers.
if (is_pointer_or_ref)
SetAddressTypeOfChildren(eAddressTypeLoad);
else
@@ -224,8 +218,8 @@ bool ValueObjectVariable::UpdateValue() {
case Value::eValueTypeVector:
// fall through
case Value::eValueTypeScalar:
- // The variable value is in the Scalar value inside the m_value.
- // We can point our m_data right to it.
+ // The variable value is in the Scalar value inside the m_value. We can
+ // point our m_data right to it.
m_error =
m_value.GetValueAsData(&exe_ctx, m_data, 0, GetModule().get());
break;
@@ -233,44 +227,26 @@ bool ValueObjectVariable::UpdateValue() {
case Value::eValueTypeFileAddress:
case Value::eValueTypeLoadAddress:
case Value::eValueTypeHostAddress:
- // The DWARF expression result was an address in the inferior
- // process. If this variable is an aggregate type, we just need
- // the address as the main value as all child variable objects
- // will rely upon this location and add an offset and then read
- // their own values as needed. If this variable is a simple
- // type, we read all data for it into m_data.
- // Make sure this type has a value before we try and read it
+ // The DWARF expression result was an address in the inferior process.
+ // If this variable is an aggregate type, we just need the address as
+ // the main value as all child variable objects will rely upon this
+ // location and add an offset and then read their own values as needed.
+ // If this variable is a simple type, we read all data for it into
+ // m_data. Make sure this type has a value before we try and read it
// If we have a file address, convert it to a load address if we can.
- if (value_type == Value::eValueTypeFileAddress && process_is_alive) {
- lldb::addr_t file_addr =
- m_value.GetScalar().ULongLong(LLDB_INVALID_ADDRESS);
- if (file_addr != LLDB_INVALID_ADDRESS) {
- SymbolContext var_sc;
- variable->CalculateSymbolContext(&var_sc);
- if (var_sc.module_sp) {
- ObjectFile *objfile = var_sc.module_sp->GetObjectFile();
- if (objfile) {
- Address so_addr(file_addr, objfile->GetSectionList());
- lldb::addr_t load_addr = so_addr.GetLoadAddress(target);
- if (load_addr != LLDB_INVALID_ADDRESS) {
- m_value.SetValueType(Value::eValueTypeLoadAddress);
- m_value.GetScalar() = load_addr;
- }
- }
- }
- }
- }
+ if (value_type == Value::eValueTypeFileAddress && process_is_alive)
+ m_value.ConvertToLoadAddress(GetModule().get(), target);
if (!CanProvideValue()) {
- // this value object represents an aggregate type whose
- // children have values, but this object does not. So we
- // say we are changed if our location has changed.
+ // this value object represents an aggregate type whose children have
+ // values, but this object does not. So we say we are changed if our
+ // location has changed.
SetValueDidChange(value_type != old_value.GetValueType() ||
m_value.GetScalar() != old_value.GetScalar());
} else {
- // Copy the Value and set the context to use our Variable
- // so it can extract read its value into m_data appropriately
+ // Copy the Value and set the context to use our Variable so it can
+ // extract read its value into m_data appropriately
Value value(m_value);
value.SetContext(Value::eContextTypeVariable, variable);
m_error =
@@ -299,14 +275,13 @@ bool ValueObjectVariable::IsInScope() {
if (frame) {
return m_variable_sp->IsInScope(frame);
} else {
- // This ValueObject had a frame at one time, but now we
- // can't locate it, so return false since we probably aren't
- // in scope.
+ // This ValueObject had a frame at one time, but now we can't locate it,
+ // so return false since we probably aren't in scope.
return false;
}
}
- // We have a variable that wasn't tied to a frame, which
- // means it is a global and is always in scope.
+ // We have a variable that wasn't tied to a frame, which means it is a global
+ // and is always in scope.
return true;
}
diff --git a/source/DataFormatters/FormatManager.cpp b/source/DataFormatters/FormatManager.cpp
index 7619b6f6f82b..bafee1799b80 100644
--- a/source/DataFormatters/FormatManager.cpp
+++ b/source/DataFormatters/FormatManager.cpp
@@ -494,8 +494,8 @@ bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) {
if (valobj.GetNumChildren() == 0)
return false;
- // ask the type if it has any opinion about this
- // eLazyBoolCalculate == no opinion; other values should be self explanatory
+ // ask the type if it has any opinion about this eLazyBoolCalculate == no
+ // opinion; other values should be self explanatory
CompilerType compiler_type(valobj.GetCompilerType());
if (compiler_type.IsValid()) {
switch (compiler_type.ShouldPrintAsOneLiner(&valobj)) {
@@ -532,8 +532,7 @@ bool FormatManager::ShouldPrintAsOneLiner(ValueObject &valobj) {
}
// if we decided to define synthetic children for a type, we probably care
- // enough
- // to show them, but avoid nesting children in children
+ // enough to show them, but avoid nesting children in children
if (child_sp->GetSyntheticChildren().get() != nullptr) {
ValueObjectSP synth_sp(child_sp->GetSyntheticValue());
// wait.. wat? just get out of here..
diff --git a/source/DataFormatters/StringPrinter.cpp b/source/DataFormatters/StringPrinter.cpp
index 84143a541087..89d7a95069ca 100644
--- a/source/DataFormatters/StringPrinter.cpp
+++ b/source/DataFormatters/StringPrinter.cpp
@@ -26,9 +26,8 @@ using namespace lldb;
using namespace lldb_private;
using namespace lldb_private::formatters;
-// we define this for all values of type but only implement it for those we care
-// about
-// that's good because we get linker errors for any unsupported type
+// we define this for all values of type but only implement it for those we
+// care about that's good because we get linker errors for any unsupported type
template <lldb_private::formatters::StringPrinter::StringElementType type>
static StringPrinter::StringPrinterBufferPointer<>
GetPrintableImpl(uint8_t *buffer, uint8_t *buffer_end, uint8_t *&next);
@@ -163,8 +162,8 @@ GetPrintableImpl<StringPrinter::StringElementType::UTF8>(uint8_t *buffer,
(unsigned char)*(buffer + 2), (unsigned char)*(buffer + 3));
break;
default:
- // this is probably some bogus non-character thing
- // just print it as-is and hope to sync up again soon
+ // this is probably some bogus non-character thing just print it as-is and
+ // hope to sync up again soon
retval = {buffer, 1};
next = buffer + 1;
return retval;
@@ -223,9 +222,9 @@ GetPrintableImpl<StringPrinter::StringElementType::UTF8>(uint8_t *buffer,
return retval;
}
-// Given a sequence of bytes, this function returns:
-// a sequence of bytes to actually print out + a length
-// the following unscanned position of the buffer is in next
+// Given a sequence of bytes, this function returns: a sequence of bytes to
+// actually print out + a length the following unscanned position of the buffer
+// is in next
static StringPrinter::StringPrinterBufferPointer<>
GetPrintable(StringPrinter::StringElementType type, uint8_t *buffer,
uint8_t *buffer_end, uint8_t *&next) {
@@ -321,8 +320,7 @@ static bool DumpUTFBufferToStream(
(llvm::UTF8 *)utf8_data_buffer_sp->GetBytes();
} else {
// just copy the pointers - the cast is necessary to make the compiler
- // happy
- // but this should only happen if we are reading UTF8 data
+ // happy but this should only happen if we are reading UTF8 data
utf8_data_ptr = const_cast<llvm::UTF8 *>(
reinterpret_cast<const llvm::UTF8 *>(data_ptr));
utf8_data_end_ptr = const_cast<llvm::UTF8 *>(
@@ -344,8 +342,8 @@ static bool DumpUTFBufferToStream(
}
// since we tend to accept partial data (and even partially malformed data)
- // we might end up with no NULL terminator before the end_ptr
- // hence we need to take a slower route and ensure we stay within boundaries
+ // we might end up with no NULL terminator before the end_ptr hence we need
+ // to take a slower route and ensure we stay within boundaries
for (; utf8_data_ptr < utf8_data_end_ptr;) {
if (zero_is_terminator && !*utf8_data_ptr)
break;
@@ -472,8 +470,8 @@ bool StringPrinter::ReadStringAndDumpToStream<
}
// since we tend to accept partial data (and even partially malformed data)
- // we might end up with no NULL terminator before the end_ptr
- // hence we need to take a slower route and ensure we stay within boundaries
+ // we might end up with no NULL terminator before the end_ptr hence we need
+ // to take a slower route and ensure we stay within boundaries
for (uint8_t *data = buffer_sp->GetBytes(); *data && (data < data_end);) {
if (escape_non_printables) {
uint8_t *next_data = nullptr;
diff --git a/source/DataFormatters/TypeFormat.cpp b/source/DataFormatters/TypeFormat.cpp
index 333fe91b76db..7902ccb47771 100644
--- a/source/DataFormatters/TypeFormat.cpp
+++ b/source/DataFormatters/TypeFormat.cpp
@@ -111,12 +111,12 @@ bool TypeFormatImpl_Format::FormatObject(ValueObject *valobj,
valobj->GetBitfieldBitSize(), // Bitfield bit size
valobj->GetBitfieldBitOffset(), // Bitfield bit offset
exe_scope);
- // Given that we do not want to set the ValueObject's m_error
- // for a formatting error (or else we wouldn't be able to reformat
- // until a next update), an empty string is treated as a "false"
- // return from here, but that's about as severe as we get
- // CompilerType::DumpTypeValue() should always return
- // something, even if that something is an error message
+ // Given that we do not want to set the ValueObject's m_error for a
+ // formatting error (or else we wouldn't be able to reformat until a
+ // next update), an empty string is treated as a "false" return from
+ // here, but that's about as severe as we get
+ // CompilerType::DumpTypeValue() should always return something, even
+ // if that something is an error message
dest = sstr.GetString();
}
}
diff --git a/source/DataFormatters/ValueObjectPrinter.cpp b/source/DataFormatters/ValueObjectPrinter.cpp
index 863ff3af12e8..43e91a2b6c92 100644
--- a/source/DataFormatters/ValueObjectPrinter.cpp
+++ b/source/DataFormatters/ValueObjectPrinter.cpp
@@ -244,8 +244,8 @@ void ValueObjectPrinter::PrintDecl() {
// always show the type at the root level if it is invalid
if (show_type) {
- // Some ValueObjects don't have types (like registers sets). Only print
- // the type if there is one to print
+ // Some ValueObjects don't have types (like registers sets). Only print the
+ // type if there is one to print
ConstString type_name;
if (m_compiler_type.IsValid()) {
if (m_options.m_use_type_display_name)
@@ -402,12 +402,10 @@ bool ValueObjectPrinter::PrintValueAndSummaryIfNeeded(bool &value_printed,
}
if (m_error.size()) {
// we need to support scenarios in which it is actually fine for a value
- // to have no type
- // but - on the other hand - if we get an error *AND* have no type, we try
- // to get out
- // gracefully, since most often that combination means "could not resolve
- // a type"
- // and the default failure mode is quite ugly
+ // to have no type but - on the other hand - if we get an error *AND*
+ // have no type, we try to get out gracefully, since most often that
+ // combination means "could not resolve a type" and the default failure
+ // mode is quite ugly
if (!m_compiler_type.IsValid()) {
m_stream->Printf(" <could not resolve type>");
return false;
@@ -416,10 +414,10 @@ bool ValueObjectPrinter::PrintValueAndSummaryIfNeeded(bool &value_printed,
error_printed = true;
m_stream->Printf(" <%s>\n", m_error.c_str());
} else {
- // Make sure we have a value and make sure the summary didn't
- // specify that the value should not be printed - and do not print
- // the value if this thing is nil
- // (but show the value if the user passes a format explicitly)
+ // Make sure we have a value and make sure the summary didn't specify
+ // that the value should not be printed - and do not print the value if
+ // this thing is nil (but show the value if the user passes a format
+ // explicitly)
TypeSummaryImpl *entry = GetSummaryFormatter();
if (!IsNil() && !IsUninitialized() && !m_value.empty() &&
(entry == NULL || (entry->DoesPrintValue(m_valobj) ||
@@ -494,8 +492,8 @@ bool ValueObjectPrinter::ShouldPrintChildren(
if (is_uninit)
return false;
- // if the user has specified an element count, always print children
- // as it is explicit user demand being honored
+ // if the user has specified an element count, always print children as it is
+ // explicit user demand being honored
if (m_options.m_pointer_as_array)
return true;
@@ -505,17 +503,16 @@ bool ValueObjectPrinter::ShouldPrintChildren(
return false;
if (is_failed_description || m_curr_depth < m_options.m_max_depth) {
- // We will show children for all concrete types. We won't show
- // pointer contents unless a pointer depth has been specified.
- // We won't reference contents unless the reference is the
- // root object (depth of zero).
+ // We will show children for all concrete types. We won't show pointer
+ // contents unless a pointer depth has been specified. We won't reference
+ // contents unless the reference is the root object (depth of zero).
- // Use a new temporary pointer depth in case we override the
- // current pointer depth below...
+ // Use a new temporary pointer depth in case we override the current
+ // pointer depth below...
if (is_ptr || is_ref) {
- // We have a pointer or reference whose value is an address.
- // Make sure that address is not NULL
+ // We have a pointer or reference whose value is an address. Make sure
+ // that address is not NULL
AddressType ptr_address_type;
if (m_valobj->GetPointerValue(&ptr_address_type) == 0)
return false;
@@ -523,10 +520,10 @@ bool ValueObjectPrinter::ShouldPrintChildren(
const bool is_root_level = m_curr_depth == 0;
if (is_ref && is_root_level) {
- // If this is the root object (depth is zero) that we are showing
- // and it is a reference, and no pointer depth has been supplied
- // print out what it references. Don't do this at deeper depths
- // otherwise we can end up with infinite recursion...
+ // If this is the root object (depth is zero) that we are showing and
+ // it is a reference, and no pointer depth has been supplied print out
+ // what it references. Don't do this at deeper depths otherwise we can
+ // end up with infinite recursion...
return true;
}
@@ -759,8 +756,7 @@ bool ValueObjectPrinter::PrintChildrenOneLiner(bool hide_names) {
void ValueObjectPrinter::PrintChildrenIfNeeded(bool value_printed,
bool summary_printed) {
// this flag controls whether we tried to display a description for this
- // object and failed
- // if that happens, we want to display the children, if any
+ // object and failed if that happens, we want to display the children, if any
bool is_failed_description =
!PrintObjectDescriptionIfNeeded(value_printed, summary_printed);
diff --git a/source/DataFormatters/VectorType.cpp b/source/DataFormatters/VectorType.cpp
index 4fb92cad3988..d85a7e674177 100644
--- a/source/DataFormatters/VectorType.cpp
+++ b/source/DataFormatters/VectorType.cpp
@@ -157,9 +157,8 @@ static lldb::Format GetItemFormatForFormat(lldb::Format format,
case lldb::eFormatDefault: {
// special case the (default, char) combination to actually display as an
- // integer value
- // most often, you won't want to see the ASCII characters... (and if you do,
- // eFormatChar is a keystroke away)
+ // integer value most often, you won't want to see the ASCII characters...
+ // (and if you do, eFormatChar is a keystroke away)
bool is_char = element_type.IsCharType();
bool is_signed = false;
element_type.IsIntegerType(is_signed);
diff --git a/source/Expression/CMakeLists.txt b/source/Expression/CMakeLists.txt
index 7d9643a45dd5..020d470ed126 100644
--- a/source/Expression/CMakeLists.txt
+++ b/source/Expression/CMakeLists.txt
@@ -30,6 +30,7 @@ add_lldb_library(lldbExpression
lldbTarget
lldbUtility
lldbPluginExpressionParserClang
+ lldbPluginObjectFileJIT
LINK_COMPONENTS
Core
diff --git a/source/Expression/DWARFExpression.cpp b/source/Expression/DWARFExpression.cpp
index 14011aece7c9..55eb65f32b5a 100644
--- a/source/Expression/DWARFExpression.cpp
+++ b/source/Expression/DWARFExpression.cpp
@@ -15,6 +15,7 @@
// C++ Includes
#include <vector>
+#include "lldb/Core/Module.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
#include "lldb/Core/Value.h"
@@ -37,13 +38,13 @@
#include "lldb/Target/StackID.h"
#include "lldb/Target/Thread.h"
-#include "Plugins/SymbolFile/DWARF/DWARFCompileUnit.h"
+#include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
using namespace lldb;
using namespace lldb_private;
static lldb::addr_t
-ReadAddressFromDebugAddrSection(const DWARFCompileUnit *dwarf_cu,
+ReadAddressFromDebugAddrSection(const DWARFUnit *dwarf_cu,
uint32_t index) {
uint32_t index_size = dwarf_cu->GetAddressByteSize();
dw_offset_t addr_base = dwarf_cu->GetAddrBase();
@@ -55,7 +56,7 @@ ReadAddressFromDebugAddrSection(const DWARFCompileUnit *dwarf_cu,
//----------------------------------------------------------------------
// DWARFExpression constructor
//----------------------------------------------------------------------
-DWARFExpression::DWARFExpression(DWARFCompileUnit *dwarf_cu)
+DWARFExpression::DWARFExpression(DWARFUnit *dwarf_cu)
: m_module_wp(), m_data(), m_dwarf_cu(dwarf_cu),
m_reg_kind(eRegisterKindDWARF), m_loclist_slide(LLDB_INVALID_ADDRESS) {}
@@ -66,7 +67,7 @@ DWARFExpression::DWARFExpression(const DWARFExpression &rhs)
DWARFExpression::DWARFExpression(lldb::ModuleSP module_sp,
const DataExtractor &data,
- DWARFCompileUnit *dwarf_cu,
+ DWARFUnit *dwarf_cu,
lldb::offset_t data_offset,
lldb::offset_t data_length)
: m_module_wp(), m_data(data, data_offset, data_length),
@@ -147,13 +148,13 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::offset_t offset,
break;
case lldb::eDescriptionLevelBrief:
- if (offset > start_offset)
+ if (op_offset > start_offset)
s->PutChar(' ');
break;
case lldb::eDescriptionLevelFull:
case lldb::eDescriptionLevelVerbose:
- if (offset > start_offset)
+ if (op_offset > start_offset)
s->EOL();
s->Indent();
if (level == lldb::eDescriptionLevelFull)
@@ -172,34 +173,34 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::offset_t offset,
*s << "DW_OP_deref";
break; // 0x06
case DW_OP_const1u:
- s->Printf("DW_OP_const1u(0x%2.2x) ", m_data.GetU8(&offset));
+ s->Printf("DW_OP_const1u(0x%2.2x)", m_data.GetU8(&offset));
break; // 0x08 1 1-byte constant
case DW_OP_const1s:
- s->Printf("DW_OP_const1s(0x%2.2x) ", m_data.GetU8(&offset));
+ s->Printf("DW_OP_const1s(0x%2.2x)", m_data.GetU8(&offset));
break; // 0x09 1 1-byte constant
case DW_OP_const2u:
- s->Printf("DW_OP_const2u(0x%4.4x) ", m_data.GetU16(&offset));
+ s->Printf("DW_OP_const2u(0x%4.4x)", m_data.GetU16(&offset));
break; // 0x0a 1 2-byte constant
case DW_OP_const2s:
- s->Printf("DW_OP_const2s(0x%4.4x) ", m_data.GetU16(&offset));
+ s->Printf("DW_OP_const2s(0x%4.4x)", m_data.GetU16(&offset));
break; // 0x0b 1 2-byte constant
case DW_OP_const4u:
- s->Printf("DW_OP_const4u(0x%8.8x) ", m_data.GetU32(&offset));
+ s->Printf("DW_OP_const4u(0x%8.8x)", m_data.GetU32(&offset));
break; // 0x0c 1 4-byte constant
case DW_OP_const4s:
- s->Printf("DW_OP_const4s(0x%8.8x) ", m_data.GetU32(&offset));
+ s->Printf("DW_OP_const4s(0x%8.8x)", m_data.GetU32(&offset));
break; // 0x0d 1 4-byte constant
case DW_OP_const8u:
- s->Printf("DW_OP_const8u(0x%16.16" PRIx64 ") ", m_data.GetU64(&offset));
+ s->Printf("DW_OP_const8u(0x%16.16" PRIx64 ")", m_data.GetU64(&offset));
break; // 0x0e 1 8-byte constant
case DW_OP_const8s:
- s->Printf("DW_OP_const8s(0x%16.16" PRIx64 ") ", m_data.GetU64(&offset));
+ s->Printf("DW_OP_const8s(0x%16.16" PRIx64 ")", m_data.GetU64(&offset));
break; // 0x0f 1 8-byte constant
case DW_OP_constu:
- s->Printf("DW_OP_constu(0x%" PRIx64 ") ", m_data.GetULEB128(&offset));
+ s->Printf("DW_OP_constu(0x%" PRIx64 ")", m_data.GetULEB128(&offset));
break; // 0x10 1 ULEB128 constant
case DW_OP_consts:
- s->Printf("DW_OP_consts(0x%" PRId64 ") ", m_data.GetSLEB128(&offset));
+ s->Printf("DW_OP_consts(0x%" PRId64 ")", m_data.GetSLEB128(&offset));
break; // 0x11 1 SLEB128 constant
case DW_OP_dup:
s->PutCString("DW_OP_dup");
@@ -211,7 +212,7 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::offset_t offset,
s->PutCString("DW_OP_over");
break; // 0x14
case DW_OP_pick:
- s->Printf("DW_OP_pick(0x%2.2x) ", m_data.GetU8(&offset));
+ s->Printf("DW_OP_pick(0x%2.2x)", m_data.GetU8(&offset));
break; // 0x15 1 1-byte stack index
case DW_OP_swap:
s->PutCString("DW_OP_swap");
@@ -253,7 +254,7 @@ void DWARFExpression::DumpLocation(Stream *s, lldb::offset_t offset,
s->PutCString("DW_OP_plus");
break; // 0x22
case DW_OP_plus_uconst: // 0x23 1 ULEB128 addend
- s->Printf("DW_OP_plus_uconst(0x%" PRIx64 ") ",
+ s->Printf("DW_OP_plus_uconst(0x%" PRIx64 ")",
m_data.GetULEB128(&offset));
break;
@@ -679,8 +680,8 @@ static bool ReadRegisterValueAsScalar(RegisterContext *reg_ctx,
error_ptr->Clear();
return true;
} else {
- // If we get this error, then we need to implement a value
- // buffer in the dwarf expression evaluation function...
+ // If we get this error, then we need to implement a value buffer in
+ // the dwarf expression evaluation function...
if (error_ptr)
error_ptr->SetErrorStringWithFormat(
"register %s can't be converted to a scalar value",
@@ -991,17 +992,17 @@ bool DWARFExpression::Update_DW_OP_addr(lldb::addr_t file_addr) {
if (op == DW_OP_addr) {
const uint32_t addr_byte_size = m_data.GetAddressByteSize();
- // We have to make a copy of the data as we don't know if this
- // data is from a read only memory mapped buffer, so we duplicate
- // all of the data first, then modify it, and if all goes well,
- // we then replace the data for this expression
+ // We have to make a copy of the data as we don't know if this data is
+ // from a read only memory mapped buffer, so we duplicate all of the data
+ // first, then modify it, and if all goes well, we then replace the data
+ // for this expression
// So first we copy the data into a heap buffer
std::unique_ptr<DataBufferHeap> head_data_ap(
new DataBufferHeap(m_data.GetDataStart(), m_data.GetByteSize()));
- // Make en encoder so we can write the address into the buffer using
- // the correct byte order (endianness)
+ // Make en encoder so we can write the address into the buffer using the
+ // correct byte order (endianness)
DataEncoder encoder(head_data_ap->GetBytes(), head_data_ap->GetByteSize(),
m_data.GetByteOrder(), addr_byte_size);
@@ -1009,9 +1010,8 @@ bool DWARFExpression::Update_DW_OP_addr(lldb::addr_t file_addr) {
if (encoder.PutMaxU64(offset, addr_byte_size, file_addr) == UINT32_MAX)
return false;
- // All went well, so now we can reset the data using a shared
- // pointer to the heap data so "m_data" will now correctly
- // manage the heap data.
+ // All went well, so now we can reset the data using a shared pointer to
+ // the heap data so "m_data" will now correctly manage the heap data.
m_data.SetData(DataBufferSP(head_data_ap.release()));
return true;
} else {
@@ -1025,9 +1025,9 @@ bool DWARFExpression::Update_DW_OP_addr(lldb::addr_t file_addr) {
}
bool DWARFExpression::ContainsThreadLocalStorage() const {
- // We are assuming for now that any thread local variable will not
- // have a location list. This has been true for all thread local
- // variables we have seen so far produced by any compiler.
+ // We are assuming for now that any thread local variable will not have a
+ // location list. This has been true for all thread local variables we have
+ // seen so far produced by any compiler.
if (IsLocationList())
return false;
lldb::offset_t offset = 0;
@@ -1048,24 +1048,24 @@ bool DWARFExpression::LinkThreadLocalStorage(
lldb::ModuleSP new_module_sp,
std::function<lldb::addr_t(lldb::addr_t file_addr)> const
&link_address_callback) {
- // We are assuming for now that any thread local variable will not
- // have a location list. This has been true for all thread local
- // variables we have seen so far produced by any compiler.
+ // We are assuming for now that any thread local variable will not have a
+ // location list. This has been true for all thread local variables we have
+ // seen so far produced by any compiler.
if (IsLocationList())
return false;
const uint32_t addr_byte_size = m_data.GetAddressByteSize();
- // We have to make a copy of the data as we don't know if this
- // data is from a read only memory mapped buffer, so we duplicate
- // all of the data first, then modify it, and if all goes well,
- // we then replace the data for this expression
+ // We have to make a copy of the data as we don't know if this data is from a
+ // read only memory mapped buffer, so we duplicate all of the data first,
+ // then modify it, and if all goes well, we then replace the data for this
+ // expression
// So first we copy the data into a heap buffer
std::shared_ptr<DataBufferHeap> heap_data_sp(
new DataBufferHeap(m_data.GetDataStart(), m_data.GetByteSize()));
- // Make en encoder so we can write the address into the buffer using
- // the correct byte order (endianness)
+ // Make en encoder so we can write the address into the buffer using the
+ // correct byte order (endianness)
DataEncoder encoder(heap_data_sp->GetBytes(), heap_data_sp->GetByteSize(),
m_data.GetByteOrder(), addr_byte_size);
@@ -1080,8 +1080,7 @@ bool DWARFExpression::LinkThreadLocalStorage(
switch (op) {
case DW_OP_const4u:
// Remember the const offset in case we later have a
- // DW_OP_form_tls_address
- // or DW_OP_GNU_push_tls_address
+ // DW_OP_form_tls_address or DW_OP_GNU_push_tls_address
const_offset = offset;
const_value = m_data.GetU32(&offset);
decoded_data = true;
@@ -1090,8 +1089,7 @@ bool DWARFExpression::LinkThreadLocalStorage(
case DW_OP_const8u:
// Remember the const offset in case we later have a
- // DW_OP_form_tls_address
- // or DW_OP_GNU_push_tls_address
+ // DW_OP_form_tls_address or DW_OP_GNU_push_tls_address
const_offset = offset;
const_value = m_data.GetU64(&offset);
decoded_data = true;
@@ -1101,21 +1099,15 @@ bool DWARFExpression::LinkThreadLocalStorage(
case DW_OP_form_tls_address:
case DW_OP_GNU_push_tls_address:
// DW_OP_form_tls_address and DW_OP_GNU_push_tls_address must be preceded
- // by
- // a file address on the stack. We assume that DW_OP_const4u or
- // DW_OP_const8u
- // is used for these values, and we check that the last opcode we got
- // before
- // either of these was DW_OP_const4u or DW_OP_const8u. If so, then we can
- // link
- // the value accodingly. For Darwin, the value in the DW_OP_const4u or
- // DW_OP_const8u is the file address of a structure that contains a
- // function
- // pointer, the pthread key and the offset into the data pointed to by the
- // pthread key. So we must link this address and also set the module of
- // this
- // expression to the new_module_sp so we can resolve the file address
- // correctly
+ // by a file address on the stack. We assume that DW_OP_const4u or
+ // DW_OP_const8u is used for these values, and we check that the last
+ // opcode we got before either of these was DW_OP_const4u or
+ // DW_OP_const8u. If so, then we can link the value accodingly. For
+ // Darwin, the value in the DW_OP_const4u or DW_OP_const8u is the file
+ // address of a structure that contains a function pointer, the pthread
+ // key and the offset into the data pointed to by the pthread key. So we
+ // must link this address and also set the module of this expression to
+ // the new_module_sp so we can resolve the file address correctly
if (const_byte_size > 0) {
lldb::addr_t linked_file_addr = link_address_callback(const_value);
if (linked_file_addr == LLDB_INVALID_ADDRESS)
@@ -1144,8 +1136,8 @@ bool DWARFExpression::LinkThreadLocalStorage(
}
// If we linked the TLS address correctly, update the module so that when the
- // expression
- // is evaluated it can resolve the file address to a load address and read the
+ // expression is evaluated it can resolve the file address to a load address
+ // and read the
// TLS data
m_module_wp = new_module_sp;
m_data.SetData(heap_data_sp);
@@ -1323,7 +1315,7 @@ bool DWARFExpression::Evaluate(ExecutionContext *exe_ctx,
bool DWARFExpression::Evaluate(
ExecutionContext *exe_ctx, RegisterContext *reg_ctx,
lldb::ModuleSP module_sp, const DataExtractor &opcodes,
- DWARFCompileUnit *dwarf_cu, const lldb::offset_t opcodes_offset,
+ DWARFUnit *dwarf_cu, const lldb::offset_t opcodes_offset,
const lldb::offset_t opcodes_length, const lldb::RegisterKind reg_kind,
const Value *initial_value_ptr, const Value *object_address_ptr,
Value &result, Status *error_ptr) {
@@ -1383,6 +1375,7 @@ bool DWARFExpression::Evaluate(
}
log->Printf("0x%8.8" PRIx64 ": %s", op_offset, DW_OP_value_to_name(op));
}
+
switch (op) {
//----------------------------------------------------------------------
// The DW_OP_addr operation has a single operand that encodes a machine
@@ -1391,17 +1384,22 @@ bool DWARFExpression::Evaluate(
case DW_OP_addr:
stack.push_back(Scalar(opcodes.GetAddress(&offset)));
stack.back().SetValueType(Value::eValueTypeFileAddress);
+ // Convert the file address to a load address, so subsequent
+ // DWARF operators can operate on it.
+ if (frame)
+ stack.back().ConvertToLoadAddress(module_sp.get(),
+ frame->CalculateTarget().get());
break;
//----------------------------------------------------------------------
// The DW_OP_addr_sect_offset4 is used for any location expressions in
// shared libraries that have a location like:
// DW_OP_addr(0x1000)
- // If this address resides in a shared library, then this virtual
- // address won't make sense when it is evaluated in the context of a
- // running process where shared libraries have been slid. To account for
- // this, this new address type where we can store the section pointer
- // and a 4 byte offset.
+ // If this address resides in a shared library, then this virtual address
+ // won't make sense when it is evaluated in the context of a running
+ // process where shared libraries have been slid. To account for this, this
+ // new address type where we can store the section pointer and a 4 byte
+ // offset.
//----------------------------------------------------------------------
// case DW_OP_addr_sect_offset4:
// {
@@ -1436,9 +1434,9 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_deref
// OPERANDS: none
// DESCRIPTION: Pops the top stack entry and treats it as an address.
- // The value retrieved from that address is pushed. The size of the
- // data retrieved from the dereferenced address is the size of an
- // address on the target machine.
+ // The value retrieved from that address is pushed. The size of the data
+ // retrieved from the dereferenced address is the size of an address on the
+ // target machine.
//----------------------------------------------------------------------
case DW_OP_deref: {
if (stack.empty()) {
@@ -1455,6 +1453,33 @@ bool DWARFExpression::Evaluate(
stack.back().GetScalar() = ptr;
stack.back().ClearContext();
} break;
+ case Value::eValueTypeFileAddress: {
+ auto file_addr = stack.back().GetScalar().ULongLong(
+ LLDB_INVALID_ADDRESS);
+ if (!module_sp) {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat(
+ "need module to resolve file address for DW_OP_deref");
+ return false;
+ }
+ Address so_addr;
+ if (!module_sp->ResolveFileAddress(file_addr, so_addr)) {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat(
+ "failed to resolve file address in module");
+ return false;
+ }
+ addr_t load_Addr = so_addr.GetLoadAddress(exe_ctx->GetTargetPtr());
+ if (load_Addr == LLDB_INVALID_ADDRESS) {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat(
+ "failed to resolve load address");
+ return false;
+ }
+ stack.back().GetScalar() = load_Addr;
+ stack.back().SetValueType(Value::eValueTypeLoadAddress);
+ // Fall through to load address code below...
+ } LLVM_FALLTHROUGH;
case Value::eValueTypeLoadAddress:
if (exe_ctx) {
if (process) {
@@ -1500,13 +1525,13 @@ bool DWARFExpression::Evaluate(
// 1 - uint8_t that specifies the size of the data to dereference.
// DESCRIPTION: Behaves like the DW_OP_deref operation: it pops the top
// stack entry and treats it as an address. The value retrieved from that
- // address is pushed. In the DW_OP_deref_size operation, however, the
- // size in bytes of the data retrieved from the dereferenced address is
+ // address is pushed. In the DW_OP_deref_size operation, however, the size
+ // in bytes of the data retrieved from the dereferenced address is
// specified by the single operand. This operand is a 1-byte unsigned
// integral constant whose value may not be larger than the size of an
- // address on the target machine. The data retrieved is zero extended
- // to the size of an address on the target machine before being pushed
- // on the expression stack.
+ // address on the target machine. The data retrieved is zero extended to
+ // the size of an address on the target machine before being pushed on the
+ // expression stack.
//----------------------------------------------------------------------
case DW_OP_deref_size: {
if (stack.empty()) {
@@ -1525,8 +1550,7 @@ bool DWARFExpression::Evaluate(
// I can't decide whether the size operand should apply to the bytes in
// their
// lldb-host endianness or the target endianness.. I doubt this'll ever
- // come up
- // but I'll opt for assuming big endian regardless.
+ // come up but I'll opt for assuming big endian regardless.
switch (size) {
case 1:
ptr = ptr & 0xff;
@@ -1622,18 +1646,17 @@ bool DWARFExpression::Evaluate(
// OPERANDS: 1
// 1 - uint8_t that specifies the size of the data to dereference.
// DESCRIPTION: Behaves like the DW_OP_xderef operation: the entry at
- // the top of the stack is treated as an address. The second stack
- // entry is treated as an "address space identifier" for those
- // architectures that support multiple address spaces. The top two
- // stack elements are popped, a data item is retrieved through an
- // implementation-defined address calculation and pushed as the new
- // stack top. In the DW_OP_xderef_size operation, however, the size in
- // bytes of the data retrieved from the dereferenced address is
- // specified by the single operand. This operand is a 1-byte unsigned
- // integral constant whose value may not be larger than the size of an
- // address on the target machine. The data retrieved is zero extended
- // to the size of an address on the target machine before being pushed
- // on the expression stack.
+ // the top of the stack is treated as an address. The second stack entry is
+ // treated as an "address space identifier" for those architectures that
+ // support multiple address spaces. The top two stack elements are popped,
+ // a data item is retrieved through an implementation-defined address
+ // calculation and pushed as the new stack top. In the DW_OP_xderef_size
+ // operation, however, the size in bytes of the data retrieved from the
+ // dereferenced address is specified by the single operand. This operand is
+ // a 1-byte unsigned integral constant whose value may not be larger than
+ // the size of an address on the target machine. The data retrieved is zero
+ // extended to the size of an address on the target machine before being
+ // pushed on the expression stack.
//----------------------------------------------------------------------
case DW_OP_xderef_size:
if (error_ptr)
@@ -1643,13 +1666,13 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_xderef
// OPERANDS: none
// DESCRIPTION: Provides an extended dereference mechanism. The entry at
- // the top of the stack is treated as an address. The second stack entry
- // is treated as an "address space identifier" for those architectures
- // that support multiple address spaces. The top two stack elements are
- // popped, a data item is retrieved through an implementation-defined
- // address calculation and pushed as the new stack top. The size of the
- // data retrieved from the dereferenced address is the size of an address
- // on the target machine.
+ // the top of the stack is treated as an address. The second stack entry is
+ // treated as an "address space identifier" for those architectures that
+ // support multiple address spaces. The top two stack elements are popped,
+ // a data item is retrieved through an implementation-defined address
+ // calculation and pushed as the new stack top. The size of the data
+ // retrieved from the dereferenced address is the size of an address on the
+ // target machine.
//----------------------------------------------------------------------
case DW_OP_xderef:
if (error_ptr)
@@ -1661,16 +1684,13 @@ bool DWARFExpression::Evaluate(
//
// Opcode Operand 1
// --------------- ----------------------------------------------------
- // DW_OP_const1u 1-byte unsigned integer constant
- // DW_OP_const1s 1-byte signed integer constant
- // DW_OP_const2u 2-byte unsigned integer constant
- // DW_OP_const2s 2-byte signed integer constant
- // DW_OP_const4u 4-byte unsigned integer constant
- // DW_OP_const4s 4-byte signed integer constant
- // DW_OP_const8u 8-byte unsigned integer constant
- // DW_OP_const8s 8-byte signed integer constant
- // DW_OP_constu unsigned LEB128 integer constant
- // DW_OP_consts signed LEB128 integer constant
+ // DW_OP_const1u 1-byte unsigned integer constant DW_OP_const1s
+ // 1-byte signed integer constant DW_OP_const2u 2-byte unsigned integer
+ // constant DW_OP_const2s 2-byte signed integer constant DW_OP_const4u
+ // 4-byte unsigned integer constant DW_OP_const4s 4-byte signed integer
+ // constant DW_OP_const8u 8-byte unsigned integer constant DW_OP_const8s
+ // 8-byte signed integer constant DW_OP_constu unsigned LEB128 integer
+ // constant DW_OP_consts signed LEB128 integer constant
//----------------------------------------------------------------------
case DW_OP_const1u:
stack.push_back(Scalar((uint8_t)opcodes.GetU8(&offset)));
@@ -1789,9 +1809,9 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_rot
// OPERANDS: none
// DESCRIPTION: Rotates the first three stack entries. The entry at
- // the top of the stack becomes the third stack entry, the second
- // entry becomes the top of the stack, and the third entry becomes
- // the second entry.
+ // the top of the stack becomes the third stack entry, the second entry
+ // becomes the top of the stack, and the third entry becomes the second
+ // entry.
//----------------------------------------------------------------------
case DW_OP_rot:
if (stack.size() < 3) {
@@ -1853,8 +1873,8 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_div
// OPERANDS: none
// DESCRIPTION: pops the top two stack values, divides the former second
- // entry by the former top of the stack using signed division, and
- // pushes the result.
+ // entry by the former top of the stack using signed division, and pushes
+ // the result.
//----------------------------------------------------------------------
case DW_OP_div:
if (stack.size() < 2) {
@@ -1905,8 +1925,8 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_mod
// OPERANDS: none
// DESCRIPTION: pops the top two stack values and pushes the result of
- // the calculation: former second stack entry modulo the former top of
- // the stack.
+ // the calculation: former second stack entry modulo the former top of the
+ // stack.
//----------------------------------------------------------------------
case DW_OP_mod:
if (stack.size() < 2) {
@@ -2050,8 +2070,8 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_shl
// OPERANDS: none
// DESCRIPTION: pops the top two stack entries, shifts the former
- // second entry left by the number of bits specified by the former top
- // of the stack, and pushes the result.
+ // second entry left by the number of bits specified by the former top of
+ // the stack, and pushes the result.
//----------------------------------------------------------------------
case DW_OP_shl:
if (stack.size() < 2) {
@@ -2096,8 +2116,8 @@ bool DWARFExpression::Evaluate(
// OPERANDS: none
// DESCRIPTION: pops the top two stack entries, shifts the former second
// entry right arithmetically (divide the magnitude by 2, keep the same
- // sign for the result) by the number of bits specified by the former
- // top of the stack, and pushes the result.
+ // sign for the result) by the number of bits specified by the former top
+ // of the stack, and pushes the result.
//----------------------------------------------------------------------
case DW_OP_shra:
if (stack.size() < 2) {
@@ -2136,8 +2156,8 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_skip
// OPERANDS: int16_t
// DESCRIPTION: An unconditional branch. Its single operand is a 2-byte
- // signed integer constant. The 2-byte constant is the number of bytes
- // of the DWARF expression to skip forward or backward from the current
+ // signed integer constant. The 2-byte constant is the number of bytes of
+ // the DWARF expression to skip forward or backward from the current
// operation, beginning after the 2-byte constant.
//----------------------------------------------------------------------
case DW_OP_skip: {
@@ -2156,11 +2176,10 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_bra
// OPERANDS: int16_t
// DESCRIPTION: A conditional branch. Its single operand is a 2-byte
- // signed integer constant. This operation pops the top of stack. If
- // the value popped is not the constant 0, the 2-byte constant operand
- // is the number of bytes of the DWARF expression to skip forward or
- // backward from the current operation, beginning after the 2-byte
- // constant.
+ // signed integer constant. This operation pops the top of stack. If the
+ // value popped is not the constant 0, the 2-byte constant operand is the
+ // number of bytes of the DWARF expression to skip forward or backward from
+ // the current operation, beginning after the 2-byte constant.
//----------------------------------------------------------------------
case DW_OP_bra:
if (stack.empty()) {
@@ -2537,15 +2556,15 @@ bool DWARFExpression::Evaluate(
// OPERANDS: 1
// ULEB128: byte size of the piece
// DESCRIPTION: The operand describes the size in bytes of the piece of
- // the object referenced by the DWARF expression whose result is at the
- // top of the stack. If the piece is located in a register, but does not
- // occupy the entire register, the placement of the piece within that
- // register is defined by the ABI.
+ // the object referenced by the DWARF expression whose result is at the top
+ // of the stack. If the piece is located in a register, but does not occupy
+ // the entire register, the placement of the piece within that register is
+ // defined by the ABI.
//
- // Many compilers store a single variable in sets of registers, or store
- // a variable partially in memory and partially in registers.
- // DW_OP_piece provides a way of describing how large a part of a
- // variable a particular DWARF expression refers to.
+ // Many compilers store a single variable in sets of registers, or store a
+ // variable partially in memory and partially in registers. DW_OP_piece
+ // provides a way of describing how large a part of a variable a particular
+ // DWARF expression refers to.
//----------------------------------------------------------------------
case DW_OP_piece: {
const uint64_t piece_byte_size = opcodes.GetULEB128(&offset);
@@ -2555,8 +2574,8 @@ bool DWARFExpression::Evaluate(
if (stack.empty()) {
// In a multi-piece expression, this means that the current piece is
- // not available.
- // Fill with zeros for now by resizing the data and appending it
+ // not available. Fill with zeros for now by resizing the data and
+ // appending it
curr_piece.ResizeData(piece_byte_size);
::memset(curr_piece.GetBuffer().GetBytes(), 0, piece_byte_size);
pieces.AppendDataToHostBuffer(curr_piece);
@@ -2646,9 +2665,9 @@ bool DWARFExpression::Evaluate(
// Check if this is the first piece?
if (op_piece_offset == 0) {
- // This is the first piece, we should push it back onto the stack so
- // subsequent
- // pieces will be able to access this piece and add to it
+ // This is the first piece, we should push it back onto the stack
+ // so subsequent pieces will be able to access this piece and add
+ // to it
if (pieces.AppendDataToHostBuffer(curr_piece) == 0) {
if (error_ptr)
error_ptr->SetErrorString("failed to append piece data");
@@ -2706,7 +2725,7 @@ bool DWARFExpression::Evaluate(
if (error_ptr) {
error_ptr->SetErrorStringWithFormat(
"unable to extract DW_OP_bit_piece(bit_size = %" PRIu64
- ", bit_offset = %" PRIu64 ") from an addresss value.",
+ ", bit_offset = %" PRIu64 ") from an address value.",
piece_bit_size, piece_bit_offset);
}
return false;
@@ -2727,11 +2746,11 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_push_object_address
// OPERANDS: none
// DESCRIPTION: Pushes the address of the object currently being
- // evaluated as part of evaluation of a user presented expression.
- // This object may correspond to an independent variable described by
- // its own DIE or it may be a component of an array, structure, or class
- // whose address has been dynamically determined by an earlier step
- // during user expression evaluation.
+ // evaluated as part of evaluation of a user presented expression. This
+ // object may correspond to an independent variable described by its own
+ // DIE or it may be a component of an array, structure, or class whose
+ // address has been dynamically determined by an earlier step during user
+ // expression evaluation.
//----------------------------------------------------------------------
case DW_OP_push_object_address:
if (object_address_ptr)
@@ -2749,21 +2768,20 @@ bool DWARFExpression::Evaluate(
// OPERANDS:
// uint16_t compile unit relative offset of a DIE
// DESCRIPTION: Performs subroutine calls during evaluation
- // of a DWARF expression. The operand is the 2-byte unsigned offset
- // of a debugging information entry in the current compilation unit.
+ // of a DWARF expression. The operand is the 2-byte unsigned offset of a
+ // debugging information entry in the current compilation unit.
//
// Operand interpretation is exactly like that for DW_FORM_ref2.
//
- // This operation transfers control of DWARF expression evaluation
- // to the DW_AT_location attribute of the referenced DIE. If there is
- // no such attribute, then there is no effect. Execution of the DWARF
- // expression of a DW_AT_location attribute may add to and/or remove from
- // values on the stack. Execution returns to the point following the call
- // when the end of the attribute is reached. Values on the stack at the
- // time of the call may be used as parameters by the called expression
- // and values left on the stack by the called expression may be used as
- // return values by prior agreement between the calling and called
- // expressions.
+ // This operation transfers control of DWARF expression evaluation to the
+ // DW_AT_location attribute of the referenced DIE. If there is no such
+ // attribute, then there is no effect. Execution of the DWARF expression of
+ // a DW_AT_location attribute may add to and/or remove from values on the
+ // stack. Execution returns to the point following the call when the end of
+ // the attribute is reached. Values on the stack at the time of the call
+ // may be used as parameters by the called expression and values left on
+ // the stack by the called expression may be used as return values by prior
+ // agreement between the calling and called expressions.
//----------------------------------------------------------------------
case DW_OP_call2:
if (error_ptr)
@@ -2774,22 +2792,21 @@ bool DWARFExpression::Evaluate(
// OPERANDS: 1
// uint32_t compile unit relative offset of a DIE
// DESCRIPTION: Performs a subroutine call during evaluation of a DWARF
- // expression. For DW_OP_call4, the operand is a 4-byte unsigned offset
- // of a debugging information entry in the current compilation unit.
+ // expression. For DW_OP_call4, the operand is a 4-byte unsigned offset of
+ // a debugging information entry in the current compilation unit.
//
// Operand interpretation DW_OP_call4 is exactly like that for
// DW_FORM_ref4.
//
- // This operation transfers control of DWARF expression evaluation
- // to the DW_AT_location attribute of the referenced DIE. If there is
- // no such attribute, then there is no effect. Execution of the DWARF
- // expression of a DW_AT_location attribute may add to and/or remove from
- // values on the stack. Execution returns to the point following the call
- // when the end of the attribute is reached. Values on the stack at the
- // time of the call may be used as parameters by the called expression
- // and values left on the stack by the called expression may be used as
- // return values by prior agreement between the calling and called
- // expressions.
+ // This operation transfers control of DWARF expression evaluation to the
+ // DW_AT_location attribute of the referenced DIE. If there is no such
+ // attribute, then there is no effect. Execution of the DWARF expression of
+ // a DW_AT_location attribute may add to and/or remove from values on the
+ // stack. Execution returns to the point following the call when the end of
+ // the attribute is reached. Values on the stack at the time of the call
+ // may be used as parameters by the called expression and values left on
+ // the stack by the called expression may be used as return values by prior
+ // agreement between the calling and called expressions.
//----------------------------------------------------------------------
case DW_OP_call4:
if (error_ptr)
@@ -2800,9 +2817,8 @@ bool DWARFExpression::Evaluate(
// OPCODE: DW_OP_stack_value
// OPERANDS: None
// DESCRIPTION: Specifies that the object does not exist in memory but
- // rather is a constant value. The value from the top of the stack is
- // the value to be used. This is the actual object value and not the
- // location.
+ // rather is a constant value. The value from the top of the stack is the
+ // value to be used. This is the actual object value and not the location.
//----------------------------------------------------------------------
case DW_OP_stack_value:
stack.back().SetValueType(Value::eValueTypeScalar);
@@ -2841,8 +2857,8 @@ bool DWARFExpression::Evaluate(
// opcode, DW_OP_GNU_push_tls_address)
// OPERANDS: none
// DESCRIPTION: Pops a TLS offset from the stack, converts it to
- // an address in the current thread's thread-local storage block,
- // and pushes it on the stack.
+ // an address in the current thread's thread-local storage block, and
+ // pushes it on the stack.
//----------------------------------------------------------------------
case DW_OP_form_tls_address:
case DW_OP_GNU_push_tls_address: {
@@ -2893,8 +2909,8 @@ bool DWARFExpression::Evaluate(
// OPERANDS: 1
// ULEB128: index to the .debug_addr section
// DESCRIPTION: Pushes an address to the stack from the .debug_addr
- // section with the base address specified by the DW_AT_addr_base
- // attribute and the 0 based index is the ULEB128 encoded index.
+ // section with the base address specified by the DW_AT_addr_base attribute
+ // and the 0 based index is the ULEB128 encoded index.
//----------------------------------------------------------------------
case DW_OP_GNU_addr_index: {
if (!dwarf_cu) {
@@ -2984,7 +3000,7 @@ bool DWARFExpression::Evaluate(
return true; // Return true on success
}
-size_t DWARFExpression::LocationListSize(const DWARFCompileUnit *dwarf_cu,
+size_t DWARFExpression::LocationListSize(const DWARFUnit *dwarf_cu,
const DataExtractor &debug_loc_data,
lldb::offset_t offset) {
const lldb::offset_t debug_loc_offset = offset;
@@ -3008,7 +3024,7 @@ size_t DWARFExpression::LocationListSize(const DWARFCompileUnit *dwarf_cu,
}
bool DWARFExpression::AddressRangeForLocationListEntry(
- const DWARFCompileUnit *dwarf_cu, const DataExtractor &debug_loc_data,
+ const DWARFUnit *dwarf_cu, const DataExtractor &debug_loc_data,
lldb::offset_t *offset_ptr, lldb::addr_t &low_pc, lldb::addr_t &high_pc) {
if (!debug_loc_data.ValidOffset(*offset_ptr))
return false;
@@ -3242,11 +3258,11 @@ bool DWARFExpression::PrintDWARFExpression(Stream &s, const DataExtractor &data,
}
void DWARFExpression::PrintDWARFLocationList(
- Stream &s, const DWARFCompileUnit *cu, const DataExtractor &debug_loc_data,
+ Stream &s, const DWARFUnit *cu, const DataExtractor &debug_loc_data,
lldb::offset_t offset) {
uint64_t start_addr, end_addr;
- uint32_t addr_size = DWARFCompileUnit::GetAddressByteSize(cu);
- s.SetAddressByteSize(DWARFCompileUnit::GetAddressByteSize(cu));
+ uint32_t addr_size = DWARFUnit::GetAddressByteSize(cu);
+ s.SetAddressByteSize(DWARFUnit::GetAddressByteSize(cu));
dw_addr_t base_addr = cu ? cu->GetBaseAddress() : 0;
while (debug_loc_data.ValidOffset(offset)) {
start_addr = debug_loc_data.GetMaxU64(&offset, addr_size);
diff --git a/source/Expression/DiagnosticManager.cpp b/source/Expression/DiagnosticManager.cpp
index ae20feb910dd..a98d30339b4a 100644
--- a/source/Expression/DiagnosticManager.cpp
+++ b/source/Expression/DiagnosticManager.cpp
@@ -22,9 +22,8 @@ void DiagnosticManager::Dump(Log *log) {
std::string str = GetString();
- // GetString() puts a separator after each diagnostic.
- // We want to remove the last '\n' because log->PutCString will add one for
- // us.
+ // GetString() puts a separator after each diagnostic. We want to remove the
+ // last '\n' because log->PutCString will add one for us.
if (str.size() && str.back() == '\n') {
str.pop_back();
diff --git a/source/Expression/ExpressionSourceCode.cpp b/source/Expression/ExpressionSourceCode.cpp
index d60a12888065..abbb332fac48 100644
--- a/source/Expression/ExpressionSourceCode.cpp
+++ b/source/Expression/ExpressionSourceCode.cpp
@@ -93,15 +93,15 @@ public:
m_state = CURRENT_FILE_POPPED;
}
- // An entry is valid if it occurs before the current line in
- // the current file.
+ // An entry is valid if it occurs before the current line in the current
+ // file.
bool IsValidEntry(uint32_t line) {
switch (m_state) {
case CURRENT_FILE_NOT_YET_PUSHED:
return true;
case CURRENT_FILE_PUSHED:
- // If we are in file included in the current file,
- // the entry should be added.
+ // If we are in file included in the current file, the entry should be
+ // added.
if (m_file_stack.back() != m_current_file)
return true;
diff --git a/source/Expression/ExpressionVariable.cpp b/source/Expression/ExpressionVariable.cpp
index a97180029a84..bce9a87bfb47 100644
--- a/source/Expression/ExpressionVariable.cpp
+++ b/source/Expression/ExpressionVariable.cpp
@@ -9,6 +9,7 @@
#include "lldb/Expression/ExpressionVariable.h"
#include "lldb/Expression/IRExecutionUnit.h"
+#include "lldb/Target/Target.h"
#include "lldb/Utility/Log.h"
using namespace lldb_private;
@@ -69,8 +70,8 @@ void PersistentExpressionState::RegisterExecutionUnit(
execution_unit_sp->GetJittedGlobalVariables()) {
if (global_var.m_remote_addr != LLDB_INVALID_ADDRESS) {
// Demangle the name before inserting it, so that lookups by the ConstStr
- // of the demangled name
- // will find the mangled one (needed for looking up metadata pointers.)
+ // of the demangled name will find the mangled one (needed for looking up
+ // metadata pointers.)
Mangled mangler(global_var.m_name);
mangler.GetDemangledName(lldb::eLanguageTypeUnknown);
m_symbol_map[global_var.m_name.GetCString()] = global_var.m_remote_addr;
@@ -80,3 +81,13 @@ void PersistentExpressionState::RegisterExecutionUnit(
}
}
}
+
+ConstString PersistentExpressionState::GetNextPersistentVariableName(
+ Target &target, llvm::StringRef Prefix) {
+ llvm::SmallString<64> name;
+ {
+ llvm::raw_svector_ostream os(name);
+ os << Prefix << target.GetNextPersistentVariableIndex();
+ }
+ return ConstString(name);
+}
diff --git a/source/Expression/FunctionCaller.cpp b/source/Expression/FunctionCaller.cpp
index 6f60f8bf9c13..9742ed0b270e 100644
--- a/source/Expression/FunctionCaller.cpp
+++ b/source/Expression/FunctionCaller.cpp
@@ -48,7 +48,8 @@ FunctionCaller::FunctionCaller(ExecutionContextScope &exe_scope,
m_function_return_type(return_type),
m_wrapper_function_name("__lldb_caller_function"),
m_wrapper_struct_name("__lldb_caller_struct"), m_wrapper_args_addrs(),
- m_arg_values(arg_value_list), m_compiled(false), m_JITted(false) {
+ m_struct_valid(false), m_arg_values(arg_value_list), m_compiled(false),
+ m_JITted(false) {
m_jit_process_wp = lldb::ProcessWP(exe_scope.CalculateProcess());
// Can't make a FunctionCaller without a process.
assert(m_jit_process_wp.lock());
@@ -90,8 +91,12 @@ bool FunctionCaller::WriteFunctionWrapper(
m_jit_start_addr, m_jit_end_addr, m_execution_unit_sp, exe_ctx,
can_interpret, eExecutionPolicyAlways));
- if (!jit_error.Success())
+ if (!jit_error.Success()) {
+ diagnostic_manager.Printf(eDiagnosticSeverityError,
+ "Error in PrepareForExecution: %s.",
+ jit_error.AsCString());
return false;
+ }
if (m_parser->GetGenerateDebugInfo()) {
lldb::ModuleSP jit_module_sp(m_execution_unit_sp->GetJITModule());
@@ -318,9 +323,9 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
DiagnosticManager &diagnostic_manager, Value &results) {
lldb::ExpressionResults return_value = lldb::eExpressionSetupError;
- // FunctionCaller::ExecuteFunction execution is always just to get the result.
- // Do make sure we ignore
- // breakpoints, unwind on error, and don't try to debug it.
+ // FunctionCaller::ExecuteFunction execution is always just to get the
+ // result. Do make sure we ignore breakpoints, unwind on error, and don't try
+ // to debug it.
EvaluateExpressionOptions real_options = options;
real_options.SetDebug(false);
real_options.SetUnwindOnError(true);
@@ -355,9 +360,8 @@ lldb::ExpressionResults FunctionCaller::ExecuteFunction(
return lldb::eExpressionSetupError;
// We need to make sure we record the fact that we are running an expression
- // here
- // otherwise this fact will fail to be recorded when fetching an Objective-C
- // object description
+ // here otherwise this fact will fail to be recorded when fetching an
+ // Objective-C object description
if (exe_ctx.GetProcessPtr())
exe_ctx.GetProcessPtr()->SetRunningUserExpression(true);
diff --git a/source/Expression/IRDynamicChecks.cpp b/source/Expression/IRDynamicChecks.cpp
index 0c8cba2050c0..e0a7dca4113d 100644
--- a/source/Expression/IRDynamicChecks.cpp
+++ b/source/Expression/IRDynamicChecks.cpp
@@ -109,17 +109,17 @@ static std::string PrintValue(llvm::Value *V, bool truncate = false) {
//----------------------------------------------------------------------
/// @class Instrumenter IRDynamicChecks.cpp
-/// @brief Finds and instruments individual LLVM IR instructions
+/// Finds and instruments individual LLVM IR instructions
///
-/// When instrumenting LLVM IR, it is frequently desirable to first search
-/// for instructions, and then later modify them. This way iterators
-/// remain intact, and multiple passes can look at the same code base without
+/// When instrumenting LLVM IR, it is frequently desirable to first search for
+/// instructions, and then later modify them. This way iterators remain
+/// intact, and multiple passes can look at the same code base without
/// treading on each other's toes.
///
/// The Instrumenter class implements this functionality. A client first
-/// calls Inspect on a function, which populates a list of instructions to
-/// be instrumented. Then, later, when all passes' Inspect functions have
-/// been called, the client calls Instrument, which adds the desired
+/// calls Inspect on a function, which populates a list of instructions to be
+/// instrumented. Then, later, when all passes' Inspect functions have been
+/// called, the client calls Instrument, which adds the desired
/// instrumentation.
///
/// A subclass of Instrumenter must override InstrumentInstruction, which
@@ -200,8 +200,8 @@ protected:
}
//------------------------------------------------------------------
- /// Determine whether a single instruction is interesting to
- /// instrument, and, if so, call RegisterInstruction
+ /// Determine whether a single instruction is interesting to instrument,
+ /// and, if so, call RegisterInstruction
///
/// @param[in] i
/// The instruction to be inspected.
@@ -250,8 +250,8 @@ protected:
}
//------------------------------------------------------------------
- /// Build a function pointer for a function with signature
- /// void (*)(uint8_t*) with a given address
+ /// Build a function pointer for a function with signature void
+ /// (*)(uint8_t*) with a given address
///
/// @param[in] start_address
/// The address of the function.
@@ -275,8 +275,8 @@ protected:
}
//------------------------------------------------------------------
- /// Build a function pointer for a function with signature
- /// void (*)(uint8_t*, uint8_t*) with a given address
+ /// Build a function pointer for a function with signature void
+ /// (*)(uint8_t*, uint8_t*) with a given address
///
/// @param[in] start_address
/// The address of the function.
diff --git a/source/Expression/IRExecutionUnit.cpp b/source/Expression/IRExecutionUnit.cpp
index be53f37e0bcc..e34a4c7fac52 100644
--- a/source/Expression/IRExecutionUnit.cpp
+++ b/source/Expression/IRExecutionUnit.cpp
@@ -33,6 +33,7 @@
#include "lldb/Utility/Log.h"
#include "lldb/../../source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
+#include "lldb/../../source/Plugins/ObjectFile/JIT/ObjectFileJIT.h"
using namespace lldb_private;
@@ -362,13 +363,10 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
ReportAllocations(*m_execution_engine_ap);
// We have to do this after calling ReportAllocations because for the MCJIT,
- // getGlobalValueAddress
- // will cause the JIT to perform all relocations. That can only be done once,
- // and has to happen
- // after we do the remapping from local -> remote.
- // That means we don't know the local address of the Variables, but we don't
- // need that for anything,
- // so that's okay.
+ // getGlobalValueAddress will cause the JIT to perform all relocations. That
+ // can only be done once, and has to happen after we do the remapping from
+ // local -> remote. That means we don't know the local address of the
+ // Variables, but we don't need that for anything, so that's okay.
std::function<void(llvm::GlobalValue &)> RegisterOneValue = [this](
llvm::GlobalValue &val) {
@@ -379,8 +377,8 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
lldb::addr_t remote_addr = GetRemoteAddressForLocal(var_ptr_addr);
// This is a really unfortunae API that sometimes returns local addresses
- // and sometimes returns remote addresses, based on whether
- // the variable was relocated during ReportAllocations or not.
+ // and sometimes returns remote addresses, based on whether the variable
+ // was relocated during ReportAllocations or not.
if (remote_addr == LLDB_INVALID_ADDRESS) {
remote_addr = var_ptr_addr;
@@ -584,33 +582,9 @@ lldb::SectionType IRExecutionUnit::GetSectionTypeFromSectionName(
default:
break;
}
- } else if (name.startswith("__apple_") || name.startswith(".apple_")) {
-#if 0
- const uint32_t name_idx = name[0] == '_' ? 8 : 7;
- llvm::StringRef apple_name(name.substr(name_idx));
- switch (apple_name[0])
- {
- case 'n':
- if (apple_name.equals("names"))
- sect_type = lldb::eSectionTypeDWARFAppleNames;
- else if (apple_name.equals("namespac") || apple_name.equals("namespaces"))
- sect_type = lldb::eSectionTypeDWARFAppleNamespaces;
- break;
- case 't':
- if (apple_name.equals("types"))
- sect_type = lldb::eSectionTypeDWARFAppleTypes;
- break;
- case 'o':
- if (apple_name.equals("objc"))
- sect_type = lldb::eSectionTypeDWARFAppleObjC;
- break;
- default:
- break;
- }
-#else
+ } else if (name.startswith("__apple_") || name.startswith(".apple_"))
sect_type = lldb::eSectionTypeInvalid;
-#endif
- } else if (name.equals("__objc_imageinfo"))
+ else if (name.equals("__objc_imageinfo"))
sect_type = lldb::eSectionTypeOther;
}
return sect_type;
@@ -906,8 +880,8 @@ lldb::addr_t IRExecutionUnit::FindInSymbols(
if (get_external_load_address(load_address, sc_list, sc)) {
return load_address;
}
- // if there are any searches we try after this, add an sc_list.Clear() in an
- // "else" clause here
+ // if there are any searches we try after this, add an sc_list.Clear() in
+ // an "else" clause here
if (best_internal_load_address != LLDB_INVALID_ADDRESS) {
return best_internal_load_address;
@@ -1124,6 +1098,7 @@ bool IRExecutionUnit::CommitOneAllocation(lldb::ProcessSP &process_sp,
case lldb::eSectionTypeDWARFAppleTypes:
case lldb::eSectionTypeDWARFAppleNamespaces:
case lldb::eSectionTypeDWARFAppleObjC:
+ case lldb::eSectionTypeDWARFGNUDebugAltLink:
error.Clear();
break;
default:
@@ -1251,15 +1226,18 @@ bool IRExecutionUnit::GetArchitecture(lldb_private::ArchSpec &arch) {
lldb::ModuleSP IRExecutionUnit::GetJITModule() {
ExecutionContext exe_ctx(GetBestExecutionContextScope());
Target *target = exe_ctx.GetTargetPtr();
- if (target) {
- lldb::ModuleSP jit_module_sp = lldb_private::Module::CreateJITModule(
- std::static_pointer_cast<lldb_private::ObjectFileJITDelegate>(
- shared_from_this()));
- if (jit_module_sp) {
- bool changed = false;
- jit_module_sp->SetLoadAddress(*target, 0, true, changed);
- }
- return jit_module_sp;
- }
- return lldb::ModuleSP();
+ if (!target)
+ return nullptr;
+
+ auto Delegate = std::static_pointer_cast<lldb_private::ObjectFileJITDelegate>(
+ shared_from_this());
+
+ lldb::ModuleSP jit_module_sp =
+ lldb_private::Module::CreateModuleFromObjectFile<ObjectFileJIT>(Delegate);
+ if (!jit_module_sp)
+ return nullptr;
+
+ bool changed = false;
+ jit_module_sp->SetLoadAddress(*target, 0, true, changed);
+ return jit_module_sp;
}
diff --git a/source/Expression/IRInterpreter.cpp b/source/Expression/IRInterpreter.cpp
index a809bff20039..abf86b739f07 100644
--- a/source/Expression/IRInterpreter.cpp
+++ b/source/Expression/IRInterpreter.cpp
@@ -154,16 +154,10 @@ public:
switch (type_size) {
case 1:
- scalar = (uint8_t)u64value;
- break;
case 2:
- scalar = (uint16_t)u64value;
- break;
case 4:
- scalar = (uint32_t)u64value;
- break;
case 8:
- scalar = (uint64_t)u64value;
+ scalar = llvm::APInt(type_size*8, u64value);
break;
default:
return false;
@@ -1567,8 +1561,8 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function,
return false;
}
- // Push all function arguments to the argument list that will
- // be passed to the call function thread plan
+ // Push all function arguments to the argument list that will be passed
+ // to the call function thread plan
for (int i = 0; i < numArgs; i++) {
// Get details of this argument
llvm::Value *arg_op = call_inst->getArgOperand(i);
diff --git a/source/Expression/IRMemoryMap.cpp b/source/Expression/IRMemoryMap.cpp
index 817c75e66a3b..1953e80852ff 100644
--- a/source/Expression/IRMemoryMap.cpp
+++ b/source/Expression/IRMemoryMap.cpp
@@ -49,8 +49,8 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
//
// The memory returned by this function will never be written to. The only
// point is that it should not shadow process memory if possible, so that
- // expressions processing real values from the process do not use the
- // wrong data.
+ // expressions processing real values from the process do not use the wrong
+ // data.
//
// If the process can in fact allocate memory (CanJIT() lets us know this)
// then this can be accomplished just be allocating memory in the inferior.
@@ -93,8 +93,8 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
}
// Now, if it's possible to use the GetMemoryRegionInfo API to detect mapped
- // regions, walk forward through memory until a region is found that
- // has adequate space for our allocation.
+ // regions, walk forward through memory until a region is found that has
+ // adequate space for our allocation.
if (process_is_alive) {
const uint64_t end_of_memory = process_sp->GetAddressByteSize() == 8
? 0xffffffffffffffffull
@@ -188,16 +188,12 @@ bool IRMemoryMap::IntersectsAllocation(lldb::addr_t addr, size_t size) const {
AllocationMap::const_iterator iter = m_allocations.lower_bound(addr);
// Since we only know that the returned interval begins at a location greater
- // than or
- // equal to where the given interval begins, it's possible that the given
- // interval
- // intersects either the returned interval or the previous interval. Thus, we
- // need to
- // check both. Note that we only need to check these two intervals. Since all
- // intervals
- // are disjoint it is not possible that an adjacent interval does not
- // intersect, but a
- // non-adjacent interval does intersect.
+ // than or equal to where the given interval begins, it's possible that the
+ // given interval intersects either the returned interval or the previous
+ // interval. Thus, we need to check both. Note that we only need to check
+ // these two intervals. Since all intervals are disjoint it is not possible
+ // that an adjacent interval does not intersect, but a non-adjacent interval
+ // does intersect.
if (iter != m_allocations.end()) {
if (AllocationsIntersect(addr, size, iter->second.m_process_start,
iter->second.m_size))
@@ -217,16 +213,15 @@ bool IRMemoryMap::IntersectsAllocation(lldb::addr_t addr, size_t size) const {
bool IRMemoryMap::AllocationsIntersect(lldb::addr_t addr1, size_t size1,
lldb::addr_t addr2, size_t size2) {
// Given two half open intervals [A, B) and [X, Y), the only 6 permutations
- // that satisfy
- // A<B and X<Y are the following:
+ // that satisfy A<B and X<Y are the following:
// A B X Y
// A X B Y (intersects)
// A X Y B (intersects)
// X A B Y (intersects)
// X A Y B (intersects)
// X Y A B
- // The first is B <= X, and the last is Y <= A.
- // So the condition is !(B <= X || Y <= A)), or (X < B && A < Y)
+ // The first is B <= X, and the last is Y <= A. So the condition is !(B <= X
+ // || Y <= A)), or (X < B && A < Y)
return (addr2 < (addr1 + size1)) && (addr1 < (addr2 + size2));
}
@@ -306,15 +301,21 @@ lldb::addr_t IRMemoryMap::Malloc(size_t size, uint8_t alignment,
lldb::addr_t allocation_address = LLDB_INVALID_ADDRESS;
lldb::addr_t aligned_address = LLDB_INVALID_ADDRESS;
- size_t alignment_mask = alignment - 1;
size_t allocation_size;
- if (size == 0)
+ if (size == 0) {
+ // FIXME: Malloc(0) should either return an invalid address or assert, in
+ // order to cut down on unnecessary allocations.
allocation_size = alignment;
- else
- allocation_size = (size & alignment_mask)
- ? ((size + alignment) & (~alignment_mask))
- : size;
+ } else {
+ // Round up the requested size to an aligned value.
+ allocation_size = llvm::alignTo(size, alignment);
+
+ // The process page cache does not see the requested alignment. We can't
+ // assume its result will be any more than 1-byte aligned. To work around
+ // this, request `alignment - 1` additional bytes.
+ allocation_size += alignment - 1;
+ }
switch (policy) {
default:
diff --git a/source/Expression/LLVMUserExpression.cpp b/source/Expression/LLVMUserExpression.cpp
index 83acb8249ba6..fc32bfbd37a2 100644
--- a/source/Expression/LLVMUserExpression.cpp
+++ b/source/Expression/LLVMUserExpression.cpp
@@ -74,9 +74,8 @@ LLVMUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
lldb::UserExpressionSP &shared_ptr_to_me,
lldb::ExpressionVariableSP &result) {
// The expression log is quite verbose, and if you're just tracking the
- // execution of the
- // expression, it's quite convenient to have these logs come out with the STEP
- // log as well.
+ // execution of the expression, it's quite convenient to have these logs come
+ // out with the STEP log as well.
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_EXPRESSIONS |
LIBLLDB_LOG_STEP));
diff --git a/source/Expression/Materializer.cpp b/source/Expression/Materializer.cpp
index 39fc5c8c2539..74a965e015ce 100644
--- a/source/Expression/Materializer.cpp
+++ b/source/Expression/Materializer.cpp
@@ -77,7 +77,8 @@ public:
void MakeAllocation(IRMemoryMap &map, Status &err) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- // Allocate a spare memory area to store the persistent variable's contents.
+ // Allocate a spare memory area to store the persistent variable's
+ // contents.
Status allocate_error;
const bool zero_memory = false;
@@ -230,8 +231,8 @@ public:
ExpressionVariable::EVIsProgramReference &&
!m_persistent_variable_sp->m_live_sp) {
// If the reference comes from the program, then the
- // ClangExpressionVariable's
- // live variable data hasn't been set up yet. Do this now.
+ // ClangExpressionVariable's live variable data hasn't been set up yet.
+ // Do this now.
lldb::addr_t location;
Status read_error;
@@ -256,10 +257,8 @@ public:
frame_bottom != LLDB_INVALID_ADDRESS && location >= frame_bottom &&
location <= frame_top) {
// If the variable is resident in the stack frame created by the
- // expression,
- // then it cannot be relied upon to stay around. We treat it as
- // needing
- // reallocation.
+ // expression, then it cannot be relied upon to stay around. We
+ // treat it as needing reallocation.
m_persistent_variable_sp->m_flags |=
ExpressionVariable::EVIsLLDBAllocated;
m_persistent_variable_sp->m_flags |=
@@ -889,9 +888,11 @@ public:
return;
}
- ConstString name = m_delegate
- ? m_delegate->GetName()
- : persistent_state->GetNextPersistentVariableName();
+ ConstString name =
+ m_delegate
+ ? m_delegate->GetName()
+ : persistent_state->GetNextPersistentVariableName(
+ *target_sp, persistent_state->GetPersistentVariablePrefix());
lldb::ExpressionVariableSP ret = persistent_state->CreatePersistentVariable(
exe_scope, name, m_type, map.GetByteOrder(), map.GetAddressByteSize());
diff --git a/source/Expression/REPL.cpp b/source/Expression/REPL.cpp
index 84a6405f3268..a441e381985c 100644
--- a/source/Expression/REPL.cpp
+++ b/source/Expression/REPL.cpp
@@ -61,10 +61,8 @@ lldb::REPLSP REPL::Create(Status &err, lldb::LanguageType language,
std::string REPL::GetSourcePath() {
ConstString file_basename = GetSourceFileBasename();
-
- FileSpec tmpdir_file_spec;
- if (HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir,
- tmpdir_file_spec)) {
+ FileSpec tmpdir_file_spec = HostInfo::GetProcessTempDir();
+ if (tmpdir_file_spec) {
tmpdir_file_spec.GetFilename().SetCString(file_basename.AsCString());
m_repl_source_path = tmpdir_file_spec.GetPath();
} else {
@@ -243,10 +241,8 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) {
IOHandler::Type::REPL, IOHandler::Type::CommandInterpreter)) {
// We typed "quit" or an alias to quit so we need to check if the
// command interpreter is above us and tell it that it is done as
- // well
- // so we don't drop back into the command interpreter if we have
- // already
- // quit
+ // well so we don't drop back into the command interpreter if we
+ // have already quit
lldb::IOHandlerSP io_handler_sp(ci.GetIOHandler());
if (io_handler_sp)
io_handler_sp->SetIsDone(true);
@@ -444,8 +440,8 @@ void REPL::IOHandlerInputComplete(IOHandler &io_handler, std::string &code) {
}
}
- // Don't complain about the REPL process going away if we are in the process
- // of quitting.
+ // Don't complain about the REPL process going away if we are in the
+ // process of quitting.
if (!did_quit && (!process_sp || !process_sp->IsAlive())) {
error_sp->Printf(
"error: REPL process is no longer alive, exiting REPL\n");
@@ -542,11 +538,9 @@ Status REPL::RunLoop() {
debugger.PushIOHandler(io_handler_sp);
- // Check if we are in dedicated REPL mode where LLDB was start with the
- // "--repl" option
- // from the command line. Currently we know this by checking if the debugger
- // already
- // has a IOHandler thread.
+ // Check if we are in dedicated REPL mode where LLDB was start with the "--
+ // repl" option from the command line. Currently we know this by checking if
+ // the debugger already has a IOHandler thread.
if (!debugger.HasIOHandlerThread()) {
// The debugger doesn't have an existing IOHandler thread, so this must be
// dedicated REPL mode...
@@ -566,8 +560,8 @@ Status REPL::RunLoop() {
io_handler_sp->WaitForPop();
if (m_dedicated_repl_mode) {
- // If we were in dedicated REPL mode we would have started the
- // IOHandler thread, and we should kill our process
+ // If we were in dedicated REPL mode we would have started the IOHandler
+ // thread, and we should kill our process
lldb::ProcessSP process_sp = m_target.GetProcessSP();
if (process_sp && process_sp->IsAlive())
process_sp->Destroy(false);
diff --git a/source/Expression/UserExpression.cpp b/source/Expression/UserExpression.cpp
index 3386bc4577ae..34945fdcbfa1 100644
--- a/source/Expression/UserExpression.cpp
+++ b/source/Expression/UserExpression.cpp
@@ -179,9 +179,8 @@ lldb::ExpressionResults UserExpression::Evaluate(
execution_policy = eExecutionPolicyNever;
// We need to set the expression execution thread here, turns out parse can
- // call functions in the process of
- // looking up symbols, which will escape the context set by exe_ctx passed to
- // Execute.
+ // call functions in the process of looking up symbols, which will escape the
+ // context set by exe_ctx passed to Execute.
lldb::ThreadSP thread_sp = exe_ctx.GetThreadSP();
ThreadList::ExpressionExecutionThreadPusher execution_thread_pusher(
thread_sp);
@@ -198,9 +197,9 @@ lldb::ExpressionResults UserExpression::Evaluate(
else
full_prefix = option_prefix;
- // If the language was not specified in the expression command,
- // set it to the language in the target's properties if
- // specified, else default to the langage for the frame.
+ // If the language was not specified in the expression command, set it to the
+ // language in the target's properties if specified, else default to the
+ // langage for the frame.
if (language == lldb::eLanguageTypeUnknown) {
if (target->GetLanguage() != lldb::eLanguageTypeUnknown)
language = target->GetLanguage();
diff --git a/source/Host/CMakeLists.txt b/source/Host/CMakeLists.txt
index 2b6f0e48a3f2..5a92447edf30 100644
--- a/source/Host/CMakeLists.txt
+++ b/source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@ macro(add_host_subdirectory group)
source_group(${group} FILES ${ARGN})
endmacro()
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Objective-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Objective-C++ would require that
+# all LLVM/Clang modules are Objective-C++ compatible (which they are likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+ string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+ string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
add_host_subdirectory(common
common/File.cpp
common/FileCache.cpp
@@ -39,11 +51,6 @@ add_host_subdirectory(common
common/UDPSocket.cpp
)
-# Keep track of whether we want to provide a define for the
-# Python's architecture-specific lib path (i.e. where a
-# Python lldb module would go).
-set (get_python_libdir 0)
-
if (NOT LLDB_DISABLE_LIBEDIT)
add_host_subdirectory(common
common/Editline.cpp
@@ -54,10 +61,6 @@ add_host_subdirectory(posix
posix/ConnectionFileDescriptorPosix.cpp
)
-if(NOT LLDB_DISABLE_PYTHON)
- list(APPEND LLDB_PLUGINS lldbPluginScriptInterpreterPython)
-endif()
-
if (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_host_subdirectory(windows
windows/ConnectionGenericFileWindows.cpp
@@ -74,11 +77,6 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
windows/Windows.cpp
)
else()
- if (NOT LLDB_DISABLE_PYTHON)
- # We'll grab the arch-specific python libdir on POSIX systems.
- set (get_python_libdir 1)
- endif()
-
add_host_subdirectory(posix
posix/DomainSocket.cpp
posix/FileSystem.cpp
@@ -92,10 +90,9 @@ else()
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
- add_host_subdirectory(macosx
- macosx/Host.mm
- macosx/HostInfoMacOSX.mm
- macosx/HostThreadMacOSX.mm
+ add_subdirectory(macosx/objcxx)
+ set(LLDBObjCLibs lldbHostMacOSXObjCXX)
+ add_host_subdirectory(maqcosx
macosx/Symbols.cpp
macosx/cfcpp/CFCBundle.cpp
macosx/cfcpp/CFCData.cpp
@@ -144,19 +141,6 @@ else()
endif()
endif()
-if (${get_python_libdir})
- # Call a python script to gather the arch-specific libdir for
- # modules like the lldb module.
- execute_process(
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/get_relative_lib_dir.py
- RESULT_VARIABLE get_libdir_status
- OUTPUT_VARIABLE relative_libdir
- )
- if (get_libdir_status EQUAL 0)
- add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${relative_libdir}")
- endif()
-endif()
-
set(EXTRA_LIBS)
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
list(APPEND EXTRA_LIBS kvm)
@@ -177,16 +161,16 @@ endif()
add_lldb_library(lldbHost
${HOST_SOURCES}
-
+
LINK_LIBS
lldbCore
- lldbInterpreter
lldbSymbol
lldbTarget
lldbUtility
- ${LLDB_PLUGINS}
${EXTRA_LIBS}
-
+ ${LLDBObjCLibs}
+
LINK_COMPONENTS
+ Object
Support
)
diff --git a/source/Host/android/HostInfoAndroid.cpp b/source/Host/android/HostInfoAndroid.cpp
index 27ce17a76d70..a96033283212 100644
--- a/source/Host/android/HostInfoAndroid.cpp
+++ b/source/Host/android/HostInfoAndroid.cpp
@@ -79,13 +79,10 @@ bool HostInfoAndroid::ComputeTempFileBaseDirectory(FileSpec &file_spec) {
bool success = HostInfoLinux::ComputeTempFileBaseDirectory(file_spec);
// On Android, there is no path which is guaranteed to be writable. If the
- // user has not
- // provided a path via an environment variable, the generic algorithm will
- // deduce /tmp, which
- // is plain wrong. In that case we have an invalid directory, we substitute
- // the path with
- // /data/local/tmp, which is correct at least in some cases (i.e., when
- // running as shell user).
+ // user has not provided a path via an environment variable, the generic
+ // algorithm will deduce /tmp, which is plain wrong. In that case we have an
+ // invalid directory, we substitute the path with /data/local/tmp, which is
+ // correct at least in some cases (i.e., when running as shell user).
if (!success || !file_spec.Exists())
file_spec = FileSpec("/data/local/tmp", false);
diff --git a/source/Host/common/Editline.cpp b/source/Host/common/Editline.cpp
index 7b580dde656a..329c0c1f3b70 100644
--- a/source/Host/common/Editline.cpp
+++ b/source/Host/common/Editline.cpp
@@ -33,8 +33,8 @@ using namespace lldb_private::line_editor;
// doesn't explicitly initialize the curses termcap library, which it gets away
// with until TERM is set to VT100 where it stumbles over an implementation
// assumption that may not exist on other platforms. The setupterm() function
-// would normally require headers that don't work gracefully in this context, so
-// the function declaraction has been hoisted here.
+// would normally require headers that don't work gracefully in this context,
+// so the function declaraction has been hoisted here.
#if defined(__APPLE__)
extern "C" {
int setupterm(char *term, int fildes, int *errret);
@@ -43,12 +43,10 @@ int setupterm(char *term, int fildes, int *errret);
#endif
// Editline uses careful cursor management to achieve the illusion of editing a
-// multi-line block of text
-// with a single line editor. Preserving this illusion requires fairly careful
-// management of cursor
-// state. Read and understand the relationship between DisplayInput(),
-// MoveCursor(), SetCurrentLine(),
-// and SaveEditedLine() before making changes.
+// multi-line block of text with a single line editor. Preserving this
+// illusion requires fairly careful management of cursor state. Read and
+// understand the relationship between DisplayInput(), MoveCursor(),
+// SetCurrentLine(), and SaveEditedLine() before making changes.
#define ESCAPE "\x1b"
#define ANSI_FAINT ESCAPE "[2m"
@@ -70,8 +68,7 @@ int setupterm(char *term, int fildes, int *errret);
#define EditLineStringFormatSpec "%s"
// use #defines so wide version functions and structs will resolve to old
-// versions
-// for case of libedit not built with wide char support
+// versions for case of libedit not built with wide char support
#define history_w history
#define history_winit history_init
#define history_wend history_end
@@ -145,10 +142,8 @@ bool IsInputPending(FILE *file) {
// FIXME: This will be broken on Windows if we ever re-enable Editline. You
// can't use select
// on something that isn't a socket. This will have to be re-written to not
- // use a FILE*, but
- // instead use some kind of yet-to-be-created abstraction that select-like
- // functionality on
- // non-socket objects.
+ // use a FILE*, but instead use some kind of yet-to-be-created abstraction
+ // that select-like functionality on non-socket objects.
const int fd = fileno(file);
SelectHelper select_helper;
select_helper.SetTimeout(std::chrono::microseconds(0));
@@ -160,13 +155,13 @@ namespace lldb_private {
namespace line_editor {
typedef std::weak_ptr<EditlineHistory> EditlineHistoryWP;
-// EditlineHistory objects are sometimes shared between multiple
-// Editline instances with the same program name.
+// EditlineHistory objects are sometimes shared between multiple Editline
+// instances with the same program name.
class EditlineHistory {
private:
- // Use static GetHistory() function to get a EditlineHistorySP to one of these
- // objects
+ // 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 = history_winit();
@@ -436,11 +431,10 @@ unsigned char Editline::RecallHistory(bool earlier) {
if (history_w(pHistory, &history_event, H_FIRST) == -1)
return CC_ERROR;
- // Save any edits to the "live" entry in case we return by moving forward in
- // history
- // (it would be more bash-like to save over any current entry, but libedit
- // doesn't
- // offer the ability to add entries anywhere except the end.)
+ // Save any edits to the "live" entry in case we return by moving forward
+ // in history (it would be more bash-like to save over any current entry,
+ // but libedit doesn't offer the ability to add entries anywhere except the
+ // end.)
SaveEditedLine();
m_live_history_lines = m_input_lines;
m_in_history = true;
@@ -466,8 +460,7 @@ unsigned char Editline::RecallHistory(bool earlier) {
DisplayInput();
// Prepare to edit the last line when moving to previous entry, or the first
- // line
- // when moving to next entry
+ // line when moving to next entry
SetCurrentLine(m_current_line_index =
earlier ? (int)m_input_lines.size() - 1 : 0);
MoveCursor(CursorLocation::BlockEnd, CursorLocation::EditingPrompt);
@@ -490,8 +483,8 @@ int Editline::GetCharacter(EditLineGetCharType *c) {
}
if (m_multiline_enabled) {
- // Detect when the number of rows used for this input line changes due to an
- // edit
+ // Detect when the number of rows used for this input line changes due to
+ // an edit
int lineLength = (int)((info->lastchar - info->buffer) + GetPromptWidth());
int new_line_rows = (lineLength / m_terminal_width) + 1;
if (m_current_line_rows != -1 && new_line_rows != m_current_line_rows) {
@@ -510,12 +503,10 @@ int Editline::GetCharacter(EditLineGetCharType *c) {
char ch = 0;
// This mutex is locked by our caller (GetLine). Unlock it while we read a
- // character
- // (blocking operation), so we do not hold the mutex indefinitely. This
- // gives a chance
- // for someone to interrupt us. After Read returns, immediately lock the
- // mutex again and
- // check if we were interrupted.
+ // character (blocking operation), so we do not hold the mutex
+ // indefinitely. This gives a chance for someone to interrupt us. After
+ // 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);
m_output_mutex.lock();
@@ -614,7 +605,8 @@ unsigned char Editline::EndOrAddLineCommand(int ch) {
// Save any edits to this line
SaveEditedLine();
- // If this is the end of the last line, consider whether to add a line instead
+ // If this is the end of the last line, consider whether to add a line
+ // instead
const LineInfoW *info = el_wline(m_editline);
if (m_current_line_index == m_input_lines.size() - 1 &&
info->cursor == info->lastchar) {
@@ -653,8 +645,8 @@ unsigned char Editline::DeleteNextCharCommand(int ch) {
return CC_REFRESH;
}
- // Fail when at the end of the last line, except when ^D is pressed on
- // the line is empty, in which case it is treated as EOF
+ // Fail when at the end of the last line, except when ^D is pressed on the
+ // line is empty, in which case it is treated as EOF
if (m_current_line_index == m_input_lines.size() - 1) {
if (ch == 4 && info->buffer == info->lastchar) {
fprintf(m_output_file, "^D\n");
@@ -685,7 +677,8 @@ unsigned char Editline::DeleteNextCharCommand(int ch) {
unsigned char Editline::DeletePreviousCharCommand(int ch) {
LineInfoW *info = const_cast<LineInfoW *>(el_wline(m_editline));
- // Just delete the previous character normally when not at the start of a line
+ // Just delete the previous character normally when not at the start of a
+ // line
if (info->cursor > info->buffer) {
el_deletestr(m_editline, 1);
return CC_REFRESH;
@@ -709,8 +702,7 @@ unsigned char Editline::DeletePreviousCharCommand(int ch) {
DisplayInput(m_current_line_index);
// Put the cursor back where libedit expects it to be before returning to
- // editing
- // by telling libedit about the newly inserted text
+ // editing by telling libedit about the newly inserted text
MoveCursor(CursorLocation::BlockEnd, CursorLocation::EditingPrompt);
el_winsertstr(m_editline, priorLine.c_str());
return CC_REDISPLAY;
@@ -762,7 +754,8 @@ unsigned char Editline::NextLineCommand(int ch) {
EditLineStringType(indentation, EditLineCharType(' ')));
}
- // Move down past the current line using newlines to force scrolling if needed
+ // Move down past the current line using newlines to force scrolling if
+ // needed
SetCurrentLine(m_current_line_index + 1);
const LineInfoW *info = el_wline(m_editline);
int cursor_position = (int)((info->cursor - info->buffer) + GetPromptWidth());
@@ -824,8 +817,7 @@ unsigned char Editline::FixIndentationCommand(int ch) {
DisplayInput(m_current_line_index);
// Reposition the cursor back on the original line and prepare to restart
- // editing
- // with a new cursor position
+ // editing with a new cursor position
SetCurrentLine(m_current_line_index);
MoveCursor(CursorLocation::BlockEnd, CursorLocation::EditingPrompt);
m_revert_cursor_index = cursor_position + indent_correction;
@@ -945,9 +937,9 @@ void Editline::ConfigureEditor(bool multiline) {
m_multiline_enabled = multiline;
if (m_editline) {
- // Disable edit mode to stop the terminal from flushing all input
- // during the call to el_end() since we expect to have multiple editline
- // instances in this program.
+ // Disable edit mode to stop the terminal from flushing all input during
+ // the call to el_end() since we expect to have multiple editline instances
+ // in this program.
el_set(m_editline, EL_EDITMODE, 0);
el_end(m_editline);
}
@@ -973,7 +965,8 @@ void Editline::ConfigureEditor(bool multiline) {
return Editline::InstanceFor(editline)->GetCharacter(c);
}));
- // Commands used for multiline support, registered whether or not they're used
+ // Commands used for multiline support, registered whether or not they're
+ // used
el_wset(m_editline, EL_ADDFN, EditLineConstString("lldb-break-line"),
EditLineConstString("Insert a line break"),
(EditlineCommandCallbackType)([](EditLine *editline, int ch) {
@@ -1031,13 +1024,11 @@ void Editline::ConfigureEditor(bool multiline) {
return Editline::InstanceFor(editline)->FixIndentationCommand(ch);
}));
- // Register the complete callback under two names for compatibility with older
- // clients using
- // custom .editrc files (largely because libedit has a bad bug where if you
- // have a bind command
- // that tries to bind to a function name that doesn't exist, it can corrupt
- // the heap and
- // crash your process later.)
+ // Register the complete callback under two names for compatibility with
+ // older clients using custom .editrc files (largely because libedit has a
+ // bad bug where if you have a bind command that tries to bind to a function
+ // name that doesn't exist, it can corrupt the heap and crash your process
+ // later.)
EditlineCommandCallbackType complete_callback = [](EditLine *editline,
int ch) {
return Editline::InstanceFor(editline)->TabCommand(ch);
@@ -1118,8 +1109,7 @@ void Editline::ConfigureEditor(bool multiline) {
NULL);
// Escape is absorbed exiting edit mode, so re-register important
- // sequences
- // without the prefix
+ // sequences without the prefix
el_set(m_editline, EL_BIND, "-a", "[A", "lldb-previous-line", NULL);
el_set(m_editline, EL_BIND, "-a", "[B", "lldb-next-line", NULL);
el_set(m_editline, EL_BIND, "-a", "[\\^", "lldb-revert-line", NULL);
@@ -1176,18 +1166,18 @@ Editline::Editline(const char *editline_name, FILE *input_file,
Editline::~Editline() {
if (m_editline) {
- // Disable edit mode to stop the terminal from flushing all input
- // during the call to el_end() since we expect to have multiple editline
- // instances in this program.
+ // Disable edit mode to stop the terminal from flushing all input during
+ // the call to el_end() since we expect to have multiple editline instances
+ // in this program.
el_set(m_editline, EL_EDITMODE, 0);
el_end(m_editline);
m_editline = nullptr;
}
- // EditlineHistory objects are sometimes shared between multiple
- // Editline instances with the same program name. So just release
- // our shared pointer and if we are the last owner, it will save the
- // history to the history save file automatically.
+ // EditlineHistory objects are sometimes shared between multiple Editline
+ // instances with the same program name. So just release our shared pointer
+ // and if we are the last owner, it will save the history to the history save
+ // file automatically.
m_history_sp.reset();
}
@@ -1313,8 +1303,8 @@ bool Editline::GetLines(int first_line_number, StringList &lines,
bool &interrupted) {
ConfigureEditor(true);
- // Print the initial input lines, then move the cursor back up to the start of
- // input
+ // Print the initial input lines, then move the cursor back up to the start
+ // of input
SetBaseLineNumber(first_line_number);
m_input_lines = std::vector<EditLineStringType>();
m_input_lines.insert(m_input_lines.begin(), EditLineConstString(""));
diff --git a/source/Host/common/File.cpp b/source/Host/common/File.cpp
index 6ee4e894756b..3c3d55df2207 100644
--- a/source/Host/common/File.cpp
+++ b/source/Host/common/File.cpp
@@ -100,7 +100,7 @@ int File::GetDescriptor() const {
// Don't open the file descriptor if we don't need to, just get it from the
// stream if we have one.
if (StreamIsValid()) {
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
return _fileno(m_stream);
#else
return fileno(m_stream);
@@ -126,8 +126,8 @@ FILE *File::GetStream() {
const char *mode = GetStreamOpenModeFromOptions(m_options);
if (mode) {
if (!m_should_close_fd) {
-// We must duplicate the file descriptor if we don't own it because
-// when you call fdopen, the stream will own the fd
+// We must duplicate the file descriptor if we don't own it because when you
+// call fdopen, the stream will own the fd
#ifdef _WIN32
m_descriptor = ::_dup(GetDescriptor());
#else
@@ -139,8 +139,8 @@ FILE *File::GetStream() {
m_stream =
llvm::sys::RetryAfterSignal(nullptr, ::fdopen, m_descriptor, mode);
- // If we got a stream, then we own the stream and should no
- // longer own the descriptor because fclose() will close it for us
+ // If we got a stream, then we own the stream and should no longer own
+ // the descriptor because fclose() will close it for us
if (m_stream) {
m_own_stream = true;
@@ -315,7 +315,7 @@ Status File::GetFileSpec(FileSpec &file_spec) const {
if (::fcntl(GetDescriptor(), F_GETPATH, path) == -1)
error.SetErrorToErrno();
else
- file_spec.SetFile(path, false);
+ file_spec.SetFile(path, false, FileSpec::Style::native);
} else {
error.SetErrorString("invalid file handle");
}
@@ -330,7 +330,7 @@ Status File::GetFileSpec(FileSpec &file_spec) const {
error.SetErrorToErrno();
else {
path[len] = '\0';
- file_spec.SetFile(path, false);
+ file_spec.SetFile(path, false, FileSpec::Style::native);
}
}
#else
diff --git a/source/Host/common/Host.cpp b/source/Host/common/Host.cpp
index 97581185ad9e..d2848254779e 100644
--- a/source/Host/common/Host.cpp
+++ b/source/Host/common/Host.cpp
@@ -59,7 +59,6 @@
#include "lldb/Target/FileAction.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/UnixSignals.h"
-#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
@@ -120,9 +119,8 @@ HostThread Host::StartMonitoringChildProcess(
#ifndef __linux__
//------------------------------------------------------------------
-// Scoped class that will disable thread canceling when it is
-// constructed, and exception safely restore the previous value it
-// when it goes out of scope.
+// Scoped class that will disable thread canceling when it is constructed, and
+// exception safely restore the previous value it when it goes out of scope.
//------------------------------------------------------------------
class ScopedPThreadCancelDisabler {
public:
@@ -271,8 +269,7 @@ static thread_result_t MonitorChildProcessThreadFunction(void *arg) {
__FUNCTION__, arg);
break;
}
- // If the callback returns true, it means this process should
- // exit
+ // If the callback returns true, it means this process should exit
if (callback_return) {
if (log)
log->Printf("%s (arg = %p) thread exiting because callback "
@@ -423,7 +420,7 @@ FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) {
Dl_info info;
if (::dladdr(host_addr, &info)) {
if (info.dli_fname)
- module_filespec.SetFile(info.dli_fname, true);
+ module_filespec.SetFile(info.dli_fname, true, FileSpec::Style::native);
}
#endif
return module_filespec;
@@ -466,15 +463,17 @@ MonitorShellCommand(std::shared_ptr<ShellInfo> shell_info, lldb::pid_t pid,
Status Host::RunShellCommand(const char *command, const FileSpec &working_dir,
int *status_ptr, int *signo_ptr,
std::string *command_output_ptr,
- uint32_t timeout_sec, bool run_in_default_shell) {
+ const Timeout<std::micro> &timeout,
+ bool run_in_default_shell) {
return RunShellCommand(Args(command), working_dir, status_ptr, signo_ptr,
- command_output_ptr, timeout_sec, run_in_default_shell);
+ command_output_ptr, timeout, run_in_default_shell);
}
Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
int *status_ptr, int *signo_ptr,
std::string *command_output_ptr,
- uint32_t timeout_sec, bool run_in_default_shell) {
+ const Timeout<std::micro> &timeout,
+ bool run_in_default_shell) {
Status error;
ProcessLaunchInfo launch_info;
launch_info.SetArchitecture(HostInfo::GetArchitecture());
@@ -498,11 +497,10 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
llvm::SmallString<PATH_MAX> output_file_path;
if (command_output_ptr) {
- // Create a temporary file to get the stdout/stderr and redirect the
- // output of the command into this file. We will later read this file
- // if all goes well and fill the data into "command_output_ptr"
- FileSpec tmpdir_file_spec;
- if (HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, tmpdir_file_spec)) {
+ // Create a temporary file to get the stdout/stderr and redirect the output
+ // of the command into this file. We will later read this file if all goes
+ // well and fill the data into "command_output_ptr"
+ if (FileSpec tmpdir_file_spec = HostInfo::GetProcessTempDir()) {
tmpdir_file_spec.AppendPathComponent("lldb-shell-output.%%%%%%");
llvm::sys::fs::createUniqueFile(tmpdir_file_spec.GetPath(),
output_file_path);
@@ -539,18 +537,14 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
error.SetErrorString("failed to get process ID");
if (error.Success()) {
- bool timed_out = false;
- shell_info_sp->process_reaped.WaitForValueEqualTo(
- true, std::chrono::seconds(timeout_sec), &timed_out);
- if (timed_out) {
+ if (!shell_info_sp->process_reaped.WaitForValueEqualTo(true, timeout)) {
error.SetErrorString("timed out waiting for shell command to complete");
// Kill the process since it didn't complete within the timeout specified
Kill(pid, SIGKILL);
// Wait for the monitor callback to get the message
- timed_out = false;
shell_info_sp->process_reaped.WaitForValueEqualTo(
- true, std::chrono::seconds(1), &timed_out);
+ true, std::chrono::seconds(1));
} else {
if (status_ptr)
*status_ptr = shell_info_sp->status;
@@ -581,7 +575,8 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
return error;
}
-// The functions below implement process launching for non-Apple-based platforms
+// The functions below implement process launching for non-Apple-based
+// platforms
#if !defined(__APPLE__)
Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
std::unique_ptr<ProcessLauncher> delegate_launcher;
@@ -596,8 +591,7 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
HostProcess process = launcher.LaunchProcess(launch_info, error);
// TODO(zturner): It would be better if the entire HostProcess were returned
- // instead of writing
- // it into this structure.
+ // instead of writing it into this structure.
launch_info.SetProcessID(process.GetProcessId());
return error;
diff --git a/source/Host/common/HostInfoBase.cpp b/source/Host/common/HostInfoBase.cpp
index aff887f9f1d2..4de6953a91e3 100644
--- a/source/Host/common/HostInfoBase.cpp
+++ b/source/Host/common/HostInfoBase.cpp
@@ -33,19 +33,19 @@ using namespace lldb_private;
namespace {
//----------------------------------------------------------------------
-// The HostInfoBaseFields is a work around for windows not supporting
-// static variables correctly in a thread safe way. Really each of the
-// variables in HostInfoBaseFields should live in the functions in which
-// they are used and each one should be static, but the work around is
-// in place to avoid this restriction. Ick.
+// The HostInfoBaseFields is a work around for windows not supporting static
+// variables correctly in a thread safe way. Really each of the variables in
+// HostInfoBaseFields should live in the functions in which they are used and
+// each one should be static, but the work around is in place to avoid this
+// restriction. Ick.
//----------------------------------------------------------------------
struct HostInfoBaseFields {
~HostInfoBaseFields() {
if (m_lldb_process_tmp_dir.Exists()) {
// Remove the LLDB temporary directory if we have one. Set "recurse" to
- // true to all files that were created for the LLDB process can be cleaned
- // up.
+ // true to all files that were created for the LLDB process can be
+ // cleaned up.
llvm::sys::fs::remove_directories(m_lldb_process_tmp_dir.GetPath());
}
}
@@ -58,7 +58,6 @@ struct HostInfoBaseFields {
FileSpec m_lldb_so_dir;
FileSpec m_lldb_support_exe_dir;
FileSpec m_lldb_headers_dir;
- FileSpec m_lldb_python_dir;
FileSpec m_lldb_clang_resource_dir;
FileSpec m_lldb_system_plugin_dir;
FileSpec m_lldb_user_plugin_dir;
@@ -111,152 +110,88 @@ llvm::Optional<HostInfoBase::ArchitectureKind> HostInfoBase::ParseArchitectureKi
.Default(llvm::None);
}
-bool HostInfoBase::GetLLDBPath(lldb::PathType type, FileSpec &file_spec) {
- file_spec.Clear();
+FileSpec HostInfoBase::GetShlibDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success = HostInfo::ComputeSharedLibraryDirectory(g_fields->m_lldb_so_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "shlib dir -> `{0}`", g_fields->m_lldb_so_dir);
+ });
+ return success ? g_fields->m_lldb_so_dir : FileSpec();
+}
-#if defined(LLDB_DISABLE_PYTHON)
- if (type == lldb::ePathTypePythonDir)
- return false;
-#endif
-
- FileSpec *result = nullptr;
- switch (type) {
- case lldb::ePathTypeLLDBShlibDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success =
- HostInfo::ComputeSharedLibraryDirectory(g_fields->m_lldb_so_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf("HostInfoBase::GetLLDBPath(ePathTypeLLDBShlibDir) => '%s'",
- g_fields->m_lldb_so_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_so_dir;
- } break;
- case lldb::ePathTypeSupportExecutableDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeSupportExeDirectory(
- g_fields->m_lldb_support_exe_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf(
- "HostInfoBase::GetLLDBPath(ePathTypeSupportExecutableDir) => '%s'",
- g_fields->m_lldb_support_exe_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_support_exe_dir;
- } break;
- case lldb::ePathTypeHeaderDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeHeaderDirectory(g_fields->m_lldb_headers_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf("HostInfoBase::GetLLDBPath(ePathTypeHeaderDir) => '%s'",
- g_fields->m_lldb_headers_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_headers_dir;
- } break;
- case lldb::ePathTypePythonDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputePythonDirectory(g_fields->m_lldb_python_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf("HostInfoBase::GetLLDBPath(ePathTypePythonDir) => '%s'",
- g_fields->m_lldb_python_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_python_dir;
- } break;
- case lldb::ePathTypeClangDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success =
- HostInfo::ComputeClangDirectory(g_fields->m_lldb_clang_resource_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf(
- "HostInfoBase::GetLLDBPath(ePathTypeClangResourceDir) => '%s'",
- g_fields->m_lldb_clang_resource_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_clang_resource_dir;
- } break;
- case lldb::ePathTypeLLDBSystemPlugins: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeSystemPluginsDirectory(
- g_fields->m_lldb_system_plugin_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf(
- "HostInfoBase::GetLLDBPath(ePathTypeLLDBSystemPlugins) => '%s'",
- g_fields->m_lldb_system_plugin_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_system_plugin_dir;
- } break;
- case lldb::ePathTypeLLDBUserPlugins: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeUserPluginsDirectory(
- g_fields->m_lldb_user_plugin_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf(
- "HostInfoBase::GetLLDBPath(ePathTypeLLDBUserPlugins) => '%s'",
- g_fields->m_lldb_user_plugin_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_user_plugin_dir;
- } break;
- case lldb::ePathTypeLLDBTempSystemDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeProcessTempFileDirectory(
- g_fields->m_lldb_process_tmp_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf(
- "HostInfoBase::GetLLDBPath(ePathTypeLLDBTempSystemDir) => '%s'",
- g_fields->m_lldb_process_tmp_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_process_tmp_dir;
- } break;
- case lldb::ePathTypeGlobalLLDBTempSystemDir: {
- static llvm::once_flag g_once_flag;
- static bool success = false;
- llvm::call_once(g_once_flag, []() {
- success = HostInfo::ComputeGlobalTempFileDirectory(
- g_fields->m_lldb_global_tmp_dir);
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- if (log)
- log->Printf("HostInfoBase::GetLLDBPath("
- "ePathTypeGlobalLLDBTempSystemDir) => '%s'",
- g_fields->m_lldb_global_tmp_dir.GetPath().c_str());
- });
- if (success)
- result = &g_fields->m_lldb_global_tmp_dir;
- } break;
- }
+FileSpec HostInfoBase::GetSupportExeDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success =
+ HostInfo::ComputeSupportExeDirectory(g_fields->m_lldb_support_exe_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "support exe dir -> `{0}`", g_fields->m_lldb_support_exe_dir);
+ });
+ return success ? g_fields->m_lldb_support_exe_dir : FileSpec();
+}
- if (!result)
- return false;
- file_spec = *result;
- return true;
+FileSpec HostInfoBase::GetHeaderDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success = HostInfo::ComputeHeaderDirectory(g_fields->m_lldb_headers_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "header dir -> `{0}`", g_fields->m_lldb_headers_dir);
+ });
+ return success ? g_fields->m_lldb_headers_dir : FileSpec();
+}
+
+FileSpec HostInfoBase::GetSystemPluginDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success = HostInfo::ComputeSystemPluginsDirectory(
+ g_fields->m_lldb_system_plugin_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "system plugin dir -> `{0}`",
+ g_fields->m_lldb_system_plugin_dir);
+ });
+ return success ? g_fields->m_lldb_system_plugin_dir : FileSpec();
+}
+
+FileSpec HostInfoBase::GetUserPluginDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success =
+ HostInfo::ComputeUserPluginsDirectory(g_fields->m_lldb_user_plugin_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "user plugin dir -> `{0}`", g_fields->m_lldb_user_plugin_dir);
+ });
+ return success ? g_fields->m_lldb_user_plugin_dir : FileSpec();
+}
+
+FileSpec HostInfoBase::GetProcessTempDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success = HostInfo::ComputeProcessTempFileDirectory(
+ g_fields->m_lldb_process_tmp_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "process temp dir -> `{0}`",
+ g_fields->m_lldb_process_tmp_dir);
+ });
+ return success ? g_fields->m_lldb_process_tmp_dir : FileSpec();
+}
+
+FileSpec HostInfoBase::GetGlobalTempDir() {
+ static llvm::once_flag g_once_flag;
+ static bool success = false;
+ llvm::call_once(g_once_flag, []() {
+ success = HostInfo::ComputeGlobalTempFileDirectory(
+ g_fields->m_lldb_global_tmp_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ LLDB_LOG(log, "global temp dir -> `{0}`", g_fields->m_lldb_global_tmp_dir);
+ });
+ return success ? g_fields->m_lldb_global_tmp_dir : FileSpec();
}
ArchSpec HostInfoBase::GetAugmentedArchSpec(llvm::StringRef triple) {
@@ -282,14 +217,12 @@ ArchSpec HostInfoBase::GetAugmentedArchSpec(llvm::StringRef triple) {
bool HostInfoBase::ComputeSharedLibraryDirectory(FileSpec &file_spec) {
// To get paths related to LLDB we get the path to the executable that
- // contains this function. On MacOSX this will be "LLDB.framework/.../LLDB",
- // on linux this is assumed to be the "lldb" main executable. If LLDB on
- // linux is actually in a shared library (liblldb.so) then this function will
- // need to be modified to "do the right thing".
+ // contains this function. On MacOSX this will be "LLDB.framework/.../LLDB".
+ // On other posix systems, we will get .../lib(64|32)?/liblldb.so.
- FileSpec lldb_file_spec(
- Host::GetModuleFileSpecForHostAddress(reinterpret_cast<void *>(
- reinterpret_cast<intptr_t>(HostInfoBase::GetLLDBPath))));
+ FileSpec lldb_file_spec(Host::GetModuleFileSpecForHostAddress(
+ reinterpret_cast<void *>(reinterpret_cast<intptr_t>(
+ HostInfoBase::ComputeSharedLibraryDirectory))));
// This is necessary because when running the testsuite the shlib might be a
// symbolic link inside the Python resource dir.
@@ -302,7 +235,8 @@ bool HostInfoBase::ComputeSharedLibraryDirectory(FileSpec &file_spec) {
}
bool HostInfoBase::ComputeSupportExeDirectory(FileSpec &file_spec) {
- return GetLLDBPath(lldb::ePathTypeLLDBShlibDir, file_spec);
+ file_spec = GetShlibDir();
+ return bool(file_spec);
}
bool HostInfoBase::ComputeProcessTempFileDirectory(FileSpec &file_spec) {
@@ -353,11 +287,9 @@ bool HostInfoBase::ComputeSystemPluginsDirectory(FileSpec &file_spec) {
return false;
}
-bool HostInfoBase::ComputeClangDirectory(FileSpec &file_spec) { return false; }
-
bool HostInfoBase::ComputeUserPluginsDirectory(FileSpec &file_spec) {
- // TODO(zturner): Figure out how to compute the user plugins directory for all
- // platforms.
+ // TODO(zturner): Figure out how to compute the user plugins directory for
+ // all platforms.
return false;
}
@@ -375,6 +307,7 @@ void HostInfoBase::ComputeHostArchitectureSupport(ArchSpec &arch_32,
case llvm::Triple::aarch64:
case llvm::Triple::ppc64:
+ case llvm::Triple::ppc64le:
case llvm::Triple::x86_64:
arch_64.SetTriple(triple);
arch_32.SetTriple(triple.get32BitArchVariant());
diff --git a/source/Host/common/MainLoop.cpp b/source/Host/common/MainLoop.cpp
index 6cbb5a842562..65158c942934 100644
--- a/source/Host/common/MainLoop.cpp
+++ b/source/Host/common/MainLoop.cpp
@@ -26,7 +26,7 @@
#if HAVE_SYS_EVENT_H
#include <sys/event.h>
-#elif defined(LLVM_ON_WIN32)
+#elif defined(_WIN32)
#include <winsock2.h>
#elif defined(__ANDROID__)
#include <sys/syscall.h>
@@ -34,14 +34,14 @@
#include <poll.h>
#endif
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
#define POLL WSAPoll
#else
#define POLL poll
#endif
#if SIGNAL_POLLING_UNSUPPORTED
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
typedef int sigset_t;
typedef int siginfo_t;
#endif
@@ -209,8 +209,8 @@ Status MainLoop::RunImpl::Poll() {
void MainLoop::RunImpl::ProcessEvents() {
#ifdef __ANDROID__
- // Collect first all readable file descriptors into a separate vector and then
- // iterate over it to invoke callbacks. Iterating directly over
+ // Collect first all readable file descriptors into a separate vector and
+ // then iterate over it to invoke callbacks. Iterating directly over
// loop.m_read_fds is not possible because the callbacks can modify the
// container which could invalidate the iterator.
std::vector<IOObject::WaitableHandle> fds;
@@ -262,7 +262,7 @@ MainLoop::~MainLoop() {
MainLoop::ReadHandleUP MainLoop::RegisterReadObject(const IOObjectSP &object_sp,
const Callback &callback,
Status &error) {
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
if (object_sp->GetFdType() != IOObject:: eFDTypeSocket) {
error.SetErrorString("MainLoop: non-socket types unsupported on Windows");
return nullptr;
@@ -285,8 +285,7 @@ MainLoop::ReadHandleUP MainLoop::RegisterReadObject(const IOObjectSP &object_sp,
}
// We shall block the signal, then install the signal handler. The signal will
-// be unblocked in
-// the Run() function to check for signal delivery.
+// be unblocked in the Run() function to check for signal delivery.
MainLoop::SignalHandleUP
MainLoop::RegisterSignal(int signo, const Callback &callback, Status &error) {
#ifdef SIGNAL_POLLING_UNSUPPORTED
@@ -321,9 +320,9 @@ MainLoop::RegisterSignal(int signo, const Callback &callback, Status &error) {
assert(ret == 0);
#endif
- // If we're using kqueue, the signal needs to be unblocked in order to recieve
- // it. If using pselect/ppoll, we need to block it, and later unblock it as a
- // part of the system call.
+ // If we're using kqueue, the signal needs to be unblocked in order to
+ // recieve it. If using pselect/ppoll, we need to block it, and later unblock
+ // it as a part of the system call.
ret = pthread_sigmask(HAVE_SYS_EVENT_H ? SIG_UNBLOCK : SIG_BLOCK,
&new_action.sa_mask, &old_set);
assert(ret == 0 && "pthread_sigmask failed");
diff --git a/source/Host/common/MonitoringProcessLauncher.cpp b/source/Host/common/MonitoringProcessLauncher.cpp
index f1fcd0b44c15..76c11454f573 100644
--- a/source/Host/common/MonitoringProcessLauncher.cpp
+++ b/source/Host/common/MonitoringProcessLauncher.cpp
@@ -8,11 +8,7 @@
//===----------------------------------------------------------------------===//
#include "lldb/Host/MonitoringProcessLauncher.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/HostProcess.h"
-#include "lldb/Target/Platform.h"
-#include "lldb/Target/Process.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
@@ -32,36 +28,23 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info,
ProcessLaunchInfo resolved_info(launch_info);
error.Clear();
- char exe_path[PATH_MAX];
-
- PlatformSP host_platform_sp(Platform::GetHostPlatform());
-
- const ArchSpec &arch_spec = resolved_info.GetArchitecture();
FileSpec exe_spec(resolved_info.GetExecutableFile());
llvm::sys::fs::file_status stats;
status(exe_spec.GetPath(), stats);
- if (!is_regular_file(stats)) {
- ModuleSpec module_spec(exe_spec, arch_spec);
- lldb::ModuleSP exe_module_sp;
- error =
- host_platform_sp->ResolveExecutable(module_spec, exe_module_sp, NULL);
-
- if (error.Fail())
- return HostProcess();
-
- if (exe_module_sp) {
- exe_spec = exe_module_sp->GetFileSpec();
- status(exe_spec.GetPath(), stats);
- }
+ if (!exists(stats)) {
+ exe_spec.ResolvePath();
+ status(exe_spec.GetPath(), stats);
+ }
+ if (!exists(stats)) {
+ exe_spec.ResolveExecutableLocation();
+ status(exe_spec.GetPath(), stats);
}
- if (exists(stats)) {
- exe_spec.GetPath(exe_path, sizeof(exe_path));
- } else {
- resolved_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path));
- error.SetErrorStringWithFormat("executable doesn't exist: '%s'", exe_path);
+ if (!exists(stats)) {
+ error.SetErrorStringWithFormatv("executable doesn't exist: '{0}'",
+ exe_spec);
return HostProcess();
}
@@ -74,18 +57,9 @@ MonitoringProcessLauncher::LaunchProcess(const ProcessLaunchInfo &launch_info,
if (process.GetProcessId() != LLDB_INVALID_PROCESS_ID) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- Host::MonitorChildProcessCallback callback =
- launch_info.GetMonitorProcessCallback();
-
- bool monitor_signals = false;
- if (callback) {
- // If the ProcessLaunchInfo specified a callback, use that.
- monitor_signals = launch_info.GetMonitorSignals();
- } else {
- callback = Process::SetProcessExitStatus;
- }
-
- process.StartMonitoring(callback, monitor_signals);
+ assert(launch_info.GetMonitorProcessCallback());
+ process.StartMonitoring(launch_info.GetMonitorProcessCallback(),
+ launch_info.GetMonitorSignals());
if (log)
log->PutCString("started monitoring child process.");
} else {
diff --git a/source/Host/common/NativeBreakpointList.cpp b/source/Host/common/NativeBreakpointList.cpp
index ce5eb94a8d1f..cfcbe0831064 100644
--- a/source/Host/common/NativeBreakpointList.cpp
+++ b/source/Host/common/NativeBreakpointList.cpp
@@ -104,8 +104,8 @@ Status NativeBreakpointList::DecRef(lldb::addr_t addr) {
return error;
}
- // Breakpoint has no more references. Disable it if it's not
- // already disabled.
+ // Breakpoint has no more references. Disable it if it's not already
+ // disabled.
if (log)
log->Printf("NativeBreakpointList::%s addr = 0x%" PRIx64
" -- removing due to no remaining references",
diff --git a/source/Host/common/NativeProcessProtocol.cpp b/source/Host/common/NativeProcessProtocol.cpp
index 1fcb11b8b6f5..3e8648f81473 100644
--- a/source/Host/common/NativeProcessProtocol.cpp
+++ b/source/Host/common/NativeProcessProtocol.cpp
@@ -8,14 +8,11 @@
//===----------------------------------------------------------------------===//
#include "lldb/Host/common/NativeProcessProtocol.h"
-#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/State.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Host/common/SoftwareBreakpoint.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Target/Process.h"
#include "lldb/Utility/LLDBAssert.h"
#include "lldb/Utility/Log.h"
#include "lldb/lldb-enumerations.h"
@@ -139,29 +136,28 @@ NativeProcessProtocol::GetHardwareDebugSupportInfo() const {
Status NativeProcessProtocol::SetWatchpoint(lldb::addr_t addr, size_t size,
uint32_t watch_flags,
bool hardware) {
- // This default implementation assumes setting the watchpoint for
- // the process will require setting the watchpoint for each of the
- // threads. Furthermore, it will track watchpoints set for the
- // process and will add them to each thread that is attached to
- // via the (FIXME implement) OnThreadAttached () method.
+ // This default implementation assumes setting the watchpoint for the process
+ // will require setting the watchpoint for each of the threads. Furthermore,
+ // it will track watchpoints set for the process and will add them to each
+ // thread that is attached to via the (FIXME implement) OnThreadAttached ()
+ // method.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
// Update the thread list
UpdateThreads();
- // Keep track of the threads we successfully set the watchpoint
- // for. If one of the thread watchpoint setting operations fails,
- // back off and remove the watchpoint for all the threads that
- // were successfully set so we get back to a consistent state.
+ // Keep track of the threads we successfully set the watchpoint for. If one
+ // of the thread watchpoint setting operations fails, back off and remove the
+ // watchpoint for all the threads that were successfully set so we get back
+ // to a consistent state.
std::vector<NativeThreadProtocol *> watchpoint_established_threads;
- // Tell each thread to set a watchpoint. In the event that
- // hardware watchpoints are requested but the SetWatchpoint fails,
- // try to set a software watchpoint as a fallback. It's
- // conceivable that if there are more threads than hardware
- // watchpoints available, some of the threads will fail to set
- // hardware watchpoints while software ones may be available.
+ // Tell each thread to set a watchpoint. In the event that hardware
+ // watchpoints are requested but the SetWatchpoint fails, try to set a
+ // software watchpoint as a fallback. It's conceivable that if there are
+ // more threads than hardware watchpoints available, some of the threads will
+ // fail to set hardware watchpoints while software ones may be available.
std::lock_guard<std::recursive_mutex> guard(m_threads_mutex);
for (const auto &thread : m_threads) {
assert(thread && "thread list should not have a NULL thread!");
@@ -169,8 +165,8 @@ Status NativeProcessProtocol::SetWatchpoint(lldb::addr_t addr, size_t size,
Status thread_error =
thread->SetWatchpoint(addr, size, watch_flags, hardware);
if (thread_error.Fail() && hardware) {
- // Try software watchpoints since we failed on hardware watchpoint setting
- // and we may have just run out of hardware watchpoints.
+ // Try software watchpoints since we failed on hardware watchpoint
+ // setting and we may have just run out of hardware watchpoints.
thread_error = thread->SetWatchpoint(addr, size, watch_flags, false);
if (thread_error.Success())
LLDB_LOG(log,
@@ -178,13 +174,12 @@ Status NativeProcessProtocol::SetWatchpoint(lldb::addr_t addr, size_t size,
}
if (thread_error.Success()) {
- // Remember that we set this watchpoint successfully in
- // case we need to clear it later.
+ // Remember that we set this watchpoint successfully in case we need to
+ // clear it later.
watchpoint_established_threads.push_back(thread.get());
} else {
- // Unset the watchpoint for each thread we successfully
- // set so that we get back to a consistent state of "not
- // set" for the watchpoint.
+ // Unset the watchpoint for each thread we successfully set so that we
+ // get back to a consistent state of "not set" for the watchpoint.
for (auto unwatch_thread_sp : watchpoint_established_threads) {
Status remove_error = unwatch_thread_sp->RemoveWatchpoint(addr);
if (remove_error.Fail())
@@ -210,9 +205,9 @@ Status NativeProcessProtocol::RemoveWatchpoint(lldb::addr_t addr) {
const Status thread_error = thread->RemoveWatchpoint(addr);
if (thread_error.Fail()) {
- // Keep track of the first thread error if any threads
- // fail. We want to try to remove the watchpoint from
- // every thread, though, even if one or more have errors.
+ // Keep track of the first thread error if any threads fail. We want to
+ // try to remove the watchpoint from every thread, though, even if one or
+ // more have errors.
if (!overall_error.Fail())
overall_error = thread_error;
}
@@ -228,9 +223,9 @@ NativeProcessProtocol::GetHardwareBreakpointMap() const {
Status NativeProcessProtocol::SetHardwareBreakpoint(lldb::addr_t addr,
size_t size) {
- // This default implementation assumes setting a hardware breakpoint for
- // this process will require setting same hardware breakpoint for each
- // of its existing threads. New thread will do the same once created.
+ // This default implementation assumes setting a hardware breakpoint for this
+ // process will require setting same hardware breakpoint for each of its
+ // existing threads. New thread will do the same once created.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
// Update the thread list
@@ -256,13 +251,13 @@ Status NativeProcessProtocol::SetHardwareBreakpoint(lldb::addr_t addr,
Status thread_error = thread->SetHardwareBreakpoint(addr, size);
if (thread_error.Success()) {
- // Remember that we set this breakpoint successfully in
- // case we need to clear it later.
+ // Remember that we set this breakpoint successfully in case we need to
+ // clear it later.
breakpoint_established_threads.push_back(thread.get());
} else {
- // Unset the breakpoint for each thread we successfully
- // set so that we get back to a consistent state of "not
- // set" for this hardware breakpoint.
+ // Unset the breakpoint for each thread we successfully set so that we
+ // get back to a consistent state of "not set" for this hardware
+ // breakpoint.
for (auto rollback_thread_sp : breakpoint_established_threads) {
Status remove_error =
rollback_thread_sp->RemoveHardwareBreakpoint(addr);
@@ -322,8 +317,8 @@ bool NativeProcessProtocol::UnregisterNativeDelegate(
remove(m_delegates.begin(), m_delegates.end(), &native_delegate),
m_delegates.end());
- // We removed the delegate if the count of delegates shrank after
- // removing all copies of the given native_delegate from the vector.
+ // We removed the delegate if the count of delegates shrank after removing
+ // all copies of the given native_delegate from the vector.
return m_delegates.size() < initial_size;
}
@@ -412,8 +407,8 @@ void NativeProcessProtocol::SetState(lldb::StateType state,
// Give process a chance to do any stop id bump processing, such as
// clearing cached data that is invalidated each time the process runs.
- // Note if/when we support some threads running, we'll end up needing
- // to manage this per thread and per process.
+ // Note if/when we support some threads running, we'll end up needing to
+ // manage this per thread and per process.
DoStopIDBumped(m_stop_id);
}
@@ -431,26 +426,4 @@ void NativeProcessProtocol::DoStopIDBumped(uint32_t /* newBumpId */) {
// Default implementation does nothing.
}
-Status NativeProcessProtocol::ResolveProcessArchitecture(lldb::pid_t pid,
- ArchSpec &arch) {
- // Grab process info for the running process.
- ProcessInstanceInfo process_info;
- if (!Host::GetProcessInfo(pid, process_info))
- return Status("failed to get process info");
-
- // Resolve the executable module.
- ModuleSpecList module_specs;
- if (!ObjectFile::GetModuleSpecifications(process_info.GetExecutableFile(), 0,
- 0, module_specs))
- return Status("failed to get module specifications");
- lldbassert(module_specs.GetSize() == 1);
-
- arch = module_specs.GetModuleSpecRefAtIndex(0).GetArchitecture();
- if (arch.IsValid())
- return Status();
- else
- return Status(
- "failed to retrieve a valid architecture from the exe module");
-}
-
NativeProcessProtocol::Factory::~Factory() = default;
diff --git a/source/Host/common/NativeRegisterContext.cpp b/source/Host/common/NativeRegisterContext.cpp
index 60eaebdc94cd..49b8284da970 100644
--- a/source/Host/common/NativeRegisterContext.cpp
+++ b/source/Host/common/NativeRegisterContext.cpp
@@ -28,13 +28,12 @@ NativeRegisterContext::NativeRegisterContext(NativeThreadProtocol &thread)
NativeRegisterContext::~NativeRegisterContext() {}
// FIXME revisit invalidation, process stop ids, etc. Right now we don't
-// support caching in NativeRegisterContext. We can do this later by
-// utilizing NativeProcessProtocol::GetStopID () and adding a stop id to
+// support caching in NativeRegisterContext. We can do this later by utilizing
+// NativeProcessProtocol::GetStopID () and adding a stop id to
// NativeRegisterContext.
// void
-// NativeRegisterContext::InvalidateIfNeeded (bool force)
-// {
+// NativeRegisterContext::InvalidateIfNeeded (bool force) {
// ProcessSP process_sp (m_thread.GetProcess());
// bool invalidate = force;
// uint32_t process_stop_id = UINT32_MAX;
@@ -365,8 +364,8 @@ Status NativeRegisterContext::ReadRegisterValueFromMemory(
// We now have a memory buffer that contains the part or all of the register
// value. Set the register value using this memory data.
// TODO: we might need to add a parameter to this function in case the byte
- // order of the memory data doesn't match the process. For now we are assuming
- // they are the same.
+ // order of the memory data doesn't match the process. For now we are
+ // assuming they are the same.
reg_value.SetFromMemoryData(reg_info, src, src_len, process.GetByteOrder(),
error);
@@ -385,8 +384,7 @@ Status NativeRegisterContext::WriteRegisterValueToMemory(
// TODO: we might need to add a parameter to this function in case the byte
// order of the memory data doesn't match the process. For now we are
- // assuming
- // they are the same.
+ // assuming they are the same.
const size_t bytes_copied = reg_value.GetAsMemoryData(
reg_info, dst, dst_len, process.GetByteOrder(), error);
diff --git a/source/Host/common/NativeThreadProtocol.cpp b/source/Host/common/NativeThreadProtocol.cpp
index 3f3915e006da..0c648e40eb5c 100644
--- a/source/Host/common/NativeThreadProtocol.cpp
+++ b/source/Host/common/NativeThreadProtocol.cpp
@@ -19,36 +19,3 @@ using namespace lldb_private;
NativeThreadProtocol::NativeThreadProtocol(NativeProcessProtocol &process,
lldb::tid_t tid)
: m_process(process), m_tid(tid) {}
-
-Status NativeThreadProtocol::ReadRegister(uint32_t reg,
- RegisterValue &reg_value) {
- NativeRegisterContext &register_context = GetRegisterContext();
-
- const RegisterInfo *const reg_info =
- register_context.GetRegisterInfoAtIndex(reg);
- if (!reg_info)
- return Status("no register info for reg num %" PRIu32, reg);
-
- return register_context.ReadRegister(reg_info, reg_value);
- ;
-}
-
-Status NativeThreadProtocol::WriteRegister(uint32_t reg,
- const RegisterValue &reg_value) {
- NativeRegisterContext& register_context = GetRegisterContext();
-
- const RegisterInfo *const reg_info =
- register_context.GetRegisterInfoAtIndex(reg);
- if (!reg_info)
- return Status("no register info for reg num %" PRIu32, reg);
-
- return register_context.WriteRegister(reg_info, reg_value);
-}
-
-Status NativeThreadProtocol::SaveAllRegisters(lldb::DataBufferSP &data_sp) {
- return GetRegisterContext().WriteAllRegisterValues(data_sp);
-}
-
-Status NativeThreadProtocol::RestoreAllRegisters(lldb::DataBufferSP &data_sp) {
- return GetRegisterContext().ReadAllRegisterValues(data_sp);
-}
diff --git a/source/Host/common/PseudoTerminal.cpp b/source/Host/common/PseudoTerminal.cpp
index 9657cb6523dc..c9b290078e18 100644
--- a/source/Host/common/PseudoTerminal.cpp
+++ b/source/Host/common/PseudoTerminal.cpp
@@ -35,10 +35,10 @@ PseudoTerminal::PseudoTerminal()
//----------------------------------------------------------------------
// Destructor
//
-// The destructor will close the master and slave file descriptors
-// if they are valid and ownership has not been released using the
-// ReleaseMasterFileDescriptor() or the ReleaseSaveFileDescriptor()
-// member functions.
+// The destructor will close the master and slave file descriptors if they are
+// valid and ownership has not been released using the
+// ReleaseMasterFileDescriptor() or the ReleaseSaveFileDescriptor() member
+// functions.
//----------------------------------------------------------------------
PseudoTerminal::~PseudoTerminal() {
CloseMasterFileDescriptor();
@@ -66,15 +66,14 @@ void PseudoTerminal::CloseSlaveFileDescriptor() {
}
//----------------------------------------------------------------------
-// Open the first available pseudo terminal with OFLAG as the
-// permissions. The file descriptor is stored in this object and can
-// be accessed with the MasterFileDescriptor() accessor. The
-// ownership of the master file descriptor can be released using
-// the ReleaseMasterFileDescriptor() accessor. If this object has
-// a valid master files descriptor when its destructor is called, it
-// will close the master file descriptor, therefore clients must
-// call ReleaseMasterFileDescriptor() if they wish to use the master
-// file descriptor after this object is out of scope or destroyed.
+// Open the first available pseudo terminal with OFLAG as the permissions. The
+// file descriptor is stored in this object and can be accessed with the
+// MasterFileDescriptor() accessor. The ownership of the master file descriptor
+// can be released using the ReleaseMasterFileDescriptor() accessor. If this
+// object has a valid master files descriptor when its destructor is called, it
+// will close the master file descriptor, therefore clients must call
+// ReleaseMasterFileDescriptor() if they wish to use the master file descriptor
+// after this object is out of scope or destroyed.
//
// RETURNS:
// True when successful, false indicating an error occurred.
@@ -118,12 +117,12 @@ bool PseudoTerminal::OpenFirstAvailableMaster(int oflag, char *error_str,
}
//----------------------------------------------------------------------
-// Open the slave pseudo terminal for the current master pseudo
-// terminal. A master pseudo terminal should already be valid prior to
-// calling this function (see OpenFirstAvailableMaster()).
-// The file descriptor is stored this object's member variables and can
-// be accessed via the GetSlaveFileDescriptor(), or released using the
-// ReleaseSlaveFileDescriptor() member function.
+// Open the slave pseudo terminal for the current master pseudo terminal. A
+// master pseudo terminal should already be valid prior to calling this
+// function (see OpenFirstAvailableMaster()). The file descriptor is stored
+// this object's member variables and can be accessed via the
+// GetSlaveFileDescriptor(), or released using the ReleaseSlaveFileDescriptor()
+// member function.
//
// RETURNS:
// True when successful, false indicating an error occurred.
@@ -152,8 +151,8 @@ bool PseudoTerminal::OpenSlave(int oflag, char *error_str, size_t error_len) {
}
//----------------------------------------------------------------------
-// Get the name of the slave pseudo terminal. A master pseudo terminal
-// should already be valid prior to calling this function (see
+// Get the name of the slave pseudo terminal. A master pseudo terminal should
+// already be valid prior to calling this function (see
// OpenFirstAvailableMaster()).
//
// RETURNS:
@@ -185,18 +184,16 @@ const char *PseudoTerminal::GetSlaveName(char *error_str,
// Fork a child process and have its stdio routed to a pseudo terminal.
//
// In the parent process when a valid pid is returned, the master file
-// descriptor can be used as a read/write access to stdio of the
-// child process.
+// descriptor can be used as a read/write access to stdio of the child process.
//
-// In the child process the stdin/stdout/stderr will already be routed
-// to the slave pseudo terminal and the master file descriptor will be
-// closed as it is no longer needed by the child process.
+// In the child process the stdin/stdout/stderr will already be routed to the
+// slave pseudo terminal and the master file descriptor will be closed as it is
+// no longer needed by the child process.
//
-// This class will close the file descriptors for the master/slave
-// when the destructor is called, so be sure to call
-// ReleaseMasterFileDescriptor() or ReleaseSlaveFileDescriptor() if any
-// file descriptors are going to be used past the lifespan of this
-// object.
+// This class will close the file descriptors for the master/slave when the
+// destructor is called, so be sure to call ReleaseMasterFileDescriptor() or
+// ReleaseSlaveFileDescriptor() if any file descriptors are going to be used
+// past the lifespan of this object.
//
// RETURNS:
// in the parent process: the pid of the child, or -1 if fork fails
@@ -261,49 +258,47 @@ lldb::pid_t PseudoTerminal::Fork(char *error_str, size_t error_len) {
}
//----------------------------------------------------------------------
-// The master file descriptor accessor. This object retains ownership
-// of the master file descriptor when this accessor is used. Use
-// ReleaseMasterFileDescriptor() if you wish this object to release
-// ownership of the master file descriptor.
+// The master file descriptor accessor. This object retains ownership of the
+// master file descriptor when this accessor is used. Use
+// ReleaseMasterFileDescriptor() if you wish this object to release ownership
+// of the master file descriptor.
//
-// Returns the master file descriptor, or -1 if the master file
-// descriptor is not currently valid.
+// Returns the master file descriptor, or -1 if the master file descriptor is
+// not currently valid.
//----------------------------------------------------------------------
int PseudoTerminal::GetMasterFileDescriptor() const { return m_master_fd; }
//----------------------------------------------------------------------
// The slave file descriptor accessor.
//
-// Returns the slave file descriptor, or -1 if the slave file
-// descriptor is not currently valid.
+// Returns the slave file descriptor, or -1 if the slave file descriptor is not
+// currently valid.
//----------------------------------------------------------------------
int PseudoTerminal::GetSlaveFileDescriptor() const { return m_slave_fd; }
//----------------------------------------------------------------------
-// Release ownership of the master pseudo terminal file descriptor
-// without closing it. The destructor for this class will close the
-// master file descriptor if the ownership isn't released using this
-// call and the master file descriptor has been opened.
+// Release ownership of the master pseudo terminal file descriptor without
+// closing it. The destructor for this class will close the master file
+// descriptor if the ownership isn't released using this call and the master
+// file descriptor has been opened.
//----------------------------------------------------------------------
int PseudoTerminal::ReleaseMasterFileDescriptor() {
- // Release ownership of the master pseudo terminal file
- // descriptor without closing it. (the destructor for this
- // class will close it otherwise!)
+ // Release ownership of the master pseudo terminal file descriptor without
+ // closing it. (the destructor for this class will close it otherwise!)
int fd = m_master_fd;
m_master_fd = invalid_fd;
return fd;
}
//----------------------------------------------------------------------
-// Release ownership of the slave pseudo terminal file descriptor
-// without closing it. The destructor for this class will close the
-// slave file descriptor if the ownership isn't released using this
-// call and the slave file descriptor has been opened.
+// Release ownership of the slave pseudo terminal file descriptor without
+// closing it. The destructor for this class will close the slave file
+// descriptor if the ownership isn't released using this call and the slave
+// file descriptor has been opened.
//----------------------------------------------------------------------
int PseudoTerminal::ReleaseSlaveFileDescriptor() {
- // Release ownership of the slave pseudo terminal file
- // descriptor without closing it (the destructor for this
- // class will close it otherwise!)
+ // Release ownership of the slave pseudo terminal file descriptor without
+ // closing it (the destructor for this class will close it otherwise!)
int fd = m_slave_fd;
m_slave_fd = invalid_fd;
return fd;
diff --git a/source/Host/common/Socket.cpp b/source/Host/common/Socket.cpp
index 4c23e4eb560c..875291bc115f 100644
--- a/source/Host/common/Socket.cpp
+++ b/source/Host/common/Socket.cpp
@@ -160,18 +160,17 @@ Status Socket::TcpListen(llvm::StringRef host_and_port,
error = listen_socket->Listen(host_and_port, backlog);
if (error.Success()) {
- // We were asked to listen on port zero which means we
- // must now read the actual port that was given to us
- // as port zero is a special code for "find an open port
- // for me".
+ // We were asked to listen on port zero which means we must now read the
+ // actual port that was given to us as port zero is a special code for
+ // "find an open port for me".
if (port == 0)
port = listen_socket->GetLocalPortNumber();
- // Set the port predicate since when doing a listen://<host>:<port>
- // it often needs to accept the incoming connection which is a blocking
- // system call. Allowing access to the bound port using a predicate allows
- // us to wait for the port predicate to be set to a non-zero value from
- // another thread in an efficient manor.
+ // Set the port predicate since when doing a listen://<host>:<port> it
+ // often needs to accept the incoming connection which is a blocking system
+ // call. Allowing access to the bound port using a predicate allows us to
+ // wait for the port predicate to be set to a non-zero value from another
+ // thread in an efficient manor.
if (predicate)
predicate->SetValue(port, eBroadcastAlways);
socket = listen_socket.release();
@@ -282,8 +281,7 @@ bool Socket::DecodeHostAndPort(llvm::StringRef host_and_port,
}
// If this was unsuccessful, then check if it's simply a signed 32-bit
- // integer, representing
- // a port with an empty host.
+ // integer, representing a port with an empty host.
host_str.clear();
port_str.clear();
bool ok = false;
@@ -436,8 +434,8 @@ NativeSocket Socket::AcceptSocket(NativeSocket sockfd, struct sockaddr *addr,
error.Clear();
#if defined(ANDROID_USE_ACCEPT_WORKAROUND)
// Hack:
- // This enables static linking lldb-server to an API 21 libc, but still having
- // it run on older devices. It is necessary because API 21 libc's
+ // This enables static linking lldb-server to an API 21 libc, but still
+ // having it run on older devices. It is necessary because API 21 libc's
// implementation of accept() uses the accept4 syscall(), which is not
// available in older kernels. Using an older libc would fix this issue, but
// introduce other ones, as the old libraries were quite buggy.
diff --git a/source/Host/common/SoftwareBreakpoint.cpp b/source/Host/common/SoftwareBreakpoint.cpp
index 14dbafd94c03..353dadf6ce6d 100644
--- a/source/Host/common/SoftwareBreakpoint.cpp
+++ b/source/Host/common/SoftwareBreakpoint.cpp
@@ -17,9 +17,8 @@
using namespace lldb_private;
-// -------------------------------------------------------------------
-// static members
-// -------------------------------------------------------------------
+// ------------------------------------------------------------------- static
+// members -------------------------------------------------------------------
Status SoftwareBreakpoint::CreateSoftwareBreakpoint(
NativeProcessProtocol &process, lldb::addr_t addr, size_t size_hint,
@@ -34,8 +33,7 @@ Status SoftwareBreakpoint::CreateSoftwareBreakpoint(
__FUNCTION__);
// Ask the NativeProcessProtocol subclass to fill in the correct software
- // breakpoint
- // trap for the breakpoint site.
+ // breakpoint trap for the breakpoint site.
size_t bp_opcode_size = 0;
const uint8_t *bp_opcode_bytes = NULL;
Status error = process.GetSoftwareBreakpointTrapOpcode(
@@ -98,9 +96,8 @@ Status SoftwareBreakpoint::CreateSoftwareBreakpoint(
log->Printf("SoftwareBreakpoint::%s addr = 0x%" PRIx64 " -- SUCCESS",
__FUNCTION__, addr);
- // Set the breakpoint and verified it was written properly. Now
- // create a breakpoint remover that understands how to undo this
- // breakpoint.
+ // Set the breakpoint and verified it was written properly. Now create a
+ // breakpoint remover that understands how to undo this breakpoint.
breakpoint_sp.reset(new SoftwareBreakpoint(process, addr, saved_opcode_bytes,
bp_opcode_bytes, bp_opcode_size));
return Status();
@@ -280,8 +277,8 @@ Status SoftwareBreakpoint::DoDisable() {
// Make sure the breakpoint opcode exists at this address
if (::memcmp(curr_break_op, m_trap_opcodes, m_opcode_size) == 0) {
break_op_found = true;
- // We found a valid breakpoint opcode at this address, now restore
- // the saved opcode.
+ // We found a valid breakpoint opcode at this address, now restore the
+ // saved opcode.
size_t bytes_written = 0;
error = m_process.WriteMemory(m_addr, m_saved_opcodes, m_opcode_size,
bytes_written);
diff --git a/source/Host/common/Symbols.cpp b/source/Host/common/Symbols.cpp
index 3f70fdc4bf95..d7e0c13112aa 100644
--- a/source/Host/common/Symbols.cpp
+++ b/source/Host/common/Symbols.cpp
@@ -8,8 +8,8 @@
//===----------------------------------------------------------------------===//
#include "lldb/Host/Symbols.h"
-#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/FileSystem.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/ArchSpec.h"
@@ -91,7 +91,7 @@ static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
::strncat(path, exec_fspec->GetFilename().AsCString(),
sizeof(path) - strlen(path) - 1);
- dsym_fspec.SetFile(path, false);
+ dsym_fspec.SetFile(path, false, FileSpec::Style::native);
ModuleSpecList module_specs;
ModuleSpec matched_module_spec;
@@ -111,15 +111,15 @@ static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
// Add a ".dSYM" name to each directory component of the path,
// stripping off components. e.g. we may have a binary like
- // /S/L/F/Foundation.framework/Versions/A/Foundation
- // and
+ // /S/L/F/Foundation.framework/Versions/A/Foundation and
// /S/L/F/Foundation.framework.dSYM
//
- // so we'll need to start with /S/L/F/Foundation.framework/Versions/A,
- // add the .dSYM part to the "A", and if that doesn't exist, strip off
- // the "A" and try it again with "Versions", etc., until we find a
- // dSYM bundle or we've stripped off enough path components that
- // there's no need to continue.
+ // so we'll need to start with
+ // /S/L/F/Foundation.framework/Versions/A, add the .dSYM part to the
+ // "A", and if that doesn't exist, strip off the "A" and try it again
+ // with "Versions", etc., until we find a dSYM bundle or we've
+ // stripped off enough path components that there's no need to
+ // continue.
for (int i = 0; i < 4; i++) {
// Does this part of the path have a "." character - could it be a
@@ -131,7 +131,8 @@ static bool LocateDSYMInVincinityOfExecutable(const ModuleSpec &module_spec,
dsym_fspec = parent_dirs;
dsym_fspec.RemoveLastPathComponent();
- // If the current directory name is "Foundation.framework", see if
+ // If the current directory name is "Foundation.framework", see
+ // if
// "Foundation.framework.dSYM/Contents/Resources/DWARF/Foundation"
// exists & has the right uuid.
std::string dsym_fn = fn;
@@ -222,14 +223,18 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
Target::GetDefaultDebugFileSearchPaths());
// Add module directory.
- const ConstString &file_dir = module_spec.GetFileSpec().GetDirectory();
+ FileSpec module_file_spec = module_spec.GetFileSpec();
+ // We keep the unresolved pathname if it fails.
+ FileSystem::ResolveSymbolicLink(module_file_spec, module_file_spec);
+
+ const ConstString &file_dir = module_file_spec.GetDirectory();
debug_file_search_paths.AppendIfUnique(
FileSpec(file_dir.AsCString("."), true));
// Add current working directory.
debug_file_search_paths.AppendIfUnique(FileSpec(".", true));
-#ifndef LLVM_ON_WIN32
+#ifndef _WIN32
#if defined(__NetBSD__)
// Add /usr/libdata/debug directory.
debug_file_search_paths.AppendIfUnique(
@@ -238,7 +243,7 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
// Add /usr/lib/debug directory.
debug_file_search_paths.AppendIfUnique(FileSpec("/usr/lib/debug", true));
#endif
-#endif // LLVM_ON_WIN32
+#endif // _WIN32
std::string uuid_str;
const UUID &module_uuid = module_spec.GetUUID();
@@ -246,6 +251,8 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
// Some debug files are stored in the .build-id directory like this:
// /usr/lib/debug/.build-id/ff/e7fe727889ad82bb153de2ad065b2189693315.debug
uuid_str = module_uuid.GetAsString("");
+ std::transform(uuid_str.begin(), uuid_str.end(), uuid_str.begin(),
+ ::tolower);
uuid_str.insert(2, 1, '/');
uuid_str = uuid_str + ".debug";
}
@@ -275,7 +282,7 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
FileSpec file_spec(filename, true);
if (llvm::sys::fs::equivalent(file_spec.GetPath(),
- module_spec.GetFileSpec().GetPath()))
+ module_file_spec.GetPath()))
continue;
if (file_spec.Exists()) {
@@ -287,10 +294,9 @@ FileSpec Symbols::LocateExecutableSymbolFile(const ModuleSpec &module_spec) {
if (num_specs == 1) {
ModuleSpec mspec;
if (specs.GetModuleSpecAtIndex(0, mspec)) {
- // Skip the uuids check if module_uuid is invalid.
- // For example, this happens for *.dwp files since
- // at the moment llvm-dwp doesn't output build ids,
- // nor does binutils dwp.
+ // Skip the uuids check if module_uuid is invalid. For example,
+ // this happens for *.dwp files since at the moment llvm-dwp
+ // doesn't output build ids, nor does binutils dwp.
if (!module_uuid.IsValid() || module_uuid == mspec.GetUUID())
return file_spec;
}
diff --git a/source/Host/common/TCPSocket.cpp b/source/Host/common/TCPSocket.cpp
index f896944bb1b3..1a10336f1dfc 100644
--- a/source/Host/common/TCPSocket.cpp
+++ b/source/Host/common/TCPSocket.cpp
@@ -26,11 +26,11 @@
#include <sys/socket.h>
#endif
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include <winsock2.h>
#endif
-#ifdef LLVM_ON_WIN32
+#ifdef _WIN32
#define CLOSE_SOCKET closesocket
typedef const char *set_socket_option_arg_type;
#else
diff --git a/source/Host/common/TaskPool.cpp b/source/Host/common/TaskPool.cpp
index 156a07942998..c54b9a8ae56b 100644
--- a/source/Host/common/TaskPool.cpp
+++ b/source/Host/common/TaskPool.cpp
@@ -49,8 +49,8 @@ void TaskPool::AddTaskImpl(std::function<void()> &&task_fn) {
TaskPoolImpl::TaskPoolImpl() : m_thread_count(0) {}
unsigned GetHardwareConcurrencyHint() {
- // std::thread::hardware_concurrency may return 0
- // if the value is not well defined or not computable.
+ // std::thread::hardware_concurrency may return 0 if the value is not well
+ // defined or not computable.
static const unsigned g_hardware_concurrency =
std::max(1u, std::thread::hardware_concurrency());
return g_hardware_concurrency;
@@ -64,9 +64,8 @@ void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) {
if (m_thread_count < GetHardwareConcurrencyHint()) {
m_thread_count++;
// Note that this detach call needs to happen with the m_tasks_mutex held.
- // This prevents the thread
- // from exiting prematurely and triggering a linux libc bug
- // (https://sourceware.org/bugzilla/show_bug.cgi?id=19951).
+ // This prevents the thread from exiting prematurely and triggering a linux
+ // libc bug (https://sourceware.org/bugzilla/show_bug.cgi?id=19951).
lldb_private::ThreadLauncher::LaunchThread("task-pool.worker", WorkerPtr,
this, nullptr, min_stack_size)
.Release();
diff --git a/source/Host/common/Terminal.cpp b/source/Host/common/Terminal.cpp
index 022b3fa50a8f..be912fbe6155 100644
--- a/source/Host/common/Terminal.cpp
+++ b/source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
#include "lldb/Host/Terminal.h"
+#include "lldb/Host/Config.h"
#include "lldb/Host/PosixApi.h"
#include "llvm/ADT/STLExtras.h"
@@ -107,9 +108,9 @@ void TerminalState::Clear() {
}
//----------------------------------------------------------------------
-// Save the current state of the TTY for the file descriptor "fd"
-// and if "save_process_group" is true, attempt to save the process
-// group info for the TTY.
+// Save the current state of the TTY for the file descriptor "fd" and if
+// "save_process_group" is true, attempt to save the process group info for the
+// TTY.
//----------------------------------------------------------------------
bool TerminalState::Save(int fd, bool save_process_group) {
m_tty.SetFileDescriptor(fd);
@@ -142,8 +143,8 @@ bool TerminalState::Save(int fd, bool save_process_group) {
}
//----------------------------------------------------------------------
-// Restore the state of the TTY using the cached values from a
-// previous call to Save().
+// Restore the state of the TTY using the cached values from a previous call to
+// Save().
//----------------------------------------------------------------------
bool TerminalState::Restore() const {
#ifndef LLDB_DISABLE_POSIX
@@ -173,8 +174,8 @@ bool TerminalState::Restore() const {
}
//----------------------------------------------------------------------
-// Returns true if this object has valid saved TTY state settings
-// that can be used to restore a previous state.
+// Returns true if this object has valid saved TTY state settings that can be
+// used to restore a previous state.
//----------------------------------------------------------------------
bool TerminalState::IsValid() const {
return m_tty.FileDescriptorIsValid() &&
@@ -236,21 +237,20 @@ bool TerminalStateSwitcher::Restore(uint32_t idx) const {
m_ttystates[idx].IsValid())
return true;
- // Set the state to match the index passed in and only update the
- // current state if there are no errors.
+ // Set the state to match the index passed in and only update the current
+ // state if there are no errors.
if (m_ttystates[idx].Restore()) {
m_currentState = idx;
return true;
}
- // We failed to set the state. The tty state was invalid or not
- // initialized.
+ // We failed to set the state. The tty state was invalid or not initialized.
return false;
}
//------------------------------------------------------------------
-// Save the state at index "idx" for file descriptor "fd" and
-// save the process group if requested.
+// Save the state at index "idx" for file descriptor "fd" and save the process
+// group if requested.
//
// Returns true if the restore was successful, false otherwise.
//------------------------------------------------------------------
diff --git a/source/Host/common/UDPSocket.cpp b/source/Host/common/UDPSocket.cpp
index 21dacbc626ee..96bcc6a150a9 100644
--- a/source/Host/common/UDPSocket.cpp
+++ b/source/Host/common/UDPSocket.cpp
@@ -69,8 +69,8 @@ Status UDPSocket::Connect(llvm::StringRef name, bool child_processes_inherit,
if (!DecodeHostAndPort(name, host_str, port_str, port, &error))
return error;
- // At this point we have setup the receive port, now we need to
- // setup the UDP send socket
+ // At this point we have setup the receive port, now we need to setup the UDP
+ // send socket
struct addrinfo hints;
struct addrinfo *service_info_list = nullptr;
diff --git a/source/Host/common/XML.cpp b/source/Host/common/XML.cpp
index c3169bd6e08d..7468a3d7ac65 100644
--- a/source/Host/common/XML.cpp
+++ b/source/Host/common/XML.cpp
@@ -151,6 +151,18 @@ llvm::StringRef XMLNode::GetAttributeValue(const char *name,
return llvm::StringRef();
}
+bool XMLNode::GetAttributeValueAsUnsigned(const char *name, uint64_t &value,
+ uint64_t fail_value, int base) const {
+#if defined(LIBXML2_DEFINED)
+ llvm::StringRef str_value = GetAttributeValue(name, "");
+#else
+ llvm::StringRef str_value;
+#endif
+ bool success = false;
+ value = StringConvert::ToUInt64(str_value.data(), fail_value, base, &success);
+ return success;
+}
+
void XMLNode::ForEachChildNode(NodeCallback const &callback) const {
#if defined(LIBXML2_DEFINED)
if (IsValid())
@@ -240,8 +252,8 @@ void XMLNode::ForEachSiblingElementWithName(
if (node->type != XML_ELEMENT_NODE)
continue;
- // If name is nullptr, we take all nodes of type "t", else
- // just the ones whose name matches
+ // If name is nullptr, we take all nodes of type "t", else just the ones
+ // whose name matches
if (name) {
if (strcmp((const char *)node->name, name) != 0)
continue; // Name mismatch, ignore this one
diff --git a/source/Host/freebsd/Host.cpp b/source/Host/freebsd/Host.cpp
index 124a8a760133..87552bc2a27e 100644
--- a/source/Host/freebsd/Host.cpp
+++ b/source/Host/freebsd/Host.cpp
@@ -26,12 +26,9 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Core/Module.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
@@ -78,9 +75,11 @@ GetFreeBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
size_t pathname_len = sizeof(pathname);
mib[2] = KERN_PROC_PATHNAME;
if (::sysctl(mib, 4, pathname, &pathname_len, NULL, 0) == 0)
- process_info.GetExecutableFile().SetFile(pathname, false);
+ process_info.GetExecutableFile().SetFile(pathname, false,
+ FileSpec::Style::native);
else
- process_info.GetExecutableFile().SetFile(cstr, false);
+ process_info.GetExecutableFile().SetFile(cstr, false,
+ FileSpec::Style::native);
if (!(match_info_ptr == NULL ||
NameMatches(process_info.GetExecutableFile().GetFilename().GetCString(),
@@ -195,9 +194,8 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
continue;
// Every thread is a process in FreeBSD, but all the threads of a single
- // process have the same pid. Do not store the process info in the
- // result list if a process with given identifier is already registered
- // there.
+ // process have the same pid. Do not store the process info in the result
+ // list if a process with given identifier is already registered there.
bool already_registered = false;
for (uint32_t pi = 0;
!already_registered && (const int)kinfo.ki_numthreads > 1 &&
@@ -243,14 +241,7 @@ bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {
return false;
}
-size_t Host::GetEnvironment(StringList &env) {
- char **host_env = environ;
- char *env_entry;
- size_t i;
- for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
- env.AppendString(env_entry);
- return i;
-}
+Environment Host::GetEnvironment() { return Environment(environ); }
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
return Status("unimplemented");
diff --git a/source/Host/freebsd/HostInfoFreeBSD.cpp b/source/Host/freebsd/HostInfoFreeBSD.cpp
index 9c82fcca7563..18eae3eb7606 100644
--- a/source/Host/freebsd/HostInfoFreeBSD.cpp
+++ b/source/Host/freebsd/HostInfoFreeBSD.cpp
@@ -18,16 +18,17 @@
using namespace lldb_private;
-bool HostInfoFreeBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
+llvm::VersionTuple HostInfoFreeBSD::GetOSVersion() {
struct utsname un;
::memset(&un, 0, sizeof(utsname));
if (uname(&un) < 0)
- return false;
+ return llvm::VersionTuple();
- int status = sscanf(un.release, "%u.%u", &major, &minor);
- return status == 2;
+ unsigned major, minor;
+ if (2 == sscanf(un.release, "%u.%u", &major, &minor))
+ return llvm::VersionTuple(major, minor);
+ return llvm::VersionTuple();
}
bool HostInfoFreeBSD::GetOSBuildString(std::string &s) {
@@ -68,9 +69,9 @@ FileSpec HostInfoFreeBSD::GetProgramFileSpec() {
if (sysctl(exe_path_mib, 4, NULL, &exe_path_size, NULL, 0) == 0) {
char *exe_path = new char[exe_path_size];
if (sysctl(exe_path_mib, 4, exe_path, &exe_path_size, NULL, 0) == 0)
- g_program_filespec.SetFile(exe_path, false);
+ g_program_filespec.SetFile(exe_path, false, FileSpec::Style::native);
delete[] exe_path;
}
}
return g_program_filespec;
-} \ No newline at end of file
+}
diff --git a/source/Host/linux/Host.cpp b/source/Host/linux/Host.cpp
index f43090eadf81..1a0eb767eb34 100644
--- a/source/Host/linux/Host.cpp
+++ b/source/Host/linux/Host.cpp
@@ -20,7 +20,9 @@
// C++ Includes
// Other libraries and framework includes
+#include "llvm/Object/ELF.h"
#include "llvm/Support/ScopedPrinter.h"
+
// Project includes
#include "lldb/Target/Process.h"
#include "lldb/Utility/Log.h"
@@ -29,12 +31,9 @@
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/linux/Support.h"
-#include "lldb/Utility/DataBufferHeap.h"
+#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/DataExtractor.h"
-#include "lldb/Core/ModuleSpec.h"
-#include "lldb/Symbol/ObjectFile.h"
-
using namespace lldb;
using namespace lldb_private;
@@ -123,28 +122,27 @@ static bool IsDirNumeric(const char *dname) {
return true;
}
-static bool GetELFProcessCPUType(llvm::StringRef exe_path,
- ProcessInstanceInfo &process_info) {
- // Clear the architecture.
- process_info.GetArchitecture().Clear();
-
- ModuleSpecList specs;
- FileSpec filespec(exe_path, false);
- const size_t num_specs =
- ObjectFile::GetModuleSpecifications(filespec, 0, 0, specs);
- // GetModuleSpecifications() could fail if the executable has been deleted or
- // is locked.
- // But it shouldn't return more than 1 architecture.
- assert(num_specs <= 1 && "Linux plugin supports only a single architecture");
- if (num_specs == 1) {
- ModuleSpec module_spec;
- if (specs.GetModuleSpecAtIndex(0, module_spec) &&
- module_spec.GetArchitecture().IsValid()) {
- process_info.GetArchitecture() = module_spec.GetArchitecture();
- return true;
- }
+static ArchSpec GetELFProcessCPUType(llvm::StringRef exe_path) {
+ Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+
+ auto buffer_sp = DataBufferLLVM::CreateSliceFromPath(exe_path, 0x20, 0);
+ if (!buffer_sp)
+ return ArchSpec();
+
+ uint8_t exe_class =
+ llvm::object::getElfArchType(
+ {buffer_sp->GetChars(), size_t(buffer_sp->GetByteSize())})
+ .first;
+
+ switch (exe_class) {
+ case llvm::ELF::ELFCLASS32:
+ return HostInfo::GetArchitecture(HostInfo::eArchKind32);
+ case llvm::ELF::ELFCLASS64:
+ return HostInfo::GetArchitecture(HostInfo::eArchKind64);
+ default:
+ LLDB_LOG(log, "Unknown elf class ({0}) in file {1}", exe_class, exe_path);
+ return ArchSpec();
}
- return false;
}
static bool GetProcessAndStatInfo(::pid_t pid,
@@ -173,7 +171,7 @@ static bool GetProcessAndStatInfo(::pid_t pid,
llvm::StringRef PathRef = ExePath;
PathRef.consume_back(" (deleted)");
- GetELFProcessCPUType(PathRef, process_info);
+ process_info.SetArchitecture(GetELFProcessCPUType(PathRef));
// Get the process environment.
auto BufferOrError = getProcFile(pid, "environ");
@@ -192,14 +190,14 @@ static bool GetProcessAndStatInfo(::pid_t pid,
return false;
process_info.SetProcessID(pid);
- process_info.GetExecutableFile().SetFile(PathRef, false);
- process_info.GetArchitecture().MergeFrom(HostInfo::GetArchitecture());
+ process_info.GetExecutableFile().SetFile(PathRef, false,
+ FileSpec::Style::native);
llvm::StringRef Rest = Environ->getBuffer();
while (!Rest.empty()) {
llvm::StringRef Var;
std::tie(Var, Rest) = Rest.split('\0');
- process_info.GetEnvironmentEntries().AppendArgument(Var);
+ process_info.GetEnvironment().insert(Var);
}
llvm::StringRef Arg0;
@@ -249,8 +247,8 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
if (State == ProcessState::Zombie)
continue;
- // Check for user match if we're not matching all users and not running as
- // root.
+ // Check for user match if we're not matching all users and not running
+ // as root.
if (!all_users && (our_uid != 0) && (process_info.GetUserID() != our_uid))
continue;
@@ -297,14 +295,7 @@ bool Host::GetProcessInfo(lldb::pid_t pid, ProcessInstanceInfo &process_info) {
return GetProcessAndStatInfo(pid, process_info, State, tracerpid);
}
-size_t Host::GetEnvironment(StringList &env) {
- char **host_env = environ;
- char *env_entry;
- size_t i;
- for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
- env.AppendString(env_entry);
- return i;
-}
+Environment Host::GetEnvironment() { return Environment(environ); }
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
return Status("unimplemented");
diff --git a/source/Host/linux/HostInfoLinux.cpp b/source/Host/linux/HostInfoLinux.cpp
index 8d59cda249e8..1d95010e2f73 100644
--- a/source/Host/linux/HostInfoLinux.cpp
+++ b/source/Host/linux/HostInfoLinux.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "lldb/Host/Config.h"
#include "lldb/Host/linux/HostInfoLinux.h"
#include "lldb/Utility/Log.h"
@@ -25,12 +26,8 @@ using namespace lldb_private;
namespace {
struct HostInfoLinuxFields {
- HostInfoLinuxFields() : m_os_major(0), m_os_minor(0), m_os_update(0) {}
-
std::string m_distribution_id;
- uint32_t m_os_major;
- uint32_t m_os_minor;
- uint32_t m_os_update;
+ llvm::VersionTuple m_os_version;
};
HostInfoLinuxFields *g_fields = nullptr;
@@ -42,35 +39,21 @@ void HostInfoLinux::Initialize() {
g_fields = new HostInfoLinuxFields();
}
-bool HostInfoLinux::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
- static bool success = false;
+llvm::VersionTuple HostInfoLinux::GetOSVersion() {
static llvm::once_flag g_once_flag;
llvm::call_once(g_once_flag, []() {
-
struct utsname un;
- if (uname(&un) == 0) {
- int status = sscanf(un.release, "%u.%u.%u", &g_fields->m_os_major,
- &g_fields->m_os_minor, &g_fields->m_os_update);
- if (status == 3)
- success = true;
- else {
- // Some kernels omit the update version, so try looking for just "X.Y"
- // and
- // set update to 0.
- g_fields->m_os_update = 0;
- status = sscanf(un.release, "%u.%u", &g_fields->m_os_major,
- &g_fields->m_os_minor);
- if (status == 2)
- success = true;
- }
- }
+ if (uname(&un) != 0)
+ return;
+
+ llvm::StringRef release = un.release;
+ // The kernel release string can include a lot of stuff (e.g.
+ // 4.9.0-6-amd64). We're only interested in the numbered prefix.
+ release = release.substr(0, release.find_first_not_of("0123456789."));
+ g_fields->m_os_version.tryParse(release);
});
- major = g_fields->m_os_major;
- minor = g_fields->m_os_minor;
- update = g_fields->m_os_update;
- return success;
+ return g_fields->m_os_version;
}
bool HostInfoLinux::GetOSBuildString(std::string &s) {
@@ -99,8 +82,8 @@ bool HostInfoLinux::GetOSKernelDescription(std::string &s) {
}
llvm::StringRef HostInfoLinux::GetDistributionId() {
- // Try to run 'lbs_release -i', and use that response
- // for the distribution id.
+ // Try to run 'lbs_release -i', and use that response for the distribution
+ // id.
static llvm::once_flag g_once_flag;
llvm::call_once(g_once_flag, []() {
@@ -108,8 +91,7 @@ llvm::StringRef HostInfoLinux::GetDistributionId() {
if (log)
log->Printf("attempting to determine Linux distribution...");
- // check if the lsb_release command exists at one of the
- // following paths
+ // check if the lsb_release command exists at one of the following paths
const char *const exe_paths[] = {"/bin/lsb_release",
"/usr/bin/lsb_release"};
@@ -188,7 +170,7 @@ FileSpec HostInfoLinux::GetProgramFileSpec() {
ssize_t len = readlink("/proc/self/exe", exe_path, sizeof(exe_path) - 1);
if (len > 0) {
exe_path[len] = 0;
- g_program_filespec.SetFile(exe_path, false);
+ g_program_filespec.SetFile(exe_path, false, FileSpec::Style::native);
}
}
@@ -204,15 +186,15 @@ bool HostInfoLinux::ComputeSupportExeDirectory(FileSpec &file_spec) {
}
bool HostInfoLinux::ComputeSystemPluginsDirectory(FileSpec &file_spec) {
- FileSpec temp_file("/usr/lib/lldb/plugins", true);
+ FileSpec temp_file("/usr/lib" LLDB_LIBDIR_SUFFIX "/lldb/plugins", true);
file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str());
return true;
}
bool HostInfoLinux::ComputeUserPluginsDirectory(FileSpec &file_spec) {
// XDG Base Directory Specification
- // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
- // If XDG_DATA_HOME exists, use that, otherwise use ~/.local/share/lldb.
+ // http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html If
+ // XDG_DATA_HOME exists, use that, otherwise use ~/.local/share/lldb.
const char *xdg_data_home = getenv("XDG_DATA_HOME");
if (xdg_data_home && xdg_data_home[0]) {
std::string user_plugin_dir(xdg_data_home);
diff --git a/source/Host/macosx/Symbols.cpp b/source/Host/macosx/Symbols.cpp
index 98c110b1bed6..b01c48e51d90 100644
--- a/source/Host/macosx/Symbols.cpp
+++ b/source/Host/macosx/Symbols.cpp
@@ -23,7 +23,7 @@
#include "Host/macosx/cfcpp/CFCData.h"
#include "Host/macosx/cfcpp/CFCReleaser.h"
#include "Host/macosx/cfcpp/CFCString.h"
-#include "lldb/Core/Module.h"
+#include "lldb/Core/ModuleList.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/Host.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -55,6 +55,13 @@ CFDictionaryRef DBGCopyDSYMPropertyLists(CFURLRef dsym_url);
int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
ModuleSpec &return_module_spec) {
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ if (!ModuleList::GetGlobalModuleListProperties().GetEnableExternalLookup()) {
+ if (log)
+ log->Printf("Spotlight lookup for .dSYM bundles is disabled.");
+ return 0;
+ }
+
return_module_spec = module_spec;
return_module_spec.GetFileSpec().Clear();
return_module_spec.GetSymbolFileSpec().Clear();
@@ -69,8 +76,8 @@ int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
if (uuid && uuid->IsValid()) {
// Try and locate the dSYM file using DebugSymbols first
- const UInt8 *module_uuid = (const UInt8 *)uuid->GetBytes();
- if (module_uuid != NULL) {
+ llvm::ArrayRef<uint8_t> module_uuid = uuid->GetBytes();
+ if (module_uuid.size() == 16) {
CFCReleaser<CFUUIDRef> module_uuid_ref(::CFUUIDCreateWithBytes(
NULL, module_uuid[0], module_uuid[1], module_uuid[2], module_uuid[3],
module_uuid[4], module_uuid[5], module_uuid[6], module_uuid[7],
@@ -80,7 +87,6 @@ int LocateMacOSXFilesUsingDebugSymbols(const ModuleSpec &module_spec,
if (module_uuid_ref.get()) {
CFCReleaser<CFURLRef> exec_url;
const FileSpec *exec_fspec = module_spec.GetFileSpecPtr();
- Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
if (exec_fspec) {
char exec_cf_path[PATH_MAX];
if (exec_fspec->GetPath(exec_cf_path, sizeof(exec_cf_path)))
@@ -241,52 +247,53 @@ FileSpec Symbols::FindSymbolFileInBundle(const FileSpec &dsym_bundle_fspec,
const lldb_private::UUID *uuid,
const ArchSpec *arch) {
char path[PATH_MAX];
+ if (dsym_bundle_fspec.GetPath(path, sizeof(path)) == 0)
+ return {};
- FileSpec dsym_fspec;
+ ::strncat(path, "/Contents/Resources/DWARF", sizeof(path) - strlen(path) - 1);
- if (dsym_bundle_fspec.GetPath(path, sizeof(path))) {
- ::strncat(path, "/Contents/Resources/DWARF",
- sizeof(path) - strlen(path) - 1);
-
- lldb_utility::CleanUp<DIR *, int> dirp(opendir(path), NULL, closedir);
- if (dirp.is_valid()) {
- dsym_fspec.GetDirectory().SetCString(path);
- struct dirent *dp;
- while ((dp = readdir(dirp.get())) != NULL) {
- // Only search directories
- if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN) {
- if (dp->d_namlen == 1 && dp->d_name[0] == '.')
- continue;
-
- if (dp->d_namlen == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.')
- continue;
- }
+ DIR *dirp = opendir(path);
+ if (!dirp)
+ return {};
- if (dp->d_type == DT_REG || dp->d_type == DT_UNKNOWN) {
- dsym_fspec.GetFilename().SetCString(dp->d_name);
- ModuleSpecList module_specs;
- if (ObjectFile::GetModuleSpecifications(dsym_fspec, 0, 0,
- module_specs)) {
- ModuleSpec spec;
- for (size_t i = 0; i < module_specs.GetSize(); ++i) {
- 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)))) {
- return dsym_fspec;
- }
- }
+ // Make sure we close the directory before exiting this scope.
+ CleanUp cleanup_dir(closedir, dirp);
+
+ FileSpec dsym_fspec;
+ dsym_fspec.GetDirectory().SetCString(path);
+ struct dirent *dp;
+ while ((dp = readdir(dirp)) != NULL) {
+ // Only search directories
+ if (dp->d_type == DT_DIR || dp->d_type == DT_UNKNOWN) {
+ if (dp->d_namlen == 1 && dp->d_name[0] == '.')
+ continue;
+
+ if (dp->d_namlen == 2 && dp->d_name[0] == '.' && dp->d_name[1] == '.')
+ continue;
+ }
+
+ if (dp->d_type == DT_REG || dp->d_type == DT_UNKNOWN) {
+ dsym_fspec.GetFilename().SetCString(dp->d_name);
+ ModuleSpecList module_specs;
+ if (ObjectFile::GetModuleSpecifications(dsym_fspec, 0, 0, module_specs)) {
+ ModuleSpec spec;
+ for (size_t i = 0; i < module_specs.GetSize(); ++i) {
+ 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)))) {
+ return dsym_fspec;
}
}
}
}
}
- dsym_fspec.Clear();
- return dsym_fspec;
+
+ return {};
}
static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
@@ -302,7 +309,8 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
(CFDictionaryRef)uuid_dict, CFSTR("DBGSymbolRichExecutable"));
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
if (CFCString::FileSystemRepresentation(cf_str, str)) {
- module_spec.GetFileSpec().SetFile(str.c_str(), true);
+ module_spec.GetFileSpec().SetFile(str.c_str(), true,
+ FileSpec::Style::native);
if (log) {
log->Printf(
"From dsymForUUID plist: Symbol rich executable is at '%s'",
@@ -315,7 +323,8 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
CFSTR("DBGDSYMPath"));
if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
if (CFCString::FileSystemRepresentation(cf_str, str)) {
- module_spec.GetSymbolFileSpec().SetFile(str.c_str(), true);
+ module_spec.GetSymbolFileSpec().SetFile(str.c_str(), true,
+ FileSpec::Style::native);
success = true;
if (log) {
log->Printf("From dsymForUUID plist: dSYM is at '%s'", str.c_str());
@@ -333,28 +342,13 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
std::string DBGBuildSourcePath;
std::string DBGSourcePath;
- cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
- CFSTR("DBGBuildSourcePath"));
- if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
- CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
- }
-
- cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
- CFSTR("DBGSourcePath"));
- if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
- CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
- }
-
- if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
- if (DBGSourcePath[0] == '~') {
- FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
- DBGSourcePath = resolved_source_path.GetPath();
- }
- module_spec.GetSourceMappingList().Append(
- ConstString(DBGBuildSourcePath.c_str()),
- ConstString(DBGSourcePath.c_str()), true);
- }
-
+ // If DBGVersion 1 or DBGVersion missing, ignore DBGSourcePathRemapping.
+ // If DBGVersion 2, strip last two components of path remappings from
+ // entries to fix an issue with a specific set of
+ // DBGSourcePathRemapping entries that lldb worked
+ // with.
+ // If DBGVersion 3, trust & use the source path remappings as-is.
+ //
cf_dict = (CFDictionaryRef)CFDictionaryGetValue(
(CFDictionaryRef)uuid_dict, CFSTR("DBGSourcePathRemapping"));
if (cf_dict && CFGetTypeID(cf_dict) == CFDictionaryGetTypeID()) {
@@ -401,10 +395,9 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
}
if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
// In the "old style" DBGSourcePathRemapping dictionary, the
- // DBGSourcePath values
- // (the "values" half of key-value path pairs) were wrong. Ignore
- // them and use the
- // universal DBGSourcePath string from earlier.
+ // DBGSourcePath values (the "values" half of key-value path pairs)
+ // were wrong. Ignore them and use the universal DBGSourcePath
+ // string from earlier.
if (new_style_source_remapping_dictionary == true &&
!original_DBGSourcePath_value.empty()) {
DBGSourcePath = original_DBGSourcePath_value;
@@ -414,9 +407,9 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
DBGSourcePath = resolved_source_path.GetPath();
}
// With version 2 of DBGSourcePathRemapping, we can chop off the
- // last two filename parts from the source remapping and get a
- // more general source remapping that still works. Add this as
- // another option in addition to the full source path remap.
+ // last two filename parts from the source remapping and get a more
+ // general source remapping that still works. Add this as another
+ // option in addition to the full source path remap.
module_spec.GetSourceMappingList().Append(
ConstString(DBGBuildSourcePath.c_str()),
ConstString(DBGSourcePath.c_str()), true);
@@ -439,6 +432,32 @@ static bool GetModuleSpecInfoFromUUIDDictionary(CFDictionaryRef uuid_dict,
free(values);
}
}
+
+
+ // If we have a DBGBuildSourcePath + DBGSourcePath pair, append them to the
+ // source remappings list.
+
+ cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
+ CFSTR("DBGBuildSourcePath"));
+ if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
+ CFCString::FileSystemRepresentation(cf_str, DBGBuildSourcePath);
+ }
+
+ cf_str = (CFStringRef)CFDictionaryGetValue((CFDictionaryRef)uuid_dict,
+ CFSTR("DBGSourcePath"));
+ if (cf_str && CFGetTypeID(cf_str) == CFStringGetTypeID()) {
+ CFCString::FileSystemRepresentation(cf_str, DBGSourcePath);
+ }
+
+ if (!DBGBuildSourcePath.empty() && !DBGSourcePath.empty()) {
+ if (DBGSourcePath[0] == '~') {
+ FileSpec resolved_source_path(DBGSourcePath.c_str(), true);
+ DBGSourcePath = resolved_source_path.GetPath();
+ }
+ module_spec.GetSourceMappingList().Append(
+ ConstString(DBGBuildSourcePath.c_str()),
+ ConstString(DBGSourcePath.c_str()), true);
+ }
}
return success;
}
@@ -450,8 +469,7 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
const FileSpec *file_spec_ptr = module_spec.GetFileSpecPtr();
// It's expensive to check for the DBGShellCommands defaults setting, only do
- // it once per
- // lldb run and cache the result.
+ // it once per lldb run and cache the result.
static bool g_have_checked_for_dbgshell_command = false;
static const char *g_dbgshell_command = NULL;
if (g_have_checked_for_dbgshell_command == false) {
@@ -473,8 +491,7 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
}
// When g_dbgshell_command is NULL, the user has not enabled the use of an
- // external program
- // to find the symbols, don't run it for them.
+ // external program to find the symbols, don't run it for them.
if (force_lookup == false && g_dbgshell_command == NULL) {
return false;
}
@@ -489,12 +506,14 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
getenv("LLDB_APPLE_DSYMFORUUID_EXECUTABLE");
FileSpec dsym_for_uuid_exe_spec;
if (dsym_for_uuid_exe_path_cstr) {
- dsym_for_uuid_exe_spec.SetFile(dsym_for_uuid_exe_path_cstr, true);
+ dsym_for_uuid_exe_spec.SetFile(dsym_for_uuid_exe_path_cstr, true,
+ FileSpec::Style::native);
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
}
if (!g_dsym_for_uuid_exe_exists) {
- dsym_for_uuid_exe_spec.SetFile("/usr/local/bin/dsymForUUID", false);
+ dsym_for_uuid_exe_spec.SetFile("/usr/local/bin/dsymForUUID", false,
+ FileSpec::Style::native);
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
if (!g_dsym_for_uuid_exe_exists) {
long bufsize;
@@ -508,14 +527,16 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
tilde_rc && tilde_rc->pw_dir) {
std::string dsymforuuid_path(tilde_rc->pw_dir);
dsymforuuid_path += "/bin/dsymForUUID";
- dsym_for_uuid_exe_spec.SetFile(dsymforuuid_path.c_str(), false);
+ dsym_for_uuid_exe_spec.SetFile(dsymforuuid_path.c_str(), false,
+ FileSpec::Style::native);
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
}
}
}
}
if (!g_dsym_for_uuid_exe_exists && g_dbgshell_command != NULL) {
- dsym_for_uuid_exe_spec.SetFile(g_dbgshell_command, true);
+ dsym_for_uuid_exe_spec.SetFile(g_dbgshell_command, true,
+ FileSpec::Style::native);
g_dsym_for_uuid_exe_exists = dsym_for_uuid_exe_spec.Exists();
}
@@ -561,8 +582,9 @@ bool Symbols::DownloadObjectAndSymbolFile(ModuleSpec &module_spec,
&exit_status, // Exit status
&signo, // Signal int *
&command_output, // Command output
- 30, // Large timeout to allow for long dsym download times
- false); // Don't run in a shell (we don't need shell expansion)
+ std::chrono::seconds(
+ 30), // Large timeout to allow for long dsym download times
+ false); // Don't run in a shell (we don't need shell expansion)
if (error.Success() && exit_status == 0 && !command_output.empty()) {
CFCData data(CFDataCreateWithBytesNoCopy(
NULL, (const UInt8 *)command_output.data(), command_output.size(),
diff --git a/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp b/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
index 201ec9a8f5c2..0c52aa3ed051 100644
--- a/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
+++ b/source/Host/macosx/cfcpp/CFCMutableDictionary.cpp
@@ -352,9 +352,8 @@ bool CFCMutableDictionary::AddValueUInt64(CFStringRef key, uint64_t value,
CFMutableDictionaryRef dict = Dictionary(can_create);
if (dict != NULL) {
// The number may appear negative if the MSBit is set in "value". Due to a
- // limitation of
- // CFNumber, there isn't a way to have it show up otherwise as of this
- // writing.
+ // limitation of CFNumber, there isn't a way to have it show up otherwise
+ // as of this writing.
CFCReleaser<CFNumberRef> cf_number(
::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
if (cf_number.get()) {
@@ -371,9 +370,8 @@ bool CFCMutableDictionary::SetValueUInt64(CFStringRef key, uint64_t value,
CFMutableDictionaryRef dict = Dictionary(can_create);
if (dict != NULL) {
// The number may appear negative if the MSBit is set in "value". Due to a
- // limitation of
- // CFNumber, there isn't a way to have it show up otherwise as of this
- // writing.
+ // limitation of CFNumber, there isn't a way to have it show up otherwise
+ // as of this writing.
CFCReleaser<CFNumberRef> cf_number(
::CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &value));
if (cf_number.get()) {
@@ -390,9 +388,8 @@ bool CFCMutableDictionary::AddValueDouble(CFStringRef key, double value,
CFMutableDictionaryRef dict = Dictionary(can_create);
if (dict != NULL) {
// The number may appear negative if the MSBit is set in "value". Due to a
- // limitation of
- // CFNumber, there isn't a way to have it show up otherwise as of this
- // writing.
+ // limitation of CFNumber, there isn't a way to have it show up otherwise
+ // as of this writing.
CFCReleaser<CFNumberRef> cf_number(
::CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &value));
if (cf_number.get()) {
@@ -409,9 +406,8 @@ bool CFCMutableDictionary::SetValueDouble(CFStringRef key, double value,
CFMutableDictionaryRef dict = Dictionary(can_create);
if (dict != NULL) {
// The number may appear negative if the MSBit is set in "value". Due to a
- // limitation of
- // CFNumber, there isn't a way to have it show up otherwise as of this
- // writing.
+ // limitation of CFNumber, there isn't a way to have it show up otherwise
+ // as of this writing.
CFCReleaser<CFNumberRef> cf_number(
::CFNumberCreate(kCFAllocatorDefault, kCFNumberDoubleType, &value));
if (cf_number.get()) {
diff --git a/source/Host/macosx/cfcpp/CFCString.cpp b/source/Host/macosx/cfcpp/CFCString.cpp
index 0d3853c60a72..6191f873c98a 100644
--- a/source/Host/macosx/cfcpp/CFCString.cpp
+++ b/source/Host/macosx/cfcpp/CFCString.cpp
@@ -88,9 +88,8 @@ const char *CFCString::UTF8(std::string &str) {
return CFCString::UTF8(get(), str);
}
-// Static function that puts a copy of the UTF8 contents of CF_STR into STR
-// and returns the C string pointer that is contained in STR when successful,
-// else
+// Static function that puts a copy of the UTF8 contents of CF_STR into STR and
+// returns the C string pointer that is contained in STR when successful, else
// NULL is returned. This allows the std::string parameter to own the extracted
// string,
// and also allows that string to be returned as a C string pointer that can be
@@ -129,9 +128,9 @@ const char *CFCString::ExpandTildeInPath(const char *path,
// Static function that puts a copy of the file system representation of CF_STR
// into STR and returns the C string pointer that is contained in STR when
-// successful, else NULL is returned. This allows the std::string parameter
-// to own the extracted string, and also allows that string to be returned as
-// a C string pointer that can be used.
+// successful, else NULL is returned. This allows the std::string parameter to
+// own the extracted string, and also allows that string to be returned as a C
+// string pointer that can be used.
const char *CFCString::FileSystemRepresentation(CFStringRef cf_str,
std::string &str) {
diff --git a/source/Host/macosx/objcxx/CMakeLists.txt b/source/Host/macosx/objcxx/CMakeLists.txt
new file mode 100644
index 000000000000..77e3091dc4fe
--- /dev/null
+++ b/source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,20 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCXX
+ Host.mm
+ HostInfoMacOSX.mm
+ HostThreadMacOSX.mm
+
+ LINK_LIBS
+ lldbCore
+ lldbSymbol
+ lldbTarget
+ lldbUtility
+ ${EXTRA_LIBS}
+
+ LINK_COMPONENTS
+ Object
+ Support
+ )
diff --git a/source/Host/macosx/Host.mm b/source/Host/macosx/objcxx/Host.mm
index 7359815fdf70..a70bf0421ec4 100644
--- a/source/Host/macosx/Host.mm
+++ b/source/Host/macosx/objcxx/Host.mm
@@ -54,13 +54,10 @@
#include <sys/types.h>
#include <unistd.h>
-#include "lldb/Core/Communication.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Core/ModuleSpec.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/ThreadLauncher.h"
-#include "lldb/Target/Platform.h"
+#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/Process.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/CleanUp.h"
@@ -72,15 +69,16 @@
#include "lldb/Utility/NameMatches.h"
#include "lldb/Utility/StreamString.h"
#include "lldb/Utility/StructuredData.h"
+#include "lldb/lldb-defines.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Errno.h"
-#include "cfcpp/CFCBundle.h"
-#include "cfcpp/CFCMutableArray.h"
-#include "cfcpp/CFCMutableDictionary.h"
-#include "cfcpp/CFCReleaser.h"
-#include "cfcpp/CFCString.h"
+#include "../cfcpp/CFCBundle.h"
+#include "../cfcpp/CFCMutableArray.h"
+#include "../cfcpp/CFCMutableDictionary.h"
+#include "../cfcpp/CFCReleaser.h"
+#include "../cfcpp/CFCString.h"
#include <objc/objc-auto.h>
@@ -107,7 +105,7 @@ bool Host::GetBundleDirectory(const FileSpec &file,
if (file.GetPath(path, sizeof(path))) {
CFCBundle bundle(path);
if (bundle.GetPath(path, sizeof(path))) {
- bundle_directory.SetFile(path, false);
+ bundle_directory.SetFile(path, false, FileSpec::Style::native);
return true;
}
}
@@ -127,7 +125,7 @@ bool Host::ResolveExecutableInBundle(FileSpec &file) {
if (url.get()) {
if (::CFURLGetFileSystemRepresentation(url.get(), YES, (UInt8 *)path,
sizeof(path))) {
- file.SetFile(path, false);
+ file.SetFile(path, false, FileSpec::Style::native);
return true;
}
}
@@ -184,175 +182,6 @@ static bool WaitForProcessToSIGSTOP(const lldb::pid_t pid,
}
#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
-// static lldb::pid_t
-// LaunchInNewTerminalWithCommandFile
-//(
-// const char **argv,
-// const char **envp,
-// const char *working_dir,
-// const ArchSpec *arch_spec,
-// bool stop_at_entry,
-// bool disable_aslr
-//)
-//{
-// if (!argv || !argv[0])
-// return LLDB_INVALID_PROCESS_ID;
-//
-// OSStatus error = 0;
-//
-// FileSpec program (argv[0], false);
-//
-//
-// std::string unix_socket_name;
-//
-// char temp_file_path[PATH_MAX];
-// const char *tmpdir = ::getenv ("TMPDIR");
-// if (tmpdir == NULL)
-// tmpdir = "/tmp/";
-// ::snprintf (temp_file_path, sizeof(temp_file_path), "%s%s-XXXXXX", tmpdir,
-// program.GetFilename().AsCString());
-//
-// if (::mktemp (temp_file_path) == NULL)
-// return LLDB_INVALID_PROCESS_ID;
-//
-// unix_socket_name.assign (temp_file_path);
-//
-// ::strlcat (temp_file_path, ".command", sizeof (temp_file_path));
-//
-// StreamFile command_file;
-// command_file.GetFile().Open (temp_file_path,
-// File::eOpenOptionWrite |
-// File::eOpenOptionCanCreate,
-// lldb::eFilePermissionsDefault);
-//
-// if (!command_file.GetFile().IsValid())
-// return LLDB_INVALID_PROCESS_ID;
-//
-// FileSpec darwin_debug_file_spec;
-// if (!HostInfo::GetLLDBPath (ePathTypeSupportExecutableDir,
-// darwin_debug_file_spec))
-// return LLDB_INVALID_PROCESS_ID;
-// darwin_debug_file_spec.GetFilename().SetCString("darwin-debug");
-//
-// if (!darwin_debug_file_spec.Exists())
-// return LLDB_INVALID_PROCESS_ID;
-//
-// char launcher_path[PATH_MAX];
-// darwin_debug_file_spec.GetPath(launcher_path, sizeof(launcher_path));
-// command_file.Printf("\"%s\" ", launcher_path);
-//
-// command_file.Printf("--unix-socket=%s ", unix_socket_name.c_str());
-//
-// if (arch_spec && arch_spec->IsValid())
-// {
-// command_file.Printf("--arch=%s ", arch_spec->GetArchitectureName());
-// }
-//
-// if (disable_aslr)
-// {
-// command_file.PutCString("--disable-aslr ");
-// }
-//
-// command_file.PutCString("-- ");
-//
-// if (argv)
-// {
-// for (size_t i=0; argv[i] != NULL; ++i)
-// {
-// command_file.Printf("\"%s\" ", argv[i]);
-// }
-// }
-// command_file.PutCString("\necho Process exited with status $?\n");
-// command_file.GetFile().Close();
-// if (::chmod (temp_file_path, S_IRWXU | S_IRWXG) != 0)
-// return LLDB_INVALID_PROCESS_ID;
-//
-// CFCMutableDictionary cf_env_dict;
-//
-// const bool can_create = true;
-// if (envp)
-// {
-// for (size_t i=0; envp[i] != NULL; ++i)
-// {
-// const char *env_entry = envp[i];
-// const char *equal_pos = strchr(env_entry, '=');
-// if (equal_pos)
-// {
-// std::string env_key (env_entry, equal_pos);
-// std::string env_val (equal_pos + 1);
-// CFCString cf_env_key (env_key.c_str(), kCFStringEncodingUTF8);
-// CFCString cf_env_val (env_val.c_str(), kCFStringEncodingUTF8);
-// cf_env_dict.AddValue (cf_env_key.get(), cf_env_val.get(),
-// can_create);
-// }
-// }
-// }
-//
-// LSApplicationParameters app_params;
-// ::memset (&app_params, 0, sizeof (app_params));
-// app_params.flags = kLSLaunchDontAddToRecents | kLSLaunchAsync;
-// app_params.argv = NULL;
-// app_params.environment = (CFDictionaryRef)cf_env_dict.get();
-//
-// CFCReleaser<CFURLRef> command_file_url
-// (::CFURLCreateFromFileSystemRepresentation (NULL,
-// (const UInt8 *)temp_file_path,
-// strlen(temp_file_path),
-// false));
-//
-// CFCMutableArray urls;
-//
-// // Terminal.app will open the ".command" file we have created
-// // and run our process inside it which will wait at the entry point
-// // for us to attach.
-// urls.AppendValue(command_file_url.get());
-//
-//
-// lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
-//
-// Status lldb_error;
-// // Sleep and wait a bit for debugserver to start to listen...
-// char connect_url[128];
-// ::snprintf (connect_url, sizeof(connect_url), "unix-accept://%s",
-// unix_socket_name.c_str());
-//
-// // Spawn a new thread to accept incoming connection on the connect_url
-// // so we can grab the pid from the inferior
-// lldb::thread_t accept_thread = Host::ThreadCreate
-// (unix_socket_name.c_str(),
-// AcceptPIDFromInferior,
-// connect_url,
-// &lldb_error);
-//
-// ProcessSerialNumber psn;
-// error = LSOpenURLsWithRole(urls.get(), kLSRolesShell, NULL, &app_params,
-// &psn, 1);
-// if (error == noErr)
-// {
-// thread_result_t accept_thread_result = NULL;
-// if (Host::ThreadJoin (accept_thread, &accept_thread_result,
-// &lldb_error))
-// {
-// if (accept_thread_result)
-// {
-// pid = (intptr_t)accept_thread_result;
-//
-// // Wait for process to be stopped the entry point by watching
-// // for the process status to be set to SSTOP which indicates
-// it it
-// // SIGSTOP'ed at the entry point
-// WaitForProcessToSIGSTOP (pid, 5);
-// }
-// }
-// }
-// else
-// {
-// Host::ThreadCancel (accept_thread, &lldb_error);
-// }
-//
-// return pid;
-//}
-
const char *applscript_in_new_tty = "tell application \"Terminal\"\n"
" activate\n"
" do script \"/bin/bash -c '%s';exit\"\n"
@@ -388,9 +217,8 @@ LaunchInNewTerminalWithAppleScript(const char *exe_path,
}
StreamString command;
- FileSpec darwin_debug_file_spec;
- if (!HostInfo::GetLLDBPath(ePathTypeSupportExecutableDir,
- darwin_debug_file_spec)) {
+ FileSpec darwin_debug_file_spec = HostInfo::GetSupportExeDir();
+ if (!darwin_debug_file_spec) {
error.SetErrorString("can't locate the 'darwin-debug' executable");
return error;
}
@@ -431,33 +259,16 @@ LaunchInNewTerminalWithAppleScript(const char *exe_path,
command.PutCString(" --disable-aslr");
// We are launching on this host in a terminal. So compare the environment on
- // the host
- // to what is supplied in the launch_info. Any items that aren't in the host
- // environment
- // need to be sent to darwin-debug. If we send all environment entries, we
- // might blow the
- // max command line length, so we only send user modified entries.
- const char **envp =
- launch_info.GetEnvironmentEntries().GetConstArgumentVector();
-
- StringList host_env;
- const size_t host_env_count = Host::GetEnvironment(host_env);
-
- if (envp && envp[0]) {
- const char *env_entry;
- for (size_t env_idx = 0; (env_entry = envp[env_idx]) != NULL; ++env_idx) {
- bool add_entry = true;
- for (size_t i = 0; i < host_env_count; ++i) {
- const char *host_env_entry = host_env.GetStringAtIndex(i);
- if (strcmp(env_entry, host_env_entry) == 0) {
- add_entry = false;
- break;
- }
- }
- if (add_entry) {
- command.Printf(" --env='%s'", env_entry);
- }
- }
+ // the host to what is supplied in the launch_info. Any items that aren't in
+ // the host environment need to be sent to darwin-debug. If we send all
+ // environment entries, we might blow the max command line length, so we only
+ // send user modified entries.
+ Environment host_env = Host::GetEnvironment();
+
+ for (const auto &KV : launch_info.GetEnvironment()) {
+ auto host_entry = host_env.find(KV.first());
+ if (host_entry == host_env.end() || host_entry->second != KV.second)
+ command.Format(" --env='{0}'", Environment::compose(KV));
}
command.PutCString(" -- ");
@@ -479,19 +290,8 @@ LaunchInNewTerminalWithAppleScript(const char *exe_path,
StreamString applescript_source;
- // if (tty_name && tty_name[0])
- // {
- // applescript_source.Printf (applscript_in_existing_tty,
- // tty_command,
- // tty_name);
- // }
- // else
- // {
applescript_source.Printf(applscript_in_new_tty,
command.GetString().str().c_str());
- // }
-
- // puts (script_source);
NSAppleScript *applescript = [[NSAppleScript alloc]
initWithSource:[NSString stringWithCString:applescript_source.GetString()
.str()
@@ -641,14 +441,7 @@ bool Host::OpenFileInExternalEditor(const FileSpec &file_spec,
#endif // #if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
}
-size_t Host::GetEnvironment(StringList &env) {
- char **host_env = *_NSGetEnviron();
- char *env_entry;
- size_t i;
- for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
- env.AppendString(env_entry);
- return i;
-}
+Environment Host::GetEnvironment() { return Environment(*_NSGetEnviron()); }
static bool GetMacOSXProcessCPUType(ProcessInstanceInfo &process_info) {
if (process_info.ProcessIDIsValid()) {
@@ -748,7 +541,8 @@ static bool GetMacOSXProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
triple_arch == llvm::Triple::x86_64);
const char *cstr = data.GetCStr(&offset);
if (cstr) {
- process_info.GetExecutableFile().SetFile(cstr, false);
+ process_info.GetExecutableFile().SetFile(cstr, false,
+ FileSpec::Style::native);
if (match_info_ptr == NULL ||
NameMatches(
@@ -770,7 +564,7 @@ static bool GetMacOSXProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
proc_args.AppendArgument(llvm::StringRef(cstr));
}
- Args &proc_env = process_info.GetEnvironmentEntries();
+ Environment &proc_env = process_info.GetEnvironment();
while ((cstr = data.GetCStr(&offset))) {
if (cstr[0] == '\0')
break;
@@ -785,7 +579,7 @@ static bool GetMacOSXProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
llvm::Triple::MacOSX);
}
- proc_env.AppendArgument(llvm::StringRef(cstr));
+ proc_env.insert(cstr);
}
return true;
}
@@ -939,6 +733,17 @@ static void PackageXPCArguments(xpc_object_t message, const char *prefix,
}
}
+static void PackageXPCEnvironment(xpc_object_t message, llvm::StringRef prefix,
+ const Environment &env) {
+ xpc_dictionary_set_int64(message, (prefix + "Count").str().c_str(),
+ env.size());
+ size_t i = 0;
+ for (const auto &KV : env) {
+ xpc_dictionary_set_string(message, (prefix + llvm::Twine(i)).str().c_str(),
+ Environment::compose(KV).c_str());
+ }
+}
+
/*
A valid authorizationRef means that
- there is the LaunchUsingXPCRightName rights in the /etc/authorization
@@ -1045,14 +850,11 @@ static short GetPosixspawnFlags(const ProcessLaunchInfo &launch_info) {
if (g_use_close_on_exec_flag == eLazyBoolCalculate) {
g_use_close_on_exec_flag = eLazyBoolNo;
- uint32_t major, minor, update;
- if (HostInfo::GetOSVersion(major, minor, update)) {
+ llvm::VersionTuple version = HostInfo::GetOSVersion();
+ if (version > llvm::VersionTuple(10, 7)) {
// Kernel panic if we use the POSIX_SPAWN_CLOEXEC_DEFAULT on 10.7 or
// earlier
- if (major > 10 || (major == 10 && minor > 7)) {
- // Only enable for 10.8 and later OS versions
- g_use_close_on_exec_flag = eLazyBoolYes;
- }
+ g_use_close_on_exec_flag = eLazyBoolYes;
}
}
#else
@@ -1141,8 +943,8 @@ static Status LaunchProcessXPC(const char *exe_path,
PackageXPCArguments(message, LauncherXPCServiceArgPrefxKey,
launch_info.GetArguments());
- PackageXPCArguments(message, LauncherXPCServiceEnvPrefxKey,
- launch_info.GetEnvironmentEntries());
+ PackageXPCEnvironment(message, LauncherXPCServiceEnvPrefxKey,
+ launch_info.GetEnvironment());
// Posix spawn stuff.
xpc_dictionary_set_int64(message, LauncherXPCServiceCPUTypeKey,
@@ -1294,10 +1096,8 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
return error;
}
- // Make a quick class that will cleanup the posix spawn attributes in case
- // we return in the middle of this function.
- lldb_utility::CleanUp<posix_spawnattr_t *, int> posix_spawnattr_cleanup(
- &attr, posix_spawnattr_destroy);
+ // Make sure we clean up the posix spawn attributes before exiting this scope.
+ CleanUp cleanup_attr(posix_spawnattr_destroy, &attr);
sigset_t no_signals;
sigset_t all_signals;
@@ -1356,8 +1156,7 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
const char *tmp_argv[2];
char *const *argv = const_cast<char *const *>(
launch_info.GetArguments().GetConstArgumentVector());
- char *const *envp = const_cast<char *const *>(
- launch_info.GetEnvironmentEntries().GetConstArgumentVector());
+ Environment::Envp envp = launch_info.GetEnvironment().getEnvp();
if (argv == NULL) {
// posix_spawn gets very unhappy if it doesn't have at least the program
// name in argv[0]. One of the side affects I have noticed is the
@@ -1400,11 +1199,8 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
return error;
}
- // Make a quick class that will cleanup the posix spawn attributes in case
- // we return in the middle of this function.
- lldb_utility::CleanUp<posix_spawn_file_actions_t *, int>
- posix_spawn_file_actions_cleanup(&file_actions,
- posix_spawn_file_actions_destroy);
+ // Make sure we clean up the posix file actions before exiting this scope.
+ CleanUp cleanup_fileact(posix_spawn_file_actions_destroy, &file_actions);
for (size_t i = 0; i < num_file_actions; ++i) {
const FileAction *launch_file_action =
@@ -1425,7 +1221,8 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
"error: {0}, ::posix_spawnp(pid => {1}, path = '{2}', "
"file_actions = {3}, "
"attr = {4}, argv = {5}, envp = {6} )",
- error, result_pid, exe_path, &file_actions, &attr, argv, envp);
+ error, result_pid, exe_path, &file_actions, &attr, argv,
+ envp.get());
if (log) {
for (int ii = 0; argv[ii]; ++ii)
LLDB_LOG(log, "argv[{0}] = '{1}'", ii, argv[ii]);
@@ -1441,7 +1238,7 @@ static Status LaunchProcessPosixSpawn(const char *exe_path,
LLDB_LOG(log,
"error: {0}, ::posix_spawnp ( pid => {1}, path = '{2}', "
"file_actions = NULL, attr = {3}, argv = {4}, envp = {5} )",
- error, result_pid, exe_path, &attr, argv, envp);
+ error, result_pid, exe_path, &attr, argv, envp.get());
if (log) {
for (int ii = 0; argv[ii]; ++ii)
LLDB_LOG(log, "argv[{0}] = '{1}'", ii, argv[ii]);
@@ -1476,36 +1273,28 @@ static bool ShouldLaunchUsingXPC(ProcessLaunchInfo &launch_info) {
Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
Status error;
- char exe_path[PATH_MAX];
- PlatformSP host_platform_sp(Platform::GetHostPlatform());
-
- ModuleSpec exe_module_spec(launch_info.GetExecutableFile(),
- launch_info.GetArchitecture());
-
- if (!llvm::sys::fs::is_regular_file(
- exe_module_spec.GetFileSpec().GetPath())) {
- lldb::ModuleSP exe_module_sp;
- error = host_platform_sp->ResolveExecutable(exe_module_spec, exe_module_sp,
- NULL);
-
- if (error.Fail())
- return error;
+ FileSpec exe_spec(launch_info.GetExecutableFile());
- if (exe_module_sp)
- exe_module_spec.GetFileSpec() = exe_module_sp->GetFileSpec();
+ llvm::sys::fs::file_status stats;
+ status(exe_spec.GetPath(), stats);
+ if (!exists(stats)) {
+ exe_spec.ResolvePath();
+ status(exe_spec.GetPath(), stats);
}
-
- if (exe_module_spec.GetFileSpec().Exists()) {
- exe_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
- } else {
- launch_info.GetExecutableFile().GetPath(exe_path, sizeof(exe_path));
- error.SetErrorStringWithFormat("executable doesn't exist: '%s'", exe_path);
+ if (!exists(stats)) {
+ exe_spec.ResolveExecutableLocation();
+ status(exe_spec.GetPath(), stats);
+ }
+ if (!exists(stats)) {
+ error.SetErrorStringWithFormatv("executable doesn't exist: '{0}'",
+ launch_info.GetExecutableFile());
return error;
}
if (launch_info.GetFlags().Test(eLaunchFlagLaunchInTTY)) {
#if !defined(__arm__) && !defined(__arm64__) && !defined(__aarch64__)
- return LaunchInNewTerminalWithAppleScript(exe_path, launch_info);
+ return LaunchInNewTerminalWithAppleScript(exe_spec.GetPath().c_str(),
+ launch_info);
#else
error.SetErrorString("launching a process in a new terminal is not "
"supported on iOS devices");
@@ -1516,9 +1305,10 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
lldb::pid_t pid = LLDB_INVALID_PROCESS_ID;
if (ShouldLaunchUsingXPC(launch_info)) {
- error = LaunchProcessXPC(exe_path, launch_info, pid);
+ error = LaunchProcessXPC(exe_spec.GetPath().c_str(), launch_info, pid);
} else {
- error = LaunchProcessPosixSpawn(exe_path, launch_info, pid);
+ error =
+ LaunchProcessPosixSpawn(exe_spec.GetPath().c_str(), launch_info, pid);
}
if (pid != LLDB_INVALID_PROCESS_ID) {
@@ -1526,15 +1316,9 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
launch_info.SetProcessID(pid);
// Make sure we reap any processes we spawn or we will have zombies.
- if (!launch_info.MonitorProcess()) {
- const bool monitor_signals = false;
- Host::MonitorChildProcessCallback callback = nullptr;
-
- if (!launch_info.GetFlags().Test(lldb::eLaunchFlagDontSetExitStatus))
- callback = Process::SetProcessExitStatus;
-
- StartMonitoringChildProcess(callback, pid, monitor_signals);
- }
+ bool monitoring = launch_info.MonitorProcess();
+ UNUSED_IF_ASSERT_DISABLED(monitoring);
+ assert(monitoring);
} else {
// Invalid process ID, something didn't go well
if (error.Success())
@@ -1546,9 +1330,8 @@ Status Host::LaunchProcess(ProcessLaunchInfo &launch_info) {
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
Status error;
if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) {
- FileSpec expand_tool_spec;
- if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir,
- expand_tool_spec)) {
+ FileSpec expand_tool_spec = HostInfo::GetSupportExeDir();
+ if (!expand_tool_spec) {
error.SetErrorString(
"could not get support executable directory for lldb-argdumper tool");
return error;
@@ -1583,7 +1366,8 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
launch_info.SetWorkingDirectory(working_dir);
}
}
- RunShellCommand(expand_command, cwd, &status, nullptr, &output, 10);
+ RunShellCommand(expand_command, cwd, &status, nullptr, &output,
+ std::chrono::seconds(10));
if (status != 0) {
error.SetErrorStringWithFormat("lldb-argdumper exited with error %d",
diff --git a/source/Host/macosx/HostInfoMacOSX.mm b/source/Host/macosx/objcxx/HostInfoMacOSX.mm
index 8774c76ef2da..a39d26aa31ae 100644
--- a/source/Host/macosx/HostInfoMacOSX.mm
+++ b/source/Host/macosx/objcxx/HostInfoMacOSX.mm
@@ -7,18 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#if !defined(LLDB_DISABLE_PYTHON)
-#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
-#endif
-
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/macosx/HostInfoMacOSX.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/SafeMachO.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
// C++ Includes
@@ -30,7 +27,7 @@
#include <sys/syslimits.h>
#include <sys/types.h>
-// Objective C/C++ includes
+// Objective-C/C++ includes
#include <CoreFoundation/CoreFoundation.h>
#include <Foundation/Foundation.h>
#include <mach-o/dyld.h>
@@ -75,32 +72,21 @@ bool HostInfoMacOSX::GetOSKernelDescription(std::string &s) {
return false;
}
-bool HostInfoMacOSX::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
- static uint32_t g_major = 0;
- static uint32_t g_minor = 0;
- static uint32_t g_update = 0;
+llvm::VersionTuple HostInfoMacOSX::GetOSVersion() {
+ static llvm::VersionTuple g_version;
- if (g_major == 0) {
+ if (g_version.empty()) {
@autoreleasepool {
NSDictionary *version_info = [NSDictionary
dictionaryWithContentsOfFile:
@"/System/Library/CoreServices/SystemVersion.plist"];
NSString *version_value = [version_info objectForKey:@"ProductVersion"];
const char *version_str = [version_value UTF8String];
- if (version_str)
- Args::StringToVersion(llvm::StringRef(version_str), g_major, g_minor,
- g_update);
+ g_version.tryParse(version_str);
}
}
- if (g_major != 0) {
- major = g_major;
- minor = g_minor;
- update = g_update;
- return true;
- }
- return false;
+ return g_version;
}
FileSpec HostInfoMacOSX::GetProgramFileSpec() {
@@ -111,13 +97,15 @@ FileSpec HostInfoMacOSX::GetProgramFileSpec() {
uint32_t len = sizeof(program_fullpath);
int err = _NSGetExecutablePath(program_fullpath, &len);
if (err == 0)
- g_program_filespec.SetFile(program_fullpath, false);
+ g_program_filespec.SetFile(program_fullpath, false,
+ FileSpec::Style::native);
else if (err == -1) {
char *large_program_fullpath = (char *)::malloc(len + 1);
err = _NSGetExecutablePath(large_program_fullpath, &len);
if (err == 0)
- g_program_filespec.SetFile(large_program_fullpath, false);
+ g_program_filespec.SetFile(large_program_fullpath, false,
+ FileSpec::Style::native);
::free(large_program_fullpath);
}
@@ -126,8 +114,8 @@ FileSpec HostInfoMacOSX::GetProgramFileSpec() {
}
bool HostInfoMacOSX::ComputeSupportExeDirectory(FileSpec &file_spec) {
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
+ FileSpec lldb_file_spec = GetShlibDir();
+ if (!lldb_file_spec)
return false;
std::string raw_path = lldb_file_spec.GetPath();
@@ -179,8 +167,8 @@ bool HostInfoMacOSX::ComputeSupportExeDirectory(FileSpec &file_spec) {
}
bool HostInfoMacOSX::ComputeHeaderDirectory(FileSpec &file_spec) {
- FileSpec lldb_file_spec;
- if (!HostInfo::GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
+ FileSpec lldb_file_spec = GetShlibDir();
+ if (!lldb_file_spec)
return false;
std::string raw_path = lldb_file_spec.GetPath();
@@ -196,58 +184,9 @@ bool HostInfoMacOSX::ComputeHeaderDirectory(FileSpec &file_spec) {
return true;
}
-bool HostInfoMacOSX::ComputePythonDirectory(FileSpec &file_spec) {
-#ifndef LLDB_DISABLE_PYTHON
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
- return false;
-
- std::string raw_path = lldb_file_spec.GetPath();
-
- size_t framework_pos = raw_path.find("LLDB.framework");
- if (framework_pos != std::string::npos) {
- framework_pos += strlen("LLDB.framework");
- raw_path.resize(framework_pos);
- raw_path.append("/Resources/Python");
- } else {
- llvm::SmallString<256> python_version_dir;
- llvm::raw_svector_ostream os(python_version_dir);
- os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION
- << "/site-packages";
-
- // We may get our string truncated. Should we protect this with an assert?
- raw_path.append(python_version_dir.c_str());
- }
- file_spec.GetDirectory().SetString(
- llvm::StringRef(raw_path.c_str(), raw_path.size()));
- return true;
-#else
- return false;
-#endif
-}
-
-bool HostInfoMacOSX::ComputeClangDirectory(FileSpec &file_spec) {
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
- return false;
-
- std::string raw_path = lldb_file_spec.GetPath();
-
- size_t framework_pos = raw_path.find("LLDB.framework");
- if (framework_pos == std::string::npos)
- return HostInfoPosix::ComputeClangDirectory(file_spec);
-
- framework_pos += strlen("LLDB.framework");
- raw_path.resize(framework_pos);
- raw_path.append("/Resources/Clang");
-
- file_spec.SetFile(raw_path.c_str(), true);
- return true;
-}
-
bool HostInfoMacOSX::ComputeSystemPluginsDirectory(FileSpec &file_spec) {
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
+ FileSpec lldb_file_spec = GetShlibDir();
+ if (!lldb_file_spec)
return false;
std::string raw_path = lldb_file_spec.GetPath();
diff --git a/source/Host/macosx/HostThreadMacOSX.mm b/source/Host/macosx/objcxx/HostThreadMacOSX.mm
index c5051cdf30d7..c5051cdf30d7 100644
--- a/source/Host/macosx/HostThreadMacOSX.mm
+++ b/source/Host/macosx/objcxx/HostThreadMacOSX.mm
diff --git a/source/Host/netbsd/Host.cpp b/source/Host/netbsd/Host.cpp
index d927f95f0675..bfd5a74ffcc2 100644
--- a/source/Host/netbsd/Host.cpp
+++ b/source/Host/netbsd/Host.cpp
@@ -25,12 +25,9 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Core/Module.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
@@ -48,14 +45,7 @@ extern char **environ;
using namespace lldb;
using namespace lldb_private;
-size_t Host::GetEnvironment(StringList &env) {
- char **host_env = environ;
- char *env_entry;
- size_t i;
- for (i = 0; (env_entry = host_env[i]) != NULL; ++i)
- env.AppendString(env_entry);
- return i;
-}
+Environment Host::GetEnvironment() { return Environment(environ); }
static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
ProcessInstanceInfo &process_info) {
@@ -80,7 +70,8 @@ static bool GetNetBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
if (!cstr)
return false;
- process_info.GetExecutableFile().SetFile(cstr, false);
+ process_info.GetExecutableFile().SetFile(cstr, false,
+ FileSpec::Style::native);
if (!(match_info_ptr == NULL ||
NameMatches(process_info.GetExecutableFile().GetFilename().GetCString(),
@@ -202,9 +193,8 @@ uint32_t Host::FindProcesses(const ProcessInstanceInfoMatch &match_info,
continue;
// Every thread is a process in NetBSD, but all the threads of a single
- // process have the same pid. Do not store the process info in the
- // result list if a process with given identifier is already registered
- // there.
+ // process have the same pid. Do not store the process info in the result
+ // list if a process with given identifier is already registered there.
if (proc_kinfo[i].p_nlwps > 1) {
bool already_registered = false;
for (size_t pi = 0; pi < process_infos.GetSize(); pi++) {
diff --git a/source/Host/netbsd/HostInfoNetBSD.cpp b/source/Host/netbsd/HostInfoNetBSD.cpp
index 428183bbe2c3..dfbce310509d 100644
--- a/source/Host/netbsd/HostInfoNetBSD.cpp
+++ b/source/Host/netbsd/HostInfoNetBSD.cpp
@@ -21,30 +21,26 @@
using namespace lldb_private;
-bool HostInfoNetBSD::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
+llvm::VersionTuple HostInfoNetBSD::GetOSVersion() {
struct utsname un;
::memset(&un, 0, sizeof(un));
if (::uname(&un) < 0)
- return false;
+ return llvm::VersionTuple();
/* Accept versions like 7.99.21 and 6.1_STABLE */
+ uint32_t major, minor, update;
int status = ::sscanf(un.release, "%" PRIu32 ".%" PRIu32 ".%" PRIu32, &major,
&minor, &update);
switch (status) {
- case 0:
- return false;
case 1:
- minor = 0;
- /* FALLTHROUGH */
+ return llvm::VersionTuple(major);
case 2:
- update = 0;
- /* FALLTHROUGH */
+ return llvm::VersionTuple(major, minor);
case 3:
- default:
- return true;
+ return llvm::VersionTuple(major, minor, update);
}
+ return llvm::VersionTuple();
}
bool HostInfoNetBSD::GetOSBuildString(std::string &s) {
@@ -89,7 +85,7 @@ FileSpec HostInfoNetBSD::GetProgramFileSpec() {
len = sizeof(path);
if (sysctl(name, __arraycount(name), path, &len, NULL, 0) != -1) {
- g_program_filespec.SetFile(path, false);
+ g_program_filespec.SetFile(path, false, FileSpec::Style::native);
}
}
return g_program_filespec;
diff --git a/source/Host/openbsd/Host.cpp b/source/Host/openbsd/Host.cpp
index 0535256b9aa1..49e9c290a027 100644
--- a/source/Host/openbsd/Host.cpp
+++ b/source/Host/openbsd/Host.cpp
@@ -22,12 +22,9 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Core/Module.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Target/Platform.h"
#include "lldb/Target/Process.h"
-#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
@@ -45,16 +42,17 @@ extern char **environ;
using namespace lldb;
using namespace lldb_private;
-size_t Host::GetEnvironment(StringList &env) {
+Environment Host::GetEnvironment() {
+ Environment env;
char *v;
char **var = environ;
for (; var != NULL && *var != NULL; ++var) {
v = strchr(*var, (int)'-');
if (v == NULL)
continue;
- env.AppendString(v);
+ env.insert(v);
}
- return env.GetSize();
+ return env;
}
static bool
@@ -74,7 +72,8 @@ GetOpenBSDProcessArgs(const ProcessInstanceInfoMatch *match_info_ptr,
cstr = data.GetCStr(&offset);
if (cstr) {
- process_info.GetExecutableFile().SetFile(cstr, false);
+ process_info.GetExecutableFile().SetFile(cstr, false,
+ FileSpec::Style::native);
if (!(match_info_ptr == NULL ||
NameMatches(
diff --git a/source/Host/posix/ConnectionFileDescriptorPosix.cpp b/source/Host/posix/ConnectionFileDescriptorPosix.cpp
index 3797650105ce..c21bb786a896 100644
--- a/source/Host/posix/ConnectionFileDescriptorPosix.cpp
+++ b/source/Host/posix/ConnectionFileDescriptorPosix.cpp
@@ -189,15 +189,14 @@ ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path,
}
#ifndef LLDB_DISABLE_POSIX
else if ((addr = GetURLAddress(path, FD_SCHEME))) {
- // Just passing a native file descriptor within this current process
- // that is already opened (possibly from a service or other source).
+ // Just passing a native file descriptor within this current process that
+ // is already opened (possibly from a service or other source).
int fd = -1;
if (!addr->getAsInteger(0, fd)) {
- // We have what looks to be a valid file descriptor, but we
- // should make sure it is. We currently are doing this by trying to
- // get the flags from the file descriptor and making sure it
- // isn't a bad fd.
+ // We have what looks to be a valid file descriptor, but we should make
+ // sure it is. We currently are doing this by trying to get the flags
+ // from the file descriptor and making sure it isn't a bad fd.
errno = 0;
int flags = ::fcntl(fd, F_GETFL, 0);
if (flags == -1 || errno == EBADF) {
@@ -208,20 +207,18 @@ ConnectionStatus ConnectionFileDescriptor::Connect(llvm::StringRef path,
m_write_sp.reset();
return eConnectionStatusError;
} else {
- // Don't take ownership of a file descriptor that gets passed
- // to us since someone else opened the file descriptor and
- // handed it to us.
+ // Don't take ownership of a file descriptor that gets passed to us
+ // since someone else opened the file descriptor and handed it to us.
// TODO: Since are using a URL to open connection we should
- // eventually parse options using the web standard where we
- // have "fd://123?opt1=value;opt2=value" and we can have an
- // option be "owns=1" or "owns=0" or something like this to
- // allow us to specify this. For now, we assume we must
- // assume we don't own it.
+ // eventually parse options using the web standard where we have
+ // "fd://123?opt1=value;opt2=value" and we can have an option be
+ // "owns=1" or "owns=0" or something like this to allow us to specify
+ // this. For now, we assume we must assume we don't own it.
std::unique_ptr<TCPSocket> tcp_socket;
tcp_socket.reset(new TCPSocket(fd, false, false));
- // Try and get a socket option from this file descriptor to
- // see if this is a socket and set m_is_socket accordingly.
+ // Try and get a socket option from this file descriptor to see if
+ // this is a socket and set m_is_socket accordingly.
int resuse;
bool is_socket =
!!tcp_socket->GetOption(SOL_SOCKET, SO_REUSEADDR, resuse);
@@ -320,13 +317,11 @@ ConnectionStatus ConnectionFileDescriptor::Disconnect(Status *error_ptr) {
m_read_sp->GetFdType() == IOObject::eFDTypeSocket)
static_cast<Socket &>(*m_read_sp).PreDisconnect();
- // Try to get the ConnectionFileDescriptor's mutex. If we fail, that is quite
- // likely
- // because somebody is doing a blocking read on our file descriptor. If
- // that's the case,
- // then send the "q" char to the command file channel so the read will wake up
- // and the connection
- // will then know to shut down.
+ // Try to get the ConnectionFileDescriptor's mutex. If we fail, that is
+ // quite likely because somebody is doing a blocking read on our file
+ // descriptor. If that's the case, then send the "q" char to the command
+ // file channel so the read will wake up and the connection will then know to
+ // shut down.
m_shutting_down = true;
@@ -430,11 +425,11 @@ size_t ConnectionFileDescriptor::Read(void *dst, size_t dst_len,
case EINVAL: // The pointer associated with fildes was negative.
case EIO: // An I/O error occurred while reading from the file system.
// The process group is orphaned.
- // The file is a regular file, nbyte is greater than 0,
- // the starting position is before the end-of-file, and
- // the starting position is greater than or equal to the
- // offset maximum established for the open file
- // descriptor associated with fildes.
+ // The file is a regular file, nbyte is greater than 0, the
+ // starting position is before the end-of-file, and the
+ // starting position is greater than or equal to the offset
+ // maximum established for the open file descriptor
+ // associated with fildes.
case EISDIR: // An attempt is made to read a directory.
case ENOBUFS: // An attempt to allocate a memory buffer fails.
case ENOMEM: // Insufficient memory is available.
@@ -550,15 +545,15 @@ ConnectionStatus
ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
Status *error_ptr) {
// Don't need to take the mutex here separately since we are only called from
- // Read. If we
- // ever get used more generally we will need to lock here as well.
+ // Read. If we ever get used more generally we will need to lock here as
+ // well.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_CONNECTION));
LLDB_LOG(log, "this = {0}, timeout = {1}", this, timeout);
- // Make a copy of the file descriptors to make sure we don't
- // have another thread change these values out from under us
- // and cause problems in the loop below where like in FS_SET()
+ // Make a copy of the file descriptors to make sure we don't have another
+ // thread change these values out from under us and cause problems in the
+ // loop below where like in FS_SET()
const IOObject::WaitableHandle handle = m_read_sp->GetWaitableHandle();
const int pipe_fd = m_pipe.GetReadFileDescriptor();
@@ -570,10 +565,9 @@ ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
select_helper.FDSetRead(handle);
#if defined(_MSC_VER)
// select() won't accept pipes on Windows. The entire Windows codepath
- // needs to be
- // converted over to using WaitForMultipleObjects and event HANDLEs, but for
- // now at least
- // this will allow ::select() to not return an error.
+ // needs to be converted over to using WaitForMultipleObjects and event
+ // HANDLEs, but for now at least this will allow ::select() to not return
+ // an error.
const bool have_pipe_fd = false;
#else
const bool have_pipe_fd = pipe_fd >= 0;
@@ -603,11 +597,10 @@ ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
return eConnectionStatusTimedOut;
case EAGAIN: // The kernel was (perhaps temporarily) unable to
- // allocate the requested number of file descriptors,
- // or we have non-blocking IO
+ // allocate the requested number of file descriptors, or
+ // we have non-blocking IO
case EINTR: // A signal was delivered before the time limit
- // expired and before any of the selected events
- // occurred.
+ // expired and before any of the selected events occurred.
break; // Lets keep reading to until we timeout
}
} else {
@@ -615,8 +608,8 @@ ConnectionFileDescriptor::BytesAvailable(const Timeout<std::micro> &timeout,
return eConnectionStatusSuccess;
if (select_helper.FDIsSetRead(pipe_fd)) {
- // There is an interrupt or exit command in the command pipe
- // Read the data from that pipe:
+ // There is an interrupt or exit command in the command pipe Read the
+ // data from that pipe:
char c;
ssize_t bytes_read = llvm::sys::RetryAfterSignal(-1, ::read, pipe_fd, &c, 1);
@@ -753,14 +746,10 @@ ConnectionStatus ConnectionFileDescriptor::ConnectUDP(llvm::StringRef s,
return eConnectionStatusSuccess;
}
-uint16_t ConnectionFileDescriptor::GetListeningPort(uint32_t timeout_sec) {
- uint16_t bound_port = 0;
- if (timeout_sec == UINT32_MAX)
- m_port_predicate.WaitForValueNotEqualTo(0, bound_port);
- else
- m_port_predicate.WaitForValueNotEqualTo(0, bound_port,
- std::chrono::seconds(timeout_sec));
- return bound_port;
+uint16_t
+ConnectionFileDescriptor::GetListeningPort(const Timeout<std::micro> &timeout) {
+ auto Result = m_port_predicate.WaitForValueNotEqualTo(0, timeout);
+ return Result ? *Result : 0;
}
bool ConnectionFileDescriptor::GetChildProcessesInherit() const {
diff --git a/source/Host/posix/FileSystem.cpp b/source/Host/posix/FileSystem.cpp
index 3ece0677f991..60be642df608 100644
--- a/source/Host/posix/FileSystem.cpp
+++ b/source/Host/posix/FileSystem.cpp
@@ -16,11 +16,6 @@
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
-#ifdef __linux__
-#include <linux/magic.h>
-#include <sys/mount.h>
-#include <sys/statfs.h>
-#endif
#if defined(__NetBSD__)
#include <sys/statvfs.h>
#endif
@@ -52,7 +47,7 @@ Status FileSystem::Readlink(const FileSpec &src, FileSpec &dst) {
error.SetErrorToErrno();
else {
buf[count] = '\0'; // Success
- dst.SetFile(buf, false);
+ dst.SetFile(buf, false, FileSpec::Style::native);
}
return error;
}
diff --git a/source/Host/posix/HostInfoPosix.cpp b/source/Host/posix/HostInfoPosix.cpp
index da9e1fb366cc..62c70fa3edc1 100644
--- a/source/Host/posix/HostInfoPosix.cpp
+++ b/source/Host/posix/HostInfoPosix.cpp
@@ -7,15 +7,9 @@
//
//===----------------------------------------------------------------------===//
-#if !defined(LLDB_DISABLE_PYTHON)
-#include "Plugins/ScriptInterpreter/Python/lldb-python.h"
-#endif
-
#include "lldb/Host/posix/HostInfoPosix.h"
#include "lldb/Utility/Log.h"
-#include "clang/Basic/Version.h"
-#include "clang/Config/config.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Path.h"
@@ -103,8 +97,7 @@ const char *HostInfoPosix::LookupGroupName(uint32_t gid,
}
} else {
// The threadsafe version isn't currently working for me on darwin, but the
- // non-threadsafe version
- // is, so I am calling it below.
+ // non-threadsafe version is, so I am calling it below.
group_info_ptr = ::getgrgid(gid);
if (group_info_ptr) {
group_name.assign(group_info_ptr->gr_name);
@@ -132,8 +125,8 @@ bool HostInfoPosix::ComputePathRelativeToLibrary(FileSpec &file_spec,
llvm::StringRef dir) {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
+ FileSpec lldb_file_spec = GetShlibDir();
+ if (!lldb_file_spec)
return false;
std::string raw_path = lldb_file_spec.GetPath();
@@ -141,8 +134,8 @@ bool HostInfoPosix::ComputePathRelativeToLibrary(FileSpec &file_spec,
llvm::StringRef parent_path = llvm::sys::path::parent_path(raw_path);
// Most Posix systems (e.g. Linux/*BSD) will attempt to replace a */lib with
- // */bin as the base directory for helper exe programs. This will fail if the
- // /lib and /bin directories are rooted in entirely different trees.
+ // */bin as the base directory for helper exe programs. This will fail if
+ // the /lib and /bin directories are rooted in entirely different trees.
if (log)
log->Printf("HostInfoPosix::ComputePathRelativeToLibrary() attempting to "
"derive the %s path from this path: %s",
@@ -169,59 +162,12 @@ bool HostInfoPosix::ComputeSupportExeDirectory(FileSpec &file_spec) {
return ComputePathRelativeToLibrary(file_spec, "/bin");
}
-bool HostInfoPosix::ComputeClangDirectory(FileSpec &file_spec) {
- return ComputePathRelativeToLibrary(
- file_spec, (llvm::Twine("/lib") + CLANG_LIBDIR_SUFFIX + "/clang/" +
- CLANG_VERSION_STRING)
- .str());
-}
-
bool HostInfoPosix::ComputeHeaderDirectory(FileSpec &file_spec) {
FileSpec temp_file("/opt/local/include/lldb", false);
file_spec.GetDirectory().SetCString(temp_file.GetPath().c_str());
return true;
}
-bool HostInfoPosix::ComputePythonDirectory(FileSpec &file_spec) {
-#ifndef LLDB_DISABLE_PYTHON
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
- return false;
-
- char raw_path[PATH_MAX];
- lldb_file_spec.GetPath(raw_path, sizeof(raw_path));
-
-#if defined(LLDB_PYTHON_RELATIVE_LIBDIR)
- // Build the path by backing out of the lib dir, then building
- // with whatever the real python interpreter uses. (e.g. lib
- // for most, lib64 on RHEL x86_64).
- char python_path[PATH_MAX];
- ::snprintf(python_path, sizeof(python_path), "%s/../%s", raw_path,
- LLDB_PYTHON_RELATIVE_LIBDIR);
-
- char final_path[PATH_MAX];
- realpath(python_path, final_path);
- file_spec.GetDirectory().SetCString(final_path);
-
- return true;
-#else
- llvm::SmallString<256> python_version_dir;
- llvm::raw_svector_ostream os(python_version_dir);
- os << "/python" << PY_MAJOR_VERSION << '.' << PY_MINOR_VERSION
- << "/site-packages";
-
- // We may get our string truncated. Should we protect this with an assert?
- ::strncat(raw_path, python_version_dir.c_str(),
- sizeof(raw_path) - strlen(raw_path) - 1);
-
- file_spec.GetDirectory().SetCString(raw_path);
- return true;
-#endif
-#else
- return false;
-#endif
-}
-
bool HostInfoPosix::GetEnvironmentVar(const std::string &var_name,
std::string &var) {
if (const char *pvar = ::getenv(var_name.c_str())) {
diff --git a/source/Host/posix/HostThreadPosix.cpp b/source/Host/posix/HostThreadPosix.cpp
index 71abb76dc600..13de42f763ec 100644
--- a/source/Host/posix/HostThreadPosix.cpp
+++ b/source/Host/posix/HostThreadPosix.cpp
@@ -41,14 +41,11 @@ Status HostThreadPosix::Join(lldb::thread_result_t *result) {
Status HostThreadPosix::Cancel() {
Status error;
if (IsJoinable()) {
-#ifndef __ANDROID__
#ifndef __FreeBSD__
llvm_unreachable("someone is calling HostThread::Cancel()");
-#endif
+#else
int err = ::pthread_cancel(m_thread);
error.SetError(err, eErrorTypePOSIX);
-#else
- error.SetErrorString("HostThreadPosix::Cancel() not supported on Android");
#endif
}
return error;
diff --git a/source/Host/posix/PipePosix.cpp b/source/Host/posix/PipePosix.cpp
index da99fd702424..b321cad64275 100644
--- a/source/Host/posix/PipePosix.cpp
+++ b/source/Host/posix/PipePosix.cpp
@@ -127,18 +127,14 @@ Status PipePosix::CreateWithUniqueName(llvm::StringRef prefix,
llvm::SmallVectorImpl<char> &name) {
llvm::SmallString<PATH_MAX> named_pipe_path;
llvm::SmallString<PATH_MAX> pipe_spec((prefix + ".%%%%%%").str());
- FileSpec tmpdir_file_spec;
- tmpdir_file_spec.Clear();
- if (HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, tmpdir_file_spec)) {
- tmpdir_file_spec.AppendPathComponent(pipe_spec.c_str());
- } else {
+ FileSpec tmpdir_file_spec = HostInfo::GetProcessTempDir();
+ if (!tmpdir_file_spec)
tmpdir_file_spec.AppendPathComponent("/tmp");
- tmpdir_file_spec.AppendPathComponent(pipe_spec.c_str());
- }
+ tmpdir_file_spec.AppendPathComponent(pipe_spec);
// It's possible that another process creates the target path after we've
- // verified it's available but before we create it, in which case we
- // should try again.
+ // verified it's available but before we create it, in which case we should
+ // try again.
Status error;
do {
llvm::sys::fs::createUniqueFile(tmpdir_file_spec.GetPath(),
diff --git a/source/Host/posix/ProcessLauncherPosixFork.cpp b/source/Host/posix/ProcessLauncherPosixFork.cpp
index ac1d9011c2b7..46ce3e3d224f 100644
--- a/source/Host/posix/ProcessLauncherPosixFork.cpp
+++ b/source/Host/posix/ProcessLauncherPosixFork.cpp
@@ -38,17 +38,12 @@
using namespace lldb;
using namespace lldb_private;
-static void FixupEnvironment(Args &env) {
+static void FixupEnvironment(Environment &env) {
#ifdef __ANDROID__
// If there is no PATH variable specified inside the environment then set the
// path to /system/bin. It is required because the default path used by
// execve() is wrong on android.
- static const char *path = "PATH=";
- for (auto &entry : env.entries()) {
- if (entry.ref.startswith(path))
- return;
- }
- env.AppendArgument(llvm::StringRef("PATH=/system/bin"));
+ env.try_emplace("PATH", "/system/bin");
#endif
}
@@ -95,10 +90,6 @@ static void DupDescriptor(int error_fd, const FileSpec &file_spec, int fd,
static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd,
const ProcessLaunchInfo &info) {
- // Do not inherit setgid powers.
- if (setgid(getgid()) != 0)
- ExitWithError(error_fd, "setgid");
-
if (info.GetFlags().Test(eLaunchFlagLaunchInSeparateProcessGroup)) {
if (setpgid(0, 0) != 0)
ExitWithError(error_fd, "setpgid");
@@ -132,23 +123,26 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd,
ExitWithError(error_fd, "chdir");
DisableASLRIfRequested(error_fd, info);
- Args env = info.GetEnvironmentEntries();
+ Environment env = info.GetEnvironment();
FixupEnvironment(env);
- const char **envp = env.GetConstArgumentVector();
+ Environment::Envp envp = env.getEnvp();
- // Clear the signal mask to prevent the child from being affected by
- // any masking done by the parent.
+ // Clear the signal mask to prevent the child from being affected by any
+ // masking done by the parent.
sigset_t set;
if (sigemptyset(&set) != 0 ||
pthread_sigmask(SIG_SETMASK, &set, nullptr) != 0)
ExitWithError(error_fd, "pthread_sigmask");
if (info.GetFlags().Test(eLaunchFlagDebug)) {
+ // Do not inherit setgid powers.
+ if (setgid(getgid()) != 0)
+ ExitWithError(error_fd, "setgid");
+
// HACK:
// Close everything besides stdin, stdout, and stderr that has no file
// action to avoid leaking. Only do this when debugging, as elsewhere we
- // actually rely on
- // passing open descriptors to child processes.
+ // actually rely on passing open descriptors to child processes.
for (int fd = 3; fd < sysconf(_SC_OPEN_MAX); ++fd)
if (!info.GetFileActionForFD(fd) && fd != error_fd)
close(fd);
@@ -159,26 +153,20 @@ static void LLVM_ATTRIBUTE_NORETURN ChildFunc(int error_fd,
}
// Execute. We should never return...
- execve(argv[0], const_cast<char *const *>(argv),
- const_cast<char *const *>(envp));
+ execve(argv[0], const_cast<char *const *>(argv), envp);
#if defined(__linux__)
if (errno == ETXTBSY) {
- // On android M and earlier we can get this error because the adb deamon can
- // hold a write
- // handle on the executable even after it has finished uploading it. This
- // state lasts
- // only a short time and happens only when there are many concurrent adb
- // commands being
- // issued, such as when running the test suite. (The file remains open when
- // someone does
- // an "adb shell" command in the fork() child before it has had a chance to
- // exec.) Since
- // this state should clear up quickly, wait a while and then give it one
- // more go.
+ // On android M and earlier we can get this error because the adb deamon
+ // can hold a write handle on the executable even after it has finished
+ // uploading it. This state lasts only a short time and happens only when
+ // there are many concurrent adb commands being issued, such as when
+ // running the test suite. (The file remains open when someone does an "adb
+ // shell" command in the fork() child before it has had a chance to exec.)
+ // Since this state should clear up quickly, wait a while and then give it
+ // one more go.
usleep(50000);
- execve(argv[0], const_cast<char *const *>(argv),
- const_cast<char *const *>(envp));
+ execve(argv[0], const_cast<char *const *>(argv), envp);
}
#endif
diff --git a/source/Host/windows/ConnectionGenericFileWindows.cpp b/source/Host/windows/ConnectionGenericFileWindows.cpp
index 41bdb5f41fb6..e59e190dcb2d 100644
--- a/source/Host/windows/ConnectionGenericFileWindows.cpp
+++ b/source/Host/windows/ConnectionGenericFileWindows.cpp
@@ -21,12 +21,10 @@ using namespace lldb_private;
namespace {
// This is a simple helper class to package up the information needed to return
-// from a Read/Write
-// operation function. Since there is a lot of code to be run before exit
-// regardless of whether the
-// operation succeeded or failed, combined with many possible return paths, this
-// is the cleanest
-// way to represent it.
+// from a Read/Write operation function. Since there is a lot of code to be
+// run before exit regardless of whether the operation succeeded or failed,
+// combined with many possible return paths, this is the cleanest way to
+// represent it.
class ReturnInfo {
public:
void Set(size_t bytes, ConnectionStatus status, DWORD error_code) {
@@ -78,11 +76,9 @@ void ConnectionGenericFile::InitializeEventHandles() {
m_event_handles[kInterruptEvent] = CreateEvent(NULL, FALSE, FALSE, NULL);
// Note, we should use a manual reset event for the hEvent argument of the
- // OVERLAPPED. This
- // is because both WaitForMultipleObjects and GetOverlappedResult (if you set
- // the bWait
- // argument to TRUE) will wait for the event to be signalled. If we use an
- // auto-reset event,
+ // OVERLAPPED. This is because both WaitForMultipleObjects and
+ // GetOverlappedResult (if you set the bWait argument to TRUE) will wait for
+ // the event to be signalled. If we use an auto-reset event,
// WaitForMultipleObjects will reset the event, return successfully, and then
// GetOverlappedResult will block since the event is no longer signalled.
m_event_handles[kBytesAvailableEvent] =
@@ -147,8 +143,7 @@ lldb::ConnectionStatus ConnectionGenericFile::Disconnect(Status *error_ptr) {
return eConnectionStatusSuccess;
// Reset the handle so that after we unblock any pending reads, subsequent
- // calls to Read() will
- // see a disconnected state.
+ // calls to Read() will see a disconnected state.
HANDLE old_file = m_file;
m_file = INVALID_HANDLE_VALUE;
@@ -157,8 +152,7 @@ lldb::ConnectionStatus ConnectionGenericFile::Disconnect(Status *error_ptr) {
::CancelIoEx(old_file, &m_overlapped);
// Close the file handle if we owned it, but don't close the event handles.
- // We could always
- // reconnect with the same Connection instance.
+ // We could always reconnect with the same Connection instance.
if (m_owns_file)
::CloseHandle(old_file);
@@ -190,8 +184,7 @@ size_t ConnectionGenericFile::Read(void *dst, size_t dst_len,
if (result || ::GetLastError() == ERROR_IO_PENDING) {
if (!result) {
// The expected return path. The operation is pending. Wait for the
- // operation to complete
- // or be interrupted.
+ // operation to complete or be interrupted.
DWORD milliseconds =
timeout
? std::chrono::duration_cast<std::chrono::milliseconds>(*timeout)
@@ -219,11 +212,9 @@ size_t ConnectionGenericFile::Read(void *dst, size_t dst_len,
// The data is ready. Figure out how much was read and return;
if (!::GetOverlappedResult(m_file, &m_overlapped, &bytes_read, FALSE)) {
DWORD result_error = ::GetLastError();
- // ERROR_OPERATION_ABORTED occurs when someone calls Disconnect() during a
- // blocking read.
- // This triggers a call to CancelIoEx, which causes the operation to
- // complete and the
- // result to be ERROR_OPERATION_ABORTED.
+ // ERROR_OPERATION_ABORTED occurs when someone calls Disconnect() during
+ // a blocking read. This triggers a call to CancelIoEx, which causes the
+ // operation to complete and the result to be ERROR_OPERATION_ABORTED.
if (result_error == ERROR_HANDLE_EOF ||
result_error == ERROR_OPERATION_ABORTED ||
result_error == ERROR_BROKEN_PIPE)
@@ -250,9 +241,9 @@ finish:
if (error_ptr)
*error_ptr = return_info.GetError();
- // kBytesAvailableEvent is a manual reset event. Make sure it gets reset here
- // so that any
- // subsequent operations don't immediately see bytes available.
+ // kBytesAvailableEvent is a manual reset event. Make sure it gets reset
+ // here so that any subsequent operations don't immediately see bytes
+ // available.
ResetEvent(m_event_handles[kBytesAvailableEvent]);
IncrementFilePointer(return_info.GetBytes());
@@ -284,7 +275,8 @@ size_t ConnectionGenericFile::Write(const void *src, size_t src_len,
m_overlapped.hEvent = NULL;
- // Writes are not interruptible like reads are, so just block until it's done.
+ // Writes are not interruptible like reads are, so just block until it's
+ // done.
result = ::WriteFile(m_file, src, src_len, NULL, &m_overlapped);
if (!result && ::GetLastError() != ERROR_IO_PENDING) {
return_info.Set(0, eConnectionStatusError, ::GetLastError());
diff --git a/source/Host/windows/EditLineWin.cpp b/source/Host/windows/EditLineWin.cpp
index 133cd6225467..3bccc4e1a2c9 100644
--- a/source/Host/windows/EditLineWin.cpp
+++ b/source/Host/windows/EditLineWin.cpp
@@ -316,8 +316,8 @@ int el_get(EditLine *el, int code, ...) {
}
int el_source(EditLine *el, const char *file) {
- // init edit line by reading the contents of 'file'
- // nothing to do here on windows...
+ // init edit line by reading the contents of 'file' nothing to do here on
+ // windows...
return 0;
}
@@ -342,8 +342,8 @@ void history_end(History *) {
}
int history(History *, HistEvent *, int op, ...) {
- // perform operation 'op' on the history list with
- // optional arguments as needed by the operation.
+ // perform operation 'op' on the history list with optional arguments as
+ // needed by the operation.
return 0;
}
diff --git a/source/Host/windows/FileSystem.cpp b/source/Host/windows/FileSystem.cpp
index 02b7e550f86c..9309b89f2baf 100644
--- a/source/Host/windows/FileSystem.cpp
+++ b/source/Host/windows/FileSystem.cpp
@@ -75,7 +75,7 @@ Status FileSystem::Readlink(const FileSpec &src, FileSpec &dst) {
else if (!llvm::convertWideToUTF8(buf.data(), path))
error.SetErrorString(PATH_CONVERSION_ERROR);
else
- dst.SetFile(path, false);
+ dst.SetFile(path, false, FileSpec::Style::native);
::CloseHandle(h);
return error;
diff --git a/source/Host/windows/Host.cpp b/source/Host/windows/Host.cpp
index 4458ce25e607..cc6c454d36b1 100644
--- a/source/Host/windows/Host.cpp
+++ b/source/Host/windows/Host.cpp
@@ -35,8 +35,7 @@ using namespace lldb_private;
namespace {
bool GetTripleForProcess(const FileSpec &executable, llvm::Triple &triple) {
// Open the PE File as a binary file, and parse just enough information to
- // determine the
- // machine type.
+ // determine the machine type.
File imageBinary(executable.GetPath().c_str(), File::eOpenOptionRead,
lldb::eFilePermissionsUserRead);
imageBinary.SeekFromStart(0x3c);
@@ -63,8 +62,8 @@ bool GetTripleForProcess(const FileSpec &executable, llvm::Triple &triple) {
}
bool GetExecutableForProcess(const AutoHandle &handle, std::string &path) {
- // Get the process image path. MAX_PATH isn't long enough, paths can actually
- // be up to 32KB.
+ // Get the process image path. MAX_PATH isn't long enough, paths can
+ // actually be up to 32KB.
std::vector<wchar_t> buffer(PATH_MAX);
DWORD dwSize = buffer.size();
if (!::QueryFullProcessImageNameW(handle.get(), 0, &buffer[0], &dwSize))
@@ -75,10 +74,9 @@ bool GetExecutableForProcess(const AutoHandle &handle, std::string &path) {
void GetProcessExecutableAndTriple(const AutoHandle &handle,
ProcessInstanceInfo &process) {
// We may not have permissions to read the path from the process. So start
- // off by
- // setting the executable file to whatever Toolhelp32 gives us, and then try
- // to
- // enhance this with more detailed information, but fail gracefully.
+ // off by setting the executable file to whatever Toolhelp32 gives us, and
+ // then try to enhance this with more detailed information, but fail
+ // gracefully.
std::string executable;
llvm::Triple triple;
triple.setVendor(llvm::Triple::PC);
@@ -124,7 +122,7 @@ FileSpec Host::GetModuleFileSpecForHostAddress(const void *host_addr) {
std::string path;
if (!llvm::convertWideToUTF8(buffer.data(), path))
return module_filespec;
- module_filespec.SetFile(path, false);
+ module_filespec.SetFile(path, false, FileSpec::Style::native);
return module_filespec;
}
@@ -184,9 +182,8 @@ HostThread Host::StartMonitoringChildProcess(
Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
Status error;
if (launch_info.GetFlags().Test(eLaunchFlagShellExpandArguments)) {
- FileSpec expand_tool_spec;
- if (!HostInfo::GetLLDBPath(lldb::ePathTypeSupportExecutableDir,
- expand_tool_spec)) {
+ FileSpec expand_tool_spec = HostInfo::GetSupportExeDir();
+ if (!expand_tool_spec) {
error.SetErrorString("could not find support executable directory for "
"the lldb-argdumper tool");
return error;
@@ -209,7 +206,7 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
std::string output;
std::string command = expand_command.GetString();
RunShellCommand(command.c_str(), launch_info.GetWorkingDirectory(), &status,
- nullptr, &output, 10);
+ nullptr, &output, std::chrono::seconds(10));
if (status != 0) {
error.SetErrorStringWithFormat("lldb-argdumper exited with error %d",
@@ -258,13 +255,12 @@ Status Host::ShellExpandArguments(ProcessLaunchInfo &launch_info) {
return error;
}
-size_t Host::GetEnvironment(StringList &env) {
+Environment Host::GetEnvironment() {
+ Environment env;
// The environment block on Windows is a contiguous buffer of NULL terminated
- // strings,
- // where the end of the environment block is indicated by two consecutive
- // NULLs.
+ // strings, where the end of the environment block is indicated by two
+ // consecutive NULLs.
LPWCH environment_block = ::GetEnvironmentStringsW();
- env.Clear();
while (*environment_block != L'\0') {
std::string current_var;
auto current_var_size = wcslen(environment_block) + 1;
@@ -273,9 +269,9 @@ size_t Host::GetEnvironment(StringList &env) {
continue;
}
if (current_var[0] != '=')
- env.AppendString(current_var);
+ env.insert(current_var);
environment_block += current_var_size;
}
- return env.GetSize();
+ return env;
}
diff --git a/source/Host/windows/HostInfoWindows.cpp b/source/Host/windows/HostInfoWindows.cpp
index 53a24ad1893e..bd3f74f2e2f3 100644
--- a/source/Host/windows/HostInfoWindows.cpp
+++ b/source/Host/windows/HostInfoWindows.cpp
@@ -42,39 +42,33 @@ size_t HostInfoWindows::GetPageSize() {
return systemInfo.dwPageSize;
}
-bool HostInfoWindows::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
+llvm::VersionTuple HostInfoWindows::GetOSVersion() {
OSVERSIONINFOEX info;
ZeroMemory(&info, sizeof(OSVERSIONINFOEX));
info.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
#pragma warning(push)
#pragma warning(disable : 4996)
- // Starting with Microsoft SDK for Windows 8.1, this function is deprecated in
- // favor of the
- // new Windows Version Helper APIs. Since we don't specify a minimum SDK
- // version, it's easier
- // to simply disable the warning rather than try to support both APIs.
- if (GetVersionEx((LPOSVERSIONINFO)&info) == 0) {
- return false;
- }
+ // Starting with Microsoft SDK for Windows 8.1, this function is deprecated
+ // in favor of the new Windows Version Helper APIs. Since we don't specify a
+ // minimum SDK version, it's easier to simply disable the warning rather than
+ // try to support both APIs.
+ if (GetVersionEx((LPOSVERSIONINFO)&info) == 0)
+ return llvm::VersionTuple();
#pragma warning(pop)
- major = info.dwMajorVersion;
- minor = info.dwMinorVersion;
- update = info.wServicePackMajor;
-
- return true;
+ return llvm::VersionTuple(info.dwMajorVersion, info.dwMinorVersion,
+ info.wServicePackMajor);
}
bool HostInfoWindows::GetOSBuildString(std::string &s) {
s.clear();
- uint32_t major, minor, update;
- if (!GetOSVersion(major, minor, update))
+ llvm::VersionTuple version = GetOSVersion();
+ if (version.empty())
return false;
llvm::raw_string_ostream stream(s);
- stream << "Windows NT " << major << "." << minor << "." << update;
+ stream << "Windows NT " << version.getAsString();
return true;
}
@@ -98,27 +92,20 @@ FileSpec HostInfoWindows::GetProgramFileSpec() {
::GetModuleFileNameW(NULL, buffer.data(), buffer.size());
std::string path;
llvm::convertWideToUTF8(buffer.data(), path);
- m_program_filespec.SetFile(path, false);
+ m_program_filespec.SetFile(path, false, FileSpec::Style::native);
});
return m_program_filespec;
}
FileSpec HostInfoWindows::GetDefaultShell() {
+ // Try to retrieve ComSpec from the environment. On the rare occasion
+ // that it fails, try a well-known path for ComSpec instead.
+
std::string shell;
- GetEnvironmentVar("ComSpec", shell);
- return FileSpec(shell, false);
-}
+ if (GetEnvironmentVar("ComSpec", shell))
+ return FileSpec(shell, false);
-bool HostInfoWindows::ComputePythonDirectory(FileSpec &file_spec) {
- FileSpec lldb_file_spec;
- if (!GetLLDBPath(lldb::ePathTypeLLDBShlibDir, lldb_file_spec))
- return false;
- llvm::SmallString<64> path(lldb_file_spec.GetDirectory().AsCString());
- llvm::sys::path::remove_filename(path);
- llvm::sys::path::append(path, "lib", "site-packages");
- std::replace(path.begin(), path.end(), '\\', '/');
- file_spec.GetDirectory().SetString(path.c_str());
- return true;
+ return FileSpec("C:\\Windows\\system32\\cmd.exe", false);
}
bool HostInfoWindows::GetEnvironmentVar(const std::string &var_name,
diff --git a/source/Host/windows/HostProcessWindows.cpp b/source/Host/windows/HostProcessWindows.cpp
index 49d42ce05422..ce75c14cdcf4 100644
--- a/source/Host/windows/HostProcessWindows.cpp
+++ b/source/Host/windows/HostProcessWindows.cpp
@@ -57,7 +57,7 @@ Status HostProcessWindows::GetMainModule(FileSpec &file_spec) const {
if (::GetProcessImageFileNameW(m_process, wpath.data(), wpath.size())) {
std::string path;
if (llvm::convertWideToUTF8(wpath.data(), path))
- file_spec.SetFile(path, false);
+ file_spec.SetFile(path, false, FileSpec::Style::native);
else
error.SetErrorString("Error converting path to UTF-8");
} else
@@ -88,8 +88,8 @@ HostThread HostProcessWindows::StartMonitoring(
info->callback = callback;
// Since the life of this HostProcessWindows instance and the life of the
- // process may be different, duplicate the handle so that
- // the monitor thread can have ownership over its own copy of the handle.
+ // process may be different, duplicate the handle so that the monitor thread
+ // can have ownership over its own copy of the handle.
HostThread result;
if (::DuplicateHandle(GetCurrentProcess(), m_process, GetCurrentProcess(),
&info->process_handle, 0, FALSE, DUPLICATE_SAME_ACCESS))
diff --git a/source/Host/windows/PipeWindows.cpp b/source/Host/windows/PipeWindows.cpp
index e8f4753d11e2..1951c9ca193a 100644
--- a/source/Host/windows/PipeWindows.cpp
+++ b/source/Host/windows/PipeWindows.cpp
@@ -40,11 +40,9 @@ PipeWindows::PipeWindows() {
PipeWindows::~PipeWindows() { Close(); }
Status PipeWindows::CreateNew(bool child_process_inherit) {
- // Even for anonymous pipes, we open a named pipe. This is because you cannot
- // get
- // overlapped i/o on Windows without using a named pipe. So we synthesize a
- // unique
- // name.
+ // Even for anonymous pipes, we open a named pipe. This is because you
+ // cannot get overlapped i/o on Windows without using a named pipe. So we
+ // synthesize a unique name.
uint32_t serial = g_pipe_serial.fetch_add(1);
std::string pipe_name;
llvm::raw_string_ostream pipe_name_stream(pipe_name);
@@ -65,8 +63,8 @@ Status PipeWindows::CreateNew(llvm::StringRef name,
std::string pipe_path = "\\\\.\\Pipe\\";
pipe_path.append(name);
- // Always open for overlapped i/o. We implement blocking manually in Read and
- // Write.
+ // Always open for overlapped i/o. We implement blocking manually in Read
+ // and Write.
DWORD read_mode = FILE_FLAG_OVERLAPPED;
m_read = ::CreateNamedPipeA(
pipe_path.c_str(), PIPE_ACCESS_INBOUND | read_mode,
@@ -250,12 +248,10 @@ Status PipeWindows::ReadWithTimeout(void *buf, size_t size,
DWORD wait_result = ::WaitForSingleObject(m_read_overlapped.hEvent, timeout);
if (wait_result != WAIT_OBJECT_0) {
// The operation probably failed. However, if it timed out, we need to
- // cancel the I/O.
- // Between the time we returned from WaitForSingleObject and the time we
- // call CancelIoEx,
- // the operation may complete. If that hapens, CancelIoEx will fail and
- // return ERROR_NOT_FOUND.
- // If that happens, the original operation should be considered to have been
+ // cancel the I/O. Between the time we returned from WaitForSingleObject
+ // and the time we call CancelIoEx, the operation may complete. If that
+ // hapens, CancelIoEx will fail and return ERROR_NOT_FOUND. If that
+ // happens, the original operation should be considered to have been
// successful.
bool failed = true;
DWORD failure_error = ::GetLastError();
@@ -268,9 +264,8 @@ Status PipeWindows::ReadWithTimeout(void *buf, size_t size,
return Status(failure_error, eErrorTypeWin32);
}
- // Now we call GetOverlappedResult setting bWait to false, since we've already
- // waited
- // as long as we're willing to.
+ // Now we call GetOverlappedResult setting bWait to false, since we've
+ // already waited as long as we're willing to.
if (!GetOverlappedResult(m_read, &m_read_overlapped, &sys_bytes_read, FALSE))
return Status(::GetLastError(), eErrorTypeWin32);
diff --git a/source/Host/windows/ProcessLauncherWindows.cpp b/source/Host/windows/ProcessLauncherWindows.cpp
index 56089742f093..553dd9d286da 100644
--- a/source/Host/windows/ProcessLauncherWindows.cpp
+++ b/source/Host/windows/ProcessLauncherWindows.cpp
@@ -21,14 +21,15 @@ using namespace lldb;
using namespace lldb_private;
namespace {
-void CreateEnvironmentBuffer(const Args &env, std::vector<char> &buffer) {
- if (env.GetArgumentCount() == 0)
+void CreateEnvironmentBuffer(const Environment &env,
+ std::vector<char> &buffer) {
+ if (env.size() == 0)
return;
// Environment buffer is a null terminated list of null terminated strings
- for (auto &entry : env.entries()) {
+ for (const auto &KV : env) {
std::wstring warg;
- if (llvm::ConvertUTF8toWide(entry.ref, warg)) {
+ if (llvm::ConvertUTF8toWide(Environment::compose(KV), warg)) {
buffer.insert(buffer.end(), (char *)warg.c_str(),
(char *)(warg.c_str() + warg.size() + 1));
}
@@ -75,9 +76,8 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
if (launch_info.GetFlags().Test(eLaunchFlagDebug))
flags |= DEBUG_ONLY_THIS_PROCESS;
- auto &env = const_cast<Args &>(launch_info.GetEnvironmentEntries());
LPVOID env_block = nullptr;
- ::CreateEnvironmentBuffer(env, environment);
+ ::CreateEnvironmentBuffer(launch_info.GetEnvironment(), environment);
if (!environment.empty())
env_block = environment.data();
@@ -96,6 +96,12 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
wexecutable.c_str(), &wcommandLine[0], NULL, NULL, TRUE, flags, env_block,
wworkingDirectory.size() == 0 ? NULL : wworkingDirectory.c_str(),
&startupinfo, &pi);
+
+ if (!result) {
+ // Call GetLastError before we make any other system calls.
+ error.SetError(::GetLastError(), eErrorTypeWin32);
+ }
+
if (result) {
// Do not call CloseHandle on pi.hProcess, since we want to pass that back
// through the HostProcess.
@@ -110,7 +116,8 @@ ProcessLauncherWindows::LaunchProcess(const ProcessLaunchInfo &launch_info,
::CloseHandle(stderr_handle);
if (!result)
- error.SetError(::GetLastError(), eErrorTypeWin32);
+ return HostProcess();
+
return HostProcess(pi.hProcess);
}
diff --git a/source/Initialization/CMakeLists.txt b/source/Initialization/CMakeLists.txt
index 7a100588e009..f8ee7c64cbb9 100644
--- a/source/Initialization/CMakeLists.txt
+++ b/source/Initialization/CMakeLists.txt
@@ -1,7 +1,3 @@
-if ( CMAKE_SYSTEM_NAME MATCHES "Darwin" )
- list(APPEND EXTRA_PLUGINS lldbPluginObjectFileMachO)
-endif()
-
if ( CMAKE_SYSTEM_NAME MATCHES "Linux|Android|FreeBSD|NetBSD" )
list(APPEND EXTRA_PLUGINS lldbPluginProcessPOSIX)
endif()
@@ -23,8 +19,6 @@ add_lldb_library(lldbInitialization
lldbPluginInstructionMIPS64
lldbPluginObjectContainerBSDArchive
lldbPluginObjectContainerMachOArchive
- lldbPluginObjectFileELF
- lldbPluginObjectFilePECOFF
lldbPluginProcessGDBRemote
${EXTRA_PLUGINS}
${LLDB_SYSTEM_LIBS}
diff --git a/source/Initialization/SystemInitializerCommon.cpp b/source/Initialization/SystemInitializerCommon.cpp
index a8fc46c119d8..006ab23595c7 100644
--- a/source/Initialization/SystemInitializerCommon.cpp
+++ b/source/Initialization/SystemInitializerCommon.cpp
@@ -14,18 +14,12 @@
#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
#include "Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h"
-#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
-#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Timer.h"
-#if defined(__APPLE__)
-#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
-#endif
-
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
#include "Plugins/Process/POSIX/ProcessPOSIXLog.h"
#endif
@@ -35,7 +29,6 @@
#include "lldb/Host/windows/windows.h"
#endif
-#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/TargetSelect.h"
#include <string>
@@ -69,9 +62,6 @@ void SystemInitializerCommon::Initialize() {
}
#endif
-#if not defined(__APPLE__)
- llvm::EnablePrettyStackTrace();
-#endif
Log::Initialize();
HostInfo::Initialize();
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
@@ -81,8 +71,6 @@ void SystemInitializerCommon::Initialize() {
// Initialize plug-ins
ObjectContainerBSDArchive::Initialize();
- ObjectFileELF::Initialize();
- ObjectFilePECOFF::Initialize();
EmulateInstructionARM::Initialize();
EmulateInstructionMIPS::Initialize();
@@ -93,9 +81,6 @@ void SystemInitializerCommon::Initialize() {
//----------------------------------------------------------------------
ObjectContainerUniversalMachO::Initialize();
-#if defined(__APPLE__)
- ObjectFileMachO::Initialize();
-#endif
#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
ProcessPOSIXLog::Initialize();
#endif
@@ -108,17 +93,12 @@ void SystemInitializerCommon::Terminate() {
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
ObjectContainerBSDArchive::Terminate();
- ObjectFileELF::Terminate();
- ObjectFilePECOFF::Terminate();
EmulateInstructionARM::Terminate();
EmulateInstructionMIPS::Terminate();
EmulateInstructionMIPS64::Terminate();
ObjectContainerUniversalMachO::Terminate();
-#if defined(__APPLE__)
- ObjectFileMachO::Terminate();
-#endif
#if defined(_MSC_VER)
ProcessWindowsLog::Terminate();
diff --git a/source/Interpreter/Args.cpp b/source/Interpreter/Args.cpp
deleted file mode 100644
index 07e5191f898a..000000000000
--- a/source/Interpreter/Args.cpp
+++ /dev/null
@@ -1,1500 +0,0 @@
-//===-- Args.cpp ------------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-// C Includes
-#include <cstdlib>
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Interpreter/CommandInterpreter.h"
-#include "lldb/Interpreter/CommandReturnObject.h"
-#include "lldb/Interpreter/Options.h"
-#include "lldb/Target/Target.h"
-#include "lldb/Utility/Stream.h"
-#include "lldb/Utility/StreamString.h"
-
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/StringExtras.h"
-#include "llvm/ADT/StringSwitch.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-
-// A helper function for argument parsing.
-// Parses the initial part of the first argument using normal double quote
-// rules:
-// backslash escapes the double quote and itself. The parsed string is appended
-// to the second
-// argument. The function returns the unparsed portion of the string, starting
-// at the closing
-// quote.
-static llvm::StringRef ParseDoubleQuotes(llvm::StringRef quoted,
- std::string &result) {
- // Inside double quotes, '\' and '"' are special.
- static const char *k_escapable_characters = "\"\\";
- while (true) {
- // Skip over over regular characters and append them.
- size_t regular = quoted.find_first_of(k_escapable_characters);
- result += quoted.substr(0, regular);
- quoted = quoted.substr(regular);
-
- // If we have reached the end of string or the closing quote, we're done.
- if (quoted.empty() || quoted.front() == '"')
- break;
-
- // We have found a backslash.
- quoted = quoted.drop_front();
-
- if (quoted.empty()) {
- // A lone backslash at the end of string, let's just append it.
- result += '\\';
- break;
- }
-
- // If the character after the backslash is not a whitelisted escapable
- // character, we
- // leave the character sequence untouched.
- if (strchr(k_escapable_characters, quoted.front()) == nullptr)
- result += '\\';
-
- result += quoted.front();
- quoted = quoted.drop_front();
- }
-
- return quoted;
-}
-
-static size_t ArgvToArgc(const char **argv) {
- if (!argv)
- return 0;
- size_t count = 0;
- while (*argv++)
- ++count;
- return count;
-}
-
-// A helper function for SetCommandString. Parses a single argument from the
-// command string, processing quotes and backslashes in a shell-like manner.
-// The function returns a tuple consisting of the parsed argument, the quote
-// char used, and the unparsed portion of the string starting at the first
-// unqouted, unescaped whitespace character.
-static std::tuple<std::string, char, llvm::StringRef>
-ParseSingleArgument(llvm::StringRef command) {
- // Argument can be split into multiple discontiguous pieces, for example:
- // "Hello ""World"
- // this would result in a single argument "Hello World" (without the quotes)
- // since the quotes would be removed and there is not space between the
- // strings.
- std::string arg;
-
- // Since we can have multiple quotes that form a single command
- // in a command like: "Hello "world'!' (which will make a single
- // argument "Hello world!") we remember the first quote character
- // we encounter and use that for the quote character.
- char first_quote_char = '\0';
-
- bool arg_complete = false;
- do {
- // Skip over over regular characters and append them.
- size_t regular = command.find_first_of(" \t\"'`\\");
- arg += command.substr(0, regular);
- command = command.substr(regular);
-
- if (command.empty())
- break;
-
- char special = command.front();
- command = command.drop_front();
- switch (special) {
- case '\\':
- if (command.empty()) {
- arg += '\\';
- break;
- }
-
- // If the character after the backslash is not a whitelisted escapable
- // character, we
- // leave the character sequence untouched.
- if (strchr(" \t\\'\"`", command.front()) == nullptr)
- arg += '\\';
-
- arg += command.front();
- command = command.drop_front();
-
- break;
-
- case ' ':
- case '\t':
- // We are not inside any quotes, we just found a space after an
- // argument. We are done.
- arg_complete = true;
- break;
-
- case '"':
- case '\'':
- case '`':
- // We found the start of a quote scope.
- if (first_quote_char == '\0')
- first_quote_char = special;
-
- if (special == '"')
- command = ParseDoubleQuotes(command, arg);
- else {
- // For single quotes, we simply skip ahead to the matching quote
- // character
- // (or the end of the string).
- size_t quoted = command.find(special);
- arg += command.substr(0, quoted);
- command = command.substr(quoted);
- }
-
- // If we found a closing quote, skip it.
- if (!command.empty())
- command = command.drop_front();
-
- break;
- }
- } while (!arg_complete);
-
- return std::make_tuple(arg, first_quote_char, command);
-}
-
-Args::ArgEntry::ArgEntry(llvm::StringRef str, char quote) : quote(quote) {
- size_t size = str.size();
- ptr.reset(new char[size + 1]);
-
- ::memcpy(data(), str.data() ? str.data() : "", size);
- ptr[size] = 0;
- ref = llvm::StringRef(c_str(), size);
-}
-
-//----------------------------------------------------------------------
-// Args constructor
-//----------------------------------------------------------------------
-Args::Args(llvm::StringRef command) { SetCommandString(command); }
-
-Args::Args(const Args &rhs) { *this = rhs; }
-
-Args::Args(const StringList &list) : Args() {
- for(size_t i = 0; i < list.GetSize(); ++i)
- AppendArgument(list[i]);
-}
-
-Args &Args::operator=(const Args &rhs) {
- Clear();
-
- m_argv.clear();
- m_entries.clear();
- for (auto &entry : rhs.m_entries) {
- m_entries.emplace_back(entry.ref, entry.quote);
- m_argv.push_back(m_entries.back().data());
- }
- m_argv.push_back(nullptr);
- return *this;
-}
-
-//----------------------------------------------------------------------
-// Destructor
-//----------------------------------------------------------------------
-Args::~Args() {}
-
-void Args::Dump(Stream &s, const char *label_name) const {
- if (!label_name)
- return;
-
- int i = 0;
- for (auto &entry : m_entries) {
- s.Indent();
- s.Format("{0}[{1}]=\"{2}\"\n", label_name, i++, entry.ref);
- }
- s.Format("{0}[{1}]=NULL\n", label_name, i);
- s.EOL();
-}
-
-bool Args::GetCommandString(std::string &command) const {
- command.clear();
-
- for (size_t i = 0; i < m_entries.size(); ++i) {
- if (i > 0)
- command += ' ';
- command += m_entries[i].ref;
- }
-
- return !m_entries.empty();
-}
-
-bool Args::GetQuotedCommandString(std::string &command) const {
- command.clear();
-
- for (size_t i = 0; i < m_entries.size(); ++i) {
- if (i > 0)
- command += ' ';
-
- if (m_entries[i].quote) {
- command += m_entries[i].quote;
- command += m_entries[i].ref;
- command += m_entries[i].quote;
- } else {
- command += m_entries[i].ref;
- }
- }
-
- return !m_entries.empty();
-}
-
-void Args::SetCommandString(llvm::StringRef command) {
- Clear();
- m_argv.clear();
-
- static const char *k_space_separators = " \t";
- command = command.ltrim(k_space_separators);
- std::string arg;
- char quote;
- while (!command.empty()) {
- std::tie(arg, quote, command) = ParseSingleArgument(command);
- m_entries.emplace_back(arg, quote);
- m_argv.push_back(m_entries.back().data());
- command = command.ltrim(k_space_separators);
- }
- m_argv.push_back(nullptr);
-}
-
-void Args::UpdateArgsAfterOptionParsing() {
- assert(!m_argv.empty());
- assert(m_argv.back() == nullptr);
-
- // Now m_argv might be out of date with m_entries, so we need to fix that.
- // This happens because getopt_long_only may permute the order of the
- // arguments in argv, so we need to re-order the quotes and the refs array
- // to match.
- for (size_t i = 0; i < m_argv.size() - 1; ++i) {
- const char *argv = m_argv[i];
- auto pos =
- std::find_if(m_entries.begin() + i, m_entries.end(),
- [argv](const ArgEntry &D) { return D.c_str() == argv; });
- assert(pos != m_entries.end());
- size_t distance = std::distance(m_entries.begin(), pos);
- if (i == distance)
- continue;
-
- assert(distance > i);
-
- std::swap(m_entries[i], m_entries[distance]);
- assert(m_entries[i].ref.data() == m_argv[i]);
- }
- m_entries.resize(m_argv.size() - 1);
-}
-
-size_t Args::GetArgumentCount() const { return m_entries.size(); }
-
-const char *Args::GetArgumentAtIndex(size_t idx) const {
- if (idx < m_argv.size())
- return m_argv[idx];
- return nullptr;
-}
-
-char Args::GetArgumentQuoteCharAtIndex(size_t idx) const {
- if (idx < m_entries.size())
- return m_entries[idx].quote;
- return '\0';
-}
-
-char **Args::GetArgumentVector() {
- assert(!m_argv.empty());
- // TODO: functions like execve and posix_spawnp exhibit undefined behavior
- // when argv or envp is null. So the code below is actually wrong. However,
- // other code in LLDB depends on it being null. The code has been acting this
- // way for some time, so it makes sense to leave it this way until someone
- // has the time to come along and fix it.
- return (m_argv.size() > 1) ? m_argv.data() : nullptr;
-}
-
-const char **Args::GetConstArgumentVector() const {
- assert(!m_argv.empty());
- return (m_argv.size() > 1) ? const_cast<const char **>(m_argv.data())
- : nullptr;
-}
-
-void Args::Shift() {
- // Don't pop the last NULL terminator from the argv array
- if (m_entries.empty())
- return;
- m_argv.erase(m_argv.begin());
- m_entries.erase(m_entries.begin());
-}
-
-void Args::Unshift(llvm::StringRef arg_str, char quote_char) {
- InsertArgumentAtIndex(0, arg_str, quote_char);
-}
-
-void Args::AppendArguments(const Args &rhs) {
- assert(m_argv.size() == m_entries.size() + 1);
- assert(m_argv.back() == nullptr);
- m_argv.pop_back();
- for (auto &entry : rhs.m_entries) {
- m_entries.emplace_back(entry.ref, entry.quote);
- m_argv.push_back(m_entries.back().data());
- }
- m_argv.push_back(nullptr);
-}
-
-void Args::AppendArguments(const char **argv) {
- size_t argc = ArgvToArgc(argv);
-
- assert(m_argv.size() == m_entries.size() + 1);
- assert(m_argv.back() == nullptr);
- m_argv.pop_back();
- for (auto arg : llvm::makeArrayRef(argv, argc)) {
- m_entries.emplace_back(arg, '\0');
- m_argv.push_back(m_entries.back().data());
- }
-
- m_argv.push_back(nullptr);
-}
-
-void Args::AppendArgument(llvm::StringRef arg_str, char quote_char) {
- InsertArgumentAtIndex(GetArgumentCount(), arg_str, quote_char);
-}
-
-void Args::InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str,
- char quote_char) {
- assert(m_argv.size() == m_entries.size() + 1);
- assert(m_argv.back() == nullptr);
-
- if (idx > m_entries.size())
- return;
- m_entries.emplace(m_entries.begin() + idx, arg_str, quote_char);
- m_argv.insert(m_argv.begin() + idx, m_entries[idx].data());
-}
-
-void Args::ReplaceArgumentAtIndex(size_t idx, llvm::StringRef arg_str,
- char quote_char) {
- assert(m_argv.size() == m_entries.size() + 1);
- assert(m_argv.back() == nullptr);
-
- if (idx >= m_entries.size())
- return;
-
- if (arg_str.size() > m_entries[idx].ref.size()) {
- m_entries[idx] = ArgEntry(arg_str, quote_char);
- m_argv[idx] = m_entries[idx].data();
- } else {
- const char *src_data = arg_str.data() ? arg_str.data() : "";
- ::memcpy(m_entries[idx].data(), src_data, arg_str.size());
- m_entries[idx].ptr[arg_str.size()] = 0;
- m_entries[idx].ref = m_entries[idx].ref.take_front(arg_str.size());
- }
-}
-
-void Args::DeleteArgumentAtIndex(size_t idx) {
- if (idx >= m_entries.size())
- return;
-
- m_argv.erase(m_argv.begin() + idx);
- m_entries.erase(m_entries.begin() + idx);
-}
-
-void Args::SetArguments(size_t argc, const char **argv) {
- Clear();
-
- auto args = llvm::makeArrayRef(argv, argc);
- m_entries.resize(argc);
- m_argv.resize(argc + 1);
- for (size_t i = 0; i < args.size(); ++i) {
- char quote =
- ((args[i][0] == '\'') || (args[i][0] == '"') || (args[i][0] == '`'))
- ? args[i][0]
- : '\0';
-
- m_entries[i] = ArgEntry(args[i], quote);
- m_argv[i] = m_entries[i].data();
- }
-}
-
-void Args::SetArguments(const char **argv) {
- SetArguments(ArgvToArgc(argv), argv);
-}
-
-Status Args::ParseOptions(Options &options, ExecutionContext *execution_context,
- PlatformSP platform_sp, bool require_validation) {
- StreamString sstr;
- Status error;
- Option *long_options = options.GetLongOptions();
- if (long_options == nullptr) {
- error.SetErrorStringWithFormat("invalid long options");
- return error;
- }
-
- for (int i = 0; long_options[i].definition != nullptr; ++i) {
- if (long_options[i].flag == nullptr) {
- if (isprint8(long_options[i].val)) {
- sstr << (char)long_options[i].val;
- switch (long_options[i].definition->option_has_arg) {
- default:
- case OptionParser::eNoArgument:
- break;
- case OptionParser::eRequiredArgument:
- sstr << ':';
- break;
- case OptionParser::eOptionalArgument:
- sstr << "::";
- break;
- }
- }
- }
- }
- std::unique_lock<std::mutex> lock;
- OptionParser::Prepare(lock);
- int val;
- while (1) {
- int long_options_index = -1;
- val = OptionParser::Parse(GetArgumentCount(), GetArgumentVector(),
- sstr.GetString(), long_options,
- &long_options_index);
- if (val == -1)
- break;
-
- // Did we get an error?
- if (val == '?') {
- error.SetErrorStringWithFormat("unknown or ambiguous option");
- break;
- }
- // The option auto-set itself
- if (val == 0)
- continue;
-
- ((Options *)&options)->OptionSeen(val);
-
- // Lookup the long option index
- if (long_options_index == -1) {
- for (int i = 0; long_options[i].definition || long_options[i].flag ||
- long_options[i].val;
- ++i) {
- if (long_options[i].val == val) {
- long_options_index = i;
- break;
- }
- }
- }
- // Call the callback with the option
- if (long_options_index >= 0 &&
- long_options[long_options_index].definition) {
- const OptionDefinition *def = long_options[long_options_index].definition;
-
- if (!platform_sp) {
- // User did not pass in an explicit platform. Try to grab
- // from the execution context.
- TargetSP target_sp =
- execution_context ? execution_context->GetTargetSP() : TargetSP();
- platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP();
- }
- OptionValidator *validator = def->validator;
-
- if (!platform_sp && require_validation) {
- // Caller requires validation but we cannot validate as we
- // don't have the mandatory platform against which to
- // validate.
- error.SetErrorString("cannot validate options: "
- "no platform available");
- return error;
- }
-
- bool validation_failed = false;
- if (platform_sp) {
- // Ensure we have an execution context, empty or not.
- ExecutionContext dummy_context;
- ExecutionContext *exe_ctx_p =
- execution_context ? execution_context : &dummy_context;
- if (validator && !validator->IsValid(*platform_sp, *exe_ctx_p)) {
- validation_failed = true;
- error.SetErrorStringWithFormat("Option \"%s\" invalid. %s",
- def->long_option,
- def->validator->LongConditionString());
- }
- }
-
- // As long as validation didn't fail, we set the option value.
- if (!validation_failed)
- error = options.SetOptionValue(
- long_options_index,
- (def->option_has_arg == OptionParser::eNoArgument)
- ? nullptr
- : OptionParser::GetOptionArgument(),
- execution_context);
- } else {
- error.SetErrorStringWithFormat("invalid option with value '%i'", val);
- }
- if (error.Fail())
- break;
- }
-
- // Update our ARGV now that get options has consumed all the options
- m_argv.erase(m_argv.begin(), m_argv.begin() + OptionParser::GetOptionIndex());
- UpdateArgsAfterOptionParsing();
- return error;
-}
-
-void Args::Clear() {
- m_entries.clear();
- m_argv.clear();
- m_argv.push_back(nullptr);
-}
-
-lldb::addr_t Args::StringToAddress(const ExecutionContext *exe_ctx,
- llvm::StringRef s, lldb::addr_t fail_value,
- Status *error_ptr) {
- bool error_set = false;
- if (s.empty()) {
- if (error_ptr)
- error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
- s.str().c_str());
- return fail_value;
- }
-
- llvm::StringRef sref = s;
-
- lldb::addr_t addr = LLDB_INVALID_ADDRESS;
- if (!s.getAsInteger(0, addr)) {
- if (error_ptr)
- error_ptr->Clear();
- return addr;
- }
-
- // Try base 16 with no prefix...
- if (!s.getAsInteger(16, addr)) {
- if (error_ptr)
- error_ptr->Clear();
- return addr;
- }
-
- Target *target = nullptr;
- if (!exe_ctx || !(target = exe_ctx->GetTargetPtr())) {
- if (error_ptr)
- error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
- s.str().c_str());
- return fail_value;
- }
-
- lldb::ValueObjectSP valobj_sp;
- EvaluateExpressionOptions options;
- options.SetCoerceToId(false);
- options.SetUnwindOnError(true);
- options.SetKeepInMemory(false);
- options.SetTryAllThreads(true);
-
- ExpressionResults expr_result =
- target->EvaluateExpression(s, exe_ctx->GetFramePtr(), valobj_sp, options);
-
- bool success = false;
- if (expr_result == eExpressionCompleted) {
- if (valobj_sp)
- valobj_sp = valobj_sp->GetQualifiedRepresentationIfAvailable(
- valobj_sp->GetDynamicValueType(), true);
- // Get the address to watch.
- if (valobj_sp)
- addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
- if (success) {
- if (error_ptr)
- error_ptr->Clear();
- return addr;
- } else {
- if (error_ptr) {
- error_set = true;
- error_ptr->SetErrorStringWithFormat(
- "address expression \"%s\" resulted in a value whose type "
- "can't be converted to an address: %s",
- s.str().c_str(), valobj_sp->GetTypeName().GetCString());
- }
- }
-
- } else {
- // Since the compiler can't handle things like "main + 12" we should
- // try to do this for now. The compiler doesn't like adding offsets
- // to function pointer types.
- static RegularExpression g_symbol_plus_offset_regex(
- "^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$");
- RegularExpression::Match regex_match(3);
- if (g_symbol_plus_offset_regex.Execute(sref, &regex_match)) {
- uint64_t offset = 0;
- bool add = true;
- std::string name;
- std::string str;
- if (regex_match.GetMatchAtIndex(s, 1, name)) {
- if (regex_match.GetMatchAtIndex(s, 2, str)) {
- add = str[0] == '+';
-
- if (regex_match.GetMatchAtIndex(s, 3, str)) {
- if (!llvm::StringRef(str).getAsInteger(0, offset)) {
- Status error;
- addr = StringToAddress(exe_ctx, name.c_str(),
- LLDB_INVALID_ADDRESS, &error);
- if (addr != LLDB_INVALID_ADDRESS) {
- if (add)
- return addr + offset;
- else
- return addr - offset;
- }
- }
- }
- }
- }
- }
-
- if (error_ptr) {
- error_set = true;
- error_ptr->SetErrorStringWithFormat(
- "address expression \"%s\" evaluation failed", s.str().c_str());
- }
- }
-
- if (error_ptr) {
- if (!error_set)
- error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
- s.str().c_str());
- }
- return fail_value;
-}
-
-const char *Args::StripSpaces(std::string &s, bool leading, bool trailing,
- bool return_null_if_empty) {
- static const char *k_white_space = " \t\v";
- if (!s.empty()) {
- if (leading) {
- size_t pos = s.find_first_not_of(k_white_space);
- if (pos == std::string::npos)
- s.clear();
- else if (pos > 0)
- s.erase(0, pos);
- }
-
- if (trailing) {
- size_t rpos = s.find_last_not_of(k_white_space);
- if (rpos != std::string::npos && rpos + 1 < s.size())
- s.erase(rpos + 1);
- }
- }
- if (return_null_if_empty && s.empty())
- return nullptr;
- return s.c_str();
-}
-
-bool Args::StringToBoolean(llvm::StringRef ref, bool fail_value,
- bool *success_ptr) {
- if (success_ptr)
- *success_ptr = true;
- ref = ref.trim();
- if (ref.equals_lower("false") || ref.equals_lower("off") ||
- ref.equals_lower("no") || ref.equals_lower("0")) {
- return false;
- } else if (ref.equals_lower("true") || ref.equals_lower("on") ||
- ref.equals_lower("yes") || ref.equals_lower("1")) {
- return true;
- }
- if (success_ptr)
- *success_ptr = false;
- return fail_value;
-}
-
-char Args::StringToChar(llvm::StringRef s, char fail_value, bool *success_ptr) {
- if (success_ptr)
- *success_ptr = false;
- if (s.size() != 1)
- return fail_value;
-
- if (success_ptr)
- *success_ptr = true;
- return s[0];
-}
-
-bool Args::StringToVersion(llvm::StringRef string, uint32_t &major,
- uint32_t &minor, uint32_t &update) {
- major = UINT32_MAX;
- minor = UINT32_MAX;
- update = UINT32_MAX;
-
- if (string.empty())
- return false;
-
- llvm::StringRef major_str, minor_str, update_str;
-
- std::tie(major_str, minor_str) = string.split('.');
- std::tie(minor_str, update_str) = minor_str.split('.');
- if (major_str.getAsInteger(10, major))
- return false;
- if (!minor_str.empty() && minor_str.getAsInteger(10, minor))
- return false;
- if (!update_str.empty() && update_str.getAsInteger(10, update))
- return false;
-
- return true;
-}
-
-const char *Args::GetShellSafeArgument(const FileSpec &shell,
- const char *unsafe_arg,
- std::string &safe_arg) {
- struct ShellDescriptor {
- ConstString m_basename;
- const char *m_escapables;
- };
-
- static ShellDescriptor g_Shells[] = {{ConstString("bash"), " '\"<>()&"},
- {ConstString("tcsh"), " '\"<>()&$"},
- {ConstString("sh"), " '\"<>()&"}};
-
- // safe minimal set
- const char *escapables = " '\"";
-
- if (auto basename = shell.GetFilename()) {
- for (const auto &Shell : g_Shells) {
- if (Shell.m_basename == basename) {
- escapables = Shell.m_escapables;
- break;
- }
- }
- }
-
- safe_arg.assign(unsafe_arg);
- size_t prev_pos = 0;
- while (prev_pos < safe_arg.size()) {
- // Escape spaces and quotes
- size_t pos = safe_arg.find_first_of(escapables, prev_pos);
- if (pos != std::string::npos) {
- safe_arg.insert(pos, 1, '\\');
- prev_pos = pos + 2;
- } else
- break;
- }
- return safe_arg.c_str();
-}
-
-int64_t Args::StringToOptionEnum(llvm::StringRef s,
- OptionEnumValueElement *enum_values,
- int32_t fail_value, Status &error) {
- error.Clear();
- if (!enum_values) {
- error.SetErrorString("invalid enumeration argument");
- return fail_value;
- }
-
- if (s.empty()) {
- error.SetErrorString("empty enumeration string");
- return fail_value;
- }
-
- for (int i = 0; enum_values[i].string_value != nullptr; i++) {
- llvm::StringRef this_enum(enum_values[i].string_value);
- if (this_enum.startswith(s))
- return enum_values[i].value;
- }
-
- StreamString strm;
- strm.PutCString("invalid enumeration value, valid values are: ");
- for (int i = 0; enum_values[i].string_value != nullptr; i++) {
- strm.Printf("%s\"%s\"", i > 0 ? ", " : "", enum_values[i].string_value);
- }
- error.SetErrorString(strm.GetString());
- return fail_value;
-}
-
-lldb::ScriptLanguage
-Args::StringToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value,
- bool *success_ptr) {
- if (success_ptr)
- *success_ptr = true;
-
- if (s.equals_lower("python"))
- return eScriptLanguagePython;
- if (s.equals_lower("default"))
- return eScriptLanguageDefault;
- if (s.equals_lower("none"))
- return eScriptLanguageNone;
-
- if (success_ptr)
- *success_ptr = false;
- return fail_value;
-}
-
-Status Args::StringToFormat(const char *s, lldb::Format &format,
- size_t *byte_size_ptr) {
- format = eFormatInvalid;
- Status error;
-
- if (s && s[0]) {
- if (byte_size_ptr) {
- if (isdigit(s[0])) {
- char *format_char = nullptr;
- unsigned long byte_size = ::strtoul(s, &format_char, 0);
- if (byte_size != ULONG_MAX)
- *byte_size_ptr = byte_size;
- s = format_char;
- } else
- *byte_size_ptr = 0;
- }
-
- const bool partial_match_ok = true;
- if (!FormatManager::GetFormatFromCString(s, partial_match_ok, format)) {
- StreamString error_strm;
- error_strm.Printf(
- "Invalid format character or name '%s'. Valid values are:\n", s);
- for (Format f = eFormatDefault; f < kNumFormats; f = Format(f + 1)) {
- char format_char = FormatManager::GetFormatAsFormatChar(f);
- if (format_char)
- error_strm.Printf("'%c' or ", format_char);
-
- error_strm.Printf("\"%s\"", FormatManager::GetFormatAsCString(f));
- error_strm.EOL();
- }
-
- if (byte_size_ptr)
- error_strm.PutCString(
- "An optional byte size can precede the format character.\n");
- error.SetErrorString(error_strm.GetString());
- }
-
- if (error.Fail())
- return error;
- } else {
- error.SetErrorStringWithFormat("%s option string", s ? "empty" : "invalid");
- }
- return error;
-}
-
-lldb::Encoding Args::StringToEncoding(llvm::StringRef s,
- lldb::Encoding fail_value) {
- return llvm::StringSwitch<lldb::Encoding>(s)
- .Case("uint", eEncodingUint)
- .Case("sint", eEncodingSint)
- .Case("ieee754", eEncodingIEEE754)
- .Case("vector", eEncodingVector)
- .Default(fail_value);
-}
-
-uint32_t Args::StringToGenericRegister(llvm::StringRef s) {
- if (s.empty())
- return LLDB_INVALID_REGNUM;
- uint32_t result = llvm::StringSwitch<uint32_t>(s)
- .Case("pc", LLDB_REGNUM_GENERIC_PC)
- .Case("sp", LLDB_REGNUM_GENERIC_SP)
- .Case("fp", LLDB_REGNUM_GENERIC_FP)
- .Cases("ra", "lr", LLDB_REGNUM_GENERIC_RA)
- .Case("flags", LLDB_REGNUM_GENERIC_FLAGS)
- .Case("arg1", LLDB_REGNUM_GENERIC_ARG1)
- .Case("arg2", LLDB_REGNUM_GENERIC_ARG2)
- .Case("arg3", LLDB_REGNUM_GENERIC_ARG3)
- .Case("arg4", LLDB_REGNUM_GENERIC_ARG4)
- .Case("arg5", LLDB_REGNUM_GENERIC_ARG5)
- .Case("arg6", LLDB_REGNUM_GENERIC_ARG6)
- .Case("arg7", LLDB_REGNUM_GENERIC_ARG7)
- .Case("arg8", LLDB_REGNUM_GENERIC_ARG8)
- .Default(LLDB_INVALID_REGNUM);
- return result;
-}
-
-void Args::AddOrReplaceEnvironmentVariable(llvm::StringRef env_var_name,
- llvm::StringRef new_value) {
- if (env_var_name.empty())
- return;
-
- // Build the new entry.
- std::string var_string(env_var_name);
- if (!new_value.empty()) {
- var_string += "=";
- var_string += new_value;
- }
-
- size_t index = 0;
- if (ContainsEnvironmentVariable(env_var_name, &index)) {
- ReplaceArgumentAtIndex(index, var_string);
- return;
- }
-
- // We didn't find it. Append it instead.
- AppendArgument(var_string);
-}
-
-bool Args::ContainsEnvironmentVariable(llvm::StringRef env_var_name,
- size_t *argument_index) const {
- // Validate args.
- if (env_var_name.empty())
- return false;
-
- // Check each arg to see if it matches the env var name.
- for (auto arg : llvm::enumerate(m_entries)) {
- llvm::StringRef name, value;
- std::tie(name, value) = arg.value().ref.split('=');
- if (name != env_var_name)
- continue;
-
- if (argument_index)
- *argument_index = arg.index();
- return true;
- }
-
- // We didn't find a match.
- return false;
-}
-
-size_t Args::FindArgumentIndexForOption(Option *long_options,
- int long_options_index) const {
- char short_buffer[3];
- char long_buffer[255];
- ::snprintf(short_buffer, sizeof(short_buffer), "-%c",
- long_options[long_options_index].val);
- ::snprintf(long_buffer, sizeof(long_buffer), "--%s",
- long_options[long_options_index].definition->long_option);
-
- for (auto entry : llvm::enumerate(m_entries)) {
- if (entry.value().ref.startswith(short_buffer) ||
- entry.value().ref.startswith(long_buffer))
- return entry.index();
- }
-
- return size_t(-1);
-}
-
-bool Args::IsPositionalArgument(const char *arg) {
- if (arg == nullptr)
- return false;
-
- bool is_positional = true;
- const char *cptr = arg;
-
- if (cptr[0] == '%') {
- ++cptr;
- while (isdigit(cptr[0]))
- ++cptr;
- if (cptr[0] != '\0')
- is_positional = false;
- } else
- is_positional = false;
-
- return is_positional;
-}
-
-std::string Args::ParseAliasOptions(Options &options,
- CommandReturnObject &result,
- OptionArgVector *option_arg_vector,
- llvm::StringRef raw_input_string) {
- std::string result_string(raw_input_string);
- StreamString sstr;
- int i;
- Option *long_options = options.GetLongOptions();
-
- if (long_options == nullptr) {
- result.AppendError("invalid long options");
- result.SetStatus(eReturnStatusFailed);
- return result_string;
- }
-
- for (i = 0; long_options[i].definition != nullptr; ++i) {
- if (long_options[i].flag == nullptr) {
- sstr << (char)long_options[i].val;
- switch (long_options[i].definition->option_has_arg) {
- default:
- case OptionParser::eNoArgument:
- break;
- case OptionParser::eRequiredArgument:
- sstr << ":";
- break;
- case OptionParser::eOptionalArgument:
- sstr << "::";
- break;
- }
- }
- }
-
- std::unique_lock<std::mutex> lock;
- OptionParser::Prepare(lock);
- result.SetStatus(eReturnStatusSuccessFinishNoResult);
- int val;
- while (1) {
- int long_options_index = -1;
- val = OptionParser::Parse(GetArgumentCount(), GetArgumentVector(),
- sstr.GetString(), long_options,
- &long_options_index);
-
- if (val == -1)
- break;
-
- if (val == '?') {
- result.AppendError("unknown or ambiguous option");
- result.SetStatus(eReturnStatusFailed);
- break;
- }
-
- if (val == 0)
- continue;
-
- options.OptionSeen(val);
-
- // Look up the long option index
- if (long_options_index == -1) {
- for (int j = 0; long_options[j].definition || long_options[j].flag ||
- long_options[j].val;
- ++j) {
- if (long_options[j].val == val) {
- long_options_index = j;
- break;
- }
- }
- }
-
- // See if the option takes an argument, and see if one was supplied.
- if (long_options_index == -1) {
- result.AppendErrorWithFormat("Invalid option with value '%c'.\n", val);
- result.SetStatus(eReturnStatusFailed);
- return result_string;
- }
-
- StreamString option_str;
- option_str.Printf("-%c", val);
- const OptionDefinition *def = long_options[long_options_index].definition;
- int has_arg =
- (def == nullptr) ? OptionParser::eNoArgument : def->option_has_arg;
-
- const char *option_arg = nullptr;
- switch (has_arg) {
- case OptionParser::eRequiredArgument:
- if (OptionParser::GetOptionArgument() == nullptr) {
- result.AppendErrorWithFormat(
- "Option '%s' is missing argument specifier.\n",
- option_str.GetData());
- result.SetStatus(eReturnStatusFailed);
- return result_string;
- }
- LLVM_FALLTHROUGH;
- case OptionParser::eOptionalArgument:
- option_arg = OptionParser::GetOptionArgument();
- LLVM_FALLTHROUGH;
- case OptionParser::eNoArgument:
- break;
- default:
- result.AppendErrorWithFormat("error with options table; invalid value "
- "in has_arg field for option '%c'.\n",
- val);
- result.SetStatus(eReturnStatusFailed);
- return result_string;
- }
- if (!option_arg)
- option_arg = "<no-argument>";
- option_arg_vector->emplace_back(option_str.GetString(), has_arg,
- option_arg);
-
- // Find option in the argument list; also see if it was supposed to take
- // an argument and if one was supplied. Remove option (and argument, if
- // given) from the argument list. Also remove them from the
- // raw_input_string, if one was passed in.
- size_t idx = FindArgumentIndexForOption(long_options, long_options_index);
- if (idx == size_t(-1))
- continue;
-
- if (!result_string.empty()) {
- auto tmp_arg = m_entries[idx].ref;
- size_t pos = result_string.find(tmp_arg);
- if (pos != std::string::npos)
- result_string.erase(pos, tmp_arg.size());
- }
- ReplaceArgumentAtIndex(idx, llvm::StringRef());
- if ((long_options[long_options_index].definition->option_has_arg !=
- OptionParser::eNoArgument) &&
- (OptionParser::GetOptionArgument() != nullptr) &&
- (idx + 1 < GetArgumentCount()) &&
- (m_entries[idx + 1].ref == OptionParser::GetOptionArgument())) {
- if (result_string.size() > 0) {
- auto tmp_arg = m_entries[idx + 1].ref;
- size_t pos = result_string.find(tmp_arg);
- if (pos != std::string::npos)
- result_string.erase(pos, tmp_arg.size());
- }
- ReplaceArgumentAtIndex(idx + 1, llvm::StringRef());
- }
- }
- return result_string;
-}
-
-void Args::ParseArgsForCompletion(Options &options,
- OptionElementVector &option_element_vector,
- uint32_t cursor_index) {
- StreamString sstr;
- Option *long_options = options.GetLongOptions();
- option_element_vector.clear();
-
- if (long_options == nullptr) {
- return;
- }
-
- // Leading : tells getopt to return a : for a missing option argument AND
- // to suppress error messages.
-
- sstr << ":";
- for (int i = 0; long_options[i].definition != nullptr; ++i) {
- if (long_options[i].flag == nullptr) {
- sstr << (char)long_options[i].val;
- switch (long_options[i].definition->option_has_arg) {
- default:
- case OptionParser::eNoArgument:
- break;
- case OptionParser::eRequiredArgument:
- sstr << ":";
- break;
- case OptionParser::eOptionalArgument:
- sstr << "::";
- break;
- }
- }
- }
-
- std::unique_lock<std::mutex> lock;
- OptionParser::Prepare(lock);
- OptionParser::EnableError(false);
-
- int val;
- auto opt_defs = options.GetDefinitions();
-
- // Fooey... OptionParser::Parse permutes the GetArgumentVector to move the
- // options to the front. So we have to build another Arg and pass that to
- // OptionParser::Parse so it doesn't change the one we have.
-
- std::vector<char *> dummy_vec = m_argv;
-
- bool failed_once = false;
- uint32_t dash_dash_pos = -1;
-
- while (1) {
- bool missing_argument = false;
- int long_options_index = -1;
-
- val = OptionParser::Parse(dummy_vec.size() - 1, &dummy_vec[0],
- sstr.GetString(), long_options,
- &long_options_index);
-
- if (val == -1) {
- // When we're completing a "--" which is the last option on line,
- if (failed_once)
- break;
-
- failed_once = true;
-
- // If this is a bare "--" we mark it as such so we can complete it
- // successfully later.
- // Handling the "--" is a little tricky, since that may mean end of
- // options or arguments, or the
- // user might want to complete options by long name. I make this work by
- // checking whether the
- // cursor is in the "--" argument, and if so I assume we're completing the
- // long option, otherwise
- // I let it pass to OptionParser::Parse which will terminate the option
- // parsing.
- // Note, in either case we continue parsing the line so we can figure out
- // what other options
- // were passed. This will be useful when we come to restricting
- // completions based on what other
- // options we've seen on the line.
-
- if (static_cast<size_t>(OptionParser::GetOptionIndex()) <
- dummy_vec.size() - 1 &&
- (strcmp(dummy_vec[OptionParser::GetOptionIndex() - 1], "--") == 0)) {
- dash_dash_pos = OptionParser::GetOptionIndex() - 1;
- if (static_cast<size_t>(OptionParser::GetOptionIndex() - 1) ==
- cursor_index) {
- option_element_vector.push_back(
- OptionArgElement(OptionArgElement::eBareDoubleDash,
- OptionParser::GetOptionIndex() - 1,
- OptionArgElement::eBareDoubleDash));
- continue;
- } else
- break;
- } else
- break;
- } else if (val == '?') {
- option_element_vector.push_back(
- OptionArgElement(OptionArgElement::eUnrecognizedArg,
- OptionParser::GetOptionIndex() - 1,
- OptionArgElement::eUnrecognizedArg));
- continue;
- } else if (val == 0) {
- continue;
- } else if (val == ':') {
- // This is a missing argument.
- val = OptionParser::GetOptionErrorCause();
- missing_argument = true;
- }
-
- ((Options *)&options)->OptionSeen(val);
-
- // Look up the long option index
- if (long_options_index == -1) {
- for (int j = 0; long_options[j].definition || long_options[j].flag ||
- long_options[j].val;
- ++j) {
- if (long_options[j].val == val) {
- long_options_index = j;
- break;
- }
- }
- }
-
- // See if the option takes an argument, and see if one was supplied.
- if (long_options_index >= 0) {
- int opt_defs_index = -1;
- for (size_t i = 0; i < opt_defs.size(); i++) {
- if (opt_defs[i].short_option != val)
- continue;
- opt_defs_index = i;
- break;
- }
-
- const OptionDefinition *def = long_options[long_options_index].definition;
- int has_arg =
- (def == nullptr) ? OptionParser::eNoArgument : def->option_has_arg;
- switch (has_arg) {
- case OptionParser::eNoArgument:
- option_element_vector.push_back(OptionArgElement(
- opt_defs_index, OptionParser::GetOptionIndex() - 1, 0));
- break;
- case OptionParser::eRequiredArgument:
- if (OptionParser::GetOptionArgument() != nullptr) {
- int arg_index;
- if (missing_argument)
- arg_index = -1;
- else
- arg_index = OptionParser::GetOptionIndex() - 1;
-
- option_element_vector.push_back(OptionArgElement(
- opt_defs_index, OptionParser::GetOptionIndex() - 2, arg_index));
- } else {
- option_element_vector.push_back(OptionArgElement(
- opt_defs_index, OptionParser::GetOptionIndex() - 1, -1));
- }
- break;
- case OptionParser::eOptionalArgument:
- if (OptionParser::GetOptionArgument() != nullptr) {
- option_element_vector.push_back(OptionArgElement(
- opt_defs_index, OptionParser::GetOptionIndex() - 2,
- OptionParser::GetOptionIndex() - 1));
- } else {
- option_element_vector.push_back(OptionArgElement(
- opt_defs_index, OptionParser::GetOptionIndex() - 2,
- OptionParser::GetOptionIndex() - 1));
- }
- break;
- default:
- // The options table is messed up. Here we'll just continue
- option_element_vector.push_back(
- OptionArgElement(OptionArgElement::eUnrecognizedArg,
- OptionParser::GetOptionIndex() - 1,
- OptionArgElement::eUnrecognizedArg));
- break;
- }
- } else {
- option_element_vector.push_back(
- OptionArgElement(OptionArgElement::eUnrecognizedArg,
- OptionParser::GetOptionIndex() - 1,
- OptionArgElement::eUnrecognizedArg));
- }
- }
-
- // Finally we have to handle the case where the cursor index points at a
- // single "-". We want to mark that in
- // the option_element_vector, but only if it is not after the "--". But it
- // turns out that OptionParser::Parse just ignores
- // an isolated "-". So we have to look it up by hand here. We only care if
- // it is AT the cursor position.
- // Note, a single quoted dash is not the same as a single dash...
-
- const ArgEntry &cursor = m_entries[cursor_index];
- if ((static_cast<int32_t>(dash_dash_pos) == -1 ||
- cursor_index < dash_dash_pos) &&
- cursor.quote == '\0' && cursor.ref == "-") {
- option_element_vector.push_back(
- OptionArgElement(OptionArgElement::eBareDash, cursor_index,
- OptionArgElement::eBareDash));
- }
-}
-
-void Args::EncodeEscapeSequences(const char *src, std::string &dst) {
- dst.clear();
- if (src) {
- for (const char *p = src; *p != '\0'; ++p) {
- size_t non_special_chars = ::strcspn(p, "\\");
- if (non_special_chars > 0) {
- dst.append(p, non_special_chars);
- p += non_special_chars;
- if (*p == '\0')
- break;
- }
-
- if (*p == '\\') {
- ++p; // skip the slash
- switch (*p) {
- case 'a':
- dst.append(1, '\a');
- break;
- case 'b':
- dst.append(1, '\b');
- break;
- case 'f':
- dst.append(1, '\f');
- break;
- case 'n':
- dst.append(1, '\n');
- break;
- case 'r':
- dst.append(1, '\r');
- break;
- case 't':
- dst.append(1, '\t');
- break;
- case 'v':
- dst.append(1, '\v');
- break;
- case '\\':
- dst.append(1, '\\');
- break;
- case '\'':
- dst.append(1, '\'');
- break;
- case '"':
- dst.append(1, '"');
- break;
- case '0':
- // 1 to 3 octal chars
- {
- // Make a string that can hold onto the initial zero char,
- // up to 3 octal digits, and a terminating NULL.
- char oct_str[5] = {'\0', '\0', '\0', '\0', '\0'};
-
- int i;
- for (i = 0; (p[i] >= '0' && p[i] <= '7') && i < 4; ++i)
- oct_str[i] = p[i];
-
- // We don't want to consume the last octal character since
- // the main for loop will do this for us, so we advance p by
- // one less than i (even if i is zero)
- p += i - 1;
- unsigned long octal_value = ::strtoul(oct_str, nullptr, 8);
- if (octal_value <= UINT8_MAX) {
- dst.append(1, (char)octal_value);
- }
- }
- break;
-
- case 'x':
- // hex number in the format
- if (isxdigit(p[1])) {
- ++p; // Skip the 'x'
-
- // Make a string that can hold onto two hex chars plus a
- // NULL terminator
- char hex_str[3] = {*p, '\0', '\0'};
- if (isxdigit(p[1])) {
- ++p; // Skip the first of the two hex chars
- hex_str[1] = *p;
- }
-
- unsigned long hex_value = strtoul(hex_str, nullptr, 16);
- if (hex_value <= UINT8_MAX)
- dst.append(1, (char)hex_value);
- } else {
- dst.append(1, 'x');
- }
- break;
-
- default:
- // Just desensitize any other character by just printing what
- // came after the '\'
- dst.append(1, *p);
- break;
- }
- }
- }
- }
-}
-
-void Args::ExpandEscapedCharacters(const char *src, std::string &dst) {
- dst.clear();
- if (src) {
- for (const char *p = src; *p != '\0'; ++p) {
- if (isprint8(*p))
- dst.append(1, *p);
- else {
- switch (*p) {
- case '\a':
- dst.append("\\a");
- break;
- case '\b':
- dst.append("\\b");
- break;
- case '\f':
- dst.append("\\f");
- break;
- case '\n':
- dst.append("\\n");
- break;
- case '\r':
- dst.append("\\r");
- break;
- case '\t':
- dst.append("\\t");
- break;
- case '\v':
- dst.append("\\v");
- break;
- case '\'':
- dst.append("\\'");
- break;
- case '"':
- dst.append("\\\"");
- break;
- case '\\':
- dst.append("\\\\");
- break;
- default: {
- // Just encode as octal
- dst.append("\\0");
- char octal_str[32];
- snprintf(octal_str, sizeof(octal_str), "%o", *p);
- dst.append(octal_str);
- } break;
- }
- }
- }
- }
-}
-
-std::string Args::EscapeLLDBCommandArgument(const std::string &arg,
- char quote_char) {
- const char *chars_to_escape = nullptr;
- switch (quote_char) {
- case '\0':
- chars_to_escape = " \t\\'\"`";
- break;
- case '\'':
- chars_to_escape = "";
- break;
- case '"':
- chars_to_escape = "$\"`\\";
- break;
- default:
- assert(false && "Unhandled quote character");
- }
-
- std::string res;
- res.reserve(arg.size());
- for (char c : arg) {
- if (::strchr(chars_to_escape, c))
- res.push_back('\\');
- res.push_back(c);
- }
- return res;
-}
diff --git a/source/Interpreter/CMakeLists.txt b/source/Interpreter/CMakeLists.txt
index 0ab25f17144b..aaa335af39f9 100644
--- a/source/Interpreter/CMakeLists.txt
+++ b/source/Interpreter/CMakeLists.txt
@@ -1,5 +1,4 @@
add_lldb_library(lldbInterpreter
- Args.cpp
CommandAlias.cpp
CommandHistory.cpp
CommandInterpreter.cpp
@@ -8,6 +7,7 @@ add_lldb_library(lldbInterpreter
CommandObjectScript.cpp
CommandOptionValidators.cpp
CommandReturnObject.cpp
+ OptionArgParser.cpp
OptionGroupArchitecture.cpp
OptionGroupBoolean.cpp
OptionGroupFile.cpp
diff --git a/source/Interpreter/CommandAlias.cpp b/source/Interpreter/CommandAlias.cpp
index 2db7460611ca..a4b0a0c55c0e 100644
--- a/source/Interpreter/CommandAlias.cpp
+++ b/source/Interpreter/CommandAlias.cpp
@@ -40,12 +40,17 @@ static bool ProcessAliasOptionsArgs(lldb::CommandObjectSP &cmd_obj_sp,
ExecutionContext exe_ctx =
cmd_obj_sp->GetCommandInterpreter().GetExecutionContext();
options->NotifyOptionParsingStarting(&exe_ctx);
- args.Unshift(llvm::StringRef("dummy_arg"));
- options_string = args.ParseAliasOptions(*options, result, option_arg_vector,
- options_args);
- args.Shift();
- if (result.Succeeded())
- options->VerifyPartialOptions(result);
+
+ llvm::Expected<Args> args_or =
+ options->ParseAlias(args, option_arg_vector, options_string);
+ if (!args_or) {
+ result.AppendError(toString(args_or.takeError()));
+ result.AppendError("Unable to create requested alias.\n");
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+ args = std::move(*args_or);
+ options->VerifyPartialOptions(result);
if (!result.Succeeded() &&
result.GetStatus() != lldb::eReturnStatusStarted) {
result.AppendError("Unable to create requested alias.\n");
@@ -109,26 +114,17 @@ bool CommandAlias::WantsCompletion() {
return false;
}
-int CommandAlias::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) {
+int CommandAlias::HandleCompletion(CompletionRequest &request) {
if (IsValid())
- return m_underlying_command_sp->HandleCompletion(
- input, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ return m_underlying_command_sp->HandleCompletion(request);
return -1;
}
int CommandAlias::HandleArgumentCompletion(
- Args &input, int &cursor_index, int &cursor_char_position,
- OptionElementVector &opt_element_vector, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
+ CompletionRequest &request, OptionElementVector &opt_element_vector) {
if (IsValid())
return m_underlying_command_sp->HandleArgumentCompletion(
- input, cursor_index, cursor_char_position, opt_element_vector,
- match_start_point, max_return_elements, word_complete, matches);
+ request, opt_element_vector);
return -1;
}
@@ -191,8 +187,8 @@ bool CommandAlias::IsDashDashCommand() {
}
}
- // if this is a nested alias, it may be adding arguments on top of an
- // already dash-dash alias
+ // if this is a nested alias, it may be adding arguments on top of an already
+ // dash-dash alias
if ((m_is_dashdash_alias == eLazyBoolNo) && IsNestedAlias())
m_is_dashdash_alias =
(GetUnderlyingCommand()->IsDashDashCommand() ? eLazyBoolYes
@@ -223,8 +219,7 @@ std::pair<lldb::CommandObjectSP, OptionArgVectorSP> CommandAlias::Desugar() {
}
// allow CommandAlias objects to provide their own help, but fallback to the
-// info
-// for the underlying command if no customization has been provided
+// info for the underlying command if no customization has been provided
void CommandAlias::SetHelp(llvm::StringRef str) {
this->CommandObject::SetHelp(str);
m_did_set_help = true;
diff --git a/source/Interpreter/CommandInterpreter.cpp b/source/Interpreter/CommandInterpreter.cpp
index 8dc5637b6e4e..4c8b65441366 100644
--- a/source/Interpreter/CommandInterpreter.cpp
+++ b/source/Interpreter/CommandInterpreter.cpp
@@ -14,32 +14,31 @@
#include "CommandObjectScript.h"
#include "lldb/Interpreter/CommandObjectRegexCommand.h"
-#include "../Commands/CommandObjectApropos.h"
-#include "../Commands/CommandObjectArgs.h"
-#include "../Commands/CommandObjectBreakpoint.h"
-#include "../Commands/CommandObjectBugreport.h"
-#include "../Commands/CommandObjectCommands.h"
-#include "../Commands/CommandObjectDisassemble.h"
-#include "../Commands/CommandObjectExpression.h"
-#include "../Commands/CommandObjectFrame.h"
-#include "../Commands/CommandObjectGUI.h"
-#include "../Commands/CommandObjectHelp.h"
-#include "../Commands/CommandObjectLanguage.h"
-#include "../Commands/CommandObjectLog.h"
-#include "../Commands/CommandObjectMemory.h"
-#include "../Commands/CommandObjectPlatform.h"
-#include "../Commands/CommandObjectPlugin.h"
-#include "../Commands/CommandObjectProcess.h"
-#include "../Commands/CommandObjectQuit.h"
-#include "../Commands/CommandObjectRegister.h"
-#include "../Commands/CommandObjectSettings.h"
-#include "../Commands/CommandObjectSource.h"
-#include "../Commands/CommandObjectSyntax.h"
-#include "../Commands/CommandObjectTarget.h"
-#include "../Commands/CommandObjectThread.h"
-#include "../Commands/CommandObjectType.h"
-#include "../Commands/CommandObjectVersion.h"
-#include "../Commands/CommandObjectWatchpoint.h"
+#include "Commands/CommandObjectApropos.h"
+#include "Commands/CommandObjectBreakpoint.h"
+#include "Commands/CommandObjectBugreport.h"
+#include "Commands/CommandObjectCommands.h"
+#include "Commands/CommandObjectDisassemble.h"
+#include "Commands/CommandObjectExpression.h"
+#include "Commands/CommandObjectFrame.h"
+#include "Commands/CommandObjectGUI.h"
+#include "Commands/CommandObjectHelp.h"
+#include "Commands/CommandObjectLanguage.h"
+#include "Commands/CommandObjectLog.h"
+#include "Commands/CommandObjectMemory.h"
+#include "Commands/CommandObjectPlatform.h"
+#include "Commands/CommandObjectPlugin.h"
+#include "Commands/CommandObjectProcess.h"
+#include "Commands/CommandObjectQuit.h"
+#include "Commands/CommandObjectRegister.h"
+#include "Commands/CommandObjectSettings.h"
+#include "Commands/CommandObjectSource.h"
+#include "Commands/CommandObjectStats.h"
+#include "Commands/CommandObjectTarget.h"
+#include "Commands/CommandObjectThread.h"
+#include "Commands/CommandObjectType.h"
+#include "Commands/CommandObjectVersion.h"
+#include "Commands/CommandObjectWatchpoint.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
@@ -55,20 +54,18 @@
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Interpreter/Property.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Target/Thread.h"
-#include "lldb/Utility/CleanUp.h"
-
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/Support/Path.h"
@@ -147,6 +144,26 @@ void CommandInterpreter::SetPromptOnQuit(bool b) {
m_collection_sp->SetPropertyAtIndexAsBoolean(nullptr, idx, b);
}
+void CommandInterpreter::AllowExitCodeOnQuit(bool allow) {
+ m_allow_exit_code = allow;
+ if (!allow)
+ m_quit_exit_code.reset();
+}
+
+bool CommandInterpreter::SetQuitExitCode(int exit_code) {
+ if (!m_allow_exit_code)
+ return false;
+ m_quit_exit_code = exit_code;
+ return true;
+}
+
+int CommandInterpreter::GetQuitExitCode(bool &exited) const {
+ exited = m_quit_exit_code.hasValue();
+ if (exited)
+ return *m_quit_exit_code;
+ return 0;
+}
+
void CommandInterpreter::ResolveCommand(const char *command_line,
CommandReturnObject &result) {
std::string command = command_line;
@@ -428,6 +445,7 @@ void CommandInterpreter::LoadCommandDictionary() {
CommandObjectSP(new CommandObjectMultiwordSettings(*this));
m_command_dict["source"] =
CommandObjectSP(new CommandObjectMultiwordSource(*this));
+ m_command_dict["statistics"] = CommandObjectSP(new CommandObjectStats(*this));
m_command_dict["target"] =
CommandObjectSP(new CommandObjectMultiwordTarget(*this));
m_command_dict["thread"] =
@@ -545,7 +563,7 @@ void CommandInterpreter::LoadCommandDictionary() {
// sure to increase the size of this buffer.
char buffer[1024];
int num_printed =
- snprintf(buffer, 1024, "%s %s", break_regexes[i][1], "-o");
+ snprintf(buffer, 1024, "%s %s", break_regexes[i][1], "-o 1");
lldbassert(num_printed < 1024);
UNUSED_IF_ASSERT_DISABLED(num_printed);
success =
@@ -683,10 +701,9 @@ void CommandInterpreter::LoadCommandDictionary() {
"bt [<digit> | all]", 2, 0, false));
if (bt_regex_cmd_ap.get()) {
// accept but don't document "bt -c <number>" -- before bt was a regex
- // command if you wanted to backtrace
- // three frames you would do "bt -c 3" but the intention is to have this
- // emulate the gdb "bt" command and
- // so now "bt 3" is the preferred form, in line with gdb.
+ // command if you wanted to backtrace three frames you would do "bt -c 3"
+ // but the intention is to have this emulate the gdb "bt" command and so
+ // now "bt 3" is the preferred form, in line with gdb.
if (bt_regex_cmd_ap->AddRegexCommand("^([[:digit:]]+)$",
"thread backtrace -c %1") &&
bt_regex_cmd_ap->AddRegexCommand("^-c ([[:digit:]]+)$",
@@ -827,9 +844,8 @@ CommandObjectSP CommandInterpreter::GetCommandSP(llvm::StringRef cmd_str,
unsigned int num_user_matches = 0;
// Look through the command dictionaries one by one, and if we get only one
- // match from any of
- // them in toto, then return that, otherwise return an empty CommandObjectSP
- // and the list of matches.
+ // match from any of them in toto, then return that, otherwise return an
+ // empty CommandObjectSP and the list of matches.
if (HasCommands()) {
num_cmd_matches =
@@ -955,10 +971,9 @@ CommandObjectSP CommandInterpreter::GetCommandSPExact(llvm::StringRef cmd_str,
CommandObjectSP cmd_obj_sp = GetCommandSP(llvm::StringRef(cmd_words.GetArgumentAtIndex(0)),
include_aliases, true, nullptr);
if (cmd_obj_sp.get() != nullptr) {
- // Loop through the rest of the words in the command (everything passed in
- // was supposed to be part of a
- // command name), and find the appropriate sub-command SP for each command
- // word....
+ // Loop through the rest of the words in the command (everything passed
+ // in was supposed to be part of a command name), and find the
+ // appropriate sub-command SP for each command word....
size_t end = cmd_words.GetArgumentCount();
for (size_t j = 1; j < end; ++j) {
if (cmd_obj_sp->IsMultiwordObject()) {
@@ -988,8 +1003,7 @@ CommandObject *CommandInterpreter::GetCommandObject(llvm::StringRef cmd_str,
GetCommandSP(cmd_str, false, true, matches).get();
// If we didn't find an exact match to the command string in the commands,
- // look in
- // the aliases.
+ // look in the aliases.
if (command_obj)
return command_obj;
@@ -1004,8 +1018,7 @@ CommandObject *CommandInterpreter::GetCommandObject(llvm::StringRef cmd_str,
command_obj = GetCommandSP(cmd_str, false, false, nullptr).get();
// Finally, if there wasn't an inexact match among the commands, look for an
- // inexact
- // match in both the commands and aliases.
+ // inexact match in both the commands and aliases.
if (command_obj) {
if (matches)
@@ -1168,8 +1181,8 @@ void CommandInterpreter::GetHelp(CommandReturnObject &result,
CommandObject *CommandInterpreter::GetCommandObjectForCommand(
llvm::StringRef &command_string) {
// This function finds the final, lowest-level, alias-resolved command object
- // whose 'Execute' function will
- // eventually be invoked by the given command line.
+ // whose 'Execute' function will eventually be invoked by the given command
+ // line.
CommandObject *cmd_obj = nullptr;
size_t start = command_string.find_first_not_of(k_white_space);
@@ -1240,8 +1253,8 @@ static size_t FindArgumentTerminator(const std::string &s) {
break;
if (pos > 0) {
if (isspace(s[pos - 1])) {
- // Check if the string ends "\s--" (where \s is a space character)
- // or if we have "\s--\s".
+ // Check if the string ends "\s--" (where \s is a space character) or
+ // if we have "\s--\s".
if ((pos + 2 >= s_len) || isspace(s[pos + 2])) {
return pos;
}
@@ -1376,20 +1389,19 @@ CommandObject *CommandInterpreter::BuildAliasResult(
}
Status CommandInterpreter::PreprocessCommand(std::string &command) {
- // The command preprocessor needs to do things to the command
- // line before any parsing of arguments or anything else is done.
- // The only current stuff that gets preprocessed is anything enclosed
- // in backtick ('`') characters is evaluated as an expression and
- // the result of the expression must be a scalar that can be substituted
- // into the command. An example would be:
+ // The command preprocessor needs to do things to the command line before any
+ // parsing of arguments or anything else is done. The only current stuff that
+ // gets preprocessed is anything enclosed in backtick ('`') characters is
+ // evaluated as an expression and the result of the expression must be a
+ // scalar that can be substituted into the command. An example would be:
// (lldb) memory read `$rsp + 20`
Status error; // Status for any expressions that might not evaluate
size_t start_backtick;
size_t pos = 0;
while ((start_backtick = command.find('`', pos)) != std::string::npos) {
if (start_backtick > 0 && command[start_backtick - 1] == '\\') {
- // The backtick was preceded by a '\' character, remove the slash
- // and don't treat the backtick as the start of an expression
+ // The backtick was preceded by a '\' character, remove the slash and
+ // don't treat the backtick as the start of an expression
command.erase(start_backtick - 1, 1);
// No need to add one to start_backtick since we just deleted a char
pos = start_backtick;
@@ -1408,8 +1420,8 @@ Status CommandInterpreter::PreprocessCommand(std::string &command) {
ExecutionContext exe_ctx(GetExecutionContext());
Target *target = exe_ctx.GetTargetPtr();
// Get a dummy target to allow for calculator mode while processing
- // backticks.
- // This also helps break the infinite loop caused when target is null.
+ // backticks. This also helps break the infinite loop caused when
+ // target is null.
if (!target)
target = m_debugger.GetDummyTarget();
if (target) {
@@ -1561,8 +1573,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
const char *k_space_characters = "\t\n\v\f\r ";
size_t non_space = command_string.find_first_not_of(k_space_characters);
- // Check for empty line or comment line (lines whose first
- // non-space character is the comment character for this interpreter)
+ // Check for empty line or comment line (lines whose first non-space
+ // character is the comment character for this interpreter)
if (non_space == std::string::npos)
empty_command = true;
else if (command_string[non_space] == m_comment_char)
@@ -1635,8 +1647,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
CommandObject *cmd_obj = ResolveCommandImpl(command_string, result);
// Although the user may have abbreviated the command, the command_string now
- // has the command expanded to the full name. For example, if the input
- // was "br s -n main", command_string is now "breakpoint set -n main".
+ // has the command expanded to the full name. For example, if the input was
+ // "br s -n main", command_string is now "breakpoint set -n main".
if (log) {
llvm::StringRef command_name = cmd_obj ? cmd_obj->GetCommandName() : "<not found>";
log->Printf("HandleCommand, cmd_obj : '%s'", command_name.str().c_str());
@@ -1650,8 +1662,8 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
// Phase 2.
// Take care of things like setting up the history command & calling the
- // appropriate Execute method on the
- // CommandObject, with the appropriate arguments.
+ // appropriate Execute method on the CommandObject, with the appropriate
+ // arguments.
if (cmd_obj != nullptr) {
if (add_to_history) {
@@ -1681,36 +1693,6 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
remainder.c_str());
cmd_obj->Execute(remainder.c_str(), result);
- } else {
- // We didn't find the first command object, so complete the first argument.
- Args command_args(command_string);
- StringList matches;
- int num_matches;
- int cursor_index = 0;
- int cursor_char_position = strlen(command_args.GetArgumentAtIndex(0));
- bool word_complete;
- num_matches = HandleCompletionMatches(command_args, cursor_index,
- cursor_char_position, 0, -1,
- word_complete, matches);
-
- if (num_matches > 0) {
- std::string error_msg;
- error_msg.assign("ambiguous command '");
- error_msg.append(command_args.GetArgumentAtIndex(0));
- error_msg.append("'.");
-
- error_msg.append(" Possible completions:");
- for (int i = 0; i < num_matches; i++) {
- error_msg.append("\n\t");
- error_msg.append(matches.GetStringAtIndex(i));
- }
- error_msg.append("\n");
- result.AppendRawError(error_msg.c_str());
- } else
- result.AppendErrorWithFormat("Unrecognized command '%s'.\n",
- command_args.GetArgumentAtIndex(0));
-
- result.SetStatus(eReturnStatusFailed);
}
if (log)
@@ -1720,60 +1702,55 @@ bool CommandInterpreter::HandleCommand(const char *command_line,
return result.Succeeded();
}
-int CommandInterpreter::HandleCompletionMatches(
- Args &parsed_line, int &cursor_index, int &cursor_char_position,
- int match_start_point, int max_return_elements, bool &word_complete,
- StringList &matches) {
+int CommandInterpreter::HandleCompletionMatches(CompletionRequest &request) {
+ auto &matches = request.GetMatches();
int num_command_matches = 0;
bool look_for_subcommand = false;
// For any of the command completions a unique match will be a complete word.
- word_complete = true;
+ request.SetWordComplete(true);
- if (cursor_index == -1) {
+ if (request.GetCursorIndex() == -1) {
// We got nothing on the command line, so return the list of commands
bool include_aliases = true;
num_command_matches =
GetCommandNamesMatchingPartialString("", include_aliases, matches);
- } else if (cursor_index == 0) {
+ } else if (request.GetCursorIndex() == 0) {
// The cursor is in the first argument, so just do a lookup in the
// dictionary.
- CommandObject *cmd_obj =
- GetCommandObject(parsed_line.GetArgumentAtIndex(0), &matches);
+ CommandObject *cmd_obj = GetCommandObject(
+ request.GetParsedLine().GetArgumentAtIndex(0), &matches);
num_command_matches = matches.GetSize();
if (num_command_matches == 1 && cmd_obj && cmd_obj->IsMultiwordObject() &&
matches.GetStringAtIndex(0) != nullptr &&
- strcmp(parsed_line.GetArgumentAtIndex(0),
+ strcmp(request.GetParsedLine().GetArgumentAtIndex(0),
matches.GetStringAtIndex(0)) == 0) {
- if (parsed_line.GetArgumentCount() == 1) {
- word_complete = true;
+ if (request.GetParsedLine().GetArgumentCount() == 1) {
+ request.SetWordComplete(true);
} else {
look_for_subcommand = true;
num_command_matches = 0;
matches.DeleteStringAtIndex(0);
- parsed_line.AppendArgument(llvm::StringRef());
- cursor_index++;
- cursor_char_position = 0;
+ request.GetParsedLine().AppendArgument(llvm::StringRef());
+ request.SetCursorIndex(request.GetCursorIndex() + 1);
+ request.SetCursorCharPosition(0);
}
}
}
- if (cursor_index > 0 || look_for_subcommand) {
+ if (request.GetCursorIndex() > 0 || look_for_subcommand) {
// We are completing further on into a commands arguments, so find the
- // command and tell it
- // to complete the command.
- // First see if there is a matching initial command:
+ // command and tell it to complete the command. First see if there is a
+ // matching initial command:
CommandObject *command_object =
- GetCommandObject(parsed_line.GetArgumentAtIndex(0));
+ GetCommandObject(request.GetParsedLine().GetArgumentAtIndex(0));
if (command_object == nullptr) {
return 0;
} else {
- parsed_line.Shift();
- cursor_index--;
- num_command_matches = command_object->HandleCompletion(
- parsed_line, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+ request.GetParsedLine().Shift();
+ request.SetCursorIndex(request.GetCursorIndex() - 1);
+ num_command_matches = command_object->HandleCompletion(request);
}
}
@@ -1783,106 +1760,59 @@ int CommandInterpreter::HandleCompletionMatches(
int CommandInterpreter::HandleCompletion(
const char *current_line, const char *cursor, const char *last_char,
int match_start_point, int max_return_elements, StringList &matches) {
- // We parse the argument up to the cursor, so the last argument in parsed_line
- // is
- // the one containing the cursor, and the cursor is after the last character.
- Args parsed_line(llvm::StringRef(current_line, last_char - current_line));
- Args partial_parsed_line(
- llvm::StringRef(current_line, cursor - current_line));
+ llvm::StringRef command_line(current_line, last_char - current_line);
+ CompletionRequest request(command_line, cursor - current_line,
+ match_start_point, max_return_elements, matches);
// Don't complete comments, and if the line we are completing is just the
- // history repeat character,
- // substitute the appropriate history line.
- const char *first_arg = parsed_line.GetArgumentAtIndex(0);
+ // history repeat character, substitute the appropriate history line.
+ const char *first_arg = request.GetParsedLine().GetArgumentAtIndex(0);
if (first_arg) {
if (first_arg[0] == m_comment_char)
return 0;
else if (first_arg[0] == CommandHistory::g_repeat_char) {
if (auto hist_str = m_command_history.FindString(first_arg)) {
- matches.Clear();
- matches.InsertStringAtIndex(0, *hist_str);
+ request.GetMatches().Clear();
+ request.GetMatches().InsertStringAtIndex(0, *hist_str);
return -2;
} else
return 0;
}
}
- int num_args = partial_parsed_line.GetArgumentCount();
- int cursor_index = partial_parsed_line.GetArgumentCount() - 1;
- int cursor_char_position;
-
- if (cursor_index == -1)
- cursor_char_position = 0;
- else
- cursor_char_position =
- strlen(partial_parsed_line.GetArgumentAtIndex(cursor_index));
-
- if (cursor > current_line && cursor[-1] == ' ') {
- // We are just after a space. If we are in an argument, then we will
- // continue
- // parsing, but if we are between arguments, then we have to complete
- // whatever the next
- // element would be.
- // We can distinguish the two cases because if we are in an argument (e.g.
- // because the space is
- // protected by a quote) then the space will also be in the parsed
- // argument...
-
- const char *current_elem =
- partial_parsed_line.GetArgumentAtIndex(cursor_index);
- if (cursor_char_position == 0 ||
- current_elem[cursor_char_position - 1] != ' ') {
- parsed_line.InsertArgumentAtIndex(cursor_index + 1, llvm::StringRef(),
- '\0');
- cursor_index++;
- cursor_char_position = 0;
- }
- }
-
- int num_command_matches;
-
- matches.Clear();
-
// Only max_return_elements == -1 is supported at present:
lldbassert(max_return_elements == -1);
- bool word_complete;
- num_command_matches = HandleCompletionMatches(
- parsed_line, cursor_index, cursor_char_position, match_start_point,
- max_return_elements, word_complete, matches);
+
+ int num_command_matches = HandleCompletionMatches(request);
if (num_command_matches <= 0)
return num_command_matches;
- if (num_args == 0) {
+ if (request.GetParsedLine().GetArgumentCount() == 0) {
// If we got an empty string, insert nothing.
matches.InsertStringAtIndex(0, "");
} else {
// Now figure out if there is a common substring, and if so put that in
- // element 0, otherwise
- // put an empty string in element 0.
- std::string command_partial_str;
- if (cursor_index >= 0)
- command_partial_str =
- parsed_line[cursor_index].ref.take_front(cursor_char_position);
+ // element 0, otherwise put an empty string in element 0.
+ std::string command_partial_str = request.GetCursorArgumentPrefix().str();
std::string common_prefix;
matches.LongestCommonPrefix(common_prefix);
const size_t partial_name_len = command_partial_str.size();
common_prefix.erase(0, partial_name_len);
- // If we matched a unique single command, add a space...
- // Only do this if the completer told us this was a complete word,
- // however...
- if (num_command_matches == 1 && word_complete) {
- char quote_char = parsed_line[cursor_index].quote;
+ // If we matched a unique single command, add a space... Only do this if
+ // the completer told us this was a complete word, however...
+ if (num_command_matches == 1 && request.GetWordComplete()) {
+ char quote_char = request.GetParsedLine()[request.GetCursorIndex()].quote;
common_prefix =
Args::EscapeLLDBCommandArgument(common_prefix, quote_char);
if (quote_char != '\0')
common_prefix.push_back(quote_char);
common_prefix.push_back(' ');
}
- matches.InsertStringAtIndex(0, common_prefix.c_str());
+ request.GetMatches().InsertStringAtIndex(0, common_prefix.c_str());
}
return num_command_matches;
}
@@ -1951,8 +1881,8 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj,
if (option_arg_vector_sp.get()) {
if (wants_raw_input) {
// We have a command that both has command options and takes raw input.
- // Make *sure* it has a
- // " -- " in the right place in the raw_input_string.
+ // Make *sure* it has a " -- " in the right place in the
+ // raw_input_string.
size_t pos = raw_input_string.find(" -- ");
if (pos == std::string::npos) {
// None found; assume it goes at the beginning of the raw input string
@@ -2036,10 +1966,9 @@ void CommandInterpreter::BuildAliasCommandArgs(CommandObject *alias_cmd_obj,
} else {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
// This alias was not created with any options; nothing further needs to be
- // done, unless it is a command that
- // wants raw input, in which case we need to clear the rest of the data from
- // cmd_args, since its in the raw
- // input string.
+ // done, unless it is a command that wants raw input, in which case we need
+ // to clear the rest of the data from cmd_args, since its in the raw input
+ // string.
if (wants_raw_input) {
cmd_args.Clear();
cmd_args.SetArguments(new_args.GetArgumentCount(),
@@ -2069,7 +1998,8 @@ int CommandInterpreter::GetOptionArgumentPosition(const char *in_string) {
while (isdigit(cptr[0]))
++cptr;
- // We've gotten to the end of the digits; are we at the end of the string?
+ // We've gotten to the end of the digits; are we at the end of the
+ // string?
if (cptr[0] == '\0')
position = atoi(start);
}
@@ -2117,16 +2047,16 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
return;
}
} else if (should_load == eLoadCWDlldbinitTrue) {
- init_file.SetFile("./.lldbinit", true);
+ init_file.SetFile("./.lldbinit", true, FileSpec::Style::native);
}
}
} else {
- // If we aren't looking in the current working directory we are looking
- // in the home directory. We will first see if there is an application
- // specific ".lldbinit" file whose name is "~/.lldbinit" followed by a
- // "-" and the name of the program. If this file doesn't exist, we fall
- // back to just the "~/.lldbinit" file. We also obey any requests to not
- // load the init files.
+ // If we aren't looking in the current working directory we are looking in
+ // the home directory. We will first see if there is an application
+ // specific ".lldbinit" file whose name is "~/.lldbinit" followed by a "-"
+ // and the name of the program. If this file doesn't exist, we fall back to
+ // just the "~/.lldbinit" file. We also obey any requests to not load the
+ // init files.
llvm::SmallString<64> home_dir_path;
llvm::sys::path::home_directory(home_dir_path);
FileSpec profilePath(home_dir_path.c_str(), false);
@@ -2141,19 +2071,19 @@ void CommandInterpreter::SourceInitFile(bool in_cwd,
char program_init_file_name[PATH_MAX];
::snprintf(program_init_file_name, sizeof(program_init_file_name),
"%s-%s", init_file_path.c_str(), program_name);
- init_file.SetFile(program_init_file_name, true);
+ init_file.SetFile(program_init_file_name, true,
+ FileSpec::Style::native);
if (!init_file.Exists())
init_file.Clear();
}
}
if (!init_file && !m_skip_lldbinit_files)
- init_file.SetFile(init_file_path, false);
+ init_file.SetFile(init_file_path, false, FileSpec::Style::native);
}
// If the file exists, tell HandleCommand to 'source' it; this will do the
- // actual broadcasting
- // of the commands back to any appropriate listener (see
+ // actual broadcasting of the commands back to any appropriate listener (see
// CommandObjectSource::Execute for more details).
if (init_file.Exists()) {
@@ -2199,15 +2129,14 @@ void CommandInterpreter::HandleCommands(const StringList &commands,
size_t num_lines = commands.GetSize();
// If we are going to continue past a "continue" then we need to run the
- // commands synchronously.
- // Make sure you reset this value anywhere you return from the function.
+ // commands synchronously. Make sure you reset this value anywhere you return
+ // from the function.
bool old_async_execution = m_debugger.GetAsyncExecution();
// If we've been given an execution context, set it at the start, but don't
- // keep resetting it or we will
- // cause series of commands that change the context, then do an operation that
- // relies on that context to fail.
+ // keep resetting it or we will cause series of commands that change the
+ // context, then do an operation that relies on that context to fail.
if (override_context != nullptr)
UpdateExecutionContext(override_context);
@@ -2232,9 +2161,8 @@ void CommandInterpreter::HandleCommands(const StringList &commands,
// HandleCommand() since we updated our context already.
// We might call into a regex or alias command, in which case the
- // add_to_history will get lost. This
- // m_command_source_depth dingus is the way we turn off adding to the
- // history in that case, so set it up here.
+ // add_to_history will get lost. This m_command_source_depth dingus is the
+ // way we turn off adding to the history in that case, so set it up here.
if (!options.GetAddToHistory())
m_command_source_depth++;
bool success =
@@ -2275,18 +2203,17 @@ void CommandInterpreter::HandleCommands(const StringList &commands,
if (result.GetImmediateErrorStream())
result.GetImmediateErrorStream()->Flush();
- // N.B. Can't depend on DidChangeProcessState, because the state coming into
- // the command execution
- // could be running (for instance in Breakpoint Commands.
- // So we check the return value to see if it is has running in it.
+ // N.B. Can't depend on DidChangeProcessState, because the state coming
+ // into the command execution could be running (for instance in Breakpoint
+ // Commands. So we check the return value to see if it is has running in
+ // it.
if ((tmp_result.GetStatus() == eReturnStatusSuccessContinuingNoResult) ||
(tmp_result.GetStatus() == eReturnStatusSuccessContinuingResult)) {
if (options.GetStopOnContinue()) {
// If we caused the target to proceed, and we're going to stop in that
- // case, set the
- // status in our real result before returning. This is an error if the
- // continue was not the
- // last command in the set of commands to be run.
+ // case, set the status in our real result before returning. This is
+ // an error if the continue was not the last command in the set of
+ // commands to be run.
if (idx != num_lines - 1)
result.AppendErrorWithFormat(
"Aborting reading of commands after command #%" PRIu64
@@ -2434,8 +2361,8 @@ void CommandInterpreter::HandleCommandsFromFile(
cmd_file_path.c_str());
}
- // Used for inheriting the right settings when "command source" might have
- // nested "command source" commands
+ // Used for inheriting the right settings when "command source" might
+ // have nested "command source" commands
lldb::StreamFileSP empty_stream_sp;
m_command_source_flags.push_back(flags);
IOHandlerSP io_handler_sp(new IOHandlerEditline(
@@ -2748,18 +2675,14 @@ void CommandInterpreter::IOHandlerInputComplete(IOHandler &io_handler,
if (is_interactive == false) {
// When we are not interactive, don't execute blank lines. This will happen
// sourcing a commands file. We don't want blank lines to repeat the
- // previous
- // command and cause any errors to occur (like redefining an alias, get an
- // error
- // and stop parsing the commands file).
+ // previous command and cause any errors to occur (like redefining an
+ // alias, get an error and stop parsing the commands file).
if (line.empty())
return;
// When using a non-interactive file handle (like when sourcing commands
- // from a file)
- // we need to echo the command out so we don't just see the command output
- // and no
- // command...
+ // from a file) we need to echo the command out so we don't just see the
+ // command output and no command...
if (io_handler.GetFlags().Test(eHandleCommandFlagEchoCommand))
io_handler.GetOutputStreamFile()->Printf("%s%s\n", io_handler.GetPrompt(),
line.c_str());
@@ -2916,13 +2839,13 @@ bool CommandInterpreter::IsActive() {
lldb::IOHandlerSP
CommandInterpreter::GetIOHandler(bool force_create,
CommandInterpreterRunOptions *options) {
- // Always re-create the IOHandlerEditline in case the input
- // changed. The old instance might have had a non-interactive
- // input and now it does or vice versa.
+ // Always re-create the IOHandlerEditline in case the input changed. The old
+ // instance might have had a non-interactive input and now it does or vice
+ // versa.
if (force_create || !m_command_io_handler_sp) {
- // Always re-create the IOHandlerEditline in case the input
- // changed. The old instance might have had a non-interactive
- // input and now it does or vice versa.
+ // Always re-create the IOHandlerEditline in case the input changed. The
+ // old instance might have had a non-interactive input and now it does or
+ // vice versa.
uint32_t flags = 0;
if (options) {
@@ -2956,8 +2879,8 @@ CommandInterpreter::GetIOHandler(bool force_create,
void CommandInterpreter::RunCommandInterpreter(
bool auto_handle_events, bool spawn_thread,
CommandInterpreterRunOptions &options) {
- // Always re-create the command interpreter when we run it in case
- // any file handles have changed.
+ // Always re-create the command interpreter when we run it in case any file
+ // handles have changed.
bool force_create = true;
m_debugger.PushIOHandler(GetIOHandler(force_create, &options));
m_stopped_for_crash = false;
@@ -3009,8 +2932,6 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
actual_cmd_name_len = cmd_obj->GetCommandName().size();
}
} else {
- if (!cmd_obj)
- cmd_obj = GetCommandObject(next_word, &matches);
if (cmd_obj) {
llvm::StringRef cmd_name = cmd_obj->GetCommandName();
actual_cmd_name_len += cmd_name.size();
@@ -3025,8 +2946,8 @@ CommandInterpreter::ResolveCommandImpl(std::string &command_line,
CommandObject *sub_cmd_obj =
cmd_obj->GetSubcommandObject(next_word.c_str());
if (sub_cmd_obj) {
- // The subcommand's name includes the parent command's name,
- // so restart rather than append to the revised_command_line.
+ // The subcommand's name includes the parent command's name, so
+ // restart rather than append to the revised_command_line.
llvm::StringRef sub_cmd_name = sub_cmd_obj->GetCommandName();
actual_cmd_name_len = sub_cmd_name.size() + 1;
revised_command_line.Clear();
diff --git a/source/Interpreter/CommandObject.cpp b/source/Interpreter/CommandObject.cpp
index 98a6a941864e..07be9139f219 100644
--- a/source/Interpreter/CommandObject.cpp
+++ b/source/Interpreter/CommandObject.cpp
@@ -90,8 +90,8 @@ void CommandObject::SetHelpLong(llvm::StringRef str) { m_cmd_help_long = str; }
void CommandObject::SetSyntax(llvm::StringRef str) { m_cmd_syntax = str; }
Options *CommandObject::GetOptions() {
- // By default commands don't have options unless this virtual function
- // is overridden by base classes.
+ // By default commands don't have options unless this virtual function is
+ // overridden by base classes.
return nullptr;
}
@@ -104,20 +104,16 @@ bool CommandObject::ParseOptions(Args &args, CommandReturnObject &result) {
auto exe_ctx = GetCommandInterpreter().GetExecutionContext();
options->NotifyOptionParsingStarting(&exe_ctx);
- // ParseOptions calls getopt_long_only, which always skips the zero'th item
- // in the array and starts at position 1,
- // so we need to push a dummy value into position zero.
- args.Unshift(llvm::StringRef("dummy_string"));
const bool require_validation = true;
- error = args.ParseOptions(*options, &exe_ctx,
- GetCommandInterpreter().GetPlatform(true),
- require_validation);
+ llvm::Expected<Args> args_or = options->Parse(
+ args, &exe_ctx, GetCommandInterpreter().GetPlatform(true),
+ require_validation);
- // The "dummy_string" will have already been removed by ParseOptions,
- // so no need to remove it.
-
- if (error.Success())
+ if (args_or) {
+ args = std::move(*args_or);
error = options->NotifyOptionParsingFinished(&exe_ctx);
+ } else
+ error = args_or.takeError();
if (error.Success()) {
if (options->VerifyOptions(result))
@@ -142,10 +138,10 @@ bool CommandObject::ParseOptions(Args &args, CommandReturnObject &result) {
bool CommandObject::CheckRequirements(CommandReturnObject &result) {
#ifdef LLDB_CONFIGURATION_DEBUG
- // Nothing should be stored in m_exe_ctx between running commands as m_exe_ctx
- // has shared pointers to the target, process, thread and frame and we don't
- // want any CommandObject instances to keep any of these objects around
- // longer than for a single command. Every command should call
+ // Nothing should be stored in m_exe_ctx between running commands as
+ // m_exe_ctx has shared pointers to the target, process, thread and frame and
+ // we don't want any CommandObject instances to keep any of these objects
+ // around longer than for a single command. Every command should call
// CommandObject::Cleanup() after it has completed
assert(m_exe_ctx.GetTargetPtr() == NULL);
assert(m_exe_ctx.GetProcessPtr() == NULL);
@@ -153,9 +149,9 @@ bool CommandObject::CheckRequirements(CommandReturnObject &result) {
assert(m_exe_ctx.GetFramePtr() == NULL);
#endif
- // Lock down the interpreter's execution context prior to running the
- // command so we guarantee the selected target, process, thread and frame
- // can't go away during the execution
+ // Lock down the interpreter's execution context prior to running the command
+ // so we guarantee the selected target, process, thread and frame can't go
+ // away during the execution
m_exe_ctx = m_interpreter.GetExecutionContext();
const uint32_t flags = GetFlags().Get();
@@ -264,19 +260,14 @@ void CommandObject::Cleanup() {
m_api_locker.unlock();
}
-int CommandObject::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements,
- bool &word_complete, StringList &matches) {
+int CommandObject::HandleCompletion(CompletionRequest &request) {
// Default implementation of WantsCompletion() is !WantsRawCommandString().
- // Subclasses who want raw command string but desire, for example,
- // argument completion should override WantsCompletion() to return true,
- // instead.
+ // Subclasses who want raw command string but desire, for example, argument
+ // completion should override WantsCompletion() to return true, instead.
if (WantsRawCommandString() && !WantsCompletion()) {
// FIXME: Abstract telling the completion to insert the completion
// character.
- matches.Clear();
+ request.GetMatches().Clear();
return -1;
} else {
// Can we do anything generic with the options?
@@ -285,34 +276,17 @@ int CommandObject::HandleCompletion(Args &input, int &cursor_index,
OptionElementVector opt_element_vector;
if (cur_options != nullptr) {
- // Re-insert the dummy command name string which will have been
- // stripped off:
- input.Unshift(llvm::StringRef("dummy-string"));
- cursor_index++;
-
- // I stick an element on the end of the input, because if the last element
- // is option that requires an argument, getopt_long_only will freak out.
-
- input.AppendArgument(llvm::StringRef("<FAKE-VALUE>"));
-
- input.ParseArgsForCompletion(*cur_options, opt_element_vector,
- cursor_index);
+ opt_element_vector = cur_options->ParseForCompletion(
+ request.GetParsedLine(), request.GetCursorIndex());
- input.DeleteArgumentAtIndex(input.GetArgumentCount() - 1);
-
- bool handled_by_options;
- handled_by_options = cur_options->HandleOptionCompletion(
- input, opt_element_vector, cursor_index, cursor_char_position,
- match_start_point, max_return_elements, GetCommandInterpreter(),
- word_complete, matches);
+ bool handled_by_options = cur_options->HandleOptionCompletion(
+ request, opt_element_vector, GetCommandInterpreter());
if (handled_by_options)
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
// If we got here, the last word is not an option or an option argument.
- return HandleArgumentCompletion(
- input, cursor_index, cursor_char_position, opt_element_vector,
- match_start_point, max_return_elements, word_complete, matches);
+ return HandleArgumentCompletion(request, opt_element_vector);
}
}
@@ -351,6 +325,22 @@ bool CommandObject::HelpTextContainsWord(llvm::StringRef search_word,
return found_word;
}
+bool CommandObject::ParseOptionsAndNotify(Args &args,
+ CommandReturnObject &result,
+ OptionGroupOptions &group_options,
+ ExecutionContext &exe_ctx) {
+ if (!ParseOptions(args, result))
+ return false;
+
+ Status error(group_options.NotifyOptionParsingFinished(&exe_ctx));
+ if (error.Fail()) {
+ result.AppendError(error.AsCString());
+ result.SetStatus(eReturnStatusFailed);
+ return false;
+ }
+ return true;
+}
+
int CommandObject::GetNumArgumentEntries() { return m_arguments.size(); }
CommandObject::CommandArgumentEntry *
@@ -441,9 +431,10 @@ OptSetFiltered(uint32_t opt_set_mask,
return ret_val;
}
-// Default parameter value of opt_set_mask is LLDB_OPT_SET_ALL, which means take
-// all the argument data into account. On rare cases where some argument sticks
-// with certain option sets, this function returns the option set filtered args.
+// Default parameter value of opt_set_mask is LLDB_OPT_SET_ALL, which means
+// take all the argument data into account. On rare cases where some argument
+// sticks with certain option sets, this function returns the option set
+// filtered args.
void CommandObject::GetFormattedCommandArguments(Stream &str,
uint32_t opt_set_mask) {
int num_args = m_arguments.size();
@@ -483,8 +474,7 @@ void CommandObject::GetFormattedCommandArguments(Stream &str,
first_name, second_name);
break;
// Explicitly test for all the rest of the cases, so if new types get
- // added we will notice the
- // missing case statement(s).
+ // added we will notice the missing case statement(s).
case eArgRepeatPlain:
case eArgRepeatOptional:
case eArgRepeatPlus:
@@ -520,8 +510,7 @@ void CommandObject::GetFormattedCommandArguments(Stream &str,
str.Printf("<%s_1> .. <%s_n>", name_str.c_str(), name_str.c_str());
break;
// Explicitly test for all the rest of the cases, so if new types get
- // added we will notice the
- // missing case statement(s).
+ // added we will notice the missing case statement(s).
case eArgRepeatPairPlain:
case eArgRepeatPairOptional:
case eArgRepeatPairPlus:
@@ -529,8 +518,8 @@ void CommandObject::GetFormattedCommandArguments(Stream &str,
case eArgRepeatPairRange:
case eArgRepeatPairRangeOptional:
// These should not be hit, as they should pass the IsPairType test
- // above, and control should
- // have gone into the other branch of the if statement.
+ // above, and control should have gone into the other branch of the if
+ // statement.
break;
}
}
@@ -874,9 +863,8 @@ void CommandObject::GenerateHelpText(Stream &output_strm) {
if (!IsDashDashCommand() && options && options->NumCommandOptions() > 0) {
if (WantsRawCommandString() && !WantsCompletion()) {
// Emit the message about using ' -- ' between the end of the command
- // options and the raw input
- // conditionally, i.e., only if the command object does not want
- // completion.
+ // options and the raw input conditionally, i.e., only if the command
+ // object does not want completion.
interpreter.OutputFormattedHelpText(
output_strm, "", "",
"\nImportant Note: Because this command takes 'raw' input, if you "
@@ -916,8 +904,8 @@ void CommandObject::AddIDsArgumentData(CommandArgumentEntry &arg,
id_range_arg.arg_repetition = eArgRepeatOptional;
// The first (and only) argument for this command could be either an id or an
- // id_range.
- // Push both variants into the entry for the first argument for this command.
+ // id_range. Push both variants into the entry for the first argument for
+ // this command.
arg.push_back(id_arg);
arg.push_back(id_range_arg);
}
@@ -1021,7 +1009,8 @@ static llvm::StringRef arch_helper() {
static StreamString g_archs_help;
if (g_archs_help.Empty()) {
StringList archs;
- ArchSpec::AutoComplete(llvm::StringRef(), archs);
+
+ ArchSpec::ListSupportedArchNames(archs);
g_archs_help.Printf("These are the supported architecture names:\n");
archs.Join("\n", g_archs_help);
}
diff --git a/source/Interpreter/CommandObjectRegexCommand.cpp b/source/Interpreter/CommandObjectRegexCommand.cpp
index 79d3bb1b5bee..f975c0eea2ee 100644
--- a/source/Interpreter/CommandObjectRegexCommand.cpp
+++ b/source/Interpreter/CommandObjectRegexCommand.cpp
@@ -35,53 +35,47 @@ CommandObjectRegexCommand::CommandObjectRegexCommand(
//----------------------------------------------------------------------
CommandObjectRegexCommand::~CommandObjectRegexCommand() {}
-bool CommandObjectRegexCommand::DoExecute(const char *command,
+bool CommandObjectRegexCommand::DoExecute(llvm::StringRef command,
CommandReturnObject &result) {
- if (command) {
- EntryCollection::const_iterator pos, end = m_entries.end();
- for (pos = m_entries.begin(); pos != end; ++pos) {
- RegularExpression::Match regex_match(m_max_matches);
+ EntryCollection::const_iterator pos, end = m_entries.end();
+ for (pos = m_entries.begin(); pos != end; ++pos) {
+ RegularExpression::Match regex_match(m_max_matches);
- if (pos->regex.Execute(command, &regex_match)) {
- std::string new_command(pos->command);
- std::string match_str;
- char percent_var[8];
- size_t idx, percent_var_idx;
- for (uint32_t match_idx = 1; match_idx <= m_max_matches; ++match_idx) {
- if (regex_match.GetMatchAtIndex(command, match_idx, match_str)) {
- const int percent_var_len =
- ::snprintf(percent_var, sizeof(percent_var), "%%%u", match_idx);
- for (idx = 0; (percent_var_idx = new_command.find(
- percent_var, idx)) != std::string::npos;) {
- new_command.erase(percent_var_idx, percent_var_len);
- new_command.insert(percent_var_idx, match_str);
- idx += percent_var_idx + match_str.size();
- }
+ if (pos->regex.Execute(command, &regex_match)) {
+ std::string new_command(pos->command);
+ std::string match_str;
+ char percent_var[8];
+ size_t idx, percent_var_idx;
+ for (uint32_t match_idx = 1; match_idx <= m_max_matches; ++match_idx) {
+ if (regex_match.GetMatchAtIndex(command, match_idx, match_str)) {
+ const int percent_var_len =
+ ::snprintf(percent_var, sizeof(percent_var), "%%%u", match_idx);
+ for (idx = 0; (percent_var_idx = new_command.find(
+ percent_var, idx)) != std::string::npos;) {
+ new_command.erase(percent_var_idx, percent_var_len);
+ new_command.insert(percent_var_idx, match_str);
+ idx += percent_var_idx + match_str.size();
}
}
- // Interpret the new command and return this as the result!
- if (m_interpreter.GetExpandRegexAliases())
- result.GetOutputStream().Printf("%s\n", new_command.c_str());
- // Pass in true for "no context switching". The command that called us
- // should have set up the context
- // appropriately, we shouldn't have to redo that.
- return m_interpreter.HandleCommand(new_command.c_str(),
- eLazyBoolCalculate, result, nullptr,
- true, true);
}
+ // Interpret the new command and return this as the result!
+ if (m_interpreter.GetExpandRegexAliases())
+ result.GetOutputStream().Printf("%s\n", new_command.c_str());
+ // Pass in true for "no context switching". The command that called us
+ // should have set up the context appropriately, we shouldn't have to
+ // redo that.
+ return m_interpreter.HandleCommand(
+ new_command.c_str(), eLazyBoolCalculate, result, nullptr, true, true);
}
- result.SetStatus(eReturnStatusFailed);
- if (!GetSyntax().empty())
- result.AppendError(GetSyntax());
- else
- result.AppendErrorWithFormat("Command contents '%s' failed to match any "
- "regular expression in the '%s' regex "
- "command.\n",
- command, m_cmd_name.c_str());
- return false;
}
- result.AppendError("empty command passed to regular expression command");
result.SetStatus(eReturnStatusFailed);
+ if (!GetSyntax().empty())
+ result.AppendError(GetSyntax());
+ else
+ result.GetOutputStream() << "Command contents '" << command
+ << "' failed to match any "
+ "regular expression in the '"
+ << m_cmd_name << "' regex ";
return false;
}
@@ -99,23 +93,14 @@ bool CommandObjectRegexCommand::AddRegexCommand(const char *re_cstr,
return false;
}
-int CommandObjectRegexCommand::HandleCompletion(Args &input, int &cursor_index,
- int &cursor_char_position,
- int match_start_point,
- int max_return_elements,
- bool &word_complete,
- StringList &matches) {
+int CommandObjectRegexCommand::HandleCompletion(CompletionRequest &request) {
if (m_completion_type_mask) {
- std::string completion_str(input.GetArgumentAtIndex(cursor_index),
- cursor_char_position);
CommandCompletions::InvokeCommonCompletionCallbacks(
- GetCommandInterpreter(), m_completion_type_mask, completion_str.c_str(),
- match_start_point, max_return_elements, nullptr, word_complete,
- matches);
- return matches.GetSize();
+ GetCommandInterpreter(), m_completion_type_mask, request, nullptr);
+ return request.GetMatches().GetSize();
} else {
- matches.Clear();
- word_complete = false;
+ request.GetMatches().Clear();
+ request.SetWordComplete(false);
}
return 0;
}
diff --git a/source/Interpreter/CommandObjectScript.cpp b/source/Interpreter/CommandObjectScript.cpp
index 0891298c5ac0..fa1516df60c9 100644
--- a/source/Interpreter/CommandObjectScript.cpp
+++ b/source/Interpreter/CommandObjectScript.cpp
@@ -18,10 +18,10 @@
#include "lldb/DataFormatters/DataVisualization.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/ScriptInterpreter.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -40,7 +40,7 @@ CommandObjectScript::CommandObjectScript(CommandInterpreter &interpreter,
CommandObjectScript::~CommandObjectScript() {}
-bool CommandObjectScript::DoExecute(const char *command,
+bool CommandObjectScript::DoExecute(llvm::StringRef command,
CommandReturnObject &result) {
#ifdef LLDB_DISABLE_PYTHON
// if we ever support languages other than Python this simple #ifdef won't
@@ -69,7 +69,7 @@ bool CommandObjectScript::DoExecute(const char *command,
// for formatting.. make sure we keep up to
// date with it
- if (command == nullptr || command[0] == '\0') {
+ if (command.empty()) {
script_interpreter->ExecuteInterpreterLoop();
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return result.Succeeded();
diff --git a/source/Interpreter/CommandObjectScript.h b/source/Interpreter/CommandObjectScript.h
index 2c05ca9468d8..7a61b06e5b04 100644
--- a/source/Interpreter/CommandObjectScript.h
+++ b/source/Interpreter/CommandObjectScript.h
@@ -30,7 +30,7 @@ public:
~CommandObjectScript() override;
protected:
- bool DoExecute(const char *command, CommandReturnObject &result) override;
+ bool DoExecute(llvm::StringRef command, CommandReturnObject &result) override;
};
} // namespace lldb_private
diff --git a/source/Interpreter/CommandReturnObject.cpp b/source/Interpreter/CommandReturnObject.cpp
index 75c02588066c..7c06e22c3909 100644
--- a/source/Interpreter/CommandReturnObject.cpp
+++ b/source/Interpreter/CommandReturnObject.cpp
@@ -25,8 +25,8 @@ static void DumpStringToStreamWithNewline(Stream &strm, const std::string &s,
if (s.empty()) {
add_newline = add_newline_if_empty;
} else {
- // We already checked for empty above, now make sure there is a newline
- // in the error, and if there isn't one, add one.
+ // We already checked for empty above, now make sure there is a newline in
+ // the error, and if there isn't one, add one.
strm.Write(s.c_str(), s.size());
const char last_char = *s.rbegin();
@@ -127,8 +127,8 @@ void CommandReturnObject::SetError(llvm::StringRef error_str) {
SetStatus(eReturnStatusFailed);
}
-// Similar to AppendError, but do not prepend 'Status: ' to message, and
-// don't append "\n" to the end of it.
+// Similar to AppendError, but do not prepend 'Status: ' to message, and don't
+// append "\n" to the end of it.
void CommandReturnObject::AppendRawError(llvm::StringRef in_string) {
if (in_string.empty())
diff --git a/source/Interpreter/OptionArgParser.cpp b/source/Interpreter/OptionArgParser.cpp
new file mode 100644
index 000000000000..3bd3af8fc50e
--- /dev/null
+++ b/source/Interpreter/OptionArgParser.cpp
@@ -0,0 +1,253 @@
+//===-- OptionArgParser.cpp -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Interpreter/OptionArgParser.h"
+#include "lldb/DataFormatters/FormatManager.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Utility/Status.h"
+#include "lldb/Utility/StreamString.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+bool OptionArgParser::ToBoolean(llvm::StringRef ref, bool fail_value,
+ bool *success_ptr) {
+ if (success_ptr)
+ *success_ptr = true;
+ ref = ref.trim();
+ if (ref.equals_lower("false") || ref.equals_lower("off") ||
+ ref.equals_lower("no") || ref.equals_lower("0")) {
+ return false;
+ } else if (ref.equals_lower("true") || ref.equals_lower("on") ||
+ ref.equals_lower("yes") || ref.equals_lower("1")) {
+ return true;
+ }
+ if (success_ptr)
+ *success_ptr = false;
+ return fail_value;
+}
+
+char OptionArgParser::ToChar(llvm::StringRef s, char fail_value,
+ bool *success_ptr) {
+ if (success_ptr)
+ *success_ptr = false;
+ if (s.size() != 1)
+ return fail_value;
+
+ if (success_ptr)
+ *success_ptr = true;
+ return s[0];
+}
+
+int64_t OptionArgParser::ToOptionEnum(llvm::StringRef s,
+ OptionEnumValueElement *enum_values,
+ int32_t fail_value, Status &error) {
+ error.Clear();
+ if (!enum_values) {
+ error.SetErrorString("invalid enumeration argument");
+ return fail_value;
+ }
+
+ if (s.empty()) {
+ error.SetErrorString("empty enumeration string");
+ return fail_value;
+ }
+
+ for (int i = 0; enum_values[i].string_value != nullptr; i++) {
+ llvm::StringRef this_enum(enum_values[i].string_value);
+ if (this_enum.startswith(s))
+ return enum_values[i].value;
+ }
+
+ StreamString strm;
+ strm.PutCString("invalid enumeration value, valid values are: ");
+ for (int i = 0; enum_values[i].string_value != nullptr; i++) {
+ strm.Printf("%s\"%s\"", i > 0 ? ", " : "", enum_values[i].string_value);
+ }
+ error.SetErrorString(strm.GetString());
+ return fail_value;
+}
+
+Status OptionArgParser::ToFormat(const char *s, lldb::Format &format,
+ size_t *byte_size_ptr) {
+ format = eFormatInvalid;
+ Status error;
+
+ if (s && s[0]) {
+ if (byte_size_ptr) {
+ if (isdigit(s[0])) {
+ char *format_char = nullptr;
+ unsigned long byte_size = ::strtoul(s, &format_char, 0);
+ if (byte_size != ULONG_MAX)
+ *byte_size_ptr = byte_size;
+ s = format_char;
+ } else
+ *byte_size_ptr = 0;
+ }
+
+ const bool partial_match_ok = true;
+ if (!FormatManager::GetFormatFromCString(s, partial_match_ok, format)) {
+ StreamString error_strm;
+ error_strm.Printf(
+ "Invalid format character or name '%s'. Valid values are:\n", s);
+ for (Format f = eFormatDefault; f < kNumFormats; f = Format(f + 1)) {
+ char format_char = FormatManager::GetFormatAsFormatChar(f);
+ if (format_char)
+ error_strm.Printf("'%c' or ", format_char);
+
+ error_strm.Printf("\"%s\"", FormatManager::GetFormatAsCString(f));
+ error_strm.EOL();
+ }
+
+ if (byte_size_ptr)
+ error_strm.PutCString(
+ "An optional byte size can precede the format character.\n");
+ error.SetErrorString(error_strm.GetString());
+ }
+
+ if (error.Fail())
+ return error;
+ } else {
+ error.SetErrorStringWithFormat("%s option string", s ? "empty" : "invalid");
+ }
+ return error;
+}
+
+lldb::ScriptLanguage OptionArgParser::ToScriptLanguage(
+ llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr) {
+ if (success_ptr)
+ *success_ptr = true;
+
+ if (s.equals_lower("python"))
+ return eScriptLanguagePython;
+ if (s.equals_lower("default"))
+ return eScriptLanguageDefault;
+ if (s.equals_lower("none"))
+ return eScriptLanguageNone;
+
+ if (success_ptr)
+ *success_ptr = false;
+ return fail_value;
+}
+
+lldb::addr_t OptionArgParser::ToAddress(const ExecutionContext *exe_ctx,
+ llvm::StringRef s,
+ lldb::addr_t fail_value,
+ Status *error_ptr) {
+ bool error_set = false;
+ if (s.empty()) {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
+ s.str().c_str());
+ return fail_value;
+ }
+
+ llvm::StringRef sref = s;
+
+ lldb::addr_t addr = LLDB_INVALID_ADDRESS;
+ if (!s.getAsInteger(0, addr)) {
+ if (error_ptr)
+ error_ptr->Clear();
+ return addr;
+ }
+
+ // Try base 16 with no prefix...
+ if (!s.getAsInteger(16, addr)) {
+ if (error_ptr)
+ error_ptr->Clear();
+ return addr;
+ }
+
+ Target *target = nullptr;
+ if (!exe_ctx || !(target = exe_ctx->GetTargetPtr())) {
+ if (error_ptr)
+ error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
+ s.str().c_str());
+ return fail_value;
+ }
+
+ lldb::ValueObjectSP valobj_sp;
+ EvaluateExpressionOptions options;
+ options.SetCoerceToId(false);
+ options.SetUnwindOnError(true);
+ options.SetKeepInMemory(false);
+ options.SetTryAllThreads(true);
+
+ ExpressionResults expr_result =
+ target->EvaluateExpression(s, exe_ctx->GetFramePtr(), valobj_sp, options);
+
+ bool success = false;
+ if (expr_result == eExpressionCompleted) {
+ if (valobj_sp)
+ valobj_sp = valobj_sp->GetQualifiedRepresentationIfAvailable(
+ valobj_sp->GetDynamicValueType(), true);
+ // Get the address to watch.
+ if (valobj_sp)
+ addr = valobj_sp->GetValueAsUnsigned(fail_value, &success);
+ if (success) {
+ if (error_ptr)
+ error_ptr->Clear();
+ return addr;
+ } else {
+ if (error_ptr) {
+ error_set = true;
+ error_ptr->SetErrorStringWithFormat(
+ "address expression \"%s\" resulted in a value whose type "
+ "can't be converted to an address: %s",
+ s.str().c_str(), valobj_sp->GetTypeName().GetCString());
+ }
+ }
+
+ } else {
+ // Since the compiler can't handle things like "main + 12" we should try to
+ // do this for now. The compiler doesn't like adding offsets to function
+ // pointer types.
+ static RegularExpression g_symbol_plus_offset_regex(
+ "^(.*)([-\\+])[[:space:]]*(0x[0-9A-Fa-f]+|[0-9]+)[[:space:]]*$");
+ RegularExpression::Match regex_match(3);
+ if (g_symbol_plus_offset_regex.Execute(sref, &regex_match)) {
+ uint64_t offset = 0;
+ bool add = true;
+ std::string name;
+ std::string str;
+ if (regex_match.GetMatchAtIndex(s, 1, name)) {
+ if (regex_match.GetMatchAtIndex(s, 2, str)) {
+ add = str[0] == '+';
+
+ if (regex_match.GetMatchAtIndex(s, 3, str)) {
+ if (!llvm::StringRef(str).getAsInteger(0, offset)) {
+ Status error;
+ addr = ToAddress(exe_ctx, name.c_str(), LLDB_INVALID_ADDRESS,
+ &error);
+ if (addr != LLDB_INVALID_ADDRESS) {
+ if (add)
+ return addr + offset;
+ else
+ return addr - offset;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if (error_ptr) {
+ error_set = true;
+ error_ptr->SetErrorStringWithFormat(
+ "address expression \"%s\" evaluation failed", s.str().c_str());
+ }
+ }
+
+ if (error_ptr) {
+ if (!error_set)
+ error_ptr->SetErrorStringWithFormat("invalid address expression \"%s\"",
+ s.str().c_str());
+ }
+ return fail_value;
+}
diff --git a/source/Interpreter/OptionGroupBoolean.cpp b/source/Interpreter/OptionGroupBoolean.cpp
index 5fd4ce7aecfa..e3759f2e60a1 100644
--- a/source/Interpreter/OptionGroupBoolean.cpp
+++ b/source/Interpreter/OptionGroupBoolean.cpp
@@ -45,8 +45,8 @@ Status OptionGroupBoolean::SetOptionValue(uint32_t option_idx,
ExecutionContext *execution_context) {
Status error;
if (m_option_definition.option_has_arg == OptionParser::eNoArgument) {
- // Not argument, toggle the default value and mark the option as having been
- // set
+ // Not argument, toggle the default value and mark the option as having
+ // been set
m_value.SetCurrentValue(!m_value.GetDefaultValue());
m_value.SetOptionWasSet();
} else {
diff --git a/source/Interpreter/OptionGroupFormat.cpp b/source/Interpreter/OptionGroupFormat.cpp
index 75d8df950f18..b64c19324810 100644
--- a/source/Interpreter/OptionGroupFormat.cpp
+++ b/source/Interpreter/OptionGroupFormat.cpp
@@ -102,8 +102,8 @@ Status OptionGroupFormat::SetOptionValue(uint32_t option_idx,
// We the first character of the "gdb_format_str" is not the
// NULL terminator, we didn't consume the entire string and
- // something is wrong. Also, if none of the format, size or count
- // was specified correctly, then abort.
+ // something is wrong. Also, if none of the format, size or count was
+ // specified correctly, then abort.
if (!gdb_format_str.empty() ||
(format == eFormatInvalid && byte_size == 0 && count == 0)) {
// Nothing got set correctly
@@ -112,9 +112,8 @@ Status OptionGroupFormat::SetOptionValue(uint32_t option_idx,
return error;
}
- // At least one of the format, size or count was set correctly.
- // Anything that wasn't set correctly should be set to the
- // previous default
+ // At least one of the format, size or count was set correctly. Anything
+ // that wasn't set correctly should be set to the previous default
if (format == eFormatInvalid)
ParserGDBFormatLetter(execution_context, m_prev_gdb_format, format,
byte_size);
@@ -127,9 +126,8 @@ Status OptionGroupFormat::SetOptionValue(uint32_t option_idx,
ParserGDBFormatLetter(execution_context, m_prev_gdb_size, format,
byte_size);
} else {
- // Byte size is disabled, make sure it wasn't specified
- // but if this is an address, it's actually necessary to
- // specify one so don't error out
+ // Byte size is disabled, make sure it wasn't specified but if this is an
+ // address, it's actually necessary to specify one so don't error out
if (byte_size > 0 && format != lldb::eFormatAddressInfo) {
error.SetErrorString(
"this command doesn't support specifying a byte size");
@@ -235,10 +233,9 @@ bool OptionGroupFormat::ParserGDBFormatLetter(
case 'w':
case 'g':
{
- // Size isn't used for printing instructions, so if a size is specified, and
- // the previous format was
- // 'i', then we should reset it to the default ('x'). Otherwise we'll
- // continue to print as instructions,
+ // Size isn't used for printing instructions, so if a size is specified,
+ // and the previous format was 'i', then we should reset it to the
+ // default ('x'). Otherwise we'll continue to print as instructions,
// which isn't expected.
if (format_letter == 'b')
byte_size = 1;
diff --git a/source/Interpreter/OptionGroupPlatform.cpp b/source/Interpreter/OptionGroupPlatform.cpp
index 5747c6a8815d..47974276c8c0 100644
--- a/source/Interpreter/OptionGroupPlatform.cpp
+++ b/source/Interpreter/OptionGroupPlatform.cpp
@@ -44,10 +44,8 @@ PlatformSP OptionGroupPlatform::CreatePlatformWithOptions(
if (platform_sp) {
interpreter.GetDebugger().GetPlatformList().Append(platform_sp,
make_selected);
- if (m_os_version_major != UINT32_MAX) {
- platform_sp->SetOSVersion(m_os_version_major, m_os_version_minor,
- m_os_version_update);
- }
+ if (!m_os_version.empty())
+ platform_sp->SetOSVersion(m_os_version);
if (m_sdk_sysroot)
platform_sp->SetSDKRootDirectory(m_sdk_sysroot);
@@ -64,9 +62,7 @@ void OptionGroupPlatform::OptionParsingStarting(
m_platform_name.clear();
m_sdk_sysroot.Clear();
m_sdk_build.Clear();
- m_os_version_major = UINT32_MAX;
- m_os_version_minor = UINT32_MAX;
- m_os_version_update = UINT32_MAX;
+ m_os_version = llvm::VersionTuple();
}
static OptionDefinition g_option_table[] = {
@@ -108,10 +104,9 @@ OptionGroupPlatform::SetOptionValue(uint32_t option_idx,
break;
case 'v':
- if (!Args::StringToVersion(option_arg, m_os_version_major,
- m_os_version_minor, m_os_version_update))
- error.SetErrorStringWithFormat("invalid version string '%s'",
- option_arg.str().c_str());
+ if (m_os_version.tryParse(option_arg))
+ error.SetErrorStringWithFormatv("invalid version string '{0}'",
+ option_arg);
break;
case 'b':
@@ -143,17 +138,8 @@ bool OptionGroupPlatform::PlatformMatches(
if (m_sdk_sysroot && m_sdk_sysroot != platform_sp->GetSDKRootDirectory())
return false;
- if (m_os_version_major != UINT32_MAX) {
- uint32_t major, minor, update;
- if (platform_sp->GetOSVersion(major, minor, update)) {
- if (m_os_version_major != major)
- return false;
- if (m_os_version_minor != minor)
- return false;
- if (m_os_version_update != update)
- return false;
- }
- }
+ if (!m_os_version.empty() && m_os_version != platform_sp->GetOSVersion())
+ return false;
return true;
}
return false;
diff --git a/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index ce27d948c93c..54b45c29c70d 100644
--- a/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -16,6 +16,7 @@
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Target/Target.h"
#include "llvm/ADT/ArrayRef.h"
@@ -85,8 +86,8 @@ Status OptionGroupValueObjectDisplay::SetOptionValue(
switch (short_option) {
case 'd': {
int32_t result;
- result =
- Args::StringToOptionEnum(option_arg, g_dynamic_value_types, 2, error);
+ result = OptionArgParser::ToOptionEnum(option_arg, g_dynamic_value_types, 2,
+ error);
if (error.Success())
use_dynamic = (lldb::DynamicValueType)result;
} break;
@@ -144,14 +145,14 @@ Status OptionGroupValueObjectDisplay::SetOptionValue(
break;
case 'S':
- use_synth = Args::StringToBoolean(option_arg, true, &success);
+ use_synth = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat("invalid synthetic-type '%s'",
option_arg.str().c_str());
break;
case 'V':
- run_validator = Args::StringToBoolean(option_arg, true, &success);
+ run_validator = OptionArgParser::ToBoolean(option_arg, true, &success);
if (!success)
error.SetErrorStringWithFormat("invalid validate '%s'",
option_arg.str().c_str());
diff --git a/source/Interpreter/OptionGroupVariable.cpp b/source/Interpreter/OptionGroupVariable.cpp
index 0793d3731446..7b7a62be8743 100644
--- a/source/Interpreter/OptionGroupVariable.cpp
+++ b/source/Interpreter/OptionGroupVariable.cpp
@@ -132,12 +132,12 @@ void OptionGroupVariable::OptionParsingStarting(
llvm::ArrayRef<OptionDefinition> OptionGroupVariable::GetDefinitions() {
auto result = llvm::makeArrayRef(g_variable_options);
- // Show the "--no-args", "--no-locals" and "--show-globals"
- // options if we are showing frame specific options
+ // Show the "--no-args", "--no-locals" and "--show-globals" options if we are
+ // showing frame specific options
if (include_frame_options)
return result;
- // Skip the "--no-args", "--no-locals" and "--show-globals"
- // options if we are not showing frame specific options (globals only)
+ // Skip the "--no-args", "--no-locals" and "--show-globals" options if we are
+ // not showing frame specific options (globals only)
return result.drop_front(NUM_FRAME_OPTS);
}
diff --git a/source/Interpreter/OptionGroupWatchpoint.cpp b/source/Interpreter/OptionGroupWatchpoint.cpp
index dd4b8c86c910..0431fefaa7f9 100644
--- a/source/Interpreter/OptionGroupWatchpoint.cpp
+++ b/source/Interpreter/OptionGroupWatchpoint.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/lldb-enumerations.h"
using namespace lldb;
@@ -65,7 +65,7 @@ OptionGroupWatchpoint::SetOptionValue(uint32_t option_idx,
switch (short_option) {
case 'w': {
WatchType tmp_watch_type;
- tmp_watch_type = (WatchType)Args::StringToOptionEnum(
+ tmp_watch_type = (WatchType)OptionArgParser::ToOptionEnum(
option_arg, g_option_table[option_idx].enum_values, 0, error);
if (error.Success()) {
watch_type = tmp_watch_type;
@@ -74,7 +74,7 @@ OptionGroupWatchpoint::SetOptionValue(uint32_t option_idx,
break;
}
case 's':
- watch_size = (uint32_t)Args::StringToOptionEnum(
+ watch_size = (uint32_t)OptionArgParser::ToOptionEnum(
option_arg, g_option_table[option_idx].enum_values, 0, error);
break;
diff --git a/source/Interpreter/OptionValue.cpp b/source/Interpreter/OptionValue.cpp
index afcace2567ce..2d7c69eaa432 100644
--- a/source/Interpreter/OptionValue.cpp
+++ b/source/Interpreter/OptionValue.cpp
@@ -20,9 +20,8 @@ using namespace lldb;
using namespace lldb_private;
//-------------------------------------------------------------------------
-// Get this value as a uint64_t value if it is encoded as a boolean,
-// uint64_t or int64_t. Other types will cause "fail_value" to be
-// returned
+// Get this value as a uint64_t value if it is encoded as a boolean, uint64_t
+// or int64_t. Other types will cause "fail_value" to be returned
//-------------------------------------------------------------------------
uint64_t OptionValue::GetUInt64Value(uint64_t fail_value, bool *success_ptr) {
if (success_ptr)
@@ -508,8 +507,8 @@ const char *OptionValue::GetBuiltinTypeAsCString(Type t) {
lldb::OptionValueSP OptionValue::CreateValueFromCStringForTypeMask(
const char *value_cstr, uint32_t type_mask, Status &error) {
- // If only 1 bit is set in the type mask for a dictionary or array
- // then we know how to decode a value from a cstring
+ // If only 1 bit is set in the type mask for a dictionary or array then we
+ // know how to decode a value from a cstring
lldb::OptionValueSP value_sp;
switch (type_mask) {
case 1u << eTypeArch:
@@ -574,12 +573,10 @@ bool OptionValue::DumpQualifiedName(Stream &strm) const {
}
size_t OptionValue::AutoComplete(CommandInterpreter &interpreter,
- llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete,
- StringList &matches) {
- word_complete = false;
- matches.Clear();
- return matches.GetSize();
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
+ return request.GetMatches().GetSize();
}
Status OptionValue::SetValueFromString(llvm::StringRef value,
diff --git a/source/Interpreter/OptionValueArch.cpp b/source/Interpreter/OptionValueArch.cpp
index 1d920a114723..3d08780ae6f6 100644
--- a/source/Interpreter/OptionValueArch.cpp
+++ b/source/Interpreter/OptionValueArch.cpp
@@ -15,9 +15,9 @@
// Project includes
#include "lldb/Core/State.h"
#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -74,13 +74,11 @@ lldb::OptionValueSP OptionValueArch::DeepCopy() const {
}
size_t OptionValueArch::AutoComplete(CommandInterpreter &interpreter,
- llvm::StringRef s, int match_start_point,
- int max_return_elements,
- bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
CommandCompletions::InvokeCommonCompletionCallbacks(
- interpreter, CommandCompletions::eArchitectureCompletion, s,
- match_start_point, max_return_elements, nullptr, word_complete, matches);
- return matches.GetSize();
+ interpreter, CommandCompletions::eArchitectureCompletion, request,
+ nullptr);
+ return request.GetMatches().GetSize();
}
diff --git a/source/Interpreter/OptionValueArgs.cpp b/source/Interpreter/OptionValueArgs.cpp
index 8edec77f9d2d..26e438548ea3 100644
--- a/source/Interpreter/OptionValueArgs.cpp
+++ b/source/Interpreter/OptionValueArgs.cpp
@@ -13,7 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/source/Interpreter/OptionValueArray.cpp b/source/Interpreter/OptionValueArray.cpp
index 8b62070352a6..d3fd1cb5db48 100644
--- a/source/Interpreter/OptionValueArray.cpp
+++ b/source/Interpreter/OptionValueArray.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
diff --git a/source/Interpreter/OptionValueBoolean.cpp b/source/Interpreter/OptionValueBoolean.cpp
index 2cb84cd6abb3..8a340792d78f 100644
--- a/source/Interpreter/OptionValueBoolean.cpp
+++ b/source/Interpreter/OptionValueBoolean.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/PosixApi.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/STLExtras.h"
@@ -47,7 +47,7 @@ Status OptionValueBoolean::SetValueFromString(llvm::StringRef value_str,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
bool success = false;
- bool value = Args::StringToBoolean(value_str, false, &success);
+ bool value = OptionArgParser::ToBoolean(value_str, false, &success);
if (success) {
m_value_was_set = true;
m_current_value = value;
@@ -76,23 +76,22 @@ lldb::OptionValueSP OptionValueBoolean::DeepCopy() const {
return OptionValueSP(new OptionValueBoolean(*this));
}
-size_t OptionValueBoolean::AutoComplete(
- CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+size_t OptionValueBoolean::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
static const llvm::StringRef g_autocomplete_entries[] = {
"true", "false", "on", "off", "yes", "no", "1", "0"};
auto entries = llvm::makeArrayRef(g_autocomplete_entries);
// only suggest "true" or "false" by default
- if (s.empty())
+ if (request.GetCursorArgumentPrefix().empty())
entries = entries.take_front(2);
for (auto entry : entries) {
- if (entry.startswith_lower(s))
- matches.AppendString(entry);
+ if (entry.startswith_lower(request.GetCursorArgumentPrefix()))
+ request.GetMatches().AppendString(entry);
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
diff --git a/source/Interpreter/OptionValueChar.cpp b/source/Interpreter/OptionValueChar.cpp
index 27684a27264d..21fe88014724 100644
--- a/source/Interpreter/OptionValueChar.cpp
+++ b/source/Interpreter/OptionValueChar.cpp
@@ -13,7 +13,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StringList.h"
#include "llvm/ADT/STLExtras.h"
@@ -47,7 +47,7 @@ Status OptionValueChar::SetValueFromString(llvm::StringRef value,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
bool success = false;
- char char_value = Args::StringToChar(value, '\0', &success);
+ char char_value = OptionArgParser::ToChar(value, '\0', &success);
if (success) {
m_current_value = char_value;
m_value_was_set = true;
diff --git a/source/Interpreter/OptionValueDictionary.cpp b/source/Interpreter/OptionValueDictionary.cpp
index a57ede486319..2e8a8427237b 100644
--- a/source/Interpreter/OptionValueDictionary.cpp
+++ b/source/Interpreter/OptionValueDictionary.cpp
@@ -16,8 +16,8 @@
// Project includes
#include "lldb/Core/State.h"
#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/OptionValueString.h"
+#include "lldb/Utility/Args.h"
using namespace lldb;
using namespace lldb_private;
@@ -128,9 +128,7 @@ Status OptionValueDictionary::SetArgs(const Args &args,
if (key.front() == '[') {
// Key name starts with '[', so the key value must be in single or
- // double quotes like:
- // ['<key>']
- // ["<key>"]
+ // double quotes like: ['<key>'] ["<key>"]
if ((key.size() > 2) && (key.back() == ']')) {
// Strip leading '[' and trailing ']'
key = key.substr(1, key.size() - 2);
@@ -286,8 +284,8 @@ OptionValueDictionary::GetValueForKey(const ConstString &key) const {
bool OptionValueDictionary::SetValueForKey(const ConstString &key,
const lldb::OptionValueSP &value_sp,
bool can_replace) {
- // Make sure the value_sp object is allowed to contain
- // values of the type passed in...
+ // Make sure the value_sp object is allowed to contain values of the type
+ // passed in...
if (value_sp && (m_type_mask & value_sp->GetTypeAsMask())) {
if (!can_replace) {
collection::const_iterator pos = m_values.find(key);
diff --git a/source/Interpreter/OptionValueEnumeration.cpp b/source/Interpreter/OptionValueEnumeration.cpp
index 9510f4a671d1..e78618ee3c6b 100644
--- a/source/Interpreter/OptionValueEnumeration.cpp
+++ b/source/Interpreter/OptionValueEnumeration.cpp
@@ -109,23 +109,23 @@ lldb::OptionValueSP OptionValueEnumeration::DeepCopy() const {
return OptionValueSP(new OptionValueEnumeration(*this));
}
-size_t OptionValueEnumeration::AutoComplete(
- CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+size_t OptionValueEnumeration::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
const uint32_t num_enumerators = m_enumerations.GetSize();
- if (!s.empty()) {
+ if (!request.GetCursorArgumentPrefix().empty()) {
for (size_t i = 0; i < num_enumerators; ++i) {
llvm::StringRef name = m_enumerations.GetCStringAtIndex(i).GetStringRef();
- if (name.startswith(s))
- matches.AppendString(name);
+ if (name.startswith(request.GetCursorArgumentPrefix()))
+ request.GetMatches().AppendString(name);
}
} else {
// only suggest "true" or "false" by default
for (size_t i = 0; i < num_enumerators; ++i)
- matches.AppendString(m_enumerations.GetCStringAtIndex(i).GetStringRef());
+ request.GetMatches().AppendString(
+ m_enumerations.GetCStringAtIndex(i).GetStringRef());
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
diff --git a/source/Interpreter/OptionValueFileSpec.cpp b/source/Interpreter/OptionValueFileSpec.cpp
index 7d17ddec4f9c..18bfcd693949 100644
--- a/source/Interpreter/OptionValueFileSpec.cpp
+++ b/source/Interpreter/OptionValueFileSpec.cpp
@@ -12,9 +12,9 @@
#include "lldb/Core/State.h"
#include "lldb/DataFormatters/FormatManager.h"
#include "lldb/Host/FileSystem.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBufferLLVM.h"
using namespace lldb;
@@ -67,18 +67,15 @@ Status OptionValueFileSpec::SetValueFromString(llvm::StringRef value,
case eVarSetOperationAssign:
if (value.size() > 0) {
// The setting value may have whitespace, double-quotes, or single-quotes
- // around the file
- // path to indicate that internal spaces are not word breaks. Strip off
- // any ws & quotes
- // from the start and end of the file path - we aren't doing any word //
- // breaking here so
- // the quoting is unnecessary. NB this will cause a problem if someone
- // tries to specify
+ // around the file path to indicate that internal spaces are not word
+ // breaks. Strip off any ws & quotes from the start and end of the file
+ // path - we aren't doing any word // breaking here so the quoting is
+ // unnecessary. NB this will cause a problem if someone tries to specify
// a file path that legitimately begins or ends with a " or ' character,
// or whitespace.
value = value.trim("\"' \t");
m_value_was_set = true;
- m_current_value.SetFile(value.str(), m_resolve);
+ m_current_value.SetFile(value.str(), m_resolve, FileSpec::Style::native);
m_data_sp.reset();
m_data_mod_time = llvm::sys::TimePoint<>();
NotifyValueChanged();
@@ -102,15 +99,13 @@ lldb::OptionValueSP OptionValueFileSpec::DeepCopy() const {
return OptionValueSP(new OptionValueFileSpec(*this));
}
-size_t OptionValueFileSpec::AutoComplete(
- CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+size_t OptionValueFileSpec::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
CommandCompletions::InvokeCommonCompletionCallbacks(
- interpreter, m_completion_mask, s, match_start_point, max_return_elements,
- nullptr, word_complete, matches);
- return matches.GetSize();
+ interpreter, m_completion_mask, request, nullptr);
+ return request.GetMatches().GetSize();
}
const lldb::DataBufferSP &OptionValueFileSpec::GetFileContents() {
diff --git a/source/Interpreter/OptionValueFileSpecLIst.cpp b/source/Interpreter/OptionValueFileSpecLIst.cpp
index 7773bdc5ea9c..7fdc3c780239 100644
--- a/source/Interpreter/OptionValueFileSpecLIst.cpp
+++ b/source/Interpreter/OptionValueFileSpecLIst.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
diff --git a/source/Interpreter/OptionValueFormat.cpp b/source/Interpreter/OptionValueFormat.cpp
index 24dd8fd5f71c..1837804a4622 100644
--- a/source/Interpreter/OptionValueFormat.cpp
+++ b/source/Interpreter/OptionValueFormat.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
@@ -43,7 +43,7 @@ Status OptionValueFormat::SetValueFromString(llvm::StringRef value,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
Format new_format;
- error = Args::StringToFormat(value.str().c_str(), new_format, nullptr);
+ error = OptionArgParser::ToFormat(value.str().c_str(), new_format, nullptr);
if (error.Success()) {
m_value_was_set = true;
m_current_value = new_format;
diff --git a/source/Interpreter/OptionValueFormatEntity.cpp b/source/Interpreter/OptionValueFormatEntity.cpp
index e9431d4562ec..ce1a84e8dece 100644
--- a/source/Interpreter/OptionValueFormatEntity.cpp
+++ b/source/Interpreter/OptionValueFormatEntity.cpp
@@ -64,12 +64,10 @@ Status OptionValueFormatEntity::SetValueFromString(llvm::StringRef value_str,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
// Check if the string starts with a quote character after removing leading
- // and trailing spaces.
- // If it does start with a quote character, make sure it ends with the same
- // quote character
- // and remove the quotes before we parse the format string. If the string
- // doesn't start with
- // a quote, leave the string alone and parse as is.
+ // and trailing spaces. If it does start with a quote character, make sure
+ // it ends with the same quote character and remove the quotes before we
+ // parse the format string. If the string doesn't start with a quote, leave
+ // the string alone and parse as is.
llvm::StringRef trimmed_value_str = value_str.trim();
if (!trimmed_value_str.empty()) {
const char first_char = trimmed_value_str[0];
@@ -107,9 +105,7 @@ lldb::OptionValueSP OptionValueFormatEntity::DeepCopy() const {
return OptionValueSP(new OptionValueFormatEntity(*this));
}
-size_t OptionValueFormatEntity::AutoComplete(
- CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point,
- int max_return_elements, bool &word_complete, StringList &matches) {
- return FormatEntity::AutoComplete(s, match_start_point, max_return_elements,
- word_complete, matches);
+size_t OptionValueFormatEntity::AutoComplete(CommandInterpreter &interpreter,
+ CompletionRequest &request) {
+ return FormatEntity::AutoComplete(request);
}
diff --git a/source/Interpreter/OptionValueLanguage.cpp b/source/Interpreter/OptionValueLanguage.cpp
index 3290e88c1815..1a82329bf0f3 100644
--- a/source/Interpreter/OptionValueLanguage.cpp
+++ b/source/Interpreter/OptionValueLanguage.cpp
@@ -14,8 +14,8 @@
// Other libraries and framework includes
// Project includes
#include "lldb/DataFormatters/FormatManager.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/Language.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
diff --git a/source/Interpreter/OptionValuePathMappings.cpp b/source/Interpreter/OptionValuePathMappings.cpp
index 5f805720bd3f..8390a8cf5aba 100644
--- a/source/Interpreter/OptionValuePathMappings.cpp
+++ b/source/Interpreter/OptionValuePathMappings.cpp
@@ -14,7 +14,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Stream.h"
diff --git a/source/Interpreter/OptionValueProperties.cpp b/source/Interpreter/OptionValueProperties.cpp
index ae7669605592..c1887f34b712 100644
--- a/source/Interpreter/OptionValueProperties.cpp
+++ b/source/Interpreter/OptionValueProperties.cpp
@@ -16,9 +16,9 @@
#include "lldb/Utility/Flags.h"
#include "lldb/Core/UserSettingsController.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/OptionValues.h"
#include "lldb/Interpreter/Property.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StringList.h"
@@ -35,15 +35,13 @@ OptionValueProperties::OptionValueProperties(
m_name(global_properties.m_name),
m_properties(global_properties.m_properties),
m_name_to_index(global_properties.m_name_to_index) {
- // We now have an exact copy of "global_properties". We need to now
- // find all non-global settings and copy the property values so that
- // all non-global settings get new OptionValue instances created for
- // them.
+ // We now have an exact copy of "global_properties". We need to now find all
+ // non-global settings and copy the property values so that all non-global
+ // settings get new OptionValue instances created for them.
const size_t num_properties = m_properties.size();
for (size_t i = 0; i < num_properties; ++i) {
// Duplicate any values that are not global when constructing properties
- // from
- // a global copy
+ // from a global copy
if (m_properties[i].IsGlobal() == false) {
lldb::OptionValueSP new_value_sp(m_properties[i].GetValue()->DeepCopy());
m_properties[i].SetOptionValue(new_value_sp);
@@ -157,15 +155,13 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
case '{':
// Predicate matching for predicates like
// "<setting-name>{<predicate>}"
- // strings are parsed by the current OptionValueProperties subclass
- // to mean whatever they want to. For instance a subclass of
- // OptionValueProperties for a lldb_private::Target might implement:
- // "target.run-args{arch==i386}" -- only set run args if the arch is
- // i386
- // "target.run-args{path=/tmp/a/b/c/a.out}" -- only set run args if the
- // path matches
- // "target.run-args{basename==test&&arch==x86_64}" -- only set run args
- // if executable basename is "test" and arch is "x86_64"
+ // strings are parsed by the current OptionValueProperties subclass to mean
+ // whatever they want to. For instance a subclass of OptionValueProperties
+ // for a lldb_private::Target might implement: "target.run-
+ // args{arch==i386}" -- only set run args if the arch is i386 "target
+ // .run-args{path=/tmp/a/b/c/a.out}" -- only set run args if the path
+ // matches "target.run-args{basename==test&&arch==x86_64}" -- only set run
+ // args if executable basename is "test" and arch is "x86_64"
if (sub_name[1]) {
llvm::StringRef predicate_start = sub_name.drop_front();
size_t pos = predicate_start.find_first_of('}');
@@ -189,9 +185,8 @@ OptionValueProperties::GetSubValue(const ExecutionContext *exe_ctx,
break;
case '[':
- // Array or dictionary access for subvalues like:
- // "[12]" -- access 12th array element
- // "['hello']" -- dictionary access of key named hello
+ // Array or dictionary access for subvalues like: "[12]" -- access
+ // 12th array element "['hello']" -- dictionary access of key named hello
return value_sp->GetSubValue(exe_ctx, sub_name, will_modify, error);
default:
@@ -207,12 +202,23 @@ Status OptionValueProperties::SetSubValue(const ExecutionContext *exe_ctx,
llvm::StringRef value) {
Status error;
const bool will_modify = true;
+ llvm::SmallVector<llvm::StringRef, 8> components;
+ name.split(components, '.');
+ bool name_contains_experimental = false;
+ for (const auto &part : components)
+ if (Properties::IsSettingExperimental(part))
+ name_contains_experimental = true;
+
+
lldb::OptionValueSP value_sp(GetSubValue(exe_ctx, name, will_modify, error));
if (value_sp)
error = value_sp->SetValueFromString(value, op);
else {
- if (error.AsCString() == nullptr)
+ // Don't set an error if the path contained .experimental. - those are
+ // allowed to be missing and should silently fail.
+ if (name_contains_experimental == false && error.AsCString() == nullptr) {
error.SetErrorStringWithFormat("invalid value path '%s'", name.str().c_str());
+ }
}
return error;
}
diff --git a/source/Interpreter/OptionValueSInt64.cpp b/source/Interpreter/OptionValueSInt64.cpp
index 9dbcd58dc3e9..ddd1b9662ca3 100644
--- a/source/Interpreter/OptionValueSInt64.cpp
+++ b/source/Interpreter/OptionValueSInt64.cpp
@@ -21,7 +21,8 @@ using namespace lldb_private;
void OptionValueSInt64::DumpValue(const ExecutionContext *exe_ctx, Stream &strm,
uint32_t dump_mask) {
- // printf ("%p: DumpValue (exe_ctx=%p, strm, mask) m_current_value = %" PRIi64
+ // printf ("%p: DumpValue (exe_ctx=%p, strm, mask) m_current_value = %"
+ // PRIi64
// "\n", this, exe_ctx, m_current_value);
if (dump_mask & eDumpOptionType)
strm.Printf("(%s)", GetTypeAsCString());
diff --git a/source/Interpreter/OptionValueString.cpp b/source/Interpreter/OptionValueString.cpp
index 1d7332dd41a6..8383b531270b 100644
--- a/source/Interpreter/OptionValueString.cpp
+++ b/source/Interpreter/OptionValueString.cpp
@@ -15,7 +15,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Stream.h"
using namespace lldb;
diff --git a/source/Interpreter/OptionValueUUID.cpp b/source/Interpreter/OptionValueUUID.cpp
index bec04cba8c37..7fa155277cec 100644
--- a/source/Interpreter/OptionValueUUID.cpp
+++ b/source/Interpreter/OptionValueUUID.cpp
@@ -43,7 +43,7 @@ Status OptionValueUUID::SetValueFromString(llvm::StringRef value,
case eVarSetOperationReplace:
case eVarSetOperationAssign: {
- if (m_uuid.SetFromCString(value.str().c_str()) == 0)
+ if (m_uuid.SetFromStringRef(value) == 0)
error.SetErrorStringWithFormat("invalid uuid string value '%s'",
value.str().c_str());
else {
@@ -68,40 +68,30 @@ lldb::OptionValueSP OptionValueUUID::DeepCopy() const {
}
size_t OptionValueUUID::AutoComplete(CommandInterpreter &interpreter,
- llvm::StringRef s, int match_start_point,
- int max_return_elements,
- bool &word_complete, StringList &matches) {
- word_complete = false;
- matches.Clear();
+ CompletionRequest &request) {
+ request.SetWordComplete(false);
+ request.GetMatches().Clear();
ExecutionContext exe_ctx(interpreter.GetExecutionContext());
Target *target = exe_ctx.GetTargetPtr();
if (target) {
- const size_t num_modules = target->GetImages().GetSize();
- if (num_modules > 0) {
- UUID::ValueType uuid_bytes;
- uint32_t num_bytes_decoded = 0;
- UUID::DecodeUUIDBytesFromString(s, uuid_bytes, num_bytes_decoded);
+ auto prefix = request.GetCursorArgumentPrefix();
+ llvm::SmallVector<uint8_t, 20> uuid_bytes;
+ if (UUID::DecodeUUIDBytesFromString(prefix, uuid_bytes).empty()) {
+ const size_t num_modules = target->GetImages().GetSize();
for (size_t i = 0; i < num_modules; ++i) {
ModuleSP module_sp(target->GetImages().GetModuleAtIndex(i));
if (module_sp) {
const UUID &module_uuid = module_sp->GetUUID();
if (module_uuid.IsValid()) {
- bool add_uuid = false;
- if (num_bytes_decoded == 0)
- add_uuid = true;
- else
- add_uuid = ::memcmp(module_uuid.GetBytes(), uuid_bytes,
- num_bytes_decoded) == 0;
- if (add_uuid) {
- std::string uuid_str;
- uuid_str = module_uuid.GetAsString();
- if (!uuid_str.empty())
- matches.AppendString(uuid_str.c_str());
+ llvm::ArrayRef<uint8_t> module_bytes = module_uuid.GetBytes();
+ if (module_bytes.size() >= uuid_bytes.size() &&
+ module_bytes.take_front(uuid_bytes.size()).equals(uuid_bytes)) {
+ request.GetMatches().AppendString(module_uuid.GetAsString());
}
}
}
}
}
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
diff --git a/source/Interpreter/Options.cpp b/source/Interpreter/Options.cpp
index f8b1a8d6beba..f4758978e2a6 100644
--- a/source/Interpreter/Options.cpp
+++ b/source/Interpreter/Options.cpp
@@ -115,13 +115,12 @@ bool Options::VerifyOptions(CommandReturnObject &result) {
int num_levels = GetRequiredOptions().size();
if (num_levels) {
for (int i = 0; i < num_levels && !options_are_valid; ++i) {
- // This is the correct set of options if: 1). m_seen_options contains all
- // of m_required_options[i]
- // (i.e. all the required options at this level are a subset of
- // m_seen_options); AND
- // 2). { m_seen_options - m_required_options[i] is a subset of
- // m_options_options[i] (i.e. all the rest of
- // m_seen_options are in the set of optional options at this level.
+ // This is the correct set of options if: 1). m_seen_options contains
+ // all of m_required_options[i] (i.e. all the required options at this
+ // level are a subset of m_seen_options); AND 2). { m_seen_options -
+ // m_required_options[i] is a subset of m_options_options[i] (i.e. all
+ // the rest of m_seen_options are in the set of optional options at this
+ // level.
// Check to see if all of m_required_options[i] are a subset of
// m_seen_options
@@ -152,8 +151,7 @@ bool Options::VerifyOptions(CommandReturnObject &result) {
}
// This is called in the Options constructor, though we could call it lazily if
-// that ends up being
-// a performance problem.
+// that ends up being a performance problem.
void Options::BuildValidOptionSets() {
// Check to see if we already did this.
@@ -265,13 +263,11 @@ Option *Options::GetLongOptions() {
}
// This function takes INDENT, which tells how many spaces to output at the
-// front of each line; SPACES, which is
-// a string containing 80 spaces; and TEXT, which is the text that is to be
-// output. It outputs the text, on
+// front of each line; SPACES, which is a string containing 80 spaces; and
+// TEXT, which is the text that is to be output. It outputs the text, on
// multiple lines if necessary, to RESULT, with INDENT spaces at the front of
-// each line. It breaks lines on spaces,
-// tabs or newlines, shortening the line if necessary to not break in the middle
-// of a word. It assumes that each
+// each line. It breaks lines on spaces, tabs or newlines, shortening the line
+// if necessary to not break in the middle of a word. It assumes that each
// output line should contain a maximum of OUTPUT_MAX_COLUMNS characters.
void Options::OutputFormattedUsageText(Stream &strm,
@@ -421,8 +417,8 @@ void Options::GenerateOptionUsage(Stream &strm, CommandObject *cmd,
strm.IndentMore(2);
- // First, show each usage level set of options, e.g. <cmd>
- // [options-for-level-0]
+ // First, show each usage level set of options, e.g. <cmd> [options-for-
+ // level-0]
// <cmd>
// [options-for-level-1]
// etc.
@@ -449,9 +445,9 @@ void Options::GenerateOptionUsage(Stream &strm, CommandObject *cmd,
if (cmd)
cmd->GetFormattedCommandArguments(args_str, opt_set_mask);
- // First go through and print all options that take no arguments as
- // a single string. If a command has "-a" "-b" and "-c", this will show
- // up as [-abc]
+ // First go through and print all options that take no arguments as a
+ // single string. If a command has "-a" "-b" and "-c", this will show up
+ // as [-abc]
std::set<int> options;
std::set<int>::const_iterator options_pos, options_end;
@@ -554,24 +550,23 @@ void Options::GenerateOptionUsage(Stream &strm, CommandObject *cmd,
// help text
// This variable is used to keep track of which options' info we've printed
- // out, because some options can be in
- // more than one usage level, but we only want to print the long form of its
- // information once.
+ // out, because some options can be in more than one usage level, but we
+ // only want to print the long form of its information once.
std::multimap<int, uint32_t> options_seen;
strm.IndentMore(5);
// Put the unique command options in a vector & sort it, so we can output
- // them alphabetically (by short_option)
- // when writing out detailed help for each option.
+ // them alphabetically (by short_option) when writing out detailed help for
+ // each option.
i = 0;
for (auto &def : opt_defs)
options_seen.insert(std::make_pair(def.short_option, i++));
- // Go through the unique'd and alphabetically sorted vector of options, find
- // the table entry for each option
- // and write out the detailed help information for that option.
+ // Go through the unique'd and alphabetically sorted vector of options,
+ // find the table entry for each option and write out the detailed help
+ // information for that option.
bool first_option_printed = false;
@@ -627,14 +622,10 @@ void Options::GenerateOptionUsage(Stream &strm, CommandObject *cmd,
}
// This function is called when we have been given a potentially incomplete set
-// of
-// options, such as when an alias has been defined (more options might be added
-// at
-// at the time the alias is invoked). We need to verify that the options in the
-// set
-// m_seen_options are all part of a set that may be used together, but
-// m_seen_options
-// may be missing some of the "required" options.
+// of options, such as when an alias has been defined (more options might be
+// added at at the time the alias is invoked). We need to verify that the
+// options in the set m_seen_options are all part of a set that may be used
+// together, but m_seen_options may be missing some of the "required" options.
bool Options::VerifyPartialOptions(CommandReturnObject &result) {
bool options_are_valid = false;
@@ -643,10 +634,8 @@ bool Options::VerifyPartialOptions(CommandReturnObject &result) {
if (num_levels) {
for (int i = 0; i < num_levels && !options_are_valid; ++i) {
// In this case we are treating all options as optional rather than
- // required.
- // Therefore a set of options is correct if m_seen_options is a subset of
- // the
- // union of m_required_options and m_optional_options.
+ // required. Therefore a set of options is correct if m_seen_options is a
+ // subset of the union of m_required_options and m_optional_options.
OptionSet union_set;
OptionsSetUnion(GetRequiredOptions()[i], GetOptionalOptions()[i],
union_set);
@@ -658,28 +647,26 @@ bool Options::VerifyPartialOptions(CommandReturnObject &result) {
return options_are_valid;
}
-bool Options::HandleOptionCompletion(
- Args &input, OptionElementVector &opt_element_vector, int cursor_index,
- int char_pos, int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter, bool &word_complete,
- lldb_private::StringList &matches) {
- word_complete = true;
+bool Options::HandleOptionCompletion(CompletionRequest &request,
+ OptionElementVector &opt_element_vector,
+ CommandInterpreter &interpreter) {
+ request.SetWordComplete(true);
// For now we just scan the completions to see if the cursor position is in
// an option or its argument. Otherwise we'll call HandleArgumentCompletion.
- // In the future we can use completion to validate options as well if we want.
+ // In the future we can use completion to validate options as well if we
+ // want.
auto opt_defs = GetDefinitions();
- std::string cur_opt_std_str(input.GetArgumentAtIndex(cursor_index));
- cur_opt_std_str.erase(char_pos);
+ std::string cur_opt_std_str = request.GetCursorArgumentPrefix().str();
const char *cur_opt_str = cur_opt_std_str.c_str();
for (size_t i = 0; i < opt_element_vector.size(); i++) {
int opt_pos = opt_element_vector[i].opt_pos;
int opt_arg_pos = opt_element_vector[i].opt_arg_pos;
int opt_defs_index = opt_element_vector[i].opt_defs_index;
- if (opt_pos == cursor_index) {
+ if (opt_pos == request.GetCursorIndex()) {
// We're completing the option itself.
if (opt_defs_index == OptionArgElement::eBareDash) {
@@ -693,7 +680,7 @@ bool Options::HandleOptionCompletion(
if (!def.short_option)
continue;
opt_str[1] = def.short_option;
- matches.AppendString(opt_str);
+ request.GetMatches().AppendString(opt_str);
}
return true;
@@ -705,25 +692,23 @@ bool Options::HandleOptionCompletion(
full_name.erase(full_name.begin() + 2, full_name.end());
full_name.append(def.long_option);
- matches.AppendString(full_name.c_str());
+ request.GetMatches().AppendString(full_name.c_str());
}
return true;
} else if (opt_defs_index != OptionArgElement::eUnrecognizedArg) {
- // We recognized it, if it an incomplete long option, complete it anyway
- // (getopt_long_only is
- // happy with shortest unique string, but it's still a nice thing to
- // do.) Otherwise return
- // The string so the upper level code will know this is a full match and
- // add the " ".
+ // We recognized it, if it an incomplete long option, complete it
+ // anyway (getopt_long_only is happy with shortest unique string, but
+ // it's still a nice thing to do.) Otherwise return The string so the
+ // upper level code will know this is a full match and add the " ".
if (cur_opt_str && strlen(cur_opt_str) > 2 && cur_opt_str[0] == '-' &&
cur_opt_str[1] == '-' &&
strcmp(opt_defs[opt_defs_index].long_option, cur_opt_str) != 0) {
std::string full_name("--");
full_name.append(opt_defs[opt_defs_index].long_option);
- matches.AppendString(full_name.c_str());
+ request.GetMatches().AppendString(full_name.c_str());
return true;
} else {
- matches.AppendString(input.GetArgumentAtIndex(cursor_index));
+ request.GetMatches().AppendString(request.GetCursorArgument());
return true;
}
} else {
@@ -731,9 +716,8 @@ bool Options::HandleOptionCompletion(
// Check to see if they are writing a long option & complete it.
// I think we will only get in here if the long option table has two
// elements
- // that are not unique up to this point. getopt_long_only does shortest
- // unique match
- // for long options already.
+ // that are not unique up to this point. getopt_long_only does
+ // shortest unique match for long options already.
if (cur_opt_str && strlen(cur_opt_str) > 2 && cur_opt_str[0] == '-' &&
cur_opt_str[1] == '-') {
@@ -747,29 +731,30 @@ bool Options::HandleOptionCompletion(
// The options definitions table has duplicates because of the
// way the grouping information is stored, so only add once.
bool duplicate = false;
- for (size_t k = 0; k < matches.GetSize(); k++) {
- if (matches.GetStringAtIndex(k) == full_name) {
+ for (size_t k = 0; k < request.GetMatches().GetSize(); k++) {
+ if (request.GetMatches().GetStringAtIndex(k) == full_name) {
duplicate = true;
break;
}
}
if (!duplicate)
- matches.AppendString(full_name.c_str());
+ request.GetMatches().AppendString(full_name.c_str());
}
}
}
return true;
}
- } else if (opt_arg_pos == cursor_index) {
- // Okay the cursor is on the completion of an argument.
- // See if it has a completion, otherwise return no matches.
+ } else if (opt_arg_pos == request.GetCursorIndex()) {
+ // Okay the cursor is on the completion of an argument. See if it has a
+ // completion, otherwise return no matches.
+ CompletionRequest subrequest = request;
+ subrequest.SetCursorCharPosition(subrequest.GetCursorArgument().size());
if (opt_defs_index != -1) {
- HandleOptionArgumentCompletion(
- input, cursor_index, strlen(input.GetArgumentAtIndex(cursor_index)),
- opt_element_vector, i, match_start_point, max_return_elements,
- interpreter, word_complete, matches);
+ HandleOptionArgumentCompletion(subrequest, opt_element_vector, i,
+ interpreter);
+ request.SetWordComplete(subrequest.GetWordComplete());
return true;
} else {
// No completion callback means no completions...
@@ -785,11 +770,8 @@ bool Options::HandleOptionCompletion(
}
bool Options::HandleOptionArgumentCompletion(
- Args &input, int cursor_index, int char_pos,
- OptionElementVector &opt_element_vector, int opt_element_index,
- int match_start_point, int max_return_elements,
- CommandInterpreter &interpreter, bool &word_complete,
- lldb_private::StringList &matches) {
+ CompletionRequest &request, OptionElementVector &opt_element_vector,
+ int opt_element_index, CommandInterpreter &interpreter) {
auto opt_defs = GetDefinitions();
std::unique_ptr<SearchFilter> filter_ap;
@@ -801,22 +783,23 @@ bool Options::HandleOptionArgumentCompletion(
OptionEnumValueElement *enum_values = opt_defs[opt_defs_index].enum_values;
if (enum_values != nullptr) {
bool return_value = false;
- std::string match_string(input.GetArgumentAtIndex(opt_arg_pos),
- input.GetArgumentAtIndex(opt_arg_pos) + char_pos);
+ std::string match_string(
+ request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos),
+ request.GetParsedLine().GetArgumentAtIndex(opt_arg_pos) +
+ request.GetCursorCharPosition());
for (int i = 0; enum_values[i].string_value != nullptr; i++) {
if (strstr(enum_values[i].string_value, match_string.c_str()) ==
enum_values[i].string_value) {
- matches.AppendString(enum_values[i].string_value);
+ request.GetMatches().AppendString(enum_values[i].string_value);
return_value = true;
}
}
return return_value;
}
- // If this is a source file or symbol type completion, and there is a
- // -shlib option somewhere in the supplied arguments, then make a search
- // filter
- // for that shared library.
+ // If this is a source file or symbol type completion, and there is a -shlib
+ // option somewhere in the supplied arguments, then make a search filter for
+ // that shared library.
// FIXME: Do we want to also have an "OptionType" so we don't have to match
// string names?
@@ -852,7 +835,8 @@ bool Options::HandleOptionArgumentCompletion(
// restrict it to that shared library.
if (cur_opt_name && strcmp(cur_opt_name, "shlib") == 0 &&
cur_arg_pos != -1) {
- const char *module_name = input.GetArgumentAtIndex(cur_arg_pos);
+ const char *module_name =
+ request.GetParsedLine().GetArgumentAtIndex(cur_arg_pos);
if (module_name) {
FileSpec module_spec(module_name, false);
lldb::TargetSP target_sp =
@@ -867,9 +851,7 @@ bool Options::HandleOptionArgumentCompletion(
}
return CommandCompletions::InvokeCommonCompletionCallbacks(
- interpreter, completion_mask, input.GetArgumentAtIndex(opt_arg_pos),
- match_start_point, max_return_elements, filter_ap.get(), word_complete,
- matches);
+ interpreter, completion_mask, request, filter_ap.get());
}
void OptionGroupOptions::Append(OptionGroup *group) {
@@ -908,8 +890,8 @@ void OptionGroupOptions::Finalize() {
Status OptionGroupOptions::SetOptionValue(uint32_t option_idx,
llvm::StringRef option_value,
ExecutionContext *execution_context) {
- // After calling OptionGroupOptions::Append(...), you must finalize the groups
- // by calling OptionGroupOptions::Finlize()
+ // After calling OptionGroupOptions::Append(...), you must finalize the
+ // groups by calling OptionGroupOptions::Finlize()
assert(m_did_finalize);
Status error;
if (option_idx < m_option_infos.size()) {
@@ -951,3 +933,525 @@ OptionGroupOptions::OptionParsingFinished(ExecutionContext *execution_context) {
}
return error;
}
+
+// OptionParser permutes the arguments while processing them, so we create a
+// temporary array holding to avoid modification of the input arguments. The
+// options themselves are never modified, but the API expects a char * anyway,
+// hence the const_cast.
+static std::vector<char *> GetArgvForParsing(const Args &args) {
+ std::vector<char *> result;
+ // OptionParser always skips the first argument as it is based on getopt().
+ result.push_back(const_cast<char *>("<FAKE-ARG0>"));
+ for (const Args::ArgEntry &entry : args)
+ result.push_back(const_cast<char *>(entry.c_str()));
+ return result;
+}
+
+// Given a permuted argument, find it's position in the original Args vector.
+static Args::const_iterator FindOriginalIter(const char *arg,
+ const Args &original) {
+ return llvm::find_if(
+ original, [arg](const Args::ArgEntry &D) { return D.c_str() == arg; });
+}
+
+// Given a permuted argument, find it's index in the original Args vector.
+static size_t FindOriginalIndex(const char *arg, const Args &original) {
+ return std::distance(original.begin(), FindOriginalIter(arg, original));
+}
+
+// Construct a new Args object, consisting of the entries from the original
+// arguments, but in the permuted order.
+static Args ReconstituteArgsAfterParsing(llvm::ArrayRef<char *> parsed,
+ const Args &original) {
+ Args result;
+ for (const char *arg : parsed) {
+ auto pos = FindOriginalIter(arg, original);
+ assert(pos != original.end());
+ result.AppendArgument(pos->ref, pos->quote);
+ }
+ return result;
+}
+
+static size_t FindArgumentIndexForOption(const Args &args,
+ const Option &long_option) {
+ std::string short_opt = llvm::formatv("-{0}", char(long_option.val)).str();
+ std::string long_opt =
+ llvm::formatv("--{0}", long_option.definition->long_option);
+ for (const auto &entry : llvm::enumerate(args)) {
+ if (entry.value().ref.startswith(short_opt) ||
+ entry.value().ref.startswith(long_opt))
+ return entry.index();
+ }
+
+ return size_t(-1);
+}
+
+llvm::Expected<Args> Options::ParseAlias(const Args &args,
+ OptionArgVector *option_arg_vector,
+ std::string &input_line) {
+ StreamString sstr;
+ int i;
+ Option *long_options = GetLongOptions();
+
+ if (long_options == nullptr) {
+ return llvm::make_error<llvm::StringError>("Invalid long options",
+ llvm::inconvertibleErrorCode());
+ }
+
+ for (i = 0; long_options[i].definition != nullptr; ++i) {
+ if (long_options[i].flag == nullptr) {
+ sstr << (char)long_options[i].val;
+ switch (long_options[i].definition->option_has_arg) {
+ default:
+ case OptionParser::eNoArgument:
+ break;
+ case OptionParser::eRequiredArgument:
+ sstr << ":";
+ break;
+ case OptionParser::eOptionalArgument:
+ sstr << "::";
+ break;
+ }
+ }
+ }
+
+ Args args_copy = args;
+ std::vector<char *> argv = GetArgvForParsing(args);
+
+ std::unique_lock<std::mutex> lock;
+ OptionParser::Prepare(lock);
+ int val;
+ while (1) {
+ int long_options_index = -1;
+ val = OptionParser::Parse(argv.size(), &*argv.begin(), sstr.GetString(),
+ long_options, &long_options_index);
+
+ if (val == -1)
+ break;
+
+ if (val == '?') {
+ return llvm::make_error<llvm::StringError>(
+ "Unknown or ambiguous option", llvm::inconvertibleErrorCode());
+ }
+
+ if (val == 0)
+ continue;
+
+ OptionSeen(val);
+
+ // Look up the long option index
+ if (long_options_index == -1) {
+ for (int j = 0; long_options[j].definition || long_options[j].flag ||
+ long_options[j].val;
+ ++j) {
+ if (long_options[j].val == val) {
+ long_options_index = j;
+ break;
+ }
+ }
+ }
+
+ // See if the option takes an argument, and see if one was supplied.
+ if (long_options_index == -1) {
+ return llvm::make_error<llvm::StringError>(
+ llvm::formatv("Invalid option with value '{0}'.", char(val)).str(),
+ llvm::inconvertibleErrorCode());
+ }
+
+ StreamString option_str;
+ option_str.Printf("-%c", val);
+ const OptionDefinition *def = long_options[long_options_index].definition;
+ int has_arg =
+ (def == nullptr) ? OptionParser::eNoArgument : def->option_has_arg;
+
+ const char *option_arg = nullptr;
+ switch (has_arg) {
+ case OptionParser::eRequiredArgument:
+ if (OptionParser::GetOptionArgument() == nullptr) {
+ return llvm::make_error<llvm::StringError>(
+ llvm::formatv("Option '{0}' is missing argument specifier.",
+ option_str.GetString())
+ .str(),
+ llvm::inconvertibleErrorCode());
+ }
+ LLVM_FALLTHROUGH;
+ case OptionParser::eOptionalArgument:
+ option_arg = OptionParser::GetOptionArgument();
+ LLVM_FALLTHROUGH;
+ case OptionParser::eNoArgument:
+ break;
+ default:
+ return llvm::make_error<llvm::StringError>(
+ llvm::formatv("error with options table; invalid value in has_arg "
+ "field for option '{0}'.",
+ char(val))
+ .str(),
+ llvm::inconvertibleErrorCode());
+ }
+ if (!option_arg)
+ option_arg = "<no-argument>";
+ option_arg_vector->emplace_back(option_str.GetString(), has_arg,
+ option_arg);
+
+ // Find option in the argument list; also see if it was supposed to take an
+ // argument and if one was supplied. Remove option (and argument, if
+ // given) from the argument list. Also remove them from the
+ // raw_input_string, if one was passed in.
+ size_t idx =
+ FindArgumentIndexForOption(args_copy, long_options[long_options_index]);
+ if (idx == size_t(-1))
+ continue;
+
+ if (!input_line.empty()) {
+ auto tmp_arg = args_copy[idx].ref;
+ size_t pos = input_line.find(tmp_arg);
+ if (pos != std::string::npos)
+ input_line.erase(pos, tmp_arg.size());
+ }
+ args_copy.DeleteArgumentAtIndex(idx);
+ if ((long_options[long_options_index].definition->option_has_arg !=
+ OptionParser::eNoArgument) &&
+ (OptionParser::GetOptionArgument() != nullptr) &&
+ (idx < args_copy.GetArgumentCount()) &&
+ (args_copy[idx].ref == OptionParser::GetOptionArgument())) {
+ if (input_line.size() > 0) {
+ auto tmp_arg = args_copy[idx].ref;
+ size_t pos = input_line.find(tmp_arg);
+ if (pos != std::string::npos)
+ input_line.erase(pos, tmp_arg.size());
+ }
+ args_copy.DeleteArgumentAtIndex(idx);
+ }
+ }
+
+ return std::move(args_copy);
+}
+
+OptionElementVector Options::ParseForCompletion(const Args &args,
+ uint32_t cursor_index) {
+ OptionElementVector option_element_vector;
+ StreamString sstr;
+ Option *long_options = GetLongOptions();
+ option_element_vector.clear();
+
+ if (long_options == nullptr)
+ return option_element_vector;
+
+ // Leading : tells getopt to return a : for a missing option argument AND to
+ // suppress error messages.
+
+ sstr << ":";
+ for (int i = 0; long_options[i].definition != nullptr; ++i) {
+ if (long_options[i].flag == nullptr) {
+ sstr << (char)long_options[i].val;
+ switch (long_options[i].definition->option_has_arg) {
+ default:
+ case OptionParser::eNoArgument:
+ break;
+ case OptionParser::eRequiredArgument:
+ sstr << ":";
+ break;
+ case OptionParser::eOptionalArgument:
+ sstr << "::";
+ break;
+ }
+ }
+ }
+
+ std::unique_lock<std::mutex> lock;
+ OptionParser::Prepare(lock);
+ OptionParser::EnableError(false);
+
+ int val;
+ auto opt_defs = GetDefinitions();
+
+ std::vector<char *> dummy_vec = GetArgvForParsing(args);
+
+ // I stick an element on the end of the input, because if the last element
+ // is option that requires an argument, getopt_long_only will freak out.
+ dummy_vec.push_back(const_cast<char *>("<FAKE-VALUE>"));
+
+ bool failed_once = false;
+ uint32_t dash_dash_pos = -1;
+
+ while (1) {
+ bool missing_argument = false;
+ int long_options_index = -1;
+
+ val = OptionParser::Parse(dummy_vec.size(), &dummy_vec[0], sstr.GetString(),
+ long_options, &long_options_index);
+
+ if (val == -1) {
+ // When we're completing a "--" which is the last option on line,
+ if (failed_once)
+ break;
+
+ failed_once = true;
+
+ // If this is a bare "--" we mark it as such so we can complete it
+ // successfully later. Handling the "--" is a little tricky, since that
+ // may mean end of options or arguments, or the user might want to
+ // complete options by long name. I make this work by checking whether
+ // the cursor is in the "--" argument, and if so I assume we're
+ // completing the long option, otherwise I let it pass to
+ // OptionParser::Parse which will terminate the option parsing. Note, in
+ // either case we continue parsing the line so we can figure out what
+ // other options were passed. This will be useful when we come to
+ // restricting completions based on what other options we've seen on the
+ // line.
+
+ if (static_cast<size_t>(OptionParser::GetOptionIndex()) <
+ dummy_vec.size() &&
+ (strcmp(dummy_vec[OptionParser::GetOptionIndex() - 1], "--") == 0)) {
+ dash_dash_pos = FindOriginalIndex(
+ dummy_vec[OptionParser::GetOptionIndex() - 1], args);
+ if (dash_dash_pos == cursor_index) {
+ option_element_vector.push_back(
+ OptionArgElement(OptionArgElement::eBareDoubleDash, dash_dash_pos,
+ OptionArgElement::eBareDoubleDash));
+ continue;
+ } else
+ break;
+ } else
+ break;
+ } else if (val == '?') {
+ option_element_vector.push_back(OptionArgElement(
+ OptionArgElement::eUnrecognizedArg,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args),
+ OptionArgElement::eUnrecognizedArg));
+ continue;
+ } else if (val == 0) {
+ continue;
+ } else if (val == ':') {
+ // This is a missing argument.
+ val = OptionParser::GetOptionErrorCause();
+ missing_argument = true;
+ }
+
+ OptionSeen(val);
+
+ // Look up the long option index
+ if (long_options_index == -1) {
+ for (int j = 0; long_options[j].definition || long_options[j].flag ||
+ long_options[j].val;
+ ++j) {
+ if (long_options[j].val == val) {
+ long_options_index = j;
+ break;
+ }
+ }
+ }
+
+ // See if the option takes an argument, and see if one was supplied.
+ if (long_options_index >= 0) {
+ int opt_defs_index = -1;
+ for (size_t i = 0; i < opt_defs.size(); i++) {
+ if (opt_defs[i].short_option != val)
+ continue;
+ opt_defs_index = i;
+ break;
+ }
+
+ const OptionDefinition *def = long_options[long_options_index].definition;
+ int has_arg =
+ (def == nullptr) ? OptionParser::eNoArgument : def->option_has_arg;
+ switch (has_arg) {
+ case OptionParser::eNoArgument:
+ option_element_vector.push_back(OptionArgElement(
+ opt_defs_index,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args),
+ 0));
+ break;
+ case OptionParser::eRequiredArgument:
+ if (OptionParser::GetOptionArgument() != nullptr) {
+ int arg_index;
+ if (missing_argument)
+ arg_index = -1;
+ else
+ arg_index = OptionParser::GetOptionIndex() - 2;
+
+ option_element_vector.push_back(OptionArgElement(
+ opt_defs_index,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 2],
+ args),
+ arg_index));
+ } else {
+ option_element_vector.push_back(OptionArgElement(
+ opt_defs_index,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args),
+ -1));
+ }
+ break;
+ case OptionParser::eOptionalArgument:
+ if (OptionParser::GetOptionArgument() != nullptr) {
+ option_element_vector.push_back(OptionArgElement(
+ opt_defs_index,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 2],
+ args),
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args)));
+ } else {
+ option_element_vector.push_back(OptionArgElement(
+ opt_defs_index,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 2],
+ args),
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args)));
+ }
+ break;
+ default:
+ // The options table is messed up. Here we'll just continue
+ option_element_vector.push_back(OptionArgElement(
+ OptionArgElement::eUnrecognizedArg,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args),
+ OptionArgElement::eUnrecognizedArg));
+ break;
+ }
+ } else {
+ option_element_vector.push_back(OptionArgElement(
+ OptionArgElement::eUnrecognizedArg,
+ FindOriginalIndex(dummy_vec[OptionParser::GetOptionIndex() - 1],
+ args),
+ OptionArgElement::eUnrecognizedArg));
+ }
+ }
+
+ // Finally we have to handle the case where the cursor index points at a
+ // single "-". We want to mark that in the option_element_vector, but only
+ // if it is not after the "--". But it turns out that OptionParser::Parse
+ // just ignores an isolated "-". So we have to look it up by hand here. We
+ // only care if it is AT the cursor position. Note, a single quoted dash is
+ // not the same as a single dash...
+
+ const Args::ArgEntry &cursor = args[cursor_index];
+ if ((static_cast<int32_t>(dash_dash_pos) == -1 ||
+ cursor_index < dash_dash_pos) &&
+ !cursor.IsQuoted() && cursor.ref == "-") {
+ option_element_vector.push_back(
+ OptionArgElement(OptionArgElement::eBareDash, cursor_index,
+ OptionArgElement::eBareDash));
+ }
+ return option_element_vector;
+}
+
+llvm::Expected<Args> Options::Parse(const Args &args,
+ ExecutionContext *execution_context,
+ lldb::PlatformSP platform_sp,
+ bool require_validation) {
+ StreamString sstr;
+ Status error;
+ Option *long_options = GetLongOptions();
+ if (long_options == nullptr) {
+ return llvm::make_error<llvm::StringError>("Invalid long options.",
+ llvm::inconvertibleErrorCode());
+ }
+
+ for (int i = 0; long_options[i].definition != nullptr; ++i) {
+ if (long_options[i].flag == nullptr) {
+ if (isprint8(long_options[i].val)) {
+ sstr << (char)long_options[i].val;
+ switch (long_options[i].definition->option_has_arg) {
+ default:
+ case OptionParser::eNoArgument:
+ break;
+ case OptionParser::eRequiredArgument:
+ sstr << ':';
+ break;
+ case OptionParser::eOptionalArgument:
+ sstr << "::";
+ break;
+ }
+ }
+ }
+ }
+ std::vector<char *> argv = GetArgvForParsing(args);
+ std::unique_lock<std::mutex> lock;
+ OptionParser::Prepare(lock);
+ int val;
+ while (1) {
+ int long_options_index = -1;
+ val = OptionParser::Parse(argv.size(), &*argv.begin(), sstr.GetString(),
+ long_options, &long_options_index);
+ if (val == -1)
+ break;
+
+ // Did we get an error?
+ if (val == '?') {
+ error.SetErrorStringWithFormat("unknown or ambiguous option");
+ break;
+ }
+ // The option auto-set itself
+ if (val == 0)
+ continue;
+
+ OptionSeen(val);
+
+ // Lookup the long option index
+ if (long_options_index == -1) {
+ for (int i = 0; long_options[i].definition || long_options[i].flag ||
+ long_options[i].val;
+ ++i) {
+ if (long_options[i].val == val) {
+ long_options_index = i;
+ break;
+ }
+ }
+ }
+ // Call the callback with the option
+ if (long_options_index >= 0 &&
+ long_options[long_options_index].definition) {
+ const OptionDefinition *def = long_options[long_options_index].definition;
+
+ if (!platform_sp) {
+ // User did not pass in an explicit platform. Try to grab from the
+ // execution context.
+ TargetSP target_sp =
+ execution_context ? execution_context->GetTargetSP() : TargetSP();
+ platform_sp = target_sp ? target_sp->GetPlatform() : PlatformSP();
+ }
+ OptionValidator *validator = def->validator;
+
+ if (!platform_sp && require_validation) {
+ // Caller requires validation but we cannot validate as we don't have
+ // the mandatory platform against which to validate.
+ return llvm::make_error<llvm::StringError>(
+ "cannot validate options: no platform available",
+ llvm::inconvertibleErrorCode());
+ }
+
+ bool validation_failed = false;
+ if (platform_sp) {
+ // Ensure we have an execution context, empty or not.
+ ExecutionContext dummy_context;
+ ExecutionContext *exe_ctx_p =
+ execution_context ? execution_context : &dummy_context;
+ if (validator && !validator->IsValid(*platform_sp, *exe_ctx_p)) {
+ validation_failed = true;
+ error.SetErrorStringWithFormat("Option \"%s\" invalid. %s",
+ def->long_option,
+ def->validator->LongConditionString());
+ }
+ }
+
+ // As long as validation didn't fail, we set the option value.
+ if (!validation_failed)
+ error =
+ SetOptionValue(long_options_index,
+ (def->option_has_arg == OptionParser::eNoArgument)
+ ? nullptr
+ : OptionParser::GetOptionArgument(),
+ execution_context);
+ } else {
+ error.SetErrorStringWithFormat("invalid option with value '%i'", val);
+ }
+ if (error.Fail())
+ return error.ToError();
+ }
+
+ argv.erase(argv.begin(), argv.begin() + OptionParser::GetOptionIndex());
+ return ReconstituteArgsAfterParsing(argv, args);
+}
diff --git a/source/Interpreter/Property.cpp b/source/Interpreter/Property.cpp
index 5bac5ea0002f..369029bc570d 100644
--- a/source/Interpreter/Property.cpp
+++ b/source/Interpreter/Property.cpp
@@ -16,6 +16,7 @@
#include "lldb/Core/UserSettingsController.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValues.h"
#include "lldb/Target/Language.h"
@@ -53,7 +54,7 @@ Property::Property(const PropertyDefinition &definition)
// "definition.default_cstr_value" as a string value that represents the
// default value.
if (definition.default_cstr_value)
- m_value_sp.reset(new OptionValueBoolean(Args::StringToBoolean(
+ m_value_sp.reset(new OptionValueBoolean(OptionArgParser::ToBoolean(
llvm::StringRef(definition.default_cstr_value), false, nullptr)));
else
m_value_sp.reset(
@@ -62,7 +63,8 @@ Property::Property(const PropertyDefinition &definition)
case OptionValue::eTypeChar: {
llvm::StringRef s(definition.default_cstr_value ? definition.default_cstr_value : "");
- m_value_sp = std::make_shared<OptionValueChar>(Args::StringToChar(s, '\0', nullptr));
+ m_value_sp = std::make_shared<OptionValueChar>(
+ OptionArgParser::ToChar(s, '\0', nullptr));
break;
}
case OptionValue::eTypeDictionary:
@@ -75,8 +77,7 @@ Property::Property(const PropertyDefinition &definition)
// "definition.default_uint_value" is the default enumeration value if
// "definition.default_cstr_value" is NULL, otherwise interpret
// "definition.default_cstr_value" as a string value that represents the
- // default
- // value.
+ // default value.
{
OptionValueEnumeration *enum_value = new OptionValueEnumeration(
definition.enum_values, definition.default_uint_value);
@@ -87,10 +88,10 @@ Property::Property(const PropertyDefinition &definition)
llvm::StringRef(definition.default_cstr_value))
.Success()) {
enum_value->SetDefaultValue(enum_value->GetCurrentValue());
- // Call Clear() since we don't want the value to appear as
- // having been set since we called SetValueFromString() above.
- // Clear will set the current value to the default and clear
- // the boolean that says that the value has been set.
+ // Call Clear() since we don't want the value to appear as having
+ // been set since we called SetValueFromString() above. Clear will
+ // set the current value to the default and clear the boolean that
+ // says that the value has been set.
enum_value->Clear();
}
}
@@ -99,8 +100,7 @@ Property::Property(const PropertyDefinition &definition)
case OptionValue::eTypeFileSpec: {
// "definition.default_uint_value" represents if the
- // "definition.default_cstr_value" should
- // be resolved or not
+ // "definition.default_cstr_value" should be resolved or not
const bool resolve = definition.default_uint_value != 0;
m_value_sp.reset(new OptionValueFileSpec(
FileSpec(definition.default_cstr_value, resolve), resolve));
@@ -115,16 +115,14 @@ Property::Property(const PropertyDefinition &definition)
case OptionValue::eTypeFormat:
// "definition.default_uint_value" is the default format enumeration value
- // if
- // "definition.default_cstr_value" is NULL, otherwise interpret
+ // if "definition.default_cstr_value" is NULL, otherwise interpret
// "definition.default_cstr_value" as a string value that represents the
- // default
- // value.
+ // default value.
{
Format new_format = eFormatInvalid;
if (definition.default_cstr_value)
- Args::StringToFormat(definition.default_cstr_value, new_format,
- nullptr);
+ OptionArgParser::ToFormat(definition.default_cstr_value, new_format,
+ nullptr);
else
new_format = (Format)definition.default_uint_value;
m_value_sp.reset(new OptionValueFormat(new_format));
@@ -132,12 +130,10 @@ Property::Property(const PropertyDefinition &definition)
break;
case OptionValue::eTypeLanguage:
- // "definition.default_uint_value" is the default language enumeration value
- // if
- // "definition.default_cstr_value" is NULL, otherwise interpret
+ // "definition.default_uint_value" is the default language enumeration
+ // value if "definition.default_cstr_value" is NULL, otherwise interpret
// "definition.default_cstr_value" as a string value that represents the
- // default
- // value.
+ // default value.
{
LanguageType new_lang = eLanguageTypeUnknown;
if (definition.default_cstr_value)
@@ -158,8 +154,7 @@ Property::Property(const PropertyDefinition &definition)
case OptionValue::eTypePathMap:
// "definition.default_uint_value" tells us if notifications should occur
- // for
- // path mappings
+ // for path mappings
m_value_sp.reset(
new OptionValuePathMappings(definition.default_uint_value != 0));
break;
@@ -175,8 +170,7 @@ Property::Property(const PropertyDefinition &definition)
// "definition.default_uint_value" is the default integer value if
// "definition.default_cstr_value" is NULL, otherwise interpret
// "definition.default_cstr_value" as a string value that represents the
- // default
- // value.
+ // default value.
m_value_sp.reset(new OptionValueSInt64(
definition.default_cstr_value
? StringConvert::ToSInt64(definition.default_cstr_value)
@@ -187,8 +181,7 @@ Property::Property(const PropertyDefinition &definition)
// "definition.default_uint_value" is the default unsigned integer value if
// "definition.default_cstr_value" is NULL, otherwise interpret
// "definition.default_cstr_value" as a string value that represents the
- // default
- // value.
+ // default value.
m_value_sp.reset(new OptionValueUInt64(
definition.default_cstr_value
? StringConvert::ToUInt64(definition.default_cstr_value)
@@ -201,15 +194,15 @@ Property::Property(const PropertyDefinition &definition)
{
UUID uuid;
if (definition.default_cstr_value)
- uuid.SetFromCString(definition.default_cstr_value);
+ uuid.SetFromStringRef(definition.default_cstr_value);
m_value_sp.reset(new OptionValueUUID(uuid));
}
break;
case OptionValue::eTypeString:
- // "definition.default_uint_value" can contain the string option flags OR'ed
- // together
- // "definition.default_cstr_value" can contain a default string value
+ // "definition.default_uint_value" can contain the string option flags
+ // OR'ed together "definition.default_cstr_value" can contain a default
+ // string value
{
OptionValueString *string_value =
new OptionValueString(definition.default_cstr_value);
diff --git a/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp b/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
index 1bd1c1bf8dd4..e0e293d7ae68 100644
--- a/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
+++ b/source/Plugins/ABI/MacOSX-arm/ABIMacOSX_arm.cpp
@@ -1466,8 +1466,8 @@ bool ABIMacOSX_arm::GetArgumentValues(Thread &thread, ValueList &values) const {
addr_t sp = 0;
for (uint32_t value_idx = 0; value_idx < num_values; ++value_idx) {
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
Value *value = values.GetValueAtIndex(value_idx);
if (!value)
@@ -1589,10 +1589,8 @@ ValueObjectSP ABIMacOSX_arm::GetReturnValueObjectImpl(
case 128:
if (IsArmv7kProcess()) {
// "A composite type not larger than 16 bytes is returned in r0-r3. The
- // format is
- // as if the result had been stored in memory at a word-aligned address
- // and then
- // loaded into r0-r3 with an ldm instruction"
+ // format is as if the result had been stored in memory at a word-
+ // aligned address and then loaded into r0-r3 with an ldm instruction"
{
const RegisterInfo *r1_reg_info =
reg_ctx->GetRegisterInfoByName("r1", 0);
@@ -1756,10 +1754,8 @@ Status ABIMacOSX_arm::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
}
} else if (num_bytes <= 16 && IsArmv7kProcess()) {
// "A composite type not larger than 16 bytes is returned in r0-r3. The
- // format is
- // as if the result had been stored in memory at a word-aligned address
- // and then
- // loaded into r0-r3 with an ldm instruction"
+ // format is as if the result had been stored in memory at a word-aligned
+ // address and then loaded into r0-r3 with an ldm instruction"
const RegisterInfo *r0_info = reg_ctx->GetRegisterInfoByName("r0", 0);
const RegisterInfo *r1_info = reg_ctx->GetRegisterInfoByName("r1", 0);
diff --git a/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp b/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
index e301b21d542a..85f864ec7561 100644
--- a/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
+++ b/source/Plugins/ABI/MacOSX-arm64/ABIMacOSX_arm64.cpp
@@ -1760,8 +1760,8 @@ bool ABIMacOSX_arm64::GetArgumentValues(Thread &thread,
addr_t sp = 0;
for (uint32_t value_idx = 0; value_idx < num_values; ++value_idx) {
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
Value *value = values.GetValueAtIndex(value_idx);
if (!value)
@@ -2022,10 +2022,9 @@ bool ABIMacOSX_arm64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
}
// AAPCS64 (Procedure Call Standard for the ARM 64-bit Architecture) says
-// registers x19 through x28 and sp are callee preserved.
-// v8-v15 are non-volatile (and specifically only the lower 8 bytes of these
-// regs),
-// the rest of the fp/SIMD registers are volatile.
+// registers x19 through x28 and sp are callee preserved. v8-v15 are non-
+// volatile (and specifically only the lower 8 bytes of these regs), the rest
+// of the fp/SIMD registers are volatile.
// We treat x29 as callee preserved also, else the unwinder won't try to
// retrieve fp saves.
@@ -2209,14 +2208,14 @@ static bool LoadValueFromConsecutiveGPRRegisters(
} else {
const RegisterInfo *reg_info = nullptr;
if (is_return_value) {
- // We are assuming we are decoding this immediately after returning
- // from a function call and that the address of the structure is in x8
+ // We are assuming we are decoding this immediately after returning from
+ // a function call and that the address of the structure is in x8
reg_info = reg_ctx->GetRegisterInfoByName("x8", 0);
} else {
// We are assuming we are stopped at the first instruction in a function
- // and that the ABI is being respected so all parameters appear where they
- // should be (functions with no external linkage can legally violate the
- // ABI).
+ // and that the ABI is being respected so all parameters appear where
+ // they should be (functions with no external linkage can legally violate
+ // the ABI).
if (NGRN >= 8)
return false;
diff --git a/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp b/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
index 716a73b854b3..9e5e39ec28ca 100644
--- a/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
+++ b/source/Plugins/ABI/MacOSX-i386/ABIMacOSX_i386.cpp
@@ -736,10 +736,10 @@ bool ABIMacOSX_i386::PrepareTrivialCall(Thread &thread, addr_t sp,
uint32_t sp_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber(
eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
- // When writing a register value down to memory, the register info used
- // to write memory just needs to have the correct size of a 32 bit register,
- // the actual register it pertains to is not important, just the size needs
- // to be correct. Here we use "eax"...
+ // When writing a register value down to memory, the register info used to
+ // write memory just needs to have the correct size of a 32 bit register, the
+ // actual register it pertains to is not important, just the size needs to be
+ // correct. Here we use "eax"...
const RegisterInfo *reg_info_32 = reg_ctx->GetRegisterInfoByName("eax");
if (!reg_info_32)
return false; // TODO this should actually never happen
@@ -828,8 +828,8 @@ bool ABIMacOSX_i386::GetArgumentValues(Thread &thread,
if (!value)
return false;
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
CompilerType compiler_type(value->GetCompilerType());
if (compiler_type) {
bool is_signed;
@@ -1075,12 +1075,13 @@ bool ABIMacOSX_i386::RegisterIsVolatile(const RegisterInfo *reg_info) {
}
// v.
-// http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/LowLevelABI/130-IA-32_Function_Calling_Conventions/IA32.html#//apple_ref/doc/uid/TP40002492-SW4
+// http://developer.apple.com/library/mac/#documentation/developertools/Conceptual/LowLevelABI/130
+// -IA-
+// 32_Function_Calling_Conventions/IA32.html#//apple_ref/doc/uid/TP40002492-SW4
//
// This document ("OS X ABI Function Call Guide", chapter "IA-32 Function
-// Calling Conventions")
-// says that the following registers on i386 are preserved aka non-volatile aka
-// callee-saved:
+// Calling Conventions") says that the following registers on i386 are
+// preserved aka non-volatile aka callee-saved:
//
// ebx, ebp, esi, edi, esp
diff --git a/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp b/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
index 882d5cd23e58..af7ac469e6db 100644
--- a/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
+++ b/source/Plugins/ABI/SysV-arm/ABISysV_arm.cpp
@@ -1470,8 +1470,8 @@ bool ABISysV_arm::GetArgumentValues(Thread &thread, ValueList &values) const {
addr_t sp = 0;
for (uint32_t value_idx = 0; value_idx < num_values; ++value_idx) {
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
Value *value = values.GetValueAtIndex(value_idx);
if (!value)
diff --git a/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp b/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
index dbe333c4649e..2c221689954c 100644
--- a/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
+++ b/source/Plugins/ABI/SysV-arm64/ABISysV_arm64.cpp
@@ -1763,8 +1763,8 @@ bool ABISysV_arm64::GetArgumentValues(Thread &thread, ValueList &values) const {
addr_t sp = 0;
for (uint32_t value_idx = 0; value_idx < num_values; ++value_idx) {
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
Value *value = values.GetValueAtIndex(value_idx);
if (!value)
@@ -1994,10 +1994,9 @@ bool ABISysV_arm64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
}
// AAPCS64 (Procedure Call Standard for the ARM 64-bit Architecture) says
-// registers x19 through x28 and sp are callee preserved.
-// v8-v15 are non-volatile (and specifically only the lower 8 bytes of these
-// regs),
-// the rest of the fp/SIMD registers are volatile.
+// registers x19 through x28 and sp are callee preserved. v8-v15 are non-
+// volatile (and specifically only the lower 8 bytes of these regs), the rest
+// of the fp/SIMD registers are volatile.
// We treat x29 as callee preserved also, else the unwinder won't try to
// retrieve fp saves.
@@ -2020,10 +2019,10 @@ bool ABISysV_arm64::RegisterIsVolatile(const RegisterInfo *reg_info) {
if (name[0] == 'x' || name[0] == 'r') {
// Volatile registers: x0-x18
- // Although documentation says only x19-28 + sp are callee saved
- // We ll also have to treat x30 as non-volatile.
- // Each dwarf frame has its own value of lr.
- // Return false for the non-volatile gpr regs, true for everything else
+ // Although documentation says only x19-28 + sp are callee saved We ll
+ // also have to treat x30 as non-volatile. Each dwarf frame has its own
+ // value of lr. Return false for the non-volatile gpr regs, true for
+ // everything else
switch (name[1]) {
case '1':
switch (name[2]) {
@@ -2180,14 +2179,14 @@ static bool LoadValueFromConsecutiveGPRRegisters(
} else {
const RegisterInfo *reg_info = nullptr;
if (is_return_value) {
- // We are assuming we are decoding this immediately after returning
- // from a function call and that the address of the structure is in x8
+ // We are assuming we are decoding this immediately after returning from
+ // a function call and that the address of the structure is in x8
reg_info = reg_ctx->GetRegisterInfoByName("x8", 0);
} else {
// We are assuming we are stopped at the first instruction in a function
- // and that the ABI is being respected so all parameters appear where they
- // should be (functions with no external linkage can legally violate the
- // ABI).
+ // and that the ABI is being respected so all parameters appear where
+ // they should be (functions with no external linkage can legally violate
+ // the ABI).
if (NGRN >= 8)
return false;
diff --git a/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp b/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
index 74274f08b24f..a30416cf5a8e 100644
--- a/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
+++ b/source/Plugins/ABI/SysV-hexagon/ABISysV_hexagon.cpp
@@ -1214,8 +1214,8 @@ ValueObjectSP ABISysV_hexagon::GetReturnValueObjectImpl(
return return_valobj_sp;
}
-// called when we are on the first instruction of a new function
-// for hexagon the return address is in RA (R31)
+// called when we are on the first instruction of a new function for hexagon
+// the return address is in RA (R31)
bool ABISysV_hexagon::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
unwind_plan.Clear();
unwind_plan.SetRegisterKind(eRegisterKindGeneric);
diff --git a/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp b/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
index d799c587dd07..e7ddfccea338 100644
--- a/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
+++ b/source/Plugins/ABI/SysV-i386/ABISysV_i386.cpp
@@ -3,8 +3,7 @@
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
-// License.
-// See LICENSE.TXT for details.
+// License. See LICENSE.TXT for details.
//===----------------------------------------------------------------------===//
#include "ABISysV_i386.h"
@@ -56,8 +55,8 @@ using namespace lldb_private;
// DWARF Register Number Mapping
// See Table 2.14 of the reference document (specified on top of this file)
-// Comment: Table 2.14 is followed till 'mm' entries.
-// After that, all entries are ignored here.
+// Comment: Table 2.14 is followed till 'mm' entries. After that, all entries
+// are ignored here.
enum dwarf_regnums {
dwarf_eax = 0,
@@ -228,12 +227,10 @@ bool ABISysV_i386::PrepareTrivialCall(Thread &thread, addr_t sp,
uint32_t sp_reg_num = reg_ctx->ConvertRegisterKindToRegisterNumber(
eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
- // While using register info to write a register value to memory, the register
- // info
- // just needs to have the correct size of a 32 bit register, the actual
- // register it
- // pertains to is not important, just the size needs to be correct.
- // "eax" is used here for this purpose.
+ // While using register info to write a register value to memory, the
+ // register info just needs to have the correct size of a 32 bit register,
+ // the actual register it pertains to is not important, just the size needs
+ // to be correct. "eax" is used here for this purpose.
const RegisterInfo *reg_info_32 = reg_ctx->GetRegisterInfoByName("eax");
if (!reg_info_32)
return false; // TODO this should actually never happen
@@ -364,8 +361,8 @@ Status ABISysV_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
}
// Following "IF ELSE" block categorizes various 'Fundamental Data Types'.
- // The terminology 'Fundamental Data Types' used here is adopted from
- // Table 2.1 of the reference document (specified on top of this file)
+ // The terminology 'Fundamental Data Types' used here is adopted from Table
+ // 2.1 of the reference document (specified on top of this file)
if (type_flags & eTypeIsPointer) // 'Pointer'
{
@@ -390,8 +387,8 @@ Status ABISysV_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
default:
break;
case 16:
- // For clang::BuiltinType::UInt128 & Int128
- // ToDo: Need to decide how to handle it
+ // For clang::BuiltinType::UInt128 & Int128 ToDo: Need to decide how to
+ // handle it
break;
case 8: {
uint32_t raw_value_low = data.GetMaxU32(&offset, 4);
@@ -470,8 +467,8 @@ Status ABISysV_i386::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
error.SetErrorString("Implementation is missing for this clang type.");
}
} else {
- // Neither 'Integral' nor 'Floating Point'. If flow reaches here
- // then check type_flags. This type_flags is not a valid type.
+ // Neither 'Integral' nor 'Floating Point'. If flow reaches here then
+ // check type_flags. This type_flags is not a valid type.
error.SetErrorString("Invalid clang type");
}
} else {
@@ -508,8 +505,8 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
reg_ctx->GetRegisterInfoByName("edx", 0)->kinds[eRegisterKindLLDB];
// Following "IF ELSE" block categorizes various 'Fundamental Data Types'.
- // The terminology 'Fundamental Data Types' used here is adopted from
- // Table 2.1 of the reference document (specified on top of this file)
+ // The terminology 'Fundamental Data Types' used here is adopted from Table
+ // 2.1 of the reference document (specified on top of this file)
if (type_flags & eTypeIsPointer) // 'Pointer'
{
@@ -543,8 +540,8 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
break;
case 16:
- // For clang::BuiltinType::UInt128 & Int128
- // ToDo: Need to decide how to handle it
+ // For clang::BuiltinType::UInt128 & Int128 ToDo: Need to decide how to
+ // handle it
break;
case 8:
@@ -612,8 +609,8 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
success = true;
} else if (byte_size == 8) // double is 8 bytes
{
- // On Android Platform: long double is also 8 bytes
- // It will be handled here only.
+ // On Android Platform: long double is also 8 bytes It will be
+ // handled here only.
double value_double = (double)value_long_double;
value.GetScalar() = value_double;
success = true;
@@ -639,8 +636,8 @@ ValueObjectSP ABISysV_i386::GetReturnValueObjectSimple(
}
} else // Neither 'Integral' nor 'Floating Point'
{
- // If flow reaches here then check type_flags
- // This type_flags is unhandled
+ // If flow reaches here then check type_flags This type_flags is
+ // unhandled
}
} else if (type_flags & eTypeIsComplex) // 'Complex Floating Point'
{
@@ -797,9 +794,9 @@ bool ABISysV_i386::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
return true;
}
-// According to "Register Usage" in reference document (specified on top
-// of this source file) ebx, ebp, esi, edi and esp registers are preserved
-// i.e. non-volatile i.e. callee-saved on i386
+// According to "Register Usage" in reference document (specified on top of
+// this source file) ebx, ebp, esi, edi and esp registers are preserved i.e.
+// non-volatile i.e. callee-saved on i386
bool ABISysV_i386::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
if (!reg_info)
return false;
diff --git a/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp b/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
index 95e2a7b0afeb..ce02f8677a63 100644
--- a/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
+++ b/source/Plugins/ABI/SysV-mips/ABISysV_mips.cpp
@@ -698,8 +698,8 @@ bool ABISysV_mips::PrepareTrivialCall(Thread &thread, addr_t sp,
if (log)
log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
- // All callers of position independent functions must place the address of the
- // called function in t9 (r25)
+ // All callers of position independent functions must place the address of
+ // the called function in t9 (r25)
if (!reg_ctx->WriteRegisterFromUnsigned(r25_info, func_addr))
return false;
@@ -867,8 +867,8 @@ ValueObjectSP ABISysV_mips::GetReturnValueObjectImpl(
UINT32_MAX;
value.GetScalar() = ptr;
} else if (return_compiler_type.IsAggregateType()) {
- // Structure/Vector is always passed in memory and pointer to that memory is
- // passed in r2.
+ // Structure/Vector is always passed in memory and pointer to that memory
+ // is passed in r2.
uint64_t mem_address = reg_ctx->ReadRegisterAsUnsigned(
reg_ctx->GetRegisterInfoByName("r2", 0), 0);
// We have got the address. Create a memory object out of it
diff --git a/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp b/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
index 749e170fa17d..b958abf25637 100644
--- a/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
+++ b/source/Plugins/ABI/SysV-mips64/ABISysV_mips64.cpp
@@ -661,8 +661,8 @@ bool ABISysV_mips64::PrepareTrivialCall(Thread &thread, addr_t sp,
if (log)
log->Printf("Writing r25: 0x%" PRIx64, (uint64_t)func_addr);
- // All callers of position independent functions must place the address of the
- // called function in t9 (r25)
+ // All callers of position independent functions must place the address of
+ // the called function in t9 (r25)
if (!reg_ctx->WriteRegisterFromUnsigned(r25_info, func_addr))
return false;
@@ -1035,10 +1035,9 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
}
}
- // If we reach here, it means this structure either contains more than two
- // fields or
- // it contains at least one non floating point type.
- // In that case, all fields are returned in GP return registers.
+ // If we reach here, it means this structure either contains more than
+ // two fields or it contains at least one non floating point type. In
+ // that case, all fields are returned in GP return registers.
for (uint32_t idx = 0; idx < num_children; idx++) {
uint64_t field_bit_offset = 0;
bool is_signed;
@@ -1049,8 +1048,8 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
const size_t field_byte_width =
field_compiler_type.GetByteSize(nullptr);
- // if we don't know the size of the field (e.g. invalid type), just bail
- // out
+ // if we don't know the size of the field (e.g. invalid type), just
+ // bail out
if (field_byte_width == 0)
break;
@@ -1078,16 +1077,15 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
}
}
// We already have consumed at-least 8 bytes that means r2 is done,
- // and this field will be in r3.
- // Check if this field can fit in r3.
+ // and this field will be in r3. Check if this field can fit in r3.
else if (integer_bytes + field_byte_width + padding <= 16) {
integer_bytes = integer_bytes + field_byte_width + padding;
use_r3 = 1;
} else {
- // There isn't any space left for this field, this should not happen
- // as we have already checked
- // the overall size is not greater than 16 bytes. For now, return a
- // nullptr return value object.
+ // There isn't any space left for this field, this should not
+ // happen as we have already checked the overall size is not
+ // greater than 16 bytes. For now, return a nullptr return value
+ // object.
return return_valobj_sp;
}
}
@@ -1123,15 +1121,16 @@ ValueObjectSP ABISysV_mips64::GetReturnValueObjectImpl(
sucess = 1;
}
if (sucess) {
- // The result is in our data buffer. Create a variable object out of it
+ // The result is in our data buffer. Create a variable object out of
+ // it
return_valobj_sp = ValueObjectConstResult::Create(
&thread, return_compiler_type, ConstString(""), return_ext);
}
return return_valobj_sp;
}
- // Any structure/vector greater than 16 bytes in size is returned in memory.
- // The pointer to that memory is returned in r2.
+ // Any structure/vector greater than 16 bytes in size is returned in
+ // memory. The pointer to that memory is returned in r2.
uint64_t mem_address = reg_ctx->ReadRegisterAsUnsigned(
reg_ctx->GetRegisterInfoByName("r2", 0), 0);
diff --git a/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp b/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
index 2fee176739f3..e93dcdbe1a59 100644
--- a/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
+++ b/source/Plugins/ABI/SysV-ppc/ABISysV_ppc.cpp
@@ -402,8 +402,8 @@ bool ABISysV_ppc::GetArgumentValues(Thread &thread, ValueList &values) const {
if (!value)
return false;
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
CompilerType compiler_type = value->GetCompilerType();
if (!compiler_type)
return false;
@@ -501,8 +501,8 @@ Status ABISysV_ppc::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
if (!set_it_simple) {
// Okay we've got a structure or something that doesn't fit in a simple
- // register.
- // We should figure out where it really goes, but we don't support this yet.
+ // register. We should figure out where it really goes, but we don't
+ // support this yet.
error.SetErrorString("We only support setting simple integer and float "
"return types at present.");
}
@@ -735,10 +735,9 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
copy_from_offset = integer_bytes - 8;
integer_bytes += field_byte_width;
} else {
- // The last field didn't fit. I can't see how that would happen w/o
- // the overall size being
- // greater than 16 bytes. For now, return a nullptr return value
- // object.
+ // The last field didn't fit. I can't see how that would happen
+ // w/o the overall size being greater than 16 bytes. For now,
+ // return a nullptr return value object.
return return_valobj_sp;
}
} else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
@@ -751,10 +750,9 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
fp_bytes += field_byte_width;
} else if (field_bit_width == 32) {
// This one is kind of complicated. If we are in an "eightbyte"
- // with another float, we'll
- // be stuffed into an xmm register with it. If we are in an
- // "eightbyte" with one or more ints,
- // then we will be stuffed into the appropriate GPR with them.
+ // with another float, we'll be stuffed into an xmm register with
+ // it. If we are in an "eightbyte" with one or more ints, then we
+ // will be stuffed into the appropriate GPR with them.
bool in_gpr;
if (field_byte_offset % 8 == 0) {
// We are at the beginning of one of the eightbytes, so check the
@@ -776,9 +774,9 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
}
}
} else if (field_byte_offset % 4 == 0) {
- // We are inside of an eightbyte, so see if the field before us is
- // floating point:
- // This could happen if somebody put padding in the structure.
+ // We are inside of an eightbyte, so see if the field before us
+ // is floating point: This could happen if somebody put padding
+ // in the structure.
if (idx == 0)
in_gpr = false;
else {
@@ -819,9 +817,9 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
}
}
- // These two tests are just sanity checks. If I somehow get the
- // type calculation wrong above it is better to just return nothing
- // than to assert or crash.
+ // These two tests are just sanity checks. If I somehow get the type
+ // calculation wrong above it is better to just return nothing than to
+ // assert or crash.
if (!copy_from_extractor)
return return_valobj_sp;
if (copy_from_offset + field_byte_width >
@@ -845,9 +843,8 @@ ValueObjectSP ABISysV_ppc::GetReturnValueObjectImpl(
// FIXME: This is just taking a guess, r3 may very well no longer hold the
// return storage location.
// If we are going to do this right, when we make a new frame we should
- // check to see if it uses a memory
- // return, and if we are at the first instruction and if so stash away the
- // return location. Then we would
+ // check to see if it uses a memory return, and if we are at the first
+ // instruction and if so stash away the return location. Then we would
// only return the memory return value if we know it is valid.
if (is_memory) {
@@ -918,9 +915,9 @@ bool ABISysV_ppc::RegisterIsVolatile(const RegisterInfo *reg_info) {
// See "Register Usage" in the
// "System V Application Binary Interface"
-// "64-bit PowerPC ELF Application Binary Interface Supplement"
-// current version is 1.9 released 2004 at
-// http://refspecs.linuxfoundation.org/ELF/ppc/PPC-elf64abi-1.9.pdf
+// "64-bit PowerPC ELF Application Binary Interface Supplement" current version
+// is 1.9 released 2004 at http://refspecs.linuxfoundation.org/ELF/ppc/PPC-
+// elf64abi-1.9.pdf
bool ABISysV_ppc::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
if (reg_info) {
diff --git a/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp b/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
index 0348853c7fa0..d0140a0c894a 100644
--- a/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
+++ b/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.cpp
@@ -16,6 +16,8 @@
#include "llvm/ADT/Triple.h"
// Project includes
+#include "Utility/PPC64LE_DWARF_Registers.h"
+#include "Utility/PPC64_DWARF_Registers.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/RegisterValue.h"
@@ -23,6 +25,7 @@
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectMemory.h"
#include "lldb/Core/ValueObjectRegister.h"
+#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
@@ -34,201 +37,48 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
-using namespace lldb;
-using namespace lldb_private;
+#include "clang/AST/ASTContext.h"
+#include "clang/AST/Attr.h"
+#include "clang/AST/Decl.h"
-enum dwarf_regnums {
- dwarf_r0 = 0,
- dwarf_r1,
- dwarf_r2,
- dwarf_r3,
- dwarf_r4,
- dwarf_r5,
- dwarf_r6,
- dwarf_r7,
- dwarf_r8,
- dwarf_r9,
- dwarf_r10,
- dwarf_r11,
- dwarf_r12,
- dwarf_r13,
- dwarf_r14,
- dwarf_r15,
- dwarf_r16,
- dwarf_r17,
- dwarf_r18,
- dwarf_r19,
- dwarf_r20,
- dwarf_r21,
- dwarf_r22,
- dwarf_r23,
- dwarf_r24,
- dwarf_r25,
- dwarf_r26,
- dwarf_r27,
- dwarf_r28,
- dwarf_r29,
- dwarf_r30,
- dwarf_r31,
- dwarf_f0,
- dwarf_f1,
- dwarf_f2,
- dwarf_f3,
- dwarf_f4,
- dwarf_f5,
- dwarf_f6,
- dwarf_f7,
- dwarf_f8,
- dwarf_f9,
- dwarf_f10,
- dwarf_f11,
- dwarf_f12,
- dwarf_f13,
- dwarf_f14,
- dwarf_f15,
- dwarf_f16,
- dwarf_f17,
- dwarf_f18,
- dwarf_f19,
- dwarf_f20,
- dwarf_f21,
- dwarf_f22,
- dwarf_f23,
- dwarf_f24,
- dwarf_f25,
- dwarf_f26,
- dwarf_f27,
- dwarf_f28,
- dwarf_f29,
- dwarf_f30,
- dwarf_f31,
- dwarf_cr,
- dwarf_fpscr,
- dwarf_xer = 101,
- dwarf_lr = 108,
- dwarf_ctr,
- dwarf_pc,
- dwarf_cfa,
-};
+#define DECLARE_REGISTER_INFOS_PPC64_STRUCT
+#include "Plugins/Process/Utility/RegisterInfos_ppc64.h"
+#undef DECLARE_REGISTER_INFOS_PPC64_STRUCT
-// Note that the size and offset will be updated by platform-specific classes.
-#define DEFINE_GPR(reg, alt, kind1, kind2, kind3, kind4) \
- { \
- #reg, alt, 8, 0, eEncodingUint, eFormatHex, {kind1, kind2, kind3, kind4 }, \
- nullptr, nullptr, nullptr, 0 \
- }
+#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
+#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
+#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-static const RegisterInfo g_register_infos[] = {
- // General purpose registers. eh_frame, DWARF,
- // Generic, Process Plugin
- DEFINE_GPR(r0, nullptr, dwarf_r0, dwarf_r0, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r1, "sp", dwarf_r1, dwarf_r1, LLDB_REGNUM_GENERIC_SP,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r2, nullptr, dwarf_r2, dwarf_r2, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r3, "arg1", dwarf_r3, dwarf_r3, LLDB_REGNUM_GENERIC_ARG1,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r4, "arg2", dwarf_r4, dwarf_r4, LLDB_REGNUM_GENERIC_ARG2,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r5, "arg3", dwarf_r5, dwarf_r5, LLDB_REGNUM_GENERIC_ARG3,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r6, "arg4", dwarf_r6, dwarf_r6, LLDB_REGNUM_GENERIC_ARG4,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r7, "arg5", dwarf_r7, dwarf_r7, LLDB_REGNUM_GENERIC_ARG5,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r8, "arg6", dwarf_r8, dwarf_r8, LLDB_REGNUM_GENERIC_ARG6,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r9, "arg7", dwarf_r9, dwarf_r9, LLDB_REGNUM_GENERIC_ARG7,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r10, "arg8", dwarf_r10, dwarf_r10, LLDB_REGNUM_GENERIC_ARG8,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r11, nullptr, dwarf_r11, dwarf_r11, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r12, nullptr, dwarf_r12, dwarf_r12, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r13, nullptr, dwarf_r13, dwarf_r13, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r14, nullptr, dwarf_r14, dwarf_r14, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r15, nullptr, dwarf_r15, dwarf_r15, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r16, nullptr, dwarf_r16, dwarf_r16, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r17, nullptr, dwarf_r17, dwarf_r17, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r18, nullptr, dwarf_r18, dwarf_r18, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r19, nullptr, dwarf_r19, dwarf_r19, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r20, nullptr, dwarf_r20, dwarf_r20, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r21, nullptr, dwarf_r21, dwarf_r21, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r22, nullptr, dwarf_r22, dwarf_r22, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r23, nullptr, dwarf_r23, dwarf_r23, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r24, nullptr, dwarf_r24, dwarf_r24, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r25, nullptr, dwarf_r25, dwarf_r25, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r26, nullptr, dwarf_r26, dwarf_r26, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r27, nullptr, dwarf_r27, dwarf_r27, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r28, nullptr, dwarf_r28, dwarf_r28, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r29, nullptr, dwarf_r29, dwarf_r29, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r30, nullptr, dwarf_r30, dwarf_r30, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(r31, nullptr, dwarf_r31, dwarf_r31, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(lr, "lr", dwarf_lr, dwarf_lr, LLDB_REGNUM_GENERIC_RA,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(cr, "cr", dwarf_cr, dwarf_cr, LLDB_REGNUM_GENERIC_FLAGS,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(xer, "xer", dwarf_xer, dwarf_xer, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(ctr, "ctr", dwarf_ctr, dwarf_ctr, LLDB_INVALID_REGNUM,
- LLDB_INVALID_REGNUM),
- DEFINE_GPR(pc, "pc", dwarf_pc, dwarf_pc, LLDB_REGNUM_GENERIC_PC,
- LLDB_INVALID_REGNUM),
- {nullptr,
- nullptr,
- 8,
- 0,
- eEncodingUint,
- eFormatHex,
- {dwarf_cfa, dwarf_cfa, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM},
- nullptr,
- nullptr,
- nullptr,
- 0}};
-
-static const uint32_t k_num_register_infos =
- llvm::array_lengthof(g_register_infos);
+using namespace lldb;
+using namespace lldb_private;
const lldb_private::RegisterInfo *
ABISysV_ppc64::GetRegisterInfoArray(uint32_t &count) {
- count = k_num_register_infos;
- return g_register_infos;
+ if (GetByteOrder() == lldb::eByteOrderLittle) {
+ count = llvm::array_lengthof(g_register_infos_ppc64le);
+ return g_register_infos_ppc64le;
+ } else {
+ count = llvm::array_lengthof(g_register_infos_ppc64);
+ return g_register_infos_ppc64;
+ }
}
size_t ABISysV_ppc64::GetRedZoneSize() const { return 224; }
+lldb::ByteOrder ABISysV_ppc64::GetByteOrder() const {
+ return GetProcessSP()->GetByteOrder();
+}
+
//------------------------------------------------------------------
// Static Functions
//------------------------------------------------------------------
ABISP
-ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp, const ArchSpec &arch) {
- static ABISP g_abi_sp;
- if (arch.GetTriple().getArch() == llvm::Triple::ppc64) {
- if (!g_abi_sp)
- g_abi_sp.reset(new ABISysV_ppc64(process_sp));
- return g_abi_sp;
+ABISysV_ppc64::CreateInstance(lldb::ProcessSP process_sp,
+ const ArchSpec &arch) {
+ if (arch.GetTriple().getArch() == llvm::Triple::ppc64 ||
+ arch.GetTriple().getArch() == llvm::Triple::ppc64le) {
+ return ABISP(new ABISysV_ppc64(process_sp));
}
return ABISP();
}
@@ -280,28 +130,68 @@ bool ABISysV_ppc64::PrepareTrivialCall(Thread &thread, addr_t sp,
sp &= ~(0xfull); // 16-byte alignment
- sp -= 8;
+ sp -= 544; // allocate frame to save TOC, RA and SP.
Status error;
+ uint64_t reg_value;
const RegisterInfo *pc_reg_info =
reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
const RegisterInfo *sp_reg_info =
reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_SP);
ProcessSP process_sp(thread.GetProcess());
+ const RegisterInfo *lr_reg_info =
+ reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA);
+ const RegisterInfo *r2_reg_info = reg_ctx->GetRegisterInfoAtIndex(2);
+ const RegisterInfo *r12_reg_info = reg_ctx->GetRegisterInfoAtIndex(12);
- RegisterValue reg_value;
-
+ // Save return address onto the stack.
if (log)
log->Printf("Pushing the return address onto the stack: 0x%" PRIx64
- ": 0x%" PRIx64,
+ "(+16): 0x%" PRIx64,
(uint64_t)sp, (uint64_t)return_addr);
+ if (!process_sp->WritePointerToMemory(sp + 16, return_addr, error))
+ return false;
- // Save return address onto the stack
- if (!process_sp->WritePointerToMemory(sp, return_addr, error))
+ // Write the return address to link register.
+ if (log)
+ log->Printf("Writing LR: 0x%" PRIx64, (uint64_t)return_addr);
+ if (!reg_ctx->WriteRegisterFromUnsigned(lr_reg_info, return_addr))
return false;
- // %r1 is set to the actual stack value.
+ // Write target address to %r12 register.
+ if (log)
+ log->Printf("Writing R12: 0x%" PRIx64, (uint64_t)func_addr);
+ if (!reg_ctx->WriteRegisterFromUnsigned(r12_reg_info, func_addr))
+ return false;
+
+ // Read TOC pointer value.
+ reg_value = reg_ctx->ReadRegisterAsUnsigned(r2_reg_info, 0);
+
+ // Write TOC pointer onto the stack.
+ uint64_t stack_offset;
+ if (GetByteOrder() == lldb::eByteOrderLittle)
+ stack_offset = 24;
+ else
+ stack_offset = 40;
+
+ if (log)
+ log->Printf("Writing R2 (TOC) at SP(0x%" PRIx64 ")+%d: 0x%" PRIx64,
+ (uint64_t)(sp + stack_offset), (int)stack_offset,
+ (uint64_t)reg_value);
+ if (!process_sp->WritePointerToMemory(sp + stack_offset, reg_value, error))
+ return false;
+
+ // Read the current SP value.
+ reg_value = reg_ctx->ReadRegisterAsUnsigned(sp_reg_info, 0);
+
+ // Save current SP onto the stack.
+ if (log)
+ log->Printf("Writing SP at SP(0x%" PRIx64 ")+0: 0x%" PRIx64, (uint64_t)sp,
+ (uint64_t)reg_value);
+ if (!process_sp->WritePointerToMemory(sp, reg_value, error))
+ return false;
+ // %r1 is set to the actual stack value.
if (log)
log->Printf("Writing SP: 0x%" PRIx64, (uint64_t)sp);
@@ -365,34 +255,23 @@ bool ABISysV_ppc64::GetArgumentValues(Thread &thread, ValueList &values) const {
if (!sp)
return false;
- addr_t current_stack_argument = sp + 48; // jump over return address
+ uint64_t stack_offset;
+ if (GetByteOrder() == lldb::eByteOrderLittle)
+ stack_offset = 32;
+ else
+ stack_offset = 48;
+ // jump over return address.
+ addr_t current_stack_argument = sp + stack_offset;
uint32_t argument_register_ids[8];
- argument_register_ids[0] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG1)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[1] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG2)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[2] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG3)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[3] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG4)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[4] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG5)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[5] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG6)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[6] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG7)
- ->kinds[eRegisterKindLLDB];
- argument_register_ids[7] =
- reg_ctx->GetRegisterInfo(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_ARG8)
- ->kinds[eRegisterKindLLDB];
+ for (size_t i = 0; i < 8; ++i) {
+ argument_register_ids[i] =
+ reg_ctx
+ ->GetRegisterInfo(eRegisterKindGeneric,
+ LLDB_REGNUM_GENERIC_ARG1 + i)
+ ->kinds[eRegisterKindLLDB];
+ }
unsigned int current_argument_register = 0;
@@ -402,8 +281,8 @@ bool ABISysV_ppc64::GetArgumentValues(Thread &thread, ValueList &values) const {
if (!value)
return false;
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
CompilerType compiler_type = value->GetCompilerType();
if (!compiler_type)
return false;
@@ -501,8 +380,8 @@ Status ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
if (!set_it_simple) {
// Okay we've got a structure or something that doesn't fit in a simple
- // register.
- // We should figure out where it really goes, but we don't support this yet.
+ // register. We should figure out where it really goes, but we don't
+ // support this yet.
error.SetErrorString("We only support setting simple integer and float "
"return types at present.");
}
@@ -510,367 +389,584 @@ Status ABISysV_ppc64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
return error;
}
-ValueObjectSP ABISysV_ppc64::GetReturnValueObjectSimple(
- Thread &thread, CompilerType &return_compiler_type) const {
- ValueObjectSP return_valobj_sp;
- Value value;
+//
+// ReturnValueExtractor
+//
- if (!return_compiler_type)
- return return_valobj_sp;
+namespace {
+
+#define LOG_PREFIX "ReturnValueExtractor: "
+
+class ReturnValueExtractor {
+ // This class represents a register, from which data may be extracted.
+ //
+ // It may be constructed by directly specifying its index (where 0 is the
+ // first register used to return values) or by specifying the offset of a
+ // given struct field, in which case the appropriated register index will be
+ // calculated.
+ class Register {
+ public:
+ enum Type {
+ GPR, // General Purpose Register
+ FPR // Floating Point Register
+ };
+
+ // main constructor
+ //
+ // offs - field offset in struct
+ Register(Type ty, uint32_t index, uint32_t offs, RegisterContext *reg_ctx,
+ ByteOrder byte_order)
+ : m_index(index), m_offs(offs % sizeof(uint64_t)),
+ m_avail(sizeof(uint64_t) - m_offs), m_type(ty), m_reg_ctx(reg_ctx),
+ m_byte_order(byte_order) {}
+
+ // explicit index, no offset
+ Register(Type ty, uint32_t index, RegisterContext *reg_ctx,
+ ByteOrder byte_order)
+ : Register(ty, index, 0, reg_ctx, byte_order) {}
+
+ // GPR, calculate index from offs
+ Register(uint32_t offs, RegisterContext *reg_ctx, ByteOrder byte_order)
+ : Register(GPR, offs / sizeof(uint64_t), offs, reg_ctx, byte_order) {}
+
+ uint32_t Index() const { return m_index; }
+
+ // register offset where data is located
+ uint32_t Offs() const { return m_offs; }
+
+ // available bytes in this register
+ uint32_t Avail() const { return m_avail; }
+
+ bool IsValid() const {
+ if (m_index > 7) {
+ LLDB_LOG(m_log, LOG_PREFIX
+ "No more than 8 registers should be used to return values");
+ return false;
+ }
+ return true;
+ }
- // value.SetContext (Value::eContextTypeClangType, return_value_type);
- value.SetCompilerType(return_compiler_type);
+ std::string GetName() const {
+ if (m_type == GPR)
+ return ("r" + llvm::Twine(m_index + 3)).str();
+ else
+ return ("f" + llvm::Twine(m_index + 1)).str();
+ }
- RegisterContext *reg_ctx = thread.GetRegisterContext().get();
- if (!reg_ctx)
- return return_valobj_sp;
-
- const uint32_t type_flags = return_compiler_type.GetTypeInfo();
- if (type_flags & eTypeIsScalar) {
- value.SetValueType(Value::eValueTypeScalar);
-
- bool success = false;
- if (type_flags & eTypeIsInteger) {
- // Extract the register context so we can read arguments from registers
-
- const size_t byte_size = return_compiler_type.GetByteSize(nullptr);
- uint64_t raw_value = thread.GetRegisterContext()->ReadRegisterAsUnsigned(
- reg_ctx->GetRegisterInfoByName("r3", 0), 0);
- const bool is_signed = (type_flags & eTypeIsSigned) != 0;
- switch (byte_size) {
- default:
- break;
-
- case sizeof(uint64_t):
- if (is_signed)
- value.GetScalar() = (int64_t)(raw_value);
- else
- value.GetScalar() = (uint64_t)(raw_value);
- success = true;
- break;
-
- case sizeof(uint32_t):
- if (is_signed)
- value.GetScalar() = (int32_t)(raw_value & UINT32_MAX);
- else
- value.GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
- success = true;
- break;
-
- case sizeof(uint16_t):
- if (is_signed)
- value.GetScalar() = (int16_t)(raw_value & UINT16_MAX);
- else
- value.GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
- success = true;
- break;
-
- case sizeof(uint8_t):
- if (is_signed)
- value.GetScalar() = (int8_t)(raw_value & UINT8_MAX);
- else
- value.GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
- success = true;
- break;
+ // get raw register data
+ bool GetRawData(uint64_t &raw_data) {
+ const RegisterInfo *reg_info =
+ m_reg_ctx->GetRegisterInfoByName(GetName());
+ if (!reg_info) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to get RegisterInfo");
+ return false;
}
- } else if (type_flags & eTypeIsFloat) {
- if (type_flags & eTypeIsComplex) {
- // Don't handle complex yet.
- } else {
- const size_t byte_size = return_compiler_type.GetByteSize(nullptr);
- if (byte_size <= sizeof(long double)) {
- const RegisterInfo *f1_info = reg_ctx->GetRegisterInfoByName("f1", 0);
- RegisterValue f1_value;
- if (reg_ctx->ReadRegister(f1_info, f1_value)) {
- DataExtractor data;
- if (f1_value.GetData(data)) {
- lldb::offset_t offset = 0;
- if (byte_size == sizeof(float)) {
- value.GetScalar() = (float)data.GetFloat(&offset);
- success = true;
- } else if (byte_size == sizeof(double)) {
- value.GetScalar() = (double)data.GetDouble(&offset);
- success = true;
- }
- }
- }
- }
+
+ RegisterValue reg_val;
+ if (!m_reg_ctx->ReadRegister(reg_info, reg_val)) {
+ LLDB_LOG(m_log, LOG_PREFIX "ReadRegister() failed");
+ return false;
}
+
+ Status error;
+ uint32_t rc = reg_val.GetAsMemoryData(
+ reg_info, &raw_data, sizeof(raw_data), m_byte_order, error);
+ if (rc != sizeof(raw_data)) {
+ LLDB_LOG(m_log, LOG_PREFIX "GetAsMemoryData() failed");
+ return false;
+ }
+
+ return true;
}
- if (success)
- return_valobj_sp = ValueObjectConstResult::Create(
- thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
- } else if (type_flags & eTypeIsPointer) {
- unsigned r3_id =
- reg_ctx->GetRegisterInfoByName("r3", 0)->kinds[eRegisterKindLLDB];
- value.GetScalar() =
- (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r3_id, 0);
- value.SetValueType(Value::eValueTypeScalar);
- return_valobj_sp = ValueObjectConstResult::Create(
- thread.GetStackFrameAtIndex(0).get(), value, ConstString(""));
- } else if (type_flags & eTypeIsVector) {
- const size_t byte_size = return_compiler_type.GetByteSize(nullptr);
- if (byte_size > 0) {
- const RegisterInfo *altivec_reg = reg_ctx->GetRegisterInfoByName("v2", 0);
- if (altivec_reg) {
- if (byte_size <= altivec_reg->byte_size) {
- ProcessSP process_sp(thread.GetProcess());
- if (process_sp) {
- std::unique_ptr<DataBufferHeap> heap_data_ap(
- new DataBufferHeap(byte_size, 0));
- const ByteOrder byte_order = process_sp->GetByteOrder();
- RegisterValue reg_value;
- if (reg_ctx->ReadRegister(altivec_reg, reg_value)) {
- Status error;
- if (reg_value.GetAsMemoryData(
- altivec_reg, heap_data_ap->GetBytes(),
- heap_data_ap->GetByteSize(), byte_order, error)) {
- DataExtractor data(DataBufferSP(heap_data_ap.release()),
- byte_order, process_sp->GetTarget()
- .GetArchitecture()
- .GetAddressByteSize());
- return_valobj_sp = ValueObjectConstResult::Create(
- &thread, return_compiler_type, ConstString(""), data);
- }
- }
- }
+ private:
+ uint32_t m_index;
+ uint32_t m_offs;
+ uint32_t m_avail;
+ Type m_type;
+ RegisterContext *m_reg_ctx;
+ ByteOrder m_byte_order;
+ Log *m_log =
+ lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+ };
+
+ Register GetGPR(uint32_t index) const {
+ return Register(Register::GPR, index, m_reg_ctx, m_byte_order);
+ }
+
+ Register GetFPR(uint32_t index) const {
+ return Register(Register::FPR, index, m_reg_ctx, m_byte_order);
+ }
+
+ Register GetGPRByOffs(uint32_t offs) const {
+ return Register(offs, m_reg_ctx, m_byte_order);
+ }
+
+public:
+ // factory
+ static llvm::Expected<ReturnValueExtractor> Create(Thread &thread,
+ CompilerType &type) {
+ RegisterContext *reg_ctx = thread.GetRegisterContext().get();
+ if (!reg_ctx)
+ return llvm::make_error<llvm::StringError>(
+ LOG_PREFIX "Failed to get RegisterContext",
+ llvm::inconvertibleErrorCode());
+
+ ProcessSP process_sp = thread.GetProcess();
+ if (!process_sp)
+ return llvm::make_error<llvm::StringError>(
+ LOG_PREFIX "GetProcess() failed", llvm::inconvertibleErrorCode());
+
+ return ReturnValueExtractor(thread, type, reg_ctx, process_sp);
+ }
+
+ // main method: get value of the type specified at construction time
+ ValueObjectSP GetValue() {
+ const uint32_t type_flags = m_type.GetTypeInfo();
+
+ // call the appropriate type handler
+ ValueSP value_sp;
+ ValueObjectSP valobj_sp;
+ if (type_flags & eTypeIsScalar) {
+ if (type_flags & eTypeIsInteger) {
+ value_sp = GetIntegerValue(0);
+ } else if (type_flags & eTypeIsFloat) {
+ if (type_flags & eTypeIsComplex) {
+ LLDB_LOG(m_log, LOG_PREFIX "Complex numbers are not supported yet");
+ return ValueObjectSP();
+ } else {
+ value_sp = GetFloatValue(m_type, 0);
}
}
+ } else if (type_flags & eTypeIsPointer) {
+ value_sp = GetPointerValue(0);
}
+
+ if (value_sp) {
+ valobj_sp = ValueObjectConstResult::Create(
+ m_thread.GetStackFrameAtIndex(0).get(), *value_sp, ConstString(""));
+ } else if (type_flags & eTypeIsVector) {
+ valobj_sp = GetVectorValueObject();
+ } else if (type_flags & eTypeIsStructUnion || type_flags & eTypeIsClass) {
+ valobj_sp = GetStructValueObject();
+ }
+
+ return valobj_sp;
}
- return return_valobj_sp;
-}
+private:
+ // data
+ Thread &m_thread;
+ CompilerType &m_type;
+ uint64_t m_byte_size;
+ std::unique_ptr<DataBufferHeap> m_data_ap;
+ int32_t m_src_offs = 0;
+ int32_t m_dst_offs = 0;
+ bool m_packed = false;
+ Log *m_log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+ RegisterContext *m_reg_ctx;
+ ProcessSP m_process_sp;
+ ByteOrder m_byte_order;
+ uint32_t m_addr_size;
+
+ // methods
+
+ // constructor
+ ReturnValueExtractor(Thread &thread, CompilerType &type,
+ RegisterContext *reg_ctx, ProcessSP process_sp)
+ : m_thread(thread), m_type(type),
+ m_byte_size(m_type.GetByteSize(nullptr)),
+ m_data_ap(new DataBufferHeap(m_byte_size, 0)), m_reg_ctx(reg_ctx),
+ m_process_sp(process_sp), m_byte_order(process_sp->GetByteOrder()),
+ m_addr_size(
+ process_sp->GetTarget().GetArchitecture().GetAddressByteSize()) {}
+
+ // build a new scalar value
+ ValueSP NewScalarValue(CompilerType &type) {
+ ValueSP value_sp(new Value);
+ value_sp->SetCompilerType(type);
+ value_sp->SetValueType(Value::eValueTypeScalar);
+ return value_sp;
+ }
-ValueObjectSP ABISysV_ppc64::GetReturnValueObjectImpl(
- Thread &thread, CompilerType &return_compiler_type) const {
- ValueObjectSP return_valobj_sp;
-
- if (!return_compiler_type)
- return return_valobj_sp;
-
- ExecutionContext exe_ctx(thread.shared_from_this());
- return_valobj_sp = GetReturnValueObjectSimple(thread, return_compiler_type);
- if (return_valobj_sp)
- return return_valobj_sp;
-
- RegisterContextSP reg_ctx_sp = thread.GetRegisterContext();
- if (!reg_ctx_sp)
- return return_valobj_sp;
-
- const size_t bit_width = return_compiler_type.GetBitSize(&thread);
- if (return_compiler_type.IsAggregateType()) {
- Target *target = exe_ctx.GetTargetPtr();
- bool is_memory = true;
- if (bit_width <= 128) {
- ByteOrder target_byte_order = target->GetArchitecture().GetByteOrder();
- DataBufferSP data_sp(new DataBufferHeap(16, 0));
- DataExtractor return_ext(data_sp, target_byte_order,
- target->GetArchitecture().GetAddressByteSize());
-
- const RegisterInfo *r3_info = reg_ctx_sp->GetRegisterInfoByName("r3", 0);
- const RegisterInfo *rdx_info =
- reg_ctx_sp->GetRegisterInfoByName("rdx", 0);
-
- RegisterValue r3_value, rdx_value;
- reg_ctx_sp->ReadRegister(r3_info, r3_value);
- reg_ctx_sp->ReadRegister(rdx_info, rdx_value);
-
- DataExtractor r3_data, rdx_data;
-
- r3_value.GetData(r3_data);
- rdx_value.GetData(rdx_data);
-
- uint32_t fp_bytes =
- 0; // Tracks how much of the xmm registers we've consumed so far
- uint32_t integer_bytes =
- 0; // Tracks how much of the r3/rds registers we've consumed so far
-
- const uint32_t num_children = return_compiler_type.GetNumFields();
-
- // Since we are in the small struct regime, assume we are not in memory.
- is_memory = false;
-
- for (uint32_t idx = 0; idx < num_children; idx++) {
- std::string name;
- uint64_t field_bit_offset = 0;
- bool is_signed;
- bool is_complex;
- uint32_t count;
-
- CompilerType field_compiler_type = return_compiler_type.GetFieldAtIndex(
- idx, name, &field_bit_offset, nullptr, nullptr);
- const size_t field_bit_width = field_compiler_type.GetBitSize(&thread);
-
- // If there are any unaligned fields, this is stored in memory.
- if (field_bit_offset % field_bit_width != 0) {
- is_memory = true;
- break;
+ // get an integer value in the specified register
+ ValueSP GetIntegerValue(uint32_t reg_index) {
+ uint64_t raw_value;
+ auto reg = GetGPR(reg_index);
+ if (!reg.GetRawData(raw_value))
+ return ValueSP();
+
+ // build value from data
+ ValueSP value_sp(NewScalarValue(m_type));
+
+ uint32_t type_flags = m_type.GetTypeInfo();
+ bool is_signed = (type_flags & eTypeIsSigned) != 0;
+
+ switch (m_byte_size) {
+ case sizeof(uint64_t):
+ if (is_signed)
+ value_sp->GetScalar() = (int64_t)(raw_value);
+ else
+ value_sp->GetScalar() = (uint64_t)(raw_value);
+ break;
+
+ case sizeof(uint32_t):
+ if (is_signed)
+ value_sp->GetScalar() = (int32_t)(raw_value & UINT32_MAX);
+ else
+ value_sp->GetScalar() = (uint32_t)(raw_value & UINT32_MAX);
+ break;
+
+ case sizeof(uint16_t):
+ if (is_signed)
+ value_sp->GetScalar() = (int16_t)(raw_value & UINT16_MAX);
+ else
+ value_sp->GetScalar() = (uint16_t)(raw_value & UINT16_MAX);
+ break;
+
+ case sizeof(uint8_t):
+ if (is_signed)
+ value_sp->GetScalar() = (int8_t)(raw_value & UINT8_MAX);
+ else
+ value_sp->GetScalar() = (uint8_t)(raw_value & UINT8_MAX);
+ break;
+
+ default:
+ llvm_unreachable("Invalid integer size");
+ }
+
+ return value_sp;
+ }
+
+ // get a floating point value on the specified register
+ ValueSP GetFloatValue(CompilerType &type, uint32_t reg_index) {
+ uint64_t raw_data;
+ auto reg = GetFPR(reg_index);
+ if (!reg.GetRawData(raw_data))
+ return ValueSP();
+
+ // build value from data
+ ValueSP value_sp(NewScalarValue(type));
+
+ DataExtractor de(&raw_data, sizeof(raw_data), m_byte_order, m_addr_size);
+
+ offset_t offset = 0;
+ size_t byte_size = type.GetByteSize(nullptr);
+ switch (byte_size) {
+ case sizeof(float):
+ value_sp->GetScalar() = (float)de.GetDouble(&offset);
+ break;
+
+ case sizeof(double):
+ value_sp->GetScalar() = de.GetDouble(&offset);
+ break;
+
+ default:
+ llvm_unreachable("Invalid floating point size");
+ }
+
+ return value_sp;
+ }
+
+ // get pointer value from register
+ ValueSP GetPointerValue(uint32_t reg_index) {
+ uint64_t raw_data;
+ auto reg = GetGPR(reg_index);
+ if (!reg.GetRawData(raw_data))
+ return ValueSP();
+
+ // build value from raw data
+ ValueSP value_sp(NewScalarValue(m_type));
+ value_sp->GetScalar() = raw_data;
+ return value_sp;
+ }
+
+ // build the ValueObject from our data buffer
+ ValueObjectSP BuildValueObject() {
+ DataExtractor de(DataBufferSP(m_data_ap.release()), m_byte_order,
+ m_addr_size);
+ return ValueObjectConstResult::Create(&m_thread, m_type, ConstString(""),
+ de);
+ }
+
+ // get a vector return value
+ ValueObjectSP GetVectorValueObject() {
+ const uint32_t MAX_VRS = 2;
+
+ // get first V register used to return values
+ const RegisterInfo *vr[MAX_VRS];
+ vr[0] = m_reg_ctx->GetRegisterInfoByName("vr2");
+ if (!vr[0]) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to get vr2 RegisterInfo");
+ return ValueObjectSP();
+ }
+
+ const uint32_t vr_size = vr[0]->byte_size;
+ size_t vrs = 1;
+ if (m_byte_size > 2 * vr_size) {
+ LLDB_LOG(
+ m_log, LOG_PREFIX
+ "Returning vectors that don't fit in 2 VR regs is not supported");
+ return ValueObjectSP();
+ }
+
+ // load vr3, if needed
+ if (m_byte_size > vr_size) {
+ vrs++;
+ vr[1] = m_reg_ctx->GetRegisterInfoByName("vr3");
+ if (!vr[1]) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to get vr3 RegisterInfo");
+ return ValueObjectSP();
+ }
+ }
+
+ // Get the whole contents of vector registers and let the logic here
+ // arrange the data properly.
+
+ RegisterValue vr_val[MAX_VRS];
+ Status error;
+ std::unique_ptr<DataBufferHeap> vr_data(
+ new DataBufferHeap(vrs * vr_size, 0));
+
+ for (uint32_t i = 0; i < vrs; i++) {
+ if (!m_reg_ctx->ReadRegister(vr[i], vr_val[i])) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to read vector register contents");
+ return ValueObjectSP();
+ }
+ if (!vr_val[i].GetAsMemoryData(vr[i], vr_data->GetBytes() + i * vr_size,
+ vr_size, m_byte_order, error)) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to extract vector register bytes");
+ return ValueObjectSP();
+ }
+ }
+
+ // The compiler generated code seems to always put the vector elements at
+ // the end of the vector register, in case they don't occupy all of it.
+ // This offset variable handles this.
+ uint32_t offs = 0;
+ if (m_byte_size < vr_size)
+ offs = vr_size - m_byte_size;
+
+ // copy extracted data to our buffer
+ memcpy(m_data_ap->GetBytes(), vr_data->GetBytes() + offs, m_byte_size);
+ return BuildValueObject();
+ }
+
+ // get a struct return value
+ ValueObjectSP GetStructValueObject() {
+ // case 1: get from stack
+ if (m_byte_size > 2 * sizeof(uint64_t)) {
+ uint64_t addr;
+ auto reg = GetGPR(0);
+ if (!reg.GetRawData(addr))
+ return ValueObjectSP();
+
+ Status error;
+ size_t rc = m_process_sp->ReadMemory(addr, m_data_ap->GetBytes(),
+ m_byte_size, error);
+ if (rc != m_byte_size) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to read memory pointed by r3");
+ return ValueObjectSP();
+ }
+ return BuildValueObject();
+ }
+
+ // get number of children
+ const bool omit_empty_base_classes = true;
+ uint32_t n = m_type.GetNumChildren(omit_empty_base_classes);
+ if (!n) {
+ LLDB_LOG(m_log, LOG_PREFIX "No children found in struct");
+ return ValueObjectSP();
+ }
+
+ // case 2: homogeneous double or float aggregate
+ CompilerType elem_type;
+ if (m_type.IsHomogeneousAggregate(&elem_type)) {
+ uint32_t type_flags = elem_type.GetTypeInfo();
+ uint64_t elem_size = elem_type.GetByteSize(nullptr);
+ if (type_flags & eTypeIsComplex || !(type_flags & eTypeIsFloat)) {
+ LLDB_LOG(m_log,
+ LOG_PREFIX "Unexpected type found in homogeneous aggregate");
+ return ValueObjectSP();
+ }
+
+ for (uint32_t i = 0; i < n; i++) {
+ ValueSP val_sp = GetFloatValue(elem_type, i);
+ if (!val_sp)
+ return ValueObjectSP();
+
+ // copy to buffer
+ Status error;
+ size_t rc = val_sp->GetScalar().GetAsMemoryData(
+ m_data_ap->GetBytes() + m_dst_offs, elem_size, m_byte_order, error);
+ if (rc != elem_size) {
+ LLDB_LOG(m_log, LOG_PREFIX "Failed to get float data");
+ return ValueObjectSP();
}
+ m_dst_offs += elem_size;
+ }
+ return BuildValueObject();
+ }
- uint32_t field_byte_width = field_bit_width / 8;
- uint32_t field_byte_offset = field_bit_offset / 8;
-
- DataExtractor *copy_from_extractor = nullptr;
- uint32_t copy_from_offset = 0;
-
- if (field_compiler_type.IsIntegerOrEnumerationType(is_signed) ||
- field_compiler_type.IsPointerType()) {
- if (integer_bytes < 8) {
- if (integer_bytes + field_byte_width <= 8) {
- // This is in RAX, copy from register to our result structure:
- copy_from_extractor = &r3_data;
- copy_from_offset = integer_bytes;
- integer_bytes += field_byte_width;
- } else {
- // The next field wouldn't fit in the remaining space, so we
- // pushed it to rdx.
- copy_from_extractor = &rdx_data;
- copy_from_offset = 0;
- integer_bytes = 8 + field_byte_width;
- }
- } else if (integer_bytes + field_byte_width <= 16) {
- copy_from_extractor = &rdx_data;
- copy_from_offset = integer_bytes - 8;
- integer_bytes += field_byte_width;
- } else {
- // The last field didn't fit. I can't see how that would happen w/o
- // the overall size being
- // greater than 16 bytes. For now, return a nullptr return value
- // object.
- return return_valobj_sp;
- }
- } else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
- // Structs with long doubles are always passed in memory.
- if (field_bit_width == 128) {
- is_memory = true;
+ // case 3: get from GPRs
+
+ // first, check if this is a packed struct or not
+ ClangASTContext *ast =
+ llvm::dyn_cast<ClangASTContext>(m_type.GetTypeSystem());
+ if (ast) {
+ clang::RecordDecl *record_decl = ClangASTContext::GetAsRecordDecl(m_type);
+
+ if (record_decl) {
+ auto attrs = record_decl->attrs();
+ for (const auto &attr : attrs) {
+ if (attr->getKind() == clang::attr::Packed) {
+ m_packed = true;
break;
- } else if (field_bit_width == 64) {
- copy_from_offset = 0;
- fp_bytes += field_byte_width;
- } else if (field_bit_width == 32) {
- // This one is kind of complicated. If we are in an "eightbyte"
- // with another float, we'll
- // be stuffed into an xmm register with it. If we are in an
- // "eightbyte" with one or more ints,
- // then we will be stuffed into the appropriate GPR with them.
- bool in_gpr;
- if (field_byte_offset % 8 == 0) {
- // We are at the beginning of one of the eightbytes, so check the
- // next element (if any)
- if (idx == num_children - 1)
- in_gpr = false;
- else {
- uint64_t next_field_bit_offset = 0;
- CompilerType next_field_compiler_type =
- return_compiler_type.GetFieldAtIndex(idx + 1, name,
- &next_field_bit_offset,
- nullptr, nullptr);
- if (next_field_compiler_type.IsIntegerOrEnumerationType(
- is_signed))
- in_gpr = true;
- else {
- copy_from_offset = 0;
- in_gpr = false;
- }
- }
- } else if (field_byte_offset % 4 == 0) {
- // We are inside of an eightbyte, so see if the field before us is
- // floating point:
- // This could happen if somebody put padding in the structure.
- if (idx == 0)
- in_gpr = false;
- else {
- uint64_t prev_field_bit_offset = 0;
- CompilerType prev_field_compiler_type =
- return_compiler_type.GetFieldAtIndex(idx - 1, name,
- &prev_field_bit_offset,
- nullptr, nullptr);
- if (prev_field_compiler_type.IsIntegerOrEnumerationType(
- is_signed))
- in_gpr = true;
- else {
- copy_from_offset = 4;
- in_gpr = false;
- }
- }
- } else {
- is_memory = true;
- continue;
- }
-
- // Okay, we've figured out whether we are in GPR or XMM, now figure
- // out which one.
- if (in_gpr) {
- if (integer_bytes < 8) {
- // This is in RAX, copy from register to our result structure:
- copy_from_extractor = &r3_data;
- copy_from_offset = integer_bytes;
- integer_bytes += field_byte_width;
- } else {
- copy_from_extractor = &rdx_data;
- copy_from_offset = integer_bytes - 8;
- integer_bytes += field_byte_width;
- }
- } else {
- fp_bytes += field_byte_width;
- }
}
}
-
- // These two tests are just sanity checks. If I somehow get the
- // type calculation wrong above it is better to just return nothing
- // than to assert or crash.
- if (!copy_from_extractor)
- return return_valobj_sp;
- if (copy_from_offset + field_byte_width >
- copy_from_extractor->GetByteSize())
- return return_valobj_sp;
-
- copy_from_extractor->CopyByteOrderedData(
- copy_from_offset, field_byte_width,
- data_sp->GetBytes() + field_byte_offset, field_byte_width,
- target_byte_order);
}
+ }
- if (!is_memory) {
- // The result is in our data buffer. Let's make a variable object out
- // of it:
- return_valobj_sp = ValueObjectConstResult::Create(
- &thread, return_compiler_type, ConstString(""), return_ext);
- }
+ LLDB_LOG(m_log, LOG_PREFIX "{0} struct",
+ m_packed ? "packed" : "not packed");
+
+ for (uint32_t i = 0; i < n; i++) {
+ std::string name;
+ uint32_t size;
+ GetChildType(i, name, size);
+ // NOTE: the offset returned by GetChildCompilerTypeAtIndex()
+ // can't be used because it never considers alignment bytes
+ // between struct fields.
+ LLDB_LOG(m_log, LOG_PREFIX "field={0}, size={1}", name, size);
+ if (!ExtractField(size))
+ return ValueObjectSP();
}
- // FIXME: This is just taking a guess, r3 may very well no longer hold the
- // return storage location.
- // If we are going to do this right, when we make a new frame we should
- // check to see if it uses a memory
- // return, and if we are at the first instruction and if so stash away the
- // return location. Then we would
- // only return the memory return value if we know it is valid.
-
- if (is_memory) {
- unsigned r3_id =
- reg_ctx_sp->GetRegisterInfoByName("r3", 0)->kinds[eRegisterKindLLDB];
- lldb::addr_t storage_addr =
- (uint64_t)thread.GetRegisterContext()->ReadRegisterAsUnsigned(r3_id,
- 0);
- return_valobj_sp = ValueObjectMemory::Create(
- &thread, "", Address(storage_addr, nullptr), return_compiler_type);
+ return BuildValueObject();
+ }
+
+ // extract 'size' bytes at 'offs' from GPRs
+ bool ExtractFromRegs(int32_t offs, uint32_t size, void *buf) {
+ while (size) {
+ auto reg = GetGPRByOffs(offs);
+ if (!reg.IsValid())
+ return false;
+
+ uint32_t n = std::min(reg.Avail(), size);
+ uint64_t raw_data;
+
+ if (!reg.GetRawData(raw_data))
+ return false;
+
+ memcpy(buf, (char *)&raw_data + reg.Offs(), n);
+ offs += n;
+ size -= n;
+ buf = (char *)buf + n;
}
+ return true;
}
- return return_valobj_sp;
+ // extract one field from GPRs and put it in our buffer
+ bool ExtractField(uint32_t size) {
+ auto reg = GetGPRByOffs(m_src_offs);
+ if (!reg.IsValid())
+ return false;
+
+ // handle padding
+ if (!m_packed) {
+ uint32_t n = m_src_offs % size;
+
+ // not 'size' bytes aligned
+ if (n) {
+ LLDB_LOG(m_log,
+ LOG_PREFIX "Extracting {0} alignment bytes at offset {1}", n,
+ m_src_offs);
+ // get alignment bytes
+ if (!ExtractFromRegs(m_src_offs, n, m_data_ap->GetBytes() + m_dst_offs))
+ return false;
+ m_src_offs += n;
+ m_dst_offs += n;
+ }
+ }
+
+ // get field
+ LLDB_LOG(m_log, LOG_PREFIX "Extracting {0} field bytes at offset {1}", size,
+ m_src_offs);
+ if (!ExtractFromRegs(m_src_offs, size, m_data_ap->GetBytes() + m_dst_offs))
+ return false;
+ m_src_offs += size;
+ m_dst_offs += size;
+ return true;
+ }
+
+ // get child
+ CompilerType GetChildType(uint32_t i, std::string &name, uint32_t &size) {
+ // GetChild constant inputs
+ const bool transparent_pointers = false;
+ const bool omit_empty_base_classes = true;
+ const bool ignore_array_bounds = false;
+ // GetChild output params
+ int32_t child_offs;
+ uint32_t child_bitfield_bit_size;
+ uint32_t child_bitfield_bit_offset;
+ bool child_is_base_class;
+ bool child_is_deref_of_parent;
+ ValueObject *valobj = nullptr;
+ uint64_t language_flags;
+ ExecutionContext exe_ctx;
+ m_thread.CalculateExecutionContext(exe_ctx);
+
+ return m_type.GetChildCompilerTypeAtIndex(
+ &exe_ctx, i, transparent_pointers, omit_empty_base_classes,
+ ignore_array_bounds, name, size, child_offs, child_bitfield_bit_size,
+ child_bitfield_bit_offset, child_is_base_class,
+ child_is_deref_of_parent, valobj, language_flags);
+ }
+};
+
+#undef LOG_PREFIX
+
+} // anonymous namespace
+
+ValueObjectSP
+ABISysV_ppc64::GetReturnValueObjectSimple(Thread &thread,
+ CompilerType &type) const {
+ if (!type)
+ return ValueObjectSP();
+
+ auto exp_extractor = ReturnValueExtractor::Create(thread, type);
+ if (!exp_extractor) {
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+ LLDB_LOG_ERROR(log, exp_extractor.takeError(),
+ "Extracting return value failed: {0}");
+ return ValueObjectSP();
+ }
+
+ return exp_extractor.get().GetValue();
+}
+
+ValueObjectSP ABISysV_ppc64::GetReturnValueObjectImpl(
+ Thread &thread, CompilerType &return_compiler_type) const {
+ return GetReturnValueObjectSimple(thread, return_compiler_type);
}
bool ABISysV_ppc64::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
unwind_plan.Clear();
unwind_plan.SetRegisterKind(eRegisterKindDWARF);
- uint32_t lr_reg_num = dwarf_lr;
- uint32_t sp_reg_num = dwarf_r1;
- uint32_t pc_reg_num = dwarf_pc;
+ uint32_t lr_reg_num;
+ uint32_t sp_reg_num;
+ uint32_t pc_reg_num;
+
+ if (GetByteOrder() == lldb::eByteOrderLittle) {
+ lr_reg_num = ppc64le_dwarf::dwarf_lr_ppc64le;
+ sp_reg_num = ppc64le_dwarf::dwarf_r1_ppc64le;
+ pc_reg_num = ppc64le_dwarf::dwarf_pc_ppc64le;
+ } else {
+ lr_reg_num = ppc64_dwarf::dwarf_lr_ppc64;
+ sp_reg_num = ppc64_dwarf::dwarf_r1_ppc64;
+ pc_reg_num = ppc64_dwarf::dwarf_pc_ppc64;
+ }
UnwindPlan::RowSP row(new UnwindPlan::Row);
@@ -893,23 +989,33 @@ bool ABISysV_ppc64::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
unwind_plan.Clear();
unwind_plan.SetRegisterKind(eRegisterKindDWARF);
- uint32_t sp_reg_num = dwarf_r1;
- uint32_t pc_reg_num = dwarf_lr;
+ uint32_t sp_reg_num;
+ uint32_t pc_reg_num;
+ uint32_t cr_reg_num;
- UnwindPlan::RowSP row(new UnwindPlan::Row);
+ if (GetByteOrder() == lldb::eByteOrderLittle) {
+ sp_reg_num = ppc64le_dwarf::dwarf_r1_ppc64le;
+ pc_reg_num = ppc64le_dwarf::dwarf_lr_ppc64le;
+ cr_reg_num = ppc64le_dwarf::dwarf_cr_ppc64le;
+ } else {
+ sp_reg_num = ppc64_dwarf::dwarf_r1_ppc64;
+ pc_reg_num = ppc64_dwarf::dwarf_lr_ppc64;
+ cr_reg_num = ppc64_dwarf::dwarf_cr_ppc64;
+ }
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
const int32_t ptr_size = 8;
row->GetCFAValue().SetIsRegisterDereferenced(sp_reg_num);
row->SetRegisterLocationToAtCFAPlusOffset(pc_reg_num, ptr_size * 2, true);
row->SetRegisterLocationToIsCFAPlusOffset(sp_reg_num, 0, true);
- row->SetRegisterLocationToAtCFAPlusOffset(dwarf_cr, ptr_size, true);
+ row->SetRegisterLocationToAtCFAPlusOffset(cr_reg_num, ptr_size, true);
unwind_plan.AppendRow(row);
unwind_plan.SetSourceName("ppc64 default unwind plan");
unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolNo);
- unwind_plan.SetReturnAddressRegister(dwarf_lr);
+ unwind_plan.SetReturnAddressRegister(pc_reg_num);
return true;
}
@@ -919,10 +1025,9 @@ bool ABISysV_ppc64::RegisterIsVolatile(const RegisterInfo *reg_info) {
// See "Register Usage" in the
// "System V Application Binary Interface"
-// "64-bit PowerPC ELF Application Binary Interface Supplement"
-// current version is 1.9 released 2004 at
-// http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.pdf
-
+// "64-bit PowerPC ELF Application Binary Interface Supplement" current version
+// is 2 released 2015 at
+// https://members.openpowerfoundation.org/document/dl/576
bool ABISysV_ppc64::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
if (reg_info) {
// Preserved registers are :
@@ -954,7 +1059,7 @@ bool ABISysV_ppc64::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
if (name[0] == 's' && name[1] == 'p' && name[2] == '\0') // sp
return true;
if (name[0] == 'f' && name[1] == 'p' && name[2] == '\0') // fp
- return true;
+ return false;
if (name[0] == 'p' && name[1] == 'c' && name[2] == '\0') // pc
return true;
}
diff --git a/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h b/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h
index 21608a5c1cdd..52765a773c0b 100644
--- a/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h
+++ b/source/Plugins/ABI/SysV-ppc64/ABISysV_ppc64.h
@@ -108,6 +108,8 @@ private:
ABISysV_ppc64(lldb::ProcessSP process_sp) : lldb_private::ABI(process_sp) {
// Call CreateInstance instead.
}
+
+ lldb::ByteOrder GetByteOrder() const;
};
#endif // liblldb_ABISysV_ppc64_h_
diff --git a/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp b/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
index 967e407188fa..31e2825c0fa2 100644
--- a/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
+++ b/source/Plugins/ABI/SysV-s390x/ABISysV_s390x.cpp
@@ -380,8 +380,8 @@ bool ABISysV_s390x::GetArgumentValues(Thread &thread, ValueList &values) const {
if (!value)
return false;
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
CompilerType compiler_type = value->GetCompilerType();
if (!compiler_type)
return false;
@@ -483,8 +483,8 @@ Status ABISysV_s390x::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
if (!set_it_simple) {
// Okay we've got a structure or something that doesn't fit in a simple
- // register.
- // We should figure out where it really goes, but we don't support this yet.
+ // register. We should figure out where it really goes, but we don't
+ // support this yet.
error.SetErrorString("We only support setting simple integer and float "
"return types at present.");
}
@@ -618,9 +618,8 @@ ValueObjectSP ABISysV_s390x::GetReturnValueObjectImpl(
// FIXME: This is just taking a guess, r2 may very well no longer hold the
// return storage location.
// If we are going to do this right, when we make a new frame we should
- // check to see if it uses a memory
- // return, and if we are at the first instruction and if so stash away the
- // return location. Then we would
+ // check to see if it uses a memory return, and if we are at the first
+ // instruction and if so stash away the return location. Then we would
// only return the memory return value if we know it is valid.
unsigned r2_id =
@@ -654,8 +653,8 @@ bool ABISysV_s390x::CreateFunctionEntryUnwindPlan(UnwindPlan &unwind_plan) {
}
bool ABISysV_s390x::CreateDefaultUnwindPlan(UnwindPlan &unwind_plan) {
- // There's really no default way to unwind on s390x.
- // Trust the .eh_frame CFI, which should always be good.
+ // There's really no default way to unwind on s390x. Trust the .eh_frame CFI,
+ // which should always be good.
return false;
}
@@ -663,8 +662,8 @@ bool ABISysV_s390x::GetFallbackRegisterLocation(
const RegisterInfo *reg_info,
UnwindPlan::Row::RegisterLocation &unwind_regloc) {
// If a volatile register is being requested, we don't want to forward the
- // next frame's register contents
- // up the stack -- the register is not retrievable at this frame.
+ // next frame's register contents up the stack -- the register is not
+ // retrievable at this frame.
if (RegisterIsVolatile(reg_info)) {
unwind_regloc.SetUndefined();
return true;
diff --git a/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp b/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
index 41d146f24526..36ae3a49827c 100644
--- a/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
+++ b/source/Plugins/ABI/SysV-x86_64/ABISysV_x86_64.cpp
@@ -1267,8 +1267,8 @@ bool ABISysV_x86_64::GetArgumentValues(Thread &thread,
if (!value)
return false;
- // We currently only support extracting values with Clang QualTypes.
- // Do we care about others?
+ // We currently only support extracting values with Clang QualTypes. Do we
+ // care about others?
CompilerType compiler_type = value->GetCompilerType();
if (!compiler_type)
return false;
@@ -1371,8 +1371,8 @@ Status ABISysV_x86_64::SetReturnValueObject(lldb::StackFrameSP &frame_sp,
if (!set_it_simple) {
// Okay we've got a structure or something that doesn't fit in a simple
- // register.
- // We should figure out where it really goes, but we don't support this yet.
+ // register. We should figure out where it really goes, but we don't
+ // support this yet.
error.SetErrorString("We only support setting simple integer and float "
"return types at present.");
}
@@ -1624,8 +1624,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
idx, name, &field_bit_offset, nullptr, nullptr);
const size_t field_bit_width = field_compiler_type.GetBitSize(&thread);
- // if we don't know the size of the field (e.g. invalid type), just bail
- // out
+ // if we don't know the size of the field (e.g. invalid type), just
+ // bail out
if (field_bit_width == 0)
break;
@@ -1661,10 +1661,9 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
copy_from_offset = integer_bytes - 8;
integer_bytes += field_byte_width;
} else {
- // The last field didn't fit. I can't see how that would happen w/o
- // the overall size being
- // greater than 16 bytes. For now, return a nullptr return value
- // object.
+ // The last field didn't fit. I can't see how that would happen
+ // w/o the overall size being greater than 16 bytes. For now,
+ // return a nullptr return value object.
return return_valobj_sp;
}
} else if (field_compiler_type.IsFloatingPointType(count, is_complex)) {
@@ -1683,10 +1682,9 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
fp_bytes += field_byte_width;
} else if (field_bit_width == 32) {
// This one is kind of complicated. If we are in an "eightbyte"
- // with another float, we'll
- // be stuffed into an xmm register with it. If we are in an
- // "eightbyte" with one or more ints,
- // then we will be stuffed into the appropriate GPR with them.
+ // with another float, we'll be stuffed into an xmm register with
+ // it. If we are in an "eightbyte" with one or more ints, then we
+ // will be stuffed into the appropriate GPR with them.
bool in_gpr;
if (field_byte_offset % 8 == 0) {
// We are at the beginning of one of the eightbytes, so check the
@@ -1708,9 +1706,9 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
}
}
} else if (field_byte_offset % 4 == 0) {
- // We are inside of an eightbyte, so see if the field before us is
- // floating point:
- // This could happen if somebody put padding in the structure.
+ // We are inside of an eightbyte, so see if the field before us
+ // is floating point: This could happen if somebody put padding
+ // in the structure.
if (idx == 0)
in_gpr = false;
else {
@@ -1756,9 +1754,9 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
}
}
- // These two tests are just sanity checks. If I somehow get the
- // type calculation wrong above it is better to just return nothing
- // than to assert or crash.
+ // These two tests are just sanity checks. If I somehow get the type
+ // calculation wrong above it is better to just return nothing than to
+ // assert or crash.
if (!copy_from_extractor)
return return_valobj_sp;
if (copy_from_offset + field_byte_width >
@@ -1782,9 +1780,8 @@ ValueObjectSP ABISysV_x86_64::GetReturnValueObjectImpl(
// FIXME: This is just taking a guess, rax may very well no longer hold the
// return storage location.
// If we are going to do this right, when we make a new frame we should
- // check to see if it uses a memory
- // return, and if we are at the first instruction and if so stash away the
- // return location. Then we would
+ // check to see if it uses a memory return, and if we are at the first
+ // instruction and if so stash away the return location. Then we would
// only return the memory return value if we know it is valid.
if (is_memory) {
@@ -1858,12 +1855,11 @@ bool ABISysV_x86_64::RegisterIsVolatile(const RegisterInfo *reg_info) {
// See "Register Usage" in the
// "System V Application Binary Interface"
-// "AMD64 Architecture Processor Supplement"
-// (or "x86-64(tm) Architecture Processor Supplement" in earlier revisions)
-// (this doc is also commonly referred to as the x86-64/AMD64 psABI)
-// Edited by Michael Matz, Jan Hubicka, Andreas Jaeger, and Mark Mitchell
-// current version is 0.99.6 released 2012-07-02 at
-// http://refspecs.linuxfoundation.org/elf/x86-64-abi-0.99.pdf
+// "AMD64 Architecture Processor Supplement" (or "x86-64(tm) Architecture
+// Processor Supplement" in earlier revisions) (this doc is also commonly
+// referred to as the x86-64/AMD64 psABI) Edited by Michael Matz, Jan Hubicka,
+// Andreas Jaeger, and Mark Mitchell current version is 0.99.6 released
+// 2012-07-02 at http://refspecs.linuxfoundation.org/elf/x86-64-abi-0.99.pdf
// It's being revised & updated at https://github.com/hjl-tools/x86-psABI/
bool ABISysV_x86_64::RegisterIsCalleeSaved(const RegisterInfo *reg_info) {
diff --git a/source/Plugins/Architecture/Arm/ArchitectureArm.cpp b/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
index abac6d3001af..1b7ecc88c35e 100644
--- a/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
+++ b/source/Plugins/Architecture/Arm/ArchitectureArm.cpp
@@ -41,32 +41,32 @@ std::unique_ptr<Architecture> ArchitectureArm::Create(const ArchSpec &arch) {
ConstString ArchitectureArm::GetPluginName() { return GetPluginNameStatic(); }
uint32_t ArchitectureArm::GetPluginVersion() { return 1; }
-void ArchitectureArm::OverrideStopInfo(Thread &thread) {
- // We need to check if we are stopped in Thumb mode in a IT instruction
- // and detect if the condition doesn't pass. If this is the case it means
- // we won't actually execute this instruction. If this happens we need to
- // clear the stop reason to no thread plans think we are stopped for a
- // reason and the plans should keep going.
+void ArchitectureArm::OverrideStopInfo(Thread &thread) const {
+ // We need to check if we are stopped in Thumb mode in a IT instruction and
+ // detect if the condition doesn't pass. If this is the case it means we
+ // won't actually execute this instruction. If this happens we need to clear
+ // the stop reason to no thread plans think we are stopped for a reason and
+ // the plans should keep going.
//
// We do this because when single stepping many ARM processes, debuggers
- // often use the BVR/BCR registers that says "stop when the PC is not
- // equal to its current value". This method of stepping means we can end
- // up stopping on instructions inside an if/then block that wouldn't get
- // executed. By fixing this we can stop the debugger from seeming like
- // you stepped through both the "if" _and_ the "else" clause when source
- // level stepping because the debugger stops regardless due to the BVR/BCR
+ // often use the BVR/BCR registers that says "stop when the PC is not equal
+ // to its current value". This method of stepping means we can end up
+ // stopping on instructions inside an if/then block that wouldn't get
+ // executed. By fixing this we can stop the debugger from seeming like you
+ // stepped through both the "if" _and_ the "else" clause when source level
+ // stepping because the debugger stops regardless due to the BVR/BCR
// triggering a stop.
//
- // It also means we can set breakpoints on instructions inside an an
- // if/then block and correctly skip them if we use the BKPT instruction.
- // The ARM and Thumb BKPT instructions are unconditional even when executed
- // in a Thumb IT block.
+ // It also means we can set breakpoints on instructions inside an an if/then
+ // block and correctly skip them if we use the BKPT instruction. The ARM and
+ // Thumb BKPT instructions are unconditional even when executed in a Thumb IT
+ // block.
//
- // If your debugger inserts software traps in ARM/Thumb code, it will
- // need to use 16 and 32 bit instruction for 16 and 32 bit thumb
- // instructions respectively. If your debugger inserts a 16 bit thumb
- // trap on top of a 32 bit thumb instruction for an opcode that is inside
- // an if/then, it will change the it/then to conditionally execute your
+ // If your debugger inserts software traps in ARM/Thumb code, it will need to
+ // use 16 and 32 bit instruction for 16 and 32 bit thumb instructions
+ // respectively. If your debugger inserts a 16 bit thumb trap on top of a 32
+ // bit thumb instruction for an opcode that is inside an if/then, it will
+ // change the it/then to conditionally execute your
// 16 bit trap and then cause your program to crash if it executes the
// trailing 16 bits (the second half of the 32 bit thumb instruction you
// partially overwrote).
@@ -85,23 +85,20 @@ void ArchitectureArm::OverrideStopInfo(Thread &thread) {
const uint32_t ISETSTATE = J << 1 | T;
if (ISETSTATE == 0) {
// NOTE: I am pretty sure we want to enable the code below
-// that detects when we stop on an instruction in ARM mode
-// that is conditional and the condition doesn't pass. This
-// can happen if you set a breakpoint on an instruction that
-// is conditional. We currently will _always_ stop on the
-// instruction which is bad. You can also run into this while
-// single stepping and you could appear to run code in the "if"
-// and in the "else" clause because it would stop at all of the
-// conditional instructions in both.
-// In such cases, we really don't want to stop at this location.
+// that detects when we stop on an instruction in ARM mode that is conditional
+// and the condition doesn't pass. This can happen if you set a breakpoint on
+// an instruction that is conditional. We currently will _always_ stop on the
+// instruction which is bad. You can also run into this while single stepping
+// and you could appear to run code in the "if" and in the "else" clause
+// because it would stop at all of the conditional instructions in both. In
+// such cases, we really don't want to stop at this location.
// I will check with the lldb-dev list first before I enable this.
#if 0
- // ARM mode: check for condition on intsruction
+ // ARM mode: check for condition on instruction
const addr_t pc = reg_ctx_sp->GetPC();
Status error;
- // If we fail to read the opcode we will get UINT64_MAX as the
- // result in "opcode" which we can use to detect if we read a
- // valid opcode.
+ // If we fail to read the opcode we will get UINT64_MAX as the result in
+ // "opcode" which we can use to detect if we read a valid opcode.
const uint64_t opcode = thread.GetProcess()->ReadUnsignedIntegerFromMemory(pc, 4, UINT64_MAX, error);
if (opcode <= UINT32_MAX)
{
@@ -109,8 +106,8 @@ void ArchitectureArm::OverrideStopInfo(Thread &thread) {
if (!ARMConditionPassed(condition, cpsr))
{
// We ARE stopped on an ARM instruction whose condition doesn't
- // pass so this instruction won't get executed.
- // Regardless of why it stopped, we need to clear the stop info
+ // pass so this instruction won't get executed. Regardless of why
+ // it stopped, we need to clear the stop info
thread.SetStopInfo (StopInfoSP());
}
}
diff --git a/source/Plugins/Architecture/Arm/ArchitectureArm.h b/source/Plugins/Architecture/Arm/ArchitectureArm.h
index 9ce6c69ef271..484c4a52fcc6 100644
--- a/source/Plugins/Architecture/Arm/ArchitectureArm.h
+++ b/source/Plugins/Architecture/Arm/ArchitectureArm.h
@@ -23,7 +23,7 @@ public:
ConstString GetPluginName() override;
uint32_t GetPluginVersion() override;
- void OverrideStopInfo(Thread &thread) override;
+ void OverrideStopInfo(Thread &thread) const override;
private:
static std::unique_ptr<Architecture> Create(const ArchSpec &arch);
diff --git a/source/Plugins/Architecture/CMakeLists.txt b/source/Plugins/Architecture/CMakeLists.txt
index 5abaa8e68231..01365a64cf96 100644
--- a/source/Plugins/Architecture/CMakeLists.txt
+++ b/source/Plugins/Architecture/CMakeLists.txt
@@ -1 +1,2 @@
add_subdirectory(Arm)
+add_subdirectory(PPC64)
diff --git a/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp b/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
new file mode 100644
index 000000000000..619de093aacc
--- /dev/null
+++ b/source/Plugins/Architecture/PPC64/ArchitecturePPC64.cpp
@@ -0,0 +1,69 @@
+//===-- ArchitecturePPC64.cpp -----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Symbol/Function.h"
+#include "lldb/Symbol/Symbol.h"
+#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Target/Thread.h"
+#include "lldb/Utility/ArchSpec.h"
+
+#include "llvm/BinaryFormat/ELF.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+ConstString ArchitecturePPC64::GetPluginNameStatic() {
+ return ConstString("ppc64");
+}
+
+void ArchitecturePPC64::Initialize() {
+ PluginManager::RegisterPlugin(GetPluginNameStatic(),
+ "PPC64-specific algorithms",
+ &ArchitecturePPC64::Create);
+}
+
+void ArchitecturePPC64::Terminate() {
+ PluginManager::UnregisterPlugin(&ArchitecturePPC64::Create);
+}
+
+std::unique_ptr<Architecture> ArchitecturePPC64::Create(const ArchSpec &arch) {
+ if ((arch.GetMachine() != llvm::Triple::ppc64 &&
+ arch.GetMachine() != llvm::Triple::ppc64le) ||
+ arch.GetTriple().getObjectFormat() != llvm::Triple::ObjectFormatType::ELF)
+ return nullptr;
+ return std::unique_ptr<Architecture>(new ArchitecturePPC64());
+}
+
+ConstString ArchitecturePPC64::GetPluginName() { return GetPluginNameStatic(); }
+uint32_t ArchitecturePPC64::GetPluginVersion() { return 1; }
+
+static int32_t GetLocalEntryOffset(const Symbol &sym) {
+ unsigned char other = sym.GetFlags() >> 8 & 0xFF;
+ return llvm::ELF::decodePPC64LocalEntryOffset(other);
+}
+
+size_t ArchitecturePPC64::GetBytesToSkip(Symbol &func,
+ const Address &curr_addr) const {
+ if (curr_addr.GetFileAddress() ==
+ func.GetFileAddress() + GetLocalEntryOffset(func))
+ return func.GetPrologueByteSize();
+ return 0;
+}
+
+void ArchitecturePPC64::AdjustBreakpointAddress(const Symbol &func,
+ Address &addr) const {
+ int32_t loffs = GetLocalEntryOffset(func);
+ if (!loffs)
+ return;
+
+ addr.SetOffset(addr.GetOffset() + loffs);
+}
diff --git a/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h b/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h
new file mode 100644
index 000000000000..95638853ad3d
--- /dev/null
+++ b/source/Plugins/Architecture/PPC64/ArchitecturePPC64.h
@@ -0,0 +1,44 @@
+//===-- ArchitecturePPC64.h -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_PLUGIN_ARCHITECTURE_PPC64_H
+#define LLDB_PLUGIN_ARCHITECTURE_PPC64_H
+
+#include "lldb/Core/Architecture.h"
+
+namespace lldb_private {
+
+class ArchitecturePPC64 : public Architecture {
+public:
+ static ConstString GetPluginNameStatic();
+ static void Initialize();
+ static void Terminate();
+
+ ConstString GetPluginName() override;
+ uint32_t GetPluginVersion() override;
+
+ void OverrideStopInfo(Thread &thread) const override {}
+
+ //------------------------------------------------------------------
+ /// This method compares current address with current function's
+ /// local entry point, returning the bytes to skip if they match.
+ //------------------------------------------------------------------
+ size_t GetBytesToSkip(Symbol &func, const Address &curr_addr) const override;
+
+ void AdjustBreakpointAddress(const Symbol &func,
+ Address &addr) const override;
+
+private:
+ static std::unique_ptr<Architecture> Create(const ArchSpec &arch);
+ ArchitecturePPC64() = default;
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_PLUGIN_ARCHITECTURE_PPC64_H
diff --git a/source/Plugins/Architecture/PPC64/CMakeLists.txt b/source/Plugins/Architecture/PPC64/CMakeLists.txt
new file mode 100644
index 000000000000..2cba112cf882
--- /dev/null
+++ b/source/Plugins/Architecture/PPC64/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_lldb_library(lldbPluginArchitecturePPC64 PLUGIN
+ ArchitecturePPC64.cpp
+
+ LINK_LIBS
+ lldbPluginProcessUtility
+ lldbCore
+ lldbTarget
+ lldbUtility
+ LINK_COMPONENTS
+ Support
+ )
diff --git a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
index a61abb9898ac..9b381dd3b96c 100644
--- a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
+++ b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.cpp
@@ -10,6 +10,9 @@
// C Includes
// C++ Includes
// Project includes
+#include "DisassemblerLLVMC.h"
+
+// Other libraries and framework includes
#include "llvm-c/Disassembler.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/MC/MCAsmInfo.h"
@@ -27,9 +30,6 @@
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/TargetSelect.h"
-// Other libraries and framework includes
-#include "DisassemblerLLVMC.h"
-
#include "lldb/Core/Address.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/SymbolContext.h"
@@ -41,13 +41,47 @@
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Log.h"
-#include "lldb/Utility/Stream.h"
-
#include "lldb/Utility/RegularExpression.h"
+#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
+class DisassemblerLLVMC::MCDisasmInstance {
+public:
+ static std::unique_ptr<MCDisasmInstance>
+ Create(const char *triple, const char *cpu, const char *features_str,
+ unsigned flavor, DisassemblerLLVMC &owner);
+
+ ~MCDisasmInstance() = default;
+
+ uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len,
+ lldb::addr_t pc, llvm::MCInst &mc_inst) const;
+ void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string,
+ std::string &comments_string);
+ void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style);
+ bool CanBranch(llvm::MCInst &mc_inst) const;
+ bool HasDelaySlot(llvm::MCInst &mc_inst) const;
+ bool IsCall(llvm::MCInst &mc_inst) const;
+
+private:
+ MCDisasmInstance(std::unique_ptr<llvm::MCInstrInfo> &&instr_info_up,
+ std::unique_ptr<llvm::MCRegisterInfo> &&reg_info_up,
+ std::unique_ptr<llvm::MCSubtargetInfo> &&subtarget_info_up,
+ std::unique_ptr<llvm::MCAsmInfo> &&asm_info_up,
+ std::unique_ptr<llvm::MCContext> &&context_up,
+ std::unique_ptr<llvm::MCDisassembler> &&disasm_up,
+ std::unique_ptr<llvm::MCInstPrinter> &&instr_printer_up);
+
+ std::unique_ptr<llvm::MCInstrInfo> m_instr_info_up;
+ std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_up;
+ std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_up;
+ std::unique_ptr<llvm::MCAsmInfo> m_asm_info_up;
+ std::unique_ptr<llvm::MCContext> m_context_up;
+ std::unique_ptr<llvm::MCDisassembler> m_disasm_up;
+ std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_up;
+};
+
class InstructionLLVMC : public lldb_private::Instruction {
public:
InstructionLLVMC(DisassemblerLLVMC &disasm,
@@ -72,7 +106,7 @@ public:
bool is_alternate_isa;
lldb::addr_t pc = m_address.GetFileAddress();
- DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+ DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
GetDisasmToUse(is_alternate_isa);
const uint8_t *opcode_data = data.GetDataStart();
const size_t opcode_data_len = data.GetByteSize();
@@ -107,7 +141,7 @@ public:
bool is_alternate_isa;
lldb::addr_t pc = m_address.GetFileAddress();
- DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+ DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
GetDisasmToUse(is_alternate_isa);
const uint8_t *opcode_data = data.GetDataStart();
const size_t opcode_data_len = data.GetByteSize();
@@ -132,19 +166,19 @@ public:
return m_has_delay_slot == eLazyBoolYes;
}
- DisassemblerLLVMC::LLVMCDisassembler *GetDisasmToUse(bool &is_alternate_isa) {
+ DisassemblerLLVMC::MCDisasmInstance *GetDisasmToUse(bool &is_alternate_isa) {
is_alternate_isa = false;
std::shared_ptr<DisassemblerLLVMC> disasm_sp(GetDisassembler());
if (disasm_sp) {
- if (disasm_sp->m_alternate_disasm_ap.get() != NULL) {
+ if (disasm_sp->m_alternate_disasm_up) {
const AddressClass address_class = GetAddressClass();
- if (address_class == eAddressClassCodeAlternateISA) {
+ if (address_class == AddressClass::eCodeAlternateISA) {
is_alternate_isa = true;
- return disasm_sp->m_alternate_disasm_ap.get();
+ return disasm_sp->m_alternate_disasm_up.get();
}
}
- return disasm_sp->m_disasm_ap.get();
+ return disasm_sp->m_disasm_up.get();
}
return nullptr;
}
@@ -197,7 +231,7 @@ public:
}
if (!got_op) {
bool is_alternate_isa = false;
- DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+ DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
GetDisasmToUse(is_alternate_isa);
const llvm::Triple::ArchType machine = arch.GetMachine();
@@ -264,12 +298,12 @@ public:
std::shared_ptr<DisassemblerLLVMC> disasm_sp(GetDisassembler());
if (disasm_sp) {
- DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr;
+ DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr;
- if (address_class == eAddressClassCodeAlternateISA)
- mc_disasm_ptr = disasm_sp->m_alternate_disasm_ap.get();
+ if (address_class == AddressClass::eCodeAlternateISA)
+ mc_disasm_ptr = disasm_sp->m_alternate_disasm_up.get();
else
- mc_disasm_ptr = disasm_sp->m_disasm_ap.get();
+ mc_disasm_ptr = disasm_sp->m_disasm_up.get();
lldb::addr_t pc = m_address.GetFileAddress();
m_using_file_addr = true;
@@ -850,7 +884,7 @@ public:
bool is_alternate_isa;
lldb::addr_t pc = m_address.GetFileAddress();
- DisassemblerLLVMC::LLVMCDisassembler *mc_disasm_ptr =
+ DisassemblerLLVMC::MCDisasmInstance *mc_disasm_ptr =
GetDisasmToUse(is_alternate_isa);
const uint8_t *opcode_data = data.GetDataStart();
const size_t opcode_data_len = data.GetByteSize();
@@ -881,80 +915,103 @@ protected:
bool m_using_file_addr;
};
-DisassemblerLLVMC::LLVMCDisassembler::LLVMCDisassembler(
- const char *triple, const char *cpu, const char *features_str,
- unsigned flavor, DisassemblerLLVMC &owner)
- : m_is_valid(true) {
+std::unique_ptr<DisassemblerLLVMC::MCDisasmInstance>
+DisassemblerLLVMC::MCDisasmInstance::Create(const char *triple, const char *cpu,
+ const char *features_str,
+ unsigned flavor,
+ DisassemblerLLVMC &owner) {
+ using Instance = std::unique_ptr<DisassemblerLLVMC::MCDisasmInstance>;
+
std::string Status;
const llvm::Target *curr_target =
llvm::TargetRegistry::lookupTarget(triple, Status);
- if (!curr_target) {
- m_is_valid = false;
- return;
- }
+ if (!curr_target)
+ return Instance();
- m_instr_info_ap.reset(curr_target->createMCInstrInfo());
- m_reg_info_ap.reset(curr_target->createMCRegInfo(triple));
-
- m_subtarget_info_ap.reset(
- curr_target->createMCSubtargetInfo(triple, cpu, features_str));
+ std::unique_ptr<llvm::MCInstrInfo> instr_info_up(
+ curr_target->createMCInstrInfo());
+ if (!instr_info_up)
+ return Instance();
- std::unique_ptr<llvm::MCRegisterInfo> reg_info(
+ std::unique_ptr<llvm::MCRegisterInfo> reg_info_up(
curr_target->createMCRegInfo(triple));
- m_asm_info_ap.reset(curr_target->createMCAsmInfo(*reg_info, triple));
+ if (!reg_info_up)
+ return Instance();
- if (m_instr_info_ap.get() == NULL || m_reg_info_ap.get() == NULL ||
- m_subtarget_info_ap.get() == NULL || m_asm_info_ap.get() == NULL) {
- m_is_valid = false;
- return;
- }
-
- m_context_ap.reset(
- new llvm::MCContext(m_asm_info_ap.get(), m_reg_info_ap.get(), 0));
-
- m_disasm_ap.reset(curr_target->createMCDisassembler(
- *m_subtarget_info_ap.get(), *m_context_ap.get()));
- if (m_disasm_ap.get() && m_context_ap.get()) {
- std::unique_ptr<llvm::MCRelocationInfo> RelInfo(
- curr_target->createMCRelocationInfo(triple, *m_context_ap.get()));
- if (!RelInfo) {
- m_is_valid = false;
- return;
- }
- std::unique_ptr<llvm::MCSymbolizer> symbolizer_up(
- curr_target->createMCSymbolizer(
- triple, NULL, DisassemblerLLVMC::SymbolLookupCallback,
- (void *)&owner, m_context_ap.get(), std::move(RelInfo)));
- m_disasm_ap->setSymbolizer(std::move(symbolizer_up));
-
- unsigned asm_printer_variant;
- if (flavor == ~0U)
- asm_printer_variant = m_asm_info_ap->getAssemblerDialect();
- else {
- asm_printer_variant = flavor;
- }
-
- m_instr_printer_ap.reset(curr_target->createMCInstPrinter(
- llvm::Triple{triple}, asm_printer_variant, *m_asm_info_ap.get(),
- *m_instr_info_ap.get(), *m_reg_info_ap.get()));
- if (m_instr_printer_ap.get() == NULL) {
- m_disasm_ap.reset();
- m_is_valid = false;
- }
- } else
- m_is_valid = false;
+ std::unique_ptr<llvm::MCSubtargetInfo> subtarget_info_up(
+ curr_target->createMCSubtargetInfo(triple, cpu, features_str));
+ if (!subtarget_info_up)
+ return Instance();
+
+ std::unique_ptr<llvm::MCAsmInfo> asm_info_up(
+ curr_target->createMCAsmInfo(*reg_info_up, triple));
+ if (!asm_info_up)
+ return Instance();
+
+ std::unique_ptr<llvm::MCContext> context_up(
+ new llvm::MCContext(asm_info_up.get(), reg_info_up.get(), 0));
+ if (!context_up)
+ return Instance();
+
+ std::unique_ptr<llvm::MCDisassembler> disasm_up(
+ curr_target->createMCDisassembler(*subtarget_info_up, *context_up));
+ if (!disasm_up)
+ return Instance();
+
+ std::unique_ptr<llvm::MCRelocationInfo> rel_info_up(
+ curr_target->createMCRelocationInfo(triple, *context_up));
+ if (!rel_info_up)
+ return Instance();
+
+ std::unique_ptr<llvm::MCSymbolizer> symbolizer_up(
+ curr_target->createMCSymbolizer(
+ triple, nullptr, DisassemblerLLVMC::SymbolLookupCallback, &owner,
+ context_up.get(), std::move(rel_info_up)));
+ disasm_up->setSymbolizer(std::move(symbolizer_up));
+
+ unsigned asm_printer_variant =
+ flavor == ~0U ? asm_info_up->getAssemblerDialect() : flavor;
+
+ std::unique_ptr<llvm::MCInstPrinter> instr_printer_up(
+ curr_target->createMCInstPrinter(llvm::Triple{triple},
+ asm_printer_variant, *asm_info_up,
+ *instr_info_up, *reg_info_up));
+ if (!instr_printer_up)
+ return Instance();
+
+ return Instance(
+ new MCDisasmInstance(std::move(instr_info_up), std::move(reg_info_up),
+ std::move(subtarget_info_up), std::move(asm_info_up),
+ std::move(context_up), std::move(disasm_up),
+ std::move(instr_printer_up)));
}
-DisassemblerLLVMC::LLVMCDisassembler::~LLVMCDisassembler() = default;
+DisassemblerLLVMC::MCDisasmInstance::MCDisasmInstance(
+ std::unique_ptr<llvm::MCInstrInfo> &&instr_info_up,
+ std::unique_ptr<llvm::MCRegisterInfo> &&reg_info_up,
+ std::unique_ptr<llvm::MCSubtargetInfo> &&subtarget_info_up,
+ std::unique_ptr<llvm::MCAsmInfo> &&asm_info_up,
+ std::unique_ptr<llvm::MCContext> &&context_up,
+ std::unique_ptr<llvm::MCDisassembler> &&disasm_up,
+ std::unique_ptr<llvm::MCInstPrinter> &&instr_printer_up)
+ : m_instr_info_up(std::move(instr_info_up)),
+ m_reg_info_up(std::move(reg_info_up)),
+ m_subtarget_info_up(std::move(subtarget_info_up)),
+ m_asm_info_up(std::move(asm_info_up)),
+ m_context_up(std::move(context_up)), m_disasm_up(std::move(disasm_up)),
+ m_instr_printer_up(std::move(instr_printer_up)) {
+ assert(m_instr_info_up && m_reg_info_up && m_subtarget_info_up &&
+ m_asm_info_up && m_context_up && m_disasm_up && m_instr_printer_up);
+}
-uint64_t DisassemblerLLVMC::LLVMCDisassembler::GetMCInst(
+uint64_t DisassemblerLLVMC::MCDisasmInstance::GetMCInst(
const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc,
- llvm::MCInst &mc_inst) {
+ llvm::MCInst &mc_inst) const {
llvm::ArrayRef<uint8_t> data(opcode_data, opcode_data_len);
llvm::MCDisassembler::DecodeStatus status;
uint64_t new_inst_size;
- status = m_disasm_ap->getInstruction(mc_inst, new_inst_size, data, pc,
+ status = m_disasm_up->getInstruction(mc_inst, new_inst_size, data, pc,
llvm::nulls(), llvm::nulls());
if (status == llvm::MCDisassembler::Success)
return new_inst_size;
@@ -962,16 +1019,16 @@ uint64_t DisassemblerLLVMC::LLVMCDisassembler::GetMCInst(
return 0;
}
-void DisassemblerLLVMC::LLVMCDisassembler::PrintMCInst(
+void DisassemblerLLVMC::MCDisasmInstance::PrintMCInst(
llvm::MCInst &mc_inst, std::string &inst_string,
std::string &comments_string) {
llvm::raw_string_ostream inst_stream(inst_string);
llvm::raw_string_ostream comments_stream(comments_string);
- m_instr_printer_ap->setCommentStream(comments_stream);
- m_instr_printer_ap->printInst(&mc_inst, inst_stream, llvm::StringRef(),
- *m_subtarget_info_ap);
- m_instr_printer_ap->setCommentStream(llvm::nulls());
+ m_instr_printer_up->setCommentStream(comments_stream);
+ m_instr_printer_up->printInst(&mc_inst, inst_stream, llvm::StringRef(),
+ *m_subtarget_info_up);
+ m_instr_printer_up->setCommentStream(llvm::nulls());
comments_stream.flush();
static std::string g_newlines("\r\n");
@@ -985,30 +1042,32 @@ void DisassemblerLLVMC::LLVMCDisassembler::PrintMCInst(
}
}
-void DisassemblerLLVMC::LLVMCDisassembler::SetStyle(
+void DisassemblerLLVMC::MCDisasmInstance::SetStyle(
bool use_hex_immed, HexImmediateStyle hex_style) {
- m_instr_printer_ap->setPrintImmHex(use_hex_immed);
+ m_instr_printer_up->setPrintImmHex(use_hex_immed);
switch (hex_style) {
case eHexStyleC:
- m_instr_printer_ap->setPrintHexStyle(llvm::HexStyle::C);
+ m_instr_printer_up->setPrintHexStyle(llvm::HexStyle::C);
break;
case eHexStyleAsm:
- m_instr_printer_ap->setPrintHexStyle(llvm::HexStyle::Asm);
+ m_instr_printer_up->setPrintHexStyle(llvm::HexStyle::Asm);
break;
}
}
-bool DisassemblerLLVMC::LLVMCDisassembler::CanBranch(llvm::MCInst &mc_inst) {
- return m_instr_info_ap->get(mc_inst.getOpcode())
- .mayAffectControlFlow(mc_inst, *m_reg_info_ap.get());
+bool DisassemblerLLVMC::MCDisasmInstance::CanBranch(
+ llvm::MCInst &mc_inst) const {
+ return m_instr_info_up->get(mc_inst.getOpcode())
+ .mayAffectControlFlow(mc_inst, *m_reg_info_up);
}
-bool DisassemblerLLVMC::LLVMCDisassembler::HasDelaySlot(llvm::MCInst &mc_inst) {
- return m_instr_info_ap->get(mc_inst.getOpcode()).hasDelaySlot();
+bool DisassemblerLLVMC::MCDisasmInstance::HasDelaySlot(
+ llvm::MCInst &mc_inst) const {
+ return m_instr_info_up->get(mc_inst.getOpcode()).hasDelaySlot();
}
-bool DisassemblerLLVMC::LLVMCDisassembler::IsCall(llvm::MCInst &mc_inst) {
- return m_instr_info_ap->get(mc_inst.getOpcode()).isCall();
+bool DisassemblerLLVMC::MCDisasmInstance::IsCall(llvm::MCInst &mc_inst) const {
+ return m_instr_info_up->get(mc_inst.getOpcode()).isCall();
}
DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
@@ -1023,8 +1082,7 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
llvm::Triple triple = arch.GetTriple();
// So far the only supported flavor is "intel" on x86. The base class will
- // set this
- // correctly coming in.
+ // set this correctly coming in.
if (triple.getArch() == llvm::Triple::x86 ||
triple.getArch() == llvm::Triple::x86_64) {
if (m_flavor == "intel") {
@@ -1048,12 +1106,10 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
}
// If no sub architecture specified then use the most recent arm architecture
- // so the
- // disassembler will return all instruction. Without it we will see a lot of
- // unknow opcode
- // in case the code uses instructions which are not available in the oldest
- // arm version
- // (used when no sub architecture is specified)
+ // so the disassembler will return all instruction. Without it we will see a
+ // lot of unknow opcode in case the code uses instructions which are not
+ // available in the oldest arm version (used when no sub architecture is
+ // specified)
if (triple.getArch() == llvm::Triple::arm &&
triple.getSubArch() == llvm::Triple::NoSubArch)
triple.setArchName("armv8.2a");
@@ -1127,20 +1183,16 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
features_str += "+dspr2,";
}
- // If any AArch64 variant, enable the ARMv8.2 ISA
- // extensions so we can disassemble newer instructions.
+ // If any AArch64 variant, enable the ARMv8.2 ISA extensions so we can
+ // disassemble newer instructions.
if (triple.getArch() == llvm::Triple::aarch64)
features_str += "+v8.2a";
- m_disasm_ap.reset(new LLVMCDisassembler(triple_str, cpu, features_str.c_str(),
- flavor, *this));
- if (!m_disasm_ap->IsValid()) {
- // We use m_disasm_ap.get() to tell whether we are valid or not, so if this
- // isn't good for some reason,
- // we reset it, and then we won't be valid and FindPlugin will fail and we
- // won't get used.
- m_disasm_ap.reset();
- }
+ // We use m_disasm_ap.get() to tell whether we are valid or not, so if this
+ // isn't good for some reason, we won't be valid and FindPlugin will fail and
+ // we won't get used.
+ m_disasm_up = MCDisasmInstance::Create(triple_str, cpu, features_str.c_str(),
+ flavor, *this);
llvm::Triple::ArchType llvm_arch = triple.getArch();
@@ -1148,12 +1200,11 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
// thumb instruction disassembler.
if (llvm_arch == llvm::Triple::arm) {
std::string thumb_triple(thumb_arch.GetTriple().getTriple());
- m_alternate_disasm_ap.reset(
- new LLVMCDisassembler(thumb_triple.c_str(), "", "", flavor, *this));
- if (!m_alternate_disasm_ap->IsValid()) {
- m_disasm_ap.reset();
- m_alternate_disasm_ap.reset();
- }
+ m_alternate_disasm_up =
+ MCDisasmInstance::Create(thumb_triple.c_str(), "", "", flavor, *this);
+ if (!m_alternate_disasm_up)
+ m_disasm_up.reset();
+
} else if (llvm_arch == llvm::Triple::mips ||
llvm_arch == llvm::Triple::mipsel ||
llvm_arch == llvm::Triple::mips64 ||
@@ -1165,12 +1216,10 @@ DisassemblerLLVMC::DisassemblerLLVMC(const ArchSpec &arch,
else if (arch_flags & ArchSpec::eMIPSAse_micromips)
features_str += "+micromips,";
- m_alternate_disasm_ap.reset(new LLVMCDisassembler(
- triple_str, cpu, features_str.c_str(), flavor, *this));
- if (!m_alternate_disasm_ap->IsValid()) {
- m_disasm_ap.reset();
- m_alternate_disasm_ap.reset();
- }
+ m_alternate_disasm_up = MCDisasmInstance::Create(
+ triple_str, cpu, features_str.c_str(), flavor, *this);
+ if (!m_alternate_disasm_up)
+ m_disasm_up.reset();
}
}
@@ -1208,9 +1257,9 @@ size_t DisassemblerLLVMC::DecodeInstructions(const Address &base_addr,
while (data_cursor < data_byte_size &&
instructions_parsed < num_instructions) {
- AddressClass address_class = eAddressClassCode;
+ AddressClass address_class = AddressClass::eCode;
- if (m_alternate_disasm_ap.get() != NULL)
+ if (m_alternate_disasm_up)
address_class = inst_addr.GetAddressClass();
InstructionSP inst_sp(
@@ -1285,6 +1334,8 @@ bool DisassemblerLLVMC::FlavorValidForArchSpec(
return false;
}
+bool DisassemblerLLVMC::IsValid() const { return m_disasm_up.operator bool(); }
+
int DisassemblerLLVMC::OpInfo(uint64_t PC, uint64_t Offset, uint64_t Size,
int tag_type, void *tag_bug) {
switch (tag_type) {
@@ -1337,8 +1388,8 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
}
}
- // If the "value" address (the target address we're symbolicating)
- // is inside the same SymbolContext as the current instruction pc
+ // If the "value" address (the target address we're symbolicating) is
+ // inside the same SymbolContext as the current instruction pc
// (pc_so_addr), don't print the full function name - just print it
// with DumpStyleNoFunctionName style, e.g. "<+36>".
if (format_omitting_current_func_name) {
@@ -1353,9 +1404,8 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
if (!ss.GetString().empty()) {
// If Address::Dump returned a multi-line description, most commonly
- // seen when we
- // have multiple levels of inlined functions at an address, only show
- // the first line.
+ // seen when we have multiple levels of inlined functions at an
+ // address, only show the first line.
std::string str = ss.GetString();
size_t first_eol_char = str.find_first_of("\r\n");
if (first_eol_char != std::string::npos) {
diff --git a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
index 26bed7ee0d7b..b7e9ccb34701 100644
--- a/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
+++ b/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
@@ -16,62 +16,14 @@
#include <mutex>
#include <string>
-// Other libraries and framework includes
-#include "llvm-c/Disassembler.h"
-
// Project includes
#include "lldb/Core/Address.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/PluginManager.h"
-// Opaque references to C++ Objects in LLVM's MC.
-namespace llvm {
-class MCContext;
-class MCInst;
-class MCInstrInfo;
-class MCRegisterInfo;
-class MCDisassembler;
-class MCInstPrinter;
-class MCAsmInfo;
-class MCSubtargetInfo;
-} // namespace llvm
-
class InstructionLLVMC;
class DisassemblerLLVMC : public lldb_private::Disassembler {
- // Since we need to make two actual MC Disassemblers for ARM (ARM & THUMB),
- // and there's a bit of goo to set up and own
- // in the MC disassembler world, I added this class to manage the actual
- // disassemblers.
- class LLVMCDisassembler {
- public:
- LLVMCDisassembler(const char *triple, const char *cpu,
- const char *features_str, unsigned flavor,
- DisassemblerLLVMC &owner);
-
- ~LLVMCDisassembler();
-
- uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len,
- lldb::addr_t pc, llvm::MCInst &mc_inst);
- void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string,
- std::string &comments_string);
- void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style);
- bool CanBranch(llvm::MCInst &mc_inst);
- bool HasDelaySlot(llvm::MCInst &mc_inst);
- bool IsCall(llvm::MCInst &mc_inst);
- bool IsValid() { return m_is_valid; }
-
- private:
- bool m_is_valid;
- std::unique_ptr<llvm::MCContext> m_context_ap;
- std::unique_ptr<llvm::MCAsmInfo> m_asm_info_ap;
- std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_ap;
- std::unique_ptr<llvm::MCInstrInfo> m_instr_info_ap;
- std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_ap;
- std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_ap;
- std::unique_ptr<llvm::MCDisassembler> m_disasm_ap;
- };
-
public:
DisassemblerLLVMC(const lldb_private::ArchSpec &arch,
const char *flavor /* = NULL */);
@@ -108,9 +60,7 @@ protected:
bool FlavorValidForArchSpec(const lldb_private::ArchSpec &arch,
const char *flavor) override;
- bool IsValid() {
- return (m_disasm_ap.get() != NULL && m_disasm_ap->IsValid());
- }
+ bool IsValid() const;
int OpInfo(uint64_t PC, uint64_t Offset, uint64_t Size, int TagType,
void *TagBug);
@@ -145,8 +95,12 @@ protected:
std::mutex m_mutex;
bool m_data_from_file;
- std::unique_ptr<LLVMCDisassembler> m_disasm_ap;
- std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap;
+ // Since we need to make two actual MC Disassemblers for ARM (ARM & THUMB),
+ // and there's a bit of goo to set up and own in the MC disassembler world,
+ // this class was added to manage the actual disassemblers.
+ class MCDisasmInstance;
+ std::unique_ptr<MCDisasmInstance> m_disasm_up;
+ std::unique_ptr<MCDisasmInstance> m_alternate_disasm_up;
};
#endif // liblldb_DisassemblerLLVM_h_
diff --git a/source/Plugins/DynamicLoader/CMakeLists.txt b/source/Plugins/DynamicLoader/CMakeLists.txt
index 8e1b316a3c25..9f3b2ab0e50f 100644
--- a/source/Plugins/DynamicLoader/CMakeLists.txt
+++ b/source/Plugins/DynamicLoader/CMakeLists.txt
@@ -1,9 +1,6 @@
+add_subdirectory(Darwin-Kernel)
add_subdirectory(MacOSX-DYLD)
add_subdirectory(POSIX-DYLD)
add_subdirectory(Static)
add_subdirectory(Hexagon-DYLD)
add_subdirectory(Windows-DYLD)
-
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- add_subdirectory(Darwin-Kernel)
-endif()
diff --git a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
index a81a0306671e..8999000dff8c 100644
--- a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
+++ b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
@@ -8,8 +8,6 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Utility/SafeMachO.h"
-
#include "Plugins/Platform/MacOSX/PlatformDarwinKernel.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
@@ -45,10 +43,10 @@
using namespace lldb;
using namespace lldb_private;
-// Progressively greater amounts of scanning we will allow
-// For some targets very early in startup, we can't do any random reads of
-// memory or we can crash the device
-// so a setting is needed that can completely disable the KASLR scans.
+// Progressively greater amounts of scanning we will allow For some targets
+// very early in startup, we can't do any random reads of memory or we can
+// crash the device so a setting is needed that can completely disable the
+// KASLR scans.
enum KASLRScanType {
eKASLRScanNone = 0, // No reading into the inferior at all
@@ -122,15 +120,15 @@ static const DynamicLoaderDarwinKernelPropertiesSP &GetGlobalProperties() {
}
//----------------------------------------------------------------------
-// Create an instance of this class. This function is filled into
-// the plugin info class that gets handed out by the plugin factory and
-// allows the lldb to instantiate an instance of this class.
+// Create an instance of this class. This function is filled into the plugin
+// info class that gets handed out by the plugin factory and allows the lldb to
+// instantiate an instance of this class.
//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
bool force) {
if (!force) {
- // If the user provided an executable binary and it is not a kernel,
- // this plugin should not create an instance.
+ // If the user provided an executable binary and it is not a kernel, this
+ // plugin should not create an instance.
Module *exe_module = process->GetTarget().GetExecutableModulePointer();
if (exe_module) {
ObjectFile *object_file = exe_module->GetObjectFile();
@@ -155,8 +153,8 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
return NULL;
}
break;
- // If we have triple like armv7-unknown-unknown, we should try looking for a
- // Darwin kernel.
+ // If we have triple like armv7-unknown-unknown, we should try looking for
+ // a Darwin kernel.
case llvm::Triple::UnknownOS:
break;
default:
@@ -166,9 +164,8 @@ DynamicLoader *DynamicLoaderDarwinKernel::CreateInstance(Process *process,
}
// At this point if there is an ExecutableModule, it is a kernel and the
- // Target is some variant of an Apple system.
- // If the Process hasn't provided the kernel load address, we need to look
- // around in memory to find it.
+ // Target is some variant of an Apple system. If the Process hasn't provided
+ // the kernel load address, we need to look around in memory to find it.
const addr_t kernel_load_address = SearchForDarwinKernel(process);
if (CheckForKernelImageAtAddress(kernel_load_address, process).IsValid()) {
@@ -197,10 +194,9 @@ DynamicLoaderDarwinKernel::SearchForDarwinKernel(Process *process) {
}
//----------------------------------------------------------------------
-// Check if the kernel binary is loaded in memory without a slide.
-// First verify that the ExecutableModule is a kernel before we proceed.
-// Returns the address of the kernel if one was found, else
-// LLDB_INVALID_ADDRESS.
+// Check if the kernel binary is loaded in memory without a slide. First verify
+// that the ExecutableModule is a kernel before we proceed. Returns the address
+// of the kernel if one was found, else LLDB_INVALID_ADDRESS.
//----------------------------------------------------------------------
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
@@ -229,10 +225,8 @@ DynamicLoaderDarwinKernel::SearchForKernelAtSameLoadAddr(Process *process) {
//----------------------------------------------------------------------
// If the debug flag is included in the boot-args nvram setting, the kernel's
-// load address
-// will be noted in the lowglo page at a fixed address
-// Returns the address of the kernel if one was found, else
-// LLDB_INVALID_ADDRESS.
+// load address will be noted in the lowglo page at a fixed address Returns the
+// address of the kernel if one was found, else LLDB_INVALID_ADDRESS.
//----------------------------------------------------------------------
lldb::addr_t
DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
@@ -282,8 +276,8 @@ DynamicLoaderDarwinKernel::SearchForKernelWithDebugHints(Process *process) {
}
//----------------------------------------------------------------------
-// If the kernel is currently executing when lldb attaches, and we don't have
-// a better way of finding the kernel's load address, try searching backwards
+// If the kernel is currently executing when lldb attaches, and we don't have a
+// better way of finding the kernel's load address, try searching backwards
// from the current pc value looking for the kernel's Mach header in memory.
// Returns the address of the kernel if one was found, else
// LLDB_INVALID_ADDRESS.
@@ -304,9 +298,8 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
return LLDB_INVALID_ADDRESS;
// The kernel will load at at one megabyte boundary (0x100000), or at that
- // boundary plus
- // an offset of one page (0x1000) or two, or four (0x4000), depending on the
- // device.
+ // boundary plus an offset of one page (0x1000) or two, or four (0x4000),
+ // depending on the device.
// Round the current pc down to the nearest one megabyte boundary - the place
// where we will start searching.
@@ -329,11 +322,10 @@ DynamicLoaderDarwinKernel::SearchForKernelNearPC(Process *process) {
}
//----------------------------------------------------------------------
-// Scan through the valid address range for a kernel binary.
-// This is uselessly slow in 64-bit environments so we don't even try it.
-// This scan is not enabled by default even for 32-bit targets.
-// Returns the address of the kernel if one was found, else
-// LLDB_INVALID_ADDRESS.
+// Scan through the valid address range for a kernel binary. This is uselessly
+// slow in 64-bit environments so we don't even try it. This scan is not
+// enabled by default even for 32-bit targets. Returns the address of the
+// kernel if one was found, else LLDB_INVALID_ADDRESS.
//----------------------------------------------------------------------
lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch(
Process *process) {
@@ -374,47 +366,30 @@ lldb::addr_t DynamicLoaderDarwinKernel::SearchForKernelViaExhaustiveSearch(
}
//----------------------------------------------------------------------
-// Given an address in memory, look to see if there is a kernel image at that
-// address.
-// Returns a UUID; if a kernel was not found at that address, UUID.IsValid()
-// will be false.
+// Read the mach_header struct out of memory and return it.
+// Returns true if the mach_header was successfully read,
+// Returns false if there was a problem reading the header, or it was not
+// a Mach-O header.
//----------------------------------------------------------------------
-lldb_private::UUID
-DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
- Process *process) {
- Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
- if (addr == LLDB_INVALID_ADDRESS)
- return UUID();
-
- if (log)
- log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
- "looking for kernel binary at 0x%" PRIx64,
- addr);
-
- // First try a quick test -- read the first 4 bytes and see if there is a
- // valid Mach-O magic field there
- // (the first field of the mach_header/mach_header_64 struct).
+bool
+DynamicLoaderDarwinKernel::ReadMachHeader(addr_t addr, Process *process, llvm::MachO::mach_header &header) {
Status read_error;
- uint8_t magicbuf[4];
- if (process->ReadMemoryFromInferior (addr, magicbuf, sizeof (magicbuf), read_error) != sizeof (magicbuf))
- return UUID();
+
+ // Read the mach header and see whether it looks like a kernel
+ if (process->DoReadMemory (addr, &header, sizeof(header), read_error) !=
+ sizeof(header))
+ return false;
const uint32_t magicks[] = { llvm::MachO::MH_MAGIC_64, llvm::MachO::MH_MAGIC, llvm::MachO::MH_CIGAM, llvm::MachO::MH_CIGAM_64};
bool found_matching_pattern = false;
for (size_t i = 0; i < llvm::array_lengthof (magicks); i++)
- if (::memcmp (magicbuf, &magicks[i], sizeof (magicbuf)) == 0)
+ if (::memcmp (&header.magic, &magicks[i], sizeof (uint32_t)) == 0)
found_matching_pattern = true;
if (found_matching_pattern == false)
- return UUID();
-
- // Read the mach header and see whether it looks like a kernel
- llvm::MachO::mach_header header;
- if (process->DoReadMemory(addr, &header, sizeof(header), read_error) !=
- sizeof(header))
- return UUID();
+ return false;
if (header.magic == llvm::MachO::MH_CIGAM ||
header.magic == llvm::MachO::MH_CIGAM_64) {
@@ -427,6 +402,35 @@ DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
header.flags = llvm::ByteSwap_32(header.flags);
}
+ return true;
+}
+
+//----------------------------------------------------------------------
+// Given an address in memory, look to see if there is a kernel image at that
+// address.
+// Returns a UUID; if a kernel was not found at that address, UUID.IsValid()
+// will be false.
+//----------------------------------------------------------------------
+lldb_private::UUID
+DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress(lldb::addr_t addr,
+ Process *process) {
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
+ if (addr == LLDB_INVALID_ADDRESS)
+ return UUID();
+
+ if (log)
+ log->Printf("DynamicLoaderDarwinKernel::CheckForKernelImageAtAddress: "
+ "looking for kernel binary at 0x%" PRIx64,
+ addr);
+
+ llvm::MachO::mach_header header;
+
+ if (ReadMachHeader (addr, process, header) == false)
+ return UUID();
+
+ // First try a quick test -- read the first 4 bytes and see if there is a
+ // valid Mach-O magic field there
+ // (the first field of the mach_header/mach_header_64 struct).
// A kernel is an executable which does not have the dynamic link object flag
// set.
if (header.filetype == llvm::MachO::MH_EXECUTE &&
@@ -630,10 +634,8 @@ UUID DynamicLoaderDarwinKernel::KextImageInfo::GetUUID() const {
}
// Given the m_load_address from the kext summaries, and a UUID, try to create
-// an in-memory
-// Module at that address. Require that the MemoryModule have a matching UUID
-// and detect
-// if this MemoryModule is a kernel or a kext.
+// an in-memory Module at that address. Require that the MemoryModule have a
+// matching UUID and detect if this MemoryModule is a kernel or a kext.
//
// Returns true if m_memory_module_sp is now set to a valid Module.
@@ -646,10 +648,19 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
return false;
FileSpec file_spec;
- file_spec.SetFile(m_name.c_str(), false);
+ file_spec.SetFile(m_name.c_str(), false, FileSpec::Style::native);
+
+ llvm::MachO::mach_header mh;
+ size_t size_to_read = 512;
+ if (ReadMachHeader (m_load_address, process, mh)) {
+ if (mh.magic == llvm::MachO::MH_CIGAM || llvm::MachO::MH_MAGIC)
+ size_to_read = sizeof (llvm::MachO::mach_header) + mh.sizeofcmds;
+ if (mh.magic == llvm::MachO::MH_CIGAM_64 || llvm::MachO::MH_MAGIC_64)
+ size_to_read = sizeof (llvm::MachO::mach_header_64) + mh.sizeofcmds;
+ }
ModuleSP memory_module_sp =
- process->ReadModuleFromMemory(file_spec, m_load_address);
+ process->ReadModuleFromMemory(file_spec, m_load_address, size_to_read);
if (memory_module_sp.get() == NULL)
return false;
@@ -668,10 +679,8 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::ReadMemoryModule(
}
// If this is a kext, and the kernel specified what UUID we should find at
- // this
- // load address, require that the memory module have a matching UUID or
- // something
- // has gone wrong and we should discard it.
+ // this load address, require that the memory module have a matching UUID or
+ // something has gone wrong and we should discard it.
if (m_uuid.IsValid()) {
if (m_uuid != memory_module_sp->GetUUID()) {
if (log) {
@@ -737,9 +746,8 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
Target &target = process->GetTarget();
- // If we don't have / can't create a memory module for this kext, don't try to
- // load it - we won't
- // have the correct segment load addresses.
+ // If we don't have / can't create a memory module for this kext, don't try
+ // to load it - we won't have the correct segment load addresses.
if (!ReadMemoryModule(process)) {
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
if (log)
@@ -772,9 +780,8 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
module_spec.GetUUID() = m_uuid;
module_spec.GetArchitecture() = target.GetArchitecture();
- // For the kernel, we really do need an on-disk file copy of the binary to
- // do anything useful.
- // This will force a clal to
+ // For the kernel, we really do need an on-disk file copy of the binary
+ // to do anything useful. This will force a clal to
if (IsKernel()) {
if (Symbols::DownloadObjectAndSymbolFile(module_spec, true)) {
if (module_spec.GetFileSpec().Exists()) {
@@ -791,10 +798,8 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
}
// If the current platform is PlatformDarwinKernel, create a ModuleSpec
- // with the filename set
- // to be the bundle ID for this kext, e.g.
- // "com.apple.filesystems.msdosfs", and ask the platform
- // to find it.
+ // with the filename set to be the bundle ID for this kext, e.g.
+ // "com.apple.filesystems.msdosfs", and ask the platform to find it.
PlatformSP platform_sp(target.GetPlatform());
if (!m_module_sp && platform_sp) {
ConstString platform_name(platform_sp->GetPluginName());
@@ -828,8 +833,9 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
}
}
- // If we managed to find a module, append it to the target's list of images.
- // If we also have a memory module, require that they have matching UUIDs
+ // If we managed to find a module, append it to the target's list of
+ // images. If we also have a memory module, require that they have matching
+ // UUIDs
if (m_module_sp) {
bool uuid_match_ok = true;
if (m_memory_module_sp) {
@@ -871,15 +877,15 @@ bool DynamicLoaderDarwinKernel::KextImageInfo::LoadImageUsingMemoryModule(
SectionList *memory_section_list = memory_object_file->GetSectionList();
if (memory_section_list && ondisk_section_list) {
const uint32_t num_ondisk_sections = ondisk_section_list->GetSize();
- // There may be CTF sections in the memory image so we can't
- // always just compare the number of sections (which are actually
- // segments in mach-o parlance)
+ // There may be CTF sections in the memory image so we can't always
+ // just compare the number of sections (which are actually segments
+ // in mach-o parlance)
uint32_t sect_idx = 0;
- // Use the memory_module's addresses for each section to set the
- // file module's load address as appropriate. We don't want to use
- // a single slide value for the entire kext - different segments may
- // be slid different amounts by the kext loader.
+ // Use the memory_module's addresses for each section to set the file
+ // module's load address as appropriate. We don't want to use a
+ // single slide value for the entire kext - different segments may be
+ // slid different amounts by the kext loader.
uint32_t num_sections_loaded = 0;
for (sect_idx = 0; sect_idx < num_ondisk_sections; ++sect_idx) {
@@ -969,10 +975,9 @@ DynamicLoaderDarwinKernel::KextImageInfo::GetArchitecture() const {
}
//----------------------------------------------------------------------
-// Load the kernel module and initialize the "m_kernel" member. Return
-// true _only_ if the kernel is loaded the first time through (subsequent
-// calls to this function should return false after the kernel has been
-// already loaded).
+// Load the kernel module and initialize the "m_kernel" member. Return true
+// _only_ if the kernel is loaded the first time through (subsequent calls to
+// this function should return false after the kernel has been already loaded).
//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
if (!m_kext_summary_header_ptr_addr.IsValid()) {
@@ -996,9 +1001,8 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
m_kernel.SetLoadAddress(m_kernel_load_address);
if (m_kernel.GetLoadAddress() == LLDB_INVALID_ADDRESS &&
m_kernel.GetModule()) {
- // We didn't get a hint from the process, so we will
- // try the kernel at the address that it exists at in
- // the file if we have one
+ // We didn't get a hint from the process, so we will try the kernel at
+ // the address that it exists at in the file if we have one
ObjectFile *kernel_object_file = m_kernel.GetModule()->GetObjectFile();
if (kernel_object_file) {
addr_t load_address =
@@ -1011,8 +1015,7 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
if (load_address != file_address) {
// Don't accidentally relocate the kernel to the File address --
// the Load address has already been set to its actual in-memory
- // address.
- // Mark it as IsLoaded.
+ // address. Mark it as IsLoaded.
m_kernel.SetProcessStopId(m_process->GetStopID());
}
} else {
@@ -1028,10 +1031,10 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
}
}
- // The operating system plugin gets loaded and initialized in
- // LoadImageUsingMemoryModule when we discover the kernel dSYM. For a
- // core file in particular, that's the wrong place to do this, since
- // we haven't fixed up the section addresses yet. So let's redo it here.
+ // The operating system plugin gets loaded and initialized in
+ // LoadImageUsingMemoryModule when we discover the kernel dSYM. For a core
+ // file in particular, that's the wrong place to do this, since we haven't
+ // fixed up the section addresses yet. So let's redo it here.
LoadOperatingSystemPlugin(false);
if (m_kernel.IsLoaded() && m_kernel.GetModule()) {
@@ -1052,9 +1055,9 @@ void DynamicLoaderDarwinKernel::LoadKernelModuleIfNeeded() {
//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
-// breakpoint gets hit. We update all of our image infos and then
-// let our super class DynamicLoader class decide if we should stop
-// or not (based on global preference).
+// breakpoint gets hit. We update all of our image infos and then let our super
+// class DynamicLoader class decide if we should stop or not (based on global
+// preference).
//----------------------------------------------------------------------
bool DynamicLoaderDarwinKernel::BreakpointHitCallback(
void *baton, StoppointCallbackContext *context, user_id_t break_id,
@@ -1087,8 +1090,8 @@ bool DynamicLoaderDarwinKernel::ReadKextSummaryHeader() {
const uint32_t addr_size = m_kernel.GetAddressByteSize();
const ByteOrder byte_order = m_kernel.GetByteOrder();
Status error;
- // Read enough bytes for a "OSKextLoadedKextSummaryHeader" structure
- // which is currently 4 uint32_t and a pointer.
+ // Read enough bytes for a "OSKextLoadedKextSummaryHeader" structure which
+ // is currently 4 uint32_t and a pointer.
uint8_t buf[24];
DataExtractor data(buf, sizeof(buf), byte_order, addr_size);
const size_t count = 4 * sizeof(uint32_t) + addr_size;
@@ -1130,7 +1133,8 @@ bool DynamicLoaderDarwinKernel::ReadKextSummaryHeader() {
return false;
}
} else {
- // Versions less than 2 didn't have an entry size, it was hard coded
+ // Versions less than 2 didn't have an entry size, it was hard
+ // coded
m_kext_summary_header.entry_size =
KERNEL_MODULE_ENTRY_SIZE_VERSION_1;
}
@@ -1156,13 +1160,10 @@ bool DynamicLoaderDarwinKernel::ReadKextSummaryHeader() {
}
// We've either (a) just attached to a new kernel, or (b) the kexts-changed
-// breakpoint was hit
-// and we need to figure out what kexts have been added or removed.
-// Read the kext summaries from the inferior kernel memory, compare them against
-// the
-// m_known_kexts vector and update the m_known_kexts vector as needed to keep in
-// sync with the
-// inferior.
+// breakpoint was hit and we need to figure out what kexts have been added or
+// removed. Read the kext summaries from the inferior kernel memory, compare
+// them against the m_known_kexts vector and update the m_known_kexts vector as
+// needed to keep in sync with the inferior.
bool DynamicLoaderDarwinKernel::ParseKextSummaries(
const Address &kext_summary_addr, uint32_t count) {
@@ -1178,14 +1179,13 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
return false;
// read the plugin.dynamic-loader.darwin-kernel.load-kexts setting -- if the
- // user requested no
- // kext loading, don't print any messages about kexts & don't try to read
- // them.
+ // user requested no kext loading, don't print any messages about kexts &
+ // don't try to read them.
const bool load_kexts = GetGlobalProperties()->GetLoadKexts();
// By default, all kexts we've loaded in the past are marked as "remove" and
- // all of the kexts
- // we just found out about from ReadKextSummaries are marked as "add".
+ // all of the kexts we just found out about from ReadKextSummaries are marked
+ // as "add".
std::vector<bool> to_be_removed(m_known_kexts.size(), true);
std::vector<bool> to_be_added(count, true);
@@ -1195,8 +1195,8 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
const uint32_t new_kexts_size = kext_summaries.size();
const uint32_t old_kexts_size = m_known_kexts.size();
- // The m_known_kexts vector may have entries that have been Cleared,
- // or are a kernel.
+ // The m_known_kexts vector may have entries that have been Cleared, or are a
+ // kernel.
for (uint32_t old_kext = 0; old_kext < old_kexts_size; old_kext++) {
bool ignore = false;
KextImageInfo &image_info = m_known_kexts[old_kext];
@@ -1229,10 +1229,9 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
break;
}
}
- // If this "kext" entry is actually an alias for the kernel --
- // the kext was compiled into the kernel or something -- then
- // we don't want to load the kernel's text section at a different
- // address. Ignore this kext entry.
+ // If this "kext" entry is actually an alias for the kernel -- the kext was
+ // compiled into the kernel or something -- then we don't want to load the
+ // kernel's text section at a different address. Ignore this kext entry.
if (kext_summaries[new_kext].GetUUID().IsValid()
&& m_kernel.GetUUID().IsValid()
&& kext_summaries[new_kext].GetUUID() == m_kernel.GetUUID()) {
@@ -1322,9 +1321,8 @@ bool DynamicLoaderDarwinKernel::ParseKextSummaries(
s->Printf(".");
image_info.Clear();
// should pull it out of the KextImageInfos vector but that would
- // mutate the list and invalidate
- // the to_be_removed bool vector; leaving it in place once Cleared()
- // is relatively harmless.
+ // mutate the list and invalidate the to_be_removed bool vector;
+ // leaving it in place once Cleared() is relatively harmless.
}
}
m_process->GetTarget().ModulesDidUnload(unloaded_module_list, false);
@@ -1370,7 +1368,7 @@ uint32_t DynamicLoaderDarwinKernel::ReadKextSummaries(
if (name_data == NULL)
break;
image_infos[i].SetName((const char *)name_data);
- UUID uuid(extractor.GetData(&offset, 16), 16);
+ UUID uuid = UUID::fromOptionalData(extractor.GetData(&offset, 16), 16);
image_infos[i].SetUUID(uuid);
image_infos[i].SetLoadAddress(extractor.GetU64(&offset));
image_infos[i].SetSize(extractor.GetU64(&offset));
@@ -1405,36 +1403,18 @@ bool DynamicLoaderDarwinKernel::ReadAllKextSummaries() {
// Dump an image info structure to the file handle provided.
//----------------------------------------------------------------------
void DynamicLoaderDarwinKernel::KextImageInfo::PutToLog(Log *log) const {
- if (log == NULL)
- return;
- const uint8_t *u = static_cast<const uint8_t *>(m_uuid.GetBytes());
-
if (m_load_address == LLDB_INVALID_ADDRESS) {
- if (u) {
- log->Printf("\tuuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2."
- "2X-%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X name=\"%s\" (UNLOADED)",
- u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7], u[8], u[9],
- u[10], u[11], u[12], u[13], u[14], u[15], m_name.c_str());
- } else
- log->Printf("\tname=\"%s\" (UNLOADED)", m_name.c_str());
+ LLDB_LOG(log, "uuid={0} name=\"{1}\" (UNLOADED)", m_uuid.GetAsString(),
+ m_name);
} else {
- if (u) {
- log->Printf("\taddr=0x%16.16" PRIx64 " size=0x%16.16" PRIx64
- " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-"
- "%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X name=\"%s\"",
- m_load_address, m_size, u[0], u[1], u[2], u[3], u[4], u[5],
- u[6], u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14],
- u[15], m_name.c_str());
- } else {
- log->Printf("\t[0x%16.16" PRIx64 " - 0x%16.16" PRIx64 ") name=\"%s\"",
- m_load_address, m_load_address + m_size, m_name.c_str());
- }
+ LLDB_LOG(log, "addr={0:x+16} size={1:x+16} uuid={2} name=\"{3}\"",
+ m_load_address, m_size, m_uuid.GetAsString(), m_name);
}
}
//----------------------------------------------------------------------
-// Dump the _dyld_all_image_infos members and all current image infos
-// that we have parsed to the file handle provided.
+// 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)
diff --git a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
index ad4f7c631d84..75998f1cc3be 100644
--- a/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
+++ b/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.h
@@ -17,6 +17,9 @@
#include <vector>
// Other libraries and framework includes
+
+#include "lldb/Utility/SafeMachO.h"
+
// Project includes
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/Process.h"
@@ -284,6 +287,9 @@ protected:
static lldb::addr_t
SearchForKernelViaExhaustiveSearch(lldb_private::Process *process);
+ static bool
+ ReadMachHeader(lldb::addr_t addr, lldb_private::Process *process, llvm::MachO::mach_header &mh);
+
static lldb_private::UUID
CheckForKernelImageAtAddress(lldb::addr_t addr,
lldb_private::Process *process);
diff --git a/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp b/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
index d0d60017e869..5ca20229d018 100644
--- a/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
+++ b/source/Plugins/DynamicLoader/Hexagon-DYLD/DynamicLoaderHexagonDYLD.cpp
@@ -127,8 +127,8 @@ void DynamicLoaderHexagonDYLD::DidAttach() {
executable = GetTargetExecutable();
- // Find the difference between the desired load address in the elf file
- // and the real load address in memory
+ // Find the difference between the desired load address in the elf file and
+ // the real load address in memory
load_offset = ComputeLoadOffset();
// Check that there is a valid executable
@@ -157,10 +157,10 @@ void DynamicLoaderHexagonDYLD::DidAttach() {
// Callback for the target to give it the loaded module list
m_process->GetTarget().ModulesDidLoad(module_list);
- // Try to set a breakpoint at the rendezvous breakpoint.
- // DidLaunch uses ProbeEntry() instead. That sets a breakpoint,
- // at the dyld breakpoint address, with a callback so that when hit,
- // the dyld structure can be parsed.
+ // Try to set a breakpoint at the rendezvous breakpoint. DidLaunch uses
+ // ProbeEntry() instead. That sets a breakpoint, at the dyld breakpoint
+ // address, with a callback so that when hit, the dyld structure can be
+ // parsed.
if (!SetRendezvousBreakpoint()) {
// fail
}
@@ -203,8 +203,8 @@ ModuleSP DynamicLoaderHexagonDYLD::GetTargetExecutable() {
// TODO: What case is this code used?
executable = target.GetSharedModule(module_spec);
if (executable.get() != target.GetExecutableModulePointer()) {
- // Don't load dependent images since we are in dyld where we will know
- // and find out about all images that are loaded
+ // Don't load dependent images since we are in dyld where we will know and
+ // find out about all images that are loaded
const bool get_dependent_images = false;
target.SetExecutableModule(executable, get_dependent_images);
}
@@ -270,9 +270,8 @@ bool DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint() {
// This is the original code, which want to look in the rendezvous structure
// to find the breakpoint address. Its backwards for us, since we can easily
- // find the breakpoint address, since it is exported in our executable.
- // We however know that we cant read the Rendezvous structure until we have
- // hit
+ // find the breakpoint address, since it is exported in our executable. We
+ // however know that we cant read the Rendezvous structure until we have hit
// the breakpoint once.
const ConstString dyldBpName("_rtld_debug_state");
addr_t break_addr = findSymbolAddress(m_process, dyldBpName);
@@ -326,8 +325,8 @@ bool DynamicLoaderHexagonDYLD::RendezvousBreakpointHit(
DynamicLoaderHexagonDYLD *dyld_instance = nullptr;
dyld_instance = static_cast<DynamicLoaderHexagonDYLD *>(baton);
- // if the dyld_instance is still not valid then
- // try to locate it on the symbol table
+ // if the dyld_instance is still not valid then try to locate it on the
+ // symbol table
if (!dyld_instance->m_rendezvous.IsValid()) {
Process *proc = dyld_instance->m_process;
@@ -480,8 +479,8 @@ void DynamicLoaderHexagonDYLD::LoadAllCurrentModules() {
return;
}
- // The rendezvous class doesn't enumerate the main module, so track
- // that ourselves here.
+ // The rendezvous class doesn't enumerate the main module, so track that
+ // ourselves here.
ModuleSP executable = GetTargetExecutable();
m_loaded_modules[executable] = m_rendezvous.GetLinkMapAddress();
@@ -517,12 +516,11 @@ addr_t DynamicLoaderHexagonDYLD::ComputeLoadOffset() {
return 0;
}
-// Here we must try to read the entry point directly from
-// the elf header. This is possible if the process is not
-// relocatable or dynamically linked.
+// Here we must try to read the entry point directly from the elf header. This
+// is possible if the process is not relocatable or dynamically linked.
//
-// an alternative is to look at the PC if we can be sure
-// that we have connected when the process is at the entry point.
+// an alternative is to look at the PC if we can be sure that we have connected
+// when the process is at the entry point.
// I dont think that is reliable for us.
addr_t DynamicLoaderHexagonDYLD::GetEntryPoint() {
if (m_entry_point != LLDB_INVALID_ADDRESS)
diff --git a/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp b/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
index c49cdc2f11b1..d5f60e07bd77 100644
--- a/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
+++ b/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.cpp
@@ -115,8 +115,8 @@ bool HexagonDYLDRendezvous::UpdateSOEntries() {
if (m_current.map_addr == 0)
return false;
- // When the previous and current states are consistent this is the first
- // time we have been asked to update. Just take a snapshot of the currently
+ // When the previous and current states are consistent this is the first time
+ // we have been asked to update. Just take a snapshot of the currently
// loaded modules.
if (m_previous.state == eConsistent && m_current.state == eConsistent)
return TakeSnapshot(m_soentries);
@@ -126,8 +126,8 @@ bool HexagonDYLDRendezvous::UpdateSOEntries() {
if (m_current.state == eAdd || m_current.state == eDelete) {
// this is a fudge so that we can clear the assert below.
m_previous.state = eConsistent;
- // We hit this assert on the 2nd run of this function after running the calc
- // example
+ // We hit this assert on the 2nd run of this function after running the
+ // calc example
assert(m_previous.state == eConsistent);
m_soentries.clear();
m_added_soentries.clear();
@@ -159,9 +159,9 @@ bool HexagonDYLDRendezvous::UpdateSOEntriesForAddition() {
if (!ReadSOEntryFromMemory(cursor, entry))
return false;
- // Only add shared libraries and not the executable.
- // On Linux this is indicated by an empty path in the entry.
- // On FreeBSD it is the name of the executable.
+ // Only add shared libraries and not the executable. On Linux this is
+ // indicated by an empty path in the entry. On FreeBSD it is the name of
+ // the executable.
if (entry.path.empty() || ::strcmp(entry.path.c_str(), m_exe_path) == 0)
continue;
@@ -204,9 +204,9 @@ bool HexagonDYLDRendezvous::TakeSnapshot(SOEntryList &entry_list) {
if (!ReadSOEntryFromMemory(cursor, entry))
return false;
- // Only add shared libraries and not the executable.
- // On Linux this is indicated by an empty path in the entry.
- // On FreeBSD it is the name of the executable.
+ // Only add shared libraries and not the executable. On Linux this is
+ // indicated by an empty path in the entry. On FreeBSD it is the name of
+ // the executable.
if (entry.path.empty() || ::strcmp(entry.path.c_str(), m_exe_path) == 0)
continue;
diff --git a/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h b/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h
index b68f89b9ce83..bdf6bae75197 100644
--- a/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h
+++ b/source/Plugins/DynamicLoader/Hexagon-DYLD/HexagonDYLDRendezvous.h
@@ -11,8 +11,10 @@
#define liblldb_HexagonDYLDRendezvous_H_
// C Includes
+#include <limits.h> // for PATH_MAX
// C++ Includes
#include <list>
+#include <map>
#include <string>
// Other libraries and framework includes
@@ -24,12 +26,12 @@ class Process;
}
/// @class HexagonDYLDRendezvous
-/// @brief Interface to the runtime linker.
+/// Interface to the runtime linker.
///
/// A structure is present in a processes memory space which is updated by the
-/// runtime liker each time a module is loaded or unloaded. This class provides
-/// an interface to this structure and maintains a consistent snapshot of the
-/// currently loaded modules.
+/// runtime liker each time a module is loaded or unloaded. This class
+/// provides an interface to this structure and maintains a consistent
+/// snapshot of the currently loaded modules.
class HexagonDYLDRendezvous {
// This structure is used to hold the contents of the debug rendezvous
@@ -124,7 +126,7 @@ public:
void DumpToLog(lldb_private::Log *log) const;
- /// @brief Constants describing the state of the rendezvous.
+ /// Constants describing the state of the rendezvous.
///
/// @see GetState().
enum RendezvousState {
@@ -133,8 +135,8 @@ public:
eDelete,
};
- /// @brief Structure representing the shared objects currently loaded into
- /// the inferior process.
+ /// Structure representing the shared objects currently loaded into the
+ /// inferior process.
///
/// This object is a rough analogue to the struct link_map object which
/// actually lives in the inferiors memory.
@@ -198,7 +200,8 @@ protected:
/// List of SOEntry objects corresponding to the current link map state.
SOEntryList m_soentries;
- /// List of SOEntry's added to the link map since the last call to Resolve().
+ /// List of SOEntry's added to the link map since the last call to
+ /// Resolve().
SOEntryList m_added_soentries;
/// List of SOEntry's removed from the link map since the last call to
diff --git a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
index 703b461f6fe1..c6439a30c8a3 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
@@ -112,8 +112,8 @@ ModuleSP DynamicLoaderDarwin::FindTargetModuleForImageInfo(
if (module_sp && !module_spec.GetUUID().IsValid() &&
!module_sp->GetUUID().IsValid()) {
- // No UUID, we must rely upon the cached module modification
- // time and the modification time of the file on disk
+ // No UUID, we must rely upon the cached module modification time and the
+ // modification time of the file on disk
if (module_sp->GetModificationTime() !=
FileSystem::GetModificationTime(module_sp->GetFileSpec()))
module_sp.reset();
@@ -198,8 +198,7 @@ void DynamicLoaderDarwin::UnloadAllImages() {
ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked(i);
// Don't remove dyld - else we'll lose our breakpoint notifying us about
- // libraries
- // being re-loaded...
+ // libraries being re-loaded...
if (module_sp.get() != nullptr && module_sp.get() != dyld_sp.get()) {
UnloadSections(module_sp);
unloaded_modules_list.Append(module_sp);
@@ -219,8 +218,8 @@ void DynamicLoaderDarwin::UnloadAllImages() {
}
//----------------------------------------------------------------------
-// Update the load addresses for all segments in MODULE using the
-// updated INFO that is passed in.
+// Update the load addresses for all segments in MODULE using the updated INFO
+// that is passed in.
//----------------------------------------------------------------------
bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
ImageInfo &info) {
@@ -231,13 +230,12 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
SectionList *section_list = image_object_file->GetSectionList();
if (section_list) {
std::vector<uint32_t> inaccessible_segment_indexes;
- // We now know the slide amount, so go through all sections
- // and update the load addresses with the correct values.
+ // We now know the slide amount, so go through all sections and update
+ // the load addresses with the correct values.
const size_t num_segments = info.segments.size();
for (size_t i = 0; i < num_segments; ++i) {
- // Only load a segment if it has protections. Things like
- // __PAGEZERO don't have any protections, and they shouldn't
- // be slid
+ // Only load a segment if it has protections. Things like __PAGEZERO
+ // don't have any protections, and they shouldn't be slid
SectionSP section_sp(
section_list->FindSectionByName(info.segments[i].name));
@@ -249,10 +247,10 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
static ConstString g_section_name_LINKEDIT("__LINKEDIT");
if (section_sp) {
- // __LINKEDIT sections from files in the shared cache
- // can overlap so check to see what the segment name is
- // and pass "false" so we don't warn of overlapping
- // "Section" objects, and "true" for all other sections.
+ // __LINKEDIT sections from files in the shared cache can overlap
+ // so check to see what the segment name is and pass "false" so
+ // we don't warn of overlapping "Section" objects, and "true" for
+ // all other sections.
const bool warn_multiple =
section_sp->GetName() != g_section_name_LINKEDIT;
@@ -270,13 +268,12 @@ bool DynamicLoaderDarwin::UpdateImageLoadAddress(Module *module,
}
}
- // If the loaded the file (it changed) and we have segments that
- // are not readable or writeable, add them to the invalid memory
- // region cache for the process. This will typically only be
- // the __PAGEZERO segment in the main executable. We might be able
- // to apply this more generally to more sections that have no
- // protections in the future, but for now we are going to just
- // do __PAGEZERO.
+ // If the loaded the file (it changed) and we have segments that are
+ // not readable or writeable, add them to the invalid memory region
+ // cache for the process. This will typically only be the __PAGEZERO
+ // segment in the main executable. We might be able to apply this more
+ // generally to more sections that have no protections in the future,
+ // but for now we are going to just do __PAGEZERO.
if (changed && !inaccessible_segment_indexes.empty()) {
for (uint32_t i = 0; i < inaccessible_segment_indexes.size(); ++i) {
const uint32_t seg_idx = inaccessible_segment_indexes[i];
@@ -344,8 +341,7 @@ bool DynamicLoaderDarwin::UnloadModuleSections(Module *module,
}
// Given a JSON dictionary (from debugserver, most likely) of binary images
-// loaded in the inferior
-// process, add the images to the ImageInfo collection.
+// loaded in the inferior process, add the images to the ImageInfo collection.
bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
StructuredData::ObjectSP image_details,
@@ -378,7 +374,8 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
image_infos[i].mod_date =
image->GetValueForKey("mod_date")->GetAsInteger()->GetValue();
image_infos[i].file_spec.SetFile(
- image->GetValueForKey("pathname")->GetAsString()->GetValue(), false);
+ image->GetValueForKey("pathname")->GetAsString()->GetValue(), false,
+ FileSpec::Style::native);
StructuredData::Dictionary *mh =
image->GetValueForKey("mach_header")->GetAsDictionary();
@@ -412,8 +409,7 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
}
// Fields that aren't used by DynamicLoaderDarwin so debugserver doesn't
- // currently send them
- // in the reply.
+ // currently send them in the reply.
if (mh->HasKey("flags"))
image_infos[i].header.flags =
@@ -454,8 +450,7 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
seg->GetValueForKey("maxprot")->GetAsInteger()->GetValue();
// Fields that aren't used by DynamicLoaderDarwin so debugserver doesn't
- // currently send them
- // in the reply.
+ // currently send them in the reply.
if (seg->HasKey("initprot"))
segment.initprot =
@@ -481,25 +476,23 @@ bool DynamicLoaderDarwin::JSONImageInformationIntoImageInfo(
image_infos[i].uuid.SetFromStringRef(
image->GetValueForKey("uuid")->GetAsString()->GetValue());
- // All sections listed in the dyld image info structure will all
- // either be fixed up already, or they will all be off by a single
- // slide amount that is determined by finding the first segment
- // that is at file offset zero which also has bytes (a file size
- // that is greater than zero) in the object file.
+ // All sections listed in the dyld image info structure will all either be
+ // fixed up already, or they will all be off by a single slide amount that
+ // is determined by finding the first segment that is at file offset zero
+ // which also has bytes (a file size that is greater than zero) in the
+ // object file.
// Determine the slide amount (if any)
const size_t num_sections = image_infos[i].segments.size();
for (size_t k = 0; k < num_sections; ++k) {
- // Iterate through the object file sections to find the
- // first section that starts of file offset zero and that
- // has bytes in the file...
+ // Iterate through the object file sections to find the first section
+ // that starts of file offset zero and that has bytes in the file...
if ((image_infos[i].segments[k].fileoff == 0 &&
image_infos[i].segments[k].filesize > 0) ||
(image_infos[i].segments[k].name == ConstString("__TEXT"))) {
image_infos[i].slide =
image_infos[i].address - image_infos[i].segments[k].vmaddr;
- // We have found the slide amount, so we can exit
- // this for loop.
+ // We have found the slide amount, so we can exit this for loop.
break;
}
}
@@ -520,16 +513,15 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
const size_t image_infos_size = image_infos.size();
for (size_t i = 0; i < image_infos_size; i++) {
if (image_infos[i].header.filetype == llvm::MachO::MH_DYLINKER) {
- // In a "simulator" process (an x86 process that is ios/tvos/watchos)
- // we will have two dyld modules -- a "dyld" that we want to keep track
- // of,
- // and a "dyld_sim" which we don't need to keep track of here.
- // If the target is an x86 system and the OS of the dyld binary is
+ // In a "simulator" process (an x86 process that is ios/tvos/watchos) we
+ // will have two dyld modules -- a "dyld" that we want to keep track of,
+ // and a "dyld_sim" which we don't need to keep track of here. If the
+ // target is an x86 system and the OS of the dyld binary is
// ios/tvos/watchos, then we are looking at dyld_sym.
- // debugserver has only recently (late 2016) started sending up the
- // os type for each binary it sees -- so if we don't have an os
- // type, use a filename check as our next best guess.
+ // debugserver has only recently (late 2016) started sending up the os
+ // type for each binary it sees -- so if we don't have an os type, use a
+ // filename check as our next best guess.
if (image_infos[i].os_type == llvm::Triple::OSType::UnknownOS) {
if (image_infos[i].file_spec.GetFilename() != g_dyld_sim_filename) {
dyld_idx = i;
@@ -543,7 +535,8 @@ void DynamicLoaderDarwin::UpdateSpecialBinariesFromNewImageInfos(
}
}
else {
- // catch-all for any other environment -- trust that dyld is actually dyld
+ // catch-all for any other environment -- trust that dyld is actually
+ // dyld
dyld_idx = i;
}
} else if (image_infos[i].header.filetype == llvm::MachO::MH_EXECUTE) {
@@ -669,11 +662,10 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
}
}
- // UpdateImageLoadAddress will return true if any segments
- // change load address. We need to check this so we don't
- // mention that all loaded shared libraries are newly loaded
- // each time we hit out dyld breakpoint since dyld will list all
- // shared libraries each time.
+ // UpdateImageLoadAddress will return true if any segments change load
+ // address. We need to check this so we don't mention that all loaded
+ // shared libraries are newly loaded each time we hit out dyld breakpoint
+ // since dyld will list all shared libraries each time.
if (UpdateImageLoadAddress(image_module_sp.get(), image_infos[idx])) {
target_images.AppendIfNeeded(image_module_sp);
loaded_module_list.AppendIfNeeded(image_module_sp);
@@ -692,12 +684,11 @@ bool DynamicLoaderDarwin::AddModulesUsingImageInfos(
//----------------------------------------------------------------------
// On Mac OS X libobjc (the Objective-C runtime) has several critical dispatch
-// functions written in hand-written assembly, and also have hand-written unwind
-// information in the eh_frame section. Normally we prefer analyzing the
-// assembly instructions of a currently executing frame to unwind from that
-// frame --
-// but on hand-written functions this profiling can fail. We should use the
-// eh_frame instructions for these functions all the time.
+// functions written in hand-written assembly, and also have hand-written
+// unwind information in the eh_frame section. Normally we prefer analyzing
+// the assembly instructions of a currently executing frame to unwind from that
+// frame -- but on hand-written functions this profiling can fail. We should
+// use the eh_frame instructions for these functions all the time.
//
// As an aside, it would be better if the eh_frame entries had a flag (or were
// extensible so they could have an Apple-specific flag) which indicates that
@@ -756,35 +747,14 @@ DynamicLoaderDarwin::ImageInfo::FindSegment(const ConstString &name) const {
// Dump an image info structure to the file handle provided.
//----------------------------------------------------------------------
void DynamicLoaderDarwin::ImageInfo::PutToLog(Log *log) const {
- if (log == NULL)
+ if (!log)
return;
- const uint8_t *u = (const uint8_t *)uuid.GetBytes();
-
if (address == LLDB_INVALID_ADDRESS) {
- if (u) {
- log->Printf("\t modtime=0x%8.8" PRIx64
- " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-"
- "%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s' (UNLOADED)",
- mod_date, u[0], u[1], u[2], u[3], u[4], u[5], u[6], u[7],
- u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15],
- file_spec.GetPath().c_str());
- } else
- log->Printf("\t modtime=0x%8.8" PRIx64
- " path='%s' (UNLOADED)",
- mod_date, file_spec.GetPath().c_str());
+ LLDB_LOG(log, "modtime={0:x+8} uuid={1} path='{2}' (UNLOADED)", mod_date,
+ uuid.GetAsString(), file_spec.GetPath());
} else {
- if (u) {
- log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64
- " uuid=%2.2X%2.2X%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-%2.2X%2.2X-"
- "%2.2X%2.2X%2.2X%2.2X%2.2X%2.2X path='%s'",
- address, mod_date, u[0], u[1], u[2], u[3], u[4], u[5], u[6],
- u[7], u[8], u[9], u[10], u[11], u[12], u[13], u[14], u[15],
- file_spec.GetPath().c_str());
- } else {
- log->Printf("\taddress=0x%16.16" PRIx64 " modtime=0x%8.8" PRIx64
- " path='%s'",
- address, mod_date, file_spec.GetPath().c_str());
- }
+ LLDB_LOG(log, "address={0:x+16} modtime={1:x+8} uuid={2} path='{3}'",
+ address, mod_date, uuid.GetAsString(), file_spec.GetPath());
for (uint32_t i = 0; i < segments.size(); ++i)
segments[i].PutToLog(log, slide);
}
@@ -817,8 +787,8 @@ void DynamicLoaderDarwin::PrivateProcessStateChanged(Process *process,
break;
case eStateStopped:
- // Keep trying find dyld and set our notification breakpoint each time
- // we stop until we succeed
+ // Keep trying find dyld and set our notification breakpoint each time we
+ // stop until we succeed
if (!DidSetNotificationBreakpoint() && m_process->IsAlive()) {
if (NeedToDoInitialImageFetch())
DoInitialImageFetch();
@@ -956,8 +926,8 @@ DynamicLoaderDarwin::GetStepThroughTrampolinePlan(Thread &thread,
}
if (addresses.size() > 0) {
- // First check whether any of the addresses point to Indirect symbols, and
- // if they do, resolve them:
+ // First check whether any of the addresses point to Indirect symbols,
+ // and if they do, resolve them:
std::vector<lldb::addr_t> load_addrs;
for (Address address : addresses) {
Symbol *symbol = address.CalculateSymbolContextSymbol();
@@ -1073,10 +1043,10 @@ DynamicLoaderDarwin::GetThreadLocalData(const lldb::ModuleSP module_sp,
const lldb::addr_t pthread_key = data.GetAddress(&offset);
const lldb::addr_t tls_offset = data.GetAddress(&offset);
if (pthread_key != 0) {
- // First check to see if we have already figured out the location
- // of TLS data for the pthread_key on a specific thread yet. If we
- // have we can re-use it since its location will not change unless
- // the process execs.
+ // First check to see if we have already figured out the location of
+ // TLS data for the pthread_key on a specific thread yet. If we have we
+ // can re-use it since its location will not change unless the process
+ // execs.
const tid_t tid = thread_sp->GetID();
auto tid_pos = m_tid_to_tls_map.find(tid);
if (tid_pos != m_tid_to_tls_map.end()) {
@@ -1131,34 +1101,29 @@ DynamicLoaderDarwin::GetThreadLocalData(const lldb::ModuleSP module_sp,
bool DynamicLoaderDarwin::UseDYLDSPI(Process *process) {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
- uint32_t major, minor, update;
-
bool use_new_spi_interface = false;
- if (process->GetHostOSVersion(major, minor, update)) {
+ llvm::VersionTuple version = process->GetHostOSVersion();
+ if (!version.empty()) {
const llvm::Triple::OSType os_type =
process->GetTarget().GetArchitecture().GetTriple().getOS();
// macOS 10.12 and newer
if (os_type == llvm::Triple::MacOSX &&
- (major > 10 || (major == 10 && minor >= 12))) {
+ version >= llvm::VersionTuple(10, 12))
use_new_spi_interface = true;
- }
// iOS 10 and newer
- if (os_type == llvm::Triple::IOS && major >= 10) {
+ if (os_type == llvm::Triple::IOS && version >= llvm::VersionTuple(10))
use_new_spi_interface = true;
- }
// tvOS 10 and newer
- if (os_type == llvm::Triple::TvOS && major >= 10) {
+ if (os_type == llvm::Triple::TvOS && version >= llvm::VersionTuple(10))
use_new_spi_interface = true;
- }
// watchOS 3 and newer
- if (os_type == llvm::Triple::WatchOS && major >= 3) {
+ if (os_type == llvm::Triple::WatchOS && version >= llvm::VersionTuple(3))
use_new_spi_interface = true;
- }
}
if (log) {
diff --git a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
index 66085a23759b..4a8ad38d1785 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.cpp
@@ -29,9 +29,9 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Create an instance of this class. This function is filled into
-// the plugin info class that gets handed out by the plugin factory and
-// allows the lldb to instantiate an instance of this class.
+// Create an instance of this class. This function is filled into the plugin
+// info class that gets handed out by the plugin factory and allows the lldb to
+// instantiate an instance of this class.
//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderMacOS::CreateInstance(Process *process,
bool force) {
@@ -144,17 +144,18 @@ void DynamicLoaderMacOS::ClearNotificationBreakpoint() {
}
//----------------------------------------------------------------------
-// Try and figure out where dyld is by first asking the Process
-// if it knows (which currently calls down in the lldb::Process
-// to get the DYLD info (available on SnowLeopard only). If that fails,
-// then check in the default addresses.
+// Try and figure out where dyld is by first asking the Process if it knows
+// (which currently calls down in the lldb::Process to get the DYLD info
+// (available on SnowLeopard only). If that fails, then check in the default
+// addresses.
//----------------------------------------------------------------------
void DynamicLoaderMacOS::DoInitialImageFetch() {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
- // Remove any binaries we pre-loaded in the Target before launching/attaching.
- // If the same binaries are present in the process, we'll get them from the
- // shared module cache, we won't need to re-load them from disk.
+ // Remove any binaries we pre-loaded in the Target before
+ // launching/attaching. If the same binaries are present in the process,
+ // we'll get them from the shared module cache, we won't need to re-load them
+ // from disk.
UnloadAllImages();
StructuredData::ObjectSP all_image_info_json_sp(
@@ -184,9 +185,9 @@ bool DynamicLoaderMacOS::NeedToDoInitialImageFetch() { return true; }
//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
-// breakpoint gets hit. We update all of our image infos and then
-// let our super class DynamicLoader class decide if we should stop
-// or not (based on global preference).
+// breakpoint gets hit. We update all of our image infos and then let our super
+// class DynamicLoader class decide if we should stop or not (based on global
+// preference).
//----------------------------------------------------------------------
bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton,
StoppointCallbackContext *context,
@@ -194,11 +195,10 @@ bool DynamicLoaderMacOS::NotifyBreakpointHit(void *baton,
lldb::user_id_t break_loc_id) {
// Let the event know that the images have changed
// DYLD passes three arguments to the notification breakpoint.
- // Arg1: enum dyld_notify_mode mode - 0 = adding, 1 = removing, 2 = remove all
- // Arg2: unsigned long icount - Number of shared libraries
- // added/removed
- // Arg3: uint64_t mach_headers[] - Array of load addresses of binaries
- // added/removed
+ // Arg1: enum dyld_notify_mode mode - 0 = adding, 1 = removing, 2 = remove
+ // all Arg2: unsigned long icount - Number of shared libraries
+ // added/removed Arg3: uint64_t mach_headers[] - Array of load addresses
+ // of binaries added/removed
DynamicLoaderMacOS *dyld_instance = (DynamicLoaderMacOS *)baton;
@@ -328,8 +328,8 @@ void DynamicLoaderMacOS::AddBinaries(
}
}
-// Dump the _dyld_all_image_infos members and all current image infos
-// that we have parsed to the file handle provided.
+// 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)
@@ -432,9 +432,9 @@ Status DynamicLoaderMacOS::CanLoadImage() {
}
}
- // Default assumption is that it is OK to load images.
- // Only say that we cannot load images if we find the symbol in libdyld and it
- // indicates that we cannot.
+ // Default assumption is that it is OK to load images. Only say that we
+ // cannot load images if we find the symbol in libdyld and it indicates that
+ // we cannot.
if (symbol_address != LLDB_INVALID_ADDRESS) {
{
@@ -445,11 +445,11 @@ Status DynamicLoaderMacOS::CanLoadImage() {
}
}
} else {
- // If we were unable to find _dyld_global_lock_held in any modules, or it is
- // not loaded into memory yet, we may be at process startup (sitting
- // at _dyld_start) - so we should not allow dlopen calls.
- // But if we found more than one module then we are clearly past _dyld_start
- // so in that case we'll default to "it's safe".
+ // If we were unable to find _dyld_global_lock_held in any modules, or it
+ // is not loaded into memory yet, we may be at process startup (sitting at
+ // _dyld_start) - so we should not allow dlopen calls. But if we found more
+ // than one module then we are clearly past _dyld_start so in that case
+ // we'll default to "it's safe".
if (num_modules <= 1)
error.SetErrorString("could not find the dyld library or "
"the dyld lock symbol");
@@ -472,7 +472,9 @@ bool DynamicLoaderMacOS::GetSharedCacheInformation(
info_dict = info->GetAsDictionary();
}
- // {"shared_cache_base_address":140735683125248,"shared_cache_uuid":"DDB8D70C-C9A2-3561-B2C8-BE48A4F33F96","no_shared_cache":false,"shared_cache_private_cache":false}
+ // {"shared_cache_base_address":140735683125248,"shared_cache_uuid
+ // ":"DDB8D70C-
+ // C9A2-3561-B2C8-BE48A4F33F96","no_shared_cache":false,"shared_cache_private_cache":false}
if (info_dict && info_dict->HasKey("shared_cache_uuid") &&
info_dict->HasKey("no_shared_cache") &&
@@ -482,7 +484,7 @@ bool DynamicLoaderMacOS::GetSharedCacheInformation(
std::string uuid_str =
info_dict->GetValueForKey("shared_cache_uuid")->GetStringValue();
if (!uuid_str.empty())
- uuid.SetFromCString(uuid_str.c_str());
+ uuid.SetFromStringRef(uuid_str);
if (info_dict->GetValueForKey("no_shared_cache")->GetBooleanValue() ==
false)
using_shared_cache = eLazyBoolYes;
diff --git a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
index e0def58f41c1..265f19d0ca06 100644
--- a/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
+++ b/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
@@ -49,9 +49,9 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Create an instance of this class. This function is filled into
-// the plugin info class that gets handed out by the plugin factory and
-// allows the lldb to instantiate an instance of this class.
+// Create an instance of this class. This function is filled into the plugin
+// info class that gets handed out by the plugin factory and allows the lldb to
+// instantiate an instance of this class.
//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderMacOSXDYLD::CreateInstance(Process *process,
bool force) {
@@ -123,17 +123,18 @@ bool DynamicLoaderMacOSXDYLD::ProcessDidExec() {
const addr_t shlib_addr = m_process->GetImageInfoAddress();
if (m_process_image_addr_is_all_images_infos == true &&
shlib_addr != m_dyld_all_image_infos_addr) {
- // The image info address from the process is the 'dyld_all_image_infos'
- // address and it has changed.
+ // The image info address from the process is the
+ // 'dyld_all_image_infos' address and it has changed.
did_exec = true;
} else if (m_process_image_addr_is_all_images_infos == false &&
shlib_addr == m_dyld.address) {
- // The image info address from the process is the mach_header
- // address for dyld and it has changed.
+ // The image info address from the process is the mach_header address
+ // for dyld and it has changed.
did_exec = true;
} else {
// ASLR might be disabled and dyld could have ended up in the same
- // location. We should try and detect if we are stopped at '_dyld_start'
+ // location. We should try and detect if we are stopped at
+ // '_dyld_start'
ThreadSP thread_sp(m_process->GetThreadList().GetThreadAtIndex(0));
if (thread_sp) {
lldb::StackFrameSP frame_sp(thread_sp->GetStackFrameAtIndex(0));
@@ -185,16 +186,15 @@ void DynamicLoaderMacOSXDYLD::ClearNotificationBreakpoint() {
}
//----------------------------------------------------------------------
-// Try and figure out where dyld is by first asking the Process
-// if it knows (which currently calls down in the lldb::Process
-// to get the DYLD info (available on SnowLeopard only). If that fails,
-// then check in the default addresses.
+// Try and figure out where dyld is by first asking the Process if it knows
+// (which currently calls down in the lldb::Process to get the DYLD info
+// (available on SnowLeopard only). If that fails, then check in the default
+// addresses.
//----------------------------------------------------------------------
void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() {
if (m_dyld_all_image_infos_addr == LLDB_INVALID_ADDRESS) {
- // Check the image info addr as it might point to the
- // mach header for dyld, or it might point to the
- // dyld_all_image_infos struct
+ // Check the image info addr as it might point to the mach header for dyld,
+ // or it might point to the dyld_all_image_infos struct
const addr_t shlib_addr = m_process->GetImageInfoAddress();
if (shlib_addr != LLDB_INVALID_ADDRESS) {
ByteOrder byte_order =
@@ -255,8 +255,7 @@ void DynamicLoaderMacOSXDYLD::DoInitialImageFetch() {
}
//----------------------------------------------------------------------
-// Assume that dyld is in memory at ADDR and try to parse it's load
-// commands
+// Assume that dyld is in memory at ADDR and try to parse it's load commands
//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback(
lldb::addr_t addr) {
@@ -287,10 +286,10 @@ bool DynamicLoaderMacOSXDYLD::ReadDYLDInfoFromMemoryAndSetNotificationCallback(
// Update all image infos
InitializeFromAllImageInfos();
- // If we didn't have an executable before, but now we do, then the
- // dyld module shared pointer might be unique and we may need to add
- // it again (since Target::SetExecutableModule() will clear the
- // images). So append the dyld module back to the list if it is
+ // If we didn't have an executable before, but now we do, then the dyld
+ // module shared pointer might be unique and we may need to add it again
+ // (since Target::SetExecutableModule() will clear the images). So append
+ // the dyld module back to the list if it is
/// unique!
if (dyld_module_sp) {
target.GetImages().AppendIfNeeded(dyld_module_sp);
@@ -315,18 +314,18 @@ bool DynamicLoaderMacOSXDYLD::NeedToDoInitialImageFetch() {
//----------------------------------------------------------------------
// Static callback function that gets called when our DYLD notification
-// breakpoint gets hit. We update all of our image infos and then
-// let our super class DynamicLoader class decide if we should stop
-// or not (based on global preference).
+// breakpoint gets hit. We update all of our image infos and then let our super
+// class DynamicLoader class decide if we should stop or not (based on global
+// preference).
//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(
void *baton, StoppointCallbackContext *context, lldb::user_id_t break_id,
lldb::user_id_t break_loc_id) {
// Let the event know that the images have changed
// DYLD passes three arguments to the notification breakpoint.
- // Arg1: enum dyld_image_mode mode - 0 = adding, 1 = removing
- // Arg2: uint32_t infoCount - Number of shared libraries added
- // Arg3: dyld_image_info info[] - Array of structs of the form:
+ // Arg1: enum dyld_image_mode mode - 0 = adding, 1 = removing Arg2: uint32_t
+ // infoCount - Number of shared libraries added Arg3: dyld_image_info
+ // info[] - Array of structs of the form:
// const struct mach_header
// *imageLoadAddress
// const char *imageFilePath
@@ -335,11 +334,10 @@ bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(
DynamicLoaderMacOSXDYLD *dyld_instance = (DynamicLoaderMacOSXDYLD *)baton;
// First step is to see if we've already initialized the all image infos. If
- // we haven't then this function
- // will do so and return true. In the course of initializing the
- // all_image_infos it will read the complete
- // current state, so we don't need to figure out what has changed from the
- // data passed in to us.
+ // we haven't then this function will do so and return true. In the course
+ // of initializing the all_image_infos it will read the complete current
+ // state, so we don't need to figure out what has changed from the data
+ // passed in to us.
ExecutionContext exe_ctx(context->exe_ctx_ref);
Process *process = exe_ctx.GetProcessPtr();
@@ -388,11 +386,9 @@ bool DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(
argument_values.GetValueAtIndex(1)->GetScalar().UInt(-1);
if (image_infos_count != static_cast<uint32_t>(-1)) {
// Got the number added, now go through the array of added elements,
- // putting out the mach header
- // address, and adding the image.
- // Note, I'm not putting in logging here, since the AddModules &
- // RemoveModules functions do
- // all the logging internally.
+ // putting out the mach header address, and adding the image. Note,
+ // I'm not putting in logging here, since the AddModules &
+ // RemoveModules functions do all the logging internally.
lldb::addr_t image_infos_addr =
argument_values.GetValueAtIndex(2)->GetScalar().ULongLong();
@@ -467,12 +463,12 @@ bool DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure() {
if (m_process->ReadMemory(m_dyld_all_image_infos_addr, buf, 4, error) ==
4) {
m_dyld_all_image_infos.version = data.GetU32(&offset);
- // If anything in the high byte is set, we probably got the byte
- // order incorrect (the process might not have it set correctly
- // yet due to attaching to a program without a specified file).
+ // If anything in the high byte is set, we probably got the byte order
+ // incorrect (the process might not have it set correctly yet due to
+ // attaching to a program without a specified file).
if (m_dyld_all_image_infos.version & 0xff000000) {
- // We have guessed the wrong byte order. Swap it and try
- // reading the version again.
+ // We have guessed the wrong byte order. Swap it and try reading the
+ // version again.
if (byte_order == eByteOrderLittle)
byte_order = eByteOrderBig;
else
@@ -508,21 +504,17 @@ bool DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure() {
uint64_t dyld_all_image_infos_addr = data.GetPointer(&offset);
// When we started, we were given the actual address of the
- // all_image_infos
- // struct (probably via TASK_DYLD_INFO) in memory - this address is
- // stored in
- // m_dyld_all_image_infos_addr and is the most accurate address we have.
+ // all_image_infos struct (probably via TASK_DYLD_INFO) in memory -
+ // this address is stored in m_dyld_all_image_infos_addr and is the
+ // most accurate address we have.
// We read the dyld_all_image_infos struct from memory; it contains its
- // own address.
- // If the address in the struct does not match the actual address,
- // the dyld we're looking at has been loaded at a different location
- // (slid) from
- // where it intended to load. The addresses in the dyld_all_image_infos
- // struct
- // are the original, non-slid addresses, and need to be adjusted. Most
- // importantly
- // the address of dyld and the notification address need to be adjusted.
+ // own address. If the address in the struct does not match the actual
+ // address, the dyld we're looking at has been loaded at a different
+ // location (slid) from where it intended to load. The addresses in
+ // the dyld_all_image_infos struct are the original, non-slid
+ // addresses, and need to be adjusted. Most importantly the address of
+ // dyld and the notification address need to be adjusted.
if (dyld_all_image_infos_addr != m_dyld_all_image_infos_addr) {
uint64_t image_infos_offset =
@@ -615,14 +607,13 @@ bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(
image_infos[idx].PutToLog(log);
}
- // Remove this image_infos from the m_all_image_infos. We do the comparison
- // by address
- // rather than by file spec because we can have many modules with the same
- // "file spec" in the
- // case that they are modules loaded from memory.
+ // Remove this image_infos from the m_all_image_infos. We do the
+ // comparison by address rather than by file spec because we can have many
+ // modules with the same "file spec" in the case that they are modules
+ // loaded from memory.
//
- // Also copy over the uuid from the old entry to the removed entry so we can
- // use it to lookup the module in the module list.
+ // Also copy over the uuid from the old entry to the removed entry so we
+ // can use it to lookup the module in the module list.
ImageInfo::collection::iterator pos, end = m_dyld_image_infos.end();
for (pos = m_dyld_image_infos.begin(); pos != end; pos++) {
@@ -630,8 +621,7 @@ bool DynamicLoaderMacOSXDYLD::RemoveModulesUsingImageInfosAddress(
image_infos[idx].uuid = (*pos).uuid;
// Add the module from this image_info to the "unloaded_module_list".
- // We'll remove them all at
- // one go later on.
+ // We'll remove them all at one go later on.
ModuleSP unload_image_module_sp(
FindTargetModuleForImageInfo(image_infos[idx], false, NULL));
@@ -703,7 +693,8 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos(
// don't resolve the path
if (error.Success()) {
const bool resolve_path = false;
- image_infos[i].file_spec.SetFile(raw_path, resolve_path);
+ image_infos[i].file_spec.SetFile(raw_path, resolve_path,
+ FileSpec::Style::native);
}
}
return true;
@@ -713,11 +704,10 @@ bool DynamicLoaderMacOSXDYLD::ReadImageInfos(
}
//----------------------------------------------------------------------
-// If we have found where the "_dyld_all_image_infos" lives in memory,
-// read the current info from it, and then update all image load
-// addresses (or lack thereof). Only do this if this is the first time
-// we're reading the dyld infos. Return true if we actually read anything,
-// and false otherwise.
+// If we have found where the "_dyld_all_image_infos" lives in memory, read the
+// current info from it, and then update all image load addresses (or lack
+// thereof). Only do this if this is the first time we're reading the dyld
+// infos. Return true if we actually read anything, and false otherwise.
//----------------------------------------------------------------------
bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
@@ -748,14 +738,11 @@ bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
}
// Now we have one more bit of business. If there is a library left in the
- // images for our target that
- // doesn't have a load address, then it must be something that we were
- // expecting to load (for instance we
- // read a load command for it) but it didn't in fact load - probably because
- // DYLD_*_PATH pointed
- // to an equivalent version. We don't want it to stay in the target's
- // module list or it will confuse
- // us, so unload it here.
+ // images for our target that doesn't have a load address, then it must be
+ // something that we were expecting to load (for instance we read a load
+ // command for it) but it didn't in fact load - probably because
+ // DYLD_*_PATH pointed to an equivalent version. We don't want it to stay
+ // in the target's module list or it will confuse us, so unload it here.
Target &target = m_process->GetTarget();
const ModuleList &target_modules = target.GetImages();
ModuleList not_loaded_modules;
@@ -784,8 +771,8 @@ bool DynamicLoaderMacOSXDYLD::InitializeFromAllImageInfos() {
}
//----------------------------------------------------------------------
-// Read a mach_header at ADDR into HEADER, and also fill in the load
-// command data into LOAD_COMMAND_DATA if it is non-NULL.
+// Read a mach_header at ADDR into HEADER, and also fill in the load command
+// data into LOAD_COMMAND_DATA if it is non-NULL.
//
// Returns true if we succeed, false if we fail for any reason.
//----------------------------------------------------------------------
@@ -840,8 +827,8 @@ bool DynamicLoaderMacOSXDYLD::ReadMachHeader(lldb::addr_t addr,
load_cmd_data_sp->GetByteSize(), error);
if (load_cmd_bytes_read == header->sizeofcmds) {
- // Set the load command data and also set the correct endian
- // swap settings and the correct address size
+ // Set the load command data and also set the correct endian swap
+ // settings and the correct address size
load_command_data->SetData(load_cmd_data_sp, 0, header->sizeofcmds);
load_command_data->SetByteOrder(data.GetByteOrder());
load_command_data->SetAddressByteSize(data.GetAddressByteSize());
@@ -867,8 +854,8 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
dylib_info.Clear(true);
for (cmd_idx = 0; cmd_idx < dylib_info.header.ncmds; cmd_idx++) {
- // Clear out any load command specific data from DYLIB_INFO since
- // we are about to read it.
+ // Clear out any load command specific data from DYLIB_INFO since we are
+ // about to read it.
if (data.ValidOffsetForDataOfSize(offset,
sizeof(llvm::MachO::load_command))) {
@@ -880,8 +867,8 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
case llvm::MachO::LC_SEGMENT: {
segment.name.SetTrimmedCStringWithLength(
(const char *)data.GetData(&offset, 16), 16);
- // We are putting 4 uint32_t values 4 uint64_t values so
- // we have to use multiple 32 bit gets below.
+ // We are putting 4 uint32_t values 4 uint64_t values so we have to use
+ // multiple 32 bit gets below.
segment.vmaddr = data.GetU32(&offset);
segment.vmsize = data.GetU32(&offset);
segment.fileoff = data.GetU32(&offset);
@@ -906,12 +893,12 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
const lldb::offset_t name_offset =
load_cmd_offset + data.GetU32(&offset);
const char *path = data.PeekCStr(name_offset);
- lc_id_dylinker->SetFile(path, true);
+ lc_id_dylinker->SetFile(path, true, FileSpec::Style::native);
}
break;
case llvm::MachO::LC_UUID:
- dylib_info.uuid.SetBytes(data.GetData(&offset, 16));
+ dylib_info.uuid = UUID::fromOptionalData(data.GetData(&offset, 16), 16);
break;
default:
@@ -922,24 +909,21 @@ uint32_t DynamicLoaderMacOSXDYLD::ParseLoadCommands(const DataExtractor &data,
}
}
- // All sections listed in the dyld image info structure will all
- // either be fixed up already, or they will all be off by a single
- // slide amount that is determined by finding the first segment
- // that is at file offset zero which also has bytes (a file size
- // that is greater than zero) in the object file.
+ // All sections listed in the dyld image info structure will all either be
+ // fixed up already, or they will all be off by a single slide amount that is
+ // determined by finding the first segment that is at file offset zero which
+ // also has bytes (a file size that is greater than zero) in the object file.
// Determine the slide amount (if any)
const size_t num_sections = dylib_info.segments.size();
for (size_t i = 0; i < num_sections; ++i) {
- // Iterate through the object file sections to find the
- // first section that starts of file offset zero and that
- // has bytes in the file...
+ // Iterate through the object file sections to find the first section that
+ // starts of file offset zero and that has bytes in the file...
if ((dylib_info.segments[i].fileoff == 0 &&
dylib_info.segments[i].filesize > 0) ||
(dylib_info.segments[i].name == ConstString("__TEXT"))) {
dylib_info.slide = dylib_info.address - dylib_info.segments[i].vmaddr;
- // We have found the slide amount, so we can exit
- // this for loop.
+ // We have found the slide amount, so we can exit this for loop.
break;
}
}
@@ -984,11 +968,11 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
// Don't load dependent images since we are in dyld where we will know
// and find out about all images that are loaded. Also when setting the
// executable module, it will clear the targets module list, and if we
- // have an in memory dyld module, it will get removed from the list
- // so we will need to add it back after setting the executable module,
- // so we first try and see if we already have a weak pointer to the
- // dyld module, make it into a shared pointer, then add the executable,
- // then re-add it back to make sure it is always in the list.
+ // have an in memory dyld module, it will get removed from the list so
+ // we will need to add it back after setting the executable module, so
+ // we first try and see if we already have a weak pointer to the dyld
+ // module, make it into a shared pointer, then add the executable, then
+ // re-add it back to make sure it is always in the list.
ModuleSP dyld_module_sp(GetDYLDModule());
const bool get_dependent_images = false;
@@ -1009,8 +993,8 @@ void DynamicLoaderMacOSXDYLD::UpdateImageInfosHeaderAndLoadCommands(
}
//----------------------------------------------------------------------
-// Dump the _dyld_all_image_infos members and all current image infos
-// that we have parsed to the file handle provided.
+// 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)
@@ -1039,10 +1023,9 @@ bool DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint() {
if (m_break_id == LLDB_INVALID_BREAK_ID) {
if (m_dyld_all_image_infos.notification != LLDB_INVALID_ADDRESS) {
Address so_addr;
- // Set the notification breakpoint and install a breakpoint
- // callback function that will get called each time the
- // breakpoint gets hit. We will use this to track when shared
- // libraries get loaded/unloaded.
+ // Set the notification breakpoint and install a breakpoint callback
+ // function that will get called each time the breakpoint gets hit. We
+ // will use this to track when shared libraries get loaded/unloaded.
bool resolved = m_process->GetTarget().ResolveLoadAddress(
m_dyld_all_image_infos.notification, so_addr);
if (!resolved) {
@@ -1071,9 +1054,9 @@ bool DynamicLoaderMacOSXDYLD::SetNotificationBreakpoint() {
Status DynamicLoaderMacOSXDYLD::CanLoadImage() {
Status error;
- // In order for us to tell if we can load a shared library we verify that
- // the dylib_info_addr isn't zero (which means no shared libraries have
- // been set yet, or dyld is currently mucking with the shared library list).
+ // In order for us to tell if we can load a shared library we verify that the
+ // dylib_info_addr isn't zero (which means no shared libraries have been set
+ // yet, or dyld is currently mucking with the shared library list).
if (ReadAllImageInfosStructure()) {
// TODO: also check the _dyld_global_lock_held variable in
// libSystem.B.dylib?
@@ -1099,13 +1082,10 @@ bool DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(
addr_t all_image_infos = m_process->GetImageInfoAddress();
// The address returned by GetImageInfoAddress may be the address of dyld
- // (don't want)
- // or it may be the address of the dyld_all_image_infos structure (want).
- // The first four
- // bytes will be either the version field (all_image_infos) or a Mach-O file
- // magic constant.
- // Version 13 and higher of dyld_all_image_infos is required to get the
- // sharedCacheUUID field.
+ // (don't want) or it may be the address of the dyld_all_image_infos
+ // structure (want). The first four bytes will be either the version field
+ // (all_image_infos) or a Mach-O file magic constant. Version 13 and higher
+ // of dyld_all_image_infos is required to get the sharedCacheUUID field.
Status err;
uint32_t version_or_magic =
@@ -1130,7 +1110,7 @@ bool DynamicLoaderMacOSXDYLD::GetSharedCacheInformation(
uuid_t shared_cache_uuid;
if (m_process->ReadMemory(sharedCacheUUID_address, shared_cache_uuid,
sizeof(uuid_t), err) == sizeof(uuid_t)) {
- uuid.SetBytes(shared_cache_uuid);
+ uuid = UUID::fromOptionalData(shared_cache_uuid, 16);
if (uuid.IsValid()) {
using_shared_cache = eLazyBoolYes;
}
diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h b/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h
index cf9da0808357..3b06fe18f0c6 100644
--- a/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h
+++ b/source/Plugins/DynamicLoader/POSIX-DYLD/AuxVector.h
@@ -22,12 +22,12 @@ class DataExtractor;
}
/// @class AuxVector
-/// @brief Represents a processes auxiliary vector.
+/// Represents a processes auxiliary vector.
///
/// When a process is loaded on Linux a vector of values is placed onto the
-/// stack communicating operating system specific information. On construction
-/// this class locates and parses this information and provides a simple
-/// read-only interface to the entries found.
+/// stack communicating operating system specific information. On
+/// construction this class locates and parses this information and provides a
+/// simple read-only interface to the entries found.
class AuxVector {
public:
@@ -41,8 +41,9 @@ public:
};
/// Constants describing the type of entry.
- /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX information.
- /// Added AUXV prefix to avoid potential conflicts with system-defined macros
+ /// On Linux, running "LD_SHOW_AUXV=1 ./executable" will spew AUX
+ /// information. Added AUXV prefix to avoid potential conflicts with system-
+ /// defined macros
enum EntryType {
AUXV_AT_NULL = 0, ///< End of auxv.
AUXV_AT_IGNORE = 1, ///< Ignore entry.
diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp b/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
index e601d64f0d8d..b1513b51a90a 100644
--- a/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
+++ b/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.cpp
@@ -45,8 +45,8 @@ static addr_t ResolveRendezvousAddress(Process *process) {
if (log)
log->Printf("%s info_location = 0x%" PRIx64, __FUNCTION__, info_location);
- // If the process fails to return an address, fall back to seeing if the local
- // object file can help us find it.
+ // If the process fails to return an address, fall back to seeing if the
+ // local object file can help us find it.
if (info_location == LLDB_INVALID_ADDRESS) {
Target *target = &process->GetTarget();
if (target) {
@@ -190,8 +190,8 @@ bool DYLDRendezvous::UpdateSOEntries(bool fromRemote) {
if (!fromRemote && m_current.map_addr == 0)
return false;
- // When the previous and current states are consistent this is the first
- // time we have been asked to update. Just take a snapshot of the currently
+ // When the previous and current states are consistent this is the first time
+ // we have been asked to update. Just take a snapshot of the currently
// loaded modules.
if (m_previous.state == eConsistent && m_current.state == eConsistent)
return fromRemote ? SaveSOEntriesFromRemote(module_list)
@@ -200,9 +200,9 @@ bool DYLDRendezvous::UpdateSOEntries(bool fromRemote) {
// If we are about to add or remove a shared object clear out the current
// state and take a snapshot of the currently loaded images.
if (m_current.state == eAdd || m_current.state == eDelete) {
- // Some versions of the android dynamic linker might send two
- // notifications with state == eAdd back to back. Ignore them
- // until we get an eConsistent notification.
+ // Some versions of the android dynamic linker might send two notifications
+ // with state == eAdd back to back. Ignore them until we get an eConsistent
+ // notification.
if (!(m_previous.state == eConsistent ||
(m_previous.state == eAdd && m_current.state == eDelete)))
return false;
@@ -243,7 +243,7 @@ bool DYLDRendezvous::FillSOEntryFromModuleInfo(
entry.base_addr = base_addr;
entry.dyn_addr = dyn_addr;
- entry.file_spec.SetFile(name, false);
+ entry.file_spec.SetFile(name, false, FileSpec::Style::native);
UpdateBaseAddrIfNecessary(entry, name);
@@ -449,16 +449,13 @@ std::string DYLDRendezvous::ReadStringFromMemory(addr_t addr) {
}
// Returns true if the load bias reported by the linker is incorrect for the
-// given entry. This
-// function is used to handle cases where we want to work around a bug in the
-// system linker.
+// given entry. This function is used to handle cases where we want to work
+// around a bug in the system linker.
static bool isLoadBiasIncorrect(Target &target, const std::string &file_path) {
// On Android L (API 21, 22) the load address of the "/system/bin/linker"
- // isn't filled in
- // correctly.
- uint32_t os_major = 0, os_minor = 0, os_update = 0;
+ // isn't filled in correctly.
+ unsigned os_major = target.GetPlatform()->GetOSVersion().getMajor();
if (target.GetArchitecture().GetTriple().isAndroid() &&
- target.GetPlatform()->GetOSVersion(os_major, os_minor, os_update) &&
(os_major == 21 || os_major == 22) &&
(file_path == "/system/bin/linker" ||
file_path == "/system/bin/linker64")) {
@@ -471,8 +468,7 @@ static bool isLoadBiasIncorrect(Target &target, const std::string &file_path) {
void DYLDRendezvous::UpdateBaseAddrIfNecessary(SOEntry &entry,
std::string const &file_path) {
// If the load bias reported by the linker is incorrect then fetch the load
- // address of the file
- // from the proc file system.
+ // address of the file from the proc file system.
if (isLoadBiasIncorrect(m_process->GetTarget(), file_path)) {
lldb::addr_t load_addr = LLDB_INVALID_ADDRESS;
bool is_loaded = false;
@@ -491,8 +487,8 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry) {
if (!(addr = ReadPointer(addr, &entry.base_addr)))
return false;
- // mips adds an extra load offset field to the link map struct on
- // FreeBSD and NetBSD (need to validate other OSes).
+ // mips adds an extra load offset field to the link map struct on FreeBSD and
+ // NetBSD (need to validate other OSes).
// http://svnweb.freebsd.org/base/head/sys/sys/link_elf.h?revision=217153&view=markup#l57
const ArchSpec &arch = m_process->GetTarget().GetArchitecture();
if ((arch.GetTriple().getOS() == llvm::Triple::FreeBSD ||
@@ -521,7 +517,7 @@ bool DYLDRendezvous::ReadSOEntryFromMemory(lldb::addr_t addr, SOEntry &entry) {
return false;
std::string file_path = ReadStringFromMemory(entry.path_addr);
- entry.file_spec.SetFile(file_path, false);
+ entry.file_spec.SetFile(file_path, false, FileSpec::Style::native);
UpdateBaseAddrIfNecessary(entry, file_path);
diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h b/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
index 295ae55e1b85..a7071801f569 100644
--- a/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
+++ b/source/Plugins/DynamicLoader/POSIX-DYLD/DYLDRendezvous.h
@@ -29,12 +29,12 @@ class Process;
}
/// @class DYLDRendezvous
-/// @brief Interface to the runtime linker.
+/// Interface to the runtime linker.
///
/// A structure is present in a processes memory space which is updated by the
-/// runtime liker each time a module is loaded or unloaded. This class provides
-/// an interface to this structure and maintains a consistent snapshot of the
-/// currently loaded modules.
+/// runtime liker each time a module is loaded or unloaded. This class
+/// provides an interface to this structure and maintains a consistent
+/// snapshot of the currently loaded modules.
class DYLDRendezvous {
// This structure is used to hold the contents of the debug rendezvous
@@ -119,13 +119,13 @@ public:
void DumpToLog(lldb_private::Log *log) const;
- /// @brief Constants describing the state of the rendezvous.
+ /// Constants describing the state of the rendezvous.
///
/// @see GetState().
enum RendezvousState { eConsistent, eAdd, eDelete };
- /// @brief Structure representing the shared objects currently loaded into
- /// the inferior process.
+ /// Structure representing the shared objects currently loaded into the
+ /// inferior process.
///
/// This object is a rough analogue to the struct link_map object which
/// actually lives in the inferiors memory.
@@ -194,7 +194,8 @@ protected:
/// List of SOEntry objects corresponding to the current link map state.
SOEntryList m_soentries;
- /// List of SOEntry's added to the link map since the last call to Resolve().
+ /// List of SOEntry's added to the link map since the last call to
+ /// Resolve().
SOEntryList m_added_soentries;
/// List of SOEntry's removed from the link map since the last call to
diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
index a7afeb6d68c3..26825d879f04 100644
--- a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
+++ b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.cpp
@@ -79,7 +79,8 @@ DynamicLoaderPOSIXDYLD::DynamicLoaderPOSIXDYLD(Process *process)
: DynamicLoader(process), m_rendezvous(process),
m_load_offset(LLDB_INVALID_ADDRESS), m_entry_point(LLDB_INVALID_ADDRESS),
m_auxv(), m_dyld_bid(LLDB_INVALID_BREAK_ID),
- m_vdso_base(LLDB_INVALID_ADDRESS) {}
+ m_vdso_base(LLDB_INVALID_ADDRESS),
+ m_interpreter_base(LLDB_INVALID_ADDRESS) {}
DynamicLoaderPOSIXDYLD::~DynamicLoaderPOSIXDYLD() {
if (m_dyld_bid != LLDB_INVALID_BREAK_ID) {
@@ -117,7 +118,7 @@ void DynamicLoaderPOSIXDYLD::DidAttach() {
: "<null executable>",
load_offset);
- EvalVdsoStatus();
+ EvalSpecialModulesStatus();
// if we dont have a load address we cant re-base
bool rebase_exec = (load_offset == LLDB_INVALID_ADDRESS) ? false : true;
@@ -152,31 +153,10 @@ void DynamicLoaderPOSIXDYLD::DidAttach() {
UpdateLoadedSections(executable_sp, LLDB_INVALID_ADDRESS, load_offset,
true);
- // When attaching to a target, there are two possible states:
- // (1) We already crossed the entry point and therefore the rendezvous
- // structure is ready to be used and we can load the list of modules
- // and place the rendezvous breakpoint.
- // (2) We didn't cross the entry point yet, so these structures are not
- // ready; we should behave as if we just launched the target and
- // call ProbeEntry(). This will place a breakpoint on the entry
- // point which itself will be hit after the rendezvous structure is
- // set up and will perform actions described in (1).
- if (m_rendezvous.Resolve()) {
- if (log)
- log->Printf("DynamicLoaderPOSIXDYLD::%s() pid %" PRIu64
- " rendezvous could resolve: attach assuming dynamic loader "
- "info is available now",
- __FUNCTION__,
- m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
- LoadAllCurrentModules();
- SetRendezvousBreakpoint();
- } else {
- if (log)
- log->Printf("DynamicLoaderPOSIXDYLD::%s() pid %" PRIu64
- " rendezvous could not yet resolve: adding breakpoint to "
- "catch future rendezvous setup",
- __FUNCTION__,
- m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
+ LoadAllCurrentModules();
+ if (!SetRendezvousBreakpoint()) {
+ // If we cannot establish rendezvous breakpoint right now we'll try again
+ // at entry point.
ProbeEntry();
}
@@ -207,7 +187,7 @@ void DynamicLoaderPOSIXDYLD::DidLaunch() {
executable = GetTargetExecutable();
load_offset = ComputeLoadOffset();
- EvalVdsoStatus();
+ EvalSpecialModulesStatus();
if (executable.get() && load_offset != LLDB_INVALID_ADDRESS) {
ModuleList module_list;
@@ -217,8 +197,14 @@ void DynamicLoaderPOSIXDYLD::DidLaunch() {
if (log)
log->Printf("DynamicLoaderPOSIXDYLD::%s about to call ProbeEntry()",
__FUNCTION__);
- ProbeEntry();
+ if (!SetRendezvousBreakpoint()) {
+ // If we cannot establish rendezvous breakpoint right now we'll try again
+ // at entry point.
+ ProbeEntry();
+ }
+
+ LoadVDSO();
m_process->GetTarget().ModulesDidLoad(module_list);
}
}
@@ -273,11 +259,11 @@ void DynamicLoaderPOSIXDYLD::ProbeEntry() {
}
// The runtime linker has run and initialized the rendezvous structure once the
-// process has hit its entry point. When we hit the corresponding breakpoint we
-// interrogate the rendezvous structure to get the load addresses of all
+// process has hit its entry point. When we hit the corresponding breakpoint
+// we interrogate the rendezvous structure to get the load addresses of all
// dependent modules for the process. Similarly, we can discover the runtime
-// linker function and setup a breakpoint to notify us of any dynamically loaded
-// modules (via dlopen).
+// linker function and setup a breakpoint to notify us of any dynamically
+// loaded modules (via dlopen).
bool DynamicLoaderPOSIXDYLD::EntryBreakpointHit(
void *baton, StoppointCallbackContext *context, user_id_t break_id,
user_id_t break_loc_id) {
@@ -295,13 +281,11 @@ bool DynamicLoaderPOSIXDYLD::EntryBreakpointHit(
: LLDB_INVALID_PROCESS_ID);
// Disable the breakpoint --- if a stop happens right after this, which we've
- // seen on occasion, we don't
- // want the breakpoint stepping thread-plan logic to show a breakpoint
- // instruction at the disassembled
- // entry point to the program. Disabling it prevents it. (One-shot is not
- // enough - one-shot removal logic
- // only happens after the breakpoint goes public, which wasn't happening in
- // our scenario).
+ // seen on occasion, we don't want the breakpoint stepping thread-plan logic
+ // to show a breakpoint instruction at the disassembled entry point to the
+ // program. Disabling it prevents it. (One-shot is not enough - one-shot
+ // removal logic only happens after the breakpoint goes public, which wasn't
+ // happening in our scenario).
if (dyld_instance->m_process) {
BreakpointSP breakpoint_sp =
dyld_instance->m_process->GetTarget().GetBreakpointByID(break_id);
@@ -329,38 +313,77 @@ bool DynamicLoaderPOSIXDYLD::EntryBreakpointHit(
return false; // Continue running.
}
-void DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
+bool DynamicLoaderPOSIXDYLD::SetRendezvousBreakpoint() {
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
+ if (m_dyld_bid != LLDB_INVALID_BREAK_ID) {
+ LLDB_LOG(log,
+ "Rendezvous breakpoint breakpoint id {0} for pid {1}"
+ "is already set.",
+ m_dyld_bid,
+ m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
+ return true;
+ }
- addr_t break_addr = m_rendezvous.GetBreakAddress();
+ addr_t break_addr;
Target &target = m_process->GetTarget();
-
- if (m_dyld_bid == LLDB_INVALID_BREAK_ID) {
- if (log)
- log->Printf("DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
- " setting rendezvous break address at 0x%" PRIx64,
- __FUNCTION__,
- m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID,
- break_addr);
- Breakpoint *dyld_break =
- target.CreateBreakpoint(break_addr, true, false).get();
- dyld_break->SetCallback(RendezvousBreakpointHit, this, true);
- dyld_break->SetBreakpointKind("shared-library-event");
- m_dyld_bid = dyld_break->GetID();
+ BreakpointSP dyld_break;
+ if (m_rendezvous.IsValid()) {
+ break_addr = m_rendezvous.GetBreakAddress();
+ LLDB_LOG(log, "Setting rendezvous break address for pid {0} at {1:x}",
+ m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID,
+ break_addr);
+ dyld_break = target.CreateBreakpoint(break_addr, true, false);
} else {
- if (log)
- log->Printf("DynamicLoaderPOSIXDYLD::%s pid %" PRIu64
- " reusing break id %" PRIu32 ", address at 0x%" PRIx64,
- __FUNCTION__,
- m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID,
- m_dyld_bid, break_addr);
+ LLDB_LOG(log, "Rendezvous structure is not set up yet. "
+ "Trying to locate rendezvous breakpoint in the interpreter "
+ "by symbol name.");
+ ModuleSP interpreter = LoadInterpreterModule();
+ if (!interpreter) {
+ LLDB_LOG(log, "Can't find interpreter, rendezvous breakpoint isn't set.");
+ return false;
+ }
+
+ // Function names from different dynamic loaders that are known to be used
+ // as rendezvous between the loader and debuggers.
+ static std::vector<std::string> DebugStateCandidates{
+ "_dl_debug_state", "rtld_db_dlactivity", "__dl_rtld_db_dlactivity",
+ "r_debug_state", "_r_debug_state", "_rtld_debug_state",
+ };
+
+ FileSpecList containingModules;
+ containingModules.Append(interpreter->GetFileSpec());
+ dyld_break = target.CreateBreakpoint(
+ &containingModules, nullptr /* containingSourceFiles */,
+ DebugStateCandidates, eFunctionNameTypeFull, eLanguageTypeC,
+ 0, /* offset */
+ eLazyBoolNo, /* skip_prologue */
+ true, /* internal */
+ false /* request_hardware */);
+ }
+
+ if (dyld_break->GetNumResolvedLocations() != 1) {
+ LLDB_LOG(
+ log,
+ "Rendezvous breakpoint has abnormal number of"
+ " resolved locations ({0}) in pid {1}. It's supposed to be exactly 1.",
+ dyld_break->GetNumResolvedLocations(),
+ m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
+
+ target.RemoveBreakpointByID(dyld_break->GetID());
+ return false;
}
- // Make sure our breakpoint is at the right address.
- assert(target.GetBreakpointByID(m_dyld_bid)
- ->FindLocationByAddress(break_addr)
- ->GetBreakpoint()
- .GetID() == m_dyld_bid);
+ BreakpointLocationSP location = dyld_break->GetLocationAtIndex(0);
+ LLDB_LOG(log,
+ "Successfully set rendezvous breakpoint at address {0:x} "
+ "for pid {1}",
+ location->GetLoadAddress(),
+ m_process ? m_process->GetID() : LLDB_INVALID_PROCESS_ID);
+
+ dyld_break->SetCallback(RendezvousBreakpointHit, this, true);
+ dyld_break->SetBreakpointKind("shared-library-event");
+ m_dyld_bid = dyld_break->GetID();
+ return true;
}
bool DynamicLoaderPOSIXDYLD::RendezvousBreakpointHit(
@@ -485,7 +508,7 @@ DynamicLoaderPOSIXDYLD::GetStepThroughTrampolinePlan(Thread &thread,
return thread_plan_sp;
}
-void DynamicLoaderPOSIXDYLD::LoadVDSO(ModuleList &modules) {
+void DynamicLoaderPOSIXDYLD::LoadVDSO() {
if (m_vdso_base == LLDB_INVALID_ADDRESS)
return;
@@ -506,13 +529,40 @@ void DynamicLoaderPOSIXDYLD::LoadVDSO(ModuleList &modules) {
}
}
+ModuleSP DynamicLoaderPOSIXDYLD::LoadInterpreterModule() {
+ if (m_interpreter_base == LLDB_INVALID_ADDRESS)
+ return nullptr;
+
+ MemoryRegionInfo info;
+ Target &target = m_process->GetTarget();
+ Status status = m_process->GetMemoryRegionInfo(m_interpreter_base, info);
+ if (status.Fail() || info.GetMapped() != MemoryRegionInfo::eYes ||
+ info.GetName().IsEmpty()) {
+ Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
+ LLDB_LOG(log, "Failed to get interpreter region info: {0}", status);
+ return nullptr;
+ }
+
+ FileSpec file(info.GetName().GetCString(), false);
+ ModuleSpec module_spec(file, target.GetArchitecture());
+
+ if (ModuleSP module_sp = target.GetSharedModule(module_spec)) {
+ UpdateLoadedSections(module_sp, LLDB_INVALID_ADDRESS, m_interpreter_base,
+ false);
+ return module_sp;
+ }
+ return nullptr;
+}
+
void DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() {
DYLDRendezvous::iterator I;
DYLDRendezvous::iterator E;
ModuleList module_list;
+ Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
+
+ LoadVDSO();
if (!m_rendezvous.Resolve()) {
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
if (log)
log->Printf("DynamicLoaderPOSIXDYLD::%s unable to resolve POSIX DYLD "
"rendezvous address",
@@ -520,11 +570,10 @@ void DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() {
return;
}
- // The rendezvous class doesn't enumerate the main module, so track
- // that ourselves here.
+ // The rendezvous class doesn't enumerate the main module, so track that
+ // ourselves here.
ModuleSP executable = GetTargetExecutable();
m_loaded_modules[executable] = m_rendezvous.GetLinkMapAddress();
- LoadVDSO(module_list);
std::vector<FileSpec> module_names;
for (I = m_rendezvous.begin(), E = m_rendezvous.end(); I != E; ++I)
@@ -536,6 +585,8 @@ void DynamicLoaderPOSIXDYLD::LoadAllCurrentModules() {
ModuleSP module_sp =
LoadModuleAtAddress(I->file_spec, I->link_addr, I->base_addr, true);
if (module_sp.get()) {
+ LLDB_LOG(log, "LoadAllCurrentModules loading module: {0}",
+ I->file_spec.GetFilename());
module_list.Append(module_sp);
} else {
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_DYNAMIC_LOADER));
@@ -575,11 +626,14 @@ addr_t DynamicLoaderPOSIXDYLD::ComputeLoadOffset() {
return m_load_offset;
}
-void DynamicLoaderPOSIXDYLD::EvalVdsoStatus() {
- AuxVector::iterator I = m_auxv->FindEntry(AuxVector::AUXV_AT_SYSINFO_EHDR);
-
- if (I != m_auxv->end())
+void DynamicLoaderPOSIXDYLD::EvalSpecialModulesStatus() {
+ auto I = m_auxv->FindEntry(AuxVector::AUXV_AT_SYSINFO_EHDR);
+ if (I != m_auxv->end() && I->value != 0)
m_vdso_base = I->value;
+
+ I = m_auxv->FindEntry(AuxVector::AUXV_AT_BASE);
+ if (I != m_auxv->end() && I->value != 0)
+ m_interpreter_base = I->value;
}
addr_t DynamicLoaderPOSIXDYLD::GetEntryPoint() {
diff --git a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
index 2e9670587e66..0456baf4a658 100644
--- a/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
+++ b/source/Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h
@@ -85,13 +85,17 @@ protected:
/// mapped to the address space
lldb::addr_t m_vdso_base;
+ /// Contains AT_BASE, which means a dynamic loader has been
+ /// mapped to the address space
+ lldb::addr_t m_interpreter_base;
+
/// Loaded module list. (link map for each module)
std::map<lldb::ModuleWP, lldb::addr_t, std::owner_less<lldb::ModuleWP>>
m_loaded_modules;
- /// Enables a breakpoint on a function called by the runtime
+ /// If possible sets a breakpoint on a function called by the runtime
/// linker each time a module is loaded or unloaded.
- virtual void SetRendezvousBreakpoint();
+ bool SetRendezvousBreakpoint();
/// Callback routine which updates the current list of loaded modules based
/// on the information supplied by the runtime linker.
@@ -138,7 +142,11 @@ protected:
/// of all dependent modules.
virtual void LoadAllCurrentModules();
- void LoadVDSO(lldb_private::ModuleList &modules);
+ void LoadVDSO();
+
+ // Loading an interpreter module (if present) assumming m_interpreter_base
+ // already points to its base address.
+ lldb::ModuleSP LoadInterpreterModule();
/// Computes a value for m_load_offset returning the computed address on
/// success and LLDB_INVALID_ADDRESS on failure.
@@ -148,9 +156,10 @@ protected:
/// success and LLDB_INVALID_ADDRESS on failure.
lldb::addr_t GetEntryPoint();
- /// Evaluate if Aux vectors contain vDSO information
+ /// Evaluate if Aux vectors contain vDSO and LD information
/// in case they do, read and assign the address to m_vdso_base
- void EvalVdsoStatus();
+ /// and m_interpreter_base.
+ void EvalSpecialModulesStatus();
/// Loads Module from inferior process.
void ResolveExecutableModule(lldb::ModuleSP &module_sp);
diff --git a/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp b/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
index 291695cb68c1..2960e3939461 100644
--- a/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
+++ b/source/Plugins/DynamicLoader/Static/DynamicLoaderStatic.cpp
@@ -19,9 +19,9 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Create an instance of this class. This function is filled into
-// the plugin info class that gets handed out by the plugin factory and
-// allows the lldb to instantiate an instance of this class.
+// Create an instance of this class. This function is filled into the plugin
+// info class that gets handed out by the plugin factory and allows the lldb to
+// instantiate an instance of this class.
//----------------------------------------------------------------------
DynamicLoader *DynamicLoaderStatic::CreateInstance(Process *process,
bool force) {
@@ -97,17 +97,17 @@ void DynamicLoaderStatic::LoadAllImagesAtFileAddresses() {
if (section_list) {
// All sections listed in the dyld image info structure will all
// either be fixed up already, or they will all be off by a single
- // slide amount that is determined by finding the first segment
- // that is at file offset zero which also has bytes (a file size
- // that is greater than zero) in the object file.
+ // slide amount that is determined by finding the first segment that
+ // is at file offset zero which also has bytes (a file size that is
+ // greater than zero) in the object file.
// Determine the slide amount (if any)
const size_t num_sections = section_list->GetSize();
size_t sect_idx = 0;
for (sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
- // Iterate through the object file sections to find the
- // first section that starts of file offset zero and that
- // has bytes in the file...
+ // Iterate through the object file sections to find the first
+ // section that starts of file offset zero and that has bytes in
+ // the file...
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
if (section_sp) {
if (m_process->GetTarget().SetSectionLoadAddress(
diff --git a/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp b/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
index 9e6a2f3acafe..fa49a51f32a6 100644
--- a/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.cpp
@@ -226,8 +226,7 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
return true;
// In C++11, last_expr can be a LValueToRvalue implicit cast. Strip that off
- // if that's the
- // case.
+ // if that's the case.
do {
ImplicitCastExpr *implicit_cast = dyn_cast<ImplicitCastExpr>(last_expr);
@@ -242,8 +241,8 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
} while (0);
// is_lvalue is used to record whether the expression returns an assignable
- // Lvalue or an
- // Rvalue. This is relevant because they are handled differently.
+ // Lvalue or an Rvalue. This is relevant because they are handled
+ // differently.
//
// For Lvalues
//
@@ -293,9 +292,8 @@ bool ASTResultSynthesizer::SynthesizeBodyResult(CompoundStmt *Body,
//
// - During dematerialization, $0 is ignored.
- bool is_lvalue = (last_expr->getValueKind() == VK_LValue ||
- last_expr->getValueKind() == VK_XValue) &&
- (last_expr->getObjectKind() == OK_Ordinary);
+ bool is_lvalue = last_expr->getValueKind() == VK_LValue &&
+ last_expr->getObjectKind() == OK_Ordinary;
QualType expr_qual_type = last_expr->getType();
const clang::Type *expr_type = expr_qual_type.getTypePtr();
diff --git a/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h b/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h
index c0e6c0358a23..859a1dfa5f73 100644
--- a/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h
+++ b/source/Plugins/ExpressionParser/Clang/ASTResultSynthesizer.h
@@ -18,18 +18,17 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ASTResultSynthesizer ASTResultSynthesizer.h
-/// "lldb/Expression/ASTResultSynthesizer.h"
-/// @brief Adds a result variable declaration to the ASTs for an expression.
+/// "lldb/Expression/ASTResultSynthesizer.h" Adds a result variable
+/// declaration to the ASTs for an expression.
///
/// Users expect the expression "i + 3" to return a result, even if a result
/// variable wasn't specifically declared. To fulfil this requirement, LLDB
-/// adds
-/// a result variable to the expression, transforming it to
-/// "int $__lldb_expr_result = i + 3." The IR transformers ensure that the
+/// adds a result variable to the expression, transforming it to "int
+/// $__lldb_expr_result = i + 3." The IR transformers ensure that the
/// resulting variable is mapped to the right piece of memory.
-/// ASTResultSynthesizer's job is to add the variable and its initialization to
-/// the ASTs for the expression, and it does so by acting as a SemaConsumer for
-/// Clang.
+/// ASTResultSynthesizer's job is to add the variable and its initialization
+/// to the ASTs for the expression, and it does so by acting as a SemaConsumer
+/// for Clang.
//----------------------------------------------------------------------
class ASTResultSynthesizer : public clang::SemaConsumer {
public:
@@ -68,8 +67,8 @@ public:
void Initialize(clang::ASTContext &Context) override;
//----------------------------------------------------------------------
- /// Examine a list of Decls to find the function $__lldb_expr and
- /// transform its code
+ /// Examine a list of Decls to find the function $__lldb_expr and transform
+ /// its code
///
/// @param[in] D
/// The list of Decls to search. These may contain LinkageSpecDecls,
@@ -124,8 +123,8 @@ public:
private:
//----------------------------------------------------------------------
- /// Hunt the given Decl for FunctionDecls named $__lldb_expr, recursing
- /// as necessary through LinkageSpecDecls, and calling SynthesizeResult on
+ /// Hunt the given Decl for FunctionDecls named $__lldb_expr, recursing as
+ /// necessary through LinkageSpecDecls, and calling SynthesizeResult on
/// anything that was found
///
/// @param[in] D
@@ -164,8 +163,8 @@ private:
bool SynthesizeBodyResult(clang::CompoundStmt *Body, clang::DeclContext *DC);
//----------------------------------------------------------------------
- /// Given a DeclContext for a function or method, find all types
- /// declared in the context and record any persistent types found.
+ /// Given a DeclContext for a function or method, find all types declared in
+ /// the context and record any persistent types found.
///
/// @param[in] FunDeclCtx
/// The context for the function to process.
@@ -173,8 +172,8 @@ private:
void RecordPersistentTypes(clang::DeclContext *FunDeclCtx);
//----------------------------------------------------------------------
- /// Given a TypeDecl, if it declares a type whose name starts with a
- /// dollar sign, register it as a pointer type in the target's scratch
+ /// Given a TypeDecl, if it declares a type whose name starts with a dollar
+ /// sign, register it as a pointer type in the target's scratch
/// AST context.
///
/// @param[in] Body
diff --git a/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h b/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h
index 63e3161cae85..65f4b00a8651 100644
--- a/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h
+++ b/source/Plugins/ExpressionParser/Clang/ASTStructExtractor.h
@@ -20,20 +20,19 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ASTStructExtractor ASTStructExtractor.h
-/// "lldb/Expression/ASTStructExtractor.h"
-/// @brief Extracts and describes the argument structure for a wrapped function.
+/// "lldb/Expression/ASTStructExtractor.h" Extracts and describes the argument
+/// structure for a wrapped function.
///
/// This pass integrates with ClangFunctionCaller, which calls functions with
-/// custom
-/// sets of arguments. To avoid having to implement the full calling convention
-/// for the target's architecture, ClangFunctionCaller writes a simple wrapper
-/// function that takes a pointer to an argument structure that contains room
-/// for the address of the function to be called, the values of all its
-/// arguments, and room for the function's return value.
+/// custom sets of arguments. To avoid having to implement the full calling
+/// convention for the target's architecture, ClangFunctionCaller writes a
+/// simple wrapper function that takes a pointer to an argument structure that
+/// contains room for the address of the function to be called, the values of
+/// all its arguments, and room for the function's return value.
///
-/// The definition of this struct is itself in the body of the wrapper function,
-/// so Clang does the structure layout itself. ASTStructExtractor reads through
-/// the AST for the wrapper function and finds the struct.
+/// The definition of this struct is itself in the body of the wrapper
+/// function, so Clang does the structure layout itself. ASTStructExtractor
+/// reads through the AST for the wrapper function and finds the struct.
//----------------------------------------------------------------------
class ASTStructExtractor : public clang::SemaConsumer {
public:
@@ -73,8 +72,8 @@ public:
void Initialize(clang::ASTContext &Context) override;
//----------------------------------------------------------------------
- /// Examine a list of Decls to find the function $__lldb_expr and
- /// transform its code
+ /// Examine a list of Decls to find the function $__lldb_expr and transform
+ /// its code
///
/// @param[in] D
/// The list of Decls to search. These may contain LinkageSpecDecls,
diff --git a/source/Plugins/ExpressionParser/Clang/CMakeLists.txt b/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
index a780e7d597b1..ec4f6d5674e1 100644
--- a/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
+++ b/source/Plugins/ExpressionParser/Clang/CMakeLists.txt
@@ -11,6 +11,7 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
ClangExpressionParser.cpp
ClangExpressionVariable.cpp
ClangFunctionCaller.cpp
+ ClangHost.cpp
ClangModulesDeclVendor.cpp
ClangPersistentVariables.cpp
ClangUserExpression.cpp
@@ -23,6 +24,7 @@ add_lldb_library(lldbPluginExpressionParserClang PLUGIN
LINK_LIBS
clangAST
clangCodeGen
+ clangDriver
clangEdit
clangFrontend
clangLex
diff --git a/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp b/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
index 7f031356b3c3..d98a2b25fbb7 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -33,8 +33,8 @@ using namespace clang;
using namespace lldb_private;
//------------------------------------------------------------------
-// Scoped class that will remove an active lexical decl from the set
-// when it goes out of scope.
+// Scoped class that will remove an active lexical decl from the set when it
+// goes out of scope.
//------------------------------------------------------------------
namespace {
class ScopedLexicalDeclEraser {
@@ -141,8 +141,8 @@ ClangASTSource::~ClangASTSource() {
m_ast_importer_sp->ForgetDestination(m_ast_context);
// We are in the process of destruction, don't create clang ast context on
- // demand
- // by passing false to Target::GetScratchClangASTContext(create_on_demand).
+ // demand by passing false to
+ // Target::GetScratchClangASTContext(create_on_demand).
ClangASTContext *scratch_clang_ast_context =
m_target->GetScratchClangASTContext(false);
@@ -231,8 +231,8 @@ bool ClangASTSource::FindExternalVisibleDeclsByName(
}
if (!GetLookupsEnabled()) {
- // Wait until we see a '$' at the start of a name before we start doing
- // any lookups so we can avoid lookup up all of the builtin types.
+ // Wait until we see a '$' at the start of a name before we start doing any
+ // lookups so we can avoid lookup up all of the builtin types.
if (!decl_name.empty() && decl_name[0] == '$') {
SetLookupsEnabled(true);
} else {
@@ -297,8 +297,8 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
}
if (!m_ast_importer_sp->CompleteTagDecl(tag_decl)) {
- // We couldn't complete the type. Maybe there's a definition
- // somewhere else that can be completed.
+ // We couldn't complete the type. Maybe there's a definition somewhere
+ // else that can be completed.
if (log)
log->Printf(" CTD[%u] Type could not be completed in the module in "
@@ -398,8 +398,8 @@ void ClangASTSource::CompleteType(TagDecl *tag_decl) {
const_cast<TagDecl *>(tag_type->getDecl());
// We have found a type by basename and we need to make sure the decl
- // contexts
- // are the same before we can try to complete this type with another
+ // contexts are the same before we can try to complete this type with
+ // another
if (!ClangASTContext::DeclsAreEquivalent(tag_decl, candidate_tag_decl))
continue;
@@ -861,13 +861,16 @@ void ClangASTSource::FindExternalVisibleDecls(
TypeList types;
SymbolContext null_sc;
- const bool exact_match = false;
+ const bool exact_match = true;
llvm::DenseSet<lldb_private::SymbolFile *> searched_symbol_files;
if (module_sp && namespace_decl)
module_sp->FindTypesInNamespace(null_sc, name, &namespace_decl, 1, types);
- else
- m_target->GetImages().FindTypes(null_sc, name, exact_match, 1,
+ else {
+ SymbolContext sc;
+ sc.module_sp = module_sp;
+ m_target->GetImages().FindTypes(sc, name, exact_match, 1,
searched_symbol_files, types);
+ }
if (size_t num_types = types.GetSize()) {
for (size_t ti = 0; ti < num_types; ++ti) {
@@ -1243,8 +1246,8 @@ void ClangASTSource::FindObjCMethodDecls(NameSearchContext &context) {
break;
// Fall back and check for methods in categories. If we find methods this
- // way, we need to check that they're actually in
- // categories on the desired class.
+ // way, we need to check that they're actually in categories on the desired
+ // class.
SymbolContextList candidate_sc_list;
@@ -1591,8 +1594,7 @@ void ClangASTSource::FindObjCPropertyAndIvarDecls(NameSearchContext &context) {
do {
// Check the runtime only if the debug information didn't have a complete
- // interface
- // and nothing was in the modules.
+ // interface and nothing was in the modules.
lldb::ProcessSP process(m_target->GetProcessSP());
@@ -1645,12 +1647,9 @@ static bool ImportOffsetMap(llvm::DenseMap<const D *, O> &destination_map,
ClangASTSource &source) {
// When importing fields into a new record, clang has a hard requirement that
// fields be imported in field offset order. Since they are stored in a
- // DenseMap
- // with a pointer as the key type, this means we cannot simply iterate over
- // the
- // map, as the order will be non-deterministic. Instead we have to sort by
- // the offset
- // and then insert in sorted order.
+ // DenseMap with a pointer as the key type, this means we cannot simply
+ // iterate over the map, as the order will be non-deterministic. Instead we
+ // have to sort by the offset and then insert in sorted order.
typedef llvm::DenseMap<const D *, O> MapType;
typedef typename MapType::value_type PairType;
std::vector<PairType> sorted_items;
@@ -2051,9 +2050,8 @@ CompilerType ClangASTSource::GuardedCopyType(const CompilerType &src_type) {
if (copied_qual_type.getAsOpaquePtr() &&
copied_qual_type->getCanonicalTypeInternal().isNull())
- // this shouldn't happen, but we're hardening because the AST importer seems
- // to be generating bad types
- // on occasion.
+ // this shouldn't happen, but we're hardening because the AST importer
+ // seems to be generating bad types on occasion.
return CompilerType();
return CompilerType(m_ast_context, copied_qual_type);
@@ -2156,6 +2154,18 @@ clang::NamedDecl *NameSearchContext::AddFunDecl(const CompilerType &type,
log->Printf("Function type wasn't a FunctionProtoType");
}
+ // If this is an operator (e.g. operator new or operator==), only insert the
+ // declaration we inferred from the symbol if we can provide the correct
+ // number of arguments. We shouldn't really inject random decl(s) for
+ // functions that are analyzed semantically in a special way, otherwise we
+ // will crash in clang.
+ clang::OverloadedOperatorKind op_kind = clang::NUM_OVERLOADED_OPERATORS;
+ if (func_proto_type &&
+ ClangASTContext::IsOperator(decl_name.getAsString().c_str(), op_kind)) {
+ if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount(
+ false, op_kind, func_proto_type->getNumParams()))
+ return NULL;
+ }
m_decls.push_back(func_decl);
return func_decl;
diff --git a/source/Plugins/ExpressionParser/Clang/ClangASTSource.h b/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
index 6f72ad92dc8c..a42422b0f97f 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangASTSource.h
@@ -25,14 +25,13 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ClangASTSource ClangASTSource.h "lldb/Expression/ClangASTSource.h"
-/// @brief Provider for named objects defined in the debug info for Clang
+/// Provider for named objects defined in the debug info for Clang
///
-/// As Clang parses an expression, it may encounter names that are not
-/// defined inside the expression, including variables, functions, and
-/// types. Clang knows the name it is looking for, but nothing else.
-/// The ExternalSemaSource class provides Decls (VarDecl, FunDecl, TypeDecl)
-/// to Clang for these names, consulting the ClangExpressionDeclMap to do
-/// the actual lookups.
+/// As Clang parses an expression, it may encounter names that are not defined
+/// inside the expression, including variables, functions, and types. Clang
+/// knows the name it is looking for, but nothing else. The ExternalSemaSource
+/// class provides Decls (VarDecl, FunDecl, TypeDecl) to Clang for these
+/// names, consulting the ClangExpressionDeclMap to do the actual lookups.
//----------------------------------------------------------------------
class ClangASTSource : public ClangExternalASTSourceCommon,
public ClangASTImporter::MapCompleter {
@@ -78,8 +77,8 @@ public:
//------------------------------------------------------------------
/// Look up all Decls that match a particular name. Only handles
/// Identifiers and DeclContexts that are either NamespaceDecls or
- /// TranslationUnitDecls. Calls SetExternalVisibleDeclsForName with
- /// the result.
+ /// TranslationUnitDecls. Calls SetExternalVisibleDeclsForName with the
+ /// result.
///
/// The work for this function is done by
/// void FindExternalVisibleDecls (NameSearchContext &);
@@ -173,8 +172,8 @@ public:
//------------------------------------------------------------------
/// Called on entering a translation unit. Tells Clang by calling
- /// setHasExternalVisibleStorage() and setHasExternalLexicalStorage()
- /// that this object has something to say about undefined names.
+ /// setHasExternalVisibleStorage() and setHasExternalLexicalStorage() that
+ /// this object has something to say about undefined names.
///
/// @param[in] ASTConsumer
/// Unused.
@@ -186,8 +185,8 @@ public:
//
//------------------------------------------------------------------
- /// Look up the modules containing a given namespace and put the
- /// appropriate entries in the namespace map.
+ /// Look up the modules containing a given namespace and put the appropriate
+ /// entries in the namespace map.
///
/// @param[in] namespace_map
/// The map to be completed.
@@ -231,11 +230,10 @@ public:
//----------------------------------------------------------------------
/// @class ClangASTSourceProxy ClangASTSource.h
- /// "lldb/Expression/ClangASTSource.h"
- /// @brief Proxy for ClangASTSource
+ /// "lldb/Expression/ClangASTSource.h" Proxy for ClangASTSource
///
- /// Clang AST contexts like to own their AST sources, so this is a
- /// state-free proxy object.
+ /// Clang AST contexts like to own their AST sources, so this is a state-
+ /// free proxy object.
//----------------------------------------------------------------------
class ClangASTSourceProxy : public ClangExternalASTSourceCommon {
public:
@@ -298,8 +296,8 @@ public:
protected:
//------------------------------------------------------------------
- /// Look for the complete version of an Objective-C interface, and
- /// return it if found.
+ /// Look for the complete version of an Objective-C interface, and return it
+ /// if found.
///
/// @param[in] interface_decl
/// An ObjCInterfaceDecl that may not be the complete one.
@@ -312,8 +310,8 @@ protected:
GetCompleteObjCInterface(const clang::ObjCInterfaceDecl *interface_decl);
//------------------------------------------------------------------
- /// Find all entities matching a given name in a given module,
- /// using a NameSearchContext to make Decls for them.
+ /// Find all entities matching a given name in a given module, using a
+ /// NameSearchContext to make Decls for them.
///
/// @param[in] context
/// The NameSearchContext that can construct Decls for this name.
@@ -474,8 +472,9 @@ protected:
};
//----------------------------------------------------------------------
-/// @class NameSearchContext ClangASTSource.h "lldb/Expression/ClangASTSource.h"
-/// @brief Container for all objects relevant to a single name lookup
+/// @class NameSearchContext ClangASTSource.h
+/// "lldb/Expression/ClangASTSource.h" Container for all objects relevant to a
+/// single name lookup
///
/// LLDB needs to create Decls for entities it finds. This class communicates
/// what name is being searched for and provides helper functions to construct
@@ -532,8 +531,8 @@ struct NameSearchContext {
}
//------------------------------------------------------------------
- /// Create a VarDecl with the name being searched for and the provided
- /// type and register it in the right places.
+ /// Create a VarDecl with the name being searched for and the provided type
+ /// and register it in the right places.
///
/// @param[in] type
/// The opaque QualType for the VarDecl being registered.
@@ -541,8 +540,8 @@ struct NameSearchContext {
clang::NamedDecl *AddVarDecl(const CompilerType &type);
//------------------------------------------------------------------
- /// Create a FunDecl with the name being searched for and the provided
- /// type and register it in the right places.
+ /// Create a FunDecl with the name being searched for and the provided type
+ /// and register it in the right places.
///
/// @param[in] type
/// The opaque QualType for the FunDecl being registered.
@@ -553,15 +552,14 @@ struct NameSearchContext {
clang::NamedDecl *AddFunDecl(const CompilerType &type, bool extern_c = false);
//------------------------------------------------------------------
- /// Create a FunDecl with the name being searched for and generic
- /// type (i.e. intptr_t NAME_GOES_HERE(...)) and register it in the
- /// right places.
+ /// Create a FunDecl with the name being searched for and generic type (i.e.
+ /// intptr_t NAME_GOES_HERE(...)) and register it in the right places.
//------------------------------------------------------------------
clang::NamedDecl *AddGenericFunDecl();
//------------------------------------------------------------------
- /// Create a TypeDecl with the name being searched for and the provided
- /// type and register it in the right places.
+ /// Create a TypeDecl with the name being searched for and the provided type
+ /// and register it in the right places.
///
/// @param[in] compiler_type
/// The opaque QualType for the TypeDecl being registered.
@@ -569,8 +567,8 @@ struct NameSearchContext {
clang::NamedDecl *AddTypeDecl(const CompilerType &compiler_type);
//------------------------------------------------------------------
- /// Add Decls from the provided DeclContextLookupResult to the list
- /// of results.
+ /// Add Decls from the provided DeclContextLookupResult to the list of
+ /// results.
///
/// @param[in] result
/// The DeclContextLookupResult, usually returned as the result
diff --git a/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp b/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
index 07ff2e97aac7..0811a7999920 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -213,8 +213,8 @@ private:
m_exporter.getFromContext().getSourceManager().getFileID(loc);
if (file != m_file)
return false;
- // We are assuming the Decl was parsed in this very expression, so it should
- // not have external storage.
+ // We are assuming the Decl was parsed in this very expression, so it
+ // should not have external storage.
lldbassert(!llvm::cast<DeclContext>(decl)->hasExternalLexicalStorage());
return true;
}
@@ -591,8 +591,8 @@ bool ClangExpressionDeclMap::GetFunctionInfo(const NamedDecl *decl,
if (!entity)
return false;
- // We know m_parser_vars is valid since we searched for the variable by
- // its NamedDecl
+ // We know m_parser_vars is valid since we searched for the variable by its
+ // NamedDecl
ClangExpressionVariable::ParserVars *parser_vars =
entity->GetParserVars(GetParserID());
@@ -720,9 +720,9 @@ lldb::VariableSP ClangExpressionDeclMap::FindGlobalVariable(
VariableList vars;
if (module && namespace_decl)
- module->FindGlobalVariables(name, namespace_decl, true, -1, vars);
+ module->FindGlobalVariables(name, namespace_decl, -1, vars);
else
- target.GetImages().FindGlobalVariables(name, true, -1, vars);
+ target.GetImages().FindGlobalVariables(name, -1, vars);
if (vars.GetSize()) {
if (type) {
@@ -867,8 +867,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
if (IgnoreName(name, false))
return;
- // Only look for functions by name out in our symbols if the function
- // doesn't start with our phony prefix of '$'
+ // Only look for functions by name out in our symbols if the function doesn't
+ // start with our phony prefix of '$'
Target *target = m_parser_vars->m_exe_ctx.GetTargetPtr();
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
SymbolContext sym_ctx;
@@ -977,13 +977,11 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
m_struct_vars->m_object_pointer_type = self_user_type;
}
} else {
- // This branch will get hit if we are executing code in the context of a
- // function that
- // claims to have an object pointer (through DW_AT_object_pointer?) but
- // is not formally a
- // method of the class. In that case, just look up the "this" variable
- // in the current
- // scope and use its type.
+ // This branch will get hit if we are executing code in the context of
+ // a function that claims to have an object pointer (through
+ // DW_AT_object_pointer?) but is not formally a method of the class.
+ // In that case, just look up the "this" variable in the current scope
+ // and use its type.
// FIXME: This code is formally correct, but clang doesn't currently
// emit DW_AT_object_pointer
// for C++ so it hasn't actually been tested.
@@ -1093,13 +1091,11 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
return;
} else {
- // This branch will get hit if we are executing code in the context of a
- // function that
- // claims to have an object pointer (through DW_AT_object_pointer?) but
- // is not formally a
- // method of the class. In that case, just look up the "self" variable
- // in the current
- // scope and use its type.
+ // This branch will get hit if we are executing code in the context of
+ // a function that claims to have an object pointer (through
+ // DW_AT_object_pointer?) but is not formally a method of the class.
+ // In that case, just look up the "self" variable in the current scope
+ // and use its type.
VariableList *vars = frame->GetVariableList(false);
@@ -1217,9 +1213,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
vars->GetVariableAtIndex(i)->GetDecl();
// Search for declarations matching the name. Do not include imported
- // decls
- // in the search if we are looking for decls in the artificial namespace
- // $__lldb_local_vars.
+ // decls in the search if we are looking for decls in the artificial
+ // namespace $__lldb_local_vars.
std::vector<CompilerDecl> found_decls =
compiler_decl_context.FindDeclByName(name,
namespace_decl.IsValid());
@@ -1285,15 +1280,15 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
append, sc_list);
}
- // If we found more than one function, see if we can use the
- // frame's decl context to remove functions that are shadowed
- // by other functions which match in type but are nearer in scope.
+ // If we found more than one function, see if we can use the frame's decl
+ // context to remove functions that are shadowed by other functions which
+ // match in type but are nearer in scope.
//
// AddOneFunction will not add a function whose type has already been
- // added, so if there's another function in the list with a matching
- // type, check to see if their decl context is a parent of the current
- // frame's or was imported via a and using statement, and pick the
- // best match according to lookup rules.
+ // added, so if there's another function in the list with a matching type,
+ // check to see if their decl context is a parent of the current frame's or
+ // was imported via a and using statement, and pick the best match
+ // according to lookup rules.
if (sc_list.GetSize() > 1) {
// Collect some info about our frame's context.
StackFrame *frame = m_parser_vars->m_exe_ctx.GetFramePtr();
@@ -1321,11 +1316,10 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
SymbolContext m_sym_ctx;
};
- // First, symplify things by looping through the symbol contexts
- // to remove unwanted functions and separate out the functions we
- // want to compare and prune into a separate list.
- // Cache the info needed about the function declarations in a
- // vector for efficiency.
+ // First, symplify things by looping through the symbol contexts to
+ // remove unwanted functions and separate out the functions we want to
+ // compare and prune into a separate list. Cache the info needed about
+ // the function declarations in a vector for efficiency.
SymbolContextList sc_sym_list;
uint32_t num_indices = sc_list.GetSize();
std::vector<FuncDeclInfo> fdi_cache;
@@ -1335,16 +1329,16 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
SymbolContext sym_ctx;
sc_list.GetContextAtIndex(index, sym_ctx);
- // We don't know enough about symbols to compare them,
- // but we should keep them in the list.
+ // We don't know enough about symbols to compare them, but we should
+ // keep them in the list.
Function *function = sym_ctx.function;
if (!function) {
sc_sym_list.Append(sym_ctx);
continue;
}
// Filter out functions without declaration contexts, as well as
- // class/instance methods, since they'll be skipped in the
- // code that follows anyway.
+ // class/instance methods, since they'll be skipped in the code that
+ // follows anyway.
CompilerDeclContext func_decl_context = function->GetDeclContext();
if (!func_decl_context ||
func_decl_context.IsClassMethod(nullptr, nullptr, nullptr))
@@ -1363,11 +1357,10 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
fdi.m_copied_type = copied_func_type;
fdi.m_decl_lvl = LLDB_INVALID_DECL_LEVEL;
if (fdi.m_copied_type && func_decl_context) {
- // Call CountDeclLevels to get the number of parent scopes we
- // have to look through before we find the function declaration.
- // When comparing functions of the same type, the one with a
- // lower count will be closer to us in the lookup scope and
- // shadows the other.
+ // Call CountDeclLevels to get the number of parent scopes we have
+ // to look through before we find the function declaration. When
+ // comparing functions of the same type, the one with a lower count
+ // will be closer to us in the lookup scope and shadows the other.
clang::DeclContext *func_decl_ctx =
(clang::DeclContext *)func_decl_context.GetOpaqueDeclContext();
fdi.m_decl_lvl = ast->CountDeclLevels(
@@ -1536,9 +1529,8 @@ void ClangExpressionDeclMap::FindExternalVisibleDecls(
}
if (target && !context.m_found.variable && !namespace_decl) {
- // We couldn't find a non-symbol variable for this. Now we'll hunt for
- // a generic
- // data symbol, and -- if it is found -- treat it as a variable.
+ // We couldn't find a non-symbol variable for this. Now we'll hunt for a
+ // generic data symbol, and -- if it is found -- treat it as a variable.
Status error;
const Symbol *data_symbol =
@@ -2116,7 +2108,8 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
parser_vars->m_llvm_value = NULL;
if (log) {
- ASTDumper ast_dumper(function_decl);
+ std::string function_str =
+ function_decl ? ASTDumper(function_decl).GetCString() : "nullptr";
StreamString ss;
@@ -2127,7 +2120,7 @@ void ClangExpressionDeclMap::AddOneFunction(NameSearchContext &context,
log->Printf(
" CEDM::FEVD[%u] Found %s function %s (description %s), returned %s",
current_id, (function ? "specific" : "generic"), decl_name.c_str(),
- ss.GetData(), ast_dumper.GetCString());
+ ss.GetData(), function_str.c_str());
}
}
@@ -2165,7 +2158,7 @@ void ClangExpressionDeclMap::AddThisType(NameSearchContext &context,
CXXMethodDecl *method_decl =
ClangASTContext::GetASTContext(m_ast_context)
->AddMethodToCXXRecordType(
- copied_clang_type.GetOpaqueQualType(), "$__lldb_expr",
+ copied_clang_type.GetOpaqueQualType(), "$__lldb_expr", NULL,
method_type, lldb::eAccessPublic, is_virtual, is_static,
is_inline, is_explicit, is_attr_used, is_artificial);
diff --git a/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h b/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
index d163ad4f7e29..b67387930190 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.h
@@ -36,29 +36,28 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ClangExpressionDeclMap ClangExpressionDeclMap.h
-/// "lldb/Expression/ClangExpressionDeclMap.h"
-/// @brief Manages named entities that are defined in LLDB's debug information.
+/// "lldb/Expression/ClangExpressionDeclMap.h" Manages named entities that are
+/// defined in LLDB's debug information.
///
/// The Clang parser uses the ClangASTSource as an interface to request named
/// entities from outside an expression. The ClangASTSource reports back,
-/// listing
-/// all possible objects corresponding to a particular name. But it in turn
-/// relies on ClangExpressionDeclMap, which performs several important
+/// listing all possible objects corresponding to a particular name. But it
+/// in turn relies on ClangExpressionDeclMap, which performs several important
/// functions.
///
-/// First, it records what variables and functions were looked up and what Decls
-/// were returned for them.
+/// First, it records what variables and functions were looked up and what
+/// Decls were returned for them.
///
/// Second, it constructs a struct on behalf of IRForTarget, recording which
-/// variables should be placed where and relaying this information back so that
-/// IRForTarget can generate context-independent code.
+/// variables should be placed where and relaying this information back so
+/// that IRForTarget can generate context-independent code.
///
/// Third, it "materializes" this struct on behalf of the expression command,
/// finding the current values of each variable and placing them into the
/// struct so that it can be passed to the JITted version of the IR.
///
-/// Fourth and finally, it "dematerializes" the struct after the JITted code has
-/// has executed, placing the new values back where it found the old ones.
+/// Fourth and finally, it "dematerializes" the struct after the JITted code
+/// has has executed, placing the new values back where it found the old ones.
//----------------------------------------------------------------------
class ClangExpressionDeclMap : public ClangASTSource {
public:
@@ -169,8 +168,8 @@ public:
lldb::offset_t alignment);
//------------------------------------------------------------------
- /// [Used by IRForTarget] Finalize the struct, laying out the position
- /// of each object in it.
+ /// [Used by IRForTarget] Finalize the struct, laying out the position of
+ /// each object in it.
///
/// @return
/// True on success; false otherwise.
@@ -178,8 +177,8 @@ public:
bool DoStructLayout();
//------------------------------------------------------------------
- /// [Used by IRForTarget] Get general information about the laid-out
- /// struct after DoStructLayout() has been called.
+ /// [Used by IRForTarget] Get general information about the laid-out struct
+ /// after DoStructLayout() has been called.
///
/// @param[out] num_elements
/// The number of elements in the struct.
@@ -197,8 +196,8 @@ public:
lldb::offset_t &alignment);
//------------------------------------------------------------------
- /// [Used by IRForTarget] Get specific information about one field
- /// of the laid-out struct after DoStructLayout() has been called.
+ /// [Used by IRForTarget] Get specific information about one field of the
+ /// laid-out struct after DoStructLayout() has been called.
///
/// @param[out] decl
/// The parsed Decl for the field, as generated by ClangASTSource
@@ -232,8 +231,7 @@ public:
uint32_t index);
//------------------------------------------------------------------
- /// [Used by IRForTarget] Get information about a function given its
- /// Decl.
+ /// [Used by IRForTarget] Get information about a function given its Decl.
///
/// @param[in] decl
/// The parsed Decl for the Function, as generated by ClangASTSource
@@ -248,8 +246,8 @@ public:
bool GetFunctionInfo(const clang::NamedDecl *decl, uint64_t &ptr);
//------------------------------------------------------------------
- /// [Used by IRForTarget] Get the address of a symbol given nothing
- /// but its name.
+ /// [Used by IRForTarget] Get the address of a symbol given nothing but its
+ /// name.
///
/// @param[in] target
/// The target to find the symbol in. If not provided,
@@ -303,8 +301,8 @@ public:
TargetInfo GetTargetInfo();
//------------------------------------------------------------------
- /// [Used by ClangASTSource] Find all entities matching a given name,
- /// using a NameSearchContext to make Decls for them.
+ /// [Used by ClangASTSource] Find all entities matching a given name, using
+ /// a NameSearchContext to make Decls for them.
///
/// @param[in] context
/// The NameSearchContext that can construct Decls for this name.
@@ -442,14 +440,13 @@ private:
void DisableStructVars() { m_struct_vars.reset(); }
//----------------------------------------------------------------------
- /// Get this parser's ID for use in extracting parser- and JIT-specific
- /// data from persistent variables.
+ /// Get this parser's ID for use in extracting parser- and JIT-specific data
+ /// from persistent variables.
//----------------------------------------------------------------------
uint64_t GetParserID() { return (uint64_t) this; }
//------------------------------------------------------------------
- /// Given a target, find a variable that matches the given name and
- /// type.
+ /// Given a target, find a variable that matches the given name and type.
///
/// @param[in] target
/// The target to use as a basis for finding the variable.
@@ -477,8 +474,8 @@ private:
TypeFromUser *type = NULL);
//------------------------------------------------------------------
- /// Get the value of a variable in a given execution context and return
- /// the associated Types if needed.
+ /// Get the value of a variable in a given execution context and return the
+ /// associated Types if needed.
///
/// @param[in] var
/// The variable to evaluate.
@@ -524,8 +521,8 @@ private:
lldb::ValueObjectSP valobj, unsigned int current_id);
//------------------------------------------------------------------
- /// Use the NameSearchContext to generate a Decl for the given
- /// persistent variable, and put it in the list of found entities.
+ /// Use the NameSearchContext to generate a Decl for the given persistent
+ /// variable, and put it in the list of found entities.
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
@@ -542,9 +539,8 @@ private:
unsigned int current_id);
//------------------------------------------------------------------
- /// Use the NameSearchContext to generate a Decl for the given LLDB
- /// symbol (treated as a variable), and put it in the list of found
- /// entities.
+ /// Use the NameSearchContext to generate a Decl for the given LLDB symbol
+ /// (treated as a variable), and put it in the list of found entities.
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
@@ -556,9 +552,9 @@ private:
unsigned int current_id);
//------------------------------------------------------------------
- /// Use the NameSearchContext to generate a Decl for the given
- /// function. (Functions are not placed in the Tuple list.) Can
- /// handle both fully typed functions and generic functions.
+ /// Use the NameSearchContext to generate a Decl for the given function.
+ /// (Functions are not placed in the Tuple list.) Can handle both fully
+ /// typed functions and generic functions.
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
@@ -575,8 +571,7 @@ private:
unsigned int current_id);
//------------------------------------------------------------------
- /// Use the NameSearchContext to generate a Decl for the given
- /// register.
+ /// Use the NameSearchContext to generate a Decl for the given register.
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
@@ -588,8 +583,8 @@ private:
unsigned int current_id);
//------------------------------------------------------------------
- /// Use the NameSearchContext to generate a Decl for the given
- /// type. (Types are not placed in the Tuple list.)
+ /// Use the NameSearchContext to generate a Decl for the given type. (Types
+ /// are not placed in the Tuple list.)
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
@@ -601,8 +596,8 @@ private:
unsigned int current_id);
//------------------------------------------------------------------
- /// Generate a Decl for "*this" and add a member function declaration
- /// to it for the expression, then report it.
+ /// Generate a Decl for "*this" and add a member function declaration to it
+ /// for the expression, then report it.
///
/// @param[in] context
/// The NameSearchContext to use when constructing the Decl.
diff --git a/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp b/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
index d9e53074b3fb..c5406fcc3340 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -182,8 +182,7 @@ public:
m_manager->AddDiagnostic(new_diagnostic);
// Don't store away warning fixits, since the compiler doesn't have
- // enough
- // context in an expression for the warning to be useful.
+ // enough context in an expression for the warning to be useful.
// FIXME: Should we try to filter out FixIts that apply to our generated
// code, and not the user's expression?
if (severity == eDiagnosticSeverityError) {
@@ -226,10 +225,9 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
m_code_generator(), m_pp_callbacks(nullptr) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
- // We can't compile expressions without a target. So if the exe_scope is null
- // or doesn't have a target,
- // then we just need to get out of here. I'll lldb_assert and not make any of
- // the compiler objects since
+ // We can't compile expressions without a target. So if the exe_scope is
+ // null or doesn't have a target, then we just need to get out of here. I'll
+ // lldb_assert and not make any of the compiler objects since
// I can't return errors directly from the constructor. Further calls will
// check if the compiler was made and
// bag out if it wasn't.
@@ -262,14 +260,14 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
const auto target_machine = target_arch.GetMachine();
- // If the expression is being evaluated in the context of an existing
- // stack frame, we introspect to see if the language runtime is available.
+ // If the expression is being evaluated in the context of an existing stack
+ // frame, we introspect to see if the language runtime is available.
lldb::StackFrameSP frame_sp = exe_scope->CalculateStackFrame();
lldb::ProcessSP process_sp = exe_scope->CalculateProcess();
- // Make sure the user hasn't provided a preferred execution language
- // with `expression --language X -- ...`
+ // Make sure the user hasn't provided a preferred execution language with
+ // `expression --language X -- ...`
if (frame_sp && frame_lang == lldb::eLanguageTypeUnknown)
frame_lang = frame_sp->GetLanguage();
@@ -281,8 +279,7 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
}
// 2. Configure the compiler with a set of default options that are
- // appropriate
- // for most situations.
+ // appropriate for most situations.
if (target_arch.IsValid()) {
std::string triple = target_arch.GetTriple().str();
m_compiler->getTargetOpts().Triple = triple;
@@ -292,19 +289,17 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
} else {
// If we get here we don't have a valid target and just have to guess.
// Sometimes this will be ok to just use the host target triple (when we
- // evaluate say "2+3", but other
- // expressions like breakpoint conditions and other things that _are_ target
- // specific really shouldn't just be
- // using the host triple. In such a case the language runtime should expose
- // an overridden options set (3),
- // below.
+ // evaluate say "2+3", but other expressions like breakpoint conditions and
+ // other things that _are_ target specific really shouldn't just be using
+ // the host triple. In such a case the language runtime should expose an
+ // overridden options set (3), below.
m_compiler->getTargetOpts().Triple = llvm::sys::getDefaultTargetTriple();
if (log)
log->Printf("Using default target triple of %s",
m_compiler->getTargetOpts().Triple.c_str());
}
- // Now add some special fixes for known architectures:
- // Any arm32 iOS environment, but not on arm64
+ // Now add some special fixes for known architectures: Any arm32 iOS
+ // environment, but not on arm64
if (m_compiler->getTargetOpts().Triple.find("arm64") == std::string::npos &&
m_compiler->getTargetOpts().Triple.find("arm") != std::string::npos &&
m_compiler->getTargetOpts().Triple.find("ios") != std::string::npos) {
@@ -317,8 +312,8 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
m_compiler->getTargetOpts().Features.push_back("+sse2");
}
- // Set the target CPU to generate code for.
- // This will be empty for any CPU that doesn't really need to make a special
+ // Set the target CPU to generate code for. This will be empty for any CPU
+ // that doesn't really need to make a special
// CPU string.
m_compiler->getTargetOpts().CPU = target_arch.GetClangTargetCPU();
@@ -328,11 +323,9 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
m_compiler->getTargetOpts().ABI = abi;
// 3. Now allow the runtime to provide custom configuration options for the
- // target.
- // In this case, a specialized language runtime is available and we can query
- // it for extra options.
- // For 99% of use cases, this will not be needed and should be provided when
- // basic platform detection is not enough.
+ // target. In this case, a specialized language runtime is available and we
+ // can query it for extra options. For 99% of use cases, this will not be
+ // needed and should be provided when basic platform detection is not enough.
if (lang_rt)
overridden_target_opts =
lang_rt->GetOverrideExprOptions(m_compiler->getTargetOpts());
@@ -378,9 +371,9 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
case lldb::eLanguageTypeC11:
// FIXME: the following language option is a temporary workaround,
// to "ask for C, get C++."
- // For now, the expression parser must use C++ anytime the
- // language is a C family language, because the expression parser
- // uses features of C++ to capture values.
+ // For now, the expression parser must use C++ anytime the language is a C
+ // family language, because the expression parser uses features of C++ to
+ // capture values.
m_compiler->getLangOpts().CPlusPlus = true;
break;
case lldb::eLanguageTypeObjC:
@@ -392,10 +385,10 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
// Clang now sets as default C++14 as the default standard (with
// GNU extensions), so we do the same here to avoid mismatches that
- // cause compiler error when evaluating expressions (e.g. nullptr
- // not found as it's a C++11 feature). Currently lldb evaluates
- // C++14 as C++11 (see two lines below) so we decide to be consistent
- // with that, but this could be re-evaluated in the future.
+ // cause compiler error when evaluating expressions (e.g. nullptr not found
+ // as it's a C++11 feature). Currently lldb evaluates C++14 as C++11 (see
+ // two lines below) so we decide to be consistent with that, but this could
+ // be re-evaluated in the future.
m_compiler->getLangOpts().CPlusPlus11 = true;
break;
case lldb::eLanguageTypeC_plus_plus:
@@ -407,8 +400,8 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
case lldb::eLanguageTypeC_plus_plus_03:
m_compiler->getLangOpts().CPlusPlus = true;
// FIXME: the following language option is a temporary workaround,
- // to "ask for C++, get ObjC++". Apple hopes to remove this requirement
- // on non-Apple platforms, but for now it is needed.
+ // to "ask for C++, get ObjC++". Apple hopes to remove this requirement on
+ // non-Apple platforms, but for now it is needed.
m_compiler->getLangOpts().ObjC1 = true;
break;
case lldb::eLanguageTypeObjC_plus_plus:
@@ -434,10 +427,9 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
ArchSpec(m_compiler->getTargetOpts().Triple.c_str())
.CharIsSignedByDefault();
- // Spell checking is a nice feature, but it ends up completing a
- // lot of types that we didn't strictly speaking need to complete.
- // As a result, we spend a long time parsing and importing debug
- // information.
+ // Spell checking is a nice feature, but it ends up completing a lot of types
+ // that we didn't strictly speaking need to complete. As a result, we spend a
+ // long time parsing and importing debug information.
m_compiler->getLangOpts().SpellChecking = false;
if (process_sp && m_compiler->getLangOpts().ObjC1) {
@@ -513,8 +505,8 @@ ClangExpressionParser::ClangExpressionParser(ExecutionContextScope *exe_scope,
m_compiler->getPreprocessor().addPPCallbacks(std::move(pp_callbacks));
}
- // 8. Most of this we get from the CompilerInstance, but we
- // also want to give the context an ExternalASTSource.
+ // 8. Most of this we get from the CompilerInstance, but we also want to give
+ // the context an ExternalASTSource.
m_selector_table.reset(new SelectorTable());
m_builtin_context.reset(new Builtin::Context());
@@ -569,9 +561,7 @@ unsigned ClangExpressionParser::Parse(DiagnosticManager &diagnostic_manager) {
codegenoptions::FullDebugInfo) {
int temp_fd = -1;
llvm::SmallString<PATH_MAX> result_path;
- FileSpec tmpdir_file_spec;
- if (HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir,
- tmpdir_file_spec)) {
+ if (FileSpec tmpdir_file_spec = HostInfo::GetProcessTempDir()) {
tmpdir_file_spec.AppendPathComponent("lldb-%%%%%%.expr");
std::string temp_source_path = tmpdir_file_spec.GetPath();
llvm::sys::fs::createUniqueFile(temp_source_path, temp_fd, result_path);
@@ -811,7 +801,7 @@ lldb_private::Status ClangExpressionParser::PrepareForExecution(
{
auto lang = m_expr.Language();
if (log)
- log->Printf("%s - Currrent expression language is %s\n", __FUNCTION__,
+ log->Printf("%s - Current expression language is %s\n", __FUNCTION__,
Language::GetNameForLanguageType(lang));
lldb::ProcessSP process_sp = exe_ctx.GetProcessSP();
if (process_sp && lang != lldb::eLanguageTypeUnknown) {
diff --git a/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h b/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
index 41f290f2e127..4058ec1270b3 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.h
@@ -26,14 +26,14 @@ class IRExecutionUnit;
//----------------------------------------------------------------------
/// @class ClangExpressionParser ClangExpressionParser.h
-/// "lldb/Expression/ClangExpressionParser.h"
-/// @brief Encapsulates an instance of Clang that can parse expressions.
+/// "lldb/Expression/ClangExpressionParser.h" Encapsulates an instance of
+/// Clang that can parse expressions.
///
/// ClangExpressionParser is responsible for preparing an instance of
/// ClangExpression for execution. ClangExpressionParser uses ClangExpression
/// as a glorified parameter list, performing the required parsing and
-/// conversion to formats (DWARF bytecode, or JIT compiled machine code)
-/// that can be executed.
+/// conversion to formats (DWARF bytecode, or JIT compiled machine code) that
+/// can be executed.
//----------------------------------------------------------------------
class ClangExpressionParser : public ExpressionParser {
public:
@@ -59,8 +59,8 @@ public:
~ClangExpressionParser() override;
//------------------------------------------------------------------
- /// Parse a single expression and convert it to IR using Clang. Don't
- /// wrap the expression in anything at all.
+ /// Parse a single expression and convert it to IR using Clang. Don't wrap
+ /// the expression in anything at all.
///
/// @param[in] diagnostic_manager
/// The diagnostic manager to report errors to.
@@ -74,8 +74,8 @@ public:
bool RewriteExpression(DiagnosticManager &diagnostic_manager) override;
//------------------------------------------------------------------
- /// Ready an already-parsed expression for execution, possibly
- /// evaluating it statically.
+ /// Ready an already-parsed expression for execution, possibly evaluating it
+ /// statically.
///
/// @param[out] func_addr
/// The address to which the function has been written.
diff --git a/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h b/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
index baa80d7ba0d4..7d5ced5b4705 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangExpressionVariable.h
@@ -41,27 +41,25 @@ class ValueObjectConstResult;
//----------------------------------------------------------------------
/// @class ClangExpressionVariable ClangExpressionVariable.h
-/// "lldb/Expression/ClangExpressionVariable.h"
-/// @brief Encapsulates one variable for the expression parser.
+/// "lldb/Expression/ClangExpressionVariable.h" Encapsulates one variable for
+/// the expression parser.
///
/// The expression parser uses variables in three different contexts:
///
-/// First, it stores persistent variables along with the process for use
-/// in expressions. These persistent variables contain their own data
-/// and are typed.
+/// First, it stores persistent variables along with the process for use in
+/// expressions. These persistent variables contain their own data and are
+/// typed.
///
-/// Second, in an interpreted expression, it stores the local variables
-/// for the expression along with the expression. These variables
-/// contain their own data and are typed.
+/// Second, in an interpreted expression, it stores the local variables for
+/// the expression along with the expression. These variables contain their
+/// own data and are typed.
///
-/// Third, in a JIT-compiled expression, it stores the variables that
-/// the expression needs to have materialized and dematerialized at each
-/// execution. These do not contain their own data but are named and
-/// typed.
+/// Third, in a JIT-compiled expression, it stores the variables that the
+/// expression needs to have materialized and dematerialized at each
+/// execution. These do not contain their own data but are named and typed.
///
-/// This class supports all of these use cases using simple type
-/// polymorphism, and provides necessary support methods. Its interface
-/// is RTTI-neutral.
+/// This class supports all of these use cases using simple type polymorphism,
+/// and provides necessary support methods. Its interface is RTTI-neutral.
//----------------------------------------------------------------------
class ClangExpressionVariable : public ExpressionVariable {
public:
@@ -79,8 +77,8 @@ public:
lldb::ByteOrder byte_order, uint32_t addr_byte_size);
//----------------------------------------------------------------------
- /// Utility functions for dealing with ExpressionVariableLists in
- /// Clang-specific ways
+ /// Utility functions for dealing with ExpressionVariableLists in Clang-
+ /// specific ways
//----------------------------------------------------------------------
//----------------------------------------------------------------------
@@ -112,9 +110,9 @@ public:
}
//----------------------------------------------------------------------
- /// If the variable contains its own data, make a Value point at it.
- /// If \a exe_ctx in not NULL, the value will be resolved in with
- /// that execution context.
+ /// If the variable contains its own data, make a Value point at it. If \a
+ /// exe_ctx in not NULL, the value will be resolved in with that execution
+ /// context.
///
/// @param[in] value
/// The value to point at the data.
@@ -156,8 +154,8 @@ private:
public:
//----------------------------------------------------------------------
- /// Make this variable usable by the parser by allocating space for
- /// parser-specific variables
+ /// Make this variable usable by the parser by allocating space for parser-
+ /// specific variables
//----------------------------------------------------------------------
void EnableParserVars(uint64_t parser_id) {
m_parser_vars.insert(std::make_pair(parser_id, ParserVars()));
diff --git a/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp b/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
index a26ceda82d5f..e3e0ed49181e 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.cpp
@@ -101,14 +101,12 @@ ClangFunctionCaller::CompileFunction(lldb::ThreadSP thread_to_use_sp,
m_wrapper_function_text.append(" (*fn_ptr) (");
// Get the number of arguments. If we have a function type and it is
- // prototyped,
- // trust that, otherwise use the values we were given.
+ // prototyped, trust that, otherwise use the values we were given.
// FIXME: This will need to be extended to handle Variadic functions. We'll
// need
// to pull the defined arguments out of the function, then add the types from
- // the
- // arguments list for the variable arguments.
+ // the arguments list for the variable arguments.
uint32_t num_args = UINT32_MAX;
bool trust_function = false;
diff --git a/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h b/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
index 0596d8fde7b9..438cf0c713da 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangFunctionCaller.h
@@ -31,8 +31,8 @@ class ClangExpressionParser;
//----------------------------------------------------------------------
/// @class ClangFunctionCaller ClangFunctionCaller.h
-/// "lldb/Expression/ClangFunctionCaller.h"
-/// @brief Encapsulates a function that can be called.
+/// "lldb/Expression/ClangFunctionCaller.h" Encapsulates a function that can
+/// be called.
///
/// A given ClangFunctionCaller object can handle a single function signature.
/// Once constructed, it can set up any number of concurrent calls to
@@ -56,8 +56,8 @@ class ClangExpressionParser;
/// If you need to call the function on the thread plan stack, you can also
/// call InsertFunction() followed by GetThreadPlanToCallFunction().
///
-/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed
-/// a pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
+/// Any of the methods that take arg_addr_ptr or arg_addr_ref can be passed a
+/// pointer set to LLDB_INVALID_ADDRESS and new structure will be allocated
/// and its address returned in that variable.
///
/// Any of the methods that take arg_addr_ptr can be passed NULL, and the
@@ -79,8 +79,8 @@ class ClangFunctionCaller : public FunctionCaller {
ClangExpressionDeclMap *DeclMap() override { return NULL; }
//------------------------------------------------------------------
- /// Return the object that the parser should allow to access ASTs.
- /// May be NULL if the ASTs do not need to be transformed.
+ /// Return the object that the parser should allow to access ASTs. May be
+ /// NULL if the ASTs do not need to be transformed.
///
/// @param[in] passthrough
/// The ASTConsumer that the returned transformer should send
diff --git a/source/Plugins/ExpressionParser/Clang/ClangHost.cpp b/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
new file mode 100644
index 000000000000..4251d2ee75b9
--- /dev/null
+++ b/source/Plugins/ExpressionParser/Clang/ClangHost.cpp
@@ -0,0 +1,142 @@
+//===-- ClangHost.cpp -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "ClangHost.h"
+
+#include "clang/Basic/Version.h"
+#include "clang/Config/config.h"
+
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Threading.h"
+
+// Project includes
+#include "lldb/Host/HostInfo.h"
+#if !defined(_WIN32)
+#include "lldb/Host/posix/HostInfoPosix.h"
+#endif
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Log.h"
+
+#include <string>
+
+using namespace lldb_private;
+
+#if defined(_WIN32)
+static bool ComputeClangDirectory(FileSpec &file_spec) { return false; }
+#else
+static bool DefaultComputeClangDirectory(FileSpec &file_spec) {
+ return HostInfoPosix::ComputePathRelativeToLibrary(
+ file_spec, (llvm::Twine("/lib") + CLANG_LIBDIR_SUFFIX + "/clang/" +
+ CLANG_VERSION_STRING)
+ .str());
+}
+
+#if defined(__APPLE__)
+
+static bool VerifyClangPath(const llvm::Twine &clang_path) {
+ if (llvm::sys::fs::is_directory(clang_path))
+ return true;
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ if (log)
+ log->Printf("VerifyClangPath(): "
+ "failed to stat clang resource directory at \"%s\"",
+ clang_path.str().c_str());
+ return false;
+}
+
+bool lldb_private::ComputeClangDirectory(FileSpec &lldb_shlib_spec,
+ FileSpec &file_spec, bool verify) {
+ std::string raw_path = lldb_shlib_spec.GetPath();
+
+ auto rev_it = llvm::sys::path::rbegin(raw_path);
+ auto r_end = llvm::sys::path::rend(raw_path);
+
+ // Check for a Posix-style build of LLDB.
+ while (rev_it != r_end) {
+ if (*rev_it == "LLDB.framework")
+ break;
+ ++rev_it;
+ }
+
+ if (rev_it == r_end)
+ return DefaultComputeClangDirectory(file_spec);
+
+ // Inside Xcode and in Xcode toolchains LLDB is always in lockstep
+ // with the Swift compiler, so it can reuse its Clang resource
+ // directory. This allows LLDB and the Swift compiler to share the
+ // same Clang module cache.
+ llvm::SmallString<256> clang_path;
+ const char *swift_clang_resource_dir = "usr/lib/swift/clang";
+ auto parent = std::next(rev_it);
+ if (parent != r_end && *parent == "SharedFrameworks") {
+ // This is the top-level LLDB in the Xcode.app bundle.
+ // E.g., "Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A"
+ raw_path.resize(parent - r_end);
+ llvm::sys::path::append(clang_path, raw_path,
+ "Developer/Toolchains/XcodeDefault.xctoolchain",
+ swift_clang_resource_dir);
+ if (!verify || VerifyClangPath(clang_path)) {
+ file_spec.SetFile(clang_path.c_str(), true, FileSpec::Style::native);
+ return true;
+ }
+ } else if (parent != r_end && *parent == "PrivateFrameworks" &&
+ std::distance(parent, r_end) > 2) {
+ ++parent;
+ ++parent;
+ if (*parent == "System") {
+ // This is LLDB inside an Xcode toolchain.
+ // E.g., "Xcode.app/Contents/Developer/Toolchains/" \
+ // "My.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework"
+ raw_path.resize(parent - r_end);
+ llvm::sys::path::append(clang_path, raw_path, swift_clang_resource_dir);
+ if (!verify || VerifyClangPath(clang_path)) {
+ file_spec.SetFile(clang_path.c_str(), true, FileSpec::Style::native);
+ return true;
+ }
+ raw_path = lldb_shlib_spec.GetPath();
+ }
+ raw_path.resize(rev_it - r_end);
+ } else {
+ raw_path.resize(rev_it - r_end);
+ }
+
+ // Fall back to the Clang resource directory inside the framework.
+ raw_path.append("LLDB.framework/Resources/Clang");
+ file_spec.SetFile(raw_path.c_str(), true, FileSpec::Style::native);
+ return true;
+}
+
+static bool ComputeClangDirectory(FileSpec &file_spec) {
+ if (FileSpec lldb_file_spec = HostInfo::GetShlibDir())
+ return ComputeClangDirectory(lldb_file_spec, file_spec, true);
+ return false;
+}
+#else // __APPLE__
+
+// All non-Apple posix systems.
+static bool ComputeClangDirectory(FileSpec &file_spec) {
+ return DefaultComputeClangDirectory(file_spec);
+}
+#endif // __APPLE__
+#endif // _WIN32
+
+FileSpec lldb_private::GetClangResourceDir() {
+ static FileSpec g_cached_resource_dir;
+ static llvm::once_flag g_once_flag;
+ llvm::call_once(g_once_flag, []() {
+ ::ComputeClangDirectory(g_cached_resource_dir);
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
+ if (log)
+ log->Printf("GetClangResourceDir() => '%s'",
+ g_cached_resource_dir.GetPath().c_str());
+ });
+ return g_cached_resource_dir;
+}
diff --git a/source/Plugins/ExpressionParser/Clang/ClangHost.h b/source/Plugins/ExpressionParser/Clang/ClangHost.h
new file mode 100644
index 000000000000..4fe423adb1a5
--- /dev/null
+++ b/source/Plugins/ExpressionParser/Clang/ClangHost.h
@@ -0,0 +1,26 @@
+//===-- ClangHost.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGHOST_H
+#define LLDB_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGHOST_H
+
+namespace lldb_private {
+
+class FileSpec;
+
+#if defined(__APPLE__)
+bool ComputeClangDirectory(FileSpec &lldb_shlib_spec, FileSpec &file_spec,
+ bool verify);
+#endif
+
+FileSpec GetClangResourceDir();
+
+} // namespace lldb_private
+
+#endif
diff --git a/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp b/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
index b42ceb9afee8..665195f01774 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.cpp
@@ -25,8 +25,10 @@
#include "llvm/Support/Threading.h"
// Project includes
+#include "ClangHost.h"
#include "ClangModulesDeclVendor.h"
+#include "lldb/Core/ModuleList.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/CompileUnit.h"
@@ -39,9 +41,9 @@
using namespace lldb_private;
namespace {
-// Any Clang compiler requires a consumer for diagnostics. This one stores them
-// as strings
-// so we can provide them to the user in case a module failed to load.
+// Any Clang compiler requires a consumer for diagnostics. This one stores
+// them as strings so we can provide them to the user in case a module failed
+// to load.
class StoringDiagnosticConsumer : public clang::DiagnosticConsumer {
public:
StoringDiagnosticConsumer();
@@ -61,8 +63,7 @@ private:
};
// The private implementation of our ClangModulesDeclVendor. Contains all the
-// Clang state required
-// to load modules.
+// Clang state required to load modules.
class ClangModulesDeclVendorImpl : public ClangModulesDeclVendor {
public:
ClangModulesDeclVendorImpl(
@@ -144,18 +145,6 @@ void StoringDiagnosticConsumer::DumpDiagnostics(Stream &error_stream) {
}
}
-static FileSpec GetResourceDir() {
- static FileSpec g_cached_resource_dir;
-
- static llvm::once_flag g_once_flag;
-
- llvm::call_once(g_once_flag, []() {
- HostInfo::GetLLDBPath(lldb::ePathTypeClangDir, g_cached_resource_dir);
- });
-
- return g_cached_resource_dir;
-}
-
ClangModulesDeclVendor::ClangModulesDeclVendor() {}
ClangModulesDeclVendor::~ClangModulesDeclVendor() {}
@@ -168,7 +157,7 @@ ClangModulesDeclVendorImpl::ClangModulesDeclVendorImpl(
: m_diagnostics_engine(std::move(diagnostics_engine)),
m_compiler_invocation(std::move(compiler_invocation)),
m_compiler_instance(std::move(compiler_instance)),
- m_parser(std::move(parser)) {}
+ m_parser(std::move(parser)), m_origin_map() {}
void ClangModulesDeclVendorImpl::ReportModuleExportsHelper(
std::set<ClangModulesDeclVendor::ModuleID> &exports,
@@ -590,14 +579,11 @@ ClangModulesDeclVendor::Create(Target &target) {
// Add additional search paths with { "-I", path } or { "-F", path } here.
{
- llvm::SmallString<128> DefaultModuleCache;
- const bool erased_on_reboot = false;
- llvm::sys::path::system_temp_directory(erased_on_reboot,
- DefaultModuleCache);
- llvm::sys::path::append(DefaultModuleCache, "org.llvm.clang");
- llvm::sys::path::append(DefaultModuleCache, "ModuleCache");
+ llvm::SmallString<128> path;
+ auto props = ModuleList::GetGlobalModuleListProperties();
+ props.GetClangModulesCachePath().GetPath(path);
std::string module_cache_argument("-fmodules-cache-path=");
- module_cache_argument.append(DefaultModuleCache.str().str());
+ module_cache_argument.append(path.str());
compiler_invocation_arguments.push_back(module_cache_argument);
}
@@ -613,7 +599,7 @@ ClangModulesDeclVendor::Create(Target &target) {
}
{
- FileSpec clang_resource_dir = GetResourceDir();
+ FileSpec clang_resource_dir = GetClangResourceDir();
if (llvm::sys::fs::is_directory(clang_resource_dir.GetPath())) {
compiler_invocation_arguments.push_back("-resource-dir");
diff --git a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
index 8ebf78409a03..bb73d55a9a41 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.cpp
@@ -10,6 +10,7 @@
#include "ClangPersistentVariables.h"
#include "lldb/Core/Value.h"
+#include "lldb/Target/Target.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
@@ -52,14 +53,6 @@ void ClangPersistentVariables::RemovePersistentVariable(
m_next_persistent_variable_id--;
}
-ConstString ClangPersistentVariables::GetNextPersistentVariableName() {
- char name_cstr[256];
- ::snprintf(name_cstr, sizeof(name_cstr), "$%u",
- m_next_persistent_variable_id++);
- ConstString name(name_cstr);
- return name;
-}
-
void ClangPersistentVariables::RegisterPersistentDecl(const ConstString &name,
clang::NamedDecl *decl) {
m_persistent_decls.insert(
diff --git a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
index 16981a7fe14a..59126974616d 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
@@ -25,9 +25,8 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ClangPersistentVariables ClangPersistentVariables.h
-/// "lldb/Expression/ClangPersistentVariables.h"
-/// @brief Manages persistent values that need to be preserved between
-/// expression invocations.
+/// "lldb/Expression/ClangPersistentVariables.h" Manages persistent values
+/// that need to be preserved between expression invocations.
///
/// A list of variables that can be accessed and updated by any expression. See
/// ClangPersistentVariable for more discussion. Also provides an increasing,
@@ -54,16 +53,11 @@ public:
const CompilerType &compiler_type, lldb::ByteOrder byte_order,
uint32_t addr_byte_size) override;
- //----------------------------------------------------------------------
- /// Return the next entry in the sequence of strings "$0", "$1", ... for
- /// use naming persistent expression convenience variables.
- ///
- /// @return
- /// A string that contains the next persistent variable name.
- //----------------------------------------------------------------------
- ConstString GetNextPersistentVariableName() override;
-
void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
+ llvm::StringRef
+ GetPersistentVariablePrefix(bool is_error) const override {
+ return "$";
+ }
void RegisterPersistentDecl(const ConstString &name, clang::NamedDecl *decl);
diff --git a/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp b/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index 18fe8b49227b..2e61f704127a 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -65,7 +65,8 @@ ClangUserExpression::ClangUserExpression(
options),
m_type_system_helper(*m_target_wp.lock().get(),
options.GetExecutionPolicy() ==
- eExecutionPolicyTopLevel) {
+ eExecutionPolicyTopLevel),
+ m_result_delegate(exe_scope.CalculateTarget()) {
switch (m_language) {
case lldb::eLanguageTypeC_plus_plus:
m_allow_cxx = true;
@@ -195,12 +196,10 @@ void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) {
} else if (clang::FunctionDecl *function_decl =
ClangASTContext::DeclContextGetAsFunctionDecl(decl_context)) {
// We might also have a function that said in the debug information that it
- // captured an
- // object pointer. The best way to deal with getting to the ivars at
- // present is by pretending
- // that this is a method of a class in whatever runtime the debug info says
- // the object pointer
- // belongs to. Do that here.
+ // captured an object pointer. The best way to deal with getting to the
+ // ivars at present is by pretending that this is a method of a class in
+ // whatever runtime the debug info says the object pointer belongs to. Do
+ // that here.
ClangASTMetadata *metadata =
ClangASTContext::DeclContextGetMetaData(decl_context, function_decl);
@@ -290,10 +289,10 @@ void ClangUserExpression::ScanContext(ExecutionContext &exe_ctx, Status &err) {
}
}
-// This is a really nasty hack, meant to fix Objective-C expressions of the form
-// (int)[myArray count]. Right now, because the type information for count is
-// not available, [myArray count] returns id, which can't be directly cast to
-// int without causing a clang error.
+// This is a really nasty hack, meant to fix Objective-C expressions of the
+// form (int)[myArray count]. Right now, because the type information for
+// count is not available, [myArray count] returns id, which can't be directly
+// cast to int without causing a clang error.
static void ApplyObjcCastHack(std::string &expr) {
#define OBJC_CAST_HACK_FROM "(int)["
#define OBJC_CAST_HACK_TO "(int)(long long)["
@@ -308,17 +307,23 @@ static void ApplyObjcCastHack(std::string &expr) {
#undef OBJC_CAST_HACK_FROM
}
-bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
- ExecutionContext &exe_ctx,
- lldb_private::ExecutionPolicy execution_policy,
- bool keep_result_in_memory,
- bool generate_debug_info) {
- Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+namespace {
+// Utility guard that calls a callback when going out of scope.
+class OnExit {
+public:
+ typedef std::function<void(void)> Callback;
- Status err;
+ OnExit(Callback const &callback) : m_callback(callback) {}
- InstallContext(exe_ctx);
+ ~OnExit() { m_callback(); }
+
+private:
+ Callback m_callback;
+};
+} // namespace
+bool ClangUserExpression::SetupPersistentState(DiagnosticManager &diagnostic_manager,
+ ExecutionContext &exe_ctx) {
if (Target *target = exe_ctx.GetTargetPtr()) {
if (PersistentExpressionState *persistent_state =
target->GetPersistentExpressionStateForLanguage(
@@ -335,26 +340,15 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
"error: couldn't start parsing (no target)");
return false;
}
+ return true;
+}
- ScanContext(exe_ctx, err);
-
- if (!err.Success()) {
- diagnostic_manager.PutString(eDiagnosticSeverityWarning, err.AsCString());
- }
-
- ////////////////////////////////////
- // Generate the expression
- //
-
- ApplyObjcCastHack(m_expr_text);
-
- std::string prefix = m_expr_prefix;
-
+static void SetupDeclVendor(ExecutionContext &exe_ctx, Target *target) {
if (ClangModulesDeclVendor *decl_vendor =
- m_target->GetClangModulesDeclVendor()) {
+ target->GetClangModulesDeclVendor()) {
const ClangModulesDeclVendor::ModuleVector &hand_imported_modules =
llvm::cast<ClangPersistentVariables>(
- m_target->GetPersistentExpressionStateForLanguage(
+ target->GetPersistentExpressionStateForLanguage(
lldb::eLanguageTypeC))
->GetHandLoadedClangModules();
ClangModulesDeclVendor::ModuleVector modules_for_macros;
@@ -363,7 +357,7 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
modules_for_macros.push_back(module);
}
- if (m_target->GetEnableAutoImportClangModules()) {
+ if (target->GetEnableAutoImportClangModules()) {
if (StackFrame *frame = exe_ctx.GetFramePtr()) {
if (Block *block = frame->GetFrameBlock()) {
SymbolContext sc;
@@ -380,8 +374,13 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
}
}
}
+}
- lldb::LanguageType lang_type = lldb::eLanguageTypeUnknown;
+llvm::Optional<lldb::LanguageType> ClangUserExpression::GetLanguageForExpr(
+ DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) {
+ lldb::LanguageType lang_type = lldb::LanguageType::eLanguageTypeUnknown;
+
+ std::string prefix = m_expr_prefix;
if (m_options.GetExecutionPolicy() == eExecutionPolicyTopLevel) {
m_transformed_text = m_expr_text;
@@ -401,9 +400,50 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
exe_ctx)) {
diagnostic_manager.PutString(eDiagnosticSeverityError,
"couldn't construct expression body");
- return false;
+ return llvm::Optional<lldb::LanguageType>();
}
}
+ return lang_type;
+}
+
+bool ClangUserExpression::PrepareForParsing(
+ DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx) {
+ InstallContext(exe_ctx);
+
+ if (!SetupPersistentState(diagnostic_manager, exe_ctx))
+ return false;
+
+ Status err;
+ ScanContext(exe_ctx, err);
+
+ if (!err.Success()) {
+ diagnostic_manager.PutString(eDiagnosticSeverityWarning, err.AsCString());
+ }
+
+ ////////////////////////////////////
+ // Generate the expression
+ //
+
+ ApplyObjcCastHack(m_expr_text);
+
+ SetupDeclVendor(exe_ctx, m_target);
+ return true;
+}
+
+bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
+ ExecutionContext &exe_ctx,
+ lldb_private::ExecutionPolicy execution_policy,
+ bool keep_result_in_memory,
+ bool generate_debug_info) {
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+
+ if (!PrepareForParsing(diagnostic_manager, exe_ctx))
+ return false;
+
+ lldb::LanguageType lang_type = lldb::LanguageType::eLanguageTypeUnknown;
+ if (auto new_lang = GetLanguageForExpr(diagnostic_manager, exe_ctx)) {
+ lang_type = new_lang.getValue();
+ }
if (log)
log->Printf("Parsing the following code:\n%s", m_transformed_text.c_str());
@@ -427,28 +467,12 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
ResetDeclMap(exe_ctx, m_result_delegate, keep_result_in_memory);
- class OnExit {
- public:
- typedef std::function<void(void)> Callback;
-
- OnExit(Callback const &callback) : m_callback(callback) {}
-
- ~OnExit() { m_callback(); }
-
- private:
- Callback m_callback;
- };
-
OnExit on_exit([this]() { ResetDeclMap(); });
if (!DeclMap()->WillParse(exe_ctx, m_materializer_ap.get())) {
diagnostic_manager.PutString(
eDiagnosticSeverityError,
"current process state is unsuitable for expression parsing");
-
- ResetDeclMap(); // We are being careful here in the case of breakpoint
- // conditions.
-
return false;
}
@@ -463,17 +487,15 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
exe_scope = exe_ctx.GetTargetPtr();
// We use a shared pointer here so we can use the original parser - if it
- // succeeds
- // or the rewrite parser we might make if it fails. But the parser_sp will
- // never be empty.
+ // succeeds or the rewrite parser we might make if it fails. But the
+ // parser_sp will never be empty.
ClangExpressionParser parser(exe_scope, *this, generate_debug_info);
unsigned num_errors = parser.Parse(diagnostic_manager);
// Check here for FixItHints. If there are any try to apply the fixits and
- // set the fixed text in m_fixed_text
- // before returning an error.
+ // set the fixed text in m_fixed_text before returning an error.
if (num_errors) {
if (diagnostic_manager.HasFixIts()) {
if (parser.RewriteExpression(diagnostic_manager)) {
@@ -487,16 +509,12 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
fixed_expression.substr(fixed_start, fixed_end - fixed_start);
}
}
-
- ResetDeclMap(); // We are being careful here in the case of breakpoint
- // conditions.
-
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////
- // Prepare the output of the parser for execution, evaluating it statically if
- // possible
+ // Prepare the output of the parser for execution, evaluating it statically
+ // if possible
//
{
@@ -539,9 +557,9 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
register_execution_unit = true;
}
- // If there is more than one external function in the execution
- // unit, it needs to keep living even if it's not top level, because
- // the result could refer to that function.
+ // If there is more than one external function in the execution unit, it
+ // needs to keep living even if it's not top level, because the result
+ // could refer to that function.
if (m_execution_unit_sp->GetJittedFunctions().size() > 1) {
register_execution_unit = true;
@@ -568,10 +586,6 @@ bool ClangUserExpression::Parse(DiagnosticManager &diagnostic_manager,
}
}
- ResetDeclMap(); // Make this go away since we don't need any of its state
- // after parsing. This also gets rid of any
- // ClangASTImporter::Minions.
-
if (process && m_jit_start_addr != LLDB_INVALID_ADDRESS)
m_jit_process_wp = lldb::ProcessWP(process->shared_from_this());
return true;
@@ -667,10 +681,10 @@ void ClangUserExpression::ClangUserExpressionHelper::CommitPersistentDecls() {
}
}
-ClangUserExpression::ResultDelegate::ResultDelegate() {}
-
ConstString ClangUserExpression::ResultDelegate::GetName() {
- return m_persistent_state->GetNextPersistentVariableName();
+ auto prefix = m_persistent_state->GetPersistentVariablePrefix();
+ return m_persistent_state->GetNextPersistentVariableName(*m_target_sp,
+ prefix);
}
void ClangUserExpression::ResultDelegate::DidDematerialize(
diff --git a/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h b/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index 88a78798b657..ac363bf91747 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -35,13 +35,13 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ClangUserExpression ClangUserExpression.h
-/// "lldb/Expression/ClangUserExpression.h"
-/// @brief Encapsulates a single expression for use with Clang
+/// "lldb/Expression/ClangUserExpression.h" Encapsulates a single expression
+/// for use with Clang
///
/// LLDB uses expressions for various purposes, notably to call functions
/// and as a backend for the expr command. ClangUserExpression encapsulates
-/// the objects needed to parse and interpret or JIT an expression. It
-/// uses the Clang parser to produce LLVM IR from the expression.
+/// the objects needed to parse and interpret or JIT an expression. It uses
+/// the Clang parser to produce LLVM IR from the expression.
//----------------------------------------------------------------------
class ClangUserExpression : public LLVMUserExpression {
public:
@@ -69,8 +69,8 @@ public:
bool keep_result_in_memory);
//------------------------------------------------------------------
- /// Return the object that the parser should allow to access ASTs.
- /// May be NULL if the ASTs do not need to be transformed.
+ /// Return the object that the parser should allow to access ASTs. May be
+ /// NULL if the ASTs do not need to be transformed.
///
/// @param[in] passthrough
/// The ASTConsumer that the returned transformer should send
@@ -174,11 +174,18 @@ private:
lldb::addr_t struct_address,
DiagnosticManager &diagnostic_manager) override;
+ llvm::Optional<lldb::LanguageType> GetLanguageForExpr(
+ DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx);
+ bool SetupPersistentState(DiagnosticManager &diagnostic_manager,
+ ExecutionContext &exe_ctx);
+ bool PrepareForParsing(DiagnosticManager &diagnostic_manager,
+ ExecutionContext &exe_ctx);
+
ClangUserExpressionHelper m_type_system_helper;
class ResultDelegate : public Materializer::PersistentVariableDelegate {
public:
- ResultDelegate();
+ ResultDelegate(lldb::TargetSP target) : m_target_sp(target) {}
ConstString GetName() override;
void DidDematerialize(lldb::ExpressionVariableSP &variable) override;
@@ -188,6 +195,7 @@ private:
private:
PersistentExpressionState *m_persistent_state;
lldb::ExpressionVariableSP m_variable;
+ lldb::TargetSP m_target_sp;
};
ResultDelegate m_result_delegate;
diff --git a/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h b/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
index 80577199b818..a897a2b17087 100644
--- a/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
+++ b/source/Plugins/ExpressionParser/Clang/ClangUtilityFunction.h
@@ -29,15 +29,15 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class ClangUtilityFunction ClangUtilityFunction.h
-/// "lldb/Expression/ClangUtilityFunction.h"
-/// @brief Encapsulates a single expression for use with Clang
+/// "lldb/Expression/ClangUtilityFunction.h" Encapsulates a single expression
+/// for use with Clang
///
/// LLDB uses expressions for various purposes, notably to call functions
/// and as a backend for the expr command. ClangUtilityFunction encapsulates
/// a self-contained function meant to be used from other code. Utility
/// functions can perform error-checking for ClangUserExpressions, or can
-/// simply provide a way to push a function into the target for the debugger to
-/// call later on.
+/// simply provide a way to push a function into the target for the debugger
+/// to call later on.
//----------------------------------------------------------------------
class ClangUtilityFunction : public UtilityFunction {
public:
@@ -60,8 +60,8 @@ public:
void ResetDeclMap(ExecutionContext &exe_ctx, bool keep_result_in_memory);
//------------------------------------------------------------------
- /// Return the object that the parser should allow to access ASTs.
- /// May be NULL if the ASTs do not need to be transformed.
+ /// Return the object that the parser should allow to access ASTs. May be
+ /// NULL if the ASTs do not need to be transformed.
///
/// @param[in] passthrough
/// The ASTConsumer that the returned transformer should send
diff --git a/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp b/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
index 13f5657eedd8..e51c9ee07b9f 100644
--- a/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
+++ b/source/Plugins/ExpressionParser/Clang/IRForTarget.cpp
@@ -263,8 +263,7 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
}
// Get the next available result name from m_decl_map and create the
- // persistent
- // variable for it
+ // persistent variable for it
// If the result is an Lvalue, it is emitted as a pointer; see
// ASTResultSynthesizer::SynthesizeBodyResult.
@@ -345,9 +344,9 @@ bool IRForTarget::CreateResultVariable(llvm::Function &llvm_function) {
GlobalValue::ExternalLinkage, NULL, /* no initializer */
m_result_name.GetCString());
- // It's too late in compilation to create a new VarDecl for this, but we don't
- // need to. We point the metadata at the old VarDecl. This creates an odd
- // anomaly: a variable with a Value whose name is something like $0 and a
+ // It's too late in compilation to create a new VarDecl for this, but we
+ // don't need to. We point the metadata at the old VarDecl. This creates an
+ // odd anomaly: a variable with a Value whose name is something like $0 and a
// Decl whose name is $__lldb_expr_result. This condition is handled in
// ClangExpressionDeclMap::DoMaterialize, and the name of the variable is
// fixed up.
@@ -464,9 +463,7 @@ bool IRForTarget::RewriteObjCConstString(llvm::GlobalVariable *ns_str,
// CFAllocatorRef -> i8*
// UInt8 * -> i8*
// CFIndex -> long (i32 or i64, as appropriate; we ask the module for its
- // pointer size for now)
- // CFStringEncoding -> i32
- // Boolean -> i8
+ // pointer size for now) CFStringEncoding -> i32 Boolean -> i8
Type *arg_type_array[5];
@@ -801,9 +798,8 @@ bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
// Unpack the message name from the selector. In LLVM IR, an objc_msgSend
// gets represented as
//
- // %tmp = load i8** @"OBJC_SELECTOR_REFERENCES_" ; <i8*>
- // %call = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %obj, i8* %tmp, ...)
- // ; <i8*>
+ // %tmp = load i8** @"OBJC_SELECTOR_REFERENCES_" ; <i8*> %call = call
+ // i8* (i8*, i8*, ...)* @objc_msgSend(i8* %obj, i8* %tmp, ...) ; <i8*>
//
// where %obj is the object pointer and %tmp is the selector.
//
@@ -870,7 +866,8 @@ bool IRForTarget::RewriteObjCSelector(Instruction *selector_load) {
log->Printf("Found sel_registerName at 0x%" PRIx64,
sel_registerName_addr);
- // Build the function type: struct objc_selector *sel_registerName(uint8_t*)
+ // Build the function type: struct objc_selector
+ // *sel_registerName(uint8_t*)
// The below code would be "more correct," but in actuality what's required
// is uint8_t*
@@ -980,11 +977,10 @@ bool IRForTarget::RewriteObjCClassReference(Instruction *class_load) {
// %struct._objc_class** @OBJC_CLASS_REFERENCES_, align 4
//
// @"OBJC_CLASS_REFERENCES_ is a bitcast of a character array called
- // @OBJC_CLASS_NAME_.
- // @OBJC_CLASS_NAME contains the string.
+ // @OBJC_CLASS_NAME_. @OBJC_CLASS_NAME contains the string.
- // Find the pointer's initializer (a ConstantExpr with opcode BitCast)
- // and get the string from its target
+ // Find the pointer's initializer (a ConstantExpr with opcode BitCast) and
+ // get the string from its target
GlobalVariable *_objc_class_references_ =
dyn_cast<GlobalVariable>(load->getPointerOperand());
@@ -1159,8 +1155,8 @@ bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) {
GlobalValue::ExternalLinkage, NULL, /* no initializer */
alloc->getName().str());
- // What we're going to do here is make believe this was a regular old external
- // variable. That means we need to make the metadata valid.
+ // What we're going to do here is make believe this was a regular old
+ // external variable. That means we need to make the metadata valid.
NamedMDNode *named_metadata =
m_module->getOrInsertNamedMetadata("clang.global.decl.ptrs");
@@ -1175,8 +1171,7 @@ bool IRForTarget::RewritePersistentAlloc(llvm::Instruction *persistent_alloc) {
named_metadata->addOperand(persistent_global_md);
// Now, since the variable is a pointer variable, we will drop in a load of
- // that
- // pointer variable.
+ // that pointer variable.
LoadInst *persistent_load = new LoadInst(persistent_global, "", alloc);
@@ -1366,16 +1361,13 @@ bool IRForTarget::MaybeHandleVariable(Value *llvm_value_ptr) {
if (name[0] == '$') {
// The $__lldb_expr_result name indicates the return value has allocated
- // as
- // a static variable. Per the comment at
- // ASTResultSynthesizer::SynthesizeBodyResult,
- // accesses to this static variable need to be redirected to the result of
- // dereferencing
- // a pointer that is passed in as one of the arguments.
+ // as a static variable. Per the comment at
+ // ASTResultSynthesizer::SynthesizeBodyResult, accesses to this static
+ // variable need to be redirected to the result of dereferencing a
+ // pointer that is passed in as one of the arguments.
//
// Consequently, when reporting the size of the type, we report a pointer
- // type pointing
- // to the type of $__lldb_expr_result, not the type itself.
+ // type pointing to the type of $__lldb_expr_result, not the type itself.
//
// We also do this for any user-declared persistent variables.
compiler_type = compiler_type.GetPointerType();
@@ -1965,12 +1957,11 @@ bool IRForTarget::ReplaceVariables(Function &llvm_function) {
FunctionValueCache body_result_maker(
[this, name, offset_type, offset, argument,
value](llvm::Function *function) -> llvm::Value * {
- // Per the comment at ASTResultSynthesizer::SynthesizeBodyResult, in
- // cases where the result
- // variable is an rvalue, we have to synthesize a dereference of the
- // appropriate structure
- // entry in order to produce the static variable that the AST thinks
- // it is accessing.
+ // Per the comment at ASTResultSynthesizer::SynthesizeBodyResult,
+ // in cases where the result variable is an rvalue, we have to
+ // synthesize a dereference of the appropriate structure entry in
+ // order to produce the static variable that the AST thinks it is
+ // accessing.
llvm::Instruction *entry_instruction = llvm::cast<Instruction>(
m_entry_instruction_finder.GetValue(function));
@@ -2194,7 +2185,8 @@ bool IRForTarget::runOnModule(Module &llvm_module) {
if (log)
log->Printf("RewriteObjCSelectors() failed");
- // RewriteObjCSelectors() reports its own errors, so we don't do so here
+ // RewriteObjCSelectors() reports its own errors, so we don't do so
+ // here
return false;
}
diff --git a/source/Plugins/ExpressionParser/Clang/IRForTarget.h b/source/Plugins/ExpressionParser/Clang/IRForTarget.h
index 93ce8aa44eb2..c6c44b46023c 100644
--- a/source/Plugins/ExpressionParser/Clang/IRForTarget.h
+++ b/source/Plugins/ExpressionParser/Clang/IRForTarget.h
@@ -47,12 +47,11 @@ class IRMemoryMap;
//----------------------------------------------------------------------
/// @class IRForTarget IRForTarget.h "lldb/Expression/IRForTarget.h"
-/// @brief Transforms the IR for a function to run in the target
+/// Transforms the IR for a function to run in the target
///
-/// Once an expression has been parsed and converted to IR, it can run
-/// in two contexts: interpreted by LLDB as a DWARF location expression,
-/// or compiled by the JIT and inserted into the target process for
-/// execution.
+/// Once an expression has been parsed and converted to IR, it can run in two
+/// contexts: interpreted by LLDB as a DWARF location expression, or compiled
+/// by the JIT and inserted into the target process for execution.
///
/// IRForTarget makes the second possible, by applying a series of
/// transformations to the IR which make it relocatable. These
@@ -126,8 +125,7 @@ public:
//------------------------------------------------------------------
/// Interface stub
///
- /// Implementation of the llvm::ModulePass::assignPassManager()
- /// function.
+ /// Implementation of the llvm::ModulePass::assignPassManager() function.
//------------------------------------------------------------------
void assignPassManager(llvm::PMStack &pass_mgr_stack,
llvm::PassManagerType pass_mgr_type =
@@ -179,8 +177,8 @@ private:
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Get the address of a function, and a location to put the complete
- /// Value of the function if one is available.
+ /// Get the address of a function, and a location to put the complete Value
+ /// of the function if one is available.
///
/// @param[in] function
/// The function to find the location of.
@@ -204,13 +202,13 @@ private:
//------------------------------------------------------------------
/// A function-level pass to take the generated global value
- /// $__lldb_expr_result and make it into a persistent variable.
- /// Also see ASTResultSynthesizer.
+ /// $__lldb_expr_result and make it into a persistent variable. Also see
+ /// ASTResultSynthesizer.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Find the NamedDecl corresponding to a Value. This interface is
- /// exposed for the IR interpreter.
+ /// Find the NamedDecl corresponding to a Value. This interface is exposed
+ /// for the IR interpreter.
///
/// @param[in] module
/// The module containing metadata to search
@@ -230,8 +228,8 @@ private:
//------------------------------------------------------------------
/// Set the constant result variable m_const_result to the provided
- /// constant, assuming it can be evaluated. The result variable
- /// will be reset to NULL later if the expression has side effects.
+ /// constant, assuming it can be evaluated. The result variable will be
+ /// reset to NULL later if the expression has side effects.
///
/// @param[in] initializer
/// The constant initializer for the variable.
@@ -247,8 +245,8 @@ private:
lldb_private::TypeFromParser type);
//------------------------------------------------------------------
- /// If the IR represents a cast of a variable, set m_const_result
- /// to the result of the cast. The result variable will be reset to
+ /// If the IR represents a cast of a variable, set m_const_result to the
+ /// result of the cast. The result variable will be reset to
/// NULL latger if the expression has side effects.
///
/// @param[in] type
@@ -301,10 +299,9 @@ private:
/// rewrite them to use sel_registerName instead of statically allocated
/// selectors. The reason is that the selectors are created on the
/// assumption that the Objective-C runtime will scan the appropriate
- /// section and prepare them. This doesn't happen when code is copied
- /// into the target, though, and there's no easy way to induce the
- /// runtime to scan them. So instead we get our selectors from
- /// sel_registerName.
+ /// section and prepare them. This doesn't happen when code is copied into
+ /// the target, though, and there's no easy way to induce the runtime to
+ /// scan them. So instead we get our selectors from sel_registerName.
//------------------------------------------------------------------
//------------------------------------------------------------------
@@ -359,13 +356,12 @@ private:
//------------------------------------------------------------------
/// A basic block-level pass to find all newly-declared persistent
- /// variables and register them with the ClangExprDeclMap. This
- /// allows them to be materialized and dematerialized like normal
- /// external variables. Before transformation, these persistent
- /// variables look like normal locals, so they have an allocation.
- /// This pass excises these allocations and makes references look
- /// like external references where they will be resolved -- like all
- /// other external references -- by ResolveExternals().
+ /// variables and register them with the ClangExprDeclMap. This allows them
+ /// to be materialized and dematerialized like normal external variables.
+ /// Before transformation, these persistent variables look like normal
+ /// locals, so they have an allocation. This pass excises these allocations
+ /// and makes references look like external references where they will be
+ /// resolved -- like all other external references -- by ResolveExternals().
//------------------------------------------------------------------
//------------------------------------------------------------------
@@ -389,15 +385,14 @@ private:
//------------------------------------------------------------------
/// A function-level pass to find all external variables and functions
- /// used in the IR. Each found external variable is added to the
- /// struct, and each external function is resolved in place, its call
- /// replaced with a call to a function pointer whose value is the
- /// address of the function in the target process.
+ /// used in the IR. Each found external variable is added to the struct,
+ /// and each external function is resolved in place, its call replaced with
+ /// a call to a function pointer whose value is the address of the function
+ /// in the target process.
//------------------------------------------------------------------
//------------------------------------------------------------------
- /// Write an initializer to a memory array of assumed sufficient
- /// size.
+ /// Write an initializer to a memory array of assumed sufficient size.
///
/// @param[in] data
/// A pointer to the data to write to.
@@ -504,8 +499,8 @@ private:
//------------------------------------------------------------------
/// A basic block-level pass to excise guard variables from the code.
/// The result for the function is passed through Clang as a static
- /// variable. Static variables normally have guard variables to
- /// ensure that they are only initialized once.
+ /// variable. Static variables normally have guard variables to ensure that
+ /// they are only initialized once.
//------------------------------------------------------------------
//------------------------------------------------------------------
@@ -529,9 +524,9 @@ private:
//------------------------------------------------------------------
/// A function-level pass to make all external variable references
- /// point at the correct offsets from the void* passed into the
- /// function. ClangExpressionDeclMap::DoStructLayout() must be called
- /// beforehand, so that the offsets are valid.
+ /// point at the correct offsets from the void* passed into the function.
+ /// ClangExpressionDeclMap::DoStructLayout() must be called beforehand, so
+ /// that the offsets are valid.
//------------------------------------------------------------------
//------------------------------------------------------------------
@@ -583,7 +578,8 @@ private:
llvm::StoreInst *m_result_store; ///< If non-NULL, the store instruction that
///writes to the result variable. If
- /// m_has_side_effects is true, this is NULL.
+ /// m_has_side_effects is true, this is
+ /// NULL.
bool m_result_is_pointer; ///< True if the function's result in the AST is a
///pointer (see comments in
/// ASTResultSynthesizer::SynthesizeBodyResult)
@@ -594,18 +590,17 @@ private:
/// location of the static allocation.
//------------------------------------------------------------------
- /// UnfoldConstant operates on a constant [Old] which has just been
- /// replaced with a value [New]. We assume that new_value has
- /// been properly placed early in the function, in front of the
- /// first instruction in the entry basic block
- /// [FirstEntryInstruction].
+ /// UnfoldConstant operates on a constant [Old] which has just been replaced
+ /// with a value [New]. We assume that new_value has been properly placed
+ /// early in the function, in front of the first instruction in the entry
+ /// basic block [FirstEntryInstruction].
///
- /// UnfoldConstant reads through the uses of Old and replaces Old
- /// in those uses with New. Where those uses are constants, the
- /// function generates new instructions to compute the result of the
- /// new, non-constant expression and places them before
- /// FirstEntryInstruction. These instructions replace the constant
- /// uses, so UnfoldConstant calls itself recursively for those.
+ /// UnfoldConstant reads through the uses of Old and replaces Old in those
+ /// uses with New. Where those uses are constants, the function generates
+ /// new instructions to compute the result of the new, non-constant
+ /// expression and places them before FirstEntryInstruction. These
+ /// instructions replace the constant uses, so UnfoldConstant calls itself
+ /// recursively for those.
///
/// @param[in] llvm_function
/// The function currently being processed.
@@ -637,8 +632,8 @@ private:
lldb_private::Stream &error_stream);
//------------------------------------------------------------------
- /// Construct a reference to m_reloc_placeholder with a given type
- /// and offset. This typically happens after inserting data into
+ /// Construct a reference to m_reloc_placeholder with a given type and
+ /// offset. This typically happens after inserting data into
/// m_data_allocator.
///
/// @param[in] type
@@ -653,8 +648,8 @@ private:
llvm::Constant *BuildRelocation(llvm::Type *type, uint64_t offset);
//------------------------------------------------------------------
- /// Commit the allocation in m_data_allocator and use its final
- /// location to replace m_reloc_placeholder.
+ /// Commit the allocation in m_data_allocator and use its final location to
+ /// replace m_reloc_placeholder.
///
/// @param[in] module
/// The module that m_data_allocator resides in
diff --git a/source/Plugins/ExpressionParser/Go/GoParser.cpp b/source/Plugins/ExpressionParser/Go/GoParser.cpp
index 538bd05e25f8..9c845d02bca0 100644
--- a/source/Plugins/ExpressionParser/Go/GoParser.cpp
+++ b/source/Plugins/ExpressionParser/Go/GoParser.cpp
@@ -67,7 +67,9 @@ private:
size_t m_pos;
};
-GoParser::GoParser(const char *src) : m_lexer(src), m_pos(0), m_failed(false) {}
+GoParser::GoParser(const char *src)
+ : m_lexer(src), m_pos(0), m_last_tok(GoLexer::TOK_INVALID),
+ m_failed(false) {}
GoASTStmt *GoParser::Statement() {
Rule r("Statement", this);
@@ -437,8 +439,10 @@ GoASTExpr *GoParser::CompositeLit() {
if (!type)
return r.error();
GoASTCompositeLit *lit = LiteralValue();
- if (!lit)
+ if (!lit) {
+ delete type;
return r.error();
+ }
lit->SetType(type);
return lit;
}
@@ -546,6 +550,7 @@ GoASTExpr *GoParser::Arguments(GoASTExpr *e) {
GoASTExpr *GoParser::Conversion() {
Rule r("Conversion", this);
if (GoASTExpr *t = Type2()) {
+ std::unique_ptr<GoASTExpr> owner(t);
if (match(GoLexer::OP_LPAREN)) {
GoASTExpr *v = Expression();
if (!v)
@@ -555,6 +560,7 @@ GoASTExpr *GoParser::Conversion() {
return r.error();
GoASTCallExpr *call = new GoASTCallExpr(false);
call->SetFun(t);
+ owner.release();
call->AddArgs(v);
return call;
}
diff --git a/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp b/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
index f4b8cfbe03d4..3a10a1dc767a 100644
--- a/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
+++ b/source/Plugins/ExpressionParser/Go/GoUserExpression.cpp
@@ -171,12 +171,11 @@ private:
VariableSP FindGlobalVariable(TargetSP target, llvm::Twine name) {
ConstString fullname(name.str());
VariableList variable_list;
- const bool append = true;
if (!target) {
return nullptr;
}
- const uint32_t match_count = target->GetImages().FindGlobalVariables(
- fullname, append, 1, variable_list);
+ const uint32_t match_count =
+ target->GetImages().FindGlobalVariables(fullname, 1, variable_list);
if (match_count == 1) {
return variable_list.GetVariableAtIndex(0);
}
@@ -272,7 +271,8 @@ GoUserExpression::DoExecute(DiagnosticManager &diagnostic_manager,
PersistentExpressionState *pv =
target->GetPersistentExpressionStateForLanguage(eLanguageTypeGo);
if (pv != nullptr) {
- result->SetName(pv->GetNextPersistentVariableName());
+ result->SetName(pv->GetNextPersistentVariableName(
+ *target, pv->GetPersistentVariablePrefix()));
pv->AddVariable(result);
}
return lldb::eExpressionCompleted;
@@ -400,8 +400,7 @@ ValueObjectSP GoUserExpression::GoInterpreter::VisitIdent(const GoASTIdent *e) {
val = m_frame->GetValueObjectForFrameVariable(var_sp, m_use_dynamic);
else {
// When a variable is on the heap instead of the stack, go records a
- // variable
- // '&x' instead of 'x'.
+ // variable '&x' instead of 'x'.
var_sp = var_list_sp->FindVariable(ConstString("&" + varname));
if (var_sp) {
val = m_frame->GetValueObjectForFrameVariable(var_sp, m_use_dynamic);
@@ -651,15 +650,6 @@ ValueObjectSP GoUserExpression::GoInterpreter::VisitCallExpr(
GoPersistentExpressionState::GoPersistentExpressionState()
: PersistentExpressionState(eKindGo) {}
-ConstString GoPersistentExpressionState::GetNextPersistentVariableName() {
- char name_cstr[256];
- // We can't use the same variable format as clang.
- ::snprintf(name_cstr, sizeof(name_cstr), "$go%u",
- m_next_persistent_variable_id++);
- ConstString name(name_cstr);
- return name;
-}
-
void GoPersistentExpressionState::RemovePersistentVariable(
lldb::ExpressionVariableSP variable) {
RemoveVariable(variable);
diff --git a/source/Plugins/ExpressionParser/Go/GoUserExpression.h b/source/Plugins/ExpressionParser/Go/GoUserExpression.h
index 03ceb76b8431..e2839da9bfdd 100644
--- a/source/Plugins/ExpressionParser/Go/GoUserExpression.h
+++ b/source/Plugins/ExpressionParser/Go/GoUserExpression.h
@@ -29,8 +29,10 @@ class GoPersistentExpressionState : public PersistentExpressionState {
public:
GoPersistentExpressionState();
- ConstString GetNextPersistentVariableName() override;
-
+ llvm::StringRef
+ GetPersistentVariablePrefix(bool is_error) const override {
+ return "$go";
+ }
void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override;
lldb::addr_t LookupSymbol(const ConstString &name) override {
@@ -48,12 +50,12 @@ private:
//----------------------------------------------------------------------
/// @class GoUserExpression GoUserExpression.h
-/// "lldb/Expression/GoUserExpression.h"
-/// @brief Encapsulates a single expression for use with Go
+/// "lldb/Expression/GoUserExpression.h" Encapsulates a single expression for
+/// use with Go
///
/// LLDB uses expressions for various purposes, notably to call functions
-/// and as a backend for the expr command. GoUserExpression encapsulates
-/// the objects needed to parse and interpret an expression.
+/// and as a backend for the expr command. GoUserExpression encapsulates the
+/// objects needed to parse and interpret an expression.
//----------------------------------------------------------------------
class GoUserExpression : public UserExpression {
public:
diff --git a/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp b/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
index 262a7914d249..86744520ad63 100644
--- a/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
+++ b/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp
@@ -258,8 +258,8 @@ static bool GetARMDWARFRegisterInfo(unsigned reg_num, RegisterInfo &reg_info) {
reg_info.name = "f7";
break;
- // Intel wireless MMX general purpose registers 0 - 7
- // XScale accumulator register 0 - 7 (they do overlap with wCGR0 - wCGR7)
+ // Intel wireless MMX general purpose registers 0 - 7 XScale accumulator
+ // register 0 - 7 (they do overlap with wCGR0 - wCGR7)
case dwarf_wCGR0:
reg_info.name = "wCGR0/ACC0";
break;
@@ -901,7 +901,8 @@ uint32_t EmulateInstructionARM::GetFramePointerDWARFRegisterNumber() const {
}
// Push Multiple Registers stores multiple registers to the stack, storing to
-// consecutive memory locations ending just below the address in SP, and updates
+// consecutive memory locations ending just below the address in SP, and
+// updates
// SP to point to the start of the stored data.
bool EmulateInstructionARM::EmulatePUSH(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -1390,8 +1391,8 @@ bool EmulateInstructionARM::EmulateMOVRdImm(const uint32_t opcode,
uint32_t imm32; // the immediate value to be written to Rd
uint32_t carry =
0; // the carry bit after ThumbExpandImm_C or ARMExpandImm_C.
- // for setflags == false, this value is a don't care
- // initialized to 0 to silence the static analyzer
+ // for setflags == false, this value is a don't care initialized to
+ // 0 to silence the static analyzer
bool setflags;
switch (encoding) {
case eEncodingT1:
@@ -1473,12 +1474,11 @@ bool EmulateInstructionARM::EmulateMOVRdImm(const uint32_t opcode,
// MUL multiplies two register values. The least significant 32 bits of the
// result are written to the destination
// register. These 32 bits do not depend on whether the source register values
-// are considered to be signed values or
-// unsigned values.
+// are considered to be signed values or unsigned values.
//
// Optionally, it can update the condition flags based on the result. In the
-// Thumb instruction set, this option is
-// limited to only a few forms of the instruction.
+// Thumb instruction set, this option is limited to only a few forms of the
+// instruction.
bool EmulateInstructionARM::EmulateMUL(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -1606,8 +1606,8 @@ bool EmulateInstructionARM::EmulateMUL(const uint32_t opcode,
}
// Bitwise NOT (immediate) writes the bitwise inverse of an immediate value to
-// the destination register.
-// It can optionally update the condition flags based on the value.
+// the destination register. It can optionally update the condition flags based
+// on the value.
bool EmulateInstructionARM::EmulateMVNImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -1666,8 +1666,8 @@ bool EmulateInstructionARM::EmulateMVNImm(const uint32_t opcode,
}
// Bitwise NOT (register) writes the bitwise inverse of a register value to the
-// destination register.
-// It can optionally update the condition flags based on the result.
+// destination register. It can optionally update the condition flags based on
+// the result.
bool EmulateInstructionARM::EmulateMVNReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -2005,9 +2005,9 @@ bool EmulateInstructionARM::EmulateADDSPRm(const uint32_t opcode,
return true;
}
-// Branch with Link and Exchange Instruction Sets (immediate) calls a subroutine
-// at a PC-relative address, and changes instruction set from ARM to Thumb, or
-// from Thumb to ARM.
+// Branch with Link and Exchange Instruction Sets (immediate) calls a
+// subroutine at a PC-relative address, and changes instruction set from ARM to
+// Thumb, or from Thumb to ARM.
// BLX (immediate)
bool EmulateInstructionARM::EmulateBLXImmediate(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -2110,8 +2110,8 @@ bool EmulateInstructionARM::EmulateBLXImmediate(const uint32_t opcode,
return true;
}
-// Branch with Link and Exchange (register) calls a subroutine at an address and
-// instruction set specified by a register.
+// Branch with Link and Exchange (register) calls a subroutine at an address
+// and instruction set specified by a register.
// BLX (register)
bool EmulateInstructionARM::EmulateBLXRm(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -2220,9 +2220,8 @@ bool EmulateInstructionARM::EmulateBXRm(const uint32_t opcode,
}
// Branch and Exchange Jazelle attempts to change to Jazelle state. If the
-// attempt fails, it branches to an
-// address and instruction set specified by a register as though it were a BX
-// instruction.
+// attempt fails, it branches to an address and instruction set specified by a
+// register as though it were a BX instruction.
//
// TODO: Emulate Jazelle architecture?
// We currently assume that switching to Jazelle state fails, thus
@@ -2561,8 +2560,8 @@ bool EmulateInstructionARM::EmulateSTRRtSP(const uint32_t opcode,
return true;
}
-// Vector Push stores multiple extension registers to the stack.
-// It also updates SP to point to the start of the stored data.
+// Vector Push stores multiple extension registers to the stack. It also
+// updates SP to point to the start of the stored data.
bool EmulateInstructionARM::EmulateVPUSH(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -2577,7 +2576,8 @@ bool EmulateInstructionARM::EmulateVPUSH(const uint32_t opcode,
MemA[address,4] = S[d+r]; address = address+4;
else
for r = 0 to regs-1
- // Store as two word-aligned words in the correct order for current endianness.
+ // Store as two word-aligned words in the correct order for
+ // current endianness.
MemA[address,4] = if BigEndian() then D[d+r]<63:32> else D[d+r]<31:0>;
MemA[address+4,4] = if BigEndian() then D[d+r]<31:0> else D[d+r]<63:32>;
address = address+8;
@@ -2653,8 +2653,8 @@ bool EmulateInstructionARM::EmulateVPUSH(const uint32_t opcode,
return true;
}
-// Vector Pop loads multiple extension registers from the stack.
-// It also updates SP to point just above the loaded data.
+// Vector Pop loads multiple extension registers from the stack. It also
+// updates SP to point just above the loaded data.
bool EmulateInstructionARM::EmulateVPOP(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -2670,7 +2670,8 @@ bool EmulateInstructionARM::EmulateVPOP(const uint32_t opcode,
else
for r = 0 to regs-1
word1 = MemA[address,4]; word2 = MemA[address+4,4]; address = address+8;
- // Combine the word-aligned words in the correct order for current endianness.
+ // Combine the word-aligned words in the correct order for
+ // current endianness.
D[d+r] = if BigEndian() then word1:word2 else word2:word1;
}
#endif
@@ -2892,10 +2893,8 @@ bool EmulateInstructionARM::EmulateB(const uint32_t opcode,
}
// Compare and Branch on Nonzero and Compare and Branch on Zero compare the
-// value in a register with
-// zero and conditionally branch forward a constant value. They do not affect
-// the condition flags.
-// CBNZ, CBZ
+// value in a register with zero and conditionally branch forward a constant
+// value. They do not affect the condition flags. CBNZ, CBZ
bool EmulateInstructionARM::EmulateCB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -2938,8 +2937,8 @@ bool EmulateInstructionARM::EmulateCB(const uint32_t opcode,
return true;
}
-// Table Branch Byte causes a PC-relative forward branch using a table of single
-// byte offsets.
+// Table Branch Byte causes a PC-relative forward branch using a table of
+// single byte offsets.
// A base register provides a pointer to the table, and a second register
// supplies an index into the table.
// The branch length is twice the value of the byte returned from the table.
@@ -2948,8 +2947,8 @@ bool EmulateInstructionARM::EmulateCB(const uint32_t opcode,
// single halfword offsets.
// A base register provides a pointer to the table, and a second register
// supplies an index into the table.
-// The branch length is twice the value of the halfword returned from the table.
-// TBB, TBH
+// The branch length is twice the value of the halfword returned from the
+// table. TBB, TBH
bool EmulateInstructionARM::EmulateTB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -2984,9 +2983,8 @@ bool EmulateInstructionARM::EmulateTB(const uint32_t opcode,
return false;
}
- // Read the address of the table from the operand register Rn.
- // The PC can be used, in which case the table immediately follows this
- // instruction.
+ // Read the address of the table from the operand register Rn. The PC can
+ // be used, in which case the table immediately follows this instruction.
uint32_t base = ReadCoreReg(Rn, &success);
if (!success)
return false;
@@ -3023,8 +3021,8 @@ bool EmulateInstructionARM::EmulateTB(const uint32_t opcode,
}
// This instruction adds an immediate value to a register value, and writes the
-// result to the destination register.
-// It can optionally update the condition flags based on the result.
+// result to the destination register. It can optionally update the condition
+// flags based on the result.
bool EmulateInstructionARM::EmulateADDImmThumb(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3145,8 +3143,8 @@ bool EmulateInstructionARM::EmulateADDImmThumb(const uint32_t opcode,
}
// This instruction adds an immediate value to a register value, and writes the
-// result to the destination
-// register. It can optionally update the condition flags based on the result.
+// result to the destination register. It can optionally update the condition
+// flags based on the result.
bool EmulateInstructionARM::EmulateADDImmARM(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3210,9 +3208,8 @@ bool EmulateInstructionARM::EmulateADDImmARM(const uint32_t opcode,
}
// This instruction adds a register value and an optionally-shifted register
-// value, and writes the result
-// to the destination register. It can optionally update the condition flags
-// based on the result.
+// value, and writes the result to the destination register. It can optionally
+// update the condition flags based on the result.
bool EmulateInstructionARM::EmulateADDReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3350,8 +3347,8 @@ bool EmulateInstructionARM::EmulateCMNImm(const uint32_t opcode,
}
// Compare Negative (register) adds a register value and an optionally-shifted
-// register value.
-// It updates the condition flags based on the result, and discards the result.
+// register value. It updates the condition flags based on the result, and
+// discards the result.
bool EmulateInstructionARM::EmulateCMNReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3419,8 +3416,8 @@ bool EmulateInstructionARM::EmulateCMNReg(const uint32_t opcode,
return true;
}
-// Compare (immediate) subtracts an immediate value from a register value.
-// It updates the condition flags based on the result, and discards the result.
+// Compare (immediate) subtracts an immediate value from a register value. It
+// updates the condition flags based on the result, and discards the result.
bool EmulateInstructionARM::EmulateCMPImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3473,8 +3470,8 @@ bool EmulateInstructionARM::EmulateCMPImm(const uint32_t opcode,
}
// Compare (register) subtracts an optionally-shifted register value from a
-// register value.
-// It updates the condition flags based on the result, and discards the result.
+// register value. It updates the condition flags based on the result, and
+// discards the result.
bool EmulateInstructionARM::EmulateCMPReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3552,10 +3549,9 @@ bool EmulateInstructionARM::EmulateCMPReg(const uint32_t opcode,
}
// Arithmetic Shift Right (immediate) shifts a register value right by an
-// immediate number of bits,
-// shifting in copies of its sign bit, and writes the result to the destination
-// register. It can
-// optionally update the condition flags based on the result.
+// immediate number of bits, shifting in copies of its sign bit, and writes the
+// result to the destination register. It can optionally update the condition
+// flags based on the result.
bool EmulateInstructionARM::EmulateASRImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3577,13 +3573,11 @@ bool EmulateInstructionARM::EmulateASRImm(const uint32_t opcode,
return EmulateShiftImm(opcode, encoding, SRType_ASR);
}
-// Arithmetic Shift Right (register) shifts a register value right by a variable
-// number of bits,
-// shifting in copies of its sign bit, and writes the result to the destination
-// register.
-// The variable number of bits is read from the bottom byte of a register. It
-// can optionally update
-// the condition flags based on the result.
+// Arithmetic Shift Right (register) shifts a register value right by a
+// variable number of bits, shifting in copies of its sign bit, and writes the
+// result to the destination register. The variable number of bits is read from
+// the bottom byte of a register. It can optionally update the condition flags
+// based on the result.
bool EmulateInstructionARM::EmulateASRReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3604,10 +3598,8 @@ bool EmulateInstructionARM::EmulateASRReg(const uint32_t opcode,
}
// Logical Shift Left (immediate) shifts a register value left by an immediate
-// number of bits,
-// shifting in zeros, and writes the result to the destination register. It can
-// optionally
-// update the condition flags based on the result.
+// number of bits, shifting in zeros, and writes the result to the destination
+// register. It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateLSLImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3630,12 +3622,9 @@ bool EmulateInstructionARM::EmulateLSLImm(const uint32_t opcode,
}
// Logical Shift Left (register) shifts a register value left by a variable
-// number of bits,
-// shifting in zeros, and writes the result to the destination register. The
-// variable number
-// of bits is read from the bottom byte of a register. It can optionally update
-// the condition
-// flags based on the result.
+// number of bits, shifting in zeros, and writes the result to the destination
+// register. The variable number of bits is read from the bottom byte of a
+// register. It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateLSLReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3655,11 +3644,10 @@ bool EmulateInstructionARM::EmulateLSLReg(const uint32_t opcode,
return EmulateShiftReg(opcode, encoding, SRType_LSL);
}
-// Logical Shift Right (immediate) shifts a register value right by an immediate
-// number of bits,
-// shifting in zeros, and writes the result to the destination register. It can
-// optionally
-// update the condition flags based on the result.
+// Logical Shift Right (immediate) shifts a register value right by an
+// immediate number of bits, shifting in zeros, and writes the result to the
+// destination register. It can optionally update the condition flags based on
+// the result.
bool EmulateInstructionARM::EmulateLSRImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3682,12 +3670,9 @@ bool EmulateInstructionARM::EmulateLSRImm(const uint32_t opcode,
}
// Logical Shift Right (register) shifts a register value right by a variable
-// number of bits,
-// shifting in zeros, and writes the result to the destination register. The
-// variable number
-// of bits is read from the bottom byte of a register. It can optionally update
-// the condition
-// flags based on the result.
+// number of bits, shifting in zeros, and writes the result to the destination
+// register. The variable number of bits is read from the bottom byte of a
+// register. It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateLSRReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3708,10 +3693,9 @@ bool EmulateInstructionARM::EmulateLSRReg(const uint32_t opcode,
}
// Rotate Right (immediate) provides the value of the contents of a register
-// rotated by a constant value.
-// The bits that are rotated off the right end are inserted into the vacated bit
-// positions on the left.
-// It can optionally update the condition flags based on the result.
+// rotated by a constant value. The bits that are rotated off the right end are
+// inserted into the vacated bit positions on the left. It can optionally
+// update the condition flags based on the result.
bool EmulateInstructionARM::EmulateRORImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3734,12 +3718,10 @@ bool EmulateInstructionARM::EmulateRORImm(const uint32_t opcode,
}
// Rotate Right (register) provides the value of the contents of a register
-// rotated by a variable number of bits.
-// The bits that are rotated off the right end are inserted into the vacated bit
-// positions on the left.
-// The variable number of bits is read from the bottom byte of a register. It
-// can optionally update the condition
-// flags based on the result.
+// rotated by a variable number of bits. The bits that are rotated off the
+// right end are inserted into the vacated bit positions on the left. The
+// variable number of bits is read from the bottom byte of a register. It can
+// optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateRORReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -3760,8 +3742,7 @@ bool EmulateInstructionARM::EmulateRORReg(const uint32_t opcode,
}
// Rotate Right with Extend provides the value of the contents of a register
-// shifted right by one place,
-// with the carry flag shifted into bit [31].
+// shifted right by one place, with the carry flag shifted into bit [31].
//
// RRX can optionally update the condition flags based on the result.
// In that case, bit [0] is shifted into the carry flag.
@@ -3808,10 +3789,9 @@ bool EmulateInstructionARM::EmulateShiftImm(const uint32_t opcode,
// A8.6.139 ROR (immediate) -- Encoding T1
ARMEncoding use_encoding = encoding;
if (shift_type == SRType_ROR && use_encoding == eEncodingT1) {
- // Morph the T1 encoding from the ARM Architecture Manual into T2 encoding
- // to
- // have the same decoding of bit fields as the other Thumb2 shift
- // operations.
+ // Morph the T1 encoding from the ARM Architecture Manual into T2
+ // encoding to have the same decoding of bit fields as the other Thumb2
+ // shift operations.
use_encoding = eEncodingT2;
}
@@ -3950,8 +3930,7 @@ bool EmulateInstructionARM::EmulateShiftReg(const uint32_t opcode,
// LDM loads multiple registers from consecutive memory locations, using an
// address from a base register. Optionally the address just above the highest
-// of those locations
-// can be written back to the base register.
+// of those locations can be written back to the base register.
bool EmulateInstructionARM::EmulateLDM(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4093,8 +4072,8 @@ bool EmulateInstructionARM::EmulateLDM(const uint32_t opcode,
// LDMDA loads multiple registers from consecutive memory locations using an
// address from a base register.
// The consecutive memory locations end at this address and the address just
-// below the lowest of those locations
-// can optionally be written back to the base register.
+// below the lowest of those locations can optionally be written back to the
+// base register.
bool EmulateInstructionARM::EmulateLDMDA(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4210,8 +4189,8 @@ bool EmulateInstructionARM::EmulateLDMDA(const uint32_t opcode,
// LDMDB loads multiple registers from consecutive memory locations using an
// address from a base register. The
// consecutive memory locations end just below this address, and the address of
-// the lowest of those locations can
-// be optionally written back to the base register.
+// the lowest of those locations can be optionally written back to the base
+// register.
bool EmulateInstructionARM::EmulateLDMDB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4349,8 +4328,8 @@ bool EmulateInstructionARM::EmulateLDMDB(const uint32_t opcode,
// LDMIB loads multiple registers from consecutive memory locations using an
// address from a base register. The
// consecutive memory locations start just above this address, and thea ddress
-// of the last of those locations can
-// optinoally be written back to the base register.
+// of the last of those locations can optinoally be written back to the base
+// register.
bool EmulateInstructionARM::EmulateLDMIB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4461,8 +4440,7 @@ bool EmulateInstructionARM::EmulateLDMIB(const uint32_t opcode,
}
// Load Register (immediate) calculates an address from a base register value
-// and
-// an immediate offset, loads a word from memory, and writes to a register.
+// and an immediate offset, loads a word from memory, and writes to a register.
// LDR (immediate, Thumb)
bool EmulateInstructionARM::EmulateLDRRtRnImm(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -4625,8 +4603,8 @@ bool EmulateInstructionARM::EmulateLDRRtRnImm(const uint32_t opcode,
// STM (Store Multiple Increment After) stores multiple registers to consecutive
// memory locations using an address
// from a base register. The consecutive memory locations start at this
-// address, and the address just above the last
-// of those locations can optionally be written back to the base register.
+// address, and the address just above the last of those locations can
+// optionally be written back to the base register.
bool EmulateInstructionARM::EmulateSTM(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4775,10 +4753,10 @@ bool EmulateInstructionARM::EmulateSTM(const uint32_t opcode,
}
// STMDA (Store Multiple Decrement After) stores multiple registers to
-// consecutive memory locations using an address
-// from a base register. The consecutive memory locations end at this address,
-// and the address just below the lowest
-// of those locations can optionally be written back to the base register.
+// consecutive memory locations using an address from a base register. The
+// consecutive memory locations end at this address, and the address just below
+// the lowest of those locations can optionally be written back to the base
+// register.
bool EmulateInstructionARM::EmulateSTMDA(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -4897,10 +4875,10 @@ bool EmulateInstructionARM::EmulateSTMDA(const uint32_t opcode,
}
// STMDB (Store Multiple Decrement Before) stores multiple registers to
-// consecutive memory locations using an address
-// from a base register. The consecutive memory locations end just below this
-// address, and the address of the first of
-// those locations can optionally be written back to the base register.
+// consecutive memory locations using an address from a base register. The
+// consecutive memory locations end just below this address, and the address of
+// the first of those locations can optionally be written back to the base
+// register.
bool EmulateInstructionARM::EmulateSTMDB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5046,10 +5024,10 @@ bool EmulateInstructionARM::EmulateSTMDB(const uint32_t opcode,
}
// STMIB (Store Multiple Increment Before) stores multiple registers to
-// consecutive memory locations using an address
-// from a base register. The consecutive memory locations start just above this
-// address, and the address of the last
-// of those locations can optionally be written back to the base register.
+// consecutive memory locations using an address from a base register. The
+// consecutive memory locations start just above this address, and the address
+// of the last of those locations can optionally be written back to the base
+// register.
bool EmulateInstructionARM::EmulateSTMIB(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5337,8 +5315,8 @@ bool EmulateInstructionARM::EmulateSTRThumb(const uint32_t opcode,
// STR (Store Register) calculates an address from a base register value and an
// offset register value, stores a
-// word from a register to memory. The offset register value can optionally be
-// shifted.
+// word from a register to memory. The offset register value can optionally
+// be shifted.
bool EmulateInstructionARM::EmulateSTRRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5423,7 +5401,7 @@ bool EmulateInstructionARM::EmulateSTRRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -5664,8 +5642,8 @@ bool EmulateInstructionARM::EmulateSTRBThumb(const uint32_t opcode,
// STRH (register) calculates an address from a base register value and an
// offset register value, and stores a
-// halfword from a register to memory. The offset register value can be shifted
-// left by 0, 1, 2, or 3 bits.
+// halfword from a register to memory. The offset register value can be
+// shifted left by 0, 1, 2, or 3 bits.
bool EmulateInstructionARM::EmulateSTRHRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5745,7 +5723,7 @@ bool EmulateInstructionARM::EmulateSTRHRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -5842,10 +5820,8 @@ bool EmulateInstructionARM::EmulateSTRHRegister(const uint32_t opcode,
}
// Add with Carry (immediate) adds an immediate value and the carry flag value
-// to a register value,
-// and writes the result to the destination register. It can optionally update
-// the condition flags
-// based on the result.
+// to a register value, and writes the result to the destination register. It
+// can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateADCImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5911,11 +5887,10 @@ bool EmulateInstructionARM::EmulateADCImm(const uint32_t opcode,
return true;
}
-// Add with Carry (register) adds a register value, the carry flag value, and an
-// optionally-shifted
-// register value, and writes the result to the destination register. It can
-// optionally update the
-// condition flags based on the result.
+// Add with Carry (register) adds a register value, the carry flag value, and
+// an optionally-shifted register value, and writes the result to the
+// destination register. It can optionally update the condition flags based on
+// the result.
bool EmulateInstructionARM::EmulateADCReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -5999,9 +5974,8 @@ bool EmulateInstructionARM::EmulateADCReg(const uint32_t opcode,
return true;
}
-// This instruction adds an immediate value to the PC value to form a
-// PC-relative address,
-// and writes the result to the destination register.
+// This instruction adds an immediate value to the PC value to form a PC-
+// relative address, and writes the result to the destination register.
bool EmulateInstructionARM::EmulateADR(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -6063,9 +6037,8 @@ bool EmulateInstructionARM::EmulateADR(const uint32_t opcode,
}
// This instruction performs a bitwise AND of a register value and an immediate
-// value, and writes the result
-// to the destination register. It can optionally update the condition flags
-// based on the result.
+// value, and writes the result to the destination register. It can optionally
+// update the condition flags based on the result.
bool EmulateInstructionARM::EmulateANDImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -6139,10 +6112,8 @@ bool EmulateInstructionARM::EmulateANDImm(const uint32_t opcode,
}
// This instruction performs a bitwise AND of a register value and an
-// optionally-shifted register value,
-// and writes the result to the destination register. It can optionally update
-// the condition flags
-// based on the result.
+// optionally-shifted register value, and writes the result to the destination
+// register. It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateANDReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -6230,10 +6201,9 @@ bool EmulateInstructionARM::EmulateANDReg(const uint32_t opcode,
}
// Bitwise Bit Clear (immediate) performs a bitwise AND of a register value and
-// the complement of an
-// immediate value, and writes the result to the destination register. It can
-// optionally update the
-// condition flags based on the result.
+// the complement of an immediate value, and writes the result to the
+// destination register. It can optionally update the condition flags based on
+// the result.
bool EmulateInstructionARM::EmulateBICImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -6306,10 +6276,9 @@ bool EmulateInstructionARM::EmulateBICImm(const uint32_t opcode,
}
// Bitwise Bit Clear (register) performs a bitwise AND of a register value and
-// the complement of an
-// optionally-shifted register value, and writes the result to the destination
-// register.
-// It can optionally update the condition flags based on the result.
+// the complement of an optionally-shifted register value, and writes the
+// result to the destination register. It can optionally update the condition
+// flags based on the result.
bool EmulateInstructionARM::EmulateBICReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -6439,7 +6408,7 @@ bool EmulateInstructionARM::EmulateLDRImmediateARM(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
imm32 = Bits32(opcode, 11, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -6624,7 +6593,7 @@ bool EmulateInstructionARM::EmulateLDRRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -6661,8 +6630,8 @@ bool EmulateInstructionARM::EmulateLDRRegister(const uint32_t opcode,
addr_t offset_addr;
addr_t address;
- // offset = Shift(R[m], shift_t, shift_n, APSR.C); -- Note "The APSR is an
- // application level alias for the CPSR".
+ // offset = Shift(R[m], shift_t, shift_n, APSR.C); -- Note "The APSR is
+ // an application level alias for the CPSR".
addr_t offset =
Shift(Rm, shift_t, shift_n, Bit32(m_opcode_cpsr, APSR_C), &success);
if (!success)
@@ -6968,9 +6937,8 @@ bool EmulateInstructionARM::EmulateLDRBLiteral(const uint32_t opcode,
}
// LDRB (register) calculates an address from a base register value and an
-// offset rigister value, loads a byte from
-// memory, zero-extends it to form a 32-bit word, and writes it to a register.
-// The offset register value can
+// offset rigister value, loads a byte from memory, zero-extends it to form a
+// 32-bit word, and writes it to a register. The offset register value can
// optionally be shifted.
bool EmulateInstructionARM::EmulateLDRBRegister(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -7049,7 +7017,7 @@ bool EmulateInstructionARM::EmulateLDRBRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -7132,9 +7100,8 @@ bool EmulateInstructionARM::EmulateLDRBRegister(const uint32_t opcode,
// LDRH (immediate, Thumb) calculates an address from a base register value and
// an immediate offset, loads a
-// halfword from memory, zero-extends it to form a 32-bit word, and writes it to
-// a register. It can use offset,
-// post-indexed, or pre-indexed addressing.
+// halfword from memory, zero-extends it to form a 32-bit word, and writes it
+// to a register. It can use offset, post-indexed, or pre-indexed addressing.
bool EmulateInstructionARM::EmulateLDRHImmediate(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -7384,8 +7351,8 @@ bool EmulateInstructionARM::EmulateLDRHLiteral(const uint32_t opcode,
// LDRH (literal) calculates an address from a base register value and an offset
// register value, loads a halfword
// from memory, zero-extends it to form a 32-bit word, and writes it to a
-// register. The offset register value can
-// be shifted left by 0, 1, 2, or 3 bits.
+// register. The offset register value can be shifted left by 0, 1, 2, or 3
+// bits.
bool EmulateInstructionARM::EmulateLDRHRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -7464,7 +7431,7 @@ bool EmulateInstructionARM::EmulateLDRHRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -7561,8 +7528,7 @@ bool EmulateInstructionARM::EmulateLDRHRegister(const uint32_t opcode,
// LDRSB (immediate) calculates an address from a base register value and an
// immediate offset, loads a byte from
// memory, sign-extends it to form a 32-bit word, and writes it to a register.
-// It can use offset, post-indexed,
-// or pre-indexed addressing.
+// It can use offset, post-indexed, or pre-indexed addressing.
bool EmulateInstructionARM::EmulateLDRSBImmediate(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -7643,7 +7609,7 @@ bool EmulateInstructionARM::EmulateLDRSBImmediate(const uint32_t opcode,
uint32_t imm4L = Bits32(opcode, 3, 0);
imm32 = (imm4H << 4) | imm4L;
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -7799,8 +7765,7 @@ bool EmulateInstructionARM::EmulateLDRSBLiteral(const uint32_t opcode,
// LDRSB (register) calculates an address from a base register value and an
// offset register value, loadsa byte from
// memory, sign-extends it to form a 32-bit word, and writes it to a register.
-// The offset register value can be
-// shifted left by 0, 1, 2, or 3 bits.
+// The offset register value can be shifted left by 0, 1, 2, or 3 bits.
bool EmulateInstructionARM::EmulateLDRSBRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -7873,7 +7838,7 @@ bool EmulateInstructionARM::EmulateLDRSBRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -7960,8 +7925,7 @@ bool EmulateInstructionARM::EmulateLDRSBRegister(const uint32_t opcode,
// LDRSH (immediate) calculates an address from a base register value and an
// immediate offset, loads a halfword from
// memory, sign-extends it to form a 32-bit word, and writes it to a register.
-// It can use offset, post-indexed, or
-// pre-indexed addressing.
+// It can use offset, post-indexed, or pre-indexed addressing.
bool EmulateInstructionARM::EmulateLDRSHImmediate(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -8043,7 +8007,7 @@ bool EmulateInstructionARM::EmulateLDRSHImmediate(const uint32_t opcode,
uint32_t imm4L = Bits32(opcode, 3, 0);
imm32 = (imm4H << 4) | imm4L;
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -8220,8 +8184,8 @@ bool EmulateInstructionARM::EmulateLDRSHLiteral(const uint32_t opcode,
// LDRSH (register) calculates an address from a base register value and an
// offset register value, loads a halfword
// from memory, sign-extends it to form a 32-bit word, and writes it to a
-// register. The offset register value can be
-// shifted left by 0, 1, 2, or 3 bits.
+// register. The offset register value can be shifted left by 0, 1, 2, or 3
+// bits.
bool EmulateInstructionARM::EmulateLDRSHRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -8301,7 +8265,7 @@ bool EmulateInstructionARM::EmulateLDRSHRegister(const uint32_t opcode,
n = Bits32(opcode, 19, 16);
m = Bits32(opcode, 3, 0);
- // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
+ // index = (P == '1'); add = (U == '1'); wback = (P == '0') ||
// (W == '1');
index = BitIsSet(opcode, 24);
add = BitIsSet(opcode, 23);
@@ -8879,9 +8843,8 @@ bool EmulateInstructionARM::EmulateRFE(const uint32_t opcode,
}
// Bitwise Exclusive OR (immediate) performs a bitwise exclusive OR of a
-// register value and an immediate value,
-// and writes the result to the destination register. It can optionally update
-// the condition flags based on
+// register value and an immediate value, and writes the result to the
+// destination register. It can optionally update the condition flags based on
// the result.
bool EmulateInstructionARM::EmulateEORImm(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -8957,11 +8920,10 @@ bool EmulateInstructionARM::EmulateEORImm(const uint32_t opcode,
return true;
}
-// Bitwise Exclusive OR (register) performs a bitwise exclusive OR of a register
-// value and an
-// optionally-shifted register value, and writes the result to the destination
-// register.
-// It can optionally update the condition flags based on the result.
+// Bitwise Exclusive OR (register) performs a bitwise exclusive OR of a
+// register value and an optionally-shifted register value, and writes the
+// result to the destination register. It can optionally update the condition
+// flags based on the result.
bool EmulateInstructionARM::EmulateEORReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9051,10 +9013,8 @@ bool EmulateInstructionARM::EmulateEORReg(const uint32_t opcode,
}
// Bitwise OR (immediate) performs a bitwise (inclusive) OR of a register value
-// and an immediate value, and
-// writes the result to the destination register. It can optionally update the
-// condition flags based
-// on the result.
+// and an immediate value, and writes the result to the destination register.
+// It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateORRImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9128,10 +9088,9 @@ bool EmulateInstructionARM::EmulateORRImm(const uint32_t opcode,
}
// Bitwise OR (register) performs a bitwise (inclusive) OR of a register value
-// and an optionally-shifted register
-// value, and writes the result to the destination register. It can optionally
-// update the condition flags based
-// on the result.
+// and an optionally-shifted register value, and writes the result to the
+// destination register. It can optionally update the condition flags based on
+// the result.
bool EmulateInstructionARM::EmulateORRReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9219,9 +9178,8 @@ bool EmulateInstructionARM::EmulateORRReg(const uint32_t opcode,
}
// Reverse Subtract (immediate) subtracts a register value from an immediate
-// value, and writes the result to
-// the destination register. It can optionally update the condition flags based
-// on the result.
+// value, and writes the result to the destination register. It can optionally
+// update the condition flags based on the result.
bool EmulateInstructionARM::EmulateRSBImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9294,10 +9252,9 @@ bool EmulateInstructionARM::EmulateRSBImm(const uint32_t opcode,
return true;
}
-// Reverse Subtract (register) subtracts a register value from an
-// optionally-shifted register value, and writes the
-// result to the destination register. It can optionally update the condition
-// flags based on the result.
+// Reverse Subtract (register) subtracts a register value from an optionally-
+// shifted register value, and writes the result to the destination register.
+// It can optionally update the condition flags based on the result.
bool EmulateInstructionARM::EmulateRSBReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9377,10 +9334,9 @@ bool EmulateInstructionARM::EmulateRSBReg(const uint32_t opcode,
}
// Reverse Subtract with Carry (immediate) subtracts a register value and the
-// value of NOT (Carry flag) from
-// an immediate value, and writes the result to the destination register. It can
-// optionally update the condition
-// flags based on the result.
+// value of NOT (Carry flag) from an immediate value, and writes the result to
+// the destination register. It can optionally update the condition flags based
+// on the result.
bool EmulateInstructionARM::EmulateRSCImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9440,9 +9396,8 @@ bool EmulateInstructionARM::EmulateRSCImm(const uint32_t opcode,
}
// Reverse Subtract with Carry (register) subtracts a register value and the
-// value of NOT (Carry flag) from an
-// optionally-shifted register value, and writes the result to the destination
-// register. It can optionally update the
+// value of NOT (Carry flag) from an optionally-shifted register value, and
+// writes the result to the destination register. It can optionally update the
// condition flags based on the result.
bool EmulateInstructionARM::EmulateRSCReg(const uint32_t opcode,
const ARMEncoding encoding) {
@@ -9512,7 +9467,8 @@ bool EmulateInstructionARM::EmulateRSCReg(const uint32_t opcode,
return true;
}
-// Subtract with Carry (immediate) subtracts an immediate value and the value of
+// Subtract with Carry (immediate) subtracts an immediate value and the value
+// of
// NOT (Carry flag) from a register value, and writes the result to the
// destination register.
// It can optionally update the condition flags based on the result.
@@ -9582,8 +9538,8 @@ bool EmulateInstructionARM::EmulateSBCImm(const uint32_t opcode,
return true;
}
-// Subtract with Carry (register) subtracts an optionally-shifted register value
-// and the value of
+// Subtract with Carry (register) subtracts an optionally-shifted register
+// value and the value of
// NOT (Carry flag) from a register value, and writes the result to the
// destination register.
// It can optionally update the condition flags based on the result.
@@ -9672,9 +9628,8 @@ bool EmulateInstructionARM::EmulateSBCReg(const uint32_t opcode,
}
// This instruction subtracts an immediate value from a register value, and
-// writes the result
-// to the destination register. It can optionally update the condition flags
-// based on the result.
+// writes the result to the destination register. It can optionally update the
+// condition flags based on the result.
bool EmulateInstructionARM::EmulateSUBImmThumb(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9766,9 +9721,8 @@ bool EmulateInstructionARM::EmulateSUBImmThumb(const uint32_t opcode,
}
// This instruction subtracts an immediate value from a register value, and
-// writes the result
-// to the destination register. It can optionally update the condition flags
-// based on the result.
+// writes the result to the destination register. It can optionally update the
+// condition flags based on the result.
bool EmulateInstructionARM::EmulateSUBImmARM(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9844,9 +9798,8 @@ bool EmulateInstructionARM::EmulateSUBImmARM(const uint32_t opcode,
}
// Test Equivalence (immediate) performs a bitwise exclusive OR operation on a
-// register value and an
-// immediate value. It updates the condition flags based on the result, and
-// discards the result.
+// register value and an immediate value. It updates the condition flags based
+// on the result, and discards the result.
bool EmulateInstructionARM::EmulateTEQImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9904,10 +9857,8 @@ bool EmulateInstructionARM::EmulateTEQImm(const uint32_t opcode,
}
// Test Equivalence (register) performs a bitwise exclusive OR operation on a
-// register value and an
-// optionally-shifted register value. It updates the condition flags based on
-// the result, and discards
-// the result.
+// register value and an optionally-shifted register value. It updates the
+// condition flags based on the result, and discards the result.
bool EmulateInstructionARM::EmulateTEQReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -9972,8 +9923,8 @@ bool EmulateInstructionARM::EmulateTEQReg(const uint32_t opcode,
}
// Test (immediate) performs a bitwise AND operation on a register value and an
-// immediate value.
-// It updates the condition flags based on the result, and discards the result.
+// immediate value. It updates the condition flags based on the result, and
+// discards the result.
bool EmulateInstructionARM::EmulateTSTImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -10031,8 +9982,8 @@ bool EmulateInstructionARM::EmulateTSTImm(const uint32_t opcode,
}
// Test (register) performs a bitwise AND operation on a register value and an
-// optionally-shifted register value.
-// It updates the condition flags based on the result, and discards the result.
+// optionally-shifted register value. It updates the condition flags based on
+// the result, and discards the result.
bool EmulateInstructionARM::EmulateTSTReg(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -10403,9 +10354,8 @@ bool EmulateInstructionARM::EmulateSUBReg(const uint32_t opcode,
AddWithCarryResult res = AddWithCarry(Rn, ~shifted, 1);
- // if d == 15 then // Can only occur for ARM encoding
- // ALUWritePC(result); // setflags is always FALSE here
- // else
+ // if d == 15 then // Can only occur for ARM encoding ALUWritePC(result);
+ // // setflags is always FALSE here else
// R[d] = result;
// if setflags then
// APSR.N = result<31>;
@@ -10429,10 +10379,9 @@ bool EmulateInstructionARM::EmulateSUBReg(const uint32_t opcode,
}
// A8.6.202 STREX
-// Store Register Exclusive calculates an address from a base register value and
-// an immediate offset, and stores a
-// word from a register to memory if the executing processor has exclusive
-// access to the memory addressed.
+// Store Register Exclusive calculates an address from a base register value
+// and an immediate offset, and stores a word from a register to memory if the
+// executing processor has exclusive access to the memory addressed.
bool EmulateInstructionARM::EmulateSTREX(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -10457,7 +10406,8 @@ bool EmulateInstructionARM::EmulateSTREX(const uint32_t opcode,
switch (encoding) {
case eEncodingT1:
- // d = UInt(Rd); t = UInt(Rt); n = UInt(Rn); imm32 = ZeroExtend(imm8:'00',
+ // d = UInt(Rd); t = UInt(Rt); n = UInt(Rn); imm32 =
+ // ZeroExtend(imm8:'00',
// 32);
d = Bits32(opcode, 11, 8);
t = Bits32(opcode, 15, 12);
@@ -10511,9 +10461,9 @@ bool EmulateInstructionARM::EmulateSTREX(const uint32_t opcode,
context.type = eContextRegisterStore;
context.SetRegisterToRegisterPlusOffset(data_reg, base_reg, imm32);
- // if ExclusiveMonitorsPass(address,4) then
- // if (ExclusiveMonitorsPass (address, addr_byte_size)) -- For now, for the
- // sake of emulation, we will say this
+ // if ExclusiveMonitorsPass(address,4) then if (ExclusiveMonitorsPass
+ // (address, addr_byte_size)) -- For now, for the sake of emulation, we
+ // will say this
// always return
// true.
if (true) {
@@ -10742,9 +10692,9 @@ bool EmulateInstructionARM::EmulateSTRImmARM(const uint32_t opcode,
// A8.6.66 LDRD (immediate)
// Load Register Dual (immediate) calculates an address from a base register
-// value and an immediate offset, loads two
-// words from memory, and writes them to two registers. It can use offset,
-// post-indexed, or pre-indexed addressing.
+// value and an immediate offset, loads two words from memory, and writes them
+// to two registers. It can use offset, post-indexed, or pre-indexed
+// addressing.
bool EmulateInstructionARM::EmulateLDRDImmediate(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -10891,9 +10841,8 @@ bool EmulateInstructionARM::EmulateLDRDImmediate(const uint32_t opcode,
// A8.6.68 LDRD (register)
// Load Register Dual (register) calculates an address from a base register
-// value and a register offset, loads two
-// words from memory, and writes them to two registers. It can use offset,
-// post-indexed or pre-indexed addressing.
+// value and a register offset, loads two words from memory, and writes them to
+// two registers. It can use offset, post-indexed or pre-indexed addressing.
bool EmulateInstructionARM::EmulateLDRDRegister(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -11021,9 +10970,8 @@ bool EmulateInstructionARM::EmulateLDRDRegister(const uint32_t opcode,
// A8.6.200 STRD (immediate)
// Store Register Dual (immediate) calculates an address from a base register
-// value and an immediate offset, and
-// stores two words from two registers to memory. It can use offset,
-// post-indexed, or pre-indexed addressing.
+// value and an immediate offset, and stores two words from two registers to
+// memory. It can use offset, post-indexed, or pre-indexed addressing.
bool EmulateInstructionARM::EmulateSTRDImm(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -11314,8 +11262,7 @@ bool EmulateInstructionARM::EmulateSTRDReg(const uint32_t opcode,
// A8.6.319 VLDM
// Vector Load Multiple loads multiple extension registers from consecutive
-// memory locations using an address from
-// an ARM core register.
+// memory locations using an address from an ARM core register.
bool EmulateInstructionARM::EmulateVLDM(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -11328,7 +11275,8 @@ bool EmulateInstructionARM::EmulateVLDM(const uint32_t opcode,
S[d+r] = MemA[address,4]; address = address+4;
else
word1 = MemA[address,4]; word2 = MemA[address+4,4]; address = address+8;
- // Combine the word-aligned words in the correct order for current endianness.
+ // Combine the word-aligned words in the correct order for
+ // current endianness.
D[d+r] = if BigEndian() then word1:word2 else word2:word1;
#endif
@@ -11389,8 +11337,8 @@ bool EmulateInstructionARM::EmulateVLDM(const uint32_t opcode,
return false;
// // Remaining combinations are PUW = 010 (IA without !), 011 (IA with
- // !), 101 (DB with !)
- // single_regs = TRUE; add = (U == '1'); wback = (W == '1'); d =
+ // !), 101 (DB with !) single_regs = TRUE; add = (U == '1'); wback = (W
+ // == '1'); d =
// UInt(Vd:D); n = UInt(Rn);
single_regs = true;
add = BitIsSet(opcode, 23);
@@ -11519,7 +11467,8 @@ bool EmulateInstructionARM::EmulateVSTM(const uint32_t opcode,
if single_regs then
MemA[address,4] = S[d+r]; address = address+4;
else
- // Store as two word-aligned words in the correct order for current endianness.
+ // Store as two word-aligned words in the correct order for
+ // current endianness.
MemA[address,4] = if BigEndian() then D[d+r]<63:32> else D[d+r]<31:0>;
MemA[address+4,4] = if BigEndian() then D[d+r]<31:0> else D[d+r]<63:32>;
address = address+8;
@@ -11582,8 +11531,8 @@ bool EmulateInstructionARM::EmulateVSTM(const uint32_t opcode,
return false;
// // Remaining combinations are PUW = 010 (IA without !), 011 (IA with
- // !), 101 (DB with !)
- // single_regs = TRUE; add = (U == '1'); wback = (W == '1'); d =
+ // !), 101 (DB with !) single_regs = TRUE; add = (U == '1'); wback = (W
+ // == '1'); d =
// UInt(Vd:D); n = UInt(Rn);
single_regs = true;
add = BitIsSet(opcode, 23);
@@ -11665,8 +11614,7 @@ bool EmulateInstructionARM::EmulateVSTM(const uint32_t opcode,
address = address + 4;
} else {
// // Store as two word-aligned words in the correct order for current
- // endianness.
- // MemA[address,4] = if BigEndian() then D[d+r]<63:32> else
+ // endianness. MemA[address,4] = if BigEndian() then D[d+r]<63:32> else
// D[d+r]<31:0>;
// MemA[address+4,4] = if BigEndian() then D[d+r]<31:0> else
// D[d+r]<63:32>;
@@ -11712,8 +11660,7 @@ bool EmulateInstructionARM::EmulateVSTM(const uint32_t opcode,
// A8.6.320
// This instruction loads a single extension register from memory, using an
-// address from an ARM core register, with
-// an optional offset.
+// address from an ARM core register, with an optional offset.
bool EmulateInstructionARM::EmulateVLDR(const uint32_t opcode,
ARMEncoding encoding) {
#if 0
@@ -11725,7 +11672,8 @@ bool EmulateInstructionARM::EmulateVLDR(const uint32_t opcode,
S[d] = MemA[address,4];
else
word1 = MemA[address,4]; word2 = MemA[address+4,4];
- // Combine the word-aligned words in the correct order for current endianness.
+ // Combine the word-aligned words in the correct order for current
+ // endianness.
D[d] = if BigEndian() then word1:word2 else word2:word1;
#endif
@@ -11839,8 +11787,7 @@ bool EmulateInstructionARM::EmulateVLDR(const uint32_t opcode,
// A8.6.400 VSTR
// This instruction stores a signle extension register to memory, using an
-// address from an ARM core register, with an
-// optional offset.
+// address from an ARM core register, with an optional offset.
bool EmulateInstructionARM::EmulateVSTR(const uint32_t opcode,
ARMEncoding encoding) {
#if 0
@@ -11850,7 +11797,8 @@ bool EmulateInstructionARM::EmulateVSTR(const uint32_t opcode,
if single_reg then
MemA[address,4] = S[d];
else
- // Store as two word-aligned words in the correct order for current endianness.
+ // Store as two word-aligned words in the correct order for current
+ // endianness.
MemA[address,4] = if BigEndian() then D[d]<63:32> else D[d]<31:0>;
MemA[address+4,4] = if BigEndian() then D[d]<31:0> else D[d]<63:32>;
#endif
@@ -11970,10 +11918,9 @@ bool EmulateInstructionARM::EmulateVSTR(const uint32_t opcode,
return true;
}
-// A8.6.307 VLDI1 (multiple single elements)
-// This instruction loads elements from memory into one, two, three or four
-// registers, without de-interleaving. Every
-// element of each register is loaded.
+// A8.6.307 VLDI1 (multiple single elements) This instruction loads elements
+// from memory into one, two, three or four registers, without de-interleaving.
+// Every element of each register is loaded.
bool EmulateInstructionARM::EmulateVLD1Multiple(const uint32_t opcode,
ARMEncoding encoding) {
#if 0
@@ -12291,8 +12238,7 @@ bool EmulateInstructionARM::EmulateVLD1Single(const uint32_t opcode,
if (index > 0)
mask = mask | Bits64(all_ones, (index * esize) - 1,
0); // add 1's to the right of where 'element' goes.
- // now mask should be 0's where element goes & 1's
- // everywhere else.
+ // now mask should be 0's where element goes & 1's everywhere else.
uint64_t masked_reg =
reg_data & mask; // Take original reg value & zero out 'element' bits
@@ -12307,10 +12253,9 @@ bool EmulateInstructionARM::EmulateVLD1Single(const uint32_t opcode,
return true;
}
-// A8.6.391 VST1 (multiple single elements)
-// Vector Store (multiple single elements) stores elements to memory from one,
-// two, three, or four registers, without
-// interleaving. Every element of each register is stored.
+// A8.6.391 VST1 (multiple single elements) Vector Store (multiple single
+// elements) stores elements to memory from one, two, three, or four registers,
+// without interleaving. Every element of each register is stored.
bool EmulateInstructionARM::EmulateVST1Multiple(const uint32_t opcode,
ARMEncoding encoding) {
#if 0
@@ -12465,8 +12410,8 @@ bool EmulateInstructionARM::EmulateVST1Multiple(const uint32_t opcode,
return true;
}
-// A8.6.392 VST1 (single element from one lane)
-// This instruction stores one element to memory from one element of a register.
+// A8.6.392 VST1 (single element from one lane) This instruction stores one
+// element to memory from one element of a register.
bool EmulateInstructionARM::EmulateVST1Single(const uint32_t opcode,
ARMEncoding encoding) {
#if 0
@@ -12624,9 +12569,8 @@ bool EmulateInstructionARM::EmulateVST1Single(const uint32_t opcode,
return true;
}
-// A8.6.309 VLD1 (single element to all lanes)
-// This instruction loads one element from memory into every element of one or
-// two vectors.
+// A8.6.309 VLD1 (single element to all lanes) This instruction loads one
+// element from memory into every element of one or two vectors.
bool EmulateInstructionARM::EmulateVLD1SingleAll(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -12754,11 +12698,10 @@ bool EmulateInstructionARM::EmulateVLD1SingleAll(const uint32_t opcode,
return true;
}
-// B6.2.13 SUBS PC, LR and related instructions
-// The SUBS PC, LR, #<const? instruction provides an exception return without
-// the use of the stack. It subtracts the
-// immediate constant from the LR, branches to the resulting address, and also
-// copies the SPSR to the CPSR.
+// B6.2.13 SUBS PC, LR and related instructions The SUBS PC, LR, #<const?
+// instruction provides an exception return without the use of the stack. It
+// subtracts the immediate constant from the LR, branches to the resulting
+// address, and also copies the SPSR to the CPSR.
bool EmulateInstructionARM::EmulateSUBSPcLrEtc(const uint32_t opcode,
const ARMEncoding encoding) {
#if 0
@@ -12797,9 +12740,9 @@ bool EmulateInstructionARM::EmulateSUBSPcLrEtc(const uint32_t opcode,
switch (encoding) {
case eEncodingT1:
- // if CurrentInstrSet() == InstrSet_ThumbEE then UNPREDICTABLE
- // n = 14; imm32 = ZeroExtend(imm8, 32); register_form = FALSE; opcode =
- // '0010'; // = SUB
+ // if CurrentInstrSet() == InstrSet_ThumbEE then UNPREDICTABLE n = 14;
+ // imm32 = ZeroExtend(imm8, 32); register_form = FALSE; opcode = '0010';
+ // // = SUB
n = 14;
imm32 = Bits32(opcode, 7, 0);
register_form = false;
@@ -12924,8 +12867,7 @@ bool EmulateInstructionARM::EmulateSUBSPcLrEtc(const uint32_t opcode,
// CPSRWriteByInstr(SPSR[], '1111', TRUE);
// For now, in emulation mode, we don't have access to the SPSR, so we will
- // use the CPSR instead, and hope for
- // the best.
+ // use the CPSR instead, and hope for the best.
uint32_t spsr =
ReadRegisterUnsigned(eRegisterKindDWARF, dwarf_cpsr, 0, &success);
if (!success)
@@ -13946,10 +13888,10 @@ bool EmulateInstructionARM::SetInstruction(const Opcode &insn_opcode,
else {
AddressClass addr_class = inst_addr.GetAddressClass();
- if ((addr_class == eAddressClassCode) ||
- (addr_class == eAddressClassUnknown))
+ if ((addr_class == AddressClass::eCode) ||
+ (addr_class == AddressClass::eUnknown))
m_opcode_mode = eModeARM;
- else if (addr_class == eAddressClassCodeAlternateISA)
+ else if (addr_class == AddressClass::eCodeAlternateISA)
m_opcode_mode = eModeThumb;
else
return false;
@@ -13999,8 +13941,7 @@ bool EmulateInstructionARM::ReadInstruction() {
if (!m_ignore_conditions) {
// If we are not ignoreing the conditions then init the it session from
- // the current
- // value of cpsr.
+ // the current value of cpsr.
uint32_t it = (Bits32(m_opcode_cpsr, 15, 10) << 2) |
Bits32(m_opcode_cpsr, 26, 25);
if (it != 0)
@@ -14018,10 +13959,9 @@ bool EmulateInstructionARM::ReadInstruction() {
uint32_t EmulateInstructionARM::ArchVersion() { return m_arm_isa; }
bool EmulateInstructionARM::ConditionPassed(const uint32_t opcode) {
- // If we are ignoring conditions, then always return true.
- // this allows us to iterate over disassembly code and still
- // emulate an instruction even if we don't have all the right
- // bits set in the CPSR register...
+ // If we are ignoring conditions, then always return true. this allows us to
+ // iterate over disassembly code and still emulate an instruction even if we
+ // don't have all the right bits set in the CPSR register...
if (m_ignore_conditions)
return true;
@@ -14225,8 +14165,8 @@ bool EmulateInstructionARM::BranchWritePC(const Context &context,
bool EmulateInstructionARM::BXWritePC(Context &context, uint32_t addr) {
addr_t target;
// If the CPSR is changed due to switching between ARM and Thumb ISETSTATE,
- // we want to record it and issue a WriteRegister callback so the clients
- // can track the mode changes accordingly.
+ // we want to record it and issue a WriteRegister callback so the clients can
+ // track the mode changes accordingly.
bool cpsr_changed = false;
if (BitIsSet(addr, 0)) {
@@ -14307,9 +14247,10 @@ bool EmulateInstructionARM::UnalignedSupport() {
return (ArchVersion() >= ARMv7);
}
-// The main addition and subtraction instructions can produce status information
-// about both unsigned carry and signed overflow conditions. This status
-// information can be used to synthesize multi-word additions and subtractions.
+// The main addition and subtraction instructions can produce status
+// information about both unsigned carry and signed overflow conditions. This
+// status information can be used to synthesize multi-word additions and
+// subtractions.
EmulateInstructionARM::AddWithCarryResult
EmulateInstructionARM::AddWithCarry(uint32_t x, uint32_t y, uint8_t carry_in) {
uint32_t result;
@@ -14364,9 +14305,8 @@ uint32_t EmulateInstructionARM::ReadCoreReg(uint32_t num, bool *success) {
uint32_t val = ReadRegisterUnsigned(reg_kind, reg_num, 0, success);
// When executing an ARM instruction , PC reads as the address of the current
- // instruction plus 8.
- // When executing a Thumb instruction , PC reads as the address of the current
- // instruction plus 4.
+ // instruction plus 8. When executing a Thumb instruction , PC reads as the
+ // address of the current instruction plus 4.
if (num == 15) {
if (CurrentInstrSet() == eModeARM)
val += 8;
@@ -14434,8 +14374,7 @@ bool EmulateInstructionARM::WriteCoreRegOptionalFlags(
// APSR.V = overflow
//
// Default arguments can be specified for carry and overflow parameters, which
-// means
-// not to update the respective flags.
+// means not to update the respective flags.
bool EmulateInstructionARM::WriteFlags(Context &context, const uint32_t result,
const uint32_t carry,
const uint32_t overflow) {
@@ -14496,8 +14435,7 @@ bool EmulateInstructionARM::EvaluateInstruction(uint32_t evaluate_options) {
}
// Advance the ITSTATE bits to their values for the next instruction if we
- // haven't just executed
- // an IT instruction what initialized it.
+ // haven't just executed an IT instruction what initialized it.
if (m_opcode_mode == eModeThumb && m_it_session.InITBlock() &&
(opcode_data == nullptr ||
opcode_data->callback != &EmulateInstructionARM::EmulateIT))
diff --git a/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp b/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
index d882108c25f4..2f484ab5ea97 100644
--- a/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
+++ b/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
@@ -76,19 +76,6 @@ static inline bool IsZero(uint64_t x) { return x == 0; }
static inline uint64_t NOT(uint64_t x) { return ~x; }
-#if 0
-// LSL_C()
-// =======
-static inline uint64_t
-LSL_C (uint64_t x, integer shift, bool &carry_out)
-{
- assert (shift >= 0);
- uint64_t result = x << shift;
- carry_out = ((1ull << (64-1)) >> (shift - 1)) != 0;
- return result;
-}
-#endif
-
// LSL()
// =====
@@ -519,8 +506,8 @@ bool EmulateInstructionARM64::UsingAArch32() {
bool EmulateInstructionARM64::BranchTo(const Context &context, uint32_t N,
addr_t target) {
#if 0
- // Set program counter to a new address, with a branch reason hint
- // for possible use by hardware fetching the next instruction.
+ // Set program counter to a new address, with a branch reason hint for
+ // possible use by hardware fetching the next instruction.
BranchTo(bits(N) target, BranchType branch_type)
Hint_Branch(branch_type);
if N == 32 then
@@ -568,10 +555,9 @@ bool EmulateInstructionARM64::BranchTo(const Context &context, uint32_t N,
}
bool EmulateInstructionARM64::ConditionHolds(const uint32_t cond) {
- // If we are ignoring conditions, then always return true.
- // this allows us to iterate over disassembly code and still
- // emulate an instruction even if we don't have all the right
- // bits set in the CPSR register...
+ // If we are ignoring conditions, then always return true. this allows us to
+ // iterate over disassembly code and still emulate an instruction even if we
+ // don't have all the right bits set in the CPSR register...
if (m_ignore_conditions)
return true;
@@ -703,8 +689,8 @@ bool EmulateInstructionARM64::EmulateADDSUBImm(const uint32_t opcode) {
context.SetRegisterPlusOffset(reg_info_Rn, imm);
if (n == GetFramePointerRegisterNumber() && d == gpr_sp_arm64 && !setflags) {
- // 'mov sp, fp' - common epilogue instruction, CFA is now in terms
- // of the stack pointer, instead of frame pointer.
+ // 'mov sp, fp' - common epilogue instruction, CFA is now in terms of the
+ // stack pointer, instead of frame pointer.
context.type = EmulateInstruction::eContextRestoreStackPointer;
} else if ((n == gpr_sp_arm64 || n == GetFramePointerRegisterNumber()) &&
d == gpr_sp_arm64 && !setflags) {
diff --git a/source/Plugins/Instruction/CMakeLists.txt b/source/Plugins/Instruction/CMakeLists.txt
index 78f2f64cf1ab..89771e8f46d1 100644
--- a/source/Plugins/Instruction/CMakeLists.txt
+++ b/source/Plugins/Instruction/CMakeLists.txt
@@ -2,3 +2,4 @@ add_subdirectory(ARM)
add_subdirectory(ARM64)
add_subdirectory(MIPS)
add_subdirectory(MIPS64)
+add_subdirectory(PPC64)
diff --git a/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp b/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
index db3d8fc1b8ca..b65747e12890 100644
--- a/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
+++ b/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
@@ -1015,7 +1015,7 @@ bool EmulateInstructionMIPS::SetInstruction(const Opcode &insn_opcode,
m_use_alt_disaasm = false;
if (EmulateInstruction::SetInstruction(insn_opcode, inst_addr, target)) {
- if (inst_addr.GetAddressClass() == eAddressClassCodeAlternateISA) {
+ if (inst_addr.GetAddressClass() == AddressClass::eCodeAlternateISA) {
Status error;
lldb::addr_t load_addr = LLDB_INVALID_ADDRESS;
@@ -1044,7 +1044,7 @@ bool EmulateInstructionMIPS::SetInstruction(const Opcode &insn_opcode,
return true;
} else {
/*
- * If the address class is not eAddressClassCodeAlternateISA then
+ * If the address class is not AddressClass::eCodeAlternateISA then
* the function is not microMIPS. In this case instruction size is
* always 4 bytes.
*/
@@ -1205,13 +1205,10 @@ bool EmulateInstructionMIPS::Emulate_ADDiu(llvm::MCInst &insn) {
dst = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
src = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
- // If immediate value is greater then 2^16 - 1 then clang generate
- // LUI, ADDIU, SUBU instructions in prolog.
- // Example
- // lui $1, 0x2
- // addiu $1, $1, -0x5920
- // subu $sp, $sp, $1
- // In this case, ADDIU dst and src will be same and not equal to sp
+ // If immediate value is greater then 2^16 - 1 then clang generate LUI,
+ // ADDIU, SUBU instructions in prolog. Example lui $1, 0x2 addiu $1, $1,
+ // -0x5920 subu $sp, $sp, $1 In this case, ADDIU dst and src will be same
+ // and not equal to sp
if (dst == src) {
Context context;
@@ -1545,8 +1542,8 @@ bool EmulateInstructionMIPS::Emulate_SWSP(llvm::MCInst &insn) {
address = address + imm5;
// We use bad_vaddr_context to store base address which is used by H/W
- // watchpoint
- // Set the bad_vaddr register with base address used in the instruction
+ // watchpoint Set the bad_vaddr register with base address used in the
+ // instruction
bad_vaddr_context.type = eContextInvalid;
WriteRegisterUnsigned(bad_vaddr_context, eRegisterKindDWARF, dwarf_bad_mips,
address);
@@ -1682,8 +1679,8 @@ bool EmulateInstructionMIPS::Emulate_LWSP(llvm::MCInst &insn) {
base_address = base_address + imm5;
// We use bad_vaddr_context to store base address which is used by H/W
- // watchpoint
- // Set the bad_vaddr register with base address used in the instruction
+ // watchpoint Set the bad_vaddr register with base address used in the
+ // instruction
bad_vaddr_context.type = eContextInvalid;
WriteRegisterUnsigned(bad_vaddr_context, eRegisterKindDWARF, dwarf_bad_mips,
base_address);
diff --git a/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp b/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
index d298589afdd9..5af12ad141aa 100644
--- a/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
+++ b/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
@@ -1091,13 +1091,10 @@ bool EmulateInstructionMIPS64::Emulate_DADDiu(llvm::MCInst &insn) {
dst = m_reg_info->getEncodingValue(insn.getOperand(0).getReg());
src = m_reg_info->getEncodingValue(insn.getOperand(1).getReg());
- // If immediate is greater than 2^16 - 1 then clang generate
- // LUI, (D)ADDIU,(D)SUBU instructions in prolog.
- // Example
- // lui $1, 0x2
- // daddiu $1, $1, -0x5920
- // dsubu $sp, $sp, $1
- // In this case, (D)ADDIU dst and src will be same and not equal to sp
+ // If immediate is greater than 2^16 - 1 then clang generate LUI,
+ // (D)ADDIU,(D)SUBU instructions in prolog. Example lui $1, 0x2 daddiu $1,
+ // $1, -0x5920 dsubu $sp, $sp, $1 In this case, (D)ADDIU dst and src will be
+ // same and not equal to sp
if (dst == src) {
Context context;
diff --git a/source/Plugins/Instruction/PPC64/CMakeLists.txt b/source/Plugins/Instruction/PPC64/CMakeLists.txt
new file mode 100644
index 000000000000..0926433fc77c
--- /dev/null
+++ b/source/Plugins/Instruction/PPC64/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_lldb_library(lldbPluginInstructionPPC64 PLUGIN
+ EmulateInstructionPPC64.cpp
+
+ LINK_LIBS
+ lldbCore
+ lldbInterpreter
+ lldbSymbol
+ lldbPluginProcessUtility
+ LINK_COMPONENTS
+ Support
+ )
diff --git a/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp b/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
new file mode 100644
index 000000000000..f3a9ca570a4a
--- /dev/null
+++ b/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.cpp
@@ -0,0 +1,406 @@
+//===-- EmulateInstructionPPC64.cpp ------------------------------*- C++-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "EmulateInstructionPPC64.h"
+
+#include <stdlib.h>
+
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Symbol/UnwindPlan.h"
+#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/ConstString.h"
+
+#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+
+#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
+#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
+
+#include "Plugins/Process/Utility/InstructionUtils.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+EmulateInstructionPPC64::EmulateInstructionPPC64(const ArchSpec &arch)
+ : EmulateInstruction(arch) {}
+
+void EmulateInstructionPPC64::Initialize() {
+ PluginManager::RegisterPlugin(GetPluginNameStatic(),
+ GetPluginDescriptionStatic(), CreateInstance);
+}
+
+void EmulateInstructionPPC64::Terminate() {
+ PluginManager::UnregisterPlugin(CreateInstance);
+}
+
+ConstString EmulateInstructionPPC64::GetPluginNameStatic() {
+ ConstString g_plugin_name("lldb.emulate-instruction.ppc64");
+ return g_plugin_name;
+}
+
+ConstString EmulateInstructionPPC64::GetPluginName() {
+ static ConstString g_plugin_name("EmulateInstructionPPC64");
+ return g_plugin_name;
+}
+
+const char *EmulateInstructionPPC64::GetPluginDescriptionStatic() {
+ return "Emulate instructions for the PPC64 architecture.";
+}
+
+EmulateInstruction *
+EmulateInstructionPPC64::CreateInstance(const ArchSpec &arch,
+ InstructionType inst_type) {
+ if (EmulateInstructionPPC64::SupportsEmulatingInstructionsOfTypeStatic(
+ inst_type)) {
+ if (arch.GetTriple().getArch() == llvm::Triple::ppc64 ||
+ arch.GetTriple().getArch() == llvm::Triple::ppc64le) {
+ return new EmulateInstructionPPC64(arch);
+ }
+ }
+
+ return nullptr;
+}
+
+bool EmulateInstructionPPC64::SetTargetTriple(const ArchSpec &arch) {
+ if (arch.GetTriple().getArch() == llvm::Triple::ppc64)
+ return true;
+ else if (arch.GetTriple().getArch() == llvm::Triple::ppc64le)
+ return true;
+
+ return false;
+}
+
+static bool LLDBTableGetRegisterInfo(uint32_t reg_num, RegisterInfo &reg_info) {
+ if (reg_num >= llvm::array_lengthof(g_register_infos_ppc64le))
+ return false;
+ reg_info = g_register_infos_ppc64le[reg_num];
+ return true;
+}
+
+bool EmulateInstructionPPC64::GetRegisterInfo(RegisterKind reg_kind,
+ uint32_t reg_num,
+ RegisterInfo &reg_info) {
+ if (reg_kind == eRegisterKindGeneric) {
+ switch (reg_num) {
+ case LLDB_REGNUM_GENERIC_PC:
+ reg_kind = eRegisterKindLLDB;
+ reg_num = gpr_pc_ppc64le;
+ break;
+ case LLDB_REGNUM_GENERIC_SP:
+ reg_kind = eRegisterKindLLDB;
+ reg_num = gpr_r1_ppc64le;
+ break;
+ case LLDB_REGNUM_GENERIC_RA:
+ reg_kind = eRegisterKindLLDB;
+ reg_num = gpr_lr_ppc64le;
+ break;
+ case LLDB_REGNUM_GENERIC_FLAGS:
+ reg_kind = eRegisterKindLLDB;
+ reg_num = gpr_cr_ppc64le;
+ break;
+
+ default:
+ return false;
+ }
+ }
+
+ if (reg_kind == eRegisterKindLLDB)
+ return LLDBTableGetRegisterInfo(reg_num, reg_info);
+ return false;
+}
+
+bool EmulateInstructionPPC64::ReadInstruction() {
+ bool success = false;
+ m_addr = ReadRegisterUnsigned(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC,
+ LLDB_INVALID_ADDRESS, &success);
+ if (success) {
+ Context ctx;
+ ctx.type = eContextReadOpcode;
+ ctx.SetNoArgs();
+ m_opcode.SetOpcode32(ReadMemoryUnsigned(ctx, m_addr, 4, 0, &success),
+ GetByteOrder());
+ }
+ if (!success)
+ m_addr = LLDB_INVALID_ADDRESS;
+ return success;
+}
+
+bool EmulateInstructionPPC64::CreateFunctionEntryUnwind(
+ UnwindPlan &unwind_plan) {
+ unwind_plan.Clear();
+ unwind_plan.SetRegisterKind(eRegisterKindLLDB);
+
+ UnwindPlan::RowSP row(new UnwindPlan::Row);
+
+ // Our previous Call Frame Address is the stack pointer
+ row->GetCFAValue().SetIsRegisterPlusOffset(gpr_r1_ppc64le, 0);
+
+ unwind_plan.AppendRow(row);
+ unwind_plan.SetSourceName("EmulateInstructionPPC64");
+ unwind_plan.SetSourcedFromCompiler(eLazyBoolNo);
+ unwind_plan.SetUnwindPlanValidAtAllInstructions(eLazyBoolYes);
+ unwind_plan.SetReturnAddressRegister(gpr_lr_ppc64le);
+ return true;
+}
+
+EmulateInstructionPPC64::Opcode *
+EmulateInstructionPPC64::GetOpcodeForInstruction(uint32_t opcode) {
+ static EmulateInstructionPPC64::Opcode g_opcodes[] = {
+ {0xfc0007ff, 0x7c0002a6, &EmulateInstructionPPC64::EmulateMFSPR,
+ "mfspr RT, SPR"},
+ {0xfc000003, 0xf8000000, &EmulateInstructionPPC64::EmulateSTD,
+ "std RS, DS(RA)"},
+ {0xfc000003, 0xf8000001, &EmulateInstructionPPC64::EmulateSTD,
+ "stdu RS, DS(RA)"},
+ {0xfc0007fe, 0x7c000378, &EmulateInstructionPPC64::EmulateOR,
+ "or RA, RS, RB"},
+ {0xfc000000, 0x38000000, &EmulateInstructionPPC64::EmulateADDI,
+ "addi RT, RA, SI"},
+ {0xfc000003, 0xe8000000, &EmulateInstructionPPC64::EmulateLD,
+ "ld RT, DS(RA)"}};
+ static const size_t k_num_ppc_opcodes = llvm::array_lengthof(g_opcodes);
+
+ for (size_t i = 0; i < k_num_ppc_opcodes; ++i) {
+ if ((g_opcodes[i].mask & opcode) == g_opcodes[i].value)
+ return &g_opcodes[i];
+ }
+ return nullptr;
+}
+
+bool EmulateInstructionPPC64::EvaluateInstruction(uint32_t evaluate_options) {
+ const uint32_t opcode = m_opcode.GetOpcode32();
+ // LLDB_LOG(log, "PPC64::EvaluateInstruction: opcode={0:X+8}", opcode);
+ Opcode *opcode_data = GetOpcodeForInstruction(opcode);
+ if (!opcode_data)
+ return false;
+
+ // LLDB_LOG(log, "PPC64::EvaluateInstruction: {0}", opcode_data->name);
+ const bool auto_advance_pc =
+ evaluate_options & eEmulateInstructionOptionAutoAdvancePC;
+
+ bool success = false;
+
+ uint32_t orig_pc_value = 0;
+ if (auto_advance_pc) {
+ orig_pc_value =
+ ReadRegisterUnsigned(eRegisterKindLLDB, gpr_pc_ppc64le, 0, &success);
+ if (!success)
+ return false;
+ }
+
+ // Call the Emulate... function.
+ success = (this->*opcode_data->callback)(opcode);
+ if (!success)
+ return false;
+
+ if (auto_advance_pc) {
+ uint32_t new_pc_value =
+ ReadRegisterUnsigned(eRegisterKindLLDB, gpr_pc_ppc64le, 0, &success);
+ if (!success)
+ return false;
+
+ if (auto_advance_pc && (new_pc_value == orig_pc_value)) {
+ EmulateInstruction::Context context;
+ context.type = eContextAdvancePC;
+ context.SetNoArgs();
+ if (!WriteRegisterUnsigned(context, eRegisterKindLLDB, gpr_pc_ppc64le,
+ orig_pc_value + 4))
+ return false;
+ }
+ }
+ return true;
+}
+
+bool EmulateInstructionPPC64::EmulateMFSPR(uint32_t opcode) {
+ uint32_t rt = Bits32(opcode, 25, 21);
+ uint32_t spr = Bits32(opcode, 20, 11);
+
+ enum { SPR_LR = 0x100 };
+
+ // For now, we're only insterested in 'mfspr r0, lr'
+ if (rt != gpr_r0_ppc64le || spr != SPR_LR)
+ return false;
+
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
+ LLDB_LOG(log, "EmulateMFSPR: {0:X+8}: mfspr r0, lr", m_addr);
+
+ bool success;
+ uint64_t lr =
+ ReadRegisterUnsigned(eRegisterKindLLDB, gpr_lr_ppc64le, 0, &success);
+ if (!success)
+ return false;
+ Context context;
+ context.type = eContextWriteRegisterRandomBits;
+ WriteRegisterUnsigned(context, eRegisterKindLLDB, gpr_r0_ppc64le, lr);
+ LLDB_LOG(log, "EmulateMFSPR: success!");
+ return true;
+}
+
+bool EmulateInstructionPPC64::EmulateLD(uint32_t opcode) {
+ uint32_t rt = Bits32(opcode, 25, 21);
+ uint32_t ra = Bits32(opcode, 20, 16);
+ uint32_t ds = Bits32(opcode, 15, 2);
+
+ int32_t ids = llvm::SignExtend32<16>(ds << 2);
+
+ // For now, tracking only loads from 0(r1) to r1 (0(r1) is the ABI defined
+ // location to save previous SP)
+ if (ra != gpr_r1_ppc64le || rt != gpr_r1_ppc64le || ids != 0)
+ return false;
+
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
+ LLDB_LOG(log, "EmulateLD: {0:X+8}: ld r{1}, {2}(r{3})", m_addr, rt, ids, ra);
+
+ RegisterInfo r1_info;
+ if (!GetRegisterInfo(eRegisterKindLLDB, gpr_r1_ppc64le, r1_info))
+ return false;
+
+ // restore SP
+ Context ctx;
+ ctx.type = eContextRestoreStackPointer;
+ ctx.SetRegisterToRegisterPlusOffset(r1_info, r1_info, 0);
+
+ WriteRegisterUnsigned(ctx, eRegisterKindLLDB, gpr_r1_ppc64le, 0);
+ LLDB_LOG(log, "EmulateLD: success!");
+ return true;
+}
+
+bool EmulateInstructionPPC64::EmulateSTD(uint32_t opcode) {
+ uint32_t rs = Bits32(opcode, 25, 21);
+ uint32_t ra = Bits32(opcode, 20, 16);
+ uint32_t ds = Bits32(opcode, 15, 2);
+ uint32_t u = Bits32(opcode, 1, 0);
+
+ // For now, tracking only stores to r1
+ if (ra != gpr_r1_ppc64le)
+ return false;
+ // ... and only stores of SP, FP and LR (moved into r0 by a previous mfspr)
+ if (rs != gpr_r1_ppc64le && rs != gpr_r31_ppc64le && rs != gpr_r30_ppc64le &&
+ rs != gpr_r0_ppc64le)
+ return false;
+
+ bool success;
+ uint64_t rs_val = ReadRegisterUnsigned(eRegisterKindLLDB, rs, 0, &success);
+ if (!success)
+ return false;
+
+ int32_t ids = llvm::SignExtend32<16>(ds << 2);
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
+ LLDB_LOG(log, "EmulateSTD: {0:X+8}: std{1} r{2}, {3}(r{4})", m_addr,
+ u ? "u" : "", rs, ids, ra);
+
+ // Make sure that r0 is really holding LR value (this won't catch unlikely
+ // cases, such as r0 being overwritten after mfspr)
+ uint32_t rs_num = rs;
+ if (rs == gpr_r0_ppc64le) {
+ uint64_t lr =
+ ReadRegisterUnsigned(eRegisterKindLLDB, gpr_lr_ppc64le, 0, &success);
+ if (!success || lr != rs_val)
+ return false;
+ rs_num = gpr_lr_ppc64le;
+ }
+
+ // set context
+ RegisterInfo rs_info;
+ if (!GetRegisterInfo(eRegisterKindLLDB, rs_num, rs_info))
+ return false;
+ RegisterInfo ra_info;
+ if (!GetRegisterInfo(eRegisterKindLLDB, ra, ra_info))
+ return false;
+
+ Context ctx;
+ ctx.type = eContextPushRegisterOnStack;
+ ctx.SetRegisterToRegisterPlusOffset(rs_info, ra_info, ids);
+
+ // store
+ uint64_t ra_val = ReadRegisterUnsigned(eRegisterKindLLDB, ra, 0, &success);
+ if (!success)
+ return false;
+
+ lldb::addr_t addr = ra_val + ids;
+ WriteMemory(ctx, addr, &rs_val, sizeof(rs_val));
+
+ // update RA?
+ if (u) {
+ Context ctx;
+ // NOTE Currently, RA will always be equal to SP(r1)
+ ctx.type = eContextAdjustStackPointer;
+ WriteRegisterUnsigned(ctx, eRegisterKindLLDB, ra, addr);
+ }
+
+ LLDB_LOG(log, "EmulateSTD: success!");
+ return true;
+}
+
+bool EmulateInstructionPPC64::EmulateOR(uint32_t opcode) {
+ uint32_t rs = Bits32(opcode, 25, 21);
+ uint32_t ra = Bits32(opcode, 20, 16);
+ uint32_t rb = Bits32(opcode, 15, 11);
+
+ // to be safe, process only the known 'mr r31/r30, r1' prologue instructions
+ if (m_fp != LLDB_INVALID_REGNUM || rs != rb ||
+ (ra != gpr_r30_ppc64le && ra != gpr_r31_ppc64le) || rb != gpr_r1_ppc64le)
+ return false;
+
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
+ LLDB_LOG(log, "EmulateOR: {0:X+8}: mr r{1}, r{2}", m_addr, ra, rb);
+
+ // set context
+ RegisterInfo ra_info;
+ if (!GetRegisterInfo(eRegisterKindLLDB, ra, ra_info))
+ return false;
+
+ Context ctx;
+ ctx.type = eContextSetFramePointer;
+ ctx.SetRegister(ra_info);
+
+ // move
+ bool success;
+ uint64_t rb_val = ReadRegisterUnsigned(eRegisterKindLLDB, rb, 0, &success);
+ if (!success)
+ return false;
+ WriteRegisterUnsigned(ctx, eRegisterKindLLDB, ra, rb_val);
+ m_fp = ra;
+ LLDB_LOG(log, "EmulateOR: success!");
+ return true;
+}
+
+bool EmulateInstructionPPC64::EmulateADDI(uint32_t opcode) {
+ uint32_t rt = Bits32(opcode, 25, 21);
+ uint32_t ra = Bits32(opcode, 20, 16);
+ uint32_t si = Bits32(opcode, 15, 0);
+
+ // handle stack adjustments only
+ // (this is a typical epilogue operation, with ra == r1. If it's
+ // something else, then we won't know the correct value of ra)
+ if (rt != gpr_r1_ppc64le || ra != gpr_r1_ppc64le)
+ return false;
+
+ int32_t si_val = llvm::SignExtend32<16>(si);
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
+ LLDB_LOG(log, "EmulateADDI: {0:X+8}: addi r1, r1, {1}", m_addr, si_val);
+
+ // set context
+ RegisterInfo r1_info;
+ if (!GetRegisterInfo(eRegisterKindLLDB, gpr_r1_ppc64le, r1_info))
+ return false;
+
+ Context ctx;
+ ctx.type = eContextRestoreStackPointer;
+ ctx.SetRegisterToRegisterPlusOffset(r1_info, r1_info, 0);
+
+ // adjust SP
+ bool success;
+ uint64_t r1 =
+ ReadRegisterUnsigned(eRegisterKindLLDB, gpr_r1_ppc64le, 0, &success);
+ if (!success)
+ return false;
+ WriteRegisterUnsigned(ctx, eRegisterKindLLDB, gpr_r1_ppc64le, r1 + si_val);
+ LLDB_LOG(log, "EmulateADDI: success!");
+ return true;
+}
diff --git a/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h b/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h
new file mode 100644
index 000000000000..be65de9a5063
--- /dev/null
+++ b/source/Plugins/Instruction/PPC64/EmulateInstructionPPC64.h
@@ -0,0 +1,97 @@
+//===-- EmulateInstructionPPC64.h -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef EmulateInstructionPPC64_h_
+#define EmulateInstructionPPC64_h_
+
+// C Includes
+// C++ Includes
+// Other libraries and framework includes
+// Project includes
+#include "lldb/Core/EmulateInstruction.h"
+#include "lldb/Interpreter/OptionValue.h"
+#include "lldb/Utility/Log.h"
+
+namespace lldb_private {
+
+class EmulateInstructionPPC64 : public EmulateInstruction {
+public:
+ EmulateInstructionPPC64(const ArchSpec &arch);
+
+ static void Initialize();
+
+ static void Terminate();
+
+ static ConstString GetPluginNameStatic();
+
+ static const char *GetPluginDescriptionStatic();
+
+ static EmulateInstruction *CreateInstance(const ArchSpec &arch,
+ InstructionType inst_type);
+
+ static bool
+ SupportsEmulatingInstructionsOfTypeStatic(InstructionType inst_type) {
+ switch (inst_type) {
+ case eInstructionTypeAny:
+ case eInstructionTypePrologueEpilogue:
+ return true;
+
+ case eInstructionTypePCModifying:
+ case eInstructionTypeAll:
+ return false;
+ }
+ return false;
+ }
+
+ ConstString GetPluginName() override;
+
+ uint32_t GetPluginVersion() override { return 1; }
+
+ bool SetTargetTriple(const ArchSpec &arch) override;
+
+ bool SupportsEmulatingInstructionsOfType(InstructionType inst_type) override {
+ return SupportsEmulatingInstructionsOfTypeStatic(inst_type);
+ }
+
+ bool ReadInstruction() override;
+
+ bool EvaluateInstruction(uint32_t evaluate_options) override;
+
+ bool TestEmulation(Stream *out_stream, ArchSpec &arch,
+ OptionValueDictionary *test_data) override {
+ return false;
+ }
+
+ bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num,
+ RegisterInfo &reg_info) override;
+
+ bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan) override;
+
+private:
+ struct Opcode {
+ uint32_t mask;
+ uint32_t value;
+ bool (EmulateInstructionPPC64::*callback)(uint32_t opcode);
+ const char *name;
+ };
+
+ uint32_t m_fp = LLDB_INVALID_REGNUM;
+
+ Opcode *GetOpcodeForInstruction(uint32_t opcode);
+
+ bool EmulateMFSPR(uint32_t opcode);
+ bool EmulateLD(uint32_t opcode);
+ bool EmulateSTD(uint32_t opcode);
+ bool EmulateOR(uint32_t opcode);
+ bool EmulateADDI(uint32_t opcode);
+};
+
+} // namespace lldb_private
+
+#endif // EmulateInstructionPPC64_h_
diff --git a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
index eb238419ab18..32da327ee465 100644
--- a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
+++ b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp
@@ -267,8 +267,8 @@ MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo(
new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid);
ThreadSP new_thread_sp(history_thread);
- // Save this in the Process' ExtendedThreadList so a strong pointer
- // retains the object
+ // Save this in the Process' ExtendedThreadList so a strong pointer retains
+ // the object
process_sp->GetExtendedThreadList().AddThread(new_thread_sp);
threads->AddThread(new_thread_sp);
diff --git a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
index cf9ba60c7b60..6ce50f5c6839 100644
--- a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
+++ b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp
@@ -282,9 +282,8 @@ GetRenumberedThreadIds(ProcessSP process_sp, ValueObjectSP data,
} else {
// This isn't a live thread anymore. Ask process to assign a new
// Index ID (or return an old one if we've already seen this
- // thread_os_id).
- // It will also make sure that no new threads are assigned this Index
- // ID.
+ // thread_os_id). It will also make sure that no new threads are
+ // assigned this Index ID.
lldb_user_id = process_sp->AssignIndexIDToThread(thread_os_id);
}
@@ -574,7 +573,7 @@ static void GetSymbolDeclarationFromAddress(ProcessSP process_sp, addr_t addr,
return;
VariableList var_list;
- module->FindGlobalVariables(sym_name, nullptr, true, 1U, var_list);
+ module->FindGlobalVariables(sym_name, nullptr, 1U, var_list);
if (var_list.GetSize() < 1)
return;
diff --git a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
index 28c28e41ef44..1e9280c8c064 100644
--- a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
+++ b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp
@@ -334,8 +334,8 @@ UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo(
std::string stop_reason_description = GetStopReasonDescription(info);
new_thread_sp->SetName(stop_reason_description.c_str());
- // Save this in the Process' ExtendedThreadList so a strong pointer
- // retains the object
+ // Save this in the Process' ExtendedThreadList so a strong pointer retains
+ // the object
process_sp->GetExtendedThreadList().AddThread(new_thread_sp);
threads->AddThread(new_thread_sp);
diff --git a/source/Plugins/JITLoader/GDB/CMakeLists.txt b/source/Plugins/JITLoader/GDB/CMakeLists.txt
index 25e8d1ee231f..190599cbd588 100644
--- a/source/Plugins/JITLoader/GDB/CMakeLists.txt
+++ b/source/Plugins/JITLoader/GDB/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(.)
-
add_lldb_library(lldbPluginJITLoaderGDB PLUGIN
JITLoaderGDB.cpp
diff --git a/source/Plugins/Language/CPlusPlus/BlockPointer.cpp b/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
index 5e8f051dec98..82b7ac1675fa 100644
--- a/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
+++ b/source/Plugins/Language/CPlusPlus/BlockPointer.cpp
@@ -147,9 +147,8 @@ public:
return child_sp;
}
- // return true if this object is now safe to use forever without
- // ever updating again; the typical (and tested) answer here is
- // 'false'
+ // return true if this object is now safe to use forever without ever
+ // updating again; the typical (and tested) answer here is 'false'
bool Update() override { return false; }
// maybe return false if the block pointer is, say, null
diff --git a/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index 51ed88065c84..2c63e6467d4c 100644
--- a/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -120,10 +120,9 @@ static bool ReverseFindMatchingChars(const llvm::StringRef &s,
static bool IsTrivialBasename(const llvm::StringRef &basename) {
// Check that the basename matches with the following regular expression
- // "^~?([A-Za-z_][A-Za-z_0-9]*)$"
- // We are using a hand written implementation because it is significantly more
- // efficient then
- // using the general purpose regular expression library.
+ // "^~?([A-Za-z_][A-Za-z_0-9]*)$" We are using a hand written implementation
+ // because it is significantly more efficient then using the general purpose
+ // regular expression library.
size_t idx = 0;
if (basename.size() > 0 && basename[0] == '~')
idx = 1;
@@ -151,10 +150,9 @@ static bool IsTrivialBasename(const llvm::StringRef &basename) {
}
bool CPlusPlusLanguage::MethodName::TrySimplifiedParse() {
- // This method tries to parse simple method definitions
- // which are presumably most comman in user programs.
- // Definitions that can be parsed by this function don't have return types
- // and templates in the name.
+ // This method tries to parse simple method definitions which are presumably
+ // most comman in user programs. Definitions that can be parsed by this
+ // function don't have return types and templates in the name.
// A::B::C::fun(std::vector<T> &) const
size_t arg_start, arg_end;
llvm::StringRef full(m_full.GetCString());
@@ -251,13 +249,17 @@ std::string CPlusPlusLanguage::MethodName::GetScopeQualifiedName() {
}
bool CPlusPlusLanguage::IsCPPMangledName(const char *name) {
- // FIXME, we should really run through all the known C++ Language plugins and
- // ask each one if
- // this is a C++ mangled name, but we can put that off till there is actually
- // more than one
- // we care about.
-
- return (name != nullptr && name[0] == '_' && name[1] == 'Z');
+ // FIXME!! we should really run through all the known C++ Language plugins
+ // and ask each one if this is a C++ mangled name
+
+ if (name == nullptr)
+ return false;
+
+ // MSVC style mangling
+ if (name[0] == '?')
+ return true;
+
+ return (name[0] != '\0' && name[0] == '_' && name[1] == 'Z');
}
bool CPlusPlusLanguage::ExtractContextAndIdentifier(
@@ -307,13 +309,15 @@ static ConstString SubsPrimitiveParmItanium(llvm::StringRef mangled,
// FastDemangle will call our hook for each instance of a primitive type,
// allowing us to perform substitution
- const char *const demangled =
+ char *const demangled =
FastDemangle(mangled.str().c_str(), mangled.size(), swap_parms_hook);
if (log)
log->Printf("substituted mangling for %s:{%s} %s:{%s}\n",
mangled.str().c_str(), demangled, output_buf.c_str(),
FastDemangle(output_buf.c_str()));
+ // FastDemangle malloc'd this string.
+ free(demangled);
return output_buf == mangled ? ConstString() : ConstString(output_buf);
}
@@ -419,18 +423,20 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
SyntheticChildren::Flags stl_synth_flags;
stl_synth_flags.SetCascades(true).SetSkipPointers(false).SetSkipReferences(
false);
+ SyntheticChildren::Flags stl_deref_flags = stl_synth_flags;
+ stl_deref_flags.SetFrontEndWantsDereference();
AddCXXSynthetic(
cpp_category_sp,
lldb_private::formatters::LibcxxBitsetSyntheticFrontEndCreator,
"libc++ std::bitset synthetic children",
- ConstString("^std::__(ndk)?1::bitset<.+>(( )?&)?$"), stl_synth_flags,
+ ConstString("^std::__(ndk)?1::bitset<.+>(( )?&)?$"), stl_deref_flags,
true);
AddCXXSynthetic(
cpp_category_sp,
lldb_private::formatters::LibcxxStdVectorSyntheticFrontEndCreator,
"libc++ std::vector synthetic children",
- ConstString("^std::__(ndk)?1::vector<.+>(( )?&)?$"), stl_synth_flags,
+ ConstString("^std::__(ndk)?1::vector<.+>(( )?&)?$"), stl_deref_flags,
true);
AddCXXSynthetic(
cpp_category_sp,
@@ -453,13 +459,13 @@ static void LoadLibCxxFormatters(lldb::TypeCategoryImplSP cpp_category_sp) {
cpp_category_sp,
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator,
"libc++ std::set synthetic children",
- ConstString("^std::__(ndk)?1::set<.+> >(( )?&)?$"), stl_synth_flags,
+ ConstString("^std::__(ndk)?1::set<.+> >(( )?&)?$"), stl_deref_flags,
true);
AddCXXSynthetic(
cpp_category_sp,
lldb_private::formatters::LibcxxStdMapSyntheticFrontEndCreator,
"libc++ std::multiset synthetic children",
- ConstString("^std::__(ndk)?1::multiset<.+> >(( )?&)?$"), stl_synth_flags,
+ ConstString("^std::__(ndk)?1::multiset<.+> >(( )?&)?$"), stl_deref_flags,
true);
AddCXXSynthetic(
cpp_category_sp,
diff --git a/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp b/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
index aebea6ae3569..b32fe9588965 100644
--- a/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
+++ b/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
@@ -25,8 +25,8 @@ Optional<ParsedFunction> CPlusPlusNameParser::ParseAsFunctionDefinition() {
m_next_token_index = 0;
Optional<ParsedFunction> result(None);
- // Try to parse the name as function without a return type specified
- // e.g. main(int, char*[])
+ // Try to parse the name as function without a return type specified e.g.
+ // main(int, char*[])
{
Bookmark start_position = SetBookmark();
result = ParseFunctionImpl(false);
@@ -34,8 +34,8 @@ Optional<ParsedFunction> CPlusPlusNameParser::ParseAsFunctionDefinition() {
return result;
}
- // Try to parse the name as function with function pointer return type
- // e.g. void (*get_func(const char*))()
+ // Try to parse the name as function with function pointer return type e.g.
+ // void (*get_func(const char*))()
result = ParseFuncPtr(true);
if (result)
return result;
@@ -183,13 +183,13 @@ bool CPlusPlusNameParser::ConsumeTemplateArgs() {
Advance();
// Consuming template arguments is a bit trickier than consuming function
- // arguments, because '<' '>' brackets are not always trivially balanced.
- // In some rare cases tokens '<' and '>' can appear inside template arguments
- // as arithmetic or shift operators not as template brackets.
- // Examples: std::enable_if<(10u)<(64), bool>
+ // arguments, because '<' '>' brackets are not always trivially balanced. In
+ // some rare cases tokens '<' and '>' can appear inside template arguments as
+ // arithmetic or shift operators not as template brackets. Examples:
+ // std::enable_if<(10u)<(64), bool>
// f<A<operator<(X,Y)::Subclass>>
- // Good thing that compiler makes sure that really ambiguous cases of
- // '>' usage should be enclosed within '()' brackets.
+ // Good thing that compiler makes sure that really ambiguous cases of '>'
+ // usage should be enclosed within '()' brackets.
int template_counter = 1;
bool can_open_template = false;
while (HasMoreTokens() && template_counter > 0) {
@@ -208,9 +208,9 @@ bool CPlusPlusNameParser::ConsumeTemplateArgs() {
case tok::less:
// '<' is an attempt to open a subteamplte
// check if parser is at the point where it's actually possible,
- // otherwise it's just a part of an expression like 'sizeof(T)<(10)'.
- // No need to do the same for '>' because compiler actually makes sure
- // that '>' always surrounded by brackets to avoid ambiguity.
+ // otherwise it's just a part of an expression like 'sizeof(T)<(10)'. No
+ // need to do the same for '>' because compiler actually makes sure that
+ // '>' always surrounded by brackets to avoid ambiguity.
if (can_open_template)
++template_counter;
can_open_template = false;
@@ -242,8 +242,7 @@ bool CPlusPlusNameParser::ConsumeTemplateArgs() {
}
}
- assert(template_counter >= 0);
- if (template_counter > 0) {
+ if (template_counter != 0) {
return false;
}
start_position.Remove();
@@ -389,10 +388,9 @@ void CPlusPlusNameParser::SkipFunctionQualifiers() {
bool CPlusPlusNameParser::ConsumeBuiltinType() {
bool result = false;
bool continue_parsing = true;
- // Built-in types can be made of a few keywords
- // like 'unsigned long long int'. This function
- // consumes all built-in type keywords without
- // checking if they make sense like 'unsigned char void'.
+ // Built-in types can be made of a few keywords like 'unsigned long long
+ // int'. This function consumes all built-in type keywords without checking
+ // if they make sense like 'unsigned char void'.
while (continue_parsing && HasMoreTokens()) {
switch (Peek().getKind()) {
case tok::kw_short:
diff --git a/source/Plugins/Language/CPlusPlus/LibCxx.cpp b/source/Plugins/Language/CPlusPlus/LibCxx.cpp
index f6d1f18cb596..95e02a473cd7 100644
--- a/source/Plugins/Language/CPlusPlus/LibCxx.cpp
+++ b/source/Plugins/Language/CPlusPlus/LibCxx.cpp
@@ -123,12 +123,11 @@ bool lldb_private::formatters::LibCxxMapIteratorSyntheticFrontEnd::Update() {
static ConstString g___i_("__i_");
- // this must be a ValueObject* because it is a child of the ValueObject we are
- // producing children for
- // it if were a ValueObjectSP, we would end up with a loop (iterator ->
- // synthetic -> child -> parent == iterator)
- // and that would in turn leak memory by never allowing the ValueObjects to
- // die and free their memory
+ // this must be a ValueObject* because it is a child of the ValueObject we
+ // are producing children for it if were a ValueObjectSP, we would end up
+ // with a loop (iterator -> synthetic -> child -> parent == iterator) and
+ // that would in turn leak memory by never allowing the ValueObjects to die
+ // and free their memory
m_pair_ptr = valobj_sp
->GetValueForExpressionPath(
".__i_.__ptr_->__value_", nullptr, nullptr,
@@ -386,7 +385,8 @@ enum LibcxxStringLayoutMode {
};
// this function abstracts away the layout and mode details of a libc++ string
-// and returns the address of the data and the size ready for callers to consume
+// and returns the address of the data and the size ready for callers to
+// consume
static bool ExtractLibcxxStringInfo(ValueObject &valobj,
ValueObjectSP &location_sp,
uint64_t &size) {
diff --git a/source/Plugins/Language/CPlusPlus/LibCxxList.cpp b/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
index 6407ae129ad7..6066f14b18cc 100644
--- a/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
+++ b/source/Plugins/Language/CPlusPlus/LibCxxList.cpp
@@ -206,8 +206,7 @@ bool AbstractListFrontEnd::HasLoop(size_t count) {
if (m_loop_detected == 0) {
// This is the first time we are being run (after the last update). Set up
- // the loop
- // invariant for the first element.
+ // the loop invariant for the first element.
m_slow_runner = ListEntry(m_head).next();
m_fast_runner = m_slow_runner.next();
m_loop_detected = 1;
@@ -215,9 +214,8 @@ bool AbstractListFrontEnd::HasLoop(size_t count) {
// Loop invariant:
// Loop detection has been run over the first m_loop_detected elements. If
- // m_slow_runner ==
- // m_fast_runner then the loop has been detected after m_loop_detected
- // elements.
+ // m_slow_runner == m_fast_runner then the loop has been detected after
+ // m_loop_detected elements.
const size_t steps_to_run = std::min(count, m_count);
while (m_loop_detected < steps_to_run && m_slow_runner && m_fast_runner &&
m_slow_runner != m_fast_runner) {
diff --git a/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp b/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
index be96a6d95bcd..8f82bdcbfd59 100644
--- a/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
+++ b/source/Plugins/Language/CPlusPlus/LibCxxMap.cpp
@@ -382,8 +382,8 @@ lldb_private::formatters::LibcxxStdMapSyntheticFrontEnd::GetChildAtIndex(
return lldb::ValueObjectSP();
}
} else {
- // because of the way our debug info is made, we need to read item 0 first
- // so that we can cache information used to generate other elements
+ // because of the way our debug info is made, we need to read item 0
+ // first so that we can cache information used to generate other elements
if (m_skip_size == UINT32_MAX)
GetChildAtIndex(0);
if (m_skip_size == UINT32_MAX) {
diff --git a/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp b/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
index b6d664df16ef..9d46e3e3ee58 100644
--- a/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
+++ b/source/Plugins/Language/CPlusPlus/LibStdcppUniquePointer.cpp
@@ -43,6 +43,8 @@ private:
ValueObjectSP m_ptr_obj;
ValueObjectSP m_obj_obj;
ValueObjectSP m_del_obj;
+
+ ValueObjectSP GetTuple();
};
} // end of anonymous namespace
@@ -53,17 +55,36 @@ LibStdcppUniquePtrSyntheticFrontEnd::LibStdcppUniquePtrSyntheticFrontEnd(
Update();
}
-bool LibStdcppUniquePtrSyntheticFrontEnd::Update() {
+ValueObjectSP LibStdcppUniquePtrSyntheticFrontEnd::GetTuple() {
ValueObjectSP valobj_backend_sp = m_backend.GetSP();
+
if (!valobj_backend_sp)
- return false;
+ return nullptr;
ValueObjectSP valobj_sp = valobj_backend_sp->GetNonSyntheticValue();
if (!valobj_sp)
- return false;
+ return nullptr;
- ValueObjectSP tuple_sp =
+ ValueObjectSP obj_child_sp =
valobj_sp->GetChildMemberWithName(ConstString("_M_t"), true);
+ if (!obj_child_sp)
+ return nullptr;
+
+ ValueObjectSP obj_subchild_sp =
+ obj_child_sp->GetChildMemberWithName(ConstString("_M_t"), true);
+
+ // if there is a _M_t subchild, the tuple is found in the obj_subchild_sp
+ // (for libstdc++ 6.0.23).
+ if (obj_subchild_sp) {
+ return obj_subchild_sp;
+ }
+
+ return obj_child_sp;
+}
+
+bool LibStdcppUniquePtrSyntheticFrontEnd::Update() {
+ ValueObjectSP tuple_sp = GetTuple();
+
if (!tuple_sp)
return false;
diff --git a/source/Plugins/Language/ObjC/Cocoa.cpp b/source/Plugins/Language/ObjC/Cocoa.cpp
index 8f4997533212..8f278fc2d513 100644
--- a/source/Plugins/Language/ObjC/Cocoa.cpp
+++ b/source/Plugins/Language/ObjC/Cocoa.cpp
@@ -67,12 +67,12 @@ bool lldb_private::formatters::NSBundleSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
- if (!strcmp(class_name, "NSBundle")) {
+ if (class_name == "NSBundle") {
uint64_t offset = 5 * ptr_size;
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(
offset,
@@ -117,12 +117,12 @@ bool lldb_private::formatters::NSTimeZoneSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
- if (!strcmp(class_name, "__NSTimeZone")) {
+ if (class_name == "__NSTimeZone") {
uint64_t offset = ptr_size;
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(
offset, valobj.GetCompilerType(), true));
@@ -164,12 +164,12 @@ bool lldb_private::formatters::NSNotificationSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
- if (!strcmp(class_name, "NSConcreteNotification")) {
+ if (class_name == "NSConcreteNotification") {
uint64_t offset = ptr_size;
ValueObjectSP text(valobj.GetSyntheticChildAtOffset(
offset, valobj.GetCompilerType(), true));
@@ -211,14 +211,14 @@ bool lldb_private::formatters::NSMachPortSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
uint64_t port_number = 0;
- if (!strcmp(class_name, "NSMachPort")) {
+ if (class_name == "NSMachPort") {
uint64_t offset = (ptr_size == 4 ? 12 : 20);
Status error;
port_number = process_sp->ReadUnsignedIntegerFromMemory(
@@ -259,16 +259,15 @@ bool lldb_private::formatters::NSIndexSetSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
uint64_t count = 0;
do {
- if (!strcmp(class_name, "NSIndexSet") ||
- !strcmp(class_name, "NSMutableIndexSet")) {
+ if (class_name == "NSIndexSet" || class_name == "NSMutableIndexSet") {
Status error;
uint32_t mode = process_sp->ReadUnsignedIntegerFromMemory(
valobj_addr + ptr_size, 4, 0, error);
@@ -451,15 +450,18 @@ bool lldb_private::formatters::NSNumberSummaryProvider(
if (!valobj_addr)
return false;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name(descriptor->GetClassName().GetCString());
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
- if (!strcmp(class_name, "__NSCFBoolean"))
+ if (class_name == "__NSCFBoolean")
return ObjCBooleanSummaryProvider(valobj, stream, options);
- if (!strcmp(class_name, "NSNumber") || !strcmp(class_name, "__NSCFNumber")) {
+ if (class_name == "NSDecimalNumber")
+ return NSDecimalNumberSummaryProvider(valobj, stream, options);
+
+ if (class_name == "NSNumber" || class_name == "__NSCFNumber") {
uint64_t value = 0;
uint64_t i_bits = 0;
if (descriptor->GetTaggedPointerInfo(&i_bits, &value)) {
@@ -626,6 +628,55 @@ bool lldb_private::formatters::NSNumberSummaryProvider(
return false;
}
+bool lldb_private::formatters::NSDecimalNumberSummaryProvider(
+ ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+ ProcessSP process_sp = valobj.GetProcessSP();
+ if (!process_sp)
+ return false;
+
+ lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);
+ uint32_t ptr_size = process_sp->GetAddressByteSize();
+
+ Status error;
+ int8_t exponent = process_sp->ReadUnsignedIntegerFromMemory(
+ valobj_addr + ptr_size, 1, 0, error);
+ if (error.Fail())
+ return false;
+
+ uint8_t length_and_negative = process_sp->ReadUnsignedIntegerFromMemory(
+ valobj_addr + ptr_size + 1, 1, 0, error);
+ if (error.Fail())
+ return false;
+
+ // Fifth bit marks negativity.
+ const bool is_negative = (length_and_negative >> 4) & 1;
+
+ // Zero length and negative means NaN.
+ uint8_t length = length_and_negative & 0xf;
+ const bool is_nan = is_negative && (length == 0);
+
+ if (is_nan) {
+ stream.Printf("NaN");
+ return true;
+ }
+
+ if (length == 0) {
+ stream.Printf("0");
+ return true;
+ }
+
+ uint64_t mantissa = process_sp->ReadUnsignedIntegerFromMemory(
+ valobj_addr + ptr_size + 4, 8, 0, error);
+ if (error.Fail())
+ return false;
+
+ if (is_negative)
+ stream.Printf("-");
+
+ stream.Printf("%" PRIu64 " x 10^%" PRIi8, mantissa, exponent);
+ return true;
+}
+
bool lldb_private::formatters::NSURLSummaryProvider(
ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
ProcessSP process_sp = valobj.GetProcessSP();
@@ -766,9 +817,9 @@ bool lldb_private::formatters::NSDateSummaryProvider(
stream.Printf("0001-12-30 00:00:00 +0000");
return true;
}
- // this snippet of code assumes that time_t == seconds since Jan-1-1970
- // this is generally true and POSIXly happy, but might break if a library
- // vendor decides to get creative
+ // this snippet of code assumes that time_t == seconds since Jan-1-1970 this
+ // is generally true and POSIXly happy, but might break if a library vendor
+ // decides to get creative
time_t epoch = GetOSXEpoch();
epoch = epoch + (time_t)date_value;
tm *tm_date = gmtime(&epoch);
@@ -871,28 +922,34 @@ bool lldb_private::formatters::NSDataSummaryProvider(
uint64_t value = 0;
- const char *class_name = descriptor->GetClassName().GetCString();
+ llvm::StringRef class_name = descriptor->GetClassName().GetCString();
- if (!class_name || !*class_name)
+ if (class_name.empty())
return false;
- if (!strcmp(class_name, "NSConcreteData") ||
- !strcmp(class_name, "NSConcreteMutableData") ||
- !strcmp(class_name, "__NSCFData")) {
- uint32_t offset = (is_64bit ? 16 : 8);
+ bool isNSConcreteData = class_name == "NSConcreteData";
+ bool isNSConcreteMutableData = class_name == "NSConcreteMutableData";
+ bool isNSCFData = class_name == "__NSCFData";
+ if (isNSConcreteData || isNSConcreteMutableData || isNSCFData) {
+ uint32_t offset;
+ if (isNSConcreteData)
+ offset = is_64bit ? 8 : 4;
+ else
+ offset = is_64bit ? 16 : 8;
+
Status error;
value = process_sp->ReadUnsignedIntegerFromMemory(
valobj_addr + offset, is_64bit ? 8 : 4, 0, error);
if (error.Fail())
return false;
- } else if (!strcmp(class_name, "_NSInlineData")) {
+ } else if (class_name == "_NSInlineData") {
uint32_t offset = (is_64bit ? 8 : 4);
Status error;
value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + offset, 2,
0, error);
if (error.Fail())
return false;
- } else if (!strcmp(class_name, "_NSZeroData")) {
+ } else if (class_name == "_NSZeroData") {
value = 0;
} else
return false;
diff --git a/source/Plugins/Language/ObjC/Cocoa.h b/source/Plugins/Language/ObjC/Cocoa.h
index 10ff3bce3b98..0f2ca5496302 100644
--- a/source/Plugins/Language/ObjC/Cocoa.h
+++ b/source/Plugins/Language/ObjC/Cocoa.h
@@ -32,6 +32,9 @@ bool NSDataSummaryProvider(ValueObject &valobj, Stream &stream,
bool NSNumberSummaryProvider(ValueObject &valobj, Stream &stream,
const TypeSummaryOptions &options);
+bool NSDecimalNumberSummaryProvider(ValueObject &valobj, Stream &stream,
+ const TypeSummaryOptions &options);
+
bool NSNotificationSummaryProvider(ValueObject &valobj, Stream &stream,
const TypeSummaryOptions &options);
diff --git a/source/Plugins/Language/ObjC/NSDictionary.cpp b/source/Plugins/Language/ObjC/NSDictionary.cpp
index c564aa1a8571..5be051b46bd6 100644
--- a/source/Plugins/Language/ObjC/NSDictionary.cpp
+++ b/source/Plugins/Language/ObjC/NSDictionary.cpp
@@ -396,6 +396,8 @@ bool lldb_private::formatters::NSDictionarySummaryProvider(
static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
static const ConstString g_DictionaryMImmutable("__NSDictionaryM_Immutable");
static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
+ static const ConstString g_Dictionary0("__NSDictionary0");
+ static const ConstString g_DictionaryCF("__NSCFDictionary");
if (class_name.IsEmpty())
return false;
@@ -407,7 +409,8 @@ bool lldb_private::formatters::NSDictionarySummaryProvider(
if (error.Fail())
return false;
value &= (is_64bit ? ~0xFC00000000000000UL : ~0xFC000000U);
- } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy) {
+ } else if (class_name == g_DictionaryM || class_name == g_DictionaryMLegacy ||
+ class_name == g_DictionaryCF) {
AppleObjCRuntime *apple_runtime =
llvm::dyn_cast_or_null<AppleObjCRuntime>(runtime);
Status error;
@@ -423,17 +426,9 @@ bool lldb_private::formatters::NSDictionarySummaryProvider(
return false;
} else if (class_name == g_Dictionary1) {
value = 1;
+ } else if (class_name == g_Dictionary0) {
+ value = 0;
}
- /*else if (!strcmp(class_name,"__NSCFDictionary"))
- {
- Status error;
- value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + (is_64bit ?
- 20 : 12), 4, 0, error);
- if (error.Fail())
- return false;
- if (is_64bit)
- value &= ~0x0f1f000000000000UL;
- }*/
else {
auto &map(NSDictionary_Additionals::GetAdditionalSummaries());
for (auto &candidate : map) {
@@ -491,6 +486,7 @@ lldb_private::formatters::NSDictionarySyntheticFrontEndCreator(
static const ConstString g_Dictionary1("__NSSingleEntryDictionaryI");
static const ConstString g_DictionaryImmutable("__NSDictionaryM_Immutable");
static const ConstString g_DictionaryMLegacy("__NSDictionaryM_Legacy");
+ static const ConstString g_Dictionary0("__NSDictionary0");
if (class_name.IsEmpty())
return nullptr;
@@ -673,11 +669,7 @@ lldb_private::formatters::NSDictionary1SyntheticFrontEnd::
size_t lldb_private::formatters::NSDictionary1SyntheticFrontEnd::
GetIndexOfChildWithName(const ConstString &name) {
static const ConstString g_zero("[0]");
-
- if (name == g_zero)
- return 0;
-
- return UINT32_MAX;
+ return name == g_zero ? 0 : UINT32_MAX;
}
size_t lldb_private::formatters::NSDictionary1SyntheticFrontEnd::
diff --git a/source/Plugins/Language/ObjC/NSError.cpp b/source/Plugins/Language/ObjC/NSError.cpp
index 4365a12b54e1..77721e2db326 100644
--- a/source/Plugins/Language/ObjC/NSError.cpp
+++ b/source/Plugins/Language/ObjC/NSError.cpp
@@ -177,12 +177,11 @@ public:
private:
// the child here can be "real" (i.e. an actual child of the root) or
- // synthetized from raw memory
- // if the former, I need to store a plain pointer to it - or else a loop of
- // references will cause this entire hierarchy of values to leak
- // if the latter, then I need to store a SharedPointer to it - so that it only
- // goes away when everyone else in the cluster goes away
- // oh joy!
+ // synthetized from raw memory if the former, I need to store a plain pointer
+ // to it - or else a loop of references will cause this entire hierarchy of
+ // values to leak if the latter, then I need to store a SharedPointer to it -
+ // so that it only goes away when everyone else in the cluster goes away oh
+ // joy!
ValueObject *m_child_ptr;
ValueObjectSP m_child_sp;
};
diff --git a/source/Plugins/Language/ObjC/NSException.cpp b/source/Plugins/Language/ObjC/NSException.cpp
index 1da4f6de19a0..c6970efae4d3 100644
--- a/source/Plugins/Language/ObjC/NSException.cpp
+++ b/source/Plugins/Language/ObjC/NSException.cpp
@@ -171,12 +171,11 @@ public:
private:
// the child here can be "real" (i.e. an actual child of the root) or
- // synthetized from raw memory
- // if the former, I need to store a plain pointer to it - or else a loop of
- // references will cause this entire hierarchy of values to leak
- // if the latter, then I need to store a SharedPointer to it - so that it only
- // goes away when everyone else in the cluster goes away
- // oh joy!
+ // synthetized from raw memory if the former, I need to store a plain pointer
+ // to it - or else a loop of references will cause this entire hierarchy of
+ // values to leak if the latter, then I need to store a SharedPointer to it -
+ // so that it only goes away when everyone else in the cluster goes away oh
+ // joy!
ValueObject *m_child_ptr;
ValueObjectSP m_child_sp;
};
diff --git a/source/Plugins/Language/ObjC/NSSet.cpp b/source/Plugins/Language/ObjC/NSSet.cpp
index fa2483ecc094..2da4bc034f32 100644
--- a/source/Plugins/Language/ObjC/NSSet.cpp
+++ b/source/Plugins/Language/ObjC/NSSet.cpp
@@ -269,7 +269,8 @@ bool lldb_private::formatters::NSSetSummaryProvider(
if (!class_name || !*class_name)
return false;
- if (!strcmp(class_name, "__NSSetI")) {
+ if (!strcmp(class_name, "__NSSetI") ||
+ !strcmp(class_name, "__NSOrderedSetI")) {
Status error;
value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size,
ptr_size, 0, error);
@@ -289,32 +290,7 @@ bool lldb_private::formatters::NSSetSummaryProvider(
}
if (error.Fail())
return false;
- }
- /*else if (!strcmp(class_name,"__NSCFSet"))
- {
- Status error;
- value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + (is_64bit ?
- 20 : 12), 4, 0, error);
- if (error.Fail())
- return false;
- if (is_64bit)
- value &= ~0x1fff000000000000UL;
- }
- else if (!strcmp(class_name,"NSCountedSet"))
- {
- Status error;
- value = process_sp->ReadUnsignedIntegerFromMemory(valobj_addr + ptr_size,
- ptr_size, 0, error);
- if (error.Fail())
- return false;
- value = process_sp->ReadUnsignedIntegerFromMemory(value + (is_64bit ? 20 :
- 12), 4, 0, error);
- if (error.Fail())
- return false;
- if (is_64bit)
- value &= ~0x1fff000000000000UL;
- }*/
- else {
+ } else {
auto &map(NSSet_Additionals::GetAdditionalSummaries());
auto iter = map.find(class_name_cs), end = map.end();
if (iter != end)
@@ -371,7 +347,8 @@ lldb_private::formatters::NSSetSyntheticFrontEndCreator(
if (!class_name || !*class_name)
return nullptr;
- if (!strcmp(class_name, "__NSSetI")) {
+ if (!strcmp(class_name, "__NSSetI") ||
+ !strcmp(class_name, "__NSOrderedSetI")) {
return (new NSSetISyntheticFrontEnd(valobj_sp));
} else if (!strcmp(class_name, "__NSSetM")) {
AppleObjCRuntime *apple_runtime =
diff --git a/source/Plugins/Language/ObjC/NSString.cpp b/source/Plugins/Language/ObjC/NSString.cpp
index 3b4edf68e063..0b12edb53d7a 100644
--- a/source/Plugins/Language/ObjC/NSString.cpp
+++ b/source/Plugins/Language/ObjC/NSString.cpp
@@ -256,8 +256,7 @@ bool lldb_private::formatters::NSStringSummaryProvider(
uint64_t location = valobj_addr + 2 * ptr_size;
if (!has_explicit_length) {
// in this kind of string, the byte before the string content is a length
- // byte
- // so let's try and use it to handle the embedded NUL case
+ // byte so let's try and use it to handle the embedded NUL case
Status error;
explicit_length =
process_sp->ReadUnsignedIntegerFromMemory(location, 1, 0, error);
@@ -368,9 +367,7 @@ bool lldb_private::formatters::NSTaggedString_SummaryProvider(
}
// this is a fairly ugly trick - pretend that the numeric value is actually a
- // char*
- // this works under a few assumptions:
- // little endian architecture
+ // char* this works under a few assumptions: little endian architecture
// sizeof(uint64_t) > g_MaxNonBitmaskedLen
if (len_bits <= g_MaxNonBitmaskedLen) {
stream.Printf("%s", prefix.c_str());
diff --git a/source/Plugins/Language/ObjC/ObjCLanguage.cpp b/source/Plugins/Language/ObjC/ObjCLanguage.cpp
index ea2eec7b33b7..47874b3be8fd 100644
--- a/source/Plugins/Language/ObjC/ObjCLanguage.cpp
+++ b/source/Plugins/Language/ObjC/ObjCLanguage.cpp
@@ -90,9 +90,8 @@ bool ObjCLanguage::MethodName::SetName(llvm::StringRef name, bool strict) {
if (name.empty())
return IsValid(strict);
- // If "strict" is true. then the method must be specified with a
- // '+' or '-' at the beginning. If "strict" is false, then the '+'
- // or '-' can be omitted
+ // If "strict" is true. then the method must be specified with a '+' or '-'
+ // at the beginning. If "strict" is false, then the '+' or '-' can be omitted
bool valid_prefix = false;
if (name.size() > 1 && (name[0] == '+' || name[0] == '-')) {
@@ -108,7 +107,7 @@ bool ObjCLanguage::MethodName::SetName(llvm::StringRef name, bool strict) {
if (valid_prefix) {
int name_len = name.size();
- // Objective C methods must have at least:
+ // Objective-C methods must have at least:
// "-[" or "+[" prefix
// One character for a class name
// One character for the space between the class name
@@ -134,8 +133,8 @@ const ConstString &ObjCLanguage::MethodName::GetClassName() {
if (paren_pos) {
m_class.SetCStringWithLength(class_start, paren_pos - class_start);
} else {
- // No '(' was found in the full name, we can definitively say
- // that our category was valid (and empty).
+ // No '(' was found in the full name, we can definitively say that our
+ // category was valid (and empty).
m_category_is_valid = true;
const char *space_pos = strchr(full, ' ');
if (space_pos) {
@@ -164,8 +163,8 @@ const ConstString &ObjCLanguage::MethodName::GetClassNameWithCategory() {
// contain a '(', then we can also fill in the m_class
if (!m_class && strchr(m_class_category.GetCString(), '(') == nullptr) {
m_class = m_class_category;
- // No '(' was found in the full name, we can definitively say
- // that our category was valid (and empty).
+ // No '(' was found in the full name, we can definitively say that
+ // our category was valid (and empty).
m_category_is_valid = true;
}
}
@@ -764,6 +763,10 @@ static void LoadObjCFormatters(TypeCategoryImplSP objc_category_sp) {
AddCXXSummary(
objc_category_sp, lldb_private::formatters::NSNumberSummaryProvider,
"NSNumber summary provider", ConstString("NSCFNumber"), appkit_flags);
+ AddCXXSummary(objc_category_sp,
+ lldb_private::formatters::NSNumberSummaryProvider,
+ "NSDecimalNumber summary provider",
+ ConstString("NSDecimalNumber"), appkit_flags);
AddCXXSummary(objc_category_sp,
lldb_private::formatters::NSURLSummaryProvider,
@@ -796,8 +799,8 @@ static void LoadObjCFormatters(TypeCategoryImplSP objc_category_sp) {
objc_category_sp, lldb_private::formatters::NSTimeZoneSummaryProvider,
"NSTimeZone summary provider", ConstString("__NSTimeZone"), appkit_flags);
- // CFAbsoluteTime is actually a double rather than a pointer to an object
- // we do not care about the numeric value, since it is probably meaningless to
+ // CFAbsoluteTime is actually a double rather than a pointer to an object we
+ // do not care about the numeric value, since it is probably meaningless to
// users
appkit_flags.SetDontShowValue(true);
AddCXXSummary(objc_category_sp,
diff --git a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
index e5a459dfe861..fc661bbbf2c9 100644
--- a/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -83,26 +83,30 @@ TypeAndOrName ItaniumABILanguageRuntime::GetTypeInfoFromVTableAddress(
// We are a C++ class, that's good. Get the class name and look it
// up:
const char *class_name = name + strlen(vtable_demangled_prefix);
+ // We know the class name is absolute, so tell FindTypes that by
+ // prefixing it with the root namespace:
+ std::string lookup_name("::");
+ lookup_name.append(class_name);
+
type_info.SetName(class_name);
const bool exact_match = true;
TypeList class_types;
uint32_t num_matches = 0;
- // First look in the module that the vtable symbol came from
- // and look for a single exact match.
+ // First look in the module that the vtable symbol came from and
+ // look for a single exact match.
llvm::DenseSet<SymbolFile *> searched_symbol_files;
if (sc.module_sp) {
num_matches = sc.module_sp->FindTypes(
- sc, ConstString(class_name), exact_match, 1,
+ sc, ConstString(lookup_name), exact_match, 1,
searched_symbol_files, class_types);
}
- // If we didn't find a symbol, then move on to the entire
- // module list in the target and get as many unique matches
- // as possible
+ // If we didn't find a symbol, then move on to the entire module
+ // list in the target and get as many unique matches as possible
if (num_matches == 0) {
num_matches = target.GetImages().FindTypes(
- sc, ConstString(class_name), exact_match, UINT32_MAX,
+ sc, ConstString(lookup_name), exact_match, UINT32_MAX,
searched_symbol_files, class_types);
}
@@ -187,15 +191,12 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
TypeAndOrName &class_type_or_name, Address &dynamic_address,
Value::ValueType &value_type) {
// For Itanium, if the type has a vtable pointer in the object, it will be at
- // offset 0
- // in the object. That will point to the "address point" within the vtable
- // (not the beginning of the
- // vtable.) We can then look up the symbol containing this "address point"
- // and that symbol's name
- // demangled will contain the full class name.
- // The second pointer above the "address point" is the "offset_to_top". We'll
- // use that to get the
- // start of the value object which holds the dynamic type.
+ // offset 0 in the object. That will point to the "address point" within the
+ // vtable (not the beginning of the vtable.) We can then look up the symbol
+ // containing this "address point" and that symbol's name demangled will
+ // contain the full class name. The second pointer above the "address point"
+ // is the "offset_to_top". We'll use that to get the start of the value
+ // object which holds the dynamic type.
//
class_type_or_name.Clear();
@@ -230,17 +231,15 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
if (class_type_or_name) {
TypeSP type_sp = class_type_or_name.GetTypeSP();
- // There can only be one type with a given name,
- // so we've just found duplicate definitions, and this
- // one will do as well as any other.
- // We don't consider something to have a dynamic type if
- // it is the same as the static type. So compare against
- // the value we were handed.
+ // There can only be one type with a given name, so we've just found
+ // duplicate definitions, and this one will do as well as any other. We
+ // don't consider something to have a dynamic type if it is the same as
+ // the static type. So compare against the value we were handed.
if (type_sp) {
if (ClangASTContext::AreTypesSame(in_value.GetCompilerType(),
type_sp->GetForwardCompilerType())) {
- // The dynamic type we found was the same type,
- // so we don't have a dynamic type here...
+ // The dynamic type we found was the same type, so we don't have a
+ // dynamic type here...
return false;
}
@@ -257,8 +256,8 @@ bool ItaniumABILanguageRuntime::GetDynamicTypeAndAddress(
if (offset_to_top == INT64_MIN)
return false;
- // So the dynamic type is a value that starts at offset_to_top
- // above the original address.
+ // So the dynamic type is a value that starts at offset_to_top above
+ // the original address.
lldb::addr_t dynamic_addr = original_ptr + offset_to_top;
if (!process->GetTarget().GetSectionLoadList().ResolveLoadAddress(
dynamic_addr, dynamic_address)) {
@@ -280,10 +279,9 @@ TypeAndOrName ItaniumABILanguageRuntime::FixUpDynamicType(
TypeAndOrName ret(type_and_or_name);
if (type_and_or_name.HasType()) {
// The type will always be the type of the dynamic object. If our parent's
- // type was a pointer,
- // then our type should be a pointer to the type of the dynamic object. If
- // a reference, then the original type
- // should be okay...
+ // type was a pointer, then our type should be a pointer to the type of the
+ // dynamic object. If a reference, then the original type should be
+ // okay...
CompilerType orig_type = type_and_or_name.GetCompilerType();
CompilerType corrected_type = orig_type;
if (static_type_flags.AllSet(eTypeIsPointer))
@@ -368,8 +366,8 @@ protected:
// the actual Mangled class should be strict about this, but on the
// command line if you're copying mangled names out of 'nm' on Darwin,
- // they will come out with an extra underscore - be willing to strip
- // this on behalf of the user. This is the moral equivalent of the -_/-n
+ // they will come out with an extra underscore - be willing to strip this
+ // on behalf of the user. This is the moral equivalent of the -_/-n
// options to c++filt
auto name = entry.ref;
if (name.startswith("__Z"))
@@ -448,13 +446,12 @@ BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
BreakpointResolverSP ItaniumABILanguageRuntime::CreateExceptionResolver(
Breakpoint *bkpt, bool catch_bp, bool throw_bp, bool for_expressions) {
// One complication here is that most users DON'T want to stop at
- // __cxa_allocate_expression, but until we can do
- // anything better with predicting unwinding the expression parser does. So
- // we have two forms of the exception
- // breakpoints, one for expressions that leaves out __cxa_allocate_exception,
- // and one that includes it.
- // The SetExceptionBreakpoints does the latter, the CreateExceptionBreakpoint
- // in the runtime the former.
+ // __cxa_allocate_expression, but until we can do anything better with
+ // predicting unwinding the expression parser does. So we have two forms of
+ // the exception breakpoints, one for expressions that leaves out
+ // __cxa_allocate_exception, and one that includes it. The
+ // SetExceptionBreakpoints does the latter, the CreateExceptionBreakpoint in
+ // the runtime the former.
static const char *g_catch_name = "__cxa_begin_catch";
static const char *g_throw_name1 = "__cxa_throw";
static const char *g_throw_name2 = "__cxa_rethrow";
@@ -517,8 +514,7 @@ void ItaniumABILanguageRuntime::SetExceptionBreakpoints() {
const bool for_expressions = true;
// For the exception breakpoints set by the Expression parser, we'll be a
- // little more aggressive and
- // stop at exception allocation as well.
+ // little more aggressive and stop at exception allocation as well.
if (m_cxx_exception_bp_sp) {
m_cxx_exception_bp_sp->SetEnabled(true);
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
index ecb0b64f2346..edb29e735ca9 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.cpp
@@ -378,8 +378,7 @@ bool ClassDescriptorV2::Describe(
AppleObjCRuntime::ClassDescriptorSP metaclass(GetMetaclass());
// We don't care about the metaclass's superclass, or its class methods.
- // Its instance methods are
- // our class methods.
+ // Its instance methods are our class methods.
if (metaclass) {
metaclass->Describe(
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
index eacc98a07193..fef42c78b24f 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.cpp
@@ -54,23 +54,20 @@ bool AppleObjCRuntime::GetObjectDescription(Stream &str, ValueObject &valobj) {
CompilerType compiler_type(valobj.GetCompilerType());
bool is_signed;
// ObjC objects can only be pointers (or numbers that actually represents
- // pointers
- // but haven't been typecast, because reasons..)
+ // pointers but haven't been typecast, because reasons..)
if (!compiler_type.IsIntegerType(is_signed) && !compiler_type.IsPointerType())
return false;
- // Make the argument list: we pass one arg, the address of our pointer, to the
- // print function.
+ // Make the argument list: we pass one arg, the address of our pointer, to
+ // the print function.
Value val;
if (!valobj.ResolveValue(val.GetScalar()))
return false;
// Value Objects may not have a process in their ExecutionContextRef. But we
- // need to have one
- // in the ref we pass down to eventually call description. Get it from the
- // target if it isn't
- // present.
+ // need to have one in the ref we pass down to eventually call description.
+ // Get it from the target if it isn't present.
ExecutionContext exe_ctx;
if (valobj.GetProcessSP()) {
exe_ctx = ExecutionContext(valobj.GetExecutionContextRef());
@@ -257,10 +254,9 @@ AppleObjCRuntime::FixUpDynamicType(const TypeAndOrName &type_and_or_name,
TypeAndOrName ret(type_and_or_name);
if (type_and_or_name.HasType()) {
// The type will always be the type of the dynamic object. If our parent's
- // type was a pointer,
- // then our type should be a pointer to the type of the dynamic object. If
- // a reference, then the original type
- // should be okay...
+ // type was a pointer, then our type should be a pointer to the type of the
+ // dynamic object. If a reference, then the original type should be
+ // okay...
CompilerType orig_type = type_and_or_name.GetCompilerType();
CompilerType corrected_type = orig_type;
if (static_type_flags.AllSet(eTypeIsPointer))
@@ -297,16 +293,14 @@ bool AppleObjCRuntime::AppleIsModuleObjCLibrary(const ModuleSP &module_sp) {
uint32_t AppleObjCRuntime::GetFoundationVersion() {
if (!m_Foundation_major.hasValue()) {
const ModuleList &modules = m_process->GetTarget().GetImages();
- uint32_t major = UINT32_MAX;
for (uint32_t idx = 0; idx < modules.GetSize(); idx++) {
lldb::ModuleSP module_sp = modules.GetModuleAtIndex(idx);
if (!module_sp)
continue;
if (strcmp(module_sp->GetFileSpec().GetFilename().AsCString(""),
"Foundation") == 0) {
- module_sp->GetVersion(&major, 1);
- m_Foundation_major = major;
- return major;
+ m_Foundation_major = module_sp->GetVersion().getMajor();
+ return *m_Foundation_major;
}
}
return LLDB_INVALID_MODULE_VERSION;
@@ -325,8 +319,8 @@ bool AppleObjCRuntime::IsModuleObjCLibrary(const ModuleSP &module_sp) {
bool AppleObjCRuntime::ReadObjCLibrary(const ModuleSP &module_sp) {
// Maybe check here and if we have a handler already, and the UUID of this
- // module is the same as the one in the
- // current module, then we don't have to reread it?
+ // module is the same as the one in the current module, then we don't have to
+ // reread it?
m_objc_trampoline_handler_ap.reset(
new AppleObjCTrampolineHandler(m_process->shared_from_this(), module_sp));
if (m_objc_trampoline_handler_ap.get() != NULL) {
@@ -365,11 +359,9 @@ AppleObjCRuntime::GetObjCVersion(Process *process, ModuleSP &objc_module_sp) {
for (size_t i = 0; i < num_images; i++) {
ModuleSP module_sp = target_modules.GetModuleAtIndexUnlocked(i);
// One tricky bit here is that we might get called as part of the initial
- // module loading, but
- // before all the pre-run libraries get winnowed from the module list. So
- // there might actually
- // be an old and incorrect ObjC library sitting around in the list, and we
- // don't want to look at that.
+ // module loading, but before all the pre-run libraries get winnowed from
+ // the module list. So there might actually be an old and incorrect ObjC
+ // library sitting around in the list, and we don't want to look at that.
// That's why we call IsLoadedInTarget.
if (AppleIsModuleObjCLibrary(module_sp) &&
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
index 9cac499c0ff0..5001c0461b3b 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.cpp
@@ -42,8 +42,7 @@ AppleObjCRuntimeV1::AppleObjCRuntimeV1(Process *process)
m_isa_hash_table_ptr(LLDB_INVALID_ADDRESS) {}
// for V1 runtime we just try to return a class name as that is the minimum
-// level of support
-// required for the data formatters to work
+// level of support required for the data formatters to work
bool AppleObjCRuntimeV1::GetDynamicTypeAndAddress(
ValueObject &in_value, lldb::DynamicValueType use_dynamic,
TypeAndOrName &class_type_or_name, Address &address,
@@ -85,7 +84,7 @@ AppleObjCRuntimeV1::CreateInstance(Process *process,
void AppleObjCRuntimeV1::Initialize() {
PluginManager::RegisterPlugin(
- GetPluginNameStatic(), "Apple Objective C Language Runtime - Version 1",
+ GetPluginNameStatic(), "Apple Objective-C Language Runtime - Version 1",
CreateInstance);
}
@@ -284,6 +283,10 @@ bool AppleObjCRuntimeV1::ClassDescriptorV1::Describe(
return false;
}
+lldb::addr_t AppleObjCRuntimeV1::GetTaggedPointerObfuscator() {
+ return 0;
+}
+
lldb::addr_t AppleObjCRuntimeV1::GetISAHashTablePointer() {
if (m_isa_hash_table_ptr == LLDB_INVALID_ADDRESS) {
ModuleSP objc_module_sp(GetObjCModule());
@@ -383,8 +386,8 @@ void AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded() {
ObjCISA isa;
if (bucket_isa_count == 1) {
- // When we only have one entry in the bucket, the bucket data is
- // the "isa"
+ // When we only have one entry in the bucket, the bucket data
+ // is the "isa"
isa = bucket_data;
if (isa) {
if (!ISAIsCached(isa)) {
@@ -402,8 +405,7 @@ void AppleObjCRuntimeV1::UpdateISAToDescriptorMapIfNeeded() {
}
} else {
// When we have more than one entry in the bucket, the bucket
- // data is a pointer
- // to an array of "isa" values
+ // data is a pointer to an array of "isa" values
addr_t isa_addr = bucket_data;
for (uint32_t isa_idx = 0; isa_idx < bucket_isa_count;
++isa_idx, isa_addr += addr_size) {
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
index 3dddf1b094e1..52eec0f692fb 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
@@ -45,6 +45,8 @@ public:
}
}
+ lldb::addr_t GetTaggedPointerObfuscator();
+
class ClassDescriptorV1 : public ObjCLanguageRuntime::ClassDescriptor {
public:
ClassDescriptorV1(ValueObject &isa_pointer);
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
index bdf79f7b82bd..d217ed3ff325 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
@@ -37,6 +37,7 @@
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueBoolean.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ObjectFile.h"
@@ -76,8 +77,7 @@ static constexpr std::chrono::seconds g_utility_function_timeout(2);
static const char *g_get_dynamic_class_info_name =
"__lldb_apple_objc_v2_get_dynamic_class_info";
// Testing using the new C++11 raw string literals. If this breaks GCC then we
-// will
-// need to revert to the code above...
+// will need to revert to the code above...
static const char *g_get_dynamic_class_info_body = R"(
extern "C"
@@ -161,8 +161,7 @@ __lldb_apple_objc_v2_get_dynamic_class_info (void *gdb_objc_realized_classes_ptr
static const char *g_get_shared_cache_class_info_name =
"__lldb_apple_objc_v2_get_shared_cache_class_info";
// Testing using the new C++11 raw string literals. If this breaks GCC then we
-// will
-// need to revert to the code above...
+// will need to revert to the code above...
static const char *g_get_shared_cache_class_info_body = R"(
extern "C"
@@ -385,7 +384,9 @@ AppleObjCRuntimeV2::AppleObjCRuntimeV2(Process *process,
m_get_class_info_args_mutex(), m_get_shared_cache_class_info_code(),
m_get_shared_cache_class_info_args(LLDB_INVALID_ADDRESS),
m_get_shared_cache_class_info_args_mutex(), m_decl_vendor_ap(),
- m_isa_hash_table_ptr(LLDB_INVALID_ADDRESS), m_hash_signature(),
+ m_tagged_pointer_obfuscator(LLDB_INVALID_ADDRESS),
+ m_isa_hash_table_ptr(LLDB_INVALID_ADDRESS),
+ m_hash_signature(),
m_has_object_getClass(false), m_loaded_objc_opt(false),
m_non_pointer_isa_cache_ap(
NonPointerISACache::CreateInstance(*this, objc_module_sp)),
@@ -406,10 +407,9 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress(
assert(m_process != NULL);
// 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. if the value was made with
- // SBTarget::EvaluateExpression...)
- // in which case it is sufficient if the target's match:
+ // value from another process. Note, however, the process might be NULL (e.g.
+ // if the value was made with SBTarget::EvaluateExpression...) in which case
+ // it is sufficient if the target's match:
Process *process = in_value.GetProcessSP().get();
if (process)
@@ -422,8 +422,8 @@ bool AppleObjCRuntimeV2::GetDynamicTypeAndAddress(
// Make sure we can have a dynamic value before starting...
if (CouldHaveDynamicValue(in_value)) {
- // First job, pull out the address at 0 offset from the object That will be
- // the ISA pointer.
+ // First job, pull out the address at 0 offset from the object That will
+ // be the ISA pointer.
ClassDescriptorSP objc_class_sp(GetNonKVOClassDescriptor(in_value));
if (objc_class_sp) {
const addr_t object_ptr = in_value.GetPointerValue();
@@ -682,7 +682,7 @@ protected:
if (!arg_str)
continue;
Status error;
- lldb::addr_t arg_addr = Args::StringToAddress(
+ lldb::addr_t arg_addr = OptionArgParser::ToAddress(
&exe_ctx, arg_str, LLDB_INVALID_ADDRESS, &error);
if (arg_addr == 0 || arg_addr == LLDB_INVALID_ADDRESS || error.Fail())
continue;
@@ -771,7 +771,7 @@ public:
void AppleObjCRuntimeV2::Initialize() {
PluginManager::RegisterPlugin(
- GetPluginNameStatic(), "Apple Objective C Language Runtime - Version 2",
+ GetPluginNameStatic(), "Apple Objective-C Language Runtime - Version 2",
CreateInstance,
[](CommandInterpreter &interpreter) -> lldb::CommandObjectSP {
return CommandObjectSP(new CommandObjectMultiwordObjC(interpreter));
@@ -870,8 +870,8 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type,
const char *class_name = parent_ast_type.GetConstTypeName().AsCString();
if (class_name && class_name[0] && ivar_name && ivar_name[0]) {
//----------------------------------------------------------------------
- // Make the objective C V2 mangled name for the ivar offset from the
- // class name and ivar name
+ // Make the objective C V2 mangled name for the ivar offset from the class
+ // name and ivar name
//----------------------------------------------------------------------
std::string buffer("OBJC_IVAR_$_");
buffer.append(class_name);
@@ -880,8 +880,8 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type,
ConstString ivar_const_str(buffer.c_str());
//----------------------------------------------------------------------
- // Try to get the ivar offset address from the symbol table first using
- // the name we created above
+ // Try to get the ivar offset address from the symbol table first using the
+ // name we created above
//----------------------------------------------------------------------
SymbolContextList sc_list;
Target &target = m_process->GetTarget();
@@ -914,11 +914,9 @@ size_t AppleObjCRuntimeV2::GetByteOffsetForIvar(CompilerType &parent_ast_type,
}
// tagged pointers are special not-a-real-pointer values that contain both type
-// and value information
-// this routine attempts to check with as little computational effort as
-// possible whether something
-// could possibly be a tagged pointer - false positives are possible but false
-// negatives shouldn't
+// and value information this routine attempts to check with as little
+// computational effort as possible whether something could possibly be a
+// tagged pointer - false positives are possible but false negatives shouldn't
bool AppleObjCRuntimeV2::IsTaggedPointer(addr_t ptr) {
if (!m_tagged_pointer_vendor_ap)
return false;
@@ -950,11 +948,11 @@ public:
Status err;
// This currently holds true for all platforms we support, but we might
- // need to change this to use get the actually byte size of "unsigned"
- // from the target AST...
+ // need to change this to use get the actually byte size of "unsigned" from
+ // the target AST...
const uint32_t unsigned_byte_size = sizeof(uint32_t);
- // Skip the prototype as we don't need it (const struct +NXMapTablePrototype
- // *prototype)
+ // Skip the prototype as we don't need it (const struct
+ // +NXMapTablePrototype *prototype)
bool success = true;
if (load_addr == LLDB_INVALID_ADDRESS)
@@ -988,8 +986,8 @@ public:
return success;
}
- // const_iterator mimics NXMapState and its code comes from NXInitMapState and
- // NXNextMapState.
+ // const_iterator mimics NXMapState and its code comes from NXInitMapState
+ // and NXNextMapState.
typedef std::pair<ConstString, ObjCLanguageRuntime::ObjCISA> element;
friend class const_iterator;
@@ -1132,8 +1130,8 @@ bool AppleObjCRuntimeV2::HashTableSignature::NeedsUpdate(
return false; // Failed to parse the header, no need to update anything
}
- // Check with out current signature and return true if the count,
- // number of buckets or the hash table address changes.
+ // Check with out current signature and return true if the count, number of
+ // buckets or the hash table address changes.
if (m_count == hash_table.GetCount() &&
m_num_buckets == hash_table.GetBucketCount() &&
m_buckets_ptr == hash_table.GetBucketDataPointer()) {
@@ -1167,9 +1165,9 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
}
return nullptr;
}
- // if we get an invalid VO (which might still happen when playing around
- // with pointers returned by the expression parser, don't consider this
- // a valid ObjC object)
+ // if we get an invalid VO (which might still happen when playing around with
+ // pointers returned by the expression parser, don't consider this a valid
+ // ObjC object)
if (valobj.GetCompilerType().IsValid()) {
addr_t isa_pointer = valobj.GetPointerValue();
@@ -1200,6 +1198,38 @@ AppleObjCRuntimeV2::GetClassDescriptor(ValueObject &valobj) {
return objc_class_sp;
}
+lldb::addr_t AppleObjCRuntimeV2::GetTaggedPointerObfuscator() {
+ if (m_tagged_pointer_obfuscator != LLDB_INVALID_ADDRESS)
+ return m_tagged_pointer_obfuscator;
+
+
+ Process *process = GetProcess();
+ ModuleSP objc_module_sp(GetObjCModule());
+
+ if (!objc_module_sp)
+ return LLDB_INVALID_ADDRESS;
+
+ static ConstString g_gdb_objc_obfuscator("objc_debug_taggedpointer_obfuscator");
+
+ const Symbol *symbol = objc_module_sp->FindFirstSymbolWithNameAndType(
+ g_gdb_objc_obfuscator, lldb::eSymbolTypeAny);
+ if (symbol) {
+ lldb::addr_t g_gdb_obj_obfuscator_ptr =
+ symbol->GetLoadAddress(&process->GetTarget());
+
+ if (g_gdb_obj_obfuscator_ptr != LLDB_INVALID_ADDRESS) {
+ Status error;
+ m_tagged_pointer_obfuscator = process->ReadPointerFromMemory(
+ g_gdb_obj_obfuscator_ptr, error);
+ }
+ }
+ // If we don't have a correct value at this point, there must be no obfuscation.
+ if (m_tagged_pointer_obfuscator == LLDB_INVALID_ADDRESS)
+ m_tagged_pointer_obfuscator = 0;
+
+ return m_tagged_pointer_obfuscator;
+}
+
lldb::addr_t AppleObjCRuntimeV2::GetISAHashTablePointer() {
if (m_isa_hash_table_ptr == LLDB_INVALID_ADDRESS) {
Process *process = GetProcess();
@@ -1359,8 +1389,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapDynamic(
arguments.GetValueAtIndex(1)->GetScalar() = class_infos_addr;
arguments.GetValueAtIndex(2)->GetScalar() = class_infos_byte_size;
- // Only dump the runtime classes from the expression evaluation if the
- // log is verbose:
+ // Only dump the runtime classes from the expression evaluation if the log is
+ // verbose:
Log *type_log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES);
bool dump_log = type_log && type_log->GetVerbose();
@@ -1440,7 +1470,8 @@ uint32_t AppleObjCRuntimeV2::ParseClassInfoArray(const DataExtractor &data,
// uint32_t hash;
// } __attribute__((__packed__));
- Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_TYPES));
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES));
+ bool should_log = log && log->GetVerbose();
uint32_t num_parsed = 0;
@@ -1450,15 +1481,15 @@ uint32_t AppleObjCRuntimeV2::ParseClassInfoArray(const DataExtractor &data,
ObjCISA isa = data.GetPointer(&offset);
if (isa == 0) {
- if (log)
+ if (should_log)
log->Printf(
"AppleObjCRuntimeV2 found NULL isa, ignoring this class info");
continue;
}
- // Check if we already know about this ISA, if we do, the info will
- // never change, so we can just skip it.
+ // Check if we already know about this ISA, if we do, the info will never
+ // change, so we can just skip it.
if (ISAIsCached(isa)) {
- if (log)
+ if (should_log)
log->Printf("AppleObjCRuntimeV2 found cached isa=0x%" PRIx64
", ignoring this class info",
isa);
@@ -1469,14 +1500,14 @@ uint32_t AppleObjCRuntimeV2::ParseClassInfoArray(const DataExtractor &data,
ClassDescriptorSP descriptor_sp(new ClassDescriptorV2(*this, isa, NULL));
AddClass(isa, descriptor_sp, name_hash);
num_parsed++;
- if (log)
+ if (should_log)
log->Printf("AppleObjCRuntimeV2 added isa=0x%" PRIx64
", hash=0x%8.8x, name=%s",
isa, name_hash,
descriptor_sp->GetClassName().AsCString("<unknown>"));
}
}
- if (log)
+ if (should_log)
log->Printf("AppleObjCRuntimeV2 parsed %" PRIu32 " class infos",
num_parsed);
return num_parsed;
@@ -1607,8 +1638,8 @@ AppleObjCRuntimeV2::UpdateISAToDescriptorMapSharedCache() {
arguments.GetValueAtIndex(0)->GetScalar() = objc_opt_ptr;
arguments.GetValueAtIndex(1)->GetScalar() = class_infos_addr;
arguments.GetValueAtIndex(2)->GetScalar() = class_infos_byte_size;
- // Only dump the runtime classes from the expression evaluation if the
- // log is verbose:
+ // Only dump the runtime classes from the expression evaluation if the log is
+ // verbose:
Log *type_log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_TYPES);
bool dump_log = type_log && type_log->GetVerbose();
@@ -1788,21 +1819,17 @@ void AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded() {
DescriptorMapUpdateResult dynamic_update_result =
UpdateISAToDescriptorMapDynamic(hash_table);
- // Now get the objc classes that are baked into the Objective C runtime
- // in the shared cache, but only once per process as this data never
- // changes
+ // Now get the objc classes that are baked into the Objective-C runtime in
+ // the shared cache, but only once per process as this data never changes
if (!m_loaded_objc_opt) {
// it is legitimately possible for the shared cache to be empty - in that
- // case, the dynamic hash table
- // will contain all the class information we need; the situation we're
- // trying to detect is one where
- // we aren't seeing class information from the runtime - in order to
- // detect that vs. just the shared cache
- // being empty or sparsely populated, we set an arbitrary (very low)
- // threshold for the number of classes
- // that we want to see in a "good" scenario - anything below that is
- // suspicious (Foundation alone has thousands
- // of classes)
+ // case, the dynamic hash table will contain all the class information we
+ // need; the situation we're trying to detect is one where we aren't
+ // seeing class information from the runtime - in order to detect that
+ // vs. just the shared cache being empty or sparsely populated, we set an
+ // arbitrary (very low) threshold for the number of classes that we want
+ // to see in a "good" scenario - anything below that is suspicious
+ // (Foundation alone has thousands of classes)
const uint32_t num_classes_to_warn_at = 500;
DescriptorMapUpdateResult shared_cache_update_result =
@@ -2089,8 +2116,8 @@ AppleObjCRuntimeV2::TaggedPointerVendorV2::CreateInstance(
if (error.Fail())
return new TaggedPointerVendorLegacy(runtime);
- // try to detect the "extended tagged pointer" variables - if any are missing,
- // use the non-extended vendor
+ // try to detect the "extended tagged pointer" variables - if any are
+ // missing, use the non-extended vendor
do {
auto objc_debug_taggedpointer_ext_mask = ExtractRuntimeGlobalSymbol(
process, ConstString("objc_debug_taggedpointer_ext_mask"),
@@ -2143,8 +2170,8 @@ AppleObjCRuntimeV2::TaggedPointerVendorV2::CreateInstance(
objc_debug_taggedpointer_classes, objc_debug_taggedpointer_ext_classes);
} while (false);
- // we might want to have some rules to outlaw these values (e.g if the table's
- // address is zero)
+ // we might want to have some rules to outlaw these values (e.g if the
+ // table's address is zero)
return new TaggedPointerVendorRuntimeAssisted(
runtime, objc_debug_taggedpointer_mask,
@@ -2217,7 +2244,9 @@ AppleObjCRuntimeV2::TaggedPointerVendorLegacy::GetClassDescriptor(
return ObjCLanguageRuntime::ClassDescriptorSP();
}
}
- return ClassDescriptorSP(new ClassDescriptorV2Tagged(name, ptr));
+
+ lldb::addr_t unobfuscated = ptr ^ m_runtime.GetTaggedPointerObfuscator();
+ return ClassDescriptorSP(new ClassDescriptorV2Tagged(name, unobfuscated));
}
AppleObjCRuntimeV2::TaggedPointerVendorRuntimeAssisted::
@@ -2249,8 +2278,9 @@ AppleObjCRuntimeV2::TaggedPointerVendorRuntimeAssisted::GetClassDescriptor(
lldb::addr_t ptr) {
ClassDescriptorSP actual_class_descriptor_sp;
uint64_t data_payload;
+ uint64_t unobfuscated = (ptr) ^ m_runtime.GetTaggedPointerObfuscator();
- if (!IsPossibleTaggedPointer(ptr))
+ if (!IsPossibleTaggedPointer(unobfuscated))
return ObjCLanguageRuntime::ClassDescriptorSP();
uintptr_t slot = (ptr >> m_objc_debug_taggedpointer_slot_shift) &
@@ -2276,7 +2306,7 @@ AppleObjCRuntimeV2::TaggedPointerVendorRuntimeAssisted::GetClassDescriptor(
}
data_payload =
- (((uint64_t)ptr << m_objc_debug_taggedpointer_payload_lshift) >>
+ (((uint64_t)unobfuscated << m_objc_debug_taggedpointer_payload_lshift) >>
m_objc_debug_taggedpointer_payload_rshift);
return ClassDescriptorSP(
@@ -2333,11 +2363,12 @@ AppleObjCRuntimeV2::TaggedPointerVendorExtended::GetClassDescriptor(
lldb::addr_t ptr) {
ClassDescriptorSP actual_class_descriptor_sp;
uint64_t data_payload;
+ uint64_t unobfuscated = (ptr) ^ m_runtime.GetTaggedPointerObfuscator();
- if (!IsPossibleTaggedPointer(ptr))
+ if (!IsPossibleTaggedPointer(unobfuscated))
return ObjCLanguageRuntime::ClassDescriptorSP();
- if (!IsPossibleExtendedTaggedPointer(ptr))
+ if (!IsPossibleExtendedTaggedPointer(unobfuscated))
return this->TaggedPointerVendorRuntimeAssisted::GetClassDescriptor(ptr);
uintptr_t slot = (ptr >> m_objc_debug_taggedpointer_ext_slot_shift) &
@@ -2363,7 +2394,7 @@ AppleObjCRuntimeV2::TaggedPointerVendorExtended::GetClassDescriptor(
}
data_payload =
- (((uint64_t)ptr << m_objc_debug_taggedpointer_ext_payload_lshift) >>
+ (((uint64_t)unobfuscated << m_objc_debug_taggedpointer_ext_payload_lshift) >>
m_objc_debug_taggedpointer_ext_payload_rshift);
return ClassDescriptorSP(
@@ -2414,11 +2445,10 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
if ((isa & ~m_objc_debug_isa_class_mask) == 0)
return false;
- // If all of the indexed ISA variables are set, then its possible that
- // this ISA is indexed, and we should first try to get its value using
- // the index.
- // Note, we check these varaibles first as the ObjC runtime will set at
- // least one of their values to 0 if they aren't needed.
+ // If all of the indexed ISA variables are set, then its possible that this
+ // ISA is indexed, and we should first try to get its value using the index.
+ // Note, we check these varaibles first as the ObjC runtime will set at least
+ // one of their values to 0 if they aren't needed.
if (m_objc_debug_indexed_isa_magic_mask &&
m_objc_debug_indexed_isa_magic_value &&
m_objc_debug_indexed_isa_index_mask &&
@@ -2431,10 +2461,10 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
// Magic bits are correct, so try extract the index.
uintptr_t index = (isa & m_objc_debug_indexed_isa_index_mask) >>
m_objc_debug_indexed_isa_index_shift;
- // If the index is out of bounds of the length of the array then
- // check if the array has been updated. If that is the case then
- // we should try read the count again, and update the cache if the
- // count has been updated.
+ // If the index is out of bounds of the length of the array then check if
+ // the array has been updated. If that is the case then we should try
+ // read the count again, and update the cache if the count has been
+ // updated.
if (index > m_indexed_isa_cache.size()) {
if (log)
log->Printf("AOCRT::NPI (index = %" PRIu64
@@ -2459,9 +2489,9 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
(uint64_t)objc_indexed_classes_count);
if (objc_indexed_classes_count > m_indexed_isa_cache.size()) {
- // Read the class entries we don't have. We should just
- // read all of them instead of just the one we need as then
- // we can cache those we may need later.
+ // Read the class entries we don't have. We should just read all of
+ // them instead of just the one we need as then we can cache those we
+ // may need later.
auto num_new_classes =
objc_indexed_classes_count - m_indexed_isa_cache.size();
const uint32_t addr_size = process->GetAddressByteSize();
@@ -2504,8 +2534,8 @@ bool AppleObjCRuntimeV2::NonPointerISACache::EvaluateNonPointerISA(
return false;
}
- // Definately not an indexed ISA, so try to use a mask to extract
- // the pointer from the ISA.
+ // Definately not an indexed ISA, so try to use a mask to extract the pointer
+ // from the ISA.
if ((isa & m_objc_debug_isa_magic_mask) == m_objc_debug_isa_magic_value) {
ret_isa = isa & m_objc_debug_isa_class_mask;
return (ret_isa != 0); // this is a pointer so 0 is not a valid value
@@ -2533,14 +2563,14 @@ bool AppleObjCRuntimeV2::GetCFBooleanValuesIfNeeded() {
if (m_CFBoolean_values)
return true;
- static ConstString g_kCFBooleanFalse("kCFBooleanFalse");
- static ConstString g_kCFBooleanTrue("kCFBooleanTrue");
+ static ConstString g_kCFBooleanFalse("__kCFBooleanFalse");
+ static ConstString g_kCFBooleanTrue("__kCFBooleanTrue");
std::function<lldb::addr_t(ConstString)> get_symbol =
[this](ConstString sym) -> lldb::addr_t {
SymbolContextList sc_list;
if (GetProcess()->GetTarget().GetImages().FindSymbolsWithNameAndType(
- g_kCFBooleanFalse, lldb::eSymbolTypeData, sc_list) == 1) {
+ sym, lldb::eSymbolTypeData, sc_list) == 1) {
SymbolContext sc;
sc_list.GetContextAtIndex(0, sc);
if (sc.symbol)
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
index 89e81d5b181e..487b67ca6271 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
@@ -94,6 +94,8 @@ public:
return m_tagged_pointer_vendor_ap.get();
}
+ lldb::addr_t GetTaggedPointerObfuscator();
+
void GetValuesForGlobalCFBooleans(lldb::addr_t &cf_true,
lldb::addr_t &cf_false) override;
@@ -330,6 +332,7 @@ private:
std::mutex m_get_shared_cache_class_info_args_mutex;
std::unique_ptr<DeclVendor> m_decl_vendor_ap;
+ lldb::addr_t m_tagged_pointer_obfuscator;
lldb::addr_t m_isa_hash_table_ptr;
HashTableSignature m_hash_signature;
bool m_has_object_getClass;
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
index a6e9c0c16f16..c75fa71ba131 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
@@ -49,227 +49,237 @@ const char *AppleObjCTrampolineHandler::g_lookup_implementation_function_name =
const char *AppleObjCTrampolineHandler::
g_lookup_implementation_with_stret_function_code =
" \n\
-extern \"C\" \n\
-{ \n\
- extern void *class_getMethodImplementation(void *objc_class, void *sel); \n\
- extern void *class_getMethodImplementation_stret(void *objc_class, void *sel); \n\
- extern void * object_getClass (id object); \n\
- extern void * sel_getUid(char *name); \n\
- extern int printf(const char *format, ...); \n\
-} \n\
-extern \"C\" void * __lldb_objc_find_implementation_for_selector (void *object, \n\
- void *sel, \n\
- int is_stret, \n\
- int is_super, \n\
- int is_super2, \n\
- int is_fixup, \n\
- int is_fixed, \n\
- int debug) \n\
-{ \n\
- struct __lldb_imp_return_struct \n\
- { \n\
- void *class_addr; \n\
- void *sel_addr; \n\
- void *impl_addr; \n\
- }; \n\
- \n\
- struct __lldb_objc_class { \n\
- void *isa; \n\
- void *super_ptr; \n\
- }; \n\
- struct __lldb_objc_super { \n\
- void *reciever; \n\
- struct __lldb_objc_class *class_ptr; \n\
- }; \n\
- struct __lldb_msg_ref { \n\
- void *dont_know; \n\
- void *sel; \n\
- }; \n\
- \n\
- struct __lldb_imp_return_struct return_struct; \n\
- \n\
- if (debug) \n\
- printf (\"\\n*** Called with obj: 0x%p sel: 0x%p is_stret: %d is_super: %d, \" \n\
- \"is_super2: %d, is_fixup: %d, is_fixed: %d\\n\", \n\
- object, sel, is_stret, is_super, is_super2, is_fixup, is_fixed); \n\
- if (is_super) \n\
- { \n\
- if (is_super2) \n\
- { \n\
- return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr->super_ptr; \n\
- } \n\
- else \n\
- { \n\
- return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr; \n\
- } \n\
- } \n\
- else \n\
- { \n\
- // This code seems a little funny, but has its reasons... \n\
- // The call to [object class] is here because if this is a class, and has not been called into \n\
- // yet, we need to do something to force the class to initialize itself. \n\
- // Then the call to object_getClass will actually return the correct class, either the class \n\
- // if object is a class instance, or the meta-class if it is a class pointer. \n\
- void *class_ptr = (void *) [(id) object class]; \n\
- return_struct.class_addr = (id) object_getClass((id) object); \n\
- if (debug) \n\
- { \n\
- if (class_ptr == object) \n\
- { \n\
- printf (\"Found a class object, need to use the meta class %p -> %p\\n\", \n\
- class_ptr, return_struct.class_addr); \n\
- } \n\
- else \n\
- { \n\
- printf (\"[object class] returned: %p object_getClass: %p.\\n\", \n\
- class_ptr, return_struct.class_addr); \n\
- } \n\
- } \n\
- } \n\
- \n\
- if (is_fixup) \n\
- { \n\
- if (is_fixed) \n\
- { \n\
- return_struct.sel_addr = ((__lldb_msg_ref *) sel)->sel; \n\
- } \n\
- else \n\
- { \n\
- char *sel_name = (char *) ((__lldb_msg_ref *) sel)->sel; \n\
- return_struct.sel_addr = sel_getUid (sel_name); \n\
- if (debug) \n\
- printf (\"\\n*** Got fixed up selector: %p for name %s.\\n\", \n\
- return_struct.sel_addr, sel_name); \n\
- } \n\
- } \n\
- else \n\
- { \n\
- return_struct.sel_addr = sel; \n\
- } \n\
- \n\
- if (is_stret) \n\
- { \n\
- return_struct.impl_addr = class_getMethodImplementation_stret (return_struct.class_addr, \n\
- return_struct.sel_addr); \n\
- } \n\
- else \n\
- { \n\
- return_struct.impl_addr = class_getMethodImplementation (return_struct.class_addr, \n\
- return_struct.sel_addr); \n\
- } \n\
- if (debug) \n\
- printf (\"\\n*** Returning implementation: %p.\\n\", return_struct.impl_addr); \n\
- \n\
- return return_struct.impl_addr; \n\
-} \n\
+extern \"C\" \n\
+{ \n\
+ extern void *class_getMethodImplementation(void *objc_class, void *sel); \n\
+ extern void *class_getMethodImplementation_stret(void *objc_class, \n\
+ void *sel); \n\
+ extern void * object_getClass (id object); \n\
+ extern void * sel_getUid(char *name); \n\
+ extern int printf(const char *format, ...); \n\
+} \n\
+extern \"C\" void * __lldb_objc_find_implementation_for_selector ( \n\
+ void *object, \n\
+ void *sel, \n\
+ int is_stret, \n\
+ int is_super, \n\
+ int is_super2, \n\
+ int is_fixup, \n\
+ int is_fixed, \n\
+ int debug) \n\
+{ \n\
+ struct __lldb_imp_return_struct \n\
+ { \n\
+ void *class_addr; \n\
+ void *sel_addr; \n\
+ void *impl_addr; \n\
+ }; \n\
+ \n\
+ struct __lldb_objc_class { \n\
+ void *isa; \n\
+ void *super_ptr; \n\
+ }; \n\
+ struct __lldb_objc_super { \n\
+ void *reciever; \n\
+ struct __lldb_objc_class *class_ptr; \n\
+ }; \n\
+ struct __lldb_msg_ref { \n\
+ void *dont_know; \n\
+ void *sel; \n\
+ }; \n\
+ \n\
+ struct __lldb_imp_return_struct return_struct; \n\
+ \n\
+ if (debug) \n\
+ printf (\"\\n*** Called with obj: 0x%p sel: 0x%p is_stret: %d is_super: %d, \"\n\
+ \"is_super2: %d, is_fixup: %d, is_fixed: %d\\n\", \n\
+ object, sel, is_stret, is_super, is_super2, is_fixup, is_fixed);\n\
+ if (is_super) \n\
+ { \n\
+ if (is_super2) \n\
+ { \n\
+ return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr->super_ptr;\n\
+ } \n\
+ else \n\
+ { \n\
+ return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr;\n\
+ } \n\
+ } \n\
+ else \n\
+ { \n\
+ // This code seems a little funny, but has its reasons... \n\
+ \n\
+ // The call to [object class] is here because if this is a \n\
+ // class, and has not been called into yet, we need to do \n\
+ // something to force the class to initialize itself. \n\
+ // Then the call to object_getClass will actually return the \n\
+ // correct class, either the class if object is a class \n\
+ // instance, or the meta-class if it is a class pointer. \n\
+ void *class_ptr = (void *) [(id) object class]; \n\
+ return_struct.class_addr = (id) object_getClass((id) object); \n\
+ if (debug) \n\
+ { \n\
+ if (class_ptr == object) \n\
+ { \n\
+ printf (\"Found a class object, need to use the meta class %p -> %p\\n\",\n\
+ class_ptr, return_struct.class_addr); \n\
+ } \n\
+ else \n\
+ { \n\
+ printf (\"[object class] returned: %p object_getClass: %p.\\n\", \n\
+ class_ptr, return_struct.class_addr); \n\
+ } \n\
+ } \n\
+ } \n\
+ \n\
+ if (is_fixup) \n\
+ { \n\
+ if (is_fixed) \n\
+ { \n\
+ return_struct.sel_addr = ((__lldb_msg_ref *) sel)->sel; \n\
+ } \n\
+ else \n\
+ { \n\
+ char *sel_name = (char *) ((__lldb_msg_ref *) sel)->sel; \n\
+ return_struct.sel_addr = sel_getUid (sel_name); \n\
+ if (debug) \n\
+ printf (\"\\n*** Got fixed up selector: %p for name %s.\\n\",\n\
+ return_struct.sel_addr, sel_name); \n\
+ } \n\
+ } \n\
+ else \n\
+ { \n\
+ return_struct.sel_addr = sel; \n\
+ } \n\
+ \n\
+ if (is_stret) \n\
+ { \n\
+ return_struct.impl_addr = \n\
+ class_getMethodImplementation_stret (return_struct.class_addr, \n\
+ return_struct.sel_addr); \n\
+ } \n\
+ else \n\
+ { \n\
+ return_struct.impl_addr = \n\
+ class_getMethodImplementation (return_struct.class_addr, \n\
+ return_struct.sel_addr); \n\
+ } \n\
+ if (debug) \n\
+ printf (\"\\n*** Returning implementation: %p.\\n\", \n\
+ return_struct.impl_addr); \n\
+ \n\
+ return return_struct.impl_addr; \n\
+} \n\
";
const char *
AppleObjCTrampolineHandler::g_lookup_implementation_no_stret_function_code =
" \n\
-extern \"C\" \n\
-{ \n\
- extern void *class_getMethodImplementation(void *objc_class, void *sel); \n\
- extern void * object_getClass (id object); \n\
- extern void * sel_getUid(char *name); \n\
- extern int printf(const char *format, ...); \n\
-} \n\
+extern \"C\" \n\
+{ \n\
+ extern void *class_getMethodImplementation(void *objc_class, void *sel); \n\
+ extern void * object_getClass (id object); \n\
+ extern void * sel_getUid(char *name); \n\
+ extern int printf(const char *format, ...); \n\
+} \n\
extern \"C\" void * __lldb_objc_find_implementation_for_selector (void *object, \n\
- void *sel, \n\
- int is_stret, \n\
- int is_super, \n\
- int is_super2, \n\
- int is_fixup, \n\
- int is_fixed, \n\
- int debug) \n\
-{ \n\
- struct __lldb_imp_return_struct \n\
- { \n\
- void *class_addr; \n\
- void *sel_addr; \n\
- void *impl_addr; \n\
- }; \n\
- \n\
- struct __lldb_objc_class { \n\
- void *isa; \n\
- void *super_ptr; \n\
- }; \n\
- struct __lldb_objc_super { \n\
- void *reciever; \n\
- struct __lldb_objc_class *class_ptr; \n\
- }; \n\
- struct __lldb_msg_ref { \n\
- void *dont_know; \n\
- void *sel; \n\
- }; \n\
- \n\
- struct __lldb_imp_return_struct return_struct; \n\
- \n\
- if (debug) \n\
+ void *sel, \n\
+ int is_stret, \n\
+ int is_super, \n\
+ int is_super2, \n\
+ int is_fixup, \n\
+ int is_fixed, \n\
+ int debug) \n\
+{ \n\
+ struct __lldb_imp_return_struct \n\
+ { \n\
+ void *class_addr; \n\
+ void *sel_addr; \n\
+ void *impl_addr; \n\
+ }; \n\
+ \n\
+ struct __lldb_objc_class { \n\
+ void *isa; \n\
+ void *super_ptr; \n\
+ }; \n\
+ struct __lldb_objc_super { \n\
+ void *reciever; \n\
+ struct __lldb_objc_class *class_ptr; \n\
+ }; \n\
+ struct __lldb_msg_ref { \n\
+ void *dont_know; \n\
+ void *sel; \n\
+ }; \n\
+ \n\
+ struct __lldb_imp_return_struct return_struct; \n\
+ \n\
+ if (debug) \n\
printf (\"\\n*** Called with obj: 0x%p sel: 0x%p is_stret: %d is_super: %d, \" \n\
- \"is_super2: %d, is_fixup: %d, is_fixed: %d\\n\", \n\
+ \"is_super2: %d, is_fixup: %d, is_fixed: %d\\n\", \n\
object, sel, is_stret, is_super, is_super2, is_fixup, is_fixed); \n\
- if (is_super) \n\
- { \n\
- if (is_super2) \n\
- { \n\
+ if (is_super) \n\
+ { \n\
+ if (is_super2) \n\
+ { \n\
return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr->super_ptr; \n\
- } \n\
- else \n\
- { \n\
+ } \n\
+ else \n\
+ { \n\
return_struct.class_addr = ((__lldb_objc_super *) object)->class_ptr; \n\
- } \n\
- } \n\
- else \n\
- { \n\
- // This code seems a little funny, but has its reasons... \n\
+ } \n\
+ } \n\
+ else \n\
+ { \n\
+ // This code seems a little funny, but has its reasons... \n\
// The call to [object class] is here because if this is a class, and has not been called into \n\
// yet, we need to do something to force the class to initialize itself. \n\
// Then the call to object_getClass will actually return the correct class, either the class \n\
// if object is a class instance, or the meta-class if it is a class pointer. \n\
- void *class_ptr = (void *) [(id) object class]; \n\
- return_struct.class_addr = (id) object_getClass((id) object); \n\
- if (debug) \n\
- { \n\
- if (class_ptr == object) \n\
- { \n\
+ void *class_ptr = (void *) [(id) object class]; \n\
+ return_struct.class_addr = (id) object_getClass((id) object); \n\
+ if (debug) \n\
+ { \n\
+ if (class_ptr == object) \n\
+ { \n\
printf (\"Found a class object, need to return the meta class %p -> %p\\n\", \n\
- class_ptr, return_struct.class_addr); \n\
- } \n\
- else \n\
- { \n\
+ class_ptr, return_struct.class_addr); \n\
+ } \n\
+ else \n\
+ { \n\
printf (\"[object class] returned: %p object_getClass: %p.\\n\", \n\
- class_ptr, return_struct.class_addr); \n\
- } \n\
- } \n\
- } \n\
- \n\
- if (is_fixup) \n\
- { \n\
- if (is_fixed) \n\
- { \n\
- return_struct.sel_addr = ((__lldb_msg_ref *) sel)->sel; \n\
- } \n\
- else \n\
- { \n\
- char *sel_name = (char *) ((__lldb_msg_ref *) sel)->sel; \n\
- return_struct.sel_addr = sel_getUid (sel_name); \n\
- if (debug) \n\
- printf (\"\\n*** Got fixed up selector: %p for name %s.\\n\", \n\
- return_struct.sel_addr, sel_name); \n\
- } \n\
- } \n\
- else \n\
- { \n\
- return_struct.sel_addr = sel; \n\
- } \n\
- \n\
- return_struct.impl_addr = class_getMethodImplementation (return_struct.class_addr, \n\
- return_struct.sel_addr); \n\
- if (debug) \n\
- printf (\"\\n*** Returning implementation: 0x%p.\\n\", return_struct.impl_addr); \n\
- \n\
- return return_struct.impl_addr; \n\
-} \n\
+ class_ptr, return_struct.class_addr); \n\
+ } \n\
+ } \n\
+ } \n\
+ \n\
+ if (is_fixup) \n\
+ { \n\
+ if (is_fixed) \n\
+ { \n\
+ return_struct.sel_addr = ((__lldb_msg_ref *) sel)->sel; \n\
+ } \n\
+ else \n\
+ { \n\
+ char *sel_name = (char *) ((__lldb_msg_ref *) sel)->sel; \n\
+ return_struct.sel_addr = sel_getUid (sel_name); \n\
+ if (debug) \n\
+ printf (\"\\n*** Got fixed up selector: %p for name %s.\\n\",\n\
+ return_struct.sel_addr, sel_name); \n\
+ } \n\
+ } \n\
+ else \n\
+ { \n\
+ return_struct.sel_addr = sel; \n\
+ } \n\
+ \n\
+ return_struct.impl_addr = \n\
+ class_getMethodImplementation (return_struct.class_addr, \n\
+ return_struct.sel_addr); \n\
+ if (debug) \n\
+ printf (\"\\n*** Returning implementation: 0x%p.\\n\", \n\
+ return_struct.impl_addr); \n\
+ \n\
+ return return_struct.impl_addr; \n\
+} \n\
";
AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::VTableRegion(
@@ -328,12 +338,11 @@ void AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion() {
// uint32_t offset
// uint32_t flags
//
- // Where offset is either 0 - in which case it is unused, or
- // it is the offset of the vtable code from the beginning of the descriptor
- // record.
- // Below, we'll convert that into an absolute code address, since I don't want
- // to have
- // to compute it over and over.
+ // Where offset is either 0 - in which case it is unused, or it is
+ // the offset of the vtable code from the beginning of the
+ // descriptor record. Below, we'll convert that into an absolute
+ // code address, since I don't want to have to compute it over and
+ // over.
// Ingest the whole descriptor array:
const lldb::addr_t desc_ptr = m_header_addr + header_size;
@@ -370,10 +379,9 @@ void AppleObjCTrampolineHandler::AppleObjCVTables::VTableRegion::SetUpRegion() {
offset = start_offset + descriptor_size;
}
- // Finally, a little bird told me that all the vtable code blocks are the same
- // size.
- // Let's compute the blocks and if they are all the same add the size to the
- // code end address:
+ // Finally, a little bird told me that all the vtable code blocks
+ // are the same size. Let's compute the blocks and if they are all
+ // the same add the size to the code end address:
lldb::addr_t code_size = 0;
bool all_the_same = true;
for (size_t i = 0; i < num_descriptors - 1; i++) {
@@ -548,9 +556,8 @@ bool AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(
}
bool AppleObjCTrampolineHandler::AppleObjCVTables::ReadRegions() {
- // The no argument version reads the start region from the value of the
- // gdb_regions_header, and
- // gets started from there.
+ // The no argument version reads the start region from the value of
+ // the gdb_regions_header, and gets started from there.
m_regions.clear();
if (!InitializeVTableSymbols())
@@ -718,13 +725,12 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(
g_lookup_implementation_with_stret_function_code;
}
- // Look up the addresses for the objc dispatch functions and cache them. For
- // now I'm inspecting the symbol
- // names dynamically to figure out how to dispatch to them. If it becomes
- // more complicated than this we can
- // turn the g_dispatch_functions char * array into a template table, and
- // populate the DispatchFunction map
- // from there.
+ // Look up the addresses for the objc dispatch functions and cache
+ // them. For now I'm inspecting the symbol names dynamically to
+ // figure out how to dispatch to them. If it becomes more
+ // complicated than this we can turn the g_dispatch_functions char *
+ // array into a template table, and populate the DispatchFunction
+ // map from there.
for (size_t i = 0; i != llvm::array_lengthof(g_dispatch_functions); i++) {
ConstString name_const_str(g_dispatch_functions[i].name);
@@ -732,11 +738,11 @@ AppleObjCTrampolineHandler::AppleObjCTrampolineHandler(
m_objc_module_sp->FindFirstSymbolWithNameAndType(name_const_str,
eSymbolTypeCode);
if (msgSend_symbol && msgSend_symbol->ValueIsAddress()) {
- // FixMe: Make g_dispatch_functions static table of DispatchFunctions, and
- // have the map be address->index.
- // Problem is we also need to lookup the dispatch function. For now we
- // could have a side table of stret & non-stret
- // dispatch functions. If that's as complex as it gets, we're fine.
+ // FIXME: Make g_dispatch_functions static table of
+ // DispatchFunctions, and have the map be address->index.
+ // Problem is we also need to lookup the dispatch function. For
+ // now we could have a side table of stret & non-stret dispatch
+ // functions. If that's as complex as it gets, we're fine.
lldb::addr_t sym_addr =
msgSend_symbol->GetAddressRef().GetOpcodeLoadAddress(target);
@@ -820,11 +826,11 @@ AppleObjCTrampolineHandler::SetupDispatchFunction(Thread &thread,
diagnostics.Clear();
- // Now write down the argument values for this particular call. This looks
- // like it might be a race condition
- // if other threads were calling into here, but actually it isn't because we
- // allocate a new args structure for
- // this call by passing args_addr = LLDB_INVALID_ADDRESS...
+ // Now write down the argument values for this particular call.
+ // This looks like it might be a race condition if other threads
+ // were calling into here, but actually it isn't because we allocate
+ // a new args structure for this call by passing args_addr =
+ // LLDB_INVALID_ADDRESS...
if (!impl_function_caller->WriteFunctionArguments(
exe_ctx, args_addr, dispatch_values, diagnostics)) {
@@ -847,9 +853,9 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
DispatchFunction this_dispatch;
bool found_it = false;
- // First step is to look and see if we are in one of the known ObjC dispatch
- // functions. We've already compiled
- // a table of same, so consult it.
+ // First step is to look and see if we are in one of the known ObjC
+ // dispatch functions. We've already compiled a table of same, so
+ // consult it.
MsgsendMap::iterator pos;
pos = m_msgSend_map.find(curr_pc);
@@ -879,8 +885,8 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
if (found_it) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
- // We are decoding a method dispatch.
- // First job is to pull the arguments out:
+ // We are decoding a method dispatch. First job is to pull the
+ // arguments out:
lldb::StackFrameSP thread_cur_frame = thread.GetStackFrameAtIndex(0);
@@ -906,10 +912,10 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
int obj_index;
int sel_index;
- // If this is a struct return dispatch, then the first argument is the
- // return struct pointer, and the object is the second, and the selector is
- // the third.
- // Otherwise the object is the first and the selector the second.
+ // If this is a struct return dispatch, then the first argument is
+ // the return struct pointer, and the object is the second, and
+ // the selector is the third. Otherwise the object is the first
+ // and the selector the second.
if (this_dispatch.stret_return) {
obj_index = 1;
sel_index = 2;
@@ -938,29 +944,26 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
ExecutionContext exe_ctx(thread.shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
- // isa_addr will store the class pointer that the method is being dispatched
- // to - so either the class
- // directly or the super class if this is one of the objc_msgSendSuper
- // flavors. That's mostly used to
- // look up the class/selector pair in our cache.
+ // isa_addr will store the class pointer that the method is being
+ // dispatched to - so either the class directly or the super class
+ // if this is one of the objc_msgSendSuper flavors. That's mostly
+ // used to look up the class/selector pair in our cache.
lldb::addr_t isa_addr = LLDB_INVALID_ADDRESS;
lldb::addr_t sel_addr =
argument_values.GetValueAtIndex(sel_index)->GetScalar().ULongLong();
- // Figure out the class this is being dispatched to and see if we've already
- // cached this method call,
- // If so we can push a run-to-address plan directly. Otherwise we have to
- // figure out where
- // the implementation lives.
+ // Figure out the class this is being dispatched to and see if
+ // we've already cached this method call, If so we can push a
+ // run-to-address plan directly. Otherwise we have to figure out
+ // where the implementation lives.
if (this_dispatch.is_super) {
if (this_dispatch.is_super2) {
- // In the objc_msgSendSuper2 case, we don't get the object directly, we
- // get a structure containing
- // the object and the class to which the super message is being sent.
- // So we need to dig the super
- // out of the class and use that.
+ // In the objc_msgSendSuper2 case, we don't get the object
+ // directly, we get a structure containing the object and the
+ // class to which the super message is being sent. So we need
+ // to dig the super out of the class and use that.
Value super_value(*(argument_values.GetValueAtIndex(obj_index)));
super_value.GetScalar() += process->GetAddressByteSize();
@@ -984,11 +987,11 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
log->Printf("Failed to extract the class value from objc_super.");
}
} else {
- // In the objc_msgSendSuper case, we don't get the object directly, we
- // get a two element structure containing
- // the object and the super class to which the super message is being
- // sent. So the class we want is
- // the second element of this structure.
+ // In the objc_msgSendSuper case, we don't get the object
+ // directly, we get a two element structure containing the
+ // object and the super class to which the super message is
+ // being sent. So the class we want is the second element of
+ // this structure.
Value super_value(*(argument_values.GetValueAtIndex(obj_index)));
super_value.GetScalar() += process->GetAddressByteSize();
@@ -1009,9 +1012,9 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
// making the object value a load address value and resolving it will get
// the pointer sized data pointed to by that value...
- // Note, it isn't a fatal error not to be able to get the address from the
- // object, since this might
- // be a "tagged pointer" which isn't a real object, but rather some word
+ // Note, it isn't a fatal error not to be able to get the
+ // address from the object, since this might be a "tagged
+ // pointer" which isn't a real object, but rather some word
// length encoded dingus.
Value isa_value(*(argument_values.GetValueAtIndex(obj_index)));
@@ -1126,9 +1129,9 @@ AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(Thread &thread,
flag_value.GetScalar() = 0; // FIXME - Set to 0 when debugging is done.
dispatch_values.PushValue(flag_value);
- // The step through code might have to fill in the cache, so it is not
- // safe to run only one thread.
- // So we override the stop_others value passed in to us here:
+ // The step through code might have to fill in the cache, so it
+ // is not safe to run only one thread. So we override the
+ // stop_others value passed in to us here:
const bool trampoline_stop_others = false;
ret_plan_sp.reset(new AppleThreadPlanStepThroughObjCTrampoline(
thread, this, dispatch_values, isa_addr, sel_addr,
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
index 316115b0dcb1..9bb1a4e0ee42 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.cpp
@@ -105,10 +105,9 @@ clang::QualType AppleObjCTypeEncodingParser::BuildAggregate(
return clang::QualType();
std::string name(ReadStructName(type));
- // We do not handle templated classes/structs at the moment.
- // If the name has a < in it, we are going to abandon this.
- // We're still obliged to parse it, so we just set a flag that
- // means "Don't actually build anything."
+ // We do not handle templated classes/structs at the moment. If the name has
+ // a < in it, we are going to abandon this. We're still obliged to parse it,
+ // so we just set a flag that means "Don't actually build anything."
const bool is_templated = name.find('<') != std::string::npos;
@@ -180,11 +179,9 @@ AppleObjCTypeEncodingParser::BuildArray(clang::ASTContext &ast_ctx,
// the runtime can emit these in the form of @"SomeType", giving more specifics
// this would be interesting for expression parser interop, but since we
-// actually try
-// to avoid exposing the ivar info to the expression evaluator, consume but
-// ignore the type info
-// and always return an 'id'; if anything, dynamic typing will resolve things
-// for us anyway
+// actually try to avoid exposing the ivar info to the expression evaluator,
+// consume but ignore the type info and always return an 'id'; if anything,
+// dynamic typing will resolve things for us anyway
clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
clang::ASTContext &ast_ctx, lldb_utility::StringLexer &type,
bool for_expression) {
@@ -197,24 +194,21 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
// We have to be careful here. We're used to seeing
// @"NSString"
// but in records it is possible that the string following an @ is the name
- // of the next field and @ means "id".
- // This is the case if anything unquoted except for "}", the end of the
- // type, or another name follows the quoted string.
+ // of the next field and @ means "id". This is the case if anything
+ // unquoted except for "}", the end of the type, or another name follows
+ // the quoted string.
//
// E.g.
// - @"NSString"@ means "id, followed by a field named NSString of type id"
- // - @"NSString"} means "a pointer to NSString and the end of the struct"
- // - @"NSString""nextField" means "a pointer to NSString and a field named
- // nextField"
- // - @"NSString" followed by the end of the string means "a pointer to
- // NSString"
+ // - @"NSString"} means "a pointer to NSString and the end of the struct" -
+ // @"NSString""nextField" means "a pointer to NSString and a field named
+ // nextField" - @"NSString" followed by the end of the string means "a
+ // pointer to NSString"
//
// As a result, the rule is: If we see @ followed by a quoted string, we
- // peek.
- // - If we see }, ), ], the end of the string, or a quote ("), the quoted
- // string is a class name.
- // - If we see anything else, the quoted string is a field name and we push
- // it back onto type.
+ // peek. - If we see }, ), ], the end of the string, or a quote ("), the
+ // quoted string is a class name. - If we see anything else, the quoted
+ // string is a field name and we push it back onto type.
name = ReadQuotedString(type);
@@ -260,9 +254,8 @@ clang::QualType AppleObjCTypeEncodingParser::BuildObjCObjectPointerType(
decl_vendor->FindDecls(ConstString(name), append, max_matches, decls);
// The user can forward-declare something that has no definition. The runtime
-// doesn't prohibit this at all.
-// This is a rare and very weird case. We keep this assert in debug builds so
-// we catch other weird cases.
+// doesn't prohibit this at all. This is a rare and very weird case. We keep
+// this assert in debug builds so we catch other weird cases.
#ifdef LLDB_CONFIGURATION_DEBUG
assert(num_types);
#else
@@ -315,8 +308,8 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
// if (!lldb_ctx)
// return clang::QualType();
// return lldb_ctx->GetIntTypeFromBitSize(32, true).GetQualType();
- // which uses one of the constants if one is available, but we don't think all
- // this work is necessary.
+ // which uses one of the constants if one is available, but we don't think
+ // all this work is necessary.
case 'q':
return ast_ctx.LongLongTy;
case 'C':
@@ -364,11 +357,10 @@ AppleObjCTypeEncodingParser::BuildType(clang::ASTContext &ast_ctx,
case '^': {
if (!for_expression && type.NextIf('?')) {
// if we are not supporting the concept of unknownAny, but what is being
- // created here is an unknownAny*, then
- // we can just get away with a void*
+ // created here is an unknownAny*, then we can just get away with a void*
// this is theoretically wrong (in the same sense as 'theoretically
- // nothing exists') but is way better than outright failure
- // in many practical cases
+ // nothing exists') but is way better than outright failure in many
+ // practical cases
return ast_ctx.VoidPtrTy;
} else {
clang::QualType target_type = BuildType(ast_ctx, type, for_expression);
diff --git a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
index a295d1b4ce76..75b670739427 100644
--- a/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
+++ b/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
@@ -52,8 +52,8 @@ AppleThreadPlanStepThroughObjCTrampoline::
void AppleThreadPlanStepThroughObjCTrampoline::DidPush() {
// Setting up the memory space for the called function text might require
- // allocations,
- // i.e. a nested function call. This needs to be done as a PreResumeAction.
+ // allocations, i.e. a nested function call. This needs to be done as a
+ // PreResumeAction.
m_thread.GetProcess()->AddPreResumeAction(PreResumeInitializeFunctionCaller,
(void *)this);
}
@@ -110,8 +110,7 @@ bool AppleThreadPlanStepThroughObjCTrampoline::DoPlanExplainsStop(
Event *event_ptr) {
// If we get asked to explain the stop it will be because something went
// wrong (like the implementation for selector function crashed... We're
- // going
- // to figure out what to do about that, so we do explain the stop.
+ // going to figure out what to do about that, so we do explain the stop.
return true;
}
@@ -135,8 +134,7 @@ bool AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(Event *event_ptr) {
}
// Second stage, if all went well with the function calling, then fetch the
- // target address, and
- // queue up a "run to that address" plan.
+ // target address, and queue up a "run to that address" plan.
if (!m_run_to_sp) {
Value target_addr_value;
ExecutionContext exc_ctx;
@@ -201,8 +199,8 @@ bool AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(Event *event_ptr) {
return false;
}
-// The base class MischiefManaged does some cleanup - so you have to call it
-// in your MischiefManaged derived class.
+// The base class MischiefManaged does some cleanup - so you have to call it in
+// your MischiefManaged derived class.
bool AppleThreadPlanStepThroughObjCTrampoline::MischiefManaged() {
if (IsPlanComplete())
return true;
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
index 654ac9abfcab..cbbc35f1c08a 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.cpp
@@ -38,14 +38,12 @@ using namespace lldb_renderscript;
// [``slang``](https://android.googlesource.com/platform/frameworks/compile/slang),
// the compiler frontend for RenderScript embeds an ARM specific triple in IR
-// that is shipped in the app, after
-// generating IR that has some assumptions that an ARM device is the target.
-// As the IR is then compiled on a device of unknown (at time the IR was
-// generated at least) architecture,
-// when calling RenderScript API function as part of debugger expressions, we
-// have to perform a fixup pass that
-// removes those assumptions right before the module is sent to be generated by
-// the llvm backend.
+// that is shipped in the app, after generating IR that has some assumptions
+// that an ARM device is the target. As the IR is then compiled on a device of
+// unknown (at time the IR was generated at least) architecture, when calling
+// RenderScript API function as part of debugger expressions, we have to
+// perform a fixup pass that removes those assumptions right before the module
+// is sent to be generated by the llvm backend.
namespace {
bool registerRSDefaultTargetOpts(clang::TargetOptions &proto,
@@ -107,10 +105,9 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
case llvm::Triple::ArchType::x86:
changed_module |= fixupX86FunctionCalls(module);
// For some reason this triple gets totally missed by the backend, and must
- // be set manually.
- // There a reference in bcc/Main.cpp about auto feature-detection being
- // removed from LLVM3.5, but I can't
- // see that discussion anywhere public.
+ // be set manually. There a reference in bcc/Main.cpp about auto feature-
+ // detection being removed from LLVM3.5, but I can't see that discussion
+ // anywhere public.
real_triple = "i686--linux-android";
break;
case llvm::Triple::ArchType::x86_64:
@@ -118,12 +115,12 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
break;
case llvm::Triple::ArchType::mipsel:
case llvm::Triple::ArchType::mips64el:
- // No actual IR fixup pass is needed on MIPS, but the datalayout
- // and targetmachine do need to be explicitly set.
+ // No actual IR fixup pass is needed on MIPS, but the datalayout and
+ // targetmachine do need to be explicitly set.
- // bcc explicitly compiles MIPS code to use the static relocation
- // model due to an issue with relocations in mclinker.
- // see libbcc/support/CompilerConfig.cpp for details
+ // bcc explicitly compiles MIPS code to use the static relocation model due
+ // to an issue with relocations in mclinker. see
+ // libbcc/support/CompilerConfig.cpp for details
reloc_model = llvm::Reloc::Static;
changed_module = true;
break;
@@ -146,8 +143,7 @@ bool RenderScriptRuntimeModulePass::runOnModule(llvm::Module &module) {
assert(target_machine &&
"failed to identify RenderScriptRuntime target machine");
// We've been using a triple and datalayout of some ARM variant all along,
- // so
- // we need to let the backend know that this is no longer the case.
+ // so we need to let the backend know that this is no longer the case.
if (log) {
log->Printf("%s - Changing RS target triple to '%s'", __FUNCTION__,
real_triple.str().c_str());
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
index ad1083be0285..4eb15369aa1e 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -26,7 +26,6 @@
#include "lldb/Expression/UserExpression.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Host/StringConvert.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -40,6 +39,7 @@
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/DataBufferLLVM.h"
#include "lldb/Utility/Log.h"
@@ -312,7 +312,8 @@ bool GetArgsMipsel(GetArgsCtx &ctx, ArgItem *arg_list, size_t num_args) {
Status err;
- // find offset to arguments on the stack (+16 to skip over a0-a3 shadow space)
+ // find offset to arguments on the stack (+16 to skip over a0-a3 shadow
+ // space)
uint64_t sp = ctx.reg_ctx->GetSP() + 16;
for (size_t i = 0; i < num_args; ++i) {
@@ -447,12 +448,11 @@ bool IsRenderScriptScriptModule(ModuleSP module) {
}
bool ParseCoordinate(llvm::StringRef coord_s, RSCoordinate &coord) {
- // takes an argument of the form 'num[,num][,num]'.
- // Where 'coord_s' is a comma separated 1,2 or 3-dimensional coordinate
- // with the whitespace trimmed.
- // Missing coordinates are defaulted to zero.
- // If parsing of any elements fails the contents of &coord are undefined
- // and `false` is returned, `true` otherwise
+ // takes an argument of the form 'num[,num][,num]'. Where 'coord_s' is a
+ // comma separated 1,2 or 3-dimensional coordinate with the whitespace
+ // trimmed. Missing coordinates are defaulted to zero. If parsing of any
+ // elements fails the contents of &coord are undefined and `false` is
+ // returned, `true` otherwise
RegularExpression regex;
RegularExpression::Match regex_match(3);
@@ -593,7 +593,7 @@ struct RenderScriptRuntime::Element {
empirical_type<uint32_t> datum_size; // Size of a single Element with padding
empirical_type<uint32_t> padding; // Number of padding bytes
empirical_type<uint32_t>
- array_size; // Number of items in array, only needed for strucrs
+ array_size; // Number of items in array, only needed for structs
ConstString type_name; // Name of type, only needed for structs
static const ConstString &
@@ -633,8 +633,9 @@ struct RenderScriptRuntime::AllocationDetails {
// subelements, there may be more than one instance of the ElementHeader
// struct. With this first instance being the root element, and the other
// instances being the root's descendants. To identify which instances are an
- // ElementHeader's children, each struct is immediately followed by a sequence
- // of consecutive offsets to the start of its child structs. These offsets are
+ // ElementHeader's children, each struct is immediately followed by a
+ // sequence of consecutive offsets to the start of its child structs. These
+ // offsets are
// 4 bytes in size, and the 0 offset signifies no more children.
struct FileHeader {
uint8_t ident[4]; // ASCII 'RSAD' identifying the file
@@ -653,8 +654,8 @@ struct RenderScriptRuntime::AllocationDetails {
// Monotonically increasing from 1
static uint32_t ID;
- // Maps Allocation DataType enum and vector size to printable strings
- // using mapping from RenderScript numerical types summary documentation
+ // Maps Allocation DataType enum and vector size to printable strings using
+ // mapping from RenderScript numerical types summary documentation
static const char *RsDataTypeToString[][4];
// Maps Allocation DataKind enum to printable strings
@@ -844,11 +845,10 @@ RSReduceBreakpointResolver::SearchCallback(lldb_private::SearchFilter &filter,
lldb_private::SymbolContext &context,
Address *, bool) {
// We need to have access to the list of reductions currently parsed, as
- // reduce names don't actually exist as
- // symbols in a module. They are only identifiable by parsing the .rs.info
- // packet, or finding the expand symbol. We
- // therefore need access to the list of parsed rs modules to properly resolve
- // reduction names.
+ // reduce names don't actually exist as symbols in a module. They are only
+ // identifiable by parsing the .rs.info packet, or finding the expand symbol.
+ // We therefore need access to the list of parsed rs modules to properly
+ // resolve reduction names.
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_BREAKPOINTS));
ModuleSP module = context.module_sp;
@@ -967,8 +967,8 @@ Searcher::CallbackReturn RSScriptGroupBreakpointResolver::SearchCallback(
log->Printf("%s: Placed %sbreakpoint on %s", __FUNCTION__,
new_bp ? "new " : "", k.m_name.AsCString());
- // exit after placing the first breakpoint if we do not intend to stop
- // on all kernels making up this script group
+ // exit after placing the first breakpoint if we do not intend to stop on
+ // all kernels making up this script group
if (!m_stop_on_all)
break;
}
@@ -1684,8 +1684,8 @@ void RenderScriptRuntime::FixupScriptDetails(RSModuleDescriptorSP rsmodule_sp) {
const ModuleSP module = rsmodule_sp->m_module;
const FileSpec &file = module->GetPlatformFileSpec();
- // Iterate over all of the scripts that we currently know of.
- // Note: We cant push or pop to m_scripts here or it may invalidate rs_script.
+ // Iterate over all of the scripts that we currently know of. Note: We cant
+ // push or pop to m_scripts here or it may invalidate rs_script.
for (const auto &rs_script : m_scripts) {
// Extract the expected .so file path for this script.
std::string shared_lib;
@@ -1825,9 +1825,9 @@ const char *JITTemplate(ExpressionStrings e) {
// rsaTypeGetNativeData(Context*, Type*, void* typeData, size) Pack the
// data in the following way mHal.state.dimX; mHal.state.dimY;
- // mHal.state.dimZ; mHal.state.lodCount; mHal.state.faces; mElement; into
- // typeData Need to specify 32 or 64 bit for uint_t since this differs
- // between devices
+ // mHal.state.dimZ; mHal.state.lodCount; mHal.state.faces; mElement;
+ // into typeData Need to specify 32 or 64 bit for uint_t since this
+ // differs between devices
JIT_TEMPLATE_CONTEXT
"uint%" PRIu32 "_t data[6]; (void*)rsaTypeGetNativeData(ctxt"
", 0x%" PRIx64 ", data, 6); data[0]", // eExprTypeDimX
@@ -1882,10 +1882,10 @@ const char *JITTemplate(ExpressionStrings e) {
}
} // end of the anonymous namespace
-// JITs the RS runtime for the internal data pointer of an allocation. Is passed
-// x,y,z coordinates for the pointer to a specific element. Then sets the
-// data_ptr member in Allocation with the result. Returns true on success, false
-// otherwise
+// JITs the RS runtime for the internal data pointer of an allocation. Is
+// passed x,y,z coordinates for the pointer to a specific element. Then sets
+// the data_ptr member in Allocation with the result. Returns true on success,
+// false otherwise
bool RenderScriptRuntime::JITDataPointer(AllocationDetails *alloc,
StackFrame *frame_ptr, uint32_t x,
uint32_t y, uint32_t z) {
@@ -1961,8 +1961,8 @@ bool RenderScriptRuntime::JITTypePointer(AllocationDetails *alloc,
}
// JITs the RS runtime for information about the dimensions and type of an
-// allocation Then sets dimension and element_ptr members in Allocation with the
-// result. Returns true on success, false otherwise
+// allocation Then sets dimension and element_ptr members in Allocation with
+// the result. Returns true on success, false otherwise
bool RenderScriptRuntime::JITTypePacked(AllocationDetails *alloc,
StackFrame *frame_ptr) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
@@ -2245,9 +2245,8 @@ bool RenderScriptRuntime::JITAllocationSize(AllocationDetails *alloc,
}
// JITs the RS runtime for information about the stride between rows in the
-// allocation. This is done to detect padding, since allocated memory is 16-byte
-// aligned.
-// Returns true on success, false otherwise
+// allocation. This is done to detect padding, since allocated memory is
+// 16-byte aligned. Returns true on success, false otherwise
bool RenderScriptRuntime::JITAllocationStride(AllocationDetails *alloc,
StackFrame *frame_ptr) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
@@ -2313,9 +2312,8 @@ bool RenderScriptRuntime::RefreshAllocation(AllocationDetails *alloc,
}
// Function attempts to set the type_name member of the paramaterised Element
-// object.
-// This string should be the name of the struct type the Element represents.
-// We need this string for pretty printing the Element to users.
+// object. This string should be the name of the struct type the Element
+// represents. We need this string for pretty printing the Element to users.
void RenderScriptRuntime::FindStructTypeName(Element &elem,
StackFrame *frame_ptr) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
@@ -2330,12 +2328,11 @@ void RenderScriptRuntime::FindStructTypeName(Element &elem,
VariableList var_list;
for (auto module_sp : m_rsmodules)
module_sp->m_module->FindGlobalVariables(
- RegularExpression(llvm::StringRef(".")), true, UINT32_MAX, var_list);
+ RegularExpression(llvm::StringRef(".")), UINT32_MAX, var_list);
// Iterate over all the global variables looking for one with a matching type
- // to the Element.
- // We make the assumption a match exists since there needs to be a global
- // variable to reflect the struct type back into java host code.
+ // to the Element. We make the assumption a match exists since there needs to
+ // be a global variable to reflect the struct type back into java host code.
for (uint32_t i = 0; i < var_list.GetSize(); ++i) {
const VariableSP var_sp(var_list.GetVariableAtIndex(i));
if (!var_sp)
@@ -2347,15 +2344,14 @@ void RenderScriptRuntime::FindStructTypeName(Element &elem,
// Find the number of variable fields.
// If it has no fields, or more fields than our Element, then it can't be
- // the struct we're looking for.
- // Don't check for equality since RS can add extra struct members for
- // padding.
+ // the struct we're looking for. Don't check for equality since RS can add
+ // extra struct members for padding.
size_t num_children = valobj_sp->GetNumChildren();
if (num_children > elem.children.size() || num_children == 0)
continue;
- // Iterate over children looking for members with matching field names.
- // If all the field names match, this is likely the struct we want.
+ // Iterate over children looking for members with matching field names. If
+ // all the field names match, this is likely the struct we want.
// TODO: This could be made more robust by also checking children data
// sizes, or array size
bool found = true;
@@ -2404,8 +2400,8 @@ void RenderScriptRuntime::FindStructTypeName(Element &elem,
}
// Function sets the datum_size member of Element. Representing the size of a
-// single instance including padding.
-// Assumes the relevant allocation information has already been jitted.
+// single instance including padding. Assumes the relevant allocation
+// information has already been jitted.
void RenderScriptRuntime::SetElementSize(Element &elem) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
const Element::DataType type = *elem.type.get();
@@ -2446,9 +2442,9 @@ void RenderScriptRuntime::SetElementSize(Element &elem) {
data_size + padding);
}
-// Given an allocation, this function copies the allocation contents from device
-// into a buffer on the heap.
-// Returning a shared pointer to the buffer containing the data.
+// Given an allocation, this function copies the allocation contents from
+// device into a buffer on the heap. Returning a shared pointer to the buffer
+// containing the data.
std::shared_ptr<uint8_t>
RenderScriptRuntime::GetAllocationData(AllocationDetails *alloc,
StackFrame *frame_ptr) {
@@ -2496,9 +2492,8 @@ RenderScriptRuntime::GetAllocationData(AllocationDetails *alloc,
return buffer;
}
-// Function copies data from a binary file into an allocation.
-// There is a header at the start of the file, FileHeader, before the data
-// content itself.
+// Function copies data from a binary file into an allocation. There is a
+// header at the start of the file, FileHeader, before the data content itself.
// Information from this header is used to display warnings to the user about
// incompatibilities
bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
@@ -2630,7 +2625,8 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
// Calculate size of allocation data in file
size_t size = data_sp->GetByteSize() - file_header->hdr_size;
- // Check if the target allocation and file both have the same total data size.
+ // Check if the target allocation and file both have the same total data
+ // size.
const uint32_t alloc_size = *alloc->size.get();
if (alloc_size != size) {
strm.Printf("Warning: Mismatched allocation sizes - file 0x%" PRIx64
@@ -2660,15 +2656,15 @@ bool RenderScriptRuntime::LoadAllocation(Stream &strm, const uint32_t alloc_id,
// Function takes as parameters a byte buffer, which will eventually be written
// to file as the element header, an offset into that buffer, and an Element
-// that will be saved into the buffer at the parametrised offset.
-// Return value is the new offset after writing the element into the buffer.
-// Elements are saved to the file as the ElementHeader struct followed by
-// offsets to the structs of all the element's children.
+// that will be saved into the buffer at the parametrised offset. Return value
+// is the new offset after writing the element into the buffer. Elements are
+// saved to the file as the ElementHeader struct followed by offsets to the
+// structs of all the element's children.
size_t RenderScriptRuntime::PopulateElementHeaders(
const std::shared_ptr<uint8_t> header_buffer, size_t offset,
const Element &elem) {
- // File struct for an element header with all the relevant details copied from
- // elem. We assume members are valid already.
+ // File struct for an element header with all the relevant details copied
+ // from elem. We assume members are valid already.
AllocationDetails::ElementHeader elem_header;
elem_header.type = *elem.type.get();
elem_header.kind = *elem.type_kind.get();
@@ -2678,9 +2674,8 @@ size_t RenderScriptRuntime::PopulateElementHeaders(
elem.array_size.isValid() ? *elem.array_size.get() : 0;
const size_t elem_header_size = sizeof(AllocationDetails::ElementHeader);
- // Copy struct into buffer and advance offset
- // We assume that header_buffer has been checked for nullptr before this
- // method is called
+ // Copy struct into buffer and advance offset We assume that header_buffer
+ // has been checked for nullptr before this method is called
memcpy(header_buffer.get() + offset, &elem_header, elem_header_size);
offset += elem_header_size;
@@ -2721,8 +2716,8 @@ size_t RenderScriptRuntime::CalculateElementHeaderSize(const Element &elem) {
return size;
}
-// Function copies allocation contents into a binary file. This file can then be
-// loaded later into a different allocation. There is a header, FileHeader,
+// Function copies allocation contents into a binary file. This file can then
+// be loaded later into a different allocation. There is a header, FileHeader,
// before the allocation data containing meta-data.
bool RenderScriptRuntime::SaveAllocation(Stream &strm, const uint32_t alloc_id,
const char *path,
@@ -2852,8 +2847,8 @@ bool RenderScriptRuntime::LoadModule(const lldb::ModuleSP &module_sp) {
if (module_sp) {
for (const auto &rs_module : m_rsmodules) {
if (rs_module->m_module == module_sp) {
- // Check if the user has enabled automatically breaking on
- // all RS kernels.
+ // Check if the user has enabled automatically breaking on all RS
+ // kernels.
if (m_breakAllKernels)
BreakOnModuleKernels(rs_module);
@@ -2975,11 +2970,10 @@ bool RSModuleDescriptor::ParseExportReduceCount(llvm::StringRef *lines,
size_t n_lines) {
// The list of reduction kernels in the `.rs.info` symbol is of the form
// "signature - accumulatordatasize - reduction_name - initializer_name -
- // accumulator_name - combiner_name -
- // outconverter_name - halter_name"
- // Where a function is not explicitly named by the user, or is not generated
- // by the compiler, it is named "." so the
- // dash separated list should always be 8 items long
+ // accumulator_name - combiner_name - outconverter_name - halter_name" Where
+ // a function is not explicitly named by the user, or is not generated by the
+ // compiler, it is named "." so the dash separated list should always be 8
+ // items long
Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE);
// Skip the exportReduceCount line
++lines;
@@ -3069,8 +3063,7 @@ bool RSModuleDescriptor::ParseExportVarCount(llvm::StringRef *lines,
}
// The .rs.info symbol in renderscript modules contains a string which needs to
-// be parsed.
-// The string is basic and is parsed on a line by line basis.
+// be parsed. The string is basic and is parsed on a line by line basis.
bool RSModuleDescriptor::ParseRSInfo() {
assert(m_module);
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANGUAGE));
@@ -3137,8 +3130,8 @@ bool RSModuleDescriptor::ParseRSInfo() {
const auto handler = rs_info_handler(key);
if (handler == -1)
continue;
- // getAsInteger returns `true` on an error condition - we're only interested
- // in numeric fields at the moment
+ // getAsInteger returns `true` on an error condition - we're only
+ // interested in numeric fields at the moment
uint64_t n_lines;
if (val.getAsInteger(10, n_lines)) {
LLDB_LOGV(log, "Failed to parse non-numeric '.rs.info' section {0}",
@@ -3213,9 +3206,8 @@ void RenderScriptRuntime::DumpContexts(Stream &strm) const {
std::map<addr_t, uint64_t> contextReferences;
- // Iterate over all of the currently discovered scripts.
- // Note: We cant push or pop from m_scripts inside this loop or it may
- // invalidate script.
+ // Iterate over all of the currently discovered scripts. Note: We cant push
+ // or pop from m_scripts inside this loop or it may invalidate script.
for (const auto &script : m_scripts) {
if (!script->context.isValid())
continue;
@@ -3393,15 +3385,15 @@ bool RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame *frame_ptr,
if ((type == Element::RS_TYPE_NONE) &&
(alloc->element.children.size() > 0) &&
(alloc->element.type_name != Element::GetFallbackStructName())) {
- // Here we are dumping an Element of struct type.
- // This is done using expression evaluation with the name of the
- // struct type and pointer to element.
- // Don't print the name of the resulting expression, since this will
- // be '$[0-9]+'
+ // Here we are dumping an Element of struct type. This is done using
+ // expression evaluation with the name of the struct type and pointer
+ // to element. Don't print the name of the resulting expression,
+ // since this will be '$[0-9]+'
DumpValueObjectOptions expr_options;
expr_options.SetHideName(true);
- // Setup expression as derefrencing a pointer cast to element address.
+ // Setup expression as dereferencing a pointer cast to element
+ // address.
char expr_char_buffer[jit_max_expr_size];
int written =
snprintf(expr_char_buffer, jit_max_expr_size, "*(%s*) 0x%" PRIx64,
@@ -3435,9 +3427,9 @@ bool RenderScriptRuntime::DumpAllocation(Stream &strm, StackFrame *frame_ptr,
return true;
}
-// Function recalculates all our cached information about allocations by jitting
-// the RS runtime regarding each allocation we know about. Returns true if all
-// allocations could be recomputed, false otherwise.
+// Function recalculates all our cached information about allocations by
+// jitting the RS runtime regarding each allocation we know about. Returns true
+// if all allocations could be recomputed, false otherwise.
bool RenderScriptRuntime::RecomputeAllAllocations(Stream &strm,
StackFrame *frame_ptr) {
bool success = true;
@@ -3601,8 +3593,8 @@ void RenderScriptRuntime::SetBreakAllKernels(bool do_break, TargetSP target) {
}
}
-// Given the name of a kernel this function creates a breakpoint using our
-// own breakpoint resolver, and returns the Breakpoint shared pointer.
+// Given the name of a kernel this function creates a breakpoint using our own
+// breakpoint resolver, and returns the Breakpoint shared pointer.
BreakpointSP
RenderScriptRuntime::CreateKernelBreakpoint(const ConstString &name) {
Log *log(
@@ -3743,8 +3735,8 @@ bool RenderScriptRuntime::GetKernelCoordinate(RSCoordinate &coord,
log->Printf("%s - Found .expand function '%s'", __FUNCTION__,
func_name.GetCString());
- // Get values for variables in .expand frame that tell us the current kernel
- // invocation
+ // Get values for variables in .expand frame that tell us the current
+ // kernel invocation
uint64_t x, y, z;
bool found = GetFrameVarAsUnsigned(frame_sp, x_expr, x) &&
GetFrameVarAsUnsigned(frame_sp, y_expr, y) &&
@@ -3765,12 +3757,11 @@ bool RenderScriptRuntime::GetKernelCoordinate(RSCoordinate &coord,
// Callback when a kernel breakpoint hits and we're looking for a specific
// coordinate. Baton parameter contains a pointer to the target coordinate we
-// want to break on.
-// Function then checks the .expand frame for the current coordinate and breaks
-// to user if it matches.
-// Parameter 'break_id' is the id of the Breakpoint which made the callback.
-// Parameter 'break_loc_id' is the id for the BreakpointLocation which was hit,
-// a single logical breakpoint can have multiple addresses.
+// want to break on. Function then checks the .expand frame for the current
+// coordinate and breaks to user if it matches. Parameter 'break_id' is the id
+// of the Breakpoint which made the callback. Parameter 'break_loc_id' is the
+// id for the BreakpointLocation which was hit, a single logical breakpoint can
+// have multiple addresses.
bool RenderScriptRuntime::KernelBreakpointHit(void *baton,
StoppointCallbackContext *ctx,
user_id_t break_id,
@@ -3845,12 +3836,10 @@ void RenderScriptRuntime::SetConditional(BreakpointSP bp, Stream &messages,
m_conditional_breaks[bp->GetID()] = std::unique_ptr<RSCoordinate>(baton);
}
-// Tries to set a breakpoint on the start of a kernel, resolved using the kernel
-// name. Argument 'coords', represents a three dimensional coordinate which can
-// be
-// used to specify a single kernel instance to break on. If this is set then we
-// add a callback
-// to the breakpoint.
+// Tries to set a breakpoint on the start of a kernel, resolved using the
+// kernel name. Argument 'coords', represents a three dimensional coordinate
+// which can be used to specify a single kernel instance to break on. If this
+// is set then we add a callback to the breakpoint.
bool RenderScriptRuntime::PlaceBreakpointOnKernel(TargetSP target,
Stream &messages,
const char *name,
@@ -4076,7 +4065,7 @@ void RSModuleDescriptor::Dump(Stream &strm) const {
void RSGlobalDescriptor::Dump(Stream &strm) const {
strm.Indent(m_name.AsCString());
VariableList var_list;
- m_module->m_module->FindGlobalVariables(m_name, nullptr, true, 1U, var_list);
+ m_module->m_module->FindGlobalVariables(m_name, nullptr, 1U, var_list);
if (var_list.GetSize() == 1) {
auto var = var_list.GetVariableAtIndex(0);
auto type = var->GetType();
@@ -4270,8 +4259,8 @@ public:
};
// Matching a comma separated list of known words is fairly
- // straightforward with PCRE, but we're
- // using ERE, so we end up with a little ugliness...
+ // straightforward with PCRE, but we're using ERE, so we end up with a
+ // little ugliness...
RegularExpression::Match match(/* max_matches */ 5);
RegularExpression match_type_list(
llvm::StringRef("^([[:alpha:]]+)(,[[:alpha:]]+){0,4}$"));
@@ -4661,7 +4650,7 @@ public:
switch (short_option) {
case 'f':
- m_outfile.SetFile(option_arg, true);
+ m_outfile.SetFile(option_arg, true, FileSpec::Style::native);
if (m_outfile.Exists()) {
m_outfile.Clear();
err.SetErrorStringWithFormat("file already exists: '%s'",
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
index fe4ae21a0c39..7786d686ad6a 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptScriptGroup.cpp
@@ -10,7 +10,6 @@
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -20,6 +19,7 @@
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Status.h"
diff --git a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
index 439d372fadeb..e1f8ea648414 100644
--- a/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
+++ b/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptx86ABIFixups.cpp
@@ -46,18 +46,15 @@ bool isRSAPICall(llvm::Module &module, llvm::CallInst *call_inst) {
bool isRSLargeReturnCall(llvm::Module &module, llvm::CallInst *call_inst) {
// i686 and x86_64 returns for large vectors in the RenderScript API are not
- // handled as normal
- // register pairs, but as a hidden sret type. This is not reflected in the
- // debug info or mangled
- // symbol name, and the android ABI for x86 and x86_64, (as well as the
- // emulators) specifies there is
- // no AVX, so bcc generates an sret function because we cannot natively return
+ // handled as normal register pairs, but as a hidden sret type. This is not
+ // reflected in the debug info or mangled symbol name, and the android ABI
+ // for x86 and x86_64, (as well as the emulators) specifies there is no AVX,
+ // so bcc generates an sret function because we cannot natively return
// 256 bit vectors.
// This function simply checks whether a function has a > 128bit return type.
- // It is perhaps an
- // unreliable heuristic, and relies on bcc not generating AVX code, so if the
- // android ABI one day
- // provides for AVX, this function may go out of fashion.
+ // It is perhaps an unreliable heuristic, and relies on bcc not generating
+ // AVX code, so if the android ABI one day provides for AVX, this function
+ // may go out of fashion.
(void)module;
if (!call_inst || !call_inst->getCalledFunction())
return false;
@@ -88,12 +85,11 @@ bool isRSAllocationTyCallSite(llvm::Module &module, llvm::CallInst *call_inst) {
llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) {
// on x86 StructReturn functions return a pointer to the return value, rather
- // than the return
- // value itself [ref](http://www.agner.org/optimize/calling_conventions.pdf
- // section 6).
- // We create a return type by getting the pointer type of the old return type,
- // and inserting a new
- // initial argument of pointer type of the original return type.
+ // than the return value itself
+ // [ref](http://www.agner.org/optimize/calling_conventions.pdf section 6). We
+ // create a return type by getting the pointer type of the old return type,
+ // and inserting a new initial argument of pointer type of the original
+ // return type.
Log *log(
GetLogIfAnyCategoriesSet(LIBLLDB_LOG_LANGUAGE | LIBLLDB_LOG_EXPRESSIONS));
@@ -112,8 +108,7 @@ llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) {
orig_type->param_end()};
// This may not work if the function is somehow declared void as llvm is
- // strongly typed
- // and represents void* with i8*
+ // strongly typed and represents void* with i8*
assert(!orig_type->getReturnType()->isVoidTy() &&
"Cannot add StructRet attribute to void function");
llvm::PointerType *return_type_ptr_type =
@@ -126,8 +121,8 @@ llvm::FunctionType *cloneToStructRetFnTy(llvm::CallInst *call_inst) {
if (log)
log->Printf("%s - return type pointer type for StructRet clone @ '0x%p':\n",
__FUNCTION__, (void *)return_type_ptr_type);
- // put the the sret pointer argument in place at the beginning of the argument
- // list.
+ // put the sret pointer argument in place at the beginning of the
+ // argument list.
params.emplace(params.begin(), return_type_ptr_type);
assert(params.size() == num_params + 1);
return llvm::FunctionType::get(return_type_ptr_type, params,
@@ -157,11 +152,9 @@ bool findRSCallSites(llvm::Module &module,
bool fixupX86StructRetCalls(llvm::Module &module) {
bool changed = false;
- // changing a basic block while iterating over it seems to have some undefined
- // behaviour
- // going on so we find all RS callsites first, then fix them up after
- // consuming
- // the iterator.
+ // changing a basic block while iterating over it seems to have some
+ // undefined behaviour going on so we find all RS callsites first, then fix
+ // them up after consuming the iterator.
std::set<llvm::CallInst *> rs_callsites;
if (!findRSCallSites(module, rs_callsites, isRSLargeReturnCall))
return false;
@@ -180,8 +173,7 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
// Allocate enough space to store the return value of the original function
// we pass a pointer to this allocation as the StructRet param, and then
- // copy its
- // value into the lldb return value
+ // copy its value into the lldb return value
const llvm::DataLayout &DL = module.getDataLayout();
llvm::AllocaInst *return_value_alloc = new llvm::AllocaInst(
func->getReturnType(), DL.getAllocaAddrSpace(), "var_vector_return_alloc",
@@ -222,19 +214,15 @@ bool fixupX86StructRetCalls(llvm::Module &module) {
bool fixupRSAllocationStructByValCalls(llvm::Module &module) {
// On x86_64, calls to functions in the RS runtime that take an
- // `rs_allocation` type argument
- // are actually handled as by-ref params by bcc, but appear to be passed by
- // value by lldb (the callsite all use
- // `struct byval`).
- // On x86_64 Linux, struct arguments are transferred in registers if the
- // struct size is no bigger than
- // 128bits [ref](http://www.agner.org/optimize/calling_conventions.pdf)
- // section 7.1 "Passing and returning objects"
- // otherwise passed on the stack.
- // an object of type `rs_allocation` is actually 256bits, so should be passed
- // on the stack. However, code generated
- // by bcc actually treats formal params of type `rs_allocation` as
- // `rs_allocation *` so we need to convert the
+ // `rs_allocation` type argument are actually handled as by-ref params by
+ // bcc, but appear to be passed by value by lldb (the callsite all use
+ // `struct byval`). On x86_64 Linux, struct arguments are transferred in
+ // registers if the struct size is no bigger than 128bits
+ // [ref](http://www.agner.org/optimize/calling_conventions.pdf) section 7.1
+ // "Passing and returning objects" otherwise passed on the stack. an object
+ // of type `rs_allocation` is actually 256bits, so should be passed on the
+ // stack. However, code generated by bcc actually treats formal params of
+ // type `rs_allocation` as `rs_allocation *` so we need to convert the
// calling convention to pass by reference, and remove any hint of byval from
// formal parameters.
bool changed = false;
diff --git a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
index d7bef836d9d8..275f1fa2f70b 100644
--- a/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
+++ b/source/Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.cpp
@@ -89,9 +89,9 @@ ObjectContainerBSDArchive::Object::Extract(const DataExtractor &data,
str.assign((const char *)data.GetData(&offset, 16), 16);
if (str.find("#1/") == 0) {
- // If the name is longer than 16 bytes, or contains an embedded space
- // then it will use this format where the length of the name is
- // here and the name characters are after this header.
+ // If the name is longer than 16 bytes, or contains an embedded space then
+ // it will use this format where the length of the name is here and the
+ // name characters are after this header.
ar_name_len = strtoul(str.c_str() + 3, &err, 10);
} else {
// Strip off any trailing spaces.
@@ -203,8 +203,8 @@ ObjectContainerBSDArchive::Archive::FindCachedArchive(
shared_ptr archive_sp;
Archive::Map &archive_map = Archive::GetArchiveCache();
Archive::Map::iterator pos = archive_map.find(file);
- // Don't cache a value for "archive_map.end()" below since we might
- // delete an archive entry...
+ // Don't cache a value for "archive_map.end()" below since we might delete an
+ // archive entry...
while (pos != archive_map.end() && pos->first == file) {
bool match = true;
if (arch.IsValid() &&
@@ -217,14 +217,13 @@ ObjectContainerBSDArchive::Archive::FindCachedArchive(
if (pos->second->GetModificationTime() == time) {
return pos->second;
} else {
- // We have a file at the same path with the same architecture
- // whose modification time doesn't match. It doesn't make sense
- // for us to continue to use this BSD archive since we cache only
- // the object info which consists of file time info and also the
- // file offset and file size of any contained objects. Since
- // this information is now out of date, we won't get the correct
- // information if we go and extract the file data, so we should
- // remove the old and outdated entry.
+ // We have a file at the same path with the same architecture whose
+ // modification time doesn't match. It doesn't make sense for us to
+ // continue to use this BSD archive since we cache only the object info
+ // which consists of file time info and also the file offset and file
+ // size of any contained objects. Since this information is now out of
+ // date, we won't get the correct information if we go and extract the
+ // file data, so we should remove the old and outdated entry.
archive_map.erase(pos);
pos = archive_map.find(file);
continue; // Continue to next iteration so we don't increment pos
@@ -295,9 +294,9 @@ ObjectContainer *ObjectContainerBSDArchive::CreateInstance(
return nullptr;
if (data_sp) {
- // We have data, which means this is the first 512 bytes of the file
- // Check to see if the magic bytes match and if they do, read the entire
- // table of contents for the archive and cache it
+ // We have data, which means this is the first 512 bytes of the file Check
+ // to see if the magic bytes match and if they do, read the entire table of
+ // contents for the archive and cache it
DataExtractor data;
data.SetData(data_sp, data_offset, length);
if (file && data_sp && ObjectContainerBSDArchive::MagicBytesMatch(data)) {
@@ -389,8 +388,8 @@ bool ObjectContainerBSDArchive::ParseHeader() {
m_file, module_sp->GetArchitecture(),
module_sp->GetModificationTime(), m_offset, m_data);
}
- // Clear the m_data that contains the entire archive
- // data and let our m_archive_sp hold onto the data.
+ // Clear the m_data that contains the entire archive data and let our
+ // m_archive_sp hold onto the data.
m_data.Clear();
}
}
@@ -453,9 +452,9 @@ size_t ObjectContainerBSDArchive::GetModuleSpecifications(
lldb::offset_t data_offset, lldb::offset_t file_offset,
lldb::offset_t file_size, lldb_private::ModuleSpecList &specs) {
- // We have data, which means this is the first 512 bytes of the file
- // Check to see if the magic bytes match and if they do, read the entire
- // table of contents for the archive and cache it
+ // We have data, which means this is the first 512 bytes of the file Check to
+ // see if the magic bytes match and if they do, read the entire table of
+ // contents for the archive and cache it
DataExtractor data;
data.SetData(data_sp, data_offset, data_sp->GetByteSize());
if (!file || !data_sp || !ObjectContainerBSDArchive::MagicBytesMatch(data))
@@ -505,8 +504,8 @@ size_t ObjectContainerBSDArchive::GetModuleSpecifications(
const size_t end_count = specs.GetSize();
size_t num_specs_added = end_count - initial_count;
if (set_archive_arch && num_specs_added > 0) {
- // The archive was created but we didn't have an architecture
- // so we need to set it
+ // The archive was created but we didn't have an architecture so we need to
+ // set it
for (size_t i = initial_count; i < end_count; ++i) {
ModuleSpec module_spec;
if (specs.GetModuleSpecAtIndex(i, module_spec)) {
diff --git a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
index 0266bbe27e7d..4c48d641829a 100644
--- a/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
+++ b/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.cpp
@@ -44,8 +44,8 @@ ObjectContainer *ObjectContainerUniversalMachO::CreateInstance(
const lldb::ModuleSP &module_sp, DataBufferSP &data_sp,
lldb::offset_t data_offset, const FileSpec *file,
lldb::offset_t file_offset, lldb::offset_t length) {
- // We get data when we aren't trying to look for cached container information,
- // so only try and look for an architecture slice if we get data
+ // We get data when we aren't trying to look for cached container
+ // information, so only try and look for an architecture slice if we get data
if (data_sp) {
DataExtractor data;
data.SetData(data_sp, data_offset, length);
@@ -81,8 +81,8 @@ ObjectContainerUniversalMachO::~ObjectContainerUniversalMachO() {}
bool ObjectContainerUniversalMachO::ParseHeader() {
bool success = ParseHeader(m_data, m_header, m_fat_archs);
- // We no longer need any data, we parsed all we needed to parse
- // and cached it in m_header and m_fat_archs
+ // We no longer need any data, we parsed all we needed to parse and cached it
+ // in m_header and m_fat_archs
m_data.Clear();
return success;
}
@@ -92,8 +92,7 @@ bool ObjectContainerUniversalMachO::ParseHeader(
std::vector<llvm::MachO::fat_arch> &fat_archs) {
bool success = false;
// Store the file offset for this universal file as we could have a universal
- // .o file
- // in a BSD archive, or be contained in another kind of object.
+ // .o file in a BSD archive, or be contained in another kind of object.
// Universal mach-o files always have their headers in big endian.
lldb::offset_t offset = 0;
data.SetByteOrder(eByteOrderBig);
diff --git a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
index 39ea49208700..16cbb6e5753b 100644
--- a/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
+++ b/source/Plugins/ObjectFile/ELF/ELFHeader.cpp
@@ -140,13 +140,12 @@ bool ELFHeader::Parse(lldb_private::DataExtractor &data,
if (data.GetU32(offset, &e_flags, 1) == NULL)
return false;
- // Read e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum and
- // e_shstrndx.
+ // Read e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum and e_shstrndx.
if (data.GetU16(offset, &e_ehsize, 6) == NULL)
return false;
- // Initialize e_phnum, e_shnum, and e_shstrndx with the values
- // read from the header.
+ // Initialize e_phnum, e_shnum, and e_shstrndx with the values read from the
+ // header.
e_phnum = e_phnum_hdr;
e_shnum = e_shnum_hdr;
e_shstrndx = e_shstrndx_hdr;
diff --git a/source/Plugins/ObjectFile/ELF/ELFHeader.h b/source/Plugins/ObjectFile/ELF/ELFHeader.h
index 4e2d3155ebb9..faaf8be99d68 100644
--- a/source/Plugins/ObjectFile/ELF/ELFHeader.h
+++ b/source/Plugins/ObjectFile/ELF/ELFHeader.h
@@ -8,14 +8,14 @@
//===----------------------------------------------------------------------===//
//
/// @file
-/// @brief Generic structures and typedefs for ELF files.
+/// Generic structures and typedefs for ELF files.
///
/// This file provides definitions for the various entities comprising an ELF
/// file. The structures are generic in the sense that they do not correspond
/// to the exact binary layout of an ELF, but can be used to hold the
/// information present in both 32 and 64 bit variants of the format. Each
-/// entity provides a \c Parse method which is capable of transparently reading
-/// both 32 and 64 bit instances of the object.
+/// entity provides a \c Parse method which is capable of transparently
+/// reading both 32 and 64 bit instances of the object.
//===----------------------------------------------------------------------===//
#ifndef liblldb_ELFHeader_h_
@@ -35,8 +35,9 @@ namespace elf {
//------------------------------------------------------------------------------
/// @name ELF type definitions.
///
-/// Types used to represent the various components of ELF structures. All types
-/// are signed or unsigned integral types wide enough to hold values from both
+/// Types used to represent the various components of ELF structures. All
+/// types are signed or unsigned integral types wide enough to hold values
+/// from both
/// 32 and 64 bit ELF variants.
//@{
typedef uint64_t elf_addr;
@@ -51,10 +52,10 @@ typedef int64_t elf_sxword;
//------------------------------------------------------------------------------
/// @class ELFHeader
-/// @brief Generic representation of an ELF file header.
+/// Generic representation of an ELF file header.
///
-/// This object is used to identify the general attributes on an ELF file and to
-/// locate additional sections within the file.
+/// This object is used to identify the general attributes on an ELF file and
+/// to locate additional sections within the file.
struct ELFHeader {
unsigned char e_ident[llvm::ELF::EI_NIDENT]; ///< ELF file identification.
elf_addr e_entry; ///< Virtual address program entry point.
@@ -118,9 +119,9 @@ struct ELFHeader {
bool HasHeaderExtension() const;
//--------------------------------------------------------------------------
- /// Parse an ELFHeader entry starting at position \p offset and
- /// update the data extractor with the address size and byte order
- /// attributes as defined by the header.
+ /// Parse an ELFHeader entry starting at position \p offset and update the
+ /// data extractor with the address size and byte order attributes as
+ /// defined by the header.
///
/// @param[in,out] data
/// The DataExtractor to read from. Updated with the address size and
@@ -157,8 +158,8 @@ struct ELFHeader {
private:
//--------------------------------------------------------------------------
- /// Parse an ELFHeader header extension entry. This method is called
- /// by Parse().
+ /// Parse an ELFHeader header extension entry. This method is called by
+ /// Parse().
///
/// @param[in] data
/// The DataExtractor to read from.
@@ -167,7 +168,7 @@ private:
//------------------------------------------------------------------------------
/// @class ELFSectionHeader
-/// @brief Generic representation of an ELF section header.
+/// Generic representation of an ELF section header.
struct ELFSectionHeader {
elf_word sh_name; ///< Section name string index.
elf_word sh_type; ///< Section type.
@@ -202,7 +203,7 @@ struct ELFSectionHeader {
//------------------------------------------------------------------------------
/// @class ELFProgramHeader
-/// @brief Generic representation of an ELF program header.
+/// Generic representation of an ELF program header.
struct ELFProgramHeader {
elf_word p_type; ///< Type of program segment.
elf_word p_flags; ///< Segment attributes.
@@ -235,7 +236,7 @@ struct ELFProgramHeader {
//------------------------------------------------------------------------------
/// @class ELFSymbol
-/// @brief Represents a symbol within an ELF symbol table.
+/// Represents a symbol within an ELF symbol table.
struct ELFSymbol {
elf_addr st_value; ///< Absolute or relocatable address.
elf_xword st_size; ///< Size of the symbol or zero.
@@ -288,7 +289,7 @@ struct ELFSymbol {
//------------------------------------------------------------------------------
/// @class ELFDynamic
-/// @brief Represents an entry in an ELF dynamic table.
+/// Represents an entry in an ELF dynamic table.
struct ELFDynamic {
elf_sxword d_tag; ///< Type of dynamic table entry.
union {
@@ -318,7 +319,7 @@ struct ELFDynamic {
//------------------------------------------------------------------------------
/// @class ELFRel
-/// @brief Represents a relocation entry with an implicit addend.
+/// Represents a relocation entry with an implicit addend.
struct ELFRel {
elf_addr r_offset; ///< Address of reference.
elf_xword r_info; ///< symbol index and type of relocation.
@@ -360,7 +361,7 @@ struct ELFRel {
//------------------------------------------------------------------------------
/// @class ELFRela
-/// @brief Represents a relocation entry with an explicit addend.
+/// Represents a relocation entry with an explicit addend.
struct ELFRela {
elf_addr r_offset; ///< Address of reference.
elf_xword r_info; ///< Symbol index and type of relocation.
diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index 36027dde0432..8701908378f1 100644
--- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -113,7 +113,7 @@ const elf_word LLDB_NT_GNU_ABI_OS_SOLARIS = 0x02;
//===----------------------------------------------------------------------===//
/// @class ELFRelocation
-/// @brief Generic wrapper for ELFRel and ELFRela.
+/// Generic wrapper for ELFRel and ELFRela.
///
/// This helper class allows us to parse both ELFRel and ELFRela relocation
/// entries in a generic manner.
@@ -240,11 +240,10 @@ bool ELFNote::Parse(const DataExtractor &data, lldb::offset_t *offset) {
if (data.GetU32(offset, &n_namesz, 3) == NULL)
return false;
- // The name field is required to be nul-terminated, and n_namesz
- // includes the terminating nul in observed implementations (contrary
- // to the ELF-64 spec). A special case is needed for cores generated
- // by some older Linux versions, which write a note named "CORE"
- // without a nul terminator and n_namesz = 4.
+ // The name field is required to be nul-terminated, and n_namesz includes the
+ // terminating nul in observed implementations (contrary to the ELF-64 spec).
+ // A special case is needed for cores generated by some older Linux versions,
+ // which write a note named "CORE" without a nul terminator and n_namesz = 4.
if (n_namesz == 4) {
char buf[4];
if (data.ExtractBytes(*offset, 4, data.GetByteOrder(), buf) != 4)
@@ -295,7 +294,8 @@ static uint32_t mipsVariantFromElfFlags (const elf::ELFHeader &header) {
uint32_t arch_variant = ArchSpec::eMIPSSubType_unknown;
uint32_t fileclass = header.e_ident[EI_CLASS];
- // If there aren't any elf flags available (e.g core elf file) then return default
+ // If there aren't any elf flags available (e.g core elf file) then return
+ // default
// 32 or 64 bit arch (without any architecture revision) based on object file's class.
if (header.e_type == ET_CORE) {
switch (fileclass) {
@@ -549,8 +549,8 @@ uint32_t ObjectFileELF::CalculateELFNotesSegmentsCRC32(
DataExtractor segment_data;
if (segment_data.SetData(object_data, ph_offset, ph_size) != ph_size) {
- // The ELF program header contained incorrect data,
- // probably corefile is incomplete or corrupted.
+ // The ELF program header contained incorrect data, probably corefile
+ // is incomplete or corrupted.
break;
}
@@ -595,8 +595,8 @@ static const char *OSABIAsCString(unsigned char osabi_byte) {
//
// WARNING : This function is being deprecated
-// It's functionality has moved to ArchSpec::SetArchitecture
-// This function is only being kept to validate the move.
+// It's functionality has moved to ArchSpec::SetArchitecture This function is
+// only being kept to validate the move.
//
// TODO : Remove this function
static bool GetOsFromOSABI(unsigned char osabi_byte,
@@ -674,29 +674,16 @@ size_t ObjectFileELF::GetModuleSpecifications(
__FUNCTION__, file.GetPath().c_str());
}
- // In case there is header extension in the section #0, the header
- // we parsed above could have sentinel values for e_phnum, e_shnum,
- // and e_shstrndx. In this case we need to reparse the header
- // with a bigger data source to get the actual values.
- size_t section_header_end = header.e_shoff + header.e_shentsize;
- if (header.HasHeaderExtension() &&
- section_header_end > data_sp->GetByteSize()) {
- data_sp = MapFileData(file, section_header_end, file_offset);
- if (data_sp) {
- data.SetData(data_sp);
- lldb::offset_t header_offset = data_offset;
- header.Parse(data, &header_offset);
- }
- }
-
- // Try to get the UUID from the section list. Usually that's at the
- // end, so map the file in if we don't have it already.
- section_header_end =
- header.e_shoff + header.e_shnum * header.e_shentsize;
- if (section_header_end > data_sp->GetByteSize()) {
- data_sp = MapFileData(file, section_header_end, file_offset);
- if (data_sp)
- data.SetData(data_sp);
+ data_sp = MapFileData(file, -1, file_offset);
+ if (data_sp)
+ data.SetData(data_sp);
+ // In case there is header extension in the section #0, the header we
+ // parsed above could have sentinel values for e_phnum, e_shnum, and
+ // e_shstrndx. In this case we need to reparse the header with a
+ // bigger data source to get the actual values.
+ if (header.HasHeaderExtension()) {
+ lldb::offset_t header_offset = data_offset;
+ header.Parse(data, &header_offset);
}
uint32_t gnu_debuglink_crc = 0;
@@ -733,51 +720,27 @@ size_t ObjectFileELF::GetModuleSpecifications(
// contents crc32 would be too much of luxury. Thus we will need
// to fallback to something simpler.
if (header.e_type == llvm::ELF::ET_CORE) {
- size_t program_headers_end =
- header.e_phoff + header.e_phnum * header.e_phentsize;
- if (program_headers_end > data_sp->GetByteSize()) {
- data_sp = MapFileData(file, program_headers_end, file_offset);
- if (data_sp)
- data.SetData(data_sp);
- }
ProgramHeaderColl program_headers;
GetProgramHeaderInfo(program_headers, data, header);
- size_t segment_data_end = 0;
- for (ProgramHeaderCollConstIter I = program_headers.begin();
- I != program_headers.end(); ++I) {
- segment_data_end = std::max<unsigned long long>(
- I->p_offset + I->p_filesz, segment_data_end);
- }
-
- if (segment_data_end > data_sp->GetByteSize()) {
- data_sp = MapFileData(file, segment_data_end, file_offset);
- if (data_sp)
- data.SetData(data_sp);
- }
-
core_notes_crc =
CalculateELFNotesSegmentsCRC32(program_headers, data);
} else {
- // Need to map entire file into memory to calculate the crc.
- data_sp = MapFileData(file, -1, file_offset);
- if (data_sp) {
- data.SetData(data_sp);
- gnu_debuglink_crc = calc_gnu_debuglink_crc32(
- data.GetDataStart(), data.GetByteSize());
- }
+ gnu_debuglink_crc = calc_gnu_debuglink_crc32(
+ data.GetDataStart(), data.GetByteSize());
}
}
+ using u32le = llvm::support::ulittle32_t;
if (gnu_debuglink_crc) {
// Use 4 bytes of crc from the .gnu_debuglink section.
- uint32_t uuidt[4] = {gnu_debuglink_crc, 0, 0, 0};
- uuid.SetBytes(uuidt, sizeof(uuidt));
+ u32le data(gnu_debuglink_crc);
+ uuid = UUID::fromData(&data, sizeof(data));
} else if (core_notes_crc) {
// Use 8 bytes - first 4 bytes for *magic* prefix, mainly to make
- // it look different form
- // .gnu_debuglink crc followed by 4 bytes of note segments crc.
- uint32_t uuidt[4] = {g_core_uuid_magic, core_notes_crc, 0, 0};
- uuid.SetBytes(uuidt, sizeof(uuidt));
+ // it look different form .gnu_debuglink crc followed by 4 bytes
+ // of note segments crc.
+ u32le data[] = {u32le(g_core_uuid_magic), u32le(core_notes_crc)};
+ uuid = UUID::fromData(data, sizeof(data));
}
}
@@ -861,21 +824,19 @@ bool ObjectFileELF::SetLoadAddress(Target &target, lldb::addr_t value,
size_t sect_idx = 0;
for (sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
- // Iterate through the object file sections to find all
- // of the sections that have SHF_ALLOC in their flag bits.
+ // Iterate through the object file sections to find all of the sections
+ // that have SHF_ALLOC in their flag bits.
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
if (section_sp && section_sp->Test(SHF_ALLOC)) {
lldb::addr_t load_addr = section_sp->GetFileAddress();
// We don't want to update the load address of a section with type
// eSectionTypeAbsoluteAddress as they already have the absolute load
- // address
- // already specified
+ // address already specified
if (section_sp->GetType() != eSectionTypeAbsoluteAddress)
load_addr += value;
// On 32-bit systems the load address have to fit into 4 bytes. The
- // rest of
- // the bytes are the overflow from the addition.
+ // rest of the bytes are the overflow from the addition.
if (GetAddressByteSize() == 4)
load_addr &= 0xFFFFFFFF;
@@ -905,24 +866,23 @@ uint32_t ObjectFileELF::GetAddressByteSize() const {
AddressClass ObjectFileELF::GetAddressClass(addr_t file_addr) {
Symtab *symtab = GetSymtab();
if (!symtab)
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
- // The address class is determined based on the symtab. Ask it from the object
- // file what
- // contains the symtab information.
+ // The address class is determined based on the symtab. Ask it from the
+ // object file what contains the symtab information.
ObjectFile *symtab_objfile = symtab->GetObjectFile();
if (symtab_objfile != nullptr && symtab_objfile != this)
return symtab_objfile->GetAddressClass(file_addr);
auto res = ObjectFile::GetAddressClass(file_addr);
- if (res != eAddressClassCode)
+ if (res != AddressClass::eCode)
return res;
auto ub = m_address_class_map.upper_bound(file_addr);
if (ub == m_address_class_map.begin()) {
- // No entry in the address class map before the address. Return
- // default address class for an address in a code section.
- return eAddressClassCode;
+ // No entry in the address class map before the address. Return default
+ // address class for an address in a code section.
+ return AddressClass::eCode;
}
// Move iterator to the address class entry preceding address
@@ -950,6 +910,7 @@ bool ObjectFileELF::GetUUID(lldb_private::UUID *uuid) {
if (!ParseSectionHeaders() && GetType() != ObjectFile::eTypeCoreFile)
return false;
+ using u32le = llvm::support::ulittle32_t;
if (m_uuid.IsValid()) {
// We have the full build id uuid.
*uuid = m_uuid;
@@ -963,11 +924,11 @@ bool ObjectFileELF::GetUUID(lldb_private::UUID *uuid) {
core_notes_crc = CalculateELFNotesSegmentsCRC32(m_program_headers, m_data);
if (core_notes_crc) {
- // Use 8 bytes - first 4 bytes for *magic* prefix, mainly to make it
- // look different form .gnu_debuglink crc - followed by 4 bytes of note
+ // Use 8 bytes - first 4 bytes for *magic* prefix, mainly to make it look
+ // different form .gnu_debuglink crc - followed by 4 bytes of note
// segments crc.
- uint32_t uuidt[4] = {g_core_uuid_magic, core_notes_crc, 0, 0};
- m_uuid.SetBytes(uuidt, sizeof(uuidt));
+ u32le data[] = {u32le(g_core_uuid_magic), u32le(core_notes_crc)};
+ m_uuid = UUID::fromData(data, sizeof(data));
}
} else {
if (!m_gnu_debuglink_crc)
@@ -975,8 +936,8 @@ bool ObjectFileELF::GetUUID(lldb_private::UUID *uuid) {
calc_gnu_debuglink_crc32(m_data.GetDataStart(), m_data.GetByteSize());
if (m_gnu_debuglink_crc) {
// Use 4 bytes of crc from the .gnu_debuglink section.
- uint32_t uuidt[4] = {m_gnu_debuglink_crc, 0, 0, 0};
- m_uuid.SetBytes(uuidt, sizeof(uuidt));
+ u32le data(m_gnu_debuglink_crc);
+ m_uuid = UUID::fromData(&data, sizeof(data));
}
}
@@ -1034,8 +995,8 @@ Address ObjectFileELF::GetImageInfoAddress(Target *target) {
ELFDynamic &symbol = m_dynamic_symbols[i];
if (symbol.d_tag == DT_DEBUG) {
- // Compute the offset as the number of previous entries plus the
- // size of d_tag.
+ // Compute the offset as the number of previous entries plus the size of
+ // d_tag.
addr_t offset = i * dynsym_hdr->sh_entsize + GetAddressByteSize();
return Address(dynsym_section_sp, offset);
}
@@ -1314,18 +1275,16 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
// Only bother processing this if we don't already have the uuid set.
if (!uuid.IsValid()) {
// 16 bytes is UUID|MD5, 20 bytes is SHA1. Other linkers may produce a
- // build-id of a different
- // length. Accept it as long as it's at least 4 bytes as it will be
- // better than our own crc32.
- if (note.n_descsz >= 4 && note.n_descsz <= 20) {
- uint8_t uuidbuf[20];
- if (data.GetU8(&offset, &uuidbuf, note.n_descsz) == nullptr) {
+ // build-id of a different length. Accept it as long as it's at least
+ // 4 bytes as it will be better than our own crc32.
+ if (note.n_descsz >= 4) {
+ if (const uint8_t *buf = data.PeekData(offset, note.n_descsz)) {
+ // Save the build id as the UUID for the module.
+ uuid = UUID::fromData(buf, note.n_descsz);
+ } else {
error.SetErrorString("failed to read GNU_BUILD_ID note payload");
return error;
}
-
- // Save the build id as the UUID for the module.
- uuid.SetBytes(uuidbuf, note.n_descsz);
}
}
break;
@@ -1368,8 +1327,8 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
arch_spec.GetTriple().setVendor(llvm::Triple::VendorType::CSR);
// TODO At some point the description string could be processed.
- // It could provide a steer towards the kalimba variant which
- // this ELF targets.
+ // It could provide a steer towards the kalimba variant which this ELF
+ // targets.
if (note.n_descsz) {
const char *cstr =
data.GetCStr(&offset, llvm::alignTo(note.n_descsz, 4));
@@ -1384,36 +1343,28 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
// register info
arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
} else if (note.n_name == LLDB_NT_OWNER_CORE) {
- // Parse the NT_FILE to look for stuff in paths to shared libraries
- // As the contents look like this in a 64 bit ELF core file:
- // count = 0x000000000000000a (10)
- // page_size = 0x0000000000001000 (4096)
- // Index start end file_ofs path
- // ===== ------------------ ------------------ ------------------
- // -------------------------------------
- // [ 0] 0x0000000000400000 0x0000000000401000 0x0000000000000000
- // /tmp/a.out
- // [ 1] 0x0000000000600000 0x0000000000601000 0x0000000000000000
- // /tmp/a.out
- // [ 2] 0x0000000000601000 0x0000000000602000 0x0000000000000001
- // /tmp/a.out
+ // Parse the NT_FILE to look for stuff in paths to shared libraries As
+ // the contents look like this in a 64 bit ELF core file: count =
+ // 0x000000000000000a (10) page_size = 0x0000000000001000 (4096) Index
+ // start end file_ofs path =====
+ // ------------------ ------------------ ------------------
+ // ------------------------------------- [ 0] 0x0000000000400000
+ // 0x0000000000401000 0x0000000000000000 /tmp/a.out [ 1]
+ // 0x0000000000600000 0x0000000000601000 0x0000000000000000 /tmp/a.out [
+ // 2] 0x0000000000601000 0x0000000000602000 0x0000000000000001 /tmp/a.out
// [ 3] 0x00007fa79c9ed000 0x00007fa79cba8000 0x0000000000000000
- // /lib/x86_64-linux-gnu/libc-2.19.so
- // [ 4] 0x00007fa79cba8000 0x00007fa79cda7000 0x00000000000001bb
- // /lib/x86_64-linux-gnu/libc-2.19.so
- // [ 5] 0x00007fa79cda7000 0x00007fa79cdab000 0x00000000000001ba
- // /lib/x86_64-linux-gnu/libc-2.19.so
- // [ 6] 0x00007fa79cdab000 0x00007fa79cdad000 0x00000000000001be
- // /lib/x86_64-linux-gnu/libc-2.19.so
- // [ 7] 0x00007fa79cdb2000 0x00007fa79cdd5000 0x0000000000000000
- // /lib/x86_64-linux-gnu/ld-2.19.so
- // [ 8] 0x00007fa79cfd4000 0x00007fa79cfd5000 0x0000000000000022
- // /lib/x86_64-linux-gnu/ld-2.19.so
- // [ 9] 0x00007fa79cfd5000 0x00007fa79cfd6000 0x0000000000000023
- // /lib/x86_64-linux-gnu/ld-2.19.so
- // In the 32 bit ELFs the count, page_size, start, end, file_ofs are
- // uint32_t
- // For reference: see readelf source code (in binutils).
+ // /lib/x86_64-linux-gnu/libc-2.19.so [ 4] 0x00007fa79cba8000
+ // 0x00007fa79cda7000 0x00000000000001bb /lib/x86_64-linux-
+ // gnu/libc-2.19.so [ 5] 0x00007fa79cda7000 0x00007fa79cdab000
+ // 0x00000000000001ba /lib/x86_64-linux-gnu/libc-2.19.so [ 6]
+ // 0x00007fa79cdab000 0x00007fa79cdad000 0x00000000000001be /lib/x86_64
+ // -linux-gnu/libc-2.19.so [ 7] 0x00007fa79cdb2000 0x00007fa79cdd5000
+ // 0x0000000000000000 /lib/x86_64-linux-gnu/ld-2.19.so [ 8]
+ // 0x00007fa79cfd4000 0x00007fa79cfd5000 0x0000000000000022 /lib/x86_64
+ // -linux-gnu/ld-2.19.so [ 9] 0x00007fa79cfd5000 0x00007fa79cfd6000
+ // 0x0000000000000023 /lib/x86_64-linux-gnu/ld-2.19.so In the 32 bit ELFs
+ // the count, page_size, start, end, file_ofs are uint32_t For reference:
+ // see readelf source code (in binutils).
if (note.n_type == NT_FILE) {
uint64_t count = data.GetAddress(&offset);
const char *cstr;
@@ -1437,15 +1388,14 @@ ObjectFileELF::RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
}
if (arch_spec.IsMIPS() &&
arch_spec.GetTriple().getOS() == llvm::Triple::OSType::UnknownOS)
- // In case of MIPSR6, the LLDB_NT_OWNER_GNU note is missing
- // for some cases (e.g. compile with -nostdlib)
- // Hence set OS to Linux
+ // In case of MIPSR6, the LLDB_NT_OWNER_GNU note is missing for some
+ // cases (e.g. compile with -nostdlib) Hence set OS to Linux
arch_spec.GetTriple().setOS(llvm::Triple::OSType::Linux);
}
}
- // Calculate the offset of the next note just in case "offset" has been used
- // to poke at the contents of the note data
+ // Calculate the offset of the next note just in case "offset" has been
+ // used to poke at the contents of the note data
offset = note_offset + note.GetByteSize();
}
@@ -1545,13 +1495,12 @@ size_t ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl &section_headers,
arch_spec.SetArchitecture(eArchTypeELF, header.e_machine, sub_type,
header.e_ident[EI_OSABI]);
- // Validate if it is ok to remove GetOsFromOSABI.
- // Note, that now the OS is determined based on EI_OSABI flag and
- // the info extracted from ELF notes (see RefineModuleDetailsFromNote).
- // However in some cases that still might be not enough: for example
- // a shared library might not have any notes at all
- // and have EI_OSABI flag set to System V,
- // as result the OS will be set to UnknownOS.
+ // Validate if it is ok to remove GetOsFromOSABI. Note, that now the OS is
+ // determined based on EI_OSABI flag and the info extracted from ELF notes
+ // (see RefineModuleDetailsFromNote). However in some cases that still
+ // might be not enough: for example a shared library might not have any
+ // notes at all and have EI_OSABI flag set to System V, as result the OS
+ // will be set to UnknownOS.
GetOsFromOSABI(header.e_ident[EI_OSABI], ostype);
spec_ostype = arch_spec.GetTriple().getOS();
assert(spec_ostype == ostype);
@@ -1842,6 +1791,7 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
static ConstString g_sect_name_dwarf_debug_loc(".debug_loc");
static ConstString g_sect_name_dwarf_debug_macinfo(".debug_macinfo");
static ConstString g_sect_name_dwarf_debug_macro(".debug_macro");
+ static ConstString g_sect_name_dwarf_debug_names(".debug_names");
static ConstString g_sect_name_dwarf_debug_pubnames(".debug_pubnames");
static ConstString g_sect_name_dwarf_debug_pubtypes(".debug_pubtypes");
static ConstString g_sect_name_dwarf_debug_ranges(".debug_ranges");
@@ -1857,10 +1807,12 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
static ConstString g_sect_name_dwarf_debug_str_dwo(".debug_str.dwo");
static ConstString g_sect_name_dwarf_debug_str_offsets_dwo(
".debug_str_offsets.dwo");
+ static ConstString g_sect_name_dwarf_debug_types(".debug_types");
static ConstString g_sect_name_eh_frame(".eh_frame");
static ConstString g_sect_name_arm_exidx(".ARM.exidx");
static ConstString g_sect_name_arm_extab(".ARM.extab");
static ConstString g_sect_name_go_symtab(".gosymtab");
+ static ConstString g_sect_name_dwarf_gnu_debugaltlink(".gnu_debugaltlink");
SectionType sect_type = eSectionTypeOther;
@@ -1881,23 +1833,19 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
}
// .debug_abbrev – Abbreviations used in the .debug_info section
// .debug_aranges – Lookup table for mapping addresses to compilation
- // units
- // .debug_frame – Call frame information
- // .debug_info – The core DWARF information section
- // .debug_line – Line number information
+ // units .debug_frame – Call frame information .debug_info – The core
+ // DWARF information section .debug_line – Line number information
// .debug_loc – Location lists used in DW_AT_location attributes
- // .debug_macinfo – Macro information
- // .debug_pubnames – Lookup table for mapping object and function names to
- // compilation units
+ // .debug_macinfo – Macro information .debug_pubnames – Lookup table
+ // for mapping object and function names to compilation units
// .debug_pubtypes – Lookup table for mapping type names to compilation
- // units
- // .debug_ranges – Address ranges used in DW_AT_ranges attributes
- // .debug_str – String table used in .debug_info
- // MISSING? .gnu_debugdata - "mini debuginfo / MiniDebugInfo" section,
- // http://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html
- // MISSING? .debug-index -
- // http://src.chromium.org/viewvc/chrome/trunk/src/build/gdb-add-index?pathrev=144644
- // MISSING? .debug_types - Type descriptions from DWARF 4? See
+ // units .debug_ranges – Address ranges used in DW_AT_ranges attributes
+ // .debug_str – String table used in .debug_info MISSING?
+ // .gnu_debugdata - "mini debuginfo / MiniDebugInfo" section,
+ // http://sourceware.org/gdb/onlinedocs/gdb/MiniDebugInfo.html MISSING?
+ // .debug-index - http://src.chromium.org/viewvc/chrome/trunk/src/build
+ // /gdb-add-index?pathrev=144644 MISSING? .debug_types - Type
+ // descriptions from DWARF 4? See
// http://gcc.gnu.org/wiki/DwarfSeparateTypeInfo
else if (name == g_sect_name_dwarf_debug_abbrev)
sect_type = eSectionTypeDWARFDebugAbbrev;
@@ -1919,6 +1867,8 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
sect_type = eSectionTypeDWARFDebugMacInfo;
else if (name == g_sect_name_dwarf_debug_macro)
sect_type = eSectionTypeDWARFDebugMacro;
+ else if (name == g_sect_name_dwarf_debug_names)
+ sect_type = eSectionTypeDWARFDebugNames;
else if (name == g_sect_name_dwarf_debug_pubnames)
sect_type = eSectionTypeDWARFDebugPubNames;
else if (name == g_sect_name_dwarf_debug_pubtypes)
@@ -1927,6 +1877,8 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
sect_type = eSectionTypeDWARFDebugRanges;
else if (name == g_sect_name_dwarf_debug_str)
sect_type = eSectionTypeDWARFDebugStr;
+ else if (name == g_sect_name_dwarf_debug_types)
+ sect_type = eSectionTypeDWARFDebugTypes;
else if (name == g_sect_name_dwarf_debug_str_offsets)
sect_type = eSectionTypeDWARFDebugStrOffsets;
else if (name == g_sect_name_dwarf_debug_abbrev_dwo)
@@ -1951,6 +1903,8 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
sect_type = eSectionTypeARMextab;
else if (name == g_sect_name_go_symtab)
sect_type = eSectionTypeGoSymtab;
+ else if (name == g_sect_name_dwarf_gnu_debugaltlink)
+ sect_type = eSectionTypeDWARFGNUDebugAltLink;
const uint32_t permissions =
((header.sh_flags & SHF_ALLOC) ? ePermissionsReadable : 0u) |
@@ -1978,13 +1932,21 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
if (eSectionTypeOther == sect_type) {
// the kalimba toolchain assumes that ELF section names are free-form.
- // It does
- // support linkscripts which (can) give rise to various arbitrarily
- // named
- // sections being "Code" or "Data".
+ // It does support linkscripts which (can) give rise to various
+ // arbitrarily named sections being "Code" or "Data".
sect_type = kalimbaSectionType(m_header, header);
}
+ // In common case ELF code section can have arbitrary name (for example,
+ // we can specify it using section attribute for particular function) so
+ // assume that section is a code section if it has SHF_EXECINSTR flag set
+ // and has SHT_PROGBITS type.
+ if (eSectionTypeOther == sect_type &&
+ llvm::ELF::SHT_PROGBITS == header.sh_type &&
+ (header.sh_flags & SHF_EXECINSTR)) {
+ sect_type = eSectionTypeCode;
+ }
+
const uint32_t target_bytes_size =
(eSectionTypeData == sect_type || eSectionTypeZeroFill == sect_type)
? m_arch_spec.GetDataByteSize()
@@ -2024,46 +1986,16 @@ void ObjectFileELF::CreateSections(SectionList &unified_section_list) {
}
}
- if (m_sections_ap.get()) {
- if (GetType() == eTypeDebugInfo) {
- static const SectionType g_sections[] = {
- eSectionTypeDWARFDebugAbbrev, eSectionTypeDWARFDebugAddr,
- eSectionTypeDWARFDebugAranges, eSectionTypeDWARFDebugCuIndex,
- eSectionTypeDWARFDebugFrame, eSectionTypeDWARFDebugInfo,
- eSectionTypeDWARFDebugLine, eSectionTypeDWARFDebugLoc,
- eSectionTypeDWARFDebugMacInfo, eSectionTypeDWARFDebugPubNames,
- eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges,
- eSectionTypeDWARFDebugStr, eSectionTypeDWARFDebugStrOffsets,
- eSectionTypeELFSymbolTable,
- };
- SectionList *elf_section_list = m_sections_ap.get();
- for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]);
- ++idx) {
- SectionType section_type = g_sections[idx];
- SectionSP section_sp(
- elf_section_list->FindSectionByType(section_type, true));
- if (section_sp) {
- SectionSP module_section_sp(
- unified_section_list.FindSectionByType(section_type, true));
- if (module_section_sp)
- unified_section_list.ReplaceSection(module_section_sp->GetID(),
- section_sp);
- else
- unified_section_list.AddSection(section_sp);
- }
- }
- } else {
- unified_section_list = *m_sections_ap;
- }
- }
+ // For eTypeDebugInfo files, the Symbol Vendor will take care of updating the
+ // unified section list.
+ if (GetType() != eTypeDebugInfo)
+ unified_section_list = *m_sections_ap;
}
// Find the arm/aarch64 mapping symbol character in the given symbol name.
-// Mapping symbols have the
-// form of "$<char>[.<any>]*". Additionally we recognize cases when the mapping
-// symbol prefixed by
-// an arbitrary string because if a symbol prefix added to each symbol in the
-// object file with
+// Mapping symbols have the form of "$<char>[.<any>]*". Additionally we
+// recognize cases when the mapping symbol prefixed by an arbitrary string
+// because if a symbol prefix added to each symbol in the object file with
// objcopy then the mapping symbols are also prefixed.
static char FindArmAarch64MappingSymbol(const char *symbol_name) {
if (!symbol_name)
@@ -2105,22 +2037,18 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
static ConstString opd_section_name(".opd"); // For ppc64
// On Android the oatdata and the oatexec symbols in the oat and odex files
- // covers the full
- // .text section what causes issues with displaying unusable symbol name to
- // the user and very
- // slow unwinding speed because the instruction emulation based unwind plans
- // try to emulate all
- // instructions in these symbols. Don't add these symbols to the symbol list
- // as they have no
- // use for the debugger and they are causing a lot of trouble.
- // Filtering can't be restricted to Android because this special object file
- // don't contain the
- // note section specifying the environment to Android but the custom extension
- // and file name
- // makes it highly unlikely that this will collide with anything else.
+ // covers the full .text section what causes issues with displaying unusable
+ // symbol name to the user and very slow unwinding speed because the
+ // instruction emulation based unwind plans try to emulate all instructions
+ // in these symbols. Don't add these symbols to the symbol list as they have
+ // no use for the debugger and they are causing a lot of trouble. Filtering
+ // can't be restricted to Android because this special object file don't
+ // contain the note section specifying the environment to Android but the
+ // custom extension and file name makes it highly unlikely that this will
+ // collide with anything else.
ConstString file_extension = m_file.GetFileNameExtension();
- bool skip_oatdata_oatexec = file_extension == ConstString("oat") ||
- file_extension == ConstString("odex");
+ bool skip_oatdata_oatexec = file_extension == ConstString(".oat") ||
+ file_extension == ConstString(".odex");
ArchSpec arch;
GetArchitecture(arch);
@@ -2129,8 +2057,8 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
module_sp ? module_sp->GetSectionList() : nullptr;
// Local cache to avoid doing a FindSectionByName for each symbol. The "const
- // char*" key must
- // came from a ConstString object so they can be compared by pointer
+ // char*" key must came from a ConstString object so they can be compared by
+ // pointer
std::unordered_map<const char *, lldb::SectionSP> section_name_to_section;
unsigned i;
@@ -2148,8 +2076,7 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
continue;
// Skipping oatdata and oatexec sections if it is requested. See details
- // above the
- // definition of skip_oatdata_oatexec for the reasons.
+ // above the definition of skip_oatdata_oatexec for the reasons.
if (skip_oatdata_oatexec && (::strcmp(symbol_name, "oatdata") == 0 ||
::strcmp(symbol_name, "oatexec") == 0))
continue;
@@ -2180,8 +2107,8 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
break;
case STT_OBJECT:
- // The symbol is associated with a data object, such as a variable,
- // an array, etc.
+ // The symbol is associated with a data object, such as a variable, an
+ // array, etc.
symbol_type = eSymbolTypeData;
break;
@@ -2192,13 +2119,13 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
case STT_SECTION:
// The symbol is associated with a section. Symbol table entries of
- // this type exist primarily for relocation and normally have
- // STB_LOCAL binding.
+ // this type exist primarily for relocation and normally have STB_LOCAL
+ // binding.
break;
case STT_FILE:
- // Conventionally, the symbol's name gives the name of the source
- // file associated with the object file. A file symbol has STB_LOCAL
+ // Conventionally, the symbol's name gives the name of the source file
+ // associated with the object file. A file symbol has STB_LOCAL
// binding, its section index is SHN_ABS, and it precedes the other
// STB_LOCAL symbols for the file, if it is present.
symbol_type = eSymbolTypeSourceFile;
@@ -2240,18 +2167,18 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
switch (mapping_symbol) {
case 'a':
// $a[.<any>]* - marks an ARM instruction sequence
- m_address_class_map[symbol.st_value] = eAddressClassCode;
+ m_address_class_map[symbol.st_value] = AddressClass::eCode;
break;
case 'b':
case 't':
// $b[.<any>]* - marks a THUMB BL instruction sequence
// $t[.<any>]* - marks a THUMB instruction sequence
m_address_class_map[symbol.st_value] =
- eAddressClassCodeAlternateISA;
+ AddressClass::eCodeAlternateISA;
break;
case 'd':
// $d[.<any>]* - marks a data item sequence (e.g. lit pool)
- m_address_class_map[symbol.st_value] = eAddressClassData;
+ m_address_class_map[symbol.st_value] = AddressClass::eData;
break;
}
}
@@ -2265,11 +2192,11 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
switch (mapping_symbol) {
case 'x':
// $x[.<any>]* - marks an A64 instruction sequence
- m_address_class_map[symbol.st_value] = eAddressClassCode;
+ m_address_class_map[symbol.st_value] = AddressClass::eCode;
break;
case 'd':
// $d[.<any>]* - marks a data item sequence (e.g. lit pool)
- m_address_class_map[symbol.st_value] = eAddressClassData;
+ m_address_class_map[symbol.st_value] = AddressClass::eData;
break;
}
}
@@ -2281,18 +2208,17 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
if (arch.GetMachine() == llvm::Triple::arm) {
if (symbol_type == eSymbolTypeCode) {
if (symbol.st_value & 1) {
- // Subtracting 1 from the address effectively unsets
- // the low order bit, which results in the address
- // actually pointing to the beginning of the symbol.
- // This delta will be used below in conjunction with
- // symbol.st_value to produce the final symbol_value
- // that we store in the symtab.
+ // Subtracting 1 from the address effectively unsets the low order
+ // bit, which results in the address actually pointing to the
+ // beginning of the symbol. This delta will be used below in
+ // conjunction with symbol.st_value to produce the final
+ // symbol_value that we store in the symtab.
symbol_value_offset = -1;
m_address_class_map[symbol.st_value ^ 1] =
- eAddressClassCodeAlternateISA;
+ AddressClass::eCodeAlternateISA;
} else {
// This address is ARM
- m_address_class_map[symbol.st_value] = eAddressClassCode;
+ m_address_class_map[symbol.st_value] = AddressClass::eCode;
}
}
}
@@ -2317,36 +2243,32 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
llvm_arch == llvm::Triple::mips64 ||
llvm_arch == llvm::Triple::mips64el) {
if (IS_MICROMIPS(symbol.st_other))
- m_address_class_map[symbol.st_value] = eAddressClassCodeAlternateISA;
+ m_address_class_map[symbol.st_value] = AddressClass::eCodeAlternateISA;
else if ((symbol.st_value & 1) && (symbol_type == eSymbolTypeCode)) {
symbol.st_value = symbol.st_value & (~1ull);
- m_address_class_map[symbol.st_value] = eAddressClassCodeAlternateISA;
+ m_address_class_map[symbol.st_value] = AddressClass::eCodeAlternateISA;
} else {
if (symbol_type == eSymbolTypeCode)
- m_address_class_map[symbol.st_value] = eAddressClassCode;
+ m_address_class_map[symbol.st_value] = AddressClass::eCode;
else if (symbol_type == eSymbolTypeData)
- m_address_class_map[symbol.st_value] = eAddressClassData;
+ m_address_class_map[symbol.st_value] = AddressClass::eData;
else
- m_address_class_map[symbol.st_value] = eAddressClassUnknown;
+ m_address_class_map[symbol.st_value] = AddressClass::eUnknown;
}
}
}
// symbol_value_offset may contain 0 for ARM symbols or -1 for THUMB
- // symbols. See above for
- // more details.
+ // symbols. See above for more details.
uint64_t symbol_value = symbol.st_value + symbol_value_offset;
if (symbol_section_sp == nullptr && section_idx == SHN_ABS &&
symbol.st_size != 0) {
// We don't have a section for a symbol with non-zero size. Create a new
- // section for it
- // so the address range covered by the symbol is also covered by the
- // module (represented
- // through the section list). It is needed so module lookup for the
- // addresses covered
- // by this symbol will be successfull. This case happens for absolute
- // symbols.
+ // section for it so the address range covered by the symbol is also
+ // covered by the module (represented through the section list). It is
+ // needed so module lookup for the addresses covered by this symbol will
+ // be successfull. This case happens for absolute symbols.
ConstString fake_section_name(std::string(".absolute.") + symbol_name);
symbol_section_sp =
std::make_shared<Section>(module_sp, this, SHN_ABS, fake_section_name,
@@ -2389,8 +2311,7 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
Mangled mangled(ConstString(symbol_bare), is_mangled);
// Now append the suffix back to mangled and unmangled names. Only do it if
- // the
- // demangling was successful (string is not empty).
+ // the demangling was successful (string is not empty).
if (has_suffix) {
llvm::StringRef suffix = symbol_ref.substr(version_pos);
@@ -2406,12 +2327,10 @@ unsigned ObjectFileELF::ParseSymbols(Symtab *symtab, user_id_t start_id,
}
// In ELF all symbol should have a valid size but it is not true for some
- // function symbols
- // coming from hand written assembly. As none of the function symbol should
- // have 0 size we
- // try to calculate the size for these symbols in the symtab with saying
- // that their original
- // size is not valid.
+ // function symbols coming from hand written assembly. As none of the
+ // function symbol should have 0 size we try to calculate the size for
+ // these symbols in the symtab with saying that their original size is not
+ // valid.
bool symbol_size_valid =
symbol.st_size != 0 || symbol.getType() != STT_FUNC;
@@ -2440,8 +2359,7 @@ unsigned ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
lldb_private::Section *symtab) {
if (symtab->GetObjectFile() != this) {
// If the symbol table section is owned by a different object file, have it
- // do the
- // parsing.
+ // do the parsing.
ObjectFileELF *obj_file_elf =
static_cast<ObjectFileELF *>(symtab->GetObjectFile());
return obj_file_elf->ParseSymbolTable(symbol_table, start_id, symtab);
@@ -2457,8 +2375,8 @@ unsigned ObjectFileELF::ParseSymbolTable(Symtab *symbol_table,
assert(symtab_hdr->sh_type == SHT_SYMTAB ||
symtab_hdr->sh_type == SHT_DYNSYM);
- // sh_link: section header index of associated string table.
- // Section ID's are ones based.
+ // sh_link: section header index of associated string table. Section ID's are
+ // ones based.
user_id_t strtab_id = symtab_hdr->sh_link + 1;
Section *strtab = section_list->FindSectionByID(strtab_id).get();
@@ -2543,19 +2461,17 @@ unsigned ObjectFileELF::PLTRelocationType() {
return 0;
}
-// Returns the size of the normal plt entries and the offset of the first normal
-// plt entry. The
-// 0th entry in the plt table is usually a resolution entry which have different
-// size in some
-// architectures then the rest of the plt entries.
+// Returns the size of the normal plt entries and the offset of the first
+// normal plt entry. The 0th entry in the plt table is usually a resolution
+// entry which have different size in some architectures then the rest of the
+// plt entries.
static std::pair<uint64_t, uint64_t>
GetPltEntrySizeAndOffset(const ELFSectionHeader *rel_hdr,
const ELFSectionHeader *plt_hdr) {
const elf_xword num_relocations = rel_hdr->sh_size / rel_hdr->sh_entsize;
- // Clang 3.3 sets entsize to 4 for 32-bit binaries, but the plt entries are 16
- // bytes.
- // So round the entsize up by the alignment if addralign is set.
+ // Clang 3.3 sets entsize to 4 for 32-bit binaries, but the plt entries are
+ // 16 bytes. So round the entsize up by the alignment if addralign is set.
elf_xword plt_entsize =
plt_hdr->sh_addralign
? llvm::alignTo(plt_hdr->sh_entsize, plt_hdr->sh_addralign)
@@ -2567,12 +2483,10 @@ GetPltEntrySizeAndOffset(const ELFSectionHeader *rel_hdr,
// just in case.
if (plt_entsize <= 4) {
// The linker haven't set the plt_hdr->sh_entsize field. Try to guess the
- // size of the plt
- // entries based on the number of entries and the size of the plt section
- // with the
- // assumption that the size of the 0th entry is at least as big as the size
- // of the normal
- // entries and it isn't much bigger then that.
+ // size of the plt entries based on the number of entries and the size of
+ // the plt section with the assumption that the size of the 0th entry is at
+ // least as big as the size of the normal entries and it isn't much bigger
+ // then that.
if (plt_hdr->sh_addralign)
plt_entsize = plt_hdr->sh_size / plt_hdr->sh_addralign /
(num_relocations + 1) * plt_hdr->sh_addralign;
@@ -2865,8 +2779,7 @@ Symtab *ObjectFileELF::GetSymtab() {
return NULL;
// We always want to use the main object file so we (hopefully) only have one
- // cached copy
- // of our symtab, dynamic sections, etc.
+ // cached copy of our symtab, dynamic sections, etc.
ObjectFile *module_obj_file = module_sp->GetObjectFile();
if (module_obj_file && module_obj_file != this)
return module_obj_file->GetSymtab();
@@ -2881,18 +2794,15 @@ Symtab *ObjectFileELF::GetSymtab() {
// Sharable objects and dynamic executables usually have 2 distinct symbol
// tables, one named ".symtab", and the other ".dynsym". The dynsym is a
- // smaller
- // version of the symtab that only contains global symbols. The information
- // found
- // in the dynsym is therefore also found in the symtab, while the reverse is
- // not
- // necessarily true.
+ // smaller version of the symtab that only contains global symbols. The
+ // information found in the dynsym is therefore also found in the symtab,
+ // while the reverse is not necessarily true.
Section *symtab =
section_list->FindSectionByType(eSectionTypeELFSymbolTable, true).get();
if (!symtab) {
// The symtab section is non-allocable and can be stripped, so if it
- // doesn't exist
- // then use the dynsym section which should always be there.
+ // doesn't exist then use the dynsym section which should always be
+ // there.
symtab =
section_list->FindSectionByType(eSectionTypeELFDynamicSymbols, true)
.get();
@@ -2939,8 +2849,7 @@ Symtab *ObjectFileELF::GetSymtab() {
}
// If we still don't have any symtab then create an empty instance to avoid
- // do the section
- // lookup next time.
+ // do the section lookup next time.
if (m_symtab_ap == nullptr)
m_symtab_ap.reset(new Symtab(this));
@@ -2954,8 +2863,8 @@ void ObjectFileELF::RelocateSection(lldb_private::Section *section)
{
static const char *debug_prefix = ".debug";
- // Set relocated bit so we stop getting called, regardless of
- // whether we actually relocate.
+ // Set relocated bit so we stop getting called, regardless of whether we
+ // actually relocate.
section->SetIsRelocated(true);
// We only relocate in ELF relocatable files
@@ -2998,12 +2907,10 @@ void ObjectFileELF::ParseUnwindSymbols(Symtab *symbol_table,
return;
// First we save the new symbols into a separate list and add them to the
- // symbol table after
- // we colleced all symbols we want to add. This is neccessary because adding a
- // new symbol
- // invalidates the internal index of the symtab what causing the next lookup
- // to be slow because
- // it have to recalculate the index first.
+ // symbol table after we colleced all symbols we want to add. This is
+ // neccessary because adding a new symbol invalidates the internal index of
+ // the symtab what causing the next lookup to be slow because it have to
+ // recalculate the index first.
std::vector<Symbol> new_symbols;
eh_frame->ForEachFDEEntries([this, symbol_table, section_list, &new_symbols](
@@ -3197,8 +3104,8 @@ void ObjectFileELF::DumpELFProgramHeader(Stream *s,
//----------------------------------------------------------------------
// DumpELFProgramHeader_p_type
//
-// Dump an token value for the ELF program header member p_type which
-// describes the type of the program header
+// Dump an token value for the ELF program header member p_type which describes
+// the type of the program header
// ----------------------------------------------------------------------
void ObjectFileELF::DumpELFProgramHeader_p_type(Stream *s, elf_word p_type) {
const int kStrWidth = 15;
@@ -3369,8 +3276,7 @@ bool ObjectFileELF::GetArchitecture(ArchSpec &arch) {
if (CalculateType() == eTypeCoreFile &&
m_arch_spec.TripleOSIsUnspecifiedUnknown()) {
// Core files don't have section headers yet they have PT_NOTE program
- // headers
- // that might shed more light on the architecture
+ // headers that might shed more light on the architecture
if (ParseProgramHeaders()) {
for (size_t i = 1, count = GetProgramHeaderCount(); i <= count; ++i) {
const elf::ELFProgramHeader *header = GetProgramHeaderByIndex(i);
@@ -3431,22 +3337,22 @@ ObjectFile::Strata ObjectFileELF::CalculateStrata() {
case llvm::ELF::ET_EXEC:
// 2 - Executable file
// TODO: is there any way to detect that an executable is a kernel
- // related executable by inspecting the program headers, section
- // headers, symbols, or any other flag bits???
+ // related executable by inspecting the program headers, section headers,
+ // symbols, or any other flag bits???
return eStrataUser;
case llvm::ELF::ET_DYN:
// 3 - Shared object file
// TODO: is there any way to detect that an shared library is a kernel
- // related executable by inspecting the program headers, section
- // headers, symbols, or any other flag bits???
+ // related executable by inspecting the program headers, section headers,
+ // symbols, or any other flag bits???
return eStrataUnknown;
case ET_CORE:
// 4 - Core file
// TODO: is there any way to detect that an core file is a kernel
- // related executable by inspecting the program headers, section
- // headers, symbols, or any other flag bits???
+ // related executable by inspecting the program headers, section headers,
+ // symbols, or any other flag bits???
return eStrataUnknown;
default:
@@ -3491,8 +3397,9 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
size_t(section_data.GetByteSize())},
GetByteOrder() == eByteOrderLittle, GetAddressByteSize() == 8);
if (!Decompressor) {
- LLDB_LOG(log, "Unable to initialize decompressor for section {0}: {1}",
- section->GetName(), llvm::toString(Decompressor.takeError()));
+ LLDB_LOG_ERROR(log, Decompressor.takeError(),
+ "Unable to initialize decompressor for section {0}",
+ section->GetName());
return result;
}
auto buffer_sp =
@@ -3500,10 +3407,45 @@ size_t ObjectFileELF::ReadSectionData(Section *section,
if (auto Error = Decompressor->decompress(
{reinterpret_cast<char *>(buffer_sp->GetBytes()),
size_t(buffer_sp->GetByteSize())})) {
- LLDB_LOG(log, "Decompression of section {0} failed: {1}",
- section->GetName(), llvm::toString(std::move(Error)));
+ LLDB_LOG_ERROR(log, std::move(Error), "Decompression of section {0} failed",
+ section->GetName());
return result;
}
section_data.SetData(buffer_sp);
return buffer_sp->GetByteSize();
}
+
+bool ObjectFileELF::AnySegmentHasPhysicalAddress() {
+ size_t header_count = ParseProgramHeaders();
+ for (size_t i = 1; i <= header_count; ++i) {
+ auto header = GetProgramHeaderByIndex(i);
+ if (header->p_paddr != 0)
+ return true;
+ }
+ return false;
+}
+
+std::vector<ObjectFile::LoadableData>
+ObjectFileELF::GetLoadableData(Target &target) {
+ // Create a list of loadable data from loadable segments, using physical
+ // addresses if they aren't all null
+ std::vector<LoadableData> loadables;
+ size_t header_count = ParseProgramHeaders();
+ bool should_use_paddr = AnySegmentHasPhysicalAddress();
+ for (size_t i = 1; i <= header_count; ++i) {
+ LoadableData loadable;
+ auto header = GetProgramHeaderByIndex(i);
+ if (header->p_type != llvm::ELF::PT_LOAD)
+ continue;
+ loadable.Dest = should_use_paddr ? header->p_paddr : header->p_vaddr;
+ if (loadable.Dest == LLDB_INVALID_ADDRESS)
+ continue;
+ if (header->p_filesz == 0)
+ continue;
+ auto segment_data = GetSegmentDataByIndex(i);
+ loadable.Contents = llvm::ArrayRef<uint8_t>(segment_data.GetDataStart(),
+ segment_data.GetByteSize());
+ loadables.push_back(loadable);
+ }
+ return loadables;
+}
diff --git a/source/Plugins/ObjectFile/ELF/ObjectFileELF.h b/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
index 2909f4e52e4a..2664595fd81d 100644
--- a/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
+++ b/source/Plugins/ObjectFile/ELF/ObjectFileELF.h
@@ -54,10 +54,10 @@ struct ELFNote {
//------------------------------------------------------------------------------
/// @class ObjectFileELF
-/// @brief Generic ELF object file reader.
+/// Generic ELF object file reader.
///
-/// This class provides a generic ELF (32/64 bit) reader plugin implementing the
-/// ObjectFile protocol.
+/// This class provides a generic ELF (32/64 bit) reader plugin implementing
+/// the ObjectFile protocol.
class ObjectFileELF : public lldb_private::ObjectFile {
public:
~ObjectFileELF() override;
@@ -113,7 +113,7 @@ public:
uint32_t GetAddressByteSize() const override;
- lldb::AddressClass GetAddressClass(lldb::addr_t file_addr) override;
+ lldb_private::AddressClass GetAddressClass(lldb::addr_t file_addr) override;
lldb_private::Symtab *GetSymtab() override;
@@ -161,6 +161,11 @@ public:
void RelocateSection(lldb_private::Section *section) override;
+protected:
+
+ std::vector<LoadableData>
+ GetLoadableData(lldb_private::Target &target) override;
+
private:
ObjectFileELF(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp,
lldb::offset_t data_offset, const lldb_private::FileSpec *file,
@@ -186,7 +191,7 @@ private:
typedef DynamicSymbolColl::iterator DynamicSymbolCollIter;
typedef DynamicSymbolColl::const_iterator DynamicSymbolCollConstIter;
- typedef std::map<lldb::addr_t, lldb::AddressClass>
+ typedef std::map<lldb::addr_t, lldb_private::AddressClass>
FileAddressToAddressClassMap;
/// Version of this reader common to all plugins based on this class.
@@ -255,8 +260,8 @@ private:
uint64_t length,
lldb_private::ArchSpec &arch_spec);
- /// Parses the elf section headers and returns the uuid, debug link name, crc,
- /// archspec.
+ /// Parses the elf section headers and returns the uuid, debug link name,
+ /// crc, archspec.
static size_t GetSectionHeaderInfo(SectionHeaderColl &section_headers,
lldb_private::DataExtractor &object_data,
const elf::ELFHeader &header,
@@ -383,6 +388,8 @@ private:
RefineModuleDetailsFromNote(lldb_private::DataExtractor &data,
lldb_private::ArchSpec &arch_spec,
lldb_private::UUID &uuid);
+
+ bool AnySegmentHasPhysicalAddress();
};
#endif // liblldb_ObjectFileELF_h_
diff --git a/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp b/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
index a9ab366fbf53..af040322ec52 100644
--- a/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
+++ b/source/Plugins/ObjectFile/JIT/ObjectFileJIT.cpp
@@ -65,8 +65,8 @@ ObjectFile *ObjectFileJIT::CreateInstance(const lldb::ModuleSP &module_sp,
const FileSpec *file,
lldb::offset_t file_offset,
lldb::offset_t length) {
- // JIT'ed object file is backed by the ObjectFileJITDelegate, never
- // read from a file
+ // JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
+ // a file
return NULL;
}
@@ -74,8 +74,8 @@ ObjectFile *ObjectFileJIT::CreateMemoryInstance(const lldb::ModuleSP &module_sp,
DataBufferSP &data_sp,
const ProcessSP &process_sp,
lldb::addr_t header_addr) {
- // JIT'ed object file is backed by the ObjectFileJITDelegate, never
- // read from memory
+ // JIT'ed object file is backed by the ObjectFileJITDelegate, never read from
+ // memory
return NULL;
}
@@ -214,9 +214,8 @@ bool ObjectFileJIT::SetLoadAddress(Target &target, lldb::addr_t value,
const size_t num_sections = section_list->GetSize();
// "value" is an offset to apply to each top level segment
for (size_t sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
- // Iterate through the object file sections to find all
- // of the sections that size on disk (to avoid __PAGEZERO)
- // and load them
+ // Iterate through the object file sections to find all of the sections
+ // that size on disk (to avoid __PAGEZERO) and load them
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
if (section_sp && section_sp->GetFileSize() > 0 &&
section_sp->IsThreadSpecific() == false) {
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index e6941c9f6ed6..91e7f3353270 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -161,8 +161,7 @@ public:
case 7:
case 8:
case 9:
- // fancy flavors that encapsulate of the above
- // flavors...
+ // fancy flavors that encapsulate of the above flavors...
break;
default:
@@ -393,8 +392,7 @@ public:
case 7:
case 8:
case 9:
- // fancy flavors that encapsulate of the above
- // flavors...
+ // fancy flavors that encapsulate of the above flavors...
break;
default:
@@ -517,8 +515,7 @@ public:
}
// Note that gpr.cpsr is also copied by the above loop; this loop
- // technically extends
- // one element past the end of the gpr.r[] array.
+ // technically extends one element past the end of the gpr.r[] array.
SetError(GPRRegSet, Read, 0);
offset = next_thread_state;
@@ -1164,19 +1161,19 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
const lldb::SectionType section_type = section_sp->GetType();
switch (section_type) {
case eSectionTypeInvalid:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeCode:
if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM) {
- // For ARM we have a bit in the n_desc field of the symbol
- // that tells us ARM/Thumb which is bit 0x0008.
+ // For ARM we have a bit in the n_desc field of the symbol that
+ // tells us ARM/Thumb which is bit 0x0008.
if (symbol->GetFlags() & MACHO_NLIST_ARM_SYMBOL_IS_THUMB)
- return eAddressClassCodeAlternateISA;
+ return AddressClass::eCodeAlternateISA;
}
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSectionTypeContainer:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeData:
case eSectionTypeDataCString:
@@ -1190,7 +1187,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDataObjCMessageRefs:
case eSectionTypeDataObjCCFStrings:
case eSectionTypeGoSymtab:
- return eAddressClassData;
+ return AddressClass::eData;
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
@@ -1203,22 +1200,25 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeDWARFDebugLoc:
case eSectionTypeDWARFDebugMacInfo:
case eSectionTypeDWARFDebugMacro:
+ case eSectionTypeDWARFDebugNames:
case eSectionTypeDWARFDebugPubNames:
case eSectionTypeDWARFDebugPubTypes:
case eSectionTypeDWARFDebugRanges:
case eSectionTypeDWARFDebugStr:
case eSectionTypeDWARFDebugStrOffsets:
+ case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFAppleNames:
case eSectionTypeDWARFAppleTypes:
case eSectionTypeDWARFAppleNamespaces:
case eSectionTypeDWARFAppleObjC:
- return eAddressClassDebug;
+ case eSectionTypeDWARFGNUDebugAltLink:
+ return AddressClass::eDebug;
case eSectionTypeEHFrame:
case eSectionTypeARMexidx:
case eSectionTypeARMextab:
case eSectionTypeCompactUnwind:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSectionTypeAbsoluteAddress:
case eSectionTypeELFSymbolTable:
@@ -1226,7 +1226,7 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
case eSectionTypeELFRelocationEntries:
case eSectionTypeELFDynamicLinkInfo:
case eSectionTypeOther:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
}
}
}
@@ -1234,73 +1234,73 @@ AddressClass ObjectFileMachO::GetAddressClass(lldb::addr_t file_addr) {
const SymbolType symbol_type = symbol->GetType();
switch (symbol_type) {
case eSymbolTypeAny:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeAbsolute:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCode:
case eSymbolTypeTrampoline:
case eSymbolTypeResolver:
if (m_header.cputype == llvm::MachO::CPU_TYPE_ARM) {
- // For ARM we have a bit in the n_desc field of the symbol
- // that tells us ARM/Thumb which is bit 0x0008.
+ // For ARM we have a bit in the n_desc field of the symbol that tells
+ // us ARM/Thumb which is bit 0x0008.
if (symbol->GetFlags() & MACHO_NLIST_ARM_SYMBOL_IS_THUMB)
- return eAddressClassCodeAlternateISA;
+ return AddressClass::eCodeAlternateISA;
}
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeData:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeRuntime:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeException:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeSourceFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeHeaderFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeObjectFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeCommonBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLocal:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeParam:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariable:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariableType:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineEntry:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineHeader:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeBegin:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeEnd:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeAdditional:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCompiler:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeInstrumentation:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeUndefined:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeObjCClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCMetaClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCIVar:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeReExported:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
}
}
}
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
}
Symtab *ObjectFileMachO::GetSymtab() {
@@ -1349,586 +1349,565 @@ bool ObjectFileMachO::IsStripped() {
return false;
}
-void ObjectFileMachO::CreateSections(SectionList &unified_section_list) {
- if (!m_sections_ap.get()) {
- m_sections_ap.reset(new SectionList());
+ObjectFileMachO::EncryptedFileRanges ObjectFileMachO::GetEncryptedFileRanges() {
+ EncryptedFileRanges result;
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
- const bool is_dsym = (m_header.filetype == MH_DSYM);
- lldb::user_id_t segID = 0;
- lldb::user_id_t sectID = 0;
- lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
- uint32_t i;
- const bool is_core = GetType() == eTypeCoreFile;
- // bool dump_sections = false;
- ModuleSP module_sp(GetModule());
- // First look up any LC_ENCRYPTION_INFO load commands
- typedef RangeArray<uint32_t, uint32_t, 8> EncryptedFileRanges;
- EncryptedFileRanges encrypted_file_ranges;
- encryption_info_command encryption_cmd;
- for (i = 0; i < m_header.ncmds; ++i) {
- const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &encryption_cmd, 2) == NULL)
- break;
+ 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)
+ break;
- // LC_ENCRYPTION_INFO and LC_ENCRYPTION_INFO_64 have the same sizes for
- // the 3 fields we care about, so treat them the same.
- if (encryption_cmd.cmd == LC_ENCRYPTION_INFO ||
- encryption_cmd.cmd == LC_ENCRYPTION_INFO_64) {
- if (m_data.GetU32(&offset, &encryption_cmd.cryptoff, 3)) {
- if (encryption_cmd.cryptid != 0) {
- EncryptedFileRanges::Entry entry;
- entry.SetRangeBase(encryption_cmd.cryptoff);
- entry.SetByteSize(encryption_cmd.cryptsize);
- encrypted_file_ranges.Append(entry);
- }
+ // LC_ENCRYPTION_INFO and LC_ENCRYPTION_INFO_64 have the same sizes for the
+ // 3 fields we care about, so treat them the same.
+ if (encryption_cmd.cmd == LC_ENCRYPTION_INFO ||
+ encryption_cmd.cmd == LC_ENCRYPTION_INFO_64) {
+ if (m_data.GetU32(&offset, &encryption_cmd.cryptoff, 3)) {
+ if (encryption_cmd.cryptid != 0) {
+ EncryptedFileRanges::Entry entry;
+ entry.SetRangeBase(encryption_cmd.cryptoff);
+ entry.SetByteSize(encryption_cmd.cryptsize);
+ result.Append(entry);
}
}
- offset = load_cmd_offset + encryption_cmd.cmdsize;
}
+ offset = load_cmd_offset + encryption_cmd.cmdsize;
+ }
- bool section_file_addresses_changed = false;
+ return result;
+}
- offset = MachHeaderSizeFromMagic(m_header.magic);
+void ObjectFileMachO::SanitizeSegmentCommand(segment_command_64 &seg_cmd,
+ uint32_t cmd_idx) {
+ if (m_length == 0 || seg_cmd.filesize == 0)
+ return;
+
+ if (seg_cmd.fileoff > m_length) {
+ // We have a load command that says it extends past the end of the file.
+ // This is likely a corrupt file. We don't have any way to return an error
+ // condition here (this method was likely invoked from something like
+ // ObjectFile::GetSectionList()), so we just null out the section contents,
+ // and dump a message to stdout. The most common case here is core file
+ // debugging with a truncated file.
+ const char *lc_segment_name =
+ seg_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
+ GetModule()->ReportWarning(
+ "load command %u %s has a fileoff (0x%" PRIx64
+ ") that extends beyond the end of the file (0x%" PRIx64
+ "), ignoring this section",
+ cmd_idx, lc_segment_name, seg_cmd.fileoff, m_length);
+
+ seg_cmd.fileoff = 0;
+ seg_cmd.filesize = 0;
+ }
- struct segment_command_64 load_cmd;
- for (i = 0; i < m_header.ncmds; ++i) {
- const lldb::offset_t load_cmd_offset = offset;
- if (m_data.GetU32(&offset, &load_cmd, 2) == NULL)
- break;
+ if (seg_cmd.fileoff + seg_cmd.filesize > m_length) {
+ // We have a load command that says it extends past the end of the file.
+ // This is likely a corrupt file. We don't have any way to return an error
+ // condition here (this method was likely invoked from something like
+ // ObjectFile::GetSectionList()), so we just null out the section contents,
+ // and dump a message to stdout. The most common case here is core file
+ // debugging with a truncated file.
+ const char *lc_segment_name =
+ seg_cmd.cmd == LC_SEGMENT_64 ? "LC_SEGMENT_64" : "LC_SEGMENT";
+ GetModule()->ReportWarning(
+ "load command %u %s has a fileoff + filesize (0x%" PRIx64
+ ") that extends beyond the end of the file (0x%" PRIx64
+ "), the segment will be truncated to match",
+ cmd_idx, lc_segment_name, seg_cmd.fileoff + seg_cmd.filesize, m_length);
+
+ // Truncate the length
+ seg_cmd.filesize = m_length - seg_cmd.fileoff;
+ }
+}
- if (load_cmd.cmd == LC_SEGMENT || load_cmd.cmd == LC_SEGMENT_64) {
- if (m_data.GetU8(&offset, (uint8_t *)load_cmd.segname, 16)) {
- bool add_section = true;
- bool add_to_unified = true;
- ConstString const_segname(load_cmd.segname,
- std::min<size_t>(strlen(load_cmd.segname),
- sizeof(load_cmd.segname)));
-
- SectionSP unified_section_sp(
- unified_section_list.FindSectionByName(const_segname));
- if (is_dsym && unified_section_sp) {
- if (const_segname == GetSegmentNameLINKEDIT()) {
- // We need to keep the __LINKEDIT segment private to this object
- // file only
- add_to_unified = false;
- } else {
- // This is the dSYM file and this section has already been created
- // by
- // the object file, no need to create it.
- add_section = false;
- }
- }
- load_cmd.vmaddr = m_data.GetAddress(&offset);
- load_cmd.vmsize = m_data.GetAddress(&offset);
- load_cmd.fileoff = m_data.GetAddress(&offset);
- load_cmd.filesize = m_data.GetAddress(&offset);
- if (m_length != 0 && load_cmd.filesize != 0) {
- if (load_cmd.fileoff > m_length) {
- // We have a load command that says it extends past the end of the
- // file. This is likely
- // a corrupt file. We don't have any way to return an error
- // condition here (this method
- // was likely invoked from something like
- // ObjectFile::GetSectionList()) -- all we can do
- // is null out the SectionList vector and if a process has been
- // set up, dump a message
- // to stdout. The most common case here is core file debugging
- // with a truncated file.
- const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64
- ? "LC_SEGMENT_64"
- : "LC_SEGMENT";
- module_sp->ReportWarning(
- "load command %u %s has a fileoff (0x%" PRIx64
- ") that extends beyond the end of the file (0x%" PRIx64
- "), ignoring this section",
- i, lc_segment_name, load_cmd.fileoff, m_length);
-
- load_cmd.fileoff = 0;
- load_cmd.filesize = 0;
- }
+static uint32_t GetSegmentPermissions(const segment_command_64 &seg_cmd) {
+ uint32_t result = 0;
+ if (seg_cmd.initprot & VM_PROT_READ)
+ result |= ePermissionsReadable;
+ if (seg_cmd.initprot & VM_PROT_WRITE)
+ result |= ePermissionsWritable;
+ if (seg_cmd.initprot & VM_PROT_EXECUTE)
+ result |= ePermissionsExecutable;
+ return result;
+}
- if (load_cmd.fileoff + load_cmd.filesize > m_length) {
- // We have a load command that says it extends past the end of the
- // file. This is likely
- // a corrupt file. We don't have any way to return an error
- // condition here (this method
- // was likely invoked from something like
- // ObjectFile::GetSectionList()) -- all we can do
- // is null out the SectionList vector and if a process has been
- // set up, dump a message
- // to stdout. The most common case here is core file debugging
- // with a truncated file.
- const char *lc_segment_name = load_cmd.cmd == LC_SEGMENT_64
- ? "LC_SEGMENT_64"
- : "LC_SEGMENT";
- GetModule()->ReportWarning(
- "load command %u %s has a fileoff + filesize (0x%" PRIx64
- ") that extends beyond the end of the file (0x%" PRIx64
- "), the segment will be truncated to match",
- i, lc_segment_name, load_cmd.fileoff + load_cmd.filesize,
- m_length);
-
- // Tuncase the length
- load_cmd.filesize = m_length - load_cmd.fileoff;
- }
- }
- if (m_data.GetU32(&offset, &load_cmd.maxprot, 4)) {
- uint32_t segment_permissions = 0;
- if (load_cmd.initprot & VM_PROT_READ)
- segment_permissions |= ePermissionsReadable;
- if (load_cmd.initprot & VM_PROT_WRITE)
- segment_permissions |= ePermissionsWritable;
- if (load_cmd.initprot & VM_PROT_EXECUTE)
- segment_permissions |= ePermissionsExecutable;
-
- const bool segment_is_encrypted =
- (load_cmd.flags & SG_PROTECTED_VERSION_1) != 0;
-
- // Keep a list of mach segments around in case we need to
- // get at data that isn't stored in the abstracted Sections.
- m_mach_segments.push_back(load_cmd);
-
- // Use a segment ID of the segment index shifted left by 8 so they
- // never conflict with any of the sections.
- SectionSP segment_sp;
- if (add_section && (const_segname || is_core)) {
- segment_sp.reset(new Section(
- module_sp, // Module to which this section belongs
- this, // Object file to which this sections belongs
- ++segID << 8, // Section ID is the 1 based segment index
- // shifted right by 8 bits as not to collide
- // with any of the 256 section IDs that are
- // possible
- const_segname, // Name of this section
- eSectionTypeContainer, // This section is a container of other
- // sections.
- load_cmd.vmaddr, // File VM address == addresses as they are
- // found in the object file
- load_cmd.vmsize, // VM size in bytes of this section
- load_cmd.fileoff, // Offset to the data for this section in
- // the file
- load_cmd.filesize, // Size in bytes of this section as found
- // in the file
- 0, // Segments have no alignment information
- load_cmd.flags)); // Flags for this section
-
- segment_sp->SetIsEncrypted(segment_is_encrypted);
- m_sections_ap->AddSection(segment_sp);
- segment_sp->SetPermissions(segment_permissions);
- if (add_to_unified)
- unified_section_list.AddSection(segment_sp);
- } else if (unified_section_sp) {
- if (is_dsym &&
- unified_section_sp->GetFileAddress() != load_cmd.vmaddr) {
- // Check to see if the module was read from memory?
- if (module_sp->GetObjectFile()->GetHeaderAddress().IsValid()) {
- // We have a module that is in memory and needs to have its
- // file address adjusted. We need to do this because when we
- // load a file from memory, its addresses will be slid
- // already,
- // yet the addresses in the new symbol file will still be
- // unslid.
- // Since everything is stored as section offset, this
- // shouldn't
- // cause any problems.
-
- // Make sure we've parsed the symbol table from the
- // ObjectFile before we go around changing its Sections.
- module_sp->GetObjectFile()->GetSymtab();
- // eh_frame would present the same problems but we parse that
- // on
- // a per-function basis as-needed so it's more difficult to
- // remove its use of the Sections. Realistically, the
- // environments
- // where this code path will be taken will not have eh_frame
- // sections.
-
- unified_section_sp->SetFileAddress(load_cmd.vmaddr);
-
- // Notify the module that the section addresses have been
- // changed once
- // we're done so any file-address caches can be updated.
- section_file_addresses_changed = true;
- }
- }
- m_sections_ap->AddSection(unified_section_sp);
- }
+static lldb::SectionType GetSectionType(uint32_t flags,
+ ConstString section_name) {
+
+ if (flags & (S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS))
+ return eSectionTypeCode;
+
+ uint32_t mach_sect_type = flags & SECTION_TYPE;
+ static ConstString g_sect_name_objc_data("__objc_data");
+ static ConstString g_sect_name_objc_msgrefs("__objc_msgrefs");
+ static ConstString g_sect_name_objc_selrefs("__objc_selrefs");
+ static ConstString g_sect_name_objc_classrefs("__objc_classrefs");
+ static ConstString g_sect_name_objc_superrefs("__objc_superrefs");
+ static ConstString g_sect_name_objc_const("__objc_const");
+ static ConstString g_sect_name_objc_classlist("__objc_classlist");
+ static ConstString g_sect_name_cfstring("__cfstring");
+
+ static ConstString g_sect_name_dwarf_debug_abbrev("__debug_abbrev");
+ static ConstString g_sect_name_dwarf_debug_aranges("__debug_aranges");
+ static ConstString g_sect_name_dwarf_debug_frame("__debug_frame");
+ static ConstString g_sect_name_dwarf_debug_info("__debug_info");
+ static ConstString g_sect_name_dwarf_debug_line("__debug_line");
+ static ConstString g_sect_name_dwarf_debug_loc("__debug_loc");
+ static ConstString g_sect_name_dwarf_debug_macinfo("__debug_macinfo");
+ static ConstString g_sect_name_dwarf_debug_names("__debug_names");
+ static ConstString g_sect_name_dwarf_debug_pubnames("__debug_pubnames");
+ static ConstString g_sect_name_dwarf_debug_pubtypes("__debug_pubtypes");
+ static ConstString g_sect_name_dwarf_debug_ranges("__debug_ranges");
+ static ConstString g_sect_name_dwarf_debug_str("__debug_str");
+ static ConstString g_sect_name_dwarf_debug_types("__debug_types");
+ static ConstString g_sect_name_dwarf_apple_names("__apple_names");
+ static ConstString g_sect_name_dwarf_apple_types("__apple_types");
+ static ConstString g_sect_name_dwarf_apple_namespaces("__apple_namespac");
+ static ConstString g_sect_name_dwarf_apple_objc("__apple_objc");
+ static ConstString g_sect_name_eh_frame("__eh_frame");
+ static ConstString g_sect_name_compact_unwind("__unwind_info");
+ static ConstString g_sect_name_text("__text");
+ static ConstString g_sect_name_data("__data");
+ static ConstString g_sect_name_go_symtab("__gosymtab");
+
+ if (section_name == g_sect_name_dwarf_debug_abbrev)
+ return eSectionTypeDWARFDebugAbbrev;
+ if (section_name == g_sect_name_dwarf_debug_aranges)
+ return eSectionTypeDWARFDebugAranges;
+ if (section_name == g_sect_name_dwarf_debug_frame)
+ return eSectionTypeDWARFDebugFrame;
+ if (section_name == g_sect_name_dwarf_debug_info)
+ return eSectionTypeDWARFDebugInfo;
+ if (section_name == g_sect_name_dwarf_debug_line)
+ return eSectionTypeDWARFDebugLine;
+ if (section_name == g_sect_name_dwarf_debug_loc)
+ return eSectionTypeDWARFDebugLoc;
+ if (section_name == g_sect_name_dwarf_debug_macinfo)
+ return eSectionTypeDWARFDebugMacInfo;
+ if (section_name == g_sect_name_dwarf_debug_names)
+ return eSectionTypeDWARFDebugNames;
+ if (section_name == g_sect_name_dwarf_debug_pubnames)
+ return eSectionTypeDWARFDebugPubNames;
+ if (section_name == g_sect_name_dwarf_debug_pubtypes)
+ return eSectionTypeDWARFDebugPubTypes;
+ if (section_name == g_sect_name_dwarf_debug_ranges)
+ return eSectionTypeDWARFDebugRanges;
+ if (section_name == g_sect_name_dwarf_debug_str)
+ return eSectionTypeDWARFDebugStr;
+ if (section_name == g_sect_name_dwarf_debug_types)
+ return eSectionTypeDWARFDebugTypes;
+ if (section_name == g_sect_name_dwarf_apple_names)
+ return eSectionTypeDWARFAppleNames;
+ if (section_name == g_sect_name_dwarf_apple_types)
+ return eSectionTypeDWARFAppleTypes;
+ if (section_name == g_sect_name_dwarf_apple_namespaces)
+ return eSectionTypeDWARFAppleNamespaces;
+ if (section_name == g_sect_name_dwarf_apple_objc)
+ return eSectionTypeDWARFAppleObjC;
+ if (section_name == g_sect_name_objc_selrefs)
+ return eSectionTypeDataCStringPointers;
+ if (section_name == g_sect_name_objc_msgrefs)
+ return eSectionTypeDataObjCMessageRefs;
+ if (section_name == g_sect_name_eh_frame)
+ return eSectionTypeEHFrame;
+ if (section_name == g_sect_name_compact_unwind)
+ return eSectionTypeCompactUnwind;
+ if (section_name == g_sect_name_cfstring)
+ return eSectionTypeDataObjCCFStrings;
+ if (section_name == g_sect_name_go_symtab)
+ return eSectionTypeGoSymtab;
+ if (section_name == g_sect_name_objc_data ||
+ section_name == g_sect_name_objc_classrefs ||
+ section_name == g_sect_name_objc_superrefs ||
+ section_name == g_sect_name_objc_const ||
+ section_name == g_sect_name_objc_classlist) {
+ return eSectionTypeDataPointers;
+ }
- struct section_64 sect64;
- ::memset(&sect64, 0, sizeof(sect64));
- // Push a section into our mach sections for the section at
- // index zero (NO_SECT) if we don't have any mach sections yet...
- if (m_mach_sections.empty())
- m_mach_sections.push_back(sect64);
- uint32_t segment_sect_idx;
- const lldb::user_id_t first_segment_sectID = sectID + 1;
-
- const uint32_t num_u32s = load_cmd.cmd == LC_SEGMENT ? 7 : 8;
- 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)
- break;
- if (m_data.GetU8(&offset, (uint8_t *)sect64.segname,
- sizeof(sect64.segname)) == NULL)
- break;
- sect64.addr = m_data.GetAddress(&offset);
- sect64.size = m_data.GetAddress(&offset);
+ switch (mach_sect_type) {
+ // TODO: categorize sections by other flags for regular sections
+ case S_REGULAR:
+ if (section_name == g_sect_name_text)
+ return eSectionTypeCode;
+ if (section_name == g_sect_name_data)
+ return eSectionTypeData;
+ return eSectionTypeOther;
+ case S_ZEROFILL:
+ return eSectionTypeZeroFill;
+ case S_CSTRING_LITERALS: // section with only literal C strings
+ return eSectionTypeDataCString;
+ case S_4BYTE_LITERALS: // section with only 4 byte literals
+ return eSectionTypeData4;
+ case S_8BYTE_LITERALS: // section with only 8 byte literals
+ return eSectionTypeData8;
+ case S_LITERAL_POINTERS: // section with only pointers to literals
+ return eSectionTypeDataPointers;
+ case S_NON_LAZY_SYMBOL_POINTERS: // section with only non-lazy symbol pointers
+ return eSectionTypeDataPointers;
+ case S_LAZY_SYMBOL_POINTERS: // section with only lazy symbol pointers
+ return eSectionTypeDataPointers;
+ case S_SYMBOL_STUBS: // section with only symbol stubs, byte size of stub in
+ // the reserved2 field
+ return eSectionTypeCode;
+ case S_MOD_INIT_FUNC_POINTERS: // section with only function pointers for
+ // initialization
+ return eSectionTypeDataPointers;
+ case S_MOD_TERM_FUNC_POINTERS: // section with only function pointers for
+ // termination
+ return eSectionTypeDataPointers;
+ case S_COALESCED:
+ return eSectionTypeOther;
+ case S_GB_ZEROFILL:
+ return eSectionTypeZeroFill;
+ case S_INTERPOSING: // section with only pairs of function pointers for
+ // interposing
+ return eSectionTypeCode;
+ case S_16BYTE_LITERALS: // section with only 16 byte literals
+ return eSectionTypeData16;
+ case S_DTRACE_DOF:
+ return eSectionTypeDebug;
+ case S_LAZY_DYLIB_SYMBOL_POINTERS:
+ return eSectionTypeDataPointers;
+ default:
+ return eSectionTypeOther;
+ }
+}
- if (m_data.GetU32(&offset, &sect64.offset, num_u32s) == NULL)
- break;
+struct ObjectFileMachO::SegmentParsingContext {
+ const EncryptedFileRanges EncryptedRanges;
+ lldb_private::SectionList &UnifiedList;
+ uint32_t NextSegmentIdx = 0;
+ uint32_t NextSectionIdx = 0;
+ bool FileAddressesChanged = false;
- // Keep a list of mach sections around in case we need to
- // get at data that isn't stored in the abstracted Sections.
- m_mach_sections.push_back(sect64);
-
- if (add_section) {
- ConstString section_name(
- sect64.sectname, std::min<size_t>(strlen(sect64.sectname),
- sizeof(sect64.sectname)));
- if (!const_segname) {
- // We have a segment with no name so we need to conjure up
- // segments that correspond to the section's segname if there
- // isn't already such a section. If there is such a section,
- // we resize the section so that it spans all sections.
- // We also mark these sections as fake so address matches
- // don't
- // hit if they land in the gaps between the child sections.
- const_segname.SetTrimmedCStringWithLength(
- sect64.segname, sizeof(sect64.segname));
- segment_sp =
- unified_section_list.FindSectionByName(const_segname);
- if (segment_sp.get()) {
- Section *segment = segment_sp.get();
- // Grow the section size as needed.
- const lldb::addr_t sect64_min_addr = sect64.addr;
- const lldb::addr_t sect64_max_addr =
- sect64_min_addr + sect64.size;
- const lldb::addr_t curr_seg_byte_size =
- segment->GetByteSize();
- const lldb::addr_t curr_seg_min_addr =
- segment->GetFileAddress();
- const lldb::addr_t curr_seg_max_addr =
- curr_seg_min_addr + curr_seg_byte_size;
- if (sect64_min_addr >= curr_seg_min_addr) {
- const lldb::addr_t new_seg_byte_size =
- sect64_max_addr - curr_seg_min_addr;
- // Only grow the section size if needed
- if (new_seg_byte_size > curr_seg_byte_size)
- segment->SetByteSize(new_seg_byte_size);
- } else {
- // We need to change the base address of the segment and
- // adjust the child section offsets for all existing
- // children.
- const lldb::addr_t slide_amount =
- sect64_min_addr - curr_seg_min_addr;
- segment->Slide(slide_amount, false);
- segment->GetChildren().Slide(-slide_amount, false);
- segment->SetByteSize(curr_seg_max_addr - sect64_min_addr);
- }
+ SegmentParsingContext(EncryptedFileRanges EncryptedRanges,
+ lldb_private::SectionList &UnifiedList)
+ : EncryptedRanges(std::move(EncryptedRanges)), UnifiedList(UnifiedList) {}
+};
- // Grow the section size as needed.
- if (sect64.offset) {
- const lldb::addr_t segment_min_file_offset =
- segment->GetFileOffset();
- const lldb::addr_t segment_max_file_offset =
- segment_min_file_offset + segment->GetFileSize();
-
- const lldb::addr_t section_min_file_offset =
- sect64.offset;
- const lldb::addr_t section_max_file_offset =
- section_min_file_offset + sect64.size;
- const lldb::addr_t new_file_offset = std::min(
- section_min_file_offset, segment_min_file_offset);
- const lldb::addr_t new_file_size =
- std::max(section_max_file_offset,
- segment_max_file_offset) -
- new_file_offset;
- segment->SetFileOffset(new_file_offset);
- segment->SetFileSize(new_file_size);
- }
- } else {
- // Create a fake section for the section's named segment
- segment_sp.reset(new Section(
- segment_sp, // Parent section
- module_sp, // Module to which this section belongs
- this, // Object file to which this section belongs
- ++segID << 8, // Section ID is the 1 based segment index
- // shifted right by 8 bits as not to
- // collide with any of the 256 section IDs
- // that are possible
- const_segname, // Name of this section
- eSectionTypeContainer, // This section is a container of
- // other sections.
- sect64.addr, // File VM address == addresses as they are
- // found in the object file
- sect64.size, // VM size in bytes of this section
- sect64.offset, // Offset to the data for this section in
- // the file
- sect64.offset ? sect64.size : 0, // Size in bytes of
- // this section as
- // found in the file
- sect64.align,
- load_cmd.flags)); // Flags for this section
- segment_sp->SetIsFake(true);
- segment_sp->SetPermissions(segment_permissions);
- m_sections_ap->AddSection(segment_sp);
- if (add_to_unified)
- unified_section_list.AddSection(segment_sp);
- segment_sp->SetIsEncrypted(segment_is_encrypted);
- }
- }
- assert(segment_sp.get());
-
- lldb::SectionType sect_type = eSectionTypeOther;
-
- if (sect64.flags &
- (S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS))
- sect_type = eSectionTypeCode;
- else {
- uint32_t mach_sect_type = sect64.flags & SECTION_TYPE;
- static ConstString g_sect_name_objc_data("__objc_data");
- static ConstString g_sect_name_objc_msgrefs("__objc_msgrefs");
- static ConstString g_sect_name_objc_selrefs("__objc_selrefs");
- static ConstString g_sect_name_objc_classrefs(
- "__objc_classrefs");
- static ConstString g_sect_name_objc_superrefs(
- "__objc_superrefs");
- static ConstString g_sect_name_objc_const("__objc_const");
- static ConstString g_sect_name_objc_classlist(
- "__objc_classlist");
- static ConstString g_sect_name_cfstring("__cfstring");
-
- static ConstString g_sect_name_dwarf_debug_abbrev(
- "__debug_abbrev");
- static ConstString g_sect_name_dwarf_debug_aranges(
- "__debug_aranges");
- static ConstString g_sect_name_dwarf_debug_frame(
- "__debug_frame");
- static ConstString g_sect_name_dwarf_debug_info(
- "__debug_info");
- static ConstString g_sect_name_dwarf_debug_line(
- "__debug_line");
- static ConstString g_sect_name_dwarf_debug_loc("__debug_loc");
- static ConstString g_sect_name_dwarf_debug_macinfo(
- "__debug_macinfo");
- static ConstString g_sect_name_dwarf_debug_pubnames(
- "__debug_pubnames");
- static ConstString g_sect_name_dwarf_debug_pubtypes(
- "__debug_pubtypes");
- static ConstString g_sect_name_dwarf_debug_ranges(
- "__debug_ranges");
- static ConstString g_sect_name_dwarf_debug_str("__debug_str");
- static ConstString g_sect_name_dwarf_apple_names(
- "__apple_names");
- static ConstString g_sect_name_dwarf_apple_types(
- "__apple_types");
- static ConstString g_sect_name_dwarf_apple_namespaces(
- "__apple_namespac");
- static ConstString g_sect_name_dwarf_apple_objc(
- "__apple_objc");
- static ConstString g_sect_name_eh_frame("__eh_frame");
- static ConstString g_sect_name_compact_unwind(
- "__unwind_info");
- static ConstString g_sect_name_text("__text");
- static ConstString g_sect_name_data("__data");
- static ConstString g_sect_name_go_symtab("__gosymtab");
-
- if (section_name == g_sect_name_dwarf_debug_abbrev)
- sect_type = eSectionTypeDWARFDebugAbbrev;
- else if (section_name == g_sect_name_dwarf_debug_aranges)
- sect_type = eSectionTypeDWARFDebugAranges;
- else if (section_name == g_sect_name_dwarf_debug_frame)
- sect_type = eSectionTypeDWARFDebugFrame;
- else if (section_name == g_sect_name_dwarf_debug_info)
- sect_type = eSectionTypeDWARFDebugInfo;
- else if (section_name == g_sect_name_dwarf_debug_line)
- sect_type = eSectionTypeDWARFDebugLine;
- else if (section_name == g_sect_name_dwarf_debug_loc)
- sect_type = eSectionTypeDWARFDebugLoc;
- else if (section_name == g_sect_name_dwarf_debug_macinfo)
- sect_type = eSectionTypeDWARFDebugMacInfo;
- else if (section_name == g_sect_name_dwarf_debug_pubnames)
- sect_type = eSectionTypeDWARFDebugPubNames;
- else if (section_name == g_sect_name_dwarf_debug_pubtypes)
- sect_type = eSectionTypeDWARFDebugPubTypes;
- else if (section_name == g_sect_name_dwarf_debug_ranges)
- sect_type = eSectionTypeDWARFDebugRanges;
- else if (section_name == g_sect_name_dwarf_debug_str)
- sect_type = eSectionTypeDWARFDebugStr;
- else if (section_name == g_sect_name_dwarf_apple_names)
- sect_type = eSectionTypeDWARFAppleNames;
- else if (section_name == g_sect_name_dwarf_apple_types)
- sect_type = eSectionTypeDWARFAppleTypes;
- else if (section_name == g_sect_name_dwarf_apple_namespaces)
- sect_type = eSectionTypeDWARFAppleNamespaces;
- else if (section_name == g_sect_name_dwarf_apple_objc)
- sect_type = eSectionTypeDWARFAppleObjC;
- else if (section_name == g_sect_name_objc_selrefs)
- sect_type = eSectionTypeDataCStringPointers;
- else if (section_name == g_sect_name_objc_msgrefs)
- sect_type = eSectionTypeDataObjCMessageRefs;
- else if (section_name == g_sect_name_eh_frame)
- sect_type = eSectionTypeEHFrame;
- else if (section_name == g_sect_name_compact_unwind)
- sect_type = eSectionTypeCompactUnwind;
- else if (section_name == g_sect_name_cfstring)
- sect_type = eSectionTypeDataObjCCFStrings;
- else if (section_name == g_sect_name_go_symtab)
- sect_type = eSectionTypeGoSymtab;
- else if (section_name == g_sect_name_objc_data ||
- section_name == g_sect_name_objc_classrefs ||
- section_name == g_sect_name_objc_superrefs ||
- section_name == g_sect_name_objc_const ||
- section_name == g_sect_name_objc_classlist) {
- sect_type = eSectionTypeDataPointers;
- }
+void ObjectFileMachO::ProcessSegmentCommand(const load_command &load_cmd_,
+ lldb::offset_t offset,
+ uint32_t cmd_idx,
+ SegmentParsingContext &context) {
+ segment_command_64 load_cmd;
+ memcpy(&load_cmd, &load_cmd_, sizeof(load_cmd_));
- if (sect_type == eSectionTypeOther) {
- switch (mach_sect_type) {
- // TODO: categorize sections by other flags for regular
- // sections
- case S_REGULAR:
- if (section_name == g_sect_name_text)
- sect_type = eSectionTypeCode;
- else if (section_name == g_sect_name_data)
- sect_type = eSectionTypeData;
- else
- sect_type = eSectionTypeOther;
- break;
- case S_ZEROFILL:
- sect_type = eSectionTypeZeroFill;
- break;
- case S_CSTRING_LITERALS:
- sect_type = eSectionTypeDataCString;
- break; // section with only literal C strings
- case S_4BYTE_LITERALS:
- sect_type = eSectionTypeData4;
- break; // section with only 4 byte literals
- case S_8BYTE_LITERALS:
- sect_type = eSectionTypeData8;
- break; // section with only 8 byte literals
- case S_LITERAL_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break; // section with only pointers to literals
- case S_NON_LAZY_SYMBOL_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break; // section with only non-lazy symbol pointers
- case S_LAZY_SYMBOL_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break; // section with only lazy symbol pointers
- case S_SYMBOL_STUBS:
- sect_type = eSectionTypeCode;
- break; // section with only symbol stubs, byte size of
- // stub in the reserved2 field
- case S_MOD_INIT_FUNC_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break; // section with only function pointers for
- // initialization
- case S_MOD_TERM_FUNC_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break; // section with only function pointers for
- // termination
- case S_COALESCED:
- sect_type = eSectionTypeOther;
- break;
- case S_GB_ZEROFILL:
- sect_type = eSectionTypeZeroFill;
- break;
- case S_INTERPOSING:
- sect_type = eSectionTypeCode;
- break; // section with only pairs of function pointers for
- // interposing
- case S_16BYTE_LITERALS:
- sect_type = eSectionTypeData16;
- break; // section with only 16 byte literals
- case S_DTRACE_DOF:
- sect_type = eSectionTypeDebug;
- break;
- case S_LAZY_DYLIB_SYMBOL_POINTERS:
- sect_type = eSectionTypeDataPointers;
- break;
- default:
- break;
- }
- }
- }
+ if (!m_data.GetU8(&offset, (uint8_t *)load_cmd.segname, 16))
+ return;
- SectionSP section_sp(new Section(
- segment_sp, module_sp, this, ++sectID, section_name,
- sect_type, sect64.addr - segment_sp->GetFileAddress(),
- sect64.size, sect64.offset,
- sect64.offset == 0 ? 0 : sect64.size, sect64.align,
- sect64.flags));
- // Set the section to be encrypted to match the segment
-
- bool section_is_encrypted = false;
- if (!segment_is_encrypted && load_cmd.filesize != 0)
- section_is_encrypted =
- encrypted_file_ranges.FindEntryThatContains(
- sect64.offset) != NULL;
-
- section_sp->SetIsEncrypted(segment_is_encrypted ||
- section_is_encrypted);
- section_sp->SetPermissions(segment_permissions);
- segment_sp->GetChildren().AddSection(section_sp);
-
- if (segment_sp->IsFake()) {
- segment_sp.reset();
- const_segname.Clear();
- }
- }
- }
- if (segment_sp && is_dsym) {
- if (first_segment_sectID <= sectID) {
- lldb::user_id_t sect_uid;
- for (sect_uid = first_segment_sectID; sect_uid <= sectID;
- ++sect_uid) {
- SectionSP curr_section_sp(
- segment_sp->GetChildren().FindSectionByID(sect_uid));
- SectionSP next_section_sp;
- if (sect_uid + 1 <= sectID)
- next_section_sp =
- segment_sp->GetChildren().FindSectionByID(sect_uid + 1);
-
- if (curr_section_sp.get()) {
- if (curr_section_sp->GetByteSize() == 0) {
- if (next_section_sp.get() != NULL)
- curr_section_sp->SetByteSize(
- next_section_sp->GetFileAddress() -
- curr_section_sp->GetFileAddress());
- else
- curr_section_sp->SetByteSize(load_cmd.vmsize);
- }
- }
- }
- }
- }
+ ModuleSP module_sp = GetModule();
+ const bool is_core = GetType() == eTypeCoreFile;
+ const bool is_dsym = (m_header.filetype == MH_DSYM);
+ bool add_section = true;
+ bool add_to_unified = true;
+ ConstString const_segname(
+ load_cmd.segname,
+ std::min<size_t>(strlen(load_cmd.segname), sizeof(load_cmd.segname)));
+
+ SectionSP unified_section_sp(
+ context.UnifiedList.FindSectionByName(const_segname));
+ if (is_dsym && unified_section_sp) {
+ if (const_segname == GetSegmentNameLINKEDIT()) {
+ // We need to keep the __LINKEDIT segment private to this object file
+ // only
+ add_to_unified = false;
+ } else {
+ // This is the dSYM file and this section has already been created by the
+ // object file, no need to create it.
+ add_section = false;
+ }
+ }
+ load_cmd.vmaddr = m_data.GetAddress(&offset);
+ load_cmd.vmsize = m_data.GetAddress(&offset);
+ load_cmd.fileoff = m_data.GetAddress(&offset);
+ load_cmd.filesize = m_data.GetAddress(&offset);
+ if (!m_data.GetU32(&offset, &load_cmd.maxprot, 4))
+ return;
+
+ SanitizeSegmentCommand(load_cmd, cmd_idx);
+
+ const uint32_t segment_permissions = GetSegmentPermissions(load_cmd);
+ const bool segment_is_encrypted =
+ (load_cmd.flags & SG_PROTECTED_VERSION_1) != 0;
+
+ // Keep a list of mach segments around in case we need to get at data that
+ // isn't stored in the abstracted Sections.
+ m_mach_segments.push_back(load_cmd);
+
+ // Use a segment ID of the segment index shifted left by 8 so they never
+ // conflict with any of the sections.
+ SectionSP segment_sp;
+ if (add_section && (const_segname || is_core)) {
+ segment_sp.reset(new Section(
+ module_sp, // Module to which this section belongs
+ this, // Object file to which this sections belongs
+ ++context.NextSegmentIdx
+ << 8, // Section ID is the 1 based segment index
+ // shifted right by 8 bits as not to collide with any of the 256
+ // section IDs that are possible
+ const_segname, // Name of this section
+ eSectionTypeContainer, // This section is a container of other
+ // sections.
+ load_cmd.vmaddr, // File VM address == addresses as they are
+ // found in the object file
+ load_cmd.vmsize, // VM size in bytes of this section
+ load_cmd.fileoff, // Offset to the data for this section in
+ // the file
+ load_cmd.filesize, // Size in bytes of this section as found
+ // in the file
+ 0, // Segments have no alignment information
+ load_cmd.flags)); // Flags for this section
+
+ segment_sp->SetIsEncrypted(segment_is_encrypted);
+ m_sections_ap->AddSection(segment_sp);
+ segment_sp->SetPermissions(segment_permissions);
+ if (add_to_unified)
+ context.UnifiedList.AddSection(segment_sp);
+ } else if (unified_section_sp) {
+ if (is_dsym && unified_section_sp->GetFileAddress() != load_cmd.vmaddr) {
+ // Check to see if the module was read from memory?
+ if (module_sp->GetObjectFile()->GetHeaderAddress().IsValid()) {
+ // We have a module that is in memory and needs to have its file
+ // address adjusted. We need to do this because when we load a file
+ // from memory, its addresses will be slid already, yet the addresses
+ // in the new symbol file will still be unslid. Since everything is
+ // stored as section offset, this shouldn't cause any problems.
+
+ // Make sure we've parsed the symbol table from the ObjectFile before
+ // we go around changing its Sections.
+ module_sp->GetObjectFile()->GetSymtab();
+ // eh_frame would present the same problems but we parse that on a per-
+ // function basis as-needed so it's more difficult to remove its use of
+ // the Sections. Realistically, the environments where this code path
+ // will be taken will not have eh_frame sections.
+
+ unified_section_sp->SetFileAddress(load_cmd.vmaddr);
+
+ // Notify the module that the section addresses have been changed once
+ // we're done so any file-address caches can be updated.
+ context.FileAddressesChanged = true;
+ }
+ }
+ m_sections_ap->AddSection(unified_section_sp);
+ }
+
+ struct section_64 sect64;
+ ::memset(&sect64, 0, sizeof(sect64));
+ // Push a section into our mach sections for the section at index zero
+ // (NO_SECT) if we don't have any mach sections yet...
+ if (m_mach_sections.empty())
+ m_mach_sections.push_back(sect64);
+ uint32_t segment_sect_idx;
+ const lldb::user_id_t first_segment_sectID = context.NextSectionIdx + 1;
+
+ const uint32_t num_u32s = load_cmd.cmd == LC_SEGMENT ? 7 : 8;
+ 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)
+ break;
+ if (m_data.GetU8(&offset, (uint8_t *)sect64.segname,
+ sizeof(sect64.segname)) == NULL)
+ break;
+ sect64.addr = m_data.GetAddress(&offset);
+ sect64.size = m_data.GetAddress(&offset);
+
+ if (m_data.GetU32(&offset, &sect64.offset, num_u32s) == NULL)
+ break;
+
+ // Keep a list of mach sections around in case we need to get at data that
+ // isn't stored in the abstracted Sections.
+ m_mach_sections.push_back(sect64);
+
+ if (add_section) {
+ ConstString section_name(
+ sect64.sectname,
+ std::min<size_t>(strlen(sect64.sectname), sizeof(sect64.sectname)));
+ if (!const_segname) {
+ // We have a segment with no name so we need to conjure up segments
+ // that correspond to the section's segname if there isn't already such
+ // a section. If there is such a section, we resize the section so that
+ // it spans all sections. We also mark these sections as fake so
+ // address matches don't hit if they land in the gaps between the child
+ // sections.
+ const_segname.SetTrimmedCStringWithLength(sect64.segname,
+ sizeof(sect64.segname));
+ segment_sp = context.UnifiedList.FindSectionByName(const_segname);
+ if (segment_sp.get()) {
+ Section *segment = segment_sp.get();
+ // Grow the section size as needed.
+ const lldb::addr_t sect64_min_addr = sect64.addr;
+ const lldb::addr_t sect64_max_addr = sect64_min_addr + sect64.size;
+ const lldb::addr_t curr_seg_byte_size = segment->GetByteSize();
+ const lldb::addr_t curr_seg_min_addr = segment->GetFileAddress();
+ const lldb::addr_t curr_seg_max_addr =
+ curr_seg_min_addr + curr_seg_byte_size;
+ if (sect64_min_addr >= curr_seg_min_addr) {
+ const lldb::addr_t new_seg_byte_size =
+ sect64_max_addr - curr_seg_min_addr;
+ // Only grow the section size if needed
+ if (new_seg_byte_size > curr_seg_byte_size)
+ segment->SetByteSize(new_seg_byte_size);
+ } else {
+ // We need to change the base address of the segment and adjust the
+ // child section offsets for all existing children.
+ const lldb::addr_t slide_amount =
+ sect64_min_addr - curr_seg_min_addr;
+ segment->Slide(slide_amount, false);
+ segment->GetChildren().Slide(-slide_amount, false);
+ segment->SetByteSize(curr_seg_max_addr - sect64_min_addr);
}
+
+ // Grow the section size as needed.
+ if (sect64.offset) {
+ const lldb::addr_t segment_min_file_offset =
+ segment->GetFileOffset();
+ const lldb::addr_t segment_max_file_offset =
+ segment_min_file_offset + segment->GetFileSize();
+
+ const lldb::addr_t section_min_file_offset = sect64.offset;
+ const lldb::addr_t section_max_file_offset =
+ section_min_file_offset + sect64.size;
+ const lldb::addr_t new_file_offset =
+ std::min(section_min_file_offset, segment_min_file_offset);
+ const lldb::addr_t new_file_size =
+ std::max(section_max_file_offset, segment_max_file_offset) -
+ new_file_offset;
+ segment->SetFileOffset(new_file_offset);
+ segment->SetFileSize(new_file_size);
+ }
+ } else {
+ // Create a fake section for the section's named segment
+ segment_sp.reset(new Section(
+ segment_sp, // Parent section
+ module_sp, // Module to which this section belongs
+ this, // Object file to which this section belongs
+ ++context.NextSegmentIdx
+ << 8, // Section ID is the 1 based segment index
+ // shifted right by 8 bits as not to
+ // collide with any of the 256 section IDs
+ // that are possible
+ const_segname, // Name of this section
+ eSectionTypeContainer, // This section is a container of
+ // other sections.
+ sect64.addr, // File VM address == addresses as they are
+ // found in the object file
+ sect64.size, // VM size in bytes of this section
+ sect64.offset, // Offset to the data for this section in
+ // the file
+ sect64.offset ? sect64.size : 0, // Size in bytes of
+ // this section as
+ // found in the file
+ sect64.align,
+ load_cmd.flags)); // Flags for this section
+ segment_sp->SetIsFake(true);
+ segment_sp->SetPermissions(segment_permissions);
+ m_sections_ap->AddSection(segment_sp);
+ if (add_to_unified)
+ context.UnifiedList.AddSection(segment_sp);
+ segment_sp->SetIsEncrypted(segment_is_encrypted);
}
- } else if (load_cmd.cmd == LC_DYSYMTAB) {
- m_dysymtab.cmd = load_cmd.cmd;
- m_dysymtab.cmdsize = load_cmd.cmdsize;
- m_data.GetU32(&offset, &m_dysymtab.ilocalsym,
- (sizeof(m_dysymtab) / sizeof(uint32_t)) - 2);
}
+ assert(segment_sp.get());
- offset = load_cmd_offset + load_cmd.cmdsize;
- }
+ lldb::SectionType sect_type = GetSectionType(sect64.flags, section_name);
+
+ SectionSP section_sp(new Section(
+ segment_sp, module_sp, this, ++context.NextSectionIdx, section_name,
+ sect_type, sect64.addr - segment_sp->GetFileAddress(), sect64.size,
+ sect64.offset, sect64.offset == 0 ? 0 : sect64.size, sect64.align,
+ sect64.flags));
+ // Set the section to be encrypted to match the segment
+
+ bool section_is_encrypted = false;
+ if (!segment_is_encrypted && load_cmd.filesize != 0)
+ section_is_encrypted = context.EncryptedRanges.FindEntryThatContains(
+ sect64.offset) != NULL;
+
+ section_sp->SetIsEncrypted(segment_is_encrypted || section_is_encrypted);
+ section_sp->SetPermissions(segment_permissions);
+ segment_sp->GetChildren().AddSection(section_sp);
- if (section_file_addresses_changed && module_sp.get()) {
- module_sp->SectionFileAddressesChanged();
+ if (segment_sp->IsFake()) {
+ segment_sp.reset();
+ const_segname.Clear();
+ }
+ }
+ }
+ if (segment_sp && is_dsym) {
+ if (first_segment_sectID <= context.NextSectionIdx) {
+ lldb::user_id_t sect_uid;
+ for (sect_uid = first_segment_sectID; sect_uid <= context.NextSectionIdx;
+ ++sect_uid) {
+ SectionSP curr_section_sp(
+ segment_sp->GetChildren().FindSectionByID(sect_uid));
+ SectionSP next_section_sp;
+ if (sect_uid + 1 <= context.NextSectionIdx)
+ next_section_sp =
+ segment_sp->GetChildren().FindSectionByID(sect_uid + 1);
+
+ if (curr_section_sp.get()) {
+ if (curr_section_sp->GetByteSize() == 0) {
+ if (next_section_sp.get() != NULL)
+ curr_section_sp->SetByteSize(next_section_sp->GetFileAddress() -
+ curr_section_sp->GetFileAddress());
+ else
+ curr_section_sp->SetByteSize(load_cmd.vmsize);
+ }
+ }
+ }
}
}
}
+void ObjectFileMachO::ProcessDysymtabCommand(const load_command &load_cmd,
+ lldb::offset_t offset) {
+ m_dysymtab.cmd = load_cmd.cmd;
+ m_dysymtab.cmdsize = load_cmd.cmdsize;
+ m_data.GetU32(&offset, &m_dysymtab.ilocalsym,
+ (sizeof(m_dysymtab) / sizeof(uint32_t)) - 2);
+}
+
+void ObjectFileMachO::CreateSections(SectionList &unified_section_list) {
+ if (m_sections_ap)
+ return;
+
+ m_sections_ap.reset(new SectionList());
+
+ lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
+ // bool dump_sections = false;
+ ModuleSP module_sp(GetModule());
+
+ offset = MachHeaderSizeFromMagic(m_header.magic);
+
+ SegmentParsingContext context(GetEncryptedFileRanges(), 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)
+ break;
+
+ if (load_cmd.cmd == LC_SEGMENT || load_cmd.cmd == LC_SEGMENT_64)
+ ProcessSegmentCommand(load_cmd, offset, i, context);
+ else if (load_cmd.cmd == LC_DYSYMTAB)
+ ProcessDysymtabCommand(load_cmd, offset);
+
+ offset = load_cmd_offset + load_cmd.cmdsize;
+ }
+
+ if (context.FileAddressesChanged && module_sp)
+ module_sp->SectionFileAddressesChanged();
+}
+
class MachSymtabSectionInfo {
public:
MachSymtabSectionInfo(SectionList *section_list)
: m_section_list(section_list), m_section_infos() {
- // Get the number of sections down to a depth of 1 to include
- // all segments and their sections, but no other sections that
- // may be added for debug map or
+ // Get the number of sections down to a depth of 1 to include all segments
+ // and their sections, but no other sections that may be added for debug
+ // map or
m_section_infos.resize(section_list->GetNumSections(1));
}
@@ -1956,9 +1935,9 @@ public:
} else if (m_section_infos[n_sect].vm_range.GetByteSize() == 0 &&
m_section_infos[n_sect].vm_range.GetBaseAddress() ==
file_addr) {
- // Symbol is in section with zero size, but has the same start
- // address as the section. This can happen with linker symbols
- // (symbols that start with the letter 'l' or 'L'.
+ // Symbol is in section with zero size, but has the same start address
+ // as the section. This can happen with linker symbols (symbols that
+ // start with the letter 'l' or 'L'.
return m_section_infos[n_sect].section_sp;
}
}
@@ -2108,10 +2087,13 @@ UUID ObjectFileMachO::GetSharedCacheUUID(FileSpec dyld_shared_cache,
version_str[6] = '\0';
if (strcmp(version_str, "dyld_v") == 0) {
offset = offsetof(struct lldb_copy_dyld_cache_header_v1, uuid);
- uint8_t uuid_bytes[sizeof(uuid_t)];
- memcpy(uuid_bytes, dsc_header_data.GetData(&offset, sizeof(uuid_t)),
- sizeof(uuid_t));
- dsc_uuid.SetBytes(uuid_bytes);
+ dsc_uuid = UUID::fromOptionalData(
+ dsc_header_data.GetData(&offset, sizeof(uuid_t)), sizeof(uuid_t));
+ }
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS));
+ if (log && dsc_uuid.IsValid()) {
+ log->Printf("Shared cache %s has UUID %s", dyld_shared_cache.GetPath().c_str(),
+ dsc_uuid.GetAsString().c_str());
}
return dsc_uuid;
}
@@ -2267,10 +2249,9 @@ size_t ObjectFileMachO::ParseSymtab() {
linkedit_section_sp->GetLoadBaseAddress(&target);
if (linkedit_load_addr == LLDB_INVALID_ADDRESS) {
// We might be trying to access the symbol table before the
- // __LINKEDIT's load
- // address has been set in the target. We can't fail to read the
- // symbol table,
- // so calculate the right address manually
+ // __LINKEDIT's load address has been set in the target. We can't
+ // fail to read the symbol table, so calculate the right address
+ // manually
linkedit_load_addr = CalculateSectionLoadAddressForMemoryImage(
m_memory_addr, GetMachHeaderSection(), linkedit_section_sp.get());
}
@@ -2291,8 +2272,8 @@ size_t ObjectFileMachO::ParseSymtab() {
process->GetAddressByteSize() == sizeof(void *)) {
// This mach-o memory file is in the dyld shared cache. If this
// program is not remote and this is iOS, then this process will
- // share the same shared cache as the process we are debugging and
- // we can read the entire __LINKEDIT from the address space in this
+ // share the same shared cache as the process we are debugging and we
+ // can read the entire __LINKEDIT from the address space in this
// process. This is a needed optimization that is used for local iOS
// debugging only since all shared libraries in the shared cache do
// not have corresponding files that exist in the file system of the
@@ -2301,22 +2282,21 @@ size_t ObjectFileMachO::ParseSymtab() {
// string tables from all of the __LINKEDIT sections from the shared
// libraries in the shared cache have been merged into a single large
// symbol and string table. Reading all of this symbol and string
- // table
- // data across can slow down debug launch times, so we optimize this
- // by
- // reading the memory for the __LINKEDIT section from this process.
-
- UUID lldb_shared_cache(GetLLDBSharedCacheUUID());
- UUID process_shared_cache(GetProcessSharedCacheUUID(process));
+ // table data across can slow down debug launch times, so we optimize
+ // this by reading the memory for the __LINKEDIT section from this
+ // process.
+
+ UUID lldb_shared_cache;
+ addr_t lldb_shared_cache_addr;
+ GetLLDBSharedCacheUUID (lldb_shared_cache_addr, lldb_shared_cache);
+ UUID process_shared_cache;
+ addr_t process_shared_cache_addr;
+ GetProcessSharedCacheUUID(process, process_shared_cache_addr, process_shared_cache);
bool use_lldb_cache = true;
if (lldb_shared_cache.IsValid() && process_shared_cache.IsValid() &&
- lldb_shared_cache != process_shared_cache) {
+ (lldb_shared_cache != process_shared_cache
+ || process_shared_cache_addr != lldb_shared_cache_addr)) {
use_lldb_cache = false;
- ModuleSP module_sp(GetModule());
- if (module_sp)
- module_sp->ReportWarning("shared cache in process does not match "
- "lldb's own shared cache, startup will "
- "be slow.");
}
PlatformSP platform_sp(target.GetPlatform());
@@ -2340,10 +2320,9 @@ size_t ObjectFileMachO::ParseSymtab() {
if (!data_was_read) {
// Always load dyld - the dynamic linker - from memory if we didn't
- // find a binary anywhere else.
- // lldb will not register dylib/framework/bundle loads/unloads if we
- // don't have the dyld symbols,
- // we force dyld to load from memory despite the user's
+ // find a binary anywhere else. lldb will not register
+ // dylib/framework/bundle loads/unloads if we don't have the dyld
+ // symbols, we force dyld to load from memory despite the user's
// target.memory-module-load-level setting.
if (memory_module_load_level == eMemoryModuleLoadLevelComplete ||
m_header.filetype == llvm::MachO::MH_DYLINKER) {
@@ -2353,10 +2332,9 @@ size_t ObjectFileMachO::ParseSymtab() {
nlist_data.SetData(nlist_data_sp, 0,
nlist_data_sp->GetByteSize());
// Load strings individually from memory when loading from memory
- // since shared cache
- // string tables contain strings for all symbols from all shared
- // cached libraries
- // DataBufferSP strtab_data_sp (ReadMemory (process_sp, strtab_addr,
+ // since shared cache string tables contain strings for all symbols
+ // from all shared cached libraries DataBufferSP strtab_data_sp
+ // (ReadMemory (process_sp, strtab_addr,
// strtab_data_byte_size));
// if (strtab_data_sp)
// strtab_data.SetData (strtab_data_sp, 0,
@@ -2460,11 +2438,9 @@ size_t ObjectFileMachO::ParseSymtab() {
const bool is_arm = (m_header.cputype == llvm::MachO::CPU_TYPE_ARM);
// lldb works best if it knows the start address of all functions in a
- // module.
- // Linker symbols or debug info are normally the best source of information
- // for start addr / size but
- // they may be stripped in a released binary.
- // Two additional sources of information exist in Mach-O binaries:
+ // module. Linker symbols or debug info are normally the best source of
+ // information for start addr / size but they may be stripped in a released
+ // binary. Two additional sources of information exist in Mach-O binaries:
// LC_FUNCTION_STARTS - a list of ULEB128 encoded offsets of each
// function's start address in the
// binary, relative to the text section.
@@ -2489,12 +2465,10 @@ size_t ObjectFileMachO::ParseSymtab() {
}
} else {
// If m_type is eTypeDebugInfo, then this is a dSYM - it will have the
- // load command claiming an eh_frame
- // but it doesn't actually have the eh_frame content. And if we have a
- // dSYM, we don't need to do any
- // of this fill-in-the-missing-symbols works anyway - the debug info
- // should give us all the functions in
- // the module.
+ // load command claiming an eh_frame but it doesn't actually have the
+ // eh_frame content. And if we have a dSYM, we don't need to do any of
+ // this fill-in-the-missing-symbols works anyway - the debug info should
+ // give us all the functions in the module.
if (text_section_sp.get() && eh_frame_section_sp.get() &&
m_type != eTypeDebugInfo) {
DWARFCallFrameInfo eh_frame(*this, eh_frame_section_sp,
@@ -2518,18 +2492,14 @@ size_t ObjectFileMachO::ParseSymtab() {
const size_t function_starts_count = function_starts.GetSize();
// For user process binaries (executables, dylibs, frameworks, bundles), if
- // we don't have
- // LC_FUNCTION_STARTS/eh_frame section in this binary, we're going to assume
- // the binary
- // has been stripped. Don't allow assembly language instruction emulation
- // because we don't
- // know proper function start boundaries.
+ // we don't have LC_FUNCTION_STARTS/eh_frame section in this binary, we're
+ // going to assume the binary has been stripped. Don't allow assembly
+ // language instruction emulation because we don't know proper function
+ // start boundaries.
//
// For all other types of binaries (kernels, stand-alone bare board
- // binaries, kexts), they
- // may not have LC_FUNCTION_STARTS / eh_frame sections - we should not make
- // any assumptions
- // about them based on that.
+ // binaries, kexts), they may not have LC_FUNCTION_STARTS / eh_frame
+ // sections - we should not make any assumptions about them based on that.
if (function_starts_count == 0 && CalculateStrata() == eStrataUser) {
m_allow_assembly_emulation_unwind_plans = false;
Log *unwind_or_symbol_log(lldb_private::GetLogIfAnyCategoriesSet(
@@ -2561,8 +2531,8 @@ size_t ObjectFileMachO::ParseSymtab() {
ValueToSymbolIndexMap N_FUN_addr_to_sym_idx;
ValueToSymbolIndexMap N_STSYM_addr_to_sym_idx;
ConstNameToSymbolIndexMap N_GSYM_name_to_sym_idx;
- // Any symbols that get merged into another will get an entry
- // in this map so we know
+ // Any symbols that get merged into another will get an entry in this map
+ // so we know
NListIndexToSymbolIndexMap m_nlist_idx_to_sym_idx;
uint32_t nlist_idx = 0;
Symbol *symbol_ptr = NULL;
@@ -2601,21 +2571,18 @@ size_t ObjectFileMachO::ParseSymtab() {
(defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
// Some recent builds of the dyld_shared_cache (hereafter: DSC) have been
- // optimized by moving LOCAL
- // symbols out of the memory mapped portion of the DSC. The symbol
- // information has all been retained,
- // but it isn't available in the normal nlist data. However, there *are*
- // duplicate entries of *some*
+ // optimized by moving LOCAL symbols out of the memory mapped portion of
+ // the DSC. The symbol information has all been retained, but it isn't
+ // available in the normal nlist data. However, there *are* duplicate
+ // entries of *some*
// LOCAL symbols in the normal nlist data. To handle this situation
// correctly, we must first attempt
// to parse any DSC unmapped symbol information. If we find any, we set a
- // flag that tells the normal
- // nlist parser to ignore all LOCAL symbols.
+ // flag that tells the normal nlist parser to ignore all LOCAL symbols.
if (m_header.flags & 0x80000000u) {
- // Before we can start mapping the DSC, we need to make certain the target
- // process is actually
- // using the cache we can find.
+ // Before we can start mapping the DSC, we need to make certain the
+ // target process is actually using the cache we can find.
// Next we need to determine the correct path for the dyld shared cache.
@@ -2644,14 +2611,15 @@ size_t ObjectFileMachO::ParseSymtab() {
UUID dsc_uuid;
UUID process_shared_cache_uuid;
+ addr_t process_shared_cache_base_addr;
if (process) {
- process_shared_cache_uuid = GetProcessSharedCacheUUID(process);
+ GetProcessSharedCacheUUID(process, process_shared_cache_base_addr, process_shared_cache_uuid);
}
- // First see if we can find an exact match for the inferior process shared
- // cache UUID in
- // the development or non-development shared caches on disk.
+ // First see if we can find an exact match for the inferior process
+ // shared cache UUID in the development or non-development shared caches
+ // on disk.
if (process_shared_cache_uuid.IsValid()) {
if (dsc_development_filespec.Exists()) {
UUID dsc_development_uuid = GetSharedCacheUUID(
@@ -2716,8 +2684,7 @@ size_t ObjectFileMachO::ParseSymtab() {
if (process_shared_cache_uuid.IsValid() &&
dsc_uuid != process_shared_cache_uuid) {
// The on-disk dyld_shared_cache file is not the same as the one in
- // this
- // process' memory, don't use it.
+ // this process' memory, don't use it.
uuid_match = false;
ModuleSP module_sp(GetModule());
if (module_sp)
@@ -2745,11 +2712,9 @@ size_t ObjectFileMachO::ParseSymtab() {
offset = 0;
// The File addresses (from the in-memory Mach-O load commands) for
- // the shared libraries
- // in the shared library cache need to be adjusted by an offset to
- // match up with the
- // dylibOffset identifying field in the
- // dyld_cache_local_symbol_entry's. This offset is
+ // the shared libraries in the shared library cache need to be
+ // adjusted by an offset to match up with the dylibOffset identifying
+ // field in the dyld_cache_local_symbol_entry's. This offset is
// recorded in mapping_offset_value.
const uint64_t mapping_offset_value =
dsc_mapping_info_data.GetU64(&offset);
@@ -2843,8 +2808,8 @@ size_t ObjectFileMachO::ParseSymtab() {
if (symbol_name == NULL) {
// No symbol should be NULL, even the symbols with no
- // string values should have an offset zero which points
- // to an empty C-string
+ // string values should have an offset zero which
+ // points to an empty C-string
Host::SystemLog(
Host::eSystemLogError,
"error: DSC unmapped local symbol[%u] has invalid "
@@ -2879,14 +2844,13 @@ size_t ObjectFileMachO::ParseSymtab() {
// FIXME: In the .o files, we have a GSYM and a debug
// symbol for all the ObjC data. They
// have the same address, but we want to ensure that
- // we always find only the real symbol,
- // 'cause we don't currently correctly attribute the
+ // we always find only the real symbol, 'cause we
+ // don't currently correctly attribute the
// GSYM one to the ObjCClass/Ivar/MetaClass
- // symbol type. This is a temporary hack to make sure
- // the ObjectiveC symbols get treated
- // correctly. To do this right, we should coalesce
- // all the GSYM & global symbols that have the
- // same address.
+ // symbol type. This is a temporary hack to make
+ // sure the ObjectiveC symbols get treated correctly.
+ // To do this right, we should coalesce all the GSYM
+ // & global symbols that have the same address.
is_gsym = true;
sym[sym_idx].SetExternal(true);
@@ -2940,25 +2904,24 @@ size_t ObjectFileMachO::ParseSymtab() {
N_FUN_addr_to_sym_idx.insert(
std::make_pair(nlist.n_value, sym_idx));
// We use the current number of symbols in the
- // symbol table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
+ // symbol table in lieu of using nlist_idx in case
+ // we ever start trimming entries out
N_FUN_indexes.push_back(sym_idx);
} else {
type = eSymbolTypeCompiler;
if (!N_FUN_indexes.empty()) {
- // Copy the size of the function into the original
+ // Copy the size of the function into the
+ // original
// STAB entry so we don't have
// to hunt for it later
symtab->SymbolAtIndex(N_FUN_indexes.back())
->SetByteSize(nlist.n_value);
N_FUN_indexes.pop_back();
// We don't really need the end function STAB as
- // it contains the size which
- // we already placed with the original symbol, so
- // don't add it if we want a
- // minimal symbol table
+ // it contains the size which we already placed
+ // with the original symbol, so don't add it if
+ // we want a minimal symbol table
add_nlist = false;
}
}
@@ -2985,19 +2948,17 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_BNSYM:
// We use the current number of symbols in the symbol
- // table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
- // Skip these if we want minimal symbol tables
+ // table in lieu of using nlist_idx in case we ever
+ // start trimming entries out Skip these if we want
+ // minimal symbol tables
add_nlist = false;
break;
case N_ENSYM:
// Set the size of the N_BNSYM to the terminating
- // index of this N_ENSYM
- // so that we can always skip the entire symbol if we
- // need to navigate
- // more quickly at the source level when parsing STABS
+ // index of this N_ENSYM so that we can always skip
+ // the entire symbol if we need to navigate more
+ // quickly at the source level when parsing STABS
// Skip these if we want minimal symbol tables
add_nlist = false;
break;
@@ -3031,11 +2992,9 @@ size_t ObjectFileMachO::ParseSymtab() {
add_nlist = false;
if (N_SO_index != UINT32_MAX) {
// Set the size of the N_SO to the terminating
- // index of this N_SO
- // so that we can always skip the entire N_SO if
- // we need to navigate
- // more quickly at the source level when parsing
- // STABS
+ // index of this N_SO so that we can always skip
+ // the entire N_SO if we need to navigate more
+ // quickly at the source level when parsing STABS
symbol_ptr = symtab->SymbolAtIndex(N_SO_index);
symbol_ptr->SetByteSize(sym_idx);
symbol_ptr->SetSizeIsSibling(true);
@@ -3048,17 +3007,16 @@ size_t ObjectFileMachO::ParseSymtab() {
N_SO_index = UINT32_MAX;
} else {
// We use the current number of symbols in the
- // symbol table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
+ // symbol table in lieu of using nlist_idx in case
+ // we ever start trimming entries out
const bool N_SO_has_full_path =
symbol_name[0] == '/';
if (N_SO_has_full_path) {
if ((N_SO_index == sym_idx - 1) &&
((sym_idx - 1) < num_syms)) {
// We have two consecutive N_SO entries where
- // the first contains a directory
- // and the second contains a full path.
+ // the first contains a directory and the
+ // second contains a full path.
sym[sym_idx - 1].GetMangled().SetValue(
ConstString(symbol_name), false);
m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
@@ -3072,9 +3030,9 @@ size_t ObjectFileMachO::ParseSymtab() {
} else if ((N_SO_index == sym_idx - 1) &&
((sym_idx - 1) < num_syms)) {
// This is usually the second N_SO entry that
- // contains just the filename,
- // so here we combine it with the first one if we
- // are minimizing the symbol table
+ // contains just the filename, so here we combine
+ // it with the first one if we are minimizing the
+ // symbol table
const char *so_path =
sym[sym_idx - 1]
.GetMangled()
@@ -3088,11 +3046,11 @@ size_t ObjectFileMachO::ParseSymtab() {
if (double_slash_pos != std::string::npos) {
// The linker has been generating bad N_SO
// entries with doubled up paths
- // in the format "%s%s" where the first string
- // in the DW_AT_comp_dir,
- // and the second is the directory for the
- // source file so you end up with
- // a path that looks like "/tmp/src//tmp/src/"
+ // in the format "%s%s" where the first
+ // string in the DW_AT_comp_dir, and the
+ // second is the directory for the source
+ // file so you end up with a path that looks
+ // like "/tmp/src//tmp/src/"
FileSpec so_dir(so_path, false);
if (!so_dir.Exists()) {
so_dir.SetFile(
@@ -3134,11 +3092,10 @@ size_t ObjectFileMachO::ParseSymtab() {
// INCL scopes
//----------------------------------------------------------------------
case N_BINCL:
- // include file beginning: name,,NO_SECT,0,sum
- // We use the current number of symbols in the symbol
- // table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
+ // include file beginning: name,,NO_SECT,0,sum We use
+ // the current number of symbols in the symbol table
+ // in lieu of using nlist_idx in case we ever start
+ // trimming entries out
N_INCL_indexes.push_back(sym_idx);
type = eSymbolTypeScopeBegin;
break;
@@ -3146,10 +3103,9 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_EINCL:
// include file end: name,,NO_SECT,0,0
// Set the size of the N_BINCL to the terminating
- // index of this N_EINCL
- // so that we can always skip the entire symbol if we
- // need to navigate
- // more quickly at the source level when parsing STABS
+ // index of this N_EINCL so that we can always skip
+ // the entire symbol if we need to navigate more
+ // quickly at the source level when parsing STABS
if (!N_INCL_indexes.empty()) {
symbol_ptr =
symtab->SymbolAtIndex(N_INCL_indexes.back());
@@ -3199,11 +3155,10 @@ size_t ObjectFileMachO::ParseSymtab() {
// Left and Right Braces
//----------------------------------------------------------------------
case N_LBRAC:
- // left bracket: 0,,NO_SECT,nesting level,address
- // We use the current number of symbols in the symbol
- // table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
+ // left bracket: 0,,NO_SECT,nesting level,address We
+ // use the current number of symbols in the symbol
+ // table in lieu of using nlist_idx in case we ever
+ // start trimming entries out
symbol_section = section_info.GetSection(
nlist.n_sect, nlist.n_value);
N_BRAC_indexes.push_back(sym_idx);
@@ -3213,10 +3168,9 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_RBRAC:
// right bracket: 0,,NO_SECT,nesting level,address
// Set the size of the N_LBRAC to the terminating
- // index of this N_RBRAC
- // so that we can always skip the entire symbol if we
- // need to navigate
- // more quickly at the source level when parsing STABS
+ // index of this N_RBRAC so that we can always skip
+ // the entire symbol if we need to navigate more
+ // quickly at the source level when parsing STABS
symbol_section = section_info.GetSection(
nlist.n_sect, nlist.n_value);
if (!N_BRAC_indexes.empty()) {
@@ -3240,9 +3194,8 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_BCOMM:
// begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol
- // table in lieu of
- // using nlist_idx in case we ever start trimming
- // entries out
+ // table in lieu of using nlist_idx in case we ever
+ // start trimming entries out
type = eSymbolTypeScopeBegin;
N_COMM_indexes.push_back(sym_idx);
break;
@@ -3256,10 +3209,10 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_ECOMM:
// end common: name,,n_sect,0,0
// Set the size of the N_BCOMM to the terminating
- // index of this N_ECOMM/N_ECOML
- // so that we can always skip the entire symbol if we
- // need to navigate
- // more quickly at the source level when parsing STABS
+ // index of this N_ECOMM/N_ECOML so that we can
+ // always skip the entire symbol if we need to
+ // navigate more quickly at the source level when
+ // parsing STABS
if (!N_COMM_indexes.empty()) {
symbol_ptr =
symtab->SymbolAtIndex(N_COMM_indexes.back());
@@ -3549,16 +3502,16 @@ size_t ObjectFileMachO::ParseSymtab() {
function_starts_count > 0) {
addr_t symbol_lookup_file_addr = nlist.n_value;
// Do an exact address match for non-ARM addresses,
- // else get the closest since
- // the symbol might be a thumb symbol which has an
- // address with bit zero set
+ // else get the closest since the symbol might be a
+ // thumb symbol which has an address with bit zero
+ // set
FunctionStarts::Entry *func_start_entry =
function_starts.FindEntry(
symbol_lookup_file_addr, !is_arm);
if (is_arm && func_start_entry) {
// Verify that the function start address is the
- // symbol address (ARM)
- // or the symbol address + 1 (thumb)
+ // symbol address (ARM) or the symbol address + 1
+ // (thumb)
if (func_start_entry->addr !=
symbol_lookup_file_addr &&
func_start_entry->addr !=
@@ -3590,8 +3543,8 @@ size_t ObjectFileMachO::ParseSymtab() {
addr_t next_symbol_file_addr =
next_func_start_entry->addr;
// Be sure the clear the Thumb address bit when
- // we calculate the size
- // from the current and next address
+ // we calculate the size from the current and
+ // next address
if (is_arm)
next_symbol_file_addr &=
THUMB_ADDRESS_BIT_MASK;
@@ -3610,12 +3563,10 @@ size_t ObjectFileMachO::ParseSymtab() {
if (is_debug == false) {
if (type == eSymbolTypeCode) {
// See if we can find a N_FUN entry for any code
- // symbols.
- // If we do find a match, and the name matches, then
- // we
- // can merge the two into just the function symbol
- // to avoid
- // duplicate entries in the symbol table
+ // symbols. If we do find a match, and the name
+ // matches, then we can merge the two into just the
+ // function symbol to avoid duplicate entries in
+ // the symbol table
std::pair<ValueToSymbolIndexMap::const_iterator,
ValueToSymbolIndexMap::const_iterator>
range;
@@ -3663,12 +3614,10 @@ size_t ObjectFileMachO::ParseSymtab() {
type == eSymbolTypeObjCMetaClass ||
type == eSymbolTypeObjCIVar) {
// See if we can find a N_STSYM entry for any data
- // symbols.
- // If we do find a match, and the name matches, then
- // we
- // can merge the two into just the Static symbol to
- // avoid
- // duplicate entries in the symbol table
+ // symbols. If we do find a match, and the name
+ // matches, then we can merge the two into just the
+ // Static symbol to avoid duplicate entries in the
+ // symbol table
std::pair<ValueToSymbolIndexMap::const_iterator,
ValueToSymbolIndexMap::const_iterator>
range;
@@ -3710,8 +3659,8 @@ size_t ObjectFileMachO::ParseSymtab() {
Mangled::ePreferMangled)
.GetCString();
if (gsym_name) {
- // Combine N_GSYM stab entries with the non stab
- // symbol
+ // Combine N_GSYM stab entries with the non
+ // stab symbol
ConstNameToSymbolIndexMap::const_iterator pos =
N_GSYM_name_to_sym_idx.find(gsym_name);
if (pos != N_GSYM_name_to_sym_idx.end()) {
@@ -3827,9 +3776,8 @@ size_t ObjectFileMachO::ParseSymtab() {
symbol_name = strtab_data.PeekCStr(nlist.n_strx);
if (symbol_name == NULL) {
- // No symbol should be NULL, even the symbols with no
- // string values should have an offset zero which points
- // to an empty C-string
+ // 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,
"error: symbol[%u] has invalid string table offset "
"0x%x in %s, ignoring symbol\n",
@@ -3868,14 +3816,12 @@ size_t ObjectFileMachO::ParseSymtab() {
// FIXME: In the .o files, we have a GSYM and a debug symbol for all
// the ObjC data. They
// have the same address, but we want to ensure that we always find
- // only the real symbol,
- // 'cause we don't currently correctly attribute the GSYM one to the
- // ObjCClass/Ivar/MetaClass
- // symbol type. This is a temporary hack to make sure the
- // ObjectiveC symbols get treated
- // correctly. To do this right, we should coalesce all the GSYM &
- // global symbols that have the
- // same address.
+ // only the real symbol, 'cause we don't currently correctly
+ // attribute the GSYM one to the ObjCClass/Ivar/MetaClass symbol
+ // type. This is a temporary hack to make sure the ObjectiveC
+ // symbols get treated correctly. To do this right, we should
+ // coalesce all the GSYM & global symbols that have the same
+ // address.
is_gsym = true;
sym[sym_idx].SetExternal(true);
@@ -3922,24 +3868,21 @@ size_t ObjectFileMachO::ParseSymtab() {
N_FUN_addr_to_sym_idx.insert(
std::make_pair(nlist.n_value, sym_idx));
// We use the current number of symbols in the symbol table in
- // lieu of
- // using nlist_idx in case we ever start trimming entries out
+ // lieu of using nlist_idx in case we ever start trimming entries
+ // out
N_FUN_indexes.push_back(sym_idx);
} else {
type = eSymbolTypeCompiler;
if (!N_FUN_indexes.empty()) {
- // Copy the size of the function into the original STAB entry so
- // we don't have
- // to hunt for it later
+ // Copy the size of the function into the original STAB entry
+ // so we don't have to hunt for it later
symtab->SymbolAtIndex(N_FUN_indexes.back())
->SetByteSize(nlist.n_value);
N_FUN_indexes.pop_back();
- // We don't really need the end function STAB as it contains the
- // size which
- // we already placed with the original symbol, so don't add it
- // if we want a
- // minimal symbol table
+ // We don't really need the end function STAB as it contains
+ // the size which we already placed with the original symbol,
+ // so don't add it if we want a minimal symbol table
add_nlist = false;
}
}
@@ -3966,18 +3909,15 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_BNSYM:
// We use the current number of symbols in the symbol table in lieu
- // of
- // using nlist_idx in case we ever start trimming entries out
+ // of using nlist_idx in case we ever start trimming entries out
// Skip these if we want minimal symbol tables
add_nlist = false;
break;
case N_ENSYM:
// Set the size of the N_BNSYM to the terminating index of this
- // N_ENSYM
- // so that we can always skip the entire symbol if we need to
- // navigate
- // more quickly at the source level when parsing STABS
+ // N_ENSYM so that we can always skip the entire symbol if we need
+ // to navigate more quickly at the source level when parsing STABS
// Skip these if we want minimal symbol tables
add_nlist = false;
break;
@@ -4011,10 +3951,9 @@ size_t ObjectFileMachO::ParseSymtab() {
add_nlist = false;
if (N_SO_index != UINT32_MAX) {
// Set the size of the N_SO to the terminating index of this
- // N_SO
- // so that we can always skip the entire N_SO if we need to
- // navigate
- // more quickly at the source level when parsing STABS
+ // N_SO so that we can always skip the entire N_SO if we need
+ // to navigate more quickly at the source level when parsing
+ // STABS
symbol_ptr = symtab->SymbolAtIndex(N_SO_index);
symbol_ptr->SetByteSize(sym_idx);
symbol_ptr->SetSizeIsSibling(true);
@@ -4027,30 +3966,27 @@ size_t ObjectFileMachO::ParseSymtab() {
N_SO_index = UINT32_MAX;
} else {
// We use the current number of symbols in the symbol table in
- // lieu of
- // using nlist_idx in case we ever start trimming entries out
+ // lieu of using nlist_idx in case we ever start trimming entries
+ // out
const bool N_SO_has_full_path = symbol_name[0] == '/';
if (N_SO_has_full_path) {
if ((N_SO_index == sym_idx - 1) && ((sym_idx - 1) < num_syms)) {
// We have two consecutive N_SO entries where the first
- // contains a directory
- // and the second contains a full path.
+ // contains a directory and the second contains a full path.
sym[sym_idx - 1].GetMangled().SetValue(
ConstString(symbol_name), false);
m_nlist_idx_to_sym_idx[nlist_idx] = sym_idx - 1;
add_nlist = false;
} else {
- // This is the first entry in a N_SO that contains a directory
- // or
- // a full path to the source file
+ // This is the first entry in a N_SO that contains a
+ // directory or a full path to the source file
N_SO_index = sym_idx;
}
} else if ((N_SO_index == sym_idx - 1) &&
((sym_idx - 1) < num_syms)) {
// This is usually the second N_SO entry that contains just the
- // filename,
- // so here we combine it with the first one if we are minimizing
- // the symbol table
+ // filename, so here we combine it with the first one if we are
+ // minimizing the symbol table
const char *so_path =
sym[sym_idx - 1]
.GetMangled()
@@ -4061,16 +3997,14 @@ size_t ObjectFileMachO::ParseSymtab() {
const size_t double_slash_pos = full_so_path.find("//");
if (double_slash_pos != std::string::npos) {
// The linker has been generating bad N_SO entries with
- // doubled up paths
- // in the format "%s%s" where the first string in the
- // DW_AT_comp_dir,
- // and the second is the directory for the source file so
- // you end up with
- // a path that looks like "/tmp/src//tmp/src/"
+ // doubled up paths in the format "%s%s" where the first
+ // string in the DW_AT_comp_dir, and the second is the
+ // directory for the source file so you end up with a path
+ // that looks like "/tmp/src//tmp/src/"
FileSpec so_dir(so_path, false);
if (!so_dir.Exists()) {
- so_dir.SetFile(&full_so_path[double_slash_pos + 1],
- false);
+ so_dir.SetFile(&full_so_path[double_slash_pos + 1], false,
+ FileSpec::Style::native);
if (so_dir.Exists()) {
// Trim off the incorrect path
full_so_path.erase(0, double_slash_pos + 1);
@@ -4106,10 +4040,9 @@ size_t ObjectFileMachO::ParseSymtab() {
// INCL scopes
//----------------------------------------------------------------------
case N_BINCL:
- // include file beginning: name,,NO_SECT,0,sum
- // We use the current number of symbols in the symbol table in lieu
- // of
- // using nlist_idx in case we ever start trimming entries out
+ // include file beginning: name,,NO_SECT,0,sum We use the current
+ // number of symbols in the symbol table in lieu of using nlist_idx
+ // in case we ever start trimming entries out
N_INCL_indexes.push_back(sym_idx);
type = eSymbolTypeScopeBegin;
break;
@@ -4117,10 +4050,8 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_EINCL:
// include file end: name,,NO_SECT,0,0
// Set the size of the N_BINCL to the terminating index of this
- // N_EINCL
- // so that we can always skip the entire symbol if we need to
- // navigate
- // more quickly at the source level when parsing STABS
+ // N_EINCL so that we can always skip the entire symbol if we need
+ // to navigate more quickly at the source level when parsing STABS
if (!N_INCL_indexes.empty()) {
symbol_ptr = symtab->SymbolAtIndex(N_INCL_indexes.back());
symbol_ptr->SetByteSize(sym_idx + 1);
@@ -4169,10 +4100,9 @@ size_t ObjectFileMachO::ParseSymtab() {
// Left and Right Braces
//----------------------------------------------------------------------
case N_LBRAC:
- // left bracket: 0,,NO_SECT,nesting level,address
- // We use the current number of symbols in the symbol table in lieu
- // of
- // using nlist_idx in case we ever start trimming entries out
+ // left bracket: 0,,NO_SECT,nesting level,address We use the
+ // current number of symbols in the symbol table in lieu of using
+ // nlist_idx in case we ever start trimming entries out
symbol_section =
section_info.GetSection(nlist.n_sect, nlist.n_value);
N_BRAC_indexes.push_back(sym_idx);
@@ -4180,12 +4110,10 @@ size_t ObjectFileMachO::ParseSymtab() {
break;
case N_RBRAC:
- // right bracket: 0,,NO_SECT,nesting level,address
- // Set the size of the N_LBRAC to the terminating index of this
- // N_RBRAC
- // so that we can always skip the entire symbol if we need to
- // navigate
- // more quickly at the source level when parsing STABS
+ // right bracket: 0,,NO_SECT,nesting level,address Set the size of
+ // the N_LBRAC to the terminating index of this N_RBRAC so that we
+ // can always skip the entire symbol if we need to navigate more
+ // quickly at the source level when parsing STABS
symbol_section =
section_info.GetSection(nlist.n_sect, nlist.n_value);
if (!N_BRAC_indexes.empty()) {
@@ -4208,8 +4136,7 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_BCOMM:
// begin common: name,,NO_SECT,0,0
// We use the current number of symbols in the symbol table in lieu
- // of
- // using nlist_idx in case we ever start trimming entries out
+ // of using nlist_idx in case we ever start trimming entries out
type = eSymbolTypeScopeBegin;
N_COMM_indexes.push_back(sym_idx);
break;
@@ -4223,10 +4150,9 @@ size_t ObjectFileMachO::ParseSymtab() {
case N_ECOMM:
// end common: name,,n_sect,0,0
// Set the size of the N_BCOMM to the terminating index of this
- // N_ECOMM/N_ECOML
- // so that we can always skip the entire symbol if we need to
- // navigate
- // more quickly at the source level when parsing STABS
+ // N_ECOMM/N_ECOML so that we can always skip the entire symbol if
+ // we need to navigate more quickly at the source level when
+ // parsing STABS
if (!N_COMM_indexes.empty()) {
symbol_ptr = symtab->SymbolAtIndex(N_COMM_indexes.back());
symbol_ptr->SetByteSize(sym_idx + 1);
@@ -4486,15 +4412,13 @@ size_t ObjectFileMachO::ParseSymtab() {
if (symbol_byte_size == 0 && function_starts_count > 0) {
addr_t symbol_lookup_file_addr = nlist.n_value;
// Do an exact address match for non-ARM addresses, else get the
- // closest since
- // the symbol might be a thumb symbol which has an address with
- // bit zero set
+ // closest since the symbol might be a thumb symbol which has an
+ // address with bit zero set
FunctionStarts::Entry *func_start_entry =
function_starts.FindEntry(symbol_lookup_file_addr, !is_arm);
if (is_arm && func_start_entry) {
// Verify that the function start address is the symbol address
- // (ARM)
- // or the symbol address + 1 (thumb)
+ // (ARM) or the symbol address + 1 (thumb)
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...
@@ -4515,8 +4439,7 @@ size_t ObjectFileMachO::ParseSymtab() {
if (next_func_start_entry) {
addr_t next_symbol_file_addr = next_func_start_entry->addr;
// Be sure the clear the Thumb address bit when we calculate
- // the size
- // from the current and next address
+ // the size from the current and next address
if (is_arm)
next_symbol_file_addr &= THUMB_ADDRESS_BIT_MASK;
symbol_byte_size = std::min<lldb::addr_t>(
@@ -4532,10 +4455,10 @@ size_t ObjectFileMachO::ParseSymtab() {
if (is_debug == false) {
if (type == eSymbolTypeCode) {
- // See if we can find a N_FUN entry for any code symbols.
- // If we do find a match, and the name matches, then we
- // can merge the two into just the function symbol to avoid
- // duplicate entries in the symbol table
+ // See if we can find a N_FUN entry for any code symbols. If we
+ // do find a match, and the name matches, then we can merge the
+ // two into just the function symbol to avoid duplicate entries
+ // in the symbol table
std::pair<ValueToSymbolIndexMap::const_iterator,
ValueToSymbolIndexMap::const_iterator>
range;
@@ -4552,9 +4475,8 @@ size_t ObjectFileMachO::ParseSymtab() {
Mangled::ePreferMangled)) {
m_nlist_idx_to_sym_idx[nlist_idx] = pos->second;
// We just need the flags from the linker symbol, so put
- // these flags
- // into the N_FUN flags to avoid duplicate symbols in the
- // symbol table
+ // these flags into the N_FUN flags to avoid duplicate
+ // symbols in the symbol table
sym[pos->second].SetExternal(sym[sym_idx].IsExternal());
sym[pos->second].SetFlags(nlist.n_type << 16 |
nlist.n_desc);
@@ -4577,10 +4499,10 @@ size_t ObjectFileMachO::ParseSymtab() {
type == eSymbolTypeObjCClass ||
type == eSymbolTypeObjCMetaClass ||
type == eSymbolTypeObjCIVar) {
- // See if we can find a N_STSYM entry for any data symbols.
- // If we do find a match, and the name matches, then we
- // can merge the two into just the Static symbol to avoid
- // duplicate entries in the symbol table
+ // See if we can find a N_STSYM entry for any data symbols. If we
+ // do find a match, and the name matches, then we can merge the
+ // two into just the Static symbol to avoid duplicate entries in
+ // the symbol table
std::pair<ValueToSymbolIndexMap::const_iterator,
ValueToSymbolIndexMap::const_iterator>
range;
@@ -4597,9 +4519,8 @@ size_t ObjectFileMachO::ParseSymtab() {
Mangled::ePreferMangled)) {
m_nlist_idx_to_sym_idx[nlist_idx] = pos->second;
// We just need the flags from the linker symbol, so put
- // these flags
- // into the N_STSYM flags to avoid duplicate symbols in the
- // symbol table
+ // these flags into the N_STSYM flags to avoid duplicate
+ // symbols in the symbol table
sym[pos->second].SetExternal(sym[sym_idx].IsExternal());
sym[pos->second].SetFlags(nlist.n_type << 16 |
nlist.n_desc);
@@ -4623,16 +4544,15 @@ size_t ObjectFileMachO::ParseSymtab() {
if (pos != N_GSYM_name_to_sym_idx.end()) {
const uint32_t GSYM_sym_idx = pos->second;
m_nlist_idx_to_sym_idx[nlist_idx] = GSYM_sym_idx;
- // Copy the address, because often the N_GSYM address has an
- // invalid address of zero
- // when the global is a common symbol
+ // Copy the address, because often the N_GSYM address has
+ // an invalid address of zero when the global is a common
+ // symbol
sym[GSYM_sym_idx].GetAddressRef().SetSection(
symbol_section);
sym[GSYM_sym_idx].GetAddressRef().SetOffset(symbol_value);
// We just need the flags from the linker symbol, so put
- // these flags
- // into the N_GSYM flags to avoid duplicate symbols in the
- // symbol table
+ // these flags into the N_GSYM flags to avoid duplicate
+ // symbols in the symbol table
sym[GSYM_sym_idx].SetFlags(nlist.n_type << 16 |
nlist.n_desc);
sym[sym_idx].Clear();
@@ -4739,8 +4659,8 @@ size_t ObjectFileMachO::ParseSymtab() {
}
}
- // Trim our symbols down to just what we ended up with after
- // removing any symbols.
+ // Trim our symbols down to just what we ended up with after removing any
+ // symbols.
if (sym_idx < num_syms) {
num_syms = sym_idx;
sym = symtab->Resize(num_syms);
@@ -4788,13 +4708,12 @@ size_t ObjectFileMachO::ParseSymtab() {
m_nlist_idx_to_sym_idx.find(stub_sym_id);
Symbol *stub_symbol = NULL;
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
+ // We have a remapping from the original nlist index to a
+ // current symbol index, so just look this up by index
stub_symbol = symtab->SymbolAtIndex(index_pos->second);
} else {
- // We need to lookup a symbol using the original nlist
- // symbol index since this index is coming from the
- // S_SYMBOL_STUBS
+ // We need to lookup a symbol using the original nlist symbol
+ // index since this index is coming from the S_SYMBOL_STUBS
stub_symbol = symtab->FindSymbolByID(stub_sym_id);
}
@@ -4803,12 +4722,9 @@ size_t ObjectFileMachO::ParseSymtab() {
if (stub_symbol->GetType() == eSymbolTypeUndefined) {
// Change the external symbol into a trampoline that makes
- // sense
- // These symbols were N_UNDF N_EXT, and are useless to us,
- // so we
- // can re-use them so we don't have to make up a synthetic
- // symbol
- // for no good reason.
+ // sense These symbols were N_UNDF N_EXT, and are useless
+ // to us, so we can re-use them so we don't have to make up
+ // a synthetic symbol for no good reason.
if (resolver_addresses.find(symbol_stub_addr) ==
resolver_addresses.end())
stub_symbol->SetType(eSymbolTypeTrampoline);
@@ -4853,8 +4769,8 @@ size_t ObjectFileMachO::ParseSymtab() {
if (!trie_entries.empty()) {
for (const auto &e : trie_entries) {
if (e.entry.import_name) {
- // Only add indirect symbols from the Trie entries if we
- // didn't have a N_INDR nlist entry for this already
+ // Only add indirect symbols from the Trie entries if we didn't have
+ // a N_INDR nlist entry for this already
if (indirect_symbol_names.find(e.entry.name) ==
indirect_symbol_names.end()) {
// Make a synthetic symbol to describe re-exported symbol.
@@ -4905,7 +4821,7 @@ void ObjectFileMachO::Dump(Stream *s) {
GetArchitecture(header_arch);
*s << ", file = '" << m_file
- << "', arch = " << header_arch.GetArchitectureName() << "\n";
+ << "', triple = " << header_arch.GetTriple().getTriple() << "\n";
SectionList *sections = GetSectionList();
if (sections)
@@ -4943,7 +4859,7 @@ bool ObjectFileMachO::GetUUID(const llvm::MachO::mach_header &header,
if (!memcmp(uuid_bytes, opencl_uuid, 16))
return false;
- uuid.SetBytes(uuid_bytes);
+ uuid = UUID::fromOptionalData(uuid_bytes, 16);
return true;
}
return false;
@@ -4953,6 +4869,21 @@ bool ObjectFileMachO::GetUUID(const llvm::MachO::mach_header &header,
return false;
}
+static const char *GetOSName(uint32_t cmd) {
+ switch (cmd) {
+ case llvm::MachO::LC_VERSION_MIN_IPHONEOS:
+ return "ios";
+ case llvm::MachO::LC_VERSION_MIN_MACOSX:
+ return "macosx";
+ case llvm::MachO::LC_VERSION_MIN_TVOS:
+ return "tvos";
+ case llvm::MachO::LC_VERSION_MIN_WATCHOS:
+ return "watchos";
+ default:
+ llvm_unreachable("unexpected LC_VERSION load command");
+ }
+}
+
bool ObjectFileMachO::GetArchitecture(const llvm::MachO::mach_header &header,
const lldb_private::DataExtractor &data,
lldb::offset_t lc_offset,
@@ -4968,16 +4899,16 @@ bool ObjectFileMachO::GetArchitecture(const llvm::MachO::mach_header &header,
if (header.filetype == MH_PRELOAD) {
if (header.cputype == CPU_TYPE_ARM) {
- // If this is a 32-bit arm binary, and it's a standalone binary,
- // force the Vendor to Apple so we don't accidentally pick up
- // the generic armv7 ABI at runtime. Apple's armv7 ABI always uses
- // r7 for the frame pointer register; most other armv7 ABIs use a
- // combination of r7 and r11.
+ // If this is a 32-bit arm binary, and it's a standalone binary, force
+ // the Vendor to Apple so we don't accidentally pick up the generic
+ // armv7 ABI at runtime. Apple's armv7 ABI always uses r7 for the
+ // frame pointer register; most other armv7 ABIs use a combination of
+ // r7 and r11.
triple.setVendor(llvm::Triple::Apple);
} else {
// Set vendor to an unspecified unknown or a "*" so it can match any
- // vendor
- // This is required for correct behavior of EFI debugging on x86_64
+ // vendor This is required for correct behavior of EFI debugging on
+ // x86_64
triple.setVendor(llvm::Triple::UnknownVendor);
triple.setVendorName(llvm::StringRef());
}
@@ -4991,23 +4922,29 @@ bool ObjectFileMachO::GetArchitecture(const llvm::MachO::mach_header &header,
if (data.GetU32(&offset, &load_cmd, 2) == NULL)
break;
+ uint32_t major, minor, patch;
+ struct version_min_command version_min;
+
+ llvm::SmallString<16> os_name;
+ llvm::raw_svector_ostream os(os_name);
+
switch (load_cmd.cmd) {
case llvm::MachO::LC_VERSION_MIN_IPHONEOS:
- triple.setOS(llvm::Triple::IOS);
- return true;
-
case llvm::MachO::LC_VERSION_MIN_MACOSX:
- triple.setOS(llvm::Triple::MacOSX);
- return true;
-
case llvm::MachO::LC_VERSION_MIN_TVOS:
- triple.setOS(llvm::Triple::TvOS);
- return true;
-
case llvm::MachO::LC_VERSION_MIN_WATCHOS:
- triple.setOS(llvm::Triple::WatchOS);
+ if (load_cmd.cmdsize != sizeof(version_min))
+ break;
+ data.ExtractBytes(cmd_offset,
+ sizeof(version_min), data.GetByteOrder(),
+ &version_min);
+ major = version_min.version >> 16;
+ minor = (version_min.version >> 8) & 0xffu;
+ patch = version_min.version & 0xffu;
+ os << GetOSName(load_cmd.cmd) << major << '.' << minor << '.'
+ << patch;
+ triple.setOSName(os.str());
return true;
-
default:
break;
}
@@ -5048,7 +4985,8 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
std::vector<std::string> rpath_relative_paths;
std::vector<std::string> at_exec_relative_paths;
const bool resolve_path = false; // Don't resolve the dependent file paths
- // since they may not reside on this system
+ // since they may not reside on this
+ // system
uint32_t i;
for (i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
@@ -5112,12 +5050,9 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
for (const auto &rpath : rpath_paths) {
std::string path = rpath;
path += rpath_relative_path;
- // It is OK to resolve this path because we must find a file on
- // disk for us to accept it anyway if it is rpath relative.
+ // It is OK to resolve this path because we must find a file on disk
+ // for us to accept it anyway if it is rpath relative.
FileSpec file_spec(path, true);
- // Remove any redundant parts of the path (like "../foo") since
- // LC_RPATH values often contain "..".
- file_spec = file_spec.GetNormalizedPath();
if (file_spec.Exists() && files.AppendIfUnique(file_spec)) {
count++;
break;
@@ -5135,11 +5070,8 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
for (const auto &at_exec_relative_path : at_exec_relative_paths) {
FileSpec file_spec =
exec_dir.CopyByAppendingPathComponent(at_exec_relative_path);
- file_spec = file_spec.GetNormalizedPath();
- if (file_spec.Exists() && files.AppendIfUnique(file_spec)) {
+ if (file_spec.Exists() && files.AppendIfUnique(file_spec))
count++;
- break;
- }
}
}
}
@@ -5148,17 +5080,15 @@ uint32_t ObjectFileMachO::GetDependentModules(FileSpecList &files) {
lldb_private::Address ObjectFileMachO::GetEntryPointAddress() {
// If the object file is not an executable it can't hold the entry point.
- // m_entry_point_address
- // is initialized to an invalid address, so we can just return that.
- // If m_entry_point_address is valid it means we've found it already, so
- // return the cached value.
+ // m_entry_point_address is initialized to an invalid address, so we can just
+ // return that. If m_entry_point_address is valid it means we've found it
+ // already, so return the cached value.
if (!IsExecutable() || m_entry_point_address.IsValid())
return m_entry_point_address;
// Otherwise, look for the UnixThread or Thread command. The data for the
- // Thread command is given in
- // /usr/include/mach-o.h, but it is basically:
+ // Thread command is given in /usr/include/mach-o.h, but it is basically:
//
// uint32_t flavor - this is the flavor argument you would pass to
// thread_get_state
@@ -5172,9 +5102,9 @@ lldb_private::Address ObjectFileMachO::GetEntryPointAddress() {
// FIXME: We will need to have a "RegisterContext data provider" class at some
// point that can get all the registers
// out of data in this form & attach them to a given thread. That should
- // underlie the MacOS X User process plugin,
- // and we'll also need it for the MacOS X Core File process plugin. When we
- // have that we can also use it here.
+ // underlie the MacOS X User process plugin, and we'll also need it for the
+ // MacOS X Core File process plugin. When we have that we can also use it
+ // here.
//
// For now we hard-code the offsets and flavors we need:
//
@@ -5279,16 +5209,14 @@ lldb_private::Address ObjectFileMachO::GetEntryPointAddress() {
if (start_address != LLDB_INVALID_ADDRESS) {
// We got the start address from the load commands, so now resolve that
- // address in the sections
- // of this ObjectFile:
+ // address in the sections of this ObjectFile:
if (!m_entry_point_address.ResolveAddressUsingFileSections(
start_address, GetSectionList())) {
m_entry_point_address.Clear();
}
} else {
// We couldn't read the UnixThread load command - maybe it wasn't there.
- // As a fallback look for the
- // "start" symbol in the main executable.
+ // As a fallback look for the "start" symbol in the main executable.
ModuleSP module_sp(GetModule());
@@ -5353,8 +5281,8 @@ std::string ObjectFileMachO::GetIdentifierString() {
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
- // First, look over the load commands for an LC_NOTE load command
- // with data_owner string "kern ver str" & use that if found.
+ // First, look over the load commands for an LC_NOTE load command with
+ // data_owner string "kern ver str" & use that if found.
lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
@@ -5370,8 +5298,8 @@ std::string ObjectFileMachO::GetIdentifierString() {
uint64_t fileoff = m_data.GetU64_unchecked (&offset);
uint64_t size = m_data.GetU64_unchecked (&offset);
- // "kern ver str" has a uint32_t version and then a
- // nul terminated c-string.
+ // "kern ver str" has a uint32_t version and then a nul terminated
+ // c-string.
if (strcmp ("kern ver str", data_owner) == 0)
{
offset = fileoff;
@@ -5398,8 +5326,8 @@ std::string ObjectFileMachO::GetIdentifierString() {
offset = cmd_offset + lc.cmdsize;
}
- // Second, make a pass over the load commands looking for an
- // obsolete LC_IDENT load command.
+ // Second, make a pass over the load commands looking for an obsolete
+ // LC_IDENT load command.
offset = MachHeaderSizeFromMagic(m_header.magic);
for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const uint32_t cmd_offset = offset;
@@ -5444,7 +5372,8 @@ bool ObjectFileMachO::GetCorefileMainBinaryInfo (addr_t &address, UUID &uuid) {
uint64_t fileoff = m_data.GetU64_unchecked (&offset);
uint64_t size = m_data.GetU64_unchecked (&offset);
- // "main bin spec" (main binary specification) data payload is formatted:
+ // "main bin spec" (main binary specification) data payload is
+ // formatted:
// uint32_t version [currently 1]
// uint32_t type [0 == unspecified, 1 == kernel, 2 == user process]
// uint64_t address [ UINT64_MAX if address not specified ]
@@ -5461,12 +5390,11 @@ bool ObjectFileMachO::GetCorefileMainBinaryInfo (addr_t &address, UUID &uuid) {
uuid_t raw_uuid;
memset (raw_uuid, 0, sizeof (uuid_t));
- if (m_data.GetU32 (&offset, &type, 1)
- && m_data.GetU64 (&offset, &address, 1)
- && m_data.CopyData (offset, sizeof (uuid_t), raw_uuid) != 0
- && uuid.SetBytes (raw_uuid, sizeof (uuid_t)))
- {
- return true;
+ if (m_data.GetU32(&offset, &type, 1) &&
+ m_data.GetU64(&offset, &address, 1) &&
+ m_data.CopyData(offset, sizeof(uuid_t), raw_uuid) != 0) {
+ uuid = UUID::fromOptionalData(raw_uuid, sizeof(uuid_t));
+ return true;
}
}
}
@@ -5525,9 +5453,9 @@ ObjectFile::Type ObjectFileMachO::CalculateType() {
// UUID load command.
UUID uuid;
if (GetUUID(&uuid)) {
- // this checking for the UUID load command is not enough
- // we could eventually look for the symbol named
- // "OSKextGetCurrentIdentifier" as this is required of kexts
+ // this checking for the UUID load command is not enough we could
+ // eventually look for the symbol named "OSKextGetCurrentIdentifier" as
+ // this is required of kexts
if (m_strata == eStrataInvalid)
m_strata = eStrataKernel;
return eTypeSharedLibrary;
@@ -5569,9 +5497,9 @@ ObjectFile::Strata ObjectFileMachO::CalculateStrata() {
// UUID load command.
UUID uuid;
if (GetUUID(&uuid)) {
- // this checking for the UUID load command is not enough
- // we could eventually look for the symbol named
- // "OSKextGetCurrentIdentifier" as this is required of kexts
+ // this checking for the UUID load command is not enough we could
+ // eventually look for the symbol named "OSKextGetCurrentIdentifier" as
+ // this is required of kexts
if (m_type == eTypeInvalid)
m_type = eTypeSharedLibrary;
@@ -5618,8 +5546,7 @@ ObjectFile::Strata ObjectFileMachO::CalculateStrata() {
return eStrataUnknown;
}
-uint32_t ObjectFileMachO::GetVersion(uint32_t *versions,
- uint32_t num_versions) {
+llvm::VersionTuple ObjectFileMachO::GetVersion() {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
@@ -5647,23 +5574,13 @@ uint32_t ObjectFileMachO::GetVersion(uint32_t *versions,
}
if (version_cmd == LC_ID_DYLIB) {
- if (versions != NULL && num_versions > 0) {
- if (num_versions > 0)
- versions[0] = (version & 0xFFFF0000ull) >> 16;
- if (num_versions > 1)
- versions[1] = (version & 0x0000FF00ull) >> 8;
- if (num_versions > 2)
- versions[2] = (version & 0x000000FFull);
- // Fill in an remaining version numbers with invalid values
- for (i = 3; i < num_versions; ++i)
- versions[i] = UINT32_MAX;
- }
- // The LC_ID_DYLIB load command has a version with 3 version numbers
- // in it, so always return 3
- return 3;
+ unsigned major = (version & 0xFFFF0000ull) >> 16;
+ unsigned minor = (version & 0x0000FF00ull) >> 8;
+ unsigned subminor = (version & 0x000000FFull);
+ return llvm::VersionTuple(major, minor, subminor);
}
}
- return false;
+ return llvm::VersionTuple();
}
bool ObjectFileMachO::GetArchitecture(ArchSpec &arch) {
@@ -5676,21 +5593,40 @@ bool ObjectFileMachO::GetArchitecture(ArchSpec &arch) {
return false;
}
-UUID ObjectFileMachO::GetProcessSharedCacheUUID(Process *process) {
- UUID uuid;
+void ObjectFileMachO::GetProcessSharedCacheUUID(Process *process, addr_t &base_addr, UUID &uuid) {
+ uuid.Clear();
+ base_addr = LLDB_INVALID_ADDRESS;
if (process && process->GetDynamicLoader()) {
DynamicLoader *dl = process->GetDynamicLoader();
- addr_t load_address;
LazyBool using_shared_cache;
LazyBool private_shared_cache;
- dl->GetSharedCacheInformation(load_address, uuid, using_shared_cache,
+ dl->GetSharedCacheInformation(base_addr, uuid, using_shared_cache,
private_shared_cache);
}
- return uuid;
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_SYMBOLS | LIBLLDB_LOG_PROCESS));
+ if (log)
+ log->Printf("inferior process shared cache has a UUID of %s, base address 0x%" PRIx64 , uuid.GetAsString().c_str(), base_addr);
}
-UUID ObjectFileMachO::GetLLDBSharedCacheUUID() {
- UUID uuid;
+// From dyld SPI header dyld_process_info.h
+typedef void *dyld_process_info;
+struct lldb_copy__dyld_process_cache_info {
+ uuid_t cacheUUID; // UUID of cache used by process
+ uint64_t cacheBaseAddress; // load address of dyld shared cache
+ bool noCache; // process is running without a dyld cache
+ bool privateCache; // process is using a private copy of its dyld cache
+};
+
+// #including mach/mach.h pulls in machine.h & CPU_TYPE_ARM etc conflicts with llvm
+// enum definitions llvm::MachO::CPU_TYPE_ARM turning them into compile errors.
+// So we need to use the actual underlying types of task_t and kern_return_t
+// below.
+extern "C" unsigned int /*task_t*/ mach_task_self();
+
+void ObjectFileMachO::GetLLDBSharedCacheUUID(addr_t &base_addr, UUID &uuid) {
+ uuid.Clear();
+ base_addr = LLDB_INVALID_ADDRESS;
+
#if defined(__APPLE__) && \
(defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
uint8_t *(*dyld_get_all_image_infos)(void);
@@ -5708,25 +5644,60 @@ UUID ObjectFileMachO::GetLLDBSharedCacheUUID() {
sharedCacheUUID_address =
(uuid_t *)((uint8_t *)dyld_all_image_infos_address +
160); // sharedCacheUUID <mach-o/dyld_images.h>
+ if (*version >= 15)
+ base_addr = *(uint64_t *) ((uint8_t *) dyld_all_image_infos_address
+ + 176); // sharedCacheBaseAddress <mach-o/dyld_images.h>
} else {
sharedCacheUUID_address =
(uuid_t *)((uint8_t *)dyld_all_image_infos_address +
84); // sharedCacheUUID <mach-o/dyld_images.h>
+ if (*version >= 15) {
+ base_addr = 0;
+ base_addr = *(uint32_t *) ((uint8_t *) dyld_all_image_infos_address
+ + 100); // sharedCacheBaseAddress <mach-o/dyld_images.h>
+ }
+ }
+ uuid = UUID::fromOptionalData(sharedCacheUUID_address, sizeof(uuid_t));
+ }
+ }
+ } else {
+ // Exists in macOS 10.12 and later, iOS 10.0 and later - dyld SPI
+ dyld_process_info (*dyld_process_info_create)(unsigned int /* task_t */ task, uint64_t timestamp, unsigned int /*kern_return_t*/ *kernelError);
+ void (*dyld_process_info_get_cache)(void *info, void *cacheInfo);
+ void (*dyld_process_info_release)(dyld_process_info info);
+
+ dyld_process_info_create = (void *(*)(unsigned int /* task_t */, uint64_t, unsigned int /*kern_return_t*/ *))
+ dlsym (RTLD_DEFAULT, "_dyld_process_info_create");
+ dyld_process_info_get_cache = (void (*)(void *, void *))
+ dlsym (RTLD_DEFAULT, "_dyld_process_info_get_cache");
+ dyld_process_info_release = (void (*)(void *))
+ dlsym (RTLD_DEFAULT, "_dyld_process_info_release");
+
+ if (dyld_process_info_create && dyld_process_info_get_cache) {
+ unsigned int /*kern_return_t */ kern_ret;
+ dyld_process_info process_info = dyld_process_info_create(::mach_task_self(), 0, &kern_ret);
+ if (process_info) {
+ struct lldb_copy__dyld_process_cache_info sc_info;
+ memset (&sc_info, 0, sizeof (struct lldb_copy__dyld_process_cache_info));
+ dyld_process_info_get_cache (process_info, &sc_info);
+ if (sc_info.cacheBaseAddress != 0) {
+ base_addr = sc_info.cacheBaseAddress;
+ uuid = UUID::fromOptionalData(sc_info.cacheUUID, sizeof(uuid_t));
}
- uuid.SetBytes(sharedCacheUUID_address);
+ dyld_process_info_release (process_info);
}
}
}
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_SYMBOLS | LIBLLDB_LOG_PROCESS));
+ if (log && uuid.IsValid())
+ log->Printf("lldb's in-memory shared cache has a UUID of %s base address of 0x%" PRIx64, uuid.GetAsString().c_str(), base_addr);
#endif
- return uuid;
}
-uint32_t ObjectFileMachO::GetMinimumOSVersion(uint32_t *versions,
- uint32_t num_versions) {
- if (m_min_os_versions.empty()) {
+llvm::VersionTuple ObjectFileMachO::GetMinimumOSVersion() {
+ if (!m_min_os_version) {
lldb::offset_t offset = MachHeaderSizeFromMagic(m_header.magic);
- bool success = false;
- for (uint32_t i = 0; success == false && i < m_header.ncmds; ++i) {
+ for (uint32_t i = 0; i < m_header.ncmds; ++i) {
const lldb::offset_t load_cmd_offset = offset;
version_min_command lc;
@@ -5742,35 +5713,21 @@ uint32_t ObjectFileMachO::GetMinimumOSVersion(uint32_t *versions,
const uint32_t yy = (lc.version >> 8) & 0xffu;
const uint32_t zz = lc.version & 0xffu;
if (xxxx) {
- m_min_os_versions.push_back(xxxx);
- m_min_os_versions.push_back(yy);
- m_min_os_versions.push_back(zz);
+ m_min_os_version = llvm::VersionTuple(xxxx, yy, zz);
+ break;
}
- success = true;
}
}
offset = load_cmd_offset + lc.cmdsize;
}
- if (success == false) {
- // Push an invalid value so we don't keep trying to
- m_min_os_versions.push_back(UINT32_MAX);
+ if (!m_min_os_version) {
+ // Set version to an empty value so we don't keep trying to
+ m_min_os_version = llvm::VersionTuple();
}
}
- if (m_min_os_versions.size() > 1 || m_min_os_versions[0] != UINT32_MAX) {
- if (versions != NULL && num_versions > 0) {
- for (size_t i = 0; i < num_versions; ++i) {
- if (i < m_min_os_versions.size())
- versions[i] = m_min_os_versions[i];
- else
- versions[i] = 0;
- }
- }
- return m_min_os_versions.size();
- }
- // Call the superclasses version that will empty out the data
- return ObjectFile::GetMinimumOSVersion(versions, num_versions);
+ return *m_min_os_version;
}
uint32_t ObjectFileMachO::GetSDKVersion(uint32_t *versions,
@@ -5797,20 +5754,29 @@ uint32_t ObjectFileMachO::GetSDKVersion(uint32_t *versions,
m_sdk_versions.push_back(xxxx);
m_sdk_versions.push_back(yy);
m_sdk_versions.push_back(zz);
+ success = true;
+ } else {
+ GetModule()->ReportWarning(
+ "minimum OS version load command with invalid (0) version found.");
}
- success = true;
}
}
offset = load_cmd_offset + lc.cmdsize;
}
if (success == false) {
- // Push an invalid value so we don't keep trying to
+ // Push an invalid value so we don't try to find
+ // the version # again on the next call to this
+ // method.
m_sdk_versions.push_back(UINT32_MAX);
}
}
- if (m_sdk_versions.size() > 1 || m_sdk_versions[0] != UINT32_MAX) {
+ // Legitimate version numbers will have 3 entries pushed
+ // on to m_sdk_versions. If we only have one value, it's
+ // 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) {
for (size_t i = 0; i < num_versions; ++i) {
if (i < m_sdk_versions.size())
@@ -5843,9 +5809,9 @@ lldb_private::ConstString ObjectFileMachO::GetPluginName() {
uint32_t ObjectFileMachO::GetPluginVersion() { return 1; }
Section *ObjectFileMachO::GetMachHeaderSection() {
- // Find the first address of the mach header which is the first non-zero
- // file sized section whose file offset is zero. This is the base file address
- // of the mach-o file which can be subtracted from the vmaddr of the other
+ // Find the first address of the mach header which is the first non-zero file
+ // sized section whose file offset is zero. This is the base file address of
+ // the mach-o file which can be subtracted from the vmaddr of the other
// segments found in memory and added to the load address
ModuleSP module_sp = GetModule();
if (module_sp) {
@@ -5883,8 +5849,8 @@ lldb::addr_t ObjectFileMachO::CalculateSectionLoadAddressForMemoryImage(
module_sp.get() == section->GetModule().get()) {
// Ignore __LINKEDIT and __DWARF segments
if (section->GetName() == GetSegmentNameLINKEDIT()) {
- // Only map __LINKEDIT if we have an in memory image and this isn't
- // a kernel binary like a kext or mach_kernel.
+ // Only map __LINKEDIT if we have an in memory image and this isn't a
+ // kernel binary like a kext or mach_kernel.
const bool is_memory_image = (bool)m_process_wp.lock();
const Strata strata = GetStrata();
if (is_memory_image == false || strata == eStrataKernel)
@@ -5910,9 +5876,8 @@ bool ObjectFileMachO::SetLoadAddress(Target &target, lldb::addr_t value,
if (value_is_offset) {
// "value" is an offset to apply to each top level segment
for (size_t sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
- // Iterate through the object file sections to find all
- // of the sections that size on disk (to avoid __PAGEZERO)
- // and load them
+ // Iterate through the object file sections to find all of the
+ // sections that size on disk (to avoid __PAGEZERO) and load them
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
if (section_sp && section_sp->GetFileSize() > 0 &&
section_sp->IsThreadSpecific() == false &&
@@ -5920,8 +5885,7 @@ bool ObjectFileMachO::SetLoadAddress(Target &target, lldb::addr_t value,
// Ignore __LINKEDIT and __DWARF segments
if (section_sp->GetName() == GetSegmentNameLINKEDIT()) {
// Only map __LINKEDIT if we have an in memory image and this
- // isn't
- // a kernel binary like a kext or mach_kernel.
+ // isn't a kernel binary like a kext or mach_kernel.
const bool is_memory_image = (bool)m_process_wp.lock();
const Strata strata = GetStrata();
if (is_memory_image == false || strata == eStrataKernel)
@@ -6071,10 +6035,10 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
ThreadList &thread_list = process_sp->GetThreadList();
const uint32_t num_threads = thread_list.GetSize();
- // Make an array of LC_THREAD data items. Each one contains
- // the contents of the LC_THREAD load command. The data doesn't
- // contain the load command + load command size, we will
- // add the load command and load command size as we emit the data.
+ // Make an array of LC_THREAD data items. Each one contains the
+ // contents of the LC_THREAD load command. The data doesn't contain
+ // the load command + load command size, we will add the load command
+ // and load command size as we emit the data.
std::vector<StreamString> LC_THREAD_datas(num_threads);
for (auto &LC_THREAD_data : LC_THREAD_datas) {
LC_THREAD_data.GetFlags().Set(Stream::eBinary);
@@ -6234,8 +6198,8 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
bytes_left -= bytes_read;
addr += bytes_read;
} else {
- // Some pages within regions are not readable, those
- // should be zero filled
+ // Some pages within regions are not readable, those should
+ // be zero filled
memset(bytes, 0, bytes_to_read);
size_t bytes_written = bytes_to_read;
error = core_file.Write(bytes, bytes_written);
diff --git a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
index 9a42f41a4c94..be64518064b5 100644
--- a/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
+++ b/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.h
@@ -86,7 +86,7 @@ public:
uint32_t GetAddressByteSize() const override;
- lldb::AddressClass GetAddressClass(lldb::addr_t file_addr) override;
+ lldb_private::AddressClass GetAddressClass(lldb::addr_t file_addr) override;
lldb_private::Symtab *GetSymtab() override;
@@ -123,10 +123,9 @@ public:
ObjectFile::Strata CalculateStrata() override;
- uint32_t GetVersion(uint32_t *versions, uint32_t num_versions) override;
+ llvm::VersionTuple GetVersion() override;
- uint32_t GetMinimumOSVersion(uint32_t *versions,
- uint32_t num_versions) override;
+ llvm::VersionTuple GetMinimumOSVersion() override;
uint32_t GetSDKVersion(uint32_t *versions, uint32_t num_versions) override;
@@ -162,14 +161,14 @@ protected:
// with an on-disk dyld_shared_cache file. The process will record
// the shared cache UUID so the on-disk cache can be matched or rejected
// correctly.
- lldb_private::UUID GetProcessSharedCacheUUID(lldb_private::Process *);
+ void GetProcessSharedCacheUUID(lldb_private::Process *, lldb::addr_t &base_addr, lldb_private::UUID &uuid);
// Intended for same-host arm device debugging where lldb will read
// shared cache libraries out of its own memory instead of the remote
// process' memory as an optimization. If lldb's shared cache UUID
// does not match the process' shared cache UUID, this optimization
// should not be used.
- lldb_private::UUID GetLLDBSharedCacheUUID();
+ void GetLLDBSharedCacheUUID(lldb::addr_t &base_addir, lldb_private::UUID &uuid);
lldb_private::Section *GetMachHeaderSection();
@@ -185,6 +184,18 @@ protected:
size_t ParseSymtab();
+ typedef lldb_private::RangeArray<uint32_t, uint32_t, 8> EncryptedFileRanges;
+ EncryptedFileRanges GetEncryptedFileRanges();
+
+ struct SegmentParsingContext;
+ void ProcessDysymtabCommand(const llvm::MachO::load_command &load_cmd,
+ lldb::offset_t offset);
+ void ProcessSegmentCommand(const llvm::MachO::load_command &load_cmd,
+ lldb::offset_t offset, uint32_t cmd_idx,
+ SegmentParsingContext &context);
+ void SanitizeSegmentCommand(llvm::MachO::segment_command_64 &seg_cmd,
+ uint32_t cmd_idx);
+
llvm::MachO::mach_header m_header;
static const lldb_private::ConstString &GetSegmentNameTEXT();
static const lldb_private::ConstString &GetSegmentNameDATA();
@@ -197,7 +208,7 @@ protected:
llvm::MachO::dysymtab_command m_dysymtab;
std::vector<llvm::MachO::segment_command_64> m_mach_segments;
std::vector<llvm::MachO::section_64> m_mach_sections;
- std::vector<uint32_t> m_min_os_versions;
+ llvm::Optional<llvm::VersionTuple> m_min_os_version;
std::vector<uint32_t> m_sdk_versions;
typedef lldb_private::RangeVector<uint32_t, uint32_t> FileRangeArray;
lldb_private::Address m_entry_point_address;
diff --git a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
index 77bfa7fe0a64..b2967f1532ab 100644
--- a/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
+++ b/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
@@ -236,8 +236,8 @@ bool ObjectFilePECOFF::SetLoadAddress(Target &target, addr_t value,
size_t sect_idx = 0;
for (sect_idx = 0; sect_idx < num_sections; ++sect_idx) {
- // Iterate through the object file sections to find all
- // of the sections that have SHF_ALLOC in their flag bits.
+ // Iterate through the object file sections to find all of the sections
+ // that have SHF_ALLOC in their flag bits.
SectionSP section_sp(section_list->GetSectionAtIndex(sect_idx));
if (section_sp && !section_sp->IsThreadSpecific()) {
if (target.GetSectionLoadList().SetSectionLoadAddress(
@@ -268,8 +268,8 @@ uint32_t ObjectFilePECOFF::GetAddressByteSize() const {
//----------------------------------------------------------------------
// NeedsEndianSwap
//
-// Return true if an endian swap needs to occur when extracting data
-// from this file.
+// Return true if an endian swap needs to occur when extracting data from this
+// file.
//----------------------------------------------------------------------
bool ObjectFilePECOFF::NeedsEndianSwap() const {
#if defined(__LITTLE_ENDIAN__)
@@ -552,8 +552,8 @@ Symtab *ObjectFilePECOFF::GetSymtab() {
// are followed by a 4-byte string table offset. Else these
// 8 bytes contain the symbol name
if (symtab_data.GetU32(&offset) == 0) {
- // Long string that doesn't fit into the symbol table name,
- // so now we must read the 4 byte string table offset
+ // Long string that doesn't fit into the symbol table name, so
+ // now we must read the 4 byte string table offset
uint32_t strtab_offset = symtab_data.GetU32(&offset);
symbol_name_cstr = strtab_data.PeekCStr(strtab_offset);
symbol_name.assign(symbol_name_cstr);
@@ -692,10 +692,12 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
static ConstString g_sect_name_dwarf_debug_line(".debug_line");
static ConstString g_sect_name_dwarf_debug_loc(".debug_loc");
static ConstString g_sect_name_dwarf_debug_macinfo(".debug_macinfo");
+ static ConstString g_sect_name_dwarf_debug_names(".debug_names");
static ConstString g_sect_name_dwarf_debug_pubnames(".debug_pubnames");
static ConstString g_sect_name_dwarf_debug_pubtypes(".debug_pubtypes");
static ConstString g_sect_name_dwarf_debug_ranges(".debug_ranges");
static ConstString g_sect_name_dwarf_debug_str(".debug_str");
+ static ConstString g_sect_name_dwarf_debug_types(".debug_types");
static ConstString g_sect_name_eh_frame(".eh_frame");
static ConstString g_sect_name_go_symtab(".gosymtab");
SectionType section_type = eSectionTypeOther;
@@ -736,6 +738,8 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
section_type = eSectionTypeDWARFDebugLoc;
else if (const_sect_name == g_sect_name_dwarf_debug_macinfo)
section_type = eSectionTypeDWARFDebugMacInfo;
+ else if (const_sect_name == g_sect_name_dwarf_debug_names)
+ section_type = eSectionTypeDWARFDebugNames;
else if (const_sect_name == g_sect_name_dwarf_debug_pubnames)
section_type = eSectionTypeDWARFDebugPubNames;
else if (const_sect_name == g_sect_name_dwarf_debug_pubtypes)
@@ -744,6 +748,8 @@ void ObjectFilePECOFF::CreateSections(SectionList &unified_section_list) {
section_type = eSectionTypeDWARFDebugRanges;
else if (const_sect_name == g_sect_name_dwarf_debug_str)
section_type = eSectionTypeDWARFDebugStr;
+ else if (const_sect_name == g_sect_name_dwarf_debug_types)
+ section_type = eSectionTypeDWARFDebugTypes;
else if (const_sect_name == g_sect_name_eh_frame)
section_type = eSectionTypeEHFrame;
else if (const_sect_name == g_sect_name_go_symtab)
diff --git a/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp b/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
index 75bc518f7538..3f6083931513 100644
--- a/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
+++ b/source/Plugins/OperatingSystem/Go/OperatingSystemGo.cpp
@@ -312,8 +312,8 @@ bool OperatingSystemGo::UpdateThreadList(ThreadList &old_thread_list,
}
std::vector<Goroutine> goroutines;
// The threads that are in "new_thread_list" upon entry are the threads from
- // the
- // lldb_private::Process subclass, no memory threads will be in this list.
+ // the lldb_private::Process subclass, no memory threads will be in this
+ // list.
Status err;
for (uint64_t i = 0; i < allglen; ++i) {
@@ -402,7 +402,6 @@ lldb::ThreadSP OperatingSystemGo::CreateThread(lldb::tid_t tid,
ValueObjectSP OperatingSystemGo::FindGlobal(TargetSP target, const char *name) {
VariableList variable_list;
- const bool append = true;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));
@@ -414,7 +413,7 @@ ValueObjectSP OperatingSystemGo::FindGlobal(TargetSP target, const char *name) {
}
uint32_t match_count = target->GetImages().FindGlobalVariables(
- ConstString(name), append, 1, variable_list);
+ ConstString(name), 1, variable_list);
if (match_count > 0) {
ExecutionContextScope *exe_scope = target->GetProcessSP().get();
if (exe_scope == NULL)
diff --git a/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp b/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
index b71f3cf04c33..d6252c473270 100644
--- a/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
+++ b/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
@@ -50,8 +50,8 @@ void OperatingSystemPython::Terminate() {
OperatingSystem *OperatingSystemPython::CreateInstance(Process *process,
bool force) {
- // Python OperatingSystem plug-ins must be requested by name, so force must be
- // true
+ // Python OperatingSystem plug-ins must be requested by name, so force must
+ // be true
FileSpec python_os_plugin_spec(process->GetPythonOSPluginPath());
if (python_os_plugin_spec && python_os_plugin_spec.Exists()) {
std::unique_ptr<OperatingSystemPython> os_ap(
@@ -156,9 +156,10 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OS));
- // First thing we have to do is to try to get the API lock, and the run lock.
- // We're going to change the thread content of the process, and we're going
- // to use python, which requires the API lock to do it.
+ // First thing we have to do is to try to get the API lock, and the
+ // interpreter lock. We're going to change the thread content of the process,
+ // and we're going to use python, which requires the API lock to do it. We
+ // need the interpreter lock to make sure thread_info_dict stays alive.
//
// If someone already has the API lock, that is ok, we just want to avoid
// external code from making new API calls while this call is happening.
@@ -166,9 +167,10 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
// This is a recursive lock so we can grant it to any Python code called on
// the stack below us.
Target &target = m_process->GetTarget();
- std::unique_lock<std::recursive_mutex> lock(target.GetAPIMutex(),
- std::defer_lock);
- lock.try_lock();
+ std::unique_lock<std::recursive_mutex> api_lock(target.GetAPIMutex(),
+ std::defer_lock);
+ api_lock.try_lock();
+ auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
if (log)
log->Printf("OperatingSystemPython::UpdateThreadList() fetching thread "
@@ -176,20 +178,16 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
m_process->GetID());
// The threads that are in "new_thread_list" upon entry are the threads from
- // the
- // lldb_private::Process subclass, no memory threads will be in this list.
-
- auto interpreter_lock =
- m_interpreter
- ->AcquireInterpreterLock(); // to make sure threads_list stays alive
+ // the lldb_private::Process subclass, no memory threads will be in this
+ // list.
StructuredData::ArraySP threads_list =
m_interpreter->OSPlugin_ThreadsInfo(m_python_object_sp);
const uint32_t num_cores = core_thread_list.GetSize(false);
// Make a map so we can keep track of which cores were used from the
- // core_thread list. Any real threads/cores that weren't used should
- // later be put back into the "new_thread_list".
+ // core_thread list. Any real threads/cores that weren't used should later be
+ // put back into the "new_thread_list".
std::vector<bool> core_used_map(num_cores, false);
if (threads_list) {
if (log) {
@@ -214,8 +212,7 @@ bool OperatingSystemPython::UpdateThreadList(ThreadList &old_thread_list,
// Any real core threads that didn't end up backing a memory thread should
// still be in the main thread list, and they should be inserted at the
- // beginning
- // of the list
+ // beginning of the list
uint32_t insert_idx = 0;
for (uint32_t core_idx = 0; core_idx < num_cores; ++core_idx) {
if (core_used_map[core_idx] == false) {
@@ -256,8 +253,8 @@ ThreadSP OperatingSystemPython::CreateThreadFromThreadInfo(
// plug-in generated thread.
if (!IsOperatingSystemPluginThread(thread_sp)) {
// We have thread ID overlap between the protocol threads and the
- // operating system threads, clear the thread so we create an
- // operating system thread for this.
+ // operating system threads, clear the thread so we create an operating
+ // system thread for this.
thread_sp.reset();
}
}
@@ -301,20 +298,24 @@ OperatingSystemPython::CreateRegisterContextForThread(Thread *thread,
if (!IsOperatingSystemPluginThread(thread->shared_from_this()))
return reg_ctx_sp;
- // First thing we have to do is get the API lock, and the run lock. We're
- // going to change the thread
- // content of the process, and we're going to use python, which requires the
- // API lock to do it.
- // So get & hold that. This is a recursive lock so we can grant it to any
- // Python code called on the stack below us.
+ // First thing we have to do is to try to get the API lock, and the
+ // interpreter lock. We're going to change the thread content of the process,
+ // and we're going to use python, which requires the API lock to do it. We
+ // need the interpreter lock to make sure thread_info_dict stays alive.
+ //
+ // If someone already has the API lock, that is ok, we just want to avoid
+ // external code from making new API calls while this call is happening.
+ //
+ // This is a recursive lock so we can grant it to any Python code called on
+ // the stack below us.
Target &target = m_process->GetTarget();
- std::lock_guard<std::recursive_mutex> guard(target.GetAPIMutex());
+ std::unique_lock<std::recursive_mutex> api_lock(target.GetAPIMutex(),
+ std::defer_lock);
+ api_lock.try_lock();
+ auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
- auto lock =
- m_interpreter
- ->AcquireInterpreterLock(); // to make sure python objects stays alive
if (reg_data_addr != LLDB_INVALID_ADDRESS) {
// The registers data is in contiguous memory, just create the register
// context using the address provided
@@ -326,8 +327,8 @@ OperatingSystemPython::CreateRegisterContextForThread(Thread *thread,
reg_ctx_sp.reset(new RegisterContextMemory(
*thread, 0, *GetDynamicRegisterInfo(), reg_data_addr));
} else {
- // No register data address is provided, query the python plug-in to let
- // it make up the data as it sees fit
+ // No register data address is provided, query the python plug-in to let it
+ // make up the data as it sees fit
if (log)
log->Printf("OperatingSystemPython::CreateRegisterContextForThread (tid "
"= 0x%" PRIx64 ", 0x%" PRIx64
@@ -383,18 +384,23 @@ lldb::ThreadSP OperatingSystemPython::CreateThread(lldb::tid_t tid,
tid, context);
if (m_interpreter && m_python_object_sp) {
- // First thing we have to do is get the API lock, and the run lock. We're
- // going to change the thread
- // content of the process, and we're going to use python, which requires the
- // API lock to do it.
- // So get & hold that. This is a recursive lock so we can grant it to any
- // Python code called on the stack below us.
+ // First thing we have to do is to try to get the API lock, and the
+ // interpreter lock. We're going to change the thread content of the
+ // process, and we're going to use python, which requires the API lock to
+ // do it. We need the interpreter lock to make sure thread_info_dict stays
+ // alive.
+ //
+ // If someone already has the API lock, that is ok, we just want to avoid
+ // external code from making new API calls while this call is happening.
+ //
+ // This is a recursive lock so we can grant it to any Python code called on
+ // the stack below us.
Target &target = m_process->GetTarget();
- std::lock_guard<std::recursive_mutex> guard(target.GetAPIMutex());
+ std::unique_lock<std::recursive_mutex> api_lock(target.GetAPIMutex(),
+ std::defer_lock);
+ api_lock.try_lock();
+ auto interpreter_lock = m_interpreter->AcquireInterpreterLock();
- auto lock = m_interpreter->AcquireInterpreterLock(); // to make sure
- // thread_info_dict
- // stays alive
StructuredData::DictionarySP thread_info_dict =
m_interpreter->OSPlugin_CreateThread(m_python_object_sp, tid, context);
std::vector<bool> core_used_map;
diff --git a/source/Plugins/Platform/Android/AdbClient.cpp b/source/Plugins/Platform/Android/AdbClient.cpp
index 6e15eb2b1dcb..4cd8c645dd76 100644
--- a/source/Plugins/Platform/Android/AdbClient.cpp
+++ b/source/Plugins/Platform/Android/AdbClient.cpp
@@ -165,8 +165,8 @@ Status AdbClient::GetDevices(DeviceIDList &device_list) {
for (const auto device : devices)
device_list.push_back(device.split('\t').first);
- // Force disconnect since ADB closes connection after host:devices
- // response is sent.
+ // Force disconnect since ADB closes connection after host:devices response
+ // is sent.
m_conn.reset();
return error;
}
diff --git a/source/Plugins/Platform/Android/PlatformAndroid.cpp b/source/Plugins/Platform/Android/PlatformAndroid.cpp
index 5b85bcdf7fdd..1cedcde97a92 100644
--- a/source/Plugins/Platform/Android/PlatformAndroid.cpp
+++ b/source/Plugins/Platform/Android/PlatformAndroid.cpp
@@ -83,9 +83,9 @@ PlatformSP PlatformAndroid::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__ANDROID__)
- // Only accept "unknown" for the vendor if the host is android and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified_
+ // Only accept "unknown" for the vendor if the host is android and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified_
case llvm::Triple::VendorType::UnknownVendor:
create = !arch->TripleVendorWasSpecified();
break;
@@ -100,9 +100,9 @@ PlatformSP PlatformAndroid::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__ANDROID__)
- // Only accept "unknown" for the OS if the host is android and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is android and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::OSType::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -193,8 +193,7 @@ Status PlatformAndroid::GetFile(const FileSpec &source,
if (IsHost() || !m_remote_platform_sp)
return PlatformLinux::GetFile(source, destination);
- FileSpec source_spec(source.GetPath(false), false,
- FileSpec::ePathSyntaxPosix);
+ FileSpec source_spec(source.GetPath(false), false, FileSpec::Style::posix);
if (source_spec.IsRelative())
source_spec = GetRemoteWorkingDirectory().CopyByAppendingPathComponent(
source_spec.GetCString(false));
@@ -222,8 +221,8 @@ Status PlatformAndroid::GetFile(const FileSpec &source,
if (strchr(source_file, '\'') != nullptr)
return Status("Doesn't support single-quotes in filenames");
- // mode == 0 can signify that adbd cannot access the file
- // due security constraints - try "cat ..." as a fallback.
+ // mode == 0 can signify that adbd cannot access the file due security
+ // constraints - try "cat ..." as a fallback.
AdbClient adb(m_device_id);
char cmd[PATH_MAX];
@@ -239,7 +238,7 @@ Status PlatformAndroid::PutFile(const FileSpec &source,
return PlatformLinux::PutFile(source, destination, uid, gid);
FileSpec destination_spec(destination.GetPath(false), false,
- FileSpec::ePathSyntaxPosix);
+ FileSpec::Style::posix);
if (destination_spec.IsRelative())
destination_spec = GetRemoteWorkingDirectory().CopyByAppendingPathComponent(
destination_spec.GetCString(false));
@@ -306,7 +305,7 @@ Status PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
const FileSpec &dst_file_spec) {
// For oat file we can try to fetch additional debug info from the device
ConstString extension = module_sp->GetFileSpec().GetFileNameExtension();
- if (extension != ConstString("oat") && extension != ConstString("odex"))
+ if (extension != ConstString(".oat") && extension != ConstString(".odex"))
return Status(
"Symbol file downloading only supported for oat and odex files");
@@ -361,10 +360,8 @@ Status PlatformAndroid::DownloadSymbolFile(const lldb::ModuleSP &module_sp,
}
bool PlatformAndroid::GetRemoteOSVersion() {
- m_major_os_version = GetSdkVersion();
- m_minor_os_version = 0;
- m_update_os_version = 0;
- return m_major_os_version != 0;
+ m_os_version = llvm::VersionTuple(GetSdkVersion());
+ return !m_os_version.empty();
}
llvm::StringRef
diff --git a/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
index dbc74833e287..2415da31daf0 100644
--- a/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
+++ b/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp
@@ -180,9 +180,9 @@ Status PlatformAndroidRemoteGDBServer::MakeConnectURL(
static const int kAttempsNum = 5;
Status error;
- // There is a race possibility that somebody will occupy
- // a port while we're in between FindUnusedPort and ForwardPortWithAdb -
- // adding the loop to mitigate such problem.
+ // There is a race possibility that somebody will occupy a port while we're
+ // in between FindUnusedPort and ForwardPortWithAdb - adding the loop to
+ // mitigate such problem.
for (auto i = 0; i < kAttempsNum; ++i) {
uint16_t local_port = 0;
error = FindUnusedPort(local_port);
@@ -208,10 +208,9 @@ lldb::ProcessSP PlatformAndroidRemoteGDBServer::ConnectProcess(
lldb_private::Debugger &debugger, lldb_private::Target *target,
lldb_private::Status &error) {
// We don't have the pid of the remote gdbserver when it isn't started by us
- // but we still want
- // to store the list of port forwards we set up in our port forward map.
- // Generate a fake pid for
- // these cases what won't collide with any other valid pid on android.
+ // but we still want to store the list of port forwards we set up in our port
+ // forward map. Generate a fake pid for these cases what won't collide with
+ // any other valid pid on android.
static lldb::pid_t s_remote_gdbserver_fake_pid = 0xffffffffffffffffULL;
int remote_port;
diff --git a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
index 73c7d21f0a06..bc8111d1078b 100644
--- a/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
+++ b/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
@@ -32,8 +32,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
-// Define these constants from FreeBSD mman.h for use when targeting
-// remote FreeBSD systems even when host has different values.
+// Define these constants from FreeBSD mman.h for use when targeting remote
+// FreeBSD systems even when host has different values.
#define MAP_PRIVATE 0x0002
#define MAP_ANON 0x1000
@@ -60,9 +60,8 @@ PlatformSP PlatformFreeBSD::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__FreeBSD__)
- // Only accept "unknown" for the OS if the host is BSD and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is BSD and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::OSType::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -143,7 +142,8 @@ bool PlatformFreeBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
arch = hostArch;
return arch.IsValid();
} else if (idx == 1) {
- // If the default host architecture is 64-bit, look for a 32-bit variant
+ // If the default host architecture is 64-bit, look for a 32-bit
+ // variant
if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) {
arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);
return arch.IsValid();
@@ -187,13 +187,10 @@ bool PlatformFreeBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
return false;
}
// Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the
- // vendor by
- // calling triple.SetVendorName("unknown") so that it is a "unspecified
- // unknown".
- // This means when someone calls triple.GetVendorName() it will return an
- // empty string
- // which indicates that the vendor can be set when two architectures are
- // merged
+ // vendor by calling triple.SetVendorName("unknown") so that it is a
+ // "unspecified unknown". This means when someone calls
+ // triple.GetVendorName() it will return an empty string which indicates
+ // that the vendor can be set when two architectures are merged
// Now set the triple into "arch" and return true
arch.SetTriple(triple);
@@ -228,16 +225,16 @@ PlatformFreeBSD::GetSoftwareBreakpointTrapOpcode(Target &target,
switch (target.GetArchitecture().GetMachine()) {
case llvm::Triple::arm: {
lldb::BreakpointLocationSP bp_loc_sp(bp_site->GetOwnerAtIndex(0));
- AddressClass addr_class = eAddressClassUnknown;
+ AddressClass addr_class = AddressClass::eUnknown;
if (bp_loc_sp) {
addr_class = bp_loc_sp->GetAddress().GetAddressClass();
- if (addr_class == eAddressClassUnknown &&
+ if (addr_class == AddressClass::eUnknown &&
(bp_loc_sp->GetAddress().GetFileAddress() & 1))
- addr_class = eAddressClassCodeAlternateISA;
+ addr_class = AddressClass::eCodeAlternateISA;
}
- if (addr_class == eAddressClassCodeAlternateISA) {
+ if (addr_class == AddressClass::eCodeAlternateISA) {
// TODO: Enable when FreeBSD supports thumb breakpoints.
// FreeBSD kernel as of 10.x, does not support thumb breakpoints
return 0;
@@ -286,9 +283,9 @@ lldb::ProcessSP PlatformFreeBSD::Attach(ProcessAttachInfo &attach_info,
if (target && error.Success()) {
debugger.GetTargetList().SetSelectedTarget(target);
- // The freebsd always currently uses the GDB remote debugger plug-in
- // so even when debugging locally we are debugging remotely!
- // Just like the darwin plugin.
+ // The freebsd always currently uses the GDB remote debugger plug-in so
+ // even when debugging locally we are debugging remotely! Just like the
+ // darwin plugin.
process_sp = target->CreateProcess(
attach_info.GetListenerForProcess(debugger), "gdb-remote", NULL);
diff --git a/source/Plugins/Platform/Linux/PlatformLinux.cpp b/source/Plugins/Platform/Linux/PlatformLinux.cpp
index 8186eae0e8c4..dbde91d7ab2d 100644
--- a/source/Plugins/Platform/Linux/PlatformLinux.cpp
+++ b/source/Plugins/Platform/Linux/PlatformLinux.cpp
@@ -30,8 +30,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
-// Define these constants from Linux mman.h for use when targeting
-// remote linux systems even when host has different values.
+// Define these constants from Linux mman.h for use when targeting remote linux
+// systems even when host has different values.
#define MAP_PRIVATE 2
#define MAP_ANON 0x20
@@ -58,9 +58,8 @@ PlatformSP PlatformLinux::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__linux__)
- // Only accept "unknown" for the OS if the host is linux and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is linux and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::OSType::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -142,7 +141,8 @@ bool PlatformLinux::GetSupportedArchitectureAtIndex(uint32_t idx,
arch = hostArch;
return arch.IsValid();
} else if (idx == 1) {
- // If the default host architecture is 64-bit, look for a 32-bit variant
+ // If the default host architecture is 64-bit, look for a 32-bit
+ // variant
if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) {
arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);
return arch.IsValid();
@@ -192,13 +192,10 @@ bool PlatformLinux::GetSupportedArchitectureAtIndex(uint32_t idx,
return false;
}
// Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the
- // vendor by
- // calling triple.SetVendorName("unknown") so that it is a "unspecified
- // unknown".
- // This means when someone calls triple.GetVendorName() it will return an
- // empty string
- // which indicates that the vendor can be set when two architectures are
- // merged
+ // vendor by calling triple.SetVendorName("unknown") so that it is a
+ // "unspecified unknown". This means when someone calls
+ // triple.GetVendorName() it will return an empty string which indicates
+ // that the vendor can be set when two architectures are merged
// Now set the triple into "arch" and return true
arch.SetTriple(triple);
@@ -212,8 +209,8 @@ void PlatformLinux::GetStatus(Stream &strm) {
#ifndef LLDB_DISABLE_POSIX
// Display local kernel information only when we are running in host mode.
- // Otherwise, we would end up printing non-Linux information (when running
- // on Mac OS for example).
+ // Otherwise, we would end up printing non-Linux information (when running on
+ // Mac OS for example).
if (IsHost()) {
struct utsname un;
@@ -272,8 +269,8 @@ bool PlatformLinux::CanDebugProcess() {
}
// For local debugging, Linux will override the debug logic to use llgs-launch
-// rather than lldb-launch, llgs-attach. This differs from current lldb-launch,
-// debugserver-attach approach on MacOSX.
+// rather than lldb-launch, llgs-attach. This differs from current lldb-
+// launch, debugserver-attach approach on MacOSX.
lldb::ProcessSP
PlatformLinux::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
Target *target, // Can be NULL, if NULL create a new
@@ -297,8 +294,8 @@ PlatformLinux::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
launch_info.GetFlags().Set(eLaunchFlagDebug);
// We always launch the process we are going to debug in a separate process
- // group, since then we can handle ^C interrupts ourselves w/o having to worry
- // about the target getting them as well.
+ // group, since then we can handle ^C interrupts ourselves w/o having to
+ // worry about the target getting them as well.
launch_info.SetLaunchInSeparateProcessGroup(true);
// Ensure we have a target.
diff --git a/source/Plugins/Platform/MacOSX/CMakeLists.txt b/source/Plugins/Platform/MacOSX/CMakeLists.txt
index f8d911b321f8..f9663559069a 100644
--- a/source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ b/source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@ list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
PlatformAppleSimulator.cpp
PlatformiOSSimulator.cpp
- PlatformiOSSimulatorCoreSimulatorSupport.mm
PlatformAppleTVSimulator.cpp
PlatformAppleWatchSimulator.cpp
)
if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
include_directories(${LIBXML2_INCLUDE_DIR})
+ add_subdirectory(objcxx)
+ set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX")
list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
else()
@@ -38,6 +39,7 @@ add_lldb_library(lldbPluginPlatformMacOSX PLUGIN
lldbTarget
lldbUtility
lldbPluginPlatformPOSIX
+ ${OBJC_LIBS}
LINK_COMPONENTS
Support
)
diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
index a216e3839dd9..6852097117a1 100644
--- a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.cpp
@@ -84,8 +84,8 @@ lldb_private::Status PlatformAppleSimulator::LaunchProcess(
void PlatformAppleSimulator::GetStatus(Stream &strm) {
#if defined(__APPLE__)
- // This will get called by subclasses, so just output status on the
- // current simulator
+ // This will get called by subclasses, so just output status on the current
+ // simulator
PlatformAppleSimulator::LoadCoreSimulator();
CoreSimulatorSupport::DeviceSet devices =
@@ -183,8 +183,8 @@ lldb::ProcessSP PlatformAppleSimulator::DebugProcess(
// Make sure we stop at the entry point
launch_info.GetFlags().Set(eLaunchFlagDebug);
// We always launch the process we are going to debug in a separate process
- // group, since then we can handle ^C interrupts ourselves w/o having to worry
- // about the target getting them as well.
+ // group, since then we can handle ^C interrupts ourselves w/o having to
+ // worry about the target getting them as well.
launch_info.SetLaunchInSeparateProcessGroup(true);
error = LaunchProcess(launch_info);
@@ -201,10 +201,10 @@ lldb::ProcessSP PlatformAppleSimulator::DebugProcess(
// process if this happens.
process_sp->SetShouldDetach(false);
- // If we didn't have any file actions, the pseudo terminal might
- // have been used where the slave side was given as the file to
- // open for stdin/out/err after we have already opened the master
- // so we can read/write stdin/out/err.
+ // If we didn't have any file actions, the pseudo terminal might have
+ // been used where the slave side was given as the file to open for
+ // stdin/out/err after we have already opened the master so we can
+ // read/write stdin/out/err.
int pty_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
if (pty_fd != PseudoTerminal::invalid_fd) {
process_sp->SetSTDIOFileDescriptor(pty_fd);
diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
index 44feb019dc73..2536854e9630 100644
--- a/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
+++ b/source/Plugins/Platform/MacOSX/PlatformAppleSimulator.h
@@ -16,8 +16,8 @@
// Other libraries and framework includes
// Project includes
-#include "PlatformDarwin.h"
-#include "PlatformiOSSimulatorCoreSimulatorSupport.h"
+#include "Plugins/Platform/MacOSX/PlatformDarwin.h"
+#include "Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h"
#include "lldb/Utility/FileSpec.h"
#include "llvm/ADT/Optional.h"
diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
index e0558f8b200e..e55cc0f4f6a4 100644
--- a/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformAppleTVSimulator.cpp
@@ -90,9 +90,9 @@ PlatformSP PlatformAppleTVSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the vendor if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -107,9 +107,9 @@ PlatformSP PlatformAppleTVSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the OS if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -199,9 +199,9 @@ Status PlatformAppleTVSimulator::ResolveExecutable(
return error;
exe_module_sp.reset();
}
- // No valid architecture was specified or the exact ARM slice wasn't
- // found so ask the platform for the architectures that we should be
- // using (in the correct order) and see if we can find a match that way
+ // No valid architecture was specified or the exact ARM slice wasn't found
+ // so ask the platform for the architectures that we should be using (in
+ // the correct order) and see if we can find a match that way
StreamString arch_names;
ArchSpec platform_arch;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
@@ -293,8 +293,8 @@ const char *PlatformAppleTVSimulator::GetSDKDirectoryAsCString() {
m_sdk_directory.assign(1, '\0');
}
- // We should have put a single NULL character into m_sdk_directory
- // or it should have a valid path if the code gets here
+ // We should have put a single NULL character into m_sdk_directory or it
+ // should have a valid path if the code gets here
assert(m_sdk_directory.empty() == false);
if (m_sdk_directory[0])
return m_sdk_directory.c_str();
@@ -315,12 +315,12 @@ Status PlatformAppleTVSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
@@ -337,10 +337,9 @@ Status PlatformAppleTVSimulator::GetSharedModule(
const ModuleSpec &module_spec, lldb_private::Process *process,
ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr,
ModuleSP *old_module_sp_ptr, bool *did_create_ptr) {
- // For AppleTV, the SDK files are all cached locally on the host
- // system. So first we ask for the file in the cached SDK,
- // then we attempt to get a shared module for the right architecture
- // with the right UUID.
+ // For AppleTV, the SDK files are all cached locally on the host system. So
+ // first we ask for the file in the cached SDK, then we attempt to get a
+ // shared module for the right architecture with the right UUID.
Status error;
ModuleSpec platform_module_spec(module_spec);
const FileSpec &platform_file = module_spec.GetFileSpec();
diff --git a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
index 9b2608f68625..8bbe0af0aec2 100644
--- a/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformAppleWatchSimulator.cpp
@@ -89,9 +89,9 @@ PlatformSP PlatformAppleWatchSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the vendor if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -106,9 +106,9 @@ PlatformSP PlatformAppleWatchSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the OS if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -199,9 +199,9 @@ Status PlatformAppleWatchSimulator::ResolveExecutable(
return error;
exe_module_sp.reset();
}
- // No valid architecture was specified or the exact ARM slice wasn't
- // found so ask the platform for the architectures that we should be
- // using (in the correct order) and see if we can find a match that way
+ // No valid architecture was specified or the exact ARM slice wasn't found
+ // so ask the platform for the architectures that we should be using (in
+ // the correct order) and see if we can find a match that way
StreamString arch_names;
ArchSpec platform_arch;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
@@ -293,8 +293,8 @@ const char *PlatformAppleWatchSimulator::GetSDKDirectoryAsCString() {
m_sdk_directory.assign(1, '\0');
}
- // We should have put a single NULL character into m_sdk_directory
- // or it should have a valid path if the code gets here
+ // We should have put a single NULL character into m_sdk_directory or it
+ // should have a valid path if the code gets here
assert(m_sdk_directory.empty() == false);
if (m_sdk_directory[0])
return m_sdk_directory.c_str();
@@ -315,12 +315,12 @@ Status PlatformAppleWatchSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
@@ -337,10 +337,9 @@ Status PlatformAppleWatchSimulator::GetSharedModule(
const ModuleSpec &module_spec, lldb_private::Process *process,
ModuleSP &module_sp, const FileSpecList *module_search_paths_ptr,
ModuleSP *old_module_sp_ptr, bool *did_create_ptr) {
- // For AppleWatch, the SDK files are all cached locally on the host
- // system. So first we ask for the file in the cached SDK,
- // then we attempt to get a shared module for the right architecture
- // with the right UUID.
+ // For AppleWatch, the SDK files are all cached locally on the host system.
+ // So first we ask for the file in the cached SDK, then we attempt to get a
+ // shared module for the right architecture with the right UUID.
Status error;
ModuleSpec platform_module_spec(module_spec);
const FileSpec &platform_file = module_spec.GetFileSpec();
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index b04d72f755f6..886e3b6d9a05 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -16,8 +16,6 @@
#include <algorithm>
#include <mutex>
-// Other libraries and framework includes
-#include "clang/Basic/VersionTuple.h"
// Project includes
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Breakpoint/BreakpointSite.h"
@@ -42,6 +40,7 @@
#include "llvm/ADT/STLExtras.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Threading.h"
+#include "llvm/Support/VersionTuple.h"
#if defined(__APPLE__)
#include <TargetConditionals.h> // for TARGET_OS_TV, TARGET_OS_WATCH
@@ -73,10 +72,9 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
// NB some extensions might be meaningful and should not be stripped -
// "this.binary.file"
// should not lose ".file" but GetFileNameStrippingExtension() will do
- // precisely that.
- // Ideally, we should have a per-platform list of extensions (".exe",
- // ".app", ".dSYM", ".framework")
- // which should be stripped while leaving "this.binary.file" as-is.
+ // precisely that. Ideally, we should have a per-platform list of
+ // extensions (".exe", ".app", ".dSYM", ".framework") which should be
+ // stripped while leaving "this.binary.file" as-is.
ScriptInterpreter *script_interpreter =
target->GetDebugger().GetCommandInterpreter().GetScriptInterpreter();
@@ -101,14 +99,11 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
// FIXME: for Python, we cannot allow certain characters in
// module
// filenames we import. Theoretically, different scripting
- // languages may
- // have different sets of forbidden tokens in filenames, and
- // that should
- // be dealt with by each ScriptInterpreter. For now, we just
- // replace dots
- // with underscores, but if we ever support anything other than
- // Python
- // we will need to rework this
+ // languages may have different sets of forbidden tokens in
+ // filenames, and that should be dealt with by each
+ // ScriptInterpreter. For now, we just replace dots with
+ // underscores, but if we ever support anything other than
+ // Python we will need to rework this
std::replace(module_basename.begin(), module_basename.end(),
'.', '_');
std::replace(module_basename.begin(), module_basename.end(),
@@ -125,9 +120,9 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
StreamString path_string;
StreamString original_path_string;
// for OSX we are going to be in
- // .dSYM/Contents/Resources/DWARF/<basename>
- // let us go to .dSYM/Contents/Resources/Python/<basename>.py
- // and see if the file exists
+ // .dSYM/Contents/Resources/DWARF/<basename> let us go to
+ // .dSYM/Contents/Resources/Python/<basename>.py and see if the
+ // file exists
path_string.Printf("%s/../Python/%s.py",
symfile_spec.GetDirectory().GetCString(),
module_basename.c_str());
@@ -140,9 +135,8 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
true);
// if we did some replacements of reserved characters, and a
- // file with the untampered name
- // exists, then warn the user that the file as-is shall not be
- // loaded
+ // file with the untampered name exists, then warn the user
+ // that the file as-is shall not be loaded
if (feedback_stream) {
if (module_basename != original_module_basename &&
orig_script_fspec.Exists()) {
@@ -178,8 +172,8 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResources(
break;
}
- // If we didn't find the python file, then keep
- // stripping the extensions and try again
+ // If we didn't find the python file, then keep stripping the
+ // extensions and try again
ConstString filename_no_extension(
module_spec.GetFileNameStrippingExtension());
if (module_spec.GetFilename() == filename_no_extension)
@@ -270,8 +264,8 @@ lldb_private::Status PlatformDarwin::GetSharedModuleWithLocalCache(
FileSpec module_cache_spec(cache_path, false);
// if rsync is supported, always bring in the file - rsync will be very
- // efficient
- // when files are the same on the local and remote end of the connection
+ // efficient when files are the same on the local and remote end of the
+ // connection
if (this->GetSupportsRSync()) {
err = BringInRemoteFile(this, module_spec, module_cache_spec);
if (err.Fail())
@@ -370,8 +364,8 @@ Status PlatformDarwin::GetSharedModule(
module_sp.reset();
if (IsRemote()) {
- // If we have a remote platform always, let it try and locate
- // the shared module first.
+ // If we have a remote platform always, let it try and locate the shared
+ // module first.
if (m_remote_platform_sp) {
error = m_remote_platform_sp->GetSharedModule(
module_spec, process, module_sp, module_search_paths_ptr,
@@ -453,8 +447,8 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode(Target &target,
switch (machine) {
case llvm::Triple::aarch64: {
// TODO: fix this with actual darwin breakpoint opcode for arm64.
- // right now debugging uses the Z packets with GDB remote so this
- // is not needed, but the size needs to be correct...
+ // right now debugging uses the Z packets with GDB remote so this is not
+ // needed, but the size needs to be correct...
static const uint8_t g_arm64_breakpoint_opcode[] = {0xFE, 0xDE, 0xFF, 0xE7};
trap_opcode = g_arm64_breakpoint_opcode;
trap_opcode_size = sizeof(g_arm64_breakpoint_opcode);
@@ -472,7 +466,7 @@ PlatformDarwin::GetSoftwareBreakpointTrapOpcode(Target &target,
lldb::BreakpointLocationSP bp_loc_sp(bp_site->GetOwnerAtIndex(0));
if (bp_loc_sp)
bp_is_thumb = bp_loc_sp->GetAddress().GetAddressClass() ==
- eAddressClassCodeAlternateISA;
+ AddressClass::eCodeAlternateISA;
}
if (bp_is_thumb) {
trap_opcode = g_thumb_breakpooint_opcode;
@@ -548,8 +542,8 @@ bool PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx,
HostInfo::GetArchitecture(HostInfo::eArchKind64));
if (platform_arch.IsExactMatch(platform_arch64)) {
// This macosx platform supports both 32 and 64 bit. Since we already
- // returned the 64 bit arch for idx == 0, return the 32 bit arch
- // for idx == 1
+ // returned the 64 bit arch for idx == 0, return the 32 bit arch for
+ // idx == 1
arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);
return arch.IsValid();
}
@@ -558,9 +552,9 @@ bool PlatformDarwin::x86GetSupportedArchitectureAtIndex(uint32_t idx,
return false;
}
-// The architecture selection rules for arm processors
-// These cpu subtypes have distinct names (e.g. armv7f) but armv7 binaries run
-// fine on an armv7f processor.
+// The architecture selection rules for arm processors These cpu subtypes have
+// distinct names (e.g. armv7f) but armv7 binaries run fine on an armv7f
+// processor.
bool PlatformDarwin::ARMGetSupportedArchitectureAtIndex(uint32_t idx,
ArchSpec &arch) {
@@ -1138,14 +1132,15 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
if (m_developer_directory.empty()) {
bool developer_dir_path_valid = false;
char developer_dir_path[PATH_MAX];
- FileSpec temp_file_spec;
// Get the lldb framework's file path, and if it exists, truncate some
// components to only the developer directory path.
- if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, temp_file_spec)) {
+ FileSpec temp_file_spec = HostInfo::GetShlibDir();
+ if (temp_file_spec) {
if (temp_file_spec.GetPath(developer_dir_path,
sizeof(developer_dir_path))) {
- // e.g. /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework
+ // e.g.
+ // /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework
char *shared_frameworks =
strstr(developer_dir_path, "/SharedFrameworks/LLDB.framework");
if (shared_frameworks) {
@@ -1153,7 +1148,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
strncat (developer_dir_path, "/Developer", sizeof (developer_dir_path) - 1); // add /Developer on
developer_dir_path_valid = true;
} else {
- // e.g. /Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework
+ // e.g.
+ // /Applications/Xcode.app/Contents/Developer/Toolchains/iOS11.2.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework
char *developer_toolchains =
strstr(developer_dir_path, "/Contents/Developer/Toolchains/");
if (developer_toolchains) {
@@ -1171,7 +1167,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
if (xcode_select_prefix_dir)
xcode_dir_path.append(xcode_select_prefix_dir);
xcode_dir_path.append("/usr/share/xcode-select/xcode_dir_path");
- temp_file_spec.SetFile(xcode_dir_path, false);
+ temp_file_spec.SetFile(xcode_dir_path, false, FileSpec::Style::native);
auto dir_buffer =
DataBufferLLVM::CreateFromPath(temp_file_spec.GetPath());
if (dir_buffer && dir_buffer->GetByteSize() > 0) {
@@ -1196,7 +1192,7 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
Host::RunShellCommand("/usr/bin/xcode-select --print-path",
NULL, // current working directory
&exit_status, &signo, &command_output,
- 2, // short timeout
+ std::chrono::seconds(2), // short timeout
false); // don't run in a shell
if (error.Success() && exit_status == 0 && !command_output.empty()) {
const char *cmd_output_ptr = command_output.c_str();
@@ -1219,7 +1215,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
}
if (developer_dir_path_valid) {
- temp_file_spec.SetFile(developer_dir_path, false);
+ temp_file_spec.SetFile(developer_dir_path, false,
+ FileSpec::Style::native);
if (temp_file_spec.Exists()) {
m_developer_directory.assign(developer_dir_path);
return m_developer_directory.c_str();
@@ -1230,8 +1227,8 @@ const char *PlatformDarwin::GetDeveloperDirectory() {
m_developer_directory.assign(1, '\0');
}
- // We should have put a single NULL character into m_developer_directory
- // or it should have a valid path if the code gets here
+ // We should have put a single NULL character into m_developer_directory or
+ // it should have a valid path if the code gets here
assert(m_developer_directory.empty() == false);
if (m_developer_directory[0])
return m_developer_directory.c_str();
@@ -1279,17 +1276,11 @@ PlatformDarwin::GetResumeCountForLaunchInfo(ProcessLaunchInfo &launch_info) {
shell_name++;
if (strcmp(shell_name, "sh") == 0) {
- // /bin/sh re-exec's itself as /bin/bash requiring another resume.
- // But it only does this if the COMMAND_MODE environment variable
- // is set to "legacy".
- const char **envp =
- launch_info.GetEnvironmentEntries().GetConstArgumentVector();
- if (envp != NULL) {
- for (int i = 0; envp[i] != NULL; i++) {
- if (strcmp(envp[i], "COMMAND_MODE=legacy") == 0)
- return 2;
- }
- }
+ // /bin/sh re-exec's itself as /bin/bash requiring another resume. But it
+ // only does this if the COMMAND_MODE environment variable is set to
+ // "legacy".
+ if (launch_info.GetEnvironment().lookup("COMMAND_MODE") == "legacy")
+ return 2;
return 1;
} else if (strcmp(shell_name, "csh") == 0 ||
strcmp(shell_name, "tcsh") == 0 ||
@@ -1310,7 +1301,7 @@ static const char *const sdk_strings[] = {
static FileSpec CheckPathForXcode(const FileSpec &fspec) {
if (fspec.Exists()) {
- const char substr[] = ".app/Contents/";
+ const char substr[] = ".app/Contents";
std::string path_to_shlib = fspec.GetPath();
size_t pos = path_to_shlib.rfind(substr);
@@ -1339,9 +1330,8 @@ static FileSpec GetXcodeContentsPath() {
// First get the program file spec. If lldb.so or LLDB.framework is running
// in a program and that program is Xcode, the path returned with be the
- // path
- // to Xcode.app/Contents/MacOS/Xcode, so this will be the correct Xcode to
- // use.
+ // path to Xcode.app/Contents/MacOS/Xcode, so this will be the correct
+ // Xcode to use.
fspec = HostInfo::GetProgramFileSpec();
if (fspec) {
@@ -1375,7 +1365,7 @@ static FileSpec GetXcodeContentsPath() {
&signo, // Put the signal that caused the process to exit in here
&output, // Get the output from the command and place it in this
// string
- 3); // Timeout in seconds to wait for shell program to finish
+ std::chrono::seconds(3));
if (status == 0 && !output.empty()) {
size_t first_non_newline = output.find_last_not_of("\r\n");
if (first_non_newline != std::string::npos) {
@@ -1392,18 +1382,14 @@ static FileSpec GetXcodeContentsPath() {
return g_xcode_filespec;
}
-bool PlatformDarwin::SDKSupportsModules(SDKType sdk_type, uint32_t major,
- uint32_t minor, uint32_t micro) {
+bool PlatformDarwin::SDKSupportsModules(SDKType sdk_type,
+ llvm::VersionTuple version) {
switch (sdk_type) {
case SDKType::MacOSX:
- if (major > 10 || (major == 10 && minor >= 10))
- return true;
- break;
+ return version >= llvm::VersionTuple(10, 10);
case SDKType::iPhoneOS:
case SDKType::iPhoneSimulator:
- if (major >= 8)
- return true;
- break;
+ return version >= llvm::VersionTuple(8);
}
return false;
@@ -1425,32 +1411,10 @@ bool PlatformDarwin::SDKSupportsModules(SDKType desired_type,
return false;
}
- const size_t major_dot_offset = version_part.find('.');
- if (major_dot_offset == llvm::StringRef::npos)
- return false;
-
- const llvm::StringRef major_version =
- version_part.slice(0, major_dot_offset);
- const llvm::StringRef minor_part =
- version_part.drop_front(major_dot_offset + 1);
-
- const size_t minor_dot_offset = minor_part.find('.');
- if (minor_dot_offset == llvm::StringRef::npos)
- return false;
-
- const llvm::StringRef minor_version = minor_part.slice(0, minor_dot_offset);
-
- unsigned int major = 0;
- unsigned int minor = 0;
- unsigned int micro = 0;
-
- if (major_version.getAsInteger(10, major))
- return false;
-
- if (minor_version.getAsInteger(10, minor))
+ llvm::VersionTuple version;
+ if (version.tryParse(version_part))
return false;
-
- return SDKSupportsModules(desired_type, major, minor, micro);
+ return SDKSupportsModules(desired_type, version);
}
return false;
@@ -1522,18 +1486,17 @@ FileSpec PlatformDarwin::GetSDKDirectoryForModules(SDKType sdk_type) {
sdks_spec.AppendPathComponent("SDKs");
if (sdk_type == SDKType::MacOSX) {
- uint32_t major = 0;
- uint32_t minor = 0;
- uint32_t micro = 0;
+ llvm::VersionTuple version = HostInfo::GetOSVersion();
- if (HostInfo::GetOSVersion(major, minor, micro)) {
- if (SDKSupportsModules(SDKType::MacOSX, major, minor, micro)) {
+ if (!version.empty()) {
+ if (SDKSupportsModules(SDKType::MacOSX, version)) {
// We slightly prefer the exact SDK for this machine. See if it is
// there.
FileSpec native_sdk_spec = sdks_spec;
StreamString native_sdk_name;
- native_sdk_name.Printf("MacOSX%u.%u.sdk", major, minor);
+ native_sdk_name.Printf("MacOSX%u.%u.sdk", version.getMajor(),
+ version.getMinor().getValueOr(0));
native_sdk_spec.AppendPathComponent(native_sdk_name.GetString());
if (native_sdk_spec.Exists()) {
@@ -1546,14 +1509,14 @@ FileSpec PlatformDarwin::GetSDKDirectoryForModules(SDKType sdk_type) {
return FindSDKInXcodeForModules(sdk_type, sdks_spec);
}
-std::tuple<uint32_t, uint32_t, uint32_t, llvm::StringRef>
+std::tuple<llvm::VersionTuple, llvm::StringRef>
PlatformDarwin::ParseVersionBuildDir(llvm::StringRef dir) {
- uint32_t major, minor, update;
llvm::StringRef build;
llvm::StringRef version_str;
llvm::StringRef build_str;
std::tie(version_str, build_str) = dir.split(' ');
- if (Args::StringToVersion(version_str, major, minor, update) ||
+ llvm::VersionTuple version;
+ if (!version.tryParse(version_str) ||
build_str.empty()) {
if (build_str.consume_front("(")) {
size_t pos = build_str.find(')');
@@ -1561,7 +1524,7 @@ PlatformDarwin::ParseVersionBuildDir(llvm::StringRef dir) {
}
}
- return std::make_tuple(major, minor, update, build);
+ return std::make_tuple(version, build);
}
void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
@@ -1573,7 +1536,6 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
options.insert(options.end(), apple_arguments.begin(), apple_arguments.end());
StreamString minimum_version_option;
- uint32_t versions[3] = {0, 0, 0};
bool use_current_os_version = false;
switch (sdk_type) {
case SDKType::iPhoneOS:
@@ -1597,9 +1559,9 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
break;
}
- bool versions_valid = false;
+ llvm::VersionTuple version;
if (use_current_os_version)
- versions_valid = GetOSVersion(versions[0], versions[1], versions[2]);
+ version = GetOSVersion();
else if (target) {
// Our OS doesn't match our executable so we need to get the min OS version
// from the object file
@@ -1607,35 +1569,23 @@ void PlatformDarwin::AddClangModuleCompilationOptionsForSDKType(
if (exe_module_sp) {
ObjectFile *object_file = exe_module_sp->GetObjectFile();
if (object_file)
- versions_valid = object_file->GetMinimumOSVersion(versions, 3) > 0;
+ version = object_file->GetMinimumOSVersion();
}
}
// Only add the version-min options if we got a version from somewhere
- if (versions_valid && versions[0] != UINT32_MAX) {
- // Make any invalid versions be zero if needed
- if (versions[1] == UINT32_MAX)
- versions[1] = 0;
- if (versions[2] == UINT32_MAX)
- versions[2] = 0;
-
+ if (!version.empty()) {
switch (sdk_type) {
case SDKType::iPhoneOS:
minimum_version_option.PutCString("-mios-version-min=");
- minimum_version_option.PutCString(
- clang::VersionTuple(versions[0], versions[1], versions[2])
- .getAsString());
+ minimum_version_option.PutCString(version.getAsString());
break;
case SDKType::iPhoneSimulator:
minimum_version_option.PutCString("-mios-simulator-version-min=");
- minimum_version_option.PutCString(
- clang::VersionTuple(versions[0], versions[1], versions[2])
- .getAsString());
+ minimum_version_option.PutCString(version.getAsString());
break;
case SDKType::MacOSX:
minimum_version_option.PutCString("-mmacosx-version-min=");
- minimum_version_option.PutCString(
- clang::VersionTuple(versions[0], versions[1], versions[2])
- .getAsString());
+ minimum_version_option.PutCString(version.getAsString());
}
options.push_back(minimum_version_option.GetString());
}
@@ -1662,49 +1612,35 @@ ConstString PlatformDarwin::GetFullNameForDylib(ConstString basename) {
return ConstString(stream.GetString());
}
-bool PlatformDarwin::GetOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update, Process *process) {
+llvm::VersionTuple PlatformDarwin::GetOSVersion(Process *process) {
if (process && strstr(GetPluginName().GetCString(), "-simulator")) {
lldb_private::ProcessInstanceInfo proc_info;
if (Host::GetProcessInfo(process->GetID(), proc_info)) {
- Args &env = proc_info.GetEnvironmentEntries();
- const size_t n = env.GetArgumentCount();
- const llvm::StringRef k_runtime_version("SIMULATOR_RUNTIME_VERSION=");
- const llvm::StringRef k_dyld_root_path("DYLD_ROOT_PATH=");
- std::string dyld_root_path;
-
- for (size_t i = 0; i < n; ++i) {
- const char *env_cstr = env.GetArgumentAtIndex(i);
- if (env_cstr) {
- llvm::StringRef env_str(env_cstr);
- if (env_str.consume_front(k_runtime_version)) {
- if (Args::StringToVersion(env_str, major, minor, update))
- return true;
- } else if (env_str.consume_front(k_dyld_root_path)) {
- dyld_root_path = env_str;
- }
- }
- }
+ const Environment &env = proc_info.GetEnvironment();
+ llvm::VersionTuple result;
+ if (!result.tryParse(env.lookup("SIMULATOR_RUNTIME_VERSION")))
+ return result;
+
+ std::string dyld_root_path = env.lookup("DYLD_ROOT_PATH");
if (!dyld_root_path.empty()) {
dyld_root_path += "/System/Library/CoreServices/SystemVersion.plist";
ApplePropertyList system_version_plist(dyld_root_path.c_str());
std::string product_version;
if (system_version_plist.GetValueAsString("ProductVersion",
product_version)) {
- return Args::StringToVersion(product_version, major, minor, update);
+ if (!result.tryParse(product_version))
+ return result;
}
}
}
// For simulator platforms, do NOT call back through
- // Platform::GetOSVersion()
- // as it might call Process::GetHostOSVersion() which we don't want as it
- // will be
- // incorrect
- return false;
+ // Platform::GetOSVersion() as it might call Process::GetHostOSVersion()
+ // which we don't want as it will be incorrect
+ return llvm::VersionTuple();
}
- return Platform::GetOSVersion(major, minor, update, process);
+ return Platform::GetOSVersion(process);
}
lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) {
@@ -1713,8 +1649,8 @@ lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) {
// any executable directories that should be searched.
static std::vector<FileSpec> g_executable_dirs;
- // Find the global list of directories that we will search for
- // executables once so we don't keep doing the work over and over.
+ // Find the global list of directories that we will search for executables
+ // once so we don't keep doing the work over and over.
static llvm::once_flag g_once_flag;
llvm::call_once(g_once_flag, []() {
@@ -1748,22 +1684,19 @@ lldb_private::FileSpec PlatformDarwin::LocateExecutable(const char *basename) {
lldb_private::Status
PlatformDarwin::LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) {
- // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr
- // if the OS_ACTIVITY_DT_MODE environment variable is set. (It doesn't
- // require any specific value; rather, it just needs to exist).
- // We will set it here as long as the IDE_DISABLED_OS_ACTIVITY_DT_MODE flag
- // is not set. Xcode makes use of IDE_DISABLED_OS_ACTIVITY_DT_MODE to tell
+ // Starting in Fall 2016 OSes, NSLog messages only get mirrored to stderr if
+ // the OS_ACTIVITY_DT_MODE environment variable is set. (It doesn't require
+ // any specific value; rather, it just needs to exist). We will set it here
+ // as long as the IDE_DISABLED_OS_ACTIVITY_DT_MODE flag is not set. Xcode
+ // makes use of IDE_DISABLED_OS_ACTIVITY_DT_MODE to tell
// LLDB *not* to muck with the OS_ACTIVITY_DT_MODE flag when they
// specifically want it unset.
const char *disable_env_var = "IDE_DISABLED_OS_ACTIVITY_DT_MODE";
- auto &env_vars = launch_info.GetEnvironmentEntries();
- if (!env_vars.ContainsEnvironmentVariable(llvm::StringRef(disable_env_var))) {
- // We want to make sure that OS_ACTIVITY_DT_MODE is set so that
- // we get os_log and NSLog messages mirrored to the target process
- // stderr.
- if (!env_vars.ContainsEnvironmentVariable(
- llvm::StringRef("OS_ACTIVITY_DT_MODE")))
- env_vars.AppendArgument(llvm::StringRef("OS_ACTIVITY_DT_MODE=enable"));
+ auto &env_vars = launch_info.GetEnvironment();
+ if (!env_vars.count(disable_env_var)) {
+ // We want to make sure that OS_ACTIVITY_DT_MODE is set so that we get
+ // os_log and NSLog messages mirrored to the target process stderr.
+ env_vars.try_emplace("OS_ACTIVITY_DT_MODE", "enable");
}
// Let our parent class do the real launching.
@@ -1777,24 +1710,23 @@ PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec
ModuleSP *old_module_sp_ptr, bool *did_create_ptr)
{
const FileSpec &platform_file = module_spec.GetFileSpec();
- // See if the file is present in any of the module_search_paths_ptr directories.
+ // See if the file is present in any of the module_search_paths_ptr
+ // directories.
if (!module_sp && module_search_paths_ptr && platform_file) {
- // create a vector of all the file / directory names in platform_file
- // e.g. this might be
+ // create a vector of all the file / directory names in platform_file e.g.
+ // this might be
// /System/Library/PrivateFrameworks/UIFoundation.framework/UIFoundation
//
- // We'll need to look in the module_search_paths_ptr directories for
- // both "UIFoundation" and "UIFoundation.framework" -- most likely the
- // latter will be the one we find there.
+ // We'll need to look in the module_search_paths_ptr directories for both
+ // "UIFoundation" and "UIFoundation.framework" -- most likely the latter
+ // will be the one we find there.
FileSpec platform_pull_apart(platform_file);
std::vector<std::string> path_parts;
- ConstString unix_root_dir("/");
- while (true) {
+ path_parts.push_back(
+ platform_pull_apart.GetLastPathComponent().AsCString());
+ while (platform_pull_apart.RemoveLastPathComponent()) {
ConstString part = platform_pull_apart.GetLastPathComponent();
- platform_pull_apart.RemoveLastPathComponent();
- if (part.IsEmpty() || part == unix_root_dir)
- break;
path_parts.push_back(part.AsCString());
}
const size_t path_parts_size = path_parts.size();
@@ -1804,25 +1736,24 @@ PlatformDarwin::FindBundleBinaryInExecSearchPaths (const ModuleSpec &module_spec
Log *log_verbose = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
if (log_verbose)
log_verbose->Printf ("PlatformRemoteDarwinDevice::GetSharedModule searching for binary in search-path %s", module_search_paths_ptr->GetFileSpecAtIndex(i).GetPath().c_str());
- // Create a new FileSpec with this module_search_paths_ptr
- // plus just the filename ("UIFoundation"), then the parent
- // dir plus filename ("UIFoundation.framework/UIFoundation")
- // etc - up to four names (to handle "Foo.framework/Contents/MacOS/Foo")
+ // Create a new FileSpec with this module_search_paths_ptr plus just the
+ // filename ("UIFoundation"), then the parent dir plus filename
+ // ("UIFoundation.framework/UIFoundation") etc - up to four names (to
+ // handle "Foo.framework/Contents/MacOS/Foo")
for (size_t j = 0; j < 4 && j < path_parts_size - 1; ++j) {
FileSpec path_to_try(module_search_paths_ptr->GetFileSpecAtIndex(i));
// Add the components backwards. For
- // .../PrivateFrameworks/UIFoundation.framework/UIFoundation
- // path_parts is
+ // .../PrivateFrameworks/UIFoundation.framework/UIFoundation path_parts
+ // is
// [0] UIFoundation
// [1] UIFoundation.framework
// [2] PrivateFrameworks
//
// and if 'j' is 2, we want to append path_parts[1] and then
- // path_parts[0], aka
- // 'UIFoundation.framework/UIFoundation', to the module_search_paths_ptr
- // path.
+ // path_parts[0], aka 'UIFoundation.framework/UIFoundation', to the
+ // module_search_paths_ptr path.
for (int k = j; k >= 0; --k) {
path_to_try.AppendPathComponent(path_parts[k]);
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwin.h b/source/Plugins/Platform/MacOSX/PlatformDarwin.h
index c04318e98cae..3ad29ec1a0b9 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwin.h
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwin.h
@@ -69,8 +69,8 @@ public:
void CalculateTrapHandlerSymbolNames() override;
- bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
- lldb_private::Process *process = nullptr) override;
+ llvm::VersionTuple
+ GetOSVersion(lldb_private::Process *process = nullptr) override;
bool SupportsModules() override { return true; }
@@ -82,7 +82,7 @@ public:
lldb_private::Status
LaunchProcess(lldb_private::ProcessLaunchInfo &launch_info) override;
- static std::tuple<uint32_t, uint32_t, uint32_t, llvm::StringRef>
+ static std::tuple<llvm::VersionTuple, llvm::StringRef>
ParseVersionBuildDir(llvm::StringRef str);
protected:
@@ -101,8 +101,7 @@ protected:
iPhoneOS,
};
- static bool SDKSupportsModules(SDKType sdk_type, uint32_t major,
- uint32_t minor, uint32_t micro);
+ static bool SDKSupportsModules(SDKType sdk_type, llvm::VersionTuple version);
static bool SDKSupportsModules(SDKType desired_type,
const lldb_private::FileSpec &sdk_path);
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
index e5d27fc28949..1e3216c0af5a 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
@@ -92,11 +92,9 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force,
}
// This is a special plugin that we don't want to activate just based on an
- // ArchSpec for normal
- // userland debugging. It is only useful in kernel debug sessions and the
- // DynamicLoaderDarwinPlugin
- // (or a user doing 'platform select') will force the creation of this
- // Platform plugin.
+ // ArchSpec for normal userland debugging. It is only useful in kernel debug
+ // sessions and the DynamicLoaderDarwinPlugin (or a user doing 'platform
+ // select') will force the creation of this Platform plugin.
if (force == false) {
if (log)
log->Printf("PlatformDarwinKernel::%s() aborting creation of platform "
@@ -115,9 +113,8 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force,
create = true;
break;
- // Only accept "unknown" for vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for vendor if the host is Apple and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -133,9 +130,8 @@ PlatformSP PlatformDarwinKernel::CreateInstance(bool force,
case llvm::Triple::WatchOS:
case llvm::Triple::TvOS:
break;
- // Only accept "vendor" for vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "vendor" for vendor if the host is Apple and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -341,11 +337,9 @@ void PlatformDarwinKernel::GetStatus(Stream &strm) {
void PlatformDarwinKernel::CollectKextAndKernelDirectories() {
// Differentiate between "ios debug session" and "mac debug session" so we
- // don't index
- // kext bundles that won't be used in this debug session. If this is an ios
- // kext debug
- // session, looking in /System/Library/Extensions is a waste of stat()s, for
- // example.
+ // don't index kext bundles that won't be used in this debug session. If
+ // this is an ios kext debug session, looking in /System/Library/Extensions
+ // is a waste of stat()s, for example.
// DeveloperDirectory is something like
// "/Applications/Xcode.app/Contents/Developer"
@@ -368,9 +362,8 @@ void PlatformDarwinKernel::CollectKextAndKernelDirectories() {
AddSDKSubdirsToSearchPaths("/Volumes/KernelDebugKit");
AddSDKSubdirsToSearchPaths("/AppleInternal/Developer/KDKs");
- // The KDKs distributed from Apple installed on external
- // developer systems may be in directories like
- // /Library/Developer/KDKs/KDK_10.10_14A298i.kdk
+ // The KDKs distributed from Apple installed on external developer systems
+ // may be in directories like /Library/Developer/KDKs/KDK_10.10_14A298i.kdk
AddSDKSubdirsToSearchPaths("/Library/Developer/KDKs");
if (m_ios_debug_session != eLazyBoolNo) {
@@ -438,8 +431,8 @@ void PlatformDarwinKernel::AddSDKSubdirsToSearchPaths(const std::string &dir) {
FileSpec::EnumerateDirectoryResult
PlatformDarwinKernel::FindKDKandSDKDirectoriesInDirectory(
void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec) {
- static ConstString g_sdk_suffix = ConstString("sdk");
- static ConstString g_kdk_suffix = ConstString("kdk");
+ static ConstString g_sdk_suffix = ConstString(".sdk");
+ static ConstString g_kdk_suffix = ConstString(".kdk");
PlatformDarwinKernel *thisp = (PlatformDarwinKernel *)baton;
if (ft == llvm::sys::fs::file_type::directory_file &&
@@ -450,9 +443,8 @@ PlatformDarwinKernel::FindKDKandSDKDirectoriesInDirectory(
return FileSpec::eEnumerateDirectoryResultNext;
}
-// Recursively search trough m_search_directories looking for
-// kext and kernel binaries, adding files found to the appropriate
-// lists.
+// Recursively search trough m_search_directories looking for kext and kernel
+// binaries, adding files found to the appropriate lists.
void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() {
const uint32_t num_dirs = m_search_directories.size();
for (uint32_t i = 0; i < num_dirs; i++) {
@@ -476,13 +468,11 @@ void PlatformDarwinKernel::SearchForKextsAndKernelsRecursively() {
}
}
-// We're only doing a filename match here. We won't try opening the file to see
-// if it's really
-// a kernel or not until we need to find a kernel of a given UUID. There's no
-// cheap way to find
-// the UUID of a file (or if it's a Mach-O binary at all) without creating a
-// whole Module for
-// the file and throwing it away if it's not wanted.
+// We're only doing a filename match here. We won't try opening the file to
+// see if it's really a kernel or not until we need to find a kernel of a given
+// UUID. There's no cheap way to find the UUID of a file (or if it's a Mach-O
+// binary at all) without creating a whole Module for the file and throwing it
+// away if it's not wanted.
//
// Recurse into any subdirectories found.
@@ -502,8 +492,8 @@ FileSpec::EnumerateDirectoryResult
PlatformDarwinKernel::GetKernelsAndKextsInDirectoryHelper(
void *baton, llvm::sys::fs::file_type ft, const FileSpec &file_spec,
bool recurse) {
- static ConstString g_kext_suffix = ConstString("kext");
- static ConstString g_dsym_suffix = ConstString("dSYM");
+ static ConstString g_kext_suffix = ConstString(".kext");
+ static ConstString g_dsym_suffix = ConstString(".dSYM");
static ConstString g_bundle_suffix = ConstString("Bundle");
ConstString file_spec_extension = file_spec.GetFileNameExtension();
@@ -633,7 +623,7 @@ bool PlatformDarwinKernel::KextHasdSYMSibling(
kext_bundle_filepath.GetPath() + "/Contents/MacOS/";
deep_bundle_str += executable_name.AsCString();
deep_bundle_str += ".dSYM";
- dsym_fspec.SetFile(deep_bundle_str, true);
+ dsym_fspec.SetFile(deep_bundle_str, true, FileSpec::Style::native);
if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {
return true;
}
@@ -643,15 +633,15 @@ bool PlatformDarwinKernel::KextHasdSYMSibling(
std::string shallow_bundle_str = kext_bundle_filepath.GetPath() + "/";
shallow_bundle_str += executable_name.AsCString();
shallow_bundle_str += ".dSYM";
- dsym_fspec.SetFile(shallow_bundle_str, true);
+ dsym_fspec.SetFile(shallow_bundle_str, true, FileSpec::Style::native);
if (llvm::sys::fs::is_directory(dsym_fspec.GetPath())) {
return true;
}
return false;
}
-// Given a FileSpec of /dir/dir/mach.development.t7004
-// Return true if a dSYM exists next to it:
+// Given a FileSpec of /dir/dir/mach.development.t7004 Return true if a dSYM
+// exists next to it:
// /dir/dir/mach.development.t7004.dSYM
bool PlatformDarwinKernel::KernelHasdSYMSibling(const FileSpec &kernel_binary) {
FileSpec kernel_dsym = kernel_binary;
@@ -694,8 +684,8 @@ Status PlatformDarwinKernel::GetSharedModule(
}
}
- // Give the generic methods, including possibly calling into
- // DebugSymbols framework on macOS systems, a chance.
+ // Give the generic methods, including possibly calling into DebugSymbols
+ // framework on macOS systems, a chance.
error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp,
module_search_paths_ptr,
old_module_sp_ptr, did_create_ptr);
@@ -749,8 +739,8 @@ Status PlatformDarwinKernel::GetSharedModule(
}
}
- // Give the generic methods, including possibly calling into
- // DebugSymbols framework on macOS systems, a chance.
+ // Give the generic methods, including possibly calling into DebugSymbols
+ // framework on macOS systems, a chance.
error = PlatformDarwin::GetSharedModule(module_spec, process, module_sp,
module_search_paths_ptr,
old_module_sp_ptr, did_create_ptr);
@@ -789,37 +779,53 @@ Status PlatformDarwinKernel::GetSharedModule(
return error;
}
+std::vector<lldb_private::FileSpec>
+PlatformDarwinKernel::SearchForExecutablesRecursively(const std::string &dir) {
+ std::vector<FileSpec> executables;
+ std::error_code EC;
+ for (llvm::sys::fs::recursive_directory_iterator it(dir.c_str(), EC),
+ end;
+ it != end && !EC; it.increment(EC)) {
+ auto status = it->status();
+ if (!status)
+ break;
+ if (llvm::sys::fs::is_regular_file(*status) &&
+ llvm::sys::fs::can_execute(it->path()))
+ executables.emplace_back(it->path(), false);
+ }
+ return executables;
+}
+
Status PlatformDarwinKernel::ExamineKextForMatchingUUID(
const FileSpec &kext_bundle_path, const lldb_private::UUID &uuid,
const ArchSpec &arch, ModuleSP &exe_module_sp) {
- Status error;
- FileSpec exe_file = kext_bundle_path;
- Host::ResolveExecutableInBundle(exe_file);
- if (exe_file.Exists()) {
- ModuleSpec exe_spec(exe_file);
- exe_spec.GetUUID() = uuid;
- if (!uuid.IsValid()) {
- exe_spec.GetArchitecture() = arch;
- }
+ for (const auto &exe_file :
+ SearchForExecutablesRecursively(kext_bundle_path.GetPath())) {
+ if (exe_file.Exists()) {
+ ModuleSpec exe_spec(exe_file);
+ exe_spec.GetUUID() = uuid;
+ if (!uuid.IsValid()) {
+ exe_spec.GetArchitecture() = arch;
+ }
- // First try to create a ModuleSP with the file / arch and see if the UUID
- // matches.
- // If that fails (this exec file doesn't have the correct uuid), don't call
- // GetSharedModule
- // (which may call in to the DebugSymbols framework and therefore can be
- // slow.)
- ModuleSP module_sp(new Module(exe_spec));
- if (module_sp && module_sp->GetObjectFile() &&
- module_sp->MatchesModuleSpec(exe_spec)) {
- error = ModuleList::GetSharedModule(exe_spec, exe_module_sp, NULL, NULL,
- NULL);
- if (exe_module_sp && exe_module_sp->GetObjectFile()) {
- return error;
+ // First try to create a ModuleSP with the file / arch and see if the UUID
+ // matches. If that fails (this exec file doesn't have the correct uuid),
+ // don't call GetSharedModule (which may call in to the DebugSymbols
+ // framework and therefore can be slow.)
+ ModuleSP module_sp(new Module(exe_spec));
+ if (module_sp && module_sp->GetObjectFile() &&
+ module_sp->MatchesModuleSpec(exe_spec)) {
+ Status error = ModuleList::GetSharedModule(exe_spec, exe_module_sp,
+ NULL, NULL, NULL);
+ if (exe_module_sp && exe_module_sp->GetObjectFile()) {
+ return error;
+ }
}
+ exe_module_sp.reset();
}
- exe_module_sp.reset();
}
- return error;
+
+ return {};
}
bool PlatformDarwinKernel::GetSupportedArchitectureAtIndex(uint32_t idx,
@@ -851,17 +857,13 @@ void PlatformDarwinKernel::CalculateTrapHandlerSymbolNames() {
#else // __APPLE__
-// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies on
-// PlatformDarwinKernel for the plug-in name, we compile just the plug-in name
-// in
-// here to avoid issues. We are tracking an internal bug to resolve this issue
-// by
-// either not compiling in DynamicLoaderDarwinKernel for non-apple builds, or to
-// make
-// PlatformDarwinKernel build on all systems. PlatformDarwinKernel is currently
-// not
-// compiled on other platforms due to the use of the Mac-specific
-// source/Host/macosx/cfcpp utilities.
+// Since DynamicLoaderDarwinKernel is compiled in for all systems, and relies
+// on PlatformDarwinKernel for the plug-in name, we compile just the plug-in
+// name in here to avoid issues. We are tracking an internal bug to resolve
+// this issue by either not compiling in DynamicLoaderDarwinKernel for non-
+// apple builds, or to make PlatformDarwinKernel build on all systems.
+// PlatformDarwinKernel is currently not compiled on other platforms due to the
+// use of the Mac-specific source/Host/macosx/cfcpp utilities.
lldb_private::ConstString PlatformDarwinKernel::GetPluginNameStatic() {
static lldb_private::ConstString g_name("darwin-kernel");
diff --git a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
index 9b3ec5e0d717..7f603cac2bec 100644
--- a/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
+++ b/source/Plugins/Platform/MacOSX/PlatformDarwinKernel.h
@@ -127,6 +127,9 @@ protected:
const lldb_private::FileSpec &file_spec,
bool recurse);
+ static std::vector<lldb_private::FileSpec>
+ SearchForExecutablesRecursively(const std::string &dir);
+
static void AddKextToMap(PlatformDarwinKernel *thisp,
const lldb_private::FileSpec &file_spec);
@@ -201,6 +204,7 @@ public:
// source/Host/macosx/cfcpp utilities.
class PlatformDarwinKernel {
+public:
static lldb_private::ConstString GetPluginNameStatic();
};
diff --git a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
index 43f4d8bbf023..99f603b01f43 100644
--- a/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
@@ -91,9 +91,8 @@ PlatformSP PlatformMacOSX::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__APPLE__)
- // Only accept "unknown" for vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for vendor if the host is Apple and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -109,9 +108,8 @@ PlatformSP PlatformMacOSX::CreateInstance(bool force, const ArchSpec *arch) {
case llvm::Triple::MacOSX:
break;
#if defined(__APPLE__)
- // Only accept "vendor" for vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "vendor" for vendor if the host is Apple and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -175,7 +173,8 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
FileSpec fspec;
uint32_t versions[2];
if (objfile->GetSDKVersion(versions, sizeof(versions))) {
- if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, fspec)) {
+ fspec = HostInfo::GetShlibDir();
+ if (fspec) {
std::string path;
xcode_contents_path = fspec.GetPath();
size_t pos = xcode_contents_path.find("/Xcode.app/Contents/");
@@ -198,7 +197,7 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
// here
&output, // Get the output from the command and place it in this
// string
- 3); // Timeout in seconds to wait for shell program to finish
+ std::chrono::seconds(3));
if (status == 0 && !output.empty()) {
size_t first_non_newline = output.find_last_not_of("\r\n");
if (first_non_newline != std::string::npos)
@@ -219,13 +218,13 @@ ConstString PlatformMacOSX::GetSDKDirectory(lldb_private::Target &target) {
"SDKs/MacOSX%u.%u.sdk",
xcode_contents_path.c_str(), versions[0],
versions[1]);
- fspec.SetFile(sdk_path.GetString(), false);
+ fspec.SetFile(sdk_path.GetString(), false, FileSpec::Style::native);
if (fspec.Exists())
return ConstString(sdk_path.GetString());
}
if (!default_xcode_sdk.empty()) {
- fspec.SetFile(default_xcode_sdk, false);
+ fspec.SetFile(default_xcode_sdk, false, FileSpec::Style::native);
if (fspec.Exists())
return ConstString(default_xcode_sdk);
}
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
index 1eef643d3904..be4c829a981c 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleTV.cpp
@@ -99,8 +99,8 @@ PlatformSP PlatformRemoteAppleTV::CreateInstance(bool force,
#if defined(__APPLE__)
// Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
index 17ae67bc28de..6159511d4a18 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteAppleWatch.cpp
@@ -94,8 +94,8 @@ PlatformSP PlatformRemoteAppleWatch::CreateInstance(bool force,
#if defined(__APPLE__)
// Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -123,8 +123,8 @@ PlatformSP PlatformRemoteAppleWatch::CreateInstance(bool force,
#if defined(__APPLE__) && \
(defined(__arm__) || defined(__arm64__) || defined(__aarch64__))
- // If lldb is running on a watch, this isn't a RemoteWatch environment; it's a
- // local system environment.
+ // If lldb is running on a watch, this isn't a RemoteWatch environment; it's
+ // a local system environment.
if (force == false) {
create = false;
}
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
index cb064aad6155..930d062fe41e 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.cpp
@@ -31,12 +31,10 @@ using namespace lldb_private;
PlatformRemoteDarwinDevice::SDKDirectoryInfo::SDKDirectoryInfo(
const lldb_private::FileSpec &sdk_dir)
- : directory(sdk_dir), build(), version_major(0), version_minor(0),
- version_update(0), user_cached(false) {
+ : directory(sdk_dir), build(), user_cached(false) {
llvm::StringRef dirname_str = sdk_dir.GetFilename().GetStringRef();
llvm::StringRef build_str;
- std::tie(version_major, version_minor, version_update, build_str) =
- ParseVersionBuildDir(dirname_str);
+ std::tie(version, build_str) = ParseVersionBuildDir(dirname_str);
build.SetString(build_str);
}
@@ -97,9 +95,9 @@ Status PlatformRemoteDarwinDevice::ResolveExecutable(
return error;
exe_module_sp.reset();
}
- // No valid architecture was specified or the exact ARM slice wasn't
- // found so ask the platform for the architectures that we should be
- // using (in the correct order) and see if we can find a match that way
+ // No valid architecture was specified or the exact ARM slice wasn't found
+ // so ask the platform for the architectures that we should be using (in
+ // the correct order) and see if we can find a match that way
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, resolved_module_spec.GetArchitecture());
@@ -183,8 +181,8 @@ bool PlatformRemoteDarwinDevice::UpdateSDKDirectoryInfosIfNeeded() {
&builtin_sdk_directory_infos);
// Only add SDK directories that have symbols in them, some SDKs only
- // contain
- // developer disk images and no symbols, so they aren't useful to us.
+ // contain developer disk images and no symbols, so they aren't useful to
+ // us.
FileSpec sdk_symbols_symlink_fspec;
for (const auto &sdk_directory_info : builtin_sdk_directory_infos) {
sdk_symbols_symlink_fspec = sdk_directory_info.directory;
@@ -244,8 +242,8 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() {
if (UpdateSDKDirectoryInfosIfNeeded()) {
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
- // Check to see if the user specified a build string. If they did, then
- // be sure to match it.
+ // Check to see if the user specified a build string. If they did, then be
+ // sure to match it.
std::vector<bool> check_sdk_info(num_sdk_infos, true);
ConstString build(m_sdk_build);
if (build) {
@@ -253,26 +251,25 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() {
check_sdk_info[i] = m_sdk_directory_infos[i].build == build;
}
- // If we are connected we can find the version of the OS the platform
- // us running on and select the right SDK
- uint32_t major, minor, update;
- if (GetOSVersion(major, minor, update)) {
+ // If we are connected we can find the version of the OS the platform us
+ // running on and select the right SDK
+ llvm::VersionTuple version = GetOSVersion();
+ if (!version.empty()) {
if (UpdateSDKDirectoryInfosIfNeeded()) {
// First try for an exact match of major, minor and update
for (i = 0; i < num_sdk_infos; ++i) {
if (check_sdk_info[i]) {
- if (m_sdk_directory_infos[i].version_major == major &&
- m_sdk_directory_infos[i].version_minor == minor &&
- m_sdk_directory_infos[i].version_update == update) {
+ if (m_sdk_directory_infos[i].version == version)
return &m_sdk_directory_infos[i];
- }
}
}
// First try for an exact match of major and minor
for (i = 0; i < num_sdk_infos; ++i) {
if (check_sdk_info[i]) {
- if (m_sdk_directory_infos[i].version_major == major &&
- m_sdk_directory_infos[i].version_minor == minor) {
+ if (m_sdk_directory_infos[i].version.getMajor() ==
+ version.getMajor() &&
+ m_sdk_directory_infos[i].version.getMinor() ==
+ version.getMinor()) {
return &m_sdk_directory_infos[i];
}
}
@@ -280,7 +277,8 @@ PlatformRemoteDarwinDevice::GetSDKDirectoryForCurrentOSVersion() {
// Lastly try to match of major version only..
for (i = 0; i < num_sdk_infos; ++i) {
if (check_sdk_info[i]) {
- if (m_sdk_directory_infos[i].version_major == major) {
+ if (m_sdk_directory_infos[i].version.getMajor() ==
+ version.getMajor()) {
return &m_sdk_directory_infos[i];
}
}
@@ -300,25 +298,13 @@ const PlatformRemoteDarwinDevice::SDKDirectoryInfo *
PlatformRemoteDarwinDevice::GetSDKDirectoryForLatestOSVersion() {
const PlatformRemoteDarwinDevice::SDKDirectoryInfo *result = NULL;
if (UpdateSDKDirectoryInfosIfNeeded()) {
- const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
- // First try for an exact match of major, minor and update
- for (uint32_t i = 0; i < num_sdk_infos; ++i) {
- const SDKDirectoryInfo &sdk_dir_info = m_sdk_directory_infos[i];
- if (sdk_dir_info.version_major != UINT32_MAX) {
- if (result == NULL ||
- sdk_dir_info.version_major > result->version_major) {
- result = &sdk_dir_info;
- } else if (sdk_dir_info.version_major == result->version_major) {
- if (sdk_dir_info.version_minor > result->version_minor) {
- result = &sdk_dir_info;
- } else if (sdk_dir_info.version_minor == result->version_minor) {
- if (sdk_dir_info.version_update > result->version_update) {
- result = &sdk_dir_info;
- }
- }
- }
- }
- }
+ auto max = std::max_element(
+ m_sdk_directory_infos.begin(), m_sdk_directory_infos.end(),
+ [](const SDKDirectoryInfo &a, const SDKDirectoryInfo &b) {
+ return a.version < b.version;
+ });
+ if (max != m_sdk_directory_infos.end())
+ result = &*max;
}
return result;
}
@@ -366,8 +352,8 @@ const char *PlatformRemoteDarwinDevice::GetDeviceSupportDirectoryForOSVersion()
}
}
// We should have put a single NULL character into
- // m_device_support_directory_for_os_version
- // or it should have a valid path if the code gets here
+ // m_device_support_directory_for_os_version or it should have a valid path
+ // if the code gets here
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();
@@ -409,7 +395,7 @@ bool PlatformRemoteDarwinDevice::GetFileInSDK(const char *platform_file_path,
const char *paths_to_try[] = {"Symbols", "", "Symbols.Internal", nullptr};
for (size_t i = 0; paths_to_try[i] != nullptr; i++) {
- local_file.SetFile(sdkroot_path, false);
+ local_file.SetFile(sdkroot_path, false, FileSpec::Style::native);
if (paths_to_try[i][0] != '\0')
local_file.AppendPathComponent(paths_to_try[i]);
local_file.AppendPathComponent(platform_file_path);
@@ -442,7 +428,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/%s", os_version_dir,
platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf("Found a copy of %s in the DeviceSupport dir %s",
@@ -454,7 +440,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols.Internal/%s",
os_version_dir, platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf(
@@ -466,7 +452,7 @@ Status PlatformRemoteDarwinDevice::GetSymbolFile(const FileSpec &platform_file,
::snprintf(resolved_path, sizeof(resolved_path), "%s/Symbols/%s",
os_version_dir, platform_file_path);
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists()) {
if (log) {
log->Printf("Found a copy of %s in the DeviceSupport dir %s/Symbols",
@@ -492,10 +478,9 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp,
const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr,
bool *did_create_ptr) {
- // For iOS, the SDK files are all cached locally on the host
- // system. So first we ask for the file in the cached SDK,
- // then we attempt to get a shared module for the right architecture
- // with the right UUID.
+ // For iOS, the SDK files are all cached locally on the host system. So first
+ // we ask for the file in the cached SDK, then we attempt to get a shared
+ // module for the right architecture with the right UUID.
const FileSpec &platform_file = module_spec.GetFileSpec();
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST);
@@ -510,8 +495,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
const uint32_t num_sdk_infos = m_sdk_directory_infos.size();
// If we are connected we migth be able to correctly deduce the SDK
- // directory
- // using the OS build.
+ // directory using the OS build.
const uint32_t connected_sdk_idx = GetConnectedSDKIndex();
if (connected_sdk_idx < num_sdk_infos) {
LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file,
@@ -528,8 +512,8 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
}
}
- // Try the last SDK index if it is set as most files from an SDK
- // will tend to be valid in that same SDK.
+ // Try the last SDK index if it is set as most files from an SDK will tend
+ // to be valid in that same SDK.
if (m_last_module_sdk_idx < num_sdk_infos) {
LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file,
m_sdk_directory_infos[m_last_module_sdk_idx].directory);
@@ -544,9 +528,9 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
}
}
- // First try for an exact match of major, minor and update:
- // If a particalar SDK version was specified via --version or --build, look
- // for a match on disk.
+ // First try for an exact match of major, minor and update: If a particalar
+ // SDK version was specified via --version or --build, look for a match on
+ // disk.
const SDKDirectoryInfo *current_sdk_info =
GetSDKDirectoryForCurrentOSVersion();
const uint32_t current_sdk_idx =
@@ -570,8 +554,7 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
// Second try all SDKs that were found.
for (uint32_t sdk_idx = 0; sdk_idx < num_sdk_infos; ++sdk_idx) {
if (m_last_module_sdk_idx == sdk_idx) {
- // Skip the last module SDK index if we already searched
- // it above
+ // Skip the last module SDK index if we already searched it above
continue;
}
LLDB_LOGV(log, "Searching for {0} in sdk path {1}", platform_file,
@@ -582,8 +565,8 @@ Status PlatformRemoteDarwinDevice::GetSharedModule(
error = ResolveExecutable(platform_module_spec, module_sp, NULL);
if (module_sp) {
- // Remember the index of the last SDK that we found a file
- // in in case the wrong SDK was selected.
+ // Remember the index of the last SDK that we found a file in in case
+ // the wrong SDK was selected.
m_last_module_sdk_idx = sdk_idx;
error.Clear();
return error;
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
index f159e8575d76..8ddfd51600fd 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteDarwinDevice.h
@@ -60,9 +60,7 @@ protected:
SDKDirectoryInfo(const lldb_private::FileSpec &sdk_dir_spec);
lldb_private::FileSpec directory;
lldb_private::ConstString build;
- uint32_t version_major;
- uint32_t version_minor;
- uint32_t version_update;
+ llvm::VersionTuple version;
bool user_cached;
};
diff --git a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
index 5bff792525bc..150bfdbfc118 100644
--- a/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformRemoteiOS.cpp
@@ -89,8 +89,8 @@ PlatformSP PlatformRemoteiOS::CreateInstance(bool force, const ArchSpec *arch) {
#if defined(__APPLE__)
// Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
index ee1f90311e7e..26feec282322 100644
--- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
+++ b/source/Plugins/Platform/MacOSX/PlatformiOSSimulator.cpp
@@ -91,9 +91,9 @@ PlatformSP PlatformiOSSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the vendor if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the vendor if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownArch:
create = !arch->TripleVendorWasSpecified();
break;
@@ -112,9 +112,9 @@ PlatformSP PlatformiOSSimulator::CreateInstance(bool force,
break;
#if defined(__APPLE__)
- // Only accept "unknown" for the OS if the host is Apple and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is Apple and it
+ // "unknown" wasn't specified (it was just returned because it was NOT
+ // specified)
case llvm::Triple::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -205,9 +205,9 @@ Status PlatformiOSSimulator::ResolveExecutable(
return error;
exe_module_sp.reset();
}
- // No valid architecture was specified or the exact ARM slice wasn't
- // found so ask the platform for the architectures that we should be
- // using (in the correct order) and see if we can find a match that way
+ // No valid architecture was specified or the exact ARM slice wasn't found
+ // so ask the platform for the architectures that we should be using (in
+ // the correct order) and see if we can find a match that way
StreamString arch_names;
ArchSpec platform_arch;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
@@ -298,8 +298,8 @@ const char *PlatformiOSSimulator::GetSDKDirectoryAsCString() {
m_sdk_directory.assign(1, '\0');
}
- // We should have put a single NULL character into m_sdk_directory
- // or it should have a valid path if the code gets here
+ // We should have put a single NULL character into m_sdk_directory or it
+ // should have a valid path if the code gets here
assert(m_sdk_directory.empty() == false);
if (m_sdk_directory[0])
return m_sdk_directory.c_str();
@@ -320,12 +320,12 @@ Status PlatformiOSSimulator::GetSymbolFile(const FileSpec &platform_file,
platform_file_path);
// First try in the SDK and see if the file is in there
- local_file.SetFile(resolved_path, true);
+ local_file.SetFile(resolved_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
// Else fall back to the actual path itself
- local_file.SetFile(platform_file_path, true);
+ local_file.SetFile(platform_file_path, true, FileSpec::Style::native);
if (local_file.Exists())
return error;
}
@@ -342,10 +342,9 @@ Status PlatformiOSSimulator::GetSharedModule(
const ModuleSpec &module_spec, Process *process, ModuleSP &module_sp,
const FileSpecList *module_search_paths_ptr, ModuleSP *old_module_sp_ptr,
bool *did_create_ptr) {
- // For iOS, the SDK files are all cached locally on the host
- // system. So first we ask for the file in the cached SDK,
- // then we attempt to get a shared module for the right architecture
- // with the right UUID.
+ // For iOS, the SDK files are all cached locally on the host system. So first
+ // we ask for the file in the cached SDK, then we attempt to get a shared
+ // module for the right architecture with the right UUID.
Status error;
ModuleSpec platform_module_spec(module_spec);
const FileSpec &platform_file = module_spec.GetFileSpec();
@@ -409,14 +408,14 @@ bool PlatformiOSSimulator::GetSupportedArchitectureAtIndex(uint32_t idx,
if (arch.IsValid()) {
if (idx == 2)
arch.GetTriple().setOS(llvm::Triple::IOS);
- // 32/64: return "i386-apple-ios" for architecture 2
- // 32/64: return "i386-apple-macosx" for architecture 3
+ // 32/64: return "i386-apple-ios" for architecture 2 32/64: return
+ // "i386-apple-macosx" for architecture 3
return true;
}
}
} else if (idx == 1) {
- // This macosx platform supports only 32 bit, so return the *-apple-macosx
- // version
+ // This macosx platform supports only 32 bit, so return the *-apple-
+ // macosx version
arch = platform_arch;
return true;
}
diff --git a/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt b/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
new file mode 100644
index 000000000000..946ff0a64c26
--- /dev/null
+++ b/source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,17 @@
+remove_module_flags()
+include_directories(.)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCXX
+ PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+ LINK_LIBS
+ lldbCore
+ lldbSymbol
+ lldbTarget
+ lldbUtility
+ ${EXTRA_LIBS}
+
+ LINK_COMPONENTS
+ Object
+ Support
+ )
diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h b/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
index 31e11a60e419..083e2d6c5687 100644
--- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.h
+++ b/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.h
@@ -24,8 +24,8 @@
typedef void *id;
#endif
// Project includes
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/ProcessLaunchInfo.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/Status.h"
diff --git a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm b/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
index 7bd37683d2fd..4516a66ee8ca 100644
--- a/source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
+++ b/source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm
@@ -478,26 +478,17 @@ CoreSimulatorSupport::Device::Spawn(ProcessLaunchInfo &launch_info) {
[options setObject:args_array forKey:kSimDeviceSpawnArguments];
}
- if (launch_info.GetEnvironmentEntries().GetArgumentCount()) {
- const Args &envs(launch_info.GetEnvironmentEntries());
- NSMutableDictionary *env_dict = [[NSMutableDictionary alloc] init];
- for (size_t idx = 0; idx < envs.GetArgumentCount(); idx++) {
- llvm::StringRef arg_sr(envs.GetArgumentAtIndex(idx));
- auto first_eq = arg_sr.find('=');
- if (first_eq == llvm::StringRef::npos)
- continue;
- llvm::StringRef key = arg_sr.substr(0, first_eq);
- llvm::StringRef value = arg_sr.substr(first_eq + 1);
-
- NSString *key_ns = [NSString stringWithUTF8String:key.str().c_str()];
- NSString *value_ns = [NSString stringWithUTF8String:value.str().c_str()];
-
- [env_dict setValue:value_ns forKey:key_ns];
- }
+ NSMutableDictionary *env_dict = [[NSMutableDictionary alloc] init];
+
+ for (const auto &KV : launch_info.GetEnvironment()) {
+ NSString *key_ns = [NSString stringWithUTF8String:KV.first().str().c_str()];
+ NSString *value_ns = [NSString stringWithUTF8String:KV.second.c_str()];
- [options setObject:env_dict forKey:kSimDeviceSpawnEnvironment];
+ [env_dict setValue:value_ns forKey:key_ns];
}
+ [options setObject:env_dict forKey:kSimDeviceSpawnEnvironment];
+
Status error;
File stdin_file;
File stdout_file;
diff --git a/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp b/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
index 38bdf60c1ced..3aa8ecb4c228 100644
--- a/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
+++ b/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
@@ -30,8 +30,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
-// Define these constants from NetBSD mman.h for use when targeting
-// remote netbsd systems even when host has different values.
+// Define these constants from NetBSD mman.h for use when targeting remote
+// netbsd systems even when host has different values.
#define MAP_PRIVATE 0x0002
#define MAP_ANON 0x1000
@@ -45,19 +45,9 @@ static uint32_t g_initialize_count = 0;
PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
- if (log) {
- const char *arch_name;
- if (arch && arch->GetArchitectureName())
- arch_name = arch->GetArchitectureName();
- else
- arch_name = "<null>";
-
- const char *triple_cstr =
- arch ? arch->GetTriple().getTriple().c_str() : "<null>";
-
- log->Printf("PlatformNetBSD::%s(force=%s, arch={%s,%s})", __FUNCTION__,
- force ? "true" : "false", arch_name, triple_cstr);
- }
+ LLDB_LOG(log, "force = {0}, arch=({1}, {2})", force,
+ arch ? arch->GetArchitectureName() : "<null>",
+ arch ? arch->GetTriple().getTriple() : "<null>");
bool create = force;
if (create == false && arch && arch->IsValid()) {
@@ -72,18 +62,10 @@ PlatformSP PlatformNetBSD::CreateInstance(bool force, const ArchSpec *arch) {
}
}
+ LLDB_LOG(log, "create = {0}", create);
if (create) {
- if (log)
- log->Printf("PlatformNetBSD::%s() creating remote-netbsd platform",
- __FUNCTION__);
return PlatformSP(new PlatformNetBSD(false));
}
-
- if (log)
- log->Printf(
- "PlatformNetBSD::%s() aborting creation of remote-netbsd platform",
- __FUNCTION__);
-
return PlatformSP();
}
@@ -152,7 +134,8 @@ bool PlatformNetBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
arch = hostArch;
return arch.IsValid();
} else if (idx == 1) {
- // If the default host architecture is 64-bit, look for a 32-bit variant
+ // If the default host architecture is 64-bit, look for a 32-bit
+ // variant
if (hostArch.IsValid() && hostArch.GetTriple().isArch64Bit()) {
arch = HostInfo::GetArchitecture(HostInfo::eArchKind32);
return arch.IsValid();
@@ -178,13 +161,10 @@ bool PlatformNetBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
return false;
}
// Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the
- // vendor by
- // calling triple.SetVendorName("unknown") so that it is a "unspecified
- // unknown".
- // This means when someone calls triple.GetVendorName() it will return an
- // empty string
- // which indicates that the vendor can be set when two architectures are
- // merged
+ // vendor by calling triple.SetVendorName("unknown") so that it is a
+ // "unspecified unknown". This means when someone calls
+ // triple.GetVendorName() it will return an empty string which indicates
+ // that the vendor can be set when two architectures are merged
// Now set the triple into "arch" and return true
arch.SetTriple(triple);
@@ -258,19 +238,15 @@ bool PlatformNetBSD::CanDebugProcess() {
}
// For local debugging, NetBSD will override the debug logic to use llgs-launch
-// rather than
-// lldb-launch, llgs-attach. This differs from current lldb-launch,
-// debugserver-attach
-// approach on MacOSX.
-lldb::ProcessSP PlatformNetBSD::DebugProcess(
- ProcessLaunchInfo &launch_info, Debugger &debugger,
- Target *target, // Can be NULL, if NULL create a new
- // target, else use existing one
- Status &error) {
+// rather than lldb-launch, llgs-attach. This differs from current lldb-
+// launch, debugserver-attach approach on MacOSX.
+lldb::ProcessSP
+PlatformNetBSD::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
+ Target *target, // Can be NULL, if NULL create a new
+ // target, else use existing one
+ Status &error) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PLATFORM));
- if (log)
- log->Printf("PlatformNetBSD::%s entered (target %p)", __FUNCTION__,
- static_cast<void *>(target));
+ LLDB_LOG(log, "target {0}", target);
// If we're a remote host, use standard behavior from parent class.
if (!IsHost())
@@ -287,67 +263,48 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess(
launch_info.GetFlags().Set(eLaunchFlagDebug);
// We always launch the process we are going to debug in a separate process
- // group, since then we can handle ^C interrupts ourselves w/o having to worry
- // about the target getting them as well.
+ // group, since then we can handle ^C interrupts ourselves w/o having to
+ // worry about the target getting them as well.
launch_info.SetLaunchInSeparateProcessGroup(true);
// Ensure we have a target.
if (target == nullptr) {
- if (log)
- log->Printf("PlatformNetBSD::%s creating new target", __FUNCTION__);
-
+ LLDB_LOG(log, "creating new target");
TargetSP new_target_sp;
error = debugger.GetTargetList().CreateTarget(debugger, "", "", false,
nullptr, new_target_sp);
if (error.Fail()) {
- if (log)
- log->Printf("PlatformNetBSD::%s failed to create new target: %s",
- __FUNCTION__, error.AsCString());
+ LLDB_LOG(log, "failed to create new target: {0}", error);
return process_sp;
}
target = new_target_sp.get();
if (!target) {
error.SetErrorString("CreateTarget() returned nullptr");
- if (log)
- log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__,
- error.AsCString());
+ LLDB_LOG(log, "error: {0}", error);
return process_sp;
}
- } else {
- if (log)
- log->Printf("PlatformNetBSD::%s using provided target", __FUNCTION__);
}
// Mark target as currently selected target.
debugger.GetTargetList().SetSelectedTarget(target);
// Now create the gdb-remote process.
- if (log)
- log->Printf(
- "PlatformNetBSD::%s having target create process with gdb-remote plugin",
- __FUNCTION__);
+ LLDB_LOG(log, "having target create process with gdb-remote plugin");
process_sp = target->CreateProcess(
launch_info.GetListenerForProcess(debugger), "gdb-remote", nullptr);
if (!process_sp) {
error.SetErrorString("CreateProcess() failed for gdb-remote process");
- if (log)
- log->Printf("PlatformNetBSD::%s failed: %s", __FUNCTION__,
- error.AsCString());
+ LLDB_LOG(log, "error: {0}", error);
return process_sp;
- } else {
- if (log)
- log->Printf("PlatformNetBSD::%s successfully created process",
- __FUNCTION__);
}
+ LLDB_LOG(log, "successfully created process");
// Adjust launch for a hijacker.
ListenerSP listener_sp;
if (!launch_info.GetHijackListener()) {
- if (log)
- log->Printf("PlatformNetBSD::%s setting up hijacker", __FUNCTION__);
-
+ LLDB_LOG(log, "setting up hijacker");
listener_sp =
Listener::MakeListener("lldb.PlatformNetBSD.DebugProcess.hijack");
launch_info.SetHijackListener(listener_sp);
@@ -356,16 +313,13 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess(
// Log file actions.
if (log) {
- log->Printf(
- "PlatformNetBSD::%s launching process with the following file actions:",
- __FUNCTION__);
-
+ LLDB_LOG(log, "launching process with the following file actions:");
StreamString stream;
size_t i = 0;
const FileAction *file_action;
while ((file_action = launch_info.GetFileActionAtIndex(i++)) != nullptr) {
file_action->Dump(stream);
- log->PutCString(stream.GetData());
+ LLDB_LOG(log, "{0}", stream.GetData());
stream.Clear();
}
}
@@ -378,16 +332,7 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess(
const StateType state = process_sp->WaitForProcessToStop(
llvm::None, NULL, false, listener_sp);
- if (state == eStateStopped) {
- if (log)
- log->Printf("PlatformNetBSD::%s pid %" PRIu64 " state %s\n",
- __FUNCTION__, process_sp->GetID(), StateAsCString(state));
- } else {
- if (log)
- log->Printf("PlatformNetBSD::%s pid %" PRIu64
- " state is not stopped - %s\n",
- __FUNCTION__, process_sp->GetID(), StateAsCString(state));
- }
+ LLDB_LOG(log, "pid {0} state {0}", process_sp->GetID(), state);
}
// Hook up process PTY if we have one (which we should for local debugging
@@ -395,20 +340,11 @@ lldb::ProcessSP PlatformNetBSD::DebugProcess(
int pty_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
if (pty_fd != PseudoTerminal::invalid_fd) {
process_sp->SetSTDIOFileDescriptor(pty_fd);
- if (log)
- log->Printf("PlatformNetBSD::%s pid %" PRIu64
- " hooked up STDIO pty to process",
- __FUNCTION__, process_sp->GetID());
- } else {
- if (log)
- log->Printf("PlatformNetBSD::%s pid %" PRIu64
- " not using process STDIO pty",
- __FUNCTION__, process_sp->GetID());
- }
+ LLDB_LOG(log, "hooked up STDIO pty to process");
+ } else
+ LLDB_LOG(log, "not using process STDIO pty");
} else {
- if (log)
- log->Printf("PlatformNetBSD::%s process launch failed: %s", __FUNCTION__,
- error.AsCString());
+ LLDB_LOG(log, "process launch failed: {0}", error);
// FIXME figure out appropriate cleanup here. Do we delete the target? Do
// we delete the process? Does our caller do that?
}
diff --git a/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp b/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
index 050639aba7cc..10ca8fbfbdd7 100644
--- a/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
+++ b/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
@@ -30,8 +30,8 @@
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
-// Define these constants from OpenBSD mman.h for use when targeting
-// remote openbsd systems even when host has different values.
+// Define these constants from OpenBSD mman.h for use when targeting remote
+// openbsd systems even when host has different values.
#define MAP_PRIVATE 0x0002
#define MAP_ANON 0x1000
@@ -58,9 +58,8 @@ PlatformSP PlatformOpenBSD::CreateInstance(bool force, const ArchSpec *arch) {
break;
#if defined(__OpenBSD__)
- // Only accept "unknown" for the OS if the host is BSD and
- // it "unknown" wasn't specified (it was just returned because it
- // was NOT specified)
+ // Only accept "unknown" for the OS if the host is BSD and it "unknown"
+ // wasn't specified (it was just returned because it was NOT specified)
case llvm::Triple::OSType::UnknownOS:
create = !arch->TripleOSWasSpecified();
break;
@@ -167,13 +166,10 @@ bool PlatformOpenBSD::GetSupportedArchitectureAtIndex(uint32_t idx,
return false;
}
// Leave the vendor as "llvm::Triple:UnknownVendor" and don't specify the
- // vendor by
- // calling triple.SetVendorName("unknown") so that it is a "unspecified
- // unknown".
- // This means when someone calls triple.GetVendorName() it will return an
- // empty string
- // which indicates that the vendor can be set when two architectures are
- // merged
+ // vendor by calling triple.SetVendorName("unknown") so that it is a
+ // "unspecified unknown". This means when someone calls
+ // triple.GetVendorName() it will return an empty string which indicates
+ // that the vendor can be set when two architectures are merged
// Now set the triple into "arch" and return true
arch.SetTriple(triple);
diff --git a/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp b/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
index d45a54ee2499..5e7ffe71918e 100644
--- a/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ b/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -18,17 +18,22 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/ValueObject.h"
+#include "lldb/Expression/DiagnosticManager.h"
+#include "lldb/Expression/FunctionCaller.h"
#include "lldb/Expression/UserExpression.h"
+#include "lldb/Expression/UtilityFunction.h"
#include "lldb/Host/File.h"
#include "lldb/Host/FileCache.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
+#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/ExecutionContext.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/ProcessLaunchInfo.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/Log.h"
@@ -97,17 +102,14 @@ lldb_private::Status PlatformPOSIX::RunShellCommand(
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t
- timeout_sec) // Timeout in seconds to wait for shell program to finish
-{
+ const Timeout<std::micro> &timeout) {
if (IsHost())
return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr,
- command_output, timeout_sec);
+ command_output, timeout);
else {
if (m_remote_platform_sp)
- return m_remote_platform_sp->RunShellCommand(command, working_dir,
- status_ptr, signo_ptr,
- command_output, timeout_sec);
+ return m_remote_platform_sp->RunShellCommand(
+ command, working_dir, status_ptr, signo_ptr, command_output, timeout);
else
return Status("unable to run a remote command without a platform");
}
@@ -124,11 +126,12 @@ PlatformPOSIX::ResolveExecutable(const ModuleSpec &module_spec,
ModuleSpec resolved_module_spec(module_spec);
if (IsHost()) {
- // If we have "ls" as the exe_file, resolve the executable location based on
- // the current path variables
+ // If we have "ls" as the exe_file, resolve the executable location based
+ // on the current path variables
if (!resolved_module_spec.GetFileSpec().Exists()) {
resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
- resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
+ resolved_module_spec.GetFileSpec().SetFile(exe_path, true,
+ FileSpec::Style::native);
}
if (!resolved_module_spec.GetFileSpec().Exists())
@@ -210,9 +213,9 @@ PlatformPOSIX::ResolveExecutable(const ModuleSpec &module_spec,
resolved_module_spec.GetArchitecture().GetArchitectureName());
}
} else {
- // No valid architecture was specified, ask the platform for
- // the architectures that we should be using (in the correct order)
- // and see if we can find a match that way
+ // No valid architecture was specified, ask the platform for the
+ // architectures that we should be using (in the correct order) and see
+ // if we can find a match that way
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, resolved_module_spec.GetArchitecture());
@@ -367,7 +370,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, 10);
+ platform->RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
+ std::chrono::seconds(10));
return status;
}
@@ -391,7 +395,8 @@ 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, 10);
+ RunShellCommand(command.GetData(), NULL, &status, NULL, NULL,
+ std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
if (uid == UINT32_MAX && gid == UINT32_MAX)
@@ -421,7 +426,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, 60);
+ Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
+ 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)
@@ -495,7 +501,8 @@ 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, 10);
+ RunShellCommand(cp_command.GetData(), NULL, &status, NULL, NULL,
+ std::chrono::seconds(10));
if (status != 0)
return Status("unable to perform copy");
return Status();
@@ -516,11 +523,12 @@ 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, 60);
+ Host::RunShellCommand(command.GetData(), NULL, &retcode, NULL, NULL,
+ std::chrono::minutes(1));
if (retcode == 0)
return Status();
- // If we are here, rsync has failed - let's try the slow way before giving
- // up
+ // If we are here, rsync has failed - let's try the slow way before
+ // giving up
}
// open src and dst
// read/write, read/write, read/write, ...
@@ -645,9 +653,10 @@ bool PlatformPOSIX::SetRemoteWorkingDirectory(const FileSpec &working_dir) {
}
bool PlatformPOSIX::GetRemoteOSVersion() {
- if (m_remote_platform_sp)
- return m_remote_platform_sp->GetOSVersion(
- m_major_os_version, m_minor_os_version, m_update_os_version);
+ if (m_remote_platform_sp) {
+ m_os_version = m_remote_platform_sp->GetOSVersion();
+ return !m_os_version.empty();
+ }
return false;
}
@@ -658,13 +667,13 @@ bool PlatformPOSIX::GetRemoteOSBuildString(std::string &s) {
return false;
}
-size_t PlatformPOSIX::GetEnvironment(StringList &env) {
+Environment PlatformPOSIX::GetEnvironment() {
if (IsRemote()) {
if (m_remote_platform_sp)
- return m_remote_platform_sp->GetEnvironment(env);
- return 0;
+ return m_remote_platform_sp->GetEnvironment();
+ return Environment();
}
- return Host::GetEnvironment(env);
+ return Host::GetEnvironment();
}
bool PlatformPOSIX::GetRemoteOSKernelDescription(std::string &s) {
@@ -861,12 +870,12 @@ PlatformPOSIX::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
if (IsHost()) {
// We are going to hand this process off to debugserver which will be in
- // charge of setting the exit status.
- // We still need to reap it from lldb but if we let the monitor thread also
- // set the exit status, we set up a
- // race between debugserver & us for who will find out about the debugged
- // process's death.
- launch_info.GetFlags().Set(eLaunchFlagDontSetExitStatus);
+ // charge of setting the exit status. However, we still need to reap it
+ // from lldb. So, make sure we use a exit callback which does not set exit
+ // status.
+ const bool monitor_signals = false;
+ launch_info.SetMonitorProcessCallback(
+ &ProcessLaunchInfo::NoOpMonitorCallback, monitor_signals);
process_sp = Platform::DebugProcess(launch_info, debugger, target, error);
} else {
if (m_remote_platform_sp)
@@ -923,64 +932,380 @@ Status PlatformPOSIX::EvaluateLibdlExpression(
return Status();
}
+std::unique_ptr<UtilityFunction>
+PlatformPOSIX::MakeLoadImageUtilityFunction(ExecutionContext &exe_ctx,
+ Status &error) {
+ // Remember to prepend this with the prefix from
+ // GetLibdlFunctionDeclarations. The returned values are all in
+ // __lldb_dlopen_result for consistency. The wrapper returns a void * but
+ // doesn't use it because UtilityFunctions don't work with void returns at
+ // present.
+ static const char *dlopen_wrapper_code = R"(
+ struct __lldb_dlopen_result {
+ void *image_ptr;
+ const char *error_str;
+ };
+
+ extern void *memcpy(void *, const void *, size_t size);
+ extern size_t strlen(const char *);
+
+
+ void * __lldb_dlopen_wrapper (const char *name,
+ const char *path_strings,
+ char *buffer,
+ __lldb_dlopen_result *result_ptr)
+ {
+ // This is the case where the name is the full path:
+ if (!path_strings) {
+ result_ptr->image_ptr = dlopen(name, 2);
+ if (result_ptr->image_ptr)
+ result_ptr->error_str = nullptr;
+ return nullptr;
+ }
+
+ // This is the case where we have a list of paths:
+ size_t name_len = strlen(name);
+ while (path_strings && path_strings[0] != '\0') {
+ size_t path_len = strlen(path_strings);
+ memcpy((void *) buffer, (void *) path_strings, path_len);
+ buffer[path_len] = '/';
+ char *target_ptr = buffer+path_len+1;
+ memcpy((void *) target_ptr, (void *) name, name_len + 1);
+ result_ptr->image_ptr = dlopen(buffer, 2);
+ if (result_ptr->image_ptr) {
+ result_ptr->error_str = nullptr;
+ break;
+ }
+ result_ptr->error_str = dlerror();
+ path_strings = path_strings + path_len + 1;
+ }
+ return nullptr;
+ }
+ )";
+
+ static const char *dlopen_wrapper_name = "__lldb_dlopen_wrapper";
+ Process *process = exe_ctx.GetProcessSP().get();
+ // Insert the dlopen shim defines into our generic expression:
+ std::string expr(GetLibdlFunctionDeclarations(process));
+ expr.append(dlopen_wrapper_code);
+ Status utility_error;
+ DiagnosticManager diagnostics;
+
+ std::unique_ptr<UtilityFunction> dlopen_utility_func_up(process
+ ->GetTarget().GetUtilityFunctionForLanguage(expr.c_str(),
+ eLanguageTypeObjC,
+ dlopen_wrapper_name,
+ utility_error));
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not make utility"
+ "function: %s", utility_error.AsCString());
+ return nullptr;
+ }
+ if (!dlopen_utility_func_up->Install(diagnostics, exe_ctx)) {
+ error.SetErrorStringWithFormat("dlopen error: could not install utility"
+ "function: %s",
+ diagnostics.GetString().c_str());
+ return nullptr;
+ }
+
+ Value value;
+ ValueList arguments;
+ FunctionCaller *do_dlopen_function = nullptr;
+
+ // Fetch the clang types we will need:
+ ClangASTContext *ast = process->GetTarget().GetScratchClangASTContext();
+
+ CompilerType clang_void_pointer_type
+ = ast->GetBasicType(eBasicTypeVoid).GetPointerType();
+ CompilerType clang_char_pointer_type
+ = ast->GetBasicType(eBasicTypeChar).GetPointerType();
+
+ // We are passing four arguments, the basename, the list of places to look,
+ // a buffer big enough for all the path + name combos, and
+ // a pointer to the storage we've made for the result:
+ value.SetValueType(Value::eValueTypeScalar);
+ value.SetCompilerType(clang_void_pointer_type);
+ arguments.PushValue(value);
+ value.SetCompilerType(clang_char_pointer_type);
+ arguments.PushValue(value);
+ arguments.PushValue(value);
+ arguments.PushValue(value);
+
+ do_dlopen_function = dlopen_utility_func_up->MakeFunctionCaller(
+ clang_void_pointer_type, arguments, exe_ctx.GetThreadSP(), utility_error);
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not make function"
+ "caller: %s", utility_error.AsCString());
+ return nullptr;
+ }
+
+ do_dlopen_function = dlopen_utility_func_up->GetFunctionCaller();
+ if (!do_dlopen_function) {
+ error.SetErrorString("dlopen error: could not get function caller.");
+ return nullptr;
+ }
+
+ // We made a good utility function, so cache it in the process:
+ return dlopen_utility_func_up;
+}
+
uint32_t PlatformPOSIX::DoLoadImage(lldb_private::Process *process,
const lldb_private::FileSpec &remote_file,
- lldb_private::Status &error) {
- char path[PATH_MAX];
- remote_file.GetPath(path, sizeof(path));
-
- StreamString expr;
- expr.Printf(R"(
- struct __lldb_dlopen_result { void *image_ptr; const char *error_str; } the_result;
- the_result.image_ptr = dlopen ("%s", 2);
- if (the_result.image_ptr == (void *) 0x0)
- {
- the_result.error_str = dlerror();
- }
- else
- {
- the_result.error_str = (const char *) 0x0;
- }
- the_result;
- )",
- path);
- llvm::StringRef prefix = GetLibdlFunctionDeclarations(process);
- lldb::ValueObjectSP result_valobj_sp;
- error = EvaluateLibdlExpression(process, expr.GetData(), prefix,
- result_valobj_sp);
- if (error.Fail())
+ const std::vector<std::string> *paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_image) {
+ if (loaded_image)
+ loaded_image->Clear();
+
+ std::string path;
+ path = remote_file.GetPath();
+
+ ThreadSP thread_sp = process->GetThreadList().GetExpressionExecutionThread();
+ if (!thread_sp) {
+ error.SetErrorString("dlopen error: no thread available to call dlopen.");
return LLDB_INVALID_IMAGE_TOKEN;
-
- error = result_valobj_sp->GetError();
- if (error.Fail())
+ }
+
+ DiagnosticManager diagnostics;
+
+ ExecutionContext exe_ctx;
+ thread_sp->CalculateExecutionContext(exe_ctx);
+
+ Status utility_error;
+ UtilityFunction *dlopen_utility_func;
+ ValueList arguments;
+ FunctionCaller *do_dlopen_function = nullptr;
+
+ // The UtilityFunction is held in the Process. Platforms don't track the
+ // lifespan of the Targets that use them, we can't put this in the Platform.
+ dlopen_utility_func = process->GetLoadImageUtilityFunction(
+ this, [&]() -> std::unique_ptr<UtilityFunction> {
+ return MakeLoadImageUtilityFunction(exe_ctx, error);
+ });
+ // If we couldn't make it, the error will be in error, so we can exit here.
+ if (!dlopen_utility_func)
return LLDB_INVALID_IMAGE_TOKEN;
-
- Scalar scalar;
- ValueObjectSP image_ptr_sp = result_valobj_sp->GetChildAtIndex(0, true);
- if (!image_ptr_sp || !image_ptr_sp->ResolveValue(scalar)) {
- error.SetErrorStringWithFormat("unable to load '%s'", path);
+
+ do_dlopen_function = dlopen_utility_func->GetFunctionCaller();
+ if (!do_dlopen_function) {
+ error.SetErrorString("dlopen error: could not get function caller.");
return LLDB_INVALID_IMAGE_TOKEN;
}
-
- addr_t image_ptr = scalar.ULongLong(LLDB_INVALID_ADDRESS);
- if (image_ptr != 0 && image_ptr != LLDB_INVALID_ADDRESS)
- return process->AddImageToken(image_ptr);
-
- if (image_ptr == 0) {
- ValueObjectSP error_str_sp = result_valobj_sp->GetChildAtIndex(1, true);
- if (error_str_sp) {
- DataBufferSP buffer_sp(new DataBufferHeap(10240, 0));
- size_t num_chars =
- error_str_sp->ReadPointedString(buffer_sp, error, 10240).first;
- if (error.Success() && num_chars > 0)
- error.SetErrorStringWithFormat("dlopen error: %s",
- buffer_sp->GetBytes());
- else
- error.SetErrorStringWithFormat("dlopen failed for unknown reasons.");
+ arguments = do_dlopen_function->GetArgumentValues();
+
+ // Now insert the path we are searching for and the result structure into the
+ // target.
+ uint32_t permissions = ePermissionsReadable|ePermissionsWritable;
+ size_t path_len = path.size() + 1;
+ lldb::addr_t path_addr = process->AllocateMemory(path_len,
+ permissions,
+ utility_error);
+ if (path_addr == LLDB_INVALID_ADDRESS) {
+ error.SetErrorStringWithFormat("dlopen error: could not allocate memory"
+ "for path: %s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Make sure we deallocate the input string memory:
+ CleanUp path_cleanup([process, path_addr] {
+ process->DeallocateMemory(path_addr);
+ });
+
+ process->WriteMemory(path_addr, path.c_str(), path_len, utility_error);
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not write path string:"
+ " %s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Make space for our return structure. It is two pointers big: the token
+ // and the error string.
+ const uint32_t addr_size = process->GetAddressByteSize();
+ lldb::addr_t return_addr = process->CallocateMemory(2*addr_size,
+ permissions,
+ utility_error);
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not allocate memory"
+ "for path: %s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Make sure we deallocate the result structure memory
+ CleanUp return_cleanup([process, return_addr] {
+ process->DeallocateMemory(return_addr);
+ });
+
+ // This will be the address of the storage for paths, if we are using them,
+ // or nullptr to signal we aren't.
+ lldb::addr_t path_array_addr = 0x0;
+ llvm::Optional<CleanUp> path_array_cleanup;
+
+ // This is the address to a buffer large enough to hold the largest path
+ // conjoined with the library name we're passing in. This is a convenience
+ // to avoid having to call malloc in the dlopen function.
+ lldb::addr_t buffer_addr = 0x0;
+ llvm::Optional<CleanUp> buffer_cleanup;
+
+ // Set the values into our args and write them to the target:
+ if (paths != nullptr) {
+ // First insert the paths into the target. This is expected to be a
+ // continuous buffer with the strings laid out null terminated and
+ // end to end with an empty string terminating the buffer.
+ // We also compute the buffer's required size as we go.
+ size_t buffer_size = 0;
+ std::string path_array;
+ for (auto path : *paths) {
+ // Don't insert empty paths, they will make us abort the path
+ // search prematurely.
+ if (path.empty())
+ continue;
+ size_t path_size = path.size();
+ path_array.append(path);
+ path_array.push_back('\0');
+ if (path_size > buffer_size)
+ buffer_size = path_size;
+ }
+ path_array.push_back('\0');
+
+ path_array_addr = process->AllocateMemory(path_array.size(),
+ permissions,
+ utility_error);
+ if (path_array_addr == LLDB_INVALID_ADDRESS) {
+ error.SetErrorStringWithFormat("dlopen error: could not allocate memory"
+ "for path array: %s",
+ utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Make sure we deallocate the paths array.
+ path_array_cleanup.emplace([process, path_array_addr] {
+ process->DeallocateMemory(path_array_addr);
+ });
+
+ process->WriteMemory(path_array_addr, path_array.data(),
+ path_array.size(), utility_error);
+
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not write path array:"
+ " %s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+ // Now make spaces in the target for the buffer. We need to add one for
+ // the '/' that the utility function will insert and one for the '\0':
+ buffer_size += path.size() + 2;
+
+ buffer_addr = process->AllocateMemory(buffer_size,
+ permissions,
+ utility_error);
+ if (buffer_addr == LLDB_INVALID_ADDRESS) {
+ error.SetErrorStringWithFormat("dlopen error: could not allocate memory"
+ "for buffer: %s",
+ utility_error.AsCString());
return LLDB_INVALID_IMAGE_TOKEN;
}
+
+ // Make sure we deallocate the buffer memory:
+ buffer_cleanup.emplace([process, buffer_addr] {
+ process->DeallocateMemory(buffer_addr);
+ });
}
- error.SetErrorStringWithFormat("unable to load '%s'", path);
+
+ arguments.GetValueAtIndex(0)->GetScalar() = path_addr;
+ arguments.GetValueAtIndex(1)->GetScalar() = path_array_addr;
+ arguments.GetValueAtIndex(2)->GetScalar() = buffer_addr;
+ arguments.GetValueAtIndex(3)->GetScalar() = return_addr;
+
+ lldb::addr_t func_args_addr = LLDB_INVALID_ADDRESS;
+
+ diagnostics.Clear();
+ if (!do_dlopen_function->WriteFunctionArguments(exe_ctx,
+ func_args_addr,
+ arguments,
+ diagnostics)) {
+ error.SetErrorStringWithFormat("dlopen error: could not write function "
+ "arguments: %s",
+ diagnostics.GetString().c_str());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Make sure we clean up the args structure. We can't reuse it because the
+ // Platform lives longer than the process and the Platforms don't get a
+ // signal to clean up cached data when a process goes away.
+ CleanUp args_cleanup([do_dlopen_function, &exe_ctx, func_args_addr] {
+ do_dlopen_function->DeallocateFunctionResults(exe_ctx, func_args_addr);
+ });
+
+ // Now run the caller:
+ EvaluateExpressionOptions options;
+ options.SetExecutionPolicy(eExecutionPolicyAlways);
+ options.SetLanguage(eLanguageTypeC_plus_plus);
+ options.SetIgnoreBreakpoints(true);
+ options.SetUnwindOnError(true);
+ options.SetTrapExceptions(false); // dlopen can't throw exceptions, so
+ // don't do the work to trap them.
+ options.SetTimeout(std::chrono::seconds(2));
+
+ Value return_value;
+ // Fetch the clang types we will need:
+ ClangASTContext *ast = process->GetTarget().GetScratchClangASTContext();
+
+ CompilerType clang_void_pointer_type
+ = ast->GetBasicType(eBasicTypeVoid).GetPointerType();
+
+ return_value.SetCompilerType(clang_void_pointer_type);
+
+ ExpressionResults results = do_dlopen_function->ExecuteFunction(
+ exe_ctx, &func_args_addr, options, diagnostics, return_value);
+ if (results != eExpressionCompleted) {
+ error.SetErrorStringWithFormat("dlopen error: failed executing "
+ "dlopen wrapper function: %s",
+ diagnostics.GetString().c_str());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // Read the dlopen token from the return area:
+ lldb::addr_t token = process->ReadPointerFromMemory(return_addr,
+ utility_error);
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not read the return "
+ "struct: %s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ // The dlopen succeeded!
+ if (token != 0x0) {
+ if (loaded_image && buffer_addr != 0x0)
+ {
+ // Capture the image which was loaded. We leave it in the buffer on
+ // exit from the dlopen function, so we can just read it from there:
+ std::string name_string;
+ process->ReadCStringFromMemory(buffer_addr, name_string, utility_error);
+ if (utility_error.Success())
+ loaded_image->SetFile(name_string, false,
+ llvm::sys::path::Style::posix);
+ }
+ return process->AddImageToken(token);
+ }
+
+ // We got an error, lets read in the error string:
+ std::string dlopen_error_str;
+ lldb::addr_t error_addr
+ = process->ReadPointerFromMemory(return_addr + addr_size, utility_error);
+ if (utility_error.Fail()) {
+ error.SetErrorStringWithFormat("dlopen error: could not read error string: "
+ "%s", utility_error.AsCString());
+ return LLDB_INVALID_IMAGE_TOKEN;
+ }
+
+ size_t num_chars = process->ReadCStringFromMemory(error_addr + addr_size,
+ dlopen_error_str,
+ utility_error);
+ if (utility_error.Success() && num_chars > 0)
+ error.SetErrorStringWithFormat("dlopen error: %s",
+ dlopen_error_str.c_str());
+ else
+ error.SetErrorStringWithFormat("dlopen failed for unknown reasons.");
+
return LLDB_INVALID_IMAGE_TOKEN;
}
diff --git a/source/Plugins/Platform/POSIX/PlatformPOSIX.h b/source/Plugins/Platform/POSIX/PlatformPOSIX.h
index 93bebeb332ca..cc6f7299c194 100644
--- a/source/Plugins/Platform/POSIX/PlatformPOSIX.h
+++ b/source/Plugins/Platform/POSIX/PlatformPOSIX.h
@@ -85,7 +85,7 @@ public:
const lldb::UnixSignalsSP &GetRemoteUnixSignals() override;
- size_t GetEnvironment(lldb_private::StringList &environment) override;
+ lldb_private::Environment GetEnvironment() override;
bool IsConnected() const override;
@@ -99,8 +99,7 @@ public:
// the process to exit
std::string
*command_output, // Pass nullptr if you don't want the command output
- uint32_t timeout_sec)
- override; // Timeout in seconds to wait for shell program to finish
+ const lldb_private::Timeout<std::micro> &timeout) override;
lldb_private::Status ResolveExecutable(
const lldb_private::ModuleSpec &module_spec, lldb::ModuleSP &module_sp,
@@ -166,7 +165,9 @@ public:
uint32_t DoLoadImage(lldb_private::Process *process,
const lldb_private::FileSpec &remote_file,
- lldb_private::Status &error) override;
+ const std::vector<std::string> *paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_image) override;
lldb_private::Status UnloadImage(lldb_private::Process *process,
uint32_t image_token) override;
@@ -201,6 +202,10 @@ protected:
llvm::StringRef expr_prefix,
lldb::ValueObjectSP &result_valobj_sp);
+ std::unique_ptr<lldb_private::UtilityFunction>
+ MakeLoadImageUtilityFunction(lldb_private::ExecutionContext &exe_ctx,
+ lldb_private::Status &error);
+
virtual
llvm::StringRef GetLibdlFunctionDeclarations(lldb_private::Process *process);
diff --git a/source/Plugins/Platform/Windows/PlatformWindows.cpp b/source/Plugins/Platform/Windows/PlatformWindows.cpp
index 3535df0c65cc..ed2bcf0cbee4 100644
--- a/source/Plugins/Platform/Windows/PlatformWindows.cpp
+++ b/source/Plugins/Platform/Windows/PlatformWindows.cpp
@@ -194,7 +194,8 @@ Status PlatformWindows::ResolveExecutable(
// variables
if (!resolved_module_spec.GetFileSpec().Exists()) {
resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
- resolved_module_spec.GetFileSpec().SetFile(exe_path, true);
+ resolved_module_spec.GetFileSpec().SetFile(exe_path, true,
+ FileSpec::Style::native);
}
if (!resolved_module_spec.GetFileSpec().Exists())
@@ -237,9 +238,9 @@ Status PlatformWindows::ResolveExecutable(
resolved_module_spec.GetArchitecture().GetArchitectureName());
}
} else {
- // No valid architecture was specified, ask the platform for
- // the architectures that we should be using (in the correct order)
- // and see if we can find a match that way
+ // No valid architecture was specified, ask the platform for the
+ // architectures that we should be using (in the correct order) and see
+ // if we can find a match that way
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, resolved_module_spec.GetArchitecture());
@@ -279,9 +280,10 @@ Status PlatformWindows::ResolveExecutable(
}
bool PlatformWindows::GetRemoteOSVersion() {
- if (m_remote_platform_sp)
- return m_remote_platform_sp->GetOSVersion(
- m_major_os_version, m_minor_os_version, m_update_os_version);
+ if (m_remote_platform_sp) {
+ m_os_version = m_remote_platform_sp->GetOSVersion();
+ return !m_os_version.empty();
+ }
return false;
}
@@ -413,29 +415,23 @@ ProcessSP PlatformWindows::DebugProcess(ProcessLaunchInfo &launch_info,
Debugger &debugger, Target *target,
Status &error) {
// Windows has special considerations that must be followed when launching or
- // attaching to a process. The
- // key requirement is that when launching or attaching to a process, you must
- // do it from the same the thread
- // that will go into a permanent loop which will then receive debug events
- // from the process. In particular,
- // this means we can't use any of LLDB's generic mechanisms to do it for us,
- // because it doesn't have the
- // special knowledge required for setting up the background thread or passing
- // the right flags.
+ // attaching to a process. The key requirement is that when launching or
+ // attaching to a process, you must do it from the same the thread that will
+ // go into a permanent loop which will then receive debug events from the
+ // process. In particular, this means we can't use any of LLDB's generic
+ // mechanisms to do it for us, because it doesn't have the special knowledge
+ // required for setting up the background thread or passing the right flags.
//
// Another problem is that that LLDB's standard model for debugging a process
- // is to first launch it, have
- // it stop at the entry point, and then attach to it. In Windows this doesn't
- // quite work, you have to
- // specify as an argument to CreateProcess() that you're going to debug the
- // process. So we override DebugProcess
- // here to handle this. Launch operations go directly to the process plugin,
- // and attach operations almost go
- // directly to the process plugin (but we hijack the events first). In
- // essence, we encapsulate all the logic
- // of Launching and Attaching in the process plugin, and
- // PlatformWindows::DebugProcess is just a pass-through
- // to get to the process plugin.
+ // is to first launch it, have it stop at the entry point, and then attach to
+ // it. In Windows this doesn't quite work, you have to specify as an
+ // argument to CreateProcess() that you're going to debug the process. So we
+ // override DebugProcess here to handle this. Launch operations go directly
+ // to the process plugin, and attach operations almost go directly to the
+ // process plugin (but we hijack the events first). In essence, we
+ // encapsulate all the logic of Launching and Attaching in the process
+ // plugin, and PlatformWindows::DebugProcess is just a pass-through to get to
+ // the process plugin.
if (launch_info.GetProcessID() != LLDB_INVALID_PROCESS_ID) {
// This is a process attach. Don't need to launch anything.
@@ -538,8 +534,8 @@ Status PlatformWindows::GetSharedModule(
module_sp.reset();
if (IsRemote()) {
- // If we have a remote platform always, let it try and locate
- // the shared module first.
+ // If we have a remote platform always, let it try and locate the shared
+ // module first.
if (m_remote_platform_sp) {
error = m_remote_platform_sp->GetSharedModule(
module_spec, process, module_sp, module_search_paths_ptr,
@@ -572,29 +568,21 @@ void PlatformWindows::GetStatus(Stream &strm) {
Platform::GetStatus(strm);
#ifdef _WIN32
- uint32_t major;
- uint32_t minor;
- uint32_t update;
- if (!HostInfo::GetOSVersion(major, minor, update)) {
- strm << "Windows";
- return;
- }
-
- strm << "Host: Windows " << major << '.' << minor << " Build: " << update
- << '\n';
+ llvm::VersionTuple version = HostInfo::GetOSVersion();
+ strm << "Host: Windows " << version.getAsString() << '\n';
#endif
}
bool PlatformWindows::CanDebugProcess() { return true; }
-size_t PlatformWindows::GetEnvironment(StringList &env) {
+Environment PlatformWindows::GetEnvironment() {
if (IsRemote()) {
if (m_remote_platform_sp)
- return m_remote_platform_sp->GetEnvironment(env);
- return 0;
+ return m_remote_platform_sp->GetEnvironment();
+ return Environment();
}
- return Host::GetEnvironment(env);
+ return Host::GetEnvironment();
}
ConstString PlatformWindows::GetFullNameForDylib(ConstString basename) {
diff --git a/source/Plugins/Platform/Windows/PlatformWindows.h b/source/Plugins/Platform/Windows/PlatformWindows.h
index 9af42116680e..3a15271c5762 100644
--- a/source/Plugins/Platform/Windows/PlatformWindows.h
+++ b/source/Plugins/Platform/Windows/PlatformWindows.h
@@ -118,7 +118,7 @@ public:
bool CanDebugProcess() override;
- size_t GetEnvironment(StringList &env) override;
+ Environment GetEnvironment() override;
// FIXME not sure what the _sigtramp equivalent would be on this platform
void CalculateTrapHandlerSymbolNames() override {}
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
index 759ec7fd1d29..348bb825a5c5 100644
--- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
+++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
@@ -118,9 +118,9 @@ Status PlatformRemoteGDBServer::ResolveExecutable(
return error;
exe_module_sp.reset();
}
- // No valid architecture was specified or the exact arch wasn't
- // found so ask the platform for the architectures that we should be
- // using (in the correct order) and see if we can find a match that way
+ // No valid architecture was specified or the exact arch wasn't found so
+ // ask the platform for the architectures that we should be using (in the
+ // correct order) and see if we can find a match that way
StreamString arch_names;
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, resolved_module_spec.GetArchitecture());
@@ -236,14 +236,8 @@ size_t PlatformRemoteGDBServer::GetSoftwareBreakpointTrapOpcode(
}
bool PlatformRemoteGDBServer::GetRemoteOSVersion() {
- uint32_t major, minor, update;
- if (m_gdb_client.GetOSVersion(major, minor, update)) {
- m_major_os_version = major;
- m_minor_os_version = minor;
- m_update_os_version = update;
- return true;
- }
- return false;
+ m_os_version = m_gdb_client.GetOSVersion();
+ return !m_os_version.empty();
}
bool PlatformRemoteGDBServer::GetRemoteOSBuildString(std::string &s) {
@@ -277,8 +271,7 @@ bool PlatformRemoteGDBServer::SetRemoteWorkingDirectory(
const FileSpec &working_dir) {
if (IsConnected()) {
// Clear the working directory it case it doesn't get set correctly. This
- // will
- // for use to re-read it
+ // will for use to re-read it
Log *log = GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM);
if (log)
log->Printf("PlatformRemoteGDBServer::SetRemoteWorkingDirectory('%s')",
@@ -423,16 +416,7 @@ Status PlatformRemoteGDBServer::LaunchProcess(ProcessLaunchInfo &launch_info) {
}
// Send the environment and the program + arguments after we connect
- const char **envp =
- launch_info.GetEnvironmentEntries().GetConstArgumentVector();
-
- if (envp) {
- const char *env_entry;
- for (int i = 0; (env_entry = envp[i]); ++i) {
- if (m_gdb_client.SendEnvironmentPacket(env_entry) != 0)
- break;
- }
- }
+ m_gdb_client.SendEnvironment(launch_info.GetEnvironment());
ArchSpec arch_spec = launch_info.GetArchitecture();
const char *arch_triple = arch_spec.GetTriple().str().c_str();
@@ -549,9 +533,8 @@ bool PlatformRemoteGDBServer::LaunchGDBServer(lldb::pid_t &pid,
bool launch_result = false;
if (remote_triple.getVendor() == llvm::Triple::Apple &&
remote_triple.getOS() == llvm::Triple::IOS) {
- // When remote debugging to iOS, we use a USB mux that always talks
- // to localhost, so we will need the remote debugserver to accept
- // connections
+ // When remote debugging to iOS, we use a USB mux that always talks to
+ // localhost, so we will need the remote debugserver to accept connections
// only from localhost, no matter what our current hostname is
launch_result =
m_gdb_client.LaunchGDBServer("127.0.0.1", pid, port, socket_name);
@@ -731,11 +714,9 @@ Status PlatformRemoteGDBServer::RunShellCommand(
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t
- timeout_sec) // Timeout in seconds to wait for shell program to finish
-{
+ const Timeout<std::micro> &timeout) {
return m_gdb_client.RunShellCommand(command, working_dir, status_ptr,
- signo_ptr, command_output, timeout_sec);
+ signo_ptr, command_output, timeout);
}
void PlatformRemoteGDBServer::CalculateTrapHandlerSymbolNames() {
@@ -749,8 +730,8 @@ const UnixSignalsSP &PlatformRemoteGDBServer::GetRemoteUnixSignals() {
if (m_remote_signals_sp)
return m_remote_signals_sp;
- // If packet not implemented or JSON failed to parse,
- // we'll guess the signal set based on the remote architecture.
+ // If packet not implemented or JSON failed to parse, we'll guess the signal
+ // set based on the remote architecture.
m_remote_signals_sp = UnixSignals::Create(GetRemoteSystemArchitecture());
StringExtractorGDBRemote response;
diff --git a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
index 210544f752e6..a31933b5d9b0 100644
--- a/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
+++ b/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
@@ -17,7 +17,7 @@
// Other libraries and framework includes
// Project includes
-#include "../../Process/gdb-remote/GDBRemoteCommunicationClient.h"
+#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
#include "Plugins/Process/Utility/GDBRemoteSignals.h"
#include "lldb/Target/Platform.h"
@@ -155,8 +155,7 @@ public:
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t timeout_sec)
- override; // Timeout in seconds to wait for shell program to finish
+ const lldb_private::Timeout<std::micro> &timeout) override;
void CalculateTrapHandlerSymbolNames() override;
diff --git a/source/Plugins/Process/CMakeLists.txt b/source/Plugins/Process/CMakeLists.txt
index 62abd75a43b6..fdeb211fe7a2 100644
--- a/source/Plugins/Process/CMakeLists.txt
+++ b/source/Plugins/Process/CMakeLists.txt
@@ -11,9 +11,9 @@ elseif (CMAKE_SYSTEM_NAME MATCHES "Windows")
add_subdirectory(Windows/Common)
elseif (CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_subdirectory(MacOSX-Kernel)
- add_subdirectory(mach-core)
endif()
add_subdirectory(gdb-remote)
add_subdirectory(Utility)
add_subdirectory(elf-core)
+add_subdirectory(mach-core)
add_subdirectory(minidump)
diff --git a/source/Plugins/Process/Darwin/CFString.cpp b/source/Plugins/Process/Darwin/CFString.cpp
index 84ad56774d7c..b87afe999181 100644
--- a/source/Plugins/Process/Darwin/CFString.cpp
+++ b/source/Plugins/Process/Darwin/CFString.cpp
@@ -91,9 +91,8 @@ const char *CFString::UTF8(std::string &str) {
return CFString::UTF8(get(), str);
}
-// Static function that puts a copy of the UTF8 contents of CF_STR into STR
-// and returns the C string pointer that is contained in STR when successful,
-// else
+// Static function that puts a copy of the UTF8 contents of CF_STR into STR and
+// returns the C string pointer that is contained in STR when successful, else
// NULL is returned. This allows the std::string parameter to own the extracted
// string,
// and also allows that string to be returned as a C string pointer that can be
@@ -120,9 +119,9 @@ const char *CFString::UTF8(CFStringRef cf_str, std::string &str) {
// Static function that puts a copy of the file system representation of CF_STR
// into STR and returns the C string pointer that is contained in STR when
-// successful, else NULL is returned. This allows the std::string parameter
-// to own the extracted string, and also allows that string to be returned as
-// a C string pointer that can be used.
+// successful, else NULL is returned. This allows the std::string parameter to
+// own the extracted string, and also allows that string to be returned as a C
+// string pointer that can be used.
const char *CFString::FileSystemRepresentation(CFStringRef cf_str,
std::string &str) {
diff --git a/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp b/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp
index 6b3d5f6c117f..95659725ce2e 100644
--- a/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp
+++ b/source/Plugins/Process/Darwin/DarwinProcessLauncher.cpp
@@ -142,8 +142,8 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[],
}
// Use a fork that ties the child process's stdin/out/err to a pseudo
- // terminal so we can read it in our MachProcess::STDIOThread
- // as unbuffered io.
+ // terminal so we can read it in our MachProcess::STDIOThread as unbuffered
+ // io.
PseudoTerminal pty;
char fork_error[256];
memset(fork_error, 0, sizeof(fork_error));
@@ -167,12 +167,12 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[],
// Get BSD signals as mach exceptions.
::ptrace(PT_SIGEXC, 0, 0, 0);
- // If our parent is setgid, lets make sure we don't inherit those
- // extra powers due to nepotism.
+ // If our parent is setgid, lets make sure we don't inherit those extra
+ // powers due to nepotism.
if (::setgid(getgid()) == 0) {
- // Let the child have its own process group. We need to execute
- // this call in both the child and parent to avoid a race
- // condition between the two processes.
+ // Let the child have its own process group. We need to execute this call
+ // in both the child and parent to avoid a race condition between the two
+ // processes.
// Set the child process group to match its pid.
::setpgid(0, 0);
@@ -183,23 +183,22 @@ static Status ForkChildForPTraceDebugging(const char *path, char const *argv[],
// Turn this process into the given executable.
::execv(path, (char *const *)argv);
}
- // Exit with error code. Child process should have taken
- // over in above exec call and if the exec fails it will
- // exit the child process below.
+ // Exit with error code. Child process should have taken over in above exec
+ // call and if the exec fails it will exit the child process below.
::exit(127);
} else {
//--------------------------------------------------------------
// Parent process
//--------------------------------------------------------------
- // Let the child have its own process group. We need to execute
- // this call in both the child and parent to avoid a race condition
- // between the two processes.
+ // Let the child have its own process group. We need to execute this call
+ // in both the child and parent to avoid a race condition between the two
+ // processes.
// Set the child process group to match its pid
::setpgid(*pid, *pid);
if (pty_fd) {
- // Release our master pty file descriptor so the pty class doesn't
- // close it and so we can continue to use it in our STDIO thread
+ // Release our master pty file descriptor so the pty class doesn't close
+ // it and so we can continue to use it in our STDIO thread
*pty_fd = pty.ReleaseMasterFileDescriptor();
}
}
@@ -302,8 +301,7 @@ static Status PosixSpawnChildForPTraceDebugging(const char *path,
return error;
}
- // Ensure we clean up the spawnattr structure however we exit this
- // function.
+ // Ensure we clean up the spawnattr structure however we exit this function.
std::unique_ptr<posix_spawnattr_t, int (*)(posix_spawnattr_t *)> spawnattr_up(
&attr, ::posix_spawnattr_destroy);
@@ -332,9 +330,9 @@ static Status PosixSpawnChildForPTraceDebugging(const char *path,
#if !defined(__arm__)
- // We don't need to do this for ARM, and we really shouldn't now that we
- // have multiple CPU subtypes and no posix_spawnattr call that allows us
- // to set which CPU subtype to launch...
+ // We don't need to do this for ARM, and we really shouldn't now that we have
+ // multiple CPU subtypes and no posix_spawnattr call that allows us to set
+ // which CPU subtype to launch...
cpu_type_t desired_cpu_type = launch_info.GetArchitecture().GetMachOCPUType();
if (desired_cpu_type != LLDB_INVALID_CPUTYPE) {
size_t ocount = 0;
@@ -374,10 +372,10 @@ static Status PosixSpawnChildForPTraceDebugging(const char *path,
int (*)(posix_spawn_file_actions_t *)>
file_actions_up(&file_actions, ::posix_spawn_file_actions_destroy);
- // We assume the caller has setup the file actions appropriately. We
- // are not in the business of figuring out what we really need here.
- // lldb-server will have already called FinalizeFileActions() as well
- // to button these up properly.
+ // We assume the caller has setup the file actions appropriately. We are not
+ // in the business of figuring out what we really need here. lldb-server will
+ // have already called FinalizeFileActions() as well to button these up
+ // properly.
const size_t num_actions = launch_info.GetNumFileActions();
for (size_t action_index = 0; action_index < num_actions; ++action_index) {
const FileAction *const action =
@@ -533,8 +531,8 @@ Status LaunchInferior(ProcessLaunchInfo &launch_info, int *pty_master_fd,
if (error.Success()) {
launch_info.SetProcessID(static_cast<lldb::pid_t>(pid));
} else {
- // Reset any variables that might have been set during a failed
- // launch attempt.
+ // Reset any variables that might have been set during a failed launch
+ // attempt.
if (pty_master_fd)
*pty_master_fd = -1;
@@ -616,8 +614,8 @@ Status LaunchInferior(ProcessLaunchInfo &launch_info, int *pty_master_fd,
if (pty_master_fd)
*pty_master_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
} else {
- // Reset any variables that might have been set during a failed
- // launch attempt.
+ // Reset any variables that might have been set during a failed launch
+ // attempt.
if (pty_master_fd)
*pty_master_fd = -1;
@@ -636,8 +634,8 @@ Status LaunchInferior(ProcessLaunchInfo &launch_info, int *pty_master_fd,
}
if (launch_info.GetProcessID() == LLDB_INVALID_PROCESS_ID) {
- // If we don't have a valid process ID and no one has set the error,
- // then return a generic error.
+ // If we don't have a valid process ID and no one has set the error, then
+ // return a generic error.
if (error.Success())
error.SetErrorStringWithFormat("%s(): failed to launch, no reason "
"specified",
diff --git a/source/Plugins/Process/Darwin/MachException.cpp b/source/Plugins/Process/Darwin/MachException.cpp
index 9f5920753d68..353f2df32139 100644
--- a/source/Plugins/Process/Darwin/MachException.cpp
+++ b/source/Plugins/Process/Darwin/MachException.cpp
@@ -92,8 +92,6 @@ extern "C" kern_return_t catch_mach_exception_raise_state_identity(
(uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
(uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
}
- mach_port_deallocate(mach_task_self(), task_port);
- mach_port_deallocate(mach_task_self(), thread_port);
return KERN_FAILURE;
}
@@ -249,20 +247,19 @@ bool MachException::Message::CatchExceptionRaise(task_t task) {
bool success = false;
state.task_port = task;
g_message = &state;
- // The exc_server function is the MIG generated server handling function
- // to handle messages from the kernel relating to the occurrence of an
- // exception in a thread. Such messages are delivered to the exception port
- // set via thread_set_exception_ports or task_set_exception_ports. When an
- // exception occurs in a thread, the thread sends an exception message to
- // its exception port, blocking in the kernel waiting for the receipt of a
- // reply. The exc_server function performs all necessary argument handling
- // for this kernel message and calls catch_exception_raise,
- // catch_exception_raise_state or catch_exception_raise_state_identity,
- // which should handle the exception. If the called routine returns
- // KERN_SUCCESS, a reply message will be sent, allowing the thread to
- // continue from the point of the exception; otherwise, no reply message
- // is sent and the called routine must have dealt with the exception
- // thread directly.
+ // The exc_server function is the MIG generated server handling function to
+ // handle messages from the kernel relating to the occurrence of an exception
+ // in a thread. Such messages are delivered to the exception port set via
+ // thread_set_exception_ports or task_set_exception_ports. When an exception
+ // occurs in a thread, the thread sends an exception message to its exception
+ // port, blocking in the kernel waiting for the receipt of a reply. The
+ // exc_server function performs all necessary argument handling for this
+ // kernel message and calls catch_exception_raise,
+ // catch_exception_raise_state or catch_exception_raise_state_identity, which
+ // should handle the exception. If the called routine returns KERN_SUCCESS, a
+ // reply message will be sent, allowing the thread to continue from the point
+ // of the exception; otherwise, no reply message is sent and the called
+ // routine must have dealt with the exception thread directly.
if (mach_exc_server(&exc_msg.hdr, &reply_msg.hdr)) {
success = true;
} else {
@@ -385,9 +382,9 @@ Status MachException::PortInfo::Save(task_t task) {
log->Printf("MachException::PortInfo::%s(task = 0x%4.4x)", __FUNCTION__,
task);
- // Be careful to be able to have debugserver built on a newer OS than what
- // it is currently running on by being able to start with all exceptions
- // and back off to just what is supported on the current system
+ // Be careful to be able to have debugserver built on a newer OS than what it
+ // is currently running on by being able to start with all exceptions and
+ // back off to just what is supported on the current system
mask = LLDB_EXC_MASK;
count = (sizeof(ports) / sizeof(ports[0]));
diff --git a/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp b/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp
index 518f0d2da4f2..3505443abcb0 100644
--- a/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp
+++ b/source/Plugins/Process/Darwin/NativeProcessDarwin.cpp
@@ -104,8 +104,8 @@ Status NativeProcessProtocol::Launch(
return error;
}
- // Finalize the processing needed to debug the launched process with
- // a NativeProcessDarwin instance.
+ // Finalize the processing needed to debug the launched process with a
+ // NativeProcessDarwin instance.
error = np_darwin_sp->FinalizeLaunch(launch_flavor, mainloop);
if (!error.Success()) {
if (log)
@@ -194,9 +194,9 @@ Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor,
"mach exception port monitor thread: %s",
__FUNCTION__, error.AsCString());
- // Terminate the inferior process. There's nothing meaningful we can
- // do if we can't receive signals and exceptions. Since we launched
- // the process, it's fair game for us to kill it.
+ // Terminate the inferior process. There's nothing meaningful we can do if
+ // we can't receive signals and exceptions. Since we launched the process,
+ // it's fair game for us to kill it.
::ptrace(PT_KILL, m_pid, 0, 0);
SetState(eStateExited);
@@ -243,9 +243,9 @@ Status NativeProcessDarwin::FinalizeLaunch(LaunchFlavor launch_flavor,
}
if (TaskPortForProcessID(error) == TASK_NULL) {
- // We failed to get the task for our process ID which is bad.
- // Kill our process; otherwise, it will be stopped at the entry
- // point and get reparented to someone else and never go away.
+ // We failed to get the task for our process ID which is bad. Kill our
+ // process; otherwise, it will be stopped at the entry point and get
+ // reparented to someone else and never go away.
if (log)
log->Printf("NativeProcessDarwin::%s(): could not get task port "
"for process, sending SIGKILL and exiting: %s",
@@ -277,9 +277,9 @@ bool NativeProcessDarwin::ProcessUsingBackBoard() const {
return false;
}
-// Called by the exception thread when an exception has been received from
-// our process. The exception message is completely filled and the exception
-// data has already been copied.
+// Called by the exception thread when an exception has been received from our
+// process. The exception message is completely filled and the exception data
+// has already been copied.
void NativeProcessDarwin::ExceptionMessageReceived(
const MachException::Message &message) {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_VERBOSE));
@@ -290,8 +290,8 @@ void NativeProcessDarwin::ExceptionMessageReceived(
SuspendTask();
}
- // Use a locker to automatically unlock our mutex in case of exceptions
- // Add the exception to our internal exception stack
+ // Use a locker to automatically unlock our mutex in case of exceptions Add
+ // the exception to our internal exception stack
m_exception_messages.push_back(message);
if (log)
@@ -324,13 +324,12 @@ void *NativeProcessDarwin::DoExceptionThread() {
// Ensure we don't get CPU starved.
MaybeRaiseThreadPriority();
- // We keep a count of the number of consecutive exceptions received so
- // we know to grab all exceptions without a timeout. We do this to get a
- // bunch of related exceptions on our exception port so we can process
- // then together. When we have multiple threads, we can get an exception
- // per thread and they will come in consecutively. The main loop in this
- // thread can stop periodically if needed to service things related to this
- // process.
+ // We keep a count of the number of consecutive exceptions received so we
+ // know to grab all exceptions without a timeout. We do this to get a bunch
+ // of related exceptions on our exception port so we can process then
+ // together. When we have multiple threads, we can get an exception per
+ // thread and they will come in consecutively. The main loop in this thread
+ // can stop periodically if needed to service things related to this process.
//
// [did we lose some words here?]
//
@@ -338,15 +337,15 @@ void *NativeProcessDarwin::DoExceptionThread() {
// 0 our exception port. After we get one exception, we then will use the
// MACH_RCV_TIMEOUT option with a zero timeout to grab all other current
// exceptions for our process. After we have received the last pending
- // exception, we will get a timeout which enables us to then notify
- // our main thread that we have an exception bundle available. We then wait
- // for the main thread to tell this exception thread to start trying to get
+ // exception, we will get a timeout which enables us to then notify our main
+ // thread that we have an exception bundle available. We then wait for the
+ // main thread to tell this exception thread to start trying to get
// exceptions messages again and we start again with a mach_msg read with
// infinite timeout.
//
// We choose to park a thread on this, rather than polling, because the
- // polling is expensive. On devices, we need to minimize overhead caused
- // by the process monitor.
+ // polling is expensive. On devices, we need to minimize overhead caused by
+ // the process monitor.
uint32_t num_exceptions_received = 0;
Status error;
task_t task = m_task;
@@ -359,8 +358,7 @@ void *NativeProcessDarwin::DoExceptionThread() {
CFReleaser<SBSWatchdogAssertionRef> watchdog;
if (process->ProcessUsingSpringBoard()) {
- // Request a renewal for every 60 seconds if we attached using
- // SpringBoard.
+ // Request a renewal for every 60 seconds if we attached using SpringBoard.
watchdog.reset(::SBSWatchdogAssertionCreateForPID(nullptr, pid, 60));
if (log)
log->Printf("::SBSWatchdogAssertionCreateForPID(NULL, %4.4x, 60) "
@@ -401,18 +399,18 @@ void *NativeProcessDarwin::DoExceptionThread() {
}
#endif // #ifdef WITH_BKS
- // Do we want to use a weak pointer to the NativeProcessDarwin here, in
- // which case we can guarantee we don't whack the process monitor if we
- // race between this thread and the main one on shutdown?
+ // Do we want to use a weak pointer to the NativeProcessDarwin here, in which
+ // case we can guarantee we don't whack the process monitor if we race
+ // between this thread and the main one on shutdown?
while (IsExceptionPortValid()) {
::pthread_testcancel();
MachException::Message exception_message;
if (num_exceptions_received > 0) {
- // We don't want a timeout here, just receive as many exceptions as
- // we can since we already have one. We want to get all currently
- // available exceptions for this task at once.
+ // We don't want a timeout here, just receive as many exceptions as we
+ // can since we already have one. We want to get all currently available
+ // exceptions for this task at once.
error = exception_message.Receive(
GetExceptionPort(),
MACH_RCV_MSG | MACH_RCV_INTERRUPT | MACH_RCV_TIMEOUT, 0);
@@ -424,8 +422,8 @@ void *NativeProcessDarwin::DoExceptionThread() {
MACH_RCV_TIMEOUT,
periodic_timeout);
} else {
- // We don't need to parse all current exceptions or stop
- // periodically, just wait for an exception forever.
+ // We don't need to parse all current exceptions or stop periodically,
+ // just wait for an exception forever.
error = exception_message.Receive(GetExceptionPort(),
MACH_RCV_MSG | MACH_RCV_INTERRUPT, 0);
}
@@ -462,8 +460,8 @@ void *NativeProcessDarwin::DoExceptionThread() {
__FUNCTION__);
continue;
} else {
- // The inferior task is no longer valid. Time to exit as
- // the process has gone away.
+ // The inferior task is no longer valid. Time to exit as the process
+ // has gone away.
if (log)
log->Printf("NativeProcessDarwin::%s(): the inferior task "
"has exited, and so will we...",
@@ -476,18 +474,17 @@ void *NativeProcessDarwin::DoExceptionThread() {
// We timed out when waiting for exceptions.
if (num_exceptions_received > 0) {
- // We were receiving all current exceptions with a timeout of
- // zero. It is time to go back to our normal looping mode.
+ // We were receiving all current exceptions with a timeout of zero.
+ // It is time to go back to our normal looping mode.
num_exceptions_received = 0;
- // Notify our main thread we have a complete exception message
- // bundle available. Get the possibly updated task port back
- // from the process in case we exec'ed and our task port
- // changed.
+ // Notify our main thread we have a complete exception message bundle
+ // available. Get the possibly updated task port back from the
+ // process in case we exec'ed and our task port changed.
task = ExceptionMessageBundleComplete();
- // In case we use a timeout value when getting exceptions,
- // make sure our task is still valid.
+ // In case we use a timeout value when getting exceptions, make sure
+ // our task is still valid.
if (IsTaskValid(task)) {
// Task is still ok.
if (log)
@@ -496,8 +493,8 @@ void *NativeProcessDarwin::DoExceptionThread() {
__FUNCTION__);
continue;
} else {
- // The inferior task is no longer valid. Time to exit as
- // the process has gone away.
+ // The inferior task is no longer valid. Time to exit as the
+ // process has gone away.
if (log)
log->Printf("NativeProcessDarwin::%s(): the inferior "
"task has exited, and so will we...",
@@ -534,10 +531,8 @@ void *NativeProcessDarwin::DoExceptionThread() {
// TODO: change SBSWatchdogAssertionRelease to SBSWatchdogAssertionCancel
// when we
// all are up and running on systems that support it. The SBS framework has
- // a #define
- // that will forward SBSWatchdogAssertionRelease to
- // SBSWatchdogAssertionCancel for now
- // so it should still build either way.
+ // a #define that will forward SBSWatchdogAssertionRelease to
+ // SBSWatchdogAssertionCancel for now so it should still build either way.
DNBLogThreadedIf(LOG_TASK, "::SBSWatchdogAssertionRelease(%p)",
watchdog.get());
::SBSWatchdogAssertionRelease(watchdog.get());
@@ -728,8 +723,8 @@ task_t NativeProcessDarwin::ExceptionMessageBundleComplete() {
const int signo = m_exception_messages[i].state.SoftSignal();
if (signo == SIGTRAP) {
// SIGTRAP could mean that we exec'ed. We need to check the
- // dyld all_image_infos.infoArray to see if it is NULL and if
- // so, say that we exec'ed.
+ // dyld all_image_infos.infoArray to see if it is NULL and if so, say
+ // that we exec'ed.
const addr_t aii_addr = GetDYLDAllImageInfosAddress(error);
if (aii_addr == LLDB_INVALID_ADDRESS)
break;
@@ -744,12 +739,12 @@ task_t NativeProcessDarwin::ExceptionMessageBundleComplete() {
bytes_read); // #bytes read
if (read_error.Success() && (bytes_read == 4)) {
if (info_array_count == 0) {
- // We got the all infos address, and there are zero
- // entries. We think we exec'd.
+ // We got the all infos address, and there are zero entries. We
+ // think we exec'd.
m_did_exec = true;
- // Force the task port to update itself in case the
- // task port changed after exec
+ // Force the task port to update itself in case the task port
+ // changed after exec
const task_t old_task = m_task;
const bool force_update = true;
const task_t new_task = TaskPortForProcessID(error, force_update);
@@ -810,8 +805,7 @@ task_t NativeProcessDarwin::ExceptionMessageBundleComplete() {
// 4 - We might need to resume if we stopped only with the
// interrupt signal that we never handled.
if (m_auto_resume_signo != 0) {
- // Only auto_resume if we stopped with _only_ the interrupt
- // signal.
+ // Only auto_resume if we stopped with _only_ the interrupt signal.
if (num_task_exceptions == 1) {
auto_resume = true;
if (log)
@@ -831,8 +825,8 @@ task_t NativeProcessDarwin::ExceptionMessageBundleComplete() {
}
}
- // Let all threads recover from stopping and do any clean up based
- // on the previous thread state (if any).
+ // Let all threads recover from stopping and do any clean up based on the
+ // previous thread state (if any).
m_thread_list.ProcessDidStop(*this);
// Let each thread know of any exceptions
@@ -863,8 +857,8 @@ task_t NativeProcessDarwin::ExceptionMessageBundleComplete() {
// TODO - need to hook up event system here. !!!!
#if 0
// Wait for the eEventProcessRunningStateChanged event to be reset
- // before changing state to stopped to avoid race condition with
- // very fast start/stops.
+ // before changing state to stopped to avoid race condition with very
+ // fast start/stops.
struct timespec timeout;
//DNBTimer::OffsetTimeOfDay(&timeout, 0, 250 * 1000); // Wait for 250 ms
@@ -889,12 +883,12 @@ Status NativeProcessDarwin::StartWaitpidThread(MainLoop &main_loop) {
Status error;
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- // Strategy: create a thread that sits on waitpid(), waiting for the
- // inferior process to die, reaping it in the process. Arrange for
- // the thread to have a pipe file descriptor that it can send a byte
- // over when the waitpid completes. Have the main loop have a read
- // object for the other side of the pipe, and have the callback for
- // the read do the process termination message sending.
+ // Strategy: create a thread that sits on waitpid(), waiting for the inferior
+ // process to die, reaping it in the process. Arrange for the thread to have
+ // a pipe file descriptor that it can send a byte over when the waitpid
+ // completes. Have the main loop have a read object for the other side of
+ // the pipe, and have the callback for the read do the process termination
+ // message sending.
// Create a single-direction communication channel.
const bool child_inherits = false;
@@ -1025,8 +1019,8 @@ void *NativeProcessDarwin::DoWaitpidThread() {
}
}
- // We should never exit as long as our child process is alive. If we
- // get here, something completely unexpected went wrong and we should exit.
+ // We should never exit as long as our child process is alive. If we get
+ // here, something completely unexpected went wrong and we should exit.
if (log)
log->Printf(
"NativeProcessDarwin::%s(): internal error: waitpid thread "
@@ -1157,8 +1151,8 @@ task_t NativeProcessDarwin::TaskPortForProcessID(Status &error,
::usleep(usec_interval);
}
- // We failed to get the task for the inferior process.
- // Ensure that it is cleared out.
+ // We failed to get the task for the inferior process. Ensure that it is
+ // cleared out.
m_task = TASK_NULL;
}
return m_task;
@@ -1196,9 +1190,9 @@ Status NativeProcessDarwin::PrivateResume() {
}
// bool stepOverBreakInstruction = step;
- // Let the thread prepare to resume and see if any threads want us to
- // step over a breakpoint instruction (ProcessWillResume will modify
- // the value of stepOverBreakInstruction).
+ // Let the thread prepare to resume and see if any threads want us to step
+ // over a breakpoint instruction (ProcessWillResume will modify the value of
+ // stepOverBreakInstruction).
m_thread_list.ProcessWillResume(*this, m_thread_actions);
// Set our state accordingly
@@ -1254,8 +1248,8 @@ Status NativeProcessDarwin::ReplyToAllExceptions() {
error = message.Reply(m_pid, m_task, thread_reply_signal);
if (error.Fail() && log) {
- // We log any error here, but we don't stop the exception
- // response handling.
+ // We log any error here, but we don't stop the exception response
+ // handling.
log->Printf("NativeProcessDarwin::%s(): failed to reply to "
"exception: %s",
__FUNCTION__, error.AsCString());
@@ -1263,8 +1257,8 @@ Status NativeProcessDarwin::ReplyToAllExceptions() {
}
}
- // Erase all exception message as we should have used and replied
- // to them all already.
+ // Erase all exception message as we should have used and replied to them all
+ // already.
m_exception_messages.clear();
return error;
}
@@ -1292,8 +1286,8 @@ Status NativeProcessDarwin::ResumeTask() {
"0x%4.4x",
__FUNCTION__, m_task);
- // Get the BasicInfo struct to verify that we're suspended before we try
- // to resume the task.
+ // Get the BasicInfo struct to verify that we're suspended before we try to
+ // resume the task.
struct task_basic_info task_info;
error = GetTaskBasicInfo(m_task, &task_info);
if (error.Fail()) {
@@ -1304,9 +1298,8 @@ Status NativeProcessDarwin::ResumeTask() {
return error;
}
- // task_resume isn't counted like task_suspend calls are, so if the
- // task is not suspended, don't try and resume it since it is already
- // running
+ // task_resume isn't counted like task_suspend calls are, so if the task is
+ // not suspended, don't try and resume it since it is already running
if (task_info.suspend_count > 0) {
auto mach_err = ::task_resume(m_task);
error.SetError(mach_err, eErrorTypeMachKernel);
diff --git a/source/Plugins/Process/Darwin/NativeProcessDarwin.h b/source/Plugins/Process/Darwin/NativeProcessDarwin.h
index 649280c17a8f..0b186fd7d80c 100644
--- a/source/Plugins/Process/Darwin/NativeProcessDarwin.h
+++ b/source/Plugins/Process/Darwin/NativeProcessDarwin.h
@@ -43,10 +43,10 @@ class Scalar;
namespace process_darwin {
/// @class NativeProcessDarwin
-/// @brief Manages communication with the inferior (debugee) process.
+/// Manages communication with the inferior (debugee) process.
///
-/// Upon construction, this class prepares and launches an inferior
-/// process for debugging.
+/// Upon construction, this class prepares and launches an inferior process
+/// for debugging.
///
/// Changes in the inferior process state are broadcasted.
class NativeProcessDarwin : public NativeProcessProtocol {
@@ -205,10 +205,10 @@ private:
// -----------------------------------------------------------------
/// Finalize the launch.
///
- /// This method associates the NativeProcessDarwin instance with
- /// the host process that was just launched. It peforms actions
- /// like attaching a listener to the inferior exception port,
- /// ptracing the process, and the like.
+ /// This method associates the NativeProcessDarwin instance with the host
+ /// process that was just launched. It peforms actions like attaching a
+ /// listener to the inferior exception port, ptracing the process, and the
+ /// like.
///
/// @param[in] launch_flavor
/// The launch flavor that was used to launch the process.
@@ -263,8 +263,8 @@ private:
task_t TaskPortForProcessID(Status &error, bool force = false) const;
- /// Attaches to an existing process. Forms the
- /// implementation of Process::DoAttach.
+ /// Attaches to an existing process. Forms the implementation of
+ /// Process::DoAttach.
void AttachToInferior(MainLoop &mainloop, lldb::pid_t pid, Status &error);
::pid_t Attach(lldb::pid_t pid, Status &error);
@@ -323,8 +323,8 @@ private:
Status GetSignalInfo(lldb::tid_t tid, void *siginfo);
/// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG)
- /// corresponding to the given thread ID to the memory pointed to
- /// by @p message.
+ /// corresponding to the given thread ID to the memory pointed to by @p
+ /// message.
Status GetEventMessage(lldb::tid_t tid, unsigned long *message);
void NotifyThreadDeath(lldb::tid_t tid);
diff --git a/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp b/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp
index 07398ab7b678..521c6d5c8fd0 100644
--- a/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp
+++ b/source/Plugins/Process/Darwin/NativeThreadDarwin.cpp
@@ -30,8 +30,8 @@ uint64_t NativeThreadDarwin::GetGloballyUniqueThreadIDForMachPortID(
(thread_info_t)&tident, &tident_count);
if (mach_err != KERN_SUCCESS) {
// When we fail to get thread info for the supposed port, assume it is
- // really a globally unique thread id already, or return the best thing
- // we can, which is the thread port.
+ // really a globally unique thread id already, or return the best thing we
+ // can, which is the thread port.
return mach_port_id;
}
return tident.thread_id;
@@ -47,9 +47,9 @@ NativeThreadDarwin::NativeThreadDarwin(NativeProcessDarwin *process,
bool NativeThreadDarwin::GetIdentifierInfo() {
// Don't try to get the thread info once and cache it for the life of the
- // thread. It changes over time, for instance
- // if the thread name changes, then the thread_handle also changes... So you
- // have to refetch it every time.
+ // thread. It changes over time, for instance if the thread name changes,
+ // then the thread_handle also changes... So you have to refetch it every
+ // time.
mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT;
kern_return_t kret = ::thread_info(m_mach_thread_port, THREAD_IDENTIFIER_INFO,
(thread_info_t)&m_ident_info, &count);
@@ -137,16 +137,16 @@ bool NativeThreadDarwin::NotifyException(MachException::Data &exc) {
// TODO implement this.
#if 0
// Allow the arch specific protocol to process (MachException::Data &)exc
- // first before possible reassignment of m_stop_exception with exc.
- // See also MachThread::GetStopException().
+ // first before possible reassignment of m_stop_exception with exc. See
+ // also MachThread::GetStopException().
bool handled = m_arch_ap->NotifyException(exc);
if (m_stop_exception.IsValid())
{
// We may have more than one exception for a thread, but we need to
- // only remember the one that we will say is the reason we stopped.
- // We may have been single stepping and also gotten a signal exception,
- // so just remember the most pertinent one.
+ // only remember the one that we will say is the reason we stopped. We
+ // may have been single stepping and also gotten a signal exception, so
+ // just remember the most pertinent one.
if (m_stop_exception.IsBreakpoint())
m_stop_exception = exc;
}
@@ -170,8 +170,8 @@ bool NativeThreadDarwin::ShouldStop(bool &step_more) const {
if (bp)
{
- // This thread is sitting at a breakpoint, ask the breakpoint
- // if we should be stopping here.
+ // This thread is sitting at a breakpoint, ask the breakpoint if we
+ // should be stopping here.
return true;
}
else
@@ -181,11 +181,10 @@ bool NativeThreadDarwin::ShouldStop(bool &step_more) const {
step_more = true;
return false;
}
- // The thread state is used to let us know what the thread was
- // trying to do. MachThread::ThreadWillResume() will set the
- // thread state to various values depending if the thread was
- // the current thread and if it was to be single stepped, or
- // resumed.
+ // The thread state is used to let us know what the thread was trying
+ // to do. MachThread::ThreadWillResume() will set the thread state to
+ // various values depending if the thread was the current thread and if
+ // it was to be single stepped, or resumed.
if (GetState() == eStateRunning)
{
// If our state is running, then we should continue as we are in
@@ -194,8 +193,7 @@ bool NativeThreadDarwin::ShouldStop(bool &step_more) const {
}
else
{
- // Stop if we have any kind of valid exception for this
- // thread.
+ // Stop if we have any kind of valid exception for this thread.
if (GetStopException().IsValid())
return true;
}
@@ -209,17 +207,17 @@ bool NativeThreadDarwin::ShouldStop(bool &step_more) const {
void NativeThreadDarwin::ThreadDidStop() {
// TODO implement this.
#if 0
- // This thread has existed prior to resuming under debug nub control,
- // and has just been stopped. Do any cleanup that needs to be done
- // after running.
+ // This thread has existed prior to resuming under debug nub control, and
+ // has just been stopped. Do any cleanup that needs to be done after
+ // running.
- // The thread state and breakpoint will still have the same values
- // as they had prior to resuming the thread, so it makes it easy to check
- // if we were trying to step a thread, or we tried to resume while being
- // at a breakpoint.
+ // The thread state and breakpoint will still have the same values as they
+ // had prior to resuming the thread, so it makes it easy to check if we
+ // were trying to step a thread, or we tried to resume while being at a
+ // breakpoint.
- // When this method gets called, the process state is still in the
- // state it was in while running so we can act accordingly.
+ // When this method gets called, the process state is still in the state it
+ // was in while running so we can act accordingly.
m_arch_ap->ThreadDidStop();
diff --git a/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp b/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp
index 7d44adeec375..4ff662e42097 100644
--- a/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp
+++ b/source/Plugins/Process/Darwin/NativeThreadListDarwin.cpp
@@ -308,8 +308,8 @@ uint32_t NativeThreadListDarwin::UpdateThreadList(NativeProcessDarwin &process,
__FUNCTION__, process.GetID(), update, process.GetStopID());
if (process.GetStopID() == 0) {
- // On our first stop, we'll record details like 32/64 bitness and
- // select the proper architecture implementation.
+ // On our first stop, we'll record details like 32/64 bitness and select
+ // the proper architecture implementation.
//
int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)process.GetID()};
@@ -358,9 +358,9 @@ uint32_t NativeThreadListDarwin::UpdateThreadList(NativeProcessDarwin &process,
if (thread_list_count > 0) {
collection currThreads;
size_t idx;
- // Iterator through the current thread list and see which threads
- // we already have in our list (keep them), which ones we don't
- // (add them), and which ones are not around anymore (remove them).
+ // Iterator through the current thread list and see which threads we
+ // already have in our list (keep them), which ones we don't (add them),
+ // and which ones are not around anymore (remove them).
for (idx = 0; idx < thread_list_count; ++idx) {
// Get the Mach thread port.
const ::thread_t mach_port_num = thread_list[idx];
@@ -373,18 +373,18 @@ uint32_t NativeThreadListDarwin::UpdateThreadList(NativeProcessDarwin &process,
// Retrieve the thread if it exists.
auto thread_sp = GetThreadByID(unique_thread_id);
if (thread_sp) {
- // We are already tracking it. Keep the existing native
- // thread instance.
+ // We are already tracking it. Keep the existing native thread
+ // instance.
currThreads.push_back(thread_sp);
} else {
- // We don't have a native thread instance for this thread.
- // Create it now.
+ // We don't have a native thread instance for this thread. Create it
+ // now.
thread_sp.reset(new NativeThreadDarwin(
&process, m_is_64_bit, unique_thread_id, mach_port_num));
- // Add the new thread regardless of its is user ready state.
- // Make sure the thread is ready to be displayed and shown
- // to users before we add this thread to our list...
+ // Add the new thread regardless of its is user ready state. Make
+ // sure the thread is ready to be displayed and shown to users before
+ // we add this thread to our list...
if (thread_sp->IsUserReady()) {
if (new_threads)
new_threads->push_back(thread_sp);
@@ -417,9 +417,9 @@ NativeThreadListDarwin::CurrentThread (MachThreadSP& thread_sp)
PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
if (m_current_thread.get() == NULL)
{
- // Figure out which thread is going to be our current thread.
- // This is currently done by finding the first thread in the list
- // that has a valid exception.
+ // Figure out which thread is going to be our current thread. This is
+ // currently done by finding the first thread in the list that has a
+ // valid exception.
const size_t num_threads = m_threads.size();
for (uint32_t idx = 0; idx < num_threads; ++idx)
{
@@ -455,8 +455,8 @@ void NativeThreadListDarwin::ProcessWillResume(
NativeProcessDarwin &process, const ResumeActionList &thread_actions) {
std::lock_guard<std::recursive_mutex> locker(m_threads_mutex);
- // Update our thread list, because sometimes libdispatch or the kernel
- // will spawn threads while a task is suspended.
+ // Update our thread list, because sometimes libdispatch or the kernel will
+ // spawn threads while a task is suspended.
NativeThreadListDarwin::collection new_threads;
// TODO implement this.
@@ -489,7 +489,8 @@ void NativeThreadListDarwin::ProcessWillResume(
#if 0
DNBThreadResumeAction resume_new_threads = { -1U, eStateRunning, 0, INVALID_NUB_ADDRESS };
- // If we are planning to run only one thread, any new threads should be suspended.
+ // If we are planning to run only one thread, any new threads should be
+ // suspended.
if (run_one_thread)
resume_new_threads.state = eStateSuspended;
@@ -549,11 +550,11 @@ uint32_t NativeThreadListDarwin::ProcessDidStop(NativeProcessDarwin &process) {
}
//----------------------------------------------------------------------
-// Check each thread in our thread list to see if we should notify our
-// client of the current halt in execution.
+// Check each thread in our thread list to see if we should notify our client
+// of the current halt in execution.
//
-// Breakpoints can have callback functions associated with them than
-// can return true to stop, or false to continue executing the inferior.
+// Breakpoints can have callback functions associated with them than can return
+// true to stop, or false to continue executing the inferior.
//
// RETURNS
// true if we should stop and notify our clients
@@ -607,8 +608,9 @@ NativeThreadListDarwin::DisableHardwareBreakpoint (const DNBBreakpoint* bp) cons
return false;
}
-// DNBWatchpointSet() -> MachProcess::CreateWatchpoint() -> MachProcess::EnableWatchpoint()
-// -> NativeThreadListDarwin::EnableHardwareWatchpoint().
+// DNBWatchpointSet() -> MachProcess::CreateWatchpoint() ->
+// MachProcess::EnableWatchpoint() ->
+// NativeThreadListDarwin::EnableHardwareWatchpoint().
uint32_t
NativeThreadListDarwin::EnableHardwareWatchpoint (const DNBBreakpoint* wp) const
{
@@ -617,14 +619,16 @@ NativeThreadListDarwin::EnableHardwareWatchpoint (const DNBBreakpoint* wp) const
{
PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
const size_t num_threads = m_threads.size();
- // On Mac OS X we have to prime the control registers for new threads. We do this
- // using the control register data for the first thread, for lack of a better way of choosing.
+ // On Mac OS X we have to prime the control registers for new threads.
+ // We do this using the control register data for the first thread, for
+ // lack of a better way of choosing.
bool also_set_on_task = true;
for (uint32_t idx = 0; idx < num_threads; ++idx)
{
if ((hw_index = m_threads[idx]->EnableHardwareWatchpoint(wp, also_set_on_task)) == INVALID_NUB_HW_INDEX)
{
- // We know that idx failed for some reason. Let's rollback the transaction for [0, idx).
+ // We know that idx failed for some reason. Let's rollback the
+ // transaction for [0, idx).
for (uint32_t i = 0; i < idx; ++i)
m_threads[i]->RollbackTransForHWP();
return INVALID_NUB_HW_INDEX;
@@ -647,14 +651,16 @@ NativeThreadListDarwin::DisableHardwareWatchpoint (const DNBBreakpoint* wp) cons
PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
const size_t num_threads = m_threads.size();
- // On Mac OS X we have to prime the control registers for new threads. We do this
- // using the control register data for the first thread, for lack of a better way of choosing.
+ // On Mac OS X we have to prime the control registers for new threads.
+ // We do this using the control register data for the first thread, for
+ // lack of a better way of choosing.
bool also_set_on_task = true;
for (uint32_t idx = 0; idx < num_threads; ++idx)
{
if (!m_threads[idx]->DisableHardwareWatchpoint(wp, also_set_on_task))
{
- // We know that idx failed for some reason. Let's rollback the transaction for [0, idx).
+ // We know that idx failed for some reason. Let's rollback the
+ // transaction for [0, idx).
for (uint32_t i = 0; i < idx; ++i)
m_threads[i]->RollbackTransForHWP();
return false;
@@ -675,7 +681,8 @@ NativeThreadListDarwin::NumSupportedHardwareWatchpoints () const
{
PTHREAD_MUTEX_LOCKER (locker, m_threads_mutex);
const size_t num_threads = m_threads.size();
- // Use an arbitrary thread to retrieve the number of supported hardware watchpoints.
+ // Use an arbitrary thread to retrieve the number of supported hardware
+ // watchpoints.
if (num_threads)
return m_threads[0]->NumSupportedHardwareWatchpoints();
return 0;
diff --git a/source/Plugins/Process/FreeBSD/CMakeLists.txt b/source/Plugins/Process/FreeBSD/CMakeLists.txt
index 63855992d708..c8301f350e07 100644
--- a/source/Plugins/Process/FreeBSD/CMakeLists.txt
+++ b/source/Plugins/Process/FreeBSD/CMakeLists.txt
@@ -1,7 +1,3 @@
-include_directories(.)
-include_directories(../POSIX)
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessFreeBSD PLUGIN
ProcessFreeBSD.cpp
FreeBSDThread.cpp
diff --git a/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp b/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
index e6557c2d58e0..3576a7f26f86 100644
--- a/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
+++ b/source/Plugins/Process/FreeBSD/FreeBSDThread.cpp
@@ -57,7 +57,7 @@ using namespace lldb_private;
FreeBSDThread::FreeBSDThread(Process &process, lldb::tid_t tid)
: Thread(process, tid), m_frame_ap(), m_breakpoint(),
- m_thread_name_valid(false), m_thread_name(), m_posix_thread(NULL) {
+ m_thread_name_valid(false), m_thread_name(), m_posix_thread(nullptr) {
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD));
LLDB_LOGV(log, "tid = {0}", tid);
@@ -69,15 +69,15 @@ FreeBSDThread::FreeBSDThread(Process &process, lldb::tid_t tid)
for (uint32_t wp_idx = 0; wp_idx < wp_size; wp_idx++) {
lldb::WatchpointSP wp = wp_list.GetByIndex(wp_idx);
if (wp.get() && wp->IsEnabled()) {
- // This watchpoint as been enabled; obviously this "new" thread
- // has been created since that watchpoint was enabled. Since
- // the POSIXBreakpointProtocol has yet to be initialized, its
- // m_watchpoints_initialized member will be FALSE. Attempting to
- // read the debug status register to determine if a watchpoint
- // has been hit would result in the zeroing of that register.
- // Since the active debug registers would have been cloned when
- // this thread was created, simply force the m_watchpoints_initized
- // member to TRUE and avoid resetting dr6 and dr7.
+ // This watchpoint as been enabled; obviously this "new" thread has been
+ // created since that watchpoint was enabled. Since the
+ // POSIXBreakpointProtocol has yet to be initialized, its
+ // m_watchpoints_initialized member will be FALSE. Attempting to read
+ // the debug status register to determine if a watchpoint has been hit
+ // would result in the zeroing of that register. Since the active debug
+ // registers would have been cloned when this thread was created, simply
+ // force the m_watchpoints_initized member to TRUE and avoid resetting
+ // dr6 and dr7.
GetPOSIXBreakpointProtocol()->ForceWatchpointsInitialized();
}
}
@@ -98,16 +98,15 @@ void FreeBSDThread::RefreshStateAfterStop() {
// context by the time this function gets called. The KDPRegisterContext
// class has been made smart enough to detect when it needs to invalidate
// which registers are valid by putting hooks in the register read and
- // register supply functions where they check the process stop ID and do
- // the right thing.
- // if (StateIsStoppedState(GetState())
+ // register supply functions where they check the process stop ID and do the
+ // right thing. if (StateIsStoppedState(GetState())
{
const bool force = false;
GetRegisterContext()->InvalidateIfNeeded(force);
}
}
-const char *FreeBSDThread::GetInfo() { return NULL; }
+const char *FreeBSDThread::GetInfo() { return nullptr; }
void FreeBSDThread::SetName(const char *name) {
m_thread_name_valid = (name && name[0]);
@@ -158,15 +157,15 @@ const char *FreeBSDThread::GetName() {
}
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
lldb::RegisterContextSP FreeBSDThread::GetRegisterContext() {
if (!m_reg_context_sp) {
- m_posix_thread = NULL;
+ m_posix_thread = nullptr;
- RegisterInfoInterface *reg_interface = NULL;
+ RegisterInfoInterface *reg_interface = nullptr;
const ArchSpec &target_arch = GetProcess()->GetTarget().GetArchitecture();
assert(target_arch.GetTriple().getOS() == llvm::Triple::FreeBSD);
@@ -282,7 +281,7 @@ bool FreeBSDThread::CalculateStopInfo() {
}
Unwind *FreeBSDThread::GetUnwinder() {
- if (m_unwinder_ap.get() == NULL)
+ if (!m_unwinder_ap)
m_unwinder_ap.reset(new UnwindLLDB(*this));
return m_unwinder_ap.get();
@@ -469,22 +468,19 @@ void FreeBSDThread::BreakNotify(const ProcessMessage &message) {
GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
// If the breakpoint is for this thread, then we'll report the hit, but if it
- // is for another thread,
- // we create a stop reason with should_stop=false. If there is no breakpoint
- // location, then report
- // an invalid stop reason. We don't need to worry about stepping over the
- // breakpoint here, that will
- // be taken care of when the thread resumes and notices that there's a
+ // is for another thread, we create a stop reason with should_stop=false. If
+ // there is no breakpoint location, then report an invalid stop reason. We
+ // don't need to worry about stepping over the breakpoint here, that will be
+ // taken care of when the thread resumes and notices that there's a
// breakpoint under the pc.
if (bp_site) {
lldb::break_id_t bp_id = bp_site->GetID();
// If we have an operating system plug-in, we might have set a thread
- // specific breakpoint using the
- // operating system thread ID, so we can't make any assumptions about the
- // thread ID so we must always
- // report the breakpoint regardless of the thread.
+ // specific breakpoint using the operating system thread ID, so we can't
+ // make any assumptions about the thread ID so we must always report the
+ // breakpoint regardless of the thread.
if (bp_site->ValidForThisThread(this) ||
- GetProcess()->GetOperatingSystem() != NULL)
+ GetProcess()->GetOperatingSystem() != nullptr)
SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(*this, bp_id));
else {
const bool should_stop = false;
@@ -541,15 +537,14 @@ void FreeBSDThread::TraceNotify(const ProcessMessage &message) {
lldb::BreakpointSiteSP bp_site(
GetProcess()->GetBreakpointSiteList().FindByAddress(pc));
- // If the current pc is a breakpoint site then set the StopInfo to Breakpoint.
- // Otherwise, set the StopInfo to Watchpoint or Trace.
- // If we have an operating system plug-in, we might have set a thread specific
- // breakpoint using the
- // operating system thread ID, so we can't make any assumptions about the
- // thread ID so we must always
- // report the breakpoint regardless of the thread.
+ // If the current pc is a breakpoint site then set the StopInfo to
+ // Breakpoint. Otherwise, set the StopInfo to Watchpoint or Trace. If we have
+ // an operating system plug-in, we might have set a thread specific
+ // breakpoint using the operating system thread ID, so we can't make any
+ // assumptions about the thread ID so we must always report the breakpoint
+ // regardless of the thread.
if (bp_site && (bp_site->ValidForThisThread(this) ||
- GetProcess()->GetOperatingSystem() != NULL))
+ GetProcess()->GetOperatingSystem() != nullptr))
SetStopInfo(StopInfo::CreateStopReasonWithBreakpointSiteID(
*this, bp_site->GetID()));
else {
diff --git a/source/Plugins/Process/FreeBSD/FreeBSDThread.h b/source/Plugins/Process/FreeBSD/FreeBSDThread.h
index 72e846459552..c93cc4fbfd73 100644
--- a/source/Plugins/Process/FreeBSD/FreeBSDThread.h
+++ b/source/Plugins/Process/FreeBSD/FreeBSDThread.h
@@ -24,7 +24,7 @@ class POSIXBreakpointProtocol;
//------------------------------------------------------------------------------
// @class FreeBSDThread
-// @brief Abstraction of a FreeBSD thread.
+// Abstraction of a FreeBSD thread.
class FreeBSDThread : public lldb_private::Thread {
public:
//------------------------------------------------------------------
diff --git a/source/Plugins/Process/FreeBSD/POSIXStopInfo.h b/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
index 96861852b38e..ff3693107170 100644
--- a/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
+++ b/source/Plugins/Process/FreeBSD/POSIXStopInfo.h
@@ -17,7 +17,7 @@
//===----------------------------------------------------------------------===//
/// @class POSIXStopInfo
-/// @brief Simple base class for all POSIX-specific StopInfo objects.
+/// Simple base class for all POSIX-specific StopInfo objects.
///
class POSIXStopInfo : public lldb_private::StopInfo {
public:
@@ -27,7 +27,7 @@ public:
//===----------------------------------------------------------------------===//
/// @class POSIXLimboStopInfo
-/// @brief Represents the stop state of a process ready to exit.
+/// Represents the stop state of a process ready to exit.
///
class POSIXLimboStopInfo : public POSIXStopInfo {
public:
@@ -46,7 +46,7 @@ public:
//===----------------------------------------------------------------------===//
/// @class POSIXNewThreadStopInfo
-/// @brief Represents the stop state of process when a new thread is spawned.
+/// Represents the stop state of process when a new thread is spawned.
///
class POSIXNewThreadStopInfo : public POSIXStopInfo {
diff --git a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
index 7a937db49be0..fa0bcea8f6bd 100644
--- a/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
+++ b/source/Plugins/Process/FreeBSD/ProcessFreeBSD.cpp
@@ -357,10 +357,10 @@ ProcessFreeBSD::GetFileSpec(const lldb_private::FileAction *file_action,
if (file_action && file_action->GetAction() == FileAction::eFileActionOpen) {
file_spec = file_action->GetFileSpec();
- // By default the stdio paths passed in will be pseudo-terminal
- // (/dev/pts). If so, convert to using a different default path
- // instead to redirect I/O to the debugger console. This should
- // also handle user overrides to /dev/null or a different file.
+ // By default the stdio paths passed in will be pseudo-terminal (/dev/pts).
+ // If so, convert to using a different default path instead to redirect I/O
+ // to the debugger console. This should also handle user overrides to
+ // /dev/null or a different file.
if (!file_spec || file_spec == dbg_pts_file_spec)
file_spec = default_file_spec;
}
@@ -407,9 +407,8 @@ Status ProcessFreeBSD::DoLaunch(Module *module,
m_monitor = new ProcessMonitor(
this, module, launch_info.GetArguments().GetConstArgumentVector(),
- launch_info.GetEnvironmentEntries().GetConstArgumentVector(),
- stdin_file_spec, stdout_file_spec, stderr_file_spec, working_dir,
- launch_info, error);
+ launch_info.GetEnvironment(), stdin_file_spec, stdout_file_spec,
+ stderr_file_spec, working_dir, launch_info, error);
m_module = module;
@@ -656,19 +655,19 @@ ProcessFreeBSD::GetSoftwareBreakpointTrapOpcode(BreakpointSite *bp_site) {
break;
case llvm::Triple::arm: {
- // The ARM reference recommends the use of 0xe7fddefe and 0xdefe
- // but the linux kernel does otherwise.
+ // The ARM reference recommends the use of 0xe7fddefe and 0xdefe but the
+ // linux kernel does otherwise.
static const uint8_t g_arm_breakpoint_opcode[] = {0xf0, 0x01, 0xf0, 0xe7};
static const uint8_t g_thumb_breakpoint_opcode[] = {0x01, 0xde};
lldb::BreakpointLocationSP bp_loc_sp(bp_site->GetOwnerAtIndex(0));
- AddressClass addr_class = eAddressClassUnknown;
+ AddressClass addr_class = AddressClass::eUnknown;
if (bp_loc_sp)
addr_class = bp_loc_sp->GetAddress().GetAddressClass();
- if (addr_class == eAddressClassCodeAlternateISA ||
- (addr_class == eAddressClassUnknown &&
+ if (addr_class == AddressClass::eCodeAlternateISA ||
+ (addr_class == AddressClass::eUnknown &&
bp_loc_sp->GetAddress().GetOffset() & 1)) {
opcode = g_thumb_breakpoint_opcode;
opcode_size = sizeof(g_thumb_breakpoint_opcode);
@@ -745,8 +744,8 @@ Status ProcessFreeBSD::EnableWatchpoint(Watchpoint *wp, bool notify) {
wp->SetEnabled(true, notify);
return error;
} else {
- // Watchpoint enabling failed on at least one
- // of the threads so roll back all of them
+ // Watchpoint enabling failed on at least one of the threads so roll
+ // back all of them
DisableWatchpoint(wp, false);
error.SetErrorString("Setting hardware watchpoint failed");
}
@@ -813,8 +812,8 @@ Status ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num) {
Status ProcessFreeBSD::GetWatchpointSupportInfo(uint32_t &num, bool &after) {
Status error = GetWatchpointSupportInfo(num);
- // Watchpoints trigger and halt the inferior after
- // the corresponding instruction has been executed.
+ // Watchpoints trigger and halt the inferior after the corresponding
+ // instruction has been executed.
after = true;
return error;
}
@@ -1077,8 +1076,8 @@ Status ProcessFreeBSD::SetupSoftwareSingleStepping(lldb::tid_t tid) {
"Emulation was successful but PC wasn't updated");
next_pc = pc_it->second.GetAsUInt64();
} else if (pc_it == baton.m_register_values.end()) {
- // Emulate instruction failed and it haven't changed PC. Advance PC
- // with the size of the current opcode because the emulation of all
+ // Emulate instruction failed and it haven't changed PC. Advance PC with
+ // the size of the current opcode because the emulation of all
// PC modifying instruction should be successful. The failure most
// likely caused by a not supported instruction which don't modify PC.
next_pc =
diff --git a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
index bd06fa25f0a0..51fdf2e5ef33 100644
--- a/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
+++ b/source/Plugins/Process/FreeBSD/ProcessMonitor.cpp
@@ -38,15 +38,11 @@
#include "ProcessFreeBSD.h"
#include "ProcessMonitor.h"
-extern "C" {
-extern char **environ;
-}
-
using namespace lldb;
using namespace lldb_private;
-// We disable the tracing of ptrace calls for integration builds to
-// avoid the additional indirection and checks.
+// We disable the tracing of ptrace calls for integration builds to avoid the
+// additional indirection and checks.
#ifndef LLDB_CONFIGURATION_BUILDANDINTEGRATION
// Wrapper for ptrace to catch errors and log calls.
@@ -65,9 +61,8 @@ const char *Get_PT_IO_OP(int op) {
}
}
-// Wrapper for ptrace to catch errors and log calls.
-// Note that ptrace sets errno on error because -1 is reserved as a valid
-// result.
+// Wrapper for ptrace to catch errors and log calls. Note that ptrace sets
+// errno on error because -1 is reserved as a valid result.
extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data,
const char *reqName, const char *file, int line) {
long int result;
@@ -134,8 +129,8 @@ extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data,
return result;
}
-// Wrapper for ptrace when logging is not required.
-// Sets errno to 0 prior to calling ptrace.
+// Wrapper for ptrace when logging is not required. Sets errno to 0 prior to
+// calling ptrace.
extern long PtraceWrapper(int req, lldb::pid_t pid, void *addr, int data) {
long result = 0;
errno = 0;
@@ -163,8 +158,10 @@ static size_t DoReadMemory(lldb::pid_t pid, lldb::addr_t vm_addr, void *buf,
pi_desc.piod_addr = buf;
pi_desc.piod_len = size;
- if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0)
+ if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) {
error.SetErrorToErrno();
+ return 0;
+ }
return pi_desc.piod_len;
}
@@ -177,8 +174,10 @@ static size_t DoWriteMemory(lldb::pid_t pid, lldb::addr_t vm_addr,
pi_desc.piod_addr = (void *)buf;
pi_desc.piod_len = size;
- if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0)
+ if (PTRACE(PT_IO, pid, (caddr_t)&pi_desc, 0) < 0) {
error.SetErrorToErrno();
+ return 0;
+ }
return pi_desc.piod_len;
}
@@ -202,15 +201,16 @@ static bool EnsureFDFlags(int fd, int flags, Status &error) {
//------------------------------------------------------------------------------
/// @class Operation
-/// @brief Represents a ProcessMonitor operation.
+/// Represents a ProcessMonitor operation.
///
-/// Under FreeBSD, it is not possible to ptrace() from any other thread but the
-/// one that spawned or attached to the process from the start. Therefore, when
-/// a ProcessMonitor is asked to deliver or change the state of an inferior
-/// process the operation must be "funneled" to a specific thread to perform the
-/// task. The Operation class provides an abstract base for all services the
-/// ProcessMonitor must perform via the single virtual function Execute, thus
-/// encapsulating the code that needs to run in the privileged context.
+/// Under FreeBSD, it is not possible to ptrace() from any other thread but
+/// the one that spawned or attached to the process from the start.
+/// Therefore, when a ProcessMonitor is asked to deliver or change the state
+/// of an inferior process the operation must be "funneled" to a specific
+/// thread to perform the task. The Operation class provides an abstract base
+/// for all services the ProcessMonitor must perform via the single virtual
+/// function Execute, thus encapsulating the code that needs to run in the
+/// privileged context.
class Operation {
public:
virtual ~Operation() {}
@@ -219,7 +219,7 @@ public:
//------------------------------------------------------------------------------
/// @class ReadOperation
-/// @brief Implements ProcessMonitor::ReadMemory.
+/// Implements ProcessMonitor::ReadMemory.
class ReadOperation : public Operation {
public:
ReadOperation(lldb::addr_t addr, void *buff, size_t size, Status &error,
@@ -245,7 +245,7 @@ void ReadOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class WriteOperation
-/// @brief Implements ProcessMonitor::WriteMemory.
+/// Implements ProcessMonitor::WriteMemory.
class WriteOperation : public Operation {
public:
WriteOperation(lldb::addr_t addr, const void *buff, size_t size,
@@ -271,7 +271,7 @@ void WriteOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ReadRegOperation
-/// @brief Implements ProcessMonitor::ReadRegisterValue.
+/// Implements ProcessMonitor::ReadRegisterValue.
class ReadRegOperation : public Operation {
public:
ReadRegOperation(lldb::tid_t tid, unsigned offset, unsigned size,
@@ -311,7 +311,7 @@ void ReadRegOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class WriteRegOperation
-/// @brief Implements ProcessMonitor::WriteRegisterValue.
+/// Implements ProcessMonitor::WriteRegisterValue.
class WriteRegOperation : public Operation {
public:
WriteRegOperation(lldb::tid_t tid, unsigned offset,
@@ -344,7 +344,7 @@ void WriteRegOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ReadDebugRegOperation
-/// @brief Implements ProcessMonitor::ReadDebugRegisterValue.
+/// Implements ProcessMonitor::ReadDebugRegisterValue.
class ReadDebugRegOperation : public Operation {
public:
ReadDebugRegOperation(lldb::tid_t tid, unsigned offset, unsigned size,
@@ -379,7 +379,7 @@ void ReadDebugRegOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class WriteDebugRegOperation
-/// @brief Implements ProcessMonitor::WriteDebugRegisterValue.
+/// Implements ProcessMonitor::WriteDebugRegisterValue.
class WriteDebugRegOperation : public Operation {
public:
WriteDebugRegOperation(lldb::tid_t tid, unsigned offset,
@@ -412,7 +412,7 @@ void WriteDebugRegOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ReadGPROperation
-/// @brief Implements ProcessMonitor::ReadGPR.
+/// Implements ProcessMonitor::ReadGPR.
class ReadGPROperation : public Operation {
public:
ReadGPROperation(lldb::tid_t tid, void *buf, bool &result)
@@ -439,7 +439,7 @@ void ReadGPROperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ReadFPROperation
-/// @brief Implements ProcessMonitor::ReadFPR.
+/// Implements ProcessMonitor::ReadFPR.
class ReadFPROperation : public Operation {
public:
ReadFPROperation(lldb::tid_t tid, void *buf, bool &result)
@@ -462,7 +462,7 @@ void ReadFPROperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class WriteGPROperation
-/// @brief Implements ProcessMonitor::WriteGPR.
+/// Implements ProcessMonitor::WriteGPR.
class WriteGPROperation : public Operation {
public:
WriteGPROperation(lldb::tid_t tid, void *buf, bool &result)
@@ -485,7 +485,7 @@ void WriteGPROperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class WriteFPROperation
-/// @brief Implements ProcessMonitor::WriteFPR.
+/// Implements ProcessMonitor::WriteFPR.
class WriteFPROperation : public Operation {
public:
WriteFPROperation(lldb::tid_t tid, void *buf, bool &result)
@@ -508,7 +508,7 @@ void WriteFPROperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ResumeOperation
-/// @brief Implements ProcessMonitor::Resume.
+/// Implements ProcessMonitor::Resume.
class ResumeOperation : public Operation {
public:
ResumeOperation(uint32_t signo, bool &result)
@@ -539,7 +539,7 @@ void ResumeOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class SingleStepOperation
-/// @brief Implements ProcessMonitor::SingleStep.
+/// Implements ProcessMonitor::SingleStep.
class SingleStepOperation : public Operation {
public:
SingleStepOperation(uint32_t signo, bool &result)
@@ -567,7 +567,7 @@ void SingleStepOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class LwpInfoOperation
-/// @brief Implements ProcessMonitor::GetLwpInfo.
+/// Implements ProcessMonitor::GetLwpInfo.
class LwpInfoOperation : public Operation {
public:
LwpInfoOperation(lldb::tid_t tid, void *info, bool &result, int &ptrace_err)
@@ -596,7 +596,7 @@ void LwpInfoOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class ThreadSuspendOperation
-/// @brief Implements ProcessMonitor::ThreadSuspend.
+/// Implements ProcessMonitor::ThreadSuspend.
class ThreadSuspendOperation : public Operation {
public:
ThreadSuspendOperation(lldb::tid_t tid, bool suspend, bool &result)
@@ -616,7 +616,7 @@ void ThreadSuspendOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class EventMessageOperation
-/// @brief Implements ProcessMonitor::GetEventMessage.
+/// Implements ProcessMonitor::GetEventMessage.
class EventMessageOperation : public Operation {
public:
EventMessageOperation(lldb::tid_t tid, unsigned long *message, bool &result)
@@ -646,7 +646,7 @@ void EventMessageOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class KillOperation
-/// @brief Implements ProcessMonitor::Kill.
+/// Implements ProcessMonitor::Kill.
class KillOperation : public Operation {
public:
KillOperation(bool &result) : m_result(result) {}
@@ -668,7 +668,7 @@ void KillOperation::Execute(ProcessMonitor *monitor) {
//------------------------------------------------------------------------------
/// @class DetachOperation
-/// @brief Implements ProcessMonitor::Detach.
+/// Implements ProcessMonitor::Detach.
class DetachOperation : public Operation {
public:
DetachOperation(Status &result) : m_error(result) {}
@@ -695,13 +695,14 @@ ProcessMonitor::OperationArgs::~OperationArgs() { sem_destroy(&m_semaphore); }
ProcessMonitor::LaunchArgs::LaunchArgs(ProcessMonitor *monitor,
lldb_private::Module *module,
- char const **argv, char const **envp,
+ char const **argv, Environment env,
const FileSpec &stdin_file_spec,
const FileSpec &stdout_file_spec,
const FileSpec &stderr_file_spec,
const FileSpec &working_dir)
- : OperationArgs(monitor), m_module(module), m_argv(argv), m_envp(envp),
- m_stdin_file_spec(stdin_file_spec), m_stdout_file_spec(stdout_file_spec),
+ : OperationArgs(monitor), m_module(module), m_argv(argv),
+ m_env(std::move(env)), m_stdin_file_spec(stdin_file_spec),
+ m_stdout_file_spec(stdout_file_spec),
m_stderr_file_spec(stderr_file_spec), m_working_dir(working_dir) {}
ProcessMonitor::LaunchArgs::~LaunchArgs() {}
@@ -714,11 +715,10 @@ ProcessMonitor::AttachArgs::~AttachArgs() {}
//------------------------------------------------------------------------------
/// The basic design of the ProcessMonitor is built around two threads.
///
-/// One thread (@see SignalThread) simply blocks on a call to waitpid() looking
-/// for changes in the debugee state. When a change is detected a
+/// One thread (@see SignalThread) simply blocks on a call to waitpid()
+/// looking for changes in the debugee state. When a change is detected a
/// ProcessMessage is sent to the associated ProcessFreeBSD instance. This
-/// thread
-/// "drives" state changes in the debugger.
+/// thread "drives" state changes in the debugger.
///
/// The second thread (@see OperationThread) is responsible for two things 1)
/// launching or attaching to the inferior process, and then 2) servicing
@@ -726,7 +726,7 @@ ProcessMonitor::AttachArgs::~AttachArgs() {}
/// on the Operation class for more info as to why this is needed.
ProcessMonitor::ProcessMonitor(
ProcessFreeBSD *process, Module *module, const char *argv[],
- const char *envp[], const FileSpec &stdin_file_spec,
+ Environment env, const FileSpec &stdin_file_spec,
const FileSpec &stdout_file_spec, const FileSpec &stderr_file_spec,
const FileSpec &working_dir,
const lldb_private::ProcessLaunchInfo & /* launch_info */,
@@ -736,7 +736,7 @@ ProcessMonitor::ProcessMonitor(
using namespace std::placeholders;
std::unique_ptr<LaunchArgs> args(
- new LaunchArgs(this, module, argv, envp, stdin_file_spec,
+ new LaunchArgs(this, module, argv, std::move(env), stdin_file_spec,
stdout_file_spec, stderr_file_spec, working_dir));
sem_init(&m_operation_pending, 0, 0);
@@ -837,7 +837,6 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {
ProcessMonitor *monitor = args->m_monitor;
ProcessFreeBSD &process = monitor->GetProcess();
const char **argv = args->m_argv;
- const char **envp = args->m_envp;
const FileSpec &stdin_file_spec = args->m_stdin_file_spec;
const FileSpec &stdout_file_spec = args->m_stdout_file_spec;
const FileSpec &stderr_file_spec = args->m_stderr_file_spec;
@@ -849,8 +848,8 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {
::pid_t pid;
// Propagate the environment if one is not supplied.
- if (envp == NULL || envp[0] == NULL)
- envp = const_cast<const char **>(environ);
+ Environment::Envp envp =
+ (args->m_env.empty() ? Host::GetEnvironment() : args->m_env).getEnvp();
if ((pid = terminal.Fork(err_str, err_len)) == -1) {
args->m_error.SetErrorToGenericError();
@@ -875,9 +874,9 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {
if (PTRACE(PT_TRACE_ME, 0, NULL, 0) < 0)
exit(ePtraceFailed);
- // terminal has already dupped the tty descriptors to stdin/out/err.
- // This closes original fd from which they were copied (and avoids
- // leaking descriptors to the debugged process.
+ // terminal has already dupped the tty descriptors to stdin/out/err. This
+ // closes original fd from which they were copied (and avoids leaking
+ // descriptors to the debugged process.
terminal.CloseSlaveFileDescriptor();
// Do not inherit setgid powers.
@@ -908,8 +907,7 @@ bool ProcessMonitor::Launch(LaunchArgs *args) {
exit(eChdirFailed);
// Execute. We should never return.
- execve(argv[0], const_cast<char *const *>(argv),
- const_cast<char *const *>(envp));
+ execve(argv[0], const_cast<char *const *>(argv), envp);
exit(eExecFailed);
}
@@ -1103,9 +1101,9 @@ ProcessMessage ProcessMonitor::MonitorSIGTRAP(ProcessMonitor *monitor,
break;
case (SIGTRAP /* | (PTRACE_EVENT_EXIT << 8) */): {
- // The inferior process is about to exit. Maintain the process in a
- // state of "limbo" until we are explicitly commanded to detach,
- // destroy, resume, etc.
+ // The inferior process is about to exit. Maintain the process in a state
+ // of "limbo" until we are explicitly commanded to detach, destroy, resume,
+ // etc.
unsigned long data = 0;
if (!monitor->GetEventMessage(tid, &data))
data = -1;
@@ -1160,8 +1158,8 @@ ProcessMessage ProcessMonitor::MonitorSignal(ProcessMonitor *monitor,
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
// POSIX says that process behaviour is undefined after it ignores a SIGFPE,
- // SIGILL, SIGSEGV, or SIGBUS *unless* that signal was generated by a
- // kill(2) or raise(3). Similarly for tgkill(2) on FreeBSD.
+ // SIGILL, SIGSEGV, or SIGBUS *unless* that signal was generated by a kill(2)
+ // or raise(3). Similarly for tgkill(2) on FreeBSD.
//
// IOW, user generated signals never generate what we consider to be a
// "crash".
@@ -1197,8 +1195,8 @@ ProcessMessage ProcessMonitor::MonitorSignal(ProcessMonitor *monitor,
} // else; Use atleast si_signo info for other si_code
}
- // Everything else is "normal" and does not require any special action on
- // our part.
+ // Everything else is "normal" and does not require any special action on our
+ // part.
return ProcessMessage::Signal(tid, signo);
}
@@ -1424,14 +1422,14 @@ void ProcessMonitor::StopMonitor() {
}
// FIXME: On Linux, when a new thread is created, we receive to notifications,
-// (1) a SIGTRAP|PTRACE_EVENT_CLONE from the main process thread with the
-// child thread id as additional information, and (2) a SIGSTOP|SI_USER from
-// the new child thread indicating that it has is stopped because we attached.
-// We have no guarantee of the order in which these arrive, but we need both
-// before we are ready to proceed. We currently keep a list of threads which
-// have sent the initial SIGSTOP|SI_USER event. Then when we receive the
-// SIGTRAP|PTRACE_EVENT_CLONE notification, if the initial stop has not occurred
-// we call ProcessMonitor::WaitForInitialTIDStop() to wait for it.
+// (1) a SIGTRAP|PTRACE_EVENT_CLONE from the main process thread with the child
+// thread id as additional information, and (2) a SIGSTOP|SI_USER from the new
+// child thread indicating that it has is stopped because we attached. We have
+// no guarantee of the order in which these arrive, but we need both before we
+// are ready to proceed. We currently keep a list of threads which have sent
+// the initial SIGSTOP|SI_USER event. Then when we receive the
+// SIGTRAP|PTRACE_EVENT_CLONE notification, if the initial stop has not
+// occurred we call ProcessMonitor::WaitForInitialTIDStop() to wait for it.
//
// Right now, the above logic is in ProcessPOSIX, so we need a definition of
// this function in the FreeBSD ProcessMonitor implementation even if it isn't
diff --git a/source/Plugins/Process/FreeBSD/ProcessMonitor.h b/source/Plugins/Process/FreeBSD/ProcessMonitor.h
index 0963453a31b1..1d3e2d746fa9 100644
--- a/source/Plugins/Process/FreeBSD/ProcessMonitor.h
+++ b/source/Plugins/Process/FreeBSD/ProcessMonitor.h
@@ -32,10 +32,10 @@ class ProcessFreeBSD;
class Operation;
/// @class ProcessMonitor
-/// @brief Manages communication with the inferior (debugee) process.
+/// Manages communication with the inferior (debugee) process.
///
-/// Upon construction, this class prepares and launches an inferior process for
-/// debugging.
+/// Upon construction, this class prepares and launches an inferior process
+/// for debugging.
///
/// Changes in the inferior process state are propagated to the associated
/// ProcessFreeBSD instance by calling ProcessFreeBSD::SendMessage with the
@@ -48,7 +48,7 @@ public:
/// Launches an inferior process ready for debugging. Forms the
/// implementation of Process::DoLaunch.
ProcessMonitor(ProcessFreeBSD *process, lldb_private::Module *module,
- char const *argv[], char const *envp[],
+ char const *argv[], lldb_private::Environment env,
const lldb_private::FileSpec &stdin_file_spec,
const lldb_private::FileSpec &stdout_file_spec,
const lldb_private::FileSpec &stderr_file_spec,
@@ -74,8 +74,7 @@ public:
/// standard error of this debugee. Even if stderr and stdout were
/// redirected on launch it may still happen that data is available on this
/// descriptor (if the inferior process opens /dev/tty, for example). This
- /// descriptor is
- /// closed after a call to StopMonitor().
+ /// descriptor is closed after a call to StopMonitor().
///
/// If this monitor was attached to an existing process this method returns
/// -1.
@@ -95,8 +94,8 @@ public:
size_t WriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size,
lldb_private::Status &error);
- /// Reads the contents from the register identified by the given (architecture
- /// dependent) offset.
+ /// Reads the contents from the register identified by the given
+ /// (architecture dependent) offset.
///
/// This method is provided for use by RegisterContextFreeBSD derivatives.
bool ReadRegisterValue(lldb::tid_t tid, unsigned offset, const char *reg_name,
@@ -215,11 +214,11 @@ private:
/// @class LauchArgs
///
- /// @brief Simple structure to pass data to the thread responsible for
- /// launching a child process.
+ /// Simple structure to pass data to the thread responsible for launching a
+ /// child process.
struct LaunchArgs : OperationArgs {
LaunchArgs(ProcessMonitor *monitor, lldb_private::Module *module,
- char const **argv, char const **envp,
+ char const **argv, lldb_private::Environment env,
const lldb_private::FileSpec &stdin_file_spec,
const lldb_private::FileSpec &stdout_file_spec,
const lldb_private::FileSpec &stderr_file_spec,
@@ -229,7 +228,7 @@ private:
lldb_private::Module *m_module; // The executable image to launch.
char const **m_argv; // Process arguments.
- char const **m_envp; // Process environment.
+ lldb_private::Environment m_env; // Process environment.
const lldb_private::FileSpec m_stdin_file_spec; // Redirect stdin or empty.
const lldb_private::FileSpec
m_stdout_file_spec; // Redirect stdout or empty.
diff --git a/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h b/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h
index 4ff5121bac13..b1b44e71de46 100644
--- a/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h
+++ b/source/Plugins/Process/FreeBSD/RegisterContextPOSIX.h
@@ -13,14 +13,14 @@
// C Includes
// C++ Includes
// Other libraries and framework includes
-#include "RegisterInfoInterface.h"
+#include "Plugins/Process/Utility/RegisterInfoInterface.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Utility/ArchSpec.h"
//------------------------------------------------------------------------------
/// @class POSIXBreakpointProtocol
///
-/// @brief Extends RegisterClass with a few virtual operations useful on POSIX.
+/// Extends RegisterClass with a few virtual operations useful on POSIX.
class POSIXBreakpointProtocol {
public:
POSIXBreakpointProtocol() { m_watchpoints_initialized = false; }
diff --git a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
index 59d42b9ad72e..8ddc253aea5d 100644
--- a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
+++ b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_arm.cpp
@@ -14,7 +14,7 @@
#include "ProcessFreeBSD.h"
#include "ProcessMonitor.h"
#include "RegisterContextPOSIXProcessMonitor_arm.h"
-#include "RegisterContextPOSIX_arm.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_arm.h"
using namespace lldb_private;
using namespace lldb;
diff --git a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
index b911ee222015..734167e1fc98 100644
--- a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
+++ b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_mips64.cpp
@@ -130,14 +130,14 @@ bool RegisterContextPOSIXProcessMonitor_mips64::ReadRegister(
bool success = ReadRegister(full_reg, value);
if (success) {
- // If our read was not aligned (for ah,bh,ch,dh), shift our returned value
- // one byte to the right.
+ // If our read was not aligned (for ah,bh,ch,dh), shift our returned
+ // value one byte to the right.
if (is_subreg && (reg_info->byte_offset & 0x1))
value.SetUInt64(value.GetAsUInt64() >> 8);
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (value.GetByteSize() > reg_info->byte_size)
value.SetType(reg_info);
}
diff --git a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
index bc1d4df89fc8..5cc6cd290629 100644
--- a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
+++ b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_powerpc.cpp
@@ -14,7 +14,7 @@
#include "ProcessFreeBSD.h"
#include "ProcessMonitor.h"
#include "RegisterContextPOSIXProcessMonitor_powerpc.h"
-#include "RegisterContextPOSIX_powerpc.h"
+#include "Plugins/Process/Utility/RegisterContextPOSIX_powerpc.h"
using namespace lldb_private;
using namespace lldb;
@@ -140,8 +140,8 @@ bool RegisterContextPOSIXProcessMonitor_powerpc::ReadRegister(
if (success) {
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (value.GetByteSize() > reg_info->byte_size)
value.SetType(reg_info);
}
diff --git a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
index 4608520dba40..7db7f803b371 100644
--- a/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
+++ b/source/Plugins/Process/FreeBSD/RegisterContextPOSIXProcessMonitor_x86.cpp
@@ -193,14 +193,14 @@ bool RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister(
bool success = ReadRegister(full_reg, value);
if (success) {
- // If our read was not aligned (for ah,bh,ch,dh), shift our returned value
- // one byte to the right.
+ // If our read was not aligned (for ah,bh,ch,dh), shift our returned
+ // value one byte to the right.
if (is_subreg && (reg_info->byte_offset & 0x1))
value.SetUInt64(value.GetAsUInt64() >> 8);
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (value.GetByteSize() > reg_info->byte_size)
value.SetType(reg_info);
}
@@ -221,7 +221,8 @@ bool RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister(
value.SetBytes(m_fpr.fxsave.xmm[reg - m_reg_info.first_xmm].bytes,
reg_info->byte_size, byte_order);
if (reg >= m_reg_info.first_ymm && reg <= m_reg_info.last_ymm) {
- // Concatenate ymm using the register halves in xmm.bytes and ymmh.bytes
+ // Concatenate ymm using the register halves in xmm.bytes and
+ // ymmh.bytes
if (GetFPRType() == eXSAVE && CopyXSTATEtoYMM(reg, byte_order))
value.SetBytes(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
reg_info->byte_size, byte_order);
@@ -233,11 +234,10 @@ bool RegisterContextPOSIXProcessMonitor_x86_64::ReadRegister(
return false;
}
- // Get pointer to m_fpr.fxsave variable and set the data from it.
- // Byte offsets of all registers are calculated wrt 'UserArea' structure.
- // However, ReadFPR() reads fpu registers {using ptrace(PT_GETFPREGS,..)}
- // and stores them in 'm_fpr' (of type FPR structure). To extract values of
- // fpu
+ // Get pointer to m_fpr.fxsave variable and set the data from it. Byte
+ // offsets of all registers are calculated wrt 'UserArea' structure. However,
+ // ReadFPR() reads fpu registers {using ptrace(PT_GETFPREGS,..)} and stores
+ // them in 'm_fpr' (of type FPR structure). To extract values of fpu
// registers, m_fpr should be read at byte offsets calculated wrt to FPR
// structure.
@@ -299,12 +299,12 @@ bool RegisterContextPOSIXProcessMonitor_x86_64::WriteRegister(
return false;
}
} else {
- // Get pointer to m_fpr.fxsave variable and set the data to it.
- // Byte offsets of all registers are calculated wrt 'UserArea' structure.
- // However, WriteFPR() takes m_fpr (of type FPR structure) and writes only
- // fpu
- // registers using ptrace(PT_SETFPREGS,..) API. Hence fpu registers should
- // be written in m_fpr at byte offsets calculated wrt FPR structure.
+ // Get pointer to m_fpr.fxsave variable and set the data to it. Byte
+ // offsets of all registers are calculated wrt 'UserArea' structure.
+ // However, WriteFPR() takes m_fpr (of type FPR structure) and writes
+ // only fpu registers using ptrace(PT_SETFPREGS,..) API. Hence fpu
+ // registers should be written in m_fpr at byte offsets calculated wrt
+ // FPR structure.
// Since, FPR structure is also one of the member of UserArea structure.
// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) -
diff --git a/source/Plugins/Process/Linux/CMakeLists.txt b/source/Plugins/Process/Linux/CMakeLists.txt
index 390dbd9ff8bf..b4b4c401a271 100644
--- a/source/Plugins/Process/Linux/CMakeLists.txt
+++ b/source/Plugins/Process/Linux/CMakeLists.txt
@@ -1,7 +1,3 @@
-include_directories(.)
-include_directories(../POSIX)
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessLinux PLUGIN
NativeProcessLinux.cpp
NativeRegisterContextLinux.cpp
diff --git a/source/Plugins/Process/Linux/NativeProcessLinux.cpp b/source/Plugins/Process/Linux/NativeProcessLinux.cpp
index 136af361af29..3fb886e1c7a3 100644
--- a/source/Plugins/Process/Linux/NativeProcessLinux.cpp
+++ b/source/Plugins/Process/Linux/NativeProcessLinux.cpp
@@ -245,13 +245,15 @@ NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info,
}
LLDB_LOG(log, "inferior started, now in stopped state");
- ArchSpec arch;
- if ((status = ResolveProcessArchitecture(pid, arch)).Fail())
- return status.ToError();
+ ProcessInstanceInfo Info;
+ if (!Host::GetProcessInfo(pid, Info)) {
+ return llvm::make_error<StringError>("Cannot get process architecture",
+ llvm::inconvertibleErrorCode());
+ }
// Set the architecture to the exe architecture.
LLDB_LOG(log, "pid = {0:x}, detected architecture {1}", pid,
- arch.GetArchitectureName());
+ Info.GetArchitecture().GetArchitectureName());
status = SetDefaultPtraceOpts(pid);
if (status.Fail()) {
@@ -261,7 +263,7 @@ NativeProcessLinux::Factory::Launch(ProcessLaunchInfo &launch_info,
return std::unique_ptr<NativeProcessLinux>(new NativeProcessLinux(
pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate,
- arch, mainloop, {pid}));
+ Info.GetArchitecture(), mainloop, {pid}));
}
llvm::Expected<std::unique_ptr<NativeProcessProtocol>>
@@ -272,17 +274,18 @@ NativeProcessLinux::Factory::Attach(
LLDB_LOG(log, "pid = {0:x}", pid);
// Retrieve the architecture for the running process.
- ArchSpec arch;
- Status status = ResolveProcessArchitecture(pid, arch);
- if (!status.Success())
- return status.ToError();
+ ProcessInstanceInfo Info;
+ if (!Host::GetProcessInfo(pid, Info)) {
+ return llvm::make_error<StringError>("Cannot get process architecture",
+ llvm::inconvertibleErrorCode());
+ }
auto tids_or = NativeProcessLinux::Attach(pid);
if (!tids_or)
return tids_or.takeError();
return std::unique_ptr<NativeProcessLinux>(new NativeProcessLinux(
- pid, -1, native_delegate, arch, mainloop, *tids_or));
+ pid, -1, native_delegate, Info.GetArchitecture(), mainloop, *tids_or));
}
// -----------------------------------------------------------------------------
@@ -334,8 +337,8 @@ llvm::Expected<std::vector<::pid_t>> NativeProcessLinux::Attach(::pid_t pid) {
// Attach to the requested process.
// An attach will cause the thread to stop with a SIGSTOP.
if ((status = PtraceWrapper(PTRACE_ATTACH, tid)).Fail()) {
- // No such thread. The thread may have exited.
- // More error handling may be needed.
+ // No such thread. The thread may have exited. More error handling
+ // may be needed.
if (status.GetError() == ESRCH) {
it = tids_to_attach.erase(it);
continue;
@@ -345,11 +348,11 @@ llvm::Expected<std::vector<::pid_t>> NativeProcessLinux::Attach(::pid_t pid) {
int wpid =
llvm::sys::RetryAfterSignal(-1, ::waitpid, tid, nullptr, __WALL);
- // Need to use __WALL otherwise we receive an error with errno=ECHLD
- // At this point we should have a thread stopped if waitpid succeeds.
+ // Need to use __WALL otherwise we receive an error with errno=ECHLD At
+ // this point we should have a thread stopped if waitpid succeeds.
if (wpid < 0) {
- // No such thread. The thread may have exited.
- // More error handling may be needed.
+ // No such thread. The thread may have exited. More error handling
+ // may be needed.
if (errno == ESRCH) {
it = tids_to_attach.erase(it);
continue;
@@ -394,8 +397,8 @@ Status NativeProcessLinux::SetDefaultPtraceOpts(lldb::pid_t pid) {
// appropriate ptrace flags here (PTRACE_O_TRACEFORK, PTRACE_O_TRACEVFORK)
ptrace_opts |= PTRACE_O_TRACECLONE;
- // Have the tracer notify us before execve returns
- // (needed to disable legacy SIGTRAP generation)
+ // Have the tracer notify us before execve returns (needed to disable legacy
+ // SIGTRAP generation)
ptrace_opts |= PTRACE_O_TRACEEXEC;
return PtraceWrapper(PTRACE_SETOPTIONS, pid, nullptr, (void *)ptrace_opts);
@@ -435,8 +438,8 @@ void NativeProcessLinux::MonitorCallback(lldb::pid_t pid, bool exited,
auto thread_sp = GetThreadByID(pid);
if (!thread_sp) {
- // Normally, the only situation when we cannot find the thread is if we have
- // just received a new thread notification. This is indicated by
+ // Normally, the only situation when we cannot find the thread is if we
+ // have just received a new thread notification. This is indicated by
// GetSignalInfo() returning si_code == SI_USER and si_pid == 0
LLDB_LOG(log, "received notification about an unknown tid {0}.", pid);
@@ -468,15 +471,15 @@ void NativeProcessLinux::MonitorCallback(lldb::pid_t pid, bool exited,
MonitorSignal(info, *thread_sp, exited);
} else {
if (info_err.GetError() == EINVAL) {
- // This is a group stop reception for this tid.
- // We can reach here if we reinject SIGSTOP, SIGSTP, SIGTTIN or SIGTTOU
- // into the tracee, triggering the group-stop mechanism. Normally
- // receiving these would stop the process, pending a SIGCONT. Simulating
- // this state in a debugger is hard and is generally not needed (one use
- // case is debugging background task being managed by a shell). For
- // general use, it is sufficient to stop the process in a signal-delivery
- // stop which happens before the group stop. This done by MonitorSignal
- // and works correctly for all signals.
+ // This is a group stop reception for this tid. We can reach here if we
+ // reinject SIGSTOP, SIGSTP, SIGTTIN or SIGTTOU into the tracee,
+ // triggering the group-stop mechanism. Normally receiving these would
+ // stop the process, pending a SIGCONT. Simulating this state in a
+ // debugger is hard and is generally not needed (one use case is
+ // debugging background task being managed by a shell). For general use,
+ // it is sufficient to stop the process in a signal-delivery stop which
+ // happens before the group stop. This done by MonitorSignal and works
+ // correctly for all signals.
LLDB_LOG(log,
"received a group stop for pid {0} tid {1}. Transparent "
"handling of group stops not supported, resuming the "
@@ -502,8 +505,8 @@ void NativeProcessLinux::MonitorCallback(lldb::pid_t pid, bool exited,
if (is_main_thread) {
// Notify the delegate - our process is not available but appears to
- // have been killed outside
- // our control. Is eStateExited the right exit state in this case?
+ // have been killed outside our control. Is eStateExited the right
+ // exit state in this case?
SetExitStatus(status, true);
SetState(StateType::eStateExited, true);
} else {
@@ -572,19 +575,14 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
switch (info.si_code) {
// TODO: these two cases are required if we want to support tracing of the
- // inferiors' children. We'd need this to debug a monitor.
- // case (SIGTRAP | (PTRACE_EVENT_FORK << 8)):
- // case (SIGTRAP | (PTRACE_EVENT_VFORK << 8)):
+ // inferiors' children. We'd need this to debug a monitor. case (SIGTRAP |
+ // (PTRACE_EVENT_FORK << 8)): case (SIGTRAP | (PTRACE_EVENT_VFORK << 8)):
case (SIGTRAP | (PTRACE_EVENT_CLONE << 8)): {
// This is the notification on the parent thread which informs us of new
- // thread
- // creation.
- // We don't want to do anything with the parent thread so we just resume it.
- // In case we
- // want to implement "break on thread creation" functionality, we would need
- // to stop
- // here.
+ // thread creation. We don't want to do anything with the parent thread so
+ // we just resume it. In case we want to implement "break on thread
+ // creation" functionality, we would need to stop here.
unsigned long event_message = 0;
if (GetEventMessage(thread.GetID(), &event_message).Fail()) {
@@ -634,10 +632,10 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
}
case (SIGTRAP | (PTRACE_EVENT_EXIT << 8)): {
- // The inferior process or one of its threads is about to exit.
- // We don't want to do anything with the thread so we just resume it. In
- // case we want to implement "break on thread exit" functionality, we would
- // need to stop here.
+ // The inferior process or one of its threads is about to exit. We don't
+ // want to do anything with the thread so we just resume it. In case we
+ // want to implement "break on thread exit" functionality, we would need to
+ // stop here.
unsigned long data = 0;
if (GetEventMessage(thread.GetID(), &data).Fail())
@@ -655,8 +653,8 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
// Due to a kernel bug, we may sometimes get this stop after the inferior
// gets a SIGKILL. This confuses our state tracking logic in
// ResumeThread(), since normally, we should not be receiving any ptrace
- // events while the inferior is stopped. This makes sure that the inferior
- // is resumed and exits normally.
+ // events while the inferior is stopped. This makes sure that the
+ // inferior is resumed and exits normally.
state = eStateRunning;
}
ResumeThread(thread, state, LLDB_INVALID_SIGNAL_NUMBER);
@@ -702,8 +700,8 @@ void NativeProcessLinux::MonitorSIGTRAP(const siginfo_t &info,
case SI_KERNEL:
#if defined __mips__
- // For mips there is no special signal for watchpoint
- // So we check for watchpoint in kernel trap
+ // For mips there is no special signal for watchpoint So we check for
+ // watchpoint in kernel trap
{
// If a watchpoint was hit, report it
uint32_t wp_index;
@@ -779,8 +777,8 @@ void NativeProcessLinux::MonitorWatchpoint(NativeThreadLinux &thread,
LLDB_LOG(log, "received watchpoint event, pid = {0}, wp_index = {1}",
thread.GetID(), wp_index);
- // Mark the thread as stopped at watchpoint.
- // The address is at (lldb::addr_t)info->si_addr if we need it.
+ // Mark the thread as stopped at watchpoint. The address is at
+ // (lldb::addr_t)info->si_addr if we need it.
thread.SetStoppedByWatchpoint(wp_index);
// We need to tell all other running threads before we notify the delegate
@@ -796,8 +794,8 @@ void NativeProcessLinux::MonitorSignal(const siginfo_t &info,
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
// POSIX says that process behaviour is undefined after it ignores a SIGFPE,
- // SIGILL, SIGSEGV, or SIGBUS *unless* that signal was generated by a
- // kill(2) or raise(3). Similarly for tgkill(2) on Linux.
+ // SIGILL, SIGSEGV, or SIGBUS *unless* that signal was generated by a kill(2)
+ // or raise(3). Similarly for tgkill(2) on Linux.
//
// IOW, user generated signals never generate what we consider to be a
// "crash".
@@ -816,22 +814,22 @@ void NativeProcessLinux::MonitorSignal(const siginfo_t &info,
// This is a tgkill()-based stop.
LLDB_LOG(log, "pid {0} tid {1}, thread stopped", GetID(), thread.GetID());
- // Check that we're not already marked with a stop reason.
- // Note this thread really shouldn't already be marked as stopped - if we
- // were, that would imply that the kernel signaled us with the thread
- // stopping which we handled and marked as stopped, and that, without an
- // intervening resume, we received another stop. It is more likely that we
- // are missing the marking of a run state somewhere if we find that the
- // thread was marked as stopped.
+ // Check that we're not already marked with a stop reason. Note this thread
+ // really shouldn't already be marked as stopped - if we were, that would
+ // imply that the kernel signaled us with the thread stopping which we
+ // handled and marked as stopped, and that, without an intervening resume,
+ // we received another stop. It is more likely that we are missing the
+ // marking of a run state somewhere if we find that the thread was marked
+ // as stopped.
const StateType thread_state = thread.GetState();
if (!StateIsStoppedState(thread_state, false)) {
// An inferior thread has stopped because of a SIGSTOP we have sent it.
// Generally, these are not important stops and we don't want to report
// them as they are just used to stop other threads when one thread (the
// one with the *real* stop reason) hits a breakpoint (watchpoint,
- // etc...). However, in the case of an asynchronous Interrupt(), this *is*
- // the real stop reason, so we leave the signal intact if this is the
- // thread that was chosen as the triggering thread.
+ // etc...). However, in the case of an asynchronous Interrupt(), this
+ // *is* the real stop reason, so we leave the signal intact if this is
+ // the thread that was chosen as the triggering thread.
if (m_pending_notification_tid != LLDB_INVALID_THREAD_ID) {
if (m_pending_notification_tid == thread.GetID())
thread.SetStoppedBySignal(SIGSTOP, &info);
@@ -860,8 +858,8 @@ void NativeProcessLinux::MonitorSignal(const siginfo_t &info,
return;
}
- // Check if debugger should stop at this signal or just ignore it
- // and resume the inferior.
+ // Check if debugger should stop at this signal or just ignore it and resume
+ // the inferior.
if (m_signals_to_ignore.find(signo) != m_signals_to_ignore.end()) {
ResumeThread(thread, thread.GetState(), signo);
return;
@@ -912,9 +910,9 @@ static bool ReadRegisterCallback(EmulateInstruction *instruction, void *baton,
return true;
}
- // The emulator only fill in the dwarf regsiter numbers (and in some case
- // the generic register numbers). Get the full register info from the
- // register context based on the dwarf register numbers.
+ // The emulator only fill in the dwarf regsiter numbers (and in some case the
+ // generic register numbers). Get the full register info from the register
+ // context based on the dwarf register numbers.
const RegisterInfo *full_reg_info =
emulator_baton->m_reg_context.GetRegisterInfo(
eRegisterKindDWARF, reg_info->kinds[eRegisterKindDWARF]);
@@ -998,8 +996,8 @@ NativeProcessLinux::SetupSoftwareSingleStepping(NativeThreadLinux &thread) {
else
next_flags = ReadFlags(register_context);
} else if (pc_it == baton.m_register_values.end()) {
- // Emulate instruction failed and it haven't changed PC. Advance PC
- // with the size of the current opcode because the emulation of all
+ // Emulate instruction failed and it haven't changed PC. Advance PC with
+ // the size of the current opcode because the emulation of all
// PC modifying instruction should be successful. The failure most
// likely caused by a not supported instruction which don't modify PC.
next_pc = register_context.GetPC() + emulator_ap->GetOpcode().GetByteSize();
@@ -1030,8 +1028,8 @@ NativeProcessLinux::SetupSoftwareSingleStepping(NativeThreadLinux &thread) {
error = SetSoftwareBreakpoint(next_pc, 0);
}
- // If setting the breakpoint fails because next_pc is out of
- // the address space, ignore it and let the debugee segfault.
+ // If setting the breakpoint fails because next_pc is out of the address
+ // space, ignore it and let the debugee segfault.
if (error.GetError() == EIO || error.GetError() == EFAULT) {
return Status();
} else if (error.Fail())
@@ -1162,8 +1160,8 @@ Status NativeProcessLinux::Signal(int signo) {
}
Status NativeProcessLinux::Interrupt() {
- // Pick a running thread (or if none, a not-dead stopped thread) as
- // the chosen thread that will be the stop-reason thread.
+ // Pick a running thread (or if none, a not-dead stopped thread) as the
+ // chosen thread that will be the stop-reason thread.
Log *log(ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_PROCESS));
NativeThreadProtocol *running_thread = nullptr;
@@ -1171,15 +1169,15 @@ Status NativeProcessLinux::Interrupt() {
LLDB_LOG(log, "selecting running thread for interrupt target");
for (const auto &thread : m_threads) {
- // If we have a running or stepping thread, we'll call that the
- // target of the interrupt.
+ // If we have a running or stepping thread, we'll call that the target of
+ // the interrupt.
const auto thread_state = thread->GetState();
if (thread_state == eStateRunning || thread_state == eStateStepping) {
running_thread = thread.get();
break;
} else if (!stopped_thread && StateIsStoppedState(thread_state, true)) {
- // Remember the first non-dead stopped thread. We'll use that as a backup
- // if there are no running threads.
+ // Remember the first non-dead stopped thread. We'll use that as a
+ // backup if there are no running threads.
stopped_thread = thread.get();
}
}
@@ -1248,9 +1246,8 @@ ParseMemoryRegionInfoFromProcMapsLine(llvm::StringRef &maps_line,
StringExtractor line_extractor(maps_line);
// Format: {address_start_hex}-{address_end_hex} perms offset dev inode
- // pathname
- // perms: rwxp (letter is present if set, '-' if not, final character is
- // p=private, s=shared).
+ // pathname perms: rwxp (letter is present if set, '-' if not, final
+ // character is p=private, s=shared).
// Parse out the starting address
lldb::addr_t start_address = line_extractor.GetHexMaxU64(false, 0);
@@ -1331,8 +1328,8 @@ Status NativeProcessLinux::GetMemoryRegionInfo(lldb::addr_t load_addr,
// the virtual address space,
// with no perms if it is not mapped.
- // Use an approach that reads memory regions from /proc/{pid}/maps.
- // Assume proc maps entries are in ascending order.
+ // Use an approach that reads memory regions from /proc/{pid}/maps. Assume
+ // proc maps entries are in ascending order.
// FIXME assert if we find differently.
if (m_supports_mem_region == LazyBool::eLazyBoolNo) {
@@ -1383,10 +1380,8 @@ Status NativeProcessLinux::GetMemoryRegionInfo(lldb::addr_t load_addr,
}
// If we made it here, we didn't find an entry that contained the given
- // address. Return the
- // load_addr as start and the amount of bytes betwwen load address and the end
- // of the memory as
- // size.
+ // address. Return the load_addr as start and the amount of bytes betwwen
+ // load address and the end of the memory as size.
range_info.GetRange().SetRangeBase(load_addr);
range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
@@ -1431,8 +1426,8 @@ Status NativeProcessLinux::PopulateMemoryRegionCache() {
if (m_mem_region_cache.empty()) {
// No entries after attempting to read them. This shouldn't happen if
- // /proc/{pid}/maps is supported. Assume we don't support map entries
- // via procfs.
+ // /proc/{pid}/maps is supported. Assume we don't support map entries via
+ // procfs.
m_supports_mem_region = LazyBool::eLazyBoolNo;
LLDB_LOG(log,
"failed to find any procfs maps entries, assuming no support "
@@ -1459,8 +1454,8 @@ void NativeProcessLinux::DoStopIDBumped(uint32_t newBumpId) {
Status NativeProcessLinux::AllocateMemory(size_t size, uint32_t permissions,
lldb::addr_t &addr) {
// FIXME implementing this requires the equivalent of
-// InferiorCallPOSIX::InferiorCallMmap, which depends on
-// functional ThreadPlans working with Native*Protocol.
+// InferiorCallPOSIX::InferiorCallMmap, which depends on functional ThreadPlans
+// working with Native*Protocol.
#if 1
return Status("not implemented yet");
#else
@@ -1475,8 +1470,7 @@ Status NativeProcessLinux::AllocateMemory(size_t size, uint32_t permissions,
prot |= eMmapProtExec;
// TODO implement this directly in NativeProcessLinux
- // (and lift to NativeProcessPOSIX if/when that class is
- // refactored out).
+ // (and lift to NativeProcessPOSIX if/when that class is refactored out).
if (InferiorCallMmap(this, addr, 0, size, prot,
eMmapFlagsAnon | eMmapFlagsPrivate, -1, 0)) {
m_addr_to_mmap_size[addr] = size;
@@ -1502,10 +1496,9 @@ lldb::addr_t NativeProcessLinux::GetSharedLibraryInfoAddress() {
}
size_t NativeProcessLinux::UpdateThreads() {
- // The NativeProcessLinux monitoring threads are always up to date
- // with respect to thread state and they keep the thread list
- // populated properly. All this method needs to do is return the
- // thread count.
+ // The NativeProcessLinux monitoring threads are always up to date with
+ // respect to thread state and they keep the thread list populated properly.
+ // All this method needs to do is return the thread count.
return m_threads.size();
}
@@ -1515,7 +1508,6 @@ Status NativeProcessLinux::GetSoftwareBreakpointPCOffset(
// set per architecture. Need ARM, MIPS support here.
static const uint8_t g_i386_opcode[] = {0xCC};
static const uint8_t g_s390x_opcode[] = {0x00, 0x01};
- static const uint8_t g_ppc64le_opcode[] = {0x08, 0x00, 0xe0, 0x7f}; // trap
switch (m_arch.GetMachine()) {
case llvm::Triple::x86:
@@ -1527,16 +1519,13 @@ Status NativeProcessLinux::GetSoftwareBreakpointPCOffset(
actual_opcode_size = static_cast<uint32_t>(sizeof(g_s390x_opcode));
return Status();
- case llvm::Triple::ppc64le:
- actual_opcode_size = static_cast<uint32_t>(sizeof(g_ppc64le_opcode));
- return Status();
-
case llvm::Triple::arm:
case llvm::Triple::aarch64:
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
case llvm::Triple::mips:
case llvm::Triple::mipsel:
+ case llvm::Triple::ppc64le:
// On these architectures the PC don't get updated for breakpoint hits
actual_opcode_size = 0;
return Status();
@@ -1633,161 +1622,11 @@ Status NativeProcessLinux::GetSoftwareBreakpointTrapOpcode(
}
}
-#if 0
-ProcessMessage::CrashReason
-NativeProcessLinux::GetCrashReasonForSIGSEGV(const siginfo_t *info)
-{
- ProcessMessage::CrashReason reason;
- assert(info->si_signo == SIGSEGV);
-
- reason = ProcessMessage::eInvalidCrashReason;
-
- switch (info->si_code)
- {
- default:
- assert(false && "unexpected si_code for SIGSEGV");
- break;
- case SI_KERNEL:
- // Linux will occasionally send spurious SI_KERNEL codes.
- // (this is poorly documented in sigaction)
- // One way to get this is via unaligned SIMD loads.
- reason = ProcessMessage::eInvalidAddress; // for lack of anything better
- break;
- case SEGV_MAPERR:
- reason = ProcessMessage::eInvalidAddress;
- break;
- case SEGV_ACCERR:
- reason = ProcessMessage::ePrivilegedAddress;
- break;
- }
-
- return reason;
-}
-#endif
-
-#if 0
-ProcessMessage::CrashReason
-NativeProcessLinux::GetCrashReasonForSIGILL(const siginfo_t *info)
-{
- ProcessMessage::CrashReason reason;
- assert(info->si_signo == SIGILL);
-
- reason = ProcessMessage::eInvalidCrashReason;
-
- switch (info->si_code)
- {
- default:
- assert(false && "unexpected si_code for SIGILL");
- break;
- case ILL_ILLOPC:
- reason = ProcessMessage::eIllegalOpcode;
- break;
- case ILL_ILLOPN:
- reason = ProcessMessage::eIllegalOperand;
- break;
- case ILL_ILLADR:
- reason = ProcessMessage::eIllegalAddressingMode;
- break;
- case ILL_ILLTRP:
- reason = ProcessMessage::eIllegalTrap;
- break;
- case ILL_PRVOPC:
- reason = ProcessMessage::ePrivilegedOpcode;
- break;
- case ILL_PRVREG:
- reason = ProcessMessage::ePrivilegedRegister;
- break;
- case ILL_COPROC:
- reason = ProcessMessage::eCoprocessorError;
- break;
- case ILL_BADSTK:
- reason = ProcessMessage::eInternalStackError;
- break;
- }
-
- return reason;
-}
-#endif
-
-#if 0
-ProcessMessage::CrashReason
-NativeProcessLinux::GetCrashReasonForSIGFPE(const siginfo_t *info)
-{
- ProcessMessage::CrashReason reason;
- assert(info->si_signo == SIGFPE);
-
- reason = ProcessMessage::eInvalidCrashReason;
-
- switch (info->si_code)
- {
- default:
- assert(false && "unexpected si_code for SIGFPE");
- break;
- case FPE_INTDIV:
- reason = ProcessMessage::eIntegerDivideByZero;
- break;
- case FPE_INTOVF:
- reason = ProcessMessage::eIntegerOverflow;
- break;
- case FPE_FLTDIV:
- reason = ProcessMessage::eFloatDivideByZero;
- break;
- case FPE_FLTOVF:
- reason = ProcessMessage::eFloatOverflow;
- break;
- case FPE_FLTUND:
- reason = ProcessMessage::eFloatUnderflow;
- break;
- case FPE_FLTRES:
- reason = ProcessMessage::eFloatInexactResult;
- break;
- case FPE_FLTINV:
- reason = ProcessMessage::eFloatInvalidOperation;
- break;
- case FPE_FLTSUB:
- reason = ProcessMessage::eFloatSubscriptRange;
- break;
- }
-
- return reason;
-}
-#endif
-
-#if 0
-ProcessMessage::CrashReason
-NativeProcessLinux::GetCrashReasonForSIGBUS(const siginfo_t *info)
-{
- ProcessMessage::CrashReason reason;
- assert(info->si_signo == SIGBUS);
-
- reason = ProcessMessage::eInvalidCrashReason;
-
- switch (info->si_code)
- {
- default:
- assert(false && "unexpected si_code for SIGBUS");
- break;
- case BUS_ADRALN:
- reason = ProcessMessage::eIllegalAlignment;
- break;
- case BUS_ADRERR:
- reason = ProcessMessage::eIllegalAddress;
- break;
- case BUS_OBJERR:
- reason = ProcessMessage::eHardwareError;
- break;
- }
-
- return reason;
-}
-#endif
-
Status NativeProcessLinux::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
size_t &bytes_read) {
if (ProcessVmReadvSupported()) {
// The process_vm_readv path is about 50 times faster than ptrace api. We
- // want to use
- // this syscall if it is supported.
+ // want to use this syscall if it is supported.
const ::pid_t pid = GetID();
@@ -2094,12 +1933,11 @@ Status NativeProcessLinux::ResumeThread(NativeThreadLinux &thread,
Log *const log = ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD);
LLDB_LOG(log, "tid: {0}", thread.GetID());
- // Before we do the resume below, first check if we have a pending
- // stop notification that is currently waiting for
- // all threads to stop. This is potentially a buggy situation since
- // we're ostensibly waiting for threads to stop before we send out the
- // pending notification, and here we are resuming one before we send
- // out the pending stop notification.
+ // Before we do the resume below, first check if we have a pending stop
+ // notification that is currently waiting for all threads to stop. This is
+ // potentially a buggy situation since we're ostensibly waiting for threads
+ // to stop before we send out the pending notification, and here we are
+ // resuming one before we send out the pending stop notification.
if (m_pending_notification_tid != LLDB_INVALID_THREAD_ID) {
LLDB_LOG(log,
"about to resume tid {0} per explicit request but we have a "
@@ -2108,8 +1946,8 @@ Status NativeProcessLinux::ResumeThread(NativeThreadLinux &thread,
thread.GetID(), m_pending_notification_tid);
}
- // Request a resume. We expect this to be synchronous and the system
- // to reflect it is running after this completes.
+ // Request a resume. We expect this to be synchronous and the system to
+ // reflect it is running after this completes.
switch (state) {
case eStateRunning: {
const auto resume_result = thread.Resume(signo);
@@ -2138,8 +1976,8 @@ void NativeProcessLinux::StopRunningThreads(const lldb::tid_t triggering_tid) {
m_pending_notification_tid = triggering_tid;
- // Request a stop for all the thread stops that need to be stopped
- // and are not already known to be stopped.
+ // Request a stop for all the thread stops that need to be stopped and are
+ // not already known to be stopped.
for (const auto &thread : m_threads) {
if (StateIsRunningState(thread->GetState()))
static_cast<NativeThreadLinux *>(thread.get())->RequestStop();
@@ -2185,8 +2023,7 @@ void NativeProcessLinux::ThreadWasCreated(NativeThreadLinux &thread) {
if (m_pending_notification_tid != LLDB_INVALID_THREAD_ID &&
StateIsRunningState(thread.GetState())) {
// We will need to wait for this new thread to stop as well before firing
- // the
- // notification.
+ // the notification.
thread.RequestStop();
}
}
@@ -2222,9 +2059,8 @@ void NativeProcessLinux::SigchldHandler() {
}
}
-// Wrapper for ptrace to catch errors and log calls.
-// Note that ptrace sets errno on error because -1 can be a valid result (i.e.
-// for PTRACE_PEEK*)
+// Wrapper for ptrace to catch errors and log calls. Note that ptrace sets
+// errno on error because -1 can be a valid result (i.e. for PTRACE_PEEK*)
Status NativeProcessLinux::PtraceWrapper(int req, lldb::pid_t pid, void *addr,
void *data, size_t data_size,
long *result) {
@@ -2422,8 +2258,8 @@ Status NativeProcessLinux::StopTracingForThread(lldb::tid_t thread) {
}
if (iter->second->GetTraceID() == m_pt_proces_trace_id) {
- // traceid maps to the whole process so we have to erase it from the
- // thread group.
+ // traceid maps to the whole process so we have to erase it from the thread
+ // group.
LLDB_LOG(log, "traceid maps to process");
m_pt_traced_thread_group.erase(thread);
}
@@ -2474,8 +2310,8 @@ Status NativeProcessLinux::StopProcessorTracingOnThread(lldb::user_id_t traceid,
if (thread == LLDB_INVALID_THREAD_ID) {
for (auto& iter : m_processor_trace_monitor) {
if (iter.second->GetTraceID() == traceid) {
- // Stopping a trace instance for an individual thread
- // hence there will only be one traceid that can match.
+ // Stopping a trace instance for an individual thread hence there will
+ // only be one traceid that can match.
m_processor_trace_monitor.erase(iter.first);
return error;
}
@@ -2505,8 +2341,8 @@ Status NativeProcessLinux::StopProcessorTracingOnThread(lldb::user_id_t traceid,
LLDB_LOG(log, "UID - {0} , Thread -{1}", traceid, thread);
if (traceid == m_pt_proces_trace_id) {
- // traceid maps to the whole process so we have to erase it from the
- // thread group.
+ // traceid maps to the whole process so we have to erase it from the thread
+ // group.
LLDB_LOG(log, "traceid maps to process");
m_pt_traced_thread_group.erase(thread);
}
diff --git a/source/Plugins/Process/Linux/NativeProcessLinux.h b/source/Plugins/Process/Linux/NativeProcessLinux.h
index f078c1ac30e2..1c2f786e8d69 100644
--- a/source/Plugins/Process/Linux/NativeProcessLinux.h
+++ b/source/Plugins/Process/Linux/NativeProcessLinux.h
@@ -31,10 +31,10 @@ class Scalar;
namespace process_linux {
/// @class NativeProcessLinux
-/// @brief Manages communication with the inferior (debugee) process.
+/// Manages communication with the inferior (debugee) process.
///
-/// Upon construction, this class prepares and launches an inferior process for
-/// debugging.
+/// Upon construction, this class prepares and launches an inferior process
+/// for debugging.
///
/// Changes in the inferior process state are broadcasted.
class NativeProcessLinux : public NativeProcessProtocol {
@@ -184,20 +184,6 @@ private:
Status SetupSoftwareSingleStepping(NativeThreadLinux &thread);
-#if 0
- static ::ProcessMessage::CrashReason
- GetCrashReasonForSIGSEGV(const siginfo_t *info);
-
- static ::ProcessMessage::CrashReason
- GetCrashReasonForSIGILL(const siginfo_t *info);
-
- static ::ProcessMessage::CrashReason
- GetCrashReasonForSIGFPE(const siginfo_t *info);
-
- static ::ProcessMessage::CrashReason
- GetCrashReasonForSIGBUS(const siginfo_t *info);
-#endif
-
bool HasThreadNoLock(lldb::tid_t thread_id);
bool StopTrackingThread(lldb::tid_t thread_id);
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
index cb05416cb6c3..749291684620 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.cpp
@@ -184,14 +184,14 @@ NativeRegisterContextLinux_arm::ReadRegister(const RegisterInfo *reg_info,
error = ReadRegisterRaw(full_reg, reg_value);
if (error.Success()) {
- // If our read was not aligned (for ah,bh,ch,dh), shift our returned value
- // one byte to the right.
+ // If our read was not aligned (for ah,bh,ch,dh), shift our returned
+ // value one byte to the right.
if (is_subreg && (reg_info->byte_offset & 0x1))
reg_value.SetUInt64(reg_value.GetAsUInt64() >> 8);
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (reg_value.GetByteSize() > reg_info->byte_size)
reg_value.SetType(reg_info);
}
@@ -558,8 +558,8 @@ uint32_t NativeRegisterContextLinux_arm::SetHardwareWatchpoint(
uint32_t control_value = 0, wp_index = 0, addr_word_offset = 0, byte_mask = 0;
lldb::addr_t real_addr = addr;
- // Check if we are setting watchpoint other than read/write/access
- // Also update watchpoint flag to match Arm write-read bit configuration.
+ // Check if we are setting watchpoint other than read/write/access Also
+ // update watchpoint flag to match Arm write-read bit configuration.
switch (watch_flags) {
case 1:
watch_flags = 2;
@@ -579,9 +579,9 @@ uint32_t NativeRegisterContextLinux_arm::SetHardwareWatchpoint(
if (size == 0 || size > 4)
return LLDB_INVALID_INDEX32;
- // Check 4-byte alignment for hardware watchpoint target address.
- // Below is a hack to recalculate address and size in order to
- // make sure we can watch non 4-byte alligned addresses as well.
+ // Check 4-byte alignment for hardware watchpoint target address. Below is a
+ // hack to recalculate address and size in order to make sure we can watch
+ // non 4-byte alligned addresses as well.
if (addr & 0x03) {
uint8_t watch_mask = (addr & 0x03) + size;
@@ -874,12 +874,10 @@ Status NativeRegisterContextLinux_arm::DoReadRegisterValue(
uint32_t offset, const char *reg_name, uint32_t size,
RegisterValue &value) {
// PTRACE_PEEKUSER don't work in the aarch64 linux kernel used on android
- // devices (always return
- // "Bad address"). To avoid using PTRACE_PEEKUSER we read out the full GPR
- // register set instead.
- // This approach is about 4 times slower but the performance overhead is
- // negligible in
- // comparision to processing time in lldb-server.
+ // devices (always return "Bad address"). To avoid using PTRACE_PEEKUSER we
+ // read out the full GPR register set instead. This approach is about 4 times
+ // slower but the performance overhead is negligible in comparision to
+ // processing time in lldb-server.
assert(offset % 4 == 0 && "Try to write a register with unaligned offset");
if (offset + sizeof(uint32_t) > sizeof(m_gpr_arm))
return Status("Register isn't fit into the size of the GPR area");
@@ -895,13 +893,10 @@ Status NativeRegisterContextLinux_arm::DoReadRegisterValue(
Status NativeRegisterContextLinux_arm::DoWriteRegisterValue(
uint32_t offset, const char *reg_name, const RegisterValue &value) {
// PTRACE_POKEUSER don't work in the aarch64 linux kernel used on android
- // devices (always return
- // "Bad address"). To avoid using PTRACE_POKEUSER we read out the full GPR
- // register set, modify
- // the requested register and write it back. This approach is about 4 times
- // slower but the
- // performance overhead is negligible in comparision to processing time in
- // lldb-server.
+ // devices (always return "Bad address"). To avoid using PTRACE_POKEUSER we
+ // read out the full GPR register set, modify the requested register and
+ // write it back. This approach is about 4 times slower but the performance
+ // overhead is negligible in comparision to processing time in lldb-server.
assert(offset % 4 == 0 && "Try to write a register with unaligned offset");
if (offset + sizeof(uint32_t) > sizeof(m_gpr_arm))
return Status("Register isn't fit into the size of the GPR area");
@@ -915,9 +910,8 @@ Status NativeRegisterContextLinux_arm::DoWriteRegisterValue(
// will clear thumb bit of new PC if we are already in thumb mode; that is
// CPSR thumb mode bit is set.
if (offset / sizeof(uint32_t) == gpr_pc_arm) {
- // Check if we are already in thumb mode and
- // thumb bit of current PC is read out to be zero and
- // thumb bit of next PC is read out to be one.
+ // Check if we are already in thumb mode and thumb bit of current PC is
+ // read out to be zero and thumb bit of next PC is read out to be one.
if ((m_gpr_arm[gpr_cpsr_arm] & 0x20) && !(m_gpr_arm[gpr_pc_arm] & 0x01) &&
(value.GetAsUInt32() & 0x01)) {
reg_value &= (~1ull);
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
index 40e3b80eda74..d0b068550a9e 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm.h
@@ -42,7 +42,7 @@ public:
Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
//------------------------------------------------------------------
- // Hardware breakpoints/watchpoint mangement functions
+ // Hardware breakpoints/watchpoint management functions
//------------------------------------------------------------------
uint32_t NumSupportedHardwareBreakpoints() override;
@@ -140,7 +140,7 @@ private:
// occurred.
lldb::addr_t real_addr; // Address value that should cause target to stop.
uint32_t control; // Breakpoint/watchpoint control value.
- uint32_t refcount; // Serves as enable/disable and refernce counter.
+ uint32_t refcount; // Serves as enable/disable and reference counter.
};
struct DREG m_hbr_regs[16]; // Arm native linux hardware breakpoints
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
index c483260a5b2c..41fe446f728c 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.cpp
@@ -28,8 +28,7 @@
#include "Plugins/Process/Utility/RegisterInfoPOSIX_arm64.h"
// System includes - They have to be included after framework includes because
-// they define some
-// macros which collide with variable names in other modules
+// they define some macros which collide with variable names in other modules
#include <sys/socket.h>
// NT_PRSTATUS and NT_FPREGSET definition
#include <elf.h>
@@ -207,14 +206,14 @@ NativeRegisterContextLinux_arm64::ReadRegister(const RegisterInfo *reg_info,
error = ReadRegisterRaw(full_reg, reg_value);
if (error.Success()) {
- // If our read was not aligned (for ah,bh,ch,dh), shift our returned value
- // one byte to the right.
+ // If our read was not aligned (for ah,bh,ch,dh), shift our returned
+ // value one byte to the right.
if (is_subreg && (reg_info->byte_offset & 0x1))
reg_value.SetUInt64(reg_value.GetAsUInt64() >> 8);
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (reg_value.GetByteSize() > reg_info->byte_size)
reg_value.SetType(reg_info);
}
@@ -562,8 +561,8 @@ uint32_t NativeRegisterContextLinux_arm64::SetHardwareWatchpoint(
uint32_t control_value = 0, wp_index = 0;
lldb::addr_t real_addr = addr;
- // Check if we are setting watchpoint other than read/write/access
- // Also update watchpoint flag to match AArch64 write-read bit configuration.
+ // Check if we are setting watchpoint other than read/write/access Also
+ // update watchpoint flag to match AArch64 write-read bit configuration.
switch (watch_flags) {
case 1:
watch_flags = 2;
@@ -581,9 +580,9 @@ uint32_t NativeRegisterContextLinux_arm64::SetHardwareWatchpoint(
if (size != 1 && size != 2 && size != 4 && size != 8)
return LLDB_INVALID_INDEX32;
- // Check 8-byte alignment for hardware watchpoint target address.
- // Below is a hack to recalculate address and size in order to
- // make sure we can watch non 8-byte alligned addresses as well.
+ // Check 8-byte alignment for hardware watchpoint target address. Below is a
+ // hack to recalculate address and size in order to make sure we can watch
+ // non 8-byte alligned addresses as well.
if (addr & 0x07) {
uint8_t watch_mask = (addr & 0x07) + size;
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
index ab3c881ead59..c859d4249d05 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_arm64.h
@@ -42,7 +42,7 @@ public:
Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
//------------------------------------------------------------------
- // Hardware breakpoints/watchpoint mangement functions
+ // Hardware breakpoints/watchpoint management functions
//------------------------------------------------------------------
uint32_t NumSupportedHardwareBreakpoints() override;
@@ -140,7 +140,7 @@ private:
// occurred.
lldb::addr_t real_addr; // Address value that should cause target to stop.
uint32_t control; // Breakpoint/watchpoint control value.
- uint32_t refcount; // Serves as enable/disable and refernce counter.
+ uint32_t refcount; // Serves as enable/disable and reference counter.
};
struct DREG m_hbr_regs[16]; // Arm native linux hardware breakpoints
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
index 32c04a4374e6..69194b3c0663 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.cpp
@@ -140,9 +140,9 @@ NativeRegisterContextLinux_mips64::NativeRegisterContextLinux_mips64(
break;
}
- // Initialize m_iovec to point to the buffer and buffer size
- // using the conventions of Berkeley style UIO structures, as required
- // by PTRACE extensions.
+ // Initialize m_iovec to point to the buffer and buffer size using the
+ // conventions of Berkeley style UIO structures, as required by PTRACE
+ // extensions.
m_iovec.iov_base = &m_msa;
m_iovec.iov_len = sizeof(MSA_linux_mips);
@@ -337,7 +337,8 @@ lldb_private::Status NativeRegisterContextLinux_mips64::WriteRegister(
uint8_t byte_size = reg_info->byte_size;
lldbassert(reg_info->byte_offset < sizeof(UserArea));
- // Initialise the FP and MSA buffers by reading all co-processor 1 registers
+ // Initialise the FP and MSA buffers by reading all co-processor 1
+ // registers
ReadCP1();
if (IsFPR(reg_index)) {
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
index ea854dfa1dc6..6aa4af64ab51 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.cpp
@@ -26,8 +26,7 @@
#include "Plugins/Process/Utility/RegisterInfoPOSIX_ppc64le.h"
// System includes - They have to be included after framework includes because
-// they define some
-// macros which collide with variable names in other modules
+// they define some macros which collide with variable names in other modules
#include <sys/socket.h>
#include <elf.h>
#include <asm/ptrace.h>
@@ -50,6 +49,7 @@ static const uint32_t g_gpr_regnums_ppc64le[] = {
gpr_pc_ppc64le, gpr_msr_ppc64le, gpr_origr3_ppc64le, gpr_ctr_ppc64le,
gpr_lr_ppc64le, gpr_xer_ppc64le, gpr_cr_ppc64le, gpr_softe_ppc64le,
gpr_trap_ppc64le,
+ LLDB_INVALID_REGNUM // register sets need to end with this flag
};
static const uint32_t g_fpr_regnums_ppc64le[] = {
@@ -62,6 +62,7 @@ static const uint32_t g_fpr_regnums_ppc64le[] = {
fpr_f24_ppc64le, fpr_f25_ppc64le, fpr_f26_ppc64le, fpr_f27_ppc64le,
fpr_f28_ppc64le, fpr_f29_ppc64le, fpr_f30_ppc64le, fpr_f31_ppc64le,
fpr_fpscr_ppc64le,
+ LLDB_INVALID_REGNUM // register sets need to end with this flag
};
static const uint32_t g_vmx_regnums_ppc64le[] = {
@@ -74,6 +75,7 @@ static const uint32_t g_vmx_regnums_ppc64le[] = {
vmx_vr24_ppc64le, vmx_vr25_ppc64le, vmx_vr26_ppc64le, vmx_vr27_ppc64le,
vmx_vr28_ppc64le, vmx_vr29_ppc64le, vmx_vr30_ppc64le, vmx_vr31_ppc64le,
vmx_vscr_ppc64le, vmx_vrsave_ppc64le,
+ LLDB_INVALID_REGNUM // register sets need to end with this flag
};
static const uint32_t g_vsx_regnums_ppc64le[] = {
@@ -93,6 +95,7 @@ static const uint32_t g_vsx_regnums_ppc64le[] = {
vsx_vs52_ppc64le, vsx_vs53_ppc64le, vsx_vs54_ppc64le, vsx_vs55_ppc64le,
vsx_vs56_ppc64le, vsx_vs57_ppc64le, vsx_vs58_ppc64le, vsx_vs59_ppc64le,
vsx_vs60_ppc64le, vsx_vs61_ppc64le, vsx_vs62_ppc64le, vsx_vs63_ppc64le,
+ LLDB_INVALID_REGNUM // register sets need to end with this flag
};
namespace {
@@ -565,8 +568,8 @@ uint32_t NativeRegisterContextLinux_ppc64le::SetHardwareWatchpoint(
lldb::addr_t real_addr = addr;
uint32_t rw_mode = 0;
- // Check if we are setting watchpoint other than read/write/access
- // Update watchpoint flag to match ppc64le write-read bit configuration.
+ // Check if we are setting watchpoint other than read/write/access Update
+ // watchpoint flag to match ppc64le write-read bit configuration.
switch (watch_flags) {
case eWatchpointKindWrite:
rw_mode = PPC_BREAKPOINT_TRIGGER_WRITE;
@@ -587,9 +590,9 @@ uint32_t NativeRegisterContextLinux_ppc64le::SetHardwareWatchpoint(
if (size != 1 && size != 2 && size != 4 && size != 8)
return LLDB_INVALID_INDEX32;
- // Check 8-byte alignment for hardware watchpoint target address.
- // Below is a hack to recalculate address and size in order to
- // make sure we can watch non 8-byte alligned addresses as well.
+ // Check 8-byte alignment for hardware watchpoint target address. Below is a
+ // hack to recalculate address and size in order to make sure we can watch
+ // non 8-byte alligned addresses as well.
if (addr & 0x07) {
addr_t begin = llvm::alignDown(addr, 8);
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h b/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
index bb25af80d02c..2c4471962ad0 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_ppc64le.h
@@ -19,7 +19,7 @@
#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
#define DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
-#include "RegisterInfos_ppc64le.h"
+#include "Plugins/Process/Utility/RegisterInfos_ppc64le.h"
#undef DECLARE_REGISTER_INFOS_PPC64LE_STRUCT
namespace lldb_private {
@@ -49,7 +49,7 @@ public:
Status WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override;
//------------------------------------------------------------------
- // Hardware watchpoint mangement functions
+ // Hardware watchpoint management functions
//------------------------------------------------------------------
uint32_t NumSupportedHardwareWatchpoints() override;
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
index 021394ab154b..36da2b001054 100644
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_s390x.cpp
@@ -10,7 +10,7 @@
#if defined(__s390x__) && defined(__linux__)
#include "NativeRegisterContextLinux_s390x.h"
-
+#include "Plugins/Process/Linux/NativeProcessLinux.h"
#include "lldb/Core/RegisterValue.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -372,10 +372,10 @@ Status NativeRegisterContextLinux_s390x::ReadAllRegisterValues(
DoReadRegisterSet(NT_S390_SYSTEM_CALL, dst, 4);
dst += 4;
- // To enable inferior function calls while the process is stopped in
- // an interrupted system call, we need to clear the system call flag.
- // It will be restored to its original value by WriteAllRegisterValues.
- // Again we ignore error if the regset is unsupported.
+ // To enable inferior function calls while the process is stopped in an
+ // interrupted system call, we need to clear the system call flag. It will be
+ // restored to its original value by WriteAllRegisterValues. Again we ignore
+ // error if the regset is unsupported.
uint32_t system_call = 0;
DoWriteRegisterSet(NT_S390_SYSTEM_CALL, &system_call, 4);
diff --git a/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp b/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
index 84ffe9b6e420..87f4b8da053e 100755
--- a/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
+++ b/source/Plugins/Process/Linux/NativeRegisterContextLinux_x86_64.cpp
@@ -329,9 +329,9 @@ NativeRegisterContextLinux_x86_64::NativeRegisterContextLinux_x86_64(
break;
}
- // Initialize m_iovec to point to the buffer and buffer size
- // using the conventions of Berkeley style UIO structures, as required
- // by PTRACE extensions.
+ // Initialize m_iovec to point to the buffer and buffer size using the
+ // conventions of Berkeley style UIO structures, as required by PTRACE
+ // extensions.
m_iovec.iov_base = &m_fpr;
m_iovec.iov_len = sizeof(m_fpr);
@@ -420,14 +420,14 @@ NativeRegisterContextLinux_x86_64::ReadRegister(const RegisterInfo *reg_info,
error = ReadRegisterRaw(full_reg, reg_value);
if (error.Success()) {
- // If our read was not aligned (for ah,bh,ch,dh), shift our returned value
- // one byte to the right.
+ // If our read was not aligned (for ah,bh,ch,dh), shift our returned
+ // value one byte to the right.
if (is_subreg && (reg_info->byte_offset & 0x1))
reg_value.SetUInt64(reg_value.GetAsUInt64() >> 8);
// If our return byte size was greater than the return value reg size,
- // then
- // use the type specified by reg_info rather than the uint64_t default
+ // then use the type specified by reg_info rather than the uint64_t
+ // default
if (reg_value.GetByteSize() > reg_info->byte_size)
reg_value.SetType(reg_info);
}
@@ -448,7 +448,8 @@ NativeRegisterContextLinux_x86_64::ReadRegister(const RegisterInfo *reg_info,
reg_value.SetBytes(m_fpr.fxsave.xmm[reg - m_reg_info.first_xmm].bytes,
reg_info->byte_size, byte_order);
if (reg >= m_reg_info.first_ymm && reg <= m_reg_info.last_ymm) {
- // Concatenate ymm using the register halves in xmm.bytes and ymmh.bytes
+ // Concatenate ymm using the register halves in xmm.bytes and
+ // ymmh.bytes
if (CopyXSTATEtoYMM(reg, byte_order))
reg_value.SetBytes(m_ymm_set.ymm[reg - m_reg_info.first_ymm].bytes,
reg_info->byte_size, byte_order);
@@ -492,8 +493,7 @@ NativeRegisterContextLinux_x86_64::ReadRegister(const RegisterInfo *reg_info,
// Byte offsets of all registers are calculated wrt 'UserArea' structure.
// However, ReadFPR() reads fpu registers {using ptrace(PTRACE_GETFPREGS,..)}
// and stores them in 'm_fpr' (of type FPR structure). To extract values of
- // fpu
- // registers, m_fpr should be read at byte offsets calculated wrt to FPR
+ // fpu registers, m_fpr should be read at byte offsets calculated wrt to FPR
// structure.
// Since, FPR structure is also one of the member of UserArea structure.
@@ -599,11 +599,10 @@ Status NativeRegisterContextLinux_x86_64::WriteRegister(
// Get pointer to m_fpr.fxsave variable and set the data to it.
// Byte offsets of all registers are calculated wrt 'UserArea' structure.
- // However, WriteFPR() takes m_fpr (of type FPR structure) and writes only
- // fpu
- // registers using ptrace(PTRACE_SETFPREGS,..) API. Hence fpu registers
- // should
- // be written in m_fpr at byte offsets calculated wrt FPR structure.
+ // However, WriteFPR() takes m_fpr (of type FPR structure) and writes
+ // only fpu registers using ptrace(PTRACE_SETFPREGS,..) API. Hence fpu
+ // registers should be written in m_fpr at byte offsets calculated wrt
+ // FPR structure.
// Since, FPR structure is also one of the member of UserArea structure.
// byte_offset(fpu wrt FPR) = byte_offset(fpu wrt UserArea) -
@@ -1093,8 +1092,7 @@ Status NativeRegisterContextLinux_x86_64::SetHardwareWatchpointWithIndex(
if (error.Fail())
return error;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // set bits 1, 3, 5, or 7
+ // for watchpoints 0, 1, 2, or 3, respectively, set bits 1, 3, 5, or 7
uint64_t enable_bit = 1 << (2 * wp_index);
// set bits 16-17, 20-21, 24-25, or 28-29
@@ -1132,8 +1130,8 @@ bool NativeRegisterContextLinux_x86_64::ClearHardwareWatchpoint(
RegisterValue reg_value;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // clear bits 0, 1, 2, or 3 of the debug status register (DR6)
+ // for watchpoints 0, 1, 2, or 3, respectively, clear bits 0, 1, 2, or 3 of
+ // the debug status register (DR6)
Status error = ReadRegisterRaw(m_reg_info.first_dr + 6, reg_value);
if (error.Fail())
return false;
@@ -1143,9 +1141,9 @@ bool NativeRegisterContextLinux_x86_64::ClearHardwareWatchpoint(
if (error.Fail())
return false;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // clear bits {0-1,16-19}, {2-3,20-23}, {4-5,24-27}, or {6-7,28-31}
- // of the debug control register (DR7)
+ // for watchpoints 0, 1, 2, or 3, respectively, clear bits {0-1,16-19},
+ // {2-3,20-23}, {4-5,24-27}, or {6-7,28-31} of the debug control register
+ // (DR7)
error = ReadRegisterRaw(m_reg_info.first_dr + 7, reg_value);
if (error.Fail())
return false;
diff --git a/source/Plugins/Process/Linux/NativeThreadLinux.cpp b/source/Plugins/Process/Linux/NativeThreadLinux.cpp
index 0db3bd56b8e4..4ab2a9ae6245 100644
--- a/source/Plugins/Process/Linux/NativeThreadLinux.cpp
+++ b/source/Plugins/Process/Linux/NativeThreadLinux.cpp
@@ -211,8 +211,8 @@ Status NativeThreadLinux::Resume(uint32_t signo) {
m_stop_info.reason = StopReason::eStopReasonNone;
m_stop_description.clear();
- // If watchpoints have been set, but none on this thread,
- // then this is a new thread. So set all existing watchpoints.
+ // If watchpoints have been set, but none on this thread, then this is a new
+ // thread. So set all existing watchpoints.
if (m_watchpoint_index_map.empty()) {
NativeProcessLinux &process = GetProcess();
@@ -263,8 +263,8 @@ Status NativeThreadLinux::SingleStep(uint32_t signo) {
data = signo;
// If hardware single-stepping is not supported, we just do a continue. The
- // breakpoint on the
- // next instruction has been setup in NativeProcessLinux::Resume.
+ // breakpoint on the next instruction has been setup in
+ // NativeProcessLinux::Resume.
return NativeProcessLinux::PtraceWrapper(
GetProcess().SupportHardwareSingleStepping() ? PTRACE_SINGLESTEP
: PTRACE_CONT,
diff --git a/source/Plugins/Process/Linux/ProcessorTrace.h b/source/Plugins/Process/Linux/ProcessorTrace.h
index 6603c7d60478..6fd918c2bb58 100644
--- a/source/Plugins/Process/Linux/ProcessorTrace.h
+++ b/source/Plugins/Process/Linux/ProcessorTrace.h
@@ -34,7 +34,7 @@ namespace process_linux {
// a key to the tracing instance and trace manipulations could be
// performed using the trace id.
//
-// The traace id could map to trace instances for a group of threads
+// The trace id could map to trace instances for a group of threads
// (spanning to all the threads in the process) or a single thread.
// The kernel interface for us is the perf_event_open.
// ---------------------------------------------------------------------
diff --git a/source/Plugins/Process/Linux/SingleStepCheck.cpp b/source/Plugins/Process/Linux/SingleStepCheck.cpp
index 251cb4b2f10a..c57a2daf2275 100644
--- a/source/Plugins/Process/Linux/SingleStepCheck.cpp
+++ b/source/Plugins/Process/Linux/SingleStepCheck.cpp
@@ -59,9 +59,9 @@ struct ChildDeleter {
bool WorkaroundNeeded() {
// We shall spawn a child, and use it to verify the debug capabilities of the
- // cpu. We shall iterate through the cpus, bind the child to each one in turn,
- // and verify that single-stepping works on that cpu. A workaround is needed
- // if we find at least one broken cpu.
+ // cpu. We shall iterate through the cpus, bind the child to each one in
+ // turn, and verify that single-stepping works on that cpu. A workaround is
+ // needed if we find at least one broken cpu.
Log *log = ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_THREAD);
::pid_t child_pid = fork();
diff --git a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
index 3d9f498b1e9a..116155d9a232 100644
--- a/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/CommunicationKDP.cpp
@@ -59,15 +59,6 @@ bool CommunicationKDP::SendRequestPacket(
return SendRequestPacketNoLock(request_packet);
}
-#if 0
-typedef struct {
- uint8_t request; // Either: CommandType | ePacketTypeRequest, or CommandType | ePacketTypeReply
- uint8_t sequence;
- uint16_t length; // Length of entire packet including this header
- uint32_t key; // Session key
-} kdp_hdr_t;
-#endif
-
void CommunicationKDP::MakeRequestPacketHeader(CommandType request_type,
PacketStreamType &request_packet,
uint16_t request_length) {
@@ -127,16 +118,14 @@ bool CommunicationKDP::SendRequestAndGetReply(
}
} else if (reply_sequence_id > request_sequence_id) {
// Sequence ID was greater than the sequence ID of the packet we
- // sent, something
- // is really wrong...
+ // sent, something is really wrong...
reply_packet.Clear();
return false;
} else {
- // The reply sequence ID was less than our current packet's sequence
- // ID
- // so we should keep trying to get a response because this was a
- // response
- // for a previous packet that we must have retried.
+ // The reply sequence ID was less than our current packet's
+ // sequence ID so we should keep trying to get a response because
+ // this was a response for a previous packet that we must have
+ // retried.
}
} else {
// Break and retry sending the packet as we didn't get a response due
@@ -186,7 +175,7 @@ bool CommunicationKDP::GetSequenceMutex(
bool CommunicationKDP::WaitForNotRunningPrivate(
const std::chrono::microseconds &timeout) {
- return m_is_running.WaitForValueEqualTo(false, timeout, NULL);
+ return m_is_running.WaitForValueEqualTo(false, timeout);
}
size_t
@@ -324,9 +313,9 @@ bool CommunicationKDP::CheckForPacket(const uint8_t *src, size_t src_len,
offset = 2;
const uint16_t length = packet.GetU16(&offset);
if (length <= bytes_available) {
- // We have an entire packet ready, we need to copy the data
- // bytes into a buffer that will be owned by the packet and
- // erase the bytes from our communcation buffer "m_bytes"
+ // We have an entire packet ready, we need to copy the data bytes into
+ // a buffer that will be owned by the packet and erase the bytes from
+ // our communcation buffer "m_bytes"
packet.SetData(DataBufferSP(new DataBufferHeap(&m_bytes[0], length)));
m_bytes.erase(0, length);
@@ -341,8 +330,8 @@ bool CommunicationKDP::CheckForPacket(const uint8_t *src, size_t src_len,
} break;
default:
- // Unrecognized reply command byte, erase this byte and try to get back on
- // track
+ // Unrecognized reply command byte, erase this byte and try to get back
+ // on track
if (log)
log->Printf("CommunicationKDP::%s: tossing junk byte: 0x%2.2x",
__FUNCTION__, (uint8_t)m_bytes[0]);
@@ -436,34 +425,6 @@ bool CommunicationKDP::SendRequestVersion() {
return false;
}
-#if 0 // Disable KDP_IMAGEPATH for now, it seems to hang the KDP connection...
-const char *
-CommunicationKDP::GetImagePath ()
-{
- if (m_image_path.empty())
- SendRequestImagePath();
- return m_image_path.c_str();
-}
-
-bool
-CommunicationKDP::SendRequestImagePath ()
-{
- PacketStreamType request_packet (Stream::eBinary, m_addr_byte_size, m_byte_order);
- const CommandType command = KDP_IMAGEPATH;
- const uint32_t command_length = 8;
- MakeRequestPacketHeader (command, request_packet, command_length);
- DataExtractor reply_packet;
- if (SendRequestAndGetReply (command, request_packet, reply_packet))
- {
- const char *path = reply_packet.PeekCStr(8);
- if (path && path[0])
- m_kernel_version.assign (path);
- return true;
- }
- return false;
-}
-#endif
-
uint32_t CommunicationKDP::GetCPUMask() {
if (!HostInfoIsValid())
SendRequestHostInfo();
@@ -495,7 +456,7 @@ lldb_private::UUID CommunicationKDP::GetUUID() {
if (uuid_str.size() < 32)
return uuid;
- if (uuid.SetFromCString(uuid_str.c_str()) == 0) {
+ if (uuid.SetFromStringRef(uuid_str) == 0) {
UUID invalid_uuid;
return invalid_uuid;
}
@@ -1245,8 +1206,8 @@ uint32_t CommunicationKDP::SendRequestReadRegisters(uint32_t cpu,
if (src) {
::memcpy(dst, src, bytes_to_copy);
error.Clear();
- // Return the number of bytes we could have returned regardless if
- // we copied them or not, just so we know when things don't match up
+ // Return the number of bytes we could have returned regardless if we
+ // copied them or not, just so we know when things don't match up
return src_len;
}
}
diff --git a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
index f01f1ace583c..2e707ab2e363 100644
--- a/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
@@ -172,10 +172,10 @@ ProcessKDP::ProcessKDP(TargetSP target_sp, ListenerSP listener_sp)
//----------------------------------------------------------------------
ProcessKDP::~ProcessKDP() {
Clear();
- // We need to call finalize on the process before destroying ourselves
- // to make sure all of the broadcaster cleanup goes as planned. If we
- // destruct this class, then Process::~Process() might have problems
- // trying to fully destroy the broadcaster.
+ // We need to call finalize on the process before destroying ourselves to
+ // make sure all of the broadcaster cleanup goes as planned. If we destruct
+ // this class, then Process::~Process() might have problems trying to fully
+ // destroy the broadcaster.
Finalize();
}
@@ -226,9 +226,9 @@ bool ProcessKDP::GetHostArchitecture(ArchSpec &arch) {
Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) {
Status error;
- // Don't let any JIT happen when doing KDP as we can't allocate
- // memory and we don't want to be mucking with threads that might
- // already be handling exceptions
+ // Don't let any JIT happen when doing KDP as we can't allocate memory and we
+ // don't want to be mucking with threads that might already be handling
+ // exceptions
SetCanJIT(false);
if (remote_url.empty()) {
@@ -282,16 +282,15 @@ Status ProcessKDP::DoConnectRemote(Stream *strm, llvm::StringRef remote_url) {
if (m_comm.RemoteIsEFI()) {
// Select an invalid plugin name for the dynamic loader so one
- // doesn't get used
- // since EFI does its own manual loading via python scripting
+ // doesn't get used since EFI does its own manual loading via
+ // python scripting
static ConstString g_none_dynamic_loader("none");
m_dyld_plugin_name = g_none_dynamic_loader;
if (kernel_uuid.IsValid()) {
- // If EFI passed in a UUID= try to lookup UUID
- // The slide will not be provided. But the UUID
- // lookup will be used to launch EFI debug scripts
- // from the dSYM, that can load all of the symbols.
+ // If EFI passed in a UUID= try to lookup UUID The slide will not
+ // be provided. But the UUID lookup will be used to launch EFI
+ // debug scripts from the dSYM, that can load all of the symbols.
ModuleSpec module_spec;
module_spec.GetUUID() = kernel_uuid;
module_spec.GetArchitecture() = target.GetArchitecture();
@@ -386,7 +385,7 @@ ProcessKDP::DoAttachToProcessWithID(lldb::pid_t attach_pid,
const ProcessAttachInfo &attach_info) {
Status error;
error.SetErrorString(
- "attach to process by ID is not suppported in kdp remote debugging");
+ "attach to process by ID is not supported in kdp remote debugging");
return error;
}
@@ -395,7 +394,7 @@ ProcessKDP::DoAttachToProcessWithName(const char *process_name,
const ProcessAttachInfo &attach_info) {
Status error;
error.SetErrorString(
- "attach to process by name is not suppported in kdp remote debugging");
+ "attach to process by name is not supported in kdp remote debugging");
return error;
}
@@ -443,8 +442,8 @@ Status ProcessKDP::DoResume() {
StateAsCString(thread_resume_state));
switch (thread_resume_state) {
case eStateSuspended:
- // Nothing to do here when a thread will stay suspended
- // we just leave the CPU mask bit set to zero for the thread
+ // Nothing to do here when a thread will stay suspended we just leave the
+ // CPU mask bit set to zero for the thread
if (log)
log->Printf("ProcessKDP::DoResume() = suspended???");
break;
@@ -535,8 +534,8 @@ bool ProcessKDP::UpdateThreadList(ThreadList &old_thread_list,
}
void ProcessKDP::RefreshStateAfterStop() {
- // Let all threads recover from stopping and do any clean up based
- // on the previous thread state (if any).
+ // Let all threads recover from stopping and do any clean up based on the
+ // previous thread state (if any).
m_thread_list.RefreshStateAfterStop();
}
@@ -545,9 +544,9 @@ Status ProcessKDP::DoHalt(bool &caused_stop) {
if (m_comm.IsRunning()) {
if (m_destroy_in_process) {
- // If we are attemping to destroy, we need to not return an error to
- // Halt or DoDestroy won't get called.
- // We are also currently running, so send a process stopped event
+ // If we are attempting to destroy, we need to not return an error to Halt
+ // or DoDestroy won't get called. We are also currently running, so send
+ // a process stopped event
SetPrivateState(eStateStopped);
} else {
error.SetErrorString("KDP cannot interrupt a running kernel");
@@ -563,8 +562,8 @@ Status ProcessKDP::DoDetach(bool keep_stopped) {
log->Printf("ProcessKDP::DoDetach(keep_stopped = %i)", keep_stopped);
if (m_comm.IsRunning()) {
- // We are running and we can't interrupt a running kernel, so we need
- // to just close the connection to the kernel and hope for the best
+ // We are running and we can't interrupt a running kernel, so we need to
+ // just close the connection to the kernel and hope for the best
} else {
// If we are going to keep the target stopped, then don't send the
// disconnect message.
@@ -647,14 +646,14 @@ size_t ProcessKDP::DoWriteMemory(addr_t addr, const void *buf, size_t size,
lldb::addr_t ProcessKDP::DoAllocateMemory(size_t size, uint32_t permissions,
Status &error) {
error.SetErrorString(
- "memory allocation not suppported in kdp remote debugging");
+ "memory allocation not supported in kdp remote debugging");
return LLDB_INVALID_ADDRESS;
}
Status ProcessKDP::DoDeallocateMemory(lldb::addr_t addr) {
Status error;
error.SetErrorString(
- "memory deallocation not suppported in kdp remote debugging");
+ "memory deallocation not supported in kdp remote debugging");
return error;
}
@@ -701,14 +700,14 @@ Status ProcessKDP::DisableBreakpointSite(BreakpointSite *bp_site) {
Status ProcessKDP::EnableWatchpoint(Watchpoint *wp, bool notify) {
Status error;
error.SetErrorString(
- "watchpoints are not suppported in kdp remote debugging");
+ "watchpoints are not supported in kdp remote debugging");
return error;
}
Status ProcessKDP::DisableWatchpoint(Watchpoint *wp, bool notify) {
Status error;
error.SetErrorString(
- "watchpoints are not suppported in kdp remote debugging");
+ "watchpoints are not supported in kdp remote debugging");
return error;
}
@@ -717,7 +716,7 @@ void ProcessKDP::Clear() { m_thread_list.Clear(); }
Status ProcessKDP::DoSignal(int signo) {
Status error;
error.SetErrorString(
- "sending signals is not suppported in kdp remote debugging");
+ "sending signals is not supported in kdp remote debugging");
return error;
}
diff --git a/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp b/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
index 1902cc492ff4..7fca0fc24fdb 100644
--- a/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
+++ b/source/Plugins/Process/MacOSX-Kernel/ThreadKDP.cpp
@@ -52,11 +52,11 @@ ThreadKDP::~ThreadKDP() {
const char *ThreadKDP::GetName() {
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
-const char *ThreadKDP::GetQueueName() { return NULL; }
+const char *ThreadKDP::GetQueueName() { return nullptr; }
void ThreadKDP::RefreshStateAfterStop() {
// Invalidate all registers in our register context. We don't set "force" to
@@ -65,8 +65,8 @@ void ThreadKDP::RefreshStateAfterStop() {
// context by the time this function gets called. The KDPRegisterContext
// class has been made smart enough to detect when it needs to invalidate
// which registers are valid by putting hooks in the register read and
- // register supply functions where they check the process stop ID and do
- // the right thing.
+ // register supply functions where they check the process stop ID and do the
+ // right thing.
const bool force = false;
lldb::RegisterContextSP reg_ctx_sp(GetRegisterContext());
if (reg_ctx_sp)
@@ -79,8 +79,8 @@ void ThreadKDP::Dump(Log *log, uint32_t index) {}
bool ThreadKDP::ShouldStop(bool &step_more) { return true; }
lldb::RegisterContextSP ThreadKDP::GetRegisterContext() {
- if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp = CreateRegisterContextForFrame(NULL);
+ if (!m_reg_context_sp)
+ m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
return m_reg_context_sp;
}
@@ -119,7 +119,7 @@ ThreadKDP::CreateRegisterContextForFrame(StackFrame *frame) {
}
} else {
Unwind *unwinder = GetUnwinder();
- if (unwinder)
+ if (unwinder != nullptr)
reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
@@ -151,8 +151,8 @@ void ThreadKDP::SetStopInfoFrom_KDP_EXCEPTION(
const uint32_t exc_type = exc_reply_packet.GetU32(&offset);
const uint32_t exc_code = exc_reply_packet.GetU32(&offset);
const uint32_t exc_subcode = exc_reply_packet.GetU32(&offset);
- // We have to make a copy of the stop info because the thread list
- // will iterate through the threads and clear all stop infos..
+ // We have to make a copy of the stop info because the thread list will
+ // iterate through the threads and clear all stop infos..
// Let the StopInfoMachException::CreateStopReasonWithMachException()
// function update the PC if needed as we might hit a software breakpoint
diff --git a/source/Plugins/Process/NetBSD/CMakeLists.txt b/source/Plugins/Process/NetBSD/CMakeLists.txt
index 5b2cef8b847b..92a6014ced07 100644
--- a/source/Plugins/Process/NetBSD/CMakeLists.txt
+++ b/source/Plugins/Process/NetBSD/CMakeLists.txt
@@ -1,7 +1,3 @@
-include_directories(.)
-include_directories(../POSIX)
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessNetBSD PLUGIN
NativeProcessNetBSD.cpp
NativeRegisterContextNetBSD.cpp
diff --git a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
index 387f04afa5b4..1a4cb21d000e 100644
--- a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
+++ b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.cpp
@@ -24,8 +24,7 @@
#include "llvm/Support/Errno.h"
// System includes - They have to be included after framework includes because
-// they define some
-// macros which collide with variable names in other modules
+// they define some macros which collide with variable names in other modules
// clang-format off
#include <sys/types.h>
#include <sys/ptrace.h>
@@ -93,17 +92,19 @@ NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info,
}
LLDB_LOG(log, "inferior started, now in stopped state");
- ArchSpec arch;
- if ((status = ResolveProcessArchitecture(pid, arch)).Fail())
- return status.ToError();
+ ProcessInstanceInfo Info;
+ if (!Host::GetProcessInfo(pid, Info)) {
+ return llvm::make_error<StringError>("Cannot get process architecture",
+ llvm::inconvertibleErrorCode());
+ }
// Set the architecture to the exe architecture.
LLDB_LOG(log, "pid = {0:x}, detected architecture {1}", pid,
- arch.GetArchitectureName());
+ Info.GetArchitecture().GetArchitectureName());
std::unique_ptr<NativeProcessNetBSD> process_up(new NativeProcessNetBSD(
pid, launch_info.GetPTY().ReleaseMasterFileDescriptor(), native_delegate,
- arch, mainloop));
+ Info.GetArchitecture(), mainloop));
status = process_up->ReinitializeThreads();
if (status.Fail())
@@ -111,7 +112,7 @@ NativeProcessNetBSD::Factory::Launch(ProcessLaunchInfo &launch_info,
for (const auto &thread : process_up->m_threads)
static_cast<NativeThreadNetBSD &>(*thread).SetStoppedBySignal(SIGSTOP);
- process_up->SetState(StateType::eStateStopped);
+ process_up->SetState(StateType::eStateStopped, false);
return std::move(process_up);
}
@@ -124,15 +125,16 @@ NativeProcessNetBSD::Factory::Attach(
LLDB_LOG(log, "pid = {0:x}", pid);
// Retrieve the architecture for the running process.
- ArchSpec arch;
- Status status = ResolveProcessArchitecture(pid, arch);
- if (!status.Success())
- return status.ToError();
+ ProcessInstanceInfo Info;
+ if (!Host::GetProcessInfo(pid, Info)) {
+ return llvm::make_error<StringError>("Cannot get process architecture",
+ llvm::inconvertibleErrorCode());
+ }
- std::unique_ptr<NativeProcessNetBSD> process_up(
- new NativeProcessNetBSD(pid, -1, native_delegate, arch, mainloop));
+ std::unique_ptr<NativeProcessNetBSD> process_up(new NativeProcessNetBSD(
+ pid, -1, native_delegate, Info.GetArchitecture(), mainloop));
- status = process_up->Attach();
+ Status status = process_up->Attach();
if (!status.Success())
return status.ToError();
@@ -349,8 +351,8 @@ NativeProcessNetBSD::FixupBreakpointPCAsNeeded(NativeThreadNetBSD &thread) {
return error;
} else
LLDB_LOG(log, "breakpoint size: {0}", breakpoint_size);
- // First try probing for a breakpoint at a software breakpoint location: PC
- // - breakpoint size.
+ // First try probing for a breakpoint at a software breakpoint location: PC -
+ // breakpoint size.
const lldb::addr_t initial_pc_addr =
context.GetPCfromBreakpointLocation();
lldb::addr_t breakpoint_addr = initial_pc_addr;
@@ -559,8 +561,8 @@ Status NativeProcessNetBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
"descending memory map entries detected, unexpected");
prev_base_address = proc_entry_info.GetRange().GetRangeBase();
UNUSED_IF_ASSERT_DISABLED(prev_base_address);
- // If the target address comes before this entry, indicate distance to
- // next region.
+ // If the target address comes before this entry, indicate distance to next
+ // region.
if (load_addr < proc_entry_info.GetRange().GetRangeBase()) {
range_info.GetRange().SetRangeBase(load_addr);
range_info.GetRange().SetByteSize(
@@ -579,9 +581,8 @@ Status NativeProcessNetBSD::GetMemoryRegionInfo(lldb::addr_t load_addr,
// parsed.
}
// If we made it here, we didn't find an entry that contained the given
- // address. Return the
- // load_addr as start and the amount of bytes betwwen load address and the
- // end of the memory as size.
+ // address. Return the load_addr as start and the amount of bytes betwwen
+ // load address and the end of the memory as size.
range_info.GetRange().SetRangeBase(load_addr);
range_info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
range_info.SetReadable(MemoryRegionInfo::OptionalBool::eNo);
@@ -641,8 +642,8 @@ Status NativeProcessNetBSD::PopulateMemoryRegionCache() {
free(vm);
if (m_mem_region_cache.empty()) {
- // No entries after attempting to read them. This shouldn't happen.
- // Assume we don't support map entries.
+ // No entries after attempting to read them. This shouldn't happen. Assume
+ // we don't support map entries.
LLDB_LOG(log, "failed to find any vmmap entries, assuming no support "
"for memory region metadata retrieval");
m_supports_mem_region = LazyBool::eLazyBoolNo;
@@ -778,8 +779,8 @@ Status NativeProcessNetBSD::Attach() {
return status;
int wstatus;
- // Need to use WALLSIG otherwise we receive an error with errno=ECHLD
- // At this point we should have a thread stopped if waitpid succeeds.
+ // Need to use WALLSIG otherwise we receive an error with errno=ECHLD At this
+ // point we should have a thread stopped if waitpid succeeds.
if ((wstatus = waitpid(m_pid, NULL, WALLSIG)) < 0)
return Status(errno, eErrorTypePOSIX);
@@ -871,13 +872,13 @@ NativeProcessNetBSD::GetAuxvData() const {
*/
size_t auxv_size = 100 * sizeof(AuxInfo);
- ErrorOr<std::unique_ptr<MemoryBuffer>> buf =
- llvm::MemoryBuffer::getNewMemBuffer(auxv_size);
+ ErrorOr<std::unique_ptr<WritableMemoryBuffer>> buf =
+ llvm::WritableMemoryBuffer::getNewMemBuffer(auxv_size);
struct ptrace_io_desc io;
io.piod_op = PIOD_READ_AUXV;
io.piod_offs = 0;
- io.piod_addr = const_cast<void *>(static_cast<const void *>(buf.get()->getBufferStart()));
+ io.piod_addr = static_cast<void *>(buf.get()->getBufferStart());
io.piod_len = auxv_size;
Status error = NativeProcessNetBSD::PtraceWrapper(PT_IO, GetID(), &io);
@@ -888,7 +889,7 @@ NativeProcessNetBSD::GetAuxvData() const {
if (io.piod_len < 1)
return std::error_code(ECANCELED, std::generic_category());
- return buf;
+ return std::move(buf);
}
Status NativeProcessNetBSD::ReinitializeThreads() {
diff --git a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
index 7090fce34fc9..142f74ecf194 100644
--- a/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
+++ b/source/Plugins/Process/NetBSD/NativeProcessNetBSD.h
@@ -20,10 +20,10 @@
namespace lldb_private {
namespace process_netbsd {
/// @class NativeProcessNetBSD
-/// @brief Manages communication with the inferior (debugee) process.
+/// Manages communication with the inferior (debugee) process.
///
-/// Upon construction, this class prepares and launches an inferior process for
-/// debugging.
+/// Upon construction, this class prepares and launches an inferior process
+/// for debugging.
///
/// Changes in the inferior process state are broadcasted.
class NativeProcessNetBSD : public NativeProcessProtocol {
diff --git a/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp b/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
index 347c15ae5b23..16b6f2c52dd5 100644
--- a/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
+++ b/source/Plugins/Process/NetBSD/NativeRegisterContextNetBSD_x86_64.cpp
@@ -161,8 +161,8 @@ static RegisterInfoInterface *
CreateRegisterInfoInterface(const ArchSpec &target_arch) {
assert((HostInfo::GetArchitecture().GetAddressByteSize() == 8) &&
"Register setting path assumes this is a 64-bit host");
- // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the
- // x86_64 register context.
+ // X86_64 hosts know how to work with 64-bit and 32-bit EXEs using the x86_64
+ // register context.
return new RegisterContextNetBSD_x86_64(target_arch);
}
@@ -805,8 +805,7 @@ Status NativeRegisterContextNetBSD_x86_64::SetHardwareWatchpointWithIndex(
if (error.Fail())
return error;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // set bits 1, 3, 5, or 7
+ // for watchpoints 0, 1, 2, or 3, respectively, set bits 1, 3, 5, or 7
uint64_t enable_bit = 1 << (2 * wp_index);
// set bits 16-17, 20-21, 24-25, or 28-29
@@ -845,8 +844,8 @@ bool NativeRegisterContextNetBSD_x86_64::ClearHardwareWatchpoint(
RegisterValue reg_value;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // clear bits 0, 1, 2, or 3 of the debug status register (DR6)
+ // for watchpoints 0, 1, 2, or 3, respectively, clear bits 0, 1, 2, or 3 of
+ // the debug status register (DR6)
const RegisterInfo *const reg_info_dr6 =
GetRegisterInfoAtIndex(lldb_dr6_x86_64);
Status error = ReadRegister(reg_info_dr6, reg_value);
@@ -858,9 +857,9 @@ bool NativeRegisterContextNetBSD_x86_64::ClearHardwareWatchpoint(
if (error.Fail())
return false;
- // for watchpoints 0, 1, 2, or 3, respectively,
- // clear bits {0-1,16-19}, {2-3,20-23}, {4-5,24-27}, or {6-7,28-31}
- // of the debug control register (DR7)
+ // for watchpoints 0, 1, 2, or 3, respectively, clear bits {0-1,16-19},
+ // {2-3,20-23}, {4-5,24-27}, or {6-7,28-31} of the debug control register
+ // (DR7)
const RegisterInfo *const reg_info_dr7 =
GetRegisterInfoAtIndex(lldb_dr7_x86_64);
error = ReadRegister(reg_info_dr7, reg_value);
diff --git a/source/Plugins/Process/POSIX/CMakeLists.txt b/source/Plugins/Process/POSIX/CMakeLists.txt
index d9a4508df0a3..f058e01c7439 100644
--- a/source/Plugins/Process/POSIX/CMakeLists.txt
+++ b/source/Plugins/Process/POSIX/CMakeLists.txt
@@ -1,6 +1,3 @@
-include_directories(.)
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessPOSIX PLUGIN
CrashReason.cpp
ProcessMessage.cpp
diff --git a/source/Plugins/Process/POSIX/CrashReason.cpp b/source/Plugins/Process/POSIX/CrashReason.cpp
index 864418c90031..4b24d31226a9 100644
--- a/source/Plugins/Process/POSIX/CrashReason.cpp
+++ b/source/Plugins/Process/POSIX/CrashReason.cpp
@@ -47,8 +47,7 @@ CrashReason GetCrashReasonForSIGSEGV(const siginfo_t &info) {
#ifdef SI_KERNEL
case SI_KERNEL:
// Some platforms will occasionally send nonstandard spurious SI_KERNEL
- // codes.
- // One way to get this is via unaligned SIMD loads.
+ // codes. One way to get this is via unaligned SIMD loads.
return CrashReason::eInvalidAddress; // for lack of anything better
#endif
case SEGV_MAPERR:
diff --git a/source/Plugins/Process/Utility/CMakeLists.txt b/source/Plugins/Process/Utility/CMakeLists.txt
index 3780fb5e4c18..b43756acea63 100644
--- a/source/Plugins/Process/Utility/CMakeLists.txt
+++ b/source/Plugins/Process/Utility/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(../../../Utility/)
-
add_lldb_library(lldbPluginProcessUtility PLUGIN
DynamicRegisterInfo.cpp
FreeBSDSignals.cpp
@@ -60,7 +58,6 @@ add_lldb_library(lldbPluginProcessUtility PLUGIN
lldbSymbol
lldbTarget
lldbUtility
- lldbPluginProcessElfCore
LINK_COMPONENTS
Support
)
diff --git a/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp b/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
index 61e5bf4481d6..5f34e9915ede 100644
--- a/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
+++ b/source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
@@ -12,6 +12,7 @@
#include "lldb/Core/StreamFile.h"
#include "lldb/DataFormatters/FormatManager.h"
#include "lldb/Host/StringConvert.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/RegularExpression.h"
#include "lldb/Utility/StringExtractor.h"
@@ -20,21 +21,42 @@
using namespace lldb;
using namespace lldb_private;
-DynamicRegisterInfo::DynamicRegisterInfo()
- : m_regs(), m_sets(), m_set_reg_nums(), m_set_names(), m_value_regs_map(),
- m_invalidate_regs_map(), m_dynamic_reg_size_map(),
- m_reg_data_byte_size(0), m_finalized(false) {}
-
DynamicRegisterInfo::DynamicRegisterInfo(
const lldb_private::StructuredData::Dictionary &dict,
- const lldb_private::ArchSpec &arch)
- : m_regs(), m_sets(), m_set_reg_nums(), m_set_names(), m_value_regs_map(),
- m_invalidate_regs_map(), m_dynamic_reg_size_map(),
- m_reg_data_byte_size(0), m_finalized(false) {
+ const lldb_private::ArchSpec &arch) {
SetRegisterInfo(dict, arch);
}
-DynamicRegisterInfo::~DynamicRegisterInfo() {}
+DynamicRegisterInfo::DynamicRegisterInfo(DynamicRegisterInfo &&info) {
+ MoveFrom(std::move(info));
+}
+
+DynamicRegisterInfo &
+DynamicRegisterInfo::operator=(DynamicRegisterInfo &&info) {
+ MoveFrom(std::move(info));
+ return *this;
+}
+
+void DynamicRegisterInfo::MoveFrom(DynamicRegisterInfo &&info) {
+ m_regs = std::move(info.m_regs);
+ m_sets = std::move(info.m_sets);
+ m_set_reg_nums = std::move(info.m_set_reg_nums);
+ m_set_names = std::move(info.m_set_names);
+ m_value_regs_map = std::move(info.m_value_regs_map);
+ m_invalidate_regs_map = std::move(info.m_invalidate_regs_map);
+ m_dynamic_reg_size_map = std::move(info.m_dynamic_reg_size_map);
+
+ m_reg_data_byte_size = info.m_reg_data_byte_size;
+ m_finalized = info.m_finalized;
+
+ if (m_finalized) {
+ const size_t num_sets = m_sets.size();
+ for (size_t set = 0; set < num_sets; ++set)
+ m_sets[set].registers = m_set_reg_nums[set].data();
+ }
+
+ info.Clear();
+}
size_t
DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
@@ -44,13 +66,9 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
if (dict.GetValueForKeyAsArray("sets", sets)) {
const uint32_t num_sets = sets->GetSize();
for (uint32_t i = 0; i < num_sets; ++i) {
- llvm::StringRef set_name_str;
ConstString set_name;
- if (sets->GetItemAtIndexAsString(i, set_name_str))
- set_name.SetString(set_name_str);
- if (set_name) {
- RegisterSet new_set = {set_name.AsCString(), NULL, 0, NULL};
- m_sets.push_back(new_set);
+ if (sets->GetItemAtIndexAsString(i, set_name) && !set_name.IsEmpty()) {
+ m_sets.push_back({ set_name.AsCString(), NULL, 0, NULL });
} else {
Clear();
printf("error: register sets must have valid names\n");
@@ -59,6 +77,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
}
m_set_reg_nums.resize(m_sets.size());
}
+
StructuredData::Array *regs = nullptr;
if (!dict.GetValueForKeyAsArray("registers", regs))
return 0;
@@ -76,8 +95,8 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
return 0;
}
- // { 'name':'rcx' , 'bitsize' : 64, 'offset' : 16, 'encoding':'uint'
- // , 'format':'hex' , 'set': 0, 'ehframe' : 2,
+ // { 'name':'rcx' , 'bitsize' : 64, 'offset' : 16,
+ // 'encoding':'uint' , 'format':'hex' , 'set': 0, 'ehframe' : 2,
// 'dwarf' : 2, 'generic':'arg4', 'alt-name':'arg4', },
RegisterInfo reg_info;
std::vector<uint32_t> value_regs;
@@ -102,14 +121,11 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
const ByteOrder byte_order = arch.GetByteOrder();
if (reg_info.byte_offset == UINT32_MAX) {
- // No offset for this register, see if the register has a value expression
- // which indicates this register is part of another register. Value
- // expressions
- // are things like "rax[31:0]" which state that the current register's
- // value
- // is in a concrete register "rax" in bits 31:0. If there is a value
- // expression
- // we can calculate the offset
+ // No offset for this register, see if the register has a value
+ // expression which indicates this register is part of another register.
+ // Value expressions are things like "rax[31:0]" which state that the
+ // current register's value is in a concrete register "rax" in bits 31:0.
+ // If there is a value expression we can calculate the offset
bool success = false;
llvm::StringRef slice_str;
if (reg_info_dict->GetValueForKeyAsString("slice", slice_str, nullptr)) {
@@ -141,7 +157,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
ConstString containing_reg_name(reg_name_str);
- RegisterInfo *containing_reg_info =
+ const RegisterInfo *containing_reg_info =
GetRegisterInfo(containing_reg_name);
if (containing_reg_info) {
const uint32_t max_bit = containing_reg_info->byte_size * 8;
@@ -210,7 +226,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
ConstString composite_reg_name;
if (composite_reg_list->GetItemAtIndexAsString(
composite_idx, composite_reg_name, nullptr)) {
- RegisterInfo *composite_reg_info =
+ const RegisterInfo *composite_reg_info =
GetRegisterInfo(composite_reg_name);
if (composite_reg_info) {
composite_offset = std::min(composite_offset,
@@ -286,7 +302,8 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
llvm::StringRef format_str;
if (reg_info_dict->GetValueForKeyAsString("format", format_str, nullptr)) {
- if (Args::StringToFormat(format_str.str().c_str(), reg_info.format, NULL)
+ if (OptionArgParser::ToFormat(format_str.str().c_str(), reg_info.format,
+ NULL)
.Fail()) {
Clear();
printf("error: invalid 'format' value in register dictionary\n");
@@ -349,7 +366,7 @@ DynamicRegisterInfo::SetRegisterInfo(const StructuredData::Dictionary &dict,
uint64_t invalidate_reg_num;
if (invalidate_reg_list->GetItemAtIndexAsString(
idx, invalidate_reg_name)) {
- RegisterInfo *invalidate_reg_info =
+ const RegisterInfo *invalidate_reg_info =
GetRegisterInfo(invalidate_reg_name);
if (invalidate_reg_info) {
m_invalidate_regs_map[i].push_back(
@@ -437,7 +454,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
for (size_t set = 0; set < num_sets; ++set) {
assert(m_sets.size() == m_set_reg_nums.size());
m_sets[set].num_registers = m_set_reg_nums[set].size();
- m_sets[set].registers = &m_set_reg_nums[set][0];
+ m_sets[set].registers = m_set_reg_nums[set].data();
}
// sort and unique all value registers and make sure each is terminated with
@@ -492,8 +509,7 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
}
// sort and unique all invalidate registers and make sure each is terminated
- // with
- // LLDB_INVALID_REGNUM
+ // with LLDB_INVALID_REGNUM
for (reg_to_regs_map::iterator pos = m_invalidate_regs_map.begin(),
end = m_invalidate_regs_map.end();
pos != end; ++pos) {
@@ -517,8 +533,8 @@ void DynamicRegisterInfo::Finalize(const ArchSpec &arch) {
m_regs[i].invalidate_regs = NULL;
}
- // Check if we need to automatically set the generic registers in case
- // they weren't set
+ // Check if we need to automatically set the generic registers in case they
+ // weren't set
bool generic_regs_specified = false;
for (const auto &reg : m_regs) {
if (reg.kinds[eRegisterKindGeneric] != LLDB_INVALID_REGNUM) {
@@ -730,11 +746,11 @@ void DynamicRegisterInfo::Dump() const {
}
}
-lldb_private::RegisterInfo *DynamicRegisterInfo::GetRegisterInfo(
- const lldb_private::ConstString &reg_name) {
+const lldb_private::RegisterInfo *DynamicRegisterInfo::GetRegisterInfo(
+ const lldb_private::ConstString &reg_name) const {
for (auto &reg_info : m_regs) {
- // We can use pointer comparison since we used a ConstString to set
- // the "name" member in AddRegister()
+ // We can use pointer comparison since we used a ConstString to set the
+ // "name" member in AddRegister()
if (reg_info.name == reg_name.GetCString()) {
return &reg_info;
}
diff --git a/source/Plugins/Process/Utility/DynamicRegisterInfo.h b/source/Plugins/Process/Utility/DynamicRegisterInfo.h
index 228acfbed4ee..acb3e3eb8a84 100644
--- a/source/Plugins/Process/Utility/DynamicRegisterInfo.h
+++ b/source/Plugins/Process/Utility/DynamicRegisterInfo.h
@@ -23,12 +23,18 @@
class DynamicRegisterInfo {
public:
- DynamicRegisterInfo();
+ DynamicRegisterInfo() = default;
DynamicRegisterInfo(const lldb_private::StructuredData::Dictionary &dict,
const lldb_private::ArchSpec &arch);
- virtual ~DynamicRegisterInfo();
+ virtual ~DynamicRegisterInfo() = default;
+
+ DynamicRegisterInfo(DynamicRegisterInfo &) = delete;
+ void operator=(DynamicRegisterInfo &) = delete;
+
+ DynamicRegisterInfo(DynamicRegisterInfo &&info);
+ DynamicRegisterInfo &operator=(DynamicRegisterInfo &&info);
size_t SetRegisterInfo(const lldb_private::StructuredData::Dictionary &dict,
const lldb_private::ArchSpec &arch);
@@ -75,8 +81,10 @@ protected:
typedef std::vector<uint8_t> dwarf_opcode;
typedef std::map<uint32_t, dwarf_opcode> dynamic_reg_size_map;
- lldb_private::RegisterInfo *
- GetRegisterInfo(const lldb_private::ConstString &reg_name);
+ const lldb_private::RegisterInfo *
+ GetRegisterInfo(const lldb_private::ConstString &reg_name) const;
+
+ void MoveFrom(DynamicRegisterInfo &&info);
reg_collection m_regs;
set_collection m_sets;
@@ -85,9 +93,8 @@ protected:
reg_to_regs_map m_value_regs_map;
reg_to_regs_map m_invalidate_regs_map;
dynamic_reg_size_map m_dynamic_reg_size_map;
- size_t m_reg_data_byte_size; // The number of bytes required to store all
- // registers
- bool m_finalized;
+ size_t m_reg_data_byte_size = 0u; // The number of bytes required to store
+ // all registers
+ bool m_finalized = false;
};
-
#endif // lldb_DynamicRegisterInfo_h_
diff --git a/source/Plugins/Process/Utility/HistoryThread.h b/source/Plugins/Process/Utility/HistoryThread.h
index 363ba2669637..7675a95246a7 100644
--- a/source/Plugins/Process/Utility/HistoryThread.h
+++ b/source/Plugins/Process/Utility/HistoryThread.h
@@ -29,13 +29,13 @@ namespace lldb_private {
//----------------------------------------------------------------------
/// @class HistoryThread HistoryThread.h "HistoryThread.h"
-/// @brief A thread object representing a backtrace from a previous point in the
+/// A thread object representing a backtrace from a previous point in the
/// process execution
///
/// This subclass of Thread is used to provide a backtrace from earlier in
/// process execution. It is given a backtrace list of pc addresses and
-/// optionally a stop_id of when those pc addresses were collected, and it will
-/// create stack frames for them.
+/// optionally a stop_id of when those pc addresses were collected, and it
+/// will create stack frames for them.
//----------------------------------------------------------------------
class HistoryThread : public lldb_private::Thread {
diff --git a/source/Plugins/Process/Utility/InstructionUtils.h b/source/Plugins/Process/Utility/InstructionUtils.h
index e422a96200c8..186d525ce499 100644
--- a/source/Plugins/Process/Utility/InstructionUtils.h
+++ b/source/Plugins/Process/Utility/InstructionUtils.h
@@ -10,6 +10,9 @@
#ifndef lldb_InstructionUtils_h_
#define lldb_InstructionUtils_h_
+#include <cassert>
+#include <cstdint>
+
// Common utilities for manipulating instruction bit fields.
namespace lldb_private {
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h b/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h
new file mode 100644
index 000000000000..ff57464be2de
--- /dev/null
+++ b/source/Plugins/Process/Utility/RegisterContextDarwinConstants.h
@@ -0,0 +1,26 @@
+//===-- RegisterContextDarwinConstants.h ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_REGISTERCONTEXTDARWINCONSTANTS_H
+#define LLDB_REGISTERCONTEXTDARWINCONSTANTS_H
+
+namespace lldb_private {
+
+/// Constants returned by various RegisterContextDarwin_*** functions.
+#ifndef KERN_SUCCESS
+#define KERN_SUCCESS 0
+#endif
+
+#ifndef KERN_INVALID_ARGUMENT
+#define KERN_INVALID_ARGUMENT 4
+#endif
+
+} // namespace lldb_private
+
+#endif // LLDB_REGISTERCONTEXTDARWINCONSTANTS_H
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp b/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
index 64a697ff53c8..5d9ff02fafdd 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_arm.cpp
@@ -7,13 +7,8 @@
//
//===----------------------------------------------------------------------===//
-#if defined(__APPLE__)
-
#include "RegisterContextDarwin_arm.h"
-
-// C Includes
-#include <mach/mach_types.h>
-#include <mach/thread_act.h>
+#include "RegisterContextDarwinConstants.h"
// C++ Includes
// Other libraries and framework includes
@@ -34,7 +29,7 @@
#endif
// Project includes
-#include "ARM_DWARF_Registers.h"
+#include "Utility/ARM_DWARF_Registers.h"
#include "Utility/ARM_ehframe_Registers.h"
#include "llvm/ADT/STLExtras.h"
@@ -968,9 +963,9 @@ const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
//----------------------------------------------------------------------
-// Register set definitions. The first definitions at register set index
-// of zero is for all registers, followed by other registers sets. The
-// register information for the all register set need not be filled in.
+// Register set definitions. The first definitions at register set index of
+// zero is for all registers, followed by other registers sets. The register
+// information for the all register set need not be filled in.
//----------------------------------------------------------------------
static const RegisterSet g_reg_sets[] = {
{
@@ -1510,7 +1505,7 @@ uint32_t RegisterContextDarwin_arm::ConvertRegisterKindToRegisterNumber(
}
uint32_t RegisterContextDarwin_arm::NumSupportedHardwareBreakpoints() {
-#if defined(__arm__)
+#if defined(__APPLE__) && defined(__arm__)
// Set the init value to something that will let us know that we need to
// autodetect how many breakpoints are supported dynamically...
static uint32_t g_num_supported_hw_breakpoints = UINT32_MAX;
@@ -1642,7 +1637,7 @@ bool RegisterContextDarwin_arm::ClearHardwareBreakpoint(uint32_t hw_index) {
}
uint32_t RegisterContextDarwin_arm::NumSupportedHardwareWatchpoints() {
-#if defined(__arm__)
+#if defined(__APPLE__) && defined(__arm__)
// Set the init value to something that will let us know that we need to
// autodetect how many watchpoints are supported dynamically...
static uint32_t g_num_supported_hw_watchpoints = UINT32_MAX;
@@ -1766,5 +1761,3 @@ bool RegisterContextDarwin_arm::ClearHardwareWatchpoint(uint32_t hw_index) {
}
return false;
}
-
-#endif
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp b/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
index 344c08965fad..03ce7ef9f524 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_arm64.cpp
@@ -8,14 +8,8 @@
//
//===----------------------------------------------------------------------===//
-#if defined(__APPLE__)
-
#include "RegisterContextDarwin_arm64.h"
-
-// C Includes
-#include <mach/mach_types.h>
-#include <mach/thread_act.h>
-#include <sys/sysctl.h>
+#include "RegisterContextDarwinConstants.h"
// C++ Includes
// Other libraries and framework includes
@@ -39,7 +33,7 @@
#endif
// Project includes
-#include "ARM64_DWARF_Registers.h"
+#include "Utility/ARM64_DWARF_Registers.h"
using namespace lldb;
using namespace lldb_private;
@@ -149,9 +143,9 @@ const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
//----------------------------------------------------------------------
-// Register set definitions. The first definitions at register set index
-// of zero is for all registers, followed by other registers sets. The
-// register information for the all register set need not be filled in.
+// Register set definitions. The first definitions at register set index of
+// zero is for all registers, followed by other registers sets. The register
+// information for the all register set need not be filled in.
//----------------------------------------------------------------------
static const RegisterSet g_reg_sets[] = {
{
@@ -299,8 +293,9 @@ int RegisterContextDarwin_arm64::WriteRegisterSet(uint32_t set) {
void RegisterContextDarwin_arm64::LogDBGRegisters(Log *log, const DBG &dbg) {
if (log) {
for (uint32_t i = 0; i < 16; i++)
- log->Printf("BVR%-2u/BCR%-2u = { 0x%8.8llx, 0x%8.8llx } WVR%-2u/WCR%-2u "
- "= { 0x%8.8llx, 0x%8.8llx }",
+ log->Printf("BVR%-2u/BCR%-2u = { 0x%8.8" PRIu64 ", 0x%8.8" PRIu64
+ " } WVR%-2u/WCR%-2u "
+ "= { 0x%8.8" PRIu64 ", 0x%8.8" PRIu64 " }",
i, i, dbg.bvr[i], dbg.bcr[i], i, i, dbg.wvr[i], dbg.wcr[i]);
}
}
@@ -921,7 +916,7 @@ uint32_t RegisterContextDarwin_arm64::ConvertRegisterKindToRegisterNumber(
}
uint32_t RegisterContextDarwin_arm64::NumSupportedHardwareWatchpoints() {
-#if defined(__arm64__) || defined(__aarch64__)
+#if defined(__APPLE__) && (defined(__arm64__) || defined(__aarch64__))
// autodetect how many watchpoints are supported dynamically...
static uint32_t g_num_supported_hw_watchpoints = UINT32_MAX;
if (g_num_supported_hw_watchpoints == UINT32_MAX) {
@@ -1043,5 +1038,3 @@ bool RegisterContextDarwin_arm64::ClearHardwareWatchpoint(uint32_t hw_index) {
}
return false;
}
-
-#endif
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp b/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
index c818fad9ac0e..24414211d9aa 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_i386.cpp
@@ -147,9 +147,9 @@ enum {
sizeof(RegisterContextDarwin_i386::FPU))
// These macros will auto define the register name, alt name, register size,
-// register offset, encoding, format and native register. This ensures that
-// the register state structures are defined correctly and have the correct
-// sizes and offsets.
+// register offset, encoding, format and native register. This ensures that the
+// register state structures are defined correctly and have the correct sizes
+// and offsets.
#define DEFINE_GPR(reg, alt) \
#reg, alt, sizeof(((RegisterContextDarwin_i386::GPR *) NULL)->reg), \
GPR_OFFSET(reg), eEncodingUint, eFormatHex
@@ -464,9 +464,9 @@ const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
//----------------------------------------------------------------------
-// Register set definitions. The first definitions at register set index
-// of zero is for all registers, followed by other registers sets. The
-// register information for the all register set need not be filled in.
+// Register set definitions. The first definitions at register set index of
+// zero is for all registers, followed by other registers sets. The register
+// information for the all register set need not be filled in.
//----------------------------------------------------------------------
static const RegisterSet g_reg_sets[] = {
{
@@ -680,8 +680,7 @@ bool RegisterContextDarwin_i386::ReadRegister(const RegisterInfo *reg_info,
case fpu_stmm6:
case fpu_stmm7:
// These values don't fit into scalar types,
- // RegisterContext::ReadRegisterBytes() must be used for these
- // registers
+ // RegisterContext::ReadRegisterBytes() must be used for these registers
//::memcpy (reg_value.value.vector.uint8, fpu.stmm[reg - fpu_stmm0].bytes,
//10);
return false;
@@ -695,8 +694,7 @@ bool RegisterContextDarwin_i386::ReadRegister(const RegisterInfo *reg_info,
case fpu_xmm6:
case fpu_xmm7:
// These values don't fit into scalar types,
- // RegisterContext::ReadRegisterBytes()
- // must be used for these registers
+ // RegisterContext::ReadRegisterBytes() must be used for these registers
//::memcpy (reg_value.value.vector.uint8, fpu.xmm[reg - fpu_xmm0].bytes,
//16);
return false;
@@ -799,8 +797,7 @@ bool RegisterContextDarwin_i386::WriteRegister(const RegisterInfo *reg_info,
case fpu_stmm6:
case fpu_stmm7:
// These values don't fit into scalar types,
- // RegisterContext::ReadRegisterBytes()
- // must be used for these registers
+ // RegisterContext::ReadRegisterBytes() must be used for these registers
::memcpy(fpu.stmm[reg - fpu_stmm0].bytes, value.GetBytes(),
value.GetByteSize());
return false;
@@ -814,8 +811,7 @@ bool RegisterContextDarwin_i386::WriteRegister(const RegisterInfo *reg_info,
case fpu_xmm6:
case fpu_xmm7:
// These values don't fit into scalar types,
- // RegisterContext::ReadRegisterBytes()
- // must be used for these registers
+ // RegisterContext::ReadRegisterBytes() must be used for these registers
::memcpy(fpu.xmm[reg - fpu_xmm0].bytes, value.GetBytes(),
value.GetByteSize());
return false;
diff --git a/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp b/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
index 50e7292f86b1..ecad8240b294 100644
--- a/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextDarwin_x86_64.cpp
@@ -165,9 +165,9 @@ enum ehframe_dwarf_regnums {
sizeof(RegisterContextDarwin_x86_64::FPU))
// These macros will auto define the register name, alt name, register size,
-// register offset, encoding, format and native register. This ensures that
-// the register state structures are defined correctly and have the correct
-// sizes and offsets.
+// register offset, encoding, format and native register. This ensures that the
+// register state structures are defined correctly and have the correct sizes
+// and offsets.
#define DEFINE_GPR(reg, alt) \
#reg, alt, sizeof(((RegisterContextDarwin_x86_64::GPR *) NULL)->reg), \
GPR_OFFSET(reg), eEncodingUint, eFormatHex
@@ -525,9 +525,9 @@ const size_t k_num_fpu_registers = llvm::array_lengthof(g_fpu_regnums);
const size_t k_num_exc_registers = llvm::array_lengthof(g_exc_regnums);
//----------------------------------------------------------------------
-// Register set definitions. The first definitions at register set index
-// of zero is for all registers, followed by other registers sets. The
-// register information for the all register set need not be filled in.
+// Register set definitions. The first definitions at register set index of
+// zero is for all registers, followed by other registers sets. The register
+// information for the all register set need not be filled in.
//----------------------------------------------------------------------
static const RegisterSet g_reg_sets[] = {
{
diff --git a/source/Plugins/Process/Utility/RegisterContextLLDB.cpp b/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
index 5435a02433ab..ba9a8071bcfb 100644
--- a/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -104,8 +104,7 @@ bool RegisterContextLLDB::IsUnwindPlanValidForCurrentPC(
}
// Initialize a RegisterContextLLDB which is the first frame of a stack -- the
-// zeroth frame or currently
-// executing frame.
+// zeroth frame or currently executing frame.
void RegisterContextLLDB::InitializeZerothFrame() {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
@@ -131,25 +130,26 @@ void RegisterContextLLDB::InitializeZerothFrame() {
// Let ABIs fixup code addresses to make sure they are valid. In ARM ABIs
// this will strip bit zero in case we read a PC from memory or from the LR.
// (which would be a no-op in frame 0 where we get it from the register set,
- // but still a good idea to make the call here for other ABIs that may exist.)
+ // but still a good idea to make the call here for other ABIs that may
+ // exist.)
ABI *abi = process->GetABI().get();
if (abi)
current_pc = abi->FixCodeAddress(current_pc);
- // Initialize m_current_pc, an Address object, based on current_pc, an addr_t.
+ // Initialize m_current_pc, an Address object, based on current_pc, an
+ // addr_t.
m_current_pc.SetLoadAddress(current_pc, &process->GetTarget());
// If we don't have a Module for some reason, we're not going to find
- // symbol/function information - just
- // stick in some reasonable defaults and hope we can unwind past this frame.
+ // symbol/function information - just stick in some reasonable defaults and
+ // hope we can unwind past this frame.
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp) {
UnwindLogMsg("using architectural default unwind method");
}
// We require either a symbol or function in the symbols context to be
- // successfully
- // filled in or this context is of no use to us.
+ // successfully filled in or this context is of no use to us.
const uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
if (pc_module_sp.get() && (pc_module_sp->ResolveSymbolContextForAddress(
m_current_pc, resolve_scope, m_sym_ctx) &
@@ -180,18 +180,17 @@ void RegisterContextLLDB::InitializeZerothFrame() {
}
// If we were able to find a symbol/function, set addr_range to the bounds of
- // that symbol/function.
- // else treat the current pc value as the start_pc and record no offset.
+ // that symbol/function. else treat the current pc value as the start_pc and
+ // record no offset.
if (addr_range.GetBaseAddress().IsValid()) {
m_start_pc = addr_range.GetBaseAddress();
if (m_current_pc.GetSection() == m_start_pc.GetSection()) {
m_current_offset = m_current_pc.GetOffset() - m_start_pc.GetOffset();
} else if (m_current_pc.GetModule() == m_start_pc.GetModule()) {
- // This means that whatever symbol we kicked up isn't really correct
- // --- we should not cross section boundaries ... We really should NULL
- // out
- // the function/symbol in this case unless there is a bad assumption
- // here due to inlined functions?
+ // This means that whatever symbol we kicked up isn't really correct ---
+ // we should not cross section boundaries ... We really should NULL out
+ // the function/symbol in this case unless there is a bad assumption here
+ // due to inlined functions?
m_current_offset =
m_current_pc.GetFileAddress() - m_start_pc.GetFileAddress();
}
@@ -266,8 +265,7 @@ void RegisterContextLLDB::InitializeZerothFrame() {
}
// Initialize a RegisterContextLLDB for the non-zeroth frame -- rely on the
-// RegisterContextLLDB "below" it
-// to provide things like its current pc value.
+// RegisterContextLLDB "below" it to provide things like its current pc value.
void RegisterContextLLDB::InitializeNonZerothFrame() {
Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_UNWIND));
@@ -333,8 +331,8 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
m_current_pc.SetLoadAddress(pc, &process->GetTarget(), allow_section_end);
// If we don't have a Module for some reason, we're not going to find
- // symbol/function information - just
- // stick in some reasonable defaults and hope we can unwind past this frame.
+ // symbol/function information - just stick in some reasonable defaults and
+ // hope we can unwind past this frame.
ModuleSP pc_module_sp(m_current_pc.GetModule());
if (!m_current_pc.IsValid() || !pc_module_sp) {
UnwindLogMsg("using architectural default unwind method");
@@ -345,12 +343,10 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
if (process->GetLoadAddressPermissions(pc, permissions) &&
(permissions & ePermissionsExecutable) == 0) {
// If this is the second frame off the stack, we may have unwound the
- // first frame
- // incorrectly. But using the architecture default unwind plan may get us
- // back on
- // track -- albeit possibly skipping a real frame. Give this frame a
- // clearly-invalid
- // pc and see if we can get any further.
+ // first frame incorrectly. But using the architecture default unwind
+ // plan may get us back on track -- albeit possibly skipping a real
+ // frame. Give this frame a clearly-invalid pc and see if we can get any
+ // further.
if (GetNextFrame().get() && GetNextFrame()->IsValid() &&
GetNextFrame()->IsFrameZero()) {
UnwindLogMsg("had a pc of 0x%" PRIx64 " which is not in executable "
@@ -359,8 +355,8 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
(uint64_t)pc);
m_frame_type = eSkipFrame;
} else {
- // anywhere other than the second frame, a non-executable pc means we're
- // off in the weeds -- stop now.
+ // anywhere other than the second frame, a non-executable pc means
+ // we're off in the weeds -- stop now.
m_frame_type = eNotAValidFrame;
UnwindLogMsg("pc is in a non-executable section of memory and this "
"isn't the 2nd frame in the stack walk.");
@@ -399,8 +395,7 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
}
// m_cfa should point into the stack memory; if we can query memory
- // region permissions,
- // see if the memory is allocated & readable.
+ // region permissions, see if the memory is allocated & readable.
if (process->GetLoadAddressPermissions(m_cfa, permissions) &&
(permissions & ePermissionsReadable) == 0) {
m_frame_type = eNotAValidFrame;
@@ -435,19 +430,18 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
bool resolve_tail_call_address = false; // m_current_pc can be one past the
// address range of the function...
- // If the saved pc does not point to a function/symbol because it is
- // beyond the bounds of the correct function and there's no symbol there,
- // we do *not* want ResolveSymbolContextForAddress to back up the pc by 1,
- // because then we might not find the correct unwind information later.
- // Instead, let ResolveSymbolContextForAddress fail, and handle the case
- // via decr_pc_and_recompute_addr_range below.
+ // If the saved pc does not point to a function/symbol because it is beyond
+ // the bounds of the correct function and there's no symbol there, we do
+ // *not* want ResolveSymbolContextForAddress to back up the pc by 1, because
+ // then we might not find the correct unwind information later. Instead, let
+ // ResolveSymbolContextForAddress fail, and handle the case via
+ // decr_pc_and_recompute_addr_range below.
const uint32_t resolve_scope = eSymbolContextFunction | eSymbolContextSymbol;
uint32_t resolved_scope = pc_module_sp->ResolveSymbolContextForAddress(
m_current_pc, resolve_scope, m_sym_ctx, resolve_tail_call_address);
// We require either a symbol or function in the symbols context to be
- // successfully
- // filled in or this context is of no use to us.
+ // successfully filled in or this context is of no use to us.
if (resolve_scope & resolved_scope) {
m_sym_ctx_valid = true;
}
@@ -476,8 +470,7 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
decr_pc_and_recompute_addr_range = true;
// Or if we're in the middle of the stack (and not "above" an asynchronous
- // event like sigtramp),
- // and our "current" pc is the start of a function...
+ // event like sigtramp), and our "current" pc is the start of a function...
if (GetNextFrame()->m_frame_type != eTrapHandlerFrame &&
GetNextFrame()->m_frame_type != eDebuggerFrame &&
(!m_sym_ctx_valid ||
@@ -488,9 +481,8 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
}
// We need to back up the pc by 1 byte and re-search for the Symbol to handle
- // the case where the "saved pc"
- // value is pointing to the next function, e.g. if a function ends with a CALL
- // instruction.
+ // the case where the "saved pc" value is pointing to the next function, e.g.
+ // if a function ends with a CALL instruction.
// FIXME this may need to be an architectural-dependent behavior; if so we'll
// need to add a member function
// to the ABI plugin and consult that.
@@ -516,9 +508,9 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
GetSymbolOrFunctionName(m_sym_ctx).AsCString(""));
}
- // If we were able to find a symbol/function, set addr_range_ptr to the bounds
- // of that symbol/function.
- // else treat the current pc value as the start_pc and record no offset.
+ // If we were able to find a symbol/function, set addr_range_ptr to the
+ // bounds of that symbol/function. else treat the current pc value as the
+ // start_pc and record no offset.
if (addr_range.GetBaseAddress().IsValid()) {
m_start_pc = addr_range.GetBaseAddress();
m_current_offset = pc - m_start_pc.GetLoadAddress(&process->GetTarget());
@@ -553,9 +545,8 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
RegisterKind row_register_kind = eRegisterKindGeneric;
// Try to get by with just the fast UnwindPlan if possible - the full
- // UnwindPlan may be expensive to get
- // (e.g. if we have to parse the entire eh_frame section of an ObjectFile for
- // the first time.)
+ // UnwindPlan may be expensive to get (e.g. if we have to parse the entire
+ // eh_frame section of an ObjectFile for the first time.)
if (m_fast_unwind_plan_sp &&
m_fast_unwind_plan_sp->PlanValidAtAddress(m_current_pc)) {
@@ -616,16 +607,14 @@ void RegisterContextLLDB::InitializeNonZerothFrame() {
bool RegisterContextLLDB::CheckIfLoopingStack() {
// If we have a bad stack setup, we can get the same CFA value multiple times
- // -- or even
- // more devious, we can actually oscillate between two CFA values. Detect that
- // here and
- // break out to avoid a possible infinite loop in lldb trying to unwind the
- // stack.
- // To detect when we have the same CFA value multiple times, we compare the
+ // -- or even more devious, we can actually oscillate between two CFA values.
+ // Detect that here and break out to avoid a possible infinite loop in lldb
+ // trying to unwind the stack. To detect when we have the same CFA value
+ // multiple times, we compare the
// CFA of the current
// frame with the 2nd next frame because in some specail case (e.g. signal
- // hanlders, hand
- // written assembly without ABI compiance) we can have 2 frames with the same
+ // hanlders, hand written assembly without ABI compiance) we can have 2
+ // frames with the same
// CFA (in theory we
// can have arbitrary number of frames with the same CFA, but more then 2 is
// very very unlikely)
@@ -734,15 +723,12 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// If we've done a jmp 0x0 / bl 0x0 (called through a null function pointer)
- // so the pc is 0x0
- // in the zeroth frame, we need to use the "unwind at first instruction" arch
- // default UnwindPlan
- // Also, if this Process can report on memory region attributes, any
- // non-executable region means
- // we jumped through a bad function pointer - handle the same way as 0x0.
- // Note, if we have a symbol context & a symbol, we don't want to follow this
- // code path. This is
- // for jumping to memory regions without any information available.
+ // so the pc is 0x0 in the zeroth frame, we need to use the "unwind at first
+ // instruction" arch default UnwindPlan Also, if this Process can report on
+ // memory region attributes, any non-executable region means we jumped
+ // through a bad function pointer - handle the same way as 0x0. Note, if we
+ // have a symbol context & a symbol, we don't want to follow this code path.
+ // 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)) &&
@@ -780,12 +766,10 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// No FuncUnwinders available for this pc (stripped function symbols, lldb
- // could not augment its
- // function table with another source, like LC_FUNCTION_STARTS or eh_frame in
- // ObjectFileMachO).
- // See if eh_frame or the .ARM.exidx tables have unwind information for this
- // address, else fall
- // back to the architectural default unwind.
+ // could not augment its function table with another source, like
+ // LC_FUNCTION_STARTS or eh_frame in ObjectFileMachO). See if eh_frame or the
+ // .ARM.exidx tables have unwind information for this address, else fall back
+ // to the architectural default unwind.
if (!func_unwinders_sp) {
m_frame_type = eNormalFrame;
@@ -793,7 +777,8 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
!m_current_pc.IsValid())
return arch_default_unwind_plan_sp;
- // Even with -fomit-frame-pointer, we can try eh_frame to get back on track.
+ // Even with -fomit-frame-pointer, we can try eh_frame to get back on
+ // track.
DWARFCallFrameInfo *eh_frame =
pc_module_sp->GetObjectFile()->GetUnwindTable().GetEHFrameInfo();
if (eh_frame) {
@@ -819,11 +804,10 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// If we're in _sigtramp(), unwinding past this frame requires special
- // knowledge. On Mac OS X this knowledge
- // is properly encoded in the eh_frame section, so prefer that if available.
- // On other platforms we may need to provide a platform-specific UnwindPlan
- // which encodes the details of
- // how to unwind out of sigtramp.
+ // knowledge. On Mac OS X this knowledge is properly encoded in the eh_frame
+ // section, so prefer that if available. On other platforms we may need to
+ // provide a platform-specific UnwindPlan which encodes the details of how to
+ // unwind out of sigtramp.
if (m_frame_type == eTrapHandlerFrame && process) {
m_fast_unwind_plan_sp.reset();
unwind_plan_sp = func_unwinders_sp->GetEHFrameUnwindPlan(
@@ -835,24 +819,19 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// Ask the DynamicLoader if the eh_frame CFI should be trusted in this frame
- // even when it's frame zero
- // This comes up if we have hand-written functions in a Module and
- // hand-written eh_frame. The assembly
- // instruction inspection may fail and the eh_frame CFI were probably written
- // with some care to do the
- // right thing. It'd be nice if there was a way to ask the eh_frame directly
- // if it is asynchronous
- // (can be trusted at every instruction point) or synchronous (the normal case
- // - only at call sites).
+ // even when it's frame zero This comes up if we have hand-written functions
+ // in a Module and hand-written eh_frame. The assembly instruction
+ // inspection may fail and the eh_frame CFI were probably written with some
+ // care to do the right thing. It'd be nice if there was a way to ask the
+ // eh_frame directly if it is asynchronous (can be trusted at every
+ // instruction point) or synchronous (the normal case - only at call sites).
// But there is not.
if (process && process->GetDynamicLoader() &&
process->GetDynamicLoader()->AlwaysRelyOnEHUnwindInfo(m_sym_ctx)) {
// We must specifically call the GetEHFrameUnwindPlan() method here --
- // normally we would
- // call GetUnwindPlanAtCallSite() -- because CallSite may return an unwind
- // plan sourced from
- // either eh_frame (that's what we intend) or compact unwind (this won't
- // work)
+ // normally we would call GetUnwindPlanAtCallSite() -- because CallSite may
+ // return an unwind plan sourced from either eh_frame (that's what we
+ // intend) or compact unwind (this won't work)
unwind_plan_sp = func_unwinders_sp->GetEHFrameUnwindPlan(
process->GetTarget(), m_current_offset_backed_up_one);
if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(m_current_pc)) {
@@ -871,22 +850,16 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
if (unwind_plan_sp && unwind_plan_sp->PlanValidAtAddress(m_current_pc)) {
if (unwind_plan_sp->GetSourcedFromCompiler() == eLazyBoolNo) {
// We probably have an UnwindPlan created by inspecting assembly
- // instructions. The
- // assembly profilers work really well with compiler-generated functions
- // but hand-
- // written assembly can be problematic. We set the eh_frame based unwind
- // plan as our
- // fallback unwind plan if instruction emulation doesn't work out even
- // for non call
- // sites if it is available and use the architecture default unwind plan
- // if it is
+ // instructions. The assembly profilers work really well with compiler-
+ // generated functions but hand- written assembly can be problematic.
+ // We set the eh_frame based unwind plan as our fallback unwind plan if
+ // instruction emulation doesn't work out even for non call sites if it
+ // is available and use the architecture default unwind plan if it is
// not available. The eh_frame unwind plan is more reliable even on non
- // call sites
- // then the architecture default plan and for hand written assembly code
- // it is often
- // written in a way that it valid at all location what helps in the most
- // common
- // cases when the instruction emulation fails.
+ // call sites then the architecture default plan and for hand written
+ // assembly code it is often written in a way that it valid at all
+ // location what helps in the most common cases when the instruction
+ // emulation fails.
UnwindPlanSP call_site_unwind_plan =
func_unwinders_sp->GetUnwindPlanAtCallSite(
process->GetTarget(), m_current_offset_backed_up_one);
@@ -919,9 +892,8 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// We'd prefer to use an UnwindPlan intended for call sites when we're at a
- // call site but if we've
- // struck out on that, fall back to using the non-call-site assembly
- // inspection UnwindPlan if possible.
+ // call site but if we've struck out on that, fall back to using the non-
+ // call-site assembly inspection UnwindPlan if possible.
if (process) {
unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtNonCallSite(
process->GetTarget(), m_thread, m_current_offset_backed_up_one);
@@ -929,19 +901,14 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
if (unwind_plan_sp &&
unwind_plan_sp->GetSourcedFromCompiler() == eLazyBoolNo) {
// We probably have an UnwindPlan created by inspecting assembly
- // instructions. The assembly
- // profilers work really well with compiler-generated functions but hand-
- // written assembly
- // can be problematic. We set the eh_frame based unwind plan as our fallback
- // unwind plan if
+ // instructions. The assembly profilers work really well with compiler-
+ // generated functions but hand- written assembly can be problematic. We
+ // set the eh_frame based unwind plan as our fallback unwind plan if
// instruction emulation doesn't work out even for non call sites if it is
- // available and use
- // the architecture default unwind plan if it is not available. The eh_frame
- // unwind plan is
- // more reliable even on non call sites then the architecture default plan
- // and for hand
- // written assembly code it is often written in a way that it valid at all
- // location what
+ // available and use the architecture default unwind plan if it is not
+ // available. The eh_frame unwind plan is more reliable even on non call
+ // sites then the architecture default plan and for hand written assembly
+ // code it is often written in a way that it valid at all location what
// helps in the most common cases when the instruction emulation fails.
UnwindPlanSP call_site_unwind_plan =
func_unwinders_sp->GetUnwindPlanAtCallSite(
@@ -963,8 +930,8 @@ UnwindPlanSP RegisterContextLLDB::GetFullUnwindPlanForFrame() {
}
// If we're on the first instruction of a function, and we have an
- // architectural default UnwindPlan
- // for the initial instruction of a function, use that.
+ // architectural default UnwindPlan for the initial instruction of a
+ // function, use that.
if (m_current_offset_backed_up_one == 0) {
unwind_plan_sp =
func_unwinders_sp->GetUnwindPlanArchitectureDefaultAtFunctionEntry(
@@ -1115,12 +1082,10 @@ bool RegisterContextLLDB::IsValid() const {
}
// After the final stack frame in a stack walk we'll get one invalid
-// (eNotAValidFrame) stack frame --
-// one past the end of the stack walk. But higher-level code will need to tell
-// the differnece between
-// "the unwind plan below this frame failed" versus "we successfully completed
-// the stack walk" so
-// this method helps to disambiguate that.
+// (eNotAValidFrame) stack frame -- one past the end of the stack walk. But
+// higher-level code will need to tell the differnece between "the unwind plan
+// below this frame failed" versus "we successfully completed the stack walk"
+// so this method helps to disambiguate that.
bool RegisterContextLLDB::IsTrapHandlerFrame() const {
return m_frame_type == eTrapHandlerFrame;
@@ -1129,12 +1094,10 @@ bool RegisterContextLLDB::IsTrapHandlerFrame() const {
// A skip frame is a bogus frame on the stack -- but one where we're likely to
// find a real frame farther
// up the stack if we keep looking. It's always the second frame in an unwind
-// (i.e. the first frame after
-// frame zero) where unwinding can be the trickiest. Ideally we'll mark up this
-// frame in some way so the
-// user knows we're displaying bad data and we may have skipped one frame of
-// their real program in the
-// process of getting back on track.
+// (i.e. the first frame after frame zero) where unwinding can be the
+// trickiest. Ideally we'll mark up this frame in some way so the user knows
+// we're displaying bad data and we may have skipped one frame of their real
+// program in the process of getting back on track.
bool RegisterContextLLDB::IsSkipFrame() const {
return m_frame_type == eSkipFrame;
@@ -1231,8 +1194,8 @@ RegisterContextLLDB::SavedLocationForRegister(
RegisterNumber return_address_reg;
// If we're fetching the saved pc and this UnwindPlan defines a
- // ReturnAddress register (e.g. lr on arm),
- // look for the return address register number in the UnwindPlan's row.
+ // ReturnAddress register (e.g. lr on arm), look for the return address
+ // register number in the UnwindPlan's row.
if (pc_regnum.IsValid() && pc_regnum == regnum &&
m_full_unwind_plan_sp->GetReturnAddressRegister() !=
LLDB_INVALID_REGNUM) {
@@ -1272,10 +1235,8 @@ RegisterContextLLDB::SavedLocationForRegister(
}
// This is frame 0 and we're retrieving the PC and it's saved in a Return
- // Address register and
- // it hasn't been saved anywhere yet -- that is, it's still live in the
- // actual register.
- // Handle this specially.
+ // Address register and it hasn't been saved anywhere yet -- that is,
+ // it's still live in the actual register. Handle this specially.
if (have_unwindplan_regloc == false && return_address_reg.IsValid() &&
IsFrameZero()) {
@@ -1298,22 +1259,18 @@ RegisterContextLLDB::SavedLocationForRegister(
}
// If this architecture stores the return address in a register (it
- // defines a Return Address register)
- // and we're on a non-zero stack frame and the Full UnwindPlan says that
- // the pc is stored in the
+ // defines a Return Address register) and we're on a non-zero stack frame
+ // and the Full UnwindPlan says that the pc is stored in the
// RA registers (e.g. lr on arm), then we know that the full unwindplan is
// not trustworthy -- this
// is an impossible situation and the instruction emulation code has
- // likely been misled.
- // If this stack frame meets those criteria, we need to throw away the
- // Full UnwindPlan that the
- // instruction emulation came up with and fall back to the architecture's
- // Default UnwindPlan so
- // the stack walk can get past this point.
+ // likely been misled. If this stack frame meets those criteria, we need
+ // to throw away the Full UnwindPlan that the instruction emulation came
+ // up with and fall back to the architecture's Default UnwindPlan so the
+ // stack walk can get past this point.
// Special note: If the Full UnwindPlan was generated from the compiler,
- // don't second-guess it
- // when we're at a call site location.
+ // don't second-guess it when we're at a call site location.
// arch_default_ra_regnum is the return address register # in the Full
// UnwindPlan register numbering
@@ -1376,11 +1333,10 @@ RegisterContextLLDB::SavedLocationForRegister(
ExecutionContext exe_ctx(m_thread.shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
if (have_unwindplan_regloc == false) {
- // If the UnwindPlan failed to give us an unwind location for this 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.
+ // If the UnwindPlan failed to give us an unwind location for this
+ // 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;
if (abi) {
const RegisterInfo *reg_info =
@@ -1558,24 +1514,19 @@ RegisterContextLLDB::SavedLocationForRegister(
// TryFallbackUnwindPlan() -- this method is a little tricky.
//
// When this is called, the frame above -- the caller frame, the "previous"
-// frame --
-// is invalid or bad.
+// frame -- is invalid or bad.
//
-// Instead of stopping the stack walk here, we'll try a different UnwindPlan and
-// see
-// if we can get a valid frame above us.
+// Instead of stopping the stack walk here, we'll try a different UnwindPlan
+// and see if we can get a valid frame above us.
//
// This most often happens when an unwind plan based on assembly instruction
-// inspection
-// is not correct -- mostly with hand-written assembly functions or functions
-// where the
-// stack frame is set up "out of band", e.g. the kernel saved the register
-// context and
-// then called an asynchronous trap handler like _sigtramp.
+// inspection is not correct -- mostly with hand-written assembly functions or
+// functions where the stack frame is set up "out of band", e.g. the kernel
+// saved the register context and then called an asynchronous trap handler like
+// _sigtramp.
//
// Often in these cases, if we just do a dumb stack walk we'll get past this
-// tricky
-// frame and our usual techniques can continue to be used.
+// tricky frame and our usual techniques can continue to be used.
bool RegisterContextLLDB::TryFallbackUnwindPlan() {
if (m_fallback_unwind_plan_sp.get() == nullptr)
@@ -1591,15 +1542,13 @@ bool RegisterContextLLDB::TryFallbackUnwindPlan() {
}
// If a compiler generated unwind plan failed, trying the arch default
- // unwindplan
- // isn't going to do any better.
+ // unwindplan isn't going to do any better.
if (m_full_unwind_plan_sp->GetSourcedFromCompiler() == eLazyBoolYes)
return false;
- // Get the caller's pc value and our own CFA value.
- // Swap in the fallback unwind plan, re-fetch the caller's pc value and CFA
- // value.
- // If they're the same, then the fallback unwind plan provides no benefit.
+ // Get the caller's pc value and our own CFA value. Swap in the fallback
+ // unwind plan, re-fetch the caller's pc value and CFA value. If they're the
+ // same, then the fallback unwind plan provides no benefit.
RegisterNumber pc_regnum(m_thread, eRegisterKindGeneric,
LLDB_REGNUM_GENERIC_PC);
@@ -1622,23 +1571,18 @@ bool RegisterContextLLDB::TryFallbackUnwindPlan() {
}
// This is a tricky wrinkle! If SavedLocationForRegister() detects a really
- // impossible
- // register location for the full unwind plan, it may call
- // ForceSwitchToFallbackUnwindPlan()
- // which in turn replaces the full unwindplan with the fallback... in short,
- // we're done,
- // we're using the fallback UnwindPlan.
- // We checked if m_fallback_unwind_plan_sp was nullptr at the top -- the only
- // way it
- // became nullptr since then is via SavedLocationForRegister().
+ // impossible register location for the full unwind plan, it may call
+ // ForceSwitchToFallbackUnwindPlan() which in turn replaces the full
+ // unwindplan with the fallback... in short, we're done, we're using the
+ // fallback UnwindPlan. We checked if m_fallback_unwind_plan_sp was nullptr
+ // at the top -- the only way it became nullptr since then is via
+ // SavedLocationForRegister().
if (m_fallback_unwind_plan_sp.get() == nullptr)
return true;
// Switch the full UnwindPlan to be the fallback UnwindPlan. If we decide
- // this isn't
- // working, we need to restore.
- // We'll also need to save & restore the value of the m_cfa ivar. Save is
- // down below a bit in 'old_cfa'.
+ // this isn't working, we need to restore. We'll also need to save & restore
+ // the value of the m_cfa ivar. Save is down below a bit in 'old_cfa'.
UnwindPlanSP original_full_unwind_plan_sp = m_full_unwind_plan_sp;
addr_t old_cfa = m_cfa;
@@ -2049,10 +1993,9 @@ bool RegisterContextLLDB::ReadPC(addr_t &pc) {
// A pc value of 0 or 1 is impossible in the middle of the stack -- it
// indicates the end of a stack walk.
// On the currently executing frame (or such a frame interrupted
- // asynchronously by sigtramp et al) this may
- // occur if code has jumped through a NULL pointer -- we want to be able to
- // unwind past that frame to help
- // find the bug.
+ // asynchronously by sigtramp et al) this may occur if code has jumped
+ // through a NULL pointer -- we want to be able to unwind past that frame
+ // to help find the bug.
ProcessSP process_sp (m_thread.GetProcess());
if (process_sp)
diff --git a/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp b/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
index 2d24bdaed2cd..77c1bea34851 100644
--- a/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextMacOSXFrameBackchain.cpp
@@ -19,7 +19,7 @@
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/StreamString.h"
// Project includes
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
@@ -139,8 +139,8 @@ bool RegisterContextMacOSXFrameBackchain::ReadRegister(
bool RegisterContextMacOSXFrameBackchain::WriteRegister(
const RegisterInfo *reg_info, const RegisterValue &value) {
- // Not supported yet. We could easily add support for this by remembering
- // the address of each entry (it would need to be part of the cursor)
+ // Not supported yet. We could easily add support for this by remembering the
+ // address of each entry (it would need to be part of the cursor)
return false;
}
@@ -154,10 +154,10 @@ bool RegisterContextMacOSXFrameBackchain::ReadAllRegisterValues(
bool RegisterContextMacOSXFrameBackchain::WriteAllRegisterValues(
const lldb::DataBufferSP &data_sp) {
- // Since this class doesn't respond to "ReadAllRegisterValues()", it must
- // not have been the one that saved all the register values. So we just let
- // the thread's register context (the register context for frame zero) do
- // the writing.
+ // Since this class doesn't respond to "ReadAllRegisterValues()", it must not
+ // have been the one that saved all the register values. So we just let the
+ // thread's register context (the register context for frame zero) do the
+ // writing.
return m_thread.GetRegisterContext()->WriteAllRegisterValues(data_sp);
}
diff --git a/source/Plugins/Process/Utility/RegisterContextMemory.cpp b/source/Plugins/Process/Utility/RegisterContextMemory.cpp
index 8f0dfd2a5b50..76189ea781de 100644
--- a/source/Plugins/Process/Utility/RegisterContextMemory.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextMemory.cpp
@@ -32,9 +32,9 @@ RegisterContextMemory::RegisterContextMemory(Thread &thread,
addr_t reg_data_addr)
: RegisterContext(thread, concrete_frame_idx), m_reg_infos(reg_infos),
m_reg_valid(), m_reg_data(), m_reg_data_addr(reg_data_addr) {
- // Resize our vector of bools to contain one bool for every register.
- // We will use these boolean values to know when a register value
- // is valid in m_reg_data.
+ // Resize our vector of bools to contain one bool for every register. We will
+ // use these boolean values to know when a register value is valid in
+ // m_reg_data.
const size_t num_regs = reg_infos.GetNumRegisters();
assert(num_regs > 0);
m_reg_valid.resize(num_regs);
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
index bb3509330eec..352e251e3b64 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_arm.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -20,7 +21,6 @@
#include "lldb/Utility/Endian.h"
#include "llvm/Support/Compiler.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "RegisterContextPOSIX_arm.h"
using namespace lldb;
@@ -107,11 +107,6 @@ RegisterContextPOSIX_arm::RegisterContextPOSIX_arm(
}
::memset(&m_fpr, 0, sizeof m_fpr);
-
- // elf-core yet to support ReadFPR()
- lldb::ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
}
RegisterContextPOSIX_arm::~RegisterContextPOSIX_arm() {}
@@ -142,8 +137,8 @@ size_t RegisterContextPOSIX_arm::GetGPRSize() {
const lldb_private::RegisterInfo *RegisterContextPOSIX_arm::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -199,8 +194,8 @@ bool RegisterContextPOSIX_arm::IsRegisterSetAvailable(size_t set_index) {
return set_index < k_num_register_sets;
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_arm::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
index 89384c8f5190..3ff93cde2347 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_arm64.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -20,7 +21,6 @@
#include "lldb/Utility/Endian.h"
#include "llvm/Support/Compiler.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "RegisterContextPOSIX_arm64.h"
using namespace lldb;
@@ -126,11 +126,6 @@ RegisterContextPOSIX_arm64::RegisterContextPOSIX_arm64(
}
::memset(&m_fpr, 0, sizeof m_fpr);
-
- // elf-core yet to support ReadFPR()
- lldb::ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
}
RegisterContextPOSIX_arm64::~RegisterContextPOSIX_arm64() {}
@@ -162,8 +157,8 @@ size_t RegisterContextPOSIX_arm64::GetGPRSize() {
const lldb_private::RegisterInfo *
RegisterContextPOSIX_arm64::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -219,8 +214,8 @@ bool RegisterContextPOSIX_arm64::IsRegisterSetAvailable(size_t set_index) {
return set_index < k_num_register_sets;
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_arm64::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
index 6a55947ba5c2..98d1e6fa8817 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_mips64.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -20,11 +21,10 @@
#include "lldb/Utility/Endian.h"
#include "llvm/Support/Compiler.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "RegisterContextPOSIX_mips64.h"
#include "RegisterContextFreeBSD_mips64.h"
#include "RegisterContextLinux_mips64.h"
-#include "RegisterContextLinux_mips.h"
+#include "RegisterContextLinux_mips.h"
using namespace lldb_private;
using namespace lldb;
@@ -59,11 +59,6 @@ RegisterContextPOSIX_mips64::RegisterContextPOSIX_mips64(
static_cast<uint32_t>(m_registers_count[gpr_registers_count] +
m_registers_count[fpr_registers_count] +
m_registers_count[msa_registers_count]));
-
- // elf-core yet to support ReadFPR()
- ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
}
RegisterContextPOSIX_mips64::~RegisterContextPOSIX_mips64() {}
@@ -92,8 +87,8 @@ size_t RegisterContextPOSIX_mips64::GetGPRSize() {
const RegisterInfo *RegisterContextPOSIX_mips64::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -172,8 +167,8 @@ bool RegisterContextPOSIX_mips64::IsRegisterSetAvailable(size_t set_index) {
return (set_index < num_sets);
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_mips64::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = m_num_registers;
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
index c2b73e226165..9f0552539723 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_powerpc.cpp
@@ -14,6 +14,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -21,7 +22,6 @@
#include "lldb/Utility/Endian.h"
#include "llvm/Support/Compiler.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "RegisterContextPOSIX_powerpc.h"
using namespace lldb_private;
@@ -95,11 +95,6 @@ RegisterContextPOSIX_powerpc::RegisterContextPOSIX_powerpc(
RegisterInfoInterface *register_info)
: RegisterContext(thread, concrete_frame_idx) {
m_register_info_ap.reset(register_info);
-
- // elf-core yet to support ReadFPR()
- ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
}
RegisterContextPOSIX_powerpc::~RegisterContextPOSIX_powerpc() {}
@@ -129,8 +124,8 @@ size_t RegisterContextPOSIX_powerpc::GetGPRSize() {
const RegisterInfo *RegisterContextPOSIX_powerpc::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -181,8 +176,8 @@ bool RegisterContextPOSIX_powerpc::IsRegisterSetAvailable(size_t set_index) {
return (set_index < num_sets);
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_powerpc::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
index de410f063b53..41ae5ec6b51a 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_ppc64le.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/RegisterValue.h"
#include "lldb/Core/Scalar.h"
+#include "lldb/Target/Process.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Utility/DataBufferHeap.h"
@@ -20,7 +21,6 @@
#include "lldb/Utility/Endian.h"
#include "llvm/Support/Compiler.h"
-#include "Plugins/Process/elf-core/ProcessElfCore.h"
#include "RegisterContextPOSIX_ppc64le.h"
using namespace lldb_private;
@@ -117,10 +117,6 @@ RegisterContextPOSIX_ppc64le::RegisterContextPOSIX_ppc64le(
RegisterInfoInterface *register_info)
: RegisterContext(thread, concrete_frame_idx) {
m_register_info_ap.reset(register_info);
-
- ProcessSP base = CalculateProcess();
- if (base.get()->GetPluginName() == ProcessElfCore::GetPluginNameStatic())
- return;
}
void RegisterContextPOSIX_ppc64le::InvalidateAllRegisters() {}
@@ -146,8 +142,8 @@ size_t RegisterContextPOSIX_ppc64le::GetGPRSize() {
const RegisterInfo *RegisterContextPOSIX_ppc64le::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -198,8 +194,8 @@ bool RegisterContextPOSIX_ppc64le::IsRegisterSetAvailable(size_t set_index) {
return (set_index < num_sets);
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_ppc64le::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
index b3365ee2f098..662ac38405ef 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_s390x.cpp
@@ -174,8 +174,8 @@ lldb::ByteOrder RegisterContextPOSIX_s390x::GetByteOrder() {
return byte_order;
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_s390x::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp b/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
index 41cec8add987..d2a06e1b7897 100644
--- a/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
+++ b/source/Plugins/Process/Utility/RegisterContextPOSIX_x86.cpp
@@ -414,8 +414,8 @@ size_t RegisterContextPOSIX_x86::GetFXSAVEOffset() {
const RegisterInfo *RegisterContextPOSIX_x86::GetRegisterInfo() {
// Commonly, this method is overridden and g_register_infos is copied and
- // specialized.
- // So, use GetRegisterInfo() rather than g_register_infos in this scope.
+ // specialized. So, use GetRegisterInfo() rather than g_register_infos in
+ // this scope.
return m_register_info_ap->GetRegisterInfo();
}
@@ -531,8 +531,8 @@ bool RegisterContextPOSIX_x86::IsRegisterSetAvailable(size_t set_index) {
return (set_index < num_sets);
}
-// Used when parsing DWARF and EH frame information and any other
-// object file sections that contain register numbers in them.
+// Used when parsing DWARF and EH frame information and any other object file
+// sections that contain register numbers in them.
uint32_t RegisterContextPOSIX_x86::ConvertRegisterKindToRegisterNumber(
lldb::RegisterKind kind, uint32_t num) {
const uint32_t num_regs = GetRegisterCount();
diff --git a/source/Plugins/Process/Utility/RegisterInfoInterface.h b/source/Plugins/Process/Utility/RegisterInfoInterface.h
index 1894b5368122..5d7ad89ad394 100644
--- a/source/Plugins/Process/Utility/RegisterInfoInterface.h
+++ b/source/Plugins/Process/Utility/RegisterInfoInterface.h
@@ -19,7 +19,7 @@ namespace lldb_private {
///------------------------------------------------------------------------------
/// @class RegisterInfoInterface
///
-/// @brief RegisterInfo interface to patch RegisterInfo structure for archs.
+/// RegisterInfo interface to patch RegisterInfo structure for archs.
///------------------------------------------------------------------------------
class RegisterInfoInterface {
public:
diff --git a/source/Plugins/Process/Utility/RegisterInfos_ppc64.h b/source/Plugins/Process/Utility/RegisterInfos_ppc64.h
new file mode 100644
index 000000000000..69f00e4ba885
--- /dev/null
+++ b/source/Plugins/Process/Utility/RegisterInfos_ppc64.h
@@ -0,0 +1,331 @@
+//===-- RegisterInfos_ppc64.h -----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifdef DECLARE_REGISTER_INFOS_PPC64_STRUCT
+
+// C Includes
+#include <stddef.h>
+
+// Computes the offset of the given GPR_PPC64 in the user data area.
+#define GPR_PPC64_OFFSET(regname) (offsetof(GPR_PPC64, regname))
+#define FPR_PPC64_OFFSET(regname) (offsetof(FPR_PPC64, regname) \
+ + sizeof(GPR_PPC64))
+#define VMX_PPC64_OFFSET(regname) (offsetof(VMX_PPC64, regname) \
+ + sizeof(GPR_PPC64) + sizeof(FPR_PPC64))
+#define GPR_PPC64_SIZE(regname) (sizeof(((GPR_PPC64 *)NULL)->regname))
+
+#include "Utility/PPC64_DWARF_Registers.h"
+#include "lldb-ppc64-register-enums.h"
+
+// Note that the size and offset will be updated by platform-specific classes.
+#define DEFINE_GPR_PPC64(reg, alt, lldb_kind) \
+ { \
+ #reg, alt, GPR_PPC64_SIZE(reg), GPR_PPC64_OFFSET(reg), lldb::eEncodingUint,\
+ lldb::eFormatHex, \
+ {ppc64_dwarf::dwarf_##reg##_ppc64, \
+ ppc64_dwarf::dwarf_##reg##_ppc64, \
+ lldb_kind, \
+ LLDB_INVALID_REGNUM, \
+ gpr_##reg##_ppc64 }, \
+ NULL, NULL, NULL, 0 \
+ }
+#define DEFINE_FPR_PPC64(reg, alt, lldb_kind) \
+ { \
+#reg, alt, 8, FPR_PPC64_OFFSET(reg), lldb::eEncodingIEEE754, \
+ lldb::eFormatFloat, \
+ {ppc64_dwarf::dwarf_##reg##_ppc64, \
+ ppc64_dwarf::dwarf_##reg##_ppc64, lldb_kind, LLDB_INVALID_REGNUM, \
+ fpr_##reg##_ppc64 }, \
+ NULL, NULL, NULL, 0 \
+ }
+#define DEFINE_VMX_PPC64(reg, lldb_kind) \
+ { \
+#reg, NULL, 16, VMX_PPC64_OFFSET(reg), lldb::eEncodingVector, \
+ lldb::eFormatVectorOfUInt32, \
+ {ppc64_dwarf::dwarf_##reg##_ppc64, \
+ ppc64_dwarf::dwarf_##reg##_ppc64, lldb_kind, LLDB_INVALID_REGNUM, \
+ vmx_##reg##_ppc64 }, \
+ NULL, NULL, NULL, 0 \
+ }
+
+// General purpose registers.
+// EH_Frame, Generic, Process Plugin
+#define PPC64_REGS \
+ DEFINE_GPR_PPC64(r0, NULL, LLDB_INVALID_REGNUM) \
+ , DEFINE_GPR_PPC64(r1, "sp", LLDB_REGNUM_GENERIC_SP), \
+ DEFINE_GPR_PPC64(r2, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r3, "arg1", LLDB_REGNUM_GENERIC_ARG1), \
+ DEFINE_GPR_PPC64(r4, "arg2", LLDB_REGNUM_GENERIC_ARG2), \
+ DEFINE_GPR_PPC64(r5, "arg3", LLDB_REGNUM_GENERIC_ARG3), \
+ DEFINE_GPR_PPC64(r6, "arg4", LLDB_REGNUM_GENERIC_ARG4), \
+ DEFINE_GPR_PPC64(r7, "arg5", LLDB_REGNUM_GENERIC_ARG5), \
+ DEFINE_GPR_PPC64(r8, "arg6", LLDB_REGNUM_GENERIC_ARG6), \
+ DEFINE_GPR_PPC64(r9, "arg7", LLDB_REGNUM_GENERIC_ARG7), \
+ DEFINE_GPR_PPC64(r10, "arg8", LLDB_REGNUM_GENERIC_ARG8), \
+ DEFINE_GPR_PPC64(r11, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r12, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r13, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r14, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r15, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r16, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r17, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r18, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r19, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r20, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r21, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r22, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r23, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r24, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r25, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r26, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r27, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r28, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r29, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r30, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(r31, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(cr, "cr", LLDB_REGNUM_GENERIC_FLAGS), \
+ DEFINE_GPR_PPC64(msr, "msr", LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(xer, "xer", LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(lr, "lr", LLDB_REGNUM_GENERIC_RA), \
+ DEFINE_GPR_PPC64(ctr, "ctr", LLDB_INVALID_REGNUM), \
+ DEFINE_GPR_PPC64(pc, "pc", LLDB_REGNUM_GENERIC_PC), \
+ DEFINE_FPR_PPC64(f0, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f1, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f2, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f3, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f4, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f5, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f6, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f7, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f8, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f9, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f10, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f11, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f12, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f13, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f14, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f15, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f16, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f17, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f18, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f19, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f20, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f21, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f22, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f23, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f24, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f25, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f26, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f27, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f28, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f29, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f30, NULL, LLDB_INVALID_REGNUM), \
+ DEFINE_FPR_PPC64(f31, NULL, LLDB_INVALID_REGNUM), \
+ {"fpscr", \
+ NULL, \
+ 8, \
+ FPR_PPC64_OFFSET(fpscr), \
+ lldb::eEncodingUint, \
+ lldb::eFormatHex, \
+ {ppc64_dwarf::dwarf_fpscr_ppc64, \
+ ppc64_dwarf::dwarf_fpscr_ppc64, LLDB_INVALID_REGNUM, \
+ LLDB_INVALID_REGNUM, fpr_fpscr_ppc64}, \
+ NULL, \
+ NULL, \
+ NULL, \
+ 0}, \
+ DEFINE_VMX_PPC64(vr0, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr1, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr2, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr3, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr4, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr5, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr6, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr7, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr8, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr9, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr10, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr11, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr12, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr13, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr14, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr15, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr16, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr17, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr18, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr19, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr20, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr21, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr22, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr23, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr24, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr25, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr26, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr27, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr28, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr29, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr30, LLDB_INVALID_REGNUM), \
+ DEFINE_VMX_PPC64(vr31, LLDB_INVALID_REGNUM), \
+ {"vscr", \
+ NULL, \
+ 4, \
+ VMX_PPC64_OFFSET(vscr), \
+ lldb::eEncodingUint, \
+ lldb::eFormatHex, \
+ {ppc64_dwarf::dwarf_vscr_ppc64, ppc64_dwarf::dwarf_vscr_ppc64, \
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, vmx_vscr_ppc64}, \
+ NULL, \
+ NULL, \
+ NULL, \
+ 0}, \
+ {"vrsave", \
+ NULL, \
+ 4, \
+ VMX_PPC64_OFFSET(vrsave), \
+ lldb::eEncodingUint, \
+ lldb::eFormatHex, \
+ {ppc64_dwarf::dwarf_vrsave_ppc64, \
+ ppc64_dwarf::dwarf_vrsave_ppc64, LLDB_INVALID_REGNUM, \
+ LLDB_INVALID_REGNUM, vmx_vrsave_ppc64}, \
+ NULL, \
+ NULL, \
+ NULL, \
+ 0}, /* */
+
+typedef struct _GPR_PPC64 {
+ uint64_t r0;
+ uint64_t r1;
+ uint64_t r2;
+ uint64_t r3;
+ uint64_t r4;
+ uint64_t r5;
+ uint64_t r6;
+ uint64_t r7;
+ uint64_t r8;
+ uint64_t r9;
+ uint64_t r10;
+ uint64_t r11;
+ uint64_t r12;
+ uint64_t r13;
+ uint64_t r14;
+ uint64_t r15;
+ uint64_t r16;
+ uint64_t r17;
+ uint64_t r18;
+ uint64_t r19;
+ uint64_t r20;
+ uint64_t r21;
+ uint64_t r22;
+ uint64_t r23;
+ uint64_t r24;
+ uint64_t r25;
+ uint64_t r26;
+ uint64_t r27;
+ uint64_t r28;
+ uint64_t r29;
+ uint64_t r30;
+ uint64_t r31;
+ uint64_t cr;
+ uint64_t msr;
+ uint64_t xer;
+ uint64_t lr;
+ uint64_t ctr;
+ uint64_t pc;
+ uint64_t pad[3];
+} GPR_PPC64;
+
+typedef struct _FPR_PPC64 {
+ uint64_t f0;
+ uint64_t f1;
+ uint64_t f2;
+ uint64_t f3;
+ uint64_t f4;
+ uint64_t f5;
+ uint64_t f6;
+ uint64_t f7;
+ uint64_t f8;
+ uint64_t f9;
+ uint64_t f10;
+ uint64_t f11;
+ uint64_t f12;
+ uint64_t f13;
+ uint64_t f14;
+ uint64_t f15;
+ uint64_t f16;
+ uint64_t f17;
+ uint64_t f18;
+ uint64_t f19;
+ uint64_t f20;
+ uint64_t f21;
+ uint64_t f22;
+ uint64_t f23;
+ uint64_t f24;
+ uint64_t f25;
+ uint64_t f26;
+ uint64_t f27;
+ uint64_t f28;
+ uint64_t f29;
+ uint64_t f30;
+ uint64_t f31;
+ uint64_t fpscr;
+} FPR_PPC64;
+
+typedef struct _VMX_PPC64 {
+ uint32_t vr0[4];
+ uint32_t vr1[4];
+ uint32_t vr2[4];
+ uint32_t vr3[4];
+ uint32_t vr4[4];
+ uint32_t vr5[4];
+ uint32_t vr6[4];
+ uint32_t vr7[4];
+ uint32_t vr8[4];
+ uint32_t vr9[4];
+ uint32_t vr10[4];
+ uint32_t vr11[4];
+ uint32_t vr12[4];
+ uint32_t vr13[4];
+ uint32_t vr14[4];
+ uint32_t vr15[4];
+ uint32_t vr16[4];
+ uint32_t vr17[4];
+ uint32_t vr18[4];
+ uint32_t vr19[4];
+ uint32_t vr20[4];
+ uint32_t vr21[4];
+ uint32_t vr22[4];
+ uint32_t vr23[4];
+ uint32_t vr24[4];
+ uint32_t vr25[4];
+ uint32_t vr26[4];
+ uint32_t vr27[4];
+ uint32_t vr28[4];
+ uint32_t vr29[4];
+ uint32_t vr30[4];
+ uint32_t vr31[4];
+ uint32_t pad[2];
+ uint32_t vscr[2];
+ uint32_t vrsave;
+} VMX_PPC64;
+
+
+static lldb_private::RegisterInfo g_register_infos_ppc64[] = {
+ PPC64_REGS
+};
+
+static_assert((sizeof(g_register_infos_ppc64) /
+ sizeof(g_register_infos_ppc64[0])) ==
+ k_num_registers_ppc64,
+ "g_register_infos_powerpc64 has wrong number of register infos");
+
+#undef DEFINE_FPR_PPC64
+#undef DEFINE_GPR_PPC64
+#undef DEFINE_VMX_PPC64
+
+#endif // DECLARE_REGISTER_INFOS_PPC64_STRUCT
diff --git a/source/Plugins/Process/Utility/StopInfoMachException.cpp b/source/Plugins/Process/Utility/StopInfoMachException.cpp
index 3e860874183c..3dbfe611e713 100644
--- a/source/Plugins/Process/Utility/StopInfoMachException.cpp
+++ b/source/Plugins/Process/Utility/StopInfoMachException.cpp
@@ -356,8 +356,8 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
if (exc_code == 0x10003) // EXC_SOFT_SIGNAL
{
if (exc_sub_code == 5) {
- // On MacOSX, a SIGTRAP can signify that a process has called
- // exec, so we should check with our dynamic loader to verify.
+ // On MacOSX, a SIGTRAP can signify that a process has called exec,
+ // so we should check with our dynamic loader to verify.
ProcessSP process_sp(thread.GetProcess());
if (process_sp) {
DynamicLoader *dynamic_loader = process_sp->GetDynamicLoader();
@@ -403,10 +403,8 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
if (!exc_sub_code) {
// This looks like a plain trap.
// Have to check if there is a breakpoint here as well. When you
- // single-step onto a trap,
- // the single step stops you not to trap. Since we also do that
- // check below, let's just use
- // that logic.
+ // single-step onto a trap, the single step stops you not to trap.
+ // Since we also do that check below, let's just use that logic.
is_actual_breakpoint = true;
is_trace_if_actual_breakpoint_missing = true;
} else {
@@ -419,8 +417,8 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
(lldb::addr_t)exc_sub_code);
if (wp_sp && wp_sp->IsEnabled()) {
// Debugserver may piggyback the hardware index of the fired
- // watchpoint in the exception data.
- // Set the hardware index if that's the case.
+ // watchpoint in the exception data. Set the hardware index if
+ // that's the case.
if (exc_data_count >= 3)
wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
return StopInfo::CreateStopReasonWithWatchpointID(thread,
@@ -450,16 +448,15 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
if (exc_code == 0x102) // EXC_ARM_DA_DEBUG
{
// It's a watchpoint, then, if the exc_sub_code indicates a
- // known/enabled
- // data break address from our watchpoint list.
+ // known/enabled data break address from our watchpoint list.
lldb::WatchpointSP wp_sp;
if (target)
wp_sp = target->GetWatchpointList().FindByAddress(
(lldb::addr_t)exc_sub_code);
if (wp_sp && wp_sp->IsEnabled()) {
// Debugserver may piggyback the hardware index of the fired
- // watchpoint in the exception data.
- // Set the hardware index if that's the case.
+ // watchpoint in the exception data. Set the hardware index if
+ // that's the case.
if (exc_data_count >= 3)
wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
return StopInfo::CreateStopReasonWithWatchpointID(thread,
@@ -473,9 +470,9 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
is_actual_breakpoint = true;
is_trace_if_actual_breakpoint_missing = true;
} else if (exc_code == 0) // FIXME not EXC_ARM_BREAKPOINT but a kernel
- // is currently returning this so accept it as
- // indicating a breakpoint until the kernel is
- // fixed
+ // is currently returning this so accept it
+ // as indicating a breakpoint until the
+ // kernel is fixed
{
is_actual_breakpoint = true;
is_trace_if_actual_breakpoint_missing = true;
@@ -493,16 +490,15 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
if (exc_code == 0x102) // EXC_ARM_DA_DEBUG
{
// It's a watchpoint, then, if the exc_sub_code indicates a
- // known/enabled
- // data break address from our watchpoint list.
+ // known/enabled data break address from our watchpoint list.
lldb::WatchpointSP wp_sp;
if (target)
wp_sp = target->GetWatchpointList().FindByAddress(
(lldb::addr_t)exc_sub_code);
if (wp_sp && wp_sp->IsEnabled()) {
// Debugserver may piggyback the hardware index of the fired
- // watchpoint in the exception data.
- // Set the hardware index if that's the case.
+ // watchpoint in the exception data. Set the hardware index if
+ // that's the case.
if (exc_data_count >= 3)
wp_sp->SetHardwareIndex((uint32_t)exc_sub_sub_code);
return StopInfo::CreateStopReasonWithWatchpointID(thread,
@@ -514,8 +510,7 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
return StopInfo::CreateStopReasonToTrace(thread);
}
// It looks like exc_sub_code has the 4 bytes of the instruction that
- // triggered the
- // exception, i.e. our breakpoint opcode
+ // triggered the exception, i.e. our breakpoint opcode
is_actual_breakpoint = exc_code == 1;
break;
}
@@ -534,23 +529,21 @@ StopInfoSP StopInfoMachException::CreateStopReasonWithMachException(
if (process_sp)
bp_site_sp = process_sp->GetBreakpointSiteList().FindByAddress(pc);
if (bp_site_sp && bp_site_sp->IsEnabled()) {
- // Update the PC if we were asked to do so, but only do
- // so if we find a breakpoint that we know about cause
- // this could be a trap instruction in the code
+ // Update the PC if we were asked to do so, but only do so if we find
+ // a breakpoint that we know about cause this could be a trap
+ // instruction in the code
if (pc_decrement > 0 && adjust_pc_if_needed)
reg_ctx_sp->SetPC(pc);
// If the breakpoint is for this thread, then we'll report the hit,
- // but if it is for another thread,
- // we can just report no reason. We don't need to worry about
- // stepping over the breakpoint here, that
+ // but if it is for another thread, we can just report no reason. We
+ // don't need to worry about stepping over the breakpoint here, that
// will be taken care of when the thread resumes and notices that
- // there's a breakpoint under the pc.
- // If we have an operating system plug-in, we might have set a thread
- // specific breakpoint using the
+ // there's a breakpoint under the pc. If we have an operating system
+ // plug-in, we might have set a thread specific breakpoint using the
// operating system thread ID, so we can't make any assumptions about
- // the thread ID so we must always
- // report the breakpoint regardless of the thread.
+ // the thread ID so we must always report the breakpoint regardless
+ // of the thread.
if (bp_site_sp->ValidForThisThread(&thread) ||
thread.GetProcess()->GetOperatingSystem() != NULL)
return StopInfo::CreateStopReasonWithBreakpointSiteID(
diff --git a/source/Plugins/Process/Utility/ThreadMemory.cpp b/source/Plugins/Process/Utility/ThreadMemory.cpp
index 5ff928c69e59..0c7c195815a4 100644
--- a/source/Plugins/Process/Utility/ThreadMemory.cpp
+++ b/source/Plugins/Process/Utility/ThreadMemory.cpp
@@ -62,7 +62,7 @@ ThreadMemory::CreateRegisterContextForFrame(StackFrame *frame) {
reg_ctx_sp = GetRegisterContext();
} else {
Unwind *unwinder = GetUnwinder();
- if (unwinder)
+ if (unwinder != nullptr)
reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
diff --git a/source/Plugins/Process/Utility/UnwindLLDB.cpp b/source/Plugins/Process/Utility/UnwindLLDB.cpp
index 2b34bddd90b2..55559f07f1e5 100644
--- a/source/Plugins/Process/Utility/UnwindLLDB.cpp
+++ b/source/Plugins/Process/Utility/UnwindLLDB.cpp
@@ -132,16 +132,12 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
// We want to detect an unwind that cycles erroneously and stop backtracing.
// Don't want this maximum unwind limit to be too low -- if you have a
- // backtrace
- // with an "infinitely recursing" bug, it will crash when the stack blows out
- // and the first 35,000 frames are uninteresting - it's the top most 5 frames
- // that
- // you actually care about. So you can't just cap the unwind at 10,000 or
- // something.
- // Realistically anything over around 200,000 is going to blow out the stack
- // space.
- // If we're still unwinding at that point, we're probably never going to
- // finish.
+ // backtrace with an "infinitely recursing" bug, it will crash when the stack
+ // blows out and the first 35,000 frames are uninteresting - it's the top
+ // most 5 frames that you actually care about. So you can't just cap the
+ // unwind at 10,000 or something. Realistically anything over around 200,000
+ // is going to blow out the stack space. If we're still unwinding at that
+ // point, we're probably never going to finish.
if (cur_idx > 300000) {
if (log)
log->Printf("%*sFrame %d unwound too many frames, assuming unwind has "
@@ -152,13 +148,12 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
if (reg_ctx_sp.get() == NULL) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
- // that and return
- // true. Subsequent calls to TryFallbackUnwindPlan() will return false.
+ // that and return true. Subsequent calls to TryFallbackUnwindPlan() will
+ // return false.
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be updated.
- // Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of prev_frame
+ // still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -172,15 +167,13 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
}
if (!reg_ctx_sp->IsValid()) {
- // We failed to get a valid RegisterContext.
- // See if the regctx below this on the stack has a fallback unwind plan it
- // can use.
- // Subsequent calls to TryFallbackUnwindPlan() will return false.
+ // We failed to get a valid RegisterContext. See if the regctx below this
+ // on the stack has a fallback unwind plan it can use. Subsequent calls to
+ // TryFallbackUnwindPlan() will return false.
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be updated.
- // Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of prev_frame
+ // still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -195,13 +188,12 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
}
if (!reg_ctx_sp->GetCFA(cursor_sp->cfa)) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
- // that and return
- // true. Subsequent calls to TryFallbackUnwindPlan() will return false.
+ // that and return true. Subsequent calls to TryFallbackUnwindPlan() will
+ // return false.
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be updated.
- // Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of prev_frame
+ // still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -216,27 +208,21 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
}
if (abi && !abi->CallFrameAddressIsValid(cursor_sp->cfa)) {
// On Mac OS X, the _sigtramp asynchronous signal trampoline frame may not
- // have
- // its (constructed) CFA aligned correctly -- don't do the abi alignment
- // check for
- // these.
+ // have its (constructed) CFA aligned correctly -- don't do the abi
+ // alignment check for these.
if (reg_ctx_sp->IsTrapHandlerFrame() == false) {
// See if we can find a fallback unwind plan for THIS frame. It may be
// that the UnwindPlan we're using for THIS frame was bad and gave us a
- // bad CFA.
- // If that's not it, then see if we can change the UnwindPlan for the
- // frame
- // below us ("NEXT") -- see if using that other UnwindPlan gets us a
- // better
- // unwind state.
+ // bad CFA. If that's not it, then see if we can change the UnwindPlan
+ // for the frame below us ("NEXT") -- see if using that other UnwindPlan
+ // gets us a better unwind state.
if (reg_ctx_sp->TryFallbackUnwindPlan() == false ||
reg_ctx_sp->GetCFA(cursor_sp->cfa) == false ||
abi->CallFrameAddressIsValid(cursor_sp->cfa) == false) {
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be
- // updated. Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of
+ // prev_frame still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -259,13 +245,12 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
}
if (!reg_ctx_sp->ReadPC(cursor_sp->start_pc)) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
- // that and return
- // true. Subsequent calls to TryFallbackUnwindPlan() will return false.
+ // that and return true. Subsequent calls to TryFallbackUnwindPlan() will
+ // return false.
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be updated.
- // Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of prev_frame
+ // still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -280,13 +265,12 @@ UnwindLLDB::CursorSP UnwindLLDB::GetOneMoreFrame(ABI *abi) {
}
if (abi && !abi->CodeAddressIsValid(cursor_sp->start_pc)) {
// If the RegisterContextLLDB has a fallback UnwindPlan, it will switch to
- // that and return
- // true. Subsequent calls to TryFallbackUnwindPlan() will return false.
+ // that and return true. Subsequent calls to TryFallbackUnwindPlan() will
+ // return false.
if (prev_frame->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// TryFallbackUnwindPlan for prev_frame succeeded and updated
- // reg_ctx_lldb_sp field of
- // prev_frame. However, cfa field of prev_frame still needs to be updated.
- // Hence updating it.
+ // reg_ctx_lldb_sp field of prev_frame. However, cfa field of prev_frame
+ // still needs to be updated. Hence updating it.
if (!(prev_frame->reg_ctx_lldb_sp->GetCFA(prev_frame->cfa)))
return nullptr;
@@ -320,13 +304,12 @@ void UnwindLLDB::UpdateUnwindPlanForFirstFrameIfInvalid(ABI *abi) {
CursorSP old_m_candidate_frame = m_candidate_frame;
// Try to unwind 2 more frames using the Unwinder. It uses Full UnwindPlan
- // and if Full UnwindPlan fails, then uses FallBack UnwindPlan. Also
- // update the cfa of Frame 0 (if required).
+ // and if Full UnwindPlan fails, then uses FallBack UnwindPlan. Also update
+ // the cfa of Frame 0 (if required).
AddOneMoreFrame(abi);
- // Remove all the frames added by above function as the purpose of
- // using above function was just to check whether Unwinder of Frame 0
- // works or not.
+ // Remove all the frames added by above function as the purpose of using
+ // above function was just to check whether Unwinder of Frame 0 works or not.
for (uint32_t i = 1; i < m_frames.size(); i++)
m_frames.pop_back();
@@ -362,51 +345,44 @@ bool UnwindLLDB::AddOneMoreFrame(ABI *abi) {
m_frames.push_back(new_frame);
- // If we can get one more frame further then accept that we get back a correct
- // frame.
+ // If we can get one more frame further then accept that we get back a
+ // correct frame.
m_candidate_frame = GetOneMoreFrame(abi);
if (m_candidate_frame)
return true;
// We can't go further from the frame returned by GetOneMore frame. Lets try
- // to get a
- // different frame with using the fallback unwind plan.
+ // to get a different frame with using the fallback unwind plan.
if (!m_frames[m_frames.size() - 2]
->reg_ctx_lldb_sp->TryFallbackUnwindPlan()) {
// We don't have a valid fallback unwind plan. Accept the frame as it is.
- // This is a
- // valid situation when we are at the bottom of the stack.
+ // This is a valid situation when we are at the bottom of the stack.
return true;
}
// Remove the possibly incorrect frame from the frame list and try to add a
- // different one with
- // the newly selected fallback unwind plan.
+ // different one with the newly selected fallback unwind plan.
m_frames.pop_back();
CursorSP new_frame_v2 = GetOneMoreFrame(abi);
if (new_frame_v2 == nullptr) {
// We haven't got a new frame from the fallback unwind plan. Accept the
- // frame from the
- // original unwind plan. This is a valid situation when we are at the bottom
- // of the stack.
+ // frame from the original unwind plan. This is a valid situation when we
+ // are at the bottom of the stack.
m_frames.push_back(new_frame);
return true;
}
// Push the new frame to the list and try to continue from this frame. If we
- // can get a new frame
- // then accept it as the correct one.
+ // can get a new frame then accept it as the correct one.
m_frames.push_back(new_frame_v2);
m_candidate_frame = GetOneMoreFrame(abi);
if (m_candidate_frame) {
// If control reached here then TryFallbackUnwindPlan had succeeded for
- // Cursor::m_frames[m_frames.size() - 2].
- // It also succeeded to Unwind next 2 frames i.e. m_frames[m_frames.size() -
- // 1] and a frame after that.
- // For Cursor::m_frames[m_frames.size() - 2], reg_ctx_lldb_sp field was
- // already updated during TryFallbackUnwindPlan
- // call above. However, cfa field still needs to be updated. Hence updating
- // it here and then returning.
+ // Cursor::m_frames[m_frames.size() - 2]. It also succeeded to Unwind next
+ // 2 frames i.e. m_frames[m_frames.size() - 1] and a frame after that. For
+ // Cursor::m_frames[m_frames.size() - 2], reg_ctx_lldb_sp field was already
+ // updated during TryFallbackUnwindPlan call above. However, cfa field
+ // still needs to be updated. Hence updating it here and then returning.
if (!(m_frames[m_frames.size() - 2]->reg_ctx_lldb_sp->GetCFA(
m_frames[m_frames.size() - 2]->cfa)))
return false;
@@ -414,8 +390,7 @@ bool UnwindLLDB::AddOneMoreFrame(ABI *abi) {
}
// The new frame hasn't helped in unwinding. Fall back to the original one as
- // the default unwind
- // plan is usually more reliable then the fallback one.
+ // the default unwind plan is usually more reliable then the fallback one.
m_frames.pop_back();
m_frames.push_back(new_frame);
return true;
@@ -486,10 +461,9 @@ bool UnwindLLDB::SearchForSavedLocationForRegister(
if (static_cast<size_t>(frame_num) >= m_frames.size())
return false;
- // Never interrogate more than one level while looking for the saved pc value.
- // If the value
- // isn't saved by frame_num, none of the frames lower on the stack will have a
- // useful value.
+ // Never interrogate more than one level while looking for the saved pc
+ // value. If the value isn't saved by frame_num, none of the frames lower on
+ // the stack will have a useful value.
if (pc_reg) {
UnwindLLDB::RegisterSearchResult result;
result = m_frames[frame_num]->reg_ctx_lldb_sp->SavedLocationForRegister(
@@ -505,8 +479,7 @@ bool UnwindLLDB::SearchForSavedLocationForRegister(
lldb_regnum, regloc);
// We descended down to the live register context aka stack frame 0 and are
- // reading the value
- // out of a live register.
+ // reading the value out of a live register.
if (result == UnwindLLDB::RegisterSearchResult::eRegisterFound &&
regloc.type ==
UnwindLLDB::RegisterLocation::eRegisterInLiveRegisterContext) {
@@ -514,11 +487,9 @@ bool UnwindLLDB::SearchForSavedLocationForRegister(
}
// If we have unwind instructions saying that register N is saved in
- // register M in the middle of
- // the stack (and N can equal M here, meaning the register was not used in
- // this function), then
- // change the register number we're looking for to M and keep looking for a
- // concrete location
+ // register M in the middle of the stack (and N can equal M here, meaning
+ // the register was not used in this function), then change the register
+ // number we're looking for to M and keep looking for a concrete location
// down the stack, or an actual value from a live RegisterContext at frame
// 0.
if (result == UnwindLLDB::RegisterSearchResult::eRegisterFound &&
diff --git a/source/Plugins/Process/Utility/UnwindLLDB.h b/source/Plugins/Process/Utility/UnwindLLDB.h
index 3f84649aa05f..3d1f85a3dec3 100644
--- a/source/Plugins/Process/Utility/UnwindLLDB.h
+++ b/source/Plugins/Process/Utility/UnwindLLDB.h
@@ -17,6 +17,7 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Symbol/FuncUnwinders.h"
+#include "lldb/Symbol/SymbolContext.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/Unwind.h"
diff --git a/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp b/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
index d831011cb661..2115b4e179c0 100644
--- a/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
+++ b/source/Plugins/Process/Utility/UnwindMacOSXFrameBackchain.cpp
@@ -133,8 +133,8 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_i386(
if (addr_range_ptr) {
if (first_frame->GetFrameCodeAddress() ==
addr_range_ptr->GetBaseAddress()) {
- // We are at the first instruction, so we can recover the
- // previous PC by dereferencing the SP
+ // We are at the first instruction, so we can recover the previous PC
+ // by dereferencing the SP
lldb::addr_t first_frame_sp = reg_ctx->GetSP(0);
// Read the real second frame return address into frame.pc
if (first_frame_sp &&
@@ -224,8 +224,8 @@ size_t UnwindMacOSXFrameBackchain::GetStackFrameData_x86_64(
if (addr_range_ptr) {
if (first_frame->GetFrameCodeAddress() ==
addr_range_ptr->GetBaseAddress()) {
- // We are at the first instruction, so we can recover the
- // previous PC by dereferencing the SP
+ // We are at the first instruction, so we can recover the previous PC
+ // by dereferencing the SP
lldb::addr_t first_frame_sp = reg_ctx->GetSP(0);
// Read the real second frame return address into frame.pc
if (process->ReadMemory(first_frame_sp, &frame.pc, sizeof(frame.pc),
diff --git a/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h b/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h
new file mode 100644
index 000000000000..9ea81c00b666
--- /dev/null
+++ b/source/Plugins/Process/Utility/lldb-ppc64-register-enums.h
@@ -0,0 +1,139 @@
+//===-- lldb-ppc64-register-enums.h ---------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef lldb_ppc64_register_enums_h
+#define lldb_ppc64_register_enums_h
+
+// LLDB register codes (e.g. RegisterKind == eRegisterKindLLDB)
+
+// ---------------------------------------------------------------------------
+// Internal codes for all ppc64 registers.
+// ---------------------------------------------------------------------------
+enum {
+ k_first_gpr_ppc64,
+ gpr_r0_ppc64 = k_first_gpr_ppc64,
+ gpr_r1_ppc64,
+ gpr_r2_ppc64,
+ gpr_r3_ppc64,
+ gpr_r4_ppc64,
+ gpr_r5_ppc64,
+ gpr_r6_ppc64,
+ gpr_r7_ppc64,
+ gpr_r8_ppc64,
+ gpr_r9_ppc64,
+ gpr_r10_ppc64,
+ gpr_r11_ppc64,
+ gpr_r12_ppc64,
+ gpr_r13_ppc64,
+ gpr_r14_ppc64,
+ gpr_r15_ppc64,
+ gpr_r16_ppc64,
+ gpr_r17_ppc64,
+ gpr_r18_ppc64,
+ gpr_r19_ppc64,
+ gpr_r20_ppc64,
+ gpr_r21_ppc64,
+ gpr_r22_ppc64,
+ gpr_r23_ppc64,
+ gpr_r24_ppc64,
+ gpr_r25_ppc64,
+ gpr_r26_ppc64,
+ gpr_r27_ppc64,
+ gpr_r28_ppc64,
+ gpr_r29_ppc64,
+ gpr_r30_ppc64,
+ gpr_r31_ppc64,
+ gpr_cr_ppc64,
+ gpr_msr_ppc64,
+ gpr_xer_ppc64,
+ gpr_lr_ppc64,
+ gpr_ctr_ppc64,
+ gpr_pc_ppc64,
+ k_last_gpr_ppc64 = gpr_pc_ppc64,
+
+ k_first_fpr_ppc64,
+ fpr_f0_ppc64 = k_first_fpr_ppc64,
+ fpr_f1_ppc64,
+ fpr_f2_ppc64,
+ fpr_f3_ppc64,
+ fpr_f4_ppc64,
+ fpr_f5_ppc64,
+ fpr_f6_ppc64,
+ fpr_f7_ppc64,
+ fpr_f8_ppc64,
+ fpr_f9_ppc64,
+ fpr_f10_ppc64,
+ fpr_f11_ppc64,
+ fpr_f12_ppc64,
+ fpr_f13_ppc64,
+ fpr_f14_ppc64,
+ fpr_f15_ppc64,
+ fpr_f16_ppc64,
+ fpr_f17_ppc64,
+ fpr_f18_ppc64,
+ fpr_f19_ppc64,
+ fpr_f20_ppc64,
+ fpr_f21_ppc64,
+ fpr_f22_ppc64,
+ fpr_f23_ppc64,
+ fpr_f24_ppc64,
+ fpr_f25_ppc64,
+ fpr_f26_ppc64,
+ fpr_f27_ppc64,
+ fpr_f28_ppc64,
+ fpr_f29_ppc64,
+ fpr_f30_ppc64,
+ fpr_f31_ppc64,
+ fpr_fpscr_ppc64,
+ k_last_fpr_ppc64 = fpr_fpscr_ppc64,
+
+ k_first_vmx_ppc64,
+ vmx_vr0_ppc64 = k_first_vmx_ppc64,
+ vmx_vr1_ppc64,
+ vmx_vr2_ppc64,
+ vmx_vr3_ppc64,
+ vmx_vr4_ppc64,
+ vmx_vr5_ppc64,
+ vmx_vr6_ppc64,
+ vmx_vr7_ppc64,
+ vmx_vr8_ppc64,
+ vmx_vr9_ppc64,
+ vmx_vr10_ppc64,
+ vmx_vr11_ppc64,
+ vmx_vr12_ppc64,
+ vmx_vr13_ppc64,
+ vmx_vr14_ppc64,
+ vmx_vr15_ppc64,
+ vmx_vr16_ppc64,
+ vmx_vr17_ppc64,
+ vmx_vr18_ppc64,
+ vmx_vr19_ppc64,
+ vmx_vr20_ppc64,
+ vmx_vr21_ppc64,
+ vmx_vr22_ppc64,
+ vmx_vr23_ppc64,
+ vmx_vr24_ppc64,
+ vmx_vr25_ppc64,
+ vmx_vr26_ppc64,
+ vmx_vr27_ppc64,
+ vmx_vr28_ppc64,
+ vmx_vr29_ppc64,
+ vmx_vr30_ppc64,
+ vmx_vr31_ppc64,
+ vmx_vscr_ppc64,
+ vmx_vrsave_ppc64,
+ k_last_vmx_ppc64 = vmx_vrsave_ppc64,
+
+ k_num_registers_ppc64,
+ k_num_gpr_registers_ppc64 = k_last_gpr_ppc64 - k_first_gpr_ppc64 + 1,
+ k_num_fpr_registers_ppc64 = k_last_fpr_ppc64 - k_first_fpr_ppc64 + 1,
+ k_num_vmx_registers_ppc64 = k_last_vmx_ppc64 - k_first_vmx_ppc64 + 1,
+};
+
+#endif // #ifndef lldb_ppc64_register_enums_h
diff --git a/source/Plugins/Process/Windows/Common/CMakeLists.txt b/source/Plugins/Process/Windows/Common/CMakeLists.txt
index 009a289bae39..092629086183 100644
--- a/source/Plugins/Process/Windows/Common/CMakeLists.txt
+++ b/source/Plugins/Process/Windows/Common/CMakeLists.txt
@@ -1,6 +1,3 @@
-include_directories(.)
-include_directories(../../Utility)
-
set(PROC_WINDOWS_COMMON_SOURCES
DebuggerThread.cpp
LocalDebugDelegate.cpp
diff --git a/source/Plugins/Process/Windows/Common/DebuggerThread.cpp b/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
index ac9e65c3c108..ad43551a4c6d 100644
--- a/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
+++ b/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
@@ -112,8 +112,7 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine(void *data) {
lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine(
const ProcessLaunchInfo &launch_info) {
// Grab a shared_ptr reference to this so that we know it won't get deleted
- // until after the
- // thread routine has exited.
+ // until after the thread routine has exited.
std::shared_ptr<DebuggerThread> this_ref(shared_from_this());
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
@@ -124,14 +123,11 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine(
ProcessLauncherWindows launcher;
HostProcess process(launcher.LaunchProcess(launch_info, error));
// If we couldn't create the process, notify waiters immediately. Otherwise
- // enter the debug
- // loop and wait until we get the create process debug notification. Note
- // that if the process
- // was created successfully, we can throw away the process handle we got from
- // CreateProcess
- // because Windows will give us another (potentially more useful?) handle when
- // it sends us the
- // CREATE_PROCESS_DEBUG_EVENT.
+ // enter the debug loop and wait until we get the create process debug
+ // notification. Note that if the process was created successfully, we can
+ // throw away the process handle we got from CreateProcess because Windows
+ // will give us another (potentially more useful?) handle when it sends us
+ // the CREATE_PROCESS_DEBUG_EVENT.
if (error.Success())
DebugLoop();
else
@@ -143,8 +139,7 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadLaunchRoutine(
lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine(
lldb::pid_t pid, const ProcessAttachInfo &attach_info) {
// Grab a shared_ptr reference to this so that we know it won't get deleted
- // until after the
- // thread routine has exited.
+ // until after the thread routine has exited.
std::shared_ptr<DebuggerThread> this_ref(shared_from_this());
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
@@ -157,11 +152,9 @@ lldb::thread_result_t DebuggerThread::DebuggerThreadAttachRoutine(
return 0;
}
- // The attach was successful, enter the debug loop. From here on out, this is
- // no different than
- // a create process operation, so all the same comments in DebugLaunch should
- // apply from this
- // point out.
+ // The attach was successful, enter the debug loop. From here on out, this
+ // is no different than a create process operation, so all the same comments
+ // in DebugLaunch should apply from this point out.
DebugLoop();
return 0;
@@ -188,21 +181,25 @@ Status DebuggerThread::StopDebugging(bool terminate) {
lldb::process_t handle = m_process.GetNativeProcess().GetSystemHandle();
if (terminate) {
- // Initiate the termination before continuing the exception, so that the
- // next debug
- // event we get is the exit process event, and not some other event.
- BOOL terminate_suceeded = TerminateProcess(handle, 0);
- LLDB_LOG(log,
- "calling TerminateProcess({0}, 0) (inferior={1}), success={2}",
- handle, pid, terminate_suceeded);
+ if (handle != nullptr && handle != LLDB_INVALID_PROCESS) {
+ // Initiate the termination before continuing the exception, so that the
+ // next debug event we get is the exit process event, and not some other
+ // event.
+ BOOL terminate_suceeded = TerminateProcess(handle, 0);
+ LLDB_LOG(log,
+ "calling TerminateProcess({0}, 0) (inferior={1}), success={2}",
+ handle, pid, terminate_suceeded);
+ } else {
+ LLDB_LOG(log,
+ "NOT calling TerminateProcess because the inferior is not valid ({0}, 0) (inferior={1})",
+ handle, pid);
+ }
}
// If we're stuck waiting for an exception to continue (e.g. the user is at a
- // breakpoint
- // messing around in the debugger), continue it now. But only AFTER calling
- // TerminateProcess
- // to make sure that the very next call to WaitForDebugEvent is an exit
- // process event.
+ // breakpoint messing around in the debugger), continue it now. But only
+ // AFTER calling TerminateProcess to make sure that the very next call to
+ // WaitForDebugEvent is an exit process event.
if (m_active_exception.get()) {
LLDB_LOG(log, "masking active exception");
ContinueAsyncException(ExceptionResult::MaskException);
@@ -355,8 +352,7 @@ DebuggerThread::HandleExceptionEvent(const EXCEPTION_DEBUG_INFO &info,
}
// Don't perform any blocking operations while we're shutting down. That
- // will
- // cause TerminateProcess -> WaitForSingleObject to time out.
+ // will cause TerminateProcess -> WaitForSingleObject to time out.
return ExceptionResult::SendToApplication;
}
@@ -373,8 +369,8 @@ DebuggerThread::HandleExceptionEvent(const EXCEPTION_DEBUG_INFO &info,
m_exception_pred.SetValue(result, eBroadcastNever);
LLDB_LOG(log, "waiting for ExceptionPred != BreakInDebugger");
- m_exception_pred.WaitForValueNotEqualTo(ExceptionResult::BreakInDebugger,
- result);
+ result = *m_exception_pred.WaitForValueNotEqualTo(
+ ExceptionResult::BreakInDebugger);
LLDB_LOG(log, "got ExceptionPred = {0}", (int)m_exception_pred.GetValue());
return result;
diff --git a/source/Plugins/Process/Windows/Common/ProcessWindows.cpp b/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
index a1c9cfaed41c..b14081f76617 100644
--- a/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
+++ b/source/Plugins/Process/Windows/Common/ProcessWindows.cpp
@@ -77,8 +77,8 @@ std::string GetProcessExecutableName(DWORD pid) {
namespace lldb_private {
// We store a pointer to this class in the ProcessWindows, so that we don't
-// expose Windows-specific types and implementation details from a public header
-// file.
+// expose Windows-specific types and implementation details from a public
+// header file.
class ProcessWindowsData {
public:
ProcessWindowsData(bool stop_at_entry) : m_stop_at_entry(stop_at_entry) {
@@ -186,9 +186,9 @@ Status ProcessWindows::DoDetach(bool keep_stopped) {
StateType private_state;
{
// Acquire the lock only long enough to get the DebuggerThread.
- // StopDebugging() will trigger a call back into ProcessWindows which
- // will also acquire the lock. Thus we have to release the lock before
- // calling StopDebugging().
+ // StopDebugging() will trigger a call back into ProcessWindows which will
+ // also acquire the lock. Thus we have to release the lock before calling
+ // StopDebugging().
llvm::sys::ScopedLock lock(m_mutex);
private_state = GetPrivateState();
@@ -228,14 +228,22 @@ Status ProcessWindows::DoDetach(bool keep_stopped) {
Status ProcessWindows::DoLaunch(Module *exe_module,
ProcessLaunchInfo &launch_info) {
- // Even though m_session_data is accessed here, it is before a debugger thread
- // has been
- // kicked off. So there's no race conditions, and it shouldn't be necessary
- // to acquire
- // the mutex.
+ // Even though m_session_data is accessed here, it is before a debugger
+ // thread has been kicked off. So there's no race conditions, and it
+ // shouldn't be necessary to acquire the mutex.
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
Status result;
+
+ FileSpec working_dir = launch_info.GetWorkingDirectory();
+ namespace fs = llvm::sys::fs;
+ if (working_dir && (!working_dir.ResolvePath() ||
+ !fs::is_directory(working_dir.GetPath()))) {
+ result.SetErrorStringWithFormat("No such file or directory: %s",
+ working_dir.GetCString());
+ return result;
+ }
+
if (!launch_info.GetFlags().Test(eLaunchFlagDebug)) {
StreamString stream;
stream.Printf("ProcessWindows unable to launch '%s'. ProcessWindows can "
@@ -251,7 +259,6 @@ Status ProcessWindows::DoLaunch(Module *exe_module,
bool stop_at_entry = launch_info.GetFlags().Test(eLaunchFlagStopAtEntry);
m_session_data.reset(new ProcessWindowsData(stop_at_entry));
- SetPrivateState(eStateLaunching);
DebugDelegateSP delegate(new LocalDebugDelegate(shared_from_this()));
m_session_data->m_debugger.reset(new DebuggerThread(delegate));
DebuggerThreadSP debugger = m_session_data->m_debugger;
@@ -276,12 +283,10 @@ Status ProcessWindows::DoLaunch(Module *exe_module,
launch_info.GetExecutableFile().GetPath());
// We've hit the initial stop. If eLaunchFlagsStopAtEntry was specified, the
- // private state
- // should already be set to eStateStopped as a result of hitting the initial
- // breakpoint. If
- // it was not set, the breakpoint should have already been resumed from and
- // the private state
- // should already be eStateRunning.
+ // private state should already be set to eStateStopped as a result of
+ // hitting the initial breakpoint. If it was not set, the breakpoint should
+ // have already been resumed from and the private state should already be
+ // eStateRunning.
launch_info.SetProcessID(process.GetProcessId());
SetID(process.GetProcessId());
@@ -322,12 +327,10 @@ ProcessWindows::DoAttachToProcessWithID(lldb::pid_t pid,
LLDB_LOG(log, "successfully attached to process with pid={0}", process_id);
// We've hit the initial stop. If eLaunchFlagsStopAtEntry was specified, the
- // private state
- // should already be set to eStateStopped as a result of hitting the initial
- // breakpoint. If
- // it was not set, the breakpoint should have already been resumed from and
- // the private state
- // should already be eStateRunning.
+ // private state should already be set to eStateStopped as a result of
+ // hitting the initial breakpoint. If it was not set, the breakpoint should
+ // have already been resumed from and the private state should already be
+ // eStateRunning.
SetID(process.GetProcessId());
return error;
}
@@ -346,22 +349,35 @@ Status ProcessWindows::DoResume() {
ExceptionRecordSP active_exception =
m_session_data->m_debugger->GetActiveException().lock();
if (active_exception) {
- // Resume the process and continue processing debug events. Mask
- // the exception so that from the process's view, there is no
- // indication that anything happened.
+ // Resume the process and continue processing debug events. Mask the
+ // exception so that from the process's view, there is no indication that
+ // anything happened.
m_session_data->m_debugger->ContinueAsyncException(
ExceptionResult::MaskException);
}
LLDB_LOG(log, "resuming {0} threads.", m_thread_list.GetSize());
+ bool failed = false;
for (uint32_t i = 0; i < m_thread_list.GetSize(); ++i) {
auto thread = std::static_pointer_cast<TargetThreadWindows>(
m_thread_list.GetThreadAtIndex(i));
- thread->DoResume();
+ Status result = thread->DoResume();
+ if (result.Fail()) {
+ failed = true;
+ LLDB_LOG(
+ log,
+ "Trying to resume thread at index {0}, but failed with error {1}.",
+ i, result);
+ }
}
- SetPrivateState(eStateRunning);
+ if (failed) {
+ error.SetErrorString("ProcessWindows::DoResume failed");
+ return error;
+ } else {
+ SetPrivateState(eStateRunning);
+ }
} else {
LLDB_LOG(log, "error: process %I64u is in state %u. Returning...",
m_session_data->m_debugger->GetProcess().GetProcessId(),
@@ -376,10 +392,9 @@ Status ProcessWindows::DoDestroy() {
StateType private_state;
{
// Acquire this lock inside an inner scope, only long enough to get the
- // DebuggerThread.
- // StopDebugging() will trigger a call back into ProcessWindows which will
- // acquire the lock
- // again, so we need to not deadlock.
+ // DebuggerThread. StopDebugging() will trigger a call back into
+ // ProcessWindows which will acquire the lock again, so we need to not
+ // deadlock.
llvm::sys::ScopedLock lock(m_mutex);
private_state = GetPrivateState();
@@ -461,8 +476,9 @@ void ProcessWindows::RefreshStateAfterStop() {
m_session_data->m_debugger->GetActiveException();
ExceptionRecordSP active_exception = exception_record.lock();
if (!active_exception) {
- LLDB_LOG(log, "there is no active exception in process {0}. Why is the "
- "process stopped?",
+ LLDB_LOG(log,
+ "there is no active exception in process {0}. Why is the "
+ "process stopped?",
m_session_data->m_debugger->GetProcess().GetProcessId());
return;
}
@@ -479,8 +495,9 @@ void ProcessWindows::RefreshStateAfterStop() {
const uint64_t pc = register_context->GetPC();
BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc));
if (site && site->ValidForThisThread(stop_thread.get())) {
- LLDB_LOG(log, "Single-stepped onto a breakpoint in process {0} at "
- "address {1:x} with breakpoint site {2}",
+ LLDB_LOG(log,
+ "Single-stepped onto a breakpoint in process {0} at "
+ "address {1:x} with breakpoint site {2}",
m_session_data->m_debugger->GetProcess().GetProcessId(), pc,
site->GetID());
stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(*stop_thread,
@@ -502,22 +519,25 @@ void ProcessWindows::RefreshStateAfterStop() {
BreakpointSiteSP site(GetBreakpointSiteList().FindByAddress(pc));
if (site) {
- LLDB_LOG(log, "detected breakpoint in process {0} at address {1:x} with "
- "breakpoint site {2}",
+ LLDB_LOG(log,
+ "detected breakpoint in process {0} at address {1:x} with "
+ "breakpoint site {2}",
m_session_data->m_debugger->GetProcess().GetProcessId(), pc,
site->GetID());
if (site->ValidForThisThread(stop_thread.get())) {
- LLDB_LOG(log, "Breakpoint site {0} is valid for this thread ({1:x}), "
- "creating stop info.",
+ LLDB_LOG(log,
+ "Breakpoint site {0} is valid for this thread ({1:x}), "
+ "creating stop info.",
site->GetID(), stop_thread->GetID());
stop_info = StopInfo::CreateStopReasonWithBreakpointSiteID(
*stop_thread, site->GetID());
register_context->SetPC(pc);
} else {
- LLDB_LOG(log, "Breakpoint site {0} is not valid for this thread, "
- "creating empty stop info.",
+ LLDB_LOG(log,
+ "Breakpoint site {0} is not valid for this thread, "
+ "creating empty stop info.",
site->GetID());
}
stop_thread->SetStopInfo(stop_info);
@@ -558,8 +578,8 @@ bool ProcessWindows::CanDebug(lldb::TargetSP target_sp,
ModuleSP exe_module_sp(target_sp->GetExecutableModule());
if (exe_module_sp.get())
return exe_module_sp->GetFileSpec().Exists();
- // However, if there is no executable module, we return true since we might be
- // preparing to attach.
+ // However, if there is no executable module, we return true since we might
+ // be preparing to attach.
return true;
}
@@ -589,8 +609,8 @@ bool ProcessWindows::UpdateThreadList(ThreadList &old_thread_list,
}
}
- // Also add all the threads that are new since the last time we broke into the
- // debugger.
+ // Also add all the threads that are new since the last time we broke into
+ // the debugger.
for (const auto &thread_info : m_session_data->m_new_threads) {
ThreadSP thread(new TargetThreadWindows(*this, thread_info.second));
thread->SetID(thread_info.first);
@@ -639,8 +659,13 @@ size_t ProcessWindows::DoReadMemory(lldb::addr_t vm_addr, void *buf,
SIZE_T bytes_read = 0;
if (!ReadProcessMemory(process.GetNativeProcess().GetSystemHandle(), addr,
buf, size, &bytes_read)) {
+ // Reading from the process can fail for a number of reasons - set the
+ // error code and make sure that the number of bytes read is set back to 0
+ // because in some scenarios the value of bytes_read returned from the API
+ // is garbage.
error.SetError(GetLastError(), eErrorTypeWin32);
LLDB_LOG(log, "reading failed with error: {0}", error);
+ bytes_read = 0;
}
return bytes_read;
}
@@ -699,11 +724,9 @@ Status ProcessWindows::GetMemoryRegionInfo(lldb::addr_t vm_addr,
SIZE_T result = ::VirtualQueryEx(handle, addr, &mem_info, sizeof(mem_info));
if (result == 0) {
if (::GetLastError() == ERROR_INVALID_PARAMETER) {
- // ERROR_INVALID_PARAMETER is returned if VirtualQueryEx is called with an
- // address
- // past the highest accessible address. We should return a range from the
- // vm_addr
- // to LLDB_INVALID_ADDRESS
+ // ERROR_INVALID_PARAMETER is returned if VirtualQueryEx is called with
+ // an address past the highest accessible address. We should return a
+ // range from the vm_addr to LLDB_INVALID_ADDRESS
info.GetRange().SetRangeBase(vm_addr);
info.GetRange().SetRangeEnd(LLDB_INVALID_ADDRESS);
info.SetReadable(MemoryRegionInfo::eNo);
@@ -713,8 +736,9 @@ Status ProcessWindows::GetMemoryRegionInfo(lldb::addr_t vm_addr,
return error;
} else {
error.SetError(::GetLastError(), eErrorTypeWin32);
- LLDB_LOG(log, "VirtualQueryEx returned error {0} while getting memory "
- "region info for address {1:x}",
+ LLDB_LOG(log,
+ "VirtualQueryEx returned error {0} while getting memory "
+ "region info for address {1:x}",
error, vm_addr);
return error;
}
@@ -744,10 +768,8 @@ Status ProcessWindows::GetMemoryRegionInfo(lldb::addr_t vm_addr,
info.SetMapped(MemoryRegionInfo::eYes);
} else {
// In the unmapped case we need to return the distance to the next block of
- // memory.
- // VirtualQueryEx nearly does that except that it gives the distance from
- // the start
- // of the page containing vm_addr.
+ // memory. VirtualQueryEx nearly does that except that it gives the
+ // distance from the start of the page containing vm_addr.
SYSTEM_INFO data;
GetSystemInfo(&data);
DWORD page_offset = vm_addr % data.dwPageSize;
@@ -757,8 +779,9 @@ Status ProcessWindows::GetMemoryRegionInfo(lldb::addr_t vm_addr,
}
error.SetError(::GetLastError(), eErrorTypeWin32);
- LLDB_LOGV(log, "Memory region info for address {0}: readable={1}, "
- "executable={2}, writable={3}",
+ LLDB_LOGV(log,
+ "Memory region info for address {0}: readable={1}, "
+ "executable={2}, writable={3}",
vm_addr, info.GetReadable(), info.GetExecutable(),
info.GetWritable());
return error;
@@ -779,7 +802,7 @@ void ProcessWindows::OnExitProcess(uint32_t exit_code) {
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
LLDB_LOG(log, "Process {0} exited with code {1}", GetID(), exit_code);
- TargetSP target = m_target_sp.lock();
+ TargetSP target = CalculateTarget();
if (target) {
ModuleSP executable_module = target->GetExecutableModule();
ModuleList unloaded_modules;
@@ -825,10 +848,9 @@ void ProcessWindows::OnDebuggerConnected(lldb::addr_t image_base) {
GetTarget().ModulesDidLoad(loaded_modules);
// Add the main executable module to the list of pending module loads. We
- // can't call
- // GetTarget().ModulesDidLoad() here because we still haven't returned from
- // DoLaunch() / DoAttach() yet
- // so the target may not have set the process instance to `this` yet.
+ // can't call GetTarget().ModulesDidLoad() here because we still haven't
+ // returned from DoLaunch() / DoAttach() yet so the target may not have set
+ // the process instance to `this` yet.
llvm::sys::ScopedLock lock(m_mutex);
const HostThreadWindows &wmain_thread =
debugger->GetMainThread().GetNativeThread();
@@ -845,15 +867,14 @@ ProcessWindows::OnDebugException(bool first_chance,
// FIXME: Without this check, occasionally when running the test suite there
// is
// an issue where m_session_data can be null. It's not clear how this could
- // happen
- // but it only surfaces while running the test suite. In order to properly
- // diagnose
- // this, we probably need to first figure allow the test suite to print out
- // full
- // lldb logs, and then add logging to the process plugin.
+ // happen but it only surfaces while running the test suite. In order to
+ // properly diagnose this, we probably need to first figure allow the test
+ // suite to print out full lldb logs, and then add logging to the process
+ // plugin.
if (!m_session_data) {
- LLDB_LOG(log, "Debugger thread reported exception {0:x} at address {1:x}, "
- "but there is no session.",
+ LLDB_LOG(log,
+ "Debugger thread reported exception {0:x} at address {1:x}, "
+ "but there is no session.",
record.GetExceptionCode(), record.GetExceptionAddress());
return ExceptionResult::SendToApplication;
}
@@ -887,8 +908,9 @@ ProcessWindows::OnDebugException(bool first_chance,
SetPrivateState(eStateStopped);
break;
default:
- LLDB_LOG(log, "Debugger thread reported exception {0:x} at address {1:x} "
- "(first_chance={2})",
+ LLDB_LOG(log,
+ "Debugger thread reported exception {0:x} at address {1:x} "
+ "(first_chance={2})",
record.GetExceptionCode(), record.GetExceptionAddress(),
first_chance);
// For non-breakpoints, give the application a chance to handle the
@@ -929,9 +951,8 @@ void ProcessWindows::OnExitThread(lldb::tid_t thread_id, uint32_t exit_code) {
void ProcessWindows::OnLoadDll(const ModuleSpec &module_spec,
lldb::addr_t module_addr) {
// Confusingly, there is no Target::AddSharedModule. Instead, calling
- // GetSharedModule() with
- // a new module will add it to the module list and return a corresponding
- // ModuleSP.
+ // GetSharedModule() with a new module will add it to the module list and
+ // return a corresponding ModuleSP.
Status error;
ModuleSP module = GetTarget().GetSharedModule(module_spec, &error);
bool load_addr_changed = false;
@@ -961,17 +982,16 @@ void ProcessWindows::OnDebuggerError(const Status &error, uint32_t type) {
Log *log = ProcessWindowsLog::GetLogIfAny(WINDOWS_LOG_PROCESS);
if (m_session_data->m_initial_stop_received) {
- // This happened while debugging. Do we shutdown the debugging session, try
- // to continue, or do something else?
- LLDB_LOG(log, "Error {0} occurred during debugging. Unexpected behavior "
- "may result. {1}",
+ // This happened while debugging. Do we shutdown the debugging session,
+ // try to continue, or do something else?
+ LLDB_LOG(log,
+ "Error {0} occurred during debugging. Unexpected behavior "
+ "may result. {1}",
error.GetError(), error);
} else {
// If we haven't actually launched the process yet, this was an error
- // launching the
- // process. Set the internal error and signal the initial stop event so
- // that the DoLaunch
- // method wakes up and returns a failure.
+ // launching the process. Set the internal error and signal the initial
+ // stop event so that the DoLaunch method wakes up and returns a failure.
m_session_data->m_launch_error = error;
::SetEvent(m_session_data->m_initial_stop_event);
LLDB_LOG(
@@ -1001,9 +1021,9 @@ Status ProcessWindows::WaitForDebuggerConnection(DebuggerThreadSP debugger,
}
// The Windows page protection bits are NOT independent masks that can be
-// bitwise-ORed together. For example, PAGE_EXECUTE_READ is not
-// (PAGE_EXECUTE | PAGE_READ). To test for an access type, it's necessary to
-// test for any of the bits that provide that access type.
+// bitwise-ORed together. For example, PAGE_EXECUTE_READ is not (PAGE_EXECUTE
+// | PAGE_READ). To test for an access type, it's necessary to test for any of
+// the bits that provide that access type.
bool ProcessWindows::IsPageReadable(uint32_t protect) {
return (protect & PAGE_NOACCESS) == 0;
}
diff --git a/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp b/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
index a4d60303877e..3903280918cc 100644
--- a/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
+++ b/source/Plugins/Process/Windows/Common/TargetThreadWindows.cpp
@@ -16,10 +16,10 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/Logging.h"
+#include "Plugins/Process/Utility/UnwindLLDB.h"
#include "ProcessWindows.h"
#include "ProcessWindowsLog.h"
#include "TargetThreadWindows.h"
-#include "UnwindLLDB.h"
#if defined(_WIN64)
#include "x64/RegisterContextWindows_x64.h"
@@ -33,7 +33,7 @@ using namespace lldb_private;
TargetThreadWindows::TargetThreadWindows(ProcessWindows &process,
const HostThread &thread)
: Thread(process, thread.GetNativeThread().GetThreadId()),
- m_host_thread(thread) {}
+ m_thread_reg_ctx_sp(), m_host_thread(thread) {}
TargetThreadWindows::~TargetThreadWindows() { DestroyThread(); }
@@ -49,40 +49,53 @@ void TargetThreadWindows::DidStop() {}
RegisterContextSP TargetThreadWindows::GetRegisterContext() {
if (!m_reg_context_sp)
- m_reg_context_sp = CreateRegisterContextForFrameIndex(0);
+ m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
return m_reg_context_sp;
}
RegisterContextSP
TargetThreadWindows::CreateRegisterContextForFrame(StackFrame *frame) {
- return CreateRegisterContextForFrameIndex(frame->GetConcreteFrameIndex());
-}
-
-RegisterContextSP
-TargetThreadWindows::CreateRegisterContextForFrameIndex(uint32_t idx) {
- if (!m_reg_context_sp) {
- ArchSpec arch = HostInfo::GetArchitecture();
- switch (arch.GetMachine()) {
- case llvm::Triple::x86:
+ RegisterContextSP reg_ctx_sp;
+ uint32_t concrete_frame_idx = 0;
+ Log *log(GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD));
+
+ if (frame)
+ concrete_frame_idx = frame->GetConcreteFrameIndex();
+
+ if (concrete_frame_idx == 0) {
+ if (!m_thread_reg_ctx_sp) {
+ ArchSpec arch = HostInfo::GetArchitecture();
+ switch (arch.GetMachine()) {
+ case llvm::Triple::x86:
#if defined(_WIN64)
-// FIXME: This is a Wow64 process, create a RegisterContextWindows_Wow64
+ // FIXME: This is a Wow64 process, create a RegisterContextWindows_Wow64
+ LLDB_LOG(log, "This is a Wow64 process, we should create a "
+ "RegisterContextWindows_Wow64, but we don't.");
#else
- m_reg_context_sp.reset(new RegisterContextWindows_x86(*this, idx));
+ m_thread_reg_ctx_sp.reset(
+ new RegisterContextWindows_x86(*this, concrete_frame_idx));
#endif
- break;
- case llvm::Triple::x86_64:
+ break;
+ case llvm::Triple::x86_64:
#if defined(_WIN64)
- m_reg_context_sp.reset(new RegisterContextWindows_x64(*this, idx));
+ m_thread_reg_ctx_sp.reset(
+ new RegisterContextWindows_x64(*this, concrete_frame_idx));
#else
-// LLDB is 32-bit, but the target process is 64-bit. We probably can't debug
-// this.
+ LLDB_LOG(log, "LLDB is 32-bit, but the target process is 64-bit.");
#endif
- default:
- break;
+ default:
+ break;
+ }
}
+ reg_ctx_sp = m_thread_reg_ctx_sp;
+ } else {
+ Unwind *unwinder = GetUnwinder();
+ if (unwinder != nullptr)
+ reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
- return m_reg_context_sp;
+
+ return reg_ctx_sp;
}
bool TargetThreadWindows::CalculateStopInfo() {
@@ -93,16 +106,16 @@ bool TargetThreadWindows::CalculateStopInfo() {
Unwind *TargetThreadWindows::GetUnwinder() {
// FIXME: Implement an unwinder based on the Windows unwinder exposed through
// DIA SDK.
- if (m_unwinder_ap.get() == NULL)
+ if (!m_unwinder_ap)
m_unwinder_ap.reset(new UnwindLLDB(*this));
return m_unwinder_ap.get();
}
-bool TargetThreadWindows::DoResume() {
+Status TargetThreadWindows::DoResume() {
StateType resume_state = GetTemporaryResumeState();
StateType current_state = GetState();
if (resume_state == current_state)
- return true;
+ return Status();
if (resume_state == eStateStepping) {
uint32_t flags_index =
@@ -118,8 +131,17 @@ bool TargetThreadWindows::DoResume() {
DWORD previous_suspend_count = 0;
HANDLE thread_handle = m_host_thread.GetNativeThread().GetSystemHandle();
do {
+ // ResumeThread returns -1 on error, or the thread's *previous* suspend
+ // count on success. This means that the return value is 1 when the thread
+ // was restarted. Note that DWORD is an unsigned int, so we need to
+ // explicitly compare with -1.
previous_suspend_count = ::ResumeThread(thread_handle);
- } while (previous_suspend_count > 0);
+
+ if (previous_suspend_count == (DWORD)-1)
+ return Status(::GetLastError(), eErrorTypeWin32);
+
+ } while (previous_suspend_count > 1);
}
- return true;
+
+ return Status();
}
diff --git a/source/Plugins/Process/Windows/Common/TargetThreadWindows.h b/source/Plugins/Process/Windows/Common/TargetThreadWindows.h
index 8b4e3dfdda4a..952c0f55b57f 100644
--- a/source/Plugins/Process/Windows/Common/TargetThreadWindows.h
+++ b/source/Plugins/Process/Windows/Common/TargetThreadWindows.h
@@ -37,15 +37,14 @@ public:
bool CalculateStopInfo() override;
Unwind *GetUnwinder() override;
- bool DoResume();
+ Status DoResume();
HostThread GetHostThread() const { return m_host_thread; }
private:
- lldb::RegisterContextSP CreateRegisterContextForFrameIndex(uint32_t idx);
-
+ lldb::RegisterContextSP m_thread_reg_ctx_sp;
HostThread m_host_thread;
};
-}
+} // namespace lldb_private
#endif
diff --git a/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp b/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
index e64bade5ff90..4aa6c785f83c 100644
--- a/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
+++ b/source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp
@@ -14,9 +14,9 @@
#include "lldb/lldb-private-types.h"
#include "RegisterContextWindows_x64.h"
-#include "RegisterContext_x86.h"
+#include "Plugins/Process/Utility/RegisterContext_x86.h"
#include "TargetThreadWindows.h"
-#include "lldb-x86-register-enums.h"
+#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
#include "llvm/ADT/STLExtras.h"
@@ -29,14 +29,11 @@ using namespace lldb_private;
namespace {
// This enum defines the layout of the global RegisterInfo array. This is
-// necessary because
-// lldb register sets are defined in terms of indices into the register array.
-// As such, the
-// order of RegisterInfos defined in global registers array must match the order
-// defined here.
-// When defining the register set layouts, these values can appear in an
-// arbitrary order, and that
-// determines the order that register values are displayed in a dump.
+// necessary because lldb register sets are defined in terms of indices into
+// the register array. As such, the order of RegisterInfos defined in global
+// registers array must match the order defined here. When defining the
+// register set layouts, these values can appear in an arbitrary order, and
+// that determines the order that register values are displayed in a dump.
enum RegisterIndex {
eRegisterIndexRax,
eRegisterIndexRbx,
@@ -44,6 +41,8 @@ enum RegisterIndex {
eRegisterIndexRdx,
eRegisterIndexRdi,
eRegisterIndexRsi,
+ eRegisterIndexRbp,
+ eRegisterIndexRsp,
eRegisterIndexR8,
eRegisterIndexR9,
eRegisterIndexR10,
@@ -52,8 +51,6 @@ enum RegisterIndex {
eRegisterIndexR13,
eRegisterIndexR14,
eRegisterIndexR15,
- eRegisterIndexRbp,
- eRegisterIndexRsp,
eRegisterIndexRip,
eRegisterIndexRflags
};
@@ -96,6 +93,16 @@ RegisterInfo g_register_infos[] = {
LLDB_INVALID_REGNUM, lldb_rsi_x86_64},
nullptr,
nullptr},
+ {DEFINE_GPR(rbp, "fp"),
+ {dwarf_rbp_x86_64, dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP,
+ LLDB_INVALID_REGNUM, lldb_rbp_x86_64},
+ nullptr,
+ nullptr},
+ {DEFINE_GPR(rsp, "sp"),
+ {dwarf_rsp_x86_64, dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP,
+ LLDB_INVALID_REGNUM, lldb_rsp_x86_64},
+ nullptr,
+ nullptr},
{DEFINE_GPR(r8, nullptr),
{dwarf_r8_x86_64, dwarf_r8_x86_64, LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM, lldb_r8_x86_64},
@@ -136,16 +143,6 @@ RegisterInfo g_register_infos[] = {
LLDB_INVALID_REGNUM, lldb_r15_x86_64},
nullptr,
nullptr},
- {DEFINE_GPR(rbp, "fp"),
- {dwarf_rbp_x86_64, dwarf_rbp_x86_64, LLDB_REGNUM_GENERIC_FP,
- LLDB_INVALID_REGNUM, lldb_rbp_x86_64},
- nullptr,
- nullptr},
- {DEFINE_GPR(rsp, "sp"),
- {dwarf_rsp_x86_64, dwarf_rsp_x86_64, LLDB_REGNUM_GENERIC_SP,
- LLDB_INVALID_REGNUM, lldb_rsp_x86_64},
- nullptr,
- nullptr},
{DEFINE_GPR(rip, "pc"),
{dwarf_rip_x86_64, dwarf_rip_x86_64, LLDB_REGNUM_GENERIC_PC,
LLDB_INVALID_REGNUM, lldb_rip_x86_64},
@@ -165,10 +162,10 @@ static size_t k_num_register_infos = llvm::array_lengthof(g_register_infos);
uint32_t g_gpr_reg_indices[] = {
eRegisterIndexRax, eRegisterIndexRbx, eRegisterIndexRcx,
eRegisterIndexRdx, eRegisterIndexRdi, eRegisterIndexRsi,
- eRegisterIndexR8, eRegisterIndexR9, eRegisterIndexR10,
- eRegisterIndexR11, eRegisterIndexR12, eRegisterIndexR13,
- eRegisterIndexR14, eRegisterIndexR15, eRegisterIndexRbp,
- eRegisterIndexRsp, eRegisterIndexRip, eRegisterIndexRflags};
+ eRegisterIndexRbp, eRegisterIndexRsp, eRegisterIndexR8,
+ eRegisterIndexR9, eRegisterIndexR10, eRegisterIndexR11,
+ eRegisterIndexR12, eRegisterIndexR13, eRegisterIndexR14,
+ eRegisterIndexR15, eRegisterIndexRip, eRegisterIndexRflags};
RegisterSet g_register_sets[] = {
{"General Purpose Registers", "gpr",
@@ -209,6 +206,9 @@ bool RegisterContextWindows_x64::ReadRegister(const RegisterInfo *reg_info,
if (!CacheAllRegisterValues())
return false;
+ if (reg_info == nullptr)
+ return false;
+
switch (reg_info->kinds[eRegisterKindLLDB]) {
case lldb_rax_x86_64:
reg_value.SetUInt64(m_context.Rax);
@@ -270,11 +270,10 @@ bool RegisterContextWindows_x64::ReadRegister(const RegisterInfo *reg_info,
bool RegisterContextWindows_x64::WriteRegister(const RegisterInfo *reg_info,
const RegisterValue &reg_value) {
- // Since we cannot only write a single register value to the inferior, we need
- // to make sure
- // our cached copy of the register values are fresh. Otherwise when writing
- // EAX, for example,
- // we may also overwrite some other register with a stale value.
+ // Since we cannot only write a single register value to the inferior, we
+ // need to make sure our cached copy of the register values are fresh.
+ // Otherwise when writing EAX, for example, we may also overwrite some other
+ // register with a stale value.
if (!CacheAllRegisterValues())
return false;
diff --git a/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp b/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
index f56836de4a67..fd486f3d0829 100644
--- a/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
+++ b/source/Plugins/Process/Windows/Common/x86/RegisterContextWindows_x86.cpp
@@ -15,9 +15,9 @@
#include "ProcessWindowsLog.h"
#include "RegisterContextWindows_x86.h"
-#include "RegisterContext_x86.h"
+#include "Plugins/Process/Utility/RegisterContext_x86.h"
#include "TargetThreadWindows.h"
-#include "lldb-x86-register-enums.h"
+#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
#include "llvm/ADT/STLExtras.h"
@@ -30,14 +30,11 @@ using namespace lldb_private;
namespace {
// This enum defines the layout of the global RegisterInfo array. This is
-// necessary because
-// lldb register sets are defined in terms of indices into the register array.
-// As such, the
-// order of RegisterInfos defined in global registers array must match the order
-// defined here.
-// When defining the register set layouts, these values can appear in an
-// arbitrary order, and that
-// determines the order that register values are displayed in a dump.
+// necessary because lldb register sets are defined in terms of indices into
+// the register array. As such, the order of RegisterInfos defined in global
+// registers array must match the order defined here. When defining the
+// register set layouts, these values can appear in an arbitrary order, and
+// that determines the order that register values are displayed in a dump.
enum RegisterIndex {
eRegisterIndexEax,
eRegisterIndexEbx,
@@ -179,6 +176,9 @@ bool RegisterContextWindows_x86::ReadRegister(const RegisterInfo *reg_info,
if (!CacheAllRegisterValues())
return false;
+ if (reg_info == nullptr)
+ return false;
+
uint32_t reg = reg_info->kinds[eRegisterKindLLDB];
switch (reg) {
case lldb_eax_i386:
@@ -212,11 +212,10 @@ bool RegisterContextWindows_x86::ReadRegister(const RegisterInfo *reg_info,
bool RegisterContextWindows_x86::WriteRegister(const RegisterInfo *reg_info,
const RegisterValue &reg_value) {
- // Since we cannot only write a single register value to the inferior, we need
- // to make sure
- // our cached copy of the register values are fresh. Otherwise when writing
- // EAX, for example,
- // we may also overwrite some other register with a stale value.
+ // Since we cannot only write a single register value to the inferior, we
+ // need to make sure our cached copy of the register values are fresh.
+ // Otherwise when writing EAX, for example, we may also overwrite some other
+ // register with a stale value.
if (!CacheAllRegisterValues())
return false;
diff --git a/source/Plugins/Process/elf-core/CMakeLists.txt b/source/Plugins/Process/elf-core/CMakeLists.txt
index 3082c73f6dda..9b6739824c06 100644
--- a/source/Plugins/Process/elf-core/CMakeLists.txt
+++ b/source/Plugins/Process/elf-core/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessElfCore PLUGIN
ProcessElfCore.cpp
ThreadElfCore.cpp
diff --git a/source/Plugins/Process/elf-core/ProcessElfCore.cpp b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
index 7d6a0c9ad2df..7bb7b72eaac1 100644
--- a/source/Plugins/Process/elf-core/ProcessElfCore.cpp
+++ b/source/Plugins/Process/elf-core/ProcessElfCore.cpp
@@ -56,9 +56,9 @@ lldb::ProcessSP ProcessElfCore::CreateInstance(lldb::TargetSP target_sp,
const FileSpec *crash_file) {
lldb::ProcessSP process_sp;
if (crash_file) {
- // Read enough data for a ELF32 header or ELF64 header
- // Note: Here we care about e_type field only, so it is safe
- // to ignore possible presence of the header extension.
+ // Read enough data for a ELF32 header or ELF64 header Note: Here we care
+ // about e_type field only, so it is safe to ignore possible presence of
+ // the header extension.
const size_t header_size = sizeof(llvm::ELF::Elf64_Ehdr);
auto data_sp = DataBufferLLVM::CreateSliceFromPath(crash_file->GetPath(),
@@ -107,10 +107,10 @@ ProcessElfCore::ProcessElfCore(lldb::TargetSP target_sp,
//----------------------------------------------------------------------
ProcessElfCore::~ProcessElfCore() {
Clear();
- // We need to call finalize on the process before destroying ourselves
- // to make sure all of the broadcaster cleanup goes as planned. If we
- // destruct this class, then Process::~Process() might have problems
- // trying to fully destroy the broadcaster.
+ // We need to call finalize on the process before destroying ourselves to
+ // make sure all of the broadcaster cleanup goes as planned. If we destruct
+ // this class, then Process::~Process() might have problems trying to fully
+ // destroy the broadcaster.
Finalize();
}
@@ -206,8 +206,8 @@ Status ProcessElfCore::DoLoadCore() {
m_core_range_infos.Sort();
}
- // Even if the architecture is set in the target, we need to override
- // it to match the core file which is always single arch.
+ // Even if the architecture is set in the target, we need to override it to
+ // match the core file which is always single arch.
ArchSpec arch(m_core_module_sp->GetArchitecture());
ArchSpec target_arch = GetTarget().GetArchitecture();
@@ -241,8 +241,7 @@ Status ProcessElfCore::DoLoadCore() {
}
// Core files are useless without the main executable. See if we can locate
- // the main
- // executable using data we found in the core file notes.
+ // the main executable using data we found in the core file notes.
lldb::ModuleSP exe_module_sp = GetTarget().GetExecutableModule();
if (!exe_module_sp) {
// The first entry in the NT_FILE might be our executable
@@ -250,7 +249,8 @@ Status ProcessElfCore::DoLoadCore() {
ModuleSpec exe_module_spec;
exe_module_spec.GetArchitecture() = arch;
exe_module_spec.GetFileSpec().SetFile(
- m_nt_file_entries[0].path.GetCString(), false);
+ m_nt_file_entries[0].path.GetCString(), false,
+ FileSpec::Style::native);
if (exe_module_spec.GetFileSpec()) {
exe_module_sp = GetTarget().GetSharedModule(exe_module_spec);
if (exe_module_sp)
@@ -297,8 +297,8 @@ bool ProcessElfCore::IsAlive() { return true; }
//------------------------------------------------------------------
size_t ProcessElfCore::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) {
- // Don't allow the caching that lldb_private::Process::ReadMemory does
- // since in core files we have it all cached our our core file anyway.
+ // Don't allow the caching that lldb_private::Process::ReadMemory does since
+ // in core files we have it all cached our our core file anyway.
return DoReadMemory(addr, buf, size, error);
}
@@ -368,17 +368,18 @@ size_t ProcessElfCore::DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
lldb::addr_t bytes_left =
0; // Number of bytes available in the core file from the given address
- // Don't proceed if core file doesn't contain the actual data for this address range.
+ // Don't proceed if core file doesn't contain the actual data for this
+ // address range.
if (file_start == file_end)
return 0;
- // Figure out how many on-disk bytes remain in this segment
- // starting at the given offset
+ // Figure out how many on-disk bytes remain in this segment starting at the
+ // given offset
if (file_end > file_start + offset)
bytes_left = file_end - (file_start + offset);
- // Figure out how many bytes we need to zero-fill if we are
- // reading more bytes than available in the on-disk segment
+ // Figure out how many bytes we need to zero-fill if we are reading more
+ // bytes than available in the on-disk segment
if (bytes_to_read > bytes_left) {
zero_fill_size = bytes_to_read - bytes_left;
bytes_to_read = bytes_left;
@@ -551,8 +552,8 @@ llvm::Error ProcessElfCore::parseFreeBSDNotes(llvm::ArrayRef<CoreNote> notes) {
llvm::Error ProcessElfCore::parseNetBSDNotes(llvm::ArrayRef<CoreNote> notes) {
ThreadData thread_data;
for (const auto &note : notes) {
- // NetBSD per-thread information is stored in notes named
- // "NetBSD-CORE@nnn" so match on the initial part of the string.
+ // NetBSD per-thread information is stored in notes named "NetBSD-CORE@nnn"
+ // so match on the initial part of the string.
if (!llvm::StringRef(note.info.n_name).startswith("NetBSD-CORE"))
continue;
@@ -585,8 +586,8 @@ llvm::Error ProcessElfCore::parseNetBSDNotes(llvm::ArrayRef<CoreNote> notes) {
llvm::Error ProcessElfCore::parseOpenBSDNotes(llvm::ArrayRef<CoreNote> notes) {
ThreadData thread_data;
for (const auto &note : notes) {
- // OpenBSD per-thread information is stored in notes named
- // "OpenBSD@nnn" so match on the initial part of the string.
+ // OpenBSD per-thread information is stored in notes named "OpenBSD@nnn" so
+ // match on the initial part of the string.
if (!llvm::StringRef(note.info.n_name).startswith("OpenBSD"))
continue;
@@ -665,7 +666,7 @@ llvm::Error ProcessElfCore::parseLinuxNotes(llvm::ArrayRef<CoreNote> notes) {
Status status = prpsinfo.Parse(note.data, arch);
if (status.Fail())
return status.ToError();
- thread_data.name = prpsinfo.pr_fname;
+ thread_data.name.assign (prpsinfo.pr_fname, strnlen (prpsinfo.pr_fname, sizeof (prpsinfo.pr_fname)));
SetID(prpsinfo.pr_pid);
break;
}
@@ -749,9 +750,9 @@ ArchSpec ProcessElfCore::GetArchitecture() {
ArchSpec target_arch = GetTarget().GetArchitecture();
arch.MergeFrom(target_arch);
- // On MIPS there is no way to differentiate betwenn 32bit and 64bit core files
- // and this information can't be merged in from the target arch so we fail
- // back to unconditionally returning the target arch in this config.
+ // On MIPS there is no way to differentiate betwenn 32bit and 64bit core
+ // files and this information can't be merged in from the target arch so we
+ // fail back to unconditionally returning the target arch in this config.
if (target_arch.IsMIPS()) {
return target_arch;
}
diff --git a/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp b/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
index e252b5a35e9c..532a1f5c0831 100644
--- a/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
+++ b/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_mips64.cpp
@@ -56,7 +56,7 @@ bool RegisterContextCorePOSIX_mips64::ReadRegister(const RegisterInfo *reg_info,
if (IsGPR(reg_info->kinds[lldb::eRegisterKindLLDB])) {
if (reg_info->byte_size == 4 && !(arch.GetMachine() == llvm::Triple::mips64el))
// In case of 32bit core file, the register data are placed at 4 byte
- // offset.
+ // offset.
offset = offset / 2;
v = m_gpr.GetMaxU64(&offset, reg_info->byte_size);
value = v;
diff --git a/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp b/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
index a5c7ffda1da5..a1f26d52444b 100644
--- a/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
+++ b/source/Plugins/Process/elf-core/RegisterContextPOSIXCore_x86_64.cpp
@@ -60,8 +60,8 @@ bool RegisterContextCorePOSIX_x86_64::ReadRegister(const RegisterInfo *reg_info,
const uint8_t *src;
size_t offset;
const size_t fxsave_offset = reg_info->byte_offset - GetFXSAVEOffset();
- // make the offset relative to the beginning of the FXSAVE structure
- // because this is the data that we have (not the entire UserArea)
+ // make the offset relative to the beginning of the FXSAVE structure because
+ // this is the data that we have (not the entire UserArea)
if (m_gpregset && reg_info->byte_offset < GetGPRSize()) {
src = m_gpregset.get();
diff --git a/source/Plugins/Process/elf-core/ThreadElfCore.cpp b/source/Plugins/Process/elf-core/ThreadElfCore.cpp
index 10c1ed288b2c..d9b90c8e902e 100644
--- a/source/Plugins/Process/elf-core/ThreadElfCore.cpp
+++ b/source/Plugins/Process/elf-core/ThreadElfCore.cpp
@@ -55,16 +55,9 @@ void ThreadElfCore::RefreshStateAfterStop() {
GetRegisterContext()->InvalidateIfNeeded(false);
}
-void ThreadElfCore::ClearStackFrames() {
- Unwind *unwinder = GetUnwinder();
- if (unwinder)
- unwinder->Clear();
- Thread::ClearStackFrames();
-}
-
RegisterContextSP ThreadElfCore::GetRegisterContext() {
- if (m_reg_context_sp.get() == NULL) {
- m_reg_context_sp = CreateRegisterContextForFrame(NULL);
+ if (!m_reg_context_sp) {
+ m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
}
return m_reg_context_sp;
}
@@ -84,7 +77,7 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
ProcessElfCore *process = static_cast<ProcessElfCore *>(GetProcess().get());
ArchSpec arch = process->GetArchitecture();
- RegisterInfoInterface *reg_interface = NULL;
+ RegisterInfoInterface *reg_interface = nullptr;
switch (arch.GetTriple().getOS()) {
case llvm::Triple::FreeBSD: {
@@ -234,8 +227,10 @@ ThreadElfCore::CreateRegisterContextForFrame(StackFrame *frame) {
}
reg_ctx_sp = m_thread_reg_ctx_sp;
- } else if (m_unwinder_ap.get()) {
- reg_ctx_sp = m_unwinder_ap->CreateRegisterContextForFrame(frame);
+ } else {
+ Unwind *unwinder = GetUnwinder();
+ if (unwinder != nullptr)
+ reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
}
@@ -292,8 +287,8 @@ Status ELFLinuxPrStatus::Parse(const DataExtractor &data,
return error;
}
- // Read field by field to correctly account for endianess
- // of both the core dump and the platform running lldb.
+ // Read field by field to correctly account for endianess of both the core
+ // dump and the platform running lldb.
offset_t offset = 0;
si_signo = data.GetU32(&offset);
si_code = data.GetU32(&offset);
@@ -340,7 +335,7 @@ size_t ELFLinuxPrPsInfo::GetSize(const lldb_private::ArchSpec &arch) {
return sizeof(ELFLinuxPrPsInfo);
return mips_linux_pr_psinfo_size_o32_n32;
}
-
+
switch (arch.GetCore()) {
case lldb_private::ArchSpec::eCore_s390x_generic:
case lldb_private::ArchSpec::eCore_x86_64_x86_64:
@@ -382,9 +377,9 @@ Status ELFLinuxPrPsInfo::Parse(const DataExtractor &data,
pr_uid = data.GetU32(&offset);
pr_gid = data.GetU32(&offset);
} else {
- // 16 bit on 32 bit platforms, 32 bit on 64 bit platforms
- pr_uid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
- pr_gid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
+ // 16 bit on 32 bit platforms, 32 bit on 64 bit platforms
+ pr_uid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
+ pr_gid = data.GetMaxU64(&offset, data.GetAddressByteSize() >> 1);
}
pr_pid = data.GetU32(&offset);
diff --git a/source/Plugins/Process/elf-core/ThreadElfCore.h b/source/Plugins/Process/elf-core/ThreadElfCore.h
index 335f698dbb24..167fd6edc4ce 100644
--- a/source/Plugins/Process/elf-core/ThreadElfCore.h
+++ b/source/Plugins/Process/elf-core/ThreadElfCore.h
@@ -146,8 +146,6 @@ public:
lldb::RegisterContextSP
CreateRegisterContextForFrame(lldb_private::StackFrame *frame) override;
- void ClearStackFrames() override;
-
static bool ThreadIDIsValid(lldb::tid_t thread) { return thread != 0; }
const char *GetName() override {
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
index 4d4a4f8c5c7a..4e20b56fb111 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
@@ -109,16 +109,14 @@ StateType GDBRemoteClientBase::SendContinuePacketAndWaitForResponse(
const bool should_stop = ShouldStop(signals, response);
response.SetFilePos(0);
- // The packet we should resume with. In the future
- // we should check our thread list and "do the right thing"
- // for new threads that show up while we stop and run async
- // packets. Setting the packet to 'c' to continue all threads
- // is the right thing to do 99.99% of the time because if a
- // thread was single stepping, and we sent an interrupt, we
- // will notice above that we didn't stop due to an interrupt
- // but stopped due to stepping and we would _not_ continue.
- // This packet may get modified by the async actions (e.g. to send a
- // signal).
+ // The packet we should resume with. In the future we should check our
+ // thread list and "do the right thing" for new threads that show up
+ // while we stop and run async packets. Setting the packet to 'c' to
+ // continue all threads is the right thing to do 99.99% of the time
+ // because if a thread was single stepping, and we sent an interrupt, we
+ // will notice above that we didn't stop due to an interrupt but stopped
+ // due to stepping and we would _not_ continue. This packet may get
+ // modified by the async actions (e.g. to send a signal).
m_continue_packet = 'c';
cont_lock.unlock();
@@ -177,6 +175,30 @@ GDBRemoteClientBase::SendPacketAndWaitForResponse(
}
GDBRemoteCommunication::PacketResult
+GDBRemoteClientBase::SendPacketAndReceiveResponseWithOutputSupport(
+ llvm::StringRef payload, StringExtractorGDBRemote &response,
+ bool send_async,
+ llvm::function_ref<void(llvm::StringRef)> output_callback) {
+ Lock lock(*this, send_async);
+ if (!lock) {
+ if (Log *log =
+ ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS))
+ log->Printf("GDBRemoteClientBase::%s failed to get mutex, not sending "
+ "packet '%.*s' (send_async=%d)",
+ __FUNCTION__, int(payload.size()), payload.data(),
+ send_async);
+ return PacketResult::ErrorSendFailed;
+ }
+
+ PacketResult packet_result = SendPacketNoLock(payload);
+ if (packet_result != PacketResult::Success)
+ return packet_result;
+
+ return ReadPacketWithOutputSupport(response, GetPacketTimeout(), true,
+ output_callback);
+}
+
+GDBRemoteCommunication::PacketResult
GDBRemoteClientBase::SendPacketAndWaitForResponseNoLock(
llvm::StringRef payload, StringExtractorGDBRemote &response) {
PacketResult packet_result = SendPacketNoLock(payload);
@@ -239,19 +261,16 @@ bool GDBRemoteClientBase::ShouldStop(const UnixSignals &signals,
if (m_async_count == 0)
return true; // We were not interrupted. The process stopped on its own.
- // Older debugserver stubs (before April 2016) can return two
- // stop-reply packets in response to a ^C packet.
- // Additionally, all debugservers still return two stop replies if
- // the inferior stops due to some other reason before the remote
- // stub manages to interrupt it. We need to wait for this
- // additional packet to make sure the packet sequence does not get
- // skewed.
+ // Older debugserver stubs (before April 2016) can return two stop-reply
+ // packets in response to a ^C packet. Additionally, all debugservers still
+ // return two stop replies if the inferior stops due to some other reason
+ // before the remote stub manages to interrupt it. We need to wait for this
+ // additional packet to make sure the packet sequence does not get skewed.
StringExtractorGDBRemote extra_stop_reply_packet;
ReadPacket(extra_stop_reply_packet, milliseconds(100), false);
- // Interrupting is typically done using SIGSTOP or SIGINT, so if
- // the process stops with some other signal, we definitely want to
- // stop.
+ // Interrupting is typically done using SIGSTOP or SIGINT, so if the process
+ // stops with some other signal, we definitely want to stop.
const uint8_t signo = response.GetHexU8(UINT8_MAX);
if (signo != signals.GetSignalNumberFromName("SIGSTOP") &&
signo != signals.GetSignalNumberFromName("SIGINT"))
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h b/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
index 2646405c9b91..3d84ce0ebe18 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.h
@@ -48,6 +48,11 @@ public:
StringExtractorGDBRemote &response,
bool send_async);
+ PacketResult SendPacketAndReceiveResponseWithOutputSupport(
+ llvm::StringRef payload, StringExtractorGDBRemote &response,
+ bool send_async,
+ llvm::function_ref<void(llvm::StringRef)> output_callback);
+
bool SendvContPacket(llvm::StringRef payload,
StringExtractorGDBRemote &response);
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
index 949cf19db658..c335b6002861 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp
@@ -150,9 +150,8 @@ GDBRemoteCommunication::~GDBRemoteCommunication() {
Disconnect();
}
- // Stop the communications read thread which is used to parse all
- // incoming packets. This function will block until the read
- // thread returns.
+ // Stop the communications read thread which is used to parse all incoming
+ // packets. This function will block until the read thread returns.
if (m_read_thread_enabled)
StopReadThread();
}
@@ -217,12 +216,10 @@ GDBRemoteCommunication::SendPacketNoLock(llvm::StringRef payload) {
}
}
- // If logging was just enabled and we have history, then dump out what
- // we have to the log so we get the historical context. The Dump() call
- // that
+ // If logging was just enabled and we have history, then dump out what we
+ // have to the log so we get the historical context. The Dump() call that
// logs all of the packet will set a boolean so that we don't dump this
- // more
- // than once
+ // more than once
if (!m_history.DidDumpToLog())
m_history.Dump(log);
@@ -275,6 +272,23 @@ GDBRemoteCommunication::PacketResult GDBRemoteCommunication::GetAck() {
}
GDBRemoteCommunication::PacketResult
+GDBRemoteCommunication::ReadPacketWithOutputSupport(
+ StringExtractorGDBRemote &response, Timeout<std::micro> timeout,
+ bool sync_on_timeout,
+ llvm::function_ref<void(llvm::StringRef)> output_callback) {
+ auto result = ReadPacket(response, timeout, sync_on_timeout);
+ while (result == PacketResult::Success && response.IsNormalResponse() &&
+ response.PeekChar() == 'O') {
+ response.GetChar();
+ std::string output;
+ if (response.GetHexByteString(output))
+ output_callback(output);
+ result = ReadPacket(response, timeout, sync_on_timeout);
+ }
+ return result;
+}
+
+GDBRemoteCommunication::PacketResult
GDBRemoteCommunication::ReadPacket(StringExtractorGDBRemote &response,
Timeout<std::micro> timeout,
bool sync_on_timeout) {
@@ -286,8 +300,8 @@ GDBRemoteCommunication::ReadPacket(StringExtractorGDBRemote &response,
// This function is called when a packet is requested.
// A whole packet is popped from the packet queue and returned to the caller.
-// Packets are placed into this queue from the communication read thread.
-// See GDBRemoteCommunication::AppendBytesToCache.
+// Packets are placed into this queue from the communication read thread. See
+// GDBRemoteCommunication::AppendBytesToCache.
GDBRemoteCommunication::PacketResult
GDBRemoteCommunication::PopPacketFromQueue(StringExtractorGDBRemote &response,
Timeout<std::micro> timeout) {
@@ -407,11 +421,9 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
break;
} else if (successful_responses == 1) {
// We got something else back as the first successful
- // response, it probably is
- // the response to the packet we actually wanted, so copy it
- // over if this
- // is the first success and continue to try to get the qEcho
- // response
+ // response, it probably is the response to the packet we
+ // actually wanted, so copy it over if this is the first
+ // success and continue to try to get the qEcho response
packet = echo_response;
got_actual_response = true;
}
@@ -424,14 +436,13 @@ GDBRemoteCommunication::WaitForPacketNoLock(StringExtractorGDBRemote &packet,
}
// We weren't able to sync back up with the server, we must abort
- // otherwise
- // all responses might not be from the right packets...
+ // otherwise all responses might not be from the right packets...
if (sync_success) {
// We timed out, but were able to recover
if (got_actual_response) {
// We initially timed out, but we did get a response that came in
- // before the successful
- // reply to our qEcho packet, so lets say everything is fine...
+ // before the successful reply to our qEcho packet, so lets say
+ // everything is fine...
return PacketResult::Success;
}
} else {
@@ -473,10 +484,9 @@ bool GDBRemoteCommunication::DecompressPacket() {
size_t pkt_size = m_bytes.size();
- // Smallest possible compressed packet is $N#00 - an uncompressed empty reply,
- // most commonly indicating
- // an unsupported packet. Anything less than 5 characters, it's definitely
- // not a compressed packet.
+ // Smallest possible compressed packet is $N#00 - an uncompressed empty
+ // reply, most commonly indicating an unsupported packet. Anything less than
+ // 5 characters, it's definitely not a compressed packet.
if (pkt_size < 5)
return true;
@@ -505,17 +515,15 @@ bool GDBRemoteCommunication::DecompressPacket() {
1; // The first character of the two hex checksum characters
// Normally size_of_first_packet == m_bytes.size() but m_bytes may contain
- // multiple packets.
- // size_of_first_packet is the size of the initial packet which we'll replace
- // with the decompressed
- // version of, leaving the rest of m_bytes unmodified.
+ // multiple packets. size_of_first_packet is the size of the initial packet
+ // which we'll replace with the decompressed version of, leaving the rest of
+ // m_bytes unmodified.
size_t size_of_first_packet = hash_mark_idx + 3;
// Compressed packets ("$C") start with a base10 number which is the size of
- // the uncompressed payload,
- // then a : and then the compressed data. e.g. $C1024:<binary>#00
- // Update content_start and content_length to only include the <binary> part
- // of the packet.
+ // the uncompressed payload, then a : and then the compressed data. e.g.
+ // $C1024:<binary>#00 Update content_start and content_length to only include
+ // the <binary> part of the packet.
uint64_t decompressed_bufsize = ULONG_MAX;
if (m_bytes[1] == 'C') {
@@ -564,15 +572,14 @@ bool GDBRemoteCommunication::DecompressPacket() {
}
if (m_bytes[1] == 'N') {
- // This packet was not compressed -- delete the 'N' character at the
- // start and the packet may be processed as-is.
+ // This packet was not compressed -- delete the 'N' character at the start
+ // and the packet may be processed as-is.
m_bytes.erase(1, 1);
return true;
}
- // Reverse the gdb-remote binary escaping that was done to the compressed text
- // to
- // guard characters like '$', '#', '}', etc.
+ // Reverse the gdb-remote binary escaping that was done to the compressed
+ // text to guard characters like '$', '#', '}', etc.
std::vector<uint8_t> unescaped_content;
unescaped_content.reserve(content_length);
size_t i = content_start;
@@ -613,12 +620,10 @@ bool GDBRemoteCommunication::DecompressPacket() {
else if (m_compression_type == CompressionType::LZMA)
compression_type = COMPRESSION_LZMA;
- // If we have the expected size of the decompressed payload, we can allocate
- // the right-sized buffer and do it. If we don't have that information,
- // we'll
- // need to try decoding into a big buffer and if the buffer wasn't big
- // enough,
- // increase it and try again.
+ // If we have the expected size of the decompressed payload, we can
+ // allocate the right-sized buffer and do it. If we don't have that
+ // information, we'll need to try decoding into a big buffer and if the
+ // buffer wasn't big enough, increase it and try again.
if (decompressed_bufsize != ULONG_MAX && decompressed_buffer != nullptr) {
decompressed_bytes = compression_decode_buffer(
@@ -706,9 +711,8 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
// Parse up the packets into gdb remote packets
if (!m_bytes.empty()) {
- // end_idx must be one past the last valid packet byte. Start
- // it off with an invalid value that is the same as the current
- // index.
+ // end_idx must be one past the last valid packet byte. Start it off with
+ // an invalid value that is the same as the current index.
size_t content_start = 0;
size_t content_length = 0;
size_t total_length = 0;
@@ -743,7 +747,8 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
checksum_idx = hash_pos + 1;
// Skip the dollar sign
content_start = 1;
- // Don't include the # in the content or the $ in the content length
+ // Don't include the # in the content or the $ in the content
+ // length
content_length = hash_pos - 1;
total_length =
@@ -757,11 +762,10 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
break;
default: {
- // We have an unexpected byte and we need to flush all bad
- // data that is in m_bytes, so we need to find the first
- // byte that is a '+' (ACK), '-' (NACK), \x03 (CTRL+C interrupt),
- // or '$' character (start of packet header) or of course,
- // the end of the data in m_bytes...
+ // We have an unexpected byte and we need to flush all bad data that is
+ // in m_bytes, so we need to find the first byte that is a '+' (ACK), '-'
+ // (NACK), \x03 (CTRL+C interrupt), or '$' character (start of packet
+ // header) or of course, the end of the data in m_bytes...
const size_t bytes_len = m_bytes.size();
bool done = false;
uint32_t idx;
@@ -802,16 +806,14 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
if (log) {
// If logging was just enabled and we have history, then dump out what
// we have to the log so we get the historical context. The Dump() call
- // that
- // logs all of the packet will set a boolean so that we don't dump this
- // more
- // than once
+ // that logs all of the packet will set a boolean so that we don't dump
+ // this more than once
if (!m_history.DidDumpToLog())
m_history.Dump(log);
bool binary = false;
- // Only detect binary for packets that start with a '$' and have a '#CC'
- // checksum
+ // Only detect binary for packets that start with a '$' and have a
+ // '#CC' checksum
if (m_bytes[0] == '$' && total_length > 4) {
for (size_t i = 0; !binary && i < total_length; ++i) {
unsigned char c = m_bytes[i];
@@ -834,8 +836,8 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
// Remove binary escaped bytes when displaying the packet...
const char ch = m_bytes[i];
if (ch == 0x7d) {
- // 0x7d is the escape character. The next character is to
- // be XOR'd with 0x20.
+ // 0x7d is the escape character. The next character is to be
+ // XOR'd with 0x20.
const char escapee = m_bytes[++i] ^ 0x20;
strm.Printf("%2.2x", escapee);
} else {
@@ -863,26 +865,25 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
// Clear packet_str in case there is some existing data in it.
packet_str.clear();
- // Copy the packet from m_bytes to packet_str expanding the
- // run-length encoding in the process.
- // Reserve enough byte for the most common case (no RLE used)
+ // Copy the packet from m_bytes to packet_str expanding the run-length
+ // encoding in the process. Reserve enough byte for the most common case
+ // (no RLE used)
packet_str.reserve(m_bytes.length());
for (std::string::const_iterator c = m_bytes.begin() + content_start;
c != m_bytes.begin() + content_end; ++c) {
if (*c == '*') {
- // '*' indicates RLE. Next character will give us the
- // repeat count and previous character is what is to be
- // repeated.
+ // '*' indicates RLE. Next character will give us the repeat count
+ // and previous character is what is to be repeated.
char char_to_repeat = packet_str.back();
// Number of time the previous character is repeated
int repeat_count = *++c + 3 - ' ';
- // We have the char_to_repeat and repeat_count. Now push
- // it in the packet.
+ // We have the char_to_repeat and repeat_count. Now push it in the
+ // packet.
for (int i = 0; i < repeat_count; ++i)
packet_str.push_back(char_to_repeat);
} else if (*c == 0x7d) {
- // 0x7d is the escape character. The next character is to
- // be XOR'd with 0x20.
+ // 0x7d is the escape character. The next character is to be XOR'd
+ // with 0x20.
char escapee = *++c ^ 0x20;
packet_str.push_back(escapee);
} else {
@@ -897,7 +898,8 @@ GDBRemoteCommunication::CheckForPacket(const uint8_t *src, size_t src_len,
if (GetSendAcks()) {
const char *packet_checksum_cstr = &m_bytes[checksum_idx];
char packet_checksum = strtol(packet_checksum_cstr, NULL, 16);
- char actual_checksum = CalculcateChecksum(packet_str);
+ char actual_checksum = CalculcateChecksum(
+ llvm::StringRef(m_bytes).slice(content_start, content_end));
success = packet_checksum == actual_checksum;
if (!success) {
if (log)
@@ -991,11 +993,12 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
char debugserver_path[PATH_MAX];
FileSpec &debugserver_file_spec = launch_info.GetExecutableFile();
- // Always check to see if we have an environment override for the path
- // to the debugserver to use and use it if we do.
+ // Always check to see if we have an environment override for the path to the
+ // debugserver to use and use it if we do.
const char *env_debugserver_path = getenv("LLDB_DEBUGSERVER_PATH");
if (env_debugserver_path) {
- debugserver_file_spec.SetFile(env_debugserver_path, false);
+ debugserver_file_spec.SetFile(env_debugserver_path, false,
+ FileSpec::Style::native);
if (log)
log->Printf("GDBRemoteCommunication::%s() gdb-remote stub exe path set "
"from environment variable: %s",
@@ -1004,10 +1007,9 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
debugserver_file_spec = g_debugserver_file_spec;
bool debugserver_exists = debugserver_file_spec.Exists();
if (!debugserver_exists) {
- // The debugserver binary is in the LLDB.framework/Resources
- // directory.
- if (HostInfo::GetLLDBPath(ePathTypeSupportExecutableDir,
- debugserver_file_spec)) {
+ // The debugserver binary is in the LLDB.framework/Resources directory.
+ debugserver_file_spec = HostInfo::GetSupportExeDir();
+ if (debugserver_file_spec) {
debugserver_file_spec.AppendPathComponent(DEBUGSERVER_BASENAME);
debugserver_exists = debugserver_file_spec.Exists();
if (debugserver_exists) {
@@ -1031,8 +1033,7 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
__FUNCTION__, debugserver_file_spec.GetPath().c_str());
}
// Don't cache the platform specific GDB server binary as it could
- // change
- // from platform to platform
+ // change from platform to platform
g_debugserver_file_spec.Clear();
}
}
@@ -1080,14 +1081,14 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
// once data is written to the pipe, debug server is up and running.
Pipe socket_pipe;
- // port is null when debug server should listen on domain socket -
- // we're not interested in port value but rather waiting for debug server
- // to become available.
+ // port is null when debug server should listen on domain socket - we're
+ // not interested in port value but rather waiting for debug server to
+ // become available.
if (pass_comm_fd == -1) {
if (url) {
-// Create a temporary file to get the stdout/stderr and redirect the
-// output of the command into this file. We will later read this file
-// if all goes well and fill the data into "command_output_ptr"
+// Create a temporary file to get the stdout/stderr and redirect the output of
+// the command into this file. We will later read this file if all goes well
+// and fill the data into "command_output_ptr"
#if defined(__APPLE__)
// Binding to port zero, we need to figure out what port it ends up
// using using a named pipe...
@@ -1120,8 +1121,7 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
#endif
} else {
// No host and port given, so lets listen on our end and make the
- // debugserver
- // connect to us..
+ // debugserver connect to us..
error = StartListenThread("127.0.0.1", 0);
if (error.Fail()) {
if (log)
@@ -1134,7 +1134,7 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
ConnectionFileDescriptor *connection =
(ConnectionFileDescriptor *)GetConnection();
// Wait for 10 seconds to resolve the bound port
- uint16_t port_ = connection->GetListeningPort(10);
+ uint16_t port_ = connection->GetListeningPort(std::chrono::seconds(10));
if (port_ > 0) {
char port_cstr[32];
snprintf(port_cstr, sizeof(port_cstr), "127.0.0.1:%i", port_);
@@ -1206,11 +1206,7 @@ Status GDBRemoteCommunication::StartDebugserverProcess(
}
// Copy the current environment to the gdbserver/debugserver instance
- StringList env;
- if (Host::GetEnvironment(env)) {
- for (size_t i = 0; i < env.GetSize(); ++i)
- launch_info.GetEnvironmentEntries().AppendArgument(env[i]);
- }
+ launch_info.GetEnvironment() = Host::GetEnvironment();
// Close STDIN, STDOUT and STDERR.
launch_info.AppendCloseFileAction(STDIN_FILENO);
@@ -1327,14 +1323,11 @@ GDBRemoteCommunication::ScopedTimeout::~ScopedTimeout() {
}
// This function is called via the Communications class read thread when bytes
-// become available
-// for this connection. This function will consume all incoming bytes and try to
-// parse whole
-// packets as they become available. Full packets are placed in a queue, so that
-// all packet
-// requests can simply pop from this queue. Async notification packets will be
-// dispatched
-// immediately to the ProcessGDBRemote Async thread via an event.
+// become available for this connection. This function will consume all
+// incoming bytes and try to parse whole packets as they become available. Full
+// packets are placed in a queue, so that all packet requests can simply pop
+// from this queue. Async notification packets will be dispatched immediately
+// to the ProcessGDBRemote Async thread via an event.
void GDBRemoteCommunication::AppendBytesToCache(const uint8_t *bytes,
size_t len, bool broadcast,
lldb::ConnectionStatus status) {
@@ -1343,8 +1336,8 @@ void GDBRemoteCommunication::AppendBytesToCache(const uint8_t *bytes,
while (true) {
PacketType type = CheckForPacket(bytes, len, packet);
- // scrub the data so we do not pass it back to CheckForPacket
- // on future passes of the loop
+ // scrub the data so we do not pass it back to CheckForPacket on future
+ // passes of the loop
bytes = nullptr;
len = 0;
@@ -1368,8 +1361,8 @@ void GDBRemoteCommunication::AppendBytesToCache(const uint8_t *bytes,
// put this packet into an event
const char *pdata = packet.GetStringRef().c_str();
- // as the communication class, we are a broadcaster and the
- // async thread is tuned to listen to us
+ // as the communication class, we are a broadcaster and the async thread
+ // is tuned to listen to us
BroadcastEvent(eBroadcastBitGdbReadThreadGotNotify,
new EventDataBytes(pdata));
}
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
index ecc9386e49c7..67796e4c61ef 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.h
@@ -24,10 +24,10 @@
#include "lldb/Core/Listener.h"
#include "lldb/Host/HostThread.h"
#include "lldb/Host/Predicate.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/lldb-public.h"
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
namespace lldb_private {
namespace process_gdb_remote {
@@ -232,6 +232,11 @@ protected:
PacketResult ReadPacket(StringExtractorGDBRemote &response,
Timeout<std::micro> timeout, bool sync_on_timeout);
+ PacketResult ReadPacketWithOutputSupport(
+ StringExtractorGDBRemote &response, Timeout<std::micro> timeout,
+ bool sync_on_timeout,
+ llvm::function_ref<void(llvm::StringRef)> output_callback);
+
// Pop a packet from the queue in a thread safe manner
PacketResult PopPacketFromQueue(StringExtractorGDBRemote &response,
Timeout<std::micro> timeout);
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
index 867f57c475ce..c8b59d5d236b 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.cpp
@@ -21,11 +21,12 @@
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/State.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Host/XML.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/UnixSignals.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBufferHeap.h"
#include "lldb/Utility/JSON.h"
#include "lldb/Utility/LLDBAssert.h"
@@ -35,8 +36,8 @@
// Project includes
#include "ProcessGDBRemote.h"
#include "ProcessGDBRemoteLog.h"
-#include "Utility/StringExtractorGDBRemote.h"
#include "lldb/Host/Config.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
#include "llvm/ADT/StringSwitch.h"
@@ -81,6 +82,7 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient()
m_supports_qXfer_libraries_read(eLazyBoolCalculate),
m_supports_qXfer_libraries_svr4_read(eLazyBoolCalculate),
m_supports_qXfer_features_read(eLazyBoolCalculate),
+ m_supports_qXfer_memory_map_read(eLazyBoolCalculate),
m_supports_augmented_libraries_svr4_read(eLazyBoolCalculate),
m_supports_jThreadExtendedInfo(eLazyBoolCalculate),
m_supports_jLoadedDynamicLibrariesInfos(eLazyBoolCalculate),
@@ -98,12 +100,12 @@ GDBRemoteCommunicationClient::GDBRemoteCommunicationClient()
m_curr_pid(LLDB_INVALID_PROCESS_ID), m_curr_tid(LLDB_INVALID_THREAD_ID),
m_curr_tid_run(LLDB_INVALID_THREAD_ID),
m_num_supported_hardware_watchpoints(0), m_host_arch(), m_process_arch(),
- m_os_version_major(UINT32_MAX), m_os_version_minor(UINT32_MAX),
- m_os_version_update(UINT32_MAX), m_os_build(), m_os_kernel(),
- m_hostname(), m_gdb_server_name(), m_gdb_server_version(UINT32_MAX),
- m_default_packet_timeout(0), m_max_packet_size(0),
- m_qSupported_response(), m_supported_async_json_packets_is_valid(false),
- m_supported_async_json_packets_sp() {}
+ m_os_build(), m_os_kernel(), m_hostname(), m_gdb_server_name(),
+ m_gdb_server_version(UINT32_MAX), m_default_packet_timeout(0),
+ m_max_packet_size(0), m_qSupported_response(),
+ m_supported_async_json_packets_is_valid(false),
+ m_supported_async_json_packets_sp(), m_qXfer_memory_map(),
+ m_qXfer_memory_map_loaded(false) {}
//----------------------------------------------------------------------
// Destructor
@@ -116,8 +118,8 @@ GDBRemoteCommunicationClient::~GDBRemoteCommunicationClient() {
bool GDBRemoteCommunicationClient::HandshakeWithServer(Status *error_ptr) {
ResetDiscoverableSettings(false);
- // Start the read thread after we send the handshake ack since if we
- // fail to send the handshake ack, there is no reason to continue...
+ // Start the read thread after we send the handshake ack since if we fail to
+ // send the handshake ack, there is no reason to continue...
if (SendAck()) {
// Wait for any responses that might have been queued up in the remote
// GDB server and flush them all
@@ -127,9 +129,9 @@ bool GDBRemoteCommunicationClient::HandshakeWithServer(Status *error_ptr) {
packet_result = ReadPacket(response, milliseconds(10), false);
// The return value from QueryNoAckModeSupported() is true if the packet
- // was sent and _any_ response (including UNIMPLEMENTED) was received),
- // or false if no response was received. This quickly tells us if we have
- // a live connection to a remote GDB server...
+ // was sent and _any_ response (including UNIMPLEMENTED) was received), or
+ // false if no response was received. This quickly tells us if we have a
+ // live connection to a remote GDB server...
if (QueryNoAckModeSupported()) {
return true;
} else {
@@ -192,6 +194,13 @@ bool GDBRemoteCommunicationClient::GetQXferFeaturesReadSupported() {
return m_supports_qXfer_features_read == eLazyBoolYes;
}
+bool GDBRemoteCommunicationClient::GetQXferMemoryMapReadSupported() {
+ if (m_supports_qXfer_memory_map_read == eLazyBoolCalculate) {
+ GetRemoteQSupported();
+ }
+ return m_supports_qXfer_memory_map_read == eLazyBoolYes;
+}
+
uint64_t GDBRemoteCommunicationClient::GetRemoteMaxPacketSize() {
if (m_max_packet_size == 0) {
GetRemoteQSupported();
@@ -205,9 +214,8 @@ bool GDBRemoteCommunicationClient::QueryNoAckModeSupported() {
m_supports_not_sending_acks = eLazyBoolNo;
// This is the first real packet that we'll send in a debug session and it
- // may take a little
- // longer than normal to receive a reply. Wait at least 6 seconds for a
- // reply to this packet.
+ // may take a little longer than normal to receive a reply. Wait at least
+ // 6 seconds for a reply to this packet.
ScopedTimeout timeout(*this, std::max(GetPacketTimeout(), seconds(6)));
@@ -296,6 +304,7 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
m_supports_qXfer_libraries_read = eLazyBoolCalculate;
m_supports_qXfer_libraries_svr4_read = eLazyBoolCalculate;
m_supports_qXfer_features_read = eLazyBoolCalculate;
+ m_supports_qXfer_memory_map_read = eLazyBoolCalculate;
m_supports_augmented_libraries_svr4_read = eLazyBoolCalculate;
m_supports_qProcessInfoPID = true;
m_supports_qfProcessInfo = true;
@@ -313,9 +322,7 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
m_qSymbol_requests_done = false;
m_supports_qModuleInfo = true;
m_host_arch.Clear();
- m_os_version_major = UINT32_MAX;
- m_os_version_minor = UINT32_MAX;
- m_os_version_update = UINT32_MAX;
+ m_os_version = llvm::VersionTuple();
m_os_build.clear();
m_os_kernel.clear();
m_hostname.clear();
@@ -329,8 +336,8 @@ void GDBRemoteCommunicationClient::ResetDiscoverableSettings(bool did_exec) {
m_supports_jModulesInfo = true;
}
- // These flags should be reset when we first connect to a GDB server
- // and when our inferior process execs
+ // These flags should be reset when we first connect to a GDB server and when
+ // our inferior process execs
m_qProcessInfo_is_valid = eLazyBoolCalculate;
m_process_arch.Clear();
}
@@ -342,6 +349,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_qXfer_libraries_svr4_read = eLazyBoolNo;
m_supports_augmented_libraries_svr4_read = eLazyBoolNo;
m_supports_qXfer_features_read = eLazyBoolNo;
+ m_supports_qXfer_memory_map_read = eLazyBoolNo;
m_max_packet_size = UINT64_MAX; // It's supposed to always be there, but if
// not, we assume no limit
@@ -361,8 +369,7 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
const char *response_cstr = response.GetStringRef().c_str();
// Hang on to the qSupported packet, so that platforms can do custom
- // configuration of the transport before attaching/launching the
- // process.
+ // configuration of the transport before attaching/launching the process.
m_qSupported_response = response_cstr;
if (::strstr(response_cstr, "qXfer:auxv:read+"))
@@ -377,9 +384,12 @@ void GDBRemoteCommunicationClient::GetRemoteQSupported() {
m_supports_qXfer_libraries_read = eLazyBoolYes;
if (::strstr(response_cstr, "qXfer:features:read+"))
m_supports_qXfer_features_read = eLazyBoolYes;
+ if (::strstr(response_cstr, "qXfer:memory-map:read+"))
+ m_supports_qXfer_memory_map_read = eLazyBoolYes;
// Look for a list of compressions in the features list e.g.
- // qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-deflate,lzma
+ // qXfer:features:read+;PacketSize=20000;qEcho+;SupportedCompressions=zlib-
+ // deflate,lzma
const char *features_list = ::strstr(response_cstr, "qXfer:features:");
if (features_list) {
const char *compressions =
@@ -543,9 +553,8 @@ GDBRemoteCommunicationClient::SendThreadSpecificPacketAndWaitForResponse(
return SendPacketAndWaitForResponseNoLock(payload.GetString(), response);
}
-// Check if the target supports 'p' packet. It sends out a 'p'
-// packet and checks the response. A normal packet will tell us
-// that support is available.
+// Check if the target supports 'p' packet. It sends out a 'p' packet and
+// checks the response. A normal packet will tell us that support is available.
//
// Takes a valid thread ID because p needs to apply to a thread.
bool GDBRemoteCommunicationClient::GetpPacketSupported(lldb::tid_t tid) {
@@ -600,8 +609,8 @@ bool GDBRemoteCommunicationClient::GetThreadExtendedInfoSupported() {
void GDBRemoteCommunicationClient::EnableErrorStringInPacket() {
if (m_supports_error_string_reply == eLazyBoolCalculate) {
StringExtractorGDBRemote response;
- // We try to enable error strings in remote packets
- // but if we fail, we just work in the older way.
+ // We try to enable error strings in remote packets but if we fail, we just
+ // work in the older way.
m_supports_error_string_reply = eLazyBoolNo;
if (SendPacketAndWaitForResponse("QEnableErrorStrings", response, false) ==
PacketResult::Success) {
@@ -715,12 +724,10 @@ lldb::pid_t GDBRemoteCommunicationClient::GetCurrentProcessID(bool allow_lazy) {
return m_curr_pid;
} else {
// If we don't get a response for qProcessInfo, check if $qC gives us a
- // result.
- // $qC only returns a real process id on older debugserver and lldb-platform
- // stubs.
- // The gdb remote protocol documents $qC as returning the thread id, which
- // newer
- // debugserver and lldb-gdbserver stubs return correctly.
+ // result. $qC only returns a real process id on older debugserver and
+ // lldb-platform stubs. The gdb remote protocol documents $qC as returning
+ // the thread id, which newer debugserver and lldb-gdbserver stubs return
+ // correctly.
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse("qC", response, false) ==
PacketResult::Success) {
@@ -775,8 +782,8 @@ bool GDBRemoteCommunicationClient::GetLaunchSuccess(std::string &error_str) {
int GDBRemoteCommunicationClient::SendArgumentsPacket(
const ProcessLaunchInfo &launch_info) {
// Since we don't get the send argv0 separate from the executable path, we
- // need to
- // make sure to use the actual executable path found in the launch_info...
+ // need to make sure to use the actual executable path found in the
+ // launch_info...
std::vector<const char *> argv;
FileSpec exe_file = launch_info.GetExecutableFile();
std::string exe_path;
@@ -822,6 +829,15 @@ int GDBRemoteCommunicationClient::SendArgumentsPacket(
return -1;
}
+int GDBRemoteCommunicationClient::SendEnvironment(const Environment &env) {
+ for (const auto &KV : env) {
+ int r = SendEnvironmentPacket(Environment::compose(KV).c_str());
+ if (r != 0)
+ return r;
+ }
+ return 0;
+}
+
int GDBRemoteCommunicationClient::SendEnvironmentPacket(
char const *name_equal_value) {
if (name_equal_value && name_equal_value[0]) {
@@ -925,18 +941,9 @@ int GDBRemoteCommunicationClient::SendLaunchEventDataPacket(
return -1;
}
-bool GDBRemoteCommunicationClient::GetOSVersion(uint32_t &major,
- uint32_t &minor,
- uint32_t &update) {
- if (GetHostInfo()) {
- if (m_os_version_major != UINT32_MAX) {
- major = m_os_version_major;
- minor = m_os_version_minor;
- update = m_os_version_update;
- return true;
- }
- }
- return false;
+llvm::VersionTuple GDBRemoteCommunicationClient::GetOSVersion() {
+ GetHostInfo();
+ return m_os_version;
}
bool GDBRemoteCommunicationClient::GetOSBuildString(std::string &s) {
@@ -1199,9 +1206,7 @@ bool GDBRemoteCommunicationClient::GetHostInfo(bool force) {
// "version" key instead of
// "os_version"...
{
- Args::StringToVersion(value, m_os_version_major, m_os_version_minor,
- m_os_version_update);
- if (m_os_version_major != UINT32_MAX)
+ if (!m_os_version.tryParse(value))
++num_keys_decoded;
} else if (name.equals("watchpoint_exceptions_received")) {
m_watchpoints_trigger_after_instruction =
@@ -1451,7 +1456,8 @@ Status GDBRemoteCommunicationClient::GetMemoryRegionInfo(
UNUSED_IF_ASSERT_DISABLED(packet_len);
StringExtractorGDBRemote response;
if (SendPacketAndWaitForResponse(packet, response, false) ==
- PacketResult::Success) {
+ PacketResult::Success &&
+ response.GetResponseType() == StringExtractorGDBRemote::eResponse) {
llvm::StringRef name;
llvm::StringRef value;
addr_t addr_value = LLDB_INVALID_ADDRESS;
@@ -1527,8 +1533,134 @@ Status GDBRemoteCommunicationClient::GetMemoryRegionInfo(
if (m_supports_memory_region_info == eLazyBoolNo) {
error.SetErrorString("qMemoryRegionInfo is not supported");
}
- if (error.Fail())
- region_info.Clear();
+
+ // Try qXfer:memory-map:read to get region information not included in
+ // qMemoryRegionInfo
+ MemoryRegionInfo qXfer_region_info;
+ Status qXfer_error = GetQXferMemoryMapRegionInfo(addr, qXfer_region_info);
+
+ if (error.Fail()) {
+ // If qMemoryRegionInfo failed, but qXfer:memory-map:read succeeded, use
+ // the qXfer result as a fallback
+ if (qXfer_error.Success()) {
+ region_info = qXfer_region_info;
+ error.Clear();
+ } else {
+ region_info.Clear();
+ }
+ } else if (qXfer_error.Success()) {
+ // If both qMemoryRegionInfo and qXfer:memory-map:read succeeded, and if
+ // both regions are the same range, update the result to include the flash-
+ // memory information that is specific to the qXfer result.
+ if (region_info.GetRange() == qXfer_region_info.GetRange()) {
+ region_info.SetFlash(qXfer_region_info.GetFlash());
+ region_info.SetBlocksize(qXfer_region_info.GetBlocksize());
+ }
+ }
+ return error;
+}
+
+Status GDBRemoteCommunicationClient::GetQXferMemoryMapRegionInfo(
+ lldb::addr_t addr, MemoryRegionInfo &region) {
+ Status error = LoadQXferMemoryMap();
+ if (!error.Success())
+ return error;
+ for (const auto &map_region : m_qXfer_memory_map) {
+ if (map_region.GetRange().Contains(addr)) {
+ region = map_region;
+ return error;
+ }
+ }
+ error.SetErrorString("Region not found");
+ return error;
+}
+
+Status GDBRemoteCommunicationClient::LoadQXferMemoryMap() {
+
+ Status error;
+
+ if (m_qXfer_memory_map_loaded)
+ // Already loaded, return success
+ return error;
+
+ if (!XMLDocument::XMLEnabled()) {
+ error.SetErrorString("XML is not supported");
+ return error;
+ }
+
+ if (!GetQXferMemoryMapReadSupported()) {
+ error.SetErrorString("Memory map is not supported");
+ return error;
+ }
+
+ std::string xml;
+ lldb_private::Status lldberr;
+ if (!ReadExtFeature(ConstString("memory-map"), ConstString(""), xml,
+ lldberr)) {
+ error.SetErrorString("Failed to read memory map");
+ return error;
+ }
+
+ XMLDocument xml_document;
+
+ if (!xml_document.ParseMemory(xml.c_str(), xml.size())) {
+ error.SetErrorString("Failed to parse memory map xml");
+ return error;
+ }
+
+ XMLNode map_node = xml_document.GetRootElement("memory-map");
+ if (!map_node) {
+ error.SetErrorString("Invalid root node in memory map xml");
+ return error;
+ }
+
+ m_qXfer_memory_map.clear();
+
+ map_node.ForEachChildElement([this](const XMLNode &memory_node) -> bool {
+ if (!memory_node.IsElement())
+ return true;
+ if (memory_node.GetName() != "memory")
+ return true;
+ auto type = memory_node.GetAttributeValue("type", "");
+ uint64_t start;
+ uint64_t length;
+ if (!memory_node.GetAttributeValueAsUnsigned("start", start))
+ return true;
+ if (!memory_node.GetAttributeValueAsUnsigned("length", length))
+ return true;
+ MemoryRegionInfo region;
+ region.GetRange().SetRangeBase(start);
+ region.GetRange().SetByteSize(length);
+ if (type == "rom") {
+ region.SetReadable(MemoryRegionInfo::eYes);
+ this->m_qXfer_memory_map.push_back(region);
+ } else if (type == "ram") {
+ region.SetReadable(MemoryRegionInfo::eYes);
+ region.SetWritable(MemoryRegionInfo::eYes);
+ this->m_qXfer_memory_map.push_back(region);
+ } else if (type == "flash") {
+ region.SetFlash(MemoryRegionInfo::eYes);
+ memory_node.ForEachChildElement(
+ [&region](const XMLNode &prop_node) -> bool {
+ if (!prop_node.IsElement())
+ return true;
+ if (prop_node.GetName() != "property")
+ return true;
+ auto propname = prop_node.GetAttributeValue("name", "");
+ if (propname == "blocksize") {
+ uint64_t blocksize;
+ if (prop_node.GetElementTextAsUnsigned(blocksize))
+ region.SetBlocksize(blocksize);
+ }
+ return true;
+ });
+ this->m_qXfer_memory_map.push_back(region);
+ }
+ return true;
+ });
+
+ m_qXfer_memory_map_loaded = true;
+
return error;
}
@@ -1585,13 +1717,13 @@ GDBRemoteCommunicationClient::GetWatchpointsTriggerAfterInstruction(
Status error;
llvm::Triple::ArchType atype = arch.GetMachine();
- // we assume watchpoints will happen after running the relevant opcode
- // and we only want to override this behavior if we have explicitly
- // received a qHostInfo telling us otherwise
+ // we assume watchpoints will happen after running the relevant opcode and we
+ // only want to override this behavior if we have explicitly received a
+ // qHostInfo telling us otherwise
if (m_qHostInfo_is_valid != eLazyBoolYes) {
// On targets like MIPS and ppc64le, watchpoint exceptions are always
- // generated before the instruction is executed. The connected target
- // may not support qHostInfo or qWatchpointSupportInfo packets.
+ // generated before the instruction is executed. The connected target may
+ // not support qHostInfo or qWatchpointSupportInfo packets.
if (atype == llvm::Triple::mips || atype == llvm::Triple::mipsel ||
atype == llvm::Triple::mips64 || atype == llvm::Triple::mips64el ||
atype == llvm::Triple::ppc64le)
@@ -1789,11 +1921,12 @@ bool GDBRemoteCommunicationClient::DecodeProcessInfoResponse(
process_info.GetArchitecture().SetTriple(triple.c_str());
} else if (name.equals("name")) {
StringExtractor extractor(value);
- // The process name from ASCII hex bytes since we can't
- // control the characters in a process name
+ // The process name from ASCII hex bytes since we can't control the
+ // characters in a process name
std::string name;
extractor.GetHexByteString(name);
- process_info.GetExecutableFile().SetFile(name, false);
+ process_info.GetExecutableFile().SetFile(name, false,
+ FileSpec::Style::native);
} else if (name.equals("cputype")) {
value.getAsInteger(0, cpu);
} else if (name.equals("cpusubtype")) {
@@ -2046,8 +2179,8 @@ uint32_t GDBRemoteCommunicationClient::FindProcesses(
}
}
StringExtractorGDBRemote response;
- // Increase timeout as the first qfProcessInfo packet takes a long time
- // on Android. The value of 1min was arrived at empirically.
+ // Increase timeout as the first qfProcessInfo packet takes a long time on
+ // Android. The value of 1min was arrived at empirically.
ScopedTimeout timeout(*this, minutes(1));
if (SendPacketAndWaitForResponse(packet.GetString(), response, false) ==
PacketResult::Success) {
@@ -2081,8 +2214,8 @@ bool GDBRemoteCommunicationClient::GetUserName(uint32_t uid,
PacketResult::Success) {
if (response.IsNormalResponse()) {
// Make sure we parsed the right number of characters. The response is
- // the hex encoded user name and should make up the entire packet.
- // If there are any non-hex ASCII bytes, the length won't match below..
+ // the hex encoded user name and should make up the entire packet. If
+ // there are any non-hex ASCII bytes, the length won't match below..
if (response.GetHexByteString(name) * 2 ==
response.GetStringRef().size())
return true;
@@ -2108,8 +2241,8 @@ bool GDBRemoteCommunicationClient::GetGroupName(uint32_t gid,
PacketResult::Success) {
if (response.IsNormalResponse()) {
// Make sure we parsed the right number of characters. The response is
- // the hex encoded group name and should make up the entire packet.
- // If there are any non-hex ASCII bytes, the length won't match below..
+ // the hex encoded group name and should make up the entire packet. If
+ // there are any non-hex ASCII bytes, the length won't match below..
if (response.GetHexByteString(name) * 2 ==
response.GetStringRef().size())
return true;
@@ -2335,8 +2468,8 @@ bool GDBRemoteCommunicationClient::LaunchGDBServer(
// Make the GDB server we launch only accept connections from this host
stream.Printf("host:%s;", hostname.c_str());
} else {
- // Make the GDB server we launch accept connections from any host since we
- // can't figure out the hostname
+ // Make the GDB server we launch accept connections from any host since
+ // we can't figure out the hostname
stream.Printf("host:*;");
}
}
@@ -2650,13 +2783,16 @@ lldb_private::Status GDBRemoteCommunicationClient::RunShellCommand(
// process to exit
std::string
*command_output, // Pass NULL if you don't want the command output
- uint32_t
- timeout_sec) // Timeout in seconds to wait for shell program to finish
-{
+ const Timeout<std::micro> &timeout) {
lldb_private::StreamString stream;
stream.PutCString("qPlatform_shell:");
stream.PutBytesAsRawHex8(command, strlen(command));
stream.PutChar(',');
+ uint32_t timeout_sec = UINT32_MAX;
+ if (timeout) {
+ // TODO: Use chrono version of std::ceil once c++17 is available.
+ timeout_sec = std::ceil(std::chrono::duration<double>(*timeout).count());
+ }
stream.PutHex32(timeout_sec);
if (working_dir) {
std::string path{working_dir.GetPath(false)};
@@ -3125,9 +3261,8 @@ bool GDBRemoteCommunicationClient::SaveRegisterState(lldb::tid_t tid,
bool GDBRemoteCommunicationClient::RestoreRegisterState(lldb::tid_t tid,
uint32_t save_id) {
// We use the "m_supports_QSaveRegisterState" variable here because the
- // QSaveRegisterState and QRestoreRegisterState packets must both be supported
- // in
- // order to be useful
+ // QSaveRegisterState and QRestoreRegisterState packets must both be
+ // supported in order to be useful
if (m_supports_QSaveRegisterState == eLazyBoolNo)
return false;
@@ -3406,7 +3541,7 @@ bool GDBRemoteCommunicationClient::GetModuleInfo(
StringExtractor extractor(value);
std::string uuid;
extractor.GetHexByteString(uuid);
- module_spec.GetUUID().SetFromCString(uuid.c_str(), uuid.size() / 2);
+ module_spec.GetUUID().SetFromStringRef(uuid, uuid.size() / 2);
} else if (name == "triple") {
StringExtractor extractor(value);
std::string triple;
@@ -3523,8 +3658,8 @@ GDBRemoteCommunicationClient::GetModulesInfo(
// query the target remote for extended information using the qXfer packet
//
-// example: object='features', annex='target.xml', out=<xml output>
-// return: 'true' on success
+// example: object='features', annex='target.xml', out=<xml output> return:
+// 'true' on success
// 'false' on failure (err set)
bool GDBRemoteCommunicationClient::ReadExtFeature(
const lldb_private::ConstString object,
@@ -3631,10 +3766,9 @@ bool GDBRemoteCommunicationClient::ReadExtFeature(
void GDBRemoteCommunicationClient::ServeSymbolLookups(
lldb_private::Process *process) {
- // Set to true once we've resolved a symbol to an address for the remote stub.
- // If we get an 'OK' response after this, the remote stub doesn't need any
- // more
- // symbols and we can stop asking.
+ // Set to true once we've resolved a symbol to an address for the remote
+ // stub. If we get an 'OK' response after this, the remote stub doesn't need
+ // any more symbols and we can stop asking.
bool symbol_response_provided = false;
// Is this the initial qSymbol:: packet?
@@ -3659,8 +3793,8 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups(
first_qsymbol_query = false;
if (response.IsUnsupportedResponse()) {
- // qSymbol is not supported by the current GDB server we are connected
- // to
+ // qSymbol is not supported by the current GDB server we are
+ // connected to
m_supports_qSymbol = false;
return;
} else {
@@ -3725,10 +3859,8 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups(
}
}
// This is the normal path where our symbol lookup was successful
- // and we want
- // to send a packet with the new symbol value and see if another
- // lookup needs to be
- // done.
+ // and we want to send a packet with the new symbol value and see
+ // if another lookup needs to be done.
// Change "packet" to contain the requested symbol value and name
packet.Clear();
@@ -3763,8 +3895,7 @@ void GDBRemoteCommunicationClient::ServeSymbolLookups(
StructuredData::Array *
GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins() {
if (!m_supported_async_json_packets_is_valid) {
- // Query the server for the array of supported asynchronous JSON
- // packets.
+ // Query the server for the array of supported asynchronous JSON packets.
m_supported_async_json_packets_is_valid = true;
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
@@ -3778,8 +3909,8 @@ GDBRemoteCommunicationClient::GetSupportedStructuredDataPlugins() {
StructuredData::ParseJSON(response.GetStringRef());
if (m_supported_async_json_packets_sp &&
!m_supported_async_json_packets_sp->GetAsArray()) {
- // We were returned something other than a JSON array. This
- // is invalid. Clear it out.
+ // We were returned something other than a JSON array. This is
+ // invalid. Clear it out.
if (log)
log->Printf("GDBRemoteCommunicationClient::%s(): "
"QSupportedAsyncJSONPackets returned invalid "
@@ -3837,8 +3968,7 @@ Status GDBRemoteCommunicationClient::ConfigureRemoteStructuredData(
return error;
}
- // Build command: Configure{type_name}: serialized config
- // data.
+ // Build command: Configure{type_name}: serialized config data.
StreamGDBRemote stream;
stream.PutCString("QConfigure");
stream.PutCString(type_name.AsCString());
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
index ba67b8246398..cf1d249768d7 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h
@@ -121,6 +121,7 @@ public:
/// response was received.
//------------------------------------------------------------------
int SendEnvironmentPacket(char const *name_equal_value);
+ int SendEnvironment(const Environment &env);
int SendLaunchArchPacket(const char *arch);
@@ -265,7 +266,7 @@ public:
bool GetDefaultThreadId(lldb::tid_t &tid);
- bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
+ llvm::VersionTuple GetOSVersion();
bool GetOSBuildString(std::string &s);
@@ -354,6 +355,8 @@ public:
bool GetQXferFeaturesReadSupported();
+ bool GetQXferMemoryMapReadSupported();
+
LazyBool SupportsAllocDeallocMemory() // const
{
// Uncomment this to have lldb pretend the debug server doesn't respond to
@@ -401,8 +404,7 @@ public:
// the process to exit
std::string
*command_output, // Pass nullptr if you don't want the command output
- uint32_t timeout_sec); // Timeout in seconds to wait for shell program to
- // finish
+ const Timeout<std::micro> &timeout);
bool CalculateMD5(const FileSpec &file_spec, uint64_t &high, uint64_t &low);
@@ -544,6 +546,7 @@ protected:
LazyBool m_supports_qXfer_libraries_read;
LazyBool m_supports_qXfer_libraries_svr4_read;
LazyBool m_supports_qXfer_features_read;
+ LazyBool m_supports_qXfer_memory_map_read;
LazyBool m_supports_augmented_libraries_svr4_read;
LazyBool m_supports_jThreadExtendedInfo;
LazyBool m_supports_jLoadedDynamicLibrariesInfos;
@@ -570,9 +573,7 @@ protected:
ArchSpec m_host_arch;
ArchSpec m_process_arch;
- uint32_t m_os_version_major;
- uint32_t m_os_version_minor;
- uint32_t m_os_version_update;
+ llvm::VersionTuple m_os_version;
std::string m_os_build;
std::string m_os_kernel;
std::string m_hostname;
@@ -587,6 +588,9 @@ protected:
bool m_supported_async_json_packets_is_valid;
lldb_private::StructuredData::ObjectSP m_supported_async_json_packets_sp;
+ std::vector<MemoryRegionInfo> m_qXfer_memory_map;
+ bool m_qXfer_memory_map_loaded;
+
bool GetCurrentProcessInfo(bool allow_lazy_pid = true);
bool GetGDBServerVersion();
@@ -609,6 +613,11 @@ protected:
llvm::MutableArrayRef<uint8_t> &buffer,
size_t offset);
+ Status LoadQXferMemoryMap();
+
+ Status GetQXferMemoryMapRegionInfo(lldb::addr_t addr,
+ MemoryRegionInfo &region);
+
private:
DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationClient);
};
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
index 4be92b79fd1a..4fc1fc7a1964 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.cpp
@@ -19,8 +19,8 @@
// Project includes
#include "ProcessGDBRemoteLog.h"
-#include "Utility/StringExtractorGDBRemote.h"
#include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
index a35352480040..880caacd6414 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h
@@ -57,8 +57,8 @@ protected:
bool m_exit_now; // use in asynchronous handling to indicate process should
// exit.
- bool m_send_error_strings; // If the client enables this then
- // we will send error strings as well.
+ bool m_send_error_strings = false; // If the client enables this then
+ // we will send error strings as well.
PacketResult Handle_QErrorStringEnable(StringExtractorGDBRemote &packet);
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
index 3cf6b8ac07b2..c5b478378faa 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
@@ -28,7 +28,7 @@
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
#include "lldb/Host/HostInfo.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/FileAction.h"
#include "lldb/Target/Platform.h"
@@ -36,13 +36,14 @@
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/JSON.h"
#include "lldb/Utility/Log.h"
+#include "lldb/Utility/SafeMachO.h"
#include "lldb/Utility/StreamGDBRemote.h"
#include "lldb/Utility/StreamString.h"
#include "llvm/ADT/Triple.h"
// Project includes
#include "ProcessGDBRemoteLog.h"
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
#ifdef __ANDROID__
#include "lldb/Host/android/HostInfoAndroid.h"
@@ -218,12 +219,15 @@ GDBRemoteCommunicationServerCommon::Handle_qHostInfo(
if (sub != LLDB_INVALID_CPUTYPE)
response.Printf("cpusubtype:%u;", sub);
- if (cpu == ArchSpec::kCore_arm_any) {
+ if (cpu == llvm::MachO::CPU_TYPE_ARM
+ || cpu == llvm::MachO::CPU_TYPE_ARM64) {
// Indicate the OS type.
#if defined(TARGET_OS_TV) && TARGET_OS_TV == 1
response.PutCString("ostype:tvos;");
#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
response.PutCString("ostype:watchos;");
+#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
+ response.PutCString("ostype:bridgeos;");
#else
response.PutCString("ostype:ios;");
#endif
@@ -265,19 +269,10 @@ GDBRemoteCommunicationServerCommon::Handle_qHostInfo(
break;
}
- uint32_t major = UINT32_MAX;
- uint32_t minor = UINT32_MAX;
- uint32_t update = UINT32_MAX;
- if (HostInfo::GetOSVersion(major, minor, update)) {
- if (major != UINT32_MAX) {
- response.Printf("os_version:%u", major);
- if (minor != UINT32_MAX) {
- response.Printf(".%u", minor);
- if (update != UINT32_MAX)
- response.Printf(".%u", update);
- }
- response.PutChar(';');
- }
+ llvm::VersionTuple version = HostInfo::GetOSVersion();
+ if (!version.empty()) {
+ response.Format("os_version:{0}", version.getAsString());
+ response.PutChar(';');
}
std::string s;
@@ -295,9 +290,9 @@ GDBRemoteCommunicationServerCommon::Handle_qHostInfo(
#if defined(__APPLE__)
#if defined(__arm__) || defined(__arm64__) || defined(__aarch64__)
- // For iOS devices, we are connected through a USB Mux so we never pretend
- // to actually have a hostname as far as the remote lldb that is connecting
- // to this lldb-platform is concerned
+ // For iOS devices, we are connected through a USB Mux so we never pretend to
+ // actually have a hostname as far as the remote lldb that is connecting to
+ // this lldb-platform is concerned
response.PutCString("hostname:");
response.PutCStringAsRawHex8("127.0.0.1");
response.PutChar(';');
@@ -357,7 +352,8 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(
StringExtractor extractor(value);
std::string file;
extractor.GetHexByteString(file);
- match_info.GetProcessInfo().GetExecutableFile().SetFile(file, false);
+ match_info.GetProcessInfo().GetExecutableFile().SetFile(
+ file, false, FileSpec::Style::native);
} else if (key.equals("name_match")) {
NameMatch name_match = llvm::StringSwitch<NameMatch>(value)
.Case("equals", NameMatch::Equals)
@@ -401,7 +397,7 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(
match_info.GetProcessInfo().SetEffectiveGroupID(gid);
} else if (key.equals("all_users")) {
match_info.SetMatchAllUsers(
- Args::StringToBoolean(value, false, &success));
+ OptionArgParser::ToBoolean(value, false, &success));
} else if (key.equals("triple")) {
match_info.GetProcessInfo().GetArchitecture() =
HostInfo::GetAugmentedArchSpec(value);
@@ -415,8 +411,8 @@ GDBRemoteCommunicationServerCommon::Handle_qfProcessInfo(
}
if (Host::FindProcesses(match_info, m_proc_infos)) {
- // We found something, return the first item by calling the get
- // subsequent process info packet handler...
+ // We found something, return the first item by calling the get subsequent
+ // process info packet handler...
return Handle_qsProcessInfo(packet);
}
return SendErrorResponse(3);
@@ -731,14 +727,13 @@ GDBRemoteCommunicationServerCommon::Handle_qPlatform_shell(
if (packet.GetChar() == ',') {
// FIXME: add timeout to qPlatform_shell packet
// uint32_t timeout = packet.GetHexMaxU32(false, 32);
- uint32_t timeout = 10;
if (packet.GetChar() == ',')
packet.GetHexByteString(working_dir);
int status, signo;
std::string output;
- Status err =
- Host::RunShellCommand(path.c_str(), FileSpec{working_dir, true},
- &status, &signo, &output, timeout);
+ Status err = Host::RunShellCommand(
+ path.c_str(), FileSpec{working_dir, true}, &status, &signo, &output,
+ std::chrono::seconds(10));
StreamGDBRemote response;
if (err.Fail()) {
response.PutCString("F,");
@@ -945,8 +940,7 @@ GDBRemoteCommunicationServerCommon::Handle_QEnvironment(
packet.SetFilePos(::strlen("QEnvironment:"));
const uint32_t bytes_left = packet.GetBytesLeft();
if (bytes_left > 0) {
- m_process_launch_info.GetEnvironmentEntries().AppendArgument(
- llvm::StringRef::withNullAsEmpty(packet.Peek()));
+ m_process_launch_info.GetEnvironment().insert(packet.Peek());
return SendOKResponse();
}
return SendErrorResponse(12);
@@ -960,7 +954,7 @@ GDBRemoteCommunicationServerCommon::Handle_QEnvironmentHexEncoded(
if (bytes_left > 0) {
std::string str;
packet.GetHexByteString(str);
- m_process_launch_info.GetEnvironmentEntries().AppendArgument(str);
+ m_process_launch_info.GetEnvironment().insert(str);
return SendOKResponse();
}
return SendErrorResponse(12);
@@ -981,11 +975,11 @@ GDBRemoteCommunicationServerCommon::Handle_QLaunchArch(
GDBRemoteCommunication::PacketResult
GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
- // The 'A' packet is the most over designed packet ever here with
- // redundant argument indexes, redundant argument lengths and needed hex
- // encoded argument string values. Really all that is needed is a comma
- // separated hex encoded argument value list, but we will stay true to the
- // documented version of the 'A' packet here...
+ // The 'A' packet is the most over designed packet ever here with redundant
+ // argument indexes, redundant argument lengths and needed hex encoded
+ // argument string values. Really all that is needed is a comma separated hex
+ // encoded argument value list, but we will stay true to the documented
+ // version of the 'A' packet here...
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
int actual_arg_index = 0;
@@ -993,8 +987,8 @@ GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
packet.SetFilePos(1); // Skip the 'A'
bool success = true;
while (success && packet.GetBytesLeft() > 0) {
- // Decode the decimal argument string length. This length is the
- // number of hex nibbles in the argument string value.
+ // Decode the decimal argument string length. This length is the number of
+ // hex nibbles in the argument string value.
const uint32_t arg_len = packet.GetU32(UINT32_MAX);
if (arg_len == UINT32_MAX)
success = false;
@@ -1003,8 +997,8 @@ GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
if (packet.GetChar() != ',')
success = false;
else {
- // Decode the argument index. We ignore this really because
- // who would really send down the arguments in a random order???
+ // Decode the argument index. We ignore this really because who would
+ // really send down the arguments in a random order???
const uint32_t arg_idx = packet.GetU32(UINT32_MAX);
if (arg_idx == UINT32_MAX)
success = false;
@@ -1013,9 +1007,9 @@ GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
if (packet.GetChar() != ',')
success = false;
else {
- // Decode the argument string value from hex bytes
- // back into a UTF8 string and make sure the length
- // matches the one supplied in the packet
+ // Decode the argument string value from hex bytes back into a UTF8
+ // string and make sure the length matches the one supplied in the
+ // packet
std::string arg;
if (packet.GetHexByteStringFixedLength(arg, arg_len) !=
(arg_len / 2))
@@ -1029,7 +1023,8 @@ GDBRemoteCommunicationServerCommon::Handle_A(StringExtractorGDBRemote &packet) {
if (success) {
if (arg_idx == 0)
- m_process_launch_info.GetExecutableFile().SetFile(arg, false);
+ m_process_launch_info.GetExecutableFile().SetFile(
+ arg, false, FileSpec::Style::native);
m_process_launch_info.GetArguments().AppendArgument(arg);
if (log)
log->Printf("LLGSPacketHandler::%s added arg %d: \"%s\"",
@@ -1254,8 +1249,8 @@ void GDBRemoteCommunicationServerCommon::
// Nothing.
break;
}
- // In case of MIPS64, pointer size is depend on ELF ABI
- // For N32 the pointer size is 4 and for N64 it is 8
+ // In case of MIPS64, pointer size is depend on ELF ABI For N32 the pointer
+ // size is 4 and for N64 it is 8
std::string abi = proc_arch.GetTargetABI();
if (!abi.empty())
response.Printf("elf_abi:%s;", abi.c_str());
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
index 32741c2404e2..50392fa38956 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
@@ -33,9 +33,9 @@
#include "lldb/Host/common/NativeProcessProtocol.h"
#include "lldb/Host/common/NativeRegisterContext.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/FileAction.h"
#include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/JSON.h"
@@ -49,7 +49,7 @@
// Project includes
#include "ProcessGDBRemote.h"
#include "ProcessGDBRemoteLog.h"
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
@@ -236,16 +236,15 @@ Status GDBRemoteCommunicationServerLLGS::LaunchProcess() {
m_debugged_process_up = std::move(*process_or);
}
- // Handle mirroring of inferior stdout/stderr over the gdb-remote protocol
- // as needed.
- // llgs local-process debugging may specify PTY paths, which will make these
- // file actions non-null
- // process launch -i/e/o will also make these file actions non-null
- // nullptr means that the traffic is expected to flow over gdb-remote protocol
+ // Handle mirroring of inferior stdout/stderr over the gdb-remote protocol as
+ // needed. llgs local-process debugging may specify PTY paths, which will
+ // make these file actions non-null process launch -i/e/o will also make
+ // these file actions non-null nullptr means that the traffic is expected to
+ // flow over gdb-remote protocol
if (should_forward_stdio) {
// nullptr means it's not redirected to file or pty (in case of LLGS local)
- // at least one of stdio will be transferred pty<->gdb-remote
- // we need to give the pty master handle to this object to read and/or write
+ // at least one of stdio will be transferred pty<->gdb-remote we need to
+ // give the pty master handle to this object to read and/or write
LLDB_LOG(log,
"pid = {0}: setting up stdout/stderr redirection via $O "
"gdb-remote commands",
@@ -291,7 +290,7 @@ Status GDBRemoteCommunicationServerLLGS::AttachToProcess(lldb::pid_t pid) {
// else.
if (m_debugged_process_up &&
m_debugged_process_up->GetID() != LLDB_INVALID_PROCESS_ID)
- return Status("cannot attach to a process %" PRIu64
+ return Status("cannot attach to process %" PRIu64
" when another process with pid %" PRIu64
" is being debugged.",
pid, m_debugged_process_up->GetID());
@@ -410,8 +409,8 @@ static JSONObject::SP GetRegistersAsJSON(NativeThreadProtocol &thread) {
JSONObject::SP register_object_sp = std::make_shared<JSONObject>();
#ifdef LLDB_JTHREADSINFO_FULL_REGISTER_SET
- // Expedite all registers in the first register set (i.e. should be GPRs) that
- // are not contained in other registers.
+ // Expedite all registers in the first register set (i.e. should be GPRs)
+ // that are not contained in other registers.
const RegisterSet *reg_set_p = reg_ctx_sp->GetRegisterSet(0);
if (!reg_set_p)
return nullptr;
@@ -420,8 +419,7 @@ static JSONObject::SP GetRegistersAsJSON(NativeThreadProtocol &thread) {
uint32_t reg_num = *reg_num_p;
#else
// Expedite only a couple of registers until we figure out why sending
- // registers is
- // expensive.
+ // registers is expensive.
static const uint32_t k_expedited_registers[] = {
LLDB_REGNUM_GENERIC_PC, LLDB_REGNUM_GENERIC_SP, LLDB_REGNUM_GENERIC_FP,
LLDB_REGNUM_GENERIC_RA, LLDB_INVALID_REGNUM};
@@ -595,8 +593,7 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(
return SendErrorResponse(52);
// FIXME implement register handling for exec'd inferiors.
- // if (tid_stop_info.reason == eStopReasonExec)
- // {
+ // if (tid_stop_info.reason == eStopReasonExec) {
// const bool force = true;
// InitializeRegisters(force);
// }
@@ -633,14 +630,14 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(
response.PutChar(';');
}
- // If a 'QListThreadsInStopReply' was sent to enable this feature, we
- // will send all thread IDs back in the "threads" key whose value is
- // a list of hex thread IDs separated by commas:
+ // If a 'QListThreadsInStopReply' was sent to enable this feature, we will
+ // send all thread IDs back in the "threads" key whose value is a list of hex
+ // thread IDs separated by commas:
// "threads:10a,10b,10c;"
- // This will save the debugger from having to send a pair of qfThreadInfo
- // and qsThreadInfo packets, but it also might take a lot of room in the
- // stop reply packet, so it must be enabled only on systems where there
- // are no limits on packet lengths.
+ // This will save the debugger from having to send a pair of qfThreadInfo and
+ // qsThreadInfo packets, but it also might take a lot of room in the stop
+ // reply packet, so it must be enabled only on systems where there are no
+ // limits on packet lengths.
if (m_list_threads_in_stop_reply) {
response.PutCString("threads:");
@@ -655,12 +652,11 @@ GDBRemoteCommunicationServerLLGS::SendStopReplyPacketForThread(
}
response.PutChar(';');
- // Include JSON info that describes the stop reason for any threads
- // that actually have stop reasons. We use the new "jstopinfo" key
- // whose values is hex ascii JSON that contains the thread IDs
- // thread stop info only for threads that have stop reasons. Only send
- // this if we have more than one thread otherwise this packet has all
- // the info it needs.
+ // Include JSON info that describes the stop reason for any threads that
+ // actually have stop reasons. We use the new "jstopinfo" key whose values
+ // is hex ascii JSON that contains the thread IDs thread stop info only for
+ // threads that have stop reasons. Only send this if we have more than one
+ // thread otherwise this packet has all the info it needs.
if (thread_index > 0) {
const bool threads_with_valid_stop_info_only = true;
JSONArray::SP threads_info_sp = GetJSONThreadsInfo(
@@ -806,8 +802,8 @@ void GDBRemoteCommunicationServerLLGS::HandleInferiorState_Exited(
__FUNCTION__, process->GetID());
}
- // Close the pipe to the inferior terminal i/o if we launched it
- // and set one up.
+ // Close the pipe to the inferior terminal i/o if we launched it and set one
+ // up.
MaybeCloseInferiorTerminalConnection();
// We are ready to exit the debug monitor.
@@ -823,8 +819,7 @@ void GDBRemoteCommunicationServerLLGS::HandleInferiorState_Stopped(
if (log)
log->Printf("GDBRemoteCommunicationServerLLGS::%s called", __FUNCTION__);
- // Send the stop reason unless this is the stop after the
- // launch or attach.
+ // Send the stop reason unless this is the stop after the launch or attach.
switch (m_inferior_prev_state) {
case eStateLaunching:
case eStateAttaching:
@@ -859,13 +854,11 @@ void GDBRemoteCommunicationServerLLGS::ProcessStateChanged(
break;
case StateType::eStateStopped:
- // Make sure we get all of the pending stdout/stderr from the inferior
- // and send it to the lldb host before we send the state change
- // notification
+ // Make sure we get all of the pending stdout/stderr from the inferior and
+ // send it to the lldb host before we send the state change notification
SendProcessOutput();
// Then stop the forwarding, so that any late output (see llvm.org/pr25652)
- // does not
- // interfere with our protocol.
+ // does not interfere with our protocol.
StopSTDIOForwarding();
HandleInferiorState_Stopped(process);
break;
@@ -1287,8 +1280,8 @@ GDBRemoteCommunicationServerLLGS::Handle_qC(StringExtractorGDBRemote &packet) {
(m_debugged_process_up->GetID() == LLDB_INVALID_PROCESS_ID))
return SendErrorResponse(68);
- // Make sure we set the current thread so g and p packets return
- // the data the gdb will expect.
+ // Make sure we set the current thread so g and p packets return the data the
+ // gdb will expect.
lldb::tid_t tid = m_debugged_process_up->GetCurrentThreadID();
SetCurrentThreadID(tid);
@@ -1397,10 +1390,9 @@ GDBRemoteCommunicationServerLLGS::Handle_C(StringExtractorGDBRemote &packet) {
Status error;
// We have two branches: what to do if a continue thread is specified (in
- // which case we target
- // sending the signal to that thread), or when we don't have a continue thread
- // set (in which
- // case we send a signal to the process).
+ // which case we target sending the signal to that thread), or when we don't
+ // have a continue thread set (in which case we send a signal to the
+ // process).
// TODO discuss with Greg Clayton, make sure this makes sense.
@@ -1639,8 +1631,8 @@ GDBRemoteCommunicationServerLLGS::SendStopReasonForState(
case eStateStopped:
case eStateCrashed: {
lldb::tid_t tid = m_debugged_process_up->GetCurrentThreadID();
- // Make sure we set the current thread so g and p packets return
- // the data the gdb will expect.
+ // Make sure we set the current thread so g and p packets return the data
+ // the gdb will expect.
SetCurrentThreadID(tid);
return SendStopReplyPacketForThread(tid);
}
@@ -2043,9 +2035,8 @@ GDBRemoteCommunicationServerLLGS::Handle_P(StringExtractorGDBRemote &packet) {
return SendErrorResponse(0x47);
}
- // The dwarf expression are evaluate on host site
- // which may cause register size to change
- // Hence the reg_size may not be same as reg_info->bytes_size
+ // The dwarf expression are evaluate on host site which may cause register
+ // size to change Hence the reg_size may not be same as reg_info->bytes_size
if ((reg_size != reg_info->byte_size) &&
!(reg_info->dynamic_size_dwarf_expr_bytes)) {
return SendIllFormedResponse(packet, "P packet register size is incorrect");
@@ -2376,10 +2367,9 @@ GDBRemoteCommunicationServerLLGS::Handle_qMemoryRegionInfoSupported(
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
// Currently only the NativeProcessProtocol knows if it can handle a
- // qMemoryRegionInfoSupported
- // request, but we're not guaranteed to be attached to a process. For now
- // we'll assume the
- // client only asks this when a process is being debugged.
+ // qMemoryRegionInfoSupported request, but we're not guaranteed to be
+ // attached to a process. For now we'll assume the client only asks this
+ // when a process is being debugged.
// Ensure we have a process running; otherwise, we can't figure this out
// since we won't have a NativeProcessProtocol.
@@ -2670,8 +2660,7 @@ GDBRemoteCommunicationServerLLGS::Handle_s(StringExtractorGDBRemote &packet) {
}
// We first try to use a continue thread id. If any one or any all set, use
- // the current thread.
- // Bail out if we don't have a thread id.
+ // the current thread. Bail out if we don't have a thread id.
lldb::tid_t tid = GetContinueThreadID();
if (tid == 0 || tid == LLDB_INVALID_THREAD_ID)
tid = GetCurrentThreadID();
@@ -2935,7 +2924,7 @@ GDBRemoteCommunicationServerLLGS::Handle_vAttach(
log->Printf("GDBRemoteCommunicationServerLLGS::%s failed to attach to "
"pid %" PRIu64 ": %s\n",
__FUNCTION__, pid, error.AsCString());
- return SendErrorResponse(0x01);
+ return SendErrorResponse(error);
}
// Notify we attached by sending a stop packet.
@@ -3093,8 +3082,8 @@ GDBRemoteCommunicationServerLLGS::Handle_QPassSignals(
std::vector<int> signals;
packet.SetFilePos(strlen("QPassSignals:"));
- // Read sequence of hex signal numbers divided by a semicolon and
- // optionally spaces.
+ // Read sequence of hex signal numbers divided by a semicolon and optionally
+ // spaces.
while (packet.GetBytesLeft() > 0) {
int signal = packet.GetS32(-1, 16);
if (signal < 0)
@@ -3154,8 +3143,7 @@ NativeThreadProtocol *GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(
return nullptr;
// If the client hasn't asked for thread suffix support, there will not be a
- // thread suffix.
- // Use the current thread in that case.
+ // thread suffix. Use the current thread in that case.
if (!m_thread_suffix_supported) {
const lldb::tid_t current_tid = GetCurrentThreadID();
if (current_tid == LLDB_INVALID_THREAD_ID)
@@ -3201,9 +3189,9 @@ NativeThreadProtocol *GDBRemoteCommunicationServerLLGS::GetThreadFromSuffix(
lldb::tid_t GDBRemoteCommunicationServerLLGS::GetCurrentThreadID() const {
if (m_current_tid == 0 || m_current_tid == LLDB_INVALID_THREAD_ID) {
- // Use whatever the debug process says is the current thread id
- // since the protocol either didn't specify or specified we want
- // any/all threads marked as the current thread.
+ // Use whatever the debug process says is the current thread id since the
+ // protocol either didn't specify or specified we want any/all threads
+ // marked as the current thread.
if (!m_debugged_process_up)
return LLDB_INVALID_THREAD_ID;
return m_debugged_process_up->GetCurrentThreadID();
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
index 04ed9d704e13..26e28a900320 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp
@@ -14,6 +14,7 @@
// C Includes
// C++ Includes
#include <chrono>
+#include <csignal>
#include <cstring>
#include <mutex>
#include <sstream>
@@ -38,7 +39,7 @@
#include "lldb/Utility/UriParser.h"
// Project includes
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
@@ -101,11 +102,11 @@ Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer(
if (port == UINT16_MAX)
port = GetNextAvailablePort();
- // Spawn a new thread to accept the port that gets bound after
- // binding to port 0 (zero).
+ // Spawn a new thread to accept the port that gets bound after binding to
+ // port 0 (zero).
- // ignore the hostname send from the remote end, just use the ip address
- // that we're currently communicating with as the hostname
+ // ignore the hostname send from the remote end, just use the ip address that
+ // we're currently communicating with as the hostname
// Spawn a debugserver and try to get the port it listens to.
ProcessLaunchInfo debugserver_launch_info;
@@ -116,8 +117,8 @@ Status GDBRemoteCommunicationServerPlatform::LaunchGDBServer(
if (log)
log->Printf("Launching debugserver with: %s:%u...", hostname.c_str(), port);
- // Do not run in a new session so that it can not linger after the
- // platform closes.
+ // Do not run in a new session so that it can not linger after the platform
+ // closes.
debugserver_launch_info.SetLaunchInSeparateProcessGroup(false);
debugserver_launch_info.SetMonitorProcessCallback(
std::bind(&GDBRemoteCommunicationServerPlatform::DebugserverProcessReaped,
@@ -170,8 +171,8 @@ GDBRemoteCommunicationServerPlatform::Handle_qLaunchGDBServer(
#ifdef _WIN32
return SendErrorResponse(9);
#else
- // Spawn a local debugserver as a platform so we can then attach or launch
- // a process...
+ // Spawn a local debugserver as a platform so we can then attach or launch a
+ // process...
Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM));
if (log)
@@ -259,8 +260,7 @@ GDBRemoteCommunicationServerPlatform::Handle_qKillSpawnedProcess(
lldb::pid_t pid = packet.GetU64(LLDB_INVALID_PROCESS_ID);
- // verify that we know anything about this pid.
- // Scope for locker
+ // verify that we know anything about this pid. Scope for locker
{
std::lock_guard<std::recursive_mutex> guard(m_spawned_pids_mutex);
if (m_spawned_pids.find(pid) == m_spawned_pids.end()) {
@@ -306,8 +306,8 @@ bool GDBRemoteCommunicationServerPlatform::KillSpawnedProcess(lldb::pid_t pid) {
return true;
}
- // the launched process still lives. Now try killing it again,
- // this time with an unblockable signal.
+ // the launched process still lives. Now try killing it again, this time
+ // with an unblockable signal.
Host::Kill(pid, SIGKILL);
for (size_t i = 0; i < 10; ++i) {
@@ -321,8 +321,7 @@ bool GDBRemoteCommunicationServerPlatform::KillSpawnedProcess(lldb::pid_t pid) {
usleep(10000);
}
- // check one more time after the final usleep
- // Scope for locker
+ // check one more time after the final usleep Scope for locker
{
std::lock_guard<std::recursive_mutex> guard(m_spawned_pids_mutex);
if (m_spawned_pids.find(pid) == m_spawned_pids.end())
@@ -389,14 +388,13 @@ GDBRemoteCommunicationServerPlatform::Handle_qC(
StreamString response;
response.Printf("QC%" PRIx64, pid);
- // If we launch a process and this GDB server is acting as a platform,
- // then we need to clear the process launch state so we can start
- // launching another process. In order to launch a process a bunch or
- // packets need to be sent: environment packets, working directory,
- // disable ASLR, and many more settings. When we launch a process we
- // then need to know when to clear this information. Currently we are
- // selecting the 'qC' packet as that packet which seems to make the most
- // sense.
+ // If we launch a process and this GDB server is acting as a platform, then
+ // we need to clear the process launch state so we can start launching
+ // another process. In order to launch a process a bunch or packets need to
+ // be sent: environment packets, working directory, disable ASLR, and many
+ // more settings. When we launch a process we then need to know when to clear
+ // this information. Currently we are selecting the 'qC' packet as that
+ // packet which seems to make the most sense.
if (pid != LLDB_INVALID_PROCESS_ID) {
m_process_launch_info.Clear();
}
@@ -445,9 +443,8 @@ Status GDBRemoteCommunicationServerPlatform::LaunchProcess() {
return Status("%s: no process command line specified to launch",
__FUNCTION__);
- // specify the process monitor if not already set. This should
- // generally be what happens since we need to reap started
- // processes.
+ // specify the process monitor if not already set. This should generally be
+ // what happens since we need to reap started processes.
if (!m_process_launch_info.GetMonitorProcessCallback())
m_process_launch_info.SetMonitorProcessCallback(
std::bind(
@@ -466,8 +463,8 @@ Status GDBRemoteCommunicationServerPlatform::LaunchProcess() {
m_process_launch_info.GetArguments().GetArgumentAtIndex(0),
m_process_launch_info.GetProcessID());
- // add to list of spawned processes. On an lldb-gdbserver, we
- // would expect there to be only one.
+ // add to list of spawned processes. On an lldb-gdbserver, we would expect
+ // there to be only one.
const auto pid = m_process_launch_info.GetProcessID();
if (pid != LLDB_INVALID_PROCESS_ID) {
// add to spawned pids
@@ -537,7 +534,7 @@ const FileSpec &GDBRemoteCommunicationServerPlatform::GetDomainSocketDir() {
if (domainsocket_dir_env != nullptr)
g_domainsocket_dir = FileSpec(domainsocket_dir_env, false);
else
- HostInfo::GetLLDBPath(ePathTypeLLDBTempSystemDir, g_domainsocket_dir);
+ g_domainsocket_dir = HostInfo::GetProcessTempDir();
});
return g_domainsocket_dir;
diff --git a/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp b/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
index e418deee01f3..07dab751f4b9 100644
--- a/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
+++ b/source/Plugins/Process/gdb-remote/GDBRemoteRegisterContext.cpp
@@ -25,7 +25,7 @@
#include "ThreadGDBRemote.h"
#include "Utility/ARM_DWARF_Registers.h"
#include "Utility/ARM_ehframe_Registers.h"
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
@@ -39,9 +39,9 @@ GDBRemoteRegisterContext::GDBRemoteRegisterContext(
GDBRemoteDynamicRegisterInfo &reg_info, bool read_all_at_once)
: RegisterContext(thread, concrete_frame_idx), m_reg_info(reg_info),
m_reg_valid(), m_reg_data(), m_read_all_at_once(read_all_at_once) {
- // Resize our vector of bools to contain one bool for every register.
- // We will use these boolean values to know when a register value
- // is valid in m_reg_data.
+ // Resize our vector of bools to contain one bool for every register. We will
+ // use these boolean values to know when a register value is valid in
+ // m_reg_data.
m_reg_valid.resize(reg_info.GetNumRegisters());
// Make a heap based buffer that is big enough to store all registers
@@ -119,8 +119,8 @@ bool GDBRemoteRegisterContext::PrivateSetRegisterValue(
if (success) {
SetRegisterIsValid(reg, true);
} else if (data.size() > 0) {
- // Only set register is valid to false if we copied some bytes, else
- // leave it as it was.
+ // Only set register is valid to false if we copied some bytes, else leave
+ // it as it was.
SetRegisterIsValid(reg, false);
}
return success;
@@ -133,11 +133,9 @@ bool GDBRemoteRegisterContext::PrivateSetRegisterValue(uint32_t reg,
return false;
// Early in process startup, we can get a thread that has an invalid byte
- // order
- // because the process hasn't been completely set up yet (see the ctor where
- // the
- // byte order is setfrom the process). If that's the case, we can't set the
- // value here.
+ // order because the process hasn't been completely set up yet (see the ctor
+ // where the byte order is setfrom the process). If that's the case, we
+ // can't set the value here.
if (m_reg_data.GetByteOrder() == eByteOrderInvalid) {
return false;
}
@@ -149,8 +147,7 @@ bool GDBRemoteRegisterContext::PrivateSetRegisterValue(uint32_t reg,
DataExtractor data(buffer_sp, endian::InlHostByteOrder(), sizeof(void *));
// If our register context and our register info disagree, which should never
- // happen, don't
- // overwrite past the end of the buffer.
+ // happen, don't overwrite past the end of the buffer.
if (m_reg_data.GetByteSize() < reg_info->byte_offset + reg_info->byte_size)
return false;
@@ -219,8 +216,7 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
}
if (reg_info->value_regs) {
// Process this composite register request by delegating to the
- // constituent
- // primordial registers.
+ // constituent primordial registers.
// Index of the primordial register.
bool success = true;
@@ -228,8 +224,8 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
const uint32_t prim_reg = reg_info->value_regs[idx];
if (prim_reg == LLDB_INVALID_REGNUM)
break;
- // We have a valid primordial register as our constituent.
- // Grab the corresponding register 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)
success = false;
@@ -242,8 +238,7 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
if (success) {
// If we reach this point, all primordial register requests have
- // succeeded.
- // Validate this composite register.
+ // succeeded. Validate this composite register.
SetRegisterIsValid(reg_info, true);
}
} else {
@@ -262,16 +257,14 @@ bool GDBRemoteRegisterContext::ReadRegisterBytes(const RegisterInfo *reg_info,
reg_info->byte_offset + reg_info->byte_size);
#endif
// If our register context and our register info disagree, which should
- // never happen, don't
- // read past the end of the buffer.
+ // never happen, don't read past the end of the buffer.
if (m_reg_data.GetByteSize() < reg_info->byte_offset + reg_info->byte_size)
return false;
- // If we aren't extracting into our own buffer (which
- // only happens when this function is called from
- // ReadRegisterValue(uint32_t, Scalar&)) then
- // we transfer bytes from our buffer into the data
- // buffer that was passed in
+ // If we aren't extracting into our own buffer (which only happens when
+ // this function is called from ReadRegisterValue(uint32_t, Scalar&)) then
+ // we transfer bytes from our buffer into the data buffer that was passed
+ // in
data.SetByteOrder(m_reg_data.GetByteOrder());
data.SetData(m_reg_data, reg_info->byte_offset, reg_info->byte_size);
@@ -321,8 +314,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
#endif
// If our register context and our register info disagree, which should never
- // happen, don't
- // overwrite past the end of the buffer.
+ // happen, don't overwrite past the end of the buffer.
if (m_reg_data.GetByteSize() < reg_info->byte_offset + reg_info->byte_size)
return false;
@@ -358,12 +350,10 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
bool success = true;
if (reg_info->value_regs) {
- // This register is part of another register. In this case we read the
- // actual
- // register data for any "value_regs", and once all that data is read,
- // we will
- // have enough data in our register context bytes for the value of
- // this register
+ // This register is part of another register. In this case we read
+ // the actual register data for any "value_regs", and once all that
+ // data is read, we will have enough data in our register context
+ // bytes for the value of this register
// Invalidate this composite register first.
@@ -371,8 +361,8 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
const uint32_t reg = reg_info->value_regs[idx];
if (reg == LLDB_INVALID_REGNUM)
break;
- // We have a valid primordial register as our constituent.
- // Grab the corresponding register 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)
success = false;
@@ -385,8 +375,7 @@ bool GDBRemoteRegisterContext::WriteRegisterBytes(const RegisterInfo *reg_info,
}
// Check if writing this register will invalidate any other register
- // values?
- // If so, invalidate them
+ // values? If so, invalidate them
if (reg_info->invalidate_regs) {
for (uint32_t idx = 0, reg = reg_info->invalidate_regs[0];
reg != LLDB_INVALID_REGNUM;
@@ -548,26 +537,22 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
return true;
uint32_t num_restored = 0;
- // We need to manually go through all of the registers and
- // restore them manually
+ // We need to manually go through all of the registers and restore them
+ // manually
DataExtractor restore_data(data_sp, m_reg_data.GetByteOrder(),
m_reg_data.GetAddressByteSize());
const RegisterInfo *reg_info;
- // The g packet contents may either include the slice registers (registers
- // defined in
- // terms of other registers, e.g. eax is a subset of rax) or not. The
- // slice registers
- // should NOT be in the g packet, but some implementations may incorrectly
- // include them.
+ // The g packet contents may either include the slice registers
+ // (registers defined in terms of other registers, e.g. eax is a subset
+ // of rax) or not. The slice registers should NOT be in the g packet,
+ // but some implementations may incorrectly include them.
//
// If the slice registers are included in the packet, we must step over
- // the slice registers
- // when parsing the packet -- relying on the RegisterInfo byte_offset
- // field would be incorrect.
- // If the slice registers are not included, then using the byte_offset
- // values into the
+ // the slice registers when parsing the packet -- relying on the
+ // RegisterInfo byte_offset field would be incorrect. If the slice
+ // registers are not included, then using the byte_offset values into the
// data buffer is the best way to find individual register values.
uint64_t size_including_slice_registers = 0;
@@ -591,21 +576,17 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
} else if (size_not_including_slice_registers ==
restore_data.GetByteSize()) {
// The size of the packet is the same as concatenating all of the
- // registers sequentially,
- // skipping the slice registers
+ // registers sequentially, skipping the slice registers
use_byte_offset_into_buffer = true;
} else if (size_including_slice_registers == restore_data.GetByteSize()) {
// The slice registers are present in the packet (when they shouldn't
- // be).
- // Don't try to use the RegisterInfo byte_offset into the restore_data,
- // it will
- // point to the wrong place.
+ // be). Don't try to use the RegisterInfo byte_offset into the
+ // restore_data, it will point to the wrong place.
use_byte_offset_into_buffer = false;
} else {
// None of our expected sizes match the actual g packet data we're
- // looking at.
- // The most conservative approach here is to use the running total byte
- // offset.
+ // looking at. The most conservative approach here is to use the
+ // running total byte offset.
use_byte_offset_into_buffer = false;
}
@@ -664,11 +645,9 @@ bool GDBRemoteRegisterContext::WriteAllRegisterValues(
if (reg_info->value_regs) // skip registers that are slices of real
// registers
continue;
- // Skip the fpsr and fpcr floating point status/control register writing
- // to
- // work around a bug in an older version of debugserver that would lead
- // to
- // register context corruption when writing fpsr/fpcr.
+ // Skip the fpsr and fpcr floating point status/control register
+ // writing to work around a bug in an older version of debugserver that
+ // would lead to register context corruption when writing fpsr/fpcr.
if (arm64_debugserver && (strcmp(reg_info->name, "fpsr") == 0 ||
strcmp(reg_info->name, "fpcr") == 0)) {
continue;
@@ -752,8 +731,8 @@ void GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) {
static uint32_t g_q14_regs[] = {71, 72, LLDB_INVALID_REGNUM}; // (d28, d29)
static uint32_t g_q15_regs[] = {73, 74, LLDB_INVALID_REGNUM}; // (d30, d31)
- // This is our array of composite registers, with each element coming from the
- // above register mappings.
+ // This is our array of composite registers, with each element coming from
+ // the above register mappings.
static uint32_t *g_composites[] = {
g_d0_regs, g_d1_regs, g_d2_regs, g_d3_regs, g_d4_regs, g_d5_regs,
g_d6_regs, g_d7_regs, g_d8_regs, g_d9_regs, g_d10_regs, g_d11_regs,
@@ -884,21 +863,17 @@ void GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) {
if (from_scratch) {
// Calculate the offsets of the registers
// Note that the layout of the "composite" registers (d0-d15 and q0-q15)
- // which comes after the
- // "primordial" registers is important. This enables us to calculate the
- // offset of the composite
- // register by using the offset of its first primordial register. For
- // example, to calculate the
- // offset of q0, use s0's offset.
+ // which comes after the "primordial" registers is important. This enables
+ // us to calculate the offset of the composite register by using the offset
+ // of its first primordial register. For example, to calculate the offset
+ // of q0, use s0's offset.
if (g_register_infos[2].byte_offset == 0) {
uint32_t byte_offset = 0;
for (i = 0; i < num_registers; ++i) {
// For primordial registers, increment the byte_offset by the byte_size
- // to arrive at the
- // byte_offset for the next register. Otherwise, we have a composite
- // register whose
- // offset can be calculated by consulting the offset of its first
- // primordial register.
+ // to arrive at the byte_offset for the next register. Otherwise, we
+ // have a composite register whose offset can be calculated by
+ // consulting the offset of its first primordial register.
if (!g_register_infos[i].value_regs) {
g_register_infos[i].byte_offset = byte_offset;
byte_offset += g_register_infos[i].byte_size;
@@ -933,8 +908,8 @@ void GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) {
RegisterInfo *g_comp_register_infos = g_register_infos + num_common_regs;
// First we need to validate that all registers that we already have match
- // the non composite regs.
- // If so, then we can add the registers, else we need to bail
+ // the non composite regs. If so, then we can add the registers, else we
+ // need to bail
bool match = true;
if (num_dynamic_regs == num_common_regs) {
for (i = 0; match && i < num_dynamic_regs; ++i) {
@@ -970,9 +945,8 @@ void GDBRemoteDynamicRegisterInfo::HardcodeARMRegisters(bool from_scratch) {
// Find a matching primordial register info entry.
if (reg_info && reg_info->name &&
::strcasecmp(reg_info->name, reg_name) == 0) {
- // The name matches the existing primordial entry.
- // Find and assign the offset, and then add this composite
- // register entry.
+ // The name matches the existing primordial entry. Find and
+ // assign the offset, and then add this composite register entry.
g_comp_register_infos[i].byte_offset = reg_info->byte_offset;
name.SetCString(g_comp_register_infos[i].name);
AddRegister(g_comp_register_infos[i], name, alt_name,
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
index 35d02c15ab85..b3d33b19bd66 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
@@ -24,6 +24,7 @@
// C++ Includes
#include <algorithm>
+#include <csignal>
#include <map>
#include <mutex>
#include <sstream>
@@ -46,11 +47,11 @@
#include "lldb/Host/Symbols.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Host/XML.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObject.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupBoolean.h"
#include "lldb/Interpreter/OptionGroupUInt64.h"
#include "lldb/Interpreter/OptionValueProperties.h"
@@ -59,10 +60,12 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/DynamicLoader.h"
+#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Target/SystemRuntime.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Target/ThreadPlanCallFunction.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/StreamString.h"
@@ -77,8 +80,8 @@
#include "ProcessGDBRemote.h"
#include "ProcessGDBRemoteLog.h"
#include "ThreadGDBRemote.h"
-#include "Utility/StringExtractorGDBRemote.h"
#include "lldb/Host/Host.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/Threading.h"
@@ -91,11 +94,11 @@ using namespace lldb_private::process_gdb_remote;
namespace lldb {
// Provide a function that can easily dump the packet history if we know a
-// ProcessGDBRemote * value (which we can get from logs or from debugging).
-// We need the function in the lldb namespace so it makes it into the final
+// ProcessGDBRemote * value (which we can get from logs or from debugging). We
+// need the function in the lldb namespace so it makes it into the final
// executable since the LLDB shared library only exports stuff in the lldb
-// namespace. This allows you to attach with a debugger and call this
-// function and get the packet history dumped to a file.
+// namespace. This allows you to attach with a debugger and call this function
+// and get the packet history dumped to a file.
void DumpProcessGDBRemotePacketHistory(void *p, const char *path) {
StreamFile strm;
Status error(strm.GetFile().Open(path, File::eOpenOptionWrite |
@@ -158,8 +161,8 @@ static const ProcessKDPPropertiesSP &GetGlobalPluginProperties() {
} // anonymous namespace end
// TODO Randomly assigning a port is unsafe. We should get an unused
-// ephemeral port from the kernel and make sure we reserve it before passing
-// it to debugserver.
+// ephemeral port from the kernel and make sure we reserve it before passing it
+// to debugserver.
#if defined(__APPLE__)
#define LOW_PORT (IPPORT_RESERVED)
@@ -233,8 +236,8 @@ bool ProcessGDBRemote::CanDebug(lldb::TargetSP target_sp,
}
return exe_module->GetFileSpec().Exists();
}
- // However, if there is no executable module, we return true since we might be
- // preparing to attach.
+ // However, if there is no executable module, we return true since we might
+ // be preparing to attach.
return true;
}
@@ -256,7 +259,8 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
m_addr_to_mmap_size(), m_thread_create_bp_sp(),
m_waiting_for_attach(false), m_destroy_tried_resuming(false),
m_command_sp(), m_breakpoint_pc_offset(0),
- m_initial_tid(LLDB_INVALID_THREAD_ID) {
+ m_initial_tid(LLDB_INVALID_THREAD_ID), m_allow_flash_writes(false),
+ m_erased_flash_ranges() {
m_async_broadcaster.SetEventName(eBroadcastBitAsyncThreadShouldExit,
"async thread should exit");
m_async_broadcaster.SetEventName(eBroadcastBitAsyncContinue,
@@ -299,17 +303,16 @@ ProcessGDBRemote::ProcessGDBRemote(lldb::TargetSP target_sp,
ProcessGDBRemote::~ProcessGDBRemote() {
// m_mach_process.UnregisterNotificationCallbacks (this);
Clear();
- // We need to call finalize on the process before destroying ourselves
- // to make sure all of the broadcaster cleanup goes as planned. If we
- // destruct this class, then Process::~Process() might have problems
- // trying to fully destroy the broadcaster.
+ // We need to call finalize on the process before destroying ourselves to
+ // make sure all of the broadcaster cleanup goes as planned. If we destruct
+ // this class, then Process::~Process() might have problems trying to fully
+ // destroy the broadcaster.
Finalize();
- // The general Finalize is going to try to destroy the process and that SHOULD
- // shut down the async thread. However, if we don't kill it it will get
- // stranded and
- // its connection will go away so when it wakes up it will crash. So kill it
- // for sure here.
+ // The general Finalize is going to try to destroy the process and that
+ // SHOULD shut down the async thread. However, if we don't kill it it will
+ // get stranded and its connection will go away so when it wakes up it will
+ // crash. So kill it for sure here.
StopAsyncThread();
KillDebugserverProcess();
}
@@ -368,8 +371,7 @@ bool ProcessGDBRemote::ParsePythonTargetDefinition(
}
// If the remote stub didn't give us eh_frame or DWARF register numbers for a
-// register,
-// see if the ABI can provide them.
+// register, see if the ABI can provide them.
// DWARF and eh_frame register numbers are defined as a part of the ABI.
static void AugmentRegisterInfoViaABI(RegisterInfo &reg_info,
ConstString reg_name, ABISP abi_sp) {
@@ -422,9 +424,9 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
m_register_info.Clear();
- // Check if qHostInfo specified a specific packet timeout for this connection.
- // If so then lets update our setting so the user knows what the timeout is
- // and can see it.
+ // Check if qHostInfo specified a specific packet timeout for this
+ // connection. If so then lets update our setting so the user knows what the
+ // timeout is and can see it.
const auto host_packet_timeout = m_gdb_comm.GetHostDefaultPacketTimeout();
if (host_packet_timeout > std::chrono::seconds(0)) {
GetGlobalPluginProperties()->SetPacketTimeout(host_packet_timeout.count());
@@ -531,7 +533,7 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
reg_info.encoding = encoding;
} else if (name.equals("format")) {
Format format = eFormatInvalid;
- if (Args::StringToFormat(value.str().c_str(), format, NULL)
+ if (OptionArgParser::ToFormat(value.str().c_str(), format, NULL)
.Success())
reg_info.format = format;
else {
@@ -596,10 +598,8 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
}
// We have to make a temporary ABI here, and not use the GetABI because
- // this code
- // gets called in DidAttach, when the target architecture (and
- // consequently the ABI we'll get from
- // the process) may be wrong.
+ // this code gets called in DidAttach, when the target architecture
+ // (and consequently the ABI we'll get from the process) may be wrong.
ABISP abi_to_use = ABI::FindPlugin(shared_from_this(), arch_to_use);
AugmentRegisterInfoViaABI(reg_info, reg_name, abi_to_use);
@@ -620,9 +620,9 @@ void ProcessGDBRemote::BuildDynamicRegisterInfo(bool force) {
// We didn't get anything if the accumulated reg_num is zero. See if we are
// debugging ARM and fill with a hard coded register set until we can get an
- // updated debugserver down on the devices.
- // On the other hand, if the accumulated reg_num is positive, see if we can
- // add composite registers to the existing primordial ones.
+ // updated debugserver down on the devices. On the other hand, if the
+ // accumulated reg_num is positive, see if we can add composite registers to
+ // the existing primordial ones.
bool from_scratch = (m_register_info.GetNumRegisters() == 0);
if (!target_arch.IsValid()) {
@@ -669,9 +669,8 @@ Status ProcessGDBRemote::DoConnectRemote(Stream *strm,
lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID();
if (pid == LLDB_INVALID_PROCESS_ID) {
- // We don't have a valid process ID, so note that we are connected
- // and could now request to launch or attach, or get remote process
- // listings...
+ // We don't have a valid process ID, so note that we are connected and
+ // could now request to launch or attach, or get remote process listings...
SetPrivateState(eStateConnected);
} else {
// We have a valid process
@@ -721,7 +720,8 @@ Status ProcessGDBRemote::DoConnectRemote(Stream *strm,
if (error.Success() && !GetTarget().GetArchitecture().IsValid() &&
m_gdb_comm.GetHostArchitecture().IsValid()) {
- // Prefer the *process'* architecture over that of the *host*, if available.
+ // Prefer the *process'* architecture over that of the *host*, if
+ // available.
if (m_gdb_comm.GetProcessArchitecture().IsValid())
GetTarget().SetArchitecture(m_gdb_comm.GetProcessArchitecture());
else
@@ -800,8 +800,8 @@ Status ProcessGDBRemote::DoLaunch(Module *exe_module,
const bool disable_stdio = (launch_flags & eLaunchFlagDisableSTDIO) != 0;
if (stdin_file_spec || disable_stdio) {
- // the inferior will be reading stdin from the specified file
- // or stdio is completely disabled
+ // the inferior will be reading stdin from the specified file or stdio is
+ // completely disabled
m_stdin_forward = false;
} else {
m_stdin_forward = true;
@@ -824,11 +824,14 @@ Status ProcessGDBRemote::DoLaunch(Module *exe_module,
if (disable_stdio) {
// set to /dev/null unless redirected to a file above
if (!stdin_file_spec)
- stdin_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stdin_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
if (!stdout_file_spec)
- stdout_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stdout_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
if (!stderr_file_spec)
- stderr_file_spec.SetFile(FileSystem::DEV_NULL, false);
+ stderr_file_spec.SetFile(FileSystem::DEV_NULL, false,
+ FileSpec::Style::native);
} else if (platform_sp && platform_sp->IsHost()) {
// If the debugserver is local and we aren't disabling STDIO, lets use
// a pseudo terminal to instead of relying on the 'O' packets for stdio
@@ -888,16 +891,7 @@ Status ProcessGDBRemote::DoLaunch(Module *exe_module,
}
// Send the environment and the program + arguments after we connect
- const Args &environment = launch_info.GetEnvironmentEntries();
- if (environment.GetArgumentCount()) {
- size_t num_environment_entries = environment.GetArgumentCount();
- for (size_t i = 0; i < num_environment_entries; ++i) {
- const char *env_entry = environment.GetArgumentAtIndex(i);
- if (env_entry == NULL ||
- m_gdb_comm.SendEnvironmentPacket(env_entry) != 0)
- break;
- }
- }
+ m_gdb_comm.SendEnvironment(launch_info.GetEnvironment());
{
// Scope for the scoped timeout object
@@ -1004,16 +998,15 @@ Status ProcessGDBRemote::ConnectToDebugserver(llvm::StringRef connect_url) {
return error;
}
- // Start the communications read thread so all incoming data can be
- // parsed into packets and queued as they arrive.
+ // Start the communications read thread so all incoming data can be parsed
+ // into packets and queued as they arrive.
if (GetTarget().GetNonStopModeEnabled())
m_gdb_comm.StartReadThread();
- // We always seem to be able to open a connection to a local port
- // so we need to make sure we can then send data to it. If we can't
- // then we aren't actually connected to anything, so try and do the
- // handshake with the remote GDB server and make sure that goes
- // alright.
+ // We always seem to be able to open a connection to a local port so we need
+ // to make sure we can then send data to it. If we can't then we aren't
+ // actually connected to anything, so try and do the handshake with the
+ // remote GDB server and make sure that goes alright.
if (!m_gdb_comm.HandshakeWithServer(&error)) {
m_gdb_comm.Disconnect();
if (error.Success())
@@ -1055,9 +1048,9 @@ void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) {
// See if the GDB server supports the qHostInfo information
- // See if the GDB server supports the qProcessInfo packet, if so
- // prefer that over the Host information as it will be more specific
- // to our process.
+ // See if the GDB server supports the qProcessInfo packet, if so prefer
+ // that over the Host information as it will be more specific to our
+ // process.
const ArchSpec &remote_process_arch = m_gdb_comm.GetProcessArchitecture();
if (remote_process_arch.IsValid()) {
@@ -1102,9 +1095,8 @@ void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) {
// architectures.
// You can have an armv6 executable, and if the host is armv7, then the
// system will load the best possible architecture for all shared
- // libraries
- // it has, so we really need to take the remote host architecture as our
- // defacto architecture in this case.
+ // libraries it has, so we really need to take the remote host
+ // architecture as our defacto architecture in this case.
if ((process_arch.GetMachine() == llvm::Triple::arm ||
process_arch.GetMachine() == llvm::Triple::thumb) &&
@@ -1150,14 +1142,14 @@ void ProcessGDBRemote::DidLaunchOrAttach(ArchSpec &process_arch) {
? target_arch.GetTriple().getTriple().c_str()
: "<null>");
} else {
- // The target doesn't have a valid architecture yet, set it from
- // the architecture we got from the remote GDB server
+ // The target doesn't have a valid architecture yet, set it from the
+ // architecture we got from the remote GDB server
GetTarget().SetArchitecture(process_arch);
}
}
- // Find out which StructuredDataPlugins are supported by the
- // debug monitor. These plugins transmit data over async $J packets.
+ // Find out which StructuredDataPlugins are supported by the debug monitor.
+ // These plugins transmit data over async $J packets.
auto supported_packets_array =
m_gdb_comm.GetSupportedStructuredDataPlugins();
if (supported_packets_array)
@@ -1365,9 +1357,9 @@ Status ProcessGDBRemote::DoResume() {
continue_packet_error = true;
if (continue_packet_error) {
- // Either no vCont support, or we tried to use part of the vCont
- // packet that wasn't supported by the remote GDB server.
- // We need to try and make a simple packet that can do our continue
+ // Either no vCont support, or we tried to use part of the vCont packet
+ // that wasn't supported by the remote GDB server. We need to try and
+ // make a simple packet that can do our continue
const size_t num_continue_c_tids = m_continue_c_tids.size();
const size_t num_continue_C_tids = m_continue_C_tids.size();
const size_t num_continue_s_tids = m_continue_s_tids.size();
@@ -1394,11 +1386,10 @@ Status ProcessGDBRemote::DoResume() {
const int continue_signo = m_continue_C_tids.front().second;
// Only one thread is continuing
if (num_continue_C_tids > 1) {
- // More that one thread with a signal, yet we don't have
- // vCont support and we are being asked to resume each
- // thread with a signal, we need to make sure they are
- // all the same signal, or we can't issue the continue
- // accurately with the current support...
+ // More that one thread with a signal, yet we don't have vCont
+ // support and we are being asked to resume each thread with a
+ // signal, we need to make sure they are all the same signal, or we
+ // can't issue the continue accurately with the current support...
if (num_continue_C_tids > 1) {
continue_packet_error = false;
for (size_t i = 1; i < m_continue_C_tids.size(); ++i) {
@@ -1532,7 +1523,6 @@ void ProcessGDBRemote::ClearThreadIDList() {
size_t
ProcessGDBRemote::UpdateThreadIDsFromStopReplyThreadsValue(std::string &value) {
m_thread_ids.clear();
- m_thread_pcs.clear();
size_t comma_pos;
lldb::tid_t tid;
while ((comma_pos = value.find(',')) != std::string::npos) {
@@ -1675,9 +1665,8 @@ bool ProcessGDBRemote::UpdateThreadList(ThreadList &old_thread_list,
}
}
- // Whatever that is left in old_thread_list_copy are not
- // present in new_thread_list. Remove non-existent threads from internal id
- // table.
+ // Whatever that is left in old_thread_list_copy are not present in
+ // new_thread_list. Remove non-existent threads from internal id table.
size_t old_num_thread_ids = old_thread_list_copy.GetSize(false);
for (size_t i = 0; i < old_num_thread_ids; i++) {
ThreadSP old_thread_sp(old_thread_list_copy.GetThreadAtIndex(i, false));
@@ -1738,12 +1727,11 @@ bool ProcessGDBRemote::CalculateThreadStopInfo(ThreadGDBRemote *thread) {
return true;
// See if we got thread stop info for any threads valid stop info reasons
- // threads
- // via the "jstopinfo" packet stop reply packet key/value pair?
+ // threads via the "jstopinfo" packet stop reply packet key/value pair?
if (m_jstopinfo_sp) {
// If we have "jstopinfo" then we have stop descriptions for all threads
- // that have stop reasons, and if there is no entry for a thread, then
- // it has no stop reason.
+ // that have stop reasons, and if there is no entry for a thread, then it
+ // has no stop reason.
thread->GetRegisterContext()->InvalidateIfNeeded(true);
if (!GetThreadStopInfoFromJSON(thread, m_jstopinfo_sp)) {
thread->SetStopInfo(StopInfoSP());
@@ -1771,9 +1759,8 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
if (tid != LLDB_INVALID_THREAD_ID) {
// Scope for "locker" below
{
- // m_thread_list_real does have its own mutex, but we need to
- // hold onto the mutex between the call to
- // m_thread_list_real.FindThreadByID(...)
+ // m_thread_list_real does have its own mutex, but we need to hold onto
+ // the mutex between the call to m_thread_list_real.FindThreadByID(...)
// and the m_thread_list_real.AddThread(...) so it doesn't change on us
std::lock_guard<std::recursive_mutex> guard(
m_thread_list_real.GetMutex());
@@ -1827,10 +1814,9 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
if (!thread_sp->StopInfoIsUpToDate()) {
thread_sp->SetStopInfo(StopInfoSP());
// If there's a memory thread backed by this thread, we need to use it
- // to calcualte StopInfo.
- ThreadSP memory_thread_sp =
- m_thread_list.FindThreadByProtocolID(thread_sp->GetProtocolID());
- if (memory_thread_sp)
+ // to calculate StopInfo.
+ if (ThreadSP memory_thread_sp =
+ m_thread_list.GetBackingThread(thread_sp))
thread_sp = memory_thread_sp;
if (exc_type != 0) {
@@ -1852,9 +1838,9 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
->GetBreakpointSiteList()
.FindByAddress(pc);
- // If the current pc is a breakpoint site then the StopInfo should
- // be set to Breakpoint
- // Otherwise, it will be set to Trace.
+ // If the current pc is a breakpoint site then the StopInfo
+ // should be set to Breakpoint Otherwise, it will be set to
+ // Trace.
if (bp_site_sp &&
bp_site_sp->ValidForThisThread(thread_sp.get())) {
thread_sp->SetStopInfo(
@@ -1871,11 +1857,10 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
.FindByAddress(pc);
if (bp_site_sp) {
// If the breakpoint is for this thread, then we'll report the
- // hit, but if it is for another thread,
- // we can just report no reason. We don't need to worry about
- // stepping over the breakpoint here, that
- // will be taken care of when the thread resumes and notices
- // that there's a breakpoint under the pc.
+ // hit, but if it is for another thread, we can just report no
+ // reason. We don't need to worry about stepping over the
+ // breakpoint here, that will be taken care of when the thread
+ // resumes and notices that there's a breakpoint under the pc.
handled = true;
if (bp_site_sp->ValidForThisThread(thread_sp.get())) {
thread_sp->SetStopInfo(
@@ -1937,13 +1922,10 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
pc);
// If the current pc is a breakpoint site then the StopInfo should
- // be set to Breakpoint
- // even though the remote stub did not set it as such. This can
- // happen when
- // the thread is involuntarily interrupted (e.g. due to stops on
- // other
- // threads) just as it is about to execute the breakpoint
- // instruction.
+ // be set to Breakpoint even though the remote stub did not set it
+ // as such. This can happen when the thread is involuntarily
+ // interrupted (e.g. due to stops on other threads) just as it is
+ // about to execute the breakpoint instruction.
if (bp_site_sp && bp_site_sp->ValidForThisThread(thread_sp.get())) {
thread_sp->SetStopInfo(
StopInfo::CreateStopReasonWithBreakpointSiteID(
@@ -1965,11 +1947,10 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
if (bp_site_sp) {
// If the breakpoint is for this thread, then we'll report the
- // hit, but if it is for another thread,
- // we can just report no reason. We don't need to worry about
- // stepping over the breakpoint here, that
- // will be taken care of when the thread resumes and notices
- // that there's a breakpoint under the pc.
+ // hit, but if it is for another thread, we can just report no
+ // reason. We don't need to worry about stepping over the
+ // breakpoint here, that will be taken care of when the thread
+ // resumes and notices that there's a breakpoint under the pc.
if (bp_site_sp->ValidForThisThread(thread_sp.get())) {
if (m_breakpoint_pc_offset != 0)
thread_sp->GetRegisterContext()->SetPC(pc);
@@ -1982,8 +1963,7 @@ ThreadSP ProcessGDBRemote::SetThreadStopInfo(
}
} else {
// If we were stepping then assume the stop was the result of
- // the trace. If we were
- // not stepping then report the SIGTRAP.
+ // the trace. If we were not stepping then report the SIGTRAP.
// FIXME: We are still missing the case where we single step
// over a trap instruction.
if (thread_sp->GetTemporaryResumeState() == eStateStepping)
@@ -2178,15 +2158,15 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
switch (stop_type) {
case 'T':
case 'S': {
- // This is a bit of a hack, but is is required. If we did exec, we
- // need to clear our thread lists and also know to rebuild our dynamic
- // register info before we lookup and threads and populate the expedited
- // register values so we need to know this right away so we can cleanup
- // and update our registers.
+ // This is a bit of a hack, but is is required. If we did exec, we need to
+ // clear our thread lists and also know to rebuild our dynamic register
+ // info before we lookup and threads and populate the expedited register
+ // values so we need to know this right away so we can cleanup and update
+ // our registers.
const uint32_t stop_id = GetStopID();
if (stop_id == 0) {
- // Our first stop, make sure we have a process ID, and also make
- // sure we know about our registers
+ // Our first stop, make sure we have a process ID, and also make sure we
+ // know about our registers
if (GetID() == LLDB_INVALID_PROCESS_ID) {
lldb::pid_t pid = m_gdb_comm.GetCurrentProcessID();
if (pid != LLDB_INVALID_PROCESS_ID)
@@ -2232,8 +2212,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
m_thread_ids.clear();
// A comma separated list of all threads in the current
- // process that includes the thread for this stop reply
- // packet
+ // process that includes the thread for this stop reply packet
lldb::tid_t tid;
while (!value.empty()) {
llvm::StringRef tid_str;
@@ -2245,8 +2224,7 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
} else if (key.compare("thread-pcs") == 0) {
m_thread_pcs.clear();
// A comma separated list of all threads in the current
- // process that includes the thread for this stop reply
- // packet
+ // process that includes the thread for this stop reply packet
lldb::addr_t pc;
while (!value.empty()) {
llvm::StringRef pc_str;
@@ -2298,13 +2276,10 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
desc_extractor.GetHexByteString(description);
} else if (key.compare("memory") == 0) {
// Expedited memory. GDB servers can choose to send back expedited
- // memory
- // that can populate the L1 memory cache in the process so that things
- // like
- // the frame pointer backchain can be expedited. This will help stack
- // backtracing be more efficient by not having to send as many memory
- // read
- // requests down the remote GDB server.
+ // memory that can populate the L1 memory cache in the process so that
+ // things like the frame pointer backchain can be expedited. This will
+ // help stack backtracing be more efficient by not having to send as
+ // many memory read requests down the remote GDB server.
// Key/value pair format: memory:<addr>=<bytes>;
// <addr> is a number whose base will be interpreted by the prefix:
@@ -2356,7 +2331,8 @@ StateType ProcessGDBRemote::SetThreadStopInfo(StringExtractor &stop_packet) {
if (tid == LLDB_INVALID_THREAD_ID) {
// A thread id may be invalid if the response is old style 'S' packet
// which does not provide the
- // thread information. So update the thread list and choose the first one.
+ // thread information. So update the thread list and choose the first
+ // one.
UpdateThreadIDList();
if (!m_thread_ids.empty()) {
@@ -2389,9 +2365,9 @@ void ProcessGDBRemote::RefreshStateAfterStop() {
m_thread_ids.clear();
m_thread_pcs.clear();
- // Set the thread stop info. It might have a "threads" key whose value is
- // a list of all thread IDs in the current process, so m_thread_ids might
- // get set.
+ // Set the thread stop info. It might have a "threads" key whose value is a
+ // list of all thread IDs in the current process, so m_thread_ids might get
+ // set.
// Scope for the lock
{
@@ -2422,8 +2398,8 @@ void ProcessGDBRemote::RefreshStateAfterStop() {
m_initial_tid = LLDB_INVALID_THREAD_ID;
}
- // Let all threads recover from stopping and do any clean up based
- // on the previous thread state (if any).
+ // Let all threads recover from stopping and do any clean up based on the
+ // previous thread state (if any).
m_thread_list_real.RefreshStateAfterStop();
}
@@ -2431,8 +2407,8 @@ Status ProcessGDBRemote::DoHalt(bool &caused_stop) {
Status error;
if (m_public_state.GetValue() == eStateAttaching) {
- // We are being asked to halt during an attach. We need to just close
- // our file handle and debugserver will go away, and we can be done...
+ // We are being asked to halt during an attach. We need to just close our
+ // file handle and debugserver will go away, and we can be done...
m_gdb_comm.Disconnect();
} else
caused_stop = m_gdb_comm.Interrupt();
@@ -2475,31 +2451,24 @@ Status ProcessGDBRemote::DoDestroy() {
log->Printf("ProcessGDBRemote::DoDestroy()");
// There is a bug in older iOS debugservers where they don't shut down the
- // process
- // they are debugging properly. If the process is sitting at a breakpoint or
- // an exception,
- // this can cause problems with restarting. So we check to see if any of our
- // threads are stopped
- // at a breakpoint, and if so we remove all the breakpoints, resume the
- // process, and THEN
- // destroy it again.
+ // process they are debugging properly. If the process is sitting at a
+ // breakpoint or an exception, this can cause problems with restarting. So
+ // we check to see if any of our threads are stopped at a breakpoint, and if
+ // so we remove all the breakpoints, resume the process, and THEN destroy it
+ // again.
//
// Note, we don't have a good way to test the version of debugserver, but I
- // happen to know that
- // the set of all the iOS debugservers which don't support
- // GetThreadSuffixSupported() and that of
- // the debugservers with this bug are equal. There really should be a better
- // way to test this!
+ // happen to know that the set of all the iOS debugservers which don't
+ // support GetThreadSuffixSupported() and that of the debugservers with this
+ // bug are equal. There really should be a better way to test this!
//
// We also use m_destroy_tried_resuming to make sure we only do this once, if
- // we resume and then halt and
- // get called here to destroy again and we're still at a breakpoint or
- // exception, then we should
- // just do the straight-forward kill.
+ // we resume and then halt and get called here to destroy again and we're
+ // still at a breakpoint or exception, then we should just do the straight-
+ // forward kill.
//
// And of course, if we weren't able to stop the process by the time we get
- // here, it isn't
- // necessary (or helpful) to do any of this.
+ // here, it isn't necessary (or helpful) to do any of this.
if (!m_gdb_comm.GetThreadSuffixSupported() &&
m_public_state.GetValue() != eStateRunning) {
@@ -2514,9 +2483,8 @@ Status ProcessGDBRemote::DoDestroy() {
"destroy once already, not doing it again.");
} else {
// At present, the plans are discarded and the breakpoints disabled
- // Process::Destroy,
- // but we really need it to happen here and it doesn't matter if we do
- // it twice.
+ // Process::Destroy, but we really need it to happen here and it
+ // doesn't matter if we do it twice.
m_thread_list.DiscardThreadPlans();
DisableAllBreakpointSites();
@@ -2553,12 +2521,11 @@ Status ProcessGDBRemote::DoDestroy() {
m_destroy_tried_resuming = true;
// If we are going to run again before killing, it would be good to
- // suspend all the threads
- // before resuming so they won't get into more trouble. Sadly, for
- // the threads stopped with
- // the breakpoint or exception, the exception doesn't get cleared if
- // it is suspended, so we do
- // have to run the risk of letting those threads proceed a bit.
+ // suspend all the threads before resuming so they won't get into
+ // more trouble. Sadly, for the threads stopped with the breakpoint
+ // or exception, the exception doesn't get cleared if it is
+ // suspended, so we do have to run the risk of letting those threads
+ // proceed a bit.
{
std::lock_guard<std::recursive_mutex> guard(threads.GetMutex());
@@ -2605,17 +2572,14 @@ Status ProcessGDBRemote::DoDestroy() {
if (packet_cmd == 'W' || packet_cmd == 'X') {
#if defined(__APPLE__)
// For Native processes on Mac OS X, we launch through the Host
- // Platform, then hand the process off
- // to debugserver, which becomes the parent process through
- // "PT_ATTACH". Then when we go to kill
- // the process on Mac OS X we call ptrace(PT_KILL) to kill it, then we
- // call waitpid which returns
- // with no error and the correct status. But amusingly enough that
- // doesn't seem to actually reap
+ // Platform, then hand the process off to debugserver, which becomes
+ // the parent process through "PT_ATTACH". Then when we go to kill
+ // the process on Mac OS X we call ptrace(PT_KILL) to kill it, then
+ // we call waitpid which returns with no error and the correct
+ // status. But amusingly enough that doesn't seem to actually reap
// the process, but instead it is left around as a Zombie. Probably
- // the kernel is in the process of
- // switching ownership back to lldb which was the original parent, and
- // gets confused in the handoff.
+ // the kernel is in the process of switching ownership back to lldb
+ // which was the original parent, and gets confused in the handoff.
// Anyway, so call waitpid here to finally reap it.
PlatformSP platform_sp(GetTarget().GetPlatform());
if (platform_sp && platform_sp->IsHost()) {
@@ -2687,9 +2651,8 @@ void ProcessGDBRemote::SetLastStopPacket(
if (GetTarget().GetNonStopModeEnabled() == false)
m_stop_packet_stack.clear();
- // Add this stop packet to the stop packet stack
- // This stack will get popped and examined when we switch to the
- // Stopped state
+ // Add this stop packet to the stop packet stack This stack will get popped
+ // and examined when we switch to the Stopped state
m_stop_packet_stack.push_back(response);
}
}
@@ -2721,12 +2684,11 @@ addr_t ProcessGDBRemote::GetImageInfoAddress() {
}
void ProcessGDBRemote::WillPublicStop() {
- // See if the GDB remote client supports the JSON threads info.
- // If so, we gather stop info for all threads, expedited registers,
- // expedited memory, runtime queue information (iOS and MacOSX only),
- // and more. Expediting memory will help stack backtracing be much
- // faster. Expediting registers will make sure we don't have to read
- // the thread registers for GPRs.
+ // See if the GDB remote client supports the JSON threads info. If so, we
+ // gather stop info for all threads, expedited registers, expedited memory,
+ // runtime queue information (iOS and MacOSX only), and more. Expediting
+ // memory will help stack backtracing be much faster. Expediting registers
+ // will make sure we don't have to read the thread registers for GPRs.
m_jthreadsinfo_sp = m_gdb_comm.GetThreadsInfo();
if (m_jthreadsinfo_sp) {
@@ -2776,14 +2738,13 @@ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size,
error.Clear();
if (binary_memory_read) {
// The lower level GDBRemoteCommunication packet receive layer has
- // already de-quoted any
- // 0x7d character escaping that was present in the packet
+ // already de-quoted any 0x7d character escaping that was present in
+ // the packet
size_t data_received_size = response.GetBytesLeft();
if (data_received_size > size) {
// Don't write past the end of BUF if the remote debug server gave us
- // too
- // much data for some reason.
+ // too much data for some reason.
data_received_size = size;
}
memcpy(buf, response.GetStringRef().data(), data_received_size);
@@ -2807,6 +2768,145 @@ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size,
return 0;
}
+Status ProcessGDBRemote::WriteObjectFile(
+ std::vector<ObjectFile::LoadableData> entries) {
+ Status error;
+ // Sort the entries by address because some writes, like those to flash
+ // memory, must happen in order of increasing address.
+ std::stable_sort(
+ std::begin(entries), std::end(entries),
+ [](const ObjectFile::LoadableData a, const ObjectFile::LoadableData b) {
+ return a.Dest < b.Dest;
+ });
+ m_allow_flash_writes = true;
+ error = Process::WriteObjectFile(entries);
+ if (error.Success())
+ error = FlashDone();
+ else
+ // Even though some of the writing failed, try to send a flash done if some
+ // of the writing succeeded so the flash state is reset to normal, but
+ // don't stomp on the error status that was set in the write failure since
+ // that's the one we want to report back.
+ FlashDone();
+ m_allow_flash_writes = false;
+ return error;
+}
+
+bool ProcessGDBRemote::HasErased(FlashRange range) {
+ auto size = m_erased_flash_ranges.GetSize();
+ for (size_t i = 0; i < size; ++i)
+ if (m_erased_flash_ranges.GetEntryAtIndex(i)->Contains(range))
+ return true;
+ return false;
+}
+
+Status ProcessGDBRemote::FlashErase(lldb::addr_t addr, size_t size) {
+ Status status;
+
+ MemoryRegionInfo region;
+ status = GetMemoryRegionInfo(addr, region);
+ if (!status.Success())
+ return status;
+
+ // The gdb spec doesn't say if erasures are allowed across multiple regions,
+ // but we'll disallow it to be safe and to keep the logic simple by worring
+ // about only one region's block size. DoMemoryWrite is this function's
+ // primary user, and it can easily keep writes within a single memory region
+ if (addr + size > region.GetRange().GetRangeEnd()) {
+ status.SetErrorString("Unable to erase flash in multiple regions");
+ return status;
+ }
+
+ uint64_t blocksize = region.GetBlocksize();
+ if (blocksize == 0) {
+ status.SetErrorString("Unable to erase flash because blocksize is 0");
+ return status;
+ }
+
+ // Erasures can only be done on block boundary adresses, so round down addr
+ // and round up size
+ lldb::addr_t block_start_addr = addr - (addr % blocksize);
+ size += (addr - block_start_addr);
+ if ((size % blocksize) != 0)
+ size += (blocksize - size % blocksize);
+
+ FlashRange range(block_start_addr, size);
+
+ if (HasErased(range))
+ return status;
+
+ // We haven't erased the entire range, but we may have erased part of it.
+ // (e.g., block A is already erased and range starts in A and ends in B). So,
+ // adjust range if necessary to exclude already erased blocks.
+ if (!m_erased_flash_ranges.IsEmpty()) {
+ // Assuming that writes and erasures are done in increasing addr order,
+ // because that is a requirement of the vFlashWrite command. Therefore, we
+ // only need to look at the last range in the list for overlap.
+ const auto &last_range = *m_erased_flash_ranges.Back();
+ if (range.GetRangeBase() < last_range.GetRangeEnd()) {
+ auto overlap = last_range.GetRangeEnd() - range.GetRangeBase();
+ // overlap will be less than range.GetByteSize() or else HasErased()
+ // would have been true
+ range.SetByteSize(range.GetByteSize() - overlap);
+ range.SetRangeBase(range.GetRangeBase() + overlap);
+ }
+ }
+
+ StreamString packet;
+ packet.Printf("vFlashErase:%" PRIx64 ",%" PRIx64, range.GetRangeBase(),
+ (uint64_t)range.GetByteSize());
+
+ StringExtractorGDBRemote response;
+ if (m_gdb_comm.SendPacketAndWaitForResponse(packet.GetString(), response,
+ true) ==
+ GDBRemoteCommunication::PacketResult::Success) {
+ if (response.IsOKResponse()) {
+ m_erased_flash_ranges.Insert(range, true);
+ } else {
+ if (response.IsErrorResponse())
+ status.SetErrorStringWithFormat("flash erase failed for 0x%" PRIx64,
+ addr);
+ else if (response.IsUnsupportedResponse())
+ status.SetErrorStringWithFormat("GDB server does not support flashing");
+ else
+ status.SetErrorStringWithFormat(
+ "unexpected response to GDB server flash erase packet '%s': '%s'",
+ packet.GetData(), response.GetStringRef().c_str());
+ }
+ } else {
+ status.SetErrorStringWithFormat("failed to send packet: '%s'",
+ packet.GetData());
+ }
+ return status;
+}
+
+Status ProcessGDBRemote::FlashDone() {
+ Status status;
+ // If we haven't erased any blocks, then we must not have written anything
+ // either, so there is no need to actually send a vFlashDone command
+ if (m_erased_flash_ranges.IsEmpty())
+ return status;
+ StringExtractorGDBRemote response;
+ if (m_gdb_comm.SendPacketAndWaitForResponse("vFlashDone", response, true) ==
+ GDBRemoteCommunication::PacketResult::Success) {
+ if (response.IsOKResponse()) {
+ m_erased_flash_ranges.Clear();
+ } else {
+ if (response.IsErrorResponse())
+ status.SetErrorStringWithFormat("flash done failed");
+ else if (response.IsUnsupportedResponse())
+ status.SetErrorStringWithFormat("GDB server does not support flashing");
+ else
+ status.SetErrorStringWithFormat(
+ "unexpected response to GDB server flash done packet: '%s'",
+ response.GetStringRef().c_str());
+ }
+ } else {
+ status.SetErrorStringWithFormat("failed to send flash done packet");
+ }
+ return status;
+}
+
size_t ProcessGDBRemote::DoWriteMemory(addr_t addr, const void *buf,
size_t size, Status &error) {
GetMaxMemorySize();
@@ -2819,10 +2919,33 @@ size_t ProcessGDBRemote::DoWriteMemory(addr_t addr, const void *buf,
size = max_memory_size;
}
- StreamString packet;
- packet.Printf("M%" PRIx64 ",%" PRIx64 ":", addr, (uint64_t)size);
- packet.PutBytesAsRawHex8(buf, size, endian::InlHostByteOrder(),
- endian::InlHostByteOrder());
+ StreamGDBRemote packet;
+
+ MemoryRegionInfo region;
+ Status region_status = GetMemoryRegionInfo(addr, region);
+
+ bool is_flash =
+ region_status.Success() && region.GetFlash() == MemoryRegionInfo::eYes;
+
+ if (is_flash) {
+ if (!m_allow_flash_writes) {
+ error.SetErrorString("Writing to flash memory is not allowed");
+ return 0;
+ }
+ // Keep the write within a flash memory region
+ if (addr + size > region.GetRange().GetRangeEnd())
+ size = region.GetRange().GetRangeEnd() - addr;
+ // Flash memory must be erased before it can be written
+ error = FlashErase(addr, size);
+ if (!error.Success())
+ return 0;
+ packet.Printf("vFlashWrite:%" PRIx64 ":", addr);
+ packet.PutEscapedBytes(buf, size);
+ } else {
+ packet.Printf("M%" PRIx64 ",%" PRIx64 ":", addr, (uint64_t)size);
+ packet.PutBytesAsRawHex8(buf, size, endian::InlHostByteOrder(),
+ endian::InlHostByteOrder());
+ }
StringExtractorGDBRemote response;
if (m_gdb_comm.SendPacketAndWaitForResponse(packet.GetString(), response,
true) ==
@@ -2918,8 +3041,8 @@ Status ProcessGDBRemote::DoDeallocateMemory(lldb::addr_t addr) {
switch (supported) {
case eLazyBoolCalculate:
- // We should never be deallocating memory without allocating memory
- // first so we should never get eLazyBoolCalculate
+ // We should never be deallocating memory without allocating memory first
+ // so we should never get eLazyBoolCalculate
error.SetErrorString(
"tried to deallocate memory without ever allocating memory");
break;
@@ -2991,18 +3114,14 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
const size_t bp_op_size = GetSoftwareBreakpointTrapOpcode(bp_site);
// SupportsGDBStoppointPacket() simply checks a boolean, indicating if this
- // breakpoint type
- // is supported by the remote stub. These are set to true by default, and
- // later set to false
- // only after we receive an unimplemented response when sending a breakpoint
- // packet. This means
- // initially that unless we were specifically instructed to use a hardware
- // breakpoint, LLDB will
- // attempt to set a software breakpoint. HardwareRequired() also queries a
- // boolean variable which
- // indicates if the user specifically asked for hardware breakpoints. If true
- // then we will
- // skip over software breakpoints.
+ // breakpoint type is supported by the remote stub. These are set to true by
+ // default, and later set to false only after we receive an unimplemented
+ // response when sending a breakpoint packet. This means initially that
+ // unless we were specifically instructed to use a hardware breakpoint, LLDB
+ // will attempt to set a software breakpoint. HardwareRequired() also queries
+ // a boolean variable which indicates if the user specifically asked for
+ // hardware breakpoints. If true then we will skip over software
+ // breakpoints.
if (m_gdb_comm.SupportsGDBStoppointPacket(eBreakpointSoftware) &&
(!bp_site->HardwareRequired())) {
// Try to send off a software breakpoint packet ($Z0)
@@ -3015,19 +3134,14 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
return error;
}
- // SendGDBStoppointTypePacket() will return an error if it was unable to set
- // this
- // breakpoint. We need to differentiate between a error specific to placing
- // this breakpoint
- // or if we have learned that this breakpoint type is unsupported. To do
- // this, we
- // must test the support boolean for this breakpoint type to see if it now
- // indicates that
- // this breakpoint type is unsupported. If they are still supported then we
- // should return
+ // SendGDBStoppointTypePacket() will return an error if it was unable to
+ // set this breakpoint. We need to differentiate between a error specific
+ // to placing this breakpoint or if we have learned that this breakpoint
+ // type is unsupported. To do this, we must test the support boolean for
+ // this breakpoint type to see if it now indicates that this breakpoint
+ // type is unsupported. If they are still supported then we should return
// with the error code. If they are now unsupported, then we would like to
- // fall through
- // and try another form of breakpoint.
+ // fall through and try another form of breakpoint.
if (m_gdb_comm.SupportsGDBStoppointPacket(eBreakpointSoftware)) {
if (error_no != UINT8_MAX)
error.SetErrorStringWithFormat(
@@ -3038,21 +3152,18 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
}
// We reach here when software breakpoints have been found to be
- // unsupported. For future
- // calls to set a breakpoint, we will not attempt to set a breakpoint with a
- // type that is
- // known not to be supported.
+ // unsupported. For future calls to set a breakpoint, we will not attempt
+ // to set a breakpoint with a type that is known not to be supported.
if (log)
log->Printf("Software breakpoints are unsupported");
// So we will fall through and try a hardware breakpoint
}
- // The process of setting a hardware breakpoint is much the same as above. We
- // check the
- // supported boolean for this breakpoint type, and if it is thought to be
- // supported then we
- // will try to set this breakpoint with a hardware breakpoint.
+ // The process of setting a hardware breakpoint is much the same as above.
+ // We check the supported boolean for this breakpoint type, and if it is
+ // thought to be supported then we will try to set this breakpoint with a
+ // hardware breakpoint.
if (m_gdb_comm.SupportsGDBStoppointPacket(eBreakpointHardware)) {
// Try to send off a hardware breakpoint packet ($Z1)
uint8_t error_no = m_gdb_comm.SendGDBStoppointTypePacket(
@@ -3094,8 +3205,8 @@ Status ProcessGDBRemote::EnableBreakpointSite(BreakpointSite *bp_site) {
return error;
}
- // As a last resort we want to place a manual breakpoint. An instruction
- // is placed into the process memory using memory write packets.
+ // As a last resort we want to place a manual breakpoint. An instruction is
+ // placed into the process memory using memory write packets.
return EnableSoftwareBreakpoint(bp_site);
}
@@ -3225,10 +3336,9 @@ Status ProcessGDBRemote::DisableWatchpoint(Watchpoint *wp, bool notify) {
log->Printf("ProcessGDBRemote::DisableWatchpoint (watchID = %" PRIu64
") addr = 0x%8.8" PRIx64 " -- SUCCESS (already disabled)",
watchID, (uint64_t)addr);
- // See also 'class WatchpointSentry' within StopInfo.cpp.
- // This disabling attempt might come from the user-supplied actions, we'll
- // route it in order for
- // the watchpoint object to intelligently process this action.
+ // See also 'class WatchpointSentry' within StopInfo.cpp. This disabling
+ // attempt might come from the user-supplied actions, we'll route it in
+ // order for the watchpoint object to intelligently process this action.
wp->SetEnabled(false, notify);
return error;
}
@@ -3313,8 +3423,8 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
static FileSpec g_debugserver_file_spec;
ProcessLaunchInfo debugserver_launch_info;
- // Make debugserver run in its own session so signals generated by
- // special terminal key sequences (^C) don't affect debugserver.
+ // Make debugserver run in its own session so signals generated by special
+ // terminal key sequences (^C) don't affect debugserver.
debugserver_launch_info.SetLaunchInSeparateProcessGroup(true);
const std::weak_ptr<ProcessGDBRemote> this_wp =
@@ -3325,27 +3435,22 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
int communication_fd = -1;
#ifdef USE_SOCKETPAIR_FOR_LOCAL_CONNECTION
- // Auto close the sockets we might open up unless everything goes OK. This
- // helps us not leak file descriptors when things go wrong.
- lldb_utility::CleanUp<int, int> our_socket(-1, -1, close);
- lldb_utility::CleanUp<int, int> gdb_socket(-1, -1, close);
-
// Use a socketpair on non-Windows systems for security and performance
// reasons.
- {
- int sockets[2]; /* the pair of socket descriptors */
- if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) == -1) {
- error.SetErrorToErrno();
- return error;
- }
-
- our_socket.set(sockets[0]);
- gdb_socket.set(sockets[1]);
+ int sockets[2]; /* the pair of socket descriptors */
+ if (socketpair(AF_UNIX, SOCK_STREAM, 0, sockets) == -1) {
+ error.SetErrorToErrno();
+ return error;
}
+ int our_socket = sockets[0];
+ int gdb_socket = sockets[1];
+ CleanUp cleanup_our(close, our_socket);
+ CleanUp cleanup_gdb(close, gdb_socket);
+
// Don't let any child processes inherit our communication socket
- SetCloexecFlag(our_socket.get());
- communication_fd = gdb_socket.get();
+ SetCloexecFlag(our_socket);
+ communication_fd = gdb_socket;
#endif
error = m_gdb_comm.StartDebugserverProcess(
@@ -3359,10 +3464,10 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
if (m_debugserver_pid != LLDB_INVALID_PROCESS_ID) {
#ifdef USE_SOCKETPAIR_FOR_LOCAL_CONNECTION
- // Our process spawned correctly, we can now set our connection to use our
- // end of the socket pair
- m_gdb_comm.SetConnection(
- new ConnectionFileDescriptor(our_socket.release(), true));
+ // Our process spawned correctly, we can now set our connection to use
+ // our end of the socket pair
+ cleanup_our.disable();
+ m_gdb_comm.SetConnection(new ConnectionFileDescriptor(our_socket, true));
#endif
StartAsyncThread();
}
@@ -3377,9 +3482,9 @@ Status ProcessGDBRemote::LaunchAndConnectToDebugserver(
}
if (m_gdb_comm.IsConnected()) {
- // Finish the connection process by doing the handshake without connecting
- // (send NULL URL)
- ConnectToDebugserver("");
+ // Finish the connection process by doing the handshake without
+ // connecting (send NULL URL)
+ error = ConnectToDebugserver("");
} else {
error.SetErrorString("connection failed");
}
@@ -3393,8 +3498,8 @@ bool ProcessGDBRemote::MonitorDebugserverProcess(
int signo, // Zero for no signal
int exit_status // Exit value of process if signal is zero
) {
- // "debugserver_pid" argument passed in is the process ID for
- // debugserver that we are tracking...
+ // "debugserver_pid" argument passed in is the process ID for debugserver
+ // that we are tracking...
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
const bool handled = true;
@@ -3410,12 +3515,12 @@ bool ProcessGDBRemote::MonitorDebugserverProcess(
if (!process_sp || process_sp->m_debugserver_pid != debugserver_pid)
return handled;
- // Sleep for a half a second to make sure our inferior process has
- // time to set its exit status before we set it incorrectly when
- // both the debugserver and the inferior process shut down.
+ // Sleep for a half a second to make sure our inferior process has time to
+ // set its exit status before we set it incorrectly when both the debugserver
+ // and the inferior process shut down.
usleep(500000);
- // If our process hasn't yet exited, debugserver might have died.
- // If the process did exit, then we are reaping it.
+ // If our process hasn't yet exited, debugserver might have died. If the
+ // process did exit, then we are reaping it.
const StateType state = process_sp->GetState();
if (state != eStateInvalid && state != eStateUnloaded &&
@@ -3438,8 +3543,8 @@ bool ProcessGDBRemote::MonitorDebugserverProcess(
process_sp->SetExitStatus(-1, error_str);
}
- // Debugserver has exited we need to let our ProcessGDBRemote
- // know that it no longer has a debugserver instance
+ // Debugserver has exited we need to let our ProcessGDBRemote know that it no
+ // longer has a debugserver instance
process_sp->m_debugserver_pid = LLDB_INVALID_PROCESS_ID;
return handled;
}
@@ -3529,10 +3634,9 @@ bool ProcessGDBRemote::HandleNotifyPacket(StringExtractorGDBRemote &packet) {
// check for more stop reasons
HandleStopReplySequence();
- // if the process is stopped then we need to fake a resume
- // so that we can stop properly with the new break. This
- // is possible due to SetPrivateState() broadcasting the
- // state change as a side effect.
+ // if the process is stopped then we need to fake a resume so that we can
+ // stop properly with the new break. This is possible due to
+ // SetPrivateState() broadcasting the state change as a side effect.
if (GetPrivateState() == lldb::StateType::eStateStopped) {
SetPrivateState(lldb::StateType::eStateRunning);
}
@@ -3605,12 +3709,11 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
response);
// We need to immediately clear the thread ID list so we are sure
- // to get a valid list of threads.
- // The thread ID list might be contained within the "response", or
- // the stop reply packet that
+ // to get a valid list of threads. The thread ID list might be
+ // contained within the "response", or the stop reply packet that
// caused the stop. So clear it now before we give the stop reply
- // packet to the process
- // using the process->SetLastStopPacket()...
+ // packet to the process using the
+ // process->SetLastStopPacket()...
process->ClearThreadIDList();
switch (stop_state) {
@@ -3647,17 +3750,14 @@ thread_result_t ProcessGDBRemote::AsyncThread(void *arg) {
// Check to see if we were trying to attach and if we got back
// 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.
+ // helpful error message about why the attach failed.
if (::strstr(continue_cstr, "vAttach") != NULL &&
response.GetError() == 0x87) {
process->SetExitStatus(-1, "cannot attach to process due to "
"System Integrity Protection");
- }
- // E01 code from vAttach means that the attach failed
- if (::strstr(continue_cstr, "vAttach") != NULL &&
- response.GetError() == 0x1) {
- process->SetExitStatus(-1, "unable to attach");
+ } else if (::strstr(continue_cstr, "vAttach") != NULL &&
+ response.GetStatus().Fail()) {
+ process->SetExitStatus(-1, response.GetStatus().AsCString());
} else {
process->SetExitStatus(-1, "lost connection");
}
@@ -3769,8 +3869,8 @@ Status ProcessGDBRemote::UpdateAutomaticSignalFiltering() {
Log *log(ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_PROCESS));
LLDB_LOG(log, "Check if need to update ignored signals");
- // QPassSignals package is not supported by the server,
- // there is no way we can ignore any signals on server side.
+ // QPassSignals package is not supported by the server, there is no way we
+ // can ignore any signals on server side.
if (!m_gdb_comm.GetQPassSignalsSupported())
return Status();
@@ -3894,9 +3994,9 @@ ProcessGDBRemote::GetExtendedInfoForThread(lldb::tid_t tid) {
// FIXME the final character of a JSON dictionary, '}', is the escape
// character in gdb-remote binary mode. lldb currently doesn't escape
- // these characters in its packet output -- so we add the quoted version
- // of the } character here manually in case we talk to a debugserver which
- // un-escapes the characters at packet read time.
+ // these characters in its packet output -- so we add the quoted version of
+ // the } character here manually in case we talk to a debugserver which un-
+ // escapes the characters at packet read time.
packet << (char)(0x7d ^ 0x20);
StringExtractorGDBRemote response;
@@ -3966,9 +4066,9 @@ ProcessGDBRemote::GetLoadedDynamicLibrariesInfos_sender(
// FIXME the final character of a JSON dictionary, '}', is the escape
// character in gdb-remote binary mode. lldb currently doesn't escape
- // these characters in its packet output -- so we add the quoted version
- // of the } character here manually in case we talk to a debugserver which
- // un-escapes the characters at packet read time.
+ // these characters in its packet output -- so we add the quoted version of
+ // the } character here manually in case we talk to a debugserver which un-
+ // escapes the characters at packet read time.
packet << (char)(0x7d ^ 0x20);
StringExtractorGDBRemote response;
@@ -3999,9 +4099,9 @@ StructuredData::ObjectSP ProcessGDBRemote::GetSharedCacheInfo() {
// FIXME the final character of a JSON dictionary, '}', is the escape
// character in gdb-remote binary mode. lldb currently doesn't escape
- // these characters in its packet output -- so we add the quoted version
- // of the } character here manually in case we talk to a debugserver which
- // un-escapes the characters at packet read time.
+ // these characters in its packet output -- so we add the quoted version of
+ // the } character here manually in case we talk to a debugserver which un-
+ // escapes the characters at packet read time.
packet << (char)(0x7d ^ 0x20);
StringExtractorGDBRemote response;
@@ -4026,14 +4126,14 @@ Status ProcessGDBRemote::ConfigureStructuredData(
return m_gdb_comm.ConfigureRemoteStructuredData(type_name, config_sp);
}
-// Establish the largest memory read/write payloads we should use.
-// If the remote stub has a max packet size, stay under that size.
+// Establish the largest memory read/write payloads we should use. If the
+// remote stub has a max packet size, stay under that size.
//
-// If the remote stub's max packet size is crazy large, use a
-// reasonable largeish default.
+// If the remote stub's max packet size is crazy large, use a reasonable
+// largeish default.
//
-// If the remote stub doesn't advertise a max packet size, use a
-// conservative default.
+// If the remote stub doesn't advertise a max packet size, use a conservative
+// default.
void ProcessGDBRemote::GetMaxMemorySize() {
const uint64_t reasonable_largeish_default = 128 * 1024;
@@ -4045,15 +4145,15 @@ void ProcessGDBRemote::GetMaxMemorySize() {
// Save the stub's claimed maximum packet size
m_remote_stub_max_memory_size = stub_max_size;
- // Even if the stub says it can support ginormous packets,
- // don't exceed our reasonable largeish default packet size.
+ // Even if the stub says it can support ginormous packets, don't exceed
+ // our reasonable largeish default packet size.
if (stub_max_size > reasonable_largeish_default) {
stub_max_size = reasonable_largeish_default;
}
- // Memory packet have other overheads too like Maddr,size:#NN
- // Instead of calculating the bytes taken by size and addr every
- // time, we take a maximum guess here.
+ // Memory packet have other overheads too like Maddr,size:#NN Instead of
+ // calculating the bytes taken by size and addr every time, we take a
+ // maximum guess here.
if (stub_max_size > 70)
stub_max_size -= 32 + 32 + 6;
else {
@@ -4140,13 +4240,8 @@ void ProcessGDBRemote::PrefetchModuleSpecs(
}
}
-bool ProcessGDBRemote::GetHostOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) {
- if (m_gdb_comm.GetOSVersion(major, minor, update))
- return true;
- // We failed to get the host OS version, defer to the base
- // implementation to correctly invalidate the arguments.
- return Process::GetHostOSVersion(major, minor, update);
+llvm::VersionTuple ProcessGDBRemote::GetHostOSVersion() {
+ return m_gdb_comm.GetOSVersion();
}
namespace {
@@ -4237,7 +4332,7 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
} else if (name == "format") {
format_set = true;
Format format = eFormatInvalid;
- if (Args::StringToFormat(value.data(), format, NULL).Success())
+ if (OptionArgParser::ToFormat(value.data(), format, NULL).Success())
reg_info.format = format;
else if (value == "vector-sint8")
reg_info.format = eFormatVectorOfSInt8;
@@ -4311,8 +4406,8 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
}
// Only update the register set name if we didn't get a "reg_set"
+ // attribute. "set_name" will be empty if we didn't have a "reg_set"
// attribute.
- // "set_name" will be empty if we didn't have a "reg_set" attribute.
if (!set_name && !gdb_group.empty())
set_name.SetCString(gdb_group.c_str());
@@ -4339,8 +4434,8 @@ bool ParseRegisters(XMLNode feature_node, GdbServerTargetInfo &target_info,
} // namespace {}
-// query the target of gdb-remote for extended target information
-// return: 'true' on success
+// query the target of gdb-remote for extended target information return:
+// 'true' on success
// 'false' on failure
bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
// Make sure LLDB has an XML parser it can use first
@@ -4409,15 +4504,27 @@ bool ProcessGDBRemote::GetGDBServerRegisterInfo(ArchSpec &arch_to_use) {
return true; // Keep iterating through all children of the target_node
});
+ // If the target.xml includes an architecture entry like
+ // <architecture>i386:x86-64</architecture> (seen from VMWare ESXi)
+ // <architecture>arm</architecture> (seen from Segger JLink on unspecified arm board)
+ // use that if we don't have anything better.
+ if (!arch_to_use.IsValid() && !target_info.arch.empty()) {
+ if (target_info.arch == "i386:x86-64")
+ {
+ // We don't have any information about vendor or OS.
+ arch_to_use.SetTriple("x86_64--");
+ GetTarget().MergeArchitecture(arch_to_use);
+ }
+ }
+
// Initialize these outside of ParseRegisters, since they should not be
// reset inside each include feature
uint32_t cur_reg_num = 0;
uint32_t reg_offset = 0;
- // Don't use Process::GetABI, this code gets called from DidAttach, and in
- // that context we haven't
- // set the Target's architecture yet, so the ABI is also potentially
- // incorrect.
+ // Don't use Process::GetABI, this code gets called from DidAttach, and
+ // in that context we haven't set the Target's architecture yet, so the
+ // ABI is also potentially incorrect.
ABISP abi_to_use_sp = ABI::FindPlugin(shared_from_this(), arch_to_use);
for (auto &feature_node : feature_nodes) {
ParseRegisters(feature_node, target_info, this->m_register_info,
@@ -4758,8 +4865,8 @@ void ProcessGDBRemote::ModulesDidLoad(ModuleList &module_list) {
// do anything
Process::ModulesDidLoad(module_list);
- // After loading shared libraries, we can ask our remote GDB server if
- // it needs any symbols.
+ // After loading shared libraries, we can ask our remote GDB server if it
+ // needs any symbols.
m_gdb_comm.ServeSymbolLookups(this);
}
@@ -4817,8 +4924,8 @@ std::string ProcessGDBRemote::HarmonizeThreadIdsForProfileData(
has_used_usec = true;
usec_value.getAsInteger(0, curr_used_usec);
} else {
- // We didn't find what we want, it is probably
- // an older version. Bail out.
+ // We didn't find what we want, it is probably an older version. Bail
+ // out.
profileDataExtractor.SetFilePos(input_file_pos);
}
}
@@ -4840,8 +4947,8 @@ std::string ProcessGDBRemote::HarmonizeThreadIdsForProfileData(
((real_used_usec > 0) || (HasAssignedIndexIDToThread(thread_id)));
if (good_first_time || good_subsequent_time) {
- // We try to avoid doing too many index id reservation,
- // resulting in fast increase of index ids.
+ // We try to avoid doing too many index id reservation, resulting in
+ // fast increase of index ids.
output_stream << name << ":";
int32_t index_id = AssignIndexIDToThread(thread_id);
@@ -4892,7 +4999,7 @@ ParseStructuredDataPacket(llvm::StringRef packet) {
if (!packet.consume_front(s_async_json_packet_prefix)) {
if (log) {
log->Printf(
- "GDBRemoteCommmunicationClientBase::%s() received $J packet "
+ "GDBRemoteCommunicationClientBase::%s() received $J packet "
"but was not a StructuredData packet: packet starts with "
"%s",
__FUNCTION__,
@@ -4901,8 +5008,7 @@ ParseStructuredDataPacket(llvm::StringRef packet) {
return StructuredData::ObjectSP();
}
- // This is an asynchronous JSON packet, destined for a
- // StructuredDataPlugin.
+ // This is an asynchronous JSON packet, destined for a StructuredDataPlugin.
StructuredData::ObjectSP json_sp = StructuredData::ParseJSON(packet);
if (log) {
if (json_sp) {
@@ -5137,8 +5243,9 @@ public:
~CommandObjectProcessGDBRemotePacketMonitor() {}
- bool DoExecute(const char *command, CommandReturnObject &result) override {
- if (command == NULL || command[0] == '\0') {
+ bool DoExecute(llvm::StringRef command,
+ CommandReturnObject &result) override {
+ if (command.empty()) {
result.AppendErrorWithFormat("'%s' takes a command string argument",
m_cmd_name.c_str());
result.SetStatus(eReturnStatusFailed);
@@ -5150,14 +5257,15 @@ public:
if (process) {
StreamString packet;
packet.PutCString("qRcmd,");
- packet.PutBytesAsRawHex8(command, strlen(command));
+ packet.PutBytesAsRawHex8(command.data(), command.size());
bool send_async = true;
StringExtractorGDBRemote response;
- process->GetGDBRemote().SendPacketAndWaitForResponse(
- packet.GetString(), response, send_async);
- result.SetStatus(eReturnStatusSuccessFinishResult);
Stream &output_strm = result.GetOutputStream();
+ process->GetGDBRemote().SendPacketAndReceiveResponseWithOutputSupport(
+ packet.GetString(), response, send_async,
+ [&output_strm](llvm::StringRef output) { output_strm << output; });
+ result.SetStatus(eReturnStatusSuccessFinishResult);
output_strm.Printf(" packet: %s\n", packet.GetData());
const std::string &response_str = response.GetStringRef();
diff --git a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
index 42d1c4ecd666..45bb2d4c28e7 100644
--- a/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
+++ b/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
@@ -144,6 +144,9 @@ public:
size_t DoReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) override;
+ Status
+ WriteObjectFile(std::vector<ObjectFile::LoadableData> entries) override;
+
size_t DoWriteMemory(lldb::addr_t addr, const void *buf, size_t size,
Status &error) override;
@@ -214,8 +217,7 @@ public:
void PrefetchModuleSpecs(llvm::ArrayRef<FileSpec> module_file_specs,
const llvm::Triple &triple) override;
- bool GetHostOSVersion(uint32_t &major, uint32_t &minor,
- uint32_t &update) override;
+ llvm::VersionTuple GetHostOSVersion() override;
size_t LoadModules(LoadedModuleInfoList &module_list) override;
@@ -302,6 +304,11 @@ protected:
int64_t m_breakpoint_pc_offset;
lldb::tid_t m_initial_tid; // The initial thread ID, given by stub on attach
+ bool m_allow_flash_writes;
+ using FlashRangeVector = lldb_private::RangeVector<lldb::addr_t, size_t>;
+ using FlashRange = FlashRangeVector::Entry;
+ FlashRangeVector m_erased_flash_ranges;
+
//----------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------
@@ -408,6 +415,12 @@ protected:
Status UpdateAutomaticSignalFiltering() override;
+ Status FlashErase(lldb::addr_t addr, size_t size);
+
+ Status FlashDone();
+
+ bool HasErased(FlashRange range);
+
private:
//------------------------------------------------------------------
// For ProcessGDBRemote only
diff --git a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
index 27dd03bfc7bc..a525c16b9f13 100644
--- a/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
+++ b/source/Plugins/Process/gdb-remote/ThreadGDBRemote.cpp
@@ -24,7 +24,7 @@
#include "ProcessGDBRemote.h"
#include "ProcessGDBRemoteLog.h"
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
using namespace lldb;
using namespace lldb_private;
@@ -55,7 +55,7 @@ ThreadGDBRemote::~ThreadGDBRemote() {
const char *ThreadGDBRemote::GetName() {
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
@@ -80,10 +80,9 @@ void ThreadGDBRemote::SetQueueInfo(std::string &&queue_name,
const char *ThreadGDBRemote::GetQueueName() {
// If our cached queue info is valid, then someone called
- // ThreadGDBRemote::SetQueueInfo(...)
- // with valid information that was gleaned from the stop reply packet. In this
- // case we trust
- // that the info is valid in m_dispatch_queue_name without refetching it
+ // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned
+ // from the stop reply packet. In this case we trust that the info is valid
+ // in m_dispatch_queue_name without refetching it
if (CachedQueueInfoIsValid()) {
if (m_dispatch_queue_name.empty())
return nullptr;
@@ -110,15 +109,14 @@ const char *ThreadGDBRemote::GetQueueName() {
return m_dispatch_queue_name.c_str();
}
}
- return NULL;
+ return nullptr;
}
QueueKind ThreadGDBRemote::GetQueueKind() {
// If our cached queue info is valid, then someone called
- // ThreadGDBRemote::SetQueueInfo(...)
- // with valid information that was gleaned from the stop reply packet. In this
- // case we trust
- // that the info is valid in m_dispatch_queue_name without refetching it
+ // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned
+ // from the stop reply packet. In this case we trust that the info is valid
+ // in m_dispatch_queue_name without refetching it
if (CachedQueueInfoIsValid()) {
return m_queue_kind;
}
@@ -141,10 +139,9 @@ QueueKind ThreadGDBRemote::GetQueueKind() {
queue_id_t ThreadGDBRemote::GetQueueID() {
// If our cached queue info is valid, then someone called
- // ThreadGDBRemote::SetQueueInfo(...)
- // with valid information that was gleaned from the stop reply packet. In this
- // case we trust
- // that the info is valid in m_dispatch_queue_name without refetching it
+ // ThreadGDBRemote::SetQueueInfo(...) with valid information that was gleaned
+ // from the stop reply packet. In this case we trust that the info is valid
+ // in m_dispatch_queue_name without refetching it
if (CachedQueueInfoIsValid())
return m_queue_serial_number;
@@ -275,11 +272,11 @@ void ThreadGDBRemote::RefreshStateAfterStop() {
// Invalidate all registers in our register context. We don't set "force" to
// true because the stop reply packet might have had some register values
// that were expedited and these will already be copied into the register
- // context by the time this function gets called. The GDBRemoteRegisterContext
- // class has been made smart enough to detect when it needs to invalidate
- // which registers are valid by putting hooks in the register read and
- // register supply functions where they check the process stop ID and do
- // the right thing.
+ // context by the time this function gets called. The
+ // GDBRemoteRegisterContext class has been made smart enough to detect when
+ // it needs to invalidate which registers are valid by putting hooks in the
+ // register read and register supply functions where they check the process
+ // stop ID and do the right thing.
const bool force = false;
GetRegisterContext()->InvalidateIfNeeded(force);
}
@@ -292,8 +289,8 @@ void ThreadGDBRemote::Dump(Log *log, uint32_t index) {}
bool ThreadGDBRemote::ShouldStop(bool &step_more) { return true; }
lldb::RegisterContextSP ThreadGDBRemote::GetRegisterContext() {
- if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp = CreateRegisterContextForFrame(NULL);
+ if (!m_reg_context_sp)
+ m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
return m_reg_context_sp;
}
@@ -310,7 +307,8 @@ ThreadGDBRemote::CreateRegisterContextForFrame(StackFrame *frame) {
if (process_sp) {
ProcessGDBRemote *gdb_process =
static_cast<ProcessGDBRemote *>(process_sp.get());
- // read_all_registers_at_once will be true if 'p' packet is not supported.
+ // read_all_registers_at_once will be true if 'p' packet is not
+ // supported.
bool read_all_registers_at_once =
!gdb_process->GetGDBRemote().GetpPacketSupported(GetID());
reg_ctx_sp.reset(new GDBRemoteRegisterContext(
@@ -319,7 +317,7 @@ ThreadGDBRemote::CreateRegisterContextForFrame(StackFrame *frame) {
}
} else {
Unwind *unwinder = GetUnwinder();
- if (unwinder)
+ if (unwinder != nullptr)
reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
diff --git a/source/Plugins/Process/mach-core/CMakeLists.txt b/source/Plugins/Process/mach-core/CMakeLists.txt
index 18f6ff581ea3..e79cd82c92a6 100644
--- a/source/Plugins/Process/mach-core/CMakeLists.txt
+++ b/source/Plugins/Process/mach-core/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessMachCore PLUGIN
ProcessMachCore.cpp
ThreadMachCore.cpp
diff --git a/source/Plugins/Process/mach-core/ProcessMachCore.cpp b/source/Plugins/Process/mach-core/ProcessMachCore.cpp
index d21651b77ee0..bfa35ed506a9 100644
--- a/source/Plugins/Process/mach-core/ProcessMachCore.cpp
+++ b/source/Plugins/Process/mach-core/ProcessMachCore.cpp
@@ -35,7 +35,7 @@
// Project includes
#include "ProcessMachCore.h"
-#include "StopInfoMachException.h"
+#include "Plugins/Process/Utility/StopInfoMachException.h"
#include "ThreadMachCore.h"
// Needed for the plug-in names for the dynamic loaders.
@@ -91,11 +91,10 @@ bool ProcessMachCore::CanDebug(lldb::TargetSP target_sp,
// For now we are just making sure the file exists for a given module
if (!m_core_module_sp && m_core_file.Exists()) {
- // Don't add the Target's architecture to the ModuleSpec - we may be working
- // with a core file that doesn't have the correct cpusubtype in the header
- // but we should still try to use it -
- // ModuleSpecList::FindMatchingModuleSpec
- // enforces a strict arch mach.
+ // Don't add the Target's architecture to the ModuleSpec - we may be
+ // working with a core file that doesn't have the correct cpusubtype in the
+ // header but we should still try to use it -
+ // 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));
@@ -125,10 +124,10 @@ ProcessMachCore::ProcessMachCore(lldb::TargetSP target_sp,
//----------------------------------------------------------------------
ProcessMachCore::~ProcessMachCore() {
Clear();
- // We need to call finalize on the process before destroying ourselves
- // to make sure all of the broadcaster cleanup goes as planned. If we
- // destruct this class, then Process::~Process() might have problems
- // trying to fully destroy the broadcaster.
+ // We need to call finalize on the process before destroying ourselves to
+ // make sure all of the broadcaster cleanup goes as planned. If we destruct
+ // this class, then Process::~Process() might have problems trying to fully
+ // destroy the broadcaster.
Finalize();
}
@@ -162,11 +161,10 @@ bool ProcessMachCore::GetDynamicLoaderAddress(lldb::addr_t addr) {
// header.magic, header.filetype);
if (header.magic == llvm::MachO::MH_MAGIC ||
header.magic == llvm::MachO::MH_MAGIC_64) {
- // Check MH_EXECUTABLE to see if we can find the mach image
- // that contains the shared library list. The dynamic loader
- // (dyld) is what contains the list for user applications,
- // and the mach kernel contains a global that has the list
- // of kexts to load
+ // Check MH_EXECUTABLE to see if we can find the mach image that contains
+ // the shared library list. The dynamic loader (dyld) is what contains the
+ // list for user applications, and the mach kernel contains a global that
+ // has the list of kexts to load
switch (header.filetype) {
case llvm::MachO::MH_DYLINKER:
// printf("0x%16.16" PRIx64 ": file_type = MH_DYLINKER\n", vaddr);
@@ -272,13 +270,10 @@ Status ProcessMachCore::DoLoadCore() {
} else {
m_core_aranges.Append(range_entry);
}
- // Some core files don't fill in the permissions correctly. If that is the
- // case
- // assume read + execute so clients don't think the memory is not
- // readable,
- // or executable. The memory isn't writable since this plug-in doesn't
- // implement
- // DoWriteMemory.
+ // Some core files don't fill in the permissions correctly. If that is
+ // the case assume read + execute so clients don't think the memory is
+ // not readable, or executable. The memory isn't writable since this
+ // plug-in doesn't implement DoWriteMemory.
uint32_t permissions = section->GetPermissions();
if (permissions == 0)
permissions = lldb::ePermissionsReadable | lldb::ePermissionsExecutable;
@@ -309,8 +304,8 @@ Status ProcessMachCore::DoLoadCore() {
}
// This checks for the presence of an LC_IDENT string in a core file;
- // LC_IDENT is very obsolete and should not be used in new code, but
- // if the load command is present, let's use the contents.
+ // LC_IDENT is very obsolete and should not be used in new code, but if the
+ // load command is present, let's use the contents.
std::string corefile_identifier = core_objfile->GetIdentifierString();
if (found_main_binary_definitively == false
&& corefile_identifier.find("Darwin Kernel") != std::string::npos) {
@@ -319,7 +314,7 @@ Status ProcessMachCore::DoLoadCore() {
if (corefile_identifier.find("UUID=") != std::string::npos) {
size_t p = corefile_identifier.find("UUID=") + strlen("UUID=");
std::string uuid_str = corefile_identifier.substr(p, 36);
- uuid.SetFromCString(uuid_str.c_str());
+ uuid.SetFromStringRef(uuid_str);
}
if (corefile_identifier.find("stext=") != std::string::npos) {
size_t p = corefile_identifier.find("stext=") + strlen("stext=");
@@ -342,16 +337,12 @@ Status ProcessMachCore::DoLoadCore() {
if (found_main_binary_definitively == false
&& (m_dyld_addr == LLDB_INVALID_ADDRESS
|| m_mach_kernel_addr == LLDB_INVALID_ADDRESS)) {
- // We need to locate the main executable in the memory ranges
- // we have in the core file. We need to search for both a user-process dyld
- // binary
+ // We need to locate the main executable in the memory ranges we have in
+ // the core file. We need to search for both a user-process dyld binary
// and a kernel binary in memory; we must look at all the pages in the
- // binary so
- // we don't miss one or the other. Step through all memory segments
- // searching for
- // a kernel binary and for a user process dyld -- we'll decide which to
- // prefer
- // later if both are present.
+ // binary so we don't miss one or the other. Step through all memory
+ // segments searching for a kernel binary and for a user process dyld --
+ // we'll decide which to prefer later if both are present.
const size_t num_core_aranges = m_core_aranges.GetSize();
for (size_t i = 0; i < num_core_aranges; ++i) {
@@ -369,13 +360,10 @@ Status ProcessMachCore::DoLoadCore() {
if (found_main_binary_definitively == false
&& m_mach_kernel_addr != LLDB_INVALID_ADDRESS) {
// In the case of multiple kernel images found in the core file via
- // exhaustive
- // search, we may not pick the correct one. See if the
- // DynamicLoaderDarwinKernel's
- // search heuristics might identify the correct one.
- // Most of the time, I expect the address from SearchForDarwinKernel() will
- // be the
- // same as the address we found via exhaustive search.
+ // exhaustive search, we may not pick the correct one. See if the
+ // DynamicLoaderDarwinKernel's search heuristics might identify the correct
+ // one. Most of the time, I expect the address from SearchForDarwinKernel()
+ // will be the same as the address we found via exhaustive search.
if (GetTarget().GetArchitecture().IsValid() == false &&
m_core_module_sp.get()) {
@@ -383,13 +371,11 @@ Status ProcessMachCore::DoLoadCore() {
}
// SearchForDarwinKernel will end up calling back into this this class in
- // the GetImageInfoAddress
- // method which will give it the m_mach_kernel_addr/m_dyld_addr it already
- // has. Save that aside
- // and set m_mach_kernel_addr/m_dyld_addr to an invalid address temporarily
- // so
- // DynamicLoaderDarwinKernel does a real search for the kernel using its own
- // heuristics.
+ // the GetImageInfoAddress method which will give it the
+ // m_mach_kernel_addr/m_dyld_addr it already has. Save that aside and set
+ // m_mach_kernel_addr/m_dyld_addr to an invalid address temporarily so
+ // DynamicLoaderDarwinKernel does a real search for the kernel using its
+ // own heuristics.
addr_t saved_mach_kernel_addr = m_mach_kernel_addr;
addr_t saved_user_dyld_addr = m_dyld_addr;
@@ -410,8 +396,8 @@ Status ProcessMachCore::DoLoadCore() {
}
}
- // If we found both a user-process dyld and a kernel binary, we need to decide
- // which to prefer.
+ // If we found both a user-process dyld and a kernel binary, we need to
+ // decide which to prefer.
if (GetCorefilePreference() == eKernelCorefile) {
if (m_mach_kernel_addr != LLDB_INVALID_ADDRESS) {
if (log)
@@ -444,18 +430,13 @@ Status ProcessMachCore::DoLoadCore() {
if (m_dyld_plugin_name != DynamicLoaderMacOSXDYLD::GetPluginNameStatic()) {
// For non-user process core files, the permissions on the core file
- // segments are usually
- // meaningless, they may be just "read", because we're dealing with kernel
- // coredumps or
- // early startup coredumps and the dumper is grabbing pages of memory
- // without knowing
- // what they are. If they aren't marked as "exeuctable", that can break the
- // unwinder
- // which will check a pc value to see if it is in an executable segment and
- // stop the
+ // segments are usually meaningless, they may be just "read", because we're
+ // dealing with kernel coredumps or early startup coredumps and the dumper
+ // is grabbing pages of memory without knowing what they are. If they
+ // aren't marked as "exeuctable", that can break the unwinder which will
+ // check a pc value to see if it is in an executable segment and stop the
// backtrace early if it is not ("executable" and "unknown" would both be
- // fine, but
- // "not executable" will break the unwinder).
+ // fine, but "not executable" will break the unwinder).
size_t core_range_infos_size = m_core_range_infos.GetSize();
for (size_t i = 0; i < core_range_infos_size; i++) {
VMRangeToPermissions::Entry *ent =
@@ -464,8 +445,8 @@ Status ProcessMachCore::DoLoadCore() {
}
}
- // Even if the architecture is set in the target, we need to override
- // it to match the core file which is always single arch.
+ // Even if the architecture is set in the target, we need to override it to
+ // match the core file which is always single arch.
ArchSpec arch(m_core_module_sp->GetArchitecture());
if (arch.GetCore() == ArchSpec::eCore_x86_32_i486) {
arch = Platform::GetAugmentedArchSpec(GetTarget().GetPlatform().get(), "i386");
@@ -488,8 +469,7 @@ bool ProcessMachCore::UpdateThreadList(ThreadList &old_thread_list,
ThreadList &new_thread_list) {
if (old_thread_list.GetSize(false) == 0) {
// Make up the thread the first time this is called so we can setup our one
- // and only
- // core thread state.
+ // and only core thread state.
ObjectFile *core_objfile = m_core_module_sp->GetObjectFile();
if (core_objfile) {
@@ -508,8 +488,8 @@ bool ProcessMachCore::UpdateThreadList(ThreadList &old_thread_list,
}
void ProcessMachCore::RefreshStateAfterStop() {
- // Let all threads recover from stopping and do any clean up based
- // on the previous thread state (if any).
+ // Let all threads recover from stopping and do any clean up based on the
+ // previous thread state (if any).
m_thread_list.RefreshStateAfterStop();
// SetThreadStopInfo (m_last_stop_packet);
}
@@ -529,8 +509,8 @@ bool ProcessMachCore::WarnBeforeDetach() const { return false; }
//------------------------------------------------------------------
size_t ProcessMachCore::ReadMemory(addr_t addr, void *buf, size_t size,
Status &error) {
- // Don't allow the caching that lldb_private::Process::ReadMemory does
- // since in core files we have it all cached our our core file anyway.
+ // Don't allow the caching that lldb_private::Process::ReadMemory does since
+ // in core files we have it all cached our our core file anyway.
return DoReadMemory(addr, buf, size, error);
}
@@ -546,19 +526,17 @@ size_t ProcessMachCore::DoReadMemory(addr_t addr, void *buf, size_t size,
// Address Size File off File size
// ---------- ---------- ---------- ----------
// LC_SEGMENT 0x000f6000 0x00001000 0x1d509ee8 0x00001000 --- --- 0
- // 0x00000000 __TEXT
- // LC_SEGMENT 0x0f600000 0x00100000 0x1d50aee8 0x00100000 --- --- 0
- // 0x00000000 __TEXT
- // LC_SEGMENT 0x000f7000 0x00001000 0x1d60aee8 0x00001000 --- --- 0
- // 0x00000000 __TEXT
+ // 0x00000000 __TEXT LC_SEGMENT 0x0f600000 0x00100000 0x1d50aee8 0x00100000
+ // --- --- 0 0x00000000 __TEXT LC_SEGMENT 0x000f7000 0x00001000
+ // 0x1d60aee8 0x00001000 --- --- 0 0x00000000 __TEXT
//
// Any if the user executes the following command:
//
// (lldb) mem read 0xf6ff0
//
- // We would attempt to read 32 bytes from 0xf6ff0 but would only
- // get 16 unless we loop through consecutive memory ranges that are
- // contiguous in the address space, but not in the file data.
+ // We would attempt to read 32 bytes from 0xf6ff0 but would only get 16
+ // unless we loop through consecutive memory ranges that are contiguous in
+ // the address space, but not in the file data.
//----------------------------------------------------------------------
while (bytes_read < size) {
const addr_t curr_addr = addr + bytes_read;
@@ -641,8 +619,8 @@ void ProcessMachCore::Initialize() {
}
addr_t ProcessMachCore::GetImageInfoAddress() {
- // If we found both a user-process dyld and a kernel binary, we need to decide
- // which to prefer.
+ // If we found both a user-process dyld and a kernel binary, we need to
+ // decide which to prefer.
if (GetCorefilePreference() == eKernelCorefile) {
if (m_mach_kernel_addr != LLDB_INVALID_ADDRESS) {
return m_mach_kernel_addr;
diff --git a/source/Plugins/Process/mach-core/ThreadMachCore.cpp b/source/Plugins/Process/mach-core/ThreadMachCore.cpp
index 2b44105c13b1..c262dd47f978 100644
--- a/source/Plugins/Process/mach-core/ThreadMachCore.cpp
+++ b/source/Plugins/Process/mach-core/ThreadMachCore.cpp
@@ -43,7 +43,7 @@ ThreadMachCore::~ThreadMachCore() { DestroyThread(); }
const char *ThreadMachCore::GetName() {
if (m_thread_name.empty())
- return NULL;
+ return nullptr;
return m_thread_name.c_str();
}
@@ -54,8 +54,8 @@ void ThreadMachCore::RefreshStateAfterStop() {
// context by the time this function gets called. The KDPRegisterContext
// class has been made smart enough to detect when it needs to invalidate
// which registers are valid by putting hooks in the register read and
- // register supply functions where they check the process stop ID and do
- // the right thing.
+ // register supply functions where they check the process stop ID and do the
+ // right thing.
const bool force = false;
GetRegisterContext()->InvalidateIfNeeded(force);
}
@@ -63,8 +63,8 @@ void ThreadMachCore::RefreshStateAfterStop() {
bool ThreadMachCore::ThreadIDIsValid(lldb::tid_t thread) { return thread != 0; }
lldb::RegisterContextSP ThreadMachCore::GetRegisterContext() {
- if (m_reg_context_sp.get() == NULL)
- m_reg_context_sp = CreateRegisterContextForFrame(NULL);
+ if (!m_reg_context_sp)
+ m_reg_context_sp = CreateRegisterContextForFrame(nullptr);
return m_reg_context_sp;
}
@@ -89,7 +89,7 @@ ThreadMachCore::CreateRegisterContextForFrame(StackFrame *frame) {
reg_ctx_sp = m_thread_reg_ctx_sp;
} else {
Unwind *unwinder = GetUnwinder();
- if (unwinder)
+ if (unwinder != nullptr)
reg_ctx_sp = unwinder->CreateRegisterContextForFrame(frame);
}
return reg_ctx_sp;
diff --git a/source/Plugins/Process/minidump/CMakeLists.txt b/source/Plugins/Process/minidump/CMakeLists.txt
index 61ce16830c9b..b898ee1aa144 100644
--- a/source/Plugins/Process/minidump/CMakeLists.txt
+++ b/source/Plugins/Process/minidump/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(../Utility)
-
add_lldb_library(lldbPluginProcessMinidump PLUGIN
MinidumpTypes.cpp
MinidumpParser.cpp
diff --git a/source/Plugins/Process/minidump/MinidumpParser.cpp b/source/Plugins/Process/minidump/MinidumpParser.cpp
index 36350fdb6398..9a979335e99e 100644
--- a/source/Plugins/Process/minidump/MinidumpParser.cpp
+++ b/source/Plugins/Process/minidump/MinidumpParser.cpp
@@ -14,10 +14,13 @@
// Other libraries and framework includes
#include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Utility/LLDBAssert.h"
// C includes
// C++ includes
+#include <algorithm>
#include <map>
+#include <vector>
using namespace lldb_private;
using namespace minidump;
@@ -27,47 +30,11 @@ MinidumpParser::Create(const lldb::DataBufferSP &data_buf_sp) {
if (data_buf_sp->GetByteSize() < sizeof(MinidumpHeader)) {
return llvm::None;
}
-
- llvm::ArrayRef<uint8_t> header_data(data_buf_sp->GetBytes(),
- sizeof(MinidumpHeader));
- const MinidumpHeader *header = MinidumpHeader::Parse(header_data);
-
- if (header == nullptr) {
- return llvm::None;
- }
-
- lldb::offset_t directory_list_offset = header->stream_directory_rva;
- // check if there is enough data for the parsing of the directory list
- if ((directory_list_offset +
- sizeof(MinidumpDirectory) * header->streams_count) >
- data_buf_sp->GetByteSize()) {
- return llvm::None;
- }
-
- const MinidumpDirectory *directory = nullptr;
- Status error;
- llvm::ArrayRef<uint8_t> directory_data(
- data_buf_sp->GetBytes() + directory_list_offset,
- sizeof(MinidumpDirectory) * header->streams_count);
- llvm::DenseMap<uint32_t, MinidumpLocationDescriptor> directory_map;
-
- for (uint32_t i = 0; i < header->streams_count; ++i) {
- error = consumeObject(directory_data, directory);
- if (error.Fail()) {
- return llvm::None;
- }
- directory_map[static_cast<const uint32_t>(directory->stream_type)] =
- directory->location;
- }
-
- return MinidumpParser(data_buf_sp, header, std::move(directory_map));
+ return MinidumpParser(data_buf_sp);
}
-MinidumpParser::MinidumpParser(
- const lldb::DataBufferSP &data_buf_sp, const MinidumpHeader *header,
- llvm::DenseMap<uint32_t, MinidumpLocationDescriptor> &&directory_map)
- : m_data_sp(data_buf_sp), m_header(header), m_directory_map(directory_map) {
-}
+MinidumpParser::MinidumpParser(const lldb::DataBufferSP &data_buf_sp)
+ : m_data_sp(data_buf_sp) {}
llvm::ArrayRef<uint8_t> MinidumpParser::GetData() {
return llvm::ArrayRef<uint8_t>(m_data_sp->GetBytes(),
@@ -96,6 +63,31 @@ llvm::Optional<std::string> MinidumpParser::GetMinidumpString(uint32_t rva) {
return parseMinidumpString(arr_ref);
}
+UUID MinidumpParser::GetModuleUUID(const MinidumpModule *module) {
+ auto cv_record =
+ GetData().slice(module->CV_record.rva, module->CV_record.data_size);
+
+ // Read the CV record signature
+ const llvm::support::ulittle32_t *signature = nullptr;
+ Status error = consumeObject(cv_record, signature);
+ if (error.Fail())
+ return UUID();
+
+ const CvSignature cv_signature =
+ static_cast<CvSignature>(static_cast<const uint32_t>(*signature));
+
+ if (cv_signature == CvSignature::Pdb70) {
+ // PDB70 record
+ const CvRecordPdb70 *pdb70_uuid = nullptr;
+ Status error = consumeObject(cv_record, pdb70_uuid);
+ if (!error.Fail())
+ return UUID::fromData(pdb70_uuid, sizeof(*pdb70_uuid));
+ } else if (cv_signature == CvSignature::ElfBuildId)
+ return UUID::fromData(cv_record);
+
+ return UUID();
+}
+
llvm::ArrayRef<MinidumpThread> MinidumpParser::GetThreads() {
llvm::ArrayRef<uint8_t> data = GetStream(MinidumpStreamType::ThreadList);
@@ -115,12 +107,12 @@ MinidumpParser::GetThreadContext(const MinidumpThread &td) {
llvm::ArrayRef<uint8_t>
MinidumpParser::GetThreadContextWow64(const MinidumpThread &td) {
- // On Windows, a 32-bit process can run on a 64-bit machine under
- // WOW64. If the minidump was captured with a 64-bit debugger, then
- // the CONTEXT we just grabbed from the mini_dump_thread is the one
- // for the 64-bit "native" process rather than the 32-bit "guest"
- // process we care about. In this case, we can get the 32-bit CONTEXT
- // from the TEB (Thread Environment Block) of the 64-bit process.
+ // On Windows, a 32-bit process can run on a 64-bit machine under WOW64. If
+ // the minidump was captured with a 64-bit debugger, then the CONTEXT we just
+ // grabbed from the mini_dump_thread is the one for the 64-bit "native"
+ // process rather than the 32-bit "guest" process we care about. In this
+ // case, we can get the 32-bit CONTEXT from the TEB (Thread Environment
+ // Block) of the 64-bit process.
auto teb_mem = GetMemory(td.teb, sizeof(TEB64));
if (teb_mem.empty())
return {};
@@ -130,9 +122,9 @@ MinidumpParser::GetThreadContextWow64(const MinidumpThread &td) {
if (error.Fail())
return {};
- // Slot 1 of the thread-local storage in the 64-bit TEB points to a
- // structure that includes the 32-bit CONTEXT (after a ULONG).
- // See: https://msdn.microsoft.com/en-us/library/ms681670.aspx
+ // Slot 1 of the thread-local storage in the 64-bit TEB points to a structure
+ // that includes the 32-bit CONTEXT (after a ULONG). See:
+ // https://msdn.microsoft.com/en-us/library/ms681670.aspx
auto context =
GetMemory(wow64teb->tls_slots[1] + 4, sizeof(MinidumpContext_x86_32));
if (context.size() < sizeof(MinidumpContext_x86_32))
@@ -334,10 +326,10 @@ MinidumpParser::FindMemoryRange(lldb::addr_t addr) {
}
}
- // Some Minidumps have a Memory64ListStream that captures all the heap
- // memory (full-memory Minidumps). We can't exactly use the same loop as
- // above, because the Minidump uses slightly different data structures to
- // describe those
+ // Some Minidumps have a Memory64ListStream that captures all the heap memory
+ // (full-memory Minidumps). We can't exactly use the same loop as above,
+ // because the Minidump uses slightly different data structures to describe
+ // those
if (!data64.empty()) {
llvm::ArrayRef<MinidumpMemoryDescriptor64> memory64_list;
@@ -377,8 +369,8 @@ llvm::ArrayRef<uint8_t> MinidumpParser::GetMemory(lldb::addr_t addr,
return {};
// There's at least some overlap between the beginning of the desired range
- // (addr) and the current range. Figure out where the overlap begins and
- // how much overlap there is.
+ // (addr) and the current range. Figure out where the overlap begins and how
+ // much overlap there is.
const size_t offset = addr - range->start;
@@ -456,3 +448,109 @@ MinidumpParser::GetMemoryRegionInfo(lldb::addr_t load_addr) {
// appear truncated.
return info;
}
+
+Status MinidumpParser::Initialize() {
+ Status error;
+
+ lldbassert(m_directory_map.empty());
+
+ llvm::ArrayRef<uint8_t> header_data(m_data_sp->GetBytes(),
+ sizeof(MinidumpHeader));
+ const MinidumpHeader *header = MinidumpHeader::Parse(header_data);
+ if (header == nullptr) {
+ error.SetErrorString("invalid minidump: can't parse the header");
+ return error;
+ }
+
+ // A minidump without at least one stream is clearly ill-formed
+ if (header->streams_count == 0) {
+ error.SetErrorString("invalid minidump: no streams present");
+ return error;
+ }
+
+ struct FileRange {
+ uint32_t offset = 0;
+ uint32_t size = 0;
+
+ FileRange(uint32_t offset, uint32_t size) : offset(offset), size(size) {}
+ uint32_t end() const { return offset + size; }
+ };
+
+ const uint32_t file_size = m_data_sp->GetByteSize();
+
+ // Build a global minidump file map, checking for:
+ // - overlapping streams/data structures
+ // - truncation (streams pointing past the end of file)
+ std::vector<FileRange> minidump_map;
+
+ // Add the minidump header to the file map
+ if (sizeof(MinidumpHeader) > file_size) {
+ error.SetErrorString("invalid minidump: truncated header");
+ return error;
+ }
+ minidump_map.emplace_back( 0, sizeof(MinidumpHeader) );
+
+ // Add the directory entries to the file map
+ FileRange directory_range(header->stream_directory_rva,
+ header->streams_count *
+ sizeof(MinidumpDirectory));
+ if (directory_range.end() > file_size) {
+ error.SetErrorString("invalid minidump: truncated streams directory");
+ return error;
+ }
+ minidump_map.push_back(directory_range);
+
+ // Parse stream directory entries
+ llvm::ArrayRef<uint8_t> directory_data(
+ m_data_sp->GetBytes() + directory_range.offset, directory_range.size);
+ for (uint32_t i = 0; i < header->streams_count; ++i) {
+ const MinidumpDirectory *directory_entry = nullptr;
+ error = consumeObject(directory_data, directory_entry);
+ if (error.Fail())
+ return error;
+ if (directory_entry->stream_type == 0) {
+ // Ignore dummy streams (technically ill-formed, but a number of
+ // existing minidumps seem to contain such streams)
+ if (directory_entry->location.data_size == 0)
+ continue;
+ error.SetErrorString("invalid minidump: bad stream type");
+ return error;
+ }
+ // Update the streams map, checking for duplicate stream types
+ if (!m_directory_map
+ .insert({directory_entry->stream_type, directory_entry->location})
+ .second) {
+ error.SetErrorString("invalid minidump: duplicate stream type");
+ return error;
+ }
+ // Ignore the zero-length streams for layout checks
+ if (directory_entry->location.data_size != 0) {
+ minidump_map.emplace_back(directory_entry->location.rva,
+ directory_entry->location.data_size);
+ }
+ }
+
+ // Sort the file map ranges by start offset
+ std::sort(minidump_map.begin(), minidump_map.end(),
+ [](const FileRange &a, const FileRange &b) {
+ return a.offset < b.offset;
+ });
+
+ // Check for overlapping streams/data structures
+ for (size_t i = 1; i < minidump_map.size(); ++i) {
+ const auto &prev_range = minidump_map[i - 1];
+ if (prev_range.end() > minidump_map[i].offset) {
+ error.SetErrorString("invalid minidump: overlapping streams");
+ return error;
+ }
+ }
+
+ // Check for streams past the end of file
+ const auto &last_range = minidump_map.back();
+ if (last_range.end() > file_size) {
+ error.SetErrorString("invalid minidump: truncated stream");
+ return error;
+ }
+
+ return error;
+}
diff --git a/source/Plugins/Process/minidump/MinidumpParser.h b/source/Plugins/Process/minidump/MinidumpParser.h
index b7329ffc0028..49b1eef14de5 100644
--- a/source/Plugins/Process/minidump/MinidumpParser.h
+++ b/source/Plugins/Process/minidump/MinidumpParser.h
@@ -17,6 +17,7 @@
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/Status.h"
+#include "lldb/Utility/UUID.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/DenseMap.h"
@@ -54,6 +55,8 @@ public:
llvm::Optional<std::string> GetMinidumpString(uint32_t rva);
+ UUID GetModuleUUID(const MinidumpModule* module);
+
llvm::ArrayRef<MinidumpThread> GetThreads();
llvm::ArrayRef<uint8_t> GetThreadContext(const MinidumpThread &td);
@@ -86,14 +89,15 @@ public:
llvm::Optional<MemoryRegionInfo> GetMemoryRegionInfo(lldb::addr_t);
+ // Perform consistency checks and initialize internal data structures
+ Status Initialize();
+
+private:
+ MinidumpParser(const lldb::DataBufferSP &data_buf_sp);
+
private:
lldb::DataBufferSP m_data_sp;
- const MinidumpHeader *m_header;
llvm::DenseMap<uint32_t, MinidumpLocationDescriptor> m_directory_map;
-
- MinidumpParser(
- const lldb::DataBufferSP &data_buf_sp, const MinidumpHeader *header,
- llvm::DenseMap<uint32_t, MinidumpLocationDescriptor> &&directory_map);
};
} // end namespace minidump
diff --git a/source/Plugins/Process/minidump/MinidumpTypes.cpp b/source/Plugins/Process/minidump/MinidumpTypes.cpp
index 24ce3f94c094..049704ba80ca 100644
--- a/source/Plugins/Process/minidump/MinidumpTypes.cpp
+++ b/source/Plugins/Process/minidump/MinidumpTypes.cpp
@@ -33,9 +33,6 @@ const MinidumpHeader *MinidumpHeader::Parse(llvm::ArrayRef<uint8_t> &data) {
version != MinidumpHeaderConstants::Version)
return nullptr;
- // TODO check for max number of streams ?
- // TODO more sanity checks ?
-
return header;
}
@@ -44,19 +41,23 @@ llvm::Optional<std::string>
lldb_private::minidump::parseMinidumpString(llvm::ArrayRef<uint8_t> &data) {
std::string result;
- const uint32_t *source_length;
- Status error = consumeObject(data, source_length);
- if (error.Fail() || *source_length > data.size() || *source_length % 2 != 0)
+ const uint32_t *source_length_ptr;
+ Status error = consumeObject(data, source_length_ptr);
+
+ // Copy non-aligned source_length data into aligned memory.
+ uint32_t source_length;
+ std::memcpy(&source_length, source_length_ptr, sizeof(source_length));
+
+ if (error.Fail() || source_length > data.size() || source_length % 2 != 0)
return llvm::None;
auto source_start = reinterpret_cast<const llvm::UTF16 *>(data.data());
- // source_length is the length of the string in bytes
- // we need the length of the string in UTF-16 characters/code points (16 bits
- // per char)
- // that's why it's divided by 2
- const auto source_end = source_start + (*source_length) / 2;
+ // source_length is the length of the string in bytes we need the length of
+ // the string in UTF-16 characters/code points (16 bits per char) that's why
+ // it's divided by 2
+ const auto source_end = source_start + source_length / 2;
// resize to worst case length
- result.resize(UNI_MAX_UTF8_BYTES_PER_CODE_POINT * (*source_length) / 2);
+ result.resize(UNI_MAX_UTF8_BYTES_PER_CODE_POINT * source_length / 2);
auto result_start = reinterpret_cast<llvm::UTF8 *>(&result[0]);
const auto result_end = result_start + result.size();
llvm::ConvertUTF16toUTF8(&source_start, source_end, &result_start, result_end,
@@ -80,11 +81,17 @@ const MinidumpThread *MinidumpThread::Parse(llvm::ArrayRef<uint8_t> &data) {
llvm::ArrayRef<MinidumpThread>
MinidumpThread::ParseThreadList(llvm::ArrayRef<uint8_t> &data) {
+ const auto orig_size = data.size();
const llvm::support::ulittle32_t *thread_count;
Status error = consumeObject(data, thread_count);
if (error.Fail() || *thread_count * sizeof(MinidumpThread) > data.size())
return {};
+ // Compilers might end up padding an extra 4 bytes depending on how the
+ // structure is padded by the compiler and the #pragma pack settings.
+ if (4 + *thread_count * sizeof(MinidumpThread) < orig_size)
+ data = data.drop_front(4);
+
return llvm::ArrayRef<MinidumpThread>(
reinterpret_cast<const MinidumpThread *>(data.data()), *thread_count);
}
@@ -156,12 +163,17 @@ const MinidumpModule *MinidumpModule::Parse(llvm::ArrayRef<uint8_t> &data) {
llvm::ArrayRef<MinidumpModule>
MinidumpModule::ParseModuleList(llvm::ArrayRef<uint8_t> &data) {
-
+ const auto orig_size = data.size();
const llvm::support::ulittle32_t *modules_count;
Status error = consumeObject(data, modules_count);
if (error.Fail() || *modules_count * sizeof(MinidumpModule) > data.size())
return {};
-
+
+ // Compilers might end up padding an extra 4 bytes depending on how the
+ // structure is padded by the compiler and the #pragma pack settings.
+ if (4 + *modules_count * sizeof(MinidumpModule) < orig_size)
+ data = data.drop_front(4);
+
return llvm::ArrayRef<MinidumpModule>(
reinterpret_cast<const MinidumpModule *>(data.data()), *modules_count);
}
@@ -179,11 +191,17 @@ MinidumpExceptionStream::Parse(llvm::ArrayRef<uint8_t> &data) {
llvm::ArrayRef<MinidumpMemoryDescriptor>
MinidumpMemoryDescriptor::ParseMemoryList(llvm::ArrayRef<uint8_t> &data) {
+ const auto orig_size = data.size();
const llvm::support::ulittle32_t *mem_ranges_count;
Status error = consumeObject(data, mem_ranges_count);
if (error.Fail() ||
*mem_ranges_count * sizeof(MinidumpMemoryDescriptor) > data.size())
return {};
+
+ // Compilers might end up padding an extra 4 bytes depending on how the
+ // structure is padded by the compiler and the #pragma pack settings.
+ if (4 + *mem_ranges_count * sizeof(MinidumpMemoryDescriptor) < orig_size)
+ data = data.drop_front(4);
return llvm::makeArrayRef(
reinterpret_cast<const MinidumpMemoryDescriptor *>(data.data()),
diff --git a/source/Plugins/Process/minidump/MinidumpTypes.h b/source/Plugins/Process/minidump/MinidumpTypes.h
index 6de4f55a769d..e83089865b9e 100644
--- a/source/Plugins/Process/minidump/MinidumpTypes.h
+++ b/source/Plugins/Process/minidump/MinidumpTypes.h
@@ -43,6 +43,21 @@ enum class MinidumpHeaderConstants : uint32_t {
};
+enum class CvSignature : uint32_t {
+ Pdb70 = 0x53445352, // RSDS
+ ElfBuildId = 0x4270454c, // BpEL (Breakpad/Crashpad minidumps)
+};
+
+// Reference:
+// https://crashpad.chromium.org/doxygen/structcrashpad_1_1CodeViewRecordPDB70.html
+struct CvRecordPdb70 {
+ uint8_t Uuid[16];
+ llvm::support::ulittle32_t Age;
+ // char PDBFileName[];
+};
+static_assert(sizeof(CvRecordPdb70) == 20,
+ "sizeof CvRecordPdb70 is not correct!");
+
// Reference:
// https://msdn.microsoft.com/en-us/library/windows/desktop/ms680394.aspx
enum class MinidumpStreamType : uint32_t {
diff --git a/source/Plugins/Process/minidump/ProcessMinidump.cpp b/source/Plugins/Process/minidump/ProcessMinidump.cpp
index d4d65c044eab..b43f22382eac 100644
--- a/source/Plugins/Process/minidump/ProcessMinidump.cpp
+++ b/source/Plugins/Process/minidump/ProcessMinidump.cpp
@@ -19,6 +19,7 @@
#include "lldb/Core/State.h"
#include "lldb/Target/DynamicLoader.h"
#include "lldb/Target/MemoryRegionInfo.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/UnixSignals.h"
#include "lldb/Utility/DataBufferLLVM.h"
@@ -31,9 +32,56 @@
// C includes
// C++ includes
+using namespace lldb;
using namespace lldb_private;
using namespace minidump;
+//------------------------------------------------------------------
+/// A placeholder module used for minidumps, where the original
+/// object files may not be available (so we can't parse the object
+/// files to extract the set of sections/segments)
+///
+/// This placeholder module has a single synthetic section (.module_image)
+/// which represents the module memory range covering the whole module.
+//------------------------------------------------------------------
+class PlaceholderModule : public Module {
+public:
+ PlaceholderModule(const ModuleSpec &module_spec) :
+ Module(module_spec.GetFileSpec(), module_spec.GetArchitecture()) {
+ if (module_spec.GetUUID().IsValid())
+ SetUUID(module_spec.GetUUID());
+ }
+
+ // Creates a synthetic module section covering the whole module image (and
+ // sets the section load address as well)
+ void CreateImageSection(const MinidumpModule *module, Target& target) {
+ const ConstString section_name(".module_image");
+ lldb::SectionSP section_sp(new Section(
+ shared_from_this(), // Module to which this section belongs.
+ nullptr, // ObjectFile
+ 0, // Section ID.
+ section_name, // Section name.
+ eSectionTypeContainer, // Section type.
+ module->base_of_image, // VM address.
+ module->size_of_image, // VM size in bytes of this section.
+ 0, // Offset of this section in the file.
+ module->size_of_image, // Size of the section as found in the file.
+ 12, // Alignment of the section (log2)
+ 0, // Flags for this section.
+ 1)); // Number of host bytes per target byte
+ section_sp->SetPermissions(ePermissionsExecutable | ePermissionsReadable);
+ GetSectionList()->AddSection(section_sp);
+ target.GetSectionLoadList().SetSectionLoadAddress(
+ section_sp, module->base_of_image);
+ }
+
+ ObjectFile *GetObjectFile() override { return nullptr; }
+
+ SectionList *GetSectionList() override {
+ return Module::GetUnifiedSectionList();
+ }
+};
+
ConstString ProcessMinidump::GetPluginNameStatic() {
static ConstString g_name("minidump");
return g_name;
@@ -57,7 +105,7 @@ lldb::ProcessSP ProcessMinidump::CreateInstance(lldb::TargetSP target_sp,
if (!DataPtr)
return nullptr;
- assert(DataPtr->GetByteSize() == header_size);
+ lldbassert(DataPtr->GetByteSize() == header_size);
// first, only try to parse the header, beacuse we need to be fast
llvm::ArrayRef<uint8_t> HeaderBytes = DataPtr->GetData();
@@ -92,10 +140,10 @@ ProcessMinidump::ProcessMinidump(lldb::TargetSP target_sp,
ProcessMinidump::~ProcessMinidump() {
Clear();
- // We need to call finalize on the process before destroying ourselves
- // to make sure all of the broadcaster cleanup goes as planned. If we
- // destruct this class, then Process::~Process() might have problems
- // trying to fully destroy the broadcaster.
+ // We need to call finalize on the process before destroying ourselves to
+ // make sure all of the broadcaster cleanup goes as planned. If we destruct
+ // this class, then Process::~Process() might have problems trying to fully
+ // destroy the broadcaster.
Finalize();
}
@@ -116,10 +164,29 @@ void ProcessMinidump::Terminate() {
Status ProcessMinidump::DoLoadCore() {
Status error;
+ // Minidump parser initialization & consistency checks
+ error = m_minidump_parser.Initialize();
+ if (error.Fail())
+ return error;
+
+ // Do we support the minidump's architecture?
+ ArchSpec arch = GetArchitecture();
+ switch (arch.GetMachine()) {
+ case llvm::Triple::x86:
+ case llvm::Triple::x86_64:
+ // supported
+ break;
+
+ default:
+ error.SetErrorStringWithFormat("unsupported minidump architecture: %s",
+ arch.GetArchitectureName());
+ return error;
+ }
+
m_thread_list = m_minidump_parser.GetThreads();
m_active_exception = m_minidump_parser.GetExceptionStream();
ReadModuleList();
- GetTarget().SetArchitecture(GetArchitecture());
+ GetTarget().SetArchitecture(arch);
llvm::Optional<lldb::pid_t> pid = m_minidump_parser.GetPid();
if (!pid) {
@@ -185,8 +252,8 @@ bool ProcessMinidump::WarnBeforeDetach() const { return false; }
size_t ProcessMinidump::ReadMemory(lldb::addr_t addr, void *buf, size_t size,
Status &error) {
- // Don't allow the caching that lldb_private::Process::ReadMemory does
- // since we have it all cached in our dump file anyway.
+ // Don't allow the caching that lldb_private::Process::ReadMemory does since
+ // we have it all cached in our dump file anyway.
return DoReadMemory(addr, buf, size, error);
}
@@ -276,12 +343,25 @@ void ProcessMinidump::ReadModuleList() {
m_is_wow64 = true;
}
- const auto file_spec = FileSpec(name.getValue(), true);
- ModuleSpec module_spec = file_spec;
+ const auto uuid = m_minidump_parser.GetModuleUUID(module);
+ const auto file_spec =
+ FileSpec(name.getValue(), true, GetArchitecture().GetTriple());
+ ModuleSpec module_spec(file_spec, uuid);
Status error;
lldb::ModuleSP module_sp = GetTarget().GetSharedModule(module_spec, &error);
if (!module_sp || error.Fail()) {
- continue;
+ // We failed to locate a matching local object file. Fortunately, the
+ // minidump format encodes enough information about each module's memory
+ // range to allow us to create placeholder modules.
+ //
+ // This enables most LLDB functionality involving address-to-module
+ // translations (ex. identifing the module for a stack frame PC) and
+ // modules/sections commands (ex. target modules list, ...)
+ auto placeholder_module =
+ std::make_shared<PlaceholderModule>(module_spec);
+ placeholder_module->CreateImageSection(module, GetTarget());
+ module_sp = placeholder_module;
+ GetTarget().GetImages().Append(module_sp);
}
if (log) {
diff --git a/source/Plugins/Process/minidump/ProcessMinidump.h b/source/Plugins/Process/minidump/ProcessMinidump.h
index 4b91d1ba396a..d65ada9009a7 100644
--- a/source/Plugins/Process/minidump/ProcessMinidump.h
+++ b/source/Plugins/Process/minidump/ProcessMinidump.h
@@ -61,6 +61,8 @@ public:
uint32_t GetPluginVersion() override;
+ SystemRuntime *GetSystemRuntime() override { return nullptr; }
+
Status DoDestroy() override;
void RefreshStateAfterStop() override;
diff --git a/source/Plugins/ScriptInterpreter/CMakeLists.txt b/source/Plugins/ScriptInterpreter/CMakeLists.txt
index dc2a27d95a31..5d8642eb07e6 100644
--- a/source/Plugins/ScriptInterpreter/CMakeLists.txt
+++ b/source/Plugins/ScriptInterpreter/CMakeLists.txt
@@ -1,2 +1,4 @@
add_subdirectory(None)
-add_subdirectory(Python)
+if (NOT LLDB_DISABLE_PYTHON)
+ add_subdirectory(Python)
+endif()
diff --git a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
index 9ec9f4344613..4bd4c6a029a0 100644
--- a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
+++ b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
@@ -27,7 +27,7 @@ ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter)
ScriptInterpreterNone::~ScriptInterpreterNone() {}
-bool ScriptInterpreterNone::ExecuteOneLine(const char *command,
+bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command,
CommandReturnObject *,
const ExecuteScriptOptions &) {
m_interpreter.GetDebugger().GetErrorFile()->PutCString(
diff --git a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
index d66b2f07310c..824579472b5e 100644
--- a/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
+++ b/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
@@ -25,7 +25,7 @@ public:
~ScriptInterpreterNone() override;
bool ExecuteOneLine(
- const char *command, CommandReturnObject *result,
+ llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
void ExecuteInterpreterLoop() override;
diff --git a/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt b/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
index c337fc7b5874..56eacc941d64 100644
--- a/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
+++ b/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt
@@ -1,3 +1,16 @@
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Windows")
+ # Call a python script to gather the arch-specific libdir for
+ # modules like the lldb module.
+ execute_process(
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../../../../scripts/get_relative_lib_dir.py
+ RESULT_VARIABLE get_libdir_status
+ OUTPUT_VARIABLE relative_libdir
+ )
+ if (get_libdir_status EQUAL 0)
+ add_definitions(-DLLDB_PYTHON_RELATIVE_LIBDIR="${relative_libdir}")
+ endif()
+endif()
+
add_lldb_library(lldbPluginScriptInterpreterPython PLUGIN
PythonDataObjects.cpp
PythonExceptionState.cpp
diff --git a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
index 966bdff3ad95..90d8ab97fb73 100644
--- a/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
+++ b/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
@@ -1,5 +1,4 @@
-//===-- PythonDataObjects.cpp ------------------------------------*- C++
-//-*-===//
+//===-- PythonDataObjects.cpp -----------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -123,21 +122,20 @@ PythonObject::ResolveNameWithDictionary(llvm::StringRef name,
}
PythonObject PythonObject::ResolveName(llvm::StringRef name) const {
- // Resolve the name in the context of the specified object. If,
- // for example, `this` refers to a PyModule, then this will look for
- // `name` in this module. If `this` refers to a PyType, then it will
- // resolve `name` as an attribute of that type. If `this` refers to
- // an instance of an object, then it will resolve `name` as the value
- // of the specified field.
+ // Resolve the name in the context of the specified object. If, for example,
+ // `this` refers to a PyModule, then this will look for `name` in this
+ // module. If `this` refers to a PyType, then it will resolve `name` as an
+ // attribute of that type. If `this` refers to an instance of an object,
+ // then it will resolve `name` as the value of the specified field.
//
// This function handles dotted names so that, for example, if `m_py_obj`
- // refers to the `sys` module, and `name` == "path.append", then it
- // will find the function `sys.path.append`.
+ // refers to the `sys` module, and `name` == "path.append", then it will find
+ // the function `sys.path.append`.
size_t dot_pos = name.find_first_of('.');
if (dot_pos == llvm::StringRef::npos) {
- // No dots in the name, we should be able to find the value immediately
- // as an attribute of `m_py_obj`.
+ // No dots in the name, we should be able to find the value immediately as
+ // an attribute of `m_py_obj`.
return GetAttributeValue(name);
}
@@ -230,8 +228,8 @@ bool PythonBytes::Check(PyObject *py_obj) {
}
void PythonBytes::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonBytes::Check(py_obj)) {
@@ -240,8 +238,7 @@ void PythonBytes::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -303,8 +300,8 @@ bool PythonByteArray::Check(PyObject *py_obj) {
}
void PythonByteArray::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonByteArray::Check(py_obj)) {
@@ -313,8 +310,7 @@ void PythonByteArray::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -378,8 +374,8 @@ bool PythonString::Check(PyObject *py_obj) {
}
void PythonString::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonString::Check(py_obj)) {
@@ -394,8 +390,7 @@ void PythonString::Reset(PyRefType type, PyObject *py_obj) {
result.Reset(PyRefType::Owned, PyUnicode_AsUTF8String(result.get()));
#endif
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -404,14 +399,16 @@ llvm::StringRef PythonString::GetString() const {
return llvm::StringRef();
Py_ssize_t size;
- char *c;
+ const char *data;
#if PY_MAJOR_VERSION >= 3
- c = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
+ data = PyUnicode_AsUTF8AndSize(m_py_obj, &size);
#else
+ char *c;
PyString_AsStringAndSize(m_py_obj, &c, &size);
+ data = c;
#endif
- return llvm::StringRef(c, size);
+ return llvm::StringRef(data, size);
}
size_t PythonString::GetSize() const {
@@ -466,8 +463,8 @@ bool PythonInteger::Check(PyObject *py_obj) {
return false;
#if PY_MAJOR_VERSION >= 3
- // Python 3 does not have PyInt_Check. There is only one type of
- // integral value, long.
+ // Python 3 does not have PyInt_Check. There is only one type of integral
+ // value, long.
return PyLong_Check(py_obj);
#else
return PyLong_Check(py_obj) || PyInt_Check(py_obj);
@@ -475,8 +472,8 @@ bool PythonInteger::Check(PyObject *py_obj) {
}
void PythonInteger::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonInteger::Check(py_obj)) {
@@ -485,13 +482,13 @@ void PythonInteger::Reset(PyRefType type, PyObject *py_obj) {
}
#if PY_MAJOR_VERSION < 3
- // Always store this as a PyLong, which makes interoperability between
- // Python 2.x and Python 3.x easier. This is only necessary in 2.x,
- // since 3.x doesn't even have a PyInt.
+ // Always store this as a PyLong, which makes interoperability between Python
+ // 2.x and Python 3.x easier. This is only necessary in 2.x, since 3.x
+ // doesn't even have a PyInt.
if (PyInt_Check(py_obj)) {
// Since we converted the original object to a different type, the new
- // object is an owned object regardless of the ownership semantics requested
- // by the user.
+ // object is an owned object regardless of the ownership semantics
+ // requested by the user.
result.Reset(PyRefType::Owned, PyLong_FromLongLong(PyInt_AsLong(py_obj)));
}
#endif
@@ -500,8 +497,7 @@ void PythonInteger::Reset(PyRefType type, PyObject *py_obj) {
"Couldn't get a PyLong from this PyObject");
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -513,10 +509,9 @@ int64_t PythonInteger::GetInteger() const {
int overflow = 0;
int64_t result = PyLong_AsLongLongAndOverflow(m_py_obj, &overflow);
if (overflow != 0) {
- // We got an integer that overflows, like 18446744072853913392L
- // we can't use PyLong_AsLongLong() as it will return
- // 0xffffffffffffffff. If we use the unsigned long long
- // it will work as expected.
+ // We got an integer that overflows, like 18446744072853913392L we can't
+ // use PyLong_AsLongLong() as it will return 0xffffffffffffffff. If we
+ // use the unsigned long long it will work as expected.
const uint64_t uval = PyLong_AsUnsignedLongLong(m_py_obj);
result = static_cast<int64_t>(uval);
}
@@ -563,8 +558,8 @@ bool PythonList::Check(PyObject *py_obj) {
}
void PythonList::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonList::Check(py_obj)) {
@@ -573,8 +568,7 @@ void PythonList::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -668,8 +662,8 @@ bool PythonTuple::Check(PyObject *py_obj) {
}
void PythonTuple::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonTuple::Check(py_obj)) {
@@ -678,8 +672,7 @@ void PythonTuple::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -741,8 +734,8 @@ bool PythonDictionary::Check(PyObject *py_obj) {
}
void PythonDictionary::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonDictionary::Check(py_obj)) {
@@ -751,8 +744,7 @@ void PythonDictionary::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -833,8 +825,8 @@ bool PythonModule::Check(PyObject *py_obj) {
}
void PythonModule::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonModule::Check(py_obj)) {
@@ -843,8 +835,7 @@ void PythonModule::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -871,8 +862,8 @@ bool PythonCallable::Check(PyObject *py_obj) {
}
void PythonCallable::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonCallable::Check(py_obj)) {
@@ -881,8 +872,7 @@ void PythonCallable::Reset(PyRefType type, PyObject *py_obj) {
}
// Calling PythonObject::Reset(const PythonObject&) will lead to stack
- // overflow since it calls
- // back into the virtual implementation.
+ // overflow since it calls back into the virtual implementation.
PythonObject::Reset(PyRefType::Borrowed, result.get());
}
@@ -963,9 +953,9 @@ bool PythonFile::Check(PyObject *py_obj) {
#else
// In Python 3, there is no `PyFile_Check`, and in fact PyFile is not even a
// first-class object type anymore. `PyFile_FromFd` is just a thin wrapper
- // over `io.open()`, which returns some object derived from `io.IOBase`.
- // As a result, the only way to detect a file in Python 3 is to check whether
- // it inherits from `io.IOBase`. Since it is possible for non-files to also
+ // over `io.open()`, which returns some object derived from `io.IOBase`. As a
+ // result, the only way to detect a file in Python 3 is to check whether it
+ // inherits from `io.IOBase`. Since it is possible for non-files to also
// inherit from `io.IOBase`, we additionally verify that it has the `fileno`
// attribute, which should guarantee that it is backed by the file system.
PythonObject io_module(PyRefType::Owned, PyImport_ImportModule("io"));
@@ -985,8 +975,8 @@ bool PythonFile::Check(PyObject *py_obj) {
}
void PythonFile::Reset(PyRefType type, PyObject *py_obj) {
- // Grab the desired reference type so that if we end up rejecting
- // `py_obj` it still gets decremented if necessary.
+ // Grab the desired reference type so that if we end up rejecting `py_obj` it
+ // still gets decremented if necessary.
PythonObject result(type, py_obj);
if (!PythonFile::Check(py_obj)) {
diff --git a/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp b/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
index 4d956d5dbe14..d28a8033820a 100644
--- a/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
+++ b/source/Plugins/ScriptInterpreter/Python/PythonExceptionState.cpp
@@ -30,9 +30,9 @@ PythonExceptionState::~PythonExceptionState() {
}
void PythonExceptionState::Acquire(bool restore_on_exit) {
- // If a state is already acquired, the user needs to decide whether they
- // want to discard or restore it. Don't allow the potential silent
- // loss of a valid state.
+ // If a state is already acquired, the user needs to decide whether they want
+ // to discard or restore it. Don't allow the potential silent loss of a
+ // valid state.
assert(!IsError());
if (!HasErrorOccurred())
@@ -45,8 +45,7 @@ void PythonExceptionState::Acquire(bool restore_on_exit) {
// PyErr_Fetch clears the error flag.
assert(!HasErrorOccurred());
- // Ownership of the objects returned by `PyErr_Fetch` is transferred
- // to us.
+ // Ownership of the objects returned by `PyErr_Fetch` is transferred to us.
m_type.Reset(PyRefType::Owned, py_type);
m_value.Reset(PyRefType::Owned, py_value);
m_traceback.Reset(PyRefType::Owned, py_traceback);
@@ -56,14 +55,14 @@ void PythonExceptionState::Acquire(bool restore_on_exit) {
void PythonExceptionState::Restore() {
if (m_type.IsValid()) {
// The documentation for PyErr_Restore says "Do not pass a null type and
- // non-null value or traceback. So only restore if type was non-null
- // to begin with. In this case we're passing ownership back to Python
- // so release them all.
+ // non-null value or traceback. So only restore if type was non-null to
+ // begin with. In this case we're passing ownership back to Python so
+ // release them all.
PyErr_Restore(m_type.release(), m_value.release(), m_traceback.release());
}
- // After we restore, we should not hold onto the exception state. Demand that
- // it be re-acquired.
+ // After we restore, we should not hold onto the exception state. Demand
+ // that it be re-acquired.
Discard();
}
@@ -100,10 +99,10 @@ std::string PythonExceptionState::Format() const {
if (!IsError())
return std::string();
- // It's possible that ReadPythonBacktrace generated another exception.
- // If this happens we have to clear the exception, because otherwise
- // PyObject_Str() will assert below. That's why we needed to do the
- // save / restore at the beginning of this function.
+ // It's possible that ReadPythonBacktrace generated another exception. If
+ // this happens we have to clear the exception, because otherwise
+ // PyObject_Str() will assert below. That's why we needed to do the save /
+ // restore at the beginning of this function.
PythonExceptionState bt_error_state(false);
std::string error_string;
@@ -114,8 +113,8 @@ std::string PythonExceptionState::Format() const {
// If we were able to read the backtrace, just append it.
error_stream << backtrace << "\n";
} else {
- // Otherwise, append some information about why we were unable to
- // obtain the backtrace.
+ // Otherwise, append some information about why we were unable to obtain
+ // the backtrace.
PythonString bt_error = bt_error_state.GetValue().Str();
error_stream << "An error occurred while retrieving the backtrace: "
<< bt_error.GetString() << "\n";
diff --git a/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 6c39690268c6..b8eb36a2baf6 100644
--- a/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -112,13 +112,12 @@ static bool g_initialized = false;
namespace {
-// Initializing Python is not a straightforward process. We cannot control what
-// external code may have done before getting to this point in LLDB, including
-// potentially having already initialized Python, so we need to do a lot of work
-// to ensure that the existing state of the system is maintained across our
-// initialization. We do this by using an RAII pattern where we save off
-// initial
-// state at the beginning, and restore it at the end
+// Initializing Python is not a straightforward process. We cannot control
+// what external code may have done before getting to this point in LLDB,
+// including potentially having already initialized Python, so we need to do a
+// lot of work to ensure that the existing state of the system is maintained
+// across our initialization. We do this by using an RAII pattern where we
+// save off initial state at the beginning, and restore it at the end
struct InitializePythonRAII {
public:
InitializePythonRAII()
@@ -210,12 +209,11 @@ bool ScriptInterpreterPython::Locker::DoAcquireLock() {
LLDB_LOGV(log, "Ensured PyGILState. Previous state = {0}locked",
m_GILState == PyGILState_UNLOCKED ? "un" : "");
- // we need to save the thread state when we first start the command
- // because we might decide to interrupt it while some action is taking
- // place outside of Python (e.g. printing to screen, waiting for the network,
- // ...)
- // in that case, _PyThreadState_Current will be NULL - and we would be unable
- // to set the asynchronous exception - not a desirable situation
+ // we need to save the thread state when we first start the command because
+ // we might decide to interrupt it while some action is taking place outside
+ // of Python (e.g. printing to screen, waiting for the network, ...) in that
+ // case, _PyThreadState_Current will be NULL - and we would be unable to set
+ // the asynchronous exception - not a desirable situation
m_python_interpreter->SetThreadState(PyThreadState_Get());
m_python_interpreter->IncrementLockCount();
return true;
@@ -281,17 +279,16 @@ ScriptInterpreterPython::ScriptInterpreterPython(
PyRun_SimpleString(run_string.GetData());
// Reloading modules requires a different syntax in Python 2 and Python 3.
- // This provides
- // a consistent syntax no matter what version of Python.
+ // This provides a consistent syntax no matter what version of Python.
run_string.Clear();
run_string.Printf("run_one_line (%s, 'from six.moves import reload_module')",
m_dictionary_name.c_str());
PyRun_SimpleString(run_string.GetData());
// WARNING: temporary code that loads Cocoa formatters - this should be done
- // on a per-platform basis rather than loading the whole set
- // and letting the individual formatter classes exploit APIs to check whether
- // they can/cannot do their task
+ // on a per-platform basis rather than loading the whole set and letting the
+ // individual formatter classes exploit APIs to check whether they can/cannot
+ // do their task
run_string.Clear();
run_string.Printf(
"run_one_line (%s, 'import lldb.formatters, lldb.formatters.cpp, pydoc')",
@@ -314,13 +311,11 @@ ScriptInterpreterPython::ScriptInterpreterPython(
}
ScriptInterpreterPython::~ScriptInterpreterPython() {
- // the session dictionary may hold objects with complex state
- // which means that they may need to be torn down with some level of smarts
- // and that, in turn, requires a valid thread state
- // force Python to procure itself such a thread state, nuke the session
- // dictionary
- // and then release it for others to use and proceed with the rest of the
- // shutdown
+ // the session dictionary may hold objects with complex state which means
+ // that they may need to be torn down with some level of smarts and that, in
+ // turn, requires a valid thread state force Python to procure itself such a
+ // thread state, nuke the session dictionary and then release it for others
+ // to use and proceed with the rest of the shutdown
auto gil_state = PyGILState_Ensure();
m_session_dict.Reset();
PyGILState_Release(gil_state);
@@ -352,6 +347,71 @@ const char *ScriptInterpreterPython::GetPluginDescriptionStatic() {
return "Embedded Python interpreter";
}
+void ScriptInterpreterPython::ComputePythonDirForApple(
+ llvm::SmallVectorImpl<char> &path) {
+ auto style = llvm::sys::path::Style::posix;
+
+ llvm::StringRef path_ref(path.begin(), path.size());
+ auto rbegin = llvm::sys::path::rbegin(path_ref, style);
+ auto rend = llvm::sys::path::rend(path_ref);
+ auto framework = std::find(rbegin, rend, "LLDB.framework");
+ if (framework == rend) {
+ ComputePythonDirForPosix(path);
+ return;
+ }
+ path.resize(framework - rend);
+ llvm::sys::path::append(path, style, "LLDB.framework", "Resources", "Python");
+}
+
+void ScriptInterpreterPython::ComputePythonDirForPosix(
+ llvm::SmallVectorImpl<char> &path) {
+ auto style = llvm::sys::path::Style::posix;
+#if defined(LLDB_PYTHON_RELATIVE_LIBDIR)
+ // Build the path by backing out of the lib dir, then building with whatever
+ // the real python interpreter uses. (e.g. lib for most, lib64 on RHEL
+ // x86_64).
+ llvm::sys::path::remove_filename(path, style);
+ llvm::sys::path::append(path, style, LLDB_PYTHON_RELATIVE_LIBDIR);
+#else
+ llvm::sys::path::append(path, style,
+ "python" + llvm::Twine(PY_MAJOR_VERSION) + "." +
+ llvm::Twine(PY_MINOR_VERSION),
+ "site-packages");
+#endif
+}
+
+void ScriptInterpreterPython::ComputePythonDirForWindows(
+ llvm::SmallVectorImpl<char> &path) {
+ auto style = llvm::sys::path::Style::windows;
+ llvm::sys::path::remove_filename(path, style);
+ llvm::sys::path::append(path, style, "lib", "site-packages");
+
+ // This will be injected directly through FileSpec.GetDirectory().SetString(),
+ // so we need to normalize manually.
+ std::replace(path.begin(), path.end(), '\\', '/');
+}
+
+FileSpec ScriptInterpreterPython::GetPythonDir() {
+ static FileSpec g_spec = []() {
+ FileSpec spec = HostInfo::GetShlibDir();
+ if (!spec)
+ return FileSpec();
+ llvm::SmallString<64> path;
+ spec.GetPath(path);
+
+#if defined(__APPLE__)
+ ComputePythonDirForApple(path);
+#elif defined(_WIN32)
+ ComputePythonDirForWindows(path);
+#else
+ ComputePythonDirForPosix(path);
+#endif
+ spec.GetDirectory().SetString(path);
+ return spec;
+ }();
+ return g_spec;
+}
+
lldb_private::ConstString ScriptInterpreterPython::GetPluginName() {
return GetPluginNameStatic();
}
@@ -452,16 +512,16 @@ void ScriptInterpreterPython::ResetOutputFileHandle(FILE *fh) {}
void ScriptInterpreterPython::SaveTerminalState(int fd) {
// Python mucks with the terminal state of STDIN. If we can possibly avoid
// this by setting the file handles up correctly prior to entering the
- // interpreter we should. For now we save and restore the terminal state
- // on the input file handle.
+ // interpreter we should. For now we save and restore the terminal state on
+ // the input file handle.
m_terminal_state.Save(fd, false);
}
void ScriptInterpreterPython::RestoreTerminalState() {
// Python mucks with the terminal state of STDIN. If we can possibly avoid
// this by setting the file handles up correctly prior to entering the
- // interpreter we should. For now we save and restore the terminal state
- // on the input file handle.
+ // interpreter we should. For now we save and restore the terminal state on
+ // the input file handle.
m_terminal_state.Restore();
}
@@ -470,14 +530,11 @@ void ScriptInterpreterPython::LeaveSession() {
if (log)
log->PutCString("ScriptInterpreterPython::LeaveSession()");
- // checking that we have a valid thread state - since we use our own threading
- // and locking
- // in some (rare) cases during cleanup Python may end up believing we have no
- // thread state
- // and PyImport_AddModule will crash if that is the case - since that seems to
- // only happen
- // when destroying the SBDebugger, we can make do without clearing up stdout
- // and stderr
+ // checking that we have a valid thread state - since we use our own
+ // threading and locking in some (rare) cases during cleanup Python may end
+ // up believing we have no thread state and PyImport_AddModule will crash if
+ // that is the case - since that seems to only happen when destroying the
+ // SBDebugger, we can make do without clearing up stdout and stderr
// rdar://problem/11292882
// When the current thread state is NULL, PyThreadState_Get() issues a fatal
@@ -526,8 +583,7 @@ bool ScriptInterpreterPython::SetStdHandle(File &file, const char *py_name,
bool ScriptInterpreterPython::EnterSession(uint16_t on_entry_flags, FILE *in,
FILE *out, FILE *err) {
// If we have already entered the session, without having officially 'left'
- // it, then there is no need to
- // 'enter' it again.
+ // it, then there is no need to 'enter' it again.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_SCRIPT));
if (m_session_is_active) {
if (log)
@@ -560,8 +616,8 @@ bool ScriptInterpreterPython::EnterSession(uint16_t on_entry_flags, FILE *in,
run_string.PutCString("; lldb.frame = lldb.thread.GetSelectedFrame ()");
run_string.PutCString("')");
} else {
- // If we aren't initing the globals, we should still always set the debugger
- // (since that is always unique.)
+ // If we aren't initing the globals, we should still always set the
+ // debugger (since that is always unique.)
run_string.Printf("run_one_line (%s, 'lldb.debugger_unique_id = %" PRIu64,
m_dictionary_name.c_str(),
GetCommandInterpreter().GetDebugger().GetID());
@@ -695,19 +751,20 @@ static void ReadThreadBytesReceived(void *baton, const void *src,
}
bool ScriptInterpreterPython::ExecuteOneLine(
- const char *command, CommandReturnObject *result,
+ llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options) {
+ std::string command_str = command.str();
+
if (!m_valid_session)
return false;
- if (command && command[0]) {
+ if (!command.empty()) {
// We want to call run_one_line, passing in the dictionary and the command
- // string. We cannot do this through
- // PyRun_SimpleString here because the command string may contain escaped
- // characters, and putting it inside
+ // string. We cannot do this through PyRun_SimpleString here because the
+ // command string may contain escaped characters, and putting it inside
// another string to pass to PyRun_SimpleString messes up the escaping. So
- // we use the following more complicated
- // method to pass the command string directly down to Python.
+ // we use the following more complicated method to pass the command string
+ // directly down to Python.
Debugger &debugger = m_interpreter.GetDebugger();
StreamFileSP input_file_sp;
@@ -773,17 +830,14 @@ bool ScriptInterpreterPython::ExecuteOneLine(
FILE *err_file = error_file_sp->GetFile().GetStream();
bool success = false;
{
- // WARNING! It's imperative that this RAII scope be as tight as possible.
- // In particular, the
- // scope must end *before* we try to join the read thread. The reason for
- // this is that a
- // pre-requisite for joining the read thread is that we close the write
- // handle (to break the
- // pipe and cause it to wake up and exit). But acquiring the GIL as below
- // will redirect Python's
- // stdio to use this same handle. If we close the handle while Python is
- // still using it, bad
- // things will happen.
+ // WARNING! It's imperative that this RAII scope be as tight as
+ // possible. In particular, the scope must end *before* we try to join
+ // the read thread. The reason for this is that a pre-requisite for
+ // joining the read thread is that we close the write handle (to break
+ // the pipe and cause it to wake up and exit). But acquiring the GIL as
+ // below will redirect Python's stdio to use this same handle. If we
+ // close the handle while Python is still using it, bad things will
+ // happen.
Locker locker(
this,
ScriptInterpreterPython::Locker::AcquireLock |
@@ -803,7 +857,7 @@ bool ScriptInterpreterPython::ExecuteOneLine(
if (PyCallable_Check(m_run_one_line_function.get())) {
PythonObject pargs(
PyRefType::Owned,
- Py_BuildValue("(Os)", session_dict.get(), command));
+ Py_BuildValue("(Os)", session_dict.get(), command_str.c_str()));
if (pargs.IsValid()) {
PythonObject return_value(
PyRefType::Owned,
@@ -827,12 +881,12 @@ bool ScriptInterpreterPython::ExecuteOneLine(
}
if (join_read_thread) {
- // Close the write end of the pipe since we are done with our
- // one line script. This should cause the read thread that
- // output_comm is using to exit
+ // Close the write end of the pipe since we are done with our one line
+ // script. This should cause the read thread that output_comm is using to
+ // exit
output_file_sp->GetFile().Close();
- // The close above should cause this thread to exit when it gets
- // to the end of file, so let it get all its data
+ // The close above should cause this thread to exit when it gets to the
+ // end of file, so let it get all its data
output_comm.JoinReadThread();
// Now we can close the read end of the pipe
output_comm.Disconnect();
@@ -842,9 +896,10 @@ bool ScriptInterpreterPython::ExecuteOneLine(
return true;
// The one-liner failed. Append the error message.
- if (result)
+ if (result) {
result->AppendErrorWithFormat(
- "python failed attempting to evaluate '%s'\n", command);
+ "python failed attempting to evaluate '%s'\n", command_str.c_str());
+ }
return false;
}
@@ -889,21 +944,18 @@ public:
ScriptInterpreterPython::Locker::FreeAcquiredLock |
ScriptInterpreterPython::Locker::TearDownSession);
- // The following call drops into the embedded interpreter loop and stays
- // there until the
- // user chooses to exit from the Python interpreter.
- // This embedded interpreter will, as any Python code that performs I/O,
- // unlock the GIL before
- // a system call that can hang, and lock it when the syscall has
- // returned.
+ // The following call drops into the embedded interpreter loop and
+ // stays there until the user chooses to exit from the Python
+ // interpreter. This embedded interpreter will, as any Python code that
+ // performs I/O, unlock the GIL before a system call that can hang, and
+ // lock it when the syscall has returned.
// We need to surround the call to the embedded interpreter with calls
- // to PyGILState_Ensure and
- // PyGILState_Release (using the Locker above). This is because Python
- // has a global lock which must be held whenever we want
- // to touch any Python objects. Otherwise, if the user calls Python
- // code, the interpreter state will be off,
- // and things could hang (it's happened before).
+ // to PyGILState_Ensure and PyGILState_Release (using the Locker
+ // above). This is because Python has a global lock which must be held
+ // whenever we want to touch any Python objects. Otherwise, if the user
+ // calls Python code, the interpreter state will be off, and things
+ // could hang (it's happened before).
StreamString run_string;
run_string.Printf("run_python_interpreter (%s)",
@@ -934,12 +986,10 @@ void ScriptInterpreterPython::ExecuteInterpreterLoop() {
Debugger &debugger = GetCommandInterpreter().GetDebugger();
// At the moment, the only time the debugger does not have an input file
- // handle is when this is called
- // directly from Python, in which case it is both dangerous and unnecessary
- // (not to mention confusing) to
- // try to embed a running interpreter loop inside the already running Python
- // interpreter loop, so we won't
- // do it.
+ // handle is when this is called directly from Python, in which case it is
+ // both dangerous and unnecessary (not to mention confusing) to try to embed
+ // a running interpreter loop inside the already running Python interpreter
+ // loop, so we won't do it.
if (!debugger.GetInputFile()->GetFile().IsValid())
return;
@@ -974,7 +1024,7 @@ bool ScriptInterpreterPython::Interrupt() {
return false;
}
bool ScriptInterpreterPython::ExecuteOneLineWithReturn(
- const char *in_string, ScriptInterpreter::ScriptReturnType return_type,
+ llvm::StringRef in_string, ScriptInterpreter::ScriptReturnType return_type,
void *ret_value, const ExecuteScriptOptions &options) {
Locker locker(this, ScriptInterpreterPython::Locker::AcquireLock |
@@ -1009,116 +1059,111 @@ bool ScriptInterpreterPython::ExecuteOneLineWithReturn(
if (py_error.IsValid())
PyErr_Clear();
- if (in_string != nullptr) {
- { // scope for PythonInputReaderManager
- // PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL);
- py_return.Reset(
- PyRefType::Owned,
- PyRun_String(in_string, Py_eval_input, globals.get(), locals.get()));
- if (!py_return.IsValid()) {
- py_error.Reset(PyRefType::Borrowed, PyErr_Occurred());
- if (py_error.IsValid())
- PyErr_Clear();
-
- py_return.Reset(PyRefType::Owned,
- PyRun_String(in_string, Py_single_input, globals.get(),
- locals.get()));
- }
+ std::string as_string = in_string.str();
+ { // scope for PythonInputReaderManager
+ // PythonInputReaderManager py_input(options.GetEnableIO() ? this : NULL);
+ py_return.Reset(PyRefType::Owned,
+ PyRun_String(as_string.c_str(), Py_eval_input,
+ globals.get(), locals.get()));
+ if (!py_return.IsValid()) {
+ py_error.Reset(PyRefType::Borrowed, PyErr_Occurred());
+ if (py_error.IsValid())
+ PyErr_Clear();
+
+ py_return.Reset(PyRefType::Owned,
+ PyRun_String(as_string.c_str(), Py_single_input,
+ globals.get(), locals.get()));
}
+ }
- if (py_return.IsValid()) {
- switch (return_type) {
- case eScriptReturnTypeCharPtr: // "char *"
- {
- const char format[3] = "s#";
- success = PyArg_Parse(py_return.get(), format, (char **)ret_value);
- break;
- }
- case eScriptReturnTypeCharStrOrNone: // char* or NULL if py_return ==
- // Py_None
- {
- const char format[3] = "z";
- success = PyArg_Parse(py_return.get(), format, (char **)ret_value);
- break;
- }
- case eScriptReturnTypeBool: {
- const char format[2] = "b";
- success = PyArg_Parse(py_return.get(), format, (bool *)ret_value);
- break;
- }
- case eScriptReturnTypeShortInt: {
- const char format[2] = "h";
- success = PyArg_Parse(py_return.get(), format, (short *)ret_value);
- break;
- }
- case eScriptReturnTypeShortIntUnsigned: {
- const char format[2] = "H";
- success =
- PyArg_Parse(py_return.get(), format, (unsigned short *)ret_value);
- break;
- }
- case eScriptReturnTypeInt: {
- const char format[2] = "i";
- success = PyArg_Parse(py_return.get(), format, (int *)ret_value);
- break;
- }
- case eScriptReturnTypeIntUnsigned: {
- const char format[2] = "I";
- success =
- PyArg_Parse(py_return.get(), format, (unsigned int *)ret_value);
- break;
- }
- case eScriptReturnTypeLongInt: {
- const char format[2] = "l";
- success = PyArg_Parse(py_return.get(), format, (long *)ret_value);
- break;
- }
- case eScriptReturnTypeLongIntUnsigned: {
- const char format[2] = "k";
- success =
- PyArg_Parse(py_return.get(), format, (unsigned long *)ret_value);
- break;
- }
- case eScriptReturnTypeLongLong: {
- const char format[2] = "L";
- success = PyArg_Parse(py_return.get(), format, (long long *)ret_value);
- break;
- }
- case eScriptReturnTypeLongLongUnsigned: {
- const char format[2] = "K";
- success = PyArg_Parse(py_return.get(), format,
- (unsigned long long *)ret_value);
- break;
- }
- case eScriptReturnTypeFloat: {
- const char format[2] = "f";
- success = PyArg_Parse(py_return.get(), format, (float *)ret_value);
- break;
- }
- case eScriptReturnTypeDouble: {
- const char format[2] = "d";
- success = PyArg_Parse(py_return.get(), format, (double *)ret_value);
- break;
- }
- case eScriptReturnTypeChar: {
- const char format[2] = "c";
- success = PyArg_Parse(py_return.get(), format, (char *)ret_value);
- break;
- }
- case eScriptReturnTypeOpaqueObject: {
- success = true;
- PyObject *saved_value = py_return.get();
- Py_XINCREF(saved_value);
- *((PyObject **)ret_value) = saved_value;
- break;
- }
- }
-
- if (success)
- ret_success = true;
- else
- ret_success = false;
+ if (py_return.IsValid()) {
+ switch (return_type) {
+ case eScriptReturnTypeCharPtr: // "char *"
+ {
+ const char format[3] = "s#";
+ success = PyArg_Parse(py_return.get(), format, (char **)ret_value);
+ break;
+ }
+ case eScriptReturnTypeCharStrOrNone: // char* or NULL if py_return ==
+ // Py_None
+ {
+ const char format[3] = "z";
+ success = PyArg_Parse(py_return.get(), format, (char **)ret_value);
+ break;
}
+ case eScriptReturnTypeBool: {
+ const char format[2] = "b";
+ success = PyArg_Parse(py_return.get(), format, (bool *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeShortInt: {
+ const char format[2] = "h";
+ success = PyArg_Parse(py_return.get(), format, (short *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeShortIntUnsigned: {
+ const char format[2] = "H";
+ success =
+ PyArg_Parse(py_return.get(), format, (unsigned short *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeInt: {
+ const char format[2] = "i";
+ success = PyArg_Parse(py_return.get(), format, (int *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeIntUnsigned: {
+ const char format[2] = "I";
+ success = PyArg_Parse(py_return.get(), format, (unsigned int *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeLongInt: {
+ const char format[2] = "l";
+ success = PyArg_Parse(py_return.get(), format, (long *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeLongIntUnsigned: {
+ const char format[2] = "k";
+ success =
+ PyArg_Parse(py_return.get(), format, (unsigned long *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeLongLong: {
+ const char format[2] = "L";
+ success = PyArg_Parse(py_return.get(), format, (long long *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeLongLongUnsigned: {
+ const char format[2] = "K";
+ success =
+ PyArg_Parse(py_return.get(), format, (unsigned long long *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeFloat: {
+ const char format[2] = "f";
+ success = PyArg_Parse(py_return.get(), format, (float *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeDouble: {
+ const char format[2] = "d";
+ success = PyArg_Parse(py_return.get(), format, (double *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeChar: {
+ const char format[2] = "c";
+ success = PyArg_Parse(py_return.get(), format, (char *)ret_value);
+ break;
+ }
+ case eScriptReturnTypeOpaqueObject: {
+ success = true;
+ PyObject *saved_value = py_return.get();
+ Py_XINCREF(saved_value);
+ *((PyObject **)ret_value) = saved_value;
+ break;
+ }
+ }
+
+ ret_success = success;
}
py_error.Reset(PyRefType::Borrowed, PyErr_Occurred());
@@ -1174,10 +1219,8 @@ Status ScriptInterpreterPython::ExecuteMultipleLines(
if (code_object.IsValid()) {
// In Python 2.x, PyEval_EvalCode takes a PyCodeObject, but in Python 3.x, it
-// takes
-// a PyObject. They are convertible (hence the function
-// PyCode_Check(PyObject*), so
-// we have to do the cast for Python 2.x
+// takes a PyObject. They are convertible (hence the function
+// PyCode_Check(PyObject*), so we have to do the cast for Python 2.x
#if PY_MAJOR_VERSION >= 3
PyObject *py_code_obj = code_object.get();
#else
@@ -1243,10 +1286,9 @@ Status ScriptInterpreterPython::SetBreakpointCommandCallback(
auto data_ap = llvm::make_unique<CommandDataPython>();
// Split the command_body_text into lines, and pass that to
- // GenerateBreakpointCommandCallbackData. That will
- // wrap the body in an auto-generated function, and return the function name
- // in script_source. That is what
- // the callback will actually invoke.
+ // GenerateBreakpointCommandCallbackData. That will wrap the body in an
+ // auto-generated function, and return the function name in script_source.
+ // That is what the callback will actually invoke.
data_ap->user_source.SplitIntoLines(command_body_text);
Status error = GenerateBreakpointCommandCallbackData(data_ap->user_source,
@@ -1268,9 +1310,8 @@ void ScriptInterpreterPython::SetWatchpointCommandCallback(
// It's necessary to set both user_source and script_source to the oneliner.
// The former is used to generate callback description (as in watchpoint
- // command list)
- // while the latter is used for Python to interpret during the actual
- // callback.
+ // command list) while the latter is used for Python to interpret during the
+ // actual callback.
data_ap->user_source.AppendString(oneliner);
data_ap->script_source.assign(oneliner);
@@ -1365,8 +1406,7 @@ bool ScriptInterpreterPython::GenerateTypeScriptFunction(
return false;
// Take what the user wrote, wrap it all up inside one big auto-generated
- // Python function, passing in the
- // ValueObject as parameter to the function.
+ // Python function, passing in the ValueObject as parameter to the function.
std::string auto_generated_function_name(
GenerateUniqueName("lldb_autogen_python_type_print_func",
@@ -1430,8 +1470,8 @@ bool ScriptInterpreterPython::GenerateTypeSynthClass(StringList &user_input,
sstr.Printf("class %s:", auto_generated_class_name.c_str());
auto_generated_class.AppendString(sstr.GetString());
- // Wrap everything up inside the class, increasing the indentation.
- // we don't need to play any fancy indentation tricks here because there is no
+ // Wrap everything up inside the class, increasing the indentation. we don't
+ // need to play any fancy indentation tricks here because there is no
// surrounding code whose indentation we need to honor
for (int i = 0; i < num_lines; ++i) {
sstr.Clear();
@@ -1439,9 +1479,8 @@ bool ScriptInterpreterPython::GenerateTypeSynthClass(StringList &user_input,
auto_generated_class.AppendString(sstr.GetString());
}
- // Verify that the results are valid Python.
- // (even though the method is ExportFunctionDefinitionToInterpreter, a class
- // will actually be exported)
+ // Verify that the results are valid Python. (even though the method is
+ // ExportFunctionDefinitionToInterpreter, a class will actually be exported)
// (TODO: rename that method to ExportDefinitionToInterpreter)
if (!ExportFunctionDefinitionToInterpreter(auto_generated_class).Success())
return false;
@@ -1585,8 +1624,8 @@ StructuredData::ArraySP ScriptInterpreterPython::OSPlugin_ThreadsInfo(
// GetPythonValueFormatString provides a system independent type safe way to
// convert a variable's type into a python value format. Python value formats
-// are defined in terms of builtin C types and could change from system to
-// as the underlying typedef for uint* types, size_t, off_t and other values
+// are defined in terms of builtin C types and could change from system to as
+// the underlying typedef for uint* types, size_t, off_t and other values
// change.
template <typename T> const char *GetPythonValueFormatString(T t);
@@ -2044,8 +2083,7 @@ void ScriptInterpreterPython::Clear() {
ScriptInterpreterPython::Locker::FreeAcquiredLock);
// This may be called as part of Py_Finalize. In that case the modules are
- // destroyed in random
- // order and we can't guarantee that we can access these.
+ // destroyed in random order and we can't guarantee that we can access these.
if (Py_IsInitialized())
PyRun_SimpleString("lldb.debugger = None; lldb.target = None; lldb.process "
"= None; lldb.thread = None; lldb.frame = None");
@@ -2615,9 +2653,9 @@ bool ScriptInterpreterPython::LoadScriptingModule(
// strip .py or .pyc extension
ConstString extension = target_file.GetFileNameExtension();
if (extension) {
- if (::strcmp(extension.GetCString(), "py") == 0)
+ if (llvm::StringRef(extension.GetCString()) == ".py")
basename.resize(basename.length() - 3);
- else if (::strcmp(extension.GetCString(), "pyc") == 0)
+ else if (llvm::StringRef(extension.GetCString()) == ".pyc")
basename.resize(basename.length() - 4);
}
} else {
@@ -2629,9 +2667,8 @@ bool ScriptInterpreterPython::LoadScriptingModule(
command_stream.Clear();
command_stream.Printf("sys.modules.__contains__('%s')", basename.c_str());
bool does_contain = false;
- // this call will succeed if the module was ever imported in any Debugger in
- // the lifetime of the process
- // in which this LLDB framework is living
+ // this call will succeed if the module was ever imported in any Debugger
+ // in the lifetime of the process in which this LLDB framework is living
bool was_imported_globally =
(ExecuteOneLineWithReturn(
command_stream.GetData(),
@@ -2705,8 +2742,8 @@ bool ScriptInterpreterPython::IsReservedWord(const char *word) {
llvm::StringRef word_sr(word);
- // filter out a few characters that would just confuse us
- // and that are clearly not keyword material anyway
+ // filter out a few characters that would just confuse us and that are
+ // clearly not keyword material anyway
if (word_sr.find_first_of("'\"") != llvm::StringRef::npos)
return false;
@@ -2740,7 +2777,7 @@ ScriptInterpreterPython::SynchronicityHandler::~SynchronicityHandler() {
}
bool ScriptInterpreterPython::RunScriptBasedCommand(
- const char *impl_function, const char *args,
+ const char *impl_function, llvm::StringRef args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj, Status &error,
const lldb_private::ExecutionContext &exe_ctx) {
@@ -2774,9 +2811,10 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
- ret_val =
- g_swig_call_command(impl_function, m_dictionary_name.c_str(),
- debugger_sp, args, cmd_retobj, exe_ctx_ref_sp);
+ std::string args_str = args.str();
+ ret_val = g_swig_call_command(impl_function, m_dictionary_name.c_str(),
+ debugger_sp, args_str.c_str(), cmd_retobj,
+ exe_ctx_ref_sp);
}
if (!ret_val)
@@ -2788,7 +2826,7 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
}
bool ScriptInterpreterPython::RunScriptBasedCommand(
- StructuredData::GenericSP impl_obj_sp, const char *args,
+ StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj, Status &error,
const lldb_private::ExecutionContext &exe_ctx) {
@@ -2822,8 +2860,10 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
SynchronicityHandler synch_handler(debugger_sp, synchronicity);
+ std::string args_str = args.str();
ret_val = g_swig_call_command_object(impl_obj_sp->GetValue(), debugger_sp,
- args, cmd_retobj, exe_ctx_ref_sp);
+ args_str.c_str(), cmd_retobj,
+ exe_ctx_ref_sp);
}
if (!ret_val)
@@ -2834,9 +2874,9 @@ bool ScriptInterpreterPython::RunScriptBasedCommand(
return ret_val;
}
-// in Python, a special attribute __doc__ contains the docstring
-// for an object (function, method, class, ...) if any is defined
-// Otherwise, the attribute's value is None
+// in Python, a special attribute __doc__ contains the docstring for an object
+// (function, method, class, ...) if any is defined Otherwise, the attribute's
+// value is None
bool ScriptInterpreterPython::GetDocumentationForItem(const char *item,
std::string &dest) {
dest.clear();
@@ -3106,10 +3146,9 @@ void ScriptInterpreterPython::InitializePrivate() {
Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
// RAII-based initialization which correctly handles multiple-initialization,
- // version-
- // specific differences among Python 2 and Python 3, and saving and restoring
- // various
- // other pieces of state that can get mucked with during initialization.
+ // version- specific differences among Python 2 and Python 3, and saving and
+ // restoring various other pieces of state that can get mucked with during
+ // initialization.
InitializePythonRAII initialize_guard;
if (g_swig_init_callback)
@@ -3121,17 +3160,13 @@ void ScriptInterpreterPython::InitializePrivate() {
PyRun_SimpleString("import sys");
AddToSysPath(AddLocation::End, ".");
- FileSpec file_spec;
// Don't denormalize paths when calling file_spec.GetPath(). On platforms
- // that use
- // a backslash as the path separator, this will result in executing python
- // code containing
- // paths with unescaped backslashes. But Python also accepts forward slashes,
- // so to make
- // life easier we just use that.
- if (HostInfo::GetLLDBPath(ePathTypePythonDir, file_spec))
+ // that use a backslash as the path separator, this will result in executing
+ // python code containing paths with unescaped backslashes. But Python also
+ // accepts forward slashes, so to make life easier we just use that.
+ if (FileSpec file_spec = GetPythonDir())
AddToSysPath(AddLocation::Beginning, file_spec.GetPath(false));
- if (HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, file_spec))
+ if (FileSpec file_spec = HostInfo::GetShlibDir())
AddToSysPath(AddLocation::Beginning, file_spec.GetPath(false));
PyRun_SimpleString("sys.dont_write_bytecode = 1; import "
@@ -3157,30 +3192,20 @@ void ScriptInterpreterPython::AddToSysPath(AddLocation location,
PyRun_SimpleString(statement.c_str());
}
-// void
-// ScriptInterpreterPython::Terminate ()
-//{
-// // We are intentionally NOT calling Py_Finalize here (this would be the
-// logical place to call it). Calling
-// // Py_Finalize here causes test suite runs to seg fault: The test suite
-// runs in Python. It registers
-// // SBDebugger::Terminate to be called 'at_exit'. When the test suite
-// Python harness finishes up, it calls
-// // Py_Finalize, which calls all the 'at_exit' registered functions.
-// SBDebugger::Terminate calls Debugger::Terminate,
-// // which calls lldb::Terminate, which calls ScriptInterpreter::Terminate,
-// which calls
-// // ScriptInterpreterPython::Terminate. So if we call Py_Finalize here, we
-// end up with Py_Finalize being called from
-// // within Py_Finalize, which results in a seg fault.
-// //
-// // Since this function only gets called when lldb is shutting down and
-// going away anyway, the fact that we don't
-// // actually call Py_Finalize should not cause any problems (everything
-// should shut down/go away anyway when the
-// // process exits).
-// //
-//// Py_Finalize ();
-//}
-
-#endif // #ifdef LLDB_DISABLE_PYTHON
+// We are intentionally NOT calling Py_Finalize here (this would be the logical
+// place to call it). Calling Py_Finalize here causes test suite runs to seg
+// fault: The test suite runs in Python. It registers SBDebugger::Terminate to
+// be called 'at_exit'. When the test suite Python harness finishes up, it
+// calls Py_Finalize, which calls all the 'at_exit' registered functions.
+// SBDebugger::Terminate calls Debugger::Terminate, which calls lldb::Terminate,
+// which calls ScriptInterpreter::Terminate, which calls
+// ScriptInterpreterPython::Terminate. So if we call Py_Finalize here, we end
+// up with Py_Finalize being called from within Py_Finalize, which results in a
+// seg fault. Since this function only gets called when lldb is shutting down
+// and going away anyway, the fact that we don't actually call Py_Finalize
+// should not cause any problems (everything should shut down/go away anyway
+// when the process exits).
+//
+// void ScriptInterpreterPython::Terminate() { Py_Finalize (); }
+
+#endif // LLDB_DISABLE_PYTHON
diff --git a/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h b/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
index a71fcea7519c..b13979dc069b 100644
--- a/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
+++ b/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
@@ -151,14 +151,14 @@ public:
bool Interrupt() override;
bool ExecuteOneLine(
- const char *command, CommandReturnObject *result,
+ llvm::StringRef command, CommandReturnObject *result,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
void ExecuteInterpreterLoop() override;
bool ExecuteOneLineWithReturn(
- const char *in_string, ScriptInterpreter::ScriptReturnType return_type,
- void *ret_value,
+ llvm::StringRef in_string,
+ ScriptInterpreter::ScriptReturnType return_type, void *ret_value,
const ExecuteScriptOptions &options = ExecuteScriptOptions()) override;
lldb_private::Status ExecuteMultipleLines(
@@ -259,18 +259,17 @@ public:
GetSyntheticTypeName(const StructuredData::ObjectSP &implementor) override;
bool
- RunScriptBasedCommand(const char *impl_function, const char *args,
+ RunScriptBasedCommand(const char *impl_function, llvm::StringRef args,
ScriptedCommandSynchronicity synchronicity,
lldb_private::CommandReturnObject &cmd_retobj,
Status &error,
const lldb_private::ExecutionContext &exe_ctx) override;
- bool
- RunScriptBasedCommand(StructuredData::GenericSP impl_obj_sp, const char *args,
- ScriptedCommandSynchronicity synchronicity,
- lldb_private::CommandReturnObject &cmd_retobj,
- Status &error,
- const lldb_private::ExecutionContext &exe_ctx) override;
+ bool RunScriptBasedCommand(
+ StructuredData::GenericSP impl_obj_sp, llvm::StringRef args,
+ ScriptedCommandSynchronicity synchronicity,
+ lldb_private::CommandReturnObject &cmd_retobj, Status &error,
+ const lldb_private::ExecutionContext &exe_ctx) override;
Status GenerateFunction(const char *signature,
const StringList &input) override;
@@ -445,6 +444,8 @@ public:
static const char *GetPluginDescriptionStatic();
+ static FileSpec GetPythonDir();
+
//------------------------------------------------------------------
// PluginInterface protocol
//------------------------------------------------------------------
@@ -509,6 +510,10 @@ protected:
static void AddToSysPath(AddLocation location, std::string path);
+ static void ComputePythonDirForApple(llvm::SmallVectorImpl<char> &path);
+ static void ComputePythonDirForPosix(llvm::SmallVectorImpl<char> &path);
+ static void ComputePythonDirForWindows(llvm::SmallVectorImpl<char> &path);
+
bool EnterSession(uint16_t on_entry_flags, FILE *in, FILE *out, FILE *err);
void LeaveSession();
diff --git a/source/Plugins/ScriptInterpreter/Python/lldb-python.h b/source/Plugins/ScriptInterpreter/Python/lldb-python.h
index ee13b7a5cd1f..f929baade2e4 100644
--- a/source/Plugins/ScriptInterpreter/Python/lldb-python.h
+++ b/source/Plugins/ScriptInterpreter/Python/lldb-python.h
@@ -1,5 +1,4 @@
-//===-- lldb-python.h --------------------------------------------*- C++
-//-*-===//
+//===-- lldb-python.h -------------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -18,7 +17,7 @@
// Python is disabled in this build
#else
#include "llvm/Support/Compiler.h"
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
// If anyone #includes Host/PosixApi.h later, it will try to typedef pid_t. We
// need to ensure this doesn't happen. At the same time, Python.h will also try
// to redefine a bunch of stuff that PosixApi.h defines. So define it all now
diff --git a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp b/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
index 8424b55ee69c..e33e26507fb1 100644
--- a/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
+++ b/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
@@ -23,6 +23,7 @@
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandObjectMultiword.h"
#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Interpreter/OptionValueString.h"
#include "lldb/Interpreter/Property.h"
@@ -184,10 +185,10 @@ const char *const s_filter_attributes[] = {
"message", // message contents, fully expanded
"subsystem" // subsystem of the log message
- // Consider impelmenting this action as it would be cheaper to filter.
- // "message" requires always formatting the message, which is a waste
- // of cycles if it ends up being rejected.
- // "format", // format string used to format message text
+ // Consider implementing this action as it would be cheaper to filter.
+ // "message" requires always formatting the message, which is a waste of
+ // cycles if it ends up being rejected. "format", // format string
+ // used to format message text
};
static const ConstString &GetDarwinLogTypeName() {
@@ -238,11 +239,10 @@ public:
// Indicate whether this is an accept or reject rule.
dict_p->AddBooleanItem("accept", m_accept);
- // Indicate which attribute of the message this filter references.
- // This can drop into the rule-specific DoSerialization if we get
- // to the point where not all FilterRule derived classes work on
- // an attribute. (e.g. logical and/or and other compound
- // operations).
+ // Indicate which attribute of the message this filter references. This can
+ // drop into the rule-specific DoSerialization if we get to the point where
+ // not all FilterRule derived classes work on an attribute. (e.g. logical
+ // and/or and other compound operations).
dict_p->AddStringItem("attribute", s_filter_attributes[m_attribute_index]);
// Indicate the type of the rule.
@@ -403,9 +403,9 @@ static void RegisterFilterOperations() {
// -------------------------------------------------------------------------
static OptionDefinition g_enable_option_table[] = {
- // Source stream include/exclude options (the first-level filter).
- // This one should be made as small as possible as everything that
- // goes through here must be processed by the process monitor.
+ // Source stream include/exclude options (the first-level filter). This one
+ // should be made as small as possible as everything that goes through here
+ // must be processed by the process monitor.
{LLDB_OPT_SET_ALL, false, "any-process", 'a', OptionParser::eNoArgument,
nullptr, nullptr, 0, eArgTypeNone,
"Specifies log messages from other related processes should be "
@@ -419,10 +419,10 @@ static OptionDefinition g_enable_option_table[] = {
"Specifies info-level log messages should be included."},
{LLDB_OPT_SET_ALL, false, "filter", 'f', OptionParser::eRequiredArgument,
nullptr, nullptr, 0, eArgRawInput,
- // There doesn't appear to be a great way for me to have these
- // multi-line, formatted tables in help. This looks mostly right
- // but there are extra linefeeds added at seemingly random spots,
- // and indentation isn't handled properly on those lines.
+ // There doesn't appear to be a great way for me to have these multi-line,
+ // formatted tables in help. This looks mostly right but there are extra
+ // linefeeds added at seemingly random spots, and indentation isn't
+ // handled properly on those lines.
"Appends a filter rule to the log message filter chain. Multiple "
"rules may be added by specifying this option multiple times, "
"once per filter rule. Filter rules are processed in the order "
@@ -488,11 +488,11 @@ static OptionDefinition g_enable_option_table[] = {
"a log message."},
{LLDB_OPT_SET_ALL, false, "category", 'c', OptionParser::eNoArgument,
nullptr, nullptr, 0, eArgTypeNone,
- "Include the category in the the message header when displaying "
+ "Include the category in the message header when displaying "
"a log message."},
{LLDB_OPT_SET_ALL, false, "activity-chain", 'C', OptionParser::eNoArgument,
nullptr, nullptr, 0, eArgTypeNone,
- "Include the activity parent-child chain in the the message header "
+ "Include the activity parent-child chain in the message header "
"when displaying a log message. The activity hierarchy is "
"displayed as {grandparent-activity}:"
"{parent-activity}:{activity}[:...]."},
@@ -544,7 +544,8 @@ public:
break;
case 'b':
- m_broadcast_events = Args::StringToBoolean(option_arg, true, nullptr);
+ m_broadcast_events =
+ OptionArgParser::ToBoolean(option_arg, true, nullptr);
break;
case 'c':
@@ -560,7 +561,7 @@ public:
break;
case 'e':
- m_echo_to_stderr = Args::StringToBoolean(option_arg, false, nullptr);
+ m_echo_to_stderr = OptionArgParser::ToBoolean(option_arg, false, nullptr);
break;
case 'f':
@@ -571,12 +572,12 @@ public:
break;
case 'l':
- m_live_stream = Args::StringToBoolean(option_arg, false, nullptr);
+ m_live_stream = OptionArgParser::ToBoolean(option_arg, false, nullptr);
break;
case 'n':
m_filter_fall_through_accepts =
- Args::StringToBoolean(option_arg, true, nullptr);
+ OptionArgParser::ToBoolean(option_arg, true, nullptr);
break;
case 'r':
@@ -614,7 +615,7 @@ public:
source_flags_sp->AddBooleanItem("any-process", m_include_any_process);
source_flags_sp->AddBooleanItem("debug-level", m_include_debug_level);
- // The debug-level flag, if set, implies info-level.
+ // The debug-level flag, if set, implies info-level.
source_flags_sp->AddBooleanItem("info-level", m_include_info_level ||
m_include_debug_level);
source_flags_sp->AddBooleanItem("live-stream", m_live_stream);
@@ -784,12 +785,11 @@ protected:
if (!source_name)
return;
- // Check if we're *not* using strict sources. If not,
- // then the user is going to get debug-level info
- // anyways, probably not what they're expecting.
- // Unfortunately we can only fix this by adding an
- // env var, which would have had to have happened
- // already. Thus, a warning is the best we can do here.
+ // Check if we're *not* using strict sources. If not, then the user is
+ // going to get debug-level info anyways, probably not what they're
+ // expecting. Unfortunately we can only fix this by adding an env var,
+ // which would have had to have happened already. Thus, a warning is the
+ // best we can do here.
StreamString stream;
stream.Printf("darwin-log source settings specify to exclude "
"%s messages, but setting "
@@ -803,24 +803,22 @@ protected:
}
bool DoExecute(Args &command, CommandReturnObject &result) override {
- // First off, set the global sticky state of enable/disable
- // based on this command execution.
+ // First off, set the global sticky state of enable/disable based on this
+ // command execution.
s_is_explicitly_enabled = m_enable;
- // Next, if this is an enable, save off the option data.
- // We will need it later if a process hasn't been launched or
- // attached yet.
+ // Next, if this is an enable, save off the option data. We will need it
+ // later if a process hasn't been launched or attached yet.
if (m_enable) {
- // Save off enabled configuration so we can apply these parsed
- // options the next time an attach or launch occurs.
+ // Save off enabled configuration so we can apply these parsed options
+ // the next time an attach or launch occurs.
DebuggerSP debugger_sp =
GetCommandInterpreter().GetDebugger().shared_from_this();
SetGlobalEnableOptions(debugger_sp, m_options_sp);
}
- // Now check if we have a running process. If so, we should
- // instruct the process monitor to enable/disable DarwinLog support
- // now.
+ // Now check if we have a running process. If so, we should instruct the
+ // process monitor to enable/disable DarwinLog support now.
Target *target = GetSelectedOrDummyTarget();
if (!target) {
// No target, so there is nothing more to do right now.
@@ -831,14 +829,13 @@ protected:
// Grab the active process.
auto process_sp = target->GetProcessSP();
if (!process_sp) {
- // No active process, so there is nothing more to do right
- // now.
+ // No active process, so there is nothing more to do right now.
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return true;
}
- // If the process is no longer alive, we can't do this now.
- // We'll catch it the next time the process is started up.
+ // If the process is no longer alive, we can't do this now. We'll catch it
+ // the next time the process is started up.
if (!process_sp->IsAlive()) {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
return true;
@@ -857,19 +854,17 @@ protected:
*static_cast<StructuredDataDarwinLog *>(plugin_sp.get());
if (m_enable) {
- // Hook up the breakpoint for the process that detects when
- // libtrace has been sufficiently initialized to really start
- // the os_log stream. This is insurance to assure us that
- // logging is really enabled. Requesting that logging be
- // enabled for a process before libtrace is initialized
- // results in a scenario where no errors occur, but no logging
- // is captured, either. This step is to eliminate that
- // possibility.
+ // Hook up the breakpoint for the process that detects when libtrace has
+ // been sufficiently initialized to really start the os_log stream. This
+ // is insurance to assure us that logging is really enabled. Requesting
+ // that logging be enabled for a process before libtrace is initialized
+ // results in a scenario where no errors occur, but no logging is
+ // captured, either. This step is to eliminate that possibility.
plugin.AddInitCompletionHook(*process_sp.get());
}
- // Send configuration to the feature by way of the process.
- // Construct the options we will use.
+ // Send configuration to the feature by way of the process. Construct the
+ // options we will use.
auto config_sp = m_options_sp->BuildConfigurationData(m_enable);
const Status error =
process_sp->ConfigureStructuredData(GetDarwinLogTypeName(), config_sp);
@@ -882,8 +877,8 @@ protected:
plugin.SetEnabled(false);
} else {
result.SetStatus(eReturnStatusSuccessFinishNoResult);
- // Our configuration succeeeded, so we're enabled/disabled
- // per whichever one this command is setup to do.
+ // Our configuration succeeded, so we're enabled/disabled per whichever
+ // one this command is setup to do.
plugin.SetEnabled(m_enable);
}
return result.Succeeded();
@@ -914,8 +909,8 @@ protected:
bool DoExecute(Args &command, CommandReturnObject &result) override {
auto &stream = result.GetOutputStream();
- // Figure out if we've got a process. If so, we can tell if
- // DarwinLog is available for that process.
+ // Figure out if we've got a process. If so, we can tell if DarwinLog is
+ // available for that process.
Target *target = GetSelectedOrDummyTarget();
auto process_sp = target ? target->GetProcessSP() : ProcessSP();
if (!target || !process_sp) {
@@ -1013,13 +1008,13 @@ public:
};
EnableOptionsSP ParseAutoEnableOptions(Status &error, Debugger &debugger) {
- // We are abusing the options data model here so that we can parse
- // options without requiring the Debugger instance.
+ Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
+ // We are abusing the options data model here so that we can parse options
+ // without requiring the Debugger instance.
- // We have an empty execution context at this point. We only want
- // to parse options, and we don't need any context to do this here.
- // In fact, we want to be able to parse the enable options before having
- // any context.
+ // We have an empty execution context at this point. We only want to parse
+ // options, and we don't need any context to do this here. In fact, we want
+ // to be able to parse the enable options before having any context.
ExecutionContext exe_ctx;
EnableOptionsSP options_sp(new EnableOptions());
@@ -1044,22 +1039,23 @@ EnableOptionsSP ParseAutoEnableOptions(Status &error, Debugger &debugger) {
options_property_sp->GetAsString()->GetCurrentValue();
Args args(enable_options);
if (args.GetArgumentCount() > 0) {
- // Eliminate the initial '--' that would be required to set the
- // settings that themselves include '-' and/or '--'.
+ // Eliminate the initial '--' that would be required to set the settings
+ // that themselves include '-' and/or '--'.
const char *first_arg = args.GetArgumentAtIndex(0);
if (first_arg && (strcmp(first_arg, "--") == 0))
args.Shift();
}
- // ParseOptions calls getopt_long_only, which always skips the zero'th item in
- // the array and starts at position 1,
- // so we need to push a dummy value into position zero.
- args.Unshift(llvm::StringRef("dummy_string"));
bool require_validation = false;
- error = args.ParseOptions(*options_sp.get(), &exe_ctx, PlatformSP(),
- require_validation);
- if (!error.Success())
+ llvm::Expected<Args> args_or =
+ options_sp->Parse(args, &exe_ctx, PlatformSP(), require_validation);
+ if (!args_or) {
+ LLDB_LOG_ERROR(
+ log, args_or.takeError(),
+ "Parsing plugin.structured-data.darwin-log.auto-enable-options value "
+ "failed: {0}");
return EnableOptionsSP();
+ }
if (!options_sp->VerifyOptions(result))
return EnableOptionsSP();
@@ -1168,9 +1164,9 @@ void StructuredDataDarwinLog::HandleArrivalOfStructuredData(
return;
}
- // Broadcast the structured data event if we have that enabled.
- // This is the way that the outside world (all clients) get access
- // to this data. This plugin sets policy as to whether we do that.
+ // Broadcast the structured data event if we have that enabled. This is the
+ // way that the outside world (all clients) get access to this data. This
+ // plugin sets policy as to whether we do that.
DebuggerSP debugger_sp = process.GetTarget().GetDebugger().shared_from_this();
auto options_sp = GetGlobalEnableOptions(debugger_sp);
if (options_sp && options_sp->GetBroadcastEvents()) {
@@ -1180,8 +1176,8 @@ void StructuredDataDarwinLog::HandleArrivalOfStructuredData(
process.BroadcastStructuredData(object_sp, shared_from_this());
}
- // Later, hang on to a configurable amount of these and allow commands
- // to inspect, including showing backtraces.
+ // Later, hang on to a configurable amount of these and allow commands to
+ // inspect, including showing backtraces.
}
static void SetErrorWithJSON(Status &error, const char *message,
@@ -1257,8 +1253,8 @@ Status StructuredDataDarwinLog::GetDescription(
return false;
}
- // If we haven't already grabbed the first timestamp
- // value, do that now.
+ // If we haven't already grabbed the first timestamp value, do that
+ // now.
if (!m_recorded_first_timestamp) {
uint64_t timestamp = 0;
if (event->GetValueForKeyAsInteger("timestamp", timestamp)) {
@@ -1296,8 +1292,8 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
// Check if we should enable the darwin log support on startup/attach.
if (!GetGlobalProperties()->GetEnableOnStartup() &&
!s_is_explicitly_enabled) {
- // We're neither auto-enabled or explicitly enabled, so we shouldn't
- // try to enable here.
+ // We're neither auto-enabled or explicitly enabled, so we shouldn't try to
+ // enable here.
if (log)
log->Printf("StructuredDataDarwinLog::%s not applicable, we're not "
"enabled (process uid %u)",
@@ -1317,9 +1313,9 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
}
}
- // The logging support module name, specifies the name of
- // the image name that must be loaded into the debugged process before
- // we can try to enable logging.
+ // The logging support module name, specifies the name of the image name that
+ // must be loaded into the debugged process before we can try to enable
+ // logging.
const char *logging_module_cstr =
GetGlobalProperties()->GetLoggingModuleName();
if (!logging_module_cstr || (logging_module_cstr[0] == 0)) {
@@ -1359,8 +1355,8 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
return;
}
- // Time to enqueue the breakpoint so we can wait for logging support
- // to be initialized before we try to tap the libtrace stream.
+ // Time to enqueue the breakpoint so we can wait for logging support to be
+ // initialized before we try to tap the libtrace stream.
AddInitCompletionHook(process);
if (log)
log->Printf("StructuredDataDarwinLog::%s post-init hook breakpoint "
@@ -1368,13 +1364,13 @@ void StructuredDataDarwinLog::ModulesDidLoad(Process &process,
__FUNCTION__, logging_module_name.AsCString(),
process.GetUniqueID());
- // We need to try the enable here as well, which will succeed
- // in the event that we're attaching to (rather than launching) the
- // process and the process is already past initialization time. In that
- // case, the completion breakpoint will never get hit and therefore won't
- // start that way. It doesn't hurt much beyond a bit of bandwidth
- // if we end up doing this twice. It hurts much more if we don't get
- // the logging enabled when the user expects it.
+ // We need to try the enable here as well, which will succeed in the event
+ // that we're attaching to (rather than launching) the process and the
+ // process is already past initialization time. In that case, the completion
+ // breakpoint will never get hit and therefore won't start that way. It
+ // doesn't hurt much beyond a bit of bandwidth if we end up doing this twice.
+ // It hurts much more if we don't get the logging enabled when the user
+ // expects it.
EnableNow();
}
@@ -1411,8 +1407,7 @@ StructuredDataDarwinLog::StructuredDataDarwinLog(const ProcessWP &process_wp)
StructuredDataPluginSP
StructuredDataDarwinLog::CreateInstance(Process &process) {
- // Currently only Apple targets support the os_log/os_activity
- // protocol.
+ // Currently only Apple targets support the os_log/os_activity protocol.
if (process.GetTarget().GetArchitecture().GetTriple().getVendor() ==
llvm::Triple::VendorType::Apple) {
auto process_wp = ProcessWP(process.shared_from_this());
@@ -1459,20 +1454,20 @@ Status StructuredDataDarwinLog::FilterLaunchInfo(ProcessLaunchInfo &launch_info,
Target *target) {
Status error;
- // If we're not debugging this launched process, there's nothing for us
- // to do here.
+ // If we're not debugging this launched process, there's nothing for us to do
+ // here.
if (!launch_info.GetFlags().AnySet(eLaunchFlagDebug))
return error;
// Darwin os_log() support automatically adds debug-level and info-level
// messages when a debugger is attached to a process. However, with
- // integrated suppport for debugging built into the command-line LLDB,
- // the user may specifically set to *not* include debug-level and info-level
- // content. When the user is using the integrated log support, we want
- // to put the kabosh on that automatic adding of info and debug level.
- // This is done by adding an environment variable to the process on launch.
- // (This also means it is not possible to suppress this behavior if
- // attaching to an already-running app).
+ // integrated support for debugging built into the command-line LLDB, the
+ // user may specifically set to *not* include debug-level and info-level
+ // content. When the user is using the integrated log support, we want to
+ // put the kabosh on that automatic adding of info and debug level. This is
+ // done by adding an environment variable to the process on launch. (This
+ // also means it is not possible to suppress this behavior if attaching to an
+ // already-running app).
// Log *log(GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PLATFORM));
// If the target architecture is not one that supports DarwinLog, we have
@@ -1483,20 +1478,19 @@ Status StructuredDataDarwinLog::FilterLaunchInfo(ProcessLaunchInfo &launch_info,
return error;
}
- // If DarwinLog is not enabled (either by explicit user command or via
- // the auto-enable option), then we have nothing to do.
+ // If DarwinLog is not enabled (either by explicit user command or via the
+ // auto-enable option), then we have nothing to do.
if (!GetGlobalProperties()->GetEnableOnStartup() &&
!s_is_explicitly_enabled) {
// Nothing to do, DarwinLog is not enabled.
return error;
}
- // If we don't have parsed configuration info, that implies we have
- // enable-on-startup set up, but we haven't yet attempted to run the
- // enable command.
+ // If we don't have parsed configuration info, that implies we have enable-
+ // on-startup set up, but we haven't yet attempted to run the enable command.
if (!target) {
- // We really can't do this without a target. We need to be able
- // to get to the debugger to get the proper options to do this right.
+ // We really can't do this without a target. We need to be able to get to
+ // the debugger to get the proper options to do this right.
// TODO log.
error.SetErrorString("requires a target to auto-enable DarwinLog.");
return error;
@@ -1509,34 +1503,28 @@ Status StructuredDataDarwinLog::FilterLaunchInfo(ProcessLaunchInfo &launch_info,
if (!options_sp || !error.Success())
return error;
- // We already parsed the options, save them now so we don't generate
- // them again until the user runs the command manually.
+ // We already parsed the options, save them now so we don't generate them
+ // again until the user runs the command manually.
SetGlobalEnableOptions(debugger_sp, options_sp);
}
- auto &env_vars = launch_info.GetEnvironmentEntries();
if (!options_sp->GetEchoToStdErr()) {
- // The user doesn't want to see os_log/NSLog messages echo to stderr.
- // That mechanism is entirely separate from the DarwinLog support.
- // By default we don't want to get it via stderr, because that would
- // be in duplicate of the explicit log support here.
+ // The user doesn't want to see os_log/NSLog messages echo to stderr. That
+ // mechanism is entirely separate from the DarwinLog support. By default we
+ // don't want to get it via stderr, because that would be in duplicate of
+ // the explicit log support here.
// Here we need to strip out any OS_ACTIVITY_DT_MODE setting to prevent
// echoing of os_log()/NSLog() to stderr in the target program.
- size_t argument_index;
- if (env_vars.ContainsEnvironmentVariable(
- llvm::StringRef("OS_ACTIVITY_DT_MODE"), &argument_index))
- env_vars.DeleteArgumentAtIndex(argument_index);
+ launch_info.GetEnvironment().erase("OS_ACTIVITY_DT_MODE");
- // We will also set the env var that tells any downstream launcher
- // from adding OS_ACTIVITY_DT_MODE.
- env_vars.AddOrReplaceEnvironmentVariable(
- llvm::StringRef("IDE_DISABLED_OS_ACTIVITY_DT_MODE"),
- llvm::StringRef("1"));
+ // We will also set the env var that tells any downstream launcher from
+ // adding OS_ACTIVITY_DT_MODE.
+ launch_info.GetEnvironment()["IDE_DISABLED_OS_ACTIVITY_DT_MODE"] = "1";
}
- // Set the OS_ACTIVITY_MODE env var appropriately to enable/disable
- // debug and info level messages.
+ // Set the OS_ACTIVITY_MODE env var appropriately to enable/disable debug and
+ // info level messages.
const char *env_var_value;
if (options_sp->GetIncludeDebugLevel())
env_var_value = "debug";
@@ -1545,10 +1533,7 @@ Status StructuredDataDarwinLog::FilterLaunchInfo(ProcessLaunchInfo &launch_info,
else
env_var_value = "default";
- if (env_var_value) {
- launch_info.GetEnvironmentEntries().AddOrReplaceEnvironmentVariable(
- llvm::StringRef("OS_ACTIVITY_MODE"), llvm::StringRef(env_var_value));
- }
+ launch_info.GetEnvironment()["OS_ACTIVITY_MODE"] = env_var_value;
return error;
}
@@ -1558,8 +1543,8 @@ bool StructuredDataDarwinLog::InitCompletionHookCallback(
lldb::user_id_t break_loc_id) {
// We hit the init function. We now want to enqueue our new thread plan,
// which will in turn enqueue a StepOut thread plan. When the StepOut
- // finishes and control returns to our new thread plan, that is the time
- // when we can execute our logic to enable the logging support.
+ // finishes and control returns to our new thread plan, that is the time when
+ // we can execute our logic to enable the logging support.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
if (log)
@@ -1618,8 +1603,8 @@ bool StructuredDataDarwinLog::InitCompletionHookCallback(
process_uid);
return;
}
- // Make sure we only call it once, just in case the
- // thread plan hits the breakpoint twice.
+ // Make sure we only call it once, just in case the thread plan hits
+ // the breakpoint twice.
if (!called_enable_method) {
if (log)
log->Printf("StructuredDataDarwinLog::post-init callback: "
@@ -1629,8 +1614,8 @@ bool StructuredDataDarwinLog::InitCompletionHookCallback(
->EnableNow();
called_enable_method = true;
} else {
- // Our breakpoint was hit more than once. Unexpected but
- // no harm done. Log it.
+ // Our breakpoint was hit more than once. Unexpected but no harm
+ // done. Log it.
if (log)
log->Printf("StructuredDataDarwinLog::post-init callback: "
"skipping EnableNow(), already called by "
@@ -1687,8 +1672,8 @@ void StructuredDataDarwinLog::AddInitCompletionHook(Process &process) {
m_added_breakpoint = true;
}
- // Set a breakpoint for the process that will kick in when libtrace
- // has finished its initialization.
+ // Set a breakpoint for the process that will kick in when libtrace has
+ // finished its initialization.
Target &target = process.GetTarget();
// Build up the module list.
@@ -1793,8 +1778,8 @@ StructuredDataDarwinLog::DumpHeader(Stream &output_stream,
if (header_count > 0)
stream.PutChar(',');
- // Display the activity chain, from parent-most to child-most
- // activity, separated by a colon (:).
+ // Display the activity chain, from parent-most to child-most activity,
+ // separated by a colon (:).
stream.PutCString("activity-chain=");
stream.PutCString(activity_chain);
++header_count;
@@ -1836,8 +1821,8 @@ size_t StructuredDataDarwinLog::HandleDisplayOfEvent(
// Check the type of the event.
ConstString event_type;
if (!event.GetValueForKeyAsString("type", event_type)) {
- // Hmm, we expected to get events that describe
- // what they are. Continue anyway.
+ // Hmm, we expected to get events that describe what they are. Continue
+ // anyway.
return 0;
}
@@ -1885,10 +1870,10 @@ void StructuredDataDarwinLog::EnableNow() {
log->Printf("StructuredDataDarwinLog::%s() call is for process uid %u",
__FUNCTION__, process_sp->GetUniqueID());
- // If we have configuration data, we can directly enable it now.
- // Otherwise, we need to run through the command interpreter to parse
- // the auto-run options (which is the only way we get here without having
- // already-parsed configuration data).
+ // If we have configuration data, we can directly enable it now. Otherwise,
+ // we need to run through the command interpreter to parse the auto-run
+ // options (which is the only way we get here without having already-parsed
+ // configuration data).
DebuggerSP debugger_sp =
process_sp->GetTarget().GetDebugger().shared_from_this();
if (!debugger_sp) {
@@ -1901,8 +1886,8 @@ void StructuredDataDarwinLog::EnableNow() {
auto options_sp = GetGlobalEnableOptions(debugger_sp);
if (!options_sp) {
- // We haven't run the enable command yet. Just do that now, it'll
- // take care of the rest.
+ // We haven't run the enable command yet. Just do that now, it'll take
+ // care of the rest.
auto &interpreter = debugger_sp->GetCommandInterpreter();
const bool success = RunEnableCommand(interpreter);
if (log) {
@@ -1925,8 +1910,8 @@ void StructuredDataDarwinLog::EnableNow() {
return;
}
- // We've previously been enabled. We will re-enable now with the
- // previously specified options.
+ // We've previously been enabled. We will re-enable now with the previously
+ // specified options.
auto config_sp = options_sp->BuildConfigurationData(true);
if (!config_sp) {
if (log)
diff --git a/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp b/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
new file mode 100644
index 000000000000..db75cf9c3bb3
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
@@ -0,0 +1,177 @@
+//===-- AppleDWARFIndex.cpp ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/SymbolFile/DWARF/AppleDWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
+#include "Plugins/SymbolFile/DWARF/DWARFUnit.h"
+#include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h"
+
+#include "lldb/Core/Module.h"
+#include "lldb/Symbol/Function.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+std::unique_ptr<AppleDWARFIndex> AppleDWARFIndex::Create(
+ Module &module, DWARFDataExtractor apple_names,
+ DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
+ DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str) {
+ auto apple_names_table_up = llvm::make_unique<DWARFMappedHash::MemoryTable>(
+ apple_names, debug_str, ".apple_names");
+ if (!apple_names_table_up->IsValid())
+ apple_names_table_up.reset();
+
+ auto apple_namespaces_table_up =
+ llvm::make_unique<DWARFMappedHash::MemoryTable>(
+ apple_namespaces, debug_str, ".apple_namespaces");
+ if (!apple_namespaces_table_up->IsValid())
+ apple_namespaces_table_up.reset();
+
+ auto apple_types_table_up = llvm::make_unique<DWARFMappedHash::MemoryTable>(
+ apple_types, debug_str, ".apple_types");
+ if (!apple_types_table_up->IsValid())
+ apple_types_table_up.reset();
+
+ auto apple_objc_table_up = llvm::make_unique<DWARFMappedHash::MemoryTable>(
+ apple_objc, debug_str, ".apple_objc");
+ if (!apple_objc_table_up->IsValid())
+ apple_objc_table_up.reset();
+
+ if (apple_names_table_up || apple_names_table_up || apple_types_table_up ||
+ apple_objc_table_up)
+ return llvm::make_unique<AppleDWARFIndex>(
+ module, std::move(apple_names_table_up),
+ std::move(apple_namespaces_table_up), std::move(apple_types_table_up),
+ std::move(apple_objc_table_up));
+
+ return nullptr;
+}
+
+void AppleDWARFIndex::GetGlobalVariables(ConstString basename, DIEArray &offsets) {
+ if (m_apple_names_up)
+ m_apple_names_up->FindByName(basename.GetStringRef(), offsets);
+}
+
+void AppleDWARFIndex::GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) {
+ if (!m_apple_names_up)
+ return;
+
+ DWARFMappedHash::DIEInfoArray hash_data;
+ if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data))
+ DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
+}
+
+void AppleDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
+ DIEArray &offsets) {
+ if (!m_apple_names_up)
+ return;
+
+ DWARFMappedHash::DIEInfoArray hash_data;
+ if (m_apple_names_up->AppendAllDIEsInRange(
+ cu.GetOffset(), cu.GetNextCompileUnitOffset(), hash_data))
+ DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
+}
+
+void AppleDWARFIndex::GetObjCMethods(ConstString class_name,
+ DIEArray &offsets) {
+ if (m_apple_objc_up)
+ m_apple_objc_up->FindByName(class_name.GetStringRef(), offsets);
+}
+
+void AppleDWARFIndex::GetCompleteObjCClass(ConstString class_name,
+ bool must_be_implementation,
+ DIEArray &offsets) {
+ if (m_apple_types_up) {
+ m_apple_types_up->FindCompleteObjCClassByName(
+ class_name.GetStringRef(), offsets, must_be_implementation);
+ }
+}
+
+void AppleDWARFIndex::GetTypes(ConstString name, DIEArray &offsets) {
+ if (m_apple_types_up)
+ m_apple_types_up->FindByName(name.GetStringRef(), offsets);
+}
+
+void AppleDWARFIndex::GetTypes(const DWARFDeclContext &context,
+ DIEArray &offsets) {
+ if (!m_apple_types_up)
+ return;
+
+ Log *log = LogChannelDWARF::GetLogIfAny(DWARF_LOG_TYPE_COMPLETION |
+ DWARF_LOG_LOOKUPS);
+ const bool has_tag = m_apple_types_up->GetHeader().header_data.ContainsAtom(
+ DWARFMappedHash::eAtomTypeTag);
+ const bool has_qualified_name_hash =
+ m_apple_types_up->GetHeader().header_data.ContainsAtom(
+ DWARFMappedHash::eAtomTypeQualNameHash);
+ const ConstString type_name(context[0].name);
+ const dw_tag_t tag = context[0].tag;
+ if (has_tag && has_qualified_name_hash) {
+ const char *qualified_name = context.GetQualifiedName();
+ const uint32_t qualified_name_hash = llvm::djbHash(qualified_name);
+ if (log)
+ m_module.LogMessage(log, "FindByNameAndTagAndQualifiedNameHash()");
+ m_apple_types_up->FindByNameAndTagAndQualifiedNameHash(
+ type_name.GetStringRef(), tag, qualified_name_hash, offsets);
+ } else if (has_tag) {
+ if (log)
+ m_module.LogMessage(log, "FindByNameAndTag()");
+ m_apple_types_up->FindByNameAndTag(type_name.GetStringRef(), tag, offsets);
+ } else
+ m_apple_types_up->FindByName(type_name.GetStringRef(), offsets);
+}
+
+void AppleDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
+ if (m_apple_namespaces_up)
+ m_apple_namespaces_up->FindByName(name.GetStringRef(), offsets);
+}
+
+void AppleDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) {
+ DIEArray offsets;
+ m_apple_names_up->FindByName(name.GetStringRef(), offsets);
+ for (const DIERef &die_ref : offsets) {
+ ProcessFunctionDIE(name.GetStringRef(), die_ref, info, parent_decl_ctx,
+ name_type_mask, dies);
+ }
+}
+
+void AppleDWARFIndex::GetFunctions(const RegularExpression &regex,
+ DIEArray &offsets) {
+ if (!m_apple_names_up)
+ return;
+
+ DWARFMappedHash::DIEInfoArray hash_data;
+ if (m_apple_names_up->AppendAllDIEsThatMatchingRegex(regex, hash_data))
+ DWARFMappedHash::ExtractDIEArray(hash_data, offsets);
+}
+
+void AppleDWARFIndex::ReportInvalidDIEOffset(dw_offset_t offset,
+ llvm::StringRef name) {
+ m_module.ReportErrorIfModifyDetected(
+ "the DWARF debug information has been modified (accelerator table had "
+ "bad die 0x%8.8x for '%s')\n",
+ offset, name.str().c_str());
+}
+
+void AppleDWARFIndex::Dump(Stream &s) {
+ if (m_apple_names_up)
+ s.PutCString(".apple_names index present\n");
+ if (m_apple_namespaces_up)
+ s.PutCString(".apple_namespaces index present\n");
+ if (m_apple_types_up)
+ s.PutCString(".apple_types index present\n");
+ if (m_apple_objc_up)
+ s.PutCString(".apple_objc index present\n");
+ // TODO: Dump index contents
+}
diff --git a/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h b/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
new file mode 100644
index 000000000000..ea133d0e73cf
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.h
@@ -0,0 +1,64 @@
+//===-- AppleDWARFIndex.h --------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_APPLEDWARFINDEX_H
+#define LLDB_APPLEDWARFINDEX_H
+
+#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/HashedNameToDIE.h"
+
+namespace lldb_private {
+class AppleDWARFIndex : public DWARFIndex {
+public:
+ static std::unique_ptr<AppleDWARFIndex>
+ Create(Module &module, DWARFDataExtractor apple_names,
+ DWARFDataExtractor apple_namespaces, DWARFDataExtractor apple_types,
+ DWARFDataExtractor apple_objc, DWARFDataExtractor debug_str);
+
+ AppleDWARFIndex(
+ Module &module, std::unique_ptr<DWARFMappedHash::MemoryTable> apple_names,
+ std::unique_ptr<DWARFMappedHash::MemoryTable> apple_namespaces,
+ std::unique_ptr<DWARFMappedHash::MemoryTable> apple_types,
+ std::unique_ptr<DWARFMappedHash::MemoryTable> apple_objc)
+ : DWARFIndex(module), m_apple_names_up(std::move(apple_names)),
+ m_apple_namespaces_up(std::move(apple_namespaces)),
+ m_apple_types_up(std::move(apple_types)),
+ m_apple_objc_up(std::move(apple_objc)) {}
+
+ void Preload() override {}
+
+ void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
+ void GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) override;
+ void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
+ void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
+ void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
+ DIEArray &offsets) override;
+ void GetTypes(ConstString name, DIEArray &offsets) override;
+ void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
+ void GetNamespaces(ConstString name, DIEArray &offsets) override;
+ void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) override;
+ void GetFunctions(const RegularExpression &regex, DIEArray &offsets) override;
+
+ void ReportInvalidDIEOffset(dw_offset_t offset,
+ llvm::StringRef name) override;
+ void Dump(Stream &s) override;
+
+private:
+ std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_up;
+ std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_up;
+ std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_up;
+ std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_up;
+};
+} // namespace lldb_private
+
+#endif // LLDB_APPLEDWARFINDEX_H
diff --git a/source/Plugins/SymbolFile/DWARF/CMakeLists.txt b/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
index 05d9e6642868..f62a496f808a 100644
--- a/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
+++ b/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
@@ -1,4 +1,6 @@
add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
+ AppleDWARFIndex.cpp
+ DebugNamesDWARFIndex.cpp
DIERef.cpp
DWARFAbbreviationDeclaration.cpp
DWARFASTParserClang.cpp
@@ -6,6 +8,7 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
DWARFASTParserJava.cpp
DWARFASTParserOCaml.cpp
DWARFAttribute.cpp
+ DWARFBaseDIE.cpp
DWARFCompileUnit.cpp
DWARFDataExtractor.cpp
DWARFDebugAbbrev.cpp
@@ -17,16 +20,17 @@ add_lldb_library(lldbPluginSymbolFileDWARF PLUGIN
DWARFDebugMacro.cpp
DWARFDebugMacinfo.cpp
DWARFDebugMacinfoEntry.cpp
- DWARFDebugPubnames.cpp
- DWARFDebugPubnamesSet.cpp
DWARFDebugRanges.cpp
DWARFDeclContext.cpp
DWARFDefines.cpp
DWARFDIE.cpp
DWARFDIECollection.cpp
DWARFFormValue.cpp
+ DWARFIndex.cpp
+ DWARFUnit.cpp
HashedNameToDIE.cpp
LogChannelDWARF.cpp
+ ManualDWARFIndex.cpp
NameToDIE.cpp
SymbolFileDWARF.cpp
SymbolFileDWARFDwo.cpp
diff --git a/source/Plugins/SymbolFile/DWARF/DIERef.cpp b/source/Plugins/SymbolFile/DWARF/DIERef.cpp
index c05444c031e6..0cd0f0c0272a 100644
--- a/source/Plugins/SymbolFile/DWARF/DIERef.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DIERef.cpp
@@ -8,17 +8,12 @@
//===----------------------------------------------------------------------===//
#include "DIERef.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfo.h"
#include "DWARFFormValue.h"
#include "SymbolFileDWARF.h"
#include "SymbolFileDWARFDebugMap.h"
-DIERef::DIERef()
- : cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) {}
-
-DIERef::DIERef(dw_offset_t c, dw_offset_t d) : cu_offset(c), die_offset(d) {}
-
DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)
: cu_offset(DW_INVALID_OFFSET), die_offset(uid & 0xffffffff) {
SymbolFileDWARFDebugMap *debug_map = dwarf->GetDebugMapSymfile();
@@ -28,7 +23,7 @@ DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)
if (actual_dwarf) {
DWARFDebugInfo *debug_info = actual_dwarf->DebugInfo();
if (debug_info) {
- DWARFCompileUnit *dwarf_cu =
+ DWARFUnit *dwarf_cu =
debug_info->GetCompileUnitContainingDIEOffset(die_offset);
if (dwarf_cu) {
cu_offset = dwarf_cu->GetOffset();
@@ -45,7 +40,7 @@ DIERef::DIERef(lldb::user_id_t uid, SymbolFileDWARF *dwarf)
DIERef::DIERef(const DWARFFormValue &form_value)
: cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) {
if (form_value.IsValid()) {
- const DWARFCompileUnit *dwarf_cu = form_value.GetCompileUnit();
+ const DWARFUnit *dwarf_cu = form_value.GetCompileUnit();
if (dwarf_cu) {
if (dwarf_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
cu_offset = dwarf_cu->GetBaseObjOffset();
diff --git a/source/Plugins/SymbolFile/DWARF/DIERef.h b/source/Plugins/SymbolFile/DWARF/DIERef.h
index d0048d0f6d6b..cb28c890c25a 100644
--- a/source/Plugins/SymbolFile/DWARF/DIERef.h
+++ b/source/Plugins/SymbolFile/DWARF/DIERef.h
@@ -17,9 +17,9 @@ class DWARFFormValue;
class SymbolFileDWARF;
struct DIERef {
- DIERef();
+ DIERef() = default;
- DIERef(dw_offset_t c, dw_offset_t d);
+ DIERef(dw_offset_t c, dw_offset_t d) : cu_offset(c), die_offset(d) {}
//----------------------------------------------------------------------
// In order to properly decode a lldb::user_id_t back into a DIERef we
@@ -45,8 +45,12 @@ struct DIERef {
bool operator<(const DIERef &ref) { return die_offset < ref.die_offset; }
- dw_offset_t cu_offset;
- dw_offset_t die_offset;
+ explicit operator bool() const {
+ return cu_offset != DW_INVALID_OFFSET || die_offset != DW_INVALID_OFFSET;
+ }
+
+ dw_offset_t cu_offset = DW_INVALID_OFFSET;
+ dw_offset_t die_offset = DW_INVALID_OFFSET;
};
typedef std::vector<DIERef> DIEArray;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp b/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
index 54b12cfb3b8c..fe6f1be3ca48 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
@@ -10,13 +10,13 @@
#include <stdlib.h>
#include "DWARFASTParserClang.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDIE.h"
#include "DWARFDIECollection.h"
#include "DWARFDebugInfo.h"
#include "DWARFDeclContext.h"
#include "DWARFDefines.h"
#include "SymbolFileDWARF.h"
+#include "SymbolFileDWARFDwo.h"
#include "SymbolFileDWARFDebugMap.h"
#include "UniqueDWARFASTType.h"
@@ -24,7 +24,6 @@
#include "lldb/Core/Module.h"
#include "lldb/Core/Value.h"
#include "lldb/Host/Host.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Symbol/ClangASTImporter.h"
#include "lldb/Symbol/ClangExternalASTSourceCommon.h"
#include "lldb/Symbol/ClangUtil.h"
@@ -39,8 +38,10 @@
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
+#include "clang/AST/CXXInheritance.h"
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclObjC.h"
+#include "clang/AST/DeclTemplate.h"
#include <map>
#include <vector>
@@ -105,9 +106,9 @@ struct BitfieldInfo {
bool NextBitfieldOffsetIsValid(const uint64_t next_bit_offset) const {
if (IsValid()) {
- // This bitfield info is valid, so any subsequent bitfields
- // must not overlap and must be at a higher bit offset than
- // any previous bitfield + size.
+ // This bitfield info is valid, so any subsequent bitfields must not
+ // overlap and must be at a higher bit offset than any previous bitfield
+ // + size.
return (bit_size + bit_offset) <= next_bit_offset;
} else {
// If the this BitfieldInfo is not valid, then any offset isOK
@@ -123,57 +124,108 @@ ClangASTImporter &DWARFASTParserClang::GetClangASTImporter() {
return *m_clang_ast_importer_ap;
}
+/// Detect a forward declaration that is nested in a DW_TAG_module.
+static bool isClangModuleFwdDecl(const DWARFDIE &Die) {
+ if (!Die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0))
+ return false;
+ auto Parent = Die.GetParent();
+ while (Parent.IsValid()) {
+ if (Parent.Tag() == DW_TAG_module)
+ return true;
+ Parent = Parent.GetParent();
+ }
+ return false;
+}
+
TypeSP DWARFASTParserClang::ParseTypeFromDWO(const DWARFDIE &die, Log *log) {
ModuleSP dwo_module_sp = die.GetContainingDWOModule();
- if (dwo_module_sp) {
- // This type comes from an external DWO module
- std::vector<CompilerContext> dwo_context;
- die.GetDWOContext(dwo_context);
- TypeMap dwo_types;
- if (dwo_module_sp->GetSymbolVendor()->FindTypes(dwo_context, true,
- dwo_types)) {
- const size_t num_dwo_types = dwo_types.GetSize();
- if (num_dwo_types == 1) {
- // We found a real definition for this type elsewhere
- // so lets use it and cache the fact that we found
- // a complete type for this die
- TypeSP dwo_type_sp = dwo_types.GetTypeAtIndex(0);
- if (dwo_type_sp) {
- lldb_private::CompilerType dwo_type =
- dwo_type_sp->GetForwardCompilerType();
-
- lldb_private::CompilerType type =
- GetClangASTImporter().CopyType(m_ast, dwo_type);
-
- // printf ("copied_qual_type: ast = %p, clang_type = %p, name =
- // '%s'\n", m_ast, copied_qual_type.getAsOpaquePtr(),
- // external_type->GetName().GetCString());
- if (type) {
- 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,
- &dwo_type_sp->GetDeclaration(), type,
- Type::eResolveStateForward));
-
- dwarf->GetTypeList()->Insert(type_sp);
- dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
- clang::TagDecl *tag_decl = ClangASTContext::GetAsTagDecl(type);
- if (tag_decl)
- LinkDeclContextToDIE(tag_decl, die);
- else {
- clang::DeclContext *defn_decl_ctx =
- GetCachedClangDeclContextForDIE(die);
- if (defn_decl_ctx)
- LinkDeclContextToDIE(defn_decl_ctx, die);
- }
- return type_sp;
- }
- }
- }
+ if (!dwo_module_sp)
+ return TypeSP();
+
+ // This type comes from an external DWO module.
+ std::vector<CompilerContext> dwo_context;
+ die.GetDWOContext(dwo_context);
+ TypeMap dwo_types;
+
+ if (!dwo_module_sp->GetSymbolVendor()->FindTypes(dwo_context, true,
+ dwo_types)) {
+ if (!isClangModuleFwdDecl(die))
+ return TypeSP();
+
+ // Since this this type is defined in one of the Clang modules imported by
+ // this symbol file, search all of them.
+ auto *SymFile = die.GetCU()->GetSymbolFileDWARF();
+ for (const auto &NameModule : SymFile->getExternalTypeModules()) {
+ if (!NameModule.second)
+ continue;
+ SymbolVendor *SymVendor = NameModule.second->GetSymbolVendor();
+ if (SymVendor->FindTypes(dwo_context, true, dwo_types))
+ break;
}
}
- return TypeSP();
+
+ const size_t num_dwo_types = dwo_types.GetSize();
+ if (num_dwo_types != 1)
+ return TypeSP();
+
+ // We found a real definition for this type in the Clang module, so lets use
+ // it and cache the fact that we found a complete type for this die.
+ TypeSP dwo_type_sp = dwo_types.GetTypeAtIndex(0);
+ if (!dwo_type_sp)
+ return TypeSP();
+
+ lldb_private::CompilerType dwo_type = dwo_type_sp->GetForwardCompilerType();
+
+ lldb_private::CompilerType type =
+ GetClangASTImporter().CopyType(m_ast, dwo_type);
+
+ if (!type)
+ return TypeSP();
+
+ 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,
+ &dwo_type_sp->GetDeclaration(), type, Type::eResolveStateForward));
+
+ dwarf->GetTypeList()->Insert(type_sp);
+ dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
+ clang::TagDecl *tag_decl = ClangASTContext::GetAsTagDecl(type);
+ if (tag_decl)
+ LinkDeclContextToDIE(tag_decl, die);
+ else {
+ clang::DeclContext *defn_decl_ctx = GetCachedClangDeclContextForDIE(die);
+ if (defn_decl_ctx)
+ LinkDeclContextToDIE(defn_decl_ctx, die);
+ }
+
+ return type_sp;
+}
+
+static void CompleteExternalTagDeclType(ClangASTImporter &ast_importer,
+ clang::DeclContext *decl_ctx,
+ DWARFDIE die,
+ const char *type_name_cstr) {
+ auto *tag_decl_ctx = clang::dyn_cast<clang::TagDecl>(decl_ctx);
+ if (!tag_decl_ctx)
+ return;
+
+ // If this type was not imported from an external AST, there's nothing to do.
+ CompilerType type = ClangASTContext::GetTypeForDecl(tag_decl_ctx);
+ if (!type || !ast_importer.CanImport(type))
+ return;
+
+ auto qual_type = ClangUtil::GetQualType(type);
+ if (!ast_importer.RequireCompleteType(qual_type)) {
+ die.GetDWARF()->GetObjectFile()->GetModule()->ReportError(
+ "Unable to complete the Decl context for DIE '%s' at offset "
+ "0x%8.8x.\nPlease file a bug report.",
+ type_name_cstr ? type_name_cstr : "", die.GetOffset());
+ // We need to make the type look complete otherwise, we might crash in
+ // Clang when adding children.
+ if (ClangASTContext::StartTagDeclarationDefinition(type))
+ ClangASTContext::CompleteTagDeclarationDefinition(type);
+ }
}
TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
@@ -198,17 +250,6 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
die.GetOffset(), static_cast<void *>(context),
context_die.GetOffset(), die.GetTagAsCString(), die.GetName());
}
- //
- // Log *log (LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
- // if (log && dwarf_cu)
- // {
- // StreamString s;
- // die->DumpLocation (this, dwarf_cu, s);
- // dwarf->GetObjectFile()->GetModule()->LogMessage (log,
- // "SymbolFileDwarf::%s %s", __FUNCTION__, s.GetData());
- //
- // }
-
Type *type_ptr = dwarf->GetDIEToType().lookup(die.GetDIE());
TypeList *type_list = dwarf->GetTypeList();
if (type_ptr == NULL) {
@@ -220,6 +261,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
bool is_forward_declaration = false;
DWARFAttributes attributes;
const char *type_name_cstr = NULL;
+ const char *mangled_name_cstr = NULL;
ConstString type_name_const_str;
Type::ResolveState resolve_state = Type::eResolveStateUnresolved;
uint64_t byte_size = 0;
@@ -268,8 +310,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
type_name_cstr = form_value.AsCString();
// Work around a bug in llvm-gcc where they give a name to a
- // reference type which doesn't
- // include the "&"...
+ // reference type which doesn't include the "&"...
if (tag == DW_TAG_reference_type) {
if (strchr(type_name_cstr, '&') == NULL)
type_name_cstr = NULL;
@@ -295,32 +336,32 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
if (tag == DW_TAG_typedef && encoding_uid.IsValid()) {
- // Try to parse a typedef from the DWO file first as modules
- // can contain typedef'ed structures that have no names like:
+ // Try to parse a typedef from the DWO file first as modules can
+ // contain typedef'ed structures that have no names like:
//
// typedef struct { int a; } Foo;
//
- // In this case we will have a structure with no name and a
- // typedef named "Foo" that points to this unnamed structure.
- // The name in the typedef is the only identifier for the struct,
- // so always try to get typedefs from DWO files if possible.
+ // In this case we will have a structure with no name and a typedef
+ // named "Foo" that points to this unnamed structure. The name in the
+ // typedef is the only identifier for the struct, so always try to
+ // get typedefs from DWO files if possible.
//
- // The type_sp returned will be empty if the typedef doesn't exist
- // in a DWO file, so it is cheap to call this function just to check.
+ // The type_sp returned will be empty if the typedef doesn't exist in
+ // a DWO file, so it is cheap to call this function just to check.
//
- // If we don't do this we end up creating a TypeSP that says this
- // is a typedef to type 0x123 (the DW_AT_type value would be 0x123
- // in the DW_TAG_typedef), and this is the unnamed structure type.
- // We will have a hard time tracking down an unnammed structure
- // type in the module DWO file, so we make sure we don't get into
- // this situation by always resolving typedefs from the DWO file.
+ // If we don't do this we end up creating a TypeSP that says this is
+ // a typedef to type 0x123 (the DW_AT_type value would be 0x123 in
+ // the DW_TAG_typedef), and this is the unnamed structure type. We
+ // will have a hard time tracking down an unnammed structure type in
+ // the module DWO file, so we make sure we don't get into this
+ // situation by always resolving typedefs from the DWO file.
const DWARFDIE encoding_die = dwarf->GetDIE(DIERef(encoding_uid));
- // First make sure that the die that this is typedef'ed to _is_
- // just a declaration (DW_AT_declaration == 1), not a full definition
+ // First make sure that the die that this is typedef'ed to _is_ just
+ // a declaration (DW_AT_declaration == 1), not a full definition
// since template types can't be represented in modules since only
- // concrete instances of templates are ever emitted and modules
- // won't contain those
+ // concrete instances of templates are ever emitted and modules won't
+ // contain those
if (encoding_die &&
encoding_die.GetAttributeValueAsUnsigned(DW_AT_declaration, 0) ==
1) {
@@ -433,7 +474,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' "
- "is Objective C 'id' built-in type.",
+ "is Objective-C 'id' built-in type.",
die.GetOffset(), die.GetTagAsCString(), die.GetName());
clang_type = m_ast.GetBasicType(eBasicTypeObjCID);
encoding_data_type = Type::eEncodingIsUID;
@@ -444,7 +485,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' "
- "is Objective C 'Class' built-in type.",
+ "is Objective-C 'Class' built-in type.",
die.GetOffset(), die.GetTagAsCString(), die.GetName());
clang_type = m_ast.GetBasicType(eBasicTypeObjCClass);
encoding_data_type = Type::eEncodingIsUID;
@@ -454,7 +495,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (log)
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF::ParseType (die = 0x%8.8x) %s '%s' "
- "is Objective C 'selector' built-in type.",
+ "is Objective-C 'selector' built-in type.",
die.GetOffset(), die.GetTagAsCString(), die.GetName());
clang_type = m_ast.GetBasicType(eBasicTypeObjCSel);
encoding_data_type = Type::eEncodingIsUID;
@@ -495,17 +536,6 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
&decl, clang_type, resolve_state));
dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
-
- // Type* encoding_type =
- // GetUniquedTypeForDIEOffset(encoding_uid, type_sp,
- // NULL, 0, 0, false);
- // if (encoding_type != NULL)
- // {
- // if (encoding_type != DIE_IS_BEING_PARSED)
- // type_sp->SetEncodingType(encoding_type);
- // else
- // m_indirect_fixups.push_back(type_sp.get());
- // }
} break;
case DW_TAG_structure_type:
@@ -517,7 +547,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
LanguageType class_language = eLanguageTypeUnknown;
bool is_complete_objc_class = false;
- // bool struct_is_class = false;
+ size_t calling_convention
+ = llvm::dwarf::CallingConvention::DW_CC_normal;
+
const size_t num_attributes = die.GetAttributes(attributes);
if (num_attributes > 0) {
uint32_t i;
@@ -528,10 +560,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
case DW_AT_decl_file:
if (die.GetCU()->DW_AT_decl_file_attributes_are_invalid()) {
// llvm-gcc outputs invalid DW_AT_decl_file attributes that
- // always
- // point to the compile unit file, so we clear this invalid
- // value
- // so that we can still unique types efficiently.
+ // always point to the compile unit file, so we clear this
+ // invalid value so that we can still unique types
+ // efficiently.
decl.SetFile(FileSpec("<invalid>", false));
} else
decl.SetFile(
@@ -572,7 +603,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
case DW_AT_APPLE_objc_complete_type:
is_complete_objc_class = form_value.Signed();
break;
-
+ case DW_AT_calling_convention:
+ calling_convention = form_value.Unsigned();
+ break;
+
case DW_AT_allocated:
case DW_AT_associated:
case DW_AT_data_location:
@@ -587,10 +621,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
}
- // UniqueDWARFASTType is large, so don't create a local variables on the
- // stack, put it on the heap. This function is often called recursively
- // and clang isn't good and sharing the stack space for variables in
- // different blocks.
+ // UniqueDWARFASTType is large, so don't create a local variables on
+ // the stack, put it on the heap. This function is often called
+ // recursively and clang isn't good and sharing the stack space for
+ // variables in different blocks.
std::unique_ptr<UniqueDWARFASTType> unique_ast_entry_ap(
new UniqueDWARFASTType());
@@ -601,10 +635,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
LanguageType die_language = die.GetLanguage();
if (Language::LanguageIsCPlusPlus(die_language)) {
// For C++, we rely solely upon the one definition rule that says
- // only
- // one thing can exist at a given decl context. We ignore the file
- // and
- // line that things are declared on.
+ // only one thing can exist at a given decl context. We ignore the
+ // file and line that things are declared on.
std::string qualified_name;
if (die.GetQualifiedName(qualified_name))
unique_typename = ConstString(qualified_name);
@@ -641,17 +673,16 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (byte_size_valid && byte_size == 0 && type_name_cstr &&
die.HasChildren() == false &&
sc.comp_unit->GetLanguage() == eLanguageTypeObjC) {
- // Work around an issue with clang at the moment where
- // forward declarations for objective C classes are emitted
- // as:
+ // Work around an issue with clang at the moment where forward
+ // declarations for objective C classes are emitted as:
// DW_TAG_structure_type [2]
// DW_AT_name( "ForwardObjcClass" )
// DW_AT_byte_size( 0x00 )
// DW_AT_decl_file( "..." )
// DW_AT_decl_line( 1 )
//
- // Note that there is no DW_AT_declaration and there are
- // no children, and the byte size is zero.
+ // Note that there is no DW_AT_declaration and there are no children,
+ // and the byte size is zero.
is_forward_declaration = true;
}
@@ -659,11 +690,11 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
class_language == eLanguageTypeObjC_plus_plus) {
if (!is_complete_objc_class &&
die.Supports_DW_AT_APPLE_objc_complete_type()) {
- // We have a valid eSymbolTypeObjCClass class symbol whose
- // name matches the current objective C class that we
- // are trying to find and this DIE isn't the complete
- // definition (we checked is_complete_objc_class above and
- // know it is false), so the real definition is in here somewhere
+ // We have a valid eSymbolTypeObjCClass class symbol whose name
+ // matches the current objective C class that we are trying to find
+ // and this DIE isn't the complete definition (we checked
+ // is_complete_objc_class above and know it is false), so the real
+ // definition is in here somewhere
type_sp = dwarf->FindCompleteObjCDefinitionTypeForDIE(
die, type_name_const_str, true);
@@ -671,9 +702,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
SymbolFileDWARFDebugMap *debug_map_symfile =
dwarf->GetDebugMapSymfile();
if (debug_map_symfile) {
- // We weren't able to find a full declaration in
- // this DWARF, see if we have a declaration anywhere
- // else...
+ // We weren't able to find a full declaration in this DWARF,
+ // see if we have a declaration anywhere else...
type_sp =
debug_map_symfile->FindCompleteObjCDefinitionTypeForDIE(
die, type_name_const_str, true);
@@ -690,9 +720,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
type_sp->GetID());
}
- // We found a real definition for this type elsewhere
- // so lets use it and cache the fact that we found
- // a complete type for this die
+ // We found a real definition for this type elsewhere so lets use
+ // it and cache the fact that we found a complete type for this
+ // die
dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
return type_sp;
}
@@ -700,11 +730,11 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
if (is_forward_declaration) {
- // We have a forward declaration to a type and we need
- // to try and find a full declaration. We look in the
- // current type index just in case we have a forward
- // declaration followed by an actual declarations in the
- // DWARF. If this fails, we need to look elsewhere...
+ // We have a forward declaration to a type and we need to try and
+ // find a full declaration. We look in the current type index just in
+ // case we have a forward declaration followed by an actual
+ // declarations in the DWARF. If this fails, we need to look
+ // elsewhere...
if (log) {
dwarf->GetObjectFile()->GetModule()->LogMessage(
log, "SymbolFileDWARF(%p) - 0x%8.8x: %s type \"%s\" is a "
@@ -730,9 +760,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
SymbolFileDWARFDebugMap *debug_map_symfile =
dwarf->GetDebugMapSymfile();
if (debug_map_symfile) {
- // We weren't able to find a full declaration in
- // this DWARF, see if we have a declaration anywhere
- // else...
+ // We weren't able to find a full declaration in this DWARF, see
+ // if we have a declaration anywhere else...
type_sp =
debug_map_symfile->FindDefinitionTypeForDWARFDeclContext(
die_decl_ctx);
@@ -748,9 +777,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
DW_TAG_value_to_name(tag), type_name_cstr, type_sp->GetID());
}
- // We found a real definition for this type elsewhere
- // so lets use it and cache the fact that we found
- // a complete type for this die
+ // We found a real definition for this type elsewhere so lets use
+ // it and cache the fact that we found a complete type for this die
dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
clang::DeclContext *defn_decl_ctx = GetCachedClangDeclContextForDIE(
dwarf->DebugInfo()->GetDIE(DIERef(type_sp->GetID(), dwarf)));
@@ -766,9 +794,18 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (!clang_type) {
clang::DeclContext *decl_ctx =
GetClangDeclContextContainingDIE(die, nullptr);
+
+ // If your decl context is a record that was imported from another
+ // AST context (in the gmodules case), we need to make sure the type
+ // backing the Decl is complete before adding children to it. This is
+ // not an issue in the non-gmodules case because the debug info will
+ // always contain a full definition of parent types in that case.
+ CompleteExternalTagDeclType(GetClangASTImporter(), decl_ctx, die,
+ type_name_cstr);
+
if (accessibility == eAccessNone && decl_ctx) {
- // Check the decl context that contains this class/struct/union.
- // If it is a class we must give it an accessibility.
+ // Check the decl context that contains this class/struct/union. If
+ // it is a class we must give it an accessibility.
const clang::Decl::Kind containing_decl_kind =
decl_ctx->getDeclKind();
if (DeclKindIsCXXClass(containing_decl_kind))
@@ -818,10 +855,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
class_language, &metadata);
}
}
-
+
// Store a forward declaration to this class type in case any
- // parameters in any class methods need it for the clang
- // types for function prototypes.
+ // parameters in any class methods need it for the clang types for
+ // function prototypes.
LinkDeclContextToDIE(m_ast.GetDeclContextForType(clang_type), die);
type_sp.reset(new Type(die.GetID(), dwarf, type_name_const_str,
byte_size, NULL, LLDB_INVALID_UID,
@@ -830,9 +867,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
type_sp->SetIsCompleteObjCClass(is_complete_objc_class);
- // Add our type to the unique type map so we don't
- // end up creating many copies of the same type over
- // and over in the ASTContext for our module
+ // Add our type to the unique type map so we don't end up creating many
+ // copies of the same type over and over in the ASTContext for our
+ // module
unique_ast_entry_ap->m_type_sp = type_sp;
unique_ast_entry_ap->m_die = die;
unique_ast_entry_ap->m_declaration = unique_decl;
@@ -844,8 +881,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
// Check to see if the DIE actually has a definition, some version of
// GCC will
// emit DIEs with DW_AT_declaration set to true, but yet still have
- // subprogram,
- // members, or inheritance, so we can't trust it
+ // subprogram, members, or inheritance, so we can't trust it
DWARFDIE child_die = die.GetFirstChild();
while (child_die) {
switch (child_die.Tag()) {
@@ -869,10 +905,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
if (!is_forward_declaration) {
- // Always start the definition for a class type so that
- // if the class has child classes or types that require
- // the class to be created for use as their decl contexts
- // the class will be ready to accept these child definitions.
+ // Always start the definition for a class type so that if the class
+ // has child classes or types that require the class to be created
+ // for use as their decl contexts the class will be ready to accept
+ // these child definitions.
if (die.HasChildren() == false) {
// No children for this struct/union/class, lets finish it
if (ClangASTContext::StartTagDeclarationDefinition(clang_type)) {
@@ -896,33 +932,30 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
}
} else if (clang_type_was_created) {
- // Start the definition if the class is not objective C since
- // the underlying decls respond to isCompleteDefinition(). Objective
+ // Start the definition if the class is not objective C since the
+ // underlying decls respond to isCompleteDefinition(). Objective
// C decls don't respond to isCompleteDefinition() so we can't
// start the declaration definition right away. For C++
- // class/union/structs
- // we want to start the definition in case the class is needed as
- // the
- // declaration context for a contained class or type without the
- // need
- // to complete that type..
+ // class/union/structs we want to start the definition in case the
+ // class is needed as the declaration context for a contained class
+ // or type without the need to complete that type..
if (class_language != eLanguageTypeObjC &&
class_language != eLanguageTypeObjC_plus_plus)
ClangASTContext::StartTagDeclarationDefinition(clang_type);
- // Leave this as a forward declaration until we need
- // to know the details of the type. lldb_private::Type
- // will automatically call the SymbolFile virtual function
- // "SymbolFileDWARF::CompleteType(Type *)"
- // When the definition needs to be defined.
+ // Leave this as a forward declaration until we need to know the
+ // details of the type. lldb_private::Type will automatically call
+ // the SymbolFile virtual function
+ // "SymbolFileDWARF::CompleteType(Type *)" When the definition
+ // needs to be defined.
assert(!dwarf->GetForwardDeclClangTypeToDie().count(
ClangUtil::RemoveFastQualifiers(clang_type)
.GetOpaqueQualType()) &&
"Type already in the forward declaration map!");
- // Can't assume m_ast.GetSymbolFile() is actually a SymbolFileDWARF,
- // it can be a
- // SymbolFileDWARFDebugMap for Apple binaries.
+ // Can't assume m_ast.GetSymbolFile() is actually a
+ // SymbolFileDWARF, it can be a SymbolFileDWARFDebugMap for Apple
+ // binaries.
dwarf->GetForwardDeclDieToClangType()[die.GetDIE()] =
clang_type.GetOpaqueQualType();
dwarf->GetForwardDeclClangTypeToDie()
@@ -931,6 +964,19 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), true);
}
}
+
+ // If we made a clang type, set the trivial abi if applicable: We only
+ // do this for pass by value - which implies the Trivial ABI. There
+ // isn't a way to assert that something that would normally be pass by
+ // value is pass by reference, so we ignore that attribute if set.
+ if (calling_convention == llvm::dwarf::DW_CC_pass_by_value) {
+ clang::CXXRecordDecl *record_decl =
+ m_ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType());
+ if (record_decl) {
+ record_decl->setHasTrivialSpecialMemberForCall();
+ }
+ }
+
} break;
case DW_TAG_enumeration_type: {
@@ -1008,9 +1054,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
SymbolFileDWARFDebugMap *debug_map_symfile =
dwarf->GetDebugMapSymfile();
if (debug_map_symfile) {
- // We weren't able to find a full declaration in
- // this DWARF, see if we have a declaration anywhere
- // else...
+ // We weren't able to find a full declaration in this DWARF,
+ // see if we have a declaration anywhere else...
type_sp =
debug_map_symfile->FindDefinitionTypeForDWARFDeclContext(
die_decl_ctx);
@@ -1027,9 +1072,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
type_sp->GetID());
}
- // We found a real definition for this type elsewhere
- // so lets use it and cache the fact that we found
- // a complete type for this die
+ // We found a real definition for this type elsewhere so lets use
+ // it and cache the fact that we found a complete type for this
+ // die
dwarf->GetDIEToType()[die.GetDIE()] = type_sp.get();
clang::DeclContext *defn_decl_ctx =
GetCachedClangDeclContextForDIE(dwarf->DebugInfo()->GetDIE(
@@ -1145,9 +1190,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
case DW_AT_linkage_name:
case DW_AT_MIPS_linkage_name:
- break; // mangled =
- // form_value.AsCString(&dwarf->get_debug_str_data());
- // break;
+ mangled_name_cstr = form_value.AsCString();
+ break;
case DW_AT_type:
type_die_form = form_value;
break;
@@ -1256,8 +1300,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
bool is_cxx_method = DeclKindIsCXXClass(containing_decl_kind);
// Start off static. This will be set to false in
- // ParseChildParameters(...)
- // if we find a "this" parameters as the first parameter
+ // ParseChildParameters(...) if we find a "this" parameters as the
+ // first parameter
if (is_cxx_method) {
is_static = true;
}
@@ -1272,25 +1316,22 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
bool ignore_containing_context = false;
// Check for templatized class member functions. If we had any
- // DW_TAG_template_type_parameter
- // or DW_TAG_template_value_parameter the DW_TAG_subprogram DIE, then we
- // can't let this become
- // a method in a class. Why? Because templatized functions are only
- // emitted if one of the
- // templatized methods is used in the current compile unit and we will
- // end up with classes
- // that may or may not include these member functions and this means one
- // class won't match another
- // class definition and it affects our ability to use a class in the
- // clang expression parser. So
- // for the greater good, we currently must not allow any template member
- // functions in a class definition.
+ // DW_TAG_template_type_parameter or DW_TAG_template_value_parameter
+ // the DW_TAG_subprogram DIE, then we can't let this become a method in
+ // a class. Why? Because templatized functions are only emitted if one
+ // of the templatized methods is used in the current compile unit and
+ // we will end up with classes that may or may not include these member
+ // functions and this means one class won't match another class
+ // definition and it affects our ability to use a class in the clang
+ // expression parser. So for the greater good, we currently must not
+ // allow any template member functions in a class definition.
if (is_cxx_method && has_template_params) {
ignore_containing_context = true;
is_cxx_method = false;
}
- // clang_type will get the function prototype clang type after this call
+ // clang_type will get the function prototype clang type after this
+ // call
clang_type = m_ast.CreateFunctionType(
return_clang_type, function_param_types.data(),
function_param_types.size(), is_variadic, type_quals);
@@ -1318,8 +1359,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (class_opaque_type) {
// If accessibility isn't set to anything valid, assume public
- // for
- // now...
+ // for now...
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
@@ -1341,9 +1381,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
}
} else if (is_cxx_method) {
- // Look at the parent of this DIE and see if is is
- // a class or struct and see if this is actually a
- // C++ method
+ // Look at the parent of this DIE and see if is is a class or
+ // struct and see if this is actually a C++ method
Type *class_type = dwarf->ResolveType(decl_ctx_die);
if (class_type) {
bool alternate_defn = false;
@@ -1352,10 +1391,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
alternate_defn = true;
// We uniqued the parent class of this function to another
- // class
- // so we now need to associate all dies under "decl_ctx_die"
- // to
- // DIEs in the DIE for "class_type"...
+ // class so we now need to associate all dies under
+ // "decl_ctx_die" to DIEs in the DIE for "class_type"...
SymbolFileDWARF *class_symfile = NULL;
DWARFDIE class_type_die;
@@ -1381,10 +1418,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
// FIXME do something with these failures that's smarter
// than
// just dropping them on the ground. Unfortunately classes
- // don't
- // like having stuff added to them after their definitions
- // are
- // complete...
+ // don't like having stuff added to them after their
+ // definitions are complete...
type_ptr = dwarf->GetDIEToType()[die.GetDIE()];
if (type_ptr && type_ptr != DIE_IS_BEING_PARSED) {
@@ -1396,16 +1431,13 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (specification_die_form.IsValid()) {
// We have a specification which we are going to base our
- // function
- // prototype off of, so we need this type to be completed so
- // that the
- // m_die_to_decl_ctx for the method in the specification has a
- // valid
- // clang decl context.
+ // function prototype off of, so we need this type to be
+ // completed so that the m_die_to_decl_ctx for the method in
+ // the specification has a valid clang decl context.
class_type->GetForwardCompilerType();
// If we have a specification, then the function type should
- // have been
- // made with the specification and not with this die.
+ // have been made with the specification and not with this
+ // die.
DWARFDIE spec_die = dwarf->DebugInfo()->GetDIE(
DIERef(specification_die_form));
clang::DeclContext *spec_clang_decl_ctx =
@@ -1421,12 +1453,9 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
type_handled = true;
} else if (abstract_origin_die_form.IsValid()) {
// We have a specification which we are going to base our
- // function
- // prototype off of, so we need this type to be completed so
- // that the
- // m_die_to_decl_ctx for the method in the abstract origin has
- // a valid
- // clang decl context.
+ // function prototype off of, so we need this type to be
+ // completed so that the m_die_to_decl_ctx for the method in
+ // the abstract origin has a valid clang decl context.
class_type->GetForwardCompilerType();
DWARFDIE abs_die = dwarf->DebugInfo()->GetDIE(
@@ -1449,17 +1478,16 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
if (class_opaque_type.IsBeingDefined() || alternate_defn) {
if (!is_static && !die.HasChildren()) {
// We have a C++ member function with no children (this
- // pointer!)
- // and clang will get mad if we try and make a function
- // that isn't
- // well formed in the DWARF, so we will just skip it...
+ // pointer!) and clang will get mad if we try and make
+ // a function that isn't well formed in the DWARF, so
+ // we will just skip it...
type_handled = true;
} else {
bool add_method = true;
if (alternate_defn) {
// If an alternate definition for the class exists,
- // then add the method only if an
- // equivalent is not already present.
+ // then add the method only if an equivalent is not
+ // already present.
clang::CXXRecordDecl *record_decl =
m_ast.GetAsCXXRecordDecl(
class_opaque_type.GetOpaqueQualType());
@@ -1499,18 +1527,18 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
const bool is_attr_used = false;
// Neither GCC 4.2 nor clang++ currently set a valid
- // accessibility
- // in the DWARF for C++ methods... Default to public
- // for now...
+ // accessibility in the DWARF for C++ methods...
+ // Default to public for now...
if (accessibility == eAccessNone)
accessibility = eAccessPublic;
clang::CXXMethodDecl *cxx_method_decl =
m_ast.AddMethodToCXXRecordType(
class_opaque_type.GetOpaqueQualType(),
- type_name_cstr, clang_type, accessibility,
- is_virtual, is_static, is_inline, is_explicit,
- is_attr_used, is_artificial);
+ type_name_cstr, mangled_name_cstr, clang_type,
+ accessibility, is_virtual, is_static,
+ is_inline, is_explicit, is_attr_used,
+ is_artificial);
type_handled = cxx_method_decl != NULL;
@@ -1541,25 +1569,21 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
} else {
// We were asked to parse the type for a method in a
- // class, yet the
- // class hasn't been asked to complete itself through the
- // clang::ExternalASTSource protocol, so we need to just
- // have the
- // class complete itself and do things the right way, then
- // our
+ // class, yet the class hasn't been asked to complete
+ // itself through the clang::ExternalASTSource protocol,
+ // so we need to just have the class complete itself and
+ // do things the right way, then our
// DIE should then have an entry in the
// dwarf->GetDIEToType() map. First
// we need to modify the dwarf->GetDIEToType() so it
- // doesn't think we are
- // trying to parse this DIE anymore...
+ // doesn't think we are trying to parse this DIE
+ // anymore...
dwarf->GetDIEToType()[die.GetDIE()] = NULL;
// Now we get the full type to force our class type to
- // complete itself
- // using the clang::ExternalASTSource protocol which will
- // parse all
- // base classes and all methods (including the method for
- // this DIE).
+ // complete itself using the clang::ExternalASTSource
+ // protocol which will parse all base classes and all
+ // methods (including the method for this DIE).
class_type->GetFullCompilerType();
// The type for this DIE should have been filled in the
@@ -1573,8 +1597,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
// FIXME This is fixing some even uglier behavior but we
// really need to
// uniq the methods of each class as well as the class
- // itself.
- // <rdar://problem/11240464>
+ // itself. <rdar://problem/11240464>
type_handled = true;
}
}
@@ -1737,8 +1760,7 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
array_element_type.GetCompleteType() == false) {
ModuleSP module_sp = die.GetModule();
if (module_sp) {
- if (die.GetCU()->GetProducer() ==
- DWARFCompileUnit::eProducerClang)
+ if (die.GetCU()->GetProducer() == eProducerClang)
module_sp->ReportError(
"DWARF DW_TAG_array_type DIE at 0x%8.8x has a "
"class/union/struct element type DIE 0x%8.8x that is a "
@@ -1760,11 +1782,10 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
}
// We have no choice other than to pretend that the element class
- // type
- // is complete. If we don't do this, clang will crash when trying
- // to layout the class. Since we provide layout assistance, all
- // ivars in this class and other classes will be fine, this is
- // the best we can do short of crashing.
+ // type is complete. If we don't do this, clang will crash when
+ // trying to layout the class. Since we provide layout
+ // assistance, all ivars in this class and other classes will be
+ // fine, this is the best we can do short of crashing.
if (ClangASTContext::StartTagDeclarationDefinition(
array_element_type)) {
ClangASTContext::CompleteTagDeclarationDefinition(
@@ -1864,7 +1885,8 @@ TypeSP DWARFASTParserClang::ParseTypeFromDWARF(const SymbolContext &sc,
dw_tag_t sc_parent_tag = sc_parent_die.Tag();
SymbolContextScope *symbol_context_scope = NULL;
- if (sc_parent_tag == DW_TAG_compile_unit) {
+ if (sc_parent_tag == DW_TAG_compile_unit ||
+ sc_parent_tag == DW_TAG_partial_unit) {
symbol_context_scope = sc.comp_unit;
} else if (sc.function != NULL && sc_parent_die) {
symbol_context_scope =
@@ -1956,6 +1978,7 @@ bool DWARFASTParserClang::ParseTemplateDIE(
const DWARFDIE &die,
ClangASTContext::TemplateParameterInfos &template_param_infos) {
const dw_tag_t tag = die.Tag();
+ bool is_template_template_argument = false;
switch (tag) {
case DW_TAG_GNU_template_parameter_pack: {
@@ -1971,11 +1994,15 @@ bool DWARFASTParserClang::ParseTemplateDIE(
}
return true;
}
+ case DW_TAG_GNU_template_template_param:
+ is_template_template_argument = true;
+ LLVM_FALLTHROUGH;
case DW_TAG_template_type_parameter:
case DW_TAG_template_value_parameter: {
DWARFAttributes attributes;
const size_t num_attributes = die.GetAttributes(attributes);
const char *name = nullptr;
+ const char *template_name = nullptr;
CompilerType clang_type;
uint64_t uval64 = 0;
bool uval64_valid = false;
@@ -1990,6 +2017,11 @@ bool DWARFASTParserClang::ParseTemplateDIE(
name = form_value.AsCString();
break;
+ case DW_AT_GNU_template_name:
+ if (attributes.ExtractFormValueAtIndex(i, form_value))
+ template_name = form_value.AsCString();
+ break;
+
case DW_AT_type:
if (attributes.ExtractFormValueAtIndex(i, form_value)) {
Type *lldb_type = die.ResolveTypeUID(DIERef(form_value));
@@ -2013,7 +2045,7 @@ bool DWARFASTParserClang::ParseTemplateDIE(
if (!clang_type)
clang_type = m_ast.GetBasicType(eBasicTypeVoid);
- if (clang_type) {
+ if (!is_template_template_argument) {
bool is_signed = false;
if (name && name[0])
template_param_infos.names.push_back(name);
@@ -2033,7 +2065,10 @@ bool DWARFASTParserClang::ParseTemplateDIE(
clang::TemplateArgument(ClangUtil::GetQualType(clang_type)));
}
} else {
- return false;
+ auto *tplt_type = m_ast.CreateTemplateTemplateParmDecl(template_name);
+ template_param_infos.names.push_back(name);
+ template_param_infos.args.push_back(
+ clang::TemplateArgument(clang::TemplateName(tplt_type)));
}
}
}
@@ -2052,7 +2087,6 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(
if (!parent_die)
return false;
- Args template_parameter_names;
for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid();
die = die.GetSibling()) {
const dw_tag_t tag = die.Tag();
@@ -2061,6 +2095,7 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(
case DW_TAG_template_type_parameter:
case DW_TAG_template_value_parameter:
case DW_TAG_GNU_template_parameter_pack:
+ case DW_TAG_GNU_template_template_param:
ParseTemplateDIE(die, template_param_infos);
break;
@@ -2073,6 +2108,95 @@ bool DWARFASTParserClang::ParseTemplateParameterInfos(
return template_param_infos.args.size() == template_param_infos.names.size();
}
+// Checks whether m1 is an overload of m2 (as opposed to an override). This is
+// called by addOverridesForMethod to distinguish overrides (which share a
+// vtable entry) from overloads (which require distinct entries).
+static bool isOverload(clang::CXXMethodDecl *m1, clang::CXXMethodDecl *m2) {
+ // FIXME: This should detect covariant return types, but currently doesn't.
+ lldbassert(&m1->getASTContext() == &m2->getASTContext() &&
+ "Methods should have the same AST context");
+ clang::ASTContext &context = m1->getASTContext();
+
+ const auto *m1Type =
+ llvm::cast<clang::FunctionProtoType>(
+ context.getCanonicalType(m1->getType()));
+
+ const auto *m2Type =
+ llvm::cast<clang::FunctionProtoType>(
+ context.getCanonicalType(m2->getType()));
+
+ auto compareArgTypes =
+ [&context](const clang::QualType &m1p, const clang::QualType &m2p) {
+ return context.hasSameType(m1p.getUnqualifiedType(),
+ m2p.getUnqualifiedType());
+ };
+
+ // FIXME: In C++14 and later, we can just pass m2Type->param_type_end()
+ // as a fourth parameter to std::equal().
+ return (m1->getNumParams() != m2->getNumParams()) ||
+ !std::equal(m1Type->param_type_begin(), m1Type->param_type_end(),
+ m2Type->param_type_begin(), compareArgTypes);
+}
+
+// If decl is a virtual method, walk the base classes looking for methods that
+// decl overrides. This table of overridden methods is used by IRGen to
+// determine the vtable layout for decl's parent class.
+static void addOverridesForMethod(clang::CXXMethodDecl *decl) {
+ if (!decl->isVirtual())
+ return;
+
+ clang::CXXBasePaths paths;
+
+ auto find_overridden_methods =
+ [decl](const clang::CXXBaseSpecifier *specifier, clang::CXXBasePath &path) {
+ if (auto *base_record =
+ llvm::dyn_cast<clang::CXXRecordDecl>(
+ specifier->getType()->getAs<clang::RecordType>()->getDecl())) {
+
+ clang::DeclarationName name = decl->getDeclName();
+
+ // If this is a destructor, check whether the base class destructor is
+ // virtual.
+ if (name.getNameKind() == clang::DeclarationName::CXXDestructorName)
+ if (auto *baseDtorDecl = base_record->getDestructor()) {
+ if (baseDtorDecl->isVirtual()) {
+ path.Decls = baseDtorDecl;
+ return true;
+ } else
+ return false;
+ }
+
+ // Otherwise, search for name in the base class.
+ for (path.Decls = base_record->lookup(name); !path.Decls.empty();
+ path.Decls = path.Decls.slice(1)) {
+ if (auto *method_decl =
+ llvm::dyn_cast<clang::CXXMethodDecl>(path.Decls.front()))
+ if (method_decl->isVirtual() && !isOverload(decl, method_decl)) {
+ path.Decls = method_decl;
+ return true;
+ }
+ }
+ }
+
+ return false;
+ };
+
+ if (decl->getParent()->lookupInBases(find_overridden_methods, paths)) {
+ for (auto *overridden_decl : paths.found_decls())
+ decl->addOverriddenMethod(
+ llvm::cast<clang::CXXMethodDecl>(overridden_decl));
+ }
+}
+
+// If clang_type is a CXXRecordDecl, builds the method override list for each
+// of its virtual methods.
+static void addMethodOverrides(ClangASTContext &ast, CompilerType &clang_type) {
+ if (auto *record =
+ ast.GetAsCXXRecordDecl(clang_type.GetOpaqueQualType()))
+ for (auto *method : record->methods())
+ addOverridesForMethod(method);
+}
+
bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
lldb_private::Type *type,
CompilerType &clang_type) {
@@ -2090,10 +2214,10 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
#if defined LLDB_CONFIGURATION_DEBUG
//----------------------------------------------------------------------
- // For debugging purposes, the LLDB_DWARF_DONT_COMPLETE_TYPENAMES
- // environment variable can be set with one or more typenames separated
- // by ';' characters. This will cause this function to not complete any
- // types whose names match.
+ // For debugging purposes, the LLDB_DWARF_DONT_COMPLETE_TYPENAMES environment
+ // variable can be set with one or more typenames separated by ';'
+ // characters. This will cause this function to not complete any types whose
+ // names match.
//
// Examples of setting this environment variable:
//
@@ -2144,8 +2268,8 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
LanguageType class_language = eLanguageTypeUnknown;
if (ClangASTContext::IsObjCObjectOrInterfaceType(clang_type)) {
class_language = eLanguageTypeObjC;
- // For objective C we don't start the definition when
- // the class is created.
+ // For objective C we don't start the definition when the class is
+ // created.
ClangASTContext::StartTagDeclarationDefinition(clang_type);
}
@@ -2217,29 +2341,27 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
clang::TTK_Class);
}
- // Since DW_TAG_structure_type gets used for both classes
- // and structures, we may need to set any DW_TAG_member
- // fields to have a "private" access if none was specified.
- // When we parsed the child members we tracked that actual
- // accessibility value for each DW_TAG_member in the
- // "member_accessibilities" array. If the value for the
- // member is zero, then it was set to the "default_accessibility"
- // which for structs was "public". Below we correct this
- // by setting any fields to "private" that weren't correctly
- // set.
+ // Since DW_TAG_structure_type gets used for both classes and
+ // structures, we may need to set any DW_TAG_member fields to have a
+ // "private" access if none was specified. When we parsed the child
+ // members we tracked that actual accessibility value for each
+ // DW_TAG_member in the "member_accessibilities" array. If the value
+ // for the member is zero, then it was set to the
+ // "default_accessibility" which for structs was "public". Below we
+ // correct this by setting any fields to "private" that weren't
+ // correctly set.
if (is_a_class && !member_accessibilities.empty()) {
- // This is a class and all members that didn't have
- // their access specified are private.
+ // This is a class and all members that didn't have their access
+ // specified are private.
m_ast.SetDefaultAccessForRecordFields(
m_ast.GetAsRecordDecl(clang_type), eAccessPrivate,
&member_accessibilities.front(), member_accessibilities.size());
}
if (!base_classes.empty()) {
- // Make sure all base classes refer to complete types and not
- // forward declarations. If we don't do this, clang will crash
- // with an assertion in the call to
- // clang_type.SetBaseClassesForClassType()
+ // Make sure all base classes refer to complete types and not forward
+ // declarations. If we don't do this, clang will crash with an
+ // assertion in the call to clang_type.SetBaseClassesForClassType()
for (auto &base_class : base_classes) {
clang::TypeSourceInfo *type_source_info =
base_class->getTypeSourceInfo();
@@ -2252,19 +2374,17 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
"does not have a complete definition.",
die.GetName(),
base_class_type.GetTypeName().GetCString());
- if (die.GetCU()->GetProducer() ==
- DWARFCompileUnit::eProducerClang)
+ if (die.GetCU()->GetProducer() == eProducerClang)
module->ReportError(":: Try compiling the source file with "
"-fstandalone-debug.");
// We have no choice other than to pretend that the base class
// is complete. If we don't do this, clang will crash when we
// call setBases() inside of
- // "clang_type.SetBaseClassesForClassType()"
- // below. Since we provide layout assistance, all ivars in this
- // class and other classes will be fine, this is the best we can
- // do
- // short of crashing.
+ // "clang_type.SetBaseClassesForClassType()" below. Since we
+ // provide layout assistance, all ivars in this class and other
+ // classes will be fine, this is the best we can do short of
+ // crashing.
if (ClangASTContext::StartTagDeclarationDefinition(
base_class_type)) {
ClangASTContext::CompleteTagDeclarationDefinition(
@@ -2277,14 +2397,15 @@ bool DWARFASTParserClang::CompleteTypeFromDWARF(const DWARFDIE &die,
&base_classes.front(),
base_classes.size());
- // Clang will copy each CXXBaseSpecifier in "base_classes"
- // so we have to free them all.
+ // Clang will copy each CXXBaseSpecifier in "base_classes" so we have
+ // to free them all.
ClangASTContext::DeleteBaseClassSpecifiers(&base_classes.front(),
base_classes.size());
}
}
}
+ addMethodOverrides(m_ast, clang_type);
ClangASTContext::BuildIndirectFields(clang_type);
ClangASTContext::CompleteTagDeclarationDefinition(clang_type);
@@ -2582,14 +2703,13 @@ Function *DWARFASTParserClang::ParseFunctionFromDWARF(const SymbolContext &sc,
Mangled func_name;
if (mangled)
func_name.SetValue(ConstString(mangled), true);
- else if (die.GetParent().Tag() == DW_TAG_compile_unit &&
+ else if ((die.GetParent().Tag() == DW_TAG_compile_unit ||
+ die.GetParent().Tag() == DW_TAG_partial_unit) &&
Language::LanguageIsCPlusPlus(die.GetLanguage()) && name &&
strcmp(name, "main") != 0) {
// If the mangled name is not present in the DWARF, generate the
- // demangled name
- // using the decl context. We skip if the function is "main" as its name
- // is
- // never mangled.
+ // demangled name using the decl context. We skip if the function is
+ // "main" as its name is never mangled.
bool is_static = false;
bool is_variadic = false;
bool has_template_params = false;
@@ -2748,8 +2868,7 @@ bool DWARFASTParserClang::ParseChildMembers(
if (form_value.BlockData()) {
Value initialValue(0);
Value memberOffset(0);
- const DWARFDataExtractor &debug_info_data =
- die.GetDWARF()->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = die.GetData();
uint32_t block_length = form_value.Unsigned();
uint32_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
@@ -2763,8 +2882,8 @@ bool DWARFASTParserClang::ParseChildMembers(
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
- // this form value is the offset in bytes from the beginning
- // of the containing entity.
+ // this form value is the offset in bytes from the beginning of
+ // the containing entity.
member_byte_offset = form_value.Unsigned();
}
break;
@@ -2806,8 +2925,8 @@ bool DWARFASTParserClang::ParseChildMembers(
ConstString fixed_getter;
ConstString fixed_setter;
- // Check if the property getter/setter were provided as full
- // names. We want basenames, so we extract them.
+ // Check if the property getter/setter were provided as full names.
+ // We want basenames, so we extract them.
if (prop_getter_name && prop_getter_name[0] == '-') {
ObjCLanguage::MethodName prop_getter_method(prop_getter_name, true);
@@ -2819,8 +2938,7 @@ bool DWARFASTParserClang::ParseChildMembers(
prop_setter_name = prop_setter_method.GetSelector().GetCString();
}
- // If the names haven't been provided, they need to be
- // filled in.
+ // If the names haven't been provided, they need to be filled in.
if (!prop_getter_name) {
prop_getter_name = prop_name;
@@ -2836,19 +2954,18 @@ bool DWARFASTParserClang::ParseChildMembers(
}
}
- // Clang has a DWARF generation bug where sometimes it
- // represents fields that are references with bad byte size
- // and bit size/offset information such as:
+ // Clang has a DWARF generation bug where sometimes it represents
+ // fields that are references with bad byte size and bit size/offset
+ // information such as:
//
// DW_AT_byte_size( 0x00 )
// DW_AT_bit_size( 0x40 )
// DW_AT_bit_offset( 0xffffffffffffffc0 )
//
- // So check the bit offset to make sure it is sane, and if
- // the values are not sane, remove them. If we don't do this
- // then we will end up with a crash if we try to use this
- // type in an expression when clang becomes unhappy with its
- // recycled debug info.
+ // So check the bit offset to make sure it is sane, and if the values
+ // are not sane, remove them. If we don't do this then we will end up
+ // with a crash if we try to use this type in an expression when clang
+ // becomes unhappy with its recycled debug info.
if (byte_size == 0 && bit_offset < 0) {
bit_size = 0;
@@ -2862,12 +2979,10 @@ bool DWARFASTParserClang::ParseChildMembers(
if (member_idx == 0 && !is_artificial && name &&
(strstr(name, "_vptr$") == name)) {
- // Not all compilers will mark the vtable pointer
- // member as artificial (llvm-gcc). We can't have
- // the virtual members in our classes otherwise it
- // throws off all child offsets since we end up
- // having and extra pointer sized member in our
- // class layouts.
+ // Not all compilers will mark the vtable pointer member as
+ // artificial (llvm-gcc). We can't have the virtual members in our
+ // classes otherwise it throws off all child offsets since we end up
+ // having and extra pointer sized member in our class layouts.
is_artificial = true;
}
@@ -2907,15 +3022,15 @@ bool DWARFASTParserClang::ParseChildMembers(
/////////////////////////////////////////////////////////////
// How to locate a field given the DWARF debug information
//
- // AT_byte_size indicates the size of the word in which the
- // bit offset must be interpreted.
+ // AT_byte_size indicates the size of the word in which the bit
+ // offset must be interpreted.
//
// AT_data_member_location indicates the byte offset of the
// word from the base address of the structure.
//
// AT_bit_offset indicates how many bits into the word
- // (according to the host endianness) the low-order bit of
- // the field starts. AT_bit_offset can be negative.
+ // (according to the host endianness) the low-order bit of the
+ // field starts. AT_bit_offset can be negative.
//
// AT_bit_size indicates the size of the field in bits.
/////////////////////////////////////////////////////////////
@@ -2956,12 +3071,9 @@ bool DWARFASTParserClang::ParseChildMembers(
field_bit_offset = this_field_info.bit_offset;
// If the member to be emitted did not start on a character
- // boundary and there is
- // empty space between the last field and this one, then we need
- // to emit an
- // anonymous member filling up the space up to its start. There
- // are three cases
- // here:
+ // boundary and there is empty space between the last field and
+ // this one, then we need to emit an anonymous member filling
+ // up the space up to its start. There are three cases here:
//
// 1 If the previous member ended on a character boundary, then
// we can emit an
@@ -2986,10 +3098,8 @@ bool DWARFASTParserClang::ParseChildMembers(
const uint64_t word_width = 32;
// Objective-C has invalid DW_AT_bit_offset values in older
- // versions
- // of clang, so we have to be careful and only insert unnamed
- // bitfields
- // if we have a new enough clang.
+ // versions of clang, so we have to be careful and only insert
+ // unnamed bitfields if we have a new enough clang.
bool detect_unnamed_bitfields = true;
if (class_language == eLanguageTypeObjC ||
@@ -3052,10 +3162,10 @@ bool DWARFASTParserClang::ParseChildMembers(
{
// Older versions of clang emit array[0] and array[1] in the
- // same way (<rdar://problem/12566646>).
- // If the current field is at the end of the structure, then
- // there is definitely no room for extra
- // elements and we override the type to array[0].
+ // same way (<rdar://problem/12566646>). If the current field
+ // is at the end of the structure, then there is definitely no
+ // room for extra elements and we override the type to
+ // array[0].
CompilerType member_array_element_type;
uint64_t member_array_size;
@@ -3089,8 +3199,7 @@ bool DWARFASTParserClang::ParseChildMembers(
if (ClangASTContext::IsCXXClassType(member_clang_type) &&
member_clang_type.GetCompleteType() == false) {
- if (die.GetCU()->GetProducer() ==
- DWARFCompileUnit::eProducerClang)
+ if (die.GetCU()->GetProducer() == eProducerClang)
module_sp->ReportError(
"DWARF DIE at 0x%8.8x (class %s) has a member variable "
"0x%8.8x (%s) whose type is a forward declaration, not a "
@@ -3108,12 +3217,11 @@ bool DWARFASTParserClang::ParseChildMembers(
die.GetOffset(), name,
sc.comp_unit ? sc.comp_unit->GetPath().c_str()
: "the source file");
- // We have no choice other than to pretend that the member class
- // is complete. If we don't do this, clang will crash when
- // trying
- // to layout the class. Since we provide layout assistance, all
- // ivars in this class and other classes will be fine, this is
- // the best we can do short of crashing.
+ // We have no choice other than to pretend that the member
+ // class is complete. If we don't do this, clang will crash
+ // when trying to layout the class. Since we provide layout
+ // assistance, all ivars in this class and other classes will
+ // be fine, this is the best we can do short of crashing.
if (ClangASTContext::StartTagDeclarationDefinition(
member_clang_type)) {
ClangASTContext::CompleteTagDeclarationDefinition(
@@ -3221,8 +3329,7 @@ bool DWARFASTParserClang::ParseChildMembers(
if (form_value.BlockData()) {
Value initialValue(0);
Value memberOffset(0);
- const DWARFDataExtractor &debug_info_data =
- die.GetDWARF()->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = die.GetData();
uint32_t block_length = form_value.Unsigned();
uint32_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
@@ -3235,8 +3342,8 @@ bool DWARFASTParserClang::ParseChildMembers(
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
- // this form value is the offset in bytes from the beginning
- // of the containing entity.
+ // this form value is the offset in bytes from the beginning of
+ // the containing entity.
member_byte_offset = form_value.Unsigned();
}
break;
@@ -3282,18 +3389,16 @@ bool DWARFASTParserClang::ParseChildMembers(
if (is_virtual) {
// Do not specify any offset for virtual inheritance. The DWARF
- // produced by clang doesn't
- // give us a constant offset, but gives us a DWARF expressions that
- // requires an actual object
- // in memory. the DW_AT_data_member_location for a virtual base
- // class looks like:
+ // produced by clang doesn't give us a constant offset, but gives
+ // us a DWARF expressions that requires an actual object in memory.
+ // the DW_AT_data_member_location for a virtual base class looks
+ // like:
// DW_AT_data_member_location( DW_OP_dup, DW_OP_deref,
// DW_OP_constu(0x00000018), DW_OP_minus, DW_OP_deref,
// DW_OP_plus )
// Given this, there is really no valid response we can give to
- // clang for virtual base
- // class offsets, and this should eventually be removed from
- // LayoutRecordType() in the external
+ // clang for virtual base class offsets, and this should eventually
+ // be removed from LayoutRecordType() in the external
// AST source in clang.
} else {
layout_info.base_offsets.insert(std::make_pair(
@@ -3365,22 +3470,6 @@ size_t DWARFASTParserClang::ParseChildParameters(
is_artificial = form_value.Boolean();
break;
case DW_AT_location:
- // if (form_value.BlockData())
- // {
- // const DWARFDataExtractor&
- // debug_info_data = debug_info();
- // uint32_t block_length =
- // form_value.Unsigned();
- // DWARFDataExtractor
- // location(debug_info_data,
- // form_value.BlockData() -
- // debug_info_data.GetDataStart(),
- // block_length);
- // }
- // else
- // {
- // }
- // break;
case DW_AT_const_value:
case DW_AT_default_value:
case DW_AT_description:
@@ -3397,52 +3486,29 @@ size_t DWARFASTParserClang::ParseChildParameters(
}
bool skip = false;
- if (skip_artificial) {
- if (is_artificial) {
- // In order to determine if a C++ member function is
- // "const" we have to look at the const-ness of "this"...
- // Ugly, but that
- if (arg_idx == 0) {
- if (DeclKindIsCXXClass(containing_decl_ctx->getDeclKind())) {
- // 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...
- if (name == NULL || ::strcmp(name, "this") == 0) {
- Type *this_type =
- die.ResolveTypeUID(DIERef(param_type_die_form));
- if (this_type) {
- uint32_t encoding_mask = this_type->GetEncodingMask();
- if (encoding_mask & Type::eEncodingIsPointerUID) {
- is_static = false;
-
- if (encoding_mask & (1u << Type::eEncodingIsConstUID))
- type_quals |= clang::Qualifiers::Const;
- if (encoding_mask & (1u << Type::eEncodingIsVolatileUID))
- type_quals |= clang::Qualifiers::Volatile;
- }
- }
- }
- }
- }
- skip = true;
- } else {
-
- // HACK: Objective C formal parameters "self" and "_cmd"
- // are not marked as artificial in the DWARF...
- CompileUnit *comp_unit = die.GetLLDBCompileUnit();
- if (comp_unit) {
- switch (comp_unit->GetLanguage()) {
- case eLanguageTypeObjC:
- case eLanguageTypeObjC_plus_plus:
- if (name && name[0] &&
- (strcmp(name, "self") == 0 || strcmp(name, "_cmd") == 0))
- skip = true;
- break;
- default:
- break;
+ if (skip_artificial && is_artificial) {
+ // In order to determine if a C++ member function is "const" we
+ // have to look at the const-ness of "this"...
+ if (arg_idx == 0 &&
+ DeclKindIsCXXClass(containing_decl_ctx->getDeclKind()) &&
+ // 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)) {
+ Type *this_type = die.ResolveTypeUID(DIERef(param_type_die_form));
+ if (this_type) {
+ uint32_t encoding_mask = this_type->GetEncodingMask();
+ if (encoding_mask & Type::eEncodingIsPointerUID) {
+ is_static = false;
+
+ if (encoding_mask & (1u << Type::eEncodingIsConstUID))
+ type_quals |= clang::Qualifiers::Const;
+ if (encoding_mask & (1u << Type::eEncodingIsVolatileUID))
+ type_quals |= clang::Qualifiers::Volatile;
}
}
}
+ skip = true;
}
if (!skip) {
@@ -3470,10 +3536,10 @@ size_t DWARFASTParserClang::ParseChildParameters(
case DW_TAG_template_type_parameter:
case DW_TAG_template_value_parameter:
case DW_TAG_GNU_template_parameter_pack:
- // The one caller of this was never using the template_param_infos,
- // and the local variable was taking up a large amount of stack space
- // in SymbolFileDWARF::ParseType() so this was removed. If we ever need
- // the template params back, we can add them back.
+ // The one caller of this was never using the template_param_infos, and
+ // the local variable was taking up a large amount of stack space in
+ // SymbolFileDWARF::ParseType() so this was removed. If we ever need the
+ // template params back, we can add them back.
// ParseTemplateDIE (dwarf_cu, die, template_param_infos);
has_template_params = true;
break;
@@ -3692,6 +3758,7 @@ DWARFASTParserClang::GetClangDeclContextForDIE(const DWARFDIE &die) {
bool try_parsing_type = true;
switch (die.Tag()) {
case DW_TAG_compile_unit:
+ case DW_TAG_partial_unit:
decl_ctx = m_ast.GetTranslationUnitDecl();
try_parsing_type = false;
break;
@@ -4008,8 +4075,8 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
// Now do the work of linking the DeclContexts and Types.
if (fast_path) {
- // We can do this quickly. Just run across the tables index-for-index since
- // we know each node has matching names and tags.
+ // We can do this quickly. Just run across the tables index-for-index
+ // since we know each node has matching names and tags.
for (idx = 0; idx < src_size; ++idx) {
src_die = src_name_to_die.GetValueAtIndexUnchecked(idx);
dst_die = dst_name_to_die.GetValueAtIndexUnchecked(idx);
@@ -4046,9 +4113,9 @@ bool DWARFASTParserClang::CopyUniqueClassMethodTypes(
}
}
} else {
- // We must do this slowly. For each member of the destination, look
- // up a member in the source with the same name, check its tag, and
- // unique them if everything matches up. Report failures.
+ // We must do this slowly. For each member of the destination, look up a
+ // member in the source with the same name, check its tag, and unique them
+ // if everything matches up. Report failures.
if (!src_name_to_die.IsEmpty() && !dst_name_to_die.IsEmpty()) {
src_name_to_die.Sort();
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
index e04dc76d1dbe..328212e4b684 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserGo.cpp
@@ -10,7 +10,6 @@
#include "DWARFASTParserGo.h"
#include "DWARFASTParserGo.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDIE.h"
#include "DWARFDIECollection.h"
#include "DWARFDebugInfo.h"
@@ -158,7 +157,8 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
Type *type = dwarf->ResolveTypeUID(encoding_uid);
if (type) {
if (go_kind == 0 && type->GetName() == type_name_const_str) {
- // Go emits extra typedefs as a forward declaration. Ignore these.
+ // Go emits extra typedefs as a forward declaration. Ignore
+ // these.
dwarf->m_die_to_type[die.GetDIE()] = type;
return type->shared_from_this();
}
@@ -213,10 +213,10 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
// TODO(ribrdb): Do we need this?
- // UniqueDWARFASTType is large, so don't create a local variables on the
- // stack, put it on the heap. This function is often called recursively
- // and clang isn't good and sharing the stack space for variables in
- // different blocks.
+ // UniqueDWARFASTType is large, so don't create a local variables on
+ // the stack, put it on the heap. This function is often called
+ // recursively and clang isn't good and sharing the stack space for
+ // variables in different blocks.
std::unique_ptr<UniqueDWARFASTType> unique_ast_entry_ap(
new UniqueDWARFASTType());
@@ -225,11 +225,10 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
dwarf->GetUniqueDWARFASTTypeMap().Find(
type_name_const_str, die, decl,
byte_size_valid ? byte_size : -1, *unique_ast_entry_ap)) {
- // We have already parsed this type or from another
- // compile unit. GCC loves to use the "one definition
- // rule" which can result in multiple definitions
- // of the same class over and over in each compile
- // unit.
+ // We have already parsed this type or from another compile unit. GCC
+ // loves to use the "one definition rule" which can result in
+ // multiple definitions of the same class over and over in each
+ // compile unit.
type_sp = unique_ast_entry_ap->m_type_sp;
if (type_sp) {
dwarf->m_die_to_type[die.GetDIE()] = type_sp.get();
@@ -255,9 +254,9 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
Type::eEncodingIsUID, &decl, compiler_type,
Type::eResolveStateForward));
- // Add our type to the unique type map so we don't
- // end up creating many copies of the same type over
- // and over in the ASTContext for our module
+ // Add our type to the unique type map so we don't end up creating many
+ // copies of the same type over and over in the ASTContext for our
+ // module
unique_ast_entry_ap->m_type_sp = type_sp;
unique_ast_entry_ap->m_die = die;
unique_ast_entry_ap->m_declaration = decl;
@@ -266,19 +265,19 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
*unique_ast_entry_ap);
if (!is_forward_declaration) {
- // Always start the definition for a class type so that
- // if the class has child classes or types that require
- // the class to be created for use as their decl contexts
- // the class will be ready to accept these child definitions.
+ // Always start the definition for a class type so that if the class
+ // has child classes or types that require the class to be created
+ // for use as their decl contexts the class will be ready to accept
+ // these child definitions.
if (die.HasChildren() == false) {
// No children for this struct/union/class, lets finish it
m_ast.CompleteStructType(compiler_type);
} else if (compiler_type_was_created) {
- // Leave this as a forward declaration until we need
- // to know the details of the type. lldb_private::Type
- // will automatically call the SymbolFile virtual function
- // "SymbolFileDWARF::CompleteType(Type *)"
- // When the definition needs to be defined.
+ // Leave this as a forward declaration until we need to know the
+ // details of the type. lldb_private::Type will automatically call
+ // the SymbolFile virtual function
+ // "SymbolFileDWARF::CompleteType(Type *)" When the definition
+ // needs to be defined.
dwarf->m_forward_decl_die_to_clang_type[die.GetDIE()] =
compiler_type.GetOpaqueQualType();
dwarf->m_forward_decl_clang_type_to_die[compiler_type
@@ -432,7 +431,8 @@ TypeSP DWARFASTParserGo::ParseTypeFromDWARF(
dw_tag_t sc_parent_tag = sc_parent_die.Tag();
SymbolContextScope *symbol_context_scope = NULL;
- if (sc_parent_tag == DW_TAG_compile_unit) {
+ if (sc_parent_tag == DW_TAG_compile_unit ||
+ sc_parent_tag == DW_TAG_partial_unit) {
symbol_context_scope = sc.comp_unit;
} else if (sc.function != NULL && sc_parent_die) {
symbol_context_scope =
@@ -655,8 +655,7 @@ size_t DWARFASTParserGo::ParseChildMembers(const SymbolContext &sc,
if (form_value.BlockData()) {
Value initialValue(0);
Value memberOffset(0);
- const DWARFDataExtractor &debug_info_data =
- die.GetDWARF()->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = die.GetData();
uint32_t block_length = form_value.Unsigned();
uint32_t block_offset =
form_value.BlockData() - debug_info_data.GetDataStart();
@@ -670,8 +669,8 @@ size_t DWARFASTParserGo::ParseChildMembers(const SymbolContext &sc,
}
} else {
// With DWARF 3 and later, if the value is an integer constant,
- // this form value is the offset in bytes from the beginning
- // of the containing entity.
+ // this form value is the offset in bytes from the beginning of
+ // the containing entity.
member_byte_offset = form_value.Unsigned();
}
break;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp b/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
index 8b5202ba265f..476394487985 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserJava.cpp
@@ -9,7 +9,7 @@
#include "DWARFASTParserJava.h"
#include "DWARFAttribute.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfoEntry.h"
#include "DWARFDebugInfoEntry.h"
#include "DWARFDeclContext.h"
@@ -324,7 +324,8 @@ lldb::TypeSP DWARFASTParserJava::ParseTypeFromDWARF(
dw_tag_t sc_parent_tag = sc_parent_die.Tag();
SymbolContextScope *symbol_context_scope = nullptr;
- if (sc_parent_tag == DW_TAG_compile_unit) {
+ if (sc_parent_tag == DW_TAG_compile_unit ||
+ sc_parent_tag == DW_TAG_partial_unit) {
symbol_context_scope = sc.comp_unit;
} else if (sc.function != nullptr && sc_parent_die) {
symbol_context_scope =
@@ -418,7 +419,7 @@ bool DWARFASTParserJava::CompleteTypeFromDWARF(
void DWARFASTParserJava::ParseChildMembers(const DWARFDIE &parent_die,
CompilerType &compiler_type) {
- DWARFCompileUnit *dwarf_cu = parent_die.GetCU();
+ DWARFUnit *dwarf_cu = parent_die.GetCU();
for (DWARFDIE die = parent_die.GetFirstChild(); die.IsValid();
die = die.GetSibling()) {
switch (die.Tag()) {
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp b/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
index 3b1466df21b0..3ef5c2eb8626 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.cpp
@@ -98,7 +98,8 @@ lldb::TypeSP DWARFASTParserOCaml::ParseTypeFromDWARF(const SymbolContext &sc,
dw_tag_t sc_parent_tag = sc_parent_die.Tag();
SymbolContextScope *symbol_context_scope = nullptr;
- if (sc_parent_tag == DW_TAG_compile_unit) {
+ if (sc_parent_tag == DW_TAG_compile_unit ||
+ sc_parent_tag == DW_TAG_partial_unit) {
symbol_context_scope = sc.comp_unit;
} else if (sc.function != nullptr && sc_parent_die) {
symbol_context_scope =
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h b/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
index e3b2279ca8fc..09cb5e14934f 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFASTParserOCaml.h
@@ -4,7 +4,6 @@
#define SymbolFileDWARF_DWARFASTParserOCaml_h_
#include "DWARFASTParser.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDIE.h"
#include "DWARFDebugInfo.h"
#include "DWARFDefines.h"
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
index bc49fc5de2cd..a765be0b46d0 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.cpp
@@ -10,6 +10,7 @@
#include "DWARFAbbreviationDeclaration.h"
#include "lldb/Core/dwarf.h"
+#include "lldb/Utility/Stream.h"
#include "DWARFFormValue.h"
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
index 28e713f9beb1..b2296c455d6a 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFAbbreviationDeclaration.h
@@ -13,8 +13,6 @@
#include "DWARFAttribute.h"
#include "SymbolFileDWARF.h"
-class DWARFCompileUnit;
-
class DWARFAbbreviationDeclaration {
public:
enum { InvalidCode = 0 };
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
index d2573f3742ba..2586d1f18530 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
@@ -8,7 +8,7 @@
//===----------------------------------------------------------------------===//
#include "DWARFAttribute.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfo.h"
DWARFAttributes::DWARFAttributes() : m_infos() {}
@@ -26,7 +26,7 @@ uint32_t DWARFAttributes::FindAttributeIndex(dw_attr_t attr) const {
return UINT32_MAX;
}
-void DWARFAttributes::Append(const DWARFCompileUnit *cu,
+void DWARFAttributes::Append(const DWARFUnit *cu,
dw_offset_t attr_die_offset, dw_attr_t attr,
dw_form_t form) {
AttributeValue attr_value = {cu, attr_die_offset, {attr, form}};
@@ -48,12 +48,11 @@ bool DWARFAttributes::RemoveAttribute(dw_attr_t attr) {
bool DWARFAttributes::ExtractFormValueAtIndex(
uint32_t i, DWARFFormValue &form_value) const {
- const DWARFCompileUnit *cu = CompileUnitAtIndex(i);
+ const DWARFUnit *cu = CompileUnitAtIndex(i);
form_value.SetCompileUnit(cu);
form_value.SetForm(FormAtIndex(i));
lldb::offset_t offset = DIEOffsetAtIndex(i);
- return form_value.ExtractValue(
- cu->GetSymbolFileDWARF()->get_debug_info_data(), &offset);
+ return form_value.ExtractValue(cu->GetData(), &offset);
}
uint64_t DWARFAttributes::FormValueAsUnsigned(dw_attr_t attr,
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
index 317e710e6d94..db4324cf7725 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
@@ -14,7 +14,7 @@
#include "llvm/ADT/SmallVector.h"
#include <vector>
-class DWARFCompileUnit;
+class DWARFUnit;
class DWARFFormValue;
class DWARFAttribute {
@@ -50,9 +50,9 @@ public:
DWARFAttributes();
~DWARFAttributes();
- void Append(const DWARFCompileUnit *cu, dw_offset_t attr_die_offset,
+ void Append(const DWARFUnit *cu, dw_offset_t attr_die_offset,
dw_attr_t attr, dw_form_t form);
- const DWARFCompileUnit *CompileUnitAtIndex(uint32_t i) const {
+ const DWARFUnit *CompileUnitAtIndex(uint32_t i) const {
return m_infos[i].cu;
}
dw_offset_t DIEOffsetAtIndex(uint32_t i) const {
@@ -73,7 +73,7 @@ public:
protected:
struct AttributeValue {
- const DWARFCompileUnit *cu; // Keep the compile unit with each attribute in
+ const DWARFUnit *cu; // Keep the compile unit with each attribute in
// case we have DW_FORM_ref_addr values
dw_offset_t die_offset;
DWARFAttribute attr;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp b/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
new file mode 100644
index 000000000000..077de9604f1d
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
@@ -0,0 +1,193 @@
+//===-- DWARFBaseDIE.cpp ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DWARFBaseDIE.h"
+
+#include "DWARFUnit.h"
+#include "DWARFDebugInfoEntry.h"
+#include "SymbolFileDWARF.h"
+
+#include "lldb/Core/Module.h"
+#include "lldb/Symbol/ObjectFile.h"
+
+using namespace lldb_private;
+
+DIERef DWARFBaseDIE::GetDIERef() const {
+ if (!IsValid())
+ return DIERef();
+
+ dw_offset_t cu_offset = m_cu->GetOffset();
+ if (m_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
+ cu_offset = m_cu->GetBaseObjOffset();
+ return DIERef(cu_offset, m_die->GetOffset());
+}
+
+dw_tag_t DWARFBaseDIE::Tag() const {
+ if (m_die)
+ return m_die->Tag();
+ else
+ return 0;
+}
+
+const char *DWARFBaseDIE::GetTagAsCString() const {
+ return lldb_private::DW_TAG_value_to_name(Tag());
+}
+
+const char *DWARFBaseDIE::GetAttributeValueAsString(const dw_attr_t attr,
+ const char *fail_value) const {
+ if (IsValid())
+ return m_die->GetAttributeValueAsString(GetDWARF(), GetCU(), attr,
+ fail_value);
+ else
+ return fail_value;
+}
+
+uint64_t DWARFBaseDIE::GetAttributeValueAsUnsigned(const dw_attr_t attr,
+ uint64_t fail_value) const {
+ if (IsValid())
+ return m_die->GetAttributeValueAsUnsigned(GetDWARF(), GetCU(), attr,
+ fail_value);
+ else
+ return fail_value;
+}
+
+int64_t DWARFBaseDIE::GetAttributeValueAsSigned(const dw_attr_t attr,
+ int64_t fail_value) const {
+ if (IsValid())
+ return m_die->GetAttributeValueAsSigned(GetDWARF(), GetCU(), attr,
+ fail_value);
+ else
+ return fail_value;
+}
+
+uint64_t DWARFBaseDIE::GetAttributeValueAsReference(const dw_attr_t attr,
+ uint64_t fail_value) const {
+ if (IsValid())
+ return m_die->GetAttributeValueAsReference(GetDWARF(), GetCU(), attr,
+ fail_value);
+ else
+ return fail_value;
+}
+
+uint64_t DWARFBaseDIE::GetAttributeValueAsAddress(const dw_attr_t attr,
+ uint64_t fail_value) const {
+ if (IsValid())
+ return m_die->GetAttributeValueAsAddress(GetDWARF(), GetCU(), attr,
+ fail_value);
+ else
+ return fail_value;
+}
+
+lldb::user_id_t DWARFBaseDIE::GetID() const {
+ return GetDIERef().GetUID(GetDWARF());
+}
+
+const char *DWARFBaseDIE::GetName() const {
+ if (IsValid())
+ return m_die->GetName(GetDWARF(), m_cu);
+ else
+ return nullptr;
+}
+
+lldb::LanguageType DWARFBaseDIE::GetLanguage() const {
+ if (IsValid())
+ return m_cu->GetLanguageType();
+ else
+ return lldb::eLanguageTypeUnknown;
+}
+
+lldb::ModuleSP DWARFBaseDIE::GetModule() const {
+ SymbolFileDWARF *dwarf = GetDWARF();
+ if (dwarf)
+ return dwarf->GetObjectFile()->GetModule();
+ else
+ return lldb::ModuleSP();
+}
+
+lldb_private::CompileUnit *DWARFBaseDIE::GetLLDBCompileUnit() const {
+ if (IsValid())
+ return GetDWARF()->GetCompUnitForDWARFCompUnit(GetCU());
+ else
+ return nullptr;
+}
+
+dw_offset_t DWARFBaseDIE::GetOffset() const {
+ if (IsValid())
+ return m_die->GetOffset();
+ else
+ return DW_INVALID_OFFSET;
+}
+
+dw_offset_t DWARFBaseDIE::GetCompileUnitRelativeOffset() const {
+ if (IsValid())
+ return m_die->GetOffset() - m_cu->GetOffset();
+ else
+ return DW_INVALID_OFFSET;
+}
+
+SymbolFileDWARF *DWARFBaseDIE::GetDWARF() const {
+ if (m_cu)
+ return m_cu->GetSymbolFileDWARF();
+ else
+ return nullptr;
+}
+
+lldb_private::TypeSystem *DWARFBaseDIE::GetTypeSystem() const {
+ if (m_cu)
+ return m_cu->GetTypeSystem();
+ else
+ return nullptr;
+}
+
+DWARFASTParser *DWARFBaseDIE::GetDWARFParser() const {
+ lldb_private::TypeSystem *type_system = GetTypeSystem();
+ if (type_system)
+ return type_system->GetDWARFParser();
+ else
+ return nullptr;
+}
+
+bool DWARFBaseDIE::HasChildren() const {
+ return m_die && m_die->HasChildren();
+}
+
+bool DWARFBaseDIE::Supports_DW_AT_APPLE_objc_complete_type() const {
+ return IsValid() && GetDWARF()->Supports_DW_AT_APPLE_objc_complete_type(m_cu);
+}
+
+size_t DWARFBaseDIE::GetAttributes(DWARFAttributes &attributes,
+ uint32_t depth) const {
+ if (IsValid()) {
+ return m_die->GetAttributes(m_cu, m_cu->GetFixedFormSizes(), attributes,
+ depth);
+ }
+ if (depth == 0)
+ attributes.Clear();
+ return 0;
+}
+
+void DWARFBaseDIE::Dump(lldb_private::Stream *s,
+ const uint32_t recurse_depth) const {
+ if (s && IsValid())
+ m_die->Dump(GetDWARF(), GetCU(), *s, recurse_depth);
+}
+
+bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
+ return lhs.GetDIE() == rhs.GetDIE() && lhs.GetCU() == rhs.GetCU();
+}
+
+bool operator!=(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs) {
+ return !(lhs == rhs);
+}
+
+const DWARFDataExtractor &DWARFBaseDIE::GetData() const {
+ // Clients must check if this DIE is valid before calling this function.
+ assert(IsValid());
+ return m_cu->GetData();
+}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h b/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
new file mode 100644
index 000000000000..2163a027ffbc
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
@@ -0,0 +1,157 @@
+//===-- DWARFBaseDIE.h -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SymbolFileDWARF_DWARFBaseDIE_h_
+#define SymbolFileDWARF_DWARFBaseDIE_h_
+
+#include "lldb/Core/dwarf.h"
+#include "lldb/lldb-types.h"
+
+struct DIERef;
+class DWARFASTParser;
+class DWARFAttributes;
+class DWARFUnit;
+class DWARFDebugInfoEntry;
+class DWARFDeclContext;
+class DWARFDIECollection;
+class SymbolFileDWARF;
+
+class DWARFBaseDIE {
+public:
+ DWARFBaseDIE() : m_cu(nullptr), m_die(nullptr) {}
+
+ DWARFBaseDIE(DWARFUnit *cu, DWARFDebugInfoEntry *die)
+ : m_cu(cu), m_die(die) {}
+
+ DWARFBaseDIE(const DWARFUnit *cu, DWARFDebugInfoEntry *die)
+ : m_cu(const_cast<DWARFUnit *>(cu)), m_die(die) {}
+
+ DWARFBaseDIE(DWARFUnit *cu, const DWARFDebugInfoEntry *die)
+ : m_cu(cu), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
+
+ DWARFBaseDIE(const DWARFUnit *cu, const DWARFDebugInfoEntry *die)
+ : m_cu(const_cast<DWARFUnit *>(cu)),
+ m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
+
+ //----------------------------------------------------------------------
+ // Tests
+ //----------------------------------------------------------------------
+ explicit operator bool() const { return IsValid(); }
+
+ bool IsValid() const { return m_cu && m_die; }
+
+ bool HasChildren() const;
+
+ bool Supports_DW_AT_APPLE_objc_complete_type() const;
+
+ //----------------------------------------------------------------------
+ // Accessors
+ //----------------------------------------------------------------------
+ SymbolFileDWARF *GetDWARF() const;
+
+ DWARFUnit *GetCU() const { return m_cu; }
+
+ DWARFDebugInfoEntry *GetDIE() const { return m_die; }
+
+ DIERef GetDIERef() const;
+
+ lldb_private::TypeSystem *GetTypeSystem() const;
+
+ DWARFASTParser *GetDWARFParser() const;
+
+ void Set(DWARFUnit *cu, DWARFDebugInfoEntry *die) {
+ if (cu && die) {
+ m_cu = cu;
+ m_die = die;
+ } else {
+ Clear();
+ }
+ }
+
+ void Clear() {
+ m_cu = nullptr;
+ m_die = nullptr;
+ }
+
+ //----------------------------------------------------------------------
+ // Get the data that contains the attribute values for this DIE. Support
+ // for .debug_types means that any DIE can have its data either in the
+ // .debug_info or the .debug_types section; this method will return the
+ // correct section data.
+ //
+ // Clients must validate that this object is valid before calling this.
+ //----------------------------------------------------------------------
+ const lldb_private::DWARFDataExtractor &GetData() const;
+
+ //----------------------------------------------------------------------
+ // Accessing information about a DIE
+ //----------------------------------------------------------------------
+ dw_tag_t Tag() const;
+
+ const char *GetTagAsCString() const;
+
+ dw_offset_t GetOffset() const;
+
+ dw_offset_t GetCompileUnitRelativeOffset() const;
+
+ //----------------------------------------------------------------------
+ // Get the LLDB user ID for this DIE. This is often just the DIE offset,
+ // but it might have a SymbolFileDWARF::GetID() in the high 32 bits if
+ // we are doing Darwin DWARF in .o file, or DWARF stand alone debug
+ // info.
+ //----------------------------------------------------------------------
+ lldb::user_id_t GetID() const;
+
+ const char *GetName() const;
+
+ lldb::LanguageType GetLanguage() const;
+
+ lldb::ModuleSP GetModule() const;
+
+ lldb_private::CompileUnit *GetLLDBCompileUnit() const;
+
+ //----------------------------------------------------------------------
+ // Getting attribute values from the DIE.
+ //
+ // GetAttributeValueAsXXX() functions should only be used if you are
+ // looking for one or two attributes on a DIE. If you are trying to
+ // parse all attributes, use GetAttributes (...) instead
+ //----------------------------------------------------------------------
+ const char *GetAttributeValueAsString(const dw_attr_t attr,
+ const char *fail_value) const;
+
+ uint64_t GetAttributeValueAsUnsigned(const dw_attr_t attr,
+ uint64_t fail_value) const;
+
+ int64_t GetAttributeValueAsSigned(const dw_attr_t attr,
+ int64_t fail_value) const;
+
+ uint64_t GetAttributeValueAsReference(const dw_attr_t attr,
+ uint64_t fail_value) const;
+
+ uint64_t GetAttributeValueAsAddress(const dw_attr_t attr,
+ uint64_t fail_value) const;
+
+ size_t GetAttributes(DWARFAttributes &attributes, uint32_t depth = 0) const;
+
+ //----------------------------------------------------------------------
+ // Pretty printing
+ //----------------------------------------------------------------------
+
+ void Dump(lldb_private::Stream *s, const uint32_t recurse_depth) const;
+
+protected:
+ DWARFUnit *m_cu;
+ DWARFDebugInfoEntry *m_die;
+};
+
+bool operator==(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs);
+bool operator!=(const DWARFBaseDIE &lhs, const DWARFBaseDIE &rhs);
+
+#endif // SymbolFileDWARF_DWARFBaseDIE_h_
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
index 5d7b12067263..8541f1cfe1f6 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
@@ -9,48 +9,22 @@
#include "DWARFCompileUnit.h"
-#include "Plugins/Language/ObjC/ObjCLanguage.h"
-#include "lldb/Core/DumpDataExtractor.h"
-#include "lldb/Core/Mangled.h"
-#include "lldb/Core/Module.h"
-#include "lldb/Host/StringConvert.h"
-#include "lldb/Symbol/CompileUnit.h"
-#include "lldb/Symbol/LineTable.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Utility/Stream.h"
-#include "lldb/Utility/StreamString.h"
-#include "lldb/Utility/Timer.h"
-
-#include "DWARFDIECollection.h"
-#include "DWARFDebugAbbrev.h"
-#include "DWARFDebugAranges.h"
-#include "DWARFDebugInfo.h"
-#include "DWARFFormValue.h"
-#include "LogChannelDWARF.h"
-#include "NameToDIE.h"
#include "SymbolFileDWARF.h"
-#include "SymbolFileDWARFDebugMap.h"
-#include "SymbolFileDWARFDwo.h"
+#include "lldb/Utility/Stream.h"
using namespace lldb;
using namespace lldb_private;
-using namespace std;
extern int g_verbose;
DWARFCompileUnit::DWARFCompileUnit(SymbolFileDWARF *dwarf2Data)
- : m_dwarf2Data(dwarf2Data) {}
+ : DWARFUnit(dwarf2Data) {}
-DWARFCompileUnit::~DWARFCompileUnit() {}
-
-DWARFCompileUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data,
- lldb::offset_t *offset_ptr) {
- DWARFCompileUnitSP cu_sp(new DWARFCompileUnit(dwarf2Data));
- // Out of memory?
- if (cu_sp.get() == NULL)
- return nullptr;
-
- const DWARFDataExtractor &debug_info = dwarf2Data->get_debug_info_data();
+DWARFUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data,
+ const DWARFDataExtractor &debug_info,
+ lldb::offset_t *offset_ptr) {
+ // std::make_shared would require the ctor to be public.
+ std::shared_ptr<DWARFCompileUnit> cu_sp(new DWARFCompileUnit(dwarf2Data));
cu_sp->m_offset = *offset_ptr;
@@ -83,259 +57,6 @@ DWARFCompileUnitSP DWARFCompileUnit::Extract(SymbolFileDWARF *dwarf2Data,
return nullptr;
}
-void DWARFCompileUnit::ClearDIEs(bool keep_compile_unit_die) {
- if (m_die_array.size() > 1) {
- // std::vectors never get any smaller when resized to a smaller size,
- // or when clear() or erase() are called, the size will report that it
- // is smaller, but the memory allocated remains intact (call capacity()
- // to see this). So we need to create a temporary vector and swap the
- // contents which will cause just the internal pointers to be swapped
- // so that when "tmp_array" goes out of scope, it will destroy the
- // contents.
-
- // Save at least the compile unit DIE
- DWARFDebugInfoEntry::collection tmp_array;
- m_die_array.swap(tmp_array);
- if (keep_compile_unit_die)
- m_die_array.push_back(tmp_array.front());
- }
-
- if (m_dwo_symbol_file)
- m_dwo_symbol_file->GetCompileUnit()->ClearDIEs(keep_compile_unit_die);
-}
-
-//----------------------------------------------------------------------
-// ParseCompileUnitDIEsIfNeeded
-//
-// Parses a compile unit and indexes its DIEs if it hasn't already been
-// done.
-//----------------------------------------------------------------------
-size_t DWARFCompileUnit::ExtractDIEsIfNeeded(bool cu_die_only) {
- const size_t initial_die_array_size = m_die_array.size();
- if ((cu_die_only && initial_die_array_size > 0) || initial_die_array_size > 1)
- return 0; // Already parsed
-
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat,
- "%8.8x: DWARFCompileUnit::ExtractDIEsIfNeeded( cu_die_only = %i )",
- m_offset, cu_die_only);
-
- // Set the offset to that of the first DIE and calculate the start of the
- // next compilation unit header.
- lldb::offset_t offset = GetFirstDIEOffset();
- lldb::offset_t next_cu_offset = GetNextCompileUnitOffset();
-
- DWARFDebugInfoEntry die;
- // Keep a flat array of the DIE for binary lookup by DIE offset
- if (!cu_die_only) {
- Log *log(
- LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_LOOKUPS));
- if (log) {
- m_dwarf2Data->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
- log, "DWARFCompileUnit::ExtractDIEsIfNeeded () for compile unit at "
- ".debug_info[0x%8.8x]",
- GetOffset());
- }
- }
-
- uint32_t depth = 0;
- // We are in our compile unit, parse starting at the offset
- // we were told to parse
- const DWARFDataExtractor &debug_info_data =
- m_dwarf2Data->get_debug_info_data();
- std::vector<uint32_t> die_index_stack;
- die_index_stack.reserve(32);
- die_index_stack.push_back(0);
- bool prev_die_had_children = false;
- DWARFFormValue::FixedFormSizes fixed_form_sizes =
- DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
- m_is_dwarf64);
- while (offset < next_cu_offset &&
- die.FastExtract(debug_info_data, this, fixed_form_sizes, &offset)) {
- // if (log)
- // log->Printf("0x%8.8x: %*.*s%s%s",
- // die.GetOffset(),
- // depth * 2, depth * 2, "",
- // DW_TAG_value_to_name (die.Tag()),
- // die.HasChildren() ? " *" : "");
-
- const bool null_die = die.IsNULL();
- if (depth == 0) {
- if (initial_die_array_size == 0)
- AddCompileUnitDIE(die);
- uint64_t base_addr = die.GetAttributeValueAsAddress(
- m_dwarf2Data, this, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
- if (base_addr == LLDB_INVALID_ADDRESS)
- base_addr = die.GetAttributeValueAsAddress(m_dwarf2Data, this,
- DW_AT_entry_pc, 0);
- SetBaseAddress(base_addr);
- if (cu_die_only)
- return 1;
- } else {
- if (null_die) {
- if (prev_die_had_children) {
- // This will only happen if a DIE says is has children
- // but all it contains is a NULL tag. Since we are removing
- // the NULL DIEs from the list (saves up to 25% in C++ code),
- // we need a way to let the DIE know that it actually doesn't
- // have children.
- if (!m_die_array.empty())
- m_die_array.back().SetEmptyChildren(true);
- }
- } else {
- die.SetParentIndex(m_die_array.size() - die_index_stack[depth - 1]);
-
- if (die_index_stack.back())
- m_die_array[die_index_stack.back()].SetSiblingIndex(
- m_die_array.size() - die_index_stack.back());
-
- // Only push the DIE if it isn't a NULL DIE
- m_die_array.push_back(die);
- }
- }
-
- if (null_die) {
- // NULL DIE.
- if (!die_index_stack.empty())
- die_index_stack.pop_back();
-
- if (depth > 0)
- --depth;
- if (depth == 0)
- break; // We are done with this compile unit!
-
- prev_die_had_children = false;
- } else {
- die_index_stack.back() = m_die_array.size() - 1;
- // Normal DIE
- const bool die_has_children = die.HasChildren();
- if (die_has_children) {
- die_index_stack.push_back(0);
- ++depth;
- }
- prev_die_had_children = die_has_children;
- }
- }
-
- // Give a little bit of info if we encounter corrupt DWARF (our offset
- // should always terminate at or before the start of the next compilation
- // unit header).
- if (offset > next_cu_offset) {
- m_dwarf2Data->GetObjectFile()->GetModule()->ReportWarning(
- "DWARF compile unit extends beyond its bounds cu 0x%8.8x at "
- "0x%8.8" PRIx64 "\n",
- GetOffset(), offset);
- }
-
- // Since std::vector objects will double their size, we really need to
- // make a new array with the perfect size so we don't end up wasting
- // space. So here we copy and swap to make sure we don't have any extra
- // memory taken up.
-
- if (m_die_array.size() < m_die_array.capacity()) {
- DWARFDebugInfoEntry::collection exact_size_die_array(m_die_array.begin(),
- m_die_array.end());
- exact_size_die_array.swap(m_die_array);
- }
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
- if (log && log->GetVerbose()) {
- StreamString strm;
- Dump(&strm);
- if (m_die_array.empty())
- strm.Printf("error: no DIE for compile unit");
- else
- m_die_array[0].Dump(m_dwarf2Data, this, strm, UINT32_MAX);
- log->PutString(strm.GetString());
- }
-
- if (!m_dwo_symbol_file)
- return m_die_array.size();
-
- DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
- size_t dwo_die_count = dwo_cu->ExtractDIEsIfNeeded(cu_die_only);
- return m_die_array.size() + dwo_die_count -
- 1; // We have 2 CU die, but we want to count it only as one
-}
-
-void DWARFCompileUnit::AddCompileUnitDIE(DWARFDebugInfoEntry &die) {
- assert(m_die_array.empty() && "Compile unit DIE already added");
- AddDIE(die);
-
- const DWARFDebugInfoEntry &cu_die = m_die_array.front();
- std::unique_ptr<SymbolFileDWARFDwo> dwo_symbol_file =
- m_dwarf2Data->GetDwoSymbolFileForCompileUnit(*this, cu_die);
- if (!dwo_symbol_file)
- return;
-
- DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
- if (!dwo_cu)
- return; // Can't fetch the compile unit from the dwo file.
-
- DWARFDIE dwo_cu_die = dwo_cu->GetCompileUnitDIEOnly();
- if (!dwo_cu_die.IsValid())
- return; // Can't fetch the compile unit DIE from the dwo file.
-
- uint64_t main_dwo_id = cu_die.GetAttributeValueAsUnsigned(
- m_dwarf2Data, this, DW_AT_GNU_dwo_id, 0);
- uint64_t sub_dwo_id =
- dwo_cu_die.GetAttributeValueAsUnsigned(DW_AT_GNU_dwo_id, 0);
- if (main_dwo_id != sub_dwo_id)
- return; // The 2 dwo ID isn't match. Don't use the dwo file as it belongs to
- // a differectn compilation.
-
- m_dwo_symbol_file = std::move(dwo_symbol_file);
-
- dw_addr_t addr_base = cu_die.GetAttributeValueAsUnsigned(
- m_dwarf2Data, this, DW_AT_GNU_addr_base, 0);
- dw_addr_t ranges_base = cu_die.GetAttributeValueAsUnsigned(
- m_dwarf2Data, this, DW_AT_GNU_ranges_base, 0);
- dwo_cu->SetAddrBase(addr_base, ranges_base, m_offset);
-}
-
-dw_offset_t DWARFCompileUnit::GetAbbrevOffset() const {
- return m_abbrevs ? m_abbrevs->GetOffset() : DW_INVALID_OFFSET;
-}
-
-bool DWARFCompileUnit::Verify(Stream *s) const {
- const DWARFDataExtractor &debug_info = m_dwarf2Data->get_debug_info_data();
- bool valid_offset = debug_info.ValidOffset(m_offset);
- bool length_OK = debug_info.ValidOffset(GetNextCompileUnitOffset() - 1);
- bool version_OK = SymbolFileDWARF::SupportedVersion(m_version);
- bool abbr_offset_OK =
- m_dwarf2Data->get_debug_abbrev_data().ValidOffset(GetAbbrevOffset());
- bool addr_size_OK = ((m_addr_size == 4) || (m_addr_size == 8));
- if (valid_offset && length_OK && version_OK && addr_size_OK &&
- abbr_offset_OK) {
- return true;
- } else {
- s->Printf(" 0x%8.8x: ", m_offset);
- DumpDataExtractor(m_dwarf2Data->get_debug_info_data(), s, m_offset,
- lldb::eFormatHex, 1, Size(), 32, LLDB_INVALID_ADDRESS, 0,
- 0);
- s->EOL();
- if (valid_offset) {
- if (!length_OK)
- s->Printf(" The length (0x%8.8x) for this compile unit is too "
- "large for the .debug_info provided.\n",
- m_length);
- if (!version_OK)
- s->Printf(" The 16 bit compile unit header version is not "
- "supported.\n");
- if (!abbr_offset_OK)
- s->Printf(" The offset into the .debug_abbrev section (0x%8.8x) "
- "is not valid.\n",
- GetAbbrevOffset());
- if (!addr_size_OK)
- s->Printf(" The address size is unsupported: 0x%2.2x\n",
- m_addr_size);
- } else
- s->Printf(" The start offset of the compile unit header in the "
- ".debug_info is invalid.\n");
- }
- return false;
-}
-
void DWARFCompileUnit::Dump(Stream *s) const {
s->Printf("0x%8.8x: Compile Unit: length = 0x%8.8x, version = 0x%4.4x, "
"abbr_offset = 0x%8.8x, addr_size = 0x%2.2x (next CU at "
@@ -344,768 +65,7 @@ void DWARFCompileUnit::Dump(Stream *s) const {
GetNextCompileUnitOffset());
}
-static uint8_t g_default_addr_size = 4;
-
-uint8_t DWARFCompileUnit::GetAddressByteSize(const DWARFCompileUnit *cu) {
- if (cu)
- return cu->GetAddressByteSize();
- return DWARFCompileUnit::GetDefaultAddressSize();
-}
-
-bool DWARFCompileUnit::IsDWARF64(const DWARFCompileUnit *cu) {
- if (cu)
- return cu->IsDWARF64();
- return false;
-}
-
-uint8_t DWARFCompileUnit::GetDefaultAddressSize() {
- return g_default_addr_size;
-}
-
-void DWARFCompileUnit::SetDefaultAddressSize(uint8_t addr_size) {
- g_default_addr_size = addr_size;
-}
-
-lldb::user_id_t DWARFCompileUnit::GetID() const {
- dw_offset_t local_id =
- m_base_obj_offset != DW_INVALID_OFFSET ? m_base_obj_offset : m_offset;
- if (m_dwarf2Data)
- return DIERef(local_id, local_id).GetUID(m_dwarf2Data);
- else
- return local_id;
-}
-
-void DWARFCompileUnit::BuildAddressRangeTable(
- SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges) {
- // This function is usually called if there in no .debug_aranges section
- // in order to produce a compile unit level set of address ranges that
- // is accurate.
-
- size_t num_debug_aranges = debug_aranges->GetNumRanges();
-
- // First get the compile unit DIE only and check if it has a DW_AT_ranges
- const DWARFDebugInfoEntry *die = GetCompileUnitDIEPtrOnly();
-
- const dw_offset_t cu_offset = GetOffset();
- if (die) {
- DWARFRangeList ranges;
- const size_t num_ranges =
- die->GetAttributeAddressRanges(dwarf2Data, this, ranges, false);
- if (num_ranges > 0) {
- // This compile unit has DW_AT_ranges, assume this is correct if it
- // is present since clang no longer makes .debug_aranges by default
- // and it emits DW_AT_ranges for DW_TAG_compile_units. GCC also does
- // this with recent GCC builds.
- for (size_t i = 0; i < num_ranges; ++i) {
- const DWARFRangeList::Entry &range = ranges.GetEntryRef(i);
- debug_aranges->AppendRange(cu_offset, range.GetRangeBase(),
- range.GetRangeEnd());
- }
-
- return; // We got all of our ranges from the DW_AT_ranges attribute
- }
- }
- // We don't have a DW_AT_ranges attribute, so we need to parse the DWARF
-
- // If the DIEs weren't parsed, then we don't want all dies for all compile
- // units
- // to stay loaded when they weren't needed. So we can end up parsing the DWARF
- // and then throwing them all away to keep memory usage down.
- const bool clear_dies = ExtractDIEsIfNeeded(false) > 1;
-
- die = DIEPtr();
- if (die)
- die->BuildAddressRangeTable(dwarf2Data, this, debug_aranges);
-
- if (debug_aranges->GetNumRanges() == num_debug_aranges) {
- // We got nothing from the functions, maybe we have a line tables only
- // situation. Check the line tables and build the arange table from this.
- SymbolContext sc;
- sc.comp_unit = dwarf2Data->GetCompUnitForDWARFCompUnit(this);
- if (sc.comp_unit) {
- SymbolFileDWARFDebugMap *debug_map_sym_file =
- m_dwarf2Data->GetDebugMapSymfile();
- if (debug_map_sym_file == NULL) {
- LineTable *line_table = sc.comp_unit->GetLineTable();
-
- if (line_table) {
- LineTable::FileAddressRanges file_ranges;
- const bool append = true;
- const size_t num_ranges =
- line_table->GetContiguousFileAddressRanges(file_ranges, append);
- for (uint32_t idx = 0; idx < num_ranges; ++idx) {
- const LineTable::FileAddressRanges::Entry &range =
- file_ranges.GetEntryRef(idx);
- debug_aranges->AppendRange(cu_offset, range.GetRangeBase(),
- range.GetRangeEnd());
- }
- }
- } else
- debug_map_sym_file->AddOSOARanges(dwarf2Data, debug_aranges);
- }
- }
-
- if (debug_aranges->GetNumRanges() == num_debug_aranges) {
- // We got nothing from the functions, maybe we have a line tables only
- // situation. Check the line tables and build the arange table from this.
- SymbolContext sc;
- sc.comp_unit = dwarf2Data->GetCompUnitForDWARFCompUnit(this);
- if (sc.comp_unit) {
- LineTable *line_table = sc.comp_unit->GetLineTable();
-
- if (line_table) {
- LineTable::FileAddressRanges file_ranges;
- const bool append = true;
- const size_t num_ranges =
- line_table->GetContiguousFileAddressRanges(file_ranges, append);
- for (uint32_t idx = 0; idx < num_ranges; ++idx) {
- const LineTable::FileAddressRanges::Entry &range =
- file_ranges.GetEntryRef(idx);
- debug_aranges->AppendRange(GetOffset(), range.GetRangeBase(),
- range.GetRangeEnd());
- }
- }
- }
- }
-
- // Keep memory down by clearing DIEs if this generate function
- // caused them to be parsed
- if (clear_dies)
- ClearDIEs(true);
-}
-
-const DWARFDebugAranges &DWARFCompileUnit::GetFunctionAranges() {
- if (m_func_aranges_ap.get() == NULL) {
- m_func_aranges_ap.reset(new DWARFDebugAranges());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
-
- if (log) {
- m_dwarf2Data->GetObjectFile()->GetModule()->LogMessage(
- log, "DWARFCompileUnit::GetFunctionAranges() for compile unit at "
- ".debug_info[0x%8.8x]",
- GetOffset());
- }
- const DWARFDebugInfoEntry *die = DIEPtr();
- if (die)
- die->BuildFunctionAddressRangeTable(m_dwarf2Data, this,
- m_func_aranges_ap.get());
-
- if (m_dwo_symbol_file) {
- DWARFCompileUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
- const DWARFDebugInfoEntry *dwo_die = dwo_cu->DIEPtr();
- if (dwo_die)
- dwo_die->BuildFunctionAddressRangeTable(m_dwo_symbol_file.get(), dwo_cu,
- m_func_aranges_ap.get());
- }
-
- const bool minimize = false;
- m_func_aranges_ap->Sort(minimize);
- }
- return *m_func_aranges_ap.get();
-}
-
-DWARFDIE
-DWARFCompileUnit::LookupAddress(const dw_addr_t address) {
- if (DIE()) {
- const DWARFDebugAranges &func_aranges = GetFunctionAranges();
-
- // Re-check the aranges auto pointer contents in case it was created above
- if (!func_aranges.IsEmpty())
- return GetDIE(func_aranges.FindAddress(address));
- }
- return DWARFDIE();
-}
-
-//----------------------------------------------------------------------
-// Compare function DWARFDebugAranges::Range structures
-//----------------------------------------------------------------------
-static bool CompareDIEOffset(const DWARFDebugInfoEntry &die,
- const dw_offset_t die_offset) {
- return die.GetOffset() < die_offset;
-}
-
-//----------------------------------------------------------------------
-// GetDIE()
-//
-// Get the DIE (Debug Information Entry) with the specified offset by
-// first checking if the DIE is contained within this compile unit and
-// grabbing the DIE from this compile unit. Otherwise we grab the DIE
-// from the DWARF file.
-//----------------------------------------------------------------------
-DWARFDIE
-DWARFCompileUnit::GetDIE(dw_offset_t die_offset) {
- if (die_offset != DW_INVALID_OFFSET) {
- if (m_dwo_symbol_file)
- return m_dwo_symbol_file->GetCompileUnit()->GetDIE(die_offset);
-
- if (ContainsDIEOffset(die_offset)) {
- ExtractDIEsIfNeeded(false);
- DWARFDebugInfoEntry::iterator end = m_die_array.end();
- DWARFDebugInfoEntry::iterator pos =
- lower_bound(m_die_array.begin(), end, die_offset, CompareDIEOffset);
- if (pos != end) {
- if (die_offset == (*pos).GetOffset())
- return DWARFDIE(this, &(*pos));
- }
- } else {
- // Don't specify the compile unit offset as we don't know it because the
- // DIE belongs to
- // a different compile unit in the same symbol file.
- return m_dwarf2Data->DebugInfo()->GetDIEForDIEOffset(die_offset);
- }
- }
- return DWARFDIE(); // Not found
-}
-
-size_t DWARFCompileUnit::AppendDIEsWithTag(const dw_tag_t tag,
- DWARFDIECollection &dies,
- uint32_t depth) const {
- size_t old_size = dies.Size();
- DWARFDebugInfoEntry::const_iterator pos;
- DWARFDebugInfoEntry::const_iterator end = m_die_array.end();
- for (pos = m_die_array.begin(); pos != end; ++pos) {
- if (pos->Tag() == tag)
- dies.Append(DWARFDIE(this, &(*pos)));
- }
-
- // Return the number of DIEs added to the collection
- return dies.Size() - old_size;
-}
-
-// void
-// DWARFCompileUnit::AddGlobalDIEByIndex (uint32_t die_idx)
-//{
-// m_global_die_indexes.push_back (die_idx);
-//}
-//
-//
-// void
-// DWARFCompileUnit::AddGlobal (const DWARFDebugInfoEntry* die)
-//{
-// // Indexes to all file level global and static variables
-// m_global_die_indexes;
-//
-// if (m_die_array.empty())
-// return;
-//
-// const DWARFDebugInfoEntry* first_die = &m_die_array[0];
-// const DWARFDebugInfoEntry* end = first_die + m_die_array.size();
-// if (first_die <= die && die < end)
-// m_global_die_indexes.push_back (die - first_die);
-//}
-
-void DWARFCompileUnit::Index(NameToDIE &func_basenames,
- NameToDIE &func_fullnames, NameToDIE &func_methods,
- NameToDIE &func_selectors,
- NameToDIE &objc_class_selectors,
- NameToDIE &globals, NameToDIE &types,
- NameToDIE &namespaces) {
- assert(!m_dwarf2Data->GetBaseCompileUnit() &&
- "DWARFCompileUnit associated with .dwo or .dwp "
- "should not be indexed directly");
-
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
-
- if (log) {
- m_dwarf2Data->GetObjectFile()->GetModule()->LogMessage(
- log,
- "DWARFCompileUnit::Index() for compile unit at .debug_info[0x%8.8x]",
- GetOffset());
- }
-
- const LanguageType cu_language = GetLanguageType();
- DWARFFormValue::FixedFormSizes fixed_form_sizes =
- DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
- m_is_dwarf64);
-
- IndexPrivate(this, cu_language, fixed_form_sizes, GetOffset(), func_basenames,
- func_fullnames, func_methods, func_selectors,
- objc_class_selectors, globals, types, namespaces);
-
- SymbolFileDWARFDwo *dwo_symbol_file = GetDwoSymbolFile();
- if (dwo_symbol_file) {
- IndexPrivate(dwo_symbol_file->GetCompileUnit(), cu_language,
- fixed_form_sizes, GetOffset(), func_basenames, func_fullnames,
- func_methods, func_selectors, objc_class_selectors, globals,
- types, namespaces);
- }
-}
-
-void DWARFCompileUnit::IndexPrivate(
- DWARFCompileUnit *dwarf_cu, const LanguageType cu_language,
- const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
- const dw_offset_t cu_offset, NameToDIE &func_basenames,
- NameToDIE &func_fullnames, NameToDIE &func_methods,
- NameToDIE &func_selectors, NameToDIE &objc_class_selectors,
- NameToDIE &globals, NameToDIE &types, NameToDIE &namespaces) {
- DWARFDebugInfoEntry::const_iterator pos;
- DWARFDebugInfoEntry::const_iterator begin = dwarf_cu->m_die_array.begin();
- DWARFDebugInfoEntry::const_iterator end = dwarf_cu->m_die_array.end();
- for (pos = begin; pos != end; ++pos) {
- const DWARFDebugInfoEntry &die = *pos;
-
- const dw_tag_t tag = die.Tag();
-
- switch (tag) {
- case DW_TAG_array_type:
- case DW_TAG_base_type:
- case DW_TAG_class_type:
- case DW_TAG_constant:
- case DW_TAG_enumeration_type:
- case DW_TAG_inlined_subroutine:
- case DW_TAG_namespace:
- case DW_TAG_string_type:
- case DW_TAG_structure_type:
- case DW_TAG_subprogram:
- case DW_TAG_subroutine_type:
- case DW_TAG_typedef:
- case DW_TAG_union_type:
- case DW_TAG_unspecified_type:
- case DW_TAG_variable:
- break;
-
- default:
- continue;
- }
-
- DWARFAttributes attributes;
- const char *name = NULL;
- const char *mangled_cstr = NULL;
- bool is_declaration = false;
- // bool is_artificial = false;
- bool has_address = false;
- bool has_location_or_const_value = false;
- bool is_global_or_static_variable = false;
-
- DWARFFormValue specification_die_form;
- const size_t num_attributes =
- die.GetAttributes(dwarf_cu, fixed_form_sizes, attributes);
- if (num_attributes > 0) {
- for (uint32_t i = 0; i < num_attributes; ++i) {
- dw_attr_t attr = attributes.AttributeAtIndex(i);
- DWARFFormValue form_value;
- switch (attr) {
- case DW_AT_name:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- name = form_value.AsCString();
- break;
-
- case DW_AT_declaration:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- is_declaration = form_value.Unsigned() != 0;
- break;
-
- // case DW_AT_artificial:
- // if (attributes.ExtractFormValueAtIndex(i,
- // form_value))
- // is_artificial = form_value.Unsigned() != 0;
- // break;
-
- case DW_AT_MIPS_linkage_name:
- case DW_AT_linkage_name:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- mangled_cstr = form_value.AsCString();
- break;
-
- case DW_AT_low_pc:
- case DW_AT_high_pc:
- case DW_AT_ranges:
- has_address = true;
- break;
-
- case DW_AT_entry_pc:
- has_address = true;
- break;
-
- case DW_AT_location:
- case DW_AT_const_value:
- has_location_or_const_value = true;
- if (tag == DW_TAG_variable) {
- const DWARFDebugInfoEntry *parent_die = die.GetParent();
- while (parent_die != NULL) {
- switch (parent_die->Tag()) {
- case DW_TAG_subprogram:
- case DW_TAG_lexical_block:
- case DW_TAG_inlined_subroutine:
- // Even if this is a function level static, we don't add it. We
- // could theoretically
- // add these if we wanted to by introspecting into the
- // DW_AT_location and seeing
- // if the location describes a hard coded address, but we dont
- // want the performance
- // penalty of that right now.
- is_global_or_static_variable = false;
- // if
- // (attributes.ExtractFormValueAtIndex(dwarf2Data,
- // i, form_value))
- // {
- // // If we have valid block
- // data, then we have location
- // expression bytes
- // // that are fixed (not a
- // location list).
- // const uint8_t *block_data =
- // form_value.BlockData();
- // if (block_data)
- // {
- // uint32_t block_length =
- // form_value.Unsigned();
- // if (block_length == 1 +
- // attributes.CompileUnitAtIndex(i)->GetAddressByteSize())
- // {
- // if (block_data[0] ==
- // DW_OP_addr)
- // add_die = true;
- // }
- // }
- // }
- parent_die = NULL; // Terminate the while loop.
- break;
-
- case DW_TAG_compile_unit:
- is_global_or_static_variable = true;
- parent_die = NULL; // Terminate the while loop.
- break;
-
- default:
- parent_die =
- parent_die->GetParent(); // Keep going in the while loop.
- break;
- }
- }
- }
- break;
-
- case DW_AT_specification:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- specification_die_form = form_value;
- break;
- }
- }
- }
-
- switch (tag) {
- case DW_TAG_subprogram:
- if (has_address) {
- if (name) {
- ObjCLanguage::MethodName objc_method(name, true);
- if (objc_method.IsValid(true)) {
- ConstString objc_class_name_with_category(
- objc_method.GetClassNameWithCategory());
- ConstString objc_selector_name(objc_method.GetSelector());
- ConstString objc_fullname_no_category_name(
- objc_method.GetFullNameWithoutCategory(true));
- ConstString objc_class_name_no_category(objc_method.GetClassName());
- func_fullnames.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- if (objc_class_name_with_category)
- objc_class_selectors.Insert(objc_class_name_with_category,
- DIERef(cu_offset, die.GetOffset()));
- if (objc_class_name_no_category &&
- objc_class_name_no_category != objc_class_name_with_category)
- objc_class_selectors.Insert(objc_class_name_no_category,
- DIERef(cu_offset, die.GetOffset()));
- if (objc_selector_name)
- func_selectors.Insert(objc_selector_name,
- DIERef(cu_offset, die.GetOffset()));
- if (objc_fullname_no_category_name)
- func_fullnames.Insert(objc_fullname_no_category_name,
- DIERef(cu_offset, die.GetOffset()));
- }
- // If we have a mangled name, then the DW_AT_name attribute
- // is usually the method name without the class or any parameters
- const DWARFDebugInfoEntry *parent = die.GetParent();
- bool is_method = false;
- if (parent) {
- dw_tag_t parent_tag = parent->Tag();
- if (parent_tag == DW_TAG_class_type ||
- parent_tag == DW_TAG_structure_type) {
- is_method = true;
- } else {
- if (specification_die_form.IsValid()) {
- DWARFDIE specification_die =
- dwarf_cu->GetSymbolFileDWARF()->DebugInfo()->GetDIE(
- DIERef(specification_die_form));
- if (specification_die.GetParent().IsStructOrClass())
- is_method = true;
- }
- }
- }
-
- if (is_method)
- func_methods.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- else
- func_basenames.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
-
- if (!is_method && !mangled_cstr && !objc_method.IsValid(true))
- func_fullnames.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- }
- if (mangled_cstr) {
- // Make sure our mangled name isn't the same string table entry
- // as our name. If it starts with '_', then it is ok, else compare
- // the string to make sure it isn't the same and we don't end up
- // with duplicate entries
- if (name && name != mangled_cstr &&
- ((mangled_cstr[0] == '_') ||
- (::strcmp(name, mangled_cstr) != 0))) {
- Mangled mangled(ConstString(mangled_cstr), true);
- func_fullnames.Insert(mangled.GetMangledName(),
- DIERef(cu_offset, die.GetOffset()));
- ConstString demangled = mangled.GetDemangledName(cu_language);
- if (demangled)
- func_fullnames.Insert(demangled,
- DIERef(cu_offset, die.GetOffset()));
- }
- }
- }
- break;
-
- case DW_TAG_inlined_subroutine:
- if (has_address) {
- if (name)
- func_basenames.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- if (mangled_cstr) {
- // Make sure our mangled name isn't the same string table entry
- // as our name. If it starts with '_', then it is ok, else compare
- // the string to make sure it isn't the same and we don't end up
- // with duplicate entries
- if (name && name != mangled_cstr &&
- ((mangled_cstr[0] == '_') ||
- (::strcmp(name, mangled_cstr) != 0))) {
- Mangled mangled(ConstString(mangled_cstr), true);
- func_fullnames.Insert(mangled.GetMangledName(),
- DIERef(cu_offset, die.GetOffset()));
- ConstString demangled = mangled.GetDemangledName(cu_language);
- if (demangled)
- func_fullnames.Insert(demangled,
- DIERef(cu_offset, die.GetOffset()));
- }
- } else
- func_fullnames.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- }
- break;
-
- case DW_TAG_array_type:
- case DW_TAG_base_type:
- case DW_TAG_class_type:
- case DW_TAG_constant:
- case DW_TAG_enumeration_type:
- case DW_TAG_string_type:
- case DW_TAG_structure_type:
- case DW_TAG_subroutine_type:
- case DW_TAG_typedef:
- case DW_TAG_union_type:
- case DW_TAG_unspecified_type:
- if (name && !is_declaration)
- types.Insert(ConstString(name), DIERef(cu_offset, die.GetOffset()));
- if (mangled_cstr && !is_declaration)
- types.Insert(ConstString(mangled_cstr),
- DIERef(cu_offset, die.GetOffset()));
- break;
-
- case DW_TAG_namespace:
- if (name)
- namespaces.Insert(ConstString(name),
- DIERef(cu_offset, die.GetOffset()));
- break;
-
- case DW_TAG_variable:
- if (name && has_location_or_const_value && is_global_or_static_variable) {
- globals.Insert(ConstString(name), DIERef(cu_offset, die.GetOffset()));
- // Be sure to include variables by their mangled and demangled
- // names if they have any since a variable can have a basename
- // "i", a mangled named "_ZN12_GLOBAL__N_11iE" and a demangled
- // mangled name "(anonymous namespace)::i"...
-
- // Make sure our mangled name isn't the same string table entry
- // as our name. If it starts with '_', then it is ok, else compare
- // the string to make sure it isn't the same and we don't end up
- // with duplicate entries
- if (mangled_cstr && name != mangled_cstr &&
- ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0))) {
- Mangled mangled(ConstString(mangled_cstr), true);
- globals.Insert(mangled.GetMangledName(),
- DIERef(cu_offset, die.GetOffset()));
- ConstString demangled = mangled.GetDemangledName(cu_language);
- if (demangled)
- globals.Insert(demangled, DIERef(cu_offset, die.GetOffset()));
- }
- }
- break;
-
- default:
- continue;
- }
- }
-}
-
-bool DWARFCompileUnit::Supports_unnamed_objc_bitfields() {
- if (GetProducer() == eProducerClang) {
- const uint32_t major_version = GetProducerVersionMajor();
- if (major_version > 425 ||
- (major_version == 425 && GetProducerVersionUpdate() >= 13))
- return true;
- else
- return false;
- }
- return true; // Assume all other compilers didn't have incorrect ObjC bitfield
- // info
-}
-
-bool DWARFCompileUnit::Supports_DW_AT_APPLE_objc_complete_type() {
- if (GetProducer() == eProducerLLVMGCC)
- return false;
- return true;
-}
-
-bool DWARFCompileUnit::DW_AT_decl_file_attributes_are_invalid() {
- // llvm-gcc makes completely invalid decl file attributes and won't ever
- // be fixed, so we need to know to ignore these.
- return GetProducer() == eProducerLLVMGCC;
-}
-
-void DWARFCompileUnit::ParseProducerInfo() {
- m_producer_version_major = UINT32_MAX;
- m_producer_version_minor = UINT32_MAX;
- m_producer_version_update = UINT32_MAX;
-
- const DWARFDebugInfoEntry *die = GetCompileUnitDIEPtrOnly();
- if (die) {
-
- const char *producer_cstr = die->GetAttributeValueAsString(
- m_dwarf2Data, this, DW_AT_producer, NULL);
- if (producer_cstr) {
- RegularExpression llvm_gcc_regex(
- llvm::StringRef("^4\\.[012]\\.[01] \\(Based on Apple "
- "Inc\\. build [0-9]+\\) \\(LLVM build "
- "[\\.0-9]+\\)$"));
- if (llvm_gcc_regex.Execute(llvm::StringRef(producer_cstr))) {
- m_producer = eProducerLLVMGCC;
- } else if (strstr(producer_cstr, "clang")) {
- static RegularExpression g_clang_version_regex(
- llvm::StringRef("clang-([0-9]+)\\.([0-9]+)\\.([0-9]+)"));
- RegularExpression::Match regex_match(3);
- if (g_clang_version_regex.Execute(llvm::StringRef(producer_cstr),
- &regex_match)) {
- std::string str;
- if (regex_match.GetMatchAtIndex(producer_cstr, 1, str))
- m_producer_version_major =
- StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
- if (regex_match.GetMatchAtIndex(producer_cstr, 2, str))
- m_producer_version_minor =
- StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
- if (regex_match.GetMatchAtIndex(producer_cstr, 3, str))
- m_producer_version_update =
- StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
- }
- m_producer = eProducerClang;
- } else if (strstr(producer_cstr, "GNU"))
- m_producer = eProducerGCC;
- }
- }
- if (m_producer == eProducerInvalid)
- m_producer = eProcucerOther;
-}
-
-DWARFCompileUnit::Producer DWARFCompileUnit::GetProducer() {
- if (m_producer == eProducerInvalid)
- ParseProducerInfo();
- return m_producer;
-}
-
-uint32_t DWARFCompileUnit::GetProducerVersionMajor() {
- if (m_producer_version_major == 0)
- ParseProducerInfo();
- return m_producer_version_major;
-}
-
-uint32_t DWARFCompileUnit::GetProducerVersionMinor() {
- if (m_producer_version_minor == 0)
- ParseProducerInfo();
- return m_producer_version_minor;
-}
-
-uint32_t DWARFCompileUnit::GetProducerVersionUpdate() {
- if (m_producer_version_update == 0)
- ParseProducerInfo();
- return m_producer_version_update;
-}
-
-LanguageType DWARFCompileUnit::LanguageTypeFromDWARF(uint64_t val) {
- // Note: user languages between lo_user and hi_user
- // must be handled explicitly here.
- switch (val) {
- case DW_LANG_Mips_Assembler:
- return eLanguageTypeMipsAssembler;
- case DW_LANG_GOOGLE_RenderScript:
- return eLanguageTypeExtRenderScript;
- default:
- return static_cast<LanguageType>(val);
- }
-}
-
-LanguageType DWARFCompileUnit::GetLanguageType() {
- if (m_language_type != eLanguageTypeUnknown)
- return m_language_type;
-
- const DWARFDebugInfoEntry *die = GetCompileUnitDIEPtrOnly();
- if (die)
- m_language_type = LanguageTypeFromDWARF(die->GetAttributeValueAsUnsigned(
- m_dwarf2Data, this, DW_AT_language, 0));
- return m_language_type;
-}
-
-bool DWARFCompileUnit::IsDWARF64() const { return m_is_dwarf64; }
-
-bool DWARFCompileUnit::GetIsOptimized() {
- if (m_is_optimized == eLazyBoolCalculate) {
- const DWARFDebugInfoEntry *die = GetCompileUnitDIEPtrOnly();
- if (die) {
- m_is_optimized = eLazyBoolNo;
- if (die->GetAttributeValueAsUnsigned(m_dwarf2Data, this,
- DW_AT_APPLE_optimized, 0) == 1) {
- m_is_optimized = eLazyBoolYes;
- }
- }
- }
- if (m_is_optimized == eLazyBoolYes) {
- return true;
- } else {
- return false;
- }
-}
-
-DWARFFormValue::FixedFormSizes DWARFCompileUnit::GetFixedFormSizes() {
- return DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
- IsDWARF64());
-}
-
-TypeSystem *DWARFCompileUnit::GetTypeSystem() {
- if (m_dwarf2Data)
- return m_dwarf2Data->GetTypeSystemForLanguage(GetLanguageType());
- else
- return nullptr;
-}
-
-void DWARFCompileUnit::SetUserData(void *d) {
- m_user_data = d;
- if (m_dwo_symbol_file)
- m_dwo_symbol_file->GetCompileUnit()->SetUserData(d);
-}
-
-void DWARFCompileUnit::SetAddrBase(dw_addr_t addr_base,
- dw_addr_t ranges_base,
- dw_offset_t base_obj_offset) {
- m_addr_base = addr_base;
- m_ranges_base = ranges_base;
- m_base_obj_offset = base_obj_offset;
-}
-lldb::ByteOrder DWARFCompileUnit::GetByteOrder() const {
- return m_dwarf2Data->GetObjectFile()->GetByteOrder();
+const lldb_private::DWARFDataExtractor &DWARFCompileUnit::GetData() const {
+ return m_dwarf->get_debug_info_data();
}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
index 8ea0d6465adf..9c1fc82f58b7 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
@@ -10,214 +10,39 @@
#ifndef SymbolFileDWARF_DWARFCompileUnit_h_
#define SymbolFileDWARF_DWARFCompileUnit_h_
-#include "DWARFDIE.h"
-#include "DWARFDebugInfoEntry.h"
-#include "lldb/lldb-enumerations.h"
+#include "DWARFUnit.h"
-class NameToDIE;
-class SymbolFileDWARF;
-class SymbolFileDWARFDwo;
+class DWARFCompileUnit : public DWARFUnit {
+ friend class DWARFUnit;
-typedef std::shared_ptr<DWARFCompileUnit> DWARFCompileUnitSP;
-
-class DWARFCompileUnit {
public:
- enum Producer {
- eProducerInvalid = 0,
- eProducerClang,
- eProducerGCC,
- eProducerLLVMGCC,
- eProcucerOther
- };
-
- static DWARFCompileUnitSP Extract(SymbolFileDWARF *dwarf2Data,
- lldb::offset_t *offset_ptr);
- ~DWARFCompileUnit();
-
- size_t ExtractDIEsIfNeeded(bool cu_die_only);
- DWARFDIE LookupAddress(const dw_addr_t address);
- size_t AppendDIEsWithTag(const dw_tag_t tag,
- DWARFDIECollection &matching_dies,
- uint32_t depth = UINT32_MAX) const;
- bool Verify(lldb_private::Stream *s) const;
- void Dump(lldb_private::Stream *s) const;
- // Offset of the initial length field.
- dw_offset_t GetOffset() const { return m_offset; }
- lldb::user_id_t GetID() const;
- // Size in bytes of the initial length + compile unit header.
- uint32_t Size() const { return m_is_dwarf64 ? 23 : 11; }
- bool ContainsDIEOffset(dw_offset_t die_offset) const {
- return die_offset >= GetFirstDIEOffset() &&
- die_offset < GetNextCompileUnitOffset();
- }
- dw_offset_t GetFirstDIEOffset() const { return m_offset + Size(); }
- dw_offset_t GetNextCompileUnitOffset() const {
- return m_offset + (m_is_dwarf64 ? 12 : 4) + m_length;
+ static DWARFUnitSP Extract(SymbolFileDWARF *dwarf2Data,
+ const lldb_private::DWARFDataExtractor &debug_info,
+ lldb::offset_t *offset_ptr);
+ void Dump(lldb_private::Stream *s) const override;
+
+ //------------------------------------------------------------------
+ /// Get the data that contains the DIE information for this unit.
+ ///
+ /// @return
+ /// The correct data (.debug_types for DWARF 4 and earlier, and
+ /// .debug_info for DWARF 5 and later) for the DIE information in
+ /// this unit.
+ //------------------------------------------------------------------
+ const lldb_private::DWARFDataExtractor &GetData() const override;
+
+ //------------------------------------------------------------------
+ /// Get the size in bytes of the header.
+ ///
+ /// @return
+ /// Byte size of the compile unit header
+ //------------------------------------------------------------------
+ uint32_t GetHeaderByteSize() const override {
+ return m_is_dwarf64 ? 23 : 11;
}
- // Size of the CU data (without initial length and without header).
- size_t GetDebugInfoSize() const {
- return (m_is_dwarf64 ? 12 : 4) + m_length - Size();
- }
- // Size of the CU data incl. header but without initial length.
- uint32_t GetLength() const { return m_length; }
- uint16_t GetVersion() const { return m_version; }
- const DWARFAbbreviationDeclarationSet *GetAbbreviations() const {
- return m_abbrevs;
- }
- dw_offset_t GetAbbrevOffset() const;
- uint8_t GetAddressByteSize() const { return m_addr_size; }
- dw_addr_t GetBaseAddress() const { return m_base_addr; }
- dw_addr_t GetAddrBase() const { return m_addr_base; }
- dw_addr_t GetRangesBase() const { return m_ranges_base; }
- void SetAddrBase(dw_addr_t addr_base, dw_addr_t ranges_base, dw_offset_t base_obj_offset);
- void ClearDIEs(bool keep_compile_unit_die);
- void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data,
- DWARFDebugAranges *debug_aranges);
-
- lldb::ByteOrder GetByteOrder() const;
-
- lldb_private::TypeSystem *GetTypeSystem();
-
- DWARFFormValue::FixedFormSizes GetFixedFormSizes();
-
- void SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; }
-
- DWARFDIE
- GetCompileUnitDIEOnly() { return DWARFDIE(this, GetCompileUnitDIEPtrOnly()); }
-
- DWARFDIE
- DIE() { return DWARFDIE(this, DIEPtr()); }
-
- void AddDIE(DWARFDebugInfoEntry &die) {
- // The average bytes per DIE entry has been seen to be
- // around 14-20 so lets pre-reserve half of that since
- // we are now stripping the NULL tags.
-
- // Only reserve the memory if we are adding children of
- // the main compile unit DIE. The compile unit DIE is always
- // the first entry, so if our size is 1, then we are adding
- // the first compile unit child DIE and should reserve
- // the memory.
- if (m_die_array.empty())
- m_die_array.reserve(GetDebugInfoSize() / 24);
- m_die_array.push_back(die);
- }
-
- void AddCompileUnitDIE(DWARFDebugInfoEntry &die);
-
- bool HasDIEsParsed() const { return m_die_array.size() > 1; }
-
- DWARFDIE
- GetDIE(dw_offset_t die_offset);
-
- static uint8_t GetAddressByteSize(const DWARFCompileUnit *cu);
-
- static bool IsDWARF64(const DWARFCompileUnit *cu);
-
- static uint8_t GetDefaultAddressSize();
-
- static void SetDefaultAddressSize(uint8_t addr_size);
-
- void *GetUserData() const { return m_user_data; }
-
- void SetUserData(void *d);
-
- bool Supports_DW_AT_APPLE_objc_complete_type();
-
- bool DW_AT_decl_file_attributes_are_invalid();
-
- bool Supports_unnamed_objc_bitfields();
-
- void Index(NameToDIE &func_basenames, NameToDIE &func_fullnames,
- NameToDIE &func_methods, NameToDIE &func_selectors,
- NameToDIE &objc_class_selectors, NameToDIE &globals,
- NameToDIE &types, NameToDIE &namespaces);
-
- const DWARFDebugAranges &GetFunctionAranges();
-
- SymbolFileDWARF *GetSymbolFileDWARF() const { return m_dwarf2Data; }
-
- Producer GetProducer();
-
- uint32_t GetProducerVersionMajor();
-
- uint32_t GetProducerVersionMinor();
-
- uint32_t GetProducerVersionUpdate();
-
- static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
-
- lldb::LanguageType GetLanguageType();
-
- bool IsDWARF64() const;
-
- bool GetIsOptimized();
-
- SymbolFileDWARFDwo *GetDwoSymbolFile() const {
- return m_dwo_symbol_file.get();
- }
-
- dw_offset_t GetBaseObjOffset() const { return m_base_obj_offset; }
-
-protected:
- SymbolFileDWARF *m_dwarf2Data;
- std::unique_ptr<SymbolFileDWARFDwo> m_dwo_symbol_file;
- const DWARFAbbreviationDeclarationSet *m_abbrevs;
- void *m_user_data = nullptr;
- DWARFDebugInfoEntry::collection
- m_die_array; // The compile unit debug information entry item
- std::unique_ptr<DWARFDebugAranges> m_func_aranges_ap; // A table similar to
- // the .debug_aranges
- // table, but this one
- // points to the exact
- // DW_TAG_subprogram
- // DIEs
- dw_addr_t m_base_addr = 0;
- // Offset of the initial length field.
- dw_offset_t m_offset;
- dw_offset_t m_length;
- uint16_t m_version;
- uint8_t m_addr_size;
- Producer m_producer = eProducerInvalid;
- uint32_t m_producer_version_major = 0;
- uint32_t m_producer_version_minor = 0;
- uint32_t m_producer_version_update = 0;
- lldb::LanguageType m_language_type = lldb::eLanguageTypeUnknown;
- bool m_is_dwarf64;
- lldb_private::LazyBool m_is_optimized = lldb_private::eLazyBoolCalculate;
- dw_addr_t m_addr_base = 0; // Value of DW_AT_addr_base
- dw_addr_t m_ranges_base = 0; // Value of DW_AT_ranges_base
- // If this is a dwo compile unit this is the offset of the base compile unit
- // in the main object file
- dw_offset_t m_base_obj_offset = DW_INVALID_OFFSET;
-
- void ParseProducerInfo();
-
- static void
- IndexPrivate(DWARFCompileUnit *dwarf_cu, const lldb::LanguageType cu_language,
- const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
- const dw_offset_t cu_offset, NameToDIE &func_basenames,
- NameToDIE &func_fullnames, NameToDIE &func_methods,
- NameToDIE &func_selectors, NameToDIE &objc_class_selectors,
- NameToDIE &globals, NameToDIE &types, NameToDIE &namespaces);
private:
DWARFCompileUnit(SymbolFileDWARF *dwarf2Data);
-
- const DWARFDebugInfoEntry *GetCompileUnitDIEPtrOnly() {
- ExtractDIEsIfNeeded(true);
- if (m_die_array.empty())
- return NULL;
- return &m_die_array[0];
- }
-
- const DWARFDebugInfoEntry *DIEPtr() {
- ExtractDIEsIfNeeded(false);
- if (m_die_array.empty())
- return NULL;
- return &m_die_array[0];
- }
-
DISALLOW_COPY_AND_ASSIGN(DWARFCompileUnit);
};
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
index 4ef2e772ea5d..d9754e911017 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
@@ -10,43 +10,27 @@
#include "DWARFDIE.h"
#include "DWARFASTParser.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDIECollection.h"
-#include "DWARFDebugAbbrev.h"
-#include "DWARFDebugAranges.h"
#include "DWARFDebugInfo.h"
#include "DWARFDebugInfoEntry.h"
-#include "DWARFDebugRanges.h"
#include "DWARFDeclContext.h"
-#include "DWARFFormValue.h"
-#include "SymbolFileDWARF.h"
-
-#include "lldb/Core/Module.h"
-#include "lldb/Symbol/ObjectFile.h"
-#include "lldb/Symbol/Type.h"
-#include "lldb/Symbol/TypeSystem.h"
+#include "DWARFUnit.h"
using namespace lldb_private;
-DIERef DWARFDIE::GetDIERef() const {
- if (!IsValid())
- return DIERef();
-
- dw_offset_t cu_offset = m_cu->GetOffset();
- if (m_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
- cu_offset = m_cu->GetBaseObjOffset();
- return DIERef(cu_offset, m_die->GetOffset());
-}
+void DWARFDIE::ElaboratingDIEIterator::Next() {
+ assert(!m_worklist.empty() && "Incrementing end iterator?");
-dw_tag_t DWARFDIE::Tag() const {
- if (m_die)
- return m_die->Tag();
- else
- return 0;
-}
+ // Pop the current item from the list.
+ DWARFDIE die = m_worklist.back();
+ m_worklist.pop_back();
-const char *DWARFDIE::GetTagAsCString() const {
- return lldb_private::DW_TAG_value_to_name(Tag());
+ // And add back any items that elaborate it.
+ for (dw_attr_t attr : {DW_AT_specification, DW_AT_abstract_origin}) {
+ if (DWARFDIE d = die.GetReferencedDIE(attr))
+ if (m_seen.insert(die.GetID()).second)
+ m_worklist.push_back(d);
+ }
}
DWARFDIE
@@ -91,37 +75,10 @@ DWARFDIE::GetDIE(dw_offset_t die_offset) const {
return DWARFDIE();
}
-const char *DWARFDIE::GetAttributeValueAsString(const dw_attr_t attr,
- const char *fail_value) const {
- if (IsValid())
- return m_die->GetAttributeValueAsString(GetDWARF(), GetCU(), attr,
- fail_value);
- else
- return fail_value;
-}
-
-uint64_t DWARFDIE::GetAttributeValueAsUnsigned(const dw_attr_t attr,
- uint64_t fail_value) const {
- if (IsValid())
- return m_die->GetAttributeValueAsUnsigned(GetDWARF(), GetCU(), attr,
- fail_value);
- else
- return fail_value;
-}
-
-int64_t DWARFDIE::GetAttributeValueAsSigned(const dw_attr_t attr,
- int64_t fail_value) const {
- if (IsValid())
- return m_die->GetAttributeValueAsSigned(GetDWARF(), GetCU(), attr,
- fail_value);
- else
- return fail_value;
-}
-
DWARFDIE
DWARFDIE::GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const {
if (IsValid()) {
- DWARFCompileUnit *cu = GetCU();
+ DWARFUnit *cu = GetCU();
SymbolFileDWARF *dwarf = cu->GetSymbolFileDWARF();
const bool check_specification_or_abstract_origin = true;
DWARFFormValue form_value;
@@ -132,29 +89,11 @@ DWARFDIE::GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const {
return DWARFDIE();
}
-uint64_t DWARFDIE::GetAttributeValueAsReference(const dw_attr_t attr,
- uint64_t fail_value) const {
- if (IsValid())
- return m_die->GetAttributeValueAsReference(GetDWARF(), GetCU(), attr,
- fail_value);
- else
- return fail_value;
-}
-
-uint64_t DWARFDIE::GetAttributeValueAsAddress(const dw_attr_t attr,
- uint64_t fail_value) const {
- if (IsValid())
- return m_die->GetAttributeValueAsAddress(GetDWARF(), GetCU(), attr,
- fail_value);
- else
- return fail_value;
-}
-
DWARFDIE
DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const {
if (IsValid()) {
SymbolFileDWARF *dwarf = GetDWARF();
- DWARFCompileUnit *cu = GetCU();
+ DWARFUnit *cu = GetCU();
DWARFDebugInfoEntry *function_die = nullptr;
DWARFDebugInfoEntry *block_die = nullptr;
if (m_die->LookupAddress(file_addr, dwarf, cu, &function_die, &block_die)) {
@@ -171,17 +110,6 @@ DWARFDIE::LookupDeepestBlock(lldb::addr_t file_addr) const {
return DWARFDIE();
}
-lldb::user_id_t DWARFDIE::GetID() const {
- return GetDIERef().GetUID(GetDWARF());
-}
-
-const char *DWARFDIE::GetName() const {
- if (IsValid())
- return m_die->GetName(GetDWARF(), m_cu);
- else
- return nullptr;
-}
-
const char *DWARFDIE::GetMangledName() const {
if (IsValid())
return m_die->GetMangledName(GetDWARF(), m_cu);
@@ -203,28 +131,6 @@ const char *DWARFDIE::GetQualifiedName(std::string &storage) const {
return nullptr;
}
-lldb::LanguageType DWARFDIE::GetLanguage() const {
- if (IsValid())
- return m_cu->GetLanguageType();
- else
- return lldb::eLanguageTypeUnknown;
-}
-
-lldb::ModuleSP DWARFDIE::GetModule() const {
- SymbolFileDWARF *dwarf = GetDWARF();
- if (dwarf)
- return dwarf->GetObjectFile()->GetModule();
- else
- return lldb::ModuleSP();
-}
-
-lldb_private::CompileUnit *DWARFDIE::GetLLDBCompileUnit() const {
- if (IsValid())
- return GetDWARF()->GetCompUnitForDWARFCompUnit(GetCU());
- else
- return nullptr;
-}
-
lldb_private::Type *DWARFDIE::ResolveType() const {
if (IsValid())
return GetDWARF()->ResolveType(*this, true);
@@ -262,7 +168,7 @@ void DWARFDIE::GetDWARFDeclContext(DWARFDeclContext &dwarf_decl_ctx) const {
void DWARFDIE::GetDWOContext(std::vector<CompilerContext> &context) const {
const dw_tag_t tag = Tag();
- if (tag == DW_TAG_compile_unit)
+ if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
return;
DWARFDIE parent = GetParent();
if (parent)
@@ -317,45 +223,17 @@ DWARFDIE::GetParentDeclContextDIE() const {
return DWARFDIE();
}
-dw_offset_t DWARFDIE::GetOffset() const {
- if (IsValid())
- return m_die->GetOffset();
- else
- return DW_INVALID_OFFSET;
-}
-
-dw_offset_t DWARFDIE::GetCompileUnitRelativeOffset() const {
- if (IsValid())
- return m_die->GetOffset() - m_cu->GetOffset();
- else
- return DW_INVALID_OFFSET;
-}
-
-SymbolFileDWARF *DWARFDIE::GetDWARF() const {
- if (m_cu)
- return m_cu->GetSymbolFileDWARF();
- else
- return nullptr;
-}
-
-lldb_private::TypeSystem *DWARFDIE::GetTypeSystem() const {
- if (m_cu)
- return m_cu->GetTypeSystem();
- else
- return nullptr;
-}
-
-DWARFASTParser *DWARFDIE::GetDWARFParser() const {
- lldb_private::TypeSystem *type_system = GetTypeSystem();
- if (type_system)
- return type_system->GetDWARFParser();
- else
- return nullptr;
+bool DWARFDIE::IsStructUnionOrClass() const {
+ const dw_tag_t tag = Tag();
+ return tag == DW_TAG_class_type || tag == DW_TAG_structure_type ||
+ tag == DW_TAG_union_type;
}
-bool DWARFDIE::IsStructOrClass() const {
- const dw_tag_t tag = Tag();
- return tag == DW_TAG_class_type || tag == DW_TAG_structure_type;
+bool DWARFDIE::IsMethod() const {
+ for (DWARFDIE d: elaborating_dies())
+ if (d.GetParent().IsStructUnionOrClass())
+ return true;
+ return false;
}
DWARFDIE
@@ -369,7 +247,7 @@ DWARFDIE::GetContainingDWOModuleDIE() const {
const dw_tag_t tag = parent.Tag();
if (tag == DW_TAG_module)
top_module_die = parent;
- else if (tag == DW_TAG_compile_unit)
+ else if (tag == DW_TAG_compile_unit || tag == DW_TAG_partial_unit)
break;
}
@@ -391,25 +269,6 @@ lldb::ModuleSP DWARFDIE::GetContainingDWOModule() const {
return lldb::ModuleSP();
}
-bool DWARFDIE::HasChildren() const {
- return m_die && m_die->HasChildren();
-}
-
-bool DWARFDIE::Supports_DW_AT_APPLE_objc_complete_type() const {
- return IsValid() && GetDWARF()->Supports_DW_AT_APPLE_objc_complete_type(m_cu);
-}
-
-size_t DWARFDIE::GetAttributes(DWARFAttributes &attributes,
- uint32_t depth) const {
- if (IsValid()) {
- return m_die->GetAttributes(m_cu, m_cu->GetFixedFormSizes(), attributes,
- depth);
- }
- if (depth == 0)
- attributes.Clear();
- return 0;
-}
-
bool DWARFDIE::GetDIENamesAndRanges(
const char *&name, const char *&mangled, DWARFRangeList &ranges,
int &decl_file, int &decl_line, int &decl_column, int &call_file,
@@ -423,12 +282,6 @@ bool DWARFDIE::GetDIENamesAndRanges(
return false;
}
-void DWARFDIE::Dump(lldb_private::Stream *s,
- const uint32_t recurse_depth) const {
- if (s && IsValid())
- m_die->Dump(GetDWARF(), GetCU(), *s, recurse_depth);
-}
-
CompilerDecl DWARFDIE::GetDecl() const {
DWARFASTParser *dwarf_ast = GetDWARFParser();
if (dwarf_ast)
@@ -452,11 +305,3 @@ CompilerDeclContext DWARFDIE::GetContainingDeclContext() const {
else
return CompilerDeclContext();
}
-
-bool operator==(const DWARFDIE &lhs, const DWARFDIE &rhs) {
- return lhs.GetDIE() == rhs.GetDIE() && lhs.GetCU() == rhs.GetCU();
-}
-
-bool operator!=(const DWARFDIE &lhs, const DWARFDIE &rhs) {
- return !(lhs == rhs);
-}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDIE.h b/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
index 8af3015b9d76..ecbf4912634e 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDIE.h
@@ -10,115 +10,41 @@
#ifndef SymbolFileDWARF_DWARFDIE_h_
#define SymbolFileDWARF_DWARFDIE_h_
-#include "lldb/Core/dwarf.h"
-#include "lldb/lldb-types.h"
-
-struct DIERef;
-class DWARFASTParser;
-class DWARFAttributes;
-class DWARFCompileUnit;
-class DWARFDebugInfoEntry;
-class DWARFDeclContext;
-class DWARFDIECollection;
-class SymbolFileDWARF;
-
-class DWARFDIE {
-public:
- DWARFDIE() : m_cu(nullptr), m_die(nullptr) {}
-
- DWARFDIE(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die)
- : m_cu(cu), m_die(die) {}
-
- DWARFDIE(const DWARFCompileUnit *cu, DWARFDebugInfoEntry *die)
- : m_cu(const_cast<DWARFCompileUnit *>(cu)), m_die(die) {}
+#include "DWARFBaseDIE.h"
+#include "llvm/ADT/SmallSet.h"
- DWARFDIE(DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die)
- : m_cu(cu), m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
+class DWARFDIE : public DWARFBaseDIE {
+public:
+ class ElaboratingDIEIterator;
- DWARFDIE(const DWARFCompileUnit *cu, const DWARFDebugInfoEntry *die)
- : m_cu(const_cast<DWARFCompileUnit *>(cu)),
- m_die(const_cast<DWARFDebugInfoEntry *>(die)) {}
+ using DWARFBaseDIE::DWARFBaseDIE;
//----------------------------------------------------------------------
// Tests
//----------------------------------------------------------------------
- explicit operator bool() const { return IsValid(); }
-
- bool IsValid() const { return m_cu && m_die; }
-
- bool IsStructOrClass() const;
+ bool IsStructUnionOrClass() const;
- bool HasChildren() const;
-
- bool Supports_DW_AT_APPLE_objc_complete_type() const;
+ bool IsMethod() const;
//----------------------------------------------------------------------
// Accessors
//----------------------------------------------------------------------
- SymbolFileDWARF *GetDWARF() const;
-
- DWARFCompileUnit *GetCU() const { return m_cu; }
-
- DWARFDebugInfoEntry *GetDIE() const { return m_die; }
-
- DIERef GetDIERef() const;
-
- lldb_private::TypeSystem *GetTypeSystem() const;
-
- DWARFASTParser *GetDWARFParser() const;
-
- void Set(DWARFCompileUnit *cu, DWARFDebugInfoEntry *die) {
- if (cu && die) {
- m_cu = cu;
- m_die = die;
- } else {
- Clear();
- }
- }
-
- void Clear() {
- m_cu = nullptr;
- m_die = nullptr;
- }
-
lldb::ModuleSP GetContainingDWOModule() const;
DWARFDIE
GetContainingDWOModuleDIE() const;
- //----------------------------------------------------------------------
- // Accessing information about a DIE
- //----------------------------------------------------------------------
- dw_tag_t Tag() const;
-
- const char *GetTagAsCString() const;
-
- dw_offset_t GetOffset() const;
-
- dw_offset_t GetCompileUnitRelativeOffset() const;
+ inline llvm::iterator_range<ElaboratingDIEIterator> elaborating_dies() const;
//----------------------------------------------------------------------
- // Get the LLDB user ID for this DIE. This is often just the DIE offset,
- // but it might have a SymbolFileDWARF::GetID() in the high 32 bits if
- // we are doing Darwin DWARF in .o file, or DWARF stand alone debug
- // info.
+ // Accessing information about a DIE
//----------------------------------------------------------------------
- lldb::user_id_t GetID() const;
-
- const char *GetName() const;
-
const char *GetMangledName() const;
const char *GetPubname() const;
const char *GetQualifiedName(std::string &storage) const;
- lldb::LanguageType GetLanguage() const;
-
- lldb::ModuleSP GetModule() const;
-
- lldb_private::CompileUnit *GetLLDBCompileUnit() const;
-
lldb_private::Type *ResolveType() const;
//----------------------------------------------------------------------
@@ -149,6 +75,7 @@ public:
//----------------------------------------------------------------------
DWARFDIE
GetDIE(dw_offset_t die_offset) const;
+ using DWARFBaseDIE::GetDIE;
DWARFDIE
LookupDeepestBlock(lldb::addr_t file_addr) const;
@@ -172,26 +99,9 @@ public:
// looking for one or two attributes on a DIE. If you are trying to
// parse all attributes, use GetAttributes (...) instead
//----------------------------------------------------------------------
- const char *GetAttributeValueAsString(const dw_attr_t attr,
- const char *fail_value) const;
-
- uint64_t GetAttributeValueAsUnsigned(const dw_attr_t attr,
- uint64_t fail_value) const;
-
- int64_t GetAttributeValueAsSigned(const dw_attr_t attr,
- int64_t fail_value) const;
-
- uint64_t GetAttributeValueAsReference(const dw_attr_t attr,
- uint64_t fail_value) const;
-
DWARFDIE
GetAttributeValueAsReferenceDIE(const dw_attr_t attr) const;
- uint64_t GetAttributeValueAsAddress(const dw_attr_t attr,
- uint64_t fail_value) const;
-
- size_t GetAttributes(DWARFAttributes &attributes, uint32_t depth = 0) const;
-
bool GetDIENamesAndRanges(const char *&name, const char *&mangled,
DWARFRangeList &ranges, int &decl_file,
int &decl_line, int &decl_column, int &call_file,
@@ -199,23 +109,68 @@ public:
lldb_private::DWARFExpression *frame_base) const;
//----------------------------------------------------------------------
- // Pretty printing
+ // CompilerDecl related functions
//----------------------------------------------------------------------
- void Dump(lldb_private::Stream *s, const uint32_t recurse_depth) const;
-
lldb_private::CompilerDecl GetDecl() const;
lldb_private::CompilerDeclContext GetDeclContext() const;
lldb_private::CompilerDeclContext GetContainingDeclContext() const;
+};
+
+/// Iterate through all DIEs elaborating (i.e. reachable by a chain of
+/// DW_AT_specification and DW_AT_abstract_origin attributes) a given DIE. For
+/// convenience, the starting die is included in the sequence as the first
+/// item.
+class DWARFDIE::ElaboratingDIEIterator
+ : public std::iterator<std::input_iterator_tag, DWARFDIE> {
+
+ // The operating invariant is: top of m_worklist contains the "current" item
+ // and the rest of the list are items yet to be visited. An empty worklist
+ // means we've reached the end.
+ // Infinite recursion is prevented by maintaining a list of seen DIEs.
+ // Container sizes are optimized for the case of following DW_AT_specification
+ // and DW_AT_abstract_origin just once.
+ llvm::SmallVector<DWARFDIE, 2> m_worklist;
+ llvm::SmallSet<lldb::user_id_t, 3> m_seen;
+
+ void Next();
+
+public:
+ /// An iterator starting at die d.
+ explicit ElaboratingDIEIterator(DWARFDIE d) : m_worklist(1, d) {}
-protected:
- DWARFCompileUnit *m_cu;
- DWARFDebugInfoEntry *m_die;
+ /// End marker
+ ElaboratingDIEIterator() {}
+
+ const DWARFDIE &operator*() const { return m_worklist.back(); }
+ ElaboratingDIEIterator &operator++() {
+ Next();
+ return *this;
+ }
+ ElaboratingDIEIterator operator++(int) {
+ ElaboratingDIEIterator I = *this;
+ Next();
+ return I;
+ }
+
+ friend bool operator==(const ElaboratingDIEIterator &a,
+ const ElaboratingDIEIterator &b) {
+ if (a.m_worklist.empty() || b.m_worklist.empty())
+ return a.m_worklist.empty() == b.m_worklist.empty();
+ return a.m_worklist.back() == b.m_worklist.back();
+ }
+ friend bool operator!=(const ElaboratingDIEIterator &a,
+ const ElaboratingDIEIterator &b) {
+ return !(a == b);
+ }
};
-bool operator==(const DWARFDIE &lhs, const DWARFDIE &rhs);
-bool operator!=(const DWARFDIE &lhs, const DWARFDIE &rhs);
+llvm::iterator_range<DWARFDIE::ElaboratingDIEIterator>
+DWARFDIE::elaborating_dies() const {
+ return llvm::make_range(ElaboratingDIEIterator(*this),
+ ElaboratingDIEIterator());
+}
#endif // SymbolFileDWARF_DWARFDIE_h_
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
index 0c807d7d604b..2fcdd34d532f 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
@@ -22,6 +22,6 @@ DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const {
dw_offset_t
DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const {
- return GetMaxU64(offset_ptr, m_is_dwarf64 ? 8 : 4);
+ return GetMaxU64(offset_ptr, GetDWARFSizeOfOffset());
}
}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
index 46d09f1ca237..ce0bfb3931d5 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.h
@@ -29,7 +29,7 @@ public:
dw_offset_t GetDWARFOffset(lldb::offset_t *offset_ptr) const;
size_t GetDWARFSizeofInitialLength() const { return m_is_dwarf64 ? 12 : 4; }
-
+ size_t GetDWARFSizeOfOffset() const { return m_is_dwarf64 ? 8 : 4; }
bool IsDWARF64() const { return m_is_dwarf64; }
protected:
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
index 1cf0e7eeeb60..affe4b85bdab 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAbbrev.cpp
@@ -80,8 +80,8 @@ DWARFAbbreviationDeclarationSet::GetAbbreviationDeclaration(
//----------------------------------------------------------------------
// DWARFAbbreviationDeclarationSet::AppendAbbrevDeclSequential()
//
-// Append an abbreviation declaration with a sequential code for O(n)
-// lookups. Handy when creating an DWARFAbbreviationDeclarationSet.
+// Append an abbreviation declaration with a sequential code for O(n) lookups.
+// Handy when creating an DWARFAbbreviationDeclarationSet.
//----------------------------------------------------------------------
dw_uleb128_t DWARFAbbreviationDeclarationSet::AppendAbbrevDeclSequential(
const DWARFAbbreviationDeclaration &abbrevDecl) {
@@ -115,9 +115,9 @@ void DWARFAbbreviationDeclarationSet::GetUnsupportedForms(
//----------------------------------------------------------------------
// Encode
//
-// Encode the abbreviation table onto the end of the buffer provided
-// into a byte representation as would be found in a ".debug_abbrev"
-// debug information section.
+// Encode the abbreviation table onto the end of the buffer provided into a
+// byte representation as would be found in a ".debug_abbrev" debug information
+// section.
//----------------------------------------------------------------------
// void
// DWARFAbbreviationDeclarationSet::Encode(BinaryStreamBuf& debug_abbrev_buf)
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
index cecb69c8fb46..00265361f865 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugArangeSet.cpp
@@ -46,19 +46,17 @@ void DWARFDebugArangeSet::Compact() {
if (m_arange_descriptors.empty())
return;
- // Iterate through all arange descriptors and combine any ranges that
- // overlap or have matching boundaries. The m_arange_descriptors are assumed
- // to be in ascending order after being built by adding descriptors
- // using the AddDescriptor method.
+ // Iterate through all arange descriptors and combine any ranges that overlap
+ // or have matching boundaries. The m_arange_descriptors are assumed to be in
+ // ascending order after being built by adding descriptors using the
+ // AddDescriptor method.
uint32_t i = 0;
while (i + 1 < m_arange_descriptors.size()) {
if (m_arange_descriptors[i].end_address() >=
m_arange_descriptors[i + 1].address) {
// The current range ends at or exceeds the start of the next address
- // range.
- // Compute the max end address between the two and use that to make the
- // new
- // length.
+ // range. Compute the max end address between the two and use that to
+ // make the new length.
const dw_addr_t max_end_addr =
std::max(m_arange_descriptors[i].end_address(),
m_arange_descriptors[i + 1].end_address());
@@ -82,8 +80,8 @@ static bool DescriptorLessThan(const DWARFDebugArangeSet::Descriptor &range1,
}
//----------------------------------------------------------------------
-// Add a range descriptor and keep things sorted so we can easily
-// compact the ranges before being saved or used.
+// Add a range descriptor and keep things sorted so we can easily compact the
+// ranges before being saved or used.
//----------------------------------------------------------------------
void DWARFDebugArangeSet::AddDescriptor(
const DWARFDebugArangeSet::Descriptor &range) {
@@ -103,15 +101,14 @@ void DWARFDebugArangeSet::AddDescriptor(
// Non-contiguous entries, add this one before the found entry
m_arange_descriptors.insert(pos, range);
} else if (range_end_addr == pos->address) {
- // The top end of 'range' is the lower end of the entry
- // pointed to by 'pos'. We can combine range with the
- // entry we found by setting the starting address and
- // increasing the length since they don't overlap.
+ // The top end of 'range' is the lower end of the entry pointed to by
+ // 'pos'. We can combine range with the entry we found by setting the
+ // starting address and increasing the length since they don't overlap.
pos->address = range.address;
pos->length += range.length;
} else {
- // We can combine these two and make sure the largest end
- // address is used to make end address.
+ // We can combine these two and make sure the largest end address is
+ // used to make end address.
pos->address = range.address;
pos->length = std::max(found_end_addr, range_end_addr) - pos->address;
}
@@ -142,18 +139,18 @@ bool DWARFDebugArangeSet::Extract(const DWARFDataExtractor &data,
// 7.20 Address Range Table
//
- // Each set of entries in the table of address ranges contained in
- // the .debug_aranges section begins with a header consisting of: a
- // 4-byte length containing the length of the set of entries for this
- // compilation unit, not including the length field itself; a 2-byte
- // version identifier containing the value 2 for DWARF Version 2; a
- // 4-byte offset into the.debug_infosection; a 1-byte unsigned integer
- // containing the size in bytes of an address (or the offset portion of
- // an address for segmented addressing) on the target system; and a
- // 1-byte unsigned integer containing the size in bytes of a segment
- // descriptor on the target system. This header is followed by a series
- // of tuples. Each tuple consists of an address and a length, each in
- // the size appropriate for an address on the target architecture.
+ // Each set of entries in the table of address ranges contained in the
+ // .debug_aranges section begins with a header consisting of: a 4-byte
+ // length containing the length of the set of entries for this compilation
+ // unit, not including the length field itself; a 2-byte version identifier
+ // containing the value 2 for DWARF Version 2; a 4-byte offset into
+ // the.debug_infosection; a 1-byte unsigned integer containing the size in
+ // bytes of an address (or the offset portion of an address for segmented
+ // addressing) on the target system; and a 1-byte unsigned integer
+ // containing the size in bytes of a segment descriptor on the target
+ // system. This header is followed by a series of tuples. Each tuple
+ // consists of an address and a length, each in the size appropriate for an
+ // address on the target architecture.
m_header.length = data.GetDWARFInitialLength(offset_ptr);
m_header.version = data.GetU16(offset_ptr);
m_header.cu_offset = data.GetDWARFOffset(offset_ptr);
@@ -195,8 +192,8 @@ bool DWARFDebugArangeSet::Extract(const DWARFDataExtractor &data,
arangeDescriptor.length =
data.GetMaxU64(offset_ptr, m_header.addr_size);
- // Each set of tuples is terminated by a 0 for the address and 0
- // for the length.
+ // Each set of tuples is terminated by a 0 for the address and 0 for
+ // the length.
if (arangeDescriptor.address || arangeDescriptor.length)
m_arange_descriptors.push_back(arangeDescriptor);
else
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
index 13c2d8726821..02f528d571b0 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -18,7 +18,7 @@
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/Timer.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfo.h"
#include "LogChannelDWARF.h"
#include "SymbolFileDWARF.h"
@@ -82,7 +82,7 @@ bool DWARFDebugAranges::Generate(SymbolFileDWARF *dwarf2Data) {
uint32_t cu_idx = 0;
const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits();
for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
- DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
+ DWARFUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (cu)
cu->BuildAddressRangeTable(dwarf2Data, this);
}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
index 9c0f1d3c8905..dadc30dc918a 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -72,7 +72,7 @@ DWARFDebugAranges &DWARFDebugInfo::GetCompileUnitAranges() {
bool printed = false;
const size_t num_compile_units = GetNumCompileUnits();
for (size_t idx = 0; idx < num_compile_units; ++idx) {
- DWARFCompileUnit *cu = GetCompileUnitAtIndex(idx);
+ DWARFUnit *cu = GetCompileUnitAtIndex(idx);
dw_offset_t offset = cu->GetOffset();
if (cus_with_data.find(offset) == cus_with_data.end()) {
@@ -97,8 +97,10 @@ void DWARFDebugInfo::ParseCompileUnitHeadersIfNeeded() {
if (m_compile_units.empty()) {
if (m_dwarf2Data != NULL) {
lldb::offset_t offset = 0;
- DWARFCompileUnitSP cu_sp;
- while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, &offset))) {
+ DWARFUnitSP cu_sp;
+ const auto &debug_info_data = m_dwarf2Data->get_debug_info_data();
+ while ((cu_sp = DWARFCompileUnit::Extract(m_dwarf2Data, debug_info_data,
+ &offset))) {
m_compile_units.push_back(cu_sp);
offset = cu_sp->GetNextCompileUnitOffset();
@@ -112,16 +114,16 @@ size_t DWARFDebugInfo::GetNumCompileUnits() {
return m_compile_units.size();
}
-DWARFCompileUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) {
- DWARFCompileUnit *cu = NULL;
+DWARFUnit *DWARFDebugInfo::GetCompileUnitAtIndex(uint32_t idx) {
+ DWARFUnit *cu = NULL;
if (idx < GetNumCompileUnits())
cu = m_compile_units[idx].get();
return cu;
}
-bool DWARFDebugInfo::ContainsCompileUnit(const DWARFCompileUnit *cu) const {
- // Not a verify efficient function, but it is handy for use in assertions
- // to make sure that a compile unit comes from a debug information file.
+bool DWARFDebugInfo::ContainsCompileUnit(const DWARFUnit *cu) const {
+ // Not a verify efficient function, but it is handy for use in assertions to
+ // make sure that a compile unit comes from a debug information file.
CompileUnitColl::const_iterator end_pos = m_compile_units.end();
CompileUnitColl::const_iterator pos;
@@ -133,13 +135,13 @@ bool DWARFDebugInfo::ContainsCompileUnit(const DWARFCompileUnit *cu) const {
}
bool DWARFDebugInfo::OffsetLessThanCompileUnitOffset(
- dw_offset_t offset, const DWARFCompileUnitSP &cu_sp) {
+ dw_offset_t offset, const DWARFUnitSP &cu_sp) {
return offset < cu_sp->GetOffset();
}
-DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
+DWARFUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
uint32_t *idx_ptr) {
- DWARFCompileUnitSP cu_sp;
+ DWARFUnitSP cu_sp;
uint32_t cu_idx = DW_INVALID_INDEX;
if (cu_offset != DW_INVALID_OFFSET) {
ParseCompileUnitHeadersIfNeeded();
@@ -170,18 +172,18 @@ DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
return cu_sp.get();
}
-DWARFCompileUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) {
+DWARFUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) {
if (die_ref.cu_offset == DW_INVALID_OFFSET)
return GetCompileUnitContainingDIEOffset(die_ref.die_offset);
else
return GetCompileUnit(die_ref.cu_offset);
}
-DWARFCompileUnit *
+DWARFUnit *
DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
ParseCompileUnitHeadersIfNeeded();
- DWARFCompileUnitSP cu_sp;
+ DWARFUnitSP cu_sp;
// Watch out for single compile unit executable as they are pretty common
const size_t num_cus = m_compile_units.size();
@@ -205,7 +207,7 @@ DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
DWARFDIE
DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
- DWARFCompileUnit *cu = GetCompileUnitContainingDIEOffset(die_offset);
+ DWARFUnit *cu = GetCompileUnitContainingDIEOffset(die_offset);
if (cu)
return cu->GetDIE(die_offset);
return DWARFDIE();
@@ -218,275 +220,9 @@ DWARFDebugInfo::GetDIEForDIEOffset(dw_offset_t die_offset) {
//----------------------------------------------------------------------
DWARFDIE
DWARFDebugInfo::GetDIE(const DIERef &die_ref) {
- DWARFCompileUnit *cu = GetCompileUnit(die_ref);
+ DWARFUnit *cu = GetCompileUnit(die_ref);
if (cu)
return cu->GetDIE(die_ref.die_offset);
return DWARFDIE(); // Not found
}
-//----------------------------------------------------------------------
-// Parse
-//
-// Parses the .debug_info section and uses the .debug_abbrev section
-// and various other sections in the SymbolFileDWARF class and calls the
-// supplied callback function each time a compile unit header, or debug
-// information entry is successfully parsed. This function can be used
-// for different tasks such as parsing the file contents into a
-// structured data, dumping, verifying and much more.
-//----------------------------------------------------------------------
-void DWARFDebugInfo::Parse(SymbolFileDWARF *dwarf2Data, Callback callback,
- void *userData) {
- if (dwarf2Data) {
- lldb::offset_t offset = 0;
- uint32_t depth = 0;
- DWARFDebugInfoEntry die;
-
- DWARFCompileUnitSP cu;
- while ((cu = DWARFCompileUnit::Extract(dwarf2Data, &offset))) {
- const dw_offset_t next_cu_offset = cu->GetNextCompileUnitOffset();
-
- depth = 0;
- // Call the callback function with no DIE pointer for the compile unit
- // and get the offset that we are to continue to parse from
- offset = callback(dwarf2Data, cu.get(), NULL, offset, depth, userData);
-
- // Make sure we are within our compile unit
- if (offset < next_cu_offset) {
- // We are in our compile unit, parse starting at the offset
- // we were told to parse
- bool done = false;
- while (!done && die.Extract(dwarf2Data, cu.get(), &offset)) {
- // Call the callback function with DIE pointer that falls within the
- // compile unit
- offset =
- callback(dwarf2Data, cu.get(), &die, offset, depth, userData);
-
- if (die.IsNULL()) {
- if (depth)
- --depth;
- else
- done = true; // We are done with this compile unit!
- } else if (die.HasChildren())
- ++depth;
- }
- }
-
- // Make sure the offset returned is valid, and if not stop parsing.
- // Returning DW_INVALID_OFFSET from this callback is a good way to end
- // all parsing
- if (!dwarf2Data->get_debug_info_data().ValidOffset(offset))
- break;
-
- // Make sure we start on a proper
- offset = next_cu_offset;
- }
- }
-}
-
-typedef struct DumpInfo {
- DumpInfo(Stream *init_strm, uint32_t off, uint32_t depth)
- : strm(init_strm), die_offset(off), recurse_depth(depth),
- found_depth(UINT32_MAX), found_die(false), ancestors() {}
- Stream *strm;
- const uint32_t die_offset;
- const uint32_t recurse_depth;
- uint32_t found_depth;
- bool found_die;
- std::vector<DWARFDebugInfoEntry> ancestors;
-
- DISALLOW_COPY_AND_ASSIGN(DumpInfo);
-} DumpInfo;
-
-//----------------------------------------------------------------------
-// DumpCallback
-//
-// A callback function for the static DWARFDebugInfo::Parse() function
-// that gets called each time a compile unit header or debug information
-// entry is successfully parsed.
-//
-// This function dump DWARF information and obey recurse depth and
-// whether a single DIE is to be dumped (or all of the data).
-//----------------------------------------------------------------------
-static dw_offset_t DumpCallback(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu, DWARFDebugInfoEntry *die,
- const dw_offset_t next_offset,
- const uint32_t curr_depth, void *userData) {
- DumpInfo *dumpInfo = (DumpInfo *)userData;
- Stream *s = dumpInfo->strm;
- bool show_parents =
- s->GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowAncestors);
-
- if (die) {
- // Are we dumping everything?
- if (dumpInfo->die_offset == DW_INVALID_OFFSET) {
- // Yes we are dumping everything. Obey our recurse level though
- if (curr_depth < dumpInfo->recurse_depth)
- die->Dump(dwarf2Data, cu, *s, 0);
- } else {
- // We are dumping a specific DIE entry by offset
- if (dumpInfo->die_offset == die->GetOffset()) {
- // We found the DIE we were looking for, dump it!
- if (show_parents) {
- s->SetIndentLevel(0);
- const uint32_t num_ancestors = dumpInfo->ancestors.size();
- if (num_ancestors > 0) {
- for (uint32_t i = 0; i < num_ancestors - 1; ++i) {
- dumpInfo->ancestors[i].Dump(dwarf2Data, cu, *s, 0);
- s->IndentMore();
- }
- }
- }
-
- dumpInfo->found_depth = curr_depth;
-
- die->Dump(dwarf2Data, cu, *s, 0);
-
- // Note that we found the DIE we were looking for
- dumpInfo->found_die = true;
-
- // Since we are dumping a single DIE, if there are no children we are
- // done!
- if (!die->HasChildren() || dumpInfo->recurse_depth == 0)
- return DW_INVALID_OFFSET; // Return an invalid address to end parsing
- } else if (dumpInfo->found_die) {
- // Are we done with all the children?
- if (curr_depth <= dumpInfo->found_depth)
- return DW_INVALID_OFFSET;
-
- // We have already found our DIE and are printing it's children. Obey
- // our recurse depth and return an invalid offset if we get done
- // dumping all of the children
- if (dumpInfo->recurse_depth == UINT32_MAX ||
- curr_depth <= dumpInfo->found_depth + dumpInfo->recurse_depth)
- die->Dump(dwarf2Data, cu, *s, 0);
- } else if (dumpInfo->die_offset > die->GetOffset()) {
- if (show_parents)
- dumpInfo->ancestors.back() = *die;
- }
- }
-
- // Keep up with our indent level
- if (die->IsNULL()) {
- if (show_parents)
- dumpInfo->ancestors.pop_back();
-
- if (curr_depth <= 1)
- return cu->GetNextCompileUnitOffset();
- else
- s->IndentLess();
- } else if (die->HasChildren()) {
- if (show_parents) {
- DWARFDebugInfoEntry null_die;
- dumpInfo->ancestors.push_back(null_die);
- }
- s->IndentMore();
- }
- } else {
- if (cu == NULL)
- s->PutCString("NULL - cu");
- // We have a compile unit, reset our indent level to zero just in case
- s->SetIndentLevel(0);
-
- // See if we are dumping everything?
- if (dumpInfo->die_offset == DW_INVALID_OFFSET) {
- // We are dumping everything
- if (cu) {
- cu->Dump(s);
- return cu->GetFirstDIEOffset(); // Return true to parse all DIEs in this
- // Compile Unit
- } else {
- return DW_INVALID_OFFSET;
- }
- } else {
- if (show_parents) {
- dumpInfo->ancestors.clear();
- dumpInfo->ancestors.resize(1);
- }
-
- // We are dumping only a single DIE possibly with it's children and
- // we must find it's compile unit before we can dump it properly
- if (cu && dumpInfo->die_offset < cu->GetFirstDIEOffset()) {
- // Not found, maybe the DIE offset provided wasn't correct?
- // *ostrm_ptr << "DIE at offset " << HEX32 << dumpInfo->die_offset << "
- // was not found." << endl;
- return DW_INVALID_OFFSET;
- } else {
- // See if the DIE is in this compile unit?
- if (cu && dumpInfo->die_offset < cu->GetNextCompileUnitOffset()) {
- return next_offset;
- // // We found our compile unit that contains our DIE, just skip to
- // dumping the requested DIE...
- // return dumpInfo->die_offset;
- } else {
- // Skip to the next compile unit as the DIE isn't in the current one!
- if (cu) {
- return cu->GetNextCompileUnitOffset();
- } else {
- return DW_INVALID_OFFSET;
- }
- }
- }
- }
- }
-
- // Just return the current offset to parse the next CU or DIE entry
- return next_offset;
-}
-
-//----------------------------------------------------------------------
-// Dump
-//
-// Dump the information in the .debug_info section to the specified
-// ostream. If die_offset is valid, a single DIE will be dumped. If the
-// die_offset is invalid, all the DWARF information will be dumped. Both
-// cases will obey a "recurse_depth" or how deep to traverse into the
-// children of each DIE entry. A recurse_depth of zero will dump all
-// compile unit headers. A recurse_depth of 1 will dump all compile unit
-// headers and the DW_TAG_compile unit tags. A depth of 2 will also
-// dump all types and functions.
-//----------------------------------------------------------------------
-void DWARFDebugInfo::Dump(Stream *s, SymbolFileDWARF *dwarf2Data,
- const uint32_t die_offset,
- const uint32_t recurse_depth) {
- DumpInfo dumpInfo(s, die_offset, recurse_depth);
- s->PutCString(".debug_info contents");
- if (dwarf2Data->get_debug_info_data().GetByteSize() > 0) {
- if (die_offset == DW_INVALID_OFFSET)
- s->PutCString(":\n");
- else {
- s->Printf(" for DIE entry at .debug_info[0x%8.8x]", die_offset);
- if (recurse_depth != UINT32_MAX)
- s->Printf(" recursing %u levels deep.", recurse_depth);
- s->EOL();
- }
- } else {
- s->PutCString(": < EMPTY >\n");
- return;
- }
- DWARFDebugInfo::Parse(dwarf2Data, DumpCallback, &dumpInfo);
-}
-
-//----------------------------------------------------------------------
-// Dump
-//
-// Dump the contents of this DWARFDebugInfo object as has been parsed
-// and/or modified after it has been parsed.
-//----------------------------------------------------------------------
-void DWARFDebugInfo::Dump(Stream *s, const uint32_t die_offset,
- const uint32_t recurse_depth) {
- DumpInfo dumpInfo(s, die_offset, recurse_depth);
-
- s->PutCString("Dumping .debug_info section from internal representation\n");
-
- CompileUnitColl::const_iterator pos;
- uint32_t curr_depth = 0;
- ParseCompileUnitHeadersIfNeeded();
- for (pos = m_compile_units.begin(); pos != m_compile_units.end(); ++pos) {
- DWARFCompileUnit *cu = pos->get();
- DumpCallback(m_dwarf2Data, cu, NULL, 0, curr_depth, &dumpInfo);
-
- const DWARFDIE die = cu->DIE();
- if (die)
- die.Dump(s, recurse_depth);
- }
-}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
index 14c7d767d05b..fc6085f99a21 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -13,6 +13,7 @@
#include <map>
#include <vector>
+#include "DWARFUnit.h"
#include "DWARFDIE.h"
#include "SymbolFileDWARF.h"
#include "lldb/Core/STLUtils.h"
@@ -26,7 +27,7 @@ typedef CStringToDIEMap::const_iterator CStringToDIEMapConstIter;
class DWARFDebugInfo {
public:
typedef dw_offset_t (*Callback)(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
DWARFDebugInfoEntry *die,
const dw_offset_t next_offset,
const uint32_t depth, void *userData);
@@ -35,22 +36,14 @@ public:
void SetDwarfData(SymbolFileDWARF *dwarf2Data);
size_t GetNumCompileUnits();
- bool ContainsCompileUnit(const DWARFCompileUnit *cu) const;
- DWARFCompileUnit *GetCompileUnitAtIndex(uint32_t idx);
- DWARFCompileUnit *GetCompileUnit(dw_offset_t cu_offset,
- uint32_t *idx_ptr = NULL);
- DWARFCompileUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset);
- DWARFCompileUnit *GetCompileUnit(const DIERef &die_ref);
+ bool ContainsCompileUnit(const DWARFUnit *cu) const;
+ DWARFUnit *GetCompileUnitAtIndex(uint32_t idx);
+ DWARFUnit *GetCompileUnit(dw_offset_t cu_offset, uint32_t *idx_ptr = NULL);
+ DWARFUnit *GetCompileUnitContainingDIEOffset(dw_offset_t die_offset);
+ DWARFUnit *GetCompileUnit(const DIERef &die_ref);
DWARFDIE GetDIEForDIEOffset(dw_offset_t die_offset);
DWARFDIE GetDIE(const DIERef &die_ref);
- void Dump(lldb_private::Stream *s, const uint32_t die_offset,
- const uint32_t recurse_depth);
- static void Parse(SymbolFileDWARF *parser, Callback callback, void *userData);
- static void Verify(lldb_private::Stream *s, SymbolFileDWARF *dwarf2Data);
- static void Dump(lldb_private::Stream *s, SymbolFileDWARF *dwarf2Data,
- const uint32_t die_offset, const uint32_t recurse_depth);
-
enum {
eDumpFlag_Verbose = (1 << 0), // Verbose dumping
eDumpFlag_ShowForm = (1 << 1), // Show the DW_form type
@@ -62,9 +55,9 @@ public:
protected:
static bool OffsetLessThanCompileUnitOffset(dw_offset_t offset,
- const DWARFCompileUnitSP &cu_sp);
+ const DWARFUnitSP &cu_sp);
- typedef std::vector<DWARFCompileUnitSP> CompileUnitColl;
+ typedef std::vector<DWARFUnitSP> CompileUnitColl;
//----------------------------------------------------------------------
// Member variables
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index f595bd83d846..d32aef6e162c 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -18,7 +18,7 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/Stream.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDIECollection.h"
#include "DWARFDebugAbbrev.h"
#include "DWARFDebugAranges.h"
@@ -34,7 +34,7 @@ using namespace std;
extern int g_verbose;
bool DWARFDebugInfoEntry::FastExtract(
- const DWARFDataExtractor &debug_info_data, const DWARFCompileUnit *cu,
+ const DWARFDataExtractor &debug_info_data, const DWARFUnit *cu,
const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
lldb::offset_t *offset_ptr) {
m_offset = *offset_ptr;
@@ -189,14 +189,14 @@ bool DWARFDebugInfoEntry::FastExtract(
//----------------------------------------------------------------------
// Extract
//
-// Extract a debug info entry for a given compile unit from the
-// .debug_info and .debug_abbrev data within the SymbolFileDWARF class
-// starting at the given offset
+// Extract a debug info entry for a given compile unit from the .debug_info and
+// .debug_abbrev data within the SymbolFileDWARF class starting at the given
+// offset
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
lldb::offset_t *offset_ptr) {
- const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = cu->GetData();
// const DWARFDataExtractor& debug_str_data =
// dwarf2Data->get_debug_str_data();
const uint32_t cu_end_offset = cu->GetNextCompileUnitOffset();
@@ -218,9 +218,10 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
m_tag = abbrevDecl->Tag();
m_has_children = abbrevDecl->HasChildren();
- bool isCompileUnitTag = m_tag == DW_TAG_compile_unit;
+ bool isCompileUnitTag = (m_tag == DW_TAG_compile_unit ||
+ m_tag == DW_TAG_partial_unit);
if (cu && isCompileUnitTag)
- const_cast<DWARFCompileUnit *>(cu)->SetBaseAddress(0);
+ const_cast<DWARFUnit *>(cu)->SetBaseAddress(0);
// Skip all data in the .debug_info for the attributes
const uint32_t numAttributes = abbrevDecl->NumAttributes();
@@ -235,7 +236,7 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
DWARFFormValue form_value(cu, form);
if (form_value.ExtractValue(debug_info_data, &offset)) {
if (attr == DW_AT_low_pc || attr == DW_AT_entry_pc)
- const_cast<DWARFCompileUnit *>(cu)->SetBaseAddress(
+ const_cast<DWARFUnit *>(cu)->SetBaseAddress(
form_value.Address());
}
} else {
@@ -245,8 +246,7 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
uint32_t form_size = 0;
switch (form) {
// Blocks if inlined data that have a length field and the data
- // bytes
- // inlined in the .debug_info
+ // bytes inlined in the .debug_info
case DW_FORM_exprloc:
case DW_FORM_block:
form_size = debug_info_data.GetULEB128(&offset);
@@ -356,11 +356,11 @@ bool DWARFDebugInfoEntry::Extract(SymbolFileDWARF *dwarf2Data,
//----------------------------------------------------------------------
// DumpAncestry
//
-// Dumps all of a debug information entries parents up until oldest and
-// all of it's attributes to the specified stream.
+// Dumps all of a debug information entries parents up until oldest and all of
+// it's attributes to the specified stream.
//----------------------------------------------------------------------
void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
const DWARFDebugInfoEntry *oldest,
Stream &s,
uint32_t recurse_depth) const {
@@ -374,11 +374,10 @@ void DWARFDebugInfoEntry::DumpAncestry(SymbolFileDWARF *dwarf2Data,
// GetDIENamesAndRanges
//
// Gets the valid address ranges for a given DIE by looking for a
-// DW_AT_low_pc/DW_AT_high_pc pair, DW_AT_entry_pc, or DW_AT_ranges
-// attributes.
+// DW_AT_low_pc/DW_AT_high_pc pair, DW_AT_entry_pc, or DW_AT_ranges attributes.
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, const char *&name,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const char *&name,
const char *&mangled, DWARFRangeList &ranges, int &decl_file,
int &decl_line, int &decl_column, int &call_file, int &call_line,
int &call_column, DWARFExpression *frame_base) const {
@@ -404,8 +403,7 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
lldb::ModuleSP module = dwarf2Data->GetObjectFile()->GetModule();
if (abbrevDecl) {
- const DWARFDataExtractor &debug_info_data =
- dwarf2Data->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = cu->GetData();
if (!debug_info_data.ValidOffset(offset))
return false;
@@ -451,9 +449,9 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
const DWARFDebugRanges *debug_ranges = dwarf2Data->DebugRanges();
if (debug_ranges) {
debug_ranges->FindRanges(cu->GetRangesBase(), form_value.Unsigned(), ranges);
- // All DW_AT_ranges are relative to the base address of the
- // compile unit. We add the compile unit base address to make
- // sure all the addresses are properly fixed up.
+ // All DW_AT_ranges are relative to the base address of the compile
+ // unit. We add the compile unit base address to make sure all the
+ // addresses are properly fixed up.
ranges.Slide(cu->GetBaseAddress());
} else {
cu->GetSymbolFileDWARF()->GetObjectFile()->GetModule()->ReportError(
@@ -582,13 +580,13 @@ bool DWARFDebugInfoEntry::GetDIENamesAndRanges(
//----------------------------------------------------------------------
// Dump
//
-// Dumps a debug information entry and all of it's attributes to the
-// specified stream.
+// Dumps a debug information entry and all of it's attributes to the specified
+// stream.
//----------------------------------------------------------------------
void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu, Stream &s,
+ const DWARFUnit *cu, Stream &s,
uint32_t recurse_depth) const {
- const DWARFDataExtractor &debug_info_data = dwarf2Data->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = cu->GetData();
lldb::offset_t offset = m_offset;
if (debug_info_data.ValidOffset(offset)) {
@@ -639,8 +637,8 @@ void DWARFDebugInfoEntry::Dump(SymbolFileDWARF *dwarf2Data,
}
void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu, Stream &s) const {
- const DWARFDIE cu_die = cu->GetCompileUnitDIEOnly();
+ DWARFUnit *cu, Stream &s) const {
+ const DWARFBaseDIE cu_die = cu->GetUnitDIEOnly();
const char *cu_name = NULL;
if (cu_die)
cu_name = cu_die.GetName();
@@ -658,12 +656,12 @@ void DWARFDebugInfoEntry::DumpLocation(SymbolFileDWARF *dwarf2Data,
//----------------------------------------------------------------------
// DumpAttribute
//
-// Dumps a debug information entry attribute along with it's form. Any
-// special display of attributes is done (disassemble location lists,
-// show enumeration values for attributes, etc).
+// Dumps a debug information entry attribute along with it's form. Any special
+// display of attributes is done (disassemble location lists, show enumeration
+// values for attributes, etc).
//----------------------------------------------------------------------
void DWARFDebugInfoEntry::DumpAttribute(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const DWARFDataExtractor &debug_info_data, lldb::offset_t *offset_ptr,
Stream &s, dw_attr_t attr, dw_form_t form) {
bool show_form = s.GetFlags().Test(DWARFDebugInfo::eDumpFlag_ShowForm);
@@ -714,11 +712,10 @@ void DWARFDebugInfoEntry::DumpAttribute(
(*offset_ptr) - form_value.Unsigned(),
form_value.Unsigned());
DWARFExpression::PrintDWARFExpression(
- s, locationData, DWARFCompileUnit::GetAddressByteSize(cu), 4, false);
+ s, locationData, DWARFUnit::GetAddressByteSize(cu), 4, false);
} else {
- // We have a location list offset as the value that is
- // the offset into the .debug_loc section that describes
- // the value over it's lifetime
+ // We have a location list offset as the value that is the offset into
+ // the .debug_loc section that describes the value over it's lifetime
uint64_t debug_loc_offset = form_value.Unsigned();
if (dwarf2Data) {
DWARFExpression::PrintDWARFLocationList(
@@ -759,18 +756,18 @@ void DWARFDebugInfoEntry::DumpAttribute(
//----------------------------------------------------------------------
// Get all attribute values for a given DIE, including following any
-// specification or abstract origin attributes and including those in
-// the results. Any duplicate attributes will have the first instance
-// take precedence (this can happen for declaration attributes).
+// specification or abstract origin attributes and including those in the
+// results. Any duplicate attributes will have the first instance take
+// precedence (this can happen for declaration attributes).
//----------------------------------------------------------------------
size_t DWARFDebugInfoEntry::GetAttributes(
- const DWARFCompileUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes,
+ const DWARFUnit *cu, DWARFFormValue::FixedFormSizes fixed_form_sizes,
DWARFAttributes &attributes, uint32_t curr_depth) const {
SymbolFileDWARF *dwarf2Data = nullptr;
const DWARFAbbreviationDeclaration *abbrevDecl = nullptr;
lldb::offset_t offset = 0;
if (cu) {
- if (m_tag != DW_TAG_compile_unit) {
+ if (m_tag != DW_TAG_compile_unit && m_tag != DW_TAG_partial_unit) {
SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
if (dwo_symbol_file)
return GetAttributes(dwo_symbol_file->GetCompileUnit(),
@@ -782,8 +779,7 @@ size_t DWARFDebugInfoEntry::GetAttributes(
}
if (abbrevDecl) {
- const DWARFDataExtractor &debug_info_data =
- dwarf2Data->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = cu->GetData();
if (fixed_form_sizes.Empty())
fixed_form_sizes = DWARFFormValue::GetFixedFormSizesForAddressSize(
@@ -803,9 +799,9 @@ size_t DWARFDebugInfoEntry::GetAttributes(
case DW_AT_sibling:
case DW_AT_declaration:
if (curr_depth > 0) {
- // This attribute doesn't make sense when combined with
- // the DIE that references this DIE. We know a DIE is
- // referencing this DIE because curr_depth is not zero
+ // This attribute doesn't make sense when combined with the DIE that
+ // references this DIE. We know a DIE is referencing this DIE because
+ // curr_depth is not zero
break;
}
LLVM_FALLTHROUGH;
@@ -819,7 +815,7 @@ size_t DWARFDebugInfoEntry::GetAttributes(
if (form_value.ExtractValue(debug_info_data, &offset)) {
dw_offset_t die_offset = form_value.Reference();
DWARFDIE spec_die =
- const_cast<DWARFCompileUnit *>(cu)->GetDIE(die_offset);
+ const_cast<DWARFUnit *>(cu)->GetDIE(die_offset);
if (spec_die)
spec_die.GetAttributes(attributes, curr_depth + 1);
}
@@ -841,17 +837,18 @@ size_t DWARFDebugInfoEntry::GetAttributes(
// GetAttributeValue
//
// Get the value of an attribute and return the .debug_info offset of the
-// attribute if it was properly extracted into form_value, or zero
-// if we fail since an offset of zero is invalid for an attribute (it
-// would be a compile unit header).
+// attribute if it was properly extracted into form_value, or zero if we fail
+// since an offset of zero is invalid for an attribute (it would be a compile
+// unit header).
//----------------------------------------------------------------------
dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, DWARFFormValue &form_value,
dw_offset_t *end_attr_offset_ptr,
bool check_specification_or_abstract_origin) const {
SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
- if (dwo_symbol_file && m_tag != DW_TAG_compile_unit)
+ if (dwo_symbol_file && m_tag != DW_TAG_compile_unit &&
+ m_tag != DW_TAG_partial_unit)
return GetAttributeValue(dwo_symbol_file, dwo_symbol_file->GetCompileUnit(),
attr, form_value, end_attr_offset_ptr,
check_specification_or_abstract_origin);
@@ -864,8 +861,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
uint32_t attr_idx = abbrevDecl->FindAttributeIndex(attr);
if (attr_idx != DW_INVALID_INDEX) {
- const DWARFDataExtractor &debug_info_data =
- dwarf2Data->get_debug_info_data();
+ const DWARFDataExtractor &debug_info_data = cu->GetData();
uint32_t idx = 0;
while (idx < attr_idx)
@@ -886,7 +882,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (check_specification_or_abstract_origin) {
if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) {
DWARFDIE die =
- const_cast<DWARFCompileUnit *>(cu)->GetDIE(form_value.Reference());
+ const_cast<DWARFUnit *>(cu)->GetDIE(form_value.Reference());
if (die) {
dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@@ -898,7 +894,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) {
DWARFDIE die =
- const_cast<DWARFCompileUnit *>(cu)->GetDIE(form_value.Reference());
+ const_cast<DWARFUnit *>(cu)->GetDIE(form_value.Reference());
if (die) {
dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@@ -912,11 +908,11 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
if (!dwo_symbol_file)
return 0;
- DWARFCompileUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
+ DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
if (!dwo_cu)
return 0;
- DWARFDIE dwo_cu_die = dwo_cu->GetCompileUnitDIEOnly();
+ DWARFBaseDIE dwo_cu_die = dwo_cu->GetUnitDIEOnly();
if (!dwo_cu_die.IsValid())
return 0;
@@ -928,13 +924,13 @@ dw_offset_t DWARFDebugInfoEntry::GetAttributeValue(
//----------------------------------------------------------------------
// GetAttributeValueAsString
//
-// Get the value of an attribute as a string return it. The resulting
-// pointer to the string data exists within the supplied SymbolFileDWARF
-// and will only be available as long as the SymbolFileDWARF is still around
-// and it's content doesn't change.
+// Get the value of an attribute as a string return it. The resulting pointer
+// to the string data exists within the supplied SymbolFileDWARF and will only
+// be available as long as the SymbolFileDWARF is still around and it's content
+// doesn't change.
//----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetAttributeValueAsString(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, const char *fail_value,
bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
@@ -950,7 +946,7 @@ const char *DWARFDebugInfoEntry::GetAttributeValueAsString(
// Get the value of an attribute as unsigned and return it.
//----------------------------------------------------------------------
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
@@ -966,7 +962,7 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsUnsigned(
// Get the value of an attribute a signed value and return it.
//----------------------------------------------------------------------
int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, int64_t fail_value,
bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
@@ -979,11 +975,11 @@ int64_t DWARFDebugInfoEntry::GetAttributeValueAsSigned(
//----------------------------------------------------------------------
// GetAttributeValueAsReference
//
-// Get the value of an attribute as reference and fix up and compile
-// unit relative offsets as needed.
+// Get the value of an attribute as reference and fix up and compile unit
+// relative offsets as needed.
//----------------------------------------------------------------------
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
@@ -994,7 +990,7 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference(
}
uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
@@ -1007,13 +1003,13 @@ uint64_t DWARFDebugInfoEntry::GetAttributeValueAsAddress(
//----------------------------------------------------------------------
// GetAttributeHighPC
//
-// Get the hi_pc, adding hi_pc to lo_pc when specified
-// as an <offset-from-low-pc>.
+// Get the hi_pc, adding hi_pc to lo_pc when specified as an <offset-from-low-
+// pc>.
//
// Returns the hi_pc or fail_value.
//----------------------------------------------------------------------
dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t lo_pc,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t lo_pc,
uint64_t fail_value, bool check_specification_or_abstract_origin) const {
DWARFFormValue form_value;
if (GetAttributeValue(dwarf2Data, cu, DW_AT_high_pc, form_value, nullptr,
@@ -1031,13 +1027,13 @@ dw_addr_t DWARFDebugInfoEntry::GetAttributeHighPC(
//----------------------------------------------------------------------
// GetAttributeAddressRange
//
-// Get the lo_pc and hi_pc, adding hi_pc to lo_pc when specified
-// as an <offset-from-low-pc>.
+// Get the lo_pc and hi_pc, adding hi_pc to lo_pc when specified as an <offset-
+// from-low-pc>.
//
// Returns true or sets lo_pc and hi_pc to fail_value.
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetAttributeAddressRange(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc,
dw_addr_t &hi_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin) const {
lo_pc = GetAttributeValueAsAddress(dwarf2Data, cu, DW_AT_low_pc, fail_value,
@@ -1054,7 +1050,7 @@ bool DWARFDebugInfoEntry::GetAttributeAddressRange(
}
size_t DWARFDebugInfoEntry::GetAttributeAddressRanges(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFRangeList &ranges, bool check_hi_lo_pc,
bool check_specification_or_abstract_origin) const {
ranges.Clear();
@@ -1083,23 +1079,23 @@ size_t DWARFDebugInfoEntry::GetAttributeAddressRanges(
//----------------------------------------------------------------------
// GetName
//
-// Get value of the DW_AT_name attribute and return it if one exists,
-// else return NULL.
+// Get value of the DW_AT_name attribute and return it if one exists, else
+// return NULL.
//----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu) const {
+ const DWARFUnit *cu) const {
return GetAttributeValueAsString(dwarf2Data, cu, DW_AT_name, nullptr, true);
}
//----------------------------------------------------------------------
// GetMangledName
//
-// Get value of the DW_AT_MIPS_linkage_name attribute and return it if
-// one exists, else return the value of the DW_AT_name attribute
+// Get value of the DW_AT_MIPS_linkage_name attribute and return it if one
+// exists, else return the value of the DW_AT_name attribute
//----------------------------------------------------------------------
const char *
DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
bool substitute_name_allowed) const {
const char *name = nullptr;
@@ -1123,11 +1119,11 @@ DWARFDebugInfoEntry::GetMangledName(SymbolFileDWARF *dwarf2Data,
//----------------------------------------------------------------------
// GetPubname
//
-// Get value the name for a DIE as it should appear for a
-// .debug_pubnames or .debug_pubtypes section.
+// Get value the name for a DIE as it should appear for a .debug_pubnames or
+// .debug_pubtypes section.
//----------------------------------------------------------------------
const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu) const {
+ const DWARFUnit *cu) const {
const char *name = nullptr;
if (!dwarf2Data)
return name;
@@ -1149,14 +1145,13 @@ const char *DWARFDebugInfoEntry::GetPubname(SymbolFileDWARF *dwarf2Data,
//----------------------------------------------------------------------
// GetName
//
-// Get value of the DW_AT_name attribute for a debug information entry
-// that exists at offset "die_offset" and place that value into the
-// supplied stream object. If the DIE is a NULL object "NULL" is placed
-// into the stream, and if no DW_AT_name attribute exists for the DIE
-// then nothing is printed.
+// Get value of the DW_AT_name attribute for a debug information entry that
+// exists at offset "die_offset" and place that value into the supplied stream
+// object. If the DIE is a NULL object "NULL" is placed into the stream, and if
+// no DW_AT_name attribute exists for the DIE then nothing is printed.
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
const dw_offset_t die_offset, Stream &s) {
if (dwarf2Data == NULL) {
s.PutCString("NULL");
@@ -1184,13 +1179,12 @@ bool DWARFDebugInfoEntry::GetName(SymbolFileDWARF *dwarf2Data,
//----------------------------------------------------------------------
// AppendTypeName
//
-// Follows the type name definition down through all needed tags to
-// end up with a fully qualified type name and dump the results to
-// the supplied stream. This is used to show the name of types given
-// a type identifier.
+// Follows the type name definition down through all needed tags to end up with
+// a fully qualified type name and dump the results to the supplied stream.
+// This is used to show the name of types given a type identifier.
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
const dw_offset_t die_offset,
Stream &s) {
if (dwarf2Data == NULL) {
@@ -1318,7 +1312,7 @@ bool DWARFDebugInfoEntry::AppendTypeName(SymbolFileDWARF *dwarf2Data,
// BuildAddressRangeTable
//----------------------------------------------------------------------
void DWARFDebugInfoEntry::BuildAddressRangeTable(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const {
if (m_tag) {
if (m_tag == DW_TAG_subprogram) {
@@ -1343,13 +1337,13 @@ void DWARFDebugInfoEntry::BuildAddressRangeTable(
//----------------------------------------------------------------------
// BuildFunctionAddressRangeTable
//
-// This function is very similar to the BuildAddressRangeTable function
-// except that the actual DIE offset for the function is placed in the
-// table instead of the compile unit offset (which is the way the
-// standard .debug_aranges section does it).
+// This function is very similar to the BuildAddressRangeTable function except
+// that the actual DIE offset for the function is placed in the table instead
+// of the compile unit offset (which is the way the standard .debug_aranges
+// section does it).
//----------------------------------------------------------------------
void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const {
if (m_tag) {
if (m_tag == DW_TAG_subprogram) {
@@ -1372,21 +1366,22 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
}
void DWARFDebugInfoEntry::GetDeclContextDIEs(
- DWARFCompileUnit *cu, DWARFDIECollection &decl_context_dies) const {
+ DWARFUnit *cu, DWARFDIECollection &decl_context_dies) const {
DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this));
die.GetDeclContextDIEs(decl_context_dies);
}
void DWARFDebugInfoEntry::GetDWARFDeclContext(
- SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDeclContext &dwarf_decl_ctx) const {
const dw_tag_t tag = Tag();
- if (tag != DW_TAG_compile_unit) {
+ if (tag != DW_TAG_compile_unit && tag != DW_TAG_partial_unit) {
dwarf_decl_ctx.AppendDeclContext(tag, GetName(dwarf2Data, cu));
DWARFDIE parent_decl_ctx_die = GetParentDeclContextDIE(dwarf2Data, cu);
if (parent_decl_ctx_die && parent_decl_ctx_die.GetDIE() != this) {
- if (parent_decl_ctx_die.Tag() != DW_TAG_compile_unit)
+ if (parent_decl_ctx_die.Tag() != DW_TAG_compile_unit &&
+ parent_decl_ctx_die.Tag() != DW_TAG_partial_unit)
parent_decl_ctx_die.GetDIE()->GetDWARFDeclContext(
parent_decl_ctx_die.GetDWARF(), parent_decl_ctx_die.GetCU(),
dwarf_decl_ctx);
@@ -1395,7 +1390,7 @@ void DWARFDebugInfoEntry::GetDWARFDeclContext(
}
bool DWARFDebugInfoEntry::MatchesDWARFDeclContext(
- SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFDeclContext &dwarf_decl_ctx) const {
DWARFDeclContext this_dwarf_decl_ctx;
@@ -1405,7 +1400,7 @@ bool DWARFDebugInfoEntry::MatchesDWARFDeclContext(
DWARFDIE
DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu) const {
+ DWARFUnit *cu) const {
DWARFAttributes attributes;
GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes);
return GetParentDeclContextDIE(dwarf2Data, cu, attributes);
@@ -1413,17 +1408,18 @@ DWARFDebugInfoEntry::GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
DWARFDIE
DWARFDebugInfoEntry::GetParentDeclContextDIE(
- SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFAttributes &attributes) const {
DWARFDIE die(cu, const_cast<DWARFDebugInfoEntry *>(this));
while (die) {
- // If this is the original DIE that we are searching for a declaration
- // for, then don't look in the cache as we don't want our own decl
- // context to be our decl context...
+ // If this is the original DIE that we are searching for a declaration for,
+ // then don't look in the cache as we don't want our own decl context to be
+ // our decl context...
if (die.GetDIE() != this) {
switch (die.Tag()) {
case DW_TAG_compile_unit:
+ case DW_TAG_partial_unit:
case DW_TAG_namespace:
case DW_TAG_structure_type:
case DW_TAG_union_type:
@@ -1465,7 +1461,7 @@ DWARFDebugInfoEntry::GetParentDeclContextDIE(
}
const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
std::string &storage) const {
DWARFAttributes attributes;
GetAttributes(cu, DWARFFormValue::FixedFormSizes(), attributes);
@@ -1473,7 +1469,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName(SymbolFileDWARF *dwarf2Data,
}
const char *DWARFDebugInfoEntry::GetQualifiedName(
- SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
const DWARFAttributes &attributes, std::string &storage) const {
const char *name = GetName(dwarf2Data, cu);
@@ -1529,7 +1525,7 @@ const char *DWARFDebugInfoEntry::GetQualifiedName(
//----------------------------------------------------------------------
bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
DWARFDebugInfoEntry **function_die,
DWARFDebugInfoEntry **block_die) {
bool found_address = false;
@@ -1661,6 +1657,7 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
case DW_TAG_unspecified_type:
break;
case DW_TAG_partial_unit:
+ match_addr_range = true;
break;
case DW_TAG_imported_unit:
break;
@@ -1684,6 +1681,7 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
// puts("***MATCH***");
switch (m_tag) {
case DW_TAG_compile_unit: // File
+ case DW_TAG_partial_unit: // File
check_children = ((function_die != NULL) || (block_die != NULL));
break;
@@ -1706,10 +1704,12 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
break;
}
}
- } else { // compile units may not have a valid high/low pc when there
+ } else {
+ // 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) &&
+ // 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));
}
} else {
@@ -1719,15 +1719,16 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
DWARFRangeList ranges;
DWARFDebugRanges *debug_ranges = dwarf2Data->DebugRanges();
debug_ranges->FindRanges(cu->GetRangesBase(), debug_ranges_offset, ranges);
- // All DW_AT_ranges are relative to the base address of the
- // compile unit. We add the compile unit base address to make
- // sure all the addresses are properly fixed up.
+ // All DW_AT_ranges are relative to the base address of the compile
+ // unit. We add the compile unit base address to make sure all the
+ // addresses are properly fixed up.
ranges.Slide(cu->GetBaseAddress());
if (ranges.FindEntryThatContains(address)) {
found_address = true;
// puts("***MATCH***");
switch (m_tag) {
case DW_TAG_compile_unit: // File
+ case DW_TAG_partial_unit: // File
check_children = ((function_die != NULL) || (block_die != NULL));
break;
@@ -1772,7 +1773,7 @@ bool DWARFDebugInfoEntry::LookupAddress(const dw_addr_t address,
const DWARFAbbreviationDeclaration *
DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb::offset_t &offset) const {
if (dwarf2Data) {
offset = GetOffset();
@@ -1782,11 +1783,10 @@ DWARFDebugInfoEntry::GetAbbreviationDeclarationPtr(
const DWARFAbbreviationDeclaration *abbrev_decl =
abbrev_set->GetAbbreviationDeclaration(m_abbr_idx);
if (abbrev_decl) {
- // Make sure the abbreviation code still matches. If it doesn't and
- // the DWARF data was mmap'ed, the backing file might have been modified
+ // Make sure the abbreviation code still matches. If it doesn't and the
+ // DWARF data was mmap'ed, the backing file might have been modified
// which is bad news.
- const uint64_t abbrev_code =
- dwarf2Data->get_debug_info_data().GetULEB128(&offset);
+ const uint64_t abbrev_code = cu->GetData().GetULEB128(&offset);
if (abbrev_decl->Code() == abbrev_code)
return abbrev_decl;
@@ -1825,3 +1825,15 @@ void DWARFDebugInfoEntry::DumpDIECollection(
die_ref.HasChildren() ? " *" : "");
}
}
+
+bool DWARFDebugInfoEntry::operator==(const DWARFDebugInfoEntry &rhs) const {
+ return m_offset == rhs.m_offset && m_parent_idx == rhs.m_parent_idx &&
+ m_sibling_idx == rhs.m_sibling_idx &&
+ m_empty_children == rhs.m_empty_children &&
+ m_abbr_idx == rhs.m_abbr_idx && m_has_children == rhs.m_has_children &&
+ m_tag == rhs.m_tag;
+}
+
+bool DWARFDebugInfoEntry::operator!=(const DWARFDebugInfoEntry &rhs) const {
+ return !(*this == rhs);
+}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
index 89450d327adf..97cb3046eb3e 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
@@ -60,128 +60,132 @@ public:
m_empty_children(false), m_abbr_idx(0), m_has_children(false),
m_tag(0) {}
+ explicit operator bool() const { return m_offset != DW_INVALID_OFFSET; }
+ bool operator==(const DWARFDebugInfoEntry &rhs) const;
+ bool operator!=(const DWARFDebugInfoEntry &rhs) const;
+
void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const;
void BuildFunctionAddressRangeTable(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
DWARFDebugAranges *debug_aranges) const;
bool FastExtract(const lldb_private::DWARFDataExtractor &debug_info_data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
lldb::offset_t *offset_ptr);
- bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ bool Extract(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb::offset_t *offset_ptr);
bool LookupAddress(const dw_addr_t address, SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
DWARFDebugInfoEntry **function_die,
DWARFDebugInfoEntry **block_die);
- size_t GetAttributes(const DWARFCompileUnit *cu,
+ size_t GetAttributes(const DWARFUnit *cu,
DWARFFormValue::FixedFormSizes fixed_form_sizes,
DWARFAttributes &attrs,
uint32_t curr_depth = 0)
const; // "curr_depth" for internal use only, don't set this yourself!!!
dw_offset_t
- GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ GetAttributeValue(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, DWARFFormValue &formValue,
dw_offset_t *end_attr_offset_ptr = nullptr,
bool check_specification_or_abstract_origin = false) const;
const char *GetAttributeValueAsString(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, const char *fail_value,
bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsUnsigned(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsReference(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
int64_t GetAttributeValueAsSigned(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, int64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
uint64_t GetAttributeValueAsAddress(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_attr_t attr, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
dw_addr_t
- GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ GetAttributeHighPC(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
dw_addr_t lo_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
bool GetAttributeAddressRange(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu, dw_addr_t &lo_pc,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, dw_addr_t &lo_pc,
dw_addr_t &hi_pc, uint64_t fail_value,
bool check_specification_or_abstract_origin = false) const;
size_t GetAttributeAddressRanges(
- SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
DWARFRangeList &ranges, bool check_hi_lo_pc,
bool check_specification_or_abstract_origin = false) const;
const char *GetName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu) const;
+ const DWARFUnit *cu) const;
const char *GetMangledName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
bool substitute_name_allowed = true) const;
const char *GetPubname(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu) const;
+ const DWARFUnit *cu) const;
- static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ static bool GetName(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const dw_offset_t die_offset, lldb_private::Stream &s);
static bool AppendTypeName(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
const dw_offset_t die_offset,
lldb_private::Stream &s);
const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
std::string &storage) const;
const char *GetQualifiedName(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
const DWARFAttributes &attributes,
std::string &storage) const;
static bool OffsetLessThan(const DWARFDebugInfoEntry &a,
const DWARFDebugInfoEntry &b);
- void Dump(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ void Dump(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
lldb_private::Stream &s, uint32_t recurse_depth) const;
- void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ void DumpAncestry(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const DWARFDebugInfoEntry *oldest, lldb_private::Stream &s,
uint32_t recurse_depth) const;
static void
- DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ DumpAttribute(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const lldb_private::DWARFDataExtractor &debug_info_data,
lldb::offset_t *offset_ptr, lldb_private::Stream &s,
dw_attr_t attr, dw_form_t form);
// This one dumps the comp unit name, objfile name and die offset for this die
// so the stream S.
- void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ void DumpLocation(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
lldb_private::Stream &s) const;
bool
- GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFCompileUnit *cu,
+ GetDIENamesAndRanges(SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
const char *&name, const char *&mangled,
DWARFRangeList &rangeList, int &decl_file,
int &decl_line, int &decl_column, int &call_file,
@@ -190,7 +194,7 @@ public:
const DWARFAbbreviationDeclaration *
GetAbbreviationDeclarationPtr(SymbolFileDWARF *dwarf2Data,
- const DWARFCompileUnit *cu,
+ const DWARFUnit *cu,
lldb::offset_t &offset) const;
dw_tag_t Tag() const { return m_tag; }
@@ -229,20 +233,20 @@ public:
return (HasChildren() && !m_empty_children) ? this + 1 : NULL;
}
- void GetDeclContextDIEs(DWARFCompileUnit *cu,
+ void GetDeclContextDIEs(DWARFUnit *cu,
DWARFDIECollection &decl_context_dies) const;
- void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
+ void GetDWARFDeclContext(SymbolFileDWARF *dwarf2Data, DWARFUnit *cu,
DWARFDeclContext &dwarf_decl_ctx) const;
bool MatchesDWARFDeclContext(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
const DWARFDeclContext &dwarf_decl_ctx) const;
DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu) const;
+ DWARFUnit *cu) const;
DWARFDIE GetParentDeclContextDIE(SymbolFileDWARF *dwarf2Data,
- DWARFCompileUnit *cu,
+ DWARFUnit *cu,
const DWARFAttributes &attributes) const;
void SetParent(DWARFDebugInfoEntry *parent) {
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
index 694d34fc211c..317ea4c22c66 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.cpp
@@ -242,8 +242,8 @@ dw_offset_t DWARFDebugLine::DumpStatementOpcodes(
log->Printf("0x%8.8x: DW_LNE_??? (%2.2x) - Skipping unknown upcode",
op_offset, opcode);
// Length doesn't include the zero opcode byte or the length itself,
- // but
- // it does include the sub_opcode, so we have to adjust for that below
+ // but it does include the sub_opcode, so we have to adjust for that
+ // below
offset += arg_size;
break;
}
@@ -324,9 +324,9 @@ dw_offset_t DWARFDebugLine::DumpStatementOpcodes(
// Special Opcodes
default:
if (opcode < prologue.opcode_base) {
- // We have an opcode that this parser doesn't know about, skip
- // the number of ULEB128 numbers that is says to skip in the
- // prologue's standard_opcode_lengths array
+ // We have an opcode that this parser doesn't know about, skip the
+ // number of ULEB128 numbers that is says to skip in the prologue's
+ // standard_opcode_lengths array
uint8_t n = prologue.standard_opcode_lengths[opcode - 1];
log->Printf("0x%8.8x: Special : Unknown skipping %u ULEB128 values.",
op_offset, n);
@@ -357,9 +357,9 @@ dw_offset_t DWARFDebugLine::DumpStatementOpcodes(
//----------------------------------------------------------------------
// Parse
//
-// Parse the entire line table contents calling callback each time a
-// new prologue is parsed and every time a new row is to be added to
-// the line table.
+// Parse the entire line table contents calling callback each time a new
+// prologue is parsed and every time a new row is to be added to the line
+// table.
//----------------------------------------------------------------------
void DWARFDebugLine::Parse(const DWARFDataExtractor &debug_line_data,
DWARFDebugLine::State::Callback callback,
@@ -444,7 +444,7 @@ bool DWARFDebugLine::ParsePrologue(const DWARFDataExtractor &debug_line_data,
bool DWARFDebugLine::ParseSupportFiles(
const lldb::ModuleSP &module_sp, const DWARFDataExtractor &debug_line_data,
- const char *cu_comp_dir, dw_offset_t stmt_list,
+ const lldb_private::FileSpec &cu_comp_dir, dw_offset_t stmt_list,
FileSpecList &support_files) {
lldb::offset_t offset = stmt_list;
@@ -463,7 +463,7 @@ bool DWARFDebugLine::ParseSupportFiles(
for (uint32_t file_idx = 1;
prologue.GetFile(file_idx, cu_comp_dir, file_spec); ++file_idx) {
if (module_sp->RemapSourceFile(file_spec.GetPath(), remapped_file))
- file_spec.SetFile(remapped_file, false);
+ file_spec.SetFile(remapped_file, false, FileSpec::Style::native);
support_files.Append(file_spec);
}
return true;
@@ -472,9 +472,9 @@ bool DWARFDebugLine::ParseSupportFiles(
//----------------------------------------------------------------------
// ParseStatementTable
//
-// Parse a single line table (prologue and all rows) and call the
-// callback function once for the prologue (row in state will be zero)
-// and each time a row is to be added to the line table.
+// Parse a single line table (prologue and all rows) and call the callback
+// function once for the prologue (row in state will be zero) and each time a
+// row is to be added to the line table.
//----------------------------------------------------------------------
bool DWARFDebugLine::ParseStatementTable(
const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr,
@@ -511,8 +511,8 @@ bool DWARFDebugLine::ParseStatementTable(
uint8_t opcode = debug_line_data.GetU8(offset_ptr);
if (opcode == 0) {
- // Extended Opcodes always start with a zero opcode followed by
- // a uleb128 length so you can skip ones you don't know about
+ // Extended Opcodes always start with a zero opcode followed by a uleb128
+ // length so you can skip ones you don't know about
lldb::offset_t ext_offset = *offset_ptr;
dw_uleb128_t len = debug_line_data.GetULEB128(offset_ptr);
dw_offset_t arg_size = len - (*offset_ptr - ext_offset);
@@ -522,12 +522,12 @@ bool DWARFDebugLine::ParseStatementTable(
switch (sub_opcode) {
case DW_LNE_end_sequence:
// Set the end_sequence register of the state machine to true and
- // append a row to the matrix using the current values of the
- // state-machine registers. Then reset the registers to the initial
- // values specified above. Every statement program sequence must end
- // with a DW_LNE_end_sequence instruction which creates a row whose
- // address is that of the byte after the last target machine instruction
- // of the sequence.
+ // append a row to the matrix using the current values of the state-
+ // machine registers. Then reset the registers to the initial values
+ // specified above. Every statement program sequence must end with a
+ // DW_LNE_end_sequence instruction which creates a row whose address is
+ // that of the byte after the last target machine instruction of the
+ // sequence.
state.end_sequence = true;
state.AppendRowToMatrix(*offset_ptr);
state.Reset();
@@ -537,8 +537,8 @@ bool DWARFDebugLine::ParseStatementTable(
// Takes a single relocatable address as an operand. The size of the
// operand is the size appropriate to hold an address on the target
// machine. Set the address register to the value given by the
- // relocatable address. All of the other statement program opcodes
- // that affect the address register add a delta to it. This instruction
+ // relocatable address. All of the other statement program opcodes that
+ // affect the address register add a delta to it. This instruction
// stores a relocatable value into it instead.
if (arg_size == 4)
state.address = debug_line_data.GetU32(offset_ptr);
@@ -549,24 +549,24 @@ bool DWARFDebugLine::ParseStatementTable(
case DW_LNE_define_file:
// Takes 4 arguments. The first is a null terminated string containing
// a source file name. The second is an unsigned LEB128 number
- // representing
- // the directory index of the directory in which the file was found. The
- // third is an unsigned LEB128 number representing the time of last
- // modification of the file. The fourth is an unsigned LEB128 number
- // representing the length in bytes of the file. The time and length
- // fields may contain LEB128(0) if the information is not available.
+ // representing the directory index of the directory in which the file
+ // was found. The third is an unsigned LEB128 number representing the
+ // time of last modification of the file. The fourth is an unsigned
+ // LEB128 number representing the length in bytes of the file. The time
+ // and length fields may contain LEB128(0) if the information is not
+ // available.
//
// The directory index represents an entry in the include_directories
- // section of the statement program prologue. The index is LEB128(0)
- // if the file was found in the current directory of the compilation,
+ // section of the statement program prologue. The index is LEB128(0) if
+ // the file was found in the current directory of the compilation,
// LEB128(1) if it was found in the first directory in the
// include_directories section, and so on. The directory index is
// ignored for file names that represent full path names.
//
// The files are numbered, starting at 1, in the order in which they
- // appear; the names in the prologue come before names defined by
- // the DW_LNE_define_file instruction. These numbers are used in the
- // file register of the state machine.
+ // appear; the names in the prologue come before names defined by the
+ // DW_LNE_define_file instruction. These numbers are used in the file
+ // register of the state machine.
{
FileNameEntry fileEntry;
fileEntry.name = debug_line_data.GetCStr(offset_ptr);
@@ -578,8 +578,9 @@ bool DWARFDebugLine::ParseStatementTable(
break;
default:
- // Length doesn't include the zero opcode byte or the length itself, but
- // it does include the sub_opcode, so we have to adjust for that below
+ // Length doesn't include the zero opcode byte or the length itself,
+ // but it does include the sub_opcode, so we have to adjust for that
+ // below
(*offset_ptr) += arg_size;
break;
}
@@ -587,23 +588,23 @@ bool DWARFDebugLine::ParseStatementTable(
switch (opcode) {
// Standard Opcodes
case DW_LNS_copy:
- // Takes no arguments. Append a row to the matrix using the
- // current values of the state-machine registers. Then set
- // the basic_block register to false.
+ // Takes no arguments. Append a row to the matrix using the current
+ // values of the state-machine registers. Then set the basic_block
+ // register to false.
state.AppendRowToMatrix(*offset_ptr);
break;
case DW_LNS_advance_pc:
// Takes a single unsigned LEB128 operand, multiplies it by the
- // min_inst_length field of the prologue, and adds the
- // result to the address register of the state machine.
+ // min_inst_length field of the prologue, and adds the result to the
+ // address register of the state machine.
state.address +=
debug_line_data.GetULEB128(offset_ptr) * prologue->min_inst_length;
break;
case DW_LNS_advance_line:
- // Takes a single signed LEB128 operand and adds that value to
- // the line register of the state machine.
+ // Takes a single signed LEB128 operand and adds that value to the line
+ // register of the state machine.
state.line += debug_line_data.GetSLEB128(offset_ptr);
break;
@@ -614,35 +615,35 @@ bool DWARFDebugLine::ParseStatementTable(
break;
case DW_LNS_set_column:
- // Takes a single unsigned LEB128 operand and stores it in the
- // column register of the state machine.
+ // Takes a single unsigned LEB128 operand and stores it in the column
+ // register of the state machine.
state.column = debug_line_data.GetULEB128(offset_ptr);
break;
case DW_LNS_negate_stmt:
- // Takes no arguments. Set the is_stmt register of the state
- // machine to the logical negation of its current value.
+ // Takes no arguments. Set the is_stmt register of the state machine to
+ // the logical negation of its current value.
state.is_stmt = !state.is_stmt;
break;
case DW_LNS_set_basic_block:
- // Takes no arguments. Set the basic_block register of the
- // state machine to true
+ // Takes no arguments. Set the basic_block register of the state
+ // machine to true
state.basic_block = true;
break;
case DW_LNS_const_add_pc:
- // Takes no arguments. Add to the address register of the state
- // machine the address increment value corresponding to special
- // opcode 255. The motivation for DW_LNS_const_add_pc is this:
- // when the statement program needs to advance the address by a
- // small amount, it can use a single special opcode, which occupies
- // a single byte. When it needs to advance the address by up to
- // twice the range of the last special opcode, it can use
- // DW_LNS_const_add_pc followed by a special opcode, for a total
- // of two bytes. Only if it needs to advance the address by more
- // than twice that range will it need to use both DW_LNS_advance_pc
- // and a special opcode, requiring three or more bytes.
+ // Takes no arguments. Add to the address register of the state machine
+ // the address increment value corresponding to special opcode 255. The
+ // motivation for DW_LNS_const_add_pc is this: when the statement
+ // program needs to advance the address by a small amount, it can use a
+ // single special opcode, which occupies a single byte. When it needs
+ // to advance the address by up to twice the range of the last special
+ // opcode, it can use DW_LNS_const_add_pc followed by a special opcode,
+ // for a total of two bytes. Only if it needs to advance the address by
+ // more than twice that range will it need to use both
+ // DW_LNS_advance_pc and a special opcode, requiring three or more
+ // bytes.
{
uint8_t adjust_opcode = 255 - prologue->opcode_base;
dw_addr_t addr_offset = (adjust_opcode / prologue->line_range) *
@@ -652,40 +653,40 @@ bool DWARFDebugLine::ParseStatementTable(
break;
case DW_LNS_fixed_advance_pc:
- // Takes a single uhalf operand. Add to the address register of
- // the state machine the value of the (unencoded) operand. This
- // is the only extended opcode that takes an argument that is not
- // a variable length number. The motivation for DW_LNS_fixed_advance_pc
- // is this: existing assemblers cannot emit DW_LNS_advance_pc or
- // special opcodes because they cannot encode LEB128 numbers or
- // judge when the computation of a special opcode overflows and
- // requires the use of DW_LNS_advance_pc. Such assemblers, however,
- // can use DW_LNS_fixed_advance_pc instead, sacrificing compression.
+ // Takes a single uhalf operand. Add to the address register of the
+ // state machine the value of the (unencoded) operand. This is the only
+ // extended opcode that takes an argument that is not a variable length
+ // number. The motivation for DW_LNS_fixed_advance_pc is this: existing
+ // assemblers cannot emit DW_LNS_advance_pc or special opcodes because
+ // they cannot encode LEB128 numbers or judge when the computation of a
+ // special opcode overflows and requires the use of DW_LNS_advance_pc.
+ // Such assemblers, however, can use DW_LNS_fixed_advance_pc instead,
+ // sacrificing compression.
state.address += debug_line_data.GetU16(offset_ptr);
break;
case DW_LNS_set_prologue_end:
- // Takes no arguments. Set the prologue_end register of the
- // state machine to true
+ // Takes no arguments. Set the prologue_end register of the state
+ // machine to true
state.prologue_end = true;
break;
case DW_LNS_set_epilogue_begin:
- // Takes no arguments. Set the basic_block register of the
- // state machine to true
+ // Takes no arguments. Set the basic_block register of the state
+ // machine to true
state.epilogue_begin = true;
break;
case DW_LNS_set_isa:
- // Takes a single unsigned LEB128 operand and stores it in the
- // column register of the state machine.
+ // Takes a single unsigned LEB128 operand and stores it in the column
+ // register of the state machine.
state.isa = debug_line_data.GetULEB128(offset_ptr);
break;
default:
- // Handle any unknown standard opcodes here. We know the lengths
- // of such opcodes because they are specified in the prologue
- // as a multiple of LEB128 operands for each opcode.
+ // Handle any unknown standard opcodes here. We know the lengths of
+ // such opcodes because they are specified in the prologue as a
+ // multiple of LEB128 operands for each opcode.
{
uint8_t i;
assert(static_cast<size_t>(opcode - 1) <
@@ -702,32 +703,32 @@ bool DWARFDebugLine::ParseStatementTable(
// A special opcode value is chosen based on the amount that needs
// to be added to the line and address registers. The maximum line
- // increment for a special opcode is the value of the line_base
- // field in the header, plus the value of the line_range field,
- // minus 1 (line base + line range - 1). If the desired line
- // increment is greater than the maximum line increment, a standard
- // opcode must be used instead of a special opcode. The "address
- // advance" is calculated by dividing the desired address increment
- // by the minimum_instruction_length field from the header. The
- // special opcode is then calculated using the following formula:
+ // increment for a special opcode is the value of the line_base field in
+ // the header, plus the value of the line_range field, minus 1 (line base
+ // + line range - 1). If the desired line increment is greater than the
+ // maximum line increment, a standard opcode must be used instead of a
+ // special opcode. The "address advance" is calculated by dividing the
+ // desired address increment by the minimum_instruction_length field from
+ // the header. The special opcode is then calculated using the following
+ // formula:
//
// opcode = (desired line increment - line_base) + (line_range * address
// advance) + opcode_base
//
- // If the resulting opcode is greater than 255, a standard opcode
- // must be used instead.
+ // If the resulting opcode is greater than 255, a standard opcode must be
+ // used instead.
//
- // To decode a special opcode, subtract the opcode_base from the
- // opcode itself to give the adjusted opcode. The amount to
- // increment the address register is the result of the adjusted
- // opcode divided by the line_range multiplied by the
- // minimum_instruction_length field from the header. That is:
+ // To decode a special opcode, subtract the opcode_base from the opcode
+ // itself to give the adjusted opcode. The amount to increment the
+ // address register is the result of the adjusted opcode divided by the
+ // line_range multiplied by the minimum_instruction_length field from the
+ // header. That is:
//
// address increment = (adjusted opcode / line_range) *
// minimum_instruction_length
//
- // The amount to increment the line register is the line_base plus
- // the result of the adjusted opcode modulo the line_range. That is:
+ // The amount to increment the line register is the line_base plus the
+ // result of the adjusted opcode modulo the line_range. That is:
//
// line increment = line_base + (adjusted opcode % line_range)
@@ -755,8 +756,8 @@ static void ParseStatementTableCallback(dw_offset_t offset,
void *userData) {
DWARFDebugLine::LineTable *line_table = (DWARFDebugLine::LineTable *)userData;
if (state.row == DWARFDebugLine::State::StartParsingLineTable) {
- // Just started parsing the line table, so lets keep a reference to
- // the prologue using the supplied shared pointer
+ // Just started parsing the line table, so lets keep a reference to the
+ // prologue using the supplied shared pointer
line_table->prologue = state.prologue;
} else if (state.row == DWARFDebugLine::State::DoneParsingLineTable) {
// Done parsing line table, nothing to do for the cleanup
@@ -769,8 +770,8 @@ static void ParseStatementTableCallback(dw_offset_t offset,
//----------------------------------------------------------------------
// ParseStatementTable
//
-// Parse a line table at offset and populate the LineTable class with
-// the prologue and all rows.
+// Parse a line table at offset and populate the LineTable class with the
+// prologue and all rows.
//----------------------------------------------------------------------
bool DWARFDebugLine::ParseStatementTable(
const DWARFDataExtractor &debug_line_data, lldb::offset_t *offset_ptr,
@@ -861,11 +862,11 @@ void DWARFDebugLine::Prologue::Dump(Log *log) {
// buff.Append8(0); // Terminate the file names section with empty string
//}
-bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx, const char *comp_dir,
- FileSpec &file) const {
+bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx,
+ const lldb_private::FileSpec &comp_dir, FileSpec &file) const {
uint32_t idx = file_idx - 1; // File indexes are 1 based...
if (idx < file_names.size()) {
- file.SetFile(file_names[idx].name, false);
+ file.SetFile(file_names[idx].name, false, FileSpec::Style::native);
if (file.IsRelative()) {
if (file_names[idx].dir_idx > 0) {
const uint32_t dir_idx = file_names[idx].dir_idx - 1;
@@ -876,7 +877,7 @@ bool DWARFDebugLine::Prologue::GetFile(uint32_t file_idx, const char *comp_dir,
}
}
- if (comp_dir && comp_dir[0])
+ if (comp_dir)
file.PrependPathComponent(comp_dir);
}
return true;
@@ -936,11 +937,10 @@ uint32_t DWARFDebugLine::LineTable::LookupAddress(dw_addr_t address,
if (address < cu_high_pc)
return rows.size() - 1;
} else {
- // Rely on fact that we are using a std::vector and we can do
- // pointer arithmetic to find the row index (which will be one less
- // that what we found since it will find the first position after
- // the current address) since std::vector iterators are just
- // pointers to the container type.
+ // Rely on fact that we are using a std::vector and we can do pointer
+ // arithmetic to find the row index (which will be one less that what we
+ // found since it will find the first position after the current address)
+ // since std::vector iterators are just pointers to the container type.
index = pos - begin_pos;
if (pos->address > address) {
if (index > 0)
@@ -1005,9 +1005,9 @@ static bool AddressLessThan(const DWARFDebugLine::Row &a,
return a.address < b.address;
}
-// Insert a row at the correct address if the addresses can be out of
-// order which can only happen when we are linking a line table that
-// may have had it's contents rearranged.
+// Insert a row at the correct address if the addresses can be out of order
+// which can only happen when we are linking a line table that may have had
+// it's contents rearranged.
void DWARFDebugLine::Row::Insert(Row::collection &state_coll,
const Row &state) {
// If we don't have anything yet, or if the address of the last state in our
@@ -1020,12 +1020,12 @@ void DWARFDebugLine::Row::Insert(Row::collection &state_coll,
state_coll.begin(), state_coll.end(), state, AddressLessThan));
// If the addresses are equal, we can safely replace the previous entry
- // with the current one if the one it is replacing is an end_sequence entry.
- // We currently always place an extra end sequence when ever we exit a valid
- // address range for a function in case the functions get rearranged by
- // optimizations or by order specifications. These extra end sequences will
- // disappear by getting replaced with valid consecutive entries within a
- // compile unit if there are no gaps.
+ // with the current one if the one it is replacing is an end_sequence
+ // entry. We currently always place an extra end sequence when ever we exit
+ // a valid address range for a function in case the functions get
+ // rearranged by optimizations or by order specifications. These extra end
+ // sequences will disappear by getting replaced with valid consecutive
+ // entries within a compile unit if there are no gaps.
if (range.first == range.second) {
state_coll.insert(range.first, state);
} else {
@@ -1065,10 +1065,9 @@ void DWARFDebugLine::State::Reset() { Row::Reset(prologue->default_is_stmt); }
// DWARFDebugLine::State::AppendRowToMatrix
//----------------------------------------------------------------------
void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) {
- // Each time we are to add an entry into the line table matrix
- // call the callback function so that someone can do something with
- // the current state of the state machine (like build a line table
- // or dump the line table!)
+ // Each time we are to add an entry into the line table matrix call the
+ // callback function so that someone can do something with the current state
+ // of the state machine (like build a line table or dump the line table!)
if (log) {
if (row == 0) {
log->PutCString("Address Line Column File ISA Flags");
@@ -1088,8 +1087,8 @@ void DWARFDebugLine::State::AppendRowToMatrix(dw_offset_t offset) {
// DWARFDebugLine::State::Finalize
//----------------------------------------------------------------------
void DWARFDebugLine::State::Finalize(dw_offset_t offset) {
- // Call the callback with a special row state when we are done parsing a
- // line table
+ // Call the callback with a special row state when we are done parsing a line
+ // table
row = DoneParsingLineTable;
if (callback)
callback(offset, *this, callbackUserData);
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
index ea02cfed6e01..3ab15ac59028 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugLine.h
@@ -90,7 +90,7 @@ public:
include_directories.clear();
file_names.clear();
}
- bool GetFile(uint32_t file_idx, const char *comp_dir,
+ bool GetFile(uint32_t file_idx, const lldb_private::FileSpec &cu_comp_dir,
lldb_private::FileSpec &file) const;
};
@@ -199,7 +199,8 @@ public:
static bool
ParseSupportFiles(const lldb::ModuleSP &module_sp,
const lldb_private::DWARFDataExtractor &debug_line_data,
- const char *cu_comp_dir, dw_offset_t stmt_list,
+ const lldb_private::FileSpec &cu_comp_dir,
+ dw_offset_t stmt_list,
lldb_private::FileSpecList &support_files);
static bool
ParsePrologue(const lldb_private::DWARFDataExtractor &debug_line_data,
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
deleted file mode 100644
index 766899c497b0..000000000000
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.cpp
+++ /dev/null
@@ -1,255 +0,0 @@
-//===-- DWARFDebugPubnames.cpp ----------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DWARFDebugPubnames.h"
-
-#include "lldb/Utility/Stream.h"
-#include "lldb/Utility/Timer.h"
-
-#include "DWARFCompileUnit.h"
-#include "DWARFDIECollection.h"
-#include "DWARFDebugInfo.h"
-#include "DWARFFormValue.h"
-#include "LogChannelDWARF.h"
-#include "SymbolFileDWARF.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-DWARFDebugPubnames::DWARFDebugPubnames() : m_sets() {}
-
-bool DWARFDebugPubnames::Extract(const DWARFDataExtractor &data) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")",
- (uint64_t)data.GetByteSize());
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES));
- if (log)
- log->Printf("DWARFDebugPubnames::Extract (byte_size = %" PRIu64 ")",
- (uint64_t)data.GetByteSize());
-
- if (data.ValidOffset(0)) {
- lldb::offset_t offset = 0;
-
- DWARFDebugPubnamesSet set;
- while (data.ValidOffset(offset)) {
- if (set.Extract(data, &offset)) {
- m_sets.push_back(set);
- offset = set.GetOffsetOfNextEntry();
- } else
- break;
- }
- if (log)
- Dump(log);
- return true;
- }
- return false;
-}
-
-bool DWARFDebugPubnames::GeneratePubnames(SymbolFileDWARF *dwarf2Data) {
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(func_cat,
- "DWARFDebugPubnames::GeneratePubnames (data = %p)",
- static_cast<void *>(dwarf2Data));
-
- Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_PUBNAMES));
- if (log)
- log->Printf("DWARFDebugPubnames::GeneratePubnames (data = %p)",
- static_cast<void *>(dwarf2Data));
-
- m_sets.clear();
- DWARFDebugInfo *debug_info = dwarf2Data->DebugInfo();
- if (debug_info) {
- uint32_t cu_idx = 0;
- const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits();
- for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
-
- DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
-
- DWARFFormValue::FixedFormSizes fixed_form_sizes =
- DWARFFormValue::GetFixedFormSizesForAddressSize(
- cu->GetAddressByteSize(), cu->IsDWARF64());
-
- bool clear_dies = cu->ExtractDIEsIfNeeded(false) > 1;
-
- DWARFDIECollection dies;
- const size_t die_count = cu->AppendDIEsWithTag(DW_TAG_subprogram, dies) +
- cu->AppendDIEsWithTag(DW_TAG_variable, dies);
-
- dw_offset_t cu_offset = cu->GetOffset();
- DWARFDebugPubnamesSet pubnames_set(DW_INVALID_OFFSET, cu_offset,
- cu->GetNextCompileUnitOffset() -
- cu_offset);
-
- size_t die_idx;
- for (die_idx = 0; die_idx < die_count; ++die_idx) {
- DWARFDIE die = dies.GetDIEAtIndex(die_idx);
- DWARFAttributes attributes;
- const char *name = NULL;
- const char *mangled = NULL;
- bool add_die = false;
- const size_t num_attributes = die.GetDIE()->GetAttributes(
- die.GetCU(), fixed_form_sizes, attributes);
- if (num_attributes > 0) {
- uint32_t i;
-
- dw_tag_t tag = die.Tag();
-
- for (i = 0; i < num_attributes; ++i) {
- dw_attr_t attr = attributes.AttributeAtIndex(i);
- DWARFFormValue form_value;
- switch (attr) {
- case DW_AT_name:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- name = form_value.AsCString();
- break;
-
- case DW_AT_MIPS_linkage_name:
- case DW_AT_linkage_name:
- if (attributes.ExtractFormValueAtIndex(i, form_value))
- mangled = form_value.AsCString();
- break;
-
- case DW_AT_low_pc:
- case DW_AT_ranges:
- case DW_AT_entry_pc:
- if (tag == DW_TAG_subprogram)
- add_die = true;
- break;
-
- case DW_AT_location:
- if (tag == DW_TAG_variable) {
- DWARFDIE parent_die = die.GetParent();
- while (parent_die) {
- switch (parent_die.Tag()) {
- case DW_TAG_subprogram:
- case DW_TAG_lexical_block:
- case DW_TAG_inlined_subroutine:
- // Even if this is a function level static, we don't add it.
- // We could theoretically
- // add these if we wanted to by introspecting into the
- // DW_AT_location and seeing
- // if the location describes a hard coded address, but we
- // don't want the performance
- // penalty of that right now.
- add_die = false;
- parent_die.Clear(); // Terminate the while loop.
- break;
-
- case DW_TAG_compile_unit:
- add_die = true;
- parent_die.Clear(); // Terminate the while loop.
- break;
-
- default:
- parent_die =
- parent_die.GetParent(); // Keep going in the while loop.
- break;
- }
- }
- }
- break;
- }
- }
- }
-
- if (add_die && (name || mangled)) {
- pubnames_set.AddDescriptor(die.GetCompileUnitRelativeOffset(),
- mangled ? mangled : name);
- }
- }
-
- if (pubnames_set.NumDescriptors() > 0) {
- m_sets.push_back(pubnames_set);
- }
-
- // Keep memory down by clearing DIEs if this generate function
- // caused them to be parsed
- if (clear_dies)
- cu->ClearDIEs(true);
- }
- }
- if (m_sets.empty())
- return false;
- if (log)
- Dump(log);
- return true;
-}
-
-bool DWARFDebugPubnames::GeneratePubBaseTypes(SymbolFileDWARF *dwarf2Data) {
- m_sets.clear();
- DWARFDebugInfo *debug_info = dwarf2Data->DebugInfo();
- if (debug_info) {
- uint32_t cu_idx = 0;
- const uint32_t num_compile_units = dwarf2Data->GetNumCompileUnits();
- for (cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
- DWARFCompileUnit *cu = debug_info->GetCompileUnitAtIndex(cu_idx);
- DWARFDIECollection dies;
- const size_t die_count = cu->AppendDIEsWithTag(DW_TAG_base_type, dies);
- dw_offset_t cu_offset = cu->GetOffset();
- DWARFDebugPubnamesSet pubnames_set(DW_INVALID_OFFSET, cu_offset,
- cu->GetNextCompileUnitOffset() -
- cu_offset);
-
- size_t die_idx;
- for (die_idx = 0; die_idx < die_count; ++die_idx) {
- DWARFDIE die = dies.GetDIEAtIndex(die_idx);
- const char *name = die.GetName();
-
- if (name)
- pubnames_set.AddDescriptor(die.GetCompileUnitRelativeOffset(), name);
- }
-
- if (pubnames_set.NumDescriptors() > 0) {
- m_sets.push_back(pubnames_set);
- }
- }
- }
- return !m_sets.empty();
-}
-
-void DWARFDebugPubnames::Dump(Log *s) const {
- if (m_sets.empty())
- s->PutCString("< EMPTY >\n");
- else {
- const_iterator pos;
- const_iterator end = m_sets.end();
-
- for (pos = m_sets.begin(); pos != end; ++pos)
- (*pos).Dump(s);
- }
-}
-
-bool DWARFDebugPubnames::Find(const char *name, bool ignore_case,
- std::vector<dw_offset_t> &die_offsets) const {
- const_iterator pos;
- const_iterator end = m_sets.end();
-
- die_offsets.clear();
-
- for (pos = m_sets.begin(); pos != end; ++pos) {
- (*pos).Find(name, ignore_case, die_offsets);
- }
-
- return !die_offsets.empty();
-}
-
-bool DWARFDebugPubnames::Find(const RegularExpression &regex,
- std::vector<dw_offset_t> &die_offsets) const {
- const_iterator pos;
- const_iterator end = m_sets.end();
-
- die_offsets.clear();
-
- for (pos = m_sets.begin(); pos != end; ++pos) {
- (*pos).Find(regex, die_offsets);
- }
-
- return !die_offsets.empty();
-}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h
deleted file mode 100644
index 57dabade012c..000000000000
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnames.h
+++ /dev/null
@@ -1,40 +0,0 @@
-//===-- DWARFDebugPubnames.h ------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SymbolFileDWARF_DWARFDebugPubnames_h_
-#define SymbolFileDWARF_DWARFDebugPubnames_h_
-
-#include "SymbolFileDWARF.h"
-
-#include <list>
-
-#include "DWARFDebugPubnamesSet.h"
-
-class DWARFDebugPubnames {
-public:
- DWARFDebugPubnames();
- bool Extract(const lldb_private::DWARFDataExtractor &data);
- bool GeneratePubnames(SymbolFileDWARF *dwarf2Data);
- bool GeneratePubBaseTypes(SymbolFileDWARF *dwarf2Data);
-
- void Dump(lldb_private::Log *s) const;
- bool Find(const char *name, bool ignore_case,
- std::vector<dw_offset_t> &die_offset_coll) const;
- bool Find(const lldb_private::RegularExpression &regex,
- std::vector<dw_offset_t> &die_offsets) const;
-
-protected:
- typedef std::list<DWARFDebugPubnamesSet> collection;
- typedef collection::iterator iterator;
- typedef collection::const_iterator const_iterator;
-
- collection m_sets;
-};
-
-#endif // SymbolFileDWARF_DWARFDebugPubnames_h_
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
deleted file mode 100644
index 21e2482783a1..000000000000
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-//===-- DWARFDebugPubnamesSet.cpp -------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "DWARFDebugPubnamesSet.h"
-
-#include "lldb/Utility/Log.h"
-#include "lldb/Utility/RegularExpression.h"
-
-#include "SymbolFileDWARF.h"
-
-using namespace lldb_private;
-
-DWARFDebugPubnamesSet::DWARFDebugPubnamesSet()
- : m_offset(DW_INVALID_OFFSET), m_header(), m_descriptors(),
- m_name_to_descriptor_index() {}
-
-DWARFDebugPubnamesSet::DWARFDebugPubnamesSet(dw_offset_t debug_aranges_offset,
- dw_offset_t cu_die_offset,
- dw_offset_t cu_die_length)
- : m_offset(debug_aranges_offset), m_header(), m_descriptors(),
- m_name_to_descriptor_index() {
- m_header.length =
- 10; // set the length to only include the header right for now
- m_header.version = 2; // The DWARF version number
- m_header.die_offset = cu_die_offset; // compile unit .debug_info offset
- m_header.die_length = cu_die_length; // compile unit .debug_info length
-}
-
-void DWARFDebugPubnamesSet::AddDescriptor(dw_offset_t cu_rel_offset,
- const char *name) {
- if (name && name[0]) {
- // Adjust our header length
- m_header.length += strlen(name) + 1 + sizeof(dw_offset_t);
- Descriptor pubnameDesc(cu_rel_offset, name);
- m_descriptors.push_back(pubnameDesc);
- }
-}
-
-void DWARFDebugPubnamesSet::Clear() {
- m_offset = DW_INVALID_OFFSET;
- m_header.length = 10;
- m_header.version = 2;
- m_header.die_offset = DW_INVALID_OFFSET;
- m_header.die_length = 0;
- m_descriptors.clear();
-}
-
-//----------------------------------------------------------------------
-// InitNameIndexes
-//----------------------------------------------------------------------
-void DWARFDebugPubnamesSet::InitNameIndexes() const {
- // Create the name index vector to be able to quickly search by name
- const size_t count = m_descriptors.size();
- for (uint32_t idx = 0; idx < count; ++idx) {
- const char *name = m_descriptors[idx].name.c_str();
- if (name && name[0])
- m_name_to_descriptor_index.insert(
- cstr_to_index_mmap::value_type(name, idx));
- }
-}
-
-bool DWARFDebugPubnamesSet::Extract(const DWARFDataExtractor &data,
- lldb::offset_t *offset_ptr) {
- if (data.ValidOffset(*offset_ptr)) {
- m_descriptors.clear();
- m_offset = *offset_ptr;
- m_header.length = data.GetDWARFInitialLength(offset_ptr);
- m_header.version = data.GetU16(offset_ptr);
- m_header.die_offset = data.GetDWARFOffset(offset_ptr);
- m_header.die_length = data.GetDWARFOffset(offset_ptr);
-
- Descriptor pubnameDesc;
- while (data.ValidOffset(*offset_ptr)) {
- pubnameDesc.offset = data.GetDWARFOffset(offset_ptr);
-
- if (pubnameDesc.offset) {
- const char *name = data.GetCStr(offset_ptr);
- if (name && name[0]) {
- pubnameDesc.name = name;
- m_descriptors.push_back(pubnameDesc);
- }
- } else
- break; // We are done if we get a zero 4 byte offset
- }
-
- return !m_descriptors.empty();
- }
- return false;
-}
-
-dw_offset_t DWARFDebugPubnamesSet::GetOffsetOfNextEntry() const {
- return m_offset + m_header.length + 4;
-}
-
-void DWARFDebugPubnamesSet::Dump(Log *log) const {
- log->Printf("Pubnames Header: length = 0x%8.8x, version = 0x%4.4x, "
- "die_offset = 0x%8.8x, die_length = 0x%8.8x",
- m_header.length, m_header.version, m_header.die_offset,
- m_header.die_length);
-
- bool verbose = log->GetVerbose();
-
- DescriptorConstIter pos;
- DescriptorConstIter end = m_descriptors.end();
- for (pos = m_descriptors.begin(); pos != end; ++pos) {
- if (verbose)
- log->Printf("0x%8.8x + 0x%8.8x = 0x%8.8x: %s", pos->offset,
- m_header.die_offset, pos->offset + m_header.die_offset,
- pos->name.c_str());
- else
- log->Printf("0x%8.8x: %s", pos->offset + m_header.die_offset,
- pos->name.c_str());
- }
-}
-
-void DWARFDebugPubnamesSet::Find(
- const char *name, bool ignore_case,
- std::vector<dw_offset_t> &die_offset_coll) const {
- if (!m_descriptors.empty() && m_name_to_descriptor_index.empty())
- InitNameIndexes();
-
- std::pair<cstr_to_index_mmap::const_iterator,
- cstr_to_index_mmap::const_iterator>
- range(m_name_to_descriptor_index.equal_range(name));
- for (cstr_to_index_mmap::const_iterator pos = range.first;
- pos != range.second; ++pos)
- die_offset_coll.push_back(m_header.die_offset +
- m_descriptors[(*pos).second].offset);
-}
-
-void DWARFDebugPubnamesSet::Find(
- const RegularExpression &regex,
- std::vector<dw_offset_t> &die_offset_coll) const {
- DescriptorConstIter pos;
- DescriptorConstIter end = m_descriptors.end();
- for (pos = m_descriptors.begin(); pos != end; ++pos) {
- if (regex.Execute(pos->name))
- die_offset_coll.push_back(m_header.die_offset + pos->offset);
- }
-}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h b/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
deleted file mode 100644
index 6e7d3f38aa85..000000000000
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugPubnamesSet.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//===-- DWARFDebugPubnamesSet.h ---------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef SymbolFileDWARF_DWARFDebugPubnamesSet_h_
-#define SymbolFileDWARF_DWARFDebugPubnamesSet_h_
-
-#include "SymbolFileDWARF.h"
-#include <map>
-#include <string>
-#include <vector>
-#if __cplusplus >= 201103L || defined(_MSC_VER)
-#include <unordered_map>
-#else
-#include <ext/hash_map>
-#endif
-
-#include "lldb/Core/STLUtils.h"
-
-class DWARFDebugPubnamesSet {
-public:
- struct Header {
- uint32_t length; // length of the set of entries for this compilation unit,
- // not including the length field itself
- uint16_t version; // The DWARF version number
- uint32_t die_offset; // compile unit .debug_info offset
- uint32_t die_length; // compile unit .debug_info length
- Header()
- : length(10), version(2), die_offset(DW_INVALID_OFFSET), die_length(0) {
- }
- };
-
- struct Descriptor {
- Descriptor() : offset(), name() {}
-
- Descriptor(dw_offset_t the_offset, const char *the_name)
- : offset(the_offset), name(the_name ? the_name : "") {}
-
- dw_offset_t offset;
- std::string name;
- };
-
- DWARFDebugPubnamesSet();
- DWARFDebugPubnamesSet(dw_offset_t debug_aranges_offset,
- dw_offset_t cu_die_offset, dw_offset_t die_length);
- dw_offset_t GetOffset() const { return m_offset; }
- void SetOffset(dw_offset_t offset) { m_offset = offset; }
- DWARFDebugPubnamesSet::Header &GetHeader() { return m_header; }
- const DWARFDebugPubnamesSet::Header &GetHeader() const { return m_header; }
- const DWARFDebugPubnamesSet::Descriptor *GetDescriptor(uint32_t i) const {
- if (i < m_descriptors.size())
- return &m_descriptors[i];
- return NULL;
- }
- uint32_t NumDescriptors() const { return m_descriptors.size(); }
- void AddDescriptor(dw_offset_t cu_rel_offset, const char *name);
- void Clear();
- bool Extract(const lldb_private::DWARFDataExtractor &debug_pubnames_data,
- lldb::offset_t *offset_ptr);
- void Dump(lldb_private::Log *s) const;
- void InitNameIndexes() const;
- void Find(const char *name, bool ignore_case,
- std::vector<dw_offset_t> &die_offset_coll) const;
- void Find(const lldb_private::RegularExpression &regex,
- std::vector<dw_offset_t> &die_offsets) const;
- dw_offset_t GetOffsetOfNextEntry() const;
-
-protected:
- typedef std::vector<Descriptor> DescriptorColl;
- typedef DescriptorColl::iterator DescriptorIter;
- typedef DescriptorColl::const_iterator DescriptorConstIter;
-
- dw_offset_t m_offset;
- Header m_header;
-#if __cplusplus >= 201103L || defined(_MSC_VER)
- typedef std::unordered_multimap<const char *, uint32_t,
- std::hash<const char *>,
- CStringEqualBinaryPredicate>
- cstr_to_index_mmap;
-#else
- typedef __gnu_cxx::hash_multimap<const char *, uint32_t,
- __gnu_cxx::hash<const char *>,
- CStringEqualBinaryPredicate>
- cstr_to_index_mmap;
-#endif
- DescriptorColl m_descriptors;
- mutable cstr_to_index_mmap m_name_to_descriptor_index;
-};
-
-#endif // SymbolFileDWARF_DWARFDebugPubnamesSet_h_
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
index a8c48b7f2f84..89e27efb3cc2 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDebugRanges.cpp
@@ -89,8 +89,8 @@ void DWARFDebugRanges::Dump(Stream &s,
debug_ranges_data.ValidOffsetForDataOfSize(*offset_ptr, 2 * addr_size)) {
dw_addr_t begin = debug_ranges_data.GetMaxU64(offset_ptr, addr_size);
dw_addr_t end = debug_ranges_data.GetMaxU64(offset_ptr, addr_size);
- // Extend 4 byte addresses that consists of 32 bits of 1's to be 64 bits
- // of ones
+ // Extend 4 byte addresses that consists of 32 bits of 1's to be 64 bits of
+ // ones
if (begin == 0xFFFFFFFFull && addr_size == 4)
begin = LLDB_INVALID_ADDRESS;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
index 79f2f221696b..dbaf0b0ed127 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDeclContext.cpp
@@ -67,8 +67,8 @@ bool DWARFDeclContext::operator==(const DWARFDeclContext &rhs) const {
// First compare the tags before we do expensive name compares
for (pos = begin, rhs_pos = rhs_begin; pos != end; ++pos, ++rhs_pos) {
if (pos->tag != rhs_pos->tag) {
- // Check for DW_TAG_structure_type and DW_TAG_class_type as they are often
- // used interchangeably in GCC
+ // Check for DW_TAG_structure_type and DW_TAG_class_type as they are
+ // often used interchangeably in GCC
if (pos->tag == DW_TAG_structure_type &&
rhs_pos->tag == DW_TAG_class_type)
continue;
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp b/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
index 2ff0fe3aac41..1d927ba3bca3 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDefines.cpp
@@ -473,16 +473,6 @@ const char *DW_ORD_value_to_name(uint32_t val) {
return llvmstr.data();
}
-const char *DW_DSC_value_to_name(uint32_t val) {
- static char invalid[100];
- llvm::StringRef llvmstr = llvm::dwarf::DiscriminantString(val);
- if (llvmstr.empty()) {
- snprintf(invalid, sizeof(invalid), "Unknown DW_DSC constant: 0x%x", val);
- return invalid;
- }
- return llvmstr.data();
-}
-
const char *DW_LNS_value_to_name(uint32_t val) {
static char invalid[100];
llvm::StringRef llvmstr = llvm::dwarf::LNStandardString(val);
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFDefines.h b/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
index 038f5706c060..926f83b3564a 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFDefines.h
@@ -58,8 +58,6 @@ const char *DW_INL_value_to_name(uint32_t val);
const char *DW_ORD_value_to_name(uint32_t val);
-const char *DW_DSC_value_to_name(uint32_t val);
-
const char *DW_LNS_value_to_name(uint32_t val);
const char *DW_LNE_value_to_name(uint32_t val);
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
index a21e313c2f81..4fde5748d3f3 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
+++ b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
@@ -12,10 +12,10 @@
#include "lldb/Core/dwarf.h"
#include "lldb/Utility/Stream.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFFormValue.h"
-class DWARFCompileUnit;
+class DWARFUnit;
using namespace lldb_private;
@@ -154,7 +154,7 @@ DWARFFormValue::GetFixedFormSizesForAddressSize(uint8_t addr_size,
DWARFFormValue::DWARFFormValue() : m_cu(NULL), m_form(0), m_value() {}
-DWARFFormValue::DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form)
+DWARFFormValue::DWARFFormValue(const DWARFUnit *cu, dw_form_t form)
: m_cu(cu), m_form(form), m_value() {}
void DWARFFormValue::Clear() {
@@ -177,7 +177,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_addr:
assert(m_cu);
m_value.value.uval = data.GetMaxU64(
- offset_ptr, DWARFCompileUnit::GetAddressByteSize(m_cu));
+ offset_ptr, DWARFUnit::GetAddressByteSize(m_cu));
break;
case DW_FORM_block2:
m_value.value.uval = data.GetU16(offset_ptr);
@@ -220,7 +220,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_strp:
assert(m_cu);
m_value.value.uval =
- data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4);
+ data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4);
break;
// case DW_FORM_APPLE_db_str:
case DW_FORM_udata:
@@ -258,7 +258,7 @@ bool DWARFFormValue::ExtractValue(const DWARFDataExtractor &data,
case DW_FORM_sec_offset:
assert(m_cu);
m_value.value.uval =
- data.GetMaxU64(offset_ptr, DWARFCompileUnit::IsDWARF64(m_cu) ? 8 : 4);
+ data.GetMaxU64(offset_ptr, DWARFUnit::IsDWARF64(m_cu) ? 8 : 4);
break;
case DW_FORM_flag_present:
m_value.value.uval = 1;
@@ -296,11 +296,11 @@ bool DWARFFormValue::SkipValue(const DWARFDataExtractor &debug_info_data,
bool DWARFFormValue::SkipValue(dw_form_t form,
const DWARFDataExtractor &debug_info_data,
lldb::offset_t *offset_ptr,
- const DWARFCompileUnit *cu) {
+ const DWARFUnit *cu) {
uint8_t ref_addr_size;
switch (form) {
- // Blocks if inlined data that have a length field and the data bytes
- // inlined in the .debug_info
+ // Blocks if inlined data that have a length field and the data bytes inlined
+ // in the .debug_info
case DW_FORM_exprloc:
case DW_FORM_block: {
dw_uleb128_t size = debug_info_data.GetULEB128(offset_ptr);
@@ -330,7 +330,7 @@ bool DWARFFormValue::SkipValue(dw_form_t form,
// Compile unit address sized values
case DW_FORM_addr:
- *offset_ptr += DWARFCompileUnit::GetAddressByteSize(cu);
+ *offset_ptr += DWARFUnit::GetAddressByteSize(cu);
return true;
case DW_FORM_ref_addr:
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
index 2aa7460c4910..ef1a693b37c9 100644
--- a/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ b/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -13,7 +13,7 @@
#include "DWARFDataExtractor.h"
#include <stddef.h> // for NULL
-class DWARFCompileUnit;
+class DWARFUnit;
class DWARFFormValue {
public:
@@ -55,9 +55,9 @@ public:
};
DWARFFormValue();
- DWARFFormValue(const DWARFCompileUnit *cu, dw_form_t form);
- const DWARFCompileUnit *GetCompileUnit() const { return m_cu; }
- void SetCompileUnit(const DWARFCompileUnit *cu) { m_cu = cu; }
+ DWARFFormValue(const DWARFUnit *cu, dw_form_t form);
+ const DWARFUnit *GetCompileUnit() const { return m_cu; }
+ void SetCompileUnit(const DWARFUnit *cu) { m_cu = cu; }
dw_form_t Form() const { return m_form; }
void SetForm(dw_form_t form) { m_form = form; }
const ValueType &Value() const { return m_value; }
@@ -79,7 +79,7 @@ public:
lldb::offset_t *offset_ptr) const;
static bool SkipValue(const dw_form_t form,
const lldb_private::DWARFDataExtractor &debug_info_data,
- lldb::offset_t *offset_ptr, const DWARFCompileUnit *cu);
+ lldb::offset_t *offset_ptr, const DWARFUnit *cu);
static bool IsBlockForm(const dw_form_t form);
static bool IsDataForm(const dw_form_t form);
static FixedFormSizes GetFixedFormSizesForAddressSize(uint8_t addr_size,
@@ -89,7 +89,7 @@ public:
static bool FormIsSupported(dw_form_t form);
protected:
- const DWARFCompileUnit *m_cu; // Compile unit for this form
+ const DWARFUnit *m_cu; // Compile unit for this form
dw_form_t m_form; // Form for this value
ValueType m_value; // Contains all data for the form
};
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp b/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
new file mode 100644
index 000000000000..4577f0557a1d
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFIndex.cpp
@@ -0,0 +1,68 @@
+//===-- DWARFIndex.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+
+#include "Plugins/Language/ObjC/ObjCLanguage.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+DWARFIndex::~DWARFIndex() = default;
+
+void DWARFIndex::ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
+ DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) {
+ DWARFDIE die = info.GetDIE(ref);
+ if (!die) {
+ ReportInvalidDIEOffset(ref.die_offset, name);
+ return;
+ }
+
+ // Exit early if we're searching exclusively for methods or selectors and
+ // we have a context specified (no methods in namespaces).
+ uint32_t looking_for_nonmethods =
+ name_type_mask & ~(eFunctionNameTypeMethod | eFunctionNameTypeSelector);
+ if (!looking_for_nonmethods && parent_decl_ctx.IsValid())
+ return;
+
+ // Otherwise, we need to also check that the context matches. If it does not
+ // match, we do nothing.
+ if (!SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
+ return;
+
+ // In case of a full match, we just insert everything we find.
+ if (name_type_mask & eFunctionNameTypeFull) {
+ dies.push_back(die);
+ return;
+ }
+
+ // If looking for ObjC selectors, we need to also check if the name is a
+ // possible selector.
+ if (name_type_mask & eFunctionNameTypeSelector &&
+ ObjCLanguage::IsPossibleObjCMethodName(die.GetName())) {
+ dies.push_back(die);
+ return;
+ }
+
+ bool looking_for_methods = name_type_mask & lldb::eFunctionNameTypeMethod;
+ bool looking_for_functions = name_type_mask & lldb::eFunctionNameTypeBase;
+ if (looking_for_methods || looking_for_functions) {
+ // If we're looking for either methods or functions, we definitely want this
+ // die. Otherwise, only keep it if the die type matches what we are
+ // searching for.
+ if ((looking_for_methods && looking_for_functions) ||
+ looking_for_methods == die.IsMethod())
+ dies.push_back(die);
+ }
+}
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFIndex.h b/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
new file mode 100644
index 000000000000..77af67b8e60f
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFIndex.h
@@ -0,0 +1,69 @@
+//===-- DWARFIndex.h -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_DWARFINDEX_H
+#define LLDB_DWARFINDEX_H
+
+#include "Plugins/SymbolFile/DWARF/DIERef.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDIE.h"
+#include "Plugins/SymbolFile/DWARF/DWARFFormValue.h"
+
+class DWARFDebugInfo;
+class DWARFDeclContext;
+class DWARFDIE;
+
+namespace lldb_private {
+class DWARFIndex {
+public:
+ DWARFIndex(Module &module) : m_module(module) {}
+ virtual ~DWARFIndex();
+
+ virtual void Preload() = 0;
+
+ /// Finds global variables with the given base name. Any additional filtering
+ /// (e.g., to only retrieve variables from a given context) should be done by
+ /// the consumer.
+ virtual void GetGlobalVariables(ConstString basename, DIEArray &offsets) = 0;
+
+ virtual void GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) = 0;
+ virtual void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) = 0;
+ virtual void GetObjCMethods(ConstString class_name, DIEArray &offsets) = 0;
+ virtual void GetCompleteObjCClass(ConstString class_name,
+ bool must_be_implementation,
+ DIEArray &offsets) = 0;
+ virtual void GetTypes(ConstString name, DIEArray &offsets) = 0;
+ virtual void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) = 0;
+ virtual void GetNamespaces(ConstString name, DIEArray &offsets) = 0;
+ virtual void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) = 0;
+ virtual void GetFunctions(const RegularExpression &regex,
+ DIEArray &offsets) = 0;
+
+ virtual void ReportInvalidDIEOffset(dw_offset_t offset,
+ llvm::StringRef name) = 0;
+ virtual void Dump(Stream &s) = 0;
+
+protected:
+ Module &m_module;
+
+ /// Helper function implementing common logic for processing function dies. If
+ /// the function given by "ref" matches search criteria given by
+ /// "parent_decl_ctx" and "name_type_mask", it is inserted into the "dies"
+ /// vector.
+ void ProcessFunctionDIE(llvm::StringRef name, DIERef ref,
+ DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask, std::vector<DWARFDIE> &dies);
+};
+} // namespace lldb_private
+
+#endif // LLDB_DWARFINDEX_H
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp b/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
new file mode 100644
index 000000000000..f44b2bb97b2b
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -0,0 +1,755 @@
+//===-- DWARFUnit.cpp -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "DWARFUnit.h"
+
+#include "lldb/Core/Module.h"
+#include "lldb/Host/StringConvert.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/LineTable.h"
+#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Utility/LLDBAssert.h"
+#include "lldb/Utility/StreamString.h"
+#include "lldb/Utility/Timer.h"
+
+#include "DWARFDIECollection.h"
+#include "DWARFDebugAranges.h"
+#include "DWARFDebugInfo.h"
+#include "LogChannelDWARF.h"
+#include "SymbolFileDWARFDebugMap.h"
+#include "SymbolFileDWARFDwo.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace std;
+
+extern int g_verbose;
+
+DWARFUnit::DWARFUnit(SymbolFileDWARF *dwarf)
+ : m_dwarf(dwarf), m_cancel_scopes(false) {}
+
+DWARFUnit::~DWARFUnit() {}
+
+//----------------------------------------------------------------------
+// Parses first DIE of a compile unit.
+//----------------------------------------------------------------------
+void DWARFUnit::ExtractUnitDIEIfNeeded() {
+ {
+ llvm::sys::ScopedReader lock(m_first_die_mutex);
+ if (m_first_die)
+ return; // Already parsed
+ }
+ llvm::sys::ScopedWriter lock(m_first_die_mutex);
+ if (m_first_die)
+ return; // Already parsed
+
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(
+ func_cat, "%8.8x: DWARFUnit::ExtractUnitDIEIfNeeded()", m_offset);
+
+ // Set the offset to that of the first DIE and calculate the start of the
+ // next compilation unit header.
+ lldb::offset_t offset = GetFirstDIEOffset();
+
+ // We are in our compile unit, parse starting at the offset we were told to
+ // parse
+ const DWARFDataExtractor &data = GetData();
+ DWARFFormValue::FixedFormSizes fixed_form_sizes =
+ DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
+ IsDWARF64());
+ if (offset < GetNextCompileUnitOffset() &&
+ m_first_die.FastExtract(data, this, fixed_form_sizes, &offset)) {
+ AddUnitDIE(m_first_die);
+ return;
+ }
+
+ ExtractDIEsEndCheck(offset);
+}
+
+//----------------------------------------------------------------------
+// Parses a compile unit and indexes its DIEs if it hasn't already been done.
+// It will leave this compile unit extracted forever.
+//----------------------------------------------------------------------
+void DWARFUnit::ExtractDIEsIfNeeded() {
+ m_cancel_scopes = true;
+
+ {
+ llvm::sys::ScopedReader lock(m_die_array_mutex);
+ if (!m_die_array.empty())
+ return; // Already parsed
+ }
+ llvm::sys::ScopedWriter lock(m_die_array_mutex);
+ if (!m_die_array.empty())
+ return; // Already parsed
+
+ ExtractDIEsRWLocked();
+}
+
+//----------------------------------------------------------------------
+// Parses a compile unit and indexes its DIEs if it hasn't already been done.
+// It will clear this compile unit after returned instance gets out of scope,
+// no other ScopedExtractDIEs instance is running for this compile unit
+// and no ExtractDIEsIfNeeded() has been executed during this ScopedExtractDIEs
+// lifetime.
+//----------------------------------------------------------------------
+DWARFUnit::ScopedExtractDIEs DWARFUnit::ExtractDIEsScoped() {
+ ScopedExtractDIEs scoped(this);
+
+ {
+ llvm::sys::ScopedReader lock(m_die_array_mutex);
+ if (!m_die_array.empty())
+ return scoped; // Already parsed
+ }
+ llvm::sys::ScopedWriter lock(m_die_array_mutex);
+ if (!m_die_array.empty())
+ return scoped; // Already parsed
+
+ // Otherwise m_die_array would be already populated.
+ lldbassert(!m_cancel_scopes);
+
+ ExtractDIEsRWLocked();
+ scoped.m_clear_dies = true;
+ return scoped;
+}
+
+DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs(DWARFUnit *cu) : m_cu(cu) {
+ lldbassert(m_cu);
+ m_cu->m_die_array_scoped_mutex.lock_shared();
+}
+
+DWARFUnit::ScopedExtractDIEs::~ScopedExtractDIEs() {
+ if (!m_cu)
+ return;
+ m_cu->m_die_array_scoped_mutex.unlock_shared();
+ if (!m_clear_dies || m_cu->m_cancel_scopes)
+ return;
+ // Be sure no other ScopedExtractDIEs is running anymore.
+ llvm::sys::ScopedWriter lock_scoped(m_cu->m_die_array_scoped_mutex);
+ llvm::sys::ScopedWriter lock(m_cu->m_die_array_mutex);
+ if (m_cu->m_cancel_scopes)
+ return;
+ m_cu->ClearDIEsRWLocked();
+}
+
+DWARFUnit::ScopedExtractDIEs::ScopedExtractDIEs(ScopedExtractDIEs &&rhs)
+ : m_cu(rhs.m_cu), m_clear_dies(rhs.m_clear_dies) {
+ rhs.m_cu = nullptr;
+}
+
+DWARFUnit::ScopedExtractDIEs &DWARFUnit::ScopedExtractDIEs::operator=(
+ DWARFUnit::ScopedExtractDIEs &&rhs) {
+ m_cu = rhs.m_cu;
+ rhs.m_cu = nullptr;
+ m_clear_dies = rhs.m_clear_dies;
+ return *this;
+}
+
+//----------------------------------------------------------------------
+// Parses a compile unit and indexes its DIEs, m_die_array_mutex must be
+// held R/W and m_die_array must be empty.
+//----------------------------------------------------------------------
+void DWARFUnit::ExtractDIEsRWLocked() {
+ llvm::sys::ScopedWriter first_die_lock(m_first_die_mutex);
+
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(
+ func_cat, "%8.8x: DWARFUnit::ExtractDIEsIfNeeded()", m_offset);
+
+ // Set the offset to that of the first DIE and calculate the start of the
+ // next compilation unit header.
+ lldb::offset_t offset = GetFirstDIEOffset();
+ lldb::offset_t next_cu_offset = GetNextCompileUnitOffset();
+
+ DWARFDebugInfoEntry die;
+ // Keep a flat array of the DIE for binary lookup by DIE offset
+ Log *log(
+ LogChannelDWARF::GetLogIfAny(DWARF_LOG_DEBUG_INFO | DWARF_LOG_LOOKUPS));
+ if (log) {
+ m_dwarf->GetObjectFile()->GetModule()->LogMessageVerboseBacktrace(
+ log,
+ "DWARFUnit::ExtractDIEsIfNeeded () for compile unit at "
+ ".debug_info[0x%8.8x]",
+ GetOffset());
+ }
+
+ uint32_t depth = 0;
+ // We are in our compile unit, parse starting at the offset we were told to
+ // parse
+ const DWARFDataExtractor &data = GetData();
+ std::vector<uint32_t> die_index_stack;
+ die_index_stack.reserve(32);
+ die_index_stack.push_back(0);
+ bool prev_die_had_children = false;
+ DWARFFormValue::FixedFormSizes fixed_form_sizes =
+ DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
+ IsDWARF64());
+ while (offset < next_cu_offset &&
+ die.FastExtract(data, this, fixed_form_sizes, &offset)) {
+ // if (log)
+ // log->Printf("0x%8.8x: %*.*s%s%s",
+ // die.GetOffset(),
+ // depth * 2, depth * 2, "",
+ // DW_TAG_value_to_name (die.Tag()),
+ // die.HasChildren() ? " *" : "");
+
+ const bool null_die = die.IsNULL();
+ if (depth == 0) {
+ assert(m_die_array.empty() && "Compile unit DIE already added");
+
+ // The average bytes per DIE entry has been seen to be around 14-20 so
+ // lets pre-reserve half of that since we are now stripping the NULL
+ // tags.
+
+ // Only reserve the memory if we are adding children of the main
+ // compile unit DIE. The compile unit DIE is always the first entry, so
+ // if our size is 1, then we are adding the first compile unit child
+ // DIE and should reserve the memory.
+ m_die_array.reserve(GetDebugInfoSize() / 24);
+ m_die_array.push_back(die);
+
+ if (!m_first_die)
+ AddUnitDIE(m_die_array.front());
+ } else {
+ if (null_die) {
+ if (prev_die_had_children) {
+ // This will only happen if a DIE says is has children but all it
+ // contains is a NULL tag. Since we are removing the NULL DIEs from
+ // the list (saves up to 25% in C++ code), we need a way to let the
+ // DIE know that it actually doesn't have children.
+ if (!m_die_array.empty())
+ m_die_array.back().SetEmptyChildren(true);
+ }
+ } else {
+ die.SetParentIndex(m_die_array.size() - die_index_stack[depth - 1]);
+
+ if (die_index_stack.back())
+ m_die_array[die_index_stack.back()].SetSiblingIndex(
+ m_die_array.size() - die_index_stack.back());
+
+ // Only push the DIE if it isn't a NULL DIE
+ m_die_array.push_back(die);
+ }
+ }
+
+ if (null_die) {
+ // NULL DIE.
+ if (!die_index_stack.empty())
+ die_index_stack.pop_back();
+
+ if (depth > 0)
+ --depth;
+ if (depth == 0)
+ break; // We are done with this compile unit!
+
+ prev_die_had_children = false;
+ } else {
+ die_index_stack.back() = m_die_array.size() - 1;
+ // Normal DIE
+ const bool die_has_children = die.HasChildren();
+ if (die_has_children) {
+ die_index_stack.push_back(0);
+ ++depth;
+ }
+ prev_die_had_children = die_has_children;
+ }
+ }
+
+ if (!m_die_array.empty()) {
+ lldbassert(!m_first_die || m_first_die == m_die_array.front());
+ m_first_die = m_die_array.front();
+ }
+
+ m_die_array.shrink_to_fit();
+
+ ExtractDIEsEndCheck(offset);
+
+ if (m_dwo_symbol_file) {
+ DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
+ dwo_cu->ExtractDIEsIfNeeded();
+ }
+}
+
+//--------------------------------------------------------------------------
+// Final checks for both ExtractUnitDIEIfNeeded() and ExtractDIEsIfNeeded().
+//--------------------------------------------------------------------------
+void DWARFUnit::ExtractDIEsEndCheck(lldb::offset_t offset) const {
+ // Give a little bit of info if we encounter corrupt DWARF (our offset should
+ // always terminate at or before the start of the next compilation unit
+ // header).
+ if (offset > GetNextCompileUnitOffset()) {
+ m_dwarf->GetObjectFile()->GetModule()->ReportWarning(
+ "DWARF compile unit extends beyond its bounds cu 0x%8.8x at "
+ "0x%8.8" PRIx64 "\n",
+ GetOffset(), offset);
+ }
+
+ Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO));
+ if (log && log->GetVerbose()) {
+ StreamString strm;
+ Dump(&strm);
+ if (m_die_array.empty())
+ strm.Printf("error: no DIE for compile unit");
+ else
+ m_die_array[0].Dump(m_dwarf, this, strm, UINT32_MAX);
+ log->PutString(strm.GetString());
+ }
+}
+
+// m_die_array_mutex must be already held as read/write.
+void DWARFUnit::AddUnitDIE(const DWARFDebugInfoEntry &cu_die) {
+ uint64_t base_addr = cu_die.GetAttributeValueAsAddress(
+ m_dwarf, this, DW_AT_low_pc, LLDB_INVALID_ADDRESS);
+ if (base_addr == LLDB_INVALID_ADDRESS)
+ base_addr = cu_die.GetAttributeValueAsAddress(
+ m_dwarf, this, DW_AT_entry_pc, 0);
+ SetBaseAddress(base_addr);
+
+ std::unique_ptr<SymbolFileDWARFDwo> dwo_symbol_file =
+ m_dwarf->GetDwoSymbolFileForCompileUnit(*this, cu_die);
+ if (!dwo_symbol_file)
+ return;
+
+ DWARFUnit *dwo_cu = dwo_symbol_file->GetCompileUnit();
+ if (!dwo_cu)
+ return; // Can't fetch the compile unit from the dwo file.
+
+ DWARFBaseDIE dwo_cu_die = dwo_cu->GetUnitDIEOnly();
+ if (!dwo_cu_die.IsValid())
+ return; // Can't fetch the compile unit DIE from the dwo file.
+
+ uint64_t main_dwo_id =
+ cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_GNU_dwo_id, 0);
+ uint64_t sub_dwo_id =
+ dwo_cu_die.GetAttributeValueAsUnsigned(DW_AT_GNU_dwo_id, 0);
+ if (main_dwo_id != sub_dwo_id)
+ return; // The 2 dwo ID isn't match. Don't use the dwo file as it belongs to
+ // a differectn compilation.
+
+ m_dwo_symbol_file = std::move(dwo_symbol_file);
+
+ dw_addr_t addr_base =
+ cu_die.GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_GNU_addr_base, 0);
+ dw_addr_t ranges_base = cu_die.GetAttributeValueAsUnsigned(
+ m_dwarf, this, DW_AT_GNU_ranges_base, 0);
+ dwo_cu->SetAddrBase(addr_base, ranges_base, m_offset);
+}
+
+DWARFDIE DWARFUnit::LookupAddress(const dw_addr_t address) {
+ if (DIE()) {
+ const DWARFDebugAranges &func_aranges = GetFunctionAranges();
+
+ // Re-check the aranges auto pointer contents in case it was created above
+ if (!func_aranges.IsEmpty())
+ return GetDIE(func_aranges.FindAddress(address));
+ }
+ return DWARFDIE();
+}
+
+size_t DWARFUnit::AppendDIEsWithTag(const dw_tag_t tag,
+ DWARFDIECollection &dies,
+ uint32_t depth) const {
+ size_t old_size = dies.Size();
+ {
+ llvm::sys::ScopedReader lock(m_die_array_mutex);
+ DWARFDebugInfoEntry::const_iterator pos;
+ DWARFDebugInfoEntry::const_iterator end = m_die_array.end();
+ for (pos = m_die_array.begin(); pos != end; ++pos) {
+ if (pos->Tag() == tag)
+ dies.Append(DWARFDIE(this, &(*pos)));
+ }
+ }
+
+ // Return the number of DIEs added to the collection
+ return dies.Size() - old_size;
+}
+
+
+lldb::user_id_t DWARFUnit::GetID() const {
+ dw_offset_t local_id =
+ m_base_obj_offset != DW_INVALID_OFFSET ? m_base_obj_offset : m_offset;
+ if (m_dwarf)
+ return DIERef(local_id, local_id).GetUID(m_dwarf);
+ else
+ return local_id;
+}
+
+dw_offset_t DWARFUnit::GetNextCompileUnitOffset() const {
+ return m_offset + GetLengthByteSize() + GetLength();
+}
+
+size_t DWARFUnit::GetDebugInfoSize() const {
+ return GetLengthByteSize() + GetLength() - GetHeaderByteSize();
+}
+
+const DWARFAbbreviationDeclarationSet *DWARFUnit::GetAbbreviations() const {
+ return m_abbrevs;
+}
+
+dw_offset_t DWARFUnit::GetAbbrevOffset() const {
+ return m_abbrevs ? m_abbrevs->GetOffset() : DW_INVALID_OFFSET;
+}
+
+void DWARFUnit::SetAddrBase(dw_addr_t addr_base,
+ dw_addr_t ranges_base,
+ dw_offset_t base_obj_offset) {
+ m_addr_base = addr_base;
+ m_ranges_base = ranges_base;
+ m_base_obj_offset = base_obj_offset;
+}
+
+// It may be called only with m_die_array_mutex held R/W.
+void DWARFUnit::ClearDIEsRWLocked() {
+ m_die_array.clear();
+ m_die_array.shrink_to_fit();
+
+ if (m_dwo_symbol_file)
+ m_dwo_symbol_file->GetCompileUnit()->ClearDIEsRWLocked();
+}
+
+void DWARFUnit::BuildAddressRangeTable(SymbolFileDWARF *dwarf,
+ DWARFDebugAranges *debug_aranges) {
+ // This function is usually called if there in no .debug_aranges section in
+ // order to produce a compile unit level set of address ranges that is
+ // accurate.
+
+ size_t num_debug_aranges = debug_aranges->GetNumRanges();
+
+ // First get the compile unit DIE only and check if it has a DW_AT_ranges
+ const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
+
+ const dw_offset_t cu_offset = GetOffset();
+ if (die) {
+ DWARFRangeList ranges;
+ const size_t num_ranges =
+ die->GetAttributeAddressRanges(dwarf, this, ranges, false);
+ if (num_ranges > 0) {
+ // This compile unit has DW_AT_ranges, assume this is correct if it is
+ // present since clang no longer makes .debug_aranges by default and it
+ // emits DW_AT_ranges for DW_TAG_compile_units. GCC also does this with
+ // recent GCC builds.
+ for (size_t i = 0; i < num_ranges; ++i) {
+ const DWARFRangeList::Entry &range = ranges.GetEntryRef(i);
+ debug_aranges->AppendRange(cu_offset, range.GetRangeBase(),
+ range.GetRangeEnd());
+ }
+
+ return; // We got all of our ranges from the DW_AT_ranges attribute
+ }
+ }
+ // We don't have a DW_AT_ranges attribute, so we need to parse the DWARF
+
+ // If the DIEs weren't parsed, then we don't want all dies for all compile
+ // units to stay loaded when they weren't needed. So we can end up parsing
+ // the DWARF and then throwing them all away to keep memory usage down.
+ ScopedExtractDIEs clear_dies(ExtractDIEsScoped());
+
+ die = DIEPtr();
+ if (die)
+ die->BuildAddressRangeTable(dwarf, this, debug_aranges);
+
+ if (debug_aranges->GetNumRanges() == num_debug_aranges) {
+ // We got nothing from the functions, maybe we have a line tables only
+ // situation. Check the line tables and build the arange table from this.
+ SymbolContext sc;
+ sc.comp_unit = dwarf->GetCompUnitForDWARFCompUnit(this);
+ if (sc.comp_unit) {
+ SymbolFileDWARFDebugMap *debug_map_sym_file =
+ m_dwarf->GetDebugMapSymfile();
+ if (debug_map_sym_file == NULL) {
+ LineTable *line_table = sc.comp_unit->GetLineTable();
+
+ if (line_table) {
+ LineTable::FileAddressRanges file_ranges;
+ const bool append = true;
+ const size_t num_ranges =
+ line_table->GetContiguousFileAddressRanges(file_ranges, append);
+ for (uint32_t idx = 0; idx < num_ranges; ++idx) {
+ const LineTable::FileAddressRanges::Entry &range =
+ file_ranges.GetEntryRef(idx);
+ debug_aranges->AppendRange(cu_offset, range.GetRangeBase(),
+ range.GetRangeEnd());
+ }
+ }
+ } else
+ debug_map_sym_file->AddOSOARanges(dwarf, debug_aranges);
+ }
+ }
+
+ if (debug_aranges->GetNumRanges() == num_debug_aranges) {
+ // We got nothing from the functions, maybe we have a line tables only
+ // situation. Check the line tables and build the arange table from this.
+ SymbolContext sc;
+ sc.comp_unit = dwarf->GetCompUnitForDWARFCompUnit(this);
+ if (sc.comp_unit) {
+ LineTable *line_table = sc.comp_unit->GetLineTable();
+
+ if (line_table) {
+ LineTable::FileAddressRanges file_ranges;
+ const bool append = true;
+ const size_t num_ranges =
+ line_table->GetContiguousFileAddressRanges(file_ranges, append);
+ for (uint32_t idx = 0; idx < num_ranges; ++idx) {
+ const LineTable::FileAddressRanges::Entry &range =
+ file_ranges.GetEntryRef(idx);
+ debug_aranges->AppendRange(GetOffset(), range.GetRangeBase(),
+ range.GetRangeEnd());
+ }
+ }
+ }
+ }
+}
+
+lldb::ByteOrder DWARFUnit::GetByteOrder() const {
+ return m_dwarf->GetObjectFile()->GetByteOrder();
+}
+
+TypeSystem *DWARFUnit::GetTypeSystem() {
+ if (m_dwarf)
+ return m_dwarf->GetTypeSystemForLanguage(GetLanguageType());
+ else
+ return nullptr;
+}
+
+DWARFFormValue::FixedFormSizes DWARFUnit::GetFixedFormSizes() {
+ return DWARFFormValue::GetFixedFormSizesForAddressSize(GetAddressByteSize(),
+ IsDWARF64());
+}
+
+void DWARFUnit::SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; }
+
+//----------------------------------------------------------------------
+// Compare function DWARFDebugAranges::Range structures
+//----------------------------------------------------------------------
+static bool CompareDIEOffset(const DWARFDebugInfoEntry &die,
+ const dw_offset_t die_offset) {
+ return die.GetOffset() < die_offset;
+}
+
+//----------------------------------------------------------------------
+// GetDIE()
+//
+// Get the DIE (Debug Information Entry) with the specified offset by first
+// checking if the DIE is contained within this compile unit and grabbing the
+// DIE from this compile unit. Otherwise we grab the DIE from the DWARF file.
+//----------------------------------------------------------------------
+DWARFDIE
+DWARFUnit::GetDIE(dw_offset_t die_offset) {
+ if (die_offset != DW_INVALID_OFFSET) {
+ if (GetDwoSymbolFile())
+ return GetDwoSymbolFile()->GetCompileUnit()->GetDIE(die_offset);
+
+ if (ContainsDIEOffset(die_offset)) {
+ ExtractDIEsIfNeeded();
+ DWARFDebugInfoEntry::const_iterator end = m_die_array.cend();
+ DWARFDebugInfoEntry::const_iterator pos =
+ lower_bound(m_die_array.cbegin(), end, die_offset, CompareDIEOffset);
+ if (pos != end) {
+ if (die_offset == (*pos).GetOffset())
+ return DWARFDIE(this, &(*pos));
+ }
+ } else {
+ // Don't specify the compile unit offset as we don't know it because the
+ // DIE belongs to
+ // a different compile unit in the same symbol file.
+ return m_dwarf->DebugInfo()->GetDIEForDIEOffset(die_offset);
+ }
+ }
+ return DWARFDIE(); // Not found
+}
+
+uint8_t DWARFUnit::GetAddressByteSize(const DWARFUnit *cu) {
+ if (cu)
+ return cu->GetAddressByteSize();
+ return DWARFUnit::GetDefaultAddressSize();
+}
+
+bool DWARFUnit::IsDWARF64(const DWARFUnit *cu) {
+ if (cu)
+ return cu->IsDWARF64();
+ return false;
+}
+
+uint8_t DWARFUnit::GetDefaultAddressSize() { return 4; }
+
+void *DWARFUnit::GetUserData() const { return m_user_data; }
+
+void DWARFUnit::SetUserData(void *d) {
+ m_user_data = d;
+ if (m_dwo_symbol_file)
+ m_dwo_symbol_file->GetCompileUnit()->SetUserData(d);
+}
+
+bool DWARFUnit::Supports_DW_AT_APPLE_objc_complete_type() {
+ if (GetProducer() == eProducerLLVMGCC)
+ return false;
+ return true;
+}
+
+bool DWARFUnit::DW_AT_decl_file_attributes_are_invalid() {
+ // llvm-gcc makes completely invalid decl file attributes and won't ever be
+ // fixed, so we need to know to ignore these.
+ return GetProducer() == eProducerLLVMGCC;
+}
+
+bool DWARFUnit::Supports_unnamed_objc_bitfields() {
+ if (GetProducer() == eProducerClang) {
+ const uint32_t major_version = GetProducerVersionMajor();
+ if (major_version > 425 ||
+ (major_version == 425 && GetProducerVersionUpdate() >= 13))
+ return true;
+ else
+ return false;
+ }
+ return true; // Assume all other compilers didn't have incorrect ObjC bitfield
+ // info
+}
+
+SymbolFileDWARF *DWARFUnit::GetSymbolFileDWARF() const { return m_dwarf; }
+
+void DWARFUnit::ParseProducerInfo() {
+ m_producer_version_major = UINT32_MAX;
+ m_producer_version_minor = UINT32_MAX;
+ m_producer_version_update = UINT32_MAX;
+
+ const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
+ if (die) {
+
+ const char *producer_cstr =
+ die->GetAttributeValueAsString(m_dwarf, this, DW_AT_producer, NULL);
+ if (producer_cstr) {
+ RegularExpression llvm_gcc_regex(
+ llvm::StringRef("^4\\.[012]\\.[01] \\(Based on Apple "
+ "Inc\\. build [0-9]+\\) \\(LLVM build "
+ "[\\.0-9]+\\)$"));
+ if (llvm_gcc_regex.Execute(llvm::StringRef(producer_cstr))) {
+ m_producer = eProducerLLVMGCC;
+ } else if (strstr(producer_cstr, "clang")) {
+ static RegularExpression g_clang_version_regex(
+ llvm::StringRef("clang-([0-9]+)\\.([0-9]+)\\.([0-9]+)"));
+ RegularExpression::Match regex_match(3);
+ if (g_clang_version_regex.Execute(llvm::StringRef(producer_cstr),
+ &regex_match)) {
+ std::string str;
+ if (regex_match.GetMatchAtIndex(producer_cstr, 1, str))
+ m_producer_version_major =
+ StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
+ if (regex_match.GetMatchAtIndex(producer_cstr, 2, str))
+ m_producer_version_minor =
+ StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
+ if (regex_match.GetMatchAtIndex(producer_cstr, 3, str))
+ m_producer_version_update =
+ StringConvert::ToUInt32(str.c_str(), UINT32_MAX, 10);
+ }
+ m_producer = eProducerClang;
+ } else if (strstr(producer_cstr, "GNU"))
+ m_producer = eProducerGCC;
+ }
+ }
+ if (m_producer == eProducerInvalid)
+ m_producer = eProcucerOther;
+}
+
+DWARFProducer DWARFUnit::GetProducer() {
+ if (m_producer == eProducerInvalid)
+ ParseProducerInfo();
+ return m_producer;
+}
+
+uint32_t DWARFUnit::GetProducerVersionMajor() {
+ if (m_producer_version_major == 0)
+ ParseProducerInfo();
+ return m_producer_version_major;
+}
+
+uint32_t DWARFUnit::GetProducerVersionMinor() {
+ if (m_producer_version_minor == 0)
+ ParseProducerInfo();
+ return m_producer_version_minor;
+}
+
+uint32_t DWARFUnit::GetProducerVersionUpdate() {
+ if (m_producer_version_update == 0)
+ ParseProducerInfo();
+ return m_producer_version_update;
+}
+LanguageType DWARFUnit::LanguageTypeFromDWARF(uint64_t val) {
+ // Note: user languages between lo_user and hi_user must be handled
+ // explicitly here.
+ switch (val) {
+ case DW_LANG_Mips_Assembler:
+ return eLanguageTypeMipsAssembler;
+ case DW_LANG_GOOGLE_RenderScript:
+ return eLanguageTypeExtRenderScript;
+ default:
+ return static_cast<LanguageType>(val);
+ }
+}
+
+LanguageType DWARFUnit::GetLanguageType() {
+ if (m_language_type != eLanguageTypeUnknown)
+ return m_language_type;
+
+ const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
+ if (die)
+ m_language_type = LanguageTypeFromDWARF(
+ die->GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_language, 0));
+ return m_language_type;
+}
+
+bool DWARFUnit::GetIsOptimized() {
+ if (m_is_optimized == eLazyBoolCalculate) {
+ const DWARFDebugInfoEntry *die = GetUnitDIEPtrOnly();
+ if (die) {
+ m_is_optimized = eLazyBoolNo;
+ if (die->GetAttributeValueAsUnsigned(m_dwarf, this, DW_AT_APPLE_optimized,
+ 0) == 1) {
+ m_is_optimized = eLazyBoolYes;
+ }
+ }
+ }
+ return m_is_optimized == eLazyBoolYes;
+}
+
+SymbolFileDWARFDwo *DWARFUnit::GetDwoSymbolFile() const {
+ return m_dwo_symbol_file.get();
+}
+
+dw_offset_t DWARFUnit::GetBaseObjOffset() const { return m_base_obj_offset; }
+
+const DWARFDebugAranges &DWARFUnit::GetFunctionAranges() {
+ if (m_func_aranges_ap.get() == NULL) {
+ m_func_aranges_ap.reset(new DWARFDebugAranges());
+ Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_ARANGES));
+
+ if (log) {
+ m_dwarf->GetObjectFile()->GetModule()->LogMessage(
+ log,
+ "DWARFUnit::GetFunctionAranges() for compile unit at "
+ ".debug_info[0x%8.8x]",
+ GetOffset());
+ }
+ const DWARFDebugInfoEntry *die = DIEPtr();
+ if (die)
+ die->BuildFunctionAddressRangeTable(m_dwarf, this,
+ m_func_aranges_ap.get());
+
+ if (m_dwo_symbol_file) {
+ DWARFUnit *dwo_cu = m_dwo_symbol_file->GetCompileUnit();
+ const DWARFDebugInfoEntry *dwo_die = dwo_cu->DIEPtr();
+ if (dwo_die)
+ dwo_die->BuildFunctionAddressRangeTable(m_dwo_symbol_file.get(), dwo_cu,
+ m_func_aranges_ap.get());
+ }
+
+ const bool minimize = false;
+ m_func_aranges_ap->Sort(minimize);
+ }
+ return *m_func_aranges_ap.get();
+}
+
diff --git a/source/Plugins/SymbolFile/DWARF/DWARFUnit.h b/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
new file mode 100644
index 000000000000..c9e48c538bc1
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -0,0 +1,252 @@
+//===-- DWARFUnit.h ---------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SymbolFileDWARF_DWARFUnit_h_
+#define SymbolFileDWARF_DWARFUnit_h_
+
+#include "DWARFDIE.h"
+#include "DWARFDebugInfoEntry.h"
+#include "lldb/lldb-enumerations.h"
+#include "llvm/Support/RWMutex.h"
+#include <atomic>
+
+class DWARFUnit;
+class DWARFCompileUnit;
+class NameToDIE;
+class SymbolFileDWARF;
+class SymbolFileDWARFDwo;
+
+typedef std::shared_ptr<DWARFUnit> DWARFUnitSP;
+
+enum DWARFProducer {
+ eProducerInvalid = 0,
+ eProducerClang,
+ eProducerGCC,
+ eProducerLLVMGCC,
+ eProcucerOther
+};
+
+class DWARFUnit {
+ friend class DWARFCompileUnit;
+
+ using die_iterator_range =
+ llvm::iterator_range<DWARFDebugInfoEntry::collection::iterator>;
+
+public:
+ virtual ~DWARFUnit();
+
+ void ExtractUnitDIEIfNeeded();
+ void ExtractDIEsIfNeeded();
+
+ class ScopedExtractDIEs {
+ DWARFUnit *m_cu;
+ public:
+ bool m_clear_dies = false;
+ ScopedExtractDIEs(DWARFUnit *cu);
+ ~ScopedExtractDIEs();
+ DISALLOW_COPY_AND_ASSIGN(ScopedExtractDIEs);
+ ScopedExtractDIEs(ScopedExtractDIEs &&rhs);
+ ScopedExtractDIEs &operator=(ScopedExtractDIEs &&rhs);
+ };
+ ScopedExtractDIEs ExtractDIEsScoped();
+
+ DWARFDIE LookupAddress(const dw_addr_t address);
+ size_t AppendDIEsWithTag(const dw_tag_t tag,
+ DWARFDIECollection &matching_dies,
+ uint32_t depth = UINT32_MAX) const;
+ bool Verify(lldb_private::Stream *s) const;
+ virtual void Dump(lldb_private::Stream *s) const = 0;
+ //------------------------------------------------------------------
+ /// Get the data that contains the DIE information for this unit.
+ ///
+ /// This will return the correct bytes that contain the data for
+ /// this DWARFUnit. It could be .debug_info or .debug_types
+ /// depending on where the data for this unit originates.
+ ///
+ /// @return
+ /// The correct data for the DIE information in this unit.
+ //------------------------------------------------------------------
+ virtual const lldb_private::DWARFDataExtractor &GetData() const = 0;
+ //------------------------------------------------------------------
+ /// Get the size in bytes of the compile unit header.
+ ///
+ /// @return
+ /// Byte size of the compile unit header
+ //------------------------------------------------------------------
+ virtual uint32_t GetHeaderByteSize() const = 0;
+ // Offset of the initial length field.
+ dw_offset_t GetOffset() const { return m_offset; }
+ lldb::user_id_t GetID() const;
+ //------------------------------------------------------------------
+ /// Get the size in bytes of the length field in the header.
+ ///
+ /// In DWARF32 this is just 4 bytes, and DWARF64 it is 12 where 4
+ /// are 0xFFFFFFFF followed by the actual 64 bit length.
+ ///
+ /// @return
+ /// Byte size of the compile unit header length field
+ //------------------------------------------------------------------
+ size_t GetLengthByteSize() const { return IsDWARF64() ? 12 : 4; }
+
+ bool ContainsDIEOffset(dw_offset_t die_offset) const {
+ return die_offset >= GetFirstDIEOffset() &&
+ die_offset < GetNextCompileUnitOffset();
+ }
+ dw_offset_t GetFirstDIEOffset() const {
+ return m_offset + GetHeaderByteSize();
+ }
+ dw_offset_t GetNextCompileUnitOffset() const;
+ // Size of the CU data (without initial length and without header).
+ size_t GetDebugInfoSize() const;
+ // Size of the CU data incl. header but without initial length.
+ uint32_t GetLength() const { return m_length; }
+ uint16_t GetVersion() const { return m_version; }
+ const DWARFAbbreviationDeclarationSet *GetAbbreviations() const;
+ dw_offset_t GetAbbrevOffset() const;
+ uint8_t GetAddressByteSize() const { return m_addr_size; }
+ dw_addr_t GetBaseAddress() const { return m_base_addr; }
+ dw_addr_t GetAddrBase() const { return m_addr_base; }
+ dw_addr_t GetRangesBase() const { return m_ranges_base; }
+ void SetAddrBase(dw_addr_t addr_base, dw_addr_t ranges_base,
+ dw_offset_t base_obj_offset);
+ void BuildAddressRangeTable(SymbolFileDWARF *dwarf,
+ DWARFDebugAranges *debug_aranges);
+
+ lldb::ByteOrder GetByteOrder() const;
+
+ lldb_private::TypeSystem *GetTypeSystem();
+
+ const DWARFDebugAranges &GetFunctionAranges();
+
+ DWARFFormValue::FixedFormSizes GetFixedFormSizes();
+
+ void SetBaseAddress(dw_addr_t base_addr);
+
+ DWARFBaseDIE GetUnitDIEOnly() { return DWARFDIE(this, GetUnitDIEPtrOnly()); }
+
+ DWARFDIE DIE() { return DWARFDIE(this, DIEPtr()); }
+
+ DWARFDIE GetDIE(dw_offset_t die_offset);
+
+ static uint8_t GetAddressByteSize(const DWARFUnit *cu);
+
+ static bool IsDWARF64(const DWARFUnit *cu);
+
+ static uint8_t GetDefaultAddressSize();
+
+ void *GetUserData() const;
+
+ void SetUserData(void *d);
+
+ bool Supports_DW_AT_APPLE_objc_complete_type();
+
+ bool DW_AT_decl_file_attributes_are_invalid();
+
+ bool Supports_unnamed_objc_bitfields();
+
+ SymbolFileDWARF *GetSymbolFileDWARF() const;
+
+ DWARFProducer GetProducer();
+
+ uint32_t GetProducerVersionMajor();
+
+ uint32_t GetProducerVersionMinor();
+
+ uint32_t GetProducerVersionUpdate();
+
+ static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val);
+
+ lldb::LanguageType GetLanguageType();
+
+ bool IsDWARF64() const { return m_is_dwarf64; }
+
+ bool GetIsOptimized();
+
+ SymbolFileDWARFDwo *GetDwoSymbolFile() const;
+
+ dw_offset_t GetBaseObjOffset() const;
+
+ die_iterator_range dies() {
+ ExtractDIEsIfNeeded();
+ return die_iterator_range(m_die_array.begin(), m_die_array.end());
+ }
+
+protected:
+ DWARFUnit(SymbolFileDWARF *dwarf);
+
+ SymbolFileDWARF *m_dwarf = nullptr;
+ std::unique_ptr<SymbolFileDWARFDwo> m_dwo_symbol_file;
+ const DWARFAbbreviationDeclarationSet *m_abbrevs = nullptr;
+ void *m_user_data = nullptr;
+ // The compile unit debug information entry item
+ DWARFDebugInfoEntry::collection m_die_array;
+ mutable llvm::sys::RWMutex m_die_array_mutex;
+ // It is used for tracking of ScopedExtractDIEs instances.
+ mutable llvm::sys::RWMutex m_die_array_scoped_mutex;
+ // ScopedExtractDIEs instances should not call ClearDIEsRWLocked()
+ // as someone called ExtractDIEsIfNeeded().
+ std::atomic<bool> m_cancel_scopes;
+ // GetUnitDIEPtrOnly() needs to return pointer to the first DIE.
+ // But the first element of m_die_array after ExtractUnitDIEIfNeeded()
+ // would possibly move in memory after later ExtractDIEsIfNeeded().
+ DWARFDebugInfoEntry m_first_die;
+ llvm::sys::RWMutex m_first_die_mutex;
+ // A table similar to the .debug_aranges table, but this one points to the
+ // exact DW_TAG_subprogram DIEs
+ std::unique_ptr<DWARFDebugAranges> m_func_aranges_ap;
+ dw_addr_t m_base_addr = 0;
+ dw_offset_t m_length = 0;
+ uint16_t m_version = 0;
+ uint8_t m_addr_size = 0;
+ DWARFProducer m_producer = eProducerInvalid;
+ uint32_t m_producer_version_major = 0;
+ uint32_t m_producer_version_minor = 0;
+ uint32_t m_producer_version_update = 0;
+ lldb::LanguageType m_language_type = lldb::eLanguageTypeUnknown;
+ bool m_is_dwarf64 = false;
+ lldb_private::LazyBool m_is_optimized = lldb_private::eLazyBoolCalculate;
+ dw_addr_t m_addr_base = 0; // Value of DW_AT_addr_base
+ dw_addr_t m_ranges_base = 0; // Value of DW_AT_ranges_base
+ // If this is a dwo compile unit this is the offset of the base compile unit
+ // in the main object file
+ dw_offset_t m_base_obj_offset = DW_INVALID_OFFSET;
+
+ // Offset of the initial length field.
+ dw_offset_t m_offset;
+
+private:
+ void ParseProducerInfo();
+ void ExtractDIEsRWLocked();
+ void ClearDIEsRWLocked();
+
+ // Get the DWARF unit DWARF debug informration entry. Parse the single DIE
+ // if needed.
+ const DWARFDebugInfoEntry *GetUnitDIEPtrOnly() {
+ ExtractUnitDIEIfNeeded();
+ // m_first_die_mutex is not required as m_first_die is never cleared.
+ if (!m_first_die)
+ return NULL;
+ return &m_first_die;
+ }
+
+ // Get all DWARF debug informration entries. Parse all DIEs if needed.
+ const DWARFDebugInfoEntry *DIEPtr() {
+ ExtractDIEsIfNeeded();
+ if (m_die_array.empty())
+ return NULL;
+ return &m_die_array[0];
+ }
+
+ void AddUnitDIE(const DWARFDebugInfoEntry &cu_die);
+ void ExtractDIEsEndCheck(lldb::offset_t offset) const;
+
+ DISALLOW_COPY_AND_ASSIGN(DWARFUnit);
+};
+
+#endif // SymbolFileDWARF_DWARFUnit_h_
diff --git a/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp b/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
new file mode 100644
index 000000000000..614ff470d161
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -0,0 +1,272 @@
+//===-- DebugNamesDWARFIndex.cpp -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
+#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h"
+#include "lldb/Utility/RegularExpression.h"
+#include "lldb/Utility/Stream.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+static llvm::DWARFDataExtractor ToLLVM(const DWARFDataExtractor &data) {
+ return llvm::DWARFDataExtractor(
+ llvm::StringRef(reinterpret_cast<const char *>(data.GetDataStart()),
+ data.GetByteSize()),
+ data.GetByteOrder() == eByteOrderLittle, data.GetAddressByteSize());
+}
+
+llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>>
+DebugNamesDWARFIndex::Create(Module &module, DWARFDataExtractor debug_names,
+ DWARFDataExtractor debug_str,
+ DWARFDebugInfo *debug_info) {
+ if (!debug_info) {
+ return llvm::make_error<llvm::StringError>("debug info null",
+ llvm::inconvertibleErrorCode());
+ }
+ auto index_up =
+ llvm::make_unique<DebugNames>(ToLLVM(debug_names), ToLLVM(debug_str));
+ if (llvm::Error E = index_up->extract())
+ return std::move(E);
+
+ return std::unique_ptr<DebugNamesDWARFIndex>(new DebugNamesDWARFIndex(
+ module, std::move(index_up), debug_names, debug_str, *debug_info));
+}
+
+llvm::DenseSet<dw_offset_t>
+DebugNamesDWARFIndex::GetUnits(const DebugNames &debug_names) {
+ llvm::DenseSet<dw_offset_t> result;
+ for (const DebugNames::NameIndex &ni : debug_names) {
+ for (uint32_t cu = 0; cu < ni.getCUCount(); ++cu)
+ result.insert(ni.getCUOffset(cu));
+ }
+ return result;
+}
+
+DIERef DebugNamesDWARFIndex::ToDIERef(const DebugNames::Entry &entry) {
+ llvm::Optional<uint64_t> cu_offset = entry.getCUOffset();
+ if (!cu_offset)
+ return DIERef();
+
+ DWARFUnit *cu = m_debug_info.GetCompileUnit(*cu_offset);
+ if (!cu)
+ return DIERef();
+
+ // This initializes the DWO symbol file. It's not possible for
+ // GetDwoSymbolFile to call this automatically because of mutual recursion
+ // between this and DWARFDebugInfoEntry::GetAttributeValue.
+ cu->ExtractUnitDIEIfNeeded();
+ uint64_t die_bias = cu->GetDwoSymbolFile() ? 0 : *cu_offset;
+
+ if (llvm::Optional<uint64_t> die_offset = entry.getDIEUnitOffset())
+ return DIERef(*cu_offset, die_bias + *die_offset);
+
+ return DIERef();
+}
+
+void DebugNamesDWARFIndex::Append(const DebugNames::Entry &entry,
+ DIEArray &offsets) {
+ if (DIERef ref = ToDIERef(entry))
+ offsets.push_back(ref);
+}
+
+void DebugNamesDWARFIndex::MaybeLogLookupError(llvm::Error error,
+ const DebugNames::NameIndex &ni,
+ llvm::StringRef name) {
+ // Ignore SentinelErrors, log everything else.
+ LLDB_LOG_ERROR(
+ LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS),
+ handleErrors(std::move(error), [](const DebugNames::SentinelError &) {}),
+ "Failed to parse index entries for index at {1:x}, name {2}: {0}",
+ ni.getUnitOffset(), name);
+}
+
+void DebugNamesDWARFIndex::GetGlobalVariables(ConstString basename,
+ DIEArray &offsets) {
+ m_fallback.GetGlobalVariables(basename, offsets);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(basename.GetStringRef())) {
+ if (entry.tag() != DW_TAG_variable)
+ continue;
+
+ Append(entry, offsets);
+ }
+}
+
+void DebugNamesDWARFIndex::GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) {
+ m_fallback.GetGlobalVariables(regex, offsets);
+
+ for (const DebugNames::NameIndex &ni: *m_debug_names_up) {
+ for (DebugNames::NameTableEntry nte: ni) {
+ if (!regex.Execute(nte.getString()))
+ continue;
+
+ uint32_t entry_offset = nte.getEntryOffset();
+ llvm::Expected<DebugNames::Entry> entry_or = ni.getEntry(&entry_offset);
+ for (; entry_or; entry_or = ni.getEntry(&entry_offset)) {
+ if (entry_or->tag() != DW_TAG_variable)
+ continue;
+
+ Append(*entry_or, offsets);
+ }
+ MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
+ }
+ }
+}
+
+void DebugNamesDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
+ DIEArray &offsets) {
+ m_fallback.GetGlobalVariables(cu, offsets);
+
+ uint64_t cu_offset = cu.GetOffset();
+ for (const DebugNames::NameIndex &ni: *m_debug_names_up) {
+ for (DebugNames::NameTableEntry nte: ni) {
+ uint32_t entry_offset = nte.getEntryOffset();
+ llvm::Expected<DebugNames::Entry> entry_or = ni.getEntry(&entry_offset);
+ for (; entry_or; entry_or = ni.getEntry(&entry_offset)) {
+ if (entry_or->tag() != DW_TAG_variable)
+ continue;
+ if (entry_or->getCUOffset() != cu_offset)
+ continue;
+
+ Append(*entry_or, offsets);
+ }
+ MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
+ }
+ }
+}
+
+void DebugNamesDWARFIndex::GetCompleteObjCClass(ConstString class_name,
+ bool must_be_implementation,
+ DIEArray &offsets) {
+ m_fallback.GetCompleteObjCClass(class_name, must_be_implementation, offsets);
+
+ // Keep a list of incomplete types as fallback for when we don't find the
+ // complete type.
+ DIEArray incomplete_types;
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(class_name.GetStringRef())) {
+ if (entry.tag() != DW_TAG_structure_type &&
+ entry.tag() != DW_TAG_class_type)
+ continue;
+
+ DIERef ref = ToDIERef(entry);
+ if (!ref)
+ continue;
+
+ DWARFUnit *cu = m_debug_info.GetCompileUnit(ref.cu_offset);
+ if (!cu || !cu->Supports_DW_AT_APPLE_objc_complete_type()) {
+ incomplete_types.push_back(ref);
+ continue;
+ }
+
+ // FIXME: We should return DWARFDIEs so we don't have to resolve it twice.
+ DWARFDIE die = m_debug_info.GetDIE(ref);
+ if (!die)
+ continue;
+
+ if (die.GetAttributeValueAsUnsigned(DW_AT_APPLE_objc_complete_type, 0)) {
+ // If we find the complete version we're done.
+ offsets.push_back(ref);
+ return;
+ } else {
+ incomplete_types.push_back(ref);
+ }
+ }
+
+ offsets.insert(offsets.end(), incomplete_types.begin(),
+ incomplete_types.end());
+}
+
+void DebugNamesDWARFIndex::GetTypes(ConstString name, DIEArray &offsets) {
+ m_fallback.GetTypes(name, offsets);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(name.GetStringRef())) {
+ if (isType(entry.tag()))
+ Append(entry, offsets);
+ }
+}
+
+void DebugNamesDWARFIndex::GetTypes(const DWARFDeclContext &context,
+ DIEArray &offsets) {
+ m_fallback.GetTypes(context, offsets);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(context[0].name)) {
+ if (entry.tag() == context[0].tag)
+ Append(entry, offsets);
+ }
+}
+
+void DebugNamesDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
+ m_fallback.GetNamespaces(name, offsets);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(name.GetStringRef())) {
+ if (entry.tag() == DW_TAG_namespace)
+ Append(entry, offsets);
+ }
+}
+
+void DebugNamesDWARFIndex::GetFunctions(
+ ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx, uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) {
+
+ m_fallback.GetFunctions(name, info, parent_decl_ctx, name_type_mask, dies);
+
+ for (const DebugNames::Entry &entry :
+ m_debug_names_up->equal_range(name.GetStringRef())) {
+ Tag tag = entry.tag();
+ if (tag != DW_TAG_subprogram && tag != DW_TAG_inlined_subroutine)
+ continue;
+
+ if (DIERef ref = ToDIERef(entry))
+ ProcessFunctionDIE(name.GetStringRef(), ref, info, parent_decl_ctx,
+ name_type_mask, dies);
+ }
+}
+
+void DebugNamesDWARFIndex::GetFunctions(const RegularExpression &regex,
+ DIEArray &offsets) {
+ m_fallback.GetFunctions(regex, offsets);
+
+ for (const DebugNames::NameIndex &ni: *m_debug_names_up) {
+ for (DebugNames::NameTableEntry nte: ni) {
+ if (!regex.Execute(nte.getString()))
+ continue;
+
+ uint32_t entry_offset = nte.getEntryOffset();
+ llvm::Expected<DebugNames::Entry> entry_or = ni.getEntry(&entry_offset);
+ for (; entry_or; entry_or = ni.getEntry(&entry_offset)) {
+ Tag tag = entry_or->tag();
+ if (tag != DW_TAG_subprogram && tag != DW_TAG_inlined_subroutine)
+ continue;
+
+ Append(*entry_or, offsets);
+ }
+ MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
+ }
+ }
+}
+
+void DebugNamesDWARFIndex::Dump(Stream &s) {
+ m_fallback.Dump(s);
+
+ std::string data;
+ llvm::raw_string_ostream os(data);
+ m_debug_names_up->dump(os);
+ s.PutCString(os.str());
+}
diff --git a/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h b/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
new file mode 100644
index 000000000000..30423c7ca2a2
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
@@ -0,0 +1,83 @@
+//===-- DebugNamesDWARFIndex.h ---------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_DEBUGNAMESDWARFINDEX_H
+#define LLDB_DEBUGNAMESDWARFINDEX_H
+
+#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h"
+#include "Plugins/SymbolFile/DWARF/ManualDWARFIndex.h"
+#include "lldb/Utility/ConstString.h"
+#include "llvm/DebugInfo/DWARF/DWARFAcceleratorTable.h"
+
+namespace lldb_private {
+class DebugNamesDWARFIndex : public DWARFIndex {
+public:
+ static llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>>
+ Create(Module &module, DWARFDataExtractor debug_names,
+ DWARFDataExtractor debug_str, DWARFDebugInfo *debug_info);
+
+ void Preload() override { m_fallback.Preload(); }
+
+ void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
+ void GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) override;
+ void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
+ void GetObjCMethods(ConstString class_name, DIEArray &offsets) override {}
+ void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
+ DIEArray &offsets) override;
+ void GetTypes(ConstString name, DIEArray &offsets) override;
+ void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
+ void GetNamespaces(ConstString name, DIEArray &offsets) override;
+ void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) override;
+ void GetFunctions(const RegularExpression &regex,
+ DIEArray &offsets) override;
+
+ void ReportInvalidDIEOffset(dw_offset_t offset,
+ llvm::StringRef name) override {}
+ void Dump(Stream &s) override;
+
+private:
+ DebugNamesDWARFIndex(Module &module,
+ std::unique_ptr<llvm::DWARFDebugNames> debug_names_up,
+ DWARFDataExtractor debug_names_data,
+ DWARFDataExtractor debug_str_data,
+ DWARFDebugInfo &debug_info)
+ : DWARFIndex(module), m_debug_info(debug_info),
+ m_debug_names_data(debug_names_data), m_debug_str_data(debug_str_data),
+ m_debug_names_up(std::move(debug_names_up)),
+ m_fallback(module, &debug_info, GetUnits(*m_debug_names_up)) {}
+
+ DWARFDebugInfo &m_debug_info;
+
+ // LLVM DWARFDebugNames will hold a non-owning reference to this data, so keep
+ // track of the ownership here.
+ DWARFDataExtractor m_debug_names_data;
+ DWARFDataExtractor m_debug_str_data;
+
+ using DebugNames = llvm::DWARFDebugNames;
+ std::unique_ptr<DebugNames> m_debug_names_up;
+ ManualDWARFIndex m_fallback;
+
+ DIERef ToDIERef(const DebugNames::Entry &entry);
+ void Append(const DebugNames::Entry &entry, DIEArray &offsets);
+
+ static void MaybeLogLookupError(llvm::Error error,
+ const DebugNames::NameIndex &ni,
+ llvm::StringRef name);
+
+ static llvm::DenseSet<dw_offset_t> GetUnits(const DebugNames &debug_names);
+};
+
+} // namespace lldb_private
+
+#endif // LLDB_DEBUGNAMESDWARFINDEX_H
diff --git a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
index cb1e5c185613..36211a08557e 100644
--- a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
+++ b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
@@ -75,15 +75,14 @@ void DWARFMappedHash::ExtractClassOrStructDIEArray(
die_tag == DW_TAG_structure_type) {
if (die_info_array[i].type_flags & eTypeFlagClassIsImplementation) {
if (return_implementation_only_if_available) {
- // We found the one true definition for this class, so
- // only return that
+ // We found the one true definition for this class, so only return
+ // that
die_offsets.clear();
die_offsets.emplace_back(die_info_array[i].cu_offset,
die_info_array[i].offset);
return;
} else {
- // Put the one true definition as the first entry so it
- // matches first
+ // Put the one true definition as the first entry so it matches first
die_offsets.emplace(die_offsets.begin(), die_info_array[i].cu_offset,
die_info_array[i].offset);
}
@@ -137,9 +136,8 @@ DWARFMappedHash::DIEInfo::DIEInfo(dw_offset_t c, dw_offset_t o, dw_tag_t t,
DWARFMappedHash::Prologue::Prologue(dw_offset_t _die_base_offset)
: die_base_offset(_die_base_offset), atoms(), atom_mask(0),
min_hash_data_byte_size(0), hash_data_has_fixed_byte_size(true) {
- // Define an array of DIE offsets by first defining an array,
- // and then define the atom type for the array, in this case
- // we have an array of DIE offsets
+ // Define an array of DIE offsets by first defining an array, and then define
+ // the atom type for the array, in this case we have an array of DIE offsets
AppendAtom(eAtomTypeDIEOffset, DW_FORM_data4);
}
@@ -239,8 +237,7 @@ DWARFMappedHash::Prologue::Read(const lldb_private::DataExtractor &data,
size_t DWARFMappedHash::Prologue::GetByteSize() const {
// Add an extra count to the atoms size for the zero termination Atom that
- // gets
- // written to disk
+ // gets written to disk
return sizeof(die_base_offset) + sizeof(uint32_t) +
atoms.size() * sizeof(Atom);
}
@@ -379,17 +376,18 @@ bool DWARFMappedHash::MemoryTable::ReadHashData(uint32_t hash_data_offset,
DWARFMappedHash::MemoryTable::Result
DWARFMappedHash::MemoryTable::GetHashDataForName(
- const char *name, lldb::offset_t *hash_data_offset_ptr, Pair &pair) const {
+ llvm::StringRef name, lldb::offset_t *hash_data_offset_ptr,
+ Pair &pair) const {
pair.key = m_data.GetU32(hash_data_offset_ptr);
pair.value.clear();
- // If the key is zero, this terminates our chain of HashData objects
- // for this hash value.
+ // If the key is zero, this terminates our chain of HashData objects for this
+ // hash value.
if (pair.key == 0)
return eResultEndOfHashData;
- // There definitely should be a string for this string offset, if
- // there isn't, there is something wrong, return and error
+ // 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) {
*hash_data_offset_ptr = UINT32_MAX;
@@ -402,22 +400,21 @@ DWARFMappedHash::MemoryTable::GetHashDataForName(
if (count > 0 &&
m_data.ValidOffsetForDataOfSize(*hash_data_offset_ptr,
min_total_hash_data_size)) {
- // We have at least one HashData entry, and we have enough
- // data to parse at least "count" HashData entries.
+ // We have at least one HashData entry, and we have enough data to parse at
+ // least "count" HashData entries.
// First make sure the entire C string matches...
- const bool match = strcmp(name, strp_cstr) == 0;
+ const bool match = name == strp_cstr;
if (!match && m_header.header_data.HashDataHasFixedByteSize()) {
- // If the string doesn't match and we have fixed size data,
- // we can just add the total byte size of all HashData objects
- // to the hash data offset and be done...
+ // If the string doesn't match and we have fixed size data, we can just
+ // add the total byte size of all HashData objects to the hash data
+ // offset and be done...
*hash_data_offset_ptr += min_total_hash_data_size;
} else {
- // If the string does match, or we don't have fixed size data
- // then we need to read the hash data as a stream. If the
- // string matches we also append all HashData objects to the
- // value array.
+ // If the string does match, or we don't have fixed size data then we
+ // need to read the hash data as a stream. If the string matches we also
+ // append all HashData objects to the value array.
for (uint32_t i = 0; i < count; ++i) {
DIEInfo die_info;
if (m_header.Read(m_data, hash_data_offset_ptr, die_info)) {
@@ -431,16 +428,15 @@ DWARFMappedHash::MemoryTable::GetHashDataForName(
}
}
}
- // Return the correct response depending on if the string matched
- // or not...
+ // Return the correct response depending on if the string matched or not...
if (match)
return eResultKeyMatch; // The key (cstring) matches and we have lookup
// results!
else
return eResultKeyMismatch; // The key doesn't match, this function will
// get called
- // again for the next key/value or the key terminator
- // which in our case is a zero .debug_str offset.
+ // again for the next key/value or the key terminator which in our case is
+ // a zero .debug_str offset.
} else {
*hash_data_offset_ptr = UINT32_MAX;
return eResultError;
@@ -452,13 +448,13 @@ DWARFMappedHash::MemoryTable::AppendHashDataForRegularExpression(
const lldb_private::RegularExpression &regex,
lldb::offset_t *hash_data_offset_ptr, Pair &pair) const {
pair.key = m_data.GetU32(hash_data_offset_ptr);
- // If the key is zero, this terminates our chain of HashData objects
- // for this hash value.
+ // If the key is zero, this terminates our chain of HashData objects for this
+ // hash value.
if (pair.key == 0)
return eResultEndOfHashData;
- // There definitely should be a string for this string offset, if
- // there isn't, there is something wrong, return and error
+ // 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)
return eResultError;
@@ -472,15 +468,14 @@ DWARFMappedHash::MemoryTable::AppendHashDataForRegularExpression(
const bool match = regex.Execute(llvm::StringRef(strp_cstr));
if (!match && m_header.header_data.HashDataHasFixedByteSize()) {
- // If the regex doesn't match and we have fixed size data,
- // we can just add the total byte size of all HashData objects
- // to the hash data offset and be done...
+ // If the regex doesn't match and we have fixed size data, we can just
+ // add the total byte size of all HashData objects to the hash data
+ // offset and be done...
*hash_data_offset_ptr += min_total_hash_data_size;
} else {
- // If the string does match, or we don't have fixed size data
- // then we need to read the hash data as a stream. If the
- // string matches we also append all HashData objects to the
- // value array.
+ // If the string does match, or we don't have fixed size data then we
+ // need to read the hash data as a stream. If the string matches we also
+ // append all HashData objects to the value array.
for (uint32_t i = 0; i < count; ++i) {
DIEInfo die_info;
if (m_header.Read(m_data, hash_data_offset_ptr, die_info)) {
@@ -494,16 +489,15 @@ DWARFMappedHash::MemoryTable::AppendHashDataForRegularExpression(
}
}
}
- // Return the correct response depending on if the string matched
- // or not...
+ // Return the correct response depending on if the string matched or not...
if (match)
return eResultKeyMatch; // The key (cstring) matches and we have lookup
// results!
else
return eResultKeyMismatch; // The key doesn't match, this function will
// get called
- // again for the next key/value or the key terminator
- // which in our case is a zero .debug_str offset.
+ // again for the next key/value or the key terminator which in our case is
+ // a zero .debug_str offset.
} else {
*hash_data_offset_ptr = UINT32_MAX;
return eResultError;
@@ -528,8 +522,7 @@ size_t DWARFMappedHash::MemoryTable::AppendAllDIEsThatMatchingRegex(
switch (hash_result) {
case eResultKeyMatch:
case eResultKeyMismatch:
- // Whether we matches or not, it doesn't matter, we
- // keep looking.
+ // Whether we matches or not, it doesn't matter, we keep looking.
break;
case eResultEndOfHashData:
@@ -552,8 +545,8 @@ size_t DWARFMappedHash::MemoryTable::AppendAllDIEsInRange(
lldb::offset_t hash_data_offset = GetHashDataOffset(offset_idx);
while (!done && hash_data_offset != UINT32_MAX) {
KeyType key = m_data.GetU32(&hash_data_offset);
- // If the key is zero, this terminates our chain of HashData objects
- // for this hash value.
+ // If the key is zero, this terminates our chain of HashData objects for
+ // this hash value.
if (key == 0)
break;
@@ -573,9 +566,9 @@ size_t DWARFMappedHash::MemoryTable::AppendAllDIEsInRange(
return die_info_array.size();
}
-size_t DWARFMappedHash::MemoryTable::FindByName(const char *name,
+size_t DWARFMappedHash::MemoryTable::FindByName(llvm::StringRef name,
DIEArray &die_offsets) {
- if (!name || !name[0])
+ if (name.empty())
return 0;
DIEInfoArray die_info_array;
@@ -584,7 +577,7 @@ size_t DWARFMappedHash::MemoryTable::FindByName(const char *name,
return die_info_array.size();
}
-size_t DWARFMappedHash::MemoryTable::FindByNameAndTag(const char *name,
+size_t DWARFMappedHash::MemoryTable::FindByNameAndTag(llvm::StringRef name,
const dw_tag_t tag,
DIEArray &die_offsets) {
DIEInfoArray die_info_array;
@@ -594,8 +587,8 @@ size_t DWARFMappedHash::MemoryTable::FindByNameAndTag(const char *name,
}
size_t DWARFMappedHash::MemoryTable::FindByNameAndTagAndQualifiedNameHash(
- const char *name, const dw_tag_t tag, const uint32_t qualified_name_hash,
- DIEArray &die_offsets) {
+ llvm::StringRef name, const dw_tag_t tag,
+ const uint32_t qualified_name_hash, DIEArray &die_offsets) {
DIEInfoArray die_info_array;
if (FindByName(name, die_info_array))
DWARFMappedHash::ExtractDIEArray(die_info_array, tag, qualified_name_hash,
@@ -604,22 +597,21 @@ size_t DWARFMappedHash::MemoryTable::FindByNameAndTagAndQualifiedNameHash(
}
size_t DWARFMappedHash::MemoryTable::FindCompleteObjCClassByName(
- const char *name, DIEArray &die_offsets, bool must_be_implementation) {
+ llvm::StringRef name, DIEArray &die_offsets, bool must_be_implementation) {
DIEInfoArray die_info_array;
if (FindByName(name, die_info_array)) {
if (must_be_implementation &&
GetHeader().header_data.ContainsAtom(eAtomTypeTypeFlags)) {
- // If we have two atoms, then we have the DIE offset and
- // the type flags so we can find the objective C class
- // efficiently.
+ // If we have two atoms, then we have the DIE offset and the type flags
+ // so we can find the objective C class efficiently.
DWARFMappedHash::ExtractTypesFromDIEArray(die_info_array, UINT32_MAX,
eTypeFlagClassIsImplementation,
die_offsets);
} else {
- // We don't only want the one true definition, so try and see
- // what we can find, and only return class or struct DIEs.
- // If we do have the full implementation, then return it alone,
- // else return all possible matches.
+ // We don't only want the one true definition, so try and see what we can
+ // find, and only return class or struct DIEs. If we do have the full
+ // implementation, then return it alone, else return all possible
+ // matches.
const bool return_implementation_only_if_available = true;
DWARFMappedHash::ExtractClassOrStructDIEArray(
die_info_array, return_implementation_only_if_available, die_offsets);
@@ -628,9 +620,9 @@ size_t DWARFMappedHash::MemoryTable::FindCompleteObjCClassByName(
return die_offsets.size();
}
-size_t DWARFMappedHash::MemoryTable::FindByName(const char *name,
+size_t DWARFMappedHash::MemoryTable::FindByName(llvm::StringRef name,
DIEInfoArray &die_info_array) {
- if (!name || !name[0])
+ if (name.empty())
return 0;
Pair kv_pair;
diff --git a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
index 959517529e52..17600df2edd4 100644
--- a/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
+++ b/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
@@ -21,10 +21,6 @@
#include "DWARFFormValue.h"
#include "NameToDIE.h"
-class SymbolFileDWARF;
-class DWARFCompileUnit;
-class DWARFDebugInfoEntry;
-
class DWARFMappedHash {
public:
enum AtomType : uint16_t {
@@ -136,17 +132,17 @@ public:
const uint32_t die_offset_end,
DIEInfoArray &die_info_array) const;
- size_t FindByName(const char *name, DIEArray &die_offsets);
+ size_t FindByName(llvm::StringRef name, DIEArray &die_offsets);
- size_t FindByNameAndTag(const char *name, const dw_tag_t tag,
+ size_t FindByNameAndTag(llvm::StringRef name, const dw_tag_t tag,
DIEArray &die_offsets);
- size_t
- FindByNameAndTagAndQualifiedNameHash(const char *name, const dw_tag_t tag,
- const uint32_t qualified_name_hash,
- DIEArray &die_offsets);
+ size_t FindByNameAndTagAndQualifiedNameHash(
+ llvm::StringRef name, const dw_tag_t tag,
+ const uint32_t qualified_name_hash, DIEArray &die_offsets);
- size_t FindCompleteObjCClassByName(const char *name, DIEArray &die_offsets,
+ size_t FindCompleteObjCClassByName(llvm::StringRef name,
+ DIEArray &die_offsets,
bool must_be_implementation);
protected:
@@ -154,14 +150,14 @@ public:
const lldb_private::RegularExpression &regex,
lldb::offset_t *hash_data_offset_ptr, Pair &pair) const;
- size_t FindByName(const char *name, DIEInfoArray &die_info_array);
+ size_t FindByName(llvm::StringRef name, DIEInfoArray &die_info_array);
- Result GetHashDataForName(const char *name,
+ Result GetHashDataForName(llvm::StringRef name,
lldb::offset_t *hash_data_offset_ptr,
Pair &pair) const override;
- const lldb_private::DWARFDataExtractor &m_data;
- const lldb_private::DWARFDataExtractor &m_string_table;
+ lldb_private::DWARFDataExtractor m_data;
+ lldb_private::DWARFDataExtractor m_string_table;
std::string m_name;
};
diff --git a/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp b/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
new file mode 100644
index 000000000000..6438f02fe8ec
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -0,0 +1,488 @@
+//===-- ManualDWARFIndex.cpp -----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/SymbolFile/DWARF/ManualDWARFIndex.h"
+#include "Plugins/Language/ObjC/ObjCLanguage.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
+#include "Plugins/SymbolFile/DWARF/LogChannelDWARF.h"
+#include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h"
+#include "lldb/Core/Module.h"
+#include "lldb/Host/TaskPool.h"
+#include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/Timer.h"
+
+using namespace lldb_private;
+using namespace lldb;
+
+void ManualDWARFIndex::Index() {
+ if (!m_debug_info)
+ return;
+
+ DWARFDebugInfo &debug_info = *m_debug_info;
+ m_debug_info = nullptr;
+
+ static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
+ Timer scoped_timer(func_cat, "%p", static_cast<void *>(&debug_info));
+
+ std::vector<DWARFUnit *> units_to_index;
+ units_to_index.reserve(debug_info.GetNumCompileUnits());
+ for (size_t U = 0; U < debug_info.GetNumCompileUnits(); ++U) {
+ DWARFUnit *unit = debug_info.GetCompileUnitAtIndex(U);
+ if (unit && m_units_to_avoid.count(unit->GetOffset()) == 0)
+ units_to_index.push_back(unit);
+ }
+ if (units_to_index.empty())
+ return;
+
+ std::vector<IndexSet> sets(units_to_index.size());
+
+ //----------------------------------------------------------------------
+ // Keep memory down by clearing DIEs for any compile units if indexing
+ // caused us to load the compile unit's DIEs.
+ //----------------------------------------------------------------------
+ std::vector<llvm::Optional<DWARFUnit::ScopedExtractDIEs>> clear_cu_dies(
+ units_to_index.size());
+ auto parser_fn = [&](size_t cu_idx) {
+ IndexUnit(*units_to_index[cu_idx], sets[cu_idx]);
+ };
+
+ auto extract_fn = [&units_to_index, &clear_cu_dies](size_t cu_idx) {
+ clear_cu_dies[cu_idx] = units_to_index[cu_idx]->ExtractDIEsScoped();
+ };
+
+ // Create a task runner that extracts dies for each DWARF compile unit in a
+ // separate thread
+ //----------------------------------------------------------------------
+ // First figure out which compile units didn't have their DIEs already
+ // parsed and remember this. If no DIEs were parsed prior to this index
+ // function call, we are going to want to clear the CU dies after we are
+ // done indexing to make sure we don't pull in all DWARF dies, but we need
+ // to wait until all compile units have been indexed in case a DIE in one
+ // compile unit refers to another and the indexes accesses those DIEs.
+ //----------------------------------------------------------------------
+ TaskMapOverInt(0, units_to_index.size(), extract_fn);
+
+ // Now create a task runner that can index each DWARF compile unit in a
+ // separate thread so we can index quickly.
+
+ TaskMapOverInt(0, units_to_index.size(), parser_fn);
+
+ auto finalize_fn = [this, &sets](NameToDIE(IndexSet::*index)) {
+ NameToDIE &result = m_set.*index;
+ for (auto &set : sets)
+ result.Append(set.*index);
+ result.Finalize();
+ };
+
+ TaskPool::RunTasks([&]() { finalize_fn(&IndexSet::function_basenames); },
+ [&]() { finalize_fn(&IndexSet::function_fullnames); },
+ [&]() { finalize_fn(&IndexSet::function_methods); },
+ [&]() { finalize_fn(&IndexSet::function_selectors); },
+ [&]() { finalize_fn(&IndexSet::objc_class_selectors); },
+ [&]() { finalize_fn(&IndexSet::globals); },
+ [&]() { finalize_fn(&IndexSet::types); },
+ [&]() { finalize_fn(&IndexSet::namespaces); });
+}
+
+void ManualDWARFIndex::IndexUnit(DWARFUnit &unit, IndexSet &set) {
+ Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS);
+
+ if (log) {
+ m_module.LogMessage(
+ log, "ManualDWARFIndex::IndexUnit for compile unit at .debug_info[0x%8.8x]",
+ unit.GetOffset());
+ }
+
+ const LanguageType cu_language = unit.GetLanguageType();
+ DWARFFormValue::FixedFormSizes fixed_form_sizes = unit.GetFixedFormSizes();
+
+ IndexUnitImpl(unit, cu_language, fixed_form_sizes, unit.GetOffset(), set);
+
+ SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile();
+ if (dwo_symbol_file && dwo_symbol_file->GetCompileUnit()) {
+ IndexUnitImpl(*dwo_symbol_file->GetCompileUnit(), cu_language,
+ fixed_form_sizes, unit.GetOffset(), set);
+ }
+}
+
+void ManualDWARFIndex::IndexUnitImpl(
+ DWARFUnit &unit, const LanguageType cu_language,
+ const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
+ const dw_offset_t cu_offset, IndexSet &set) {
+ for (const DWARFDebugInfoEntry &die : unit.dies()) {
+ const dw_tag_t tag = die.Tag();
+
+ switch (tag) {
+ case DW_TAG_array_type:
+ case DW_TAG_base_type:
+ case DW_TAG_class_type:
+ case DW_TAG_constant:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_inlined_subroutine:
+ case DW_TAG_namespace:
+ case DW_TAG_string_type:
+ case DW_TAG_structure_type:
+ case DW_TAG_subprogram:
+ case DW_TAG_subroutine_type:
+ case DW_TAG_typedef:
+ case DW_TAG_union_type:
+ case DW_TAG_unspecified_type:
+ case DW_TAG_variable:
+ break;
+
+ default:
+ continue;
+ }
+
+ DWARFAttributes attributes;
+ const char *name = NULL;
+ const char *mangled_cstr = NULL;
+ bool is_declaration = false;
+ // bool is_artificial = false;
+ bool has_address = false;
+ bool has_location_or_const_value = false;
+ bool is_global_or_static_variable = false;
+
+ DWARFFormValue specification_die_form;
+ const size_t num_attributes =
+ die.GetAttributes(&unit, fixed_form_sizes, attributes);
+ if (num_attributes > 0) {
+ for (uint32_t i = 0; i < num_attributes; ++i) {
+ dw_attr_t attr = attributes.AttributeAtIndex(i);
+ DWARFFormValue form_value;
+ switch (attr) {
+ case DW_AT_name:
+ if (attributes.ExtractFormValueAtIndex(i, form_value))
+ name = form_value.AsCString();
+ break;
+
+ case DW_AT_declaration:
+ if (attributes.ExtractFormValueAtIndex(i, form_value))
+ is_declaration = form_value.Unsigned() != 0;
+ break;
+
+ // case DW_AT_artificial:
+ // if (attributes.ExtractFormValueAtIndex(i,
+ // form_value))
+ // is_artificial = form_value.Unsigned() != 0;
+ // break;
+
+ case DW_AT_MIPS_linkage_name:
+ case DW_AT_linkage_name:
+ if (attributes.ExtractFormValueAtIndex(i, form_value))
+ mangled_cstr = form_value.AsCString();
+ break;
+
+ case DW_AT_low_pc:
+ case DW_AT_high_pc:
+ case DW_AT_ranges:
+ has_address = true;
+ break;
+
+ case DW_AT_entry_pc:
+ has_address = true;
+ break;
+
+ case DW_AT_location:
+ case DW_AT_const_value:
+ has_location_or_const_value = true;
+ if (tag == DW_TAG_variable) {
+ const DWARFDebugInfoEntry *parent_die = die.GetParent();
+ while (parent_die != NULL) {
+ switch (parent_die->Tag()) {
+ case DW_TAG_subprogram:
+ case DW_TAG_lexical_block:
+ case DW_TAG_inlined_subroutine:
+ // Even if this is a function level static, we don't add it. We
+ // could theoretically add these if we wanted to by
+ // introspecting into the DW_AT_location and seeing if the
+ // location describes a hard coded address, but we don't want
+ // the performance penalty of that right now.
+ is_global_or_static_variable = false;
+ // if (attributes.ExtractFormValueAtIndex(dwarf, i,
+ // form_value)) {
+ // // If we have valid block data, then we have location
+ // // expression bytesthat are fixed (not a location list).
+ // const uint8_t *block_data = form_value.BlockData();
+ // if (block_data) {
+ // uint32_t block_length = form_value.Unsigned();
+ // if (block_length == 1 +
+ // attributes.CompileUnitAtIndex(i)->GetAddressByteSize()) {
+ // if (block_data[0] == DW_OP_addr)
+ // add_die = true;
+ // }
+ // }
+ // }
+ parent_die = NULL; // 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.
+ break;
+
+ default:
+ parent_die =
+ parent_die->GetParent(); // Keep going in the while loop.
+ break;
+ }
+ }
+ }
+ break;
+
+ case DW_AT_specification:
+ if (attributes.ExtractFormValueAtIndex(i, form_value))
+ specification_die_form = form_value;
+ break;
+ }
+ }
+ }
+
+ switch (tag) {
+ case DW_TAG_inlined_subroutine:
+ case DW_TAG_subprogram:
+ if (has_address) {
+ if (name) {
+ ObjCLanguage::MethodName objc_method(name, true);
+ if (objc_method.IsValid(true)) {
+ ConstString objc_class_name_with_category(
+ objc_method.GetClassNameWithCategory());
+ ConstString objc_selector_name(objc_method.GetSelector());
+ ConstString objc_fullname_no_category_name(
+ objc_method.GetFullNameWithoutCategory(true));
+ ConstString objc_class_name_no_category(objc_method.GetClassName());
+ set.function_fullnames.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+ if (objc_class_name_with_category)
+ set.objc_class_selectors.Insert(
+ objc_class_name_with_category,
+ DIERef(cu_offset, die.GetOffset()));
+ if (objc_class_name_no_category &&
+ objc_class_name_no_category != objc_class_name_with_category)
+ set.objc_class_selectors.Insert(
+ objc_class_name_no_category,
+ DIERef(cu_offset, die.GetOffset()));
+ if (objc_selector_name)
+ set.function_selectors.Insert(objc_selector_name,
+ DIERef(cu_offset, die.GetOffset()));
+ if (objc_fullname_no_category_name)
+ set.function_fullnames.Insert(objc_fullname_no_category_name,
+ DIERef(cu_offset, die.GetOffset()));
+ }
+ // If we have a mangled name, then the DW_AT_name attribute is
+ // usually the method name without the class or any parameters
+ bool is_method = DWARFDIE(&unit, &die).IsMethod();
+
+ if (is_method)
+ set.function_methods.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+ else
+ set.function_basenames.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+
+ if (!is_method && !mangled_cstr && !objc_method.IsValid(true))
+ set.function_fullnames.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+ }
+ if (mangled_cstr) {
+ // Make sure our mangled name isn't the same string table entry as
+ // our name. If it starts with '_', then it is ok, else compare the
+ // string to make sure it isn't the same and we don't end up with
+ // duplicate entries
+ if (name && name != mangled_cstr &&
+ ((mangled_cstr[0] == '_') ||
+ (::strcmp(name, mangled_cstr) != 0))) {
+ set.function_fullnames.Insert(ConstString(mangled_cstr),
+ DIERef(cu_offset, die.GetOffset()));
+ }
+ }
+ }
+ break;
+
+ case DW_TAG_array_type:
+ case DW_TAG_base_type:
+ case DW_TAG_class_type:
+ case DW_TAG_constant:
+ case DW_TAG_enumeration_type:
+ case DW_TAG_string_type:
+ case DW_TAG_structure_type:
+ case DW_TAG_subroutine_type:
+ case DW_TAG_typedef:
+ case DW_TAG_union_type:
+ case DW_TAG_unspecified_type:
+ if (name && !is_declaration)
+ set.types.Insert(ConstString(name), DIERef(cu_offset, die.GetOffset()));
+ if (mangled_cstr && !is_declaration)
+ set.types.Insert(ConstString(mangled_cstr),
+ DIERef(cu_offset, die.GetOffset()));
+ break;
+
+ case DW_TAG_namespace:
+ if (name)
+ set.namespaces.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+ break;
+
+ case DW_TAG_variable:
+ if (name && has_location_or_const_value && is_global_or_static_variable) {
+ set.globals.Insert(ConstString(name),
+ DIERef(cu_offset, die.GetOffset()));
+ // Be sure to include variables by their mangled and demangled names if
+ // they have any since a variable can have a basename "i", a mangled
+ // named "_ZN12_GLOBAL__N_11iE" and a demangled mangled name
+ // "(anonymous namespace)::i"...
+
+ // Make sure our mangled name isn't the same string table entry as our
+ // name. If it starts with '_', then it is ok, else compare the string
+ // to make sure it isn't the same and we don't end up with duplicate
+ // entries
+ if (mangled_cstr && name != mangled_cstr &&
+ ((mangled_cstr[0] == '_') || (::strcmp(name, mangled_cstr) != 0))) {
+ set.globals.Insert(ConstString(mangled_cstr),
+ DIERef(cu_offset, die.GetOffset()));
+ }
+ }
+ break;
+
+ default:
+ continue;
+ }
+ }
+}
+
+void ManualDWARFIndex::GetGlobalVariables(ConstString basename, DIEArray &offsets) {
+ Index();
+ m_set.globals.Find(basename, offsets);
+}
+
+void ManualDWARFIndex::GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) {
+ Index();
+ m_set.globals.Find(regex, offsets);
+}
+
+void ManualDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
+ DIEArray &offsets) {
+ Index();
+ m_set.globals.FindAllEntriesForCompileUnit(cu.GetOffset(), offsets);
+}
+
+void ManualDWARFIndex::GetObjCMethods(ConstString class_name,
+ DIEArray &offsets) {
+ Index();
+ m_set.objc_class_selectors.Find(class_name, offsets);
+}
+
+void ManualDWARFIndex::GetCompleteObjCClass(ConstString class_name,
+ bool must_be_implementation,
+ DIEArray &offsets) {
+ Index();
+ m_set.types.Find(class_name, offsets);
+}
+
+void ManualDWARFIndex::GetTypes(ConstString name, DIEArray &offsets) {
+ Index();
+ m_set.types.Find(name, offsets);
+}
+
+void ManualDWARFIndex::GetTypes(const DWARFDeclContext &context,
+ DIEArray &offsets) {
+ Index();
+ m_set.types.Find(ConstString(context[0].name), offsets);
+}
+
+void ManualDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
+ Index();
+ m_set.namespaces.Find(name, offsets);
+}
+
+void ManualDWARFIndex::GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) {
+ Index();
+
+ if (name_type_mask & eFunctionNameTypeFull) {
+ DIEArray offsets;
+ m_set.function_basenames.Find(name, offsets);
+ m_set.function_methods.Find(name, offsets);
+ m_set.function_fullnames.Find(name, offsets);
+ for (const DIERef &die_ref: offsets) {
+ DWARFDIE die = info.GetDIE(die_ref);
+ if (!die)
+ continue;
+ if (SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
+ dies.push_back(die);
+ }
+ }
+ if (name_type_mask & eFunctionNameTypeBase) {
+ DIEArray offsets;
+ m_set.function_basenames.Find(name, offsets);
+ for (const DIERef &die_ref: offsets) {
+ DWARFDIE die = info.GetDIE(die_ref);
+ if (!die)
+ continue;
+ if (SymbolFileDWARF::DIEInDeclContext(&parent_decl_ctx, die))
+ dies.push_back(die);
+ }
+ offsets.clear();
+ }
+
+ if (name_type_mask & eFunctionNameTypeMethod && !parent_decl_ctx.IsValid()) {
+ DIEArray offsets;
+ m_set.function_methods.Find(name, offsets);
+ for (const DIERef &die_ref: offsets) {
+ if (DWARFDIE die = info.GetDIE(die_ref))
+ dies.push_back(die);
+ }
+ }
+
+ if (name_type_mask & eFunctionNameTypeSelector &&
+ !parent_decl_ctx.IsValid()) {
+ DIEArray offsets;
+ m_set.function_selectors.Find(name, offsets);
+ for (const DIERef &die_ref: offsets) {
+ if (DWARFDIE die = info.GetDIE(die_ref))
+ dies.push_back(die);
+ }
+ }
+}
+
+void ManualDWARFIndex::GetFunctions(const RegularExpression &regex,
+ DIEArray &offsets) {
+ Index();
+
+ m_set.function_basenames.Find(regex, offsets);
+ m_set.function_fullnames.Find(regex, offsets);
+}
+
+void ManualDWARFIndex::Dump(Stream &s) {
+ s.Format("Manual DWARF index for ({0}) '{1:F}':",
+ m_module.GetArchitecture().GetArchitectureName(),
+ m_module.GetObjectFile()->GetFileSpec());
+ s.Printf("\nFunction basenames:\n");
+ m_set.function_basenames.Dump(&s);
+ s.Printf("\nFunction fullnames:\n");
+ m_set.function_fullnames.Dump(&s);
+ s.Printf("\nFunction methods:\n");
+ m_set.function_methods.Dump(&s);
+ s.Printf("\nFunction selectors:\n");
+ m_set.function_selectors.Dump(&s);
+ s.Printf("\nObjective-C class selectors:\n");
+ m_set.objc_class_selectors.Dump(&s);
+ s.Printf("\nGlobals and statics:\n");
+ m_set.globals.Dump(&s);
+ s.Printf("\nTypes:\n");
+ m_set.types.Dump(&s);
+ s.Printf("\nNamespaces:\n");
+ m_set.namespaces.Dump(&s);
+}
diff --git a/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h b/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
new file mode 100644
index 000000000000..79ab1d95b380
--- /dev/null
+++ b/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
@@ -0,0 +1,75 @@
+//===-- ManulaDWARFIndex.h -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_MANUALDWARFINDEX_H
+#define LLDB_MANUALDWARFINDEX_H
+
+#include "Plugins/SymbolFile/DWARF/DWARFIndex.h"
+#include "Plugins/SymbolFile/DWARF/NameToDIE.h"
+#include "llvm/ADT/DenseSet.h"
+
+namespace lldb_private {
+class ManualDWARFIndex : public DWARFIndex {
+public:
+ ManualDWARFIndex(Module &module, DWARFDebugInfo *debug_info,
+ llvm::DenseSet<dw_offset_t> units_to_avoid = {})
+ : DWARFIndex(module), m_debug_info(debug_info),
+ m_units_to_avoid(std::move(units_to_avoid)) {}
+
+ void Preload() override { Index(); }
+
+ void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
+ void GetGlobalVariables(const RegularExpression &regex,
+ DIEArray &offsets) override;
+ void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
+ void GetObjCMethods(ConstString class_name, DIEArray &offsets) override;
+ void GetCompleteObjCClass(ConstString class_name, bool must_be_implementation,
+ DIEArray &offsets) override;
+ void GetTypes(ConstString name, DIEArray &offsets) override;
+ void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
+ void GetNamespaces(ConstString name, DIEArray &offsets) override;
+ void GetFunctions(ConstString name, DWARFDebugInfo &info,
+ const CompilerDeclContext &parent_decl_ctx,
+ uint32_t name_type_mask,
+ std::vector<DWARFDIE> &dies) override;
+ void GetFunctions(const RegularExpression &regex, DIEArray &offsets) override;
+
+ void ReportInvalidDIEOffset(dw_offset_t offset,
+ llvm::StringRef name) override {}
+ void Dump(Stream &s) override;
+
+private:
+ struct IndexSet {
+ NameToDIE function_basenames;
+ NameToDIE function_fullnames;
+ NameToDIE function_methods;
+ NameToDIE function_selectors;
+ NameToDIE objc_class_selectors;
+ NameToDIE globals;
+ NameToDIE types;
+ NameToDIE namespaces;
+ };
+ void Index();
+ void IndexUnit(DWARFUnit &unit, IndexSet &set);
+
+ static void
+ IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language,
+ const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
+ const dw_offset_t cu_offset, IndexSet &set);
+
+ /// Non-null value means we haven't built the index yet.
+ DWARFDebugInfo *m_debug_info;
+ /// Which dwarf units should we skip while building the index.
+ llvm::DenseSet<dw_offset_t> m_units_to_avoid;
+
+ IndexSet m_set;
+};
+} // namespace lldb_private
+
+#endif // LLDB_MANUALDWARFINDEX_H
diff --git a/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp b/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
index c97680eda0fe..c8d6bba16976 100644
--- a/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ b/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -14,7 +14,6 @@
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StreamString.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDebugInfo.h"
#include "DWARFDebugInfoEntry.h"
#include "SymbolFileDWARF.h"
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
index f149ec354f08..ac320ac52b08 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -27,6 +27,7 @@
#include "lldb/Utility/Timer.h"
#include "Plugins/ExpressionParser/Clang/ClangModulesDeclVendor.h"
+#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
@@ -49,27 +50,24 @@
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
-#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
-#include "Plugins/Language/ObjC/ObjCLanguage.h"
-
#include "lldb/Target/Language.h"
-#include "lldb/Host/TaskPool.h"
-
+#include "AppleDWARFIndex.h"
#include "DWARFASTParser.h"
#include "DWARFASTParserClang.h"
-#include "DWARFCompileUnit.h"
#include "DWARFDIECollection.h"
#include "DWARFDebugAbbrev.h"
#include "DWARFDebugAranges.h"
#include "DWARFDebugInfo.h"
#include "DWARFDebugLine.h"
#include "DWARFDebugMacro.h"
-#include "DWARFDebugPubnames.h"
#include "DWARFDebugRanges.h"
#include "DWARFDeclContext.h"
#include "DWARFFormValue.h"
+#include "DWARFUnit.h"
+#include "DebugNamesDWARFIndex.h"
#include "LogChannelDWARF.h"
+#include "ManualDWARFIndex.h"
#include "SymbolFileDWARFDebugMap.h"
#include "SymbolFileDWARFDwo.h"
#include "SymbolFileDWARFDwp.h"
@@ -115,11 +113,20 @@ namespace {
PropertyDefinition g_properties[] = {
{"comp-dir-symlink-paths", OptionValue::eTypeFileSpecList, true, 0, nullptr,
- nullptr, "If the DW_AT_comp_dir matches any of these paths the symbolic "
- "links will be resolved at DWARF parse time."},
- {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr}};
+ nullptr,
+ "If the DW_AT_comp_dir matches any of these paths the symbolic "
+ "links will be resolved at DWARF parse time."},
+ {"ignore-file-indexes", OptionValue::eTypeBoolean, true, 0, nullptr,
+ nullptr,
+ "Ignore indexes present in the object files and always index DWARF "
+ "manually."},
+ {nullptr, OptionValue::eTypeInvalid, false, 0, nullptr, nullptr, nullptr},
+};
-enum { ePropertySymLinkPaths };
+enum {
+ ePropertySymLinkPaths,
+ ePropertyIgnoreIndexes,
+};
class PluginProperties : public Properties {
public:
@@ -139,6 +146,11 @@ public:
assert(option_value);
return option_value->GetCurrentValue();
}
+
+ bool IgnoreFileIndexes() const {
+ return m_collection_sp->GetPropertyAtIndexAsBoolean(
+ nullptr, ePropertyIgnoreIndexes, false);
+ }
};
typedef std::shared_ptr<PluginProperties> SymbolFileDWARFPropertiesSP;
@@ -165,8 +177,8 @@ static const char *removeHostnameFromPathname(const char *path_from_dwarf) {
return path_from_dwarf;
}
- // check whether we have a windows path, and so the first character
- // is a drive-letter not a hostname.
+ // check whether we have a windows path, and so the first character is a
+ // drive-letter not a hostname.
if (colon_pos == path_from_dwarf + 1 && isalpha(*path_from_dwarf) &&
strlen(path_from_dwarf) > 2 && '\\' == path_from_dwarf[2]) {
return path_from_dwarf;
@@ -175,41 +187,42 @@ static const char *removeHostnameFromPathname(const char *path_from_dwarf) {
return colon_pos + 1;
}
-static const char *resolveCompDir(const char *path_from_dwarf) {
+static FileSpec resolveCompDir(const char *path_from_dwarf) {
if (!path_from_dwarf)
- return nullptr;
+ return FileSpec();
// DWARF2/3 suggests the form hostname:pathname for compilation directory.
// Remove the host part if present.
const char *local_path = removeHostnameFromPathname(path_from_dwarf);
if (!local_path)
- return nullptr;
+ return FileSpec();
bool is_symlink = false;
- FileSpec local_path_spec(local_path, false);
+ // Always normalize our compile unit directory to get rid of redundant
+ // slashes and other path anomalies before we use it for path prepending
+ FileSpec local_spec(local_path, false);
const auto &file_specs = GetGlobalPluginProperties()->GetSymLinkPaths();
for (size_t i = 0; i < file_specs.GetSize() && !is_symlink; ++i)
is_symlink = FileSpec::Equal(file_specs.GetFileSpecAtIndex(i),
- local_path_spec, true);
+ local_spec, true);
if (!is_symlink)
- return local_path;
+ return local_spec;
namespace fs = llvm::sys::fs;
- if (fs::get_file_type(local_path_spec.GetPath(), false) !=
+ if (fs::get_file_type(local_spec.GetPath(), false) !=
fs::file_type::symlink_file)
- return local_path;
+ return local_spec;
- FileSpec resolved_local_path_spec;
- const auto error =
- FileSystem::Readlink(local_path_spec, resolved_local_path_spec);
+ FileSpec resolved_symlink;
+ const auto error = FileSystem::Readlink(local_spec, resolved_symlink);
if (error.Success())
- return resolved_local_path_spec.GetCString();
+ return resolved_symlink;
- return nullptr;
+ return local_spec;
}
-DWARFCompileUnit *SymbolFileDWARF::GetBaseCompileUnit() {
+DWARFUnit *SymbolFileDWARF::GetBaseCompileUnit() {
return nullptr;
}
@@ -334,7 +347,7 @@ size_t SymbolFileDWARF::GetTypes(SymbolContextScope *sc_scope,
TypeSet type_set;
CompileUnit *comp_unit = NULL;
- DWARFCompileUnit *dwarf_cu = NULL;
+ DWARFUnit *dwarf_cu = NULL;
if (sc_scope)
comp_unit = sc_scope->CalculateSymbolContextCompileUnit();
@@ -382,6 +395,7 @@ SymbolFileDWARF::GetParentSymbolContextDIE(const DWARFDIE &child_die) {
switch (tag) {
case DW_TAG_compile_unit:
+ case DW_TAG_partial_unit:
case DW_TAG_subprogram:
case DW_TAG_inlined_subroutine:
case DW_TAG_lexical_block:
@@ -392,20 +406,16 @@ SymbolFileDWARF::GetParentSymbolContextDIE(const DWARFDIE &child_die) {
}
SymbolFileDWARF::SymbolFileDWARF(ObjectFile *objfile)
- : SymbolFile(objfile), UserID(0), // Used by SymbolFileDWARFDebugMap to when
- // this class parses .o files to contain
- // the .o file index/ID
+ : SymbolFile(objfile), UserID(uint64_t(DW_INVALID_OFFSET)
+ << 32), // 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_data_debug_abbrev(),
m_data_debug_aranges(), m_data_debug_frame(), m_data_debug_info(),
m_data_debug_line(), m_data_debug_macro(), m_data_debug_loc(),
m_data_debug_ranges(), m_data_debug_str(), m_data_apple_names(),
m_data_apple_types(), m_data_apple_namespaces(), m_abbr(), m_info(),
- m_line(), m_apple_names_ap(), m_apple_types_ap(), m_apple_namespaces_ap(),
- m_apple_objc_ap(), m_function_basename_index(),
- m_function_fullname_index(), m_function_method_index(),
- m_function_selector_index(), m_objc_class_selectors_index(),
- m_global_index(), m_type_index(), m_namespace_index(), m_indexed(false),
- m_using_apple_tables(false), m_fetched_external_modules(false),
+ m_line(), m_fetched_external_modules(false),
m_supports_DW_AT_APPLE_objc_complete_type(eLazyBoolCalculate), m_ranges(),
m_unique_ast_type_map() {}
@@ -438,6 +448,7 @@ TypeSystem *SymbolFileDWARF::GetTypeSystemForLanguage(LanguageType language) {
}
void SymbolFileDWARF::InitializeObject() {
+ Log *log = LogChannelDWARF::GetLogIfAll(DWARF_LOG_DEBUG_INFO);
ModuleSP module_sp(m_obj_file->GetModule());
if (module_sp) {
const SectionList *section_list = module_sp->GetSectionList();
@@ -448,45 +459,38 @@ void SymbolFileDWARF::InitializeObject() {
m_obj_file->ReadSectionData(section, m_dwarf_data);
}
- get_apple_names_data();
- if (m_data_apple_names.m_data.GetByteSize() > 0) {
- m_apple_names_ap.reset(new DWARFMappedHash::MemoryTable(
- m_data_apple_names.m_data, get_debug_str_data(), ".apple_names"));
- if (m_apple_names_ap->IsValid())
- m_using_apple_tables = true;
- else
- m_apple_names_ap.reset();
- }
- get_apple_types_data();
- if (m_data_apple_types.m_data.GetByteSize() > 0) {
- m_apple_types_ap.reset(new DWARFMappedHash::MemoryTable(
- m_data_apple_types.m_data, get_debug_str_data(), ".apple_types"));
- if (m_apple_types_ap->IsValid())
- m_using_apple_tables = true;
- else
- m_apple_types_ap.reset();
- }
+ if (!GetGlobalPluginProperties()->IgnoreFileIndexes()) {
+ DWARFDataExtractor apple_names, apple_namespaces, apple_types, apple_objc;
+ LoadSectionData(eSectionTypeDWARFAppleNames, apple_names);
+ LoadSectionData(eSectionTypeDWARFAppleNamespaces, apple_namespaces);
+ LoadSectionData(eSectionTypeDWARFAppleTypes, apple_types);
+ LoadSectionData(eSectionTypeDWARFAppleObjC, apple_objc);
- get_apple_namespaces_data();
- if (m_data_apple_namespaces.m_data.GetByteSize() > 0) {
- m_apple_namespaces_ap.reset(new DWARFMappedHash::MemoryTable(
- m_data_apple_namespaces.m_data, get_debug_str_data(),
- ".apple_namespaces"));
- if (m_apple_namespaces_ap->IsValid())
- m_using_apple_tables = true;
- else
- m_apple_namespaces_ap.reset();
- }
+ m_index = AppleDWARFIndex::Create(
+ *GetObjectFile()->GetModule(), apple_names, apple_namespaces,
+ apple_types, apple_objc, get_debug_str_data());
- get_apple_objc_data();
- if (m_data_apple_objc.m_data.GetByteSize() > 0) {
- m_apple_objc_ap.reset(new DWARFMappedHash::MemoryTable(
- m_data_apple_objc.m_data, get_debug_str_data(), ".apple_objc"));
- if (m_apple_objc_ap->IsValid())
- m_using_apple_tables = true;
- else
- m_apple_objc_ap.reset();
+ if (m_index)
+ return;
+
+ DWARFDataExtractor debug_names;
+ LoadSectionData(eSectionTypeDWARFDebugNames, debug_names);
+ if (debug_names.GetByteSize() > 0) {
+ llvm::Expected<std::unique_ptr<DebugNamesDWARFIndex>> index_or =
+ DebugNamesDWARFIndex::Create(*GetObjectFile()->GetModule(),
+ debug_names, get_debug_str_data(),
+ DebugInfo());
+ if (index_or) {
+ m_index = std::move(*index_or);
+ return;
+ }
+ LLDB_LOG_ERROR(log, index_or.takeError(),
+ "Unable to read .debug_names data: {0}");
+ }
}
+
+ m_index = llvm::make_unique<ManualDWARFIndex>(*GetObjectFile()->GetModule(),
+ DebugInfo());
}
bool SymbolFileDWARF::SupportedVersion(uint16_t version) {
@@ -501,15 +505,14 @@ uint32_t SymbolFileDWARF::CalculateAbilities() {
if (section_list == NULL)
return 0;
- // On non Apple platforms we might have .debug_types debug info that
- // is created by using "-fdebug-types-section". LLDB currently will try
- // to load this debug info, but it causes crashes during debugging when
- // types are missing since it doesn't know how to parse the info in
- // the .debug_types type units. This causes all complex debug info
- // types to be unresolved. Because this causes LLDB to crash and since
- // it really doesn't provide a solid debuggiung experience, we should
- // disable trying to debug this kind of DWARF until support gets
- // added or deprecated.
+ // On non Apple platforms we might have .debug_types debug info that is
+ // created by using "-fdebug-types-section". LLDB currently will try to
+ // load this debug info, but it causes crashes during debugging when types
+ // are missing since it doesn't know how to parse the info in the
+ // .debug_types type units. This causes all complex debug info types to be
+ // unresolved. Because this causes LLDB to crash and since it really
+ // doesn't provide a solid debuggiung experience, we should disable trying
+ // to debug this kind of DWARF until support gets added or deprecated.
if (section_list->FindSectionByName(ConstString(".debug_types"))) {
m_obj_file->GetModule()->ReportWarning(
"lldb doesn’t support .debug_types debug info");
@@ -561,10 +564,10 @@ uint32_t SymbolFileDWARF::CalculateAbilities() {
if (symfile_dir_cstr) {
if (strcasestr(symfile_dir_cstr, ".dsym")) {
if (m_obj_file->GetType() == ObjectFile::eTypeDebugInfo) {
- // We have a dSYM file that didn't have a any debug info.
- // If the string table has a size of 1, then it was made from
- // an executable with no debug info, or from an executable that
- // was stripped.
+ // We have a dSYM file that didn't have a any debug info. If the
+ // string table has a size of 1, then it was made from an
+ // executable with no debug info, or from an executable that was
+ // stripped.
section =
section_list->FindSectionByType(eSectionTypeDWARFDebugStr, true)
.get();
@@ -664,6 +667,10 @@ const DWARFDataExtractor &SymbolFileDWARF::get_debug_str_offsets_data() {
m_data_debug_str_offsets);
}
+const DWARFDataExtractor &SymbolFileDWARF::get_debug_types_data() {
+ return GetCachedSectionData(eSectionTypeDWARFDebugTypes, m_data_debug_types);
+}
+
const DWARFDataExtractor &SymbolFileDWARF::get_apple_names_data() {
return GetCachedSectionData(eSectionTypeDWARFAppleNames, m_data_apple_names);
}
@@ -681,6 +688,11 @@ const DWARFDataExtractor &SymbolFileDWARF::get_apple_objc_data() {
return GetCachedSectionData(eSectionTypeDWARFAppleObjC, m_data_apple_objc);
}
+const DWARFDataExtractor &SymbolFileDWARF::get_gnu_debugaltlink() {
+ return GetCachedSectionData(eSectionTypeDWARFGNUDebugAltLink,
+ m_data_gnu_debugaltlink);
+}
+
DWARFDebugAbbrev *SymbolFileDWARF::DebugAbbrev() {
if (m_abbr.get() == NULL) {
const DWARFDataExtractor &debug_abbrev_data = get_debug_abbrev_data();
@@ -716,17 +728,17 @@ const DWARFDebugInfo *SymbolFileDWARF::DebugInfo() const {
return m_info.get();
}
-DWARFCompileUnit *
+DWARFUnit *
SymbolFileDWARF::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
if (!comp_unit)
return nullptr;
DWARFDebugInfo *info = DebugInfo();
if (info) {
- // Just a normal DWARF file whose user ID for the compile unit is
- // the DWARF offset itself
+ // Just a normal DWARF file whose user ID for the compile unit is the DWARF
+ // offset itself
- DWARFCompileUnit *dwarf_cu =
+ DWARFUnit *dwarf_cu =
info->GetCompileUnit((dw_offset_t)comp_unit->GetID());
if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
dwarf_cu->SetUserData(comp_unit);
@@ -753,7 +765,7 @@ const DWARFDebugRanges *SymbolFileDWARF::DebugRanges() const {
return m_ranges.get();
}
-lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
+lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) {
CompUnitSP cu_sp;
if (dwarf_cu) {
@@ -772,13 +784,13 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
} else {
ModuleSP module_sp(m_obj_file->GetModule());
if (module_sp) {
- const DWARFDIE cu_die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFDIE cu_die = dwarf_cu->DIE();
if (cu_die) {
FileSpec cu_file_spec{cu_die.GetName(), false};
if (cu_file_spec) {
// If we have a full path to the compile unit, we don't need to
- // resolve
- // the file. This can be expensive e.g. when the source files are
+ // resolve the file. This can be expensive e.g. when the source
+ // files are
// NFS mounted.
if (cu_file_spec.IsRelative()) {
const char *cu_comp_dir{
@@ -789,10 +801,11 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
std::string remapped_file;
if (module_sp->RemapSourceFile(cu_file_spec.GetPath(),
remapped_file))
- cu_file_spec.SetFile(remapped_file, false);
+ cu_file_spec.SetFile(remapped_file, false,
+ FileSpec::Style::native);
}
- LanguageType cu_language = DWARFCompileUnit::LanguageTypeFromDWARF(
+ LanguageType cu_language = DWARFUnit::LanguageTypeFromDWARF(
cu_die.GetAttributeValueAsUnsigned(DW_AT_language, 0));
bool is_optimized = dwarf_cu->GetIsOptimized();
@@ -801,10 +814,8 @@ lldb::CompUnitSP SymbolFileDWARF::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo));
if (cu_sp) {
// If we just created a compile unit with an invalid file spec,
- // try and get the
- // first entry in the supports files from the line table as that
- // should be the
- // compile unit.
+ // try and get the first entry in the supports files from the
+ // line table as that should be the compile unit.
if (!cu_file_spec) {
cu_file_spec = cu_sp->GetSupportFiles().GetFileSpecAtIndex(1);
if (cu_file_spec) {
@@ -843,7 +854,7 @@ CompUnitSP SymbolFileDWARF::ParseCompileUnitAtIndex(uint32_t cu_idx) {
CompUnitSP cu_sp;
DWARFDebugInfo *info = DebugInfo();
if (info) {
- DWARFCompileUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
+ DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu)
cu_sp = ParseCompileUnit(dwarf_cu, cu_idx);
}
@@ -876,7 +887,7 @@ bool SymbolFileDWARF::FixupAddress(Address &addr) {
lldb::LanguageType
SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) {
assert(sc.comp_unit);
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu)
return dwarf_cu->GetLanguageType();
else
@@ -886,7 +897,7 @@ SymbolFileDWARF::ParseCompileUnitLanguage(const SymbolContext &sc) {
size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
assert(sc.comp_unit);
size_t functions_added = 0;
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
DWARFDIECollection function_dies;
const size_t num_functions =
@@ -907,12 +918,12 @@ size_t SymbolFileDWARF::ParseCompileUnitFunctions(const SymbolContext &sc) {
bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
const SymbolContext &sc, FileSpecList &support_files) {
assert(sc.comp_unit);
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
- const DWARFDIE cu_die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFBaseDIE cu_die = dwarf_cu->GetUnitDIEOnly();
if (cu_die) {
- const char *cu_comp_dir = resolveCompDir(
+ FileSpec cu_comp_dir = resolveCompDir(
cu_die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr));
const dw_offset_t stmt_list = cu_die.GetAttributeValueAsUnsigned(
DW_AT_stmt_list, DW_INVALID_OFFSET);
@@ -931,7 +942,7 @@ bool SymbolFileDWARF::ParseCompileUnitSupportFiles(
bool SymbolFileDWARF::ParseCompileUnitIsOptimized(
const lldb_private::SymbolContext &sc) {
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu)
return dwarf_cu->GetIsOptimized();
return false;
@@ -941,14 +952,14 @@ bool SymbolFileDWARF::ParseImportedModules(
const lldb_private::SymbolContext &sc,
std::vector<lldb_private::ConstString> &imported_modules) {
assert(sc.comp_unit);
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
if (ClangModulesDeclVendor::LanguageSupportsClangModules(
sc.comp_unit->GetLanguage())) {
UpdateExternalModuleListIfNeeded();
if (sc.comp_unit) {
- const DWARFDIE die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFDIE die = dwarf_cu->DIE();
if (die) {
for (DWARFDIE child_die = die.GetFirstChild(); child_die;
@@ -998,8 +1009,7 @@ static void ParseDWARFLineTableCallback(dw_offset_t offset,
(ParseDWARFLineTableCallbackInfo *)userData;
LineTable *line_table = info->line_table;
- // If this is our first time here, we need to create a
- // sequence container.
+ // If this is our first time here, we need to create a sequence container.
if (!info->sequence_ap.get()) {
info->sequence_ap.reset(line_table->CreateLineSequenceContainer());
assert(info->sequence_ap.get());
@@ -1022,9 +1032,9 @@ bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
if (sc.comp_unit->GetLineTable() != NULL)
return true;
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
- const DWARFDIE dwarf_cu_die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFBaseDIE dwarf_cu_die = dwarf_cu->GetUnitDIEOnly();
if (dwarf_cu_die) {
const dw_offset_t cu_line_offset =
dwarf_cu_die.GetAttributeValueAsUnsigned(DW_AT_stmt_list,
@@ -1063,10 +1073,10 @@ bool SymbolFileDWARF::ParseCompileUnitLineTable(const SymbolContext &sc) {
&info);
SymbolFileDWARFDebugMap *debug_map_symfile = GetDebugMapSymfile();
if (debug_map_symfile) {
- // We have an object file that has a line table with addresses
- // that are not linked. We need to link the line table and convert
- // the addresses that are relative to the .o file into addresses
- // for the main executable.
+ // We have an object file that has a line table with addresses that
+ // are not linked. We need to link the line table and convert the
+ // addresses that are relative to the .o file into addresses for
+ // the main executable.
sc.comp_unit->SetLineTable(
debug_map_symfile->LinkOSOLineTable(this, line_table_ap.get()));
} else {
@@ -1105,11 +1115,11 @@ SymbolFileDWARF::ParseDebugMacros(lldb::offset_t *offset) {
bool SymbolFileDWARF::ParseCompileUnitDebugMacros(const SymbolContext &sc) {
assert(sc.comp_unit);
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu == nullptr)
return false;
- const DWARFDIE dwarf_cu_die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFBaseDIE dwarf_cu_die = dwarf_cu->GetUnitDIEOnly();
if (!dwarf_cu_die)
return false;
@@ -1142,9 +1152,9 @@ size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc,
case DW_TAG_lexical_block: {
Block *block = NULL;
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 entities.
+ // Skip any DW_TAG_subprogram DIEs that are inside of a normal or
+ // inlined functions. These will be parsed on their own as separate
+ // entities.
if (depth > 0)
break;
@@ -1172,18 +1182,14 @@ size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc,
assert(subprogram_low_pc == LLDB_INVALID_ADDRESS);
subprogram_low_pc = ranges.GetMinRangeBase(0);
} else if (tag == DW_TAG_inlined_subroutine) {
- // We get called here for inlined subroutines in two ways.
- // The first time is when we are making the Function object
- // for this inlined concrete instance. Since we're creating a top
- // level block at
+ // We get called here for inlined subroutines in two ways. The first
+ // time is when we are making the Function object for this inlined
+ // concrete instance. Since we're creating a top level block at
// here, the subprogram_low_pc will be LLDB_INVALID_ADDRESS. So we
- // need to
- // adjust the containing address.
- // The second time is when we are parsing the blocks inside the
- // function that contains
- // the inlined concrete instance. Since these will be blocks inside
- // the containing "real"
- // function the offset will be for that function.
+ // need to adjust the containing address. The second time is when we
+ // are parsing the blocks inside the function that contains the
+ // inlined concrete instance. Since these will be blocks inside the
+ // containing "real" function the offset will be for that function.
if (subprogram_low_pc == LLDB_INVALID_ADDRESS) {
subprogram_low_pc = ranges.GetMinRangeBase(0);
}
@@ -1238,9 +1244,9 @@ size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc,
break;
}
- // Only parse siblings of the block if we are not at depth zero. A depth
- // of zero indicates we are currently parsing the top level
- // DW_TAG_subprogram DIE
+ // Only parse siblings of the block if we are not at depth zero. A depth of
+ // zero indicates we are currently parsing the top level DW_TAG_subprogram
+ // DIE
if (depth == 0)
die.Clear();
@@ -1286,12 +1292,12 @@ void SymbolFileDWARF::ParseDeclsForContext(CompilerDeclContext decl_ctx) {
}
SymbolFileDWARF *SymbolFileDWARF::GetDWARFForUID(lldb::user_id_t uid) {
- // Anytime we get a "lldb::user_id_t" from an lldb_private::SymbolFile API
- // we must make sure we use the correct DWARF file when resolving things.
- // On MacOSX, when using SymbolFileDWARFDebugMap, we will use multiple
- // SymbolFileDWARF classes, one for each .o file. We can often end up
- // with references to other DWARF objects and we must be ready to receive
- // a "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
+ // Anytime we get a "lldb::user_id_t" from an lldb_private::SymbolFile API we
+ // must make sure we use the correct DWARF file when resolving things. On
+ // MacOSX, when using SymbolFileDWARFDebugMap, we will use multiple
+ // SymbolFileDWARF classes, one for each .o file. We can often end up with
+ // references to other DWARF objects and we must be ready to receive a
+ // "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
// instance.
SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile();
if (debug_map)
@@ -1302,12 +1308,12 @@ SymbolFileDWARF *SymbolFileDWARF::GetDWARFForUID(lldb::user_id_t uid) {
DWARFDIE
SymbolFileDWARF::GetDIEFromUID(lldb::user_id_t uid) {
- // Anytime we get a "lldb::user_id_t" from an lldb_private::SymbolFile API
- // we must make sure we use the correct DWARF file when resolving things.
- // On MacOSX, when using SymbolFileDWARFDebugMap, we will use multiple
- // SymbolFileDWARF classes, one for each .o file. We can often end up
- // with references to other DWARF objects and we must be ready to receive
- // a "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
+ // Anytime we get a "lldb::user_id_t" from an lldb_private::SymbolFile API we
+ // must make sure we use the correct DWARF file when resolving things. On
+ // MacOSX, when using SymbolFileDWARFDebugMap, we will use multiple
+ // SymbolFileDWARF classes, one for each .o file. We can often end up with
+ // references to other DWARF objects and we must be ready to receive a
+ // "lldb::user_id_t" that specifies a DIE from another SymbolFileDWARF
// instance.
SymbolFileDWARF *dwarf = GetDWARFForUID(uid);
if (dwarf)
@@ -1316,9 +1322,9 @@ SymbolFileDWARF::GetDIEFromUID(lldb::user_id_t uid) {
}
CompilerDecl SymbolFileDWARF::GetDeclForUID(lldb::user_id_t type_uid) {
- // Anytime we have a lldb::user_id_t, we must get the DIE by
- // calling SymbolFileDWARF::GetDIEFromUID(). See comments inside
- // the SymbolFileDWARF::GetDIEFromUID() for details.
+ // Anytime we have a lldb::user_id_t, we must get the DIE by calling
+ // SymbolFileDWARF::GetDIEFromUID(). See comments inside the
+ // SymbolFileDWARF::GetDIEFromUID() for details.
DWARFDIE die = GetDIEFromUID(type_uid);
if (die)
return die.GetDecl();
@@ -1327,9 +1333,9 @@ CompilerDecl SymbolFileDWARF::GetDeclForUID(lldb::user_id_t type_uid) {
CompilerDeclContext
SymbolFileDWARF::GetDeclContextForUID(lldb::user_id_t type_uid) {
- // Anytime we have a lldb::user_id_t, we must get the DIE by
- // calling SymbolFileDWARF::GetDIEFromUID(). See comments inside
- // the SymbolFileDWARF::GetDIEFromUID() for details.
+ // Anytime we have a lldb::user_id_t, we must get the DIE by calling
+ // SymbolFileDWARF::GetDIEFromUID(). See comments inside the
+ // SymbolFileDWARF::GetDIEFromUID() for details.
DWARFDIE die = GetDIEFromUID(type_uid);
if (die)
return die.GetDeclContext();
@@ -1338,9 +1344,9 @@ SymbolFileDWARF::GetDeclContextForUID(lldb::user_id_t type_uid) {
CompilerDeclContext
SymbolFileDWARF::GetDeclContextContainingUID(lldb::user_id_t type_uid) {
- // Anytime we have a lldb::user_id_t, we must get the DIE by
- // calling SymbolFileDWARF::GetDIEFromUID(). See comments inside
- // the SymbolFileDWARF::GetDIEFromUID() for details.
+ // Anytime we have a lldb::user_id_t, we must get the DIE by calling
+ // SymbolFileDWARF::GetDIEFromUID(). See comments inside the
+ // SymbolFileDWARF::GetDIEFromUID() for details.
DWARFDIE die = GetDIEFromUID(type_uid);
if (die)
return die.GetContainingDeclContext();
@@ -1348,9 +1354,9 @@ SymbolFileDWARF::GetDeclContextContainingUID(lldb::user_id_t type_uid) {
}
Type *SymbolFileDWARF::ResolveTypeUID(lldb::user_id_t type_uid) {
- // Anytime we have a lldb::user_id_t, we must get the DIE by
- // calling SymbolFileDWARF::GetDIEFromUID(). See comments inside
- // the SymbolFileDWARF::GetDIEFromUID() for details.
+ // Anytime we have a lldb::user_id_t, we must get the DIE by calling
+ // SymbolFileDWARF::GetDIEFromUID(). See comments inside the
+ // SymbolFileDWARF::GetDIEFromUID() for details.
DWARFDIE type_die = GetDIEFromUID(type_uid);
if (type_die)
return type_die.ResolveType();
@@ -1371,9 +1377,9 @@ Type *SymbolFileDWARF::ResolveTypeUID(const DWARFDIE &die,
log, "SymbolFileDWARF::ResolveTypeUID (die = 0x%8.8x) %s '%s'",
die.GetOffset(), die.GetTagAsCString(), die.GetName());
- // We might be coming in in the middle of a type tree (a class
- // within a class, an enum within a class), so parse any needed
- // parent DIEs before we get to this one...
+ // We might be coming in in the middle of a type tree (a class within a
+ // class, an enum within a class), so parse any needed parent DIEs before
+ // we get to this one...
DWARFDIE decl_ctx_die = GetDeclContextDIEContainingDIE(die);
if (decl_ctx_die) {
if (log) {
@@ -1401,8 +1407,8 @@ Type *SymbolFileDWARF::ResolveTypeUID(const DWARFDIE &die,
}
// This function is used when SymbolFileDWARFDebugMap owns a bunch of
-// SymbolFileDWARF objects to detect if this DWARF file is the one that
-// can resolve a compiler_type.
+// SymbolFileDWARF objects to detect if this DWARF file is the one that can
+// resolve a compiler_type.
bool SymbolFileDWARF::HasForwardDeclForClangType(
const CompilerType &compiler_type) {
CompilerType compiler_type_no_qualifiers =
@@ -1448,12 +1454,10 @@ bool SymbolFileDWARF::CompleteType(CompilerType &compiler_type) {
DWARFDIE dwarf_die = GetDIE(die_it->getSecond());
if (dwarf_die) {
- // Once we start resolving this type, remove it from the forward declaration
- // map in case anyone child members or other types require this type to get
- // resolved.
- // The type will get resolved when all of the calls to
- // SymbolFileDWARF::ResolveClangOpaqueTypeDefinition
- // are done.
+ // Once we start resolving this type, remove it from the forward
+ // declaration map in case anyone child members or other types require this
+ // type to get resolved. The type will get resolved when all of the calls
+ // to SymbolFileDWARF::ResolveClangOpaqueTypeDefinition are done.
GetForwardDeclClangTypeToDie().erase(die_it);
Type *type = GetDIEToType().lookup(dwarf_die.GetDIE());
@@ -1494,12 +1498,12 @@ Type *SymbolFileDWARF::ResolveType(const DWARFDIE &die,
}
CompileUnit *
-SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu,
+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) {
- // The symbol vendor doesn't know about this compile unit, we
- // need to parse and add it to the symbol vendor object.
+ // 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();
}
return (CompileUnit *)dwarf_cu->GetUserData();
@@ -1508,15 +1512,7 @@ SymbolFileDWARF::GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu,
size_t SymbolFileDWARF::GetObjCMethodDIEOffsets(ConstString class_name,
DIEArray &method_die_offsets) {
method_die_offsets.clear();
- if (m_using_apple_tables) {
- if (m_apple_objc_ap.get())
- m_apple_objc_ap->FindByName(class_name.GetCString(), method_die_offsets);
- } else {
- if (!m_indexed)
- Index();
-
- m_objc_class_selectors_index.Find(class_name, method_die_offsets);
- }
+ m_index->GetObjCMethods(class_name, method_die_offsets);
return method_die_offsets.size();
}
@@ -1560,9 +1556,9 @@ SymbolFileDWARF::GetDIE(const DIERef &die_ref) {
std::unique_ptr<SymbolFileDWARFDwo>
SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(
- DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) {
+ DWARFUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) {
// If we are using a dSYM file, we never want the standard DWO files since
- // the -gmodule support uses the same DWO machanism to specify full debug
+ // the -gmodules support uses the same DWO machanism to specify full debug
// info files for modules.
if (GetDebugMapSymfile())
return nullptr;
@@ -1589,7 +1585,7 @@ SymbolFileDWARF::GetDwoSymbolFileForCompileUnit(
if (!comp_dir)
return nullptr;
- dwo_file.SetFile(comp_dir, true);
+ dwo_file.SetFile(comp_dir, true, FileSpec::Style::native);
dwo_file.AppendPathComponent(dwo_name);
}
@@ -1617,9 +1613,9 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
- DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
+ DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
- const DWARFDIE die = dwarf_cu->GetCompileUnitDIEOnly();
+ const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly();
if (die && die.HasChildren() == false) {
const char *name = die.GetAttributeValueAsString(DW_AT_name, nullptr);
@@ -1632,35 +1628,35 @@ void SymbolFileDWARF::UpdateExternalModuleListIfNeeded() {
die.GetAttributeValueAsString(DW_AT_GNU_dwo_name, nullptr);
if (dwo_path) {
ModuleSpec dwo_module_spec;
- dwo_module_spec.GetFileSpec().SetFile(dwo_path, false);
+ dwo_module_spec.GetFileSpec().SetFile(dwo_path, false,
+ FileSpec::Style::native);
if (dwo_module_spec.GetFileSpec().IsRelative()) {
const char *comp_dir =
die.GetAttributeValueAsString(DW_AT_comp_dir, nullptr);
if (comp_dir) {
- dwo_module_spec.GetFileSpec().SetFile(comp_dir, true);
+ dwo_module_spec.GetFileSpec().SetFile(comp_dir, true,
+ FileSpec::Style::native);
dwo_module_spec.GetFileSpec().AppendPathComponent(dwo_path);
}
}
dwo_module_spec.GetArchitecture() =
m_obj_file->GetModule()->GetArchitecture();
- // When LLDB loads "external" modules it looks at the
- // presence of DW_AT_GNU_dwo_name.
- // However, when the already created module
- // (corresponding to .dwo itself) is being processed,
- // it will see the presence of DW_AT_GNU_dwo_name
- // (which contains the name of dwo file) and
- // will try to call ModuleList::GetSharedModule again.
- // In some cases (i.e. for empty files) Clang 4.0
- // generates a *.dwo file which has DW_AT_GNU_dwo_name,
- // but no DW_AT_comp_dir. In this case the method
- // ModuleList::GetSharedModule will fail and
- // the warning will be printed. However, as one can notice
- // in this case we don't actually need to try to load the already
- // loaded module (corresponding to .dwo) so we simply skip it.
+ // When LLDB loads "external" modules it looks at the presence of
+ // DW_AT_GNU_dwo_name. However, when the already created module
+ // (corresponding to .dwo itself) is being processed, it will see
+ // the presence of DW_AT_GNU_dwo_name (which contains the name of
+ // dwo file) and will try to call ModuleList::GetSharedModule
+ // again. In some cases (i.e. for empty files) Clang 4.0 generates
+ // a *.dwo file which has DW_AT_GNU_dwo_name, but no
+ // DW_AT_comp_dir. In this case the method
+ // ModuleList::GetSharedModule will fail and the warning will be
+ // printed. However, as one can notice in this case we don't
+ // actually need to try to load the already loaded module
+ // (corresponding to .dwo) so we simply skip it.
if (m_obj_file->GetFileSpec()
.GetFileNameExtension()
- .GetStringRef() == "dwo" &&
+ .GetStringRef() == ".dwo" &&
llvm::StringRef(m_obj_file->GetFileSpec().GetPath())
.endswith(dwo_module_spec.GetFileSpec().GetPath())) {
continue;
@@ -1751,13 +1747,11 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
const dw_offset_t cu_offset =
debug_info->GetCompileUnitAranges().FindAddress(file_vm_addr);
if (cu_offset == DW_INVALID_OFFSET) {
- // Global variables are not in the compile unit address ranges. The only
- // way to
- // currently find global variables is to iterate over the
- // .debug_pubnames or the
- // __apple_names table and find all items in there that point to
- // DW_TAG_variable
- // DIEs and then find the address that matches.
+ // Global variables are not in the compile unit address ranges. The
+ // only way to currently find global variables is to iterate over the
+ // .debug_pubnames or the __apple_names table and find all items in
+ // there that point to DW_TAG_variable DIEs and then find the address
+ // that matches.
if (resolve_scope & eSymbolContextVariable) {
GlobalVariableMap &map = GetGlobalAranges();
const GlobalVariableMap::Entry *entry =
@@ -1774,7 +1768,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
}
} else {
uint32_t cu_idx = DW_INVALID_INDEX;
- DWARFCompileUnit *dwarf_cu =
+ DWARFUnit *dwarf_cu =
debug_info->GetCompileUnit(cu_offset, &cu_idx);
if (dwarf_cu) {
sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
@@ -1825,13 +1819,10 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
LineTable *line_table = sc.comp_unit->GetLineTable();
if (line_table != NULL) {
// 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 to be in
- // terms
- // of the debug map executable. Either way, calling
- // FixupAddress()
- // will work for us.
+ // 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
+ // to be in terms of the debug map executable. Either way,
+ // calling FixupAddress() will work for us.
Address exe_so_addr(so_addr);
if (FixupAddress(exe_so_addr)) {
if (line_table->FindLineEntryByAddress(exe_so_addr,
@@ -1845,11 +1836,11 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const Address &so_addr,
if (force_check_line_table &&
!(resolved & eSymbolContextLineEntry)) {
// We might have had a compile unit that had discontiguous
- // address ranges where the gaps are symbols that don't have
- // any debug info. Discontiguous compile unit address ranges
- // should only happen when there aren't other functions from
- // other compile units in these gaps. This helps keep the size
- // of the aranges down.
+ // address ranges where the gaps are symbols that don't have any
+ // debug info. Discontiguous compile unit address ranges should
+ // 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;
resolved &= ~eSymbolContextCompUnit;
}
@@ -1876,7 +1867,7 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
DWARFDebugInfo *debug_info = DebugInfo();
if (debug_info) {
uint32_t cu_idx;
- DWARFCompileUnit *dwarf_cu = NULL;
+ DWARFUnit *dwarf_cu = NULL;
for (cu_idx = 0;
(dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx)) != NULL;
@@ -1891,8 +1882,8 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
if (sc.comp_unit) {
uint32_t file_idx = UINT32_MAX;
- // If we are looking for inline functions only and we don't
- // find it in the support files, we are done.
+ // If we are looking for inline functions only and we don't find it
+ // in the support files, we are done.
if (check_inlines) {
file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex(
1, file_spec, true);
@@ -1904,8 +1895,8 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
LineTable *line_table = sc.comp_unit->GetLineTable();
if (line_table != NULL && line != 0) {
- // We will have already looked up the file index if
- // we are searching for inline entries.
+ // We will have already looked up the file index if we are
+ // searching for inline entries.
if (!check_inlines)
file_idx = sc.comp_unit->GetSupportFiles().FindFileIndex(
1, file_spec, true);
@@ -1962,16 +1953,14 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
}
} else if (file_spec_matches_cu_file_spec && !check_inlines) {
// only append the context if we aren't looking for inline call
- // sites
- // by file and line and if the file spec matches that of the
- // compile unit
+ // sites by file and line and if the file spec matches that of
+ // the compile unit
sc_list.Append(sc);
}
} else if (file_spec_matches_cu_file_spec && !check_inlines) {
// only append the context if we aren't looking for inline call
- // sites
- // by file and line and if the file spec matches that of the
- // compile unit
+ // sites by file and line and if the file spec matches that of
+ // the compile unit
sc_list.Append(sc);
}
@@ -1988,143 +1977,15 @@ uint32_t SymbolFileDWARF::ResolveSymbolContext(const FileSpec &file_spec,
void SymbolFileDWARF::PreloadSymbols() {
std::lock_guard<std::recursive_mutex> guard(
GetObjectFile()->GetModule()->GetMutex());
- Index();
-}
-
-void SymbolFileDWARF::Index() {
- if (m_indexed)
- return;
- m_indexed = true;
- static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
- Timer scoped_timer(
- func_cat, "SymbolFileDWARF::Index (%s)",
- GetObjectFile()->GetFileSpec().GetFilename().AsCString("<Unknown>"));
-
- DWARFDebugInfo *debug_info = DebugInfo();
- if (debug_info) {
- const uint32_t num_compile_units = GetNumCompileUnits();
- if (num_compile_units == 0)
- return;
-
- std::vector<NameToDIE> function_basename_index(num_compile_units);
- std::vector<NameToDIE> function_fullname_index(num_compile_units);
- std::vector<NameToDIE> function_method_index(num_compile_units);
- std::vector<NameToDIE> function_selector_index(num_compile_units);
- std::vector<NameToDIE> objc_class_selectors_index(num_compile_units);
- std::vector<NameToDIE> global_index(num_compile_units);
- std::vector<NameToDIE> type_index(num_compile_units);
- std::vector<NameToDIE> namespace_index(num_compile_units);
-
- // std::vector<bool> might be implemented using bit test-and-set, so use
- // uint8_t instead.
- std::vector<uint8_t> clear_cu_dies(num_compile_units, false);
- auto parser_fn = [debug_info, &function_basename_index,
- &function_fullname_index, &function_method_index,
- &function_selector_index, &objc_class_selectors_index,
- &global_index, &type_index,
- &namespace_index](size_t cu_idx) {
- DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
- if (dwarf_cu) {
- dwarf_cu->Index(
- function_basename_index[cu_idx], function_fullname_index[cu_idx],
- function_method_index[cu_idx], function_selector_index[cu_idx],
- objc_class_selectors_index[cu_idx], global_index[cu_idx],
- type_index[cu_idx], namespace_index[cu_idx]);
- }
- };
-
- auto extract_fn = [debug_info, &clear_cu_dies](size_t cu_idx) {
- DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
- if (dwarf_cu) {
- // dwarf_cu->ExtractDIEsIfNeeded(false) will return zero if the
- // DIEs for a compile unit have already been parsed.
- if (dwarf_cu->ExtractDIEsIfNeeded(false) > 1)
- clear_cu_dies[cu_idx] = true;
- }
- };
-
- // Create a task runner that extracts dies for each DWARF compile unit in a
- // separate thread
- //----------------------------------------------------------------------
- // First figure out which compile units didn't have their DIEs already
- // parsed and remember this. If no DIEs were parsed prior to this index
- // function call, we are going to want to clear the CU dies after we
- // are done indexing to make sure we don't pull in all DWARF dies, but
- // we need to wait until all compile units have been indexed in case
- // a DIE in one compile unit refers to another and the indexes accesses
- // those DIEs.
- //----------------------------------------------------------------------
- TaskMapOverInt(0, num_compile_units, extract_fn);
-
- // Now create a task runner that can index each DWARF compile unit in a
- // separate
- // thread so we can index quickly.
-
- TaskMapOverInt(0, num_compile_units, parser_fn);
-
- auto finalize_fn = [](NameToDIE &index, std::vector<NameToDIE> &srcs) {
- for (auto &src : srcs)
- index.Append(src);
- index.Finalize();
- };
-
- TaskPool::RunTasks(
- [&]() {
- finalize_fn(m_function_basename_index, function_basename_index);
- },
- [&]() {
- finalize_fn(m_function_fullname_index, function_fullname_index);
- },
- [&]() { finalize_fn(m_function_method_index, function_method_index); },
- [&]() {
- finalize_fn(m_function_selector_index, function_selector_index);
- },
- [&]() {
- finalize_fn(m_objc_class_selectors_index, objc_class_selectors_index);
- },
- [&]() { finalize_fn(m_global_index, global_index); },
- [&]() { finalize_fn(m_type_index, type_index); },
- [&]() { finalize_fn(m_namespace_index, namespace_index); });
-
- //----------------------------------------------------------------------
- // Keep memory down by clearing DIEs for any compile units if indexing
- // caused us to load the compile unit's DIEs.
- //----------------------------------------------------------------------
- for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
- if (clear_cu_dies[cu_idx])
- debug_info->GetCompileUnitAtIndex(cu_idx)->ClearDIEs(true);
- }
-
-#if defined(ENABLE_DEBUG_PRINTF)
- StreamFile s(stdout, false);
- s.Printf("DWARF index for '%s':",
- GetObjectFile()->GetFileSpec().GetPath().c_str());
- s.Printf("\nFunction basenames:\n");
- m_function_basename_index.Dump(&s);
- s.Printf("\nFunction fullnames:\n");
- m_function_fullname_index.Dump(&s);
- s.Printf("\nFunction methods:\n");
- m_function_method_index.Dump(&s);
- s.Printf("\nFunction selectors:\n");
- m_function_selector_index.Dump(&s);
- s.Printf("\nObjective C class selectors:\n");
- m_objc_class_selectors_index.Dump(&s);
- s.Printf("\nGlobals and statics:\n");
- m_global_index.Dump(&s);
- s.Printf("\nTypes:\n");
- m_type_index.Dump(&s);
- s.Printf("\nNamespaces:\n");
- m_namespace_index.Dump(&s);
-#endif
- }
+ m_index->Preload();
}
bool SymbolFileDWARF::DeclContextMatchesThisSymbolFile(
const lldb_private::CompilerDeclContext *decl_ctx) {
if (decl_ctx == nullptr || !decl_ctx->IsValid()) {
- // Invalid namespace decl which means we aren't matching only things
- // in this symbol file, so return true to indicate it matches this
- // symbol file.
+ // Invalid namespace decl which means we aren't matching only things in
+ // this symbol file, so return true to indicate it matches this symbol
+ // file.
return true;
}
@@ -2146,14 +2007,15 @@ bool SymbolFileDWARF::DeclContextMatchesThisSymbolFile(
uint32_t SymbolFileDWARF::FindGlobalVariables(
const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches, VariableList &variables) {
+ uint32_t max_matches, VariableList &variables) {
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
if (log)
GetObjectFile()->GetModule()->LogMessage(
- log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
- "parent_decl_ctx=%p, append=%u, max_matches=%u, variables)",
- name.GetCString(), static_cast<const void *>(parent_decl_ctx), append,
+ log,
+ "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
+ "parent_decl_ctx=%p, max_matches=%u, variables)",
+ name.GetCString(), static_cast<const void *>(parent_decl_ctx),
max_matches);
if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
@@ -2163,42 +2025,28 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
if (info == NULL)
return 0;
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- variables.Clear();
-
- // Remember how many variables are in the list before we search in case
- // we are appending the results to a variable list.
+ // Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
- DIEArray die_offsets;
-
- if (m_using_apple_tables) {
- if (m_apple_names_ap.get()) {
- const char *name_cstr = name.GetCString();
- llvm::StringRef basename;
- llvm::StringRef context;
-
- if (!CPlusPlusLanguage::ExtractContextAndIdentifier(name_cstr, context,
- basename))
- basename = name_cstr;
+ llvm::StringRef basename;
+ llvm::StringRef context;
- m_apple_names_ap->FindByName(basename.data(), die_offsets);
- }
- } else {
- // Index the DWARF if we haven't already
- if (!m_indexed)
- Index();
-
- m_global_index.Find(name, die_offsets);
- }
+ if (!CPlusPlusLanguage::ExtractContextAndIdentifier(name.GetCString(),
+ context, basename))
+ basename = name.GetStringRef();
+ DIEArray die_offsets;
+ m_index->GetGlobalVariables(ConstString(basename), die_offsets);
const size_t num_die_matches = die_offsets.size();
if (num_die_matches) {
SymbolContext sc;
sc.module_sp = m_obj_file->GetModule();
assert(sc.module_sp);
+ // Loop invariant: Variables up to this index have been checked for context
+ // matches.
+ uint32_t pruned_idx = original_size;
+
bool done = false;
for (size_t i = 0; i < num_die_matches && !done; ++i) {
const DIERef &die_ref = die_offsets[i];
@@ -2229,18 +2077,21 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
ParseVariables(sc, die, LLDB_INVALID_ADDRESS, false, false,
&variables);
+ while (pruned_idx < variables.GetSize()) {
+ VariableSP var_sp = variables.GetVariableAtIndex(pruned_idx);
+ if (var_sp->GetName().GetStringRef().contains(name.GetStringRef()))
+ ++pruned_idx;
+ else
+ variables.RemoveVariableAtIndex(pruned_idx);
+ }
if (variables.GetSize() - original_size >= max_matches)
done = true;
} break;
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_names "
- "accelerator table had bad die 0x%8.8x for '%s')\n",
- die_ref.die_offset, name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ name.GetStringRef());
}
}
}
@@ -2249,54 +2100,37 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(
const uint32_t num_matches = variables.GetSize() - original_size;
if (log && num_matches > 0) {
GetObjectFile()->GetModule()->LogMessage(
- log, "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
- "parent_decl_ctx=%p, append=%u, max_matches=%u, variables) => %u",
- name.GetCString(), static_cast<const void *>(parent_decl_ctx), append,
+ log,
+ "SymbolFileDWARF::FindGlobalVariables (name=\"%s\", "
+ "parent_decl_ctx=%p, max_matches=%u, variables) => %u",
+ name.GetCString(), static_cast<const void *>(parent_decl_ctx),
max_matches, num_matches);
}
return num_matches;
}
uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
VariableList &variables) {
Log *log(LogChannelDWARF::GetLogIfAll(DWARF_LOG_LOOKUPS));
if (log) {
GetObjectFile()->GetModule()->LogMessage(
- log, "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", append=%u, "
- "max_matches=%u, variables)",
- regex.GetText().str().c_str(), append, max_matches);
+ log,
+ "SymbolFileDWARF::FindGlobalVariables (regex=\"%s\", "
+ "max_matches=%u, variables)",
+ regex.GetText().str().c_str(), max_matches);
}
DWARFDebugInfo *info = DebugInfo();
if (info == NULL)
return 0;
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- variables.Clear();
-
- // Remember how many variables are in the list before we search in case
- // we are appending the results to a variable list.
+ // Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
DIEArray die_offsets;
-
- if (m_using_apple_tables) {
- if (m_apple_names_ap.get()) {
- DWARFMappedHash::DIEInfoArray hash_data_array;
- if (m_apple_names_ap->AppendAllDIEsThatMatchingRegex(regex,
- hash_data_array))
- DWARFMappedHash::ExtractDIEArray(hash_data_array, die_offsets);
- }
- } else {
- // Index the DWARF if we haven't already
- if (!m_indexed)
- Index();
-
- m_global_index.Find(regex, die_offsets);
- }
+ m_index->GetGlobalVariables(regex, die_offsets);
SymbolContext sc;
sc.module_sp = m_obj_file->GetModule();
@@ -2315,14 +2149,8 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
if (variables.GetSize() - original_size >= max_matches)
break;
- } else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_names "
- "accelerator table had bad die 0x%8.8x for regex '%s')\n",
- die_ref.die_offset, regex.GetText().str().c_str());
- }
- }
+ } else
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset, regex.GetText());
}
}
@@ -2330,13 +2158,6 @@ uint32_t SymbolFileDWARF::FindGlobalVariables(const RegularExpression &regex,
return variables.GetSize() - original_size;
}
-bool SymbolFileDWARF::ResolveFunction(const DIERef &die_ref,
- bool include_inlines,
- SymbolContextList &sc_list) {
- DWARFDIE die = DebugInfo()->GetDIE(die_ref);
- return ResolveFunction(die, include_inlines, sc_list);
-}
-
bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die,
bool include_inlines,
SymbolContextList &sc_list) {
@@ -2390,54 +2211,11 @@ bool SymbolFileDWARF::ResolveFunction(const DWARFDIE &orig_die,
return false;
}
-void SymbolFileDWARF::FindFunctions(const ConstString &name,
- const NameToDIE &name_to_die,
- bool include_inlines,
- SymbolContextList &sc_list) {
- DIEArray die_offsets;
- if (name_to_die.Find(name, die_offsets)) {
- ParseFunctions(die_offsets, include_inlines, sc_list);
- }
-}
-
-void SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
- const NameToDIE &name_to_die,
- bool include_inlines,
- SymbolContextList &sc_list) {
- DIEArray die_offsets;
- if (name_to_die.Find(regex, die_offsets)) {
- ParseFunctions(die_offsets, include_inlines, sc_list);
- }
-}
-
-void SymbolFileDWARF::FindFunctions(
- const RegularExpression &regex,
- const DWARFMappedHash::MemoryTable &memory_table, bool include_inlines,
- SymbolContextList &sc_list) {
- DIEArray die_offsets;
- DWARFMappedHash::DIEInfoArray hash_data_array;
- if (memory_table.AppendAllDIEsThatMatchingRegex(regex, hash_data_array)) {
- DWARFMappedHash::ExtractDIEArray(hash_data_array, die_offsets);
- ParseFunctions(die_offsets, include_inlines, sc_list);
- }
-}
-
-void SymbolFileDWARF::ParseFunctions(const DIEArray &die_offsets,
- bool include_inlines,
- SymbolContextList &sc_list) {
- const size_t num_matches = die_offsets.size();
- if (num_matches) {
- for (size_t i = 0; i < num_matches; ++i)
- ResolveFunction(die_offsets[i], include_inlines, sc_list);
- }
-}
-
bool SymbolFileDWARF::DIEInDeclContext(const CompilerDeclContext *decl_ctx,
const DWARFDIE &die) {
// If we have no parent decl context to match this DIE matches, and if the
- // parent
- // decl context isn't valid, we aren't trying to look for any particular decl
- // context so any die matches.
+ // parent decl context isn't valid, we aren't trying to look for any
+ // particular decl context so any die matches.
if (decl_ctx == nullptr || !decl_ctx->IsValid())
return true;
@@ -2486,10 +2264,8 @@ SymbolFileDWARF::FindFunctions(const ConstString &name,
if (name.IsEmpty())
return 0;
- // Remember how many sc_list are in the list before we search in case
- // we are appending the results to a variable list.
-
- const char *name_cstr = name.GetCString();
+ // Remember how many sc_list are in the list before we search in case we are
+ // appending the results to a variable list.
const uint32_t original_size = sc_list.GetSize();
@@ -2497,228 +2273,17 @@ SymbolFileDWARF::FindFunctions(const ConstString &name,
if (info == NULL)
return 0;
- std::set<const DWARFDebugInfoEntry *> resolved_dies;
- if (m_using_apple_tables) {
- if (m_apple_names_ap.get()) {
-
- DIEArray die_offsets;
-
- uint32_t num_matches = 0;
-
- if (name_type_mask & eFunctionNameTypeFull) {
- // If they asked for the full name, match what they typed. At some
- // point we may
- // want to canonicalize this (strip double spaces, etc. For now, we
- // just add all the
- // dies that we find by exact match.
- num_matches = m_apple_names_ap->FindByName(name_cstr, die_offsets);
- for (uint32_t i = 0; i < num_matches; i++) {
- const DIERef &die_ref = die_offsets[i];
- DWARFDIE die = info->GetDIE(die_ref);
- if (die) {
- if (!DIEInDeclContext(parent_decl_ctx, die))
- continue; // The containing decl contexts don't match
-
- if (resolved_dies.find(die.GetDIE()) == resolved_dies.end()) {
- if (ResolveFunction(die, include_inlines, sc_list))
- resolved_dies.insert(die.GetDIE());
- }
- } else {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_names "
- "accelerator table had bad die 0x%8.8x for '%s')",
- die_ref.die_offset, name_cstr);
- }
- }
- }
-
- if (name_type_mask & eFunctionNameTypeSelector) {
- if (parent_decl_ctx && parent_decl_ctx->IsValid())
- return 0; // no selectors in namespaces
-
- num_matches = m_apple_names_ap->FindByName(name_cstr, die_offsets);
- // Now make sure these are actually ObjC methods. In this case we can
- // simply look up the name,
- // and if it is an ObjC method name, we're good.
+ llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
+ DIEArray offsets;
+ CompilerDeclContext empty_decl_ctx;
+ if (!parent_decl_ctx)
+ parent_decl_ctx = &empty_decl_ctx;
- for (uint32_t i = 0; i < num_matches; i++) {
- const DIERef &die_ref = die_offsets[i];
- DWARFDIE die = info->GetDIE(die_ref);
- if (die) {
- const char *die_name = die.GetName();
- if (ObjCLanguage::IsPossibleObjCMethodName(die_name)) {
- if (resolved_dies.find(die.GetDIE()) == resolved_dies.end()) {
- if (ResolveFunction(die, include_inlines, sc_list))
- resolved_dies.insert(die.GetDIE());
- }
- }
- } else {
- GetObjectFile()->GetModule()->ReportError(
- "the DWARF debug information has been modified (.apple_names "
- "accelerator table had bad die 0x%8.8x for '%s')",
- die_ref.die_offset, name_cstr);
- }
- }
- die_offsets.clear();
- }
-
- if (((name_type_mask & eFunctionNameTypeMethod) && !parent_decl_ctx) ||
- name_type_mask & eFunctionNameTypeBase) {
- // The apple_names table stores just the "base name" of C++ methods in
- // the table. So we have to
- // extract the base name, look that up, and if there is any other
- // information in the name we were
- // passed in we have to post-filter based on that.
-
- // FIXME: Arrange the logic above so that we don't calculate the base
- // name twice:
- num_matches = m_apple_names_ap->FindByName(name_cstr, die_offsets);
-
- for (uint32_t i = 0; i < num_matches; i++) {
- const DIERef &die_ref = die_offsets[i];
- DWARFDIE die = info->GetDIE(die_ref);
- if (die) {
- if (!DIEInDeclContext(parent_decl_ctx, die))
- continue; // The containing decl contexts don't match
-
- // If we get to here, the die is good, and we should add it:
- if (resolved_dies.find(die.GetDIE()) == resolved_dies.end() &&
- ResolveFunction(die, include_inlines, sc_list)) {
- bool keep_die = true;
- if ((name_type_mask &
- (eFunctionNameTypeBase | eFunctionNameTypeMethod)) !=
- (eFunctionNameTypeBase | eFunctionNameTypeMethod)) {
- // We are looking for either basenames or methods, so we need to
- // trim out the ones we won't want by looking at the type
- SymbolContext sc;
- if (sc_list.GetLastContext(sc)) {
- if (sc.block) {
- // We have an inlined function
- } else if (sc.function) {
- Type *type = sc.function->GetType();
-
- if (type) {
- CompilerDeclContext decl_ctx =
- GetDeclContextContainingUID(type->GetID());
- if (decl_ctx.IsStructUnionOrClass()) {
- if (name_type_mask & eFunctionNameTypeBase) {
- sc_list.RemoveContextAtIndex(sc_list.GetSize() - 1);
- keep_die = false;
- }
- } else {
- if (name_type_mask & eFunctionNameTypeMethod) {
- sc_list.RemoveContextAtIndex(sc_list.GetSize() - 1);
- keep_die = false;
- }
- }
- } else {
- GetObjectFile()->GetModule()->ReportWarning(
- "function at die offset 0x%8.8x had no function type",
- die_ref.die_offset);
- }
- }
- }
- }
- if (keep_die)
- resolved_dies.insert(die.GetDIE());
- }
- } else {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_names "
- "accelerator table had bad die 0x%8.8x for '%s')",
- die_ref.die_offset, name_cstr);
- }
- }
- die_offsets.clear();
- }
- }
- } else {
-
- // Index the DWARF if we haven't already
- if (!m_indexed)
- Index();
-
- if (name_type_mask & eFunctionNameTypeFull) {
- FindFunctions(name, m_function_fullname_index, include_inlines, sc_list);
-
- // FIXME Temporary workaround for global/anonymous namespace
- // functions debugging FreeBSD and Linux binaries.
- // If we didn't find any functions in the global namespace try
- // looking in the basename index but ignore any returned
- // functions that have a namespace but keep functions which
- // have an anonymous namespace
- // TODO: The arch in the object file isn't correct for MSVC
- // binaries on windows, we should find a way to make it
- // correct and handle those symbols as well.
- if (sc_list.GetSize() == original_size) {
- ArchSpec arch;
- if (!parent_decl_ctx && GetObjectFile()->GetArchitecture(arch) &&
- arch.GetTriple().isOSBinFormatELF()) {
- SymbolContextList temp_sc_list;
- FindFunctions(name, m_function_basename_index, include_inlines,
- temp_sc_list);
- SymbolContext sc;
- for (uint32_t i = 0; i < temp_sc_list.GetSize(); i++) {
- if (temp_sc_list.GetContextAtIndex(i, sc)) {
- ConstString mangled_name =
- sc.GetFunctionName(Mangled::ePreferMangled);
- ConstString demangled_name =
- sc.GetFunctionName(Mangled::ePreferDemangled);
- // Mangled names on Linux and FreeBSD are of the form:
- // _ZN18function_namespace13function_nameEv.
- if (strncmp(mangled_name.GetCString(), "_ZN", 3) ||
- !strncmp(demangled_name.GetCString(), "(anonymous namespace)",
- 21)) {
- sc_list.Append(sc);
- }
- }
- }
- }
- }
- }
- DIEArray die_offsets;
- if (name_type_mask & eFunctionNameTypeBase) {
- uint32_t num_base = m_function_basename_index.Find(name, die_offsets);
- for (uint32_t i = 0; i < num_base; i++) {
- DWARFDIE die = info->GetDIE(die_offsets[i]);
- if (die) {
- if (!DIEInDeclContext(parent_decl_ctx, die))
- continue; // The containing decl contexts don't match
-
- // If we get to here, the die is good, and we should add it:
- if (resolved_dies.find(die.GetDIE()) == resolved_dies.end()) {
- if (ResolveFunction(die, include_inlines, sc_list))
- resolved_dies.insert(die.GetDIE());
- }
- }
- }
- die_offsets.clear();
- }
-
- if (name_type_mask & eFunctionNameTypeMethod) {
- if (parent_decl_ctx && parent_decl_ctx->IsValid())
- return 0; // no methods in namespaces
-
- uint32_t num_base = m_function_method_index.Find(name, die_offsets);
- {
- for (uint32_t i = 0; i < num_base; i++) {
- DWARFDIE die = info->GetDIE(die_offsets[i]);
- if (die) {
- // If we get to here, the die is good, and we should add it:
- if (resolved_dies.find(die.GetDIE()) == resolved_dies.end()) {
- if (ResolveFunction(die, include_inlines, sc_list))
- resolved_dies.insert(die.GetDIE());
- }
- }
- }
- }
- die_offsets.clear();
- }
-
- if ((name_type_mask & eFunctionNameTypeSelector) &&
- (!parent_decl_ctx || !parent_decl_ctx->IsValid())) {
- FindFunctions(name, m_function_selector_index, include_inlines, sc_list);
- }
+ std::vector<DWARFDIE> dies;
+ m_index->GetFunctions(name, *info, *parent_decl_ctx, name_type_mask, dies);
+ for (const DWARFDIE &die: dies) {
+ if (resolved_dies.insert(die.GetDIE()).second)
+ ResolveFunction(die, include_inlines, sc_list);
}
// Return the number of variable that were appended to the list
@@ -2755,21 +2320,26 @@ uint32_t SymbolFileDWARF::FindFunctions(const RegularExpression &regex,
if (!append)
sc_list.Clear();
- // Remember how many sc_list are in the list before we search in case
- // we are appending the results to a variable list.
- uint32_t original_size = sc_list.GetSize();
+ DWARFDebugInfo *info = DebugInfo();
+ if (!info)
+ return 0;
- if (m_using_apple_tables) {
- if (m_apple_names_ap.get())
- FindFunctions(regex, *m_apple_names_ap, include_inlines, sc_list);
- } else {
- // Index the DWARF if we haven't already
- if (!m_indexed)
- Index();
+ // Remember how many sc_list are in the list before we search in case we are
+ // appending the results to a variable list.
+ uint32_t original_size = sc_list.GetSize();
- FindFunctions(regex, m_function_basename_index, include_inlines, sc_list);
+ DIEArray offsets;
+ m_index->GetFunctions(regex, offsets);
- FindFunctions(regex, m_function_fullname_index, include_inlines, sc_list);
+ llvm::DenseSet<const DWARFDebugInfoEntry *> resolved_dies;
+ for (DIERef ref : offsets) {
+ DWARFDIE die = info->GetDIE(ref);
+ if (!die) {
+ m_index->ReportInvalidDIEOffset(ref.die_offset, regex.GetText());
+ continue;
+ }
+ if (resolved_dies.insert(die.GetDIE()).second)
+ ResolveFunction(die, include_inlines, sc_list);
}
// Return the number of variable that were appended to the list
@@ -2785,7 +2355,7 @@ void SymbolFileDWARF::GetMangledNamesForFunction(
num_comp_units = info->GetNumCompileUnits();
for (uint32_t i = 0; i < num_comp_units; i++) {
- DWARFCompileUnit *cu = info->GetCompileUnitAtIndex(i);
+ DWARFUnit *cu = info->GetCompileUnitAtIndex(i);
if (cu == nullptr)
continue;
@@ -2847,19 +2417,7 @@ uint32_t SymbolFileDWARF::FindTypes(
return 0;
DIEArray die_offsets;
-
- if (m_using_apple_tables) {
- if (m_apple_types_ap.get()) {
- const char *name_cstr = name.GetCString();
- m_apple_types_ap->FindByName(name_cstr, die_offsets);
- }
- } else {
- if (!m_indexed)
- Index();
-
- m_type_index.Find(name, die_offsets);
- }
-
+ m_index->GetTypes(name, die_offsets);
const size_t num_die_matches = die_offsets.size();
if (num_die_matches) {
@@ -2881,12 +2439,8 @@ uint32_t SymbolFileDWARF::FindTypes(
break;
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_types "
- "accelerator table had bad die 0x%8.8x for '%s')\n",
- die_ref.die_offset, name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ name.GetStringRef());
}
}
const uint32_t num_matches = types.GetSize() - initial_types_size;
@@ -2935,25 +2489,13 @@ size_t SymbolFileDWARF::FindTypes(const std::vector<CompilerContext> &context,
if (context.empty())
return 0;
- DIEArray die_offsets;
-
ConstString name = context.back().name;
if (!name)
return 0;
- if (m_using_apple_tables) {
- if (m_apple_types_ap.get()) {
- const char *name_cstr = name.GetCString();
- m_apple_types_ap->FindByName(name_cstr, die_offsets);
- }
- } else {
- if (!m_indexed)
- Index();
-
- m_type_index.Find(name, die_offsets);
- }
-
+ DIEArray die_offsets;
+ m_index->GetTypes(name, die_offsets);
const size_t num_die_matches = die_offsets.size();
if (num_die_matches) {
@@ -2976,12 +2518,8 @@ size_t SymbolFileDWARF::FindTypes(const std::vector<CompilerContext> &context,
++num_matches;
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_types "
- "accelerator table had bad die 0x%8.8x for '%s')\n",
- die_ref.die_offset, name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ name.GetStringRef());
}
}
return num_matches;
@@ -3008,21 +2546,7 @@ SymbolFileDWARF::FindNamespace(const SymbolContext &sc, const ConstString &name,
DWARFDebugInfo *info = DebugInfo();
if (info) {
DIEArray die_offsets;
-
- // Index if we already haven't to make sure the compile units
- // get indexed and make their global DIE index list
- if (m_using_apple_tables) {
- if (m_apple_namespaces_ap.get()) {
- const char *name_cstr = name.GetCString();
- m_apple_namespaces_ap->FindByName(name_cstr, die_offsets);
- }
- } else {
- if (!m_indexed)
- Index();
-
- m_namespace_index.Find(name, die_offsets);
- }
-
+ m_index->GetNamespaces(name, die_offsets);
const size_t num_matches = die_offsets.size();
if (num_matches) {
for (size_t i = 0; i < num_matches; ++i) {
@@ -3040,13 +2564,8 @@ SymbolFileDWARF::FindNamespace(const SymbolContext &sc, const ConstString &name,
break;
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified "
- "(.apple_namespaces accelerator table had bad die 0x%8.8x for "
- "'%s')\n",
- die_ref.die_offset, name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ name.GetStringRef());
}
}
}
@@ -3105,6 +2624,7 @@ SymbolFileDWARF::GetDeclContextDIEContainingDIE(const DWARFDIE &orig_die) {
if (orig_die != die) {
switch (die.Tag()) {
case DW_TAG_compile_unit:
+ case DW_TAG_partial_unit:
case DW_TAG_namespace:
case DW_TAG_structure_type:
case DW_TAG_union_type:
@@ -3159,16 +2679,14 @@ SymbolFileDWARF::GetObjCClassSymbol(const ConstString &objc_class_name) {
}
// Some compilers don't emit the DW_AT_APPLE_objc_complete_type attribute. If
-// they don't
-// then we can end up looking through all class types for a complete type and
-// never find
-// the full definition. We need to know if this attribute is supported, so we
-// determine
-// this here and cache th result. We also need to worry about the debug map
+// they don't then we can end up looking through all class types for a complete
+// type and never find the full definition. We need to know if this attribute
+// is supported, so we determine this here and cache th result. We also need to
+// worry about the debug map
// DWARF file
// if we are doing darwin DWARF in .o file debugging.
bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(
- DWARFCompileUnit *cu) {
+ DWARFUnit *cu) {
if (m_supports_DW_AT_APPLE_objc_complete_type == eLazyBoolCalculate) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolNo;
if (cu && cu->Supports_DW_AT_APPLE_objc_complete_type())
@@ -3177,7 +2695,7 @@ bool SymbolFileDWARF::Supports_DW_AT_APPLE_objc_complete_type(
DWARFDebugInfo *debug_info = DebugInfo();
const uint32_t num_compile_units = GetNumCompileUnits();
for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
- DWARFCompileUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
+ DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
if (dwarf_cu != cu &&
dwarf_cu->Supports_DW_AT_APPLE_objc_complete_type()) {
m_supports_DW_AT_APPLE_objc_complete_type = eLazyBoolYes;
@@ -3204,19 +2722,7 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
return type_sp;
DIEArray die_offsets;
-
- if (m_using_apple_tables) {
- if (m_apple_types_ap.get()) {
- const char *name_cstr = type_name.GetCString();
- m_apple_types_ap->FindCompleteObjCClassByName(name_cstr, die_offsets,
- must_be_implementation);
- }
- } else {
- if (!m_indexed)
- Index();
-
- m_type_index.Find(type_name, die_offsets);
- }
+ m_index->GetCompleteObjCClass(type_name, must_be_implementation, die_offsets);
const size_t num_matches = die_offsets.size();
@@ -3228,7 +2734,8 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
if (type_die) {
bool try_resolving_type = false;
- // Don't try and resolve the DIE we are looking for with the DIE itself!
+ // Don't try and resolve the DIE we are looking for with the DIE
+ // itself!
if (type_die != die) {
switch (type_die.Tag()) {
case DW_TAG_class_type:
@@ -3264,12 +2771,8 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
}
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_types "
- "accelerator table had bad die 0x%8.8x for '%s')\n",
- die_ref.die_offset, type_name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ type_name.GetStringRef());
}
}
}
@@ -3277,16 +2780,15 @@ TypeSP SymbolFileDWARF::FindCompleteObjCDefinitionTypeForDIE(
}
//----------------------------------------------------------------------
-// This function helps to ensure that the declaration contexts match for
-// two different DIEs. Often times debug information will refer to a
-// forward declaration of a type (the equivalent of "struct my_struct;".
-// There will often be a declaration of that type elsewhere that has the
-// full definition. When we go looking for the full type "my_struct", we
-// will find one or more matches in the accelerator tables and we will
-// then need to make sure the type was in the same declaration context
-// as the original DIE. This function can efficiently compare two DIEs
-// and will return true when the declaration context matches, and false
-// when they don't.
+// This function helps to ensure that the declaration contexts match for two
+// different DIEs. Often times debug information will refer to a forward
+// declaration of a type (the equivalent of "struct my_struct;". There will
+// often be a declaration of that type elsewhere that has the full definition.
+// When we go looking for the full type "my_struct", we will find one or more
+// matches in the accelerator tables and we will then need to make sure the
+// type was in the same declaration context as the original DIE. This function
+// can efficiently compare two DIEs and will return true when the declaration
+// context matches, and false when they don't.
//----------------------------------------------------------------------
bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1,
const DWARFDIE &die2) {
@@ -3295,32 +2797,31 @@ bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1,
DWARFDIECollection decl_ctx_1;
DWARFDIECollection decl_ctx_2;
- // The declaration DIE stack is a stack of the declaration context
- // DIEs all the way back to the compile unit. If a type "T" is
- // declared inside a class "B", and class "B" is declared inside
- // a class "A" and class "A" is in a namespace "lldb", and the
- // namespace is in a compile unit, there will be a stack of DIEs:
+ // The declaration DIE stack is a stack of the declaration context DIEs all
+ // the way back to the compile unit. If a type "T" is declared inside a class
+ // "B", and class "B" is declared inside a class "A" and class "A" is in a
+ // namespace "lldb", and the namespace is in a compile unit, there will be a
+ // stack of DIEs:
//
// [0] DW_TAG_class_type for "B"
// [1] DW_TAG_class_type for "A"
// [2] DW_TAG_namespace for "lldb"
- // [3] DW_TAG_compile_unit for the source file.
+ // [3] DW_TAG_compile_unit or DW_TAG_partial_unit for the source file.
//
- // We grab both contexts and make sure that everything matches
- // all the way back to the compiler unit.
+ // We grab both contexts and make sure that everything matches all the way
+ // back to the compiler unit.
// First lets grab the decl contexts for both DIEs
die1.GetDeclContextDIEs(decl_ctx_1);
die2.GetDeclContextDIEs(decl_ctx_2);
- // Make sure the context arrays have the same size, otherwise
- // we are done
+ // Make sure the context arrays have the same size, otherwise we are done
const size_t count1 = decl_ctx_1.Size();
const size_t count2 = decl_ctx_2.Size();
if (count1 != count2)
return false;
- // Make sure the DW_TAG values match all the way back up the
- // compile unit. If they don't, then we are done.
+ // Make sure the DW_TAG values match all the way back up the compile unit. If
+ // they don't, then we are done.
DWARFDIE decl_ctx_die1;
DWARFDIE decl_ctx_die2;
size_t i;
@@ -3333,25 +2834,28 @@ bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1,
#if defined LLDB_CONFIGURATION_DEBUG
// Make sure the top item in the decl context die array is always
- // DW_TAG_compile_unit. If it isn't then something went wrong in
- // the DWARFDIE::GetDeclContextDIEs() function...
- assert(decl_ctx_1.GetDIEAtIndex(count1 - 1).Tag() == DW_TAG_compile_unit);
+ // DW_TAG_compile_unit or DW_TAG_partial_unit. If it isn't then
+ // something went wrong in the DWARFDIE::GetDeclContextDIEs()
+ // function.
+ dw_tag_t cu_tag = decl_ctx_1.GetDIEAtIndex(count1 - 1).Tag();
+ UNUSED_IF_ASSERT_DISABLED(cu_tag);
+ assert(cu_tag == DW_TAG_compile_unit || cu_tag == DW_TAG_partial_unit);
#endif
- // Always skip the compile unit when comparing by only iterating up to
- // "count - 1". Here we compare the names as we go.
+ // Always skip the compile unit when comparing by only iterating up to "count
+ // - 1". Here we compare the names as we go.
for (i = 0; i < count1 - 1; i++) {
decl_ctx_die1 = decl_ctx_1.GetDIEAtIndex(i);
decl_ctx_die2 = decl_ctx_2.GetDIEAtIndex(i);
const char *name1 = decl_ctx_die1.GetName();
const char *name2 = decl_ctx_die2.GetName();
- // If the string was from a DW_FORM_strp, then the pointer will often
- // be the same!
+ // If the string was from a DW_FORM_strp, then the pointer will often be
+ // the same!
if (name1 == name2)
continue;
- // Name pointers are not equal, so only compare the strings
- // if both are not NULL.
+ // Name pointers are not equal, so only compare the strings if both are not
+ // NULL.
if (name1 && name2) {
// If the strings don't compare, we are done...
if (strcmp(name1, name2) != 0)
@@ -3361,8 +2865,8 @@ bool SymbolFileDWARF::DIEDeclContextsMatch(const DWARFDIE &die1,
return false;
}
}
- // We made it through all of the checks and the declaration contexts
- // are equal.
+ // We made it through all of the checks and the declaration contexts are
+ // equal.
return true;
}
@@ -3387,47 +2891,12 @@ TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
}
DIEArray die_offsets;
-
- if (m_using_apple_tables) {
- if (m_apple_types_ap.get()) {
- const bool has_tag =
- m_apple_types_ap->GetHeader().header_data.ContainsAtom(
- DWARFMappedHash::eAtomTypeTag);
- const bool has_qualified_name_hash =
- m_apple_types_ap->GetHeader().header_data.ContainsAtom(
- DWARFMappedHash::eAtomTypeQualNameHash);
- if (has_tag && has_qualified_name_hash) {
- const char *qualified_name = dwarf_decl_ctx.GetQualifiedName();
- const uint32_t qualified_name_hash =
- MappedHash::HashStringUsingDJB(qualified_name);
- if (log)
- GetObjectFile()->GetModule()->LogMessage(
- log, "FindByNameAndTagAndQualifiedNameHash()");
- m_apple_types_ap->FindByNameAndTagAndQualifiedNameHash(
- type_name.GetCString(), tag, qualified_name_hash, die_offsets);
- } else if (has_tag) {
- if (log)
- GetObjectFile()->GetModule()->LogMessage(log,
- "FindByNameAndTag()");
- m_apple_types_ap->FindByNameAndTag(type_name.GetCString(), tag,
- die_offsets);
- } else {
- m_apple_types_ap->FindByName(type_name.GetCString(), die_offsets);
- }
- }
- } else {
- if (!m_indexed)
- Index();
-
- m_type_index.Find(type_name, die_offsets);
- }
-
+ m_index->GetTypes(dwarf_decl_ctx, die_offsets);
const size_t num_matches = die_offsets.size();
- // Get the type system that we are looking to find a type for. We will use
- // this
- // to ensure any matches we find are in a language that this type system
- // supports
+ // Get the type system that we are looking to find a type for. We will
+ // use this to ensure any matches we find are in a language that this
+ // type system supports
const LanguageType language = dwarf_decl_ctx.GetLanguage();
TypeSystem *type_system = (language == eLanguageTypeUnknown)
? nullptr
@@ -3440,10 +2909,8 @@ TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
if (type_die) {
// Make sure type_die's langauge matches the type system we are
- // looking for.
- // We don't want to find a "Foo" type from Java if we are looking
- // for a "Foo"
- // type for C, C++, ObjC, or ObjC++.
+ // looking for. We don't want to find a "Foo" type from Java if we
+ // are looking for a "Foo" type for C, C++, ObjC, or ObjC++.
if (type_system &&
!type_system->SupportsLanguage(type_die.GetLanguage()))
continue;
@@ -3457,24 +2924,23 @@ TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
// The tags match, lets try resolving this type
try_resolving_type = true;
} else {
- // The tags don't match, but we need to watch our for a
- // forward declaration for a struct and ("struct foo")
- // ends up being a class ("class foo { ... };") or
- // vice versa.
+ // The tags don't match, but we need to watch our for a forward
+ // declaration for a struct and ("struct foo") ends up being a
+ // class ("class foo { ... };") or vice versa.
switch (type_tag) {
case DW_TAG_class_type:
- // We had a "class foo", see if we ended up with a "struct foo {
- // ... };"
+ // We had a "class foo", see if we ended up with a "struct foo
+ // { ... };"
try_resolving_type = (tag == DW_TAG_structure_type);
break;
case DW_TAG_structure_type:
- // We had a "struct foo", see if we ended up with a "class foo {
- // ... };"
+ // We had a "struct foo", see if we ended up with a "class foo
+ // { ... };"
try_resolving_type = (tag == DW_TAG_class_type);
break;
default:
- // Tags don't match, don't event try to resolve
- // using this type whose name matches....
+ // Tags don't match, don't event try to resolve using this type
+ // whose name matches....
break;
}
}
@@ -3515,12 +2981,8 @@ TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext(
}
}
} else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified (.apple_types "
- "accelerator table had bad die 0x%8.8x for '%s')\n",
- die_ref.die_offset, type_name.GetCString());
- }
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset,
+ type_name.GetStringRef());
}
}
}
@@ -3606,7 +3068,7 @@ size_t SymbolFileDWARF::ParseTypes(const SymbolContext &sc,
size_t SymbolFileDWARF::ParseFunctionBlocks(const SymbolContext &sc) {
assert(sc.comp_unit && sc.function);
size_t functions_added = 0;
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
const dw_offset_t function_die_offset = sc.function->GetID();
DWARFDIE function_die = dwarf_cu->GetDIE(function_die_offset);
@@ -3623,7 +3085,7 @@ size_t SymbolFileDWARF::ParseTypes(const SymbolContext &sc) {
// At least a compile unit must be valid
assert(sc.comp_unit);
size_t types_added = 0;
- DWARFCompileUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
+ DWARFUnit *dwarf_cu = GetDWARFCompileUnit(sc.comp_unit);
if (dwarf_cu) {
if (sc.function) {
dw_offset_t function_die_offset = sc.function->GetID();
@@ -3662,7 +3124,7 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
return num_variables;
}
} else if (sc.comp_unit) {
- DWARFCompileUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID());
+ DWARFUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID());
if (dwarf_cu == NULL)
return 0;
@@ -3675,25 +3137,7 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
sc.comp_unit->SetVariableList(variables);
DIEArray die_offsets;
- if (m_using_apple_tables) {
- if (m_apple_names_ap.get()) {
- DWARFMappedHash::DIEInfoArray hash_data_array;
- if (m_apple_names_ap->AppendAllDIEsInRange(
- dwarf_cu->GetOffset(), dwarf_cu->GetNextCompileUnitOffset(),
- hash_data_array)) {
- DWARFMappedHash::ExtractDIEArray(hash_data_array, die_offsets);
- }
- }
- } else {
- // Index if we already haven't to make sure the compile units
- // get indexed and make their global DIE index list
- if (!m_indexed)
- Index();
-
- m_global_index.FindAllEntriesForCompileUnit(dwarf_cu->GetOffset(),
- die_offsets);
- }
-
+ m_index->GetGlobalVariables(*dwarf_cu, die_offsets);
const size_t num_matches = die_offsets.size();
if (num_matches) {
for (size_t i = 0; i < num_matches; ++i) {
@@ -3706,14 +3150,8 @@ size_t SymbolFileDWARF::ParseVariablesForContext(const SymbolContext &sc) {
variables->AddVariableIfUnique(var_sp);
++vars_added;
}
- } else {
- if (m_using_apple_tables) {
- GetObjectFile()->GetModule()->ReportErrorIfModifyDetected(
- "the DWARF debug information has been modified "
- "(.apple_names accelerator table had bad die 0x%8.8x)\n",
- die_ref.die_offset);
- }
- }
+ } else
+ m_index->ReportInvalidDIEOffset(die_ref.die_offset, "");
}
}
}
@@ -3796,7 +3234,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
location_is_const_value_data = true;
// The constant value will be either a block, a data value or a
// string.
- const DWARFDataExtractor &debug_info_data = get_debug_info_data();
+ auto debug_info_data = die.GetData();
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
// Retrieve the value as a block expression.
uint32_t block_offset =
@@ -3853,13 +3291,12 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
location_is_const_value_data = false;
has_explicit_location = true;
if (DWARFFormValue::IsBlockForm(form_value.Form())) {
- const DWARFDataExtractor &debug_info_data = get_debug_info_data();
+ auto data = die.GetData();
uint32_t block_offset =
- form_value.BlockData() - debug_info_data.GetDataStart();
+ form_value.BlockData() - data.GetDataStart();
uint32_t block_length = form_value.Unsigned();
- location.CopyOpcodeData(module, get_debug_info_data(),
- block_offset, block_length);
+ location.CopyOpcodeData(module, data, block_offset, block_length);
} else {
const DWARFDataExtractor &debug_loc_data = get_debug_loc_data();
const dw_offset_t debug_loc_offset = form_value.Unsigned();
@@ -3902,10 +3339,9 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
// TODO: Handle the case when DW_AT_start_scope have form
// constant. The
// dwarf spec is a bit ambiguous about what is the expected
- // behavior in
- // case the enclosing block have a non coninious address range and
- // the
- // DW_AT_start_scope entry have a form constant.
+ // behavior in case the enclosing block have a non coninious
+ // address range and the DW_AT_start_scope entry have a form
+ // constant.
GetObjectFile()->GetModule()->ReportWarning(
"0x%8.8" PRIx64
": DW_AT_start_scope has unsupported form type (0x%x)\n",
@@ -3937,7 +3373,8 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
const DWARFDIE parent_context_die = GetDeclContextDIEContainingDIE(die);
const dw_tag_t parent_tag = die.GetParent().Tag();
bool is_static_member =
- parent_tag == DW_TAG_compile_unit &&
+ (parent_tag == DW_TAG_compile_unit ||
+ parent_tag == DW_TAG_partial_unit) &&
(parent_context_die.Tag() == DW_TAG_class_type ||
parent_context_die.Tag() == DW_TAG_structure_type);
@@ -3949,17 +3386,17 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
bool has_explicit_mangled = mangled != nullptr;
if (!mangled) {
// LLDB relies on the mangled name (DW_TAG_linkage_name or
- // DW_AT_MIPS_linkage_name) to
- // generate fully qualified names of global variables with commands like
- // "frame var j".
- // For example, if j were an int variable holding a value 4 and declared
- // in a namespace
- // B which in turn is contained in a namespace A, the command "frame var
- // j" returns
- // "(int) A::B::j = 4". If the compiler does not emit a linkage name, we
- // should be able
- // to generate a fully qualified name from the declaration context.
- if (parent_tag == DW_TAG_compile_unit &&
+ // DW_AT_MIPS_linkage_name) to generate fully qualified names
+ // of global variables with commands like "frame var j". For
+ // example, if j were an int variable holding a value 4 and
+ // declared in a namespace B which in turn is contained in a
+ // namespace A, the command "frame var j" returns
+ // "(int) A::B::j = 4".
+ // If the compiler does not emit a linkage name, we should be
+ // able to generate a fully qualified name from the
+ // declaration context.
+ if ((parent_tag == DW_TAG_compile_unit ||
+ parent_tag == DW_TAG_partial_unit) &&
Language::LanguageIsCPlusPlus(die.GetLanguage())) {
DWARFDeclContext decl_ctx;
@@ -4007,24 +3444,21 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
scope = eValueTypeVariableStatic;
if (debug_map_symfile) {
- // When leaving the DWARF in the .o files on darwin,
- // when we have a global variable that wasn't initialized,
- // the .o file might not have allocated a virtual
- // address for the global variable. In this case it will
- // have created a symbol for the global variable
- // that is undefined/data and external and the value will
- // be the byte size of the variable. When we do the
- // address map in SymbolFileDWARFDebugMap we rely on
- // having an address, we need to do some magic here
- // so we can get the correct address for our global
- // variable. The address for all of these entries
- // will be zero, and there will be an undefined symbol
- // in this object file, and the executable will have
- // a matching symbol with a good address. So here we
- // dig up the correct address and replace it in the
- // location for the variable, and set the variable's
- // symbol context scope to be that of the main executable
- // so the file address will resolve correctly.
+ // When leaving the DWARF in the .o files on darwin, when we have a
+ // global variable that wasn't initialized, the .o file might not
+ // have allocated a virtual address for the global variable. In
+ // this case it will have created a symbol for the global variable
+ // that is undefined/data and external and the value will be the
+ // byte size of the variable. When we do the address map in
+ // SymbolFileDWARFDebugMap we rely on having an address, we need to
+ // do some magic here so we can get the correct address for our
+ // global variable. The address for all of these entries will be
+ // zero, and there will be an undefined symbol in this object file,
+ // and the executable will have a matching symbol with a good
+ // address. So here we dig up the correct address and replace it in
+ // the location for the variable, and set the variable's symbol
+ // context scope to be that of the main executable so the file
+ // address will resolve correctly.
bool linked_oso_file_addr = false;
if (is_external && location_DW_OP_addr == 0) {
// we have a possible uninitialized extern global
@@ -4056,8 +3490,7 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
if (!linked_oso_file_addr) {
// The DW_OP_addr is not zero, but it contains a .o file address
- // which
- // needs to be linked up correctly.
+ // which needs to be linked up correctly.
const lldb::addr_t exe_file_addr =
debug_map_symfile->LinkOSOFileAddress(this,
location_DW_OP_addr);
@@ -4127,16 +3560,16 @@ VariableSP SymbolFileDWARF::ParseVariableDIE(const SymbolContext &sc,
var_sp->SetLocationIsConstantValueData(location_is_const_value_data);
} else {
- // Not ready to parse this variable yet. It might be a global
- // or static variable that is in a function scope and the function
- // in the symbol context wasn't filled in yet
+ // Not ready to parse this variable yet. It might be a global or static
+ // variable that is in a function scope and the function in the symbol
+ // context wasn't filled in yet
return var_sp;
}
}
- // Cache var_sp even if NULL (the variable was just a specification or
- // was missing vital information to be able to be displayed in the debugger
- // (missing location due to optimization, etc)) so we don't re-parse
- // this DIE over and over later...
+ // Cache var_sp even if NULL (the variable was just a specification or was
+ // missing vital information to be able to be displayed in the debugger
+ // (missing location due to optimization, etc)) so we don't re-parse this
+ // DIE over and over later...
GetDIEToVariable()[die.GetDIE()] = var_sp;
if (spec_die)
GetDIEToVariable()[spec_die.GetDIE()] = var_sp;
@@ -4217,11 +3650,11 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
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) {
variable_list_sp = sc.comp_unit->GetVariableList(false);
if (variable_list_sp.get() == NULL) {
variable_list_sp.reset(new VariableList());
- sc.comp_unit->SetVariableList(variable_list_sp);
}
} else {
GetObjectFile()->GetModule()->ReportError(
@@ -4243,8 +3676,8 @@ size_t SymbolFileDWARF::ParseVariables(const SymbolContext &sc,
Block *block = sc.function->GetBlock(true).FindBlockByID(
sc_parent_die.GetID());
if (block == NULL) {
- // This must be a specification or abstract origin with
- // a concrete block counterpart in the current function. We need
+ // 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
// variable to it
const DWARFDIE concrete_block_die =
@@ -4310,30 +3743,7 @@ ConstString SymbolFileDWARF::GetPluginName() { return GetPluginNameStatic(); }
uint32_t SymbolFileDWARF::GetPluginVersion() { return 1; }
-void SymbolFileDWARF::DumpIndexes() {
- StreamFile s(stdout, false);
-
- s.Printf(
- "DWARF index for (%s) '%s':",
- GetObjectFile()->GetModule()->GetArchitecture().GetArchitectureName(),
- GetObjectFile()->GetFileSpec().GetPath().c_str());
- s.Printf("\nFunction basenames:\n");
- m_function_basename_index.Dump(&s);
- s.Printf("\nFunction fullnames:\n");
- m_function_fullname_index.Dump(&s);
- s.Printf("\nFunction methods:\n");
- m_function_method_index.Dump(&s);
- s.Printf("\nFunction selectors:\n");
- m_function_selector_index.Dump(&s);
- s.Printf("\nObjective C class selectors:\n");
- m_objc_class_selectors_index.Dump(&s);
- s.Printf("\nGlobals and statics:\n");
- m_global_index.Dump(&s);
- s.Printf("\nTypes:\n");
- m_type_index.Dump(&s);
- s.Printf("\nNamespaces:\n");
- m_namespace_index.Dump(&s);
-}
+void SymbolFileDWARF::Dump(lldb_private::Stream &s) { m_index->Dump(s); }
SymbolFileDWARFDebugMap *SymbolFileDWARF::GetDebugMapSymfile() {
if (m_debug_map_symfile == NULL && !m_debug_map_module_wp.expired()) {
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
index 6902dc0333d2..a5f2ac8f3e7d 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -38,8 +38,7 @@
// Project includes
#include "DWARFDataExtractor.h"
#include "DWARFDefines.h"
-#include "HashedNameToDIE.h"
-#include "NameToDIE.h"
+#include "DWARFIndex.h"
#include "UniqueDWARFASTType.h"
//----------------------------------------------------------------------
@@ -54,7 +53,6 @@ class DWARFDebugAranges;
class DWARFDebugInfo;
class DWARFDebugInfoEntry;
class DWARFDebugLine;
-class DWARFDebugPubnames;
class DWARFDebugRanges;
class DWARFDeclContext;
class DWARFDIECollection;
@@ -72,7 +70,7 @@ public:
friend class SymbolFileDWARFDwo;
friend class DebugMapModule;
friend struct DIERef;
- friend class DWARFCompileUnit;
+ friend class DWARFUnit;
friend class DWARFDIE;
friend class DWARFASTParserClang;
friend class DWARFASTParserGo;
@@ -181,11 +179,11 @@ public:
uint32_t
FindGlobalVariables(const lldb_private::ConstString &name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t
@@ -247,10 +245,12 @@ public:
const lldb_private::DWARFDataExtractor &get_debug_ranges_data();
const lldb_private::DWARFDataExtractor &get_debug_str_data();
const lldb_private::DWARFDataExtractor &get_debug_str_offsets_data();
+ const lldb_private::DWARFDataExtractor &get_debug_types_data();
const lldb_private::DWARFDataExtractor &get_apple_names_data();
const lldb_private::DWARFDataExtractor &get_apple_types_data();
const lldb_private::DWARFDataExtractor &get_apple_namespaces_data();
const lldb_private::DWARFDataExtractor &get_apple_objc_data();
+ const lldb_private::DWARFDataExtractor &get_gnu_debugaltlink();
DWARFDebugAbbrev *DebugAbbrev();
@@ -273,19 +273,19 @@ public:
HasForwardDeclForClangType(const lldb_private::CompilerType &compiler_type);
lldb_private::CompileUnit *
- GetCompUnitForDWARFCompUnit(DWARFCompileUnit *dwarf_cu,
+ GetCompUnitForDWARFCompUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx = UINT32_MAX);
virtual size_t GetObjCMethodDIEOffsets(lldb_private::ConstString class_name,
DIEArray &method_die_offsets);
- bool Supports_DW_AT_APPLE_objc_complete_type(DWARFCompileUnit *cu);
+ bool Supports_DW_AT_APPLE_objc_complete_type(DWARFUnit *cu);
lldb_private::DebugMacrosSP ParseDebugMacros(lldb::offset_t *offset);
static DWARFDIE GetParentSymbolContextDIE(const DWARFDIE &die);
- virtual lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
+ virtual lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx);
virtual lldb_private::DWARFExpression::LocationListFormat
@@ -293,16 +293,30 @@ public:
lldb::ModuleSP GetDWOModule(lldb_private::ConstString name);
+ typedef std::map<lldb_private::ConstString, lldb::ModuleSP>
+ ExternalTypeModuleMap;
+
+ /// Return the list of Clang modules imported by this SymbolFile.
+ const ExternalTypeModuleMap& getExternalTypeModules() const {
+ return m_external_type_modules;
+ }
+
virtual DWARFDIE GetDIE(const DIERef &die_ref);
virtual std::unique_ptr<SymbolFileDWARFDwo>
- GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu,
+ GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
const DWARFDebugInfoEntry &cu_die);
// For regular SymbolFileDWARF instances the method returns nullptr,
// for the instances of the subclass SymbolFileDWARFDwo
// the method returns a pointer to the base compile unit.
- virtual DWARFCompileUnit *GetBaseCompileUnit();
+ virtual DWARFUnit *GetBaseCompileUnit();
+
+ static bool
+ DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx,
+ const DWARFDIE &die);
+
+ void Dump(lldb_private::Stream &s) override;
protected:
typedef llvm::DenseMap<const DWARFDebugInfoEntry *, lldb_private::Type *>
@@ -331,14 +345,10 @@ protected:
bool DeclContextMatchesThisSymbolFile(
const lldb_private::CompilerDeclContext *decl_ctx);
- bool
- DIEInDeclContext(const lldb_private::CompilerDeclContext *parent_decl_ctx,
- const DWARFDIE &die);
-
- virtual DWARFCompileUnit *
+ virtual DWARFUnit *
GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit);
- DWARFCompileUnit *GetNextUnparsedDWARFCompileUnit(DWARFCompileUnit *prev_cu);
+ DWARFUnit *GetNextUnparsedDWARFCompileUnit(DWARFUnit *prev_cu);
bool GetFunction(const DWARFDIE &die, lldb_private::SymbolContext &sc);
@@ -375,25 +385,9 @@ protected:
bool ClassOrStructIsVirtual(const DWARFDIE &die);
// Given a die_offset, figure out the symbol context representing that die.
- bool ResolveFunction(const DIERef &die_ref, bool include_inlines,
- lldb_private::SymbolContextList &sc_list);
-
bool ResolveFunction(const DWARFDIE &die, bool include_inlines,
lldb_private::SymbolContextList &sc_list);
- void FindFunctions(const lldb_private::ConstString &name,
- const NameToDIE &name_to_die, bool include_inlines,
- lldb_private::SymbolContextList &sc_list);
-
- void FindFunctions(const lldb_private::RegularExpression &regex,
- const NameToDIE &name_to_die, bool include_inlines,
- lldb_private::SymbolContextList &sc_list);
-
- void FindFunctions(const lldb_private::RegularExpression &regex,
- const DWARFMappedHash::MemoryTable &memory_table,
- bool include_inlines,
- lldb_private::SymbolContextList &sc_list);
-
virtual lldb::TypeSP
FindDefinitionTypeForDWARFDeclContext(const DWARFDeclContext &die_decl_ctx);
@@ -404,16 +398,9 @@ protected:
lldb_private::Symbol *
GetObjCClassSymbol(const lldb_private::ConstString &objc_class_name);
- void ParseFunctions(const DIEArray &die_offsets, bool include_inlines,
- lldb_private::SymbolContextList &sc_list);
-
lldb::TypeSP GetTypeForDIE(const DWARFDIE &die,
bool resolve_function_context = false);
- void Index();
-
- void DumpIndexes();
-
void SetDebugMapModule(const lldb::ModuleSP &module_sp) {
m_debug_map_module_wp = module_sp;
}
@@ -439,9 +426,6 @@ protected:
typedef std::set<lldb_private::Type *> TypeSet;
- typedef std::map<lldb_private::ConstString, lldb::ModuleSP>
- ExternalTypeModuleMap;
-
void GetTypes(const DWARFDIE &die, dw_offset_t min_die_offset,
dw_offset_t max_die_offset, uint32_t type_mask,
TypeSet &type_set);
@@ -487,10 +471,12 @@ protected:
DWARFDataSegment m_data_debug_ranges;
DWARFDataSegment m_data_debug_str;
DWARFDataSegment m_data_debug_str_offsets;
+ DWARFDataSegment m_data_debug_types;
DWARFDataSegment m_data_apple_names;
DWARFDataSegment m_data_apple_types;
DWARFDataSegment m_data_apple_namespaces;
DWARFDataSegment m_data_apple_objc;
+ DWARFDataSegment m_data_gnu_debugaltlink;
// The unique pointer items below are generated on demand if and when someone
// accesses
@@ -498,10 +484,6 @@ protected:
std::unique_ptr<DWARFDebugAbbrev> m_abbr;
std::unique_ptr<DWARFDebugInfo> m_info;
std::unique_ptr<DWARFDebugLine> m_line;
- std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_names_ap;
- std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_types_ap;
- std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_namespaces_ap;
- std::unique_ptr<DWARFMappedHash::MemoryTable> m_apple_objc_ap;
std::unique_ptr<GlobalVariableMap> m_global_aranges_ap;
typedef std::unordered_map<lldb::offset_t, lldb_private::DebugMacrosSP>
@@ -509,17 +491,8 @@ protected:
DebugMacrosMap m_debug_macros_map;
ExternalTypeModuleMap m_external_type_modules;
- NameToDIE m_function_basename_index; // All concrete functions
- NameToDIE m_function_fullname_index; // All concrete functions
- NameToDIE m_function_method_index; // All inlined functions
- NameToDIE
- m_function_selector_index; // All method names for functions of classes
- NameToDIE m_objc_class_selectors_index; // Given a class name, find all
- // selectors for the class
- NameToDIE m_global_index; // Global and static variables
- NameToDIE m_type_index; // All type DIE offsets
- NameToDIE m_namespace_index; // All type DIE offsets
- bool m_indexed : 1, m_using_apple_tables : 1, m_fetched_external_modules : 1;
+ std::unique_ptr<lldb_private::DWARFIndex> m_index;
+ bool m_fetched_external_modules : 1;
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
typedef std::shared_ptr<std::set<DIERef>> DIERefSetSP;
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
index eabff86a5428..39c70d146524 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
@@ -44,10 +44,8 @@ using namespace lldb;
using namespace lldb_private;
// Subclass lldb_private::Module so we can intercept the
-// "Module::GetObjectFile()"
-// (so we can fixup the object file sections) and also for
-// "Module::GetSymbolVendor()"
-// (so we can fixup the symbol file id.
+// "Module::GetObjectFile()" (so we can fixup the object file sections) and
+// also for "Module::GetSymbolVendor()" (so we can fixup the symbol file id.
const SymbolFileDWARFDebugMap::FileRangeMap &
SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
@@ -84,8 +82,8 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
/// const uint32_t fun_resolve_flags = SymbolContext::Module |
/// eSymbolContextCompUnit | eSymbolContextFunction;
// SectionList *oso_sections = oso_objfile->Sections();
- // Now we need to make sections that map from zero based object
- // file addresses to where things ended up in the main executable.
+ // Now we need to make sections that map from zero based object file
+ // addresses to where things ended up in the main executable.
assert(comp_unit_info->first_symbol_index != UINT32_MAX);
// End index is one past the last valid symbol index
@@ -104,9 +102,9 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
break;
case eSymbolTypeCode: {
- // For each N_FUN, or function that we run into in the debug map
- // we make a new section that we add to the sections found in the
- // .o file. This new section has the file address set to what the
+ // For each N_FUN, or function that we run into in the debug map we
+ // make a new section that we add to the sections found in the .o
+ // file. This new section has the file address set to what the
// addresses are in the .o file, and the load address is adjusted
// to match where it ended up in the final executable! We do this
// before we parse any dwarf info so that when it goes get parsed
@@ -129,21 +127,21 @@ SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap(
} break;
case eSymbolTypeData: {
- // For each N_GSYM we remap the address for the global by making
- // a new section that we add to the sections found in the .o file.
- // This new section has the file address set to what the
- // addresses are in the .o file, and the load address is adjusted
- // to match where it ended up in the final executable! We do this
- // before we parse any dwarf info so that when it goes get parsed
- // all section/offset addresses that get registered will resolve
+ // For each N_GSYM we remap the address for the global by making a
+ // new section that we add to the sections found in the .o file.
+ // This new section has the file address set to what the addresses
+ // are in the .o file, and the load address is adjusted to match
+ // where it ended up in the final executable! We do this before we
+ // parse any dwarf info so that when it goes get parsed all
+ // section/offset addresses that get registered will resolve
// correctly to the new addresses in the main executable. We
// initially set the section size to be 1 byte, but will need to
// fix up these addresses further after all globals have been
// parsed to span the gaps, or we can find the global variable
// sizes from the DWARF info as we are parsing.
- // Next we find the non-stab entry that corresponds to the N_GSYM in
- // the .o file
+ // Next we find the non-stab entry that corresponds to the N_GSYM
+ // in the .o file
Symbol *oso_gsym_symbol =
oso_symtab->FindFirstSymbolWithNameAndType(
exe_symbol->GetMangled().GetName(lldb::eLanguageTypeUnknown,
@@ -198,9 +196,9 @@ public:
SymbolVendor *symbol_vendor =
Module::GetSymbolVendor(can_create, feedback_strm);
if (symbol_vendor) {
- // Set a pointer to this class to set our OSO DWARF file know
- // that the DWARF is being used along with a debug map and that
- // it will have the remapped sections that we do below.
+ // Set a pointer to this class to set our OSO DWARF file know that
+ // the DWARF is being used along with a debug map and that it will
+ // have the remapped sections that we do below.
SymbolFileDWARF *oso_symfile =
SymbolFileDWARFDebugMap::GetSymbolFileAsSymbolFileDWARF(
symbol_vendor->GetSymbolFile());
@@ -292,8 +290,8 @@ void SymbolFileDWARFDebugMap::InitOSO() {
// In order to get the abilities of this plug-in, we look at the list of
// N_OSO entries (object files) from the symbol table and make sure that
- // these files exist and also contain valid DWARF. If we get any of that
- // then we return the abilities of the first N_OSO's DWARF.
+ // these files exist and also contain valid DWARF. If we get any of that then
+ // we return the abilities of the first N_OSO's DWARF.
Symtab *symtab = m_obj_file->GetSymtab();
if (symtab) {
@@ -303,10 +301,10 @@ void SymbolFileDWARFDebugMap::InitOSO() {
// When a mach-o symbol is encoded, the n_type field is encoded in bits
// 23:16, and the n_desc field is encoded in bits 15:0.
//
- // To find all N_OSO entries that are part of the DWARF + debug map
- // we find only object file symbols with the flags value as follows:
- // bits 23:16 == 0x66 (N_OSO)
- // bits 15: 0 == 0x0001 (specifies this is a debug map object file)
+ // To find all N_OSO entries that are part of the DWARF + debug map we find
+ // only object file symbols with the flags value as follows: bits 23:16 ==
+ // 0x66 (N_OSO) bits 15: 0 == 0x0001 (specifies this is a debug map object
+ // file)
const uint32_t k_oso_symbol_flags_value = 0x660001u;
const uint32_t oso_index_count =
@@ -353,7 +351,7 @@ void SymbolFileDWARFDebugMap::InitOSO() {
so_symbol->GetType() == eSymbolTypeSourceFile &&
oso_symbol->GetType() == eSymbolTypeObjectFile) {
m_compile_unit_infos[i].so_file.SetFile(
- so_symbol->GetName().AsCString(), false);
+ so_symbol->GetName().AsCString(), false, FileSpec::Style::native);
m_compile_unit_infos[i].oso_path = oso_symbol->GetName();
m_compile_unit_infos[i].oso_mod_time =
llvm::sys::toTimePoint(oso_symbol->GetIntegerValue(0));
@@ -413,13 +411,15 @@ Module *SymbolFileDWARFDebugMap::GetModuleByOSOIndex(uint32_t oso_idx) {
Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
CompileUnitInfo *comp_unit_info) {
if (!comp_unit_info->oso_sp) {
- auto pos = m_oso_map.find(comp_unit_info->oso_path);
+ auto pos = m_oso_map.find(
+ {comp_unit_info->oso_path, comp_unit_info->oso_mod_time});
if (pos != m_oso_map.end()) {
comp_unit_info->oso_sp = pos->second;
} else {
ObjectFile *obj_file = GetObjectFile();
comp_unit_info->oso_sp.reset(new OSOInfo());
- m_oso_map[comp_unit_info->oso_path] = comp_unit_info->oso_sp;
+ m_oso_map[{comp_unit_info->oso_path, comp_unit_info->oso_mod_time}] =
+ comp_unit_info->oso_sp;
const char *oso_path = comp_unit_info->oso_path.GetCString();
FileSpec oso_file(oso_path, false);
ConstString oso_object;
@@ -443,16 +443,15 @@ Module *SymbolFileDWARFDebugMap::GetModuleByCompUnitInfo(
return NULL;
}
}
- // Always create a new module for .o files. Why? Because we
- // use the debug map, to add new sections to each .o file and
- // even though a .o file might not have changed, the sections
- // that get added to the .o file can change.
+ // Always create a new module for .o files. Why? Because we use the debug
+ // map, to add new sections to each .o file and even though a .o file
+ // might not have changed, the sections that get added to the .o file can
+ // change.
ArchSpec oso_arch;
// Only adopt the architecture from the module (not the vendor or OS)
- // since .o files for "i386-apple-ios" will historically show up as
- // "i386-apple-macosx"
- // due to the lack of a LC_VERSION_MIN_MACOSX or LC_VERSION_MIN_IPHONEOS
- // load command...
+ // since .o files for "i386-apple-ios" will historically show up as "i386
+ // -apple-macosx" due to the lack of a LC_VERSION_MIN_MACOSX or
+ // LC_VERSION_MIN_IPHONEOS load command...
oso_arch.SetTriple(m_obj_file->GetModule()
->GetArchitecture()
.GetTriple()
@@ -546,8 +545,8 @@ SymbolFileDWARF *SymbolFileDWARFDebugMap::GetSymbolFileByCompUnitInfo(
uint32_t SymbolFileDWARFDebugMap::CalculateAbilities() {
// In order to get the abilities of this plug-in, we look at the list of
// N_OSO entries (object files) from the symbol table and make sure that
- // these files exist and also contain valid DWARF. If we get any of that
- // then we return the abilities of the first N_OSO's DWARF.
+ // these files exist and also contain valid DWARF. If we get any of that then
+ // we return the abilities of the first N_OSO's DWARF.
const uint32_t oso_index_count = GetNumCompileUnits();
if (oso_index_count > 0) {
@@ -576,9 +575,8 @@ CompUnitSP SymbolFileDWARFDebugMap::ParseCompileUnitAtIndex(uint32_t cu_idx) {
if (oso_module) {
FileSpec so_file_spec;
if (GetFileSpecForSO(cu_idx, so_file_spec)) {
- // User zero as the ID to match the compile unit at offset
- // zero in each .o file since each .o file can only have
- // one compile unit for now.
+ // User zero as the ID to match the compile unit at offset zero in each
+ // .o file since each .o file can only have one compile unit for now.
lldb::user_id_t cu_id = 0;
m_compile_unit_infos[cu_idx].compile_unit_sp.reset(
new CompileUnit(m_obj_file->GetModule(), NULL, so_file_spec, cu_id,
@@ -767,8 +765,8 @@ uint32_t SymbolFileDWARFDebugMap::ResolveSymbolContext(
const uint32_t cu_count = GetNumCompileUnits();
for (uint32_t i = 0; i < cu_count; ++i) {
- // If we are checking for inlines, then we need to look through all
- // compile units no matter if "file_spec" matches.
+ // If we are checking for inlines, then we need to look through all compile
+ // units no matter if "file_spec" matches.
bool resolve = check_inlines;
if (!resolve) {
@@ -805,8 +803,8 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
if (comp_unit_info) {
SymbolFileDWARF *oso_dwarf = GetSymbolFileByOSOIndex(oso_idx);
if (oso_dwarf) {
- if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, true,
- max_matches, variables))
+ if (oso_dwarf->FindGlobalVariables(name, parent_decl_ctx, max_matches,
+ variables))
if (variables.GetSize() > max_matches)
break;
}
@@ -817,21 +815,16 @@ uint32_t SymbolFileDWARFDebugMap::PrivateFindGlobalVariables(
uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(
const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches, VariableList &variables) {
+ uint32_t max_matches, VariableList &variables) {
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- variables.Clear();
-
- // Remember how many variables are in the list before we search in case
- // we are appending the results to a variable list.
+ // Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
uint32_t total_matches = 0;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
const uint32_t oso_matches = oso_dwarf->FindGlobalVariables(
- name, parent_decl_ctx, true, max_matches, variables);
+ name, parent_decl_ctx, max_matches, variables);
if (oso_matches > 0) {
total_matches += oso_matches;
@@ -843,8 +836,8 @@ uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(
if (max_matches >= total_matches)
return true;
- // Update the max matches for any subsequent calls to find globals
- // in any other object files with DWARF
+ // Update the max matches for any subsequent calls to find globals in any
+ // other object files with DWARF
max_matches -= oso_matches;
}
@@ -857,20 +850,15 @@ uint32_t SymbolFileDWARFDebugMap::FindGlobalVariables(
uint32_t
SymbolFileDWARFDebugMap::FindGlobalVariables(const RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
VariableList &variables) {
- // If we aren't appending the results to this list, then clear the list
- if (!append)
- variables.Clear();
-
- // Remember how many variables are in the list before we search in case
- // we are appending the results to a variable list.
+ // Remember how many variables are in the list before we search.
const uint32_t original_size = variables.GetSize();
uint32_t total_matches = 0;
ForEachSymbolFile([&](SymbolFileDWARF *oso_dwarf) -> bool {
const uint32_t oso_matches =
- oso_dwarf->FindGlobalVariables(regex, true, max_matches, variables);
+ oso_dwarf->FindGlobalVariables(regex, max_matches, variables);
if (oso_matches > 0) {
total_matches += oso_matches;
@@ -882,8 +870,8 @@ SymbolFileDWARFDebugMap::FindGlobalVariables(const RegularExpression &regex,
if (max_matches >= total_matches)
return true;
- // Update the max matches for any subsequent calls to find globals
- // in any other object files with DWARF
+ // Update the max matches for any subsequent calls to find globals in any
+ // other object files with DWARF
max_matches -= oso_matches;
}
@@ -965,12 +953,12 @@ SymbolFileDWARFDebugMap::GetCompileUnitInfoForSymbolWithID(
static void RemoveFunctionsWithModuleNotEqualTo(const ModuleSP &module_sp,
SymbolContextList &sc_list,
uint32_t start_idx) {
- // We found functions in .o files. Not all functions in the .o files
- // will have made it into the final output file. The ones that did
- // make it into the final output file will have a section whose module
- // matches the module from the ObjectFile for this SymbolFile. When
- // the modules don't match, then we have something that was in a
- // .o file, but doesn't map to anything in the final executable.
+ // We found functions in .o files. Not all functions in the .o files will
+ // have made it into the final output file. The ones that did make it into
+ // the final output file will have a section whose module matches the module
+ // from the ObjectFile for this SymbolFile. When the modules don't match,
+ // then we have something that was in a .o file, but doesn't map to anything
+ // in the final executable.
uint32_t i = start_idx;
while (i < sc_list.GetSize()) {
SymbolContext sc;
@@ -1101,12 +1089,12 @@ bool SymbolFileDWARFDebugMap::Supports_DW_AT_APPLE_objc_complete_type(
TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
const DWARFDIE &die, const ConstString &type_name,
bool must_be_implementation) {
- // If we have a debug map, we will have an Objective C symbol whose name is
+ // If we have a debug map, we will have an Objective-C symbol whose name is
// the type name and whose type is eSymbolTypeObjCClass. If we can find that
// symbol and find its containing parent, we can locate the .o file that will
// 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.
+ // N_SO and we can then locate the SymbolFileDWARF that corresponds to that
+ // N_SO.
SymbolFileDWARF *oso_dwarf = NULL;
TypeSP type_sp;
ObjectFile *module_objfile = m_obj_file->GetModule()->GetObjectFile();
@@ -1118,8 +1106,7 @@ TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
Symtab::eVisibilityAny);
if (objc_class_symbol) {
// Get the N_SO symbol that contains the objective C class symbol as
- // this
- // should be the .o file that contains the real definition...
+ // this should be the .o file that contains the real definition...
const Symbol *source_file_symbol = symtab->GetParent(objc_class_symbol);
if (source_file_symbol &&
@@ -1147,10 +1134,8 @@ TypeSP SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE(
}
// Only search all .o files for the definition if we don't need the
- // implementation
- // because otherwise, with a valid debug map we should have the ObjC class
- // symbol and
- // the code above should have found it.
+ // implementation because otherwise, with a valid debug map we should have
+ // the ObjC class symbol and the code above should have found it.
if (must_be_implementation == false) {
TypeSP type_sp;
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
index dcca4268b6eb..550f74a203ea 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.h
@@ -95,10 +95,10 @@ public:
uint32_t
FindGlobalVariables(const lldb_private::ConstString &name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t
FindFunctions(const lldb_private::ConstString &name,
@@ -136,7 +136,7 @@ protected:
friend class DebugMapModule;
friend struct DIERef;
friend class DWARFASTParserClang;
- friend class DWARFCompileUnit;
+ friend class DWARFUnit;
friend class SymbolFileDWARF;
struct OSOInfo {
lldb::ModuleSP module_sp;
@@ -300,7 +300,9 @@ protected:
std::vector<CompileUnitInfo> m_compile_unit_infos;
std::vector<uint32_t> m_func_indexes; // Sorted by address
std::vector<uint32_t> m_glob_indexes;
- std::map<lldb_private::ConstString, OSOInfoSP> m_oso_map;
+ std::map<std::pair<lldb_private::ConstString, llvm::sys::TimePoint<>>,
+ OSOInfoSP>
+ m_oso_map;
UniqueDWARFASTTypeMap m_unique_ast_type_map;
lldb_private::LazyBool m_supports_DW_AT_APPLE_objc_complete_type;
DebugMap m_debug_map;
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
index 17c188a41a77..15fe362fa117 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -14,14 +14,14 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/LLDBAssert.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfo.h"
using namespace lldb;
using namespace lldb_private;
SymbolFileDWARFDwo::SymbolFileDWARFDwo(ObjectFileSP objfile,
- DWARFCompileUnit *dwarf_cu)
+ DWARFUnit *dwarf_cu)
: SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
m_base_dwarf_cu(dwarf_cu) {
SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
@@ -52,7 +52,7 @@ void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
}
lldb::CompUnitSP
-SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
+SymbolFileDWARFDwo::ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) {
assert(GetCompileUnit() == dwarf_cu && "SymbolFileDWARFDwo::ParseCompileUnit "
"called with incompatible compile "
@@ -60,7 +60,7 @@ SymbolFileDWARFDwo::ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
return GetBaseSymbolFile()->ParseCompileUnit(m_base_dwarf_cu, UINT32_MAX);
}
-DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
+DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() {
// A clang module is found via a skeleton CU, but is not a proper DWO.
// Clang modules have a .debug_info section instead of the *_dwo variant.
if (auto *section_list = m_obj_file->GetSectionList(false))
@@ -76,7 +76,7 @@ DWARFCompileUnit *SymbolFileDWARFDwo::GetCompileUnit() {
return nullptr;
}
-DWARFCompileUnit *
+DWARFUnit *
SymbolFileDWARFDwo::GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) {
return GetCompileUnit();
}
@@ -122,7 +122,7 @@ lldb::TypeSP SymbolFileDWARFDwo::FindCompleteObjCDefinitionTypeForDIE(
die, type_name, must_be_implementation);
}
-DWARFCompileUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() {
+DWARFUnit *SymbolFileDWARFDwo::GetBaseCompileUnit() {
return m_base_dwarf_cu;
}
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
index b67967aafab2..483a19512a36 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
@@ -18,16 +18,16 @@
class SymbolFileDWARFDwo : public SymbolFileDWARF {
public:
- SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu);
+ SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu);
~SymbolFileDWARFDwo() override = default;
- lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu,
+ lldb::CompUnitSP ParseCompileUnit(DWARFUnit *dwarf_cu,
uint32_t cu_idx) override;
- DWARFCompileUnit *GetCompileUnit();
+ DWARFUnit *GetCompileUnit();
- DWARFCompileUnit *
+ DWARFUnit *
GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override;
lldb_private::DWARFExpression::LocationListFormat
@@ -43,12 +43,12 @@ public:
GetDIE(const DIERef &die_ref) override;
std::unique_ptr<SymbolFileDWARFDwo>
- GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu,
+ GetDwoSymbolFileForCompileUnit(DWARFUnit &dwarf_cu,
const DWARFDebugInfoEntry &cu_die) override {
return nullptr;
}
- DWARFCompileUnit *GetBaseCompileUnit() override;
+ DWARFUnit *GetBaseCompileUnit() override;
protected:
void LoadSectionData(lldb::SectionType sect_type,
@@ -74,7 +74,7 @@ protected:
SymbolFileDWARF *GetBaseSymbolFile();
lldb::ObjectFileSP m_obj_file_sp;
- DWARFCompileUnit *m_base_dwarf_cu;
+ DWARFUnit *m_base_dwarf_cu;
};
#endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp
index f6de1818eae0..403c10fe65ea 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.cpp
@@ -14,7 +14,7 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Utility/LLDBAssert.h"
-#include "DWARFCompileUnit.h"
+#include "DWARFUnit.h"
#include "DWARFDebugInfo.h"
using namespace lldb;
@@ -22,7 +22,7 @@ using namespace lldb_private;
SymbolFileDWARFDwoDwp::SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile,
ObjectFileSP objfile,
- DWARFCompileUnit *dwarf_cu,
+ DWARFUnit *dwarf_cu,
uint64_t dwo_id)
: SymbolFileDWARFDwo(objfile, dwarf_cu), m_dwp_symfile(dwp_symfile),
m_dwo_id(dwo_id) {}
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h
index 00ad7aafd96b..b1b505b5899f 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwoDwp.h
@@ -20,7 +20,7 @@
class SymbolFileDWARFDwoDwp : public SymbolFileDWARFDwo {
public:
SymbolFileDWARFDwoDwp(SymbolFileDWARFDwp *dwp_symfile,
- lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu,
+ lldb::ObjectFileSP objfile, DWARFUnit *dwarf_cu,
uint64_t dwo_id);
protected:
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
index 1dc1dab34a5c..ae10e7179e33 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.cpp
@@ -85,7 +85,7 @@ SymbolFileDWARFDwp::SymbolFileDWARFDwp(lldb::ModuleSP module_sp,
{}
std::unique_ptr<SymbolFileDWARFDwo>
-SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu,
+SymbolFileDWARFDwp::GetSymbolFileForDwoId(DWARFUnit *dwarf_cu,
uint64_t dwo_id) {
return std::unique_ptr<SymbolFileDWARFDwo>(
new SymbolFileDWARFDwoDwp(this, m_obj_file, dwarf_cu, dwo_id));
diff --git a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
index a7372b9358b1..470d1c5b1c48 100644
--- a/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
+++ b/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwp.h
@@ -29,7 +29,7 @@ public:
Create(lldb::ModuleSP module_sp, const lldb_private::FileSpec &file_spec);
std::unique_ptr<SymbolFileDWARFDwo>
- GetSymbolFileForDwoId(DWARFCompileUnit *dwarf_cu, uint64_t dwo_id);
+ GetSymbolFileForDwoId(DWARFUnit *dwarf_cu, uint64_t dwo_id);
bool LoadSectionData(uint64_t dwo_id, lldb::SectionType sect_type,
lldb_private::DWARFDataExtractor &data);
diff --git a/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp b/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
index 8697e08dbf86..8273d975e57d 100644
--- a/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
+++ b/source/Plugins/SymbolFile/DWARF/UniqueDWARFASTType.cpp
@@ -27,8 +27,8 @@ bool UniqueDWARFASTTypeList::Find(const DWARFDIE &die,
udt.m_byte_size == byte_size) {
// Make sure the file and line match
if (udt.m_declaration == decl) {
- // The type has the same name, and was defined on the same
- // file and line. Now verify all of the parent DIEs match.
+ // The type has the same name, and was defined on the same file and
+ // line. Now verify all of the parent DIEs match.
DWARFDIE parent_arg_die = die.GetParent();
DWARFDIE parent_pos_die = udt.m_die.GetParent();
bool match = true;
@@ -57,6 +57,7 @@ bool UniqueDWARFASTTypeList::Find(const DWARFDIE &die,
} break;
case DW_TAG_compile_unit:
+ case DW_TAG_partial_unit:
done = true;
break;
}
diff --git a/source/Plugins/SymbolFile/PDB/CMakeLists.txt b/source/Plugins/SymbolFile/PDB/CMakeLists.txt
index 871f382298d6..1c176c32224d 100644
--- a/source/Plugins/SymbolFile/PDB/CMakeLists.txt
+++ b/source/Plugins/SymbolFile/PDB/CMakeLists.txt
@@ -1,5 +1,6 @@
add_lldb_library(lldbPluginSymbolFilePDB PLUGIN
PDBASTParser.cpp
+ PDBLocationToDWARFExpression.cpp
SymbolFilePDB.cpp
LINK_LIBS
diff --git a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
index 7802d6f0d859..8bea994aae5d 100644
--- a/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
+++ b/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
@@ -19,19 +19,22 @@
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/TypeSystem.h"
+#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
+#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeArray.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeBuiltin.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionArg.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeFunctionSig.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolTypePointer.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
using namespace lldb;
using namespace lldb_private;
-using namespace llvm;
using namespace llvm::pdb;
namespace {
@@ -46,7 +49,7 @@ int TranslateUdtKind(PDB_UdtType pdb_kind) {
case PDB_UdtType::Interface:
return clang::TTK_Interface;
}
- return clang::TTK_Class;
+ return -1;
}
lldb::Encoding TranslateBuiltinEncoding(PDB_BuiltinType type) {
@@ -58,16 +61,146 @@ lldb::Encoding TranslateBuiltinEncoding(PDB_BuiltinType type) {
case PDB_BuiltinType::Char:
return lldb::eEncodingSint;
case PDB_BuiltinType::Bool:
+ case PDB_BuiltinType::Char16:
+ case PDB_BuiltinType::Char32:
case PDB_BuiltinType::UInt:
case PDB_BuiltinType::ULong:
case PDB_BuiltinType::HResult:
+ case PDB_BuiltinType::WCharT:
return lldb::eEncodingUint;
default:
return lldb::eEncodingInvalid;
}
}
+
+lldb::Encoding TranslateEnumEncoding(PDB_VariantType type) {
+ switch (type) {
+ case PDB_VariantType::Int8:
+ case PDB_VariantType::Int16:
+ case PDB_VariantType::Int32:
+ case PDB_VariantType::Int64:
+ return lldb::eEncodingSint;
+
+ case PDB_VariantType::UInt8:
+ case PDB_VariantType::UInt16:
+ case PDB_VariantType::UInt32:
+ case PDB_VariantType::UInt64:
+ return lldb::eEncodingUint;
+
+ default:
+ break;
+ }
+
+ return lldb::eEncodingSint;
}
+CompilerType
+GetBuiltinTypeForPDBEncodingAndBitSize(ClangASTContext &clang_ast,
+ const PDBSymbolTypeBuiltin &pdb_type,
+ Encoding encoding, uint32_t width) {
+ auto *ast = clang_ast.getASTContext();
+ if (!ast)
+ return CompilerType();
+
+ switch (pdb_type.getBuiltinType()) {
+ default:
+ break;
+ case PDB_BuiltinType::None:
+ return CompilerType();
+ case PDB_BuiltinType::Void:
+ return clang_ast.GetBasicType(eBasicTypeVoid);
+ case PDB_BuiltinType::Bool:
+ return clang_ast.GetBasicType(eBasicTypeBool);
+ case PDB_BuiltinType::Long:
+ if (width == ast->getTypeSize(ast->LongTy))
+ return CompilerType(ast, ast->LongTy);
+ if (width == ast->getTypeSize(ast->LongLongTy))
+ return CompilerType(ast, ast->LongLongTy);
+ break;
+ case PDB_BuiltinType::ULong:
+ if (width == ast->getTypeSize(ast->UnsignedLongTy))
+ return CompilerType(ast, ast->UnsignedLongTy);
+ if (width == ast->getTypeSize(ast->UnsignedLongLongTy))
+ return CompilerType(ast, ast->UnsignedLongLongTy);
+ break;
+ case PDB_BuiltinType::WCharT:
+ if (width == ast->getTypeSize(ast->WCharTy))
+ return CompilerType(ast, ast->WCharTy);
+ break;
+ case PDB_BuiltinType::Char16:
+ return CompilerType(ast, ast->Char16Ty);
+ case PDB_BuiltinType::Char32:
+ return CompilerType(ast, ast->Char32Ty);
+ case PDB_BuiltinType::Float:
+ // Note: types `long double` and `double` have same bit size in MSVC and
+ // there is no information in the PDB to distinguish them. So when falling
+ // back to default search, the compiler type of `long double` will be
+ // represented by the one generated for `double`.
+ break;
+ }
+ // If there is no match on PDB_BuiltinType, fall back to default search by
+ // encoding and width only
+ return clang_ast.GetBuiltinTypeForEncodingAndBitSize(encoding, width);
+}
+
+ConstString GetPDBBuiltinTypeName(const PDBSymbolTypeBuiltin &pdb_type,
+ CompilerType &compiler_type) {
+ PDB_BuiltinType kind = pdb_type.getBuiltinType();
+ switch (kind) {
+ default:
+ break;
+ case PDB_BuiltinType::Currency:
+ return ConstString("CURRENCY");
+ case PDB_BuiltinType::Date:
+ return ConstString("DATE");
+ case PDB_BuiltinType::Variant:
+ return ConstString("VARIANT");
+ case PDB_BuiltinType::Complex:
+ return ConstString("complex");
+ case PDB_BuiltinType::Bitfield:
+ return ConstString("bitfield");
+ case PDB_BuiltinType::BSTR:
+ return ConstString("BSTR");
+ case PDB_BuiltinType::HResult:
+ return ConstString("HRESULT");
+ case PDB_BuiltinType::BCD:
+ return ConstString("BCD");
+ case PDB_BuiltinType::Char16:
+ return ConstString("char16_t");
+ case PDB_BuiltinType::Char32:
+ return ConstString("char32_t");
+ case PDB_BuiltinType::None:
+ return ConstString("...");
+ }
+ return compiler_type.GetTypeName();
+}
+
+bool GetDeclarationForSymbol(const PDBSymbol &symbol, Declaration &decl) {
+ auto &raw_sym = symbol.getRawSymbol();
+ auto first_line_up = raw_sym.getSrcLineOnTypeDefn();
+
+ if (!first_line_up) {
+ auto lines_up = symbol.getSession().findLineNumbersByAddress(
+ raw_sym.getVirtualAddress(), raw_sym.getLength());
+ if (!lines_up)
+ return false;
+ first_line_up = lines_up->getNext();
+ if (!first_line_up)
+ return false;
+ }
+ uint32_t src_file_id = first_line_up->getSourceFileId();
+ auto src_file_up = symbol.getSession().getSourceFileById(src_file_id);
+ if (!src_file_up)
+ return false;
+
+ FileSpec spec(src_file_up->getFileName(), /*resolve_path*/ false);
+ decl.SetFile(spec);
+ decl.SetColumn(first_line_up->getColumnNumber());
+ decl.SetLine(first_line_up->getLineNumber());
+ return true;
+}
+} // namespace
+
PDBASTParser::PDBASTParser(lldb_private::ClangASTContext &ast) : m_ast(ast) {}
PDBASTParser::~PDBASTParser() {}
@@ -76,21 +209,27 @@ PDBASTParser::~PDBASTParser() {}
lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
// PDB doesn't maintain enough information to robustly rebuild the entire
- // tree, and this is most problematic when it comes to figure out the
- // right DeclContext to put a type in. So for now, everything goes in
- // the translation unit decl as a fully qualified type.
+ // tree, and this is most problematic when it comes to figure out the right
+ // DeclContext to put a type in. So for now, everything goes in the
+ // translation unit decl as a fully qualified type.
clang::DeclContext *tu_decl_ctx = m_ast.GetTranslationUnitDecl();
Declaration decl;
- if (auto udt = llvm::dyn_cast<PDBSymbolTypeUDT>(&type)) {
+ switch (type.getSymTag()) {
+ case PDB_SymType::UDT: {
+ auto udt = llvm::dyn_cast<PDBSymbolTypeUDT>(&type);
+ assert(udt);
AccessType access = lldb::eAccessPublic;
PDB_UdtType udt_kind = udt->getUdtKind();
+ auto tag_type_kind = TranslateUdtKind(udt_kind);
+ if (tag_type_kind == -1)
+ return nullptr;
if (udt_kind == PDB_UdtType::Class)
access = lldb::eAccessPrivate;
CompilerType clang_type = m_ast.CreateRecordType(
- tu_decl_ctx, access, udt->getName().c_str(), TranslateUdtKind(udt_kind),
+ tu_decl_ctx, access, udt->getName().c_str(), tag_type_kind,
lldb::eLanguageTypeC_plus_plus, nullptr);
m_ast.SetHasExternalStorage(clang_type.GetOpaqueQualType(), true);
@@ -100,51 +239,107 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
ConstString(udt->getName()), udt->getLength(), nullptr,
LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl, clang_type,
lldb_private::Type::eResolveStateForward);
- } else if (auto enum_type = llvm::dyn_cast<PDBSymbolTypeEnum>(&type)) {
- std::string name = enum_type->getName();
+ } break;
+ case PDB_SymType::Enum: {
+ auto enum_type = llvm::dyn_cast<PDBSymbolTypeEnum>(&type);
+ assert(enum_type);
+ auto underlying_type_up = enum_type->getUnderlyingType();
+ if (!underlying_type_up)
+ return nullptr;
lldb::Encoding encoding =
- TranslateBuiltinEncoding(enum_type->getBuiltinType());
+ TranslateBuiltinEncoding(underlying_type_up->getBuiltinType());
+ // FIXME: Type of underlying builtin is always `Int`. We correct it with
+ // the very first enumerator's encoding if any.
+ auto first_child = enum_type->findOneChild<PDBSymbolData>();
+ if (first_child) {
+ encoding = TranslateEnumEncoding(first_child->getValue().Type);
+ }
+ std::string name = enum_type->getName();
uint64_t bytes = enum_type->getLength();
- CompilerType builtin_type =
- m_ast.GetBuiltinTypeForEncodingAndBitSize(encoding, bytes * 8);
+ CompilerType builtin_type;
+ if (bytes > 0)
+ builtin_type = GetBuiltinTypeForPDBEncodingAndBitSize(
+ m_ast, *underlying_type_up, encoding, bytes * 8);
+ else
+ builtin_type = m_ast.GetBasicType(eBasicTypeInt);
+ // FIXME: PDB does not have information about scoped enumeration (Enum
+ // Class). Set it false for now.
+ bool isScoped = false;
CompilerType ast_enum = m_ast.CreateEnumerationType(
- name.c_str(), tu_decl_ctx, decl, builtin_type, false);
+ name.c_str(), tu_decl_ctx, decl, builtin_type, isScoped);
auto enum_values = enum_type->findAllChildren<PDBSymbolData>();
- while (auto enum_value = enum_values->getNext()) {
- if (enum_value->getDataKind() != PDB_DataKind::Constant)
- continue;
- AddEnumValue(ast_enum, *enum_value);
+ if (enum_values) {
+ while (auto enum_value = enum_values->getNext()) {
+ if (enum_value->getDataKind() != PDB_DataKind::Constant)
+ continue;
+ AddEnumValue(ast_enum, *enum_value);
+ }
}
+ if (ClangASTContext::StartTagDeclarationDefinition(ast_enum))
+ ClangASTContext::CompleteTagDeclarationDefinition(ast_enum);
+ GetDeclarationForSymbol(type, decl);
return std::make_shared<lldb_private::Type>(
type.getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name), bytes,
nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,
ast_enum, lldb_private::Type::eResolveStateFull);
- } else if (auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type)) {
+ } break;
+ case PDB_SymType::Typedef: {
+ auto type_def = llvm::dyn_cast<PDBSymbolTypeTypedef>(&type);
+ assert(type_def);
lldb_private::Type *target_type =
m_ast.GetSymbolFile()->ResolveTypeUID(type_def->getTypeId());
if (!target_type)
return nullptr;
std::string name = type_def->getName();
uint64_t bytes = type_def->getLength();
- if (!target_type)
- return nullptr;
CompilerType target_ast_type = target_type->GetFullCompilerType();
CompilerDeclContext target_decl_ctx =
m_ast.GetSymbolFile()->GetDeclContextForUID(target_type->GetID());
CompilerType ast_typedef =
m_ast.CreateTypedefType(target_ast_type, name.c_str(), target_decl_ctx);
+ if (!ast_typedef)
+ return nullptr;
+
return std::make_shared<lldb_private::Type>(
type_def->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name),
bytes, nullptr, target_type->GetID(),
lldb_private::Type::eEncodingIsTypedefUID, decl, ast_typedef,
lldb_private::Type::eResolveStateFull);
- } else if (auto func_sig = llvm::dyn_cast<PDBSymbolTypeFunctionSig>(&type)) {
+ } break;
+ case PDB_SymType::Function:
+ case PDB_SymType::FunctionSig: {
+ std::string name;
+ PDBSymbolTypeFunctionSig *func_sig = nullptr;
+ if (auto pdb_func = llvm::dyn_cast<PDBSymbolFunc>(&type)) {
+ if (pdb_func->isCompilerGenerated())
+ return nullptr;
+
+ auto sig = pdb_func->getSignature();
+ if (!sig)
+ return nullptr;
+ func_sig = sig.release();
+ // Function type is named.
+ name = pdb_func->getName();
+ } else if (auto pdb_func_sig =
+ llvm::dyn_cast<PDBSymbolTypeFunctionSig>(&type)) {
+ func_sig = const_cast<PDBSymbolTypeFunctionSig *>(pdb_func_sig);
+ } else
+ llvm_unreachable("Unexpected PDB symbol!");
+
auto arg_enum = func_sig->getArguments();
uint32_t num_args = arg_enum->getChildCount();
- std::vector<CompilerType> arg_list(num_args);
- while (auto arg = arg_enum->getNext()) {
+ std::vector<CompilerType> arg_list;
+
+ bool is_variadic = func_sig->isCVarArgs();
+ // Drop last variadic argument.
+ if (is_variadic)
+ --num_args;
+ for (uint32_t arg_idx = 0; arg_idx < num_args; arg_idx++) {
+ auto arg = arg_enum->getChildAtIndex(arg_idx);
+ if (!arg)
+ break;
lldb_private::Type *arg_type =
m_ast.GetSymbolFile()->ResolveTypeUID(arg->getSymIndexId());
// If there's some error looking up one of the dependent types of this
@@ -154,6 +349,8 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
CompilerType arg_ast_type = arg_type->GetFullCompilerType();
arg_list.push_back(arg_ast_type);
}
+ lldbassert(arg_list.size() <= num_args);
+
auto pdb_return_type = func_sig->getReturnType();
lldb_private::Type *return_type =
m_ast.GetSymbolFile()->ResolveTypeUID(pdb_return_type->getSymIndexId());
@@ -167,29 +364,109 @@ lldb::TypeSP PDBASTParser::CreateLLDBTypeFromPDBType(const PDBSymbol &type) {
type_quals |= clang::Qualifiers::Const;
if (func_sig->isVolatileType())
type_quals |= clang::Qualifiers::Volatile;
- CompilerType func_sig_ast_type = m_ast.CreateFunctionType(
- return_ast_type, &arg_list[0], num_args, false, type_quals);
+ CompilerType func_sig_ast_type =
+ m_ast.CreateFunctionType(return_ast_type, arg_list.data(),
+ arg_list.size(), is_variadic, type_quals);
+ GetDeclarationForSymbol(type, decl);
return std::make_shared<lldb_private::Type>(
- func_sig->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(), 0,
+ type.getSymIndexId(), m_ast.GetSymbolFile(), ConstString(name), 0,
nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,
func_sig_ast_type, lldb_private::Type::eResolveStateFull);
- } else if (auto array_type = llvm::dyn_cast<PDBSymbolTypeArray>(&type)) {
+ } break;
+ case PDB_SymType::ArrayType: {
+ auto array_type = llvm::dyn_cast<PDBSymbolTypeArray>(&type);
+ assert(array_type);
uint32_t num_elements = array_type->getCount();
- uint32_t element_uid = array_type->getElementType()->getSymIndexId();
+ uint32_t element_uid = array_type->getElementTypeId();
uint32_t bytes = array_type->getLength();
+ // If array rank > 0, PDB gives the element type at N=0. So element type
+ // will parsed in the order N=0, N=1,..., N=rank sequentially.
lldb_private::Type *element_type =
m_ast.GetSymbolFile()->ResolveTypeUID(element_uid);
if (!element_type)
return nullptr;
- CompilerType element_ast_type = element_type->GetFullCompilerType();
- CompilerType array_ast_type =
- m_ast.CreateArrayType(element_ast_type, num_elements, false);
- return std::make_shared<lldb_private::Type>(
+
+ CompilerType element_ast_type = element_type->GetForwardCompilerType();
+ // If element type is UDT, it needs to be complete.
+ if (ClangASTContext::IsCXXClassType(element_ast_type) &&
+ element_ast_type.GetCompleteType() == false) {
+ if (ClangASTContext::StartTagDeclarationDefinition(element_ast_type)) {
+ ClangASTContext::CompleteTagDeclarationDefinition(element_ast_type);
+ } else {
+ // We are not able to start defintion.
+ return nullptr;
+ }
+ }
+ CompilerType array_ast_type = m_ast.CreateArrayType(
+ element_ast_type, num_elements, /*is_gnu_vector*/ false);
+ TypeSP type_sp = std::make_shared<lldb_private::Type>(
array_type->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(),
bytes, nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID,
decl, array_ast_type, lldb_private::Type::eResolveStateFull);
+ type_sp->SetEncodingType(element_type);
+ return type_sp;
+ } break;
+ case PDB_SymType::BuiltinType: {
+ auto *builtin_type = llvm::dyn_cast<PDBSymbolTypeBuiltin>(&type);
+ assert(builtin_type);
+ PDB_BuiltinType builtin_kind = builtin_type->getBuiltinType();
+ if (builtin_kind == PDB_BuiltinType::None)
+ return nullptr;
+
+ uint64_t bytes = builtin_type->getLength();
+ Encoding encoding = TranslateBuiltinEncoding(builtin_kind);
+ CompilerType builtin_ast_type = GetBuiltinTypeForPDBEncodingAndBitSize(
+ m_ast, *builtin_type, encoding, bytes * 8);
+
+ if (builtin_type->isConstType())
+ builtin_ast_type = builtin_ast_type.AddConstModifier();
+
+ if (builtin_type->isVolatileType())
+ builtin_ast_type = builtin_ast_type.AddVolatileModifier();
+
+ auto type_name = GetPDBBuiltinTypeName(*builtin_type, builtin_ast_type);
+
+ return std::make_shared<lldb_private::Type>(
+ builtin_type->getSymIndexId(), m_ast.GetSymbolFile(), type_name, bytes,
+ nullptr, LLDB_INVALID_UID, lldb_private::Type::eEncodingIsUID, decl,
+ builtin_ast_type, lldb_private::Type::eResolveStateFull);
+ } break;
+ case PDB_SymType::PointerType: {
+ auto *pointer_type = llvm::dyn_cast<PDBSymbolTypePointer>(&type);
+ assert(pointer_type);
+ Type *pointee_type = m_ast.GetSymbolFile()->ResolveTypeUID(
+ pointer_type->getPointeeType()->getSymIndexId());
+ if (!pointee_type)
+ return nullptr;
+
+ CompilerType pointer_ast_type;
+ pointer_ast_type = pointee_type->GetFullCompilerType();
+ if (pointer_type->isReference())
+ pointer_ast_type = pointer_ast_type.GetLValueReferenceType();
+ else if (pointer_type->isRValueReference())
+ pointer_ast_type = pointer_ast_type.GetRValueReferenceType();
+ else
+ pointer_ast_type = pointer_ast_type.GetPointerType();
+
+ if (pointer_type->isConstType())
+ pointer_ast_type = pointer_ast_type.AddConstModifier();
+
+ if (pointer_type->isVolatileType())
+ pointer_ast_type = pointer_ast_type.AddVolatileModifier();
+
+ if (pointer_type->isRestrictedType())
+ pointer_ast_type = pointer_ast_type.AddRestrictModifier();
+
+ return std::make_shared<lldb_private::Type>(
+ pointer_type->getSymIndexId(), m_ast.GetSymbolFile(), ConstString(),
+ pointer_type->getLength(), nullptr, LLDB_INVALID_UID,
+ lldb_private::Type::eEncodingIsUID, decl, pointer_ast_type,
+ lldb_private::Type::eResolveStateFull);
+ } break;
+ default:
+ break;
}
return nullptr;
}
diff --git a/source/Plugins/SymbolFile/PDB/PDBASTParser.h b/source/Plugins/SymbolFile/PDB/PDBASTParser.h
index e9ff02c0a77e..d1ac138b8115 100644
--- a/source/Plugins/SymbolFile/PDB/PDBASTParser.h
+++ b/source/Plugins/SymbolFile/PDB/PDBASTParser.h
@@ -19,20 +19,20 @@ class CharUnits;
class CXXRecordDecl;
class FieldDecl;
class RecordDecl;
-}
+} // namespace clang
namespace lldb_private {
class ClangASTContext;
class CompilerType;
-}
+} // namespace lldb_private
namespace llvm {
namespace pdb {
class PDBSymbol;
class PDBSymbolData;
class PDBSymbolTypeBuiltin;
-}
-}
+} // namespace pdb
+} // namespace llvm
class PDBASTParser {
public:
@@ -49,4 +49,4 @@ private:
lldb_private::ClangASTImporter m_ast_importer;
};
-#endif // SymbolFileDWARF_DWARFASTParserClang_h_
+#endif // LLDB_PLUGINS_SYMBOLFILE_PDB_PDBASTPARSER_H
diff --git a/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp b/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
new file mode 100644
index 000000000000..69ef70cc508c
--- /dev/null
+++ b/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.cpp
@@ -0,0 +1,585 @@
+//===-- PDBLocationToDWARFExpression.cpp ------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "PDBLocationToDWARFExpression.h"
+
+#include "lldb/Core/Section.h"
+#include "lldb/Core/StreamBuffer.h"
+#include "lldb/Core/dwarf.h"
+#include "lldb/Expression/DWARFExpression.h"
+#include "lldb/Utility/DataBufferHeap.h"
+
+#include "llvm/DebugInfo/CodeView/CodeView.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
+
+#include "Plugins/Process/Utility/lldb-x86-register-enums.h"
+
+using namespace lldb;
+using namespace lldb_private;
+using namespace llvm::pdb;
+
+namespace {
+const uint32_t g_code_view_to_lldb_registers_x86[] = {
+ LLDB_INVALID_REGNUM, // CVRegNONE
+ lldb_al_i386, // CVRegAL
+ lldb_cl_i386, // CVRegCL
+ lldb_dl_i386, // CVRegDL
+ lldb_bl_i386, // CVRegBL
+ lldb_ah_i386, // CVRegAH
+ lldb_ch_i386, // CVRegCH
+ lldb_dh_i386, // CVRegDH
+ lldb_bh_i386, // CVRegBH
+ lldb_ax_i386, // CVRegAX
+ lldb_cx_i386, // CVRegCX
+ lldb_dx_i386, // CVRegDX
+ lldb_bx_i386, // CVRegBX
+ lldb_sp_i386, // CVRegSP
+ lldb_bp_i386, // CVRegBP
+ lldb_si_i386, // CVRegSI
+ lldb_di_i386, // CVRegDI
+ lldb_eax_i386, // CVRegEAX
+ lldb_ecx_i386, // CVRegECX
+ lldb_edx_i386, // CVRegEDX
+ lldb_ebx_i386, // CVRegEBX
+ lldb_esp_i386, // CVRegESP
+ lldb_ebp_i386, // CVRegEBP
+ lldb_esi_i386, // CVRegESI
+ lldb_edi_i386, // CVRegEDI
+ lldb_es_i386, // CVRegES
+ lldb_cs_i386, // CVRegCS
+ lldb_ss_i386, // CVRegSS
+ lldb_ds_i386, // CVRegDS
+ lldb_fs_i386, // CVRegFS
+ lldb_gs_i386, // CVRegGS
+ LLDB_INVALID_REGNUM, // CVRegIP
+ LLDB_INVALID_REGNUM, // CVRegFLAGS
+ lldb_eip_i386, // CVRegEIP
+ lldb_eflags_i386, // CVRegEFLAGS
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegTEMP
+ LLDB_INVALID_REGNUM, // CVRegTEMPH
+ LLDB_INVALID_REGNUM, // CVRegQUOTE
+ LLDB_INVALID_REGNUM, // CVRegPCDR3
+ LLDB_INVALID_REGNUM, // CVRegPCDR4
+ LLDB_INVALID_REGNUM, // CVRegPCDR5
+ LLDB_INVALID_REGNUM, // CVRegPCDR6
+ LLDB_INVALID_REGNUM, // CVRegPCDR7
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegCR0
+ LLDB_INVALID_REGNUM, // CVRegCR1
+ LLDB_INVALID_REGNUM, // CVRegCR2
+ LLDB_INVALID_REGNUM, // CVRegCR3
+ LLDB_INVALID_REGNUM, // CVRegCR4
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ lldb_dr0_i386, // CVRegDR0
+ lldb_dr1_i386, // CVRegDR1
+ lldb_dr2_i386, // CVRegDR2
+ lldb_dr3_i386, // CVRegDR3
+ lldb_dr4_i386, // CVRegDR4
+ lldb_dr5_i386, // CVRegDR5
+ lldb_dr6_i386, // CVRegDR6
+ lldb_dr7_i386, // CVRegDR7
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegGDTR
+ LLDB_INVALID_REGNUM, // CVRegGDTL
+ LLDB_INVALID_REGNUM, // CVRegIDTR
+ LLDB_INVALID_REGNUM, // CVRegIDTL
+ LLDB_INVALID_REGNUM, // CVRegLDTR
+ LLDB_INVALID_REGNUM, // CVRegTR
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO1
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO2
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO3
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO4
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO5
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO6
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO7
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO8
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO9
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ lldb_st0_i386, // CVRegST0
+ lldb_st1_i386, // CVRegST1
+ lldb_st2_i386, // CVRegST2
+ lldb_st3_i386, // CVRegST3
+ lldb_st4_i386, // CVRegST4
+ lldb_st5_i386, // CVRegST5
+ lldb_st6_i386, // CVRegST6
+ lldb_st7_i386, // CVRegST7
+ LLDB_INVALID_REGNUM, // CVRegCTRL
+ LLDB_INVALID_REGNUM, // CVRegSTAT
+ LLDB_INVALID_REGNUM, // CVRegTAG
+ LLDB_INVALID_REGNUM, // CVRegFPIP
+ LLDB_INVALID_REGNUM, // CVRegFPCS
+ LLDB_INVALID_REGNUM, // CVRegFPDO
+ LLDB_INVALID_REGNUM, // CVRegFPDS
+ LLDB_INVALID_REGNUM, // CVRegISEM
+ LLDB_INVALID_REGNUM, // CVRegFPEIP
+ LLDB_INVALID_REGNUM, // CVRegFPEDO
+ lldb_mm0_i386, // CVRegMM0
+ lldb_mm1_i386, // CVRegMM1
+ lldb_mm2_i386, // CVRegMM2
+ lldb_mm3_i386, // CVRegMM3
+ lldb_mm4_i386, // CVRegMM4
+ lldb_mm5_i386, // CVRegMM5
+ lldb_mm6_i386, // CVRegMM6
+ lldb_mm7_i386, // CVRegMM7
+ lldb_xmm0_i386, // CVRegXMM0
+ lldb_xmm1_i386, // CVRegXMM1
+ lldb_xmm2_i386, // CVRegXMM2
+ lldb_xmm3_i386, // CVRegXMM3
+ lldb_xmm4_i386, // CVRegXMM4
+ lldb_xmm5_i386, // CVRegXMM5
+ lldb_xmm6_i386, // CVRegXMM6
+ lldb_xmm7_i386 // CVRegXMM7
+};
+
+const uint32_t g_code_view_to_lldb_registers_x86_64[] = {
+ LLDB_INVALID_REGNUM, // CVRegNONE
+ lldb_al_x86_64, // CVRegAL
+ lldb_cl_x86_64, // CVRegCL
+ lldb_dl_x86_64, // CVRegDL
+ lldb_bl_x86_64, // CVRegBL
+ lldb_ah_x86_64, // CVRegAH
+ lldb_ch_x86_64, // CVRegCH
+ lldb_dh_x86_64, // CVRegDH
+ lldb_bh_x86_64, // CVRegBH
+ lldb_ax_x86_64, // CVRegAX
+ lldb_cx_x86_64, // CVRegCX
+ lldb_dx_x86_64, // CVRegDX
+ lldb_bx_x86_64, // CVRegBX
+ lldb_sp_x86_64, // CVRegSP
+ lldb_bp_x86_64, // CVRegBP
+ lldb_si_x86_64, // CVRegSI
+ lldb_di_x86_64, // CVRegDI
+ lldb_eax_x86_64, // CVRegEAX
+ lldb_ecx_x86_64, // CVRegECX
+ lldb_edx_x86_64, // CVRegEDX
+ lldb_ebx_x86_64, // CVRegEBX
+ lldb_esp_x86_64, // CVRegESP
+ lldb_ebp_x86_64, // CVRegEBP
+ lldb_esi_x86_64, // CVRegESI
+ lldb_edi_x86_64, // CVRegEDI
+ lldb_es_x86_64, // CVRegES
+ lldb_cs_x86_64, // CVRegCS
+ lldb_ss_x86_64, // CVRegSS
+ lldb_ds_x86_64, // CVRegDS
+ lldb_fs_x86_64, // CVRegFS
+ lldb_gs_x86_64, // CVRegGS
+ LLDB_INVALID_REGNUM, // CVRegIP
+ LLDB_INVALID_REGNUM, // CVRegFLAGS
+ LLDB_INVALID_REGNUM, // CVRegEIP
+ LLDB_INVALID_REGNUM, // CVRegEFLAGS
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegTEMP
+ LLDB_INVALID_REGNUM, // CVRegTEMPH
+ LLDB_INVALID_REGNUM, // CVRegQUOTE
+ LLDB_INVALID_REGNUM, // CVRegPCDR3
+ LLDB_INVALID_REGNUM, // CVRegPCDR4
+ LLDB_INVALID_REGNUM, // CVRegPCDR5
+ LLDB_INVALID_REGNUM, // CVRegPCDR6
+ LLDB_INVALID_REGNUM, // CVRegPCDR7
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegCR0
+ LLDB_INVALID_REGNUM, // CVRegCR1
+ LLDB_INVALID_REGNUM, // CVRegCR2
+ LLDB_INVALID_REGNUM, // CVRegCR3
+ LLDB_INVALID_REGNUM, // CVRegCR4
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ lldb_dr0_x86_64, // CVRegDR0
+ lldb_dr1_x86_64, // CVRegDR1
+ lldb_dr2_x86_64, // CVRegDR2
+ lldb_dr3_x86_64, // CVRegDR3
+ lldb_dr4_x86_64, // CVRegDR4
+ lldb_dr5_x86_64, // CVRegDR5
+ lldb_dr6_x86_64, // CVRegDR6
+ lldb_dr7_x86_64, // CVRegDR7
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegGDTR
+ LLDB_INVALID_REGNUM, // CVRegGDTL
+ LLDB_INVALID_REGNUM, // CVRegIDTR
+ LLDB_INVALID_REGNUM, // CVRegIDTL
+ LLDB_INVALID_REGNUM, // CVRegLDTR
+ LLDB_INVALID_REGNUM, // CVRegTR
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO1
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO2
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO3
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO4
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO5
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO6
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO7
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO8
+ LLDB_INVALID_REGNUM, // CVRegPSEUDO9
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ lldb_st0_x86_64, // CVRegST0
+ lldb_st1_x86_64, // CVRegST1
+ lldb_st2_x86_64, // CVRegST2
+ lldb_st3_x86_64, // CVRegST3
+ lldb_st4_x86_64, // CVRegST4
+ lldb_st5_x86_64, // CVRegST5
+ lldb_st6_x86_64, // CVRegST6
+ lldb_st7_x86_64, // CVRegST7
+ LLDB_INVALID_REGNUM, // CVRegCTRL
+ LLDB_INVALID_REGNUM, // CVRegSTAT
+ LLDB_INVALID_REGNUM, // CVRegTAG
+ LLDB_INVALID_REGNUM, // CVRegFPIP
+ LLDB_INVALID_REGNUM, // CVRegFPCS
+ LLDB_INVALID_REGNUM, // CVRegFPDO
+ LLDB_INVALID_REGNUM, // CVRegFPDS
+ LLDB_INVALID_REGNUM, // CVRegISEM
+ LLDB_INVALID_REGNUM, // CVRegFPEIP
+ LLDB_INVALID_REGNUM, // CVRegFPEDO
+ lldb_mm0_x86_64, // CVRegMM0
+ lldb_mm1_x86_64, // CVRegMM1
+ lldb_mm2_x86_64, // CVRegMM2
+ lldb_mm3_x86_64, // CVRegMM3
+ lldb_mm4_x86_64, // CVRegMM4
+ lldb_mm5_x86_64, // CVRegMM5
+ lldb_mm6_x86_64, // CVRegMM6
+ lldb_mm7_x86_64, // CVRegMM7
+ lldb_xmm0_x86_64, // CVRegXMM0
+ lldb_xmm1_x86_64, // CVRegXMM1
+ lldb_xmm2_x86_64, // CVRegXMM2
+ lldb_xmm3_x86_64, // CVRegXMM3
+ lldb_xmm4_x86_64, // CVRegXMM4
+ lldb_xmm5_x86_64, // CVRegXMM5
+ lldb_xmm6_x86_64, // CVRegXMM6
+ lldb_xmm7_x86_64, // CVRegXMM7
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM,
+ lldb_mxcsr_x86_64, // CVRegMXCSR
+ LLDB_INVALID_REGNUM, // CVRegEDXEAX
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, // CVRegEMM0L
+ LLDB_INVALID_REGNUM, // CVRegEMM1L
+ LLDB_INVALID_REGNUM, // CVRegEMM2L
+ LLDB_INVALID_REGNUM, // CVRegEMM3L
+ LLDB_INVALID_REGNUM, // CVRegEMM4L
+ LLDB_INVALID_REGNUM, // CVRegEMM5L
+ LLDB_INVALID_REGNUM, // CVRegEMM6L
+ LLDB_INVALID_REGNUM, // CVRegEMM7L
+ LLDB_INVALID_REGNUM, // CVRegEMM0H
+ LLDB_INVALID_REGNUM, // CVRegEMM1H
+ LLDB_INVALID_REGNUM, // CVRegEMM2H
+ LLDB_INVALID_REGNUM, // CVRegEMM3H
+ LLDB_INVALID_REGNUM, // CVRegEMM4H
+ LLDB_INVALID_REGNUM, // CVRegEMM5H
+ LLDB_INVALID_REGNUM, // CVRegEMM6H
+ LLDB_INVALID_REGNUM, // CVRegEMM7H
+ LLDB_INVALID_REGNUM, // CVRegMM00
+ LLDB_INVALID_REGNUM, // CVRegMM01
+ LLDB_INVALID_REGNUM, // CVRegMM10
+ LLDB_INVALID_REGNUM, // CVRegMM11
+ LLDB_INVALID_REGNUM, // CVRegMM20
+ LLDB_INVALID_REGNUM, // CVRegMM21
+ LLDB_INVALID_REGNUM, // CVRegMM30
+ LLDB_INVALID_REGNUM, // CVRegMM31
+ LLDB_INVALID_REGNUM, // CVRegMM40
+ LLDB_INVALID_REGNUM, // CVRegMM41
+ LLDB_INVALID_REGNUM, // CVRegMM50
+ LLDB_INVALID_REGNUM, // CVRegMM51
+ LLDB_INVALID_REGNUM, // CVRegMM60
+ LLDB_INVALID_REGNUM, // CVRegMM61
+ LLDB_INVALID_REGNUM, // CVRegMM70
+ LLDB_INVALID_REGNUM, // CVRegMM71
+ lldb_xmm8_x86_64, // CVRegXMM8
+ lldb_xmm9_x86_64, // CVRegXMM9
+ lldb_xmm10_x86_64, // CVRegXMM10
+ lldb_xmm11_x86_64, // CVRegXMM11
+ lldb_xmm12_x86_64, // CVRegXMM12
+ lldb_xmm13_x86_64, // CVRegXMM13
+ lldb_xmm14_x86_64, // CVRegXMM14
+ lldb_xmm15_x86_64, // CVRegXMM15
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM,
+ lldb_sil_x86_64, // CVRegSIL
+ lldb_dil_x86_64, // CVRegDIL
+ lldb_bpl_x86_64, // CVRegBPL
+ lldb_spl_x86_64, // CVRegSPL
+ lldb_rax_x86_64, // CVRegRAX
+ lldb_rbx_x86_64, // CVRegRBX
+ lldb_rcx_x86_64, // CVRegRCX
+ lldb_rdx_x86_64, // CVRegRDX
+ lldb_rsi_x86_64, // CVRegRSI
+ lldb_rdi_x86_64, // CVRegRDI
+ lldb_rbp_x86_64, // CVRegRBP
+ lldb_rsp_x86_64, // CVRegRSP
+ lldb_r8_x86_64, // CVRegR8
+ lldb_r9_x86_64, // CVRegR9
+ lldb_r10_x86_64, // CVRegR10
+ lldb_r11_x86_64, // CVRegR11
+ lldb_r12_x86_64, // CVRegR12
+ lldb_r13_x86_64, // CVRegR13
+ lldb_r14_x86_64, // CVRegR14
+ lldb_r15_x86_64, // CVRegR15
+ lldb_r8l_x86_64, // CVRegR8B
+ lldb_r9l_x86_64, // CVRegR9B
+ lldb_r10l_x86_64, // CVRegR10B
+ lldb_r11l_x86_64, // CVRegR11B
+ lldb_r12l_x86_64, // CVRegR12B
+ lldb_r13l_x86_64, // CVRegR13B
+ lldb_r14l_x86_64, // CVRegR14B
+ lldb_r15l_x86_64, // CVRegR15B
+ lldb_r8w_x86_64, // CVRegR8W
+ lldb_r9w_x86_64, // CVRegR9W
+ lldb_r10w_x86_64, // CVRegR10W
+ lldb_r11w_x86_64, // CVRegR11W
+ lldb_r12w_x86_64, // CVRegR12W
+ lldb_r13w_x86_64, // CVRegR13W
+ lldb_r14w_x86_64, // CVRegR14W
+ lldb_r15w_x86_64, // CVRegR15W
+ lldb_r8d_x86_64, // CVRegR8D
+ lldb_r9d_x86_64, // CVRegR9D
+ lldb_r10d_x86_64, // CVRegR10D
+ lldb_r11d_x86_64, // CVRegR11D
+ lldb_r12d_x86_64, // CVRegR12D
+ lldb_r13d_x86_64, // CVRegR13D
+ lldb_r14d_x86_64, // CVRegR14D
+ lldb_r15d_x86_64, // CVRegR15D
+ lldb_ymm0_x86_64, // CVRegAMD64_YMM0
+ lldb_ymm1_x86_64, // CVRegAMD64_YMM1
+ lldb_ymm2_x86_64, // CVRegAMD64_YMM2
+ lldb_ymm3_x86_64, // CVRegAMD64_YMM3
+ lldb_ymm4_x86_64, // CVRegAMD64_YMM4
+ lldb_ymm5_x86_64, // CVRegAMD64_YMM5
+ lldb_ymm6_x86_64, // CVRegAMD64_YMM6
+ lldb_ymm7_x86_64, // CVRegAMD64_YMM7
+ lldb_ymm8_x86_64, // CVRegAMD64_YMM8
+ lldb_ymm9_x86_64, // CVRegAMD64_YMM9
+ lldb_ymm10_x86_64, // CVRegAMD64_YMM10
+ lldb_ymm11_x86_64, // CVRegAMD64_YMM11
+ lldb_ymm12_x86_64, // CVRegAMD64_YMM12
+ lldb_ymm13_x86_64, // CVRegAMD64_YMM13
+ lldb_ymm14_x86_64, // CVRegAMD64_YMM14
+ lldb_ymm15_x86_64, // CVRegAMD64_YMM15
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM, LLDB_INVALID_REGNUM,
+ lldb_bnd0_x86_64, // CVRegBND0
+ lldb_bnd1_x86_64, // CVRegBND1
+ lldb_bnd2_x86_64 // CVRegBND2
+};
+
+uint32_t GetLLDBRegisterNumber(llvm::Triple::ArchType arch_type,
+ llvm::codeview::RegisterId register_id) {
+ switch (arch_type) {
+ case llvm::Triple::x86:
+ if (static_cast<uint16_t>(register_id) <
+ sizeof(g_code_view_to_lldb_registers_x86) /
+ sizeof(g_code_view_to_lldb_registers_x86[0]))
+ return g_code_view_to_lldb_registers_x86[static_cast<uint16_t>(
+ register_id)];
+
+ switch (register_id) {
+ case llvm::codeview::RegisterId::CVRegMXCSR:
+ return lldb_mxcsr_i386;
+ case llvm::codeview::RegisterId::CVRegBND0:
+ return lldb_bnd0_i386;
+ case llvm::codeview::RegisterId::CVRegBND1:
+ return lldb_bnd1_i386;
+ case llvm::codeview::RegisterId::CVRegBND2:
+ return lldb_bnd2_i386;
+ default:
+ return LLDB_INVALID_REGNUM;
+ }
+ case llvm::Triple::x86_64:
+ if (static_cast<uint16_t>(register_id) <
+ sizeof(g_code_view_to_lldb_registers_x86_64) /
+ sizeof(g_code_view_to_lldb_registers_x86_64[0]))
+ return g_code_view_to_lldb_registers_x86_64[static_cast<uint16_t>(
+ register_id)];
+
+ return LLDB_INVALID_REGNUM;
+ default:
+ return LLDB_INVALID_REGNUM;
+ }
+}
+
+uint32_t GetGenericRegisterNumber(llvm::codeview::RegisterId register_id) {
+ if (register_id == llvm::codeview::RegisterId::CVRegVFRAME)
+ return LLDB_REGNUM_GENERIC_FP;
+
+ return LLDB_INVALID_REGNUM;
+}
+
+uint32_t GetRegisterNumber(llvm::Triple::ArchType arch_type,
+ llvm::codeview::RegisterId register_id,
+ RegisterKind &register_kind) {
+ register_kind = eRegisterKindLLDB;
+ uint32_t reg_num = GetLLDBRegisterNumber(arch_type, register_id);
+ if (reg_num != LLDB_INVALID_REGNUM)
+ return reg_num;
+
+ register_kind = eRegisterKindGeneric;
+ return GetGenericRegisterNumber(register_id);
+}
+} // namespace
+
+DWARFExpression ConvertPDBLocationToDWARFExpression(ModuleSP module,
+ const PDBSymbolData &symbol,
+ bool &is_constant) {
+ is_constant = true;
+
+ if (!module)
+ return DWARFExpression(nullptr);
+
+ const ArchSpec &architecture = module->GetArchitecture();
+ llvm::Triple::ArchType arch_type = architecture.GetMachine();
+ ByteOrder byte_order = architecture.GetByteOrder();
+ uint32_t address_size = architecture.GetAddressByteSize();
+ uint32_t byte_size = architecture.GetDataByteSize();
+ if (byte_order == eByteOrderInvalid || address_size == 0)
+ return DWARFExpression(nullptr);
+
+ RegisterKind register_kind = eRegisterKindDWARF;
+ StreamBuffer<32> stream(Stream::eBinary, address_size, byte_order);
+ switch (symbol.getLocationType()) {
+ case PDB_LocType::Static:
+ case PDB_LocType::TLS: {
+ stream.PutHex8(DW_OP_addr);
+
+ SectionList *section_list = module->GetSectionList();
+ if (!section_list)
+ return DWARFExpression(nullptr);
+
+ uint32_t section_idx = symbol.getAddressSection() - 1;
+ if (section_idx >= section_list->GetSize())
+ return DWARFExpression(nullptr);
+
+ auto section = section_list->GetSectionAtIndex(section_idx);
+ if (!section)
+ return DWARFExpression(nullptr);
+
+ uint32_t offset = symbol.getAddressOffset();
+ stream.PutMaxHex64(section->GetFileAddress() + offset, address_size,
+ byte_order);
+
+ is_constant = false;
+
+ break;
+ }
+ case PDB_LocType::RegRel: {
+ uint32_t reg_num =
+ GetRegisterNumber(arch_type, symbol.getRegisterId(), register_kind);
+ if (reg_num == LLDB_INVALID_REGNUM)
+ return DWARFExpression(nullptr);
+
+ if (reg_num > 31) {
+ stream.PutHex8(DW_OP_bregx);
+ stream.PutULEB128(reg_num);
+ } else
+ stream.PutHex8(DW_OP_breg0 + reg_num);
+
+ int32_t offset = symbol.getOffset();
+ stream.PutSLEB128(offset);
+
+ is_constant = false;
+
+ break;
+ }
+ case PDB_LocType::Enregistered: {
+ uint32_t reg_num =
+ GetRegisterNumber(arch_type, symbol.getRegisterId(), register_kind);
+ if (reg_num == LLDB_INVALID_REGNUM)
+ return DWARFExpression(nullptr);
+
+ if (reg_num > 31) {
+ stream.PutHex8(DW_OP_regx);
+ stream.PutULEB128(reg_num);
+ } else
+ stream.PutHex8(DW_OP_reg0 + reg_num);
+
+ is_constant = false;
+
+ break;
+ }
+ case PDB_LocType::Constant: {
+ Variant value = symbol.getValue();
+ stream.PutRawBytes(&value.Value, sizeof(value.Value),
+ endian::InlHostByteOrder());
+ break;
+ }
+ default:
+ return DWARFExpression(nullptr);
+ }
+
+ DataBufferSP buffer =
+ std::make_shared<DataBufferHeap>(stream.GetData(), stream.GetSize());
+ DataExtractor extractor(buffer, byte_order, address_size, byte_size);
+ DWARFExpression result(module, extractor, nullptr, 0, buffer->GetByteSize());
+ result.SetRegisterKind(register_kind);
+
+ return result;
+}
diff --git a/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h b/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h
new file mode 100644
index 000000000000..37b80dfccb84
--- /dev/null
+++ b/source/Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h
@@ -0,0 +1,45 @@
+//===-- PDBLocationToDWARFExpression.h --------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef lldb_Plugins_SymbolFile_PDB_PDBLocationToDWARFExpression_h_
+#define lldb_Plugins_SymbolFile_PDB_PDBLocationToDWARFExpression_h_
+
+#include "lldb/Core/Module.h"
+
+namespace lldb_private {
+class DWARFExpression;
+}
+
+namespace llvm {
+namespace pdb {
+class PDBSymbolData;
+}
+} // namespace llvm
+
+//------------------------------------------------------------------------------
+/// Converts a location information from a PDB symbol to a DWARF expression
+///
+/// @param[in] module
+/// The module \a symbol belongs to.
+///
+/// @param[in] symbol
+/// The symbol with a location information to convert.
+///
+/// @param[out] is_constant
+/// Set to \b true if the result expression is a constant value data,
+/// and \b false if it is a DWARF bytecode.
+///
+/// @return
+/// The DWARF expression corresponding to the location data of \a symbol.
+//------------------------------------------------------------------------------
+lldb_private::DWARFExpression
+ConvertPDBLocationToDWARFExpression(lldb::ModuleSP module,
+ const llvm::pdb::PDBSymbolData &symbol,
+ bool &is_constant);
+#endif
diff --git a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
index de9b9f024fc7..05f3017819fa 100644
--- a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
+++ b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
@@ -18,16 +18,21 @@
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
+#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/TypeList.h"
#include "lldb/Symbol/TypeMap.h"
+#include "lldb/Symbol/Variable.h"
#include "lldb/Utility/RegularExpression.h"
#include "llvm/DebugInfo/PDB/GenericError.h"
#include "llvm/DebugInfo/PDB/IPDBDataStream.h"
#include "llvm/DebugInfo/PDB/IPDBEnumChildren.h"
#include "llvm/DebugInfo/PDB/IPDBLineNumber.h"
+#include "llvm/DebugInfo/PDB/IPDBSectionContrib.h"
#include "llvm/DebugInfo/PDB/IPDBSourceFile.h"
#include "llvm/DebugInfo/PDB/IPDBTable.h"
#include "llvm/DebugInfo/PDB/PDBSymbol.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolBlock.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompiland.h"
#include "llvm/DebugInfo/PDB/PDBSymbolCompilandDetails.h"
#include "llvm/DebugInfo/PDB/PDBSymbolData.h"
@@ -35,14 +40,18 @@
#include "llvm/DebugInfo/PDB/PDBSymbolFunc.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugEnd.h"
#include "llvm/DebugInfo/PDB/PDBSymbolFuncDebugStart.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolPublicSymbol.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeEnum.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeTypedef.h"
#include "llvm/DebugInfo/PDB/PDBSymbolTypeUDT.h"
+#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
#include "Plugins/SymbolFile/PDB/PDBASTParser.h"
+#include "Plugins/SymbolFile/PDB/PDBLocationToDWARFExpression.h"
#include <regex>
+using namespace lldb;
using namespace lldb_private;
using namespace llvm::pdb;
@@ -63,7 +72,7 @@ bool ShouldAddLine(uint32_t requested_line, uint32_t actual_line,
return ((requested_line == 0 || actual_line == requested_line) &&
addr_length > 0);
}
-}
+} // namespace
void SymbolFilePDB::Initialize() {
PluginManager::RegisterPlugin(GetPluginNameStatic(),
@@ -92,7 +101,8 @@ SymbolFilePDB::CreateInstance(lldb_private::ObjectFile *obj_file) {
}
SymbolFilePDB::SymbolFilePDB(lldb_private::ObjectFile *object_file)
- : SymbolFile(object_file), m_cached_compile_unit_count(0) {}
+ : SymbolFile(object_file), m_session_up(), m_global_scope_up(),
+ m_cached_compile_unit_count(0), m_tu_decl_ctx_up() {}
SymbolFilePDB::~SymbolFilePDB() {}
@@ -116,15 +126,14 @@ uint32_t SymbolFilePDB::CalculateAbilities() {
if (!symfile)
return 0;
error = loadDataForPDB(PDB_ReaderType::DIA,
- llvm::StringRef(symfile.GetPath()),
- m_session_up);
+ llvm::StringRef(symfile.GetPath()), m_session_up);
if (error) {
llvm::consumeError(std::move(error));
return 0;
}
}
}
- if (!m_session_up.get())
+ if (!m_session_up)
return 0;
auto enum_tables_up = m_session_up->getEnumTables();
@@ -138,13 +147,14 @@ uint32_t SymbolFilePDB::CalculateAbilities() {
case PDB_TableType::Symbols:
// This table represents a store of symbols with types listed in
// PDBSym_Type
- abilities |= (CompileUnits | Functions | Blocks |
- GlobalVariables | LocalVariables | VariableTypes);
+ abilities |= (CompileUnits | Functions | Blocks | GlobalVariables |
+ LocalVariables | VariableTypes);
break;
case PDB_TableType::LineNumbers:
abilities |= LineTables;
break;
- default: break;
+ default:
+ break;
}
}
return abilities;
@@ -152,41 +162,88 @@ uint32_t SymbolFilePDB::CalculateAbilities() {
void SymbolFilePDB::InitializeObject() {
lldb::addr_t obj_load_address = m_obj_file->GetFileOffset();
+ lldbassert(obj_load_address && obj_load_address != LLDB_INVALID_ADDRESS);
m_session_up->setLoadAddress(obj_load_address);
+ if (!m_global_scope_up)
+ m_global_scope_up = m_session_up->getGlobalScope();
+ lldbassert(m_global_scope_up.get());
TypeSystem *type_system =
GetTypeSystemForLanguage(lldb::eLanguageTypeC_plus_plus);
ClangASTContext *clang_type_system =
llvm::dyn_cast_or_null<ClangASTContext>(type_system);
+ lldbassert(clang_type_system);
m_tu_decl_ctx_up = llvm::make_unique<CompilerDeclContext>(
type_system, clang_type_system->GetTranslationUnitDecl());
}
uint32_t SymbolFilePDB::GetNumCompileUnits() {
if (m_cached_compile_unit_count == 0) {
- auto global = m_session_up->getGlobalScope();
- auto compilands = global->findAllChildren<PDBSymbolCompiland>();
+ auto compilands = m_global_scope_up->findAllChildren<PDBSymbolCompiland>();
+ if (!compilands)
+ return 0;
+
+ // The linker could link *.dll (compiland language = LINK), or import
+ // *.dll. For example, a compiland with name `Import:KERNEL32.dll` could be
+ // found as a child of the global scope (PDB executable). Usually, such
+ // compilands contain `thunk` symbols in which we are not interested for
+ // now. However we still count them in the compiland list. If we perform
+ // any compiland related activity, like finding symbols through
+ // llvm::pdb::IPDBSession methods, such compilands will all be searched
+ // automatically no matter whether we include them or not.
m_cached_compile_unit_count = compilands->getChildCount();
// The linker can inject an additional "dummy" compilation unit into the
// PDB. Ignore this special compile unit for our purposes, if it is there.
// It is always the last one.
- auto last_cu = compilands->getChildAtIndex(m_cached_compile_unit_count - 1);
- std::string name = last_cu->getName();
+ auto last_compiland_up =
+ compilands->getChildAtIndex(m_cached_compile_unit_count - 1);
+ lldbassert(last_compiland_up.get());
+ std::string name = last_compiland_up->getName();
if (name == "* Linker *")
--m_cached_compile_unit_count;
}
return m_cached_compile_unit_count;
}
-lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitAtIndex(uint32_t index) {
- auto global = m_session_up->getGlobalScope();
- auto compilands = global->findAllChildren<PDBSymbolCompiland>();
- auto cu = compilands->getChildAtIndex(index);
+void SymbolFilePDB::GetCompileUnitIndex(
+ const llvm::pdb::PDBSymbolCompiland &pdb_compiland, uint32_t &index) {
+ auto results_up = m_global_scope_up->findAllChildren<PDBSymbolCompiland>();
+ if (!results_up)
+ return;
+ auto uid = pdb_compiland.getSymIndexId();
+ for (uint32_t cu_idx = 0; cu_idx < GetNumCompileUnits(); ++cu_idx) {
+ auto compiland_up = results_up->getChildAtIndex(cu_idx);
+ if (!compiland_up)
+ continue;
+ if (compiland_up->getSymIndexId() == uid) {
+ index = cu_idx;
+ return;
+ }
+ }
+ index = UINT32_MAX;
+ return;
+}
- uint32_t id = cu->getSymIndexId();
+std::unique_ptr<llvm::pdb::PDBSymbolCompiland>
+SymbolFilePDB::GetPDBCompilandByUID(uint32_t uid) {
+ return m_session_up->getConcreteSymbolById<PDBSymbolCompiland>(uid);
+}
- return ParseCompileUnitForSymIndex(id);
+lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitAtIndex(uint32_t index) {
+ if (index >= GetNumCompileUnits())
+ return CompUnitSP();
+
+ // Assuming we always retrieve same compilands listed in same order through
+ // `PDBSymbolExe::findAllChildren` method, otherwise using `index` to get a
+ // compile unit makes no sense.
+ auto results = m_global_scope_up->findAllChildren<PDBSymbolCompiland>();
+ if (!results)
+ return CompUnitSP();
+ auto compiland_up = results->getChildAtIndex(index);
+ if (!compiland_up)
+ return CompUnitSP();
+ return ParseCompileUnitForUID(compiland_up->getSymIndexId(), index);
}
lldb::LanguageType
@@ -196,24 +253,71 @@ SymbolFilePDB::ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) {
if (!sc.comp_unit)
return lldb::eLanguageTypeUnknown;
- auto cu = m_session_up->getConcreteSymbolById<PDBSymbolCompiland>(
- sc.comp_unit->GetID());
- if (!cu)
+ auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland_up)
return lldb::eLanguageTypeUnknown;
- auto details = cu->findOneChild<PDBSymbolCompilandDetails>();
+ auto details = compiland_up->findOneChild<PDBSymbolCompilandDetails>();
if (!details)
return lldb::eLanguageTypeUnknown;
return TranslateLanguage(details->getLanguage());
}
+lldb_private::Function *SymbolFilePDB::ParseCompileUnitFunctionForPDBFunc(
+ const PDBSymbolFunc &pdb_func, const lldb_private::SymbolContext &sc) {
+ lldbassert(sc.comp_unit && sc.module_sp.get());
+
+ auto file_vm_addr = pdb_func.getVirtualAddress();
+ if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
+ return nullptr;
+
+ auto func_length = pdb_func.getLength();
+ AddressRange func_range =
+ AddressRange(file_vm_addr, func_length, sc.module_sp->GetSectionList());
+ if (!func_range.GetBaseAddress().IsValid())
+ return nullptr;
+
+ lldb_private::Type *func_type = ResolveTypeUID(pdb_func.getSymIndexId());
+ if (!func_type)
+ return nullptr;
+
+ user_id_t func_type_uid = pdb_func.getSignatureId();
+
+ Mangled mangled = GetMangledForPDBFunc(pdb_func);
+
+ FunctionSP func_sp =
+ std::make_shared<Function>(sc.comp_unit, pdb_func.getSymIndexId(),
+ func_type_uid, mangled, func_type, func_range);
+
+ sc.comp_unit->AddFunction(func_sp);
+ return func_sp.get();
+}
+
size_t SymbolFilePDB::ParseCompileUnitFunctions(
const lldb_private::SymbolContext &sc) {
- // TODO: Implement this
- return size_t();
+ lldbassert(sc.comp_unit);
+ size_t func_added = 0;
+ auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland_up)
+ return 0;
+ auto results_up = compiland_up->findAllChildren<PDBSymbolFunc>();
+ if (!results_up)
+ return 0;
+ while (auto pdb_func_up = results_up->getNext()) {
+ auto func_sp =
+ sc.comp_unit->FindFunctionByUID(pdb_func_up->getSymIndexId());
+ if (!func_sp) {
+ if (ParseCompileUnitFunctionForPDBFunc(*pdb_func_up, sc))
+ ++func_added;
+ }
+ }
+ return func_added;
}
bool SymbolFilePDB::ParseCompileUnitLineTable(
const lldb_private::SymbolContext &sc) {
+ lldbassert(sc.comp_unit);
+ if (sc.comp_unit->GetLineTable())
+ return true;
return ParseCompileUnitLineTable(sc, 0);
}
@@ -226,26 +330,29 @@ bool SymbolFilePDB::ParseCompileUnitDebugMacros(
bool SymbolFilePDB::ParseCompileUnitSupportFiles(
const lldb_private::SymbolContext &sc,
lldb_private::FileSpecList &support_files) {
- if (!sc.comp_unit)
- return false;
+ lldbassert(sc.comp_unit);
// In theory this is unnecessary work for us, because all of this information
// is easily (and quickly) accessible from DebugInfoPDB, so caching it a
// second time seems like a waste. Unfortunately, there's no good way around
// this short of a moderate refactor since SymbolVendor depends on being able
// to cache this list.
- auto cu = m_session_up->getConcreteSymbolById<PDBSymbolCompiland>(
- sc.comp_unit->GetID());
- if (!cu)
+ auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland_up)
return false;
- auto files = m_session_up->getSourceFilesForCompiland(*cu);
+ auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
if (!files || files->getChildCount() == 0)
return false;
while (auto file = files->getNext()) {
- FileSpec spec(file->getFileName(), false);
- support_files.Append(spec);
+ FileSpec spec(file->getFileName(), false, FileSpec::Style::windows);
+ support_files.AppendIfUnique(spec);
}
+
+ // LLDB uses the DWARF-like file numeration (one based),
+ // the zeroth file is the compile unit itself
+ support_files.Insert(0, *sc.comp_unit);
+
return true;
}
@@ -256,21 +363,178 @@ bool SymbolFilePDB::ParseImportedModules(
return false;
}
+static size_t ParseFunctionBlocksForPDBSymbol(
+ const lldb_private::SymbolContext &sc, uint64_t func_file_vm_addr,
+ const llvm::pdb::PDBSymbol *pdb_symbol, lldb_private::Block *parent_block,
+ bool is_top_parent) {
+ assert(pdb_symbol && parent_block);
+
+ size_t num_added = 0;
+ switch (pdb_symbol->getSymTag()) {
+ case PDB_SymType::Block:
+ case PDB_SymType::Function: {
+ Block *block = nullptr;
+ auto &raw_sym = pdb_symbol->getRawSymbol();
+ if (auto *pdb_func = llvm::dyn_cast<PDBSymbolFunc>(pdb_symbol)) {
+ if (pdb_func->hasNoInlineAttribute())
+ break;
+ if (is_top_parent)
+ block = parent_block;
+ else
+ break;
+ } else if (llvm::dyn_cast<PDBSymbolBlock>(pdb_symbol)) {
+ auto uid = pdb_symbol->getSymIndexId();
+ if (parent_block->FindBlockByID(uid))
+ break;
+ if (raw_sym.getVirtualAddress() < func_file_vm_addr)
+ break;
+
+ auto block_sp = std::make_shared<Block>(pdb_symbol->getSymIndexId());
+ parent_block->AddChild(block_sp);
+ block = block_sp.get();
+ } else
+ llvm_unreachable("Unexpected PDB symbol!");
+
+ block->AddRange(Block::Range(
+ raw_sym.getVirtualAddress() - func_file_vm_addr, raw_sym.getLength()));
+ block->FinalizeRanges();
+ ++num_added;
+
+ auto results_up = pdb_symbol->findAllChildren();
+ if (!results_up)
+ break;
+ while (auto symbol_up = results_up->getNext()) {
+ num_added += ParseFunctionBlocksForPDBSymbol(
+ sc, func_file_vm_addr, symbol_up.get(), block, false);
+ }
+ } break;
+ default:
+ break;
+ }
+ return num_added;
+}
+
size_t
SymbolFilePDB::ParseFunctionBlocks(const lldb_private::SymbolContext &sc) {
- // TODO: Implement this
- return size_t();
+ lldbassert(sc.comp_unit && sc.function);
+ size_t num_added = 0;
+ auto uid = sc.function->GetID();
+ auto pdb_func_up = m_session_up->getConcreteSymbolById<PDBSymbolFunc>(uid);
+ if (!pdb_func_up)
+ return 0;
+ Block &parent_block = sc.function->GetBlock(false);
+ num_added =
+ ParseFunctionBlocksForPDBSymbol(sc, pdb_func_up->getVirtualAddress(),
+ pdb_func_up.get(), &parent_block, true);
+ return num_added;
}
size_t SymbolFilePDB::ParseTypes(const lldb_private::SymbolContext &sc) {
- // TODO: Implement this
- return size_t();
+ lldbassert(sc.module_sp.get());
+ if (!sc.comp_unit)
+ return 0;
+
+ size_t num_added = 0;
+ auto compiland = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland)
+ return 0;
+
+ auto ParseTypesByTagFn = [&num_added, this](const PDBSymbol &raw_sym) {
+ std::unique_ptr<IPDBEnumSymbols> results;
+ PDB_SymType tags_to_search[] = {PDB_SymType::Enum, PDB_SymType::Typedef,
+ PDB_SymType::UDT};
+ for (auto tag : tags_to_search) {
+ results = raw_sym.findAllChildren(tag);
+ if (!results || results->getChildCount() == 0)
+ continue;
+ while (auto symbol = results->getNext()) {
+ switch (symbol->getSymTag()) {
+ case PDB_SymType::Enum:
+ case PDB_SymType::UDT:
+ case PDB_SymType::Typedef:
+ break;
+ default:
+ continue;
+ }
+
+ // This should cause the type to get cached and stored in the `m_types`
+ // lookup.
+ if (!ResolveTypeUID(symbol->getSymIndexId()))
+ continue;
+
+ ++num_added;
+ }
+ }
+ };
+
+ if (sc.function) {
+ auto pdb_func = m_session_up->getConcreteSymbolById<PDBSymbolFunc>(
+ sc.function->GetID());
+ if (!pdb_func)
+ return 0;
+ ParseTypesByTagFn(*pdb_func);
+ } else {
+ ParseTypesByTagFn(*compiland);
+
+ // Also parse global types particularly coming from this compiland.
+ // Unfortunately, PDB has no compiland information for each global type. We
+ // have to parse them all. But ensure we only do this once.
+ static bool parse_all_global_types = false;
+ if (!parse_all_global_types) {
+ ParseTypesByTagFn(*m_global_scope_up);
+ parse_all_global_types = true;
+ }
+ }
+ return num_added;
}
size_t
SymbolFilePDB::ParseVariablesForContext(const lldb_private::SymbolContext &sc) {
- // TODO: Implement this
- return size_t();
+ if (!sc.comp_unit)
+ return 0;
+
+ size_t num_added = 0;
+ if (sc.function) {
+ auto pdb_func = m_session_up->getConcreteSymbolById<PDBSymbolFunc>(
+ sc.function->GetID());
+ if (!pdb_func)
+ return 0;
+
+ num_added += ParseVariables(sc, *pdb_func);
+ sc.function->GetBlock(false).SetDidParseVariables(true, true);
+ } else if (sc.comp_unit) {
+ auto compiland = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland)
+ return 0;
+
+ if (sc.comp_unit->GetVariableList(false))
+ return 0;
+
+ auto results = m_global_scope_up->findAllChildren<PDBSymbolData>();
+ if (results && results->getChildCount()) {
+ while (auto result = results->getNext()) {
+ auto cu_id = result->getCompilandId();
+ // FIXME: We are not able to determine variable's compile unit.
+ if (cu_id == 0)
+ continue;
+
+ if (cu_id == sc.comp_unit->GetID())
+ num_added += ParseVariables(sc, *result);
+ }
+ }
+
+ // FIXME: A `file static` or `global constant` variable appears both in
+ // compiland's children and global scope's children with unexpectedly
+ // different symbol's Id making it ambiguous.
+
+ // FIXME: 'local constant', for example, const char var[] = "abc", declared
+ // in a function scope, can't be found in PDB.
+
+ // Parse variables in this compiland.
+ num_added += ParseVariables(sc, *compiland);
+ }
+
+ return num_added;
}
lldb_private::Type *SymbolFilePDB::ResolveTypeUID(lldb::user_id_t type_uid) {
@@ -294,8 +558,12 @@ lldb_private::Type *SymbolFilePDB::ResolveTypeUID(lldb::user_id_t type_uid) {
return nullptr;
lldb::TypeSP result = pdb->CreateLLDBTypeFromPDBType(*pdb_type);
- if (result.get())
+ if (result) {
m_types.insert(std::make_pair(type_uid, result));
+ auto type_list = GetTypeList();
+ if (type_list)
+ type_list->Insert(result);
+ }
return result.get();
}
@@ -328,12 +596,62 @@ uint32_t
SymbolFilePDB::ResolveSymbolContext(const lldb_private::Address &so_addr,
uint32_t resolve_scope,
lldb_private::SymbolContext &sc) {
- return uint32_t();
+ uint32_t resolved_flags = 0;
+ if (resolve_scope & eSymbolContextCompUnit ||
+ resolve_scope & eSymbolContextVariable ||
+ resolve_scope & eSymbolContextFunction ||
+ resolve_scope & eSymbolContextBlock ||
+ resolve_scope & eSymbolContextLineEntry) {
+ auto cu_sp = GetCompileUnitContainsAddress(so_addr);
+ if (!cu_sp) {
+ if (resolved_flags | eSymbolContextVariable) {
+ // TODO: Resolve variables
+ }
+ return 0;
+ }
+ sc.comp_unit = cu_sp.get();
+ resolved_flags |= eSymbolContextCompUnit;
+ lldbassert(sc.module_sp == cu_sp->GetModule());
+ }
+
+ if (resolve_scope & eSymbolContextFunction) {
+ addr_t file_vm_addr = so_addr.GetFileAddress();
+ auto symbol_up =
+ m_session_up->findSymbolByAddress(file_vm_addr, PDB_SymType::Function);
+ if (symbol_up) {
+ auto *pdb_func = llvm::dyn_cast<PDBSymbolFunc>(symbol_up.get());
+ assert(pdb_func);
+ auto func_uid = pdb_func->getSymIndexId();
+ sc.function = sc.comp_unit->FindFunctionByUID(func_uid).get();
+ if (sc.function == nullptr)
+ sc.function = ParseCompileUnitFunctionForPDBFunc(*pdb_func, sc);
+ if (sc.function) {
+ resolved_flags |= eSymbolContextFunction;
+ if (resolve_scope & eSymbolContextBlock) {
+ Block &block = sc.function->GetBlock(true);
+ sc.block = block.FindBlockByID(sc.function->GetID());
+ if (sc.block)
+ resolved_flags |= eSymbolContextBlock;
+ }
+ }
+ }
+ }
+
+ if (resolve_scope & eSymbolContextLineEntry) {
+ if (auto *line_table = sc.comp_unit->GetLineTable()) {
+ Address addr(so_addr);
+ if (line_table->FindLineEntryByAddress(addr, sc.line_entry))
+ resolved_flags |= eSymbolContextLineEntry;
+ }
+ }
+
+ return resolved_flags;
}
uint32_t SymbolFilePDB::ResolveSymbolContext(
const lldb_private::FileSpec &file_spec, uint32_t line, bool check_inlines,
uint32_t resolve_scope, lldb_private::SymbolContextList &sc_list) {
+ const size_t old_size = sc_list.GetSize();
if (resolve_scope & lldb::eSymbolContextCompUnit) {
// Locate all compilation units with line numbers referencing the specified
// file. For example, if `file_spec` is <vector>, then this should return
@@ -342,56 +660,498 @@ uint32_t SymbolFilePDB::ResolveSymbolContext(
auto compilands = m_session_up->findCompilandsForSourceFile(
file_spec.GetPath(), PDB_NameSearchFlags::NS_CaseInsensitive);
+ if (!compilands)
+ return 0;
+
// For each one, either find its previously parsed data or parse it afresh
// and add it to the symbol context list.
while (auto compiland = compilands->getNext()) {
- // If we're not checking inlines, then don't add line information for this
- // file unless the FileSpec matches.
+ // If we're not checking inlines, then don't add line information for
+ // this file unless the FileSpec matches. For inline functions, we don't
+ // have to match the FileSpec since they could be defined in headers
+ // other than file specified in FileSpec.
if (!check_inlines) {
- // `getSourceFileName` returns the basename of the original source file
- // used to generate this compiland. It does not return the full path.
- // Currently the only way to get that is to do a basename lookup to get
- // the IPDBSourceFile, but this is ambiguous in the case of two source
- // files with the same name contributing to the same compiland. This is
- // a moderately extreme edge case, so we consider this OK for now,
- // although we need to find a long-term solution.
- std::string source_file = compiland->getSourceFileName();
- auto pdb_file = m_session_up->findOneSourceFile(
- compiland.get(), source_file,
- PDB_NameSearchFlags::NS_CaseInsensitive);
- source_file = pdb_file->getFileName();
- FileSpec this_spec(source_file, false, FileSpec::ePathSyntaxWindows);
- if (!file_spec.FileEquals(this_spec))
+ std::string source_file = compiland->getSourceFileFullPath();
+ if (source_file.empty())
+ continue;
+ FileSpec this_spec(source_file, false, FileSpec::Style::windows);
+ bool need_full_match = !file_spec.GetDirectory().IsEmpty();
+ if (FileSpec::Compare(file_spec, this_spec, need_full_match) != 0)
continue;
}
SymbolContext sc;
- auto cu = ParseCompileUnitForSymIndex(compiland->getSymIndexId());
+ auto cu = ParseCompileUnitForUID(compiland->getSymIndexId());
+ if (!cu)
+ continue;
sc.comp_unit = cu.get();
sc.module_sp = cu->GetModule();
- sc_list.Append(sc);
// If we were asked to resolve line entries, add all entries to the line
// table that match the requested line (or all lines if `line` == 0).
- if (resolve_scope & lldb::eSymbolContextLineEntry)
- ParseCompileUnitLineTable(sc, line);
+ if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock |
+ eSymbolContextLineEntry)) {
+ bool has_line_table = ParseCompileUnitLineTable(sc, line);
+
+ if ((resolve_scope & eSymbolContextLineEntry) && !has_line_table) {
+ // The query asks for line entries, but we can't get them for the
+ // compile unit. This is not normal for `line` = 0. So just assert
+ // it.
+ assert(line && "Couldn't get all line entries!\n");
+
+ // Current compiland does not have the requested line. Search next.
+ continue;
+ }
+
+ if (resolve_scope & (eSymbolContextFunction | eSymbolContextBlock)) {
+ if (!has_line_table)
+ continue;
+
+ auto *line_table = sc.comp_unit->GetLineTable();
+ lldbassert(line_table);
+
+ uint32_t num_line_entries = line_table->GetSize();
+ // Skip the terminal line entry.
+ --num_line_entries;
+
+ // If `line `!= 0, see if we can resolve function for each line entry
+ // in the line table.
+ for (uint32_t line_idx = 0; line && line_idx < num_line_entries;
+ ++line_idx) {
+ if (!line_table->GetLineEntryAtIndex(line_idx, sc.line_entry))
+ continue;
+
+ auto file_vm_addr =
+ sc.line_entry.range.GetBaseAddress().GetFileAddress();
+ if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
+ continue;
+
+ auto symbol_up = m_session_up->findSymbolByAddress(
+ file_vm_addr, PDB_SymType::Function);
+ if (symbol_up) {
+ auto func_uid = symbol_up->getSymIndexId();
+ sc.function = sc.comp_unit->FindFunctionByUID(func_uid).get();
+ if (sc.function == nullptr) {
+ auto pdb_func = llvm::dyn_cast<PDBSymbolFunc>(symbol_up.get());
+ assert(pdb_func);
+ sc.function = ParseCompileUnitFunctionForPDBFunc(*pdb_func, sc);
+ }
+ if (sc.function && (resolve_scope & eSymbolContextBlock)) {
+ Block &block = sc.function->GetBlock(true);
+ sc.block = block.FindBlockByID(sc.function->GetID());
+ }
+ }
+ sc_list.Append(sc);
+ }
+ } else if (has_line_table) {
+ // We can parse line table for the compile unit. But no query to
+ // resolve function or block. We append `sc` to the list anyway.
+ sc_list.Append(sc);
+ }
+ } else {
+ // No query for line entry, function or block. But we have a valid
+ // compile unit, append `sc` to the list.
+ sc_list.Append(sc);
+ }
}
}
- return sc_list.GetSize();
+ return sc_list.GetSize() - old_size;
+}
+
+std::string SymbolFilePDB::GetMangledForPDBData(const PDBSymbolData &pdb_data) {
+ std::string decorated_name;
+ auto vm_addr = pdb_data.getVirtualAddress();
+ if (vm_addr != LLDB_INVALID_ADDRESS && vm_addr) {
+ auto result_up =
+ m_global_scope_up->findAllChildren(PDB_SymType::PublicSymbol);
+ if (result_up) {
+ while (auto symbol_up = result_up->getNext()) {
+ if (symbol_up->getRawSymbol().getVirtualAddress() == vm_addr) {
+ decorated_name = symbol_up->getRawSymbol().getName();
+ break;
+ }
+ }
+ }
+ }
+ if (!decorated_name.empty())
+ return decorated_name;
+
+ return std::string();
+}
+
+VariableSP SymbolFilePDB::ParseVariableForPDBData(
+ const lldb_private::SymbolContext &sc,
+ const llvm::pdb::PDBSymbolData &pdb_data) {
+ VariableSP var_sp;
+ uint32_t var_uid = pdb_data.getSymIndexId();
+ auto result = m_variables.find(var_uid);
+ if (result != m_variables.end())
+ return result->second;
+
+ ValueType scope = eValueTypeInvalid;
+ bool is_static_member = false;
+ bool is_external = false;
+ bool is_artificial = false;
+
+ switch (pdb_data.getDataKind()) {
+ case PDB_DataKind::Global:
+ scope = eValueTypeVariableGlobal;
+ is_external = true;
+ break;
+ case PDB_DataKind::Local:
+ scope = eValueTypeVariableLocal;
+ break;
+ case PDB_DataKind::FileStatic:
+ scope = eValueTypeVariableStatic;
+ break;
+ case PDB_DataKind::StaticMember:
+ is_static_member = true;
+ scope = eValueTypeVariableStatic;
+ break;
+ case PDB_DataKind::Member:
+ scope = eValueTypeVariableStatic;
+ break;
+ case PDB_DataKind::Param:
+ scope = eValueTypeVariableArgument;
+ break;
+ case PDB_DataKind::Constant:
+ scope = eValueTypeConstResult;
+ break;
+ default:
+ break;
+ }
+
+ switch (pdb_data.getLocationType()) {
+ case PDB_LocType::TLS:
+ scope = eValueTypeVariableThreadLocal;
+ break;
+ case PDB_LocType::RegRel: {
+ // It is a `this` pointer.
+ if (pdb_data.getDataKind() == PDB_DataKind::ObjectPtr) {
+ scope = eValueTypeVariableArgument;
+ is_artificial = true;
+ }
+ } break;
+ default:
+ break;
+ }
+
+ Declaration decl;
+ if (!is_artificial && !pdb_data.isCompilerGenerated()) {
+ if (auto lines = pdb_data.getLineNumbers()) {
+ if (auto first_line = lines->getNext()) {
+ uint32_t src_file_id = first_line->getSourceFileId();
+ auto src_file = m_session_up->getSourceFileById(src_file_id);
+ if (src_file) {
+ FileSpec spec(src_file->getFileName(), /*resolve_path*/ false);
+ decl.SetFile(spec);
+ decl.SetColumn(first_line->getColumnNumber());
+ decl.SetLine(first_line->getLineNumber());
+ }
+ }
+ }
+ }
+
+ Variable::RangeList ranges;
+ SymbolContextScope *context_scope = sc.comp_unit;
+ if (scope == eValueTypeVariableLocal) {
+ if (sc.function) {
+ context_scope = sc.function->GetBlock(true).FindBlockByID(
+ pdb_data.getClassParentId());
+ if (context_scope == nullptr)
+ context_scope = sc.function;
+ }
+ }
+
+ SymbolFileTypeSP type_sp =
+ std::make_shared<SymbolFileType>(*this, pdb_data.getTypeId());
+
+ auto var_name = pdb_data.getName();
+ auto mangled = GetMangledForPDBData(pdb_data);
+ auto mangled_cstr = mangled.empty() ? nullptr : mangled.c_str();
+
+ bool is_constant;
+ DWARFExpression location = ConvertPDBLocationToDWARFExpression(
+ GetObjectFile()->GetModule(), pdb_data, is_constant);
+
+ var_sp = std::make_shared<Variable>(
+ var_uid, var_name.c_str(), mangled_cstr, type_sp, scope, context_scope,
+ ranges, &decl, location, is_external, is_artificial, is_static_member);
+ var_sp->SetLocationIsConstantValueData(is_constant);
+
+ m_variables.insert(std::make_pair(var_uid, var_sp));
+ return var_sp;
+}
+
+size_t
+SymbolFilePDB::ParseVariables(const lldb_private::SymbolContext &sc,
+ const llvm::pdb::PDBSymbol &pdb_symbol,
+ lldb_private::VariableList *variable_list) {
+ size_t num_added = 0;
+
+ if (auto pdb_data = llvm::dyn_cast<PDBSymbolData>(&pdb_symbol)) {
+ VariableListSP local_variable_list_sp;
+
+ auto result = m_variables.find(pdb_data->getSymIndexId());
+ if (result != m_variables.end()) {
+ if (variable_list)
+ variable_list->AddVariableIfUnique(result->second);
+ } else {
+ // Prepare right VariableList for this variable.
+ if (auto lexical_parent = pdb_data->getLexicalParent()) {
+ switch (lexical_parent->getSymTag()) {
+ case PDB_SymType::Exe:
+ assert(sc.comp_unit);
+ LLVM_FALLTHROUGH;
+ case PDB_SymType::Compiland: {
+ if (sc.comp_unit) {
+ local_variable_list_sp = sc.comp_unit->GetVariableList(false);
+ if (!local_variable_list_sp) {
+ local_variable_list_sp = std::make_shared<VariableList>();
+ sc.comp_unit->SetVariableList(local_variable_list_sp);
+ }
+ }
+ } break;
+ case PDB_SymType::Block:
+ case PDB_SymType::Function: {
+ if (sc.function) {
+ Block *block = sc.function->GetBlock(true).FindBlockByID(
+ lexical_parent->getSymIndexId());
+ if (block) {
+ local_variable_list_sp = block->GetBlockVariableList(false);
+ if (!local_variable_list_sp) {
+ local_variable_list_sp = std::make_shared<VariableList>();
+ block->SetVariableList(local_variable_list_sp);
+ }
+ }
+ }
+ } break;
+ default:
+ break;
+ }
+ }
+
+ if (local_variable_list_sp) {
+ if (auto var_sp = ParseVariableForPDBData(sc, *pdb_data)) {
+ local_variable_list_sp->AddVariableIfUnique(var_sp);
+ if (variable_list)
+ variable_list->AddVariableIfUnique(var_sp);
+ ++num_added;
+ }
+ }
+ }
+ }
+
+ if (auto results = pdb_symbol.findAllChildren()) {
+ while (auto result = results->getNext())
+ num_added += ParseVariables(sc, *result, variable_list);
+ }
+
+ return num_added;
}
uint32_t SymbolFilePDB::FindGlobalVariables(
const lldb_private::ConstString &name,
- const lldb_private::CompilerDeclContext *parent_decl_ctx, bool append,
+ const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t max_matches, lldb_private::VariableList &variables) {
- return uint32_t();
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
+ return 0;
+ if (name.IsEmpty())
+ return 0;
+
+ auto results =
+ m_global_scope_up->findChildren(PDB_SymType::Data, name.GetStringRef(),
+ PDB_NameSearchFlags::NS_CaseSensitive);
+ if (!results)
+ return 0;
+
+ uint32_t matches = 0;
+ size_t old_size = variables.GetSize();
+ while (auto result = results->getNext()) {
+ auto pdb_data = llvm::dyn_cast<PDBSymbolData>(result.get());
+ if (max_matches > 0 && matches >= max_matches)
+ break;
+
+ SymbolContext sc;
+ sc.module_sp = m_obj_file->GetModule();
+ lldbassert(sc.module_sp.get());
+
+ sc.comp_unit = ParseCompileUnitForUID(pdb_data->getCompilandId()).get();
+ // FIXME: We are not able to determine the compile unit.
+ if (sc.comp_unit == nullptr)
+ continue;
+
+ ParseVariables(sc, *pdb_data, &variables);
+ matches = variables.GetSize() - old_size;
+ }
+
+ return matches;
}
uint32_t
SymbolFilePDB::FindGlobalVariables(const lldb_private::RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) {
- return uint32_t();
+ if (!regex.IsValid())
+ return 0;
+ auto results = m_global_scope_up->findAllChildren<PDBSymbolData>();
+ if (!results)
+ return 0;
+
+ uint32_t matches = 0;
+ size_t old_size = variables.GetSize();
+ while (auto pdb_data = results->getNext()) {
+ if (max_matches > 0 && matches >= max_matches)
+ break;
+
+ auto var_name = pdb_data->getName();
+ if (var_name.empty())
+ continue;
+ if (!regex.Execute(var_name))
+ continue;
+ SymbolContext sc;
+ sc.module_sp = m_obj_file->GetModule();
+ lldbassert(sc.module_sp.get());
+
+ sc.comp_unit = ParseCompileUnitForUID(pdb_data->getCompilandId()).get();
+ // FIXME: We are not able to determine the compile unit.
+ if (sc.comp_unit == nullptr)
+ continue;
+
+ ParseVariables(sc, *pdb_data, &variables);
+ matches = variables.GetSize() - old_size;
+ }
+
+ return matches;
+}
+
+bool SymbolFilePDB::ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) {
+ lldb_private::SymbolContext sc;
+ sc.comp_unit = ParseCompileUnitForUID(pdb_func.getCompilandId()).get();
+ if (!sc.comp_unit)
+ return false;
+ sc.module_sp = sc.comp_unit->GetModule();
+ sc.function = ParseCompileUnitFunctionForPDBFunc(pdb_func, sc);
+ if (!sc.function)
+ return false;
+
+ sc_list.Append(sc);
+ return true;
+}
+
+bool SymbolFilePDB::ResolveFunction(uint32_t uid, bool include_inlines,
+ lldb_private::SymbolContextList &sc_list) {
+ auto pdb_func_up = m_session_up->getConcreteSymbolById<PDBSymbolFunc>(uid);
+ if (!pdb_func_up && !(include_inlines && pdb_func_up->hasInlineAttribute()))
+ return false;
+ return ResolveFunction(*pdb_func_up, include_inlines, sc_list);
+}
+
+void SymbolFilePDB::CacheFunctionNames() {
+ if (!m_func_full_names.IsEmpty())
+ return;
+
+ std::map<uint64_t, uint32_t> addr_ids;
+
+ if (auto results_up = m_global_scope_up->findAllChildren<PDBSymbolFunc>()) {
+ while (auto pdb_func_up = results_up->getNext()) {
+ if (pdb_func_up->isCompilerGenerated())
+ continue;
+
+ auto name = pdb_func_up->getName();
+ auto demangled_name = pdb_func_up->getUndecoratedName();
+ if (name.empty() && demangled_name.empty())
+ continue;
+
+ auto uid = pdb_func_up->getSymIndexId();
+ if (!demangled_name.empty() && pdb_func_up->getVirtualAddress())
+ addr_ids.insert(std::make_pair(pdb_func_up->getVirtualAddress(), uid));
+
+ if (auto parent = pdb_func_up->getClassParent()) {
+
+ // PDB have symbols for class/struct methods or static methods in Enum
+ // Class. We won't bother to check if the parent is UDT or Enum here.
+ m_func_method_names.Append(ConstString(name), uid);
+
+ ConstString cstr_name(name);
+
+ // To search a method name, like NS::Class:MemberFunc, LLDB searches
+ // its base name, i.e. MemberFunc by default. Since PDBSymbolFunc does
+ // not have inforamtion of this, we extract base names and cache them
+ // by our own effort.
+ llvm::StringRef basename;
+ CPlusPlusLanguage::MethodName cpp_method(cstr_name);
+ if (cpp_method.IsValid()) {
+ llvm::StringRef context;
+ basename = cpp_method.GetBasename();
+ if (basename.empty())
+ CPlusPlusLanguage::ExtractContextAndIdentifier(name.c_str(),
+ context, basename);
+ }
+
+ if (!basename.empty())
+ m_func_base_names.Append(ConstString(basename), uid);
+ else {
+ m_func_base_names.Append(ConstString(name), uid);
+ }
+
+ if (!demangled_name.empty())
+ m_func_full_names.Append(ConstString(demangled_name), uid);
+
+ } else {
+ // Handle not-method symbols.
+
+ // The function name might contain namespace, or its lexical scope. It
+ // is not safe to get its base name by applying same scheme as we deal
+ // with the method names.
+ // FIXME: Remove namespace if function is static in a scope.
+ m_func_base_names.Append(ConstString(name), uid);
+
+ if (name == "main") {
+ m_func_full_names.Append(ConstString(name), uid);
+
+ if (!demangled_name.empty() && name != demangled_name) {
+ m_func_full_names.Append(ConstString(demangled_name), uid);
+ m_func_base_names.Append(ConstString(demangled_name), uid);
+ }
+ } else if (!demangled_name.empty()) {
+ m_func_full_names.Append(ConstString(demangled_name), uid);
+ } else {
+ m_func_full_names.Append(ConstString(name), uid);
+ }
+ }
+ }
+ }
+
+ if (auto results_up =
+ m_global_scope_up->findAllChildren<PDBSymbolPublicSymbol>()) {
+ while (auto pub_sym_up = results_up->getNext()) {
+ if (!pub_sym_up->isFunction())
+ continue;
+ auto name = pub_sym_up->getName();
+ if (name.empty())
+ continue;
+
+ if (CPlusPlusLanguage::IsCPPMangledName(name.c_str())) {
+ auto vm_addr = pub_sym_up->getVirtualAddress();
+
+ // PDB public symbol has mangled name for its associated function.
+ if (vm_addr && addr_ids.find(vm_addr) != addr_ids.end()) {
+ // Cache mangled name.
+ m_func_full_names.Append(ConstString(name), addr_ids[vm_addr]);
+ }
+ }
+ }
+ }
+ // Sort them before value searching is working properly
+ m_func_full_names.Sort();
+ m_func_full_names.SizeToFit();
+ m_func_method_names.Sort();
+ m_func_method_names.SizeToFit();
+ m_func_base_names.Sort();
+ m_func_base_names.SizeToFit();
}
uint32_t SymbolFilePDB::FindFunctions(
@@ -399,14 +1159,77 @@ uint32_t SymbolFilePDB::FindFunctions(
const lldb_private::CompilerDeclContext *parent_decl_ctx,
uint32_t name_type_mask, bool include_inlines, bool append,
lldb_private::SymbolContextList &sc_list) {
- return uint32_t();
+ if (!append)
+ sc_list.Clear();
+ lldbassert((name_type_mask & eFunctionNameTypeAuto) == 0);
+
+ if (name_type_mask == eFunctionNameTypeNone)
+ return 0;
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
+ return 0;
+ if (name.IsEmpty())
+ return 0;
+
+ auto old_size = sc_list.GetSize();
+ if (name_type_mask & eFunctionNameTypeFull ||
+ name_type_mask & eFunctionNameTypeBase ||
+ name_type_mask & eFunctionNameTypeMethod) {
+ CacheFunctionNames();
+
+ std::set<uint32_t> resolved_ids;
+ auto ResolveFn = [include_inlines, &name, &sc_list, &resolved_ids,
+ this](UniqueCStringMap<uint32_t> &Names) {
+ std::vector<uint32_t> ids;
+ if (Names.GetValues(name, ids)) {
+ for (auto id : ids) {
+ if (resolved_ids.find(id) == resolved_ids.end()) {
+ if (ResolveFunction(id, include_inlines, sc_list))
+ resolved_ids.insert(id);
+ }
+ }
+ }
+ };
+ if (name_type_mask & eFunctionNameTypeFull) {
+ ResolveFn(m_func_full_names);
+ }
+ if (name_type_mask & eFunctionNameTypeBase) {
+ ResolveFn(m_func_base_names);
+ }
+ if (name_type_mask & eFunctionNameTypeMethod) {
+ ResolveFn(m_func_method_names);
+ }
+ }
+ return sc_list.GetSize() - old_size;
}
uint32_t
SymbolFilePDB::FindFunctions(const lldb_private::RegularExpression &regex,
bool include_inlines, bool append,
lldb_private::SymbolContextList &sc_list) {
- return uint32_t();
+ if (!append)
+ sc_list.Clear();
+ if (!regex.IsValid())
+ return 0;
+
+ auto old_size = sc_list.GetSize();
+ CacheFunctionNames();
+
+ std::set<uint32_t> resolved_ids;
+ auto ResolveFn = [&regex, include_inlines, &sc_list, &resolved_ids,
+ this](UniqueCStringMap<uint32_t> &Names) {
+ std::vector<uint32_t> ids;
+ if (Names.GetValues(regex, ids)) {
+ for (auto id : ids) {
+ if (resolved_ids.find(id) == resolved_ids.end())
+ if (ResolveFunction(id, include_inlines, sc_list))
+ resolved_ids.insert(id);
+ }
+ }
+ };
+ ResolveFn(m_func_full_names);
+ ResolveFn(m_func_base_names);
+
+ return sc_list.GetSize() - old_size;
}
void SymbolFilePDB::GetMangledNamesForFunction(
@@ -424,6 +1247,8 @@ uint32_t SymbolFilePDB::FindTypes(
types.Clear();
if (!name)
return 0;
+ if (!DeclContextMatchesThisSymbolFile(parent_decl_ctx))
+ return 0;
searched_symbol_files.clear();
searched_symbol_files.insert(this);
@@ -432,14 +1257,13 @@ uint32_t SymbolFilePDB::FindTypes(
// There is an assumption 'name' is not a regex
FindTypesByName(name_str, max_matches, types);
-
+
return types.GetSize();
}
-void
-SymbolFilePDB::FindTypesByRegex(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::TypeMap &types) {
+void SymbolFilePDB::FindTypesByRegex(
+ const lldb_private::RegularExpression &regex, uint32_t max_matches,
+ lldb_private::TypeMap &types) {
// When searching by regex, we need to go out of our way to limit the search
// space as much as possible since this searches EVERYTHING in the PDB,
// manually doing regex comparisons. PDB library isn't optimized for regex
@@ -448,13 +1272,15 @@ SymbolFilePDB::FindTypesByRegex(const lldb_private::RegularExpression &regex,
// and do a regex comparison against each of them.
PDB_SymType tags_to_search[] = {PDB_SymType::Enum, PDB_SymType::Typedef,
PDB_SymType::UDT};
- auto global = m_session_up->getGlobalScope();
std::unique_ptr<IPDBEnumSymbols> results;
uint32_t matches = 0;
for (auto tag : tags_to_search) {
- results = global->findAllChildren(tag);
+ results = m_global_scope_up->findAllChildren(tag);
+ if (!results)
+ continue;
+
while (auto result = results->getNext()) {
if (max_matches > 0 && matches >= max_matches)
break;
@@ -493,10 +1319,13 @@ SymbolFilePDB::FindTypesByRegex(const lldb_private::RegularExpression &regex,
void SymbolFilePDB::FindTypesByName(const std::string &name,
uint32_t max_matches,
lldb_private::TypeMap &types) {
- auto global = m_session_up->getGlobalScope();
std::unique_ptr<IPDBEnumSymbols> results;
- results = global->findChildren(PDB_SymType::None, name,
- PDB_NameSearchFlags::NS_Default);
+ if (name.empty())
+ return;
+ results = m_global_scope_up->findChildren(PDB_SymType::None, name,
+ PDB_NameSearchFlags::NS_Default);
+ if (!results)
+ return;
uint32_t matches = 0;
@@ -509,8 +1338,8 @@ void SymbolFilePDB::FindTypesByName(const std::string &name,
case PDB_SymType::Typedef:
break;
default:
- // We're looking only for types that have names. Skip symbols, as well as
- // unnamed types such as arrays, pointers, etc.
+ // We're looking only for types that have names. Skip symbols, as well
+ // as unnamed types such as arrays, pointers, etc.
continue;
}
@@ -533,12 +1362,87 @@ size_t SymbolFilePDB::FindTypes(
return 0;
}
-lldb_private::TypeList *SymbolFilePDB::GetTypeList() { return nullptr; }
+lldb_private::TypeList *SymbolFilePDB::GetTypeList() {
+ return m_obj_file->GetModule()->GetTypeList();
+}
+
+void SymbolFilePDB::GetTypesForPDBSymbol(const llvm::pdb::PDBSymbol &pdb_symbol,
+ uint32_t type_mask,
+ TypeCollection &type_collection) {
+ bool can_parse = false;
+ switch (pdb_symbol.getSymTag()) {
+ case PDB_SymType::ArrayType:
+ can_parse = ((type_mask & eTypeClassArray) != 0);
+ break;
+ case PDB_SymType::BuiltinType:
+ can_parse = ((type_mask & eTypeClassBuiltin) != 0);
+ break;
+ case PDB_SymType::Enum:
+ can_parse = ((type_mask & eTypeClassEnumeration) != 0);
+ break;
+ case PDB_SymType::Function:
+ case PDB_SymType::FunctionSig:
+ can_parse = ((type_mask & eTypeClassFunction) != 0);
+ break;
+ case PDB_SymType::PointerType:
+ can_parse = ((type_mask & (eTypeClassPointer | eTypeClassBlockPointer |
+ eTypeClassMemberPointer)) != 0);
+ break;
+ case PDB_SymType::Typedef:
+ can_parse = ((type_mask & eTypeClassTypedef) != 0);
+ break;
+ case PDB_SymType::UDT: {
+ auto *udt = llvm::dyn_cast<PDBSymbolTypeUDT>(&pdb_symbol);
+ assert(udt);
+ can_parse = (udt->getUdtKind() != PDB_UdtType::Interface &&
+ ((type_mask & (eTypeClassClass | eTypeClassStruct |
+ eTypeClassUnion)) != 0));
+ } break;
+ default:
+ break;
+ }
+
+ if (can_parse) {
+ if (auto *type = ResolveTypeUID(pdb_symbol.getSymIndexId())) {
+ auto result =
+ std::find(type_collection.begin(), type_collection.end(), type);
+ if (result == type_collection.end())
+ type_collection.push_back(type);
+ }
+ }
+
+ auto results_up = pdb_symbol.findAllChildren();
+ while (auto symbol_up = results_up->getNext())
+ GetTypesForPDBSymbol(*symbol_up, type_mask, type_collection);
+}
size_t SymbolFilePDB::GetTypes(lldb_private::SymbolContextScope *sc_scope,
uint32_t type_mask,
lldb_private::TypeList &type_list) {
- return size_t();
+ TypeCollection type_collection;
+ uint32_t old_size = type_list.GetSize();
+ CompileUnit *cu =
+ sc_scope ? sc_scope->CalculateSymbolContextCompileUnit() : nullptr;
+ if (cu) {
+ auto compiland_up = GetPDBCompilandByUID(cu->GetID());
+ if (!compiland_up)
+ return 0;
+ GetTypesForPDBSymbol(*compiland_up, type_mask, type_collection);
+ } else {
+ for (uint32_t cu_idx = 0; cu_idx < GetNumCompileUnits(); ++cu_idx) {
+ auto cu_sp = ParseCompileUnitAtIndex(cu_idx);
+ if (cu_sp) {
+ if (auto compiland_up = GetPDBCompilandByUID(cu_sp->GetID()))
+ GetTypesForPDBSymbol(*compiland_up, type_mask, type_collection);
+ }
+ }
+ }
+
+ for (auto type : type_collection) {
+ type->GetForwardCompilerType();
+ type_list.Insert(type->shared_from_this());
+ }
+ return type_list.GetSize() - old_size;
}
lldb_private::TypeSystem *
@@ -570,65 +1474,78 @@ const IPDBSession &SymbolFilePDB::GetPDBSession() const {
return *m_session_up;
}
-lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitForSymIndex(uint32_t id) {
+lldb::CompUnitSP SymbolFilePDB::ParseCompileUnitForUID(uint32_t id,
+ uint32_t index) {
auto found_cu = m_comp_units.find(id);
if (found_cu != m_comp_units.end())
return found_cu->second;
- auto cu = m_session_up->getConcreteSymbolById<PDBSymbolCompiland>(id);
-
- // `getSourceFileName` returns the basename of the original source file used
- // to generate this compiland. It does not return the full path. Currently
- // the only way to get that is to do a basename lookup to get the
- // IPDBSourceFile, but this is ambiguous in the case of two source files with
- // the same name contributing to the same compiland. This is a moderately
- // extreme edge case, so we consider this OK for now, although we need to find
- // a long-term solution.
- auto file =
- m_session_up->findOneSourceFile(cu.get(), cu->getSourceFileName(),
- PDB_NameSearchFlags::NS_CaseInsensitive);
- std::string path = file->getFileName();
+ auto compiland_up = GetPDBCompilandByUID(id);
+ if (!compiland_up)
+ return CompUnitSP();
lldb::LanguageType lang;
- auto details = cu->findOneChild<PDBSymbolCompilandDetails>();
+ auto details = compiland_up->findOneChild<PDBSymbolCompilandDetails>();
if (!details)
lang = lldb::eLanguageTypeC_plus_plus;
else
lang = TranslateLanguage(details->getLanguage());
+ if (lang == lldb::LanguageType::eLanguageTypeUnknown)
+ return CompUnitSP();
+
+ std::string path = compiland_up->getSourceFileFullPath();
+ if (path.empty())
+ return CompUnitSP();
+
// Don't support optimized code for now, DebugInfoPDB does not return this
// information.
LazyBool optimized = eLazyBoolNo;
- auto result = std::make_shared<CompileUnit>(
- m_obj_file->GetModule(), nullptr, path.c_str(), id, lang, optimized);
- m_comp_units.insert(std::make_pair(id, result));
- return result;
+ auto cu_sp = std::make_shared<CompileUnit>(m_obj_file->GetModule(), nullptr,
+ path.c_str(), id, lang, optimized);
+
+ if (!cu_sp)
+ return CompUnitSP();
+
+ m_comp_units.insert(std::make_pair(id, cu_sp));
+ if (index == UINT32_MAX)
+ GetCompileUnitIndex(*compiland_up, index);
+ lldbassert(index != UINT32_MAX);
+ m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(index,
+ cu_sp);
+ return cu_sp;
}
bool SymbolFilePDB::ParseCompileUnitLineTable(
const lldb_private::SymbolContext &sc, uint32_t match_line) {
- auto global = m_session_up->getGlobalScope();
- auto cu = m_session_up->getConcreteSymbolById<PDBSymbolCompiland>(
- sc.comp_unit->GetID());
+ lldbassert(sc.comp_unit);
+
+ auto compiland_up = GetPDBCompilandByUID(sc.comp_unit->GetID());
+ if (!compiland_up)
+ return false;
// LineEntry needs the *index* of the file into the list of support files
// returned by ParseCompileUnitSupportFiles. But the underlying SDK gives us
- // a globally unique idenfitifier in the namespace of the PDB. So, we have to
- // do a mapping so that we can hand out indices.
+ // a globally unique idenfitifier in the namespace of the PDB. So, we have
+ // to do a mapping so that we can hand out indices.
llvm::DenseMap<uint32_t, uint32_t> index_map;
- BuildSupportFileIdToSupportFileIndexMap(*cu, index_map);
+ BuildSupportFileIdToSupportFileIndexMap(*compiland_up, index_map);
auto line_table = llvm::make_unique<LineTable>(sc.comp_unit);
- // Find contributions to `cu` from all source and header files.
+ // Find contributions to `compiland` from all source and header files.
std::string path = sc.comp_unit->GetPath();
- auto files = m_session_up->getSourceFilesForCompiland(*cu);
+ auto files = m_session_up->getSourceFilesForCompiland(*compiland_up);
+ if (!files)
+ return false;
- // For each source and header file, create a LineSequence for contributions to
- // the cu from that file, and add the sequence.
+ // For each source and header file, create a LineSequence for contributions
+ // to the compiland from that file, and add the sequence.
while (auto file = files->getNext()) {
std::unique_ptr<LineSequence> sequence(
line_table->CreateLineSequenceContainer());
- auto lines = m_session_up->findLineNumbers(*cu, *file);
+ auto lines = m_session_up->findLineNumbers(*compiland_up, *file);
+ if (!lines)
+ continue;
int entry_count = lines->getChildCount();
uint64_t prev_addr;
@@ -646,8 +1563,8 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
uint32_t col = line->getColumnNumber();
uint32_t source_idx = index_map[source_id];
- // There was a gap between the current entry and the previous entry if the
- // addresses don't perfectly line up.
+ // There was a gap between the current entry and the previous entry if
+ // the addresses don't perfectly line up.
bool is_gap = (i > 0) && (prev_addr + prev_length < addr);
// Before inserting the current entry, insert a terminal entry at the end
@@ -657,6 +1574,9 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
line_table->AppendLineEntryToSequence(
sequence.get(), prev_addr + prev_length, prev_line, 0,
prev_source_idx, false, false, false, false, true);
+
+ line_table->InsertSequence(sequence.release());
+ sequence.reset(line_table->CreateLineSequenceContainer());
}
if (ShouldAddLine(match_line, lno, length)) {
@@ -667,10 +1587,12 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
m_session_up->findSymbolByAddress(addr, PDB_SymType::Function);
if (func) {
auto prologue = func->findOneChild<PDBSymbolFuncDebugStart>();
- is_prologue = (addr == prologue->getVirtualAddress());
+ if (prologue)
+ is_prologue = (addr == prologue->getVirtualAddress());
auto epilogue = func->findOneChild<PDBSymbolFuncDebugEnd>();
- is_epilogue = (addr == epilogue->getVirtualAddress());
+ if (epilogue)
+ is_epilogue = (addr == epilogue->getVirtualAddress());
}
line_table->AppendLineEntryToSequence(sequence.get(), addr, lno, col,
@@ -694,23 +1616,134 @@ bool SymbolFilePDB::ParseCompileUnitLineTable(
line_table->InsertSequence(sequence.release());
}
- sc.comp_unit->SetLineTable(line_table.release());
- return true;
+ if (line_table->GetSize()) {
+ sc.comp_unit->SetLineTable(line_table.release());
+ return true;
+ }
+ return false;
}
void SymbolFilePDB::BuildSupportFileIdToSupportFileIndexMap(
- const PDBSymbolCompiland &cu,
+ const PDBSymbolCompiland &compiland,
llvm::DenseMap<uint32_t, uint32_t> &index_map) const {
- // This is a hack, but we need to convert the source id into an index into the
- // support files array. We don't want to do path comparisons to avoid
+ // This is a hack, but we need to convert the source id into an index into
+ // the support files array. We don't want to do path comparisons to avoid
// basename / full path issues that may or may not even be a problem, so we
// use the globally unique source file identifiers. Ideally we could use the
// global identifiers everywhere, but LineEntry currently assumes indices.
- auto source_files = m_session_up->getSourceFilesForCompiland(cu);
- int index = 0;
+ auto source_files = m_session_up->getSourceFilesForCompiland(compiland);
+ if (!source_files)
+ return;
+
+ // LLDB uses the DWARF-like file numeration (one based)
+ int index = 1;
while (auto file = source_files->getNext()) {
uint32_t source_id = file->getUniqueId();
index_map[source_id] = index++;
}
}
+
+lldb::CompUnitSP SymbolFilePDB::GetCompileUnitContainsAddress(
+ const lldb_private::Address &so_addr) {
+ lldb::addr_t file_vm_addr = so_addr.GetFileAddress();
+ if (file_vm_addr == LLDB_INVALID_ADDRESS || file_vm_addr == 0)
+ return nullptr;
+
+ // If it is a PDB function's vm addr, this is the first sure bet.
+ if (auto lines =
+ m_session_up->findLineNumbersByAddress(file_vm_addr, /*Length=*/1)) {
+ if (auto first_line = lines->getNext())
+ return ParseCompileUnitForUID(first_line->getCompilandId());
+ }
+
+ // Otherwise we resort to section contributions.
+ if (auto sec_contribs = m_session_up->getSectionContribs()) {
+ while (auto section = sec_contribs->getNext()) {
+ auto va = section->getVirtualAddress();
+ if (file_vm_addr >= va && file_vm_addr < va + section->getLength())
+ return ParseCompileUnitForUID(section->getCompilandId());
+ }
+ }
+ return nullptr;
+}
+
+Mangled
+SymbolFilePDB::GetMangledForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func) {
+ Mangled mangled;
+ auto func_name = pdb_func.getName();
+ auto func_undecorated_name = pdb_func.getUndecoratedName();
+ std::string func_decorated_name;
+
+ // Seek from public symbols for non-static function's decorated name if any.
+ // For static functions, they don't have undecorated names and aren't exposed
+ // in Public Symbols either.
+ if (!func_undecorated_name.empty()) {
+ auto result_up = m_global_scope_up->findChildren(
+ PDB_SymType::PublicSymbol, func_undecorated_name,
+ PDB_NameSearchFlags::NS_UndecoratedName);
+ if (result_up) {
+ while (auto symbol_up = result_up->getNext()) {
+ // For a public symbol, it is unique.
+ lldbassert(result_up->getChildCount() == 1);
+ if (auto *pdb_public_sym =
+ llvm::dyn_cast_or_null<PDBSymbolPublicSymbol>(
+ symbol_up.get())) {
+ if (pdb_public_sym->isFunction()) {
+ func_decorated_name = pdb_public_sym->getName();
+ break;
+ }
+ }
+ }
+ }
+ }
+ if (!func_decorated_name.empty()) {
+ mangled.SetMangledName(ConstString(func_decorated_name));
+
+ // For MSVC, format of C funciton's decorated name depends on calling
+ // conventon. Unfortunately none of the format is recognized by current
+ // LLDB. For example, `_purecall` is a __cdecl C function. From PDB,
+ // `__purecall` is retrieved as both its decorated and undecorated name
+ // (using PDBSymbolFunc::getUndecoratedName method). However `__purecall`
+ // string is not treated as mangled in LLDB (neither `?` nor `_Z` prefix).
+ // Mangled::GetDemangledName method will fail internally and caches an
+ // empty string as its undecorated name. So we will face a contradition
+ // here for the same symbol:
+ // non-empty undecorated name from PDB
+ // empty undecorated name from LLDB
+ if (!func_undecorated_name.empty() &&
+ mangled.GetDemangledName(mangled.GuessLanguage()).IsEmpty())
+ mangled.SetDemangledName(ConstString(func_undecorated_name));
+
+ // LLDB uses several flags to control how a C++ decorated name is
+ // undecorated for MSVC. See `safeUndecorateName` in Class Mangled. So the
+ // yielded name could be different from what we retrieve from
+ // PDB source unless we also apply same flags in getting undecorated
+ // name through PDBSymbolFunc::getUndecoratedNameEx method.
+ if (!func_undecorated_name.empty() &&
+ mangled.GetDemangledName(mangled.GuessLanguage()) !=
+ ConstString(func_undecorated_name))
+ mangled.SetDemangledName(ConstString(func_undecorated_name));
+ } else if (!func_undecorated_name.empty()) {
+ mangled.SetDemangledName(ConstString(func_undecorated_name));
+ } else if (!func_name.empty())
+ mangled.SetValue(ConstString(func_name), false);
+
+ return mangled;
+}
+
+bool SymbolFilePDB::DeclContextMatchesThisSymbolFile(
+ const lldb_private::CompilerDeclContext *decl_ctx) {
+ if (decl_ctx == nullptr || !decl_ctx->IsValid())
+ return true;
+
+ TypeSystem *decl_ctx_type_system = decl_ctx->GetTypeSystem();
+ if (!decl_ctx_type_system)
+ return false;
+ TypeSystem *type_system = GetTypeSystemForLanguage(
+ decl_ctx_type_system->GetMinimumLanguage(nullptr));
+ if (decl_ctx_type_system == type_system)
+ return true; // The type systems match, return true
+
+ return false;
+}
diff --git a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
index eef96be8d1fe..96b62d68a6c2 100644
--- a/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
+++ b/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
@@ -10,12 +10,15 @@
#ifndef lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_
#define lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_
+#include "lldb/Core/UniqueCStringMap.h"
#include "lldb/Symbol/SymbolFile.h"
+#include "lldb/Symbol/VariableList.h"
#include "lldb/Utility/UserID.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/DebugInfo/PDB/IPDBSession.h"
#include "llvm/DebugInfo/PDB/PDB.h"
+#include "llvm/DebugInfo/PDB/PDBSymbolExe.h"
class SymbolFilePDB : public lldb_private::SymbolFile {
public:
@@ -108,11 +111,11 @@ public:
uint32_t
FindGlobalVariables(const lldb_private::ConstString &name,
const lldb_private::CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t FindGlobalVariables(const lldb_private::RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
lldb_private::VariableList &variables) override;
uint32_t
@@ -141,8 +144,7 @@ public:
bool append, lldb_private::TypeMap &types) override;
void FindTypesByRegex(const lldb_private::RegularExpression &regex,
- uint32_t max_matches,
- lldb_private::TypeMap &types);
+ uint32_t max_matches, lldb_private::TypeMap &types);
lldb_private::TypeList *GetTypeList() override;
@@ -167,25 +169,76 @@ public:
const llvm::pdb::IPDBSession &GetPDBSession() const;
private:
- lldb::CompUnitSP ParseCompileUnitForSymIndex(uint32_t id);
+ lldb::CompUnitSP ParseCompileUnitForUID(uint32_t id,
+ uint32_t index = UINT32_MAX);
bool ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc,
uint32_t match_line);
void BuildSupportFileIdToSupportFileIndexMap(
- const llvm::pdb::PDBSymbolCompiland &cu,
+ const llvm::pdb::PDBSymbolCompiland &pdb_compiland,
llvm::DenseMap<uint32_t, uint32_t> &index_map) const;
void FindTypesByName(const std::string &name, uint32_t max_matches,
lldb_private::TypeMap &types);
+ std::string GetMangledForPDBData(const llvm::pdb::PDBSymbolData &pdb_data);
+
+ lldb::VariableSP
+ ParseVariableForPDBData(const lldb_private::SymbolContext &sc,
+ const llvm::pdb::PDBSymbolData &pdb_data);
+
+ size_t ParseVariables(const lldb_private::SymbolContext &sc,
+ const llvm::pdb::PDBSymbol &pdb_data,
+ lldb_private::VariableList *variable_list = nullptr);
+
+ lldb::CompUnitSP
+ GetCompileUnitContainsAddress(const lldb_private::Address &so_addr);
+
+ typedef std::vector<lldb_private::Type *> TypeCollection;
+
+ void GetTypesForPDBSymbol(const llvm::pdb::PDBSymbol &pdb_symbol,
+ uint32_t type_mask,
+ TypeCollection &type_collection);
+
+ lldb_private::Function *
+ ParseCompileUnitFunctionForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func,
+ const lldb_private::SymbolContext &sc);
+
+ void GetCompileUnitIndex(const llvm::pdb::PDBSymbolCompiland &pdb_compiland,
+ uint32_t &index);
+
+ std::unique_ptr<llvm::pdb::PDBSymbolCompiland>
+ GetPDBCompilandByUID(uint32_t uid);
+
+ lldb_private::Mangled
+ GetMangledForPDBFunc(const llvm::pdb::PDBSymbolFunc &pdb_func);
+
+ bool ResolveFunction(const llvm::pdb::PDBSymbolFunc &pdb_func,
+ bool include_inlines,
+ lldb_private::SymbolContextList &sc_list);
+
+ bool ResolveFunction(uint32_t uid, bool include_inlines,
+ lldb_private::SymbolContextList &sc_list);
+
+ void CacheFunctionNames();
+
+ bool DeclContextMatchesThisSymbolFile(
+ const lldb_private::CompilerDeclContext *decl_ctx);
+
llvm::DenseMap<uint32_t, lldb::CompUnitSP> m_comp_units;
llvm::DenseMap<uint32_t, lldb::TypeSP> m_types;
+ llvm::DenseMap<uint32_t, lldb::VariableSP> m_variables;
std::vector<lldb::TypeSP> m_builtin_types;
std::unique_ptr<llvm::pdb::IPDBSession> m_session_up;
+ std::unique_ptr<llvm::pdb::PDBSymbolExe> m_global_scope_up;
uint32_t m_cached_compile_unit_count;
std::unique_ptr<lldb_private::CompilerDeclContext> m_tu_decl_ctx_up;
+
+ lldb_private::UniqueCStringMap<uint32_t> m_func_full_names;
+ lldb_private::UniqueCStringMap<uint32_t> m_func_base_names;
+ lldb_private::UniqueCStringMap<uint32_t> m_func_method_names;
};
#endif // lldb_Plugins_SymbolFile_PDB_SymbolFilePDB_h_
diff --git a/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp b/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
index dbc1b9ee5470..64e2daf60ee5 100644
--- a/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
+++ b/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.cpp
@@ -63,9 +63,9 @@ uint32_t SymbolFileSymtab::CalculateAbilities() {
const Symtab *symtab = m_obj_file->GetSymtab();
if (symtab) {
//----------------------------------------------------------------------
- // The snippet of code below will get the indexes the module symbol
- // table entries that are code, data, or function related (debug info),
- // sort them by value (address) and dump the sorted symbols.
+ // The snippet of code below will get the indexes the module symbol table
+ // entries that are code, data, or function related (debug info), sort
+ // them by value (address) and dump the sorted symbols.
//----------------------------------------------------------------------
if (symtab->AppendSymbolIndexesWithType(eSymbolTypeSourceFile,
m_source_indexes)) {
@@ -105,24 +105,21 @@ uint32_t SymbolFileSymtab::CalculateAbilities() {
}
uint32_t SymbolFileSymtab::GetNumCompileUnits() {
- // If we don't have any source file symbols we will just have one compile unit
- // for
- // the entire object file
+ // If we don't have any source file symbols we will just have one compile
+ // unit for the entire object file
if (m_source_indexes.empty())
return 0;
// If we have any source file symbols we will logically organize the object
- // symbols
- // using these.
+ // symbols using these.
return m_source_indexes.size();
}
CompUnitSP SymbolFileSymtab::ParseCompileUnitAtIndex(uint32_t idx) {
CompUnitSP cu_sp;
- // If we don't have any source file symbols we will just have one compile unit
- // for
- // the entire object file
+ // If we don't have any source file symbols we will just have one compile
+ // unit for the entire object file
if (idx < m_source_indexes.size()) {
const Symbol *cu_symbol =
m_obj_file->GetSymtab()->SymbolAtIndex(m_source_indexes[idx]);
@@ -152,13 +149,12 @@ size_t SymbolFileSymtab::ParseCompileUnitFunctions(const SymbolContext &sc) {
//
// const uint32_t prefix_len = strlen(prefix);
- // If we don't have any source file symbols we will just have one compile unit
- // for
- // the entire object file
+ // If we don't have any source file symbols we will just have one compile
+ // unit for the entire object file
if (m_source_indexes.empty()) {
- // The only time we will have a user ID of zero is when we don't have
- // and source file symbols and we declare one compile unit for the
- // entire object file
+ // The only time we will have a user ID of zero is when we don't have and
+ // source file symbols and we declare one compile unit for the entire
+ // object file
if (!m_func_indexes.empty()) {
}
diff --git a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
index a25119684c28..d24510966878 100644
--- a/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
+++ b/source/Plugins/SymbolVendor/ELF/SymbolVendorELF.cpp
@@ -57,9 +57,9 @@ const char *SymbolVendorELF::GetPluginDescriptionStatic() {
//----------------------------------------------------------------------
// CreateInstance
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *
SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
@@ -112,11 +112,9 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
module_sp, &dsym_fspec, 0, dsym_fspec.GetByteSize(),
dsym_file_data_sp, dsym_file_data_offset);
if (dsym_objfile_sp) {
- // This objfile is for debugging purposes. Sadly, ObjectFileELF won't be
- // able
- // to figure this out consistently as the symbol file may not have
- // stripped the
- // code sections, etc.
+ // This objfile is for debugging purposes. Sadly, ObjectFileELF won't
+ // be able to figure this out consistently as the symbol file may not
+ // have stripped the code sections, etc.
dsym_objfile_sp->SetType(ObjectFile::eTypeDebugInfo);
SymbolVendorELF *symbol_vendor = new SymbolVendorELF(module_sp);
@@ -134,7 +132,7 @@ SymbolVendorELF::CreateInstance(const lldb::ModuleSP &module_sp,
eSectionTypeDWARFDebugMacInfo, eSectionTypeDWARFDebugPubNames,
eSectionTypeDWARFDebugPubTypes, eSectionTypeDWARFDebugRanges,
eSectionTypeDWARFDebugStr, eSectionTypeDWARFDebugStrOffsets,
- eSectionTypeELFSymbolTable,
+ eSectionTypeELFSymbolTable, eSectionTypeDWARFGNUDebugAltLink,
};
for (size_t idx = 0; idx < sizeof(g_sections) / sizeof(g_sections[0]);
++idx) {
diff --git a/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp b/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
index b3fb05e652d9..c69eb7fd51c7 100644
--- a/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
+++ b/source/Plugins/SymbolVendor/MacOSX/SymbolVendorMacOSX.cpp
@@ -94,9 +94,9 @@ const char *SymbolVendorMacOSX::GetPluginDescriptionStatic() {
//----------------------------------------------------------------------
// CreateInstance
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *
SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
@@ -130,14 +130,14 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
"SymbolVendorMacOSX::CreateInstance (module = %s) locate dSYM",
module_sp->GetFileSpec().GetPath().c_str());
- // First check to see if the module has a symbol file in mind already.
- // If it does, then we MUST use that.
+ // First check to see if the module has a symbol file in mind already. If
+ // it does, then we MUST use that.
FileSpec dsym_fspec(module_sp->GetSymbolFileFileSpec());
ObjectFileSP dsym_objfile_sp;
if (!dsym_fspec) {
- // No symbol file was specified in the module, lets try and find
- // one ourselves.
+ // No symbol file was specified in the module, lets try and find one
+ // ourselves.
FileSpec file_spec = obj_file->GetFileSpec();
if (!file_spec)
file_spec = module_sp->GetFileSpec();
@@ -179,24 +179,8 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
std::string DBGBuildSourcePath;
std::string DBGSourcePath;
- plist.GetValueAsString("DBGBuildSourcePath",
- DBGBuildSourcePath);
- plist.GetValueAsString("DBGSourcePath", DBGSourcePath);
- if (!DBGBuildSourcePath.empty() &&
- !DBGSourcePath.empty()) {
- if (DBGSourcePath[0] == '~') {
- FileSpec resolved_source_path(DBGSourcePath.c_str(),
- true);
- DBGSourcePath = resolved_source_path.GetPath();
- }
- module_sp->GetSourceMappingList().Append(
- ConstString(DBGBuildSourcePath),
- ConstString(DBGSourcePath), true);
- }
-
// DBGSourcePathRemapping is a dictionary in the plist
- // with
- // keys which are DBGBuildSourcePath file paths and
+ // with keys which are DBGBuildSourcePath file paths and
// values which are DBGSourcePath file paths
StructuredData::ObjectSP plist_sp =
@@ -208,17 +192,14 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
->GetValueForKey("DBGSourcePathRemapping")
->GetAsDictionary()) {
- // In an early version of DBGSourcePathRemapping, the
- // DBGSourcePath
- // values were incorrect. If we have a newer style
- // DBGSourcePathRemapping, there will be a DBGVersion
- // key in the plist with version 2 or higher.
+ // If DBGVersion 1 or DBGVersion missing, ignore DBGSourcePathRemapping.
+ // If DBGVersion 2, strip last two components of path remappings from
+ // entries to fix an issue with a specific set of
+ // DBGSourcePathRemapping entries that lldb worked
+ // with.
+ // If DBGVersion 3, trust & use the source path remappings as-is.
//
- // If this is an old style DBGSourcePathRemapping,
- // ignore the
- // value half of the key-value remappings and use reuse
- // the original
- // gloal DBGSourcePath string.
+
bool new_style_source_remapping_dictionary = false;
bool do_truncate_remapping_names = false;
std::string original_DBGSourcePath_value =
@@ -268,10 +249,12 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
}
module_sp->GetSourceMappingList().Append(
key, ConstString(DBGSourcePath), true);
- // With version 2 of DBGSourcePathRemapping, we can chop off the
- // last two filename parts from the source remapping and get a
- // more general source remapping that still works. Add this as
- // another option in addition to the full source path remap.
+ // With version 2 of DBGSourcePathRemapping, we
+ // can chop off the last two filename parts
+ // from the source remapping and get a more
+ // general source remapping that still works.
+ // Add this as another option in addition to
+ // the full source path remap.
if (do_truncate_remapping_names) {
FileSpec build_path(key.AsCString(), false);
FileSpec source_path(DBGSourcePath.c_str(), false);
@@ -287,6 +270,24 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
return true;
});
}
+
+ // If we have a DBGBuildSourcePath + DBGSourcePath pair,
+ // append those to the source path remappings.
+
+ plist.GetValueAsString("DBGBuildSourcePath",
+ DBGBuildSourcePath);
+ plist.GetValueAsString("DBGSourcePath", DBGSourcePath);
+ if (!DBGBuildSourcePath.empty() &&
+ !DBGSourcePath.empty()) {
+ if (DBGSourcePath[0] == '~') {
+ FileSpec resolved_source_path(DBGSourcePath.c_str(),
+ true);
+ DBGSourcePath = resolved_source_path.GetPath();
+ }
+ module_sp->GetSourceMappingList().Append(
+ ConstString(DBGBuildSourcePath),
+ ConstString(DBGSourcePath), true);
+ }
}
}
}
@@ -300,9 +301,9 @@ SymbolVendorMacOSX::CreateInstance(const lldb::ModuleSP &module_sp,
}
}
- // Just create our symbol vendor using the current objfile as this is either
- // an executable with no dSYM (that we could locate), an executable with
- // a dSYM that has a UUID that doesn't match.
+ // Just create our symbol vendor using the current objfile as this is
+ // either an executable with no dSYM (that we could locate), an executable
+ // with a dSYM that has a UUID that doesn't match.
symbol_vendor->AddSymbolFileRepresentation(obj_file->shared_from_this());
}
return symbol_vendor;
diff --git a/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp b/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
index 3f0c7db676f3..007a59378fc5 100644
--- a/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
+++ b/source/Plugins/SystemRuntime/MacOSX/AppleGetItemInfoHandler.cpp
@@ -119,20 +119,18 @@ void AppleGetItemInfoHandler::Detach() {
}
// Compile our __lldb_backtrace_recording_get_item_info() function (from the
-// source above in g_get_item_info_function_code) if we don't find that function
-// in the inferior
-// already with USE_BUILTIN_FUNCTION defined. (e.g. this would be the case for
-// testing.)
+// source above in g_get_item_info_function_code) if we don't find that
+// function in the inferior already with USE_BUILTIN_FUNCTION defined. (e.g.
+// this would be the case for testing.)
//
-// Insert the __lldb_backtrace_recording_get_item_info into the inferior process
-// if needed.
+// Insert the __lldb_backtrace_recording_get_item_info into the inferior
+// process if needed.
//
// Write the get_item_info_arglist into the inferior's memory space to prepare
// for the call.
//
// Returns the address of the arguments written down in the inferior process,
-// which can be used to
-// make the function call.
+// which can be used to make the function call.
lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction(
Thread &thread, ValueList &get_item_info_arglist) {
@@ -146,7 +144,8 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction(
{
std::lock_guard<std::mutex> guard(m_get_item_info_function_mutex);
- // First stage is to make the UtilityFunction to hold our injected function:
+ // First stage is to make the UtilityFunction to hold our injected
+ // function:
if (!m_get_item_info_impl_code.get()) {
if (g_get_item_info_function_code != NULL) {
@@ -209,10 +208,9 @@ lldb::addr_t AppleGetItemInfoHandler::SetupGetItemInfoFunction(
diagnostics.Clear();
// Now write down the argument values for this particular call. This looks
- // like it might be a race condition
- // if other threads were calling into here, but actually it isn't because we
- // allocate a new args structure for
- // this call by passing args_addr = LLDB_INVALID_ADDRESS...
+ // like it might be a race condition if other threads were calling into here,
+ // but actually it isn't because we allocate a new args structure for this
+ // call by passing args_addr = LLDB_INVALID_ADDRESS...
if (!get_item_info_caller->WriteFunctionArguments(
exe_ctx, args_addr, get_item_info_arglist, diagnostics)) {
@@ -272,8 +270,7 @@ AppleGetItemInfoHandler::GetItemInfo(Thread &thread, uint64_t item,
// uint64_t page_to_free_size)
// Where the return_buffer argument points to a 24 byte region of memory
- // already allocated by lldb in
- // the inferior process.
+ // already allocated by lldb in the inferior process.
CompilerType clang_void_ptr_type =
clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
diff --git a/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp b/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
index e3d03a6f9484..0de32bf11416 100644
--- a/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
+++ b/source/Plugins/SystemRuntime/MacOSX/AppleGetPendingItemsHandler.cpp
@@ -121,11 +121,10 @@ void AppleGetPendingItemsHandler::Detach() {
}
}
-// Compile our __lldb_backtrace_recording_get_pending_items() function (from the
-// source above in g_get_pending_items_function_code) if we don't find that
-// function in the inferior
-// already with USE_BUILTIN_FUNCTION defined. (e.g. this would be the case for
-// testing.)
+// Compile our __lldb_backtrace_recording_get_pending_items() function (from
+// the source above in g_get_pending_items_function_code) if we don't find that
+// function in the inferior already with USE_BUILTIN_FUNCTION defined. (e.g.
+// this would be the case for testing.)
//
// Insert the __lldb_backtrace_recording_get_pending_items into the inferior
// process if needed.
@@ -134,8 +133,7 @@ void AppleGetPendingItemsHandler::Detach() {
// prepare for the call.
//
// Returns the address of the arguments written down in the inferior process,
-// which can be used to
-// make the function call.
+// which can be used to make the function call.
lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(
Thread &thread, ValueList &get_pending_items_arglist) {
@@ -212,10 +210,9 @@ lldb::addr_t AppleGetPendingItemsHandler::SetupGetPendingItemsFunction(
}
// Now write down the argument values for this particular call. This looks
- // like it might be a race condition
- // if other threads were calling into here, but actually it isn't because we
- // allocate a new args structure for
- // this call by passing args_addr = LLDB_INVALID_ADDRESS...
+ // like it might be a race condition if other threads were calling into here,
+ // but actually it isn't because we allocate a new args structure for this
+ // call by passing args_addr = LLDB_INVALID_ADDRESS...
if (!get_pending_items_caller->WriteFunctionArguments(
exe_ctx, args_addr, get_pending_items_arglist, diagnostics)) {
@@ -279,8 +276,7 @@ AppleGetPendingItemsHandler::GetPendingItems(Thread &thread, addr_t queue,
// uint64_t page_to_free_size)
// Where the return_buffer argument points to a 24 byte region of memory
- // already allocated by lldb in
- // the inferior process.
+ // already allocated by lldb in the inferior process.
CompilerType clang_void_ptr_type =
clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
diff --git a/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp b/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
index c1654eb62ccc..7855b3603a3a 100644
--- a/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
+++ b/source/Plugins/SystemRuntime/MacOSX/AppleGetQueuesHandler.cpp
@@ -118,9 +118,9 @@ void AppleGetQueuesHandler::Detach() {
}
// Construct a CompilerType for the structure that
-// g_get_current_queues_function_code will return by value
-// so we can extract the fields after performing the function call.
-// i.e. we are getting this struct returned to us:
+// g_get_current_queues_function_code will return by value so we can extract
+// the fields after performing the function call. i.e. we are getting this
+// struct returned to us:
//
// struct get_current_queues_return_values
// {
@@ -130,11 +130,9 @@ void AppleGetQueuesHandler::Detach() {
// };
// Compile our __lldb_backtrace_recording_get_current_queues() function (from
-// the
-// source above in g_get_current_queues_function_code) if we don't find that
-// function in the inferior
-// already with USE_BUILTIN_FUNCTION defined. (e.g. this would be the case for
-// testing.)
+// the source above in g_get_current_queues_function_code) if we don't find
+// that function in the inferior already with USE_BUILTIN_FUNCTION defined.
+// (e.g. this would be the case for testing.)
//
// Insert the __lldb_backtrace_recording_get_current_queues into the inferior
// process if needed.
@@ -143,8 +141,7 @@ void AppleGetQueuesHandler::Detach() {
// the call.
//
// Returns the address of the arguments written down in the inferior process,
-// which can be used to
-// make the function call.
+// which can be used to make the function call.
lldb::addr_t
AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread,
@@ -217,10 +214,9 @@ AppleGetQueuesHandler::SetupGetQueuesFunction(Thread &thread,
diagnostics.Clear();
// Now write down the argument values for this particular call. This looks
- // like it might be a race condition
- // if other threads were calling into here, but actually it isn't because we
- // allocate a new args structure for
- // this call by passing args_addr = LLDB_INVALID_ADDRESS...
+ // like it might be a race condition if other threads were calling into here,
+ // but actually it isn't because we allocate a new args structure for this
+ // call by passing args_addr = LLDB_INVALID_ADDRESS...
if (!get_queues_caller->WriteFunctionArguments(
exe_ctx, args_addr, get_queues_arglist, diagnostics)) {
@@ -280,8 +276,7 @@ AppleGetQueuesHandler::GetCurrentQueues(Thread &thread, addr_t page_to_free,
// uint64_t page_to_free_size);
// Where the return_buffer argument points to a 24 byte region of memory
- // already allocated by lldb in
- // the inferior process.
+ // already allocated by lldb in the inferior process.
CompilerType clang_void_ptr_type =
clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
diff --git a/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp b/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
index 8d83922af1e7..09ab6600a9f0 100644
--- a/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
+++ b/source/Plugins/SystemRuntime/MacOSX/AppleGetThreadItemInfoHandler.cpp
@@ -128,11 +128,9 @@ void AppleGetThreadItemInfoHandler::Detach() {
}
// Compile our __lldb_backtrace_recording_get_thread_item_info() function (from
-// the
-// source above in g_get_thread_item_info_function_code) if we don't find that
-// function in the inferior
-// already with USE_BUILTIN_FUNCTION defined. (e.g. this would be the case for
-// testing.)
+// the source above in g_get_thread_item_info_function_code) if we don't find
+// that function in the inferior already with USE_BUILTIN_FUNCTION defined.
+// (e.g. this would be the case for testing.)
//
// Insert the __lldb_backtrace_recording_get_thread_item_info into the inferior
// process if needed.
@@ -141,8 +139,7 @@ void AppleGetThreadItemInfoHandler::Detach() {
// prepare for the call.
//
// Returns the address of the arguments written down in the inferior process,
-// which can be used to
-// make the function call.
+// which can be used to make the function call.
lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(
Thread &thread, ValueList &get_thread_item_info_arglist) {
@@ -221,10 +218,9 @@ lldb::addr_t AppleGetThreadItemInfoHandler::SetupGetThreadItemInfoFunction(
diagnostics.Clear();
// Now write down the argument values for this particular call. This looks
- // like it might be a race condition
- // if other threads were calling into here, but actually it isn't because we
- // allocate a new args structure for
- // this call by passing args_addr = LLDB_INVALID_ADDRESS...
+ // like it might be a race condition if other threads were calling into here,
+ // but actually it isn't because we allocate a new args structure for this
+ // call by passing args_addr = LLDB_INVALID_ADDRESS...
if (!get_thread_item_info_caller->WriteFunctionArguments(
exe_ctx, args_addr, get_thread_item_info_arglist, diagnostics)) {
@@ -266,8 +262,7 @@ AppleGetThreadItemInfoHandler::GetThreadItemInfo(Thread &thread,
// Set up the arguments for a call to
- // struct get_thread_item_info_return_values
- // {
+ // struct get_thread_item_info_return_values {
// uint64_t item_info_buffer_ptr; /* the address of the items buffer
// from libBacktraceRecording */
// uint64_t item_info_buffer_size; /* the size of the items buffer from
@@ -283,8 +278,7 @@ AppleGetThreadItemInfoHandler::GetThreadItemInfo(Thread &thread,
// uint64_t page_to_free_size)
// Where the return_buffer argument points to a 24 byte region of memory
- // already allocated by lldb in
- // the inferior process.
+ // already allocated by lldb in the inferior process.
CompilerType clang_void_ptr_type =
clang_ast_context->GetBasicType(eBasicTypeVoid).GetPointerType();
diff --git a/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 1a538b236c15..4748d5e8622e 100644
--- a/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -34,9 +34,9 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Create an instance of this class. This function is filled into
-// the plugin info class that gets handed out by the plugin factory and
-// allows the lldb to instantiate an instance of this class.
+// Create an instance of this class. This function is filled into the plugin
+// info class that gets handed out by the plugin factory and allows the lldb to
+// instantiate an instance of this class.
//----------------------------------------------------------------------
SystemRuntime *SystemRuntimeMacOSX::CreateInstance(Process *process) {
bool create = false;
@@ -125,17 +125,15 @@ SystemRuntimeMacOSX::GetQueueNameFromThreadQAddress(addr_t dispatch_qaddr) {
ReadLibdispatchOffsets();
if (m_libdispatch_offsets.IsValid()) {
// dispatch_qaddr is from a thread_info(THREAD_IDENTIFIER_INFO) call for a
- // thread -
- // deref it to get the address of the dispatch_queue_t structure for this
- // thread's
- // queue.
+ // thread - deref it to get the address of the dispatch_queue_t structure
+ // for this thread's queue.
Status error;
addr_t dispatch_queue_addr =
m_process->ReadPointerFromMemory(dispatch_qaddr, error);
if (error.Success()) {
if (m_libdispatch_offsets.dqo_version >= 4) {
- // libdispatch versions 4+, pointer to dispatch name is in the
- // queue structure.
+ // libdispatch versions 4+, pointer to dispatch name is in the queue
+ // structure.
addr_t pointer_to_label_address =
dispatch_queue_addr + m_libdispatch_offsets.dqo_label;
addr_t label_addr =
@@ -248,10 +246,8 @@ SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress(lldb::addr_t dispatch_qaddr) {
ReadLibdispatchOffsets();
if (m_libdispatch_offsets.IsValid()) {
// dispatch_qaddr is from a thread_info(THREAD_IDENTIFIER_INFO) call for a
- // thread -
- // deref it to get the address of the dispatch_queue_t structure for this
- // thread's
- // queue.
+ // thread - deref it to get the address of the dispatch_queue_t structure
+ // for this thread's queue.
Status error;
uint64_t dispatch_queue_addr =
m_process->ReadPointerFromMemory(dispatch_qaddr, error);
@@ -287,8 +283,8 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress() {
dispatch_queue_offsets_symbol = module_sp->FindFirstSymbolWithNameAndType(
g_dispatch_queue_offsets_symbol_name, eSymbolTypeData);
- // libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion") and
- // later
+ // libdispatch symbols are in their own dylib as of Mac OS X 10.7 ("Lion")
+ // and later
if (dispatch_queue_offsets_symbol == NULL) {
ModuleSpec libdispatch_module_spec(FileSpec("libdispatch.dylib", false));
module_sp = m_process->GetTarget().GetImages().FindFirstModule(
@@ -320,8 +316,7 @@ void SystemRuntimeMacOSX::ReadLibdispatchOffsets() {
lldb::offset_t data_offset = 0;
// The struct LibdispatchOffsets is a series of uint16_t's - extract them
- // all
- // in one big go.
+ // all in one big go.
data.GetU16(&data_offset, &m_libdispatch_offsets.dqo_version,
sizeof(struct LibdispatchOffsets) / sizeof(uint16_t));
}
@@ -368,8 +363,7 @@ void SystemRuntimeMacOSX::ReadLibpthreadOffsets() {
lldb::offset_t data_offset = 0;
// The struct LibpthreadOffsets is a series of uint16_t's - extract them
- // all
- // in one big go.
+ // all in one big go.
data.GetU16(&data_offset, &m_libpthread_offsets.plo_version,
sizeof(struct LibpthreadOffsets) / sizeof(uint16_t));
}
@@ -407,10 +401,8 @@ void SystemRuntimeMacOSX::ReadLibdispatchTSDIndexes() {
if (m_dispatch_tsd_indexes_addr != LLDB_INVALID_ADDRESS) {
// We don't need to check the version number right now, it will be at least 2,
-// but
-// keep this code around to fetch just the version # for the future where we
-// need
-// to fetch alternate versions of the struct.
+// but keep this code around to fetch just the version # for the future where
+// we need to fetch alternate versions of the struct.
#if 0
uint16_t dti_version = 2;
Address dti_struct_addr;
@@ -473,12 +465,9 @@ ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceThread(ThreadSP real_thread,
Status error;
// real_thread is either an actual, live thread (in which case we need to
- // call into
- // libBacktraceRecording to find its originator) or it is an extended
- // backtrace itself,
- // in which case we get the token from it and call into
- // libBacktraceRecording to find
- // the originator of that token.
+ // call into libBacktraceRecording to find its originator) or it is an
+ // extended backtrace itself, in which case we get the token from it and
+ // call into libBacktraceRecording to find the originator of that token.
if (real_thread->GetExtendedBacktraceToken() != LLDB_INVALID_ADDRESS) {
originating_thread_sp = GetExtendedBacktraceFromItemRef(
@@ -735,13 +724,11 @@ void SystemRuntimeMacOSX::PopulateQueueList(
}
// We either didn't have libBacktraceRecording (and need to create the queues
- // list based on threads)
- // or we did get the queues list from libBacktraceRecording but some special
- // queues may not be
- // included in its information. This is needed because libBacktraceRecording
- // will only list queues with pending or running items by default - but the
- // magic com.apple.main-thread
- // queue on thread 1 is always around.
+ // list based on threads) or we did get the queues list from
+ // libBacktraceRecording but some special queues may not be included in its
+ // information. This is needed because libBacktraceRecording will only list
+ // queues with pending or running items by default - but the magic com.apple
+ // .main-thread queue on thread 1 is always around.
for (ThreadSP thread_sp : m_process->Threads()) {
if (thread_sp->GetAssociatedWithLibdispatchQueue() != eLazyBoolNo) {
@@ -769,12 +756,10 @@ void SystemRuntimeMacOSX::PopulateQueueList(
}
// Returns either an array of introspection_dispatch_item_info_ref's for the
-// pending items on
-// a queue or an array introspection_dispatch_item_info_ref's and code addresses
-// for the
-// pending items on a queue. The information about each of these pending items
-// then needs to
-// be fetched individually by passing the ref to libBacktraceRecording.
+// pending items on a queue or an array introspection_dispatch_item_info_ref's
+// and code addresses for the pending items on a queue. The information about
+// each of these pending items then needs to be fetched individually by passing
+// the ref to libBacktraceRecording.
SystemRuntimeMacOSX::PendingItemsForQueue
SystemRuntimeMacOSX::GetPendingItemRefsForQueue(lldb::addr_t queue) {
@@ -927,8 +912,8 @@ void SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR(
offset_t offset = 0;
uint64_t queues_read = 0;
- // The information about the queues is stored in this format (v1):
- // typedef struct introspection_dispatch_queue_info_s {
+ // The information about the queues is stored in this format (v1): typedef
+ // struct introspection_dispatch_queue_info_s {
// uint32_t offset_to_next;
// dispatch_queue_t queue;
// uint64_t serialnum; // queue's serialnum in the process, as
diff --git a/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp b/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
index f8aca4d1283b..54e182b30b6f 100644
--- a/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
+++ b/source/Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.cpp
@@ -12,6 +12,7 @@
#include "lldb/Core/Address.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/DumpDataExtractor.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/FormatEntity.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Target/ExecutionContext.h"
@@ -58,8 +59,8 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
if (range.GetByteSize() > 0 && range.GetBaseAddress().IsValid() &&
m_inst_emulator_ap.get()) {
- // The instruction emulation subclass setup the unwind plan for the
- // first instruction.
+ // The instruction emulation subclass setup the unwind plan for the first
+ // instruction.
m_inst_emulator_ap->CreateFunctionEntryUnwind(unwind_plan);
// CreateFunctionEntryUnwind should have created the first row. If it
@@ -90,9 +91,9 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
m_register_values.clear();
m_pushed_regs.clear();
- // Initialize the CFA with a known value. In the 32 bit case
- // it will be 0x80000000, and in the 64 bit case 0x8000000000000000.
- // We use the address byte size to be safe for any future address sizes
+ // Initialize the CFA with a known value. In the 32 bit case it will be
+ // 0x80000000, and in the 64 bit case 0x8000000000000000. We use the
+ // address byte size to be safe for any future address sizes
m_initial_sp = (1ull << ((addr_byte_size * 8) - 1));
RegisterValue cfa_reg_value;
cfa_reg_value.SetUInt(m_initial_sp, m_cfa_reg_info.byte_size);
@@ -105,14 +106,12 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
Instruction *inst = inst_list.GetInstructionAtIndex(0).get();
const lldb::addr_t base_addr = inst->GetAddress().GetFileAddress();
- // Map for storing the unwind plan row and the value of the registers at
- // a given offset.
- // When we see a forward branch we add a new entry to this map with the
- // actual unwind plan
- // row and register context for the target address of the branch as the
- // current data have
- // to be valid for the target address of the branch too if we are in the
- // same function.
+ // Map for storing the unwind plan row and the value of the registers
+ // at a given offset. When we see a forward branch we add a new entry
+ // to this map with the actual unwind plan row and register context for
+ // the target address of the branch as the current data have to be
+ // valid for the target address of the branch too if we are in the same
+ // function.
std::map<lldb::addr_t, std::pair<UnwindPlan::RowSP, RegisterValueMap>>
saved_unwind_states;
@@ -128,15 +127,14 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
saved_unwind_states.insert({0, {last_row, m_register_values}});
// cache the pc register number (in whatever register numbering this
- // UnwindPlan uses) for
- // quick reference during instruction parsing.
+ // UnwindPlan uses) for quick reference during instruction parsing.
RegisterInfo pc_reg_info;
m_inst_emulator_ap->GetRegisterInfo(
eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC, pc_reg_info);
// cache the return address register number (in whatever register
- // numbering this UnwindPlan uses) for
- // quick reference during instruction parsing.
+ // numbering this UnwindPlan uses) for quick reference during
+ // instruction parsing.
RegisterInfo ra_reg_info;
m_inst_emulator_ap->GetRegisterInfo(
eRegisterKindGeneric, LLDB_REGNUM_GENERIC_RA, ra_reg_info);
@@ -160,12 +158,11 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
"Unwind row for the function entry missing");
--it; // Move it to the row corresponding to the current offset
- // If the offset of m_curr_row don't match with the offset we see in
- // saved_unwind_states
- // then we have to update m_curr_row and m_register_values based on
- // the saved values. It
- // is happenning after we processed an epilogue and a return to
- // caller instruction.
+ // If the offset of m_curr_row don't match with the offset we see
+ // in saved_unwind_states then we have to update m_curr_row and
+ // m_register_values based on the saved values. It is happening
+ // after we processed an epilogue and a return to caller
+ // instruction.
if (it->second.first->GetOffset() != m_curr_row->GetOffset()) {
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *it->second.first;
@@ -181,10 +178,9 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
if (m_inst_emulator_ap->GetInstructionCondition() !=
EmulateInstruction::UnconditionalCondition &&
saved_unwind_states.count(current_offset) == 0) {
- // If we don't have a saved row for the current offset then save
- // our
- // current state because we will have to restore it after the
- // conditional block.
+ // If we don't have a saved row for the current offset then
+ // save our current state because we will have to restore it
+ // after the conditional block.
auto new_row =
std::make_shared<UnwindPlan::Row>(*m_curr_row.get());
saved_unwind_states.insert(
@@ -192,8 +188,8 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
}
// If the last instruction was conditional with a different
- // condition
- // then the then current condition then restore the condition.
+ // condition then the then current condition then restore the
+ // condition.
if (last_condition !=
EmulateInstruction::UnconditionalCondition) {
const auto &saved_state =
@@ -211,7 +207,7 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
replace_existing);
}
- // We are starting a new conditional block at the catual offset
+ // We are starting a new conditional block at the actual offset
condition_block_start_offset = current_offset;
}
@@ -230,8 +226,7 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
eEmulateInstructionOptionIgnoreConditions);
// If the current instruction is a branch forward then save the
- // current CFI information
- // for the offset where we are branching.
+ // current CFI information for the offset where we are branching.
if (m_forward_branch_offset != 0 &&
range.ContainsFileAddress(inst->GetAddress().GetFileAddress() +
m_forward_branch_offset)) {
@@ -247,8 +242,8 @@ bool UnwindAssemblyInstEmulation::GetNonCallSiteUnwindPlanFromAssembly(
// Were there any changes to the CFI while evaluating this
// instruction?
if (m_curr_row_modified) {
- // Save the modified row if we don't already have a CFI row in the
- // currennt address
+ // Save the modified row if we don't already have a CFI row in
+ // the current address
if (saved_unwind_states.count(
current_offset + inst->GetOpcode().GetByteSize()) == 0) {
m_curr_row->SetOffset(current_offset +
@@ -492,7 +487,7 @@ bool UnwindAssemblyInstEmulation::ReadRegister(EmulateInstruction *instruction,
strm.Printf("UnwindAssemblyInstEmulation::ReadRegister (name = \"%s\") => "
"synthetic_value = %i, value = ",
reg_info->name, synthetic);
- reg_value.Dump(&strm, reg_info, false, false, eFormatDefault);
+ DumpRegisterValue(reg_value, &strm, reg_info, false, false, eFormatDefault);
log->PutString(strm.GetString());
}
return true;
@@ -518,7 +513,7 @@ bool UnwindAssemblyInstEmulation::WriteRegister(
strm.Printf(
"UnwindAssemblyInstEmulation::WriteRegister (name = \"%s\", value = ",
reg_info->name);
- reg_value.Dump(&strm, reg_info, false, false, eFormatDefault);
+ DumpRegisterValue(reg_value, &strm, reg_info, false, false, eFormatDefault);
strm.PutCString(", context = ");
context.Dump(strm, instruction);
log->PutString(strm.GetString());
diff --git a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
index b8dcd99a53e7..327d0b0e4f71 100644
--- a/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
+++ b/source/Plugins/UnwindAssembly/x86/UnwindAssembly-x86.cpp
@@ -86,12 +86,10 @@ bool UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(
LLDB_REGNUM_GENERIC_PC);
// Does this UnwindPlan describe the prologue? I want to see that the CFA is
- // set
- // in terms of the stack pointer plus an offset, and I want to see that rip is
- // retrieved at the CFA-wordsize.
- // If there is no description of the prologue, don't try to augment this
- // eh_frame
- // unwinder code, fall back to assembly parsing instead.
+ // set in terms of the stack pointer plus an offset, and I want to see that
+ // rip is retrieved at the CFA-wordsize. If there is no description of the
+ // prologue, don't try to augment this eh_frame unwinder code, fall back to
+ // assembly parsing instead.
if (first_row->GetCFAValue().GetValueType() !=
UnwindPlan::Row::CFAValue::isRegisterPlusOffset ||
@@ -110,14 +108,13 @@ bool UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(
return false;
}
- // It looks like the prologue is described.
- // Is the epilogue described? If it is, no need to do any augmentation.
+ // It looks like the prologue is described. Is the epilogue described? If it
+ // is, no need to do any augmentation.
if (first_row != last_row &&
first_row->GetOffset() != last_row->GetOffset()) {
- // The first & last row have the same CFA register
- // and the same CFA offset value
- // and the CFA register is esp/rsp (the stack pointer).
+ // The first & last row have the same CFA register and the same CFA offset
+ // value and the CFA register is esp/rsp (the stack pointer).
// We're checking that both of them have an unwind rule like "CFA=esp+4" or
// CFA+rsp+8".
@@ -128,8 +125,8 @@ bool UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(
last_row->GetCFAValue().GetRegisterNumber() &&
first_row->GetCFAValue().GetOffset() ==
last_row->GetCFAValue().GetOffset()) {
- // Get the register locations for eip/rip from the first & last rows.
- // Are they both CFA plus an offset? Is it the same offset?
+ // Get the register locations for eip/rip from the first & last rows. Are
+ // they both CFA plus an offset? Is it the same offset?
UnwindPlan::Row::RegisterLocation last_row_pc_loc;
if (last_row->GetRegisterInfo(
@@ -139,12 +136,10 @@ bool UnwindAssembly_x86::AugmentUnwindPlanFromCallSite(
first_row_pc_loc.GetOffset() == last_row_pc_loc.GetOffset()) {
// One last sanity check: Is the unwind rule for getting the caller
- // pc value
- // "deref the CFA-4" or "deref the CFA-8"?
+ // pc value "deref the CFA-4" or "deref the CFA-8"?
// If so, we have an UnwindPlan that already describes the epilogue
- // and we don't need
- // to modify it at all.
+ // and we don't need to modify it at all.
if (first_row_pc_loc.GetOffset() == -wordsize) {
do_augment_unwindplan = false;
diff --git a/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp b/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
index aa15063ac0dc..10a56980594f 100644
--- a/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
+++ b/source/Plugins/UnwindAssembly/x86/x86AssemblyInspectionEngine.cpp
@@ -246,8 +246,7 @@ void x86AssemblyInspectionEngine::Initialize(
}
// This function expects an x86 native register number (i.e. the bits stripped
-// out of the
-// actual instruction), not an lldb register number.
+// out of the actual instruction), not an lldb register number.
//
// FIXME: This is ABI dependent, it shouldn't be hardcoded here.
@@ -321,15 +320,14 @@ bool x86AssemblyInspectionEngine::push_imm_pattern_p() {
// pushl imm8(%esp)
//
-// e.g. 0xff 0x74 0x24 0x20 - 'pushl 0x20(%esp)'
-// (same byte pattern for 'pushq 0x20(%rsp)' in an x86_64 program)
+// e.g. 0xff 0x74 0x24 0x20 - 'pushl 0x20(%esp)' (same byte pattern for 'pushq
+// 0x20(%rsp)' in an x86_64 program)
//
-// 0xff (with opcode bits '6' in next byte, PUSH r/m32)
-// 0x74 (ModR/M byte with three bits used to specify the opcode)
+// 0xff (with opcode bits '6' in next byte, PUSH r/m32) 0x74 (ModR/M byte with
+// three bits used to specify the opcode)
// mod == b01, opcode == b110, R/M == b100
// "+disp8"
-// 0x24 (SIB byte - scaled index = 0, r32 == esp)
-// 0x20 imm8 value
+// 0x24 (SIB byte - scaled index = 0, r32 == esp) 0x20 imm8 value
bool x86AssemblyInspectionEngine::push_extended_pattern_p() {
if (*m_cur_insn == 0xff) {
@@ -337,9 +335,8 @@ bool x86AssemblyInspectionEngine::push_extended_pattern_p() {
uint8_t opcode = (*(m_cur_insn + 1) >> 3) & 7;
if (opcode == 6) {
// I'm only looking for 0xff /6 here - I
- // don't really care what value is being pushed,
- // just that we're pushing a 32/64 bit value on
- // to the stack is enough.
+ // don't really care what value is being pushed, just that we're pushing
+ // a 32/64 bit value on to the stack is enough.
return true;
}
}
@@ -377,8 +374,8 @@ bool x86AssemblyInspectionEngine::push_reg_p(int &regno) {
return false;
}
-// movq %rsp, %rbp [0x48 0x8b 0xec] or [0x48 0x89 0xe5]
-// movl %esp, %ebp [0x8b 0xec] or [0x89 0xe5]
+// movq %rsp, %rbp [0x48 0x8b 0xec] or [0x48 0x89 0xe5] movl %esp, %ebp [0x8b
+// 0xec] or [0x89 0xe5]
bool x86AssemblyInspectionEngine::mov_rsp_rbp_pattern_p() {
uint8_t *p = m_cur_insn;
if (m_wordsize == 8 && *p == 0x48)
@@ -529,16 +526,16 @@ bool x86AssemblyInspectionEngine::call_next_insn_pattern_p() {
(*(p + 3) == 0x0) && (*(p + 4) == 0x0);
}
-// Look for an instruction sequence storing a nonvolatile register
-// on to the stack frame.
+// Look for an instruction sequence storing a nonvolatile register on to the
+// stack frame.
// movq %rax, -0x10(%rbp) [0x48 0x89 0x45 0xf0]
// movl %eax, -0xc(%ebp) [0x89 0x45 0xf4]
-// The offset value returned in rbp_offset will be positive --
-// but it must be subtraced from the frame base register to get
-// the actual location. The positive value returned for the offset
-// is a convention used elsewhere for CFA offsets et al.
+// The offset value returned in rbp_offset will be positive -- but it must be
+// subtraced from the frame base register to get the actual location. The
+// positive value returned for the offset is a convention used elsewhere for
+// CFA offsets et al.
bool x86AssemblyInspectionEngine::mov_reg_to_local_stack_frame_p(
int &regno, int &rbp_offset) {
@@ -550,8 +547,8 @@ bool x86AssemblyInspectionEngine::mov_reg_to_local_stack_frame_p(
src_reg_prefix_bit = REX_W_SRCREG(*p) << 3;
target_reg_prefix_bit = REX_W_DSTREG(*p) << 3;
if (target_reg_prefix_bit == 1) {
- // rbp/ebp don't need a prefix bit - we know this isn't the
- // reg we care about.
+ // rbp/ebp don't need a prefix bit - we know this isn't the reg we care
+ // about.
return false;
}
p++;
@@ -671,18 +668,16 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
*newrow = *row.get();
row.reset(newrow);
- // Track which registers have been saved so far in the prologue.
- // If we see another push of that register, it's not part of the prologue.
- // The register numbers used here are the machine register #'s
- // (i386_register_numbers, x86_64_register_numbers).
+ // Track which registers have been saved so far in the prologue. If we see
+ // another push of that register, it's not part of the prologue. The register
+ // numbers used here are the machine register #'s (i386_register_numbers,
+ // x86_64_register_numbers).
std::vector<bool> saved_registers(32, false);
// Once the prologue has completed we'll save a copy of the unwind
- // instructions
- // If there is an epilogue in the middle of the function, after that epilogue
- // we'll reinstate
- // the unwind setup -- we assume that some code path jumps over the
- // mid-function epilogue
+ // instructions If there is an epilogue in the middle of the function, after
+ // that epilogue we'll reinstate the unwind setup -- we assume that some code
+ // path jumps over the mid-function epilogue
UnwindPlan::RowSP prologue_completed_row; // copy of prologue row of CFI
int prologue_completed_sp_bytes_offset_from_cfa; // The sp value before the
@@ -723,9 +718,8 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
}
// This is the start() function (or a pthread equivalent), it starts with a
- // pushl $0x0 which puts the
- // saved pc value of 0 on the stack. In this case we want to pretend we
- // didn't see a stack movement at all --
+ // pushl $0x0 which puts the saved pc value of 0 on the stack. In this
+ // case we want to pretend we didn't see a stack movement at all --
// normally the saved pc value is already on the stack by the time the
// function starts executing.
else if (push_0_pattern_p()) {
@@ -733,9 +727,9 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
else if (push_reg_p(machine_regno)) {
current_sp_bytes_offset_from_cfa += m_wordsize;
- // the PUSH instruction has moved the stack pointer - if the CFA is set in
- // terms of the stack pointer,
- // we need to add a new row of instructions.
+ // the PUSH instruction has moved the stack pointer - if the CFA is set
+ // in terms of the stack pointer, we need to add a new row of
+ // instructions.
if (row->GetCFAValue().GetRegisterNumber() == m_lldb_sp_regnum) {
row->GetCFAValue().SetOffset(current_sp_bytes_offset_from_cfa);
row_updated = true;
@@ -772,8 +766,7 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
}
// the POP instruction has moved the stack pointer - if the CFA is set in
- // terms of the stack pointer,
- // we need to add a new row of instructions.
+ // terms of the stack pointer, we need to add a new row of instructions.
if (row->GetCFAValue().GetRegisterNumber() == m_lldb_sp_regnum) {
row->GetCFAValue().SetIsRegisterPlusOffset(
m_lldb_sp_regnum, current_sp_bytes_offset_from_cfa);
@@ -790,13 +783,13 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
}
}
- // The LEAVE instruction moves the value from rbp into rsp and pops
- // a value off the stack into rbp (restoring the caller's rbp value).
- // It is the opposite of ENTER, or 'push rbp, mov rsp rbp'.
+ // The LEAVE instruction moves the value from rbp into rsp and pops a value
+ // off the stack into rbp (restoring the caller's rbp value). It is the
+ // opposite of ENTER, or 'push rbp, mov rsp rbp'.
else if (leave_pattern_p()) {
// We're going to copy the value in rbp into rsp, so re-set the sp offset
- // based on the CFAValue. Also, adjust it to recognize that we're popping
- // the saved rbp value off the stack.
+ // based on the CFAValue. Also, adjust it to recognize that we're
+ // popping the saved rbp value off the stack.
current_sp_bytes_offset_from_cfa = row->GetCFAValue().GetOffset();
current_sp_bytes_offset_from_cfa -= m_wordsize;
row->GetCFAValue().SetOffset(current_sp_bytes_offset_from_cfa);
@@ -822,12 +815,11 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
UnwindPlan::Row::RegisterLocation regloc;
- // stack_offset for 'movq %r15, -80(%rbp)' will be 80.
- // In the Row, we want to express this as the offset from the CFA. If the
- // frame base
- // is rbp (like the above instruction), the CFA offset for rbp is probably
- // 16. So we
- // want to say that the value is stored at the CFA address - 96.
+ // stack_offset for 'movq %r15, -80(%rbp)' will be 80. In the Row, we
+ // want to express this as the offset from the CFA. If the frame base is
+ // rbp (like the above instruction), the CFA offset for rbp is probably
+ // 16. So we want to say that the value is stored at the CFA address -
+ // 96.
regloc.SetAtCFAPlusOffset(
-(stack_offset + row->GetCFAValue().GetOffset()));
@@ -879,8 +871,8 @@ bool x86AssemblyInspectionEngine::GetNonCallSiteUnwindPlanFromAssembly(
}
else if (ret_pattern_p() && prologue_completed_row.get()) {
- // Reinstate the saved prologue setup for any instructions
- // that come after the ret instruction
+ // Reinstate the saved prologue setup for any instructions that come
+ // after the ret instruction
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *prologue_completed_row.get();
@@ -960,16 +952,15 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
if (!addr_start.IsValid())
return false;
- // We either need a live RegisterContext, or we need the UnwindPlan to already
- // be in the lldb register numbering scheme.
+ // We either need a live RegisterContext, or we need the UnwindPlan to
+ // already be in the lldb register numbering scheme.
if (reg_ctx.get() == nullptr &&
unwind_plan.GetRegisterKind() != eRegisterKindLLDB)
return false;
// Is original unwind_plan valid?
- // unwind_plan should have at least one row which is ABI-default (CFA register
- // is sp),
- // and another row in mid-function.
+ // unwind_plan should have at least one row which is ABI-default (CFA
+ // register is sp), and another row in mid-function.
if (unwind_plan.GetRowCount() < 2)
return false;
@@ -994,11 +985,9 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
UnwindPlan::RowSP row(new UnwindPlan::Row(*first_row));
m_cur_insn = data + offset;
- // After a mid-function epilogue we will need to re-insert the original unwind
- // rules
- // so unwinds work for the remainder of the function. These aren't common
- // with clang/gcc
- // on x86 but it is possible.
+ // After a mid-function epilogue we will need to re-insert the original
+ // unwind rules so unwinds work for the remainder of the function. These
+ // aren't common with clang/gcc on x86 but it is possible.
bool reinstate_unwind_state = false;
while (offset < size) {
@@ -1015,8 +1004,7 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
offset += insn_len;
m_cur_insn = data + offset;
- // offset is pointing beyond the bounds of the
- // function; stop looping.
+ // offset is pointing beyond the bounds of the function; stop looping.
if (offset >= size)
continue;
@@ -1044,9 +1032,8 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
}
if (row_id == 0) {
- // If we are here, compiler didn't generate CFI for prologue.
- // This won't happen to GCC or clang.
- // In this case, bail out directly.
+ // If we are here, compiler didn't generate CFI for prologue. This won't
+ // happen to GCC or clang. In this case, bail out directly.
return false;
}
@@ -1086,10 +1073,9 @@ bool x86AssemblyInspectionEngine::AugmentUnwindPlanFromCallSite(
}
if (pop_reg_p(regno)) {
// Technically, this might be a nonvolatile register recover in
- // epilogue.
- // We should reset RegisterInfo for the register.
- // But in practice, previous rule for the register is still valid...
- // So we ignore this case.
+ // epilogue. We should reset RegisterInfo for the register. But in
+ // practice, previous rule for the register is still valid... So we
+ // ignore this case.
row->SetOffset(offset);
row->GetCFAValue().IncOffset(-m_wordsize);
diff --git a/source/Symbol/ArmUnwindInfo.cpp b/source/Symbol/ArmUnwindInfo.cpp
index 4da307bf0c32..6dcad62f2f9d 100644
--- a/source/Symbol/ArmUnwindInfo.cpp
+++ b/source/Symbol/ArmUnwindInfo.cpp
@@ -65,17 +65,16 @@ ArmUnwindInfo::ArmUnwindInfo(ObjectFile &objfile, SectionSP &arm_exidx,
}
// Sort the entries in the exidx section. The entries should be sorted inside
- // the section but
- // some old compiler isn't sorted them.
+ // the section but some old compiler isn't sorted them.
std::sort(m_exidx_entries.begin(), m_exidx_entries.end());
}
ArmUnwindInfo::~ArmUnwindInfo() {}
-// Read a byte from the unwind instruction stream with the given offset.
-// Custom function is required because have to red in order of significance
-// within their containing
-// word (most significant byte first) and in increasing word address order.
+// Read a byte from the unwind instruction stream with the given offset. Custom
+// function is required because have to red in order of significance within
+// their containing word (most significant byte first) and in increasing word
+// address order.
uint8_t ArmUnwindInfo::GetByteAtOffset(const uint32_t *data,
uint16_t offset) const {
uint32_t value = data[offset / 4];
@@ -276,8 +275,8 @@ bool ArmUnwindInfo::GetUnwindPlan(Target &target, const Address &addr,
return false;
} else if ((byte1 & 0xff) == 0xc8) {
// 11001000 sssscccc
- // Pop VFP double precision registers D[16+ssss]-D[16+ssss+cccc] saved (as
- // if) by FSTMFDD (see remarks d,e)
+ // Pop VFP double precision registers D[16+ssss]-D[16+ssss+cccc] saved
+ // (as if) by FSTMFDD (see remarks d,e)
if (byte_offset >= byte_count)
return false;
diff --git a/source/Symbol/Block.cpp b/source/Symbol/Block.cpp
index 648d8ee48bf5..46f875fca776 100644
--- a/source/Symbol/Block.cpp
+++ b/source/Symbol/Block.cpp
@@ -60,8 +60,7 @@ void Block::Dump(Stream *s, addr_t base_addr, int32_t depth,
if (depth < 0) {
Block *parent = GetParent();
if (parent) {
- // We have a depth that is less than zero, print our parent blocks
- // first
+ // We have a depth that is less than zero, print our parent blocks first
parent->Dump(s, base_addr, depth + 1, show_context);
}
}
diff --git a/source/Symbol/CMakeLists.txt b/source/Symbol/CMakeLists.txt
index 69a2b5a1699c..6f8a8cb9f9f2 100644
--- a/source/Symbol/CMakeLists.txt
+++ b/source/Symbol/CMakeLists.txt
@@ -50,7 +50,6 @@ add_lldb_library(lldbSymbol
lldbPluginExpressionParserGo
lldbPluginSymbolFileDWARF
lldbPluginSymbolFilePDB
- lldbPluginObjectContainerBSDArchive
lldbPluginCPlusPlusLanguage
lldbPluginObjCLanguage
diff --git a/source/Symbol/ClangASTContext.cpp b/source/Symbol/ClangASTContext.cpp
index 673124cc0de5..95e7f8a68d44 100644
--- a/source/Symbol/ClangASTContext.cpp
+++ b/source/Symbol/ClangASTContext.cpp
@@ -138,8 +138,8 @@ static ClangASTMap &GetASTMap() {
return *g_map_ptr;
}
-static bool IsOperator(const char *name,
- clang::OverloadedOperatorKind &op_kind) {
+bool ClangASTContext::IsOperator(const char *name,
+ clang::OverloadedOperatorKind &op_kind) {
if (name == nullptr || name[0] == '\0')
return false;
@@ -163,8 +163,8 @@ static bool IsOperator(const char *name,
#undef OPERATOR_PREFIX
#undef OPERATOR_PREFIX_LENGTH
- // This is an operator, set the overloaded operator kind to invalid
- // in case this is a conversion operator...
+ // This is an operator, set the overloaded operator kind to invalid in case
+ // this is a conversion operator...
op_kind = clang::NUM_OVERLOADED_OPERATORS;
switch (post_op_name[0]) {
@@ -375,9 +375,9 @@ ClangASTContext::ConvertAccessTypeToAccessSpecifier(AccessType access) {
static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
// FIXME: Cleanup per-file based stuff.
- // Set some properties which depend solely on the input kind; it would be nice
- // to move these to the language standard, and have the driver resolve the
- // input kind + language standard.
+ // Set some properties which depend solely on the input kind; it would be
+ // nice to move these to the language standard, and have the driver resolve
+ // the input kind + language standard.
if (IK.getLanguage() == InputKind::Asm) {
Opts.AsmPreprocessor = 1;
} else if (IK.isObjectiveC()) {
@@ -408,6 +408,9 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
case InputKind::ObjCXX:
LangStd = LangStandard::lang_gnucxx98;
break;
+ case InputKind::HIP:
+ LangStd = LangStandard::lang_hip;
+ break;
}
}
@@ -437,8 +440,8 @@ static void ParseLangArgs(LangOptions &Opts, InputKind IK, const char *triple) {
Opts.setValueVisibilityMode(DefaultVisibility);
- // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs
- // is specified, or -std is set to a conforming mode.
+ // Mimicing gcc's behavior, trigraphs are only enabled if -trigraphs is
+ // specified, or -std is set to a conforming mode.
Opts.Trigraphs = !Opts.GNUMode;
Opts.CharIsSigned = ArchSpec(triple).CharIsSignedByDefault();
Opts.OptimizeSize = 0;
@@ -659,8 +662,8 @@ ASTContext *ClangASTContext::getASTContext() {
m_ast_ap->getDiagnostics().setClient(getDiagnosticConsumer(), false);
// This can be NULL if we don't know anything about the architecture or if
- // the
- // target for an architecture isn't enabled in the llvm/clang that we built
+ // the target for an architecture isn't enabled in the llvm/clang that we
+ // built
TargetInfo *target_info = getTargetInfo();
if (target_info)
m_ast_ap->InitBuiltinTypes(*target_info);
@@ -1251,8 +1254,8 @@ CompilerType ClangASTContext::GetTypeForDecl(clang::NamedDecl *decl) {
}
CompilerType ClangASTContext::GetTypeForDecl(TagDecl *decl) {
- // No need to call the getASTContext() accessor (which can create the AST
- // if it isn't created yet, because we can't have created a decl in this
+ // No need to call the getASTContext() accessor (which can create the AST if
+ // it isn't created yet, because we can't have created a decl in this
// AST if our AST didn't already exist...
ASTContext *ast = &decl->getASTContext();
if (ast)
@@ -1261,8 +1264,8 @@ CompilerType ClangASTContext::GetTypeForDecl(TagDecl *decl) {
}
CompilerType ClangASTContext::GetTypeForDecl(ObjCInterfaceDecl *decl) {
- // No need to call the getASTContext() accessor (which can create the AST
- // if it isn't created yet, because we can't have created a decl in this
+ // No need to call the getASTContext() accessor (which can create the AST if
+ // it isn't created yet, because we can't have created a decl in this
// AST if our AST didn't already exist...
ASTContext *ast = &decl->getASTContext();
if (ast)
@@ -1291,9 +1294,9 @@ CompilerType ClangASTContext::CreateRecordType(DeclContext *decl_ctx,
}
// NOTE: Eventually CXXRecordDecl will be merged back into RecordDecl and
- // we will need to update this code. I was told to currently always use
- // the CXXRecordDecl class since we often don't know from debug information
- // if something is struct or a class, so we default to always use the more
+ // we will need to update this code. I was told to currently always use the
+ // CXXRecordDecl class since we often don't know from debug information if
+ // something is struct or a class, so we default to always use the more
// complete definition just in case.
bool is_anonymous = (!name) || (!name[0]);
@@ -1388,7 +1391,7 @@ static TemplateParameterList *CreateTemplateParameterList(
clang::FunctionTemplateDecl *ClangASTContext::CreateFunctionTemplateDecl(
clang::DeclContext *decl_ctx, clang::FunctionDecl *func_decl,
const char *name, const TemplateParameterInfos &template_param_infos) {
- // /// \brief Create a function template node.
+ // /// Create a function template node.
ASTContext *ast = getASTContext();
llvm::SmallVector<NamedDecl *, 8> template_param_decls;
@@ -1482,6 +1485,29 @@ ClassTemplateDecl *ClangASTContext::CreateClassTemplateDecl(
return class_template_decl;
}
+TemplateTemplateParmDecl *
+ClangASTContext::CreateTemplateTemplateParmDecl(const char *template_name) {
+ ASTContext *ast = getASTContext();
+
+ auto *decl_ctx = ast->getTranslationUnitDecl();
+
+ IdentifierInfo &identifier_info = ast->Idents.get(template_name);
+ llvm::SmallVector<NamedDecl *, 8> template_param_decls;
+
+ ClangASTContext::TemplateParameterInfos template_param_infos;
+ TemplateParameterList *template_param_list = CreateTemplateParameterList(
+ ast, template_param_infos, template_param_decls);
+
+ // LLDB needs to create those decls only to be able to display a
+ // type that includes a template template argument. Only the name matters for
+ // this purpose, so we use dummy values for the other characterisitcs of the
+ // type.
+ return TemplateTemplateParmDecl::Create(
+ *ast, decl_ctx, SourceLocation(),
+ /*Depth*/ 0, /*Position*/ 0,
+ /*IsParameterPack*/ false, &identifier_info, template_param_list);
+}
+
ClassTemplateSpecializationDecl *
ClangASTContext::CreateClassTemplateSpecializationDecl(
DeclContext *decl_ctx, ClassTemplateDecl *class_template_decl, int kind,
@@ -1623,7 +1649,7 @@ bool ClangASTContext::RecordHasFields(const RecordDecl *record_decl) {
return false;
}
-#pragma mark Objective C Classes
+#pragma mark Objective-C Classes
CompilerType ClangASTContext::CreateObjCClass(const char *name,
DeclContext *decl_ctx,
@@ -1907,11 +1933,10 @@ ClangASTContext::GetDeclarationName(const char *name,
return DeclarationName(&getASTContext()->Idents.get(
name)); // Not operator, but a regular function.
- // Check the number of operator parameters. Sometimes we have
- // seen bad DWARF that doesn't correctly describe operators and
- // if we try to create a method and add it to the class, clang
- // will assert and crash, so we need to make sure things are
- // acceptable.
+ // Check the number of operator parameters. Sometimes we have seen bad DWARF
+ // that doesn't correctly describe operators and if we try to create a method
+ // and add it to the class, clang will assert and crash, so we need to make
+ // sure things are acceptable.
clang::QualType method_qual_type(ClangUtil::GetQualType(function_clang_type));
const clang::FunctionProtoType *function_type =
llvm::dyn_cast<clang::FunctionProtoType>(method_qual_type.getTypePtr());
@@ -2121,51 +2146,6 @@ ClangASTContext::CreateEnumerationType(const char *name, DeclContext *decl_ctx,
return CompilerType();
}
-// Disable this for now since I can't seem to get a nicely formatted float
-// out of the APFloat class without just getting the float, double or quad
-// and then using a formatted print on it which defeats the purpose. We ideally
-// would like to get perfect string values for any kind of float semantics
-// so we can support remote targets. The code below also requires a patch to
-// llvm::APInt.
-// bool
-// ClangASTContext::ConvertFloatValueToString (ASTContext *ast,
-// lldb::opaque_compiler_type_t clang_type, const uint8_t* bytes, size_t
-// byte_size, int apint_byte_order, std::string &float_str)
-//{
-// uint32_t count = 0;
-// bool is_complex = false;
-// if (ClangASTContext::IsFloatingPointType (clang_type, count, is_complex))
-// {
-// unsigned num_bytes_per_float = byte_size / count;
-// unsigned num_bits_per_float = num_bytes_per_float * 8;
-//
-// float_str.clear();
-// uint32_t i;
-// for (i=0; i<count; i++)
-// {
-// APInt ap_int(num_bits_per_float, bytes + i * num_bytes_per_float,
-// (APInt::ByteOrder)apint_byte_order);
-// bool is_ieee = false;
-// APFloat ap_float(ap_int, is_ieee);
-// char s[1024];
-// unsigned int hex_digits = 0;
-// bool upper_case = false;
-//
-// if (ap_float.convertToHexString(s, hex_digits, upper_case,
-// APFloat::rmNearestTiesToEven) > 0)
-// {
-// if (i > 0)
-// float_str.append(", ");
-// float_str.append(s);
-// if (i == 1 && is_complex)
-// float_str.append(1, 'i');
-// }
-// }
-// return !float_str.empty();
-// }
-// return false;
-//}
-
CompilerType ClangASTContext::GetIntTypeFromBitSize(clang::ASTContext *ast,
size_t bit_size,
bool is_signed) {
@@ -2266,8 +2246,8 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl,
if (lhs_decl_kind == rhs_decl_kind) {
//------------------------------------------------------------------
- // Now check that the decl contexts kinds are all equivalent
- // before we have to check any names of the decl contexts...
+ // Now check that the decl contexts kinds are all equivalent before we
+ // have to check any names of the decl contexts...
//------------------------------------------------------------------
clang::DeclContext *lhs_decl_ctx = lhs_decl->getDeclContext();
clang::DeclContext *rhs_decl_ctx = rhs_decl->getDeclContext();
@@ -2309,8 +2289,8 @@ bool ClangASTContext::DeclsAreEquivalent(clang::Decl *lhs_decl,
return false;
//--------------------------------------------------------------
- // We know that the decl context kinds all match, so now we need
- // to make sure the names match as well
+ // We know that the decl context kinds all match, so now we need to
+ // make sure the names match as well
//--------------------------------------------------------------
lhs_decl_ctx = lhs_decl->getDeclContext();
rhs_decl_ctx = rhs_decl->getDeclContext();
@@ -2580,8 +2560,7 @@ static bool GetCompleteQualType(clang::ASTContext *ast,
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (class_interface_decl->getDefinition())
return true;
@@ -2901,8 +2880,8 @@ bool ClangASTContext::IsCStringType(lldb::opaque_compiler_type_t type,
if (type_flags.AnySet(eTypeIsArray | eTypeIsPointer)) {
if (pointee_or_element_clang_type.IsCharType()) {
if (type_flags.Test(eTypeIsArray)) {
- // We know the size of the array and it could be a C string
- // since it is an array of characters
+ // We know the size of the array and it could be a C string since it is
+ // an array of characters
length = llvm::cast<clang::ConstantArrayType>(
GetCanonicalQualType(type).getTypePtr())
->getSize()
@@ -3642,9 +3621,8 @@ bool ClangASTContext::IsPossibleDynamicType(lldb::opaque_compiler_type_t type,
if (success) {
// Check to make sure what we are pointing too is a possible dynamic C++
- // type
- // We currently accept any "void *" (in case we have a class that has been
- // watered down to an opaque pointer) and virtual C++ classes.
+ // type We currently accept any "void *" (in case we have a class that
+ // has been watered down to an opaque pointer) and virtual C++ classes.
const clang::Type::TypeClass pointee_type_class =
pointee_qual_type.getCanonicalType()->getTypeClass();
switch (pointee_type_class) {
@@ -3964,7 +3942,10 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type,
case clang::Type::DependentTemplateSpecialization:
return eTypeIsTemplate;
case clang::Type::Decltype:
- return 0;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::Enum:
if (pointee_or_element_clang_type)
@@ -4046,9 +4027,16 @@ ClangASTContext::GetTypeInfo(lldb::opaque_compiler_type_t type,
->getUnderlyingType())
.GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::TypeOfExpr:
- return 0;
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::TypeOf:
- return 0;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeInfo(pointee_or_element_clang_type);
case clang::Type::UnresolvedUsing:
return 0;
@@ -4178,6 +4166,8 @@ ClangASTContext::GetTypeClass(lldb::opaque_compiler_type_t type) {
return lldb::eTypeClassArray;
case clang::Type::DependentSizedExtVector:
return lldb::eTypeClassVector;
+ case clang::Type::DependentVector:
+ return lldb::eTypeClassVector;
case clang::Type::ExtVector:
return lldb::eTypeClassVector;
case clang::Type::Vector:
@@ -4255,11 +4245,21 @@ ClangASTContext::GetTypeClass(lldb::opaque_compiler_type_t type) {
break;
case clang::Type::TypeOfExpr:
- break;
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetTypeClass();
case clang::Type::TypeOf:
- break;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeClass();
case clang::Type::Decltype:
- break;
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetTypeClass();
case clang::Type::TemplateSpecialization:
break;
case clang::Type::DeducedTemplateSpecialization:
@@ -4776,9 +4776,8 @@ ClangASTContext::CreateTypedef(lldb::opaque_compiler_type_t type,
}
// Check whether this declaration is an anonymous struct, union, or enum,
- // hidden behind a typedef. If so, we
- // try to check whether we have a typedef tag to attach to the original
- // record declaration
+ // hidden behind a typedef. If so, we try to check whether we have a
+ // typedef tag to attach to the original record declaration
if (tdecl && !tdecl->getIdentifier() && !tdecl->getTypedefNameForAnonDecl())
tdecl->setTypedefNameForAnonDecl(decl);
@@ -4903,6 +4902,7 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::ConstantArray:
break;
+ case clang::Type::DependentVector:
case clang::Type::ExtVector:
case clang::Type::Vector:
// TODO: Set this to more than one???
@@ -4917,8 +4917,6 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::Char_S:
case clang::BuiltinType::SChar:
case clang::BuiltinType::WChar_S:
- case clang::BuiltinType::Char16:
- case clang::BuiltinType::Char32:
case clang::BuiltinType::Short:
case clang::BuiltinType::Int:
case clang::BuiltinType::Long:
@@ -4929,6 +4927,9 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::Char_U:
case clang::BuiltinType::UChar:
case clang::BuiltinType::WChar_U:
+ case clang::BuiltinType::Char8:
+ case clang::BuiltinType::Char16:
+ case clang::BuiltinType::Char32:
case clang::BuiltinType::UShort:
case clang::BuiltinType::UInt:
case clang::BuiltinType::ULong:
@@ -4936,6 +4937,33 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::BuiltinType::UInt128:
return lldb::eEncodingUint;
+ // Fixed point types. Note that they are currently ignored.
+ case clang::BuiltinType::ShortAccum:
+ case clang::BuiltinType::Accum:
+ case clang::BuiltinType::LongAccum:
+ case clang::BuiltinType::UShortAccum:
+ case clang::BuiltinType::UAccum:
+ case clang::BuiltinType::ULongAccum:
+ case clang::BuiltinType::ShortFract:
+ case clang::BuiltinType::Fract:
+ case clang::BuiltinType::LongFract:
+ case clang::BuiltinType::UShortFract:
+ case clang::BuiltinType::UFract:
+ case clang::BuiltinType::ULongFract:
+ case clang::BuiltinType::SatShortAccum:
+ case clang::BuiltinType::SatAccum:
+ case clang::BuiltinType::SatLongAccum:
+ case clang::BuiltinType::SatUShortAccum:
+ case clang::BuiltinType::SatUAccum:
+ case clang::BuiltinType::SatULongAccum:
+ case clang::BuiltinType::SatShortFract:
+ case clang::BuiltinType::SatFract:
+ case clang::BuiltinType::SatLongFract:
+ case clang::BuiltinType::SatUShortFract:
+ case clang::BuiltinType::SatUFract:
+ case clang::BuiltinType::SatULongFract:
+ break;
+
case clang::BuiltinType::Half:
case clang::BuiltinType::Float:
case clang::BuiltinType::Float16:
@@ -5004,9 +5032,8 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
break;
}
break;
- // All pointer types are represented as unsigned integer encodings.
- // We may nee to add a eEncodingPointer if we ever need to know the
- // difference
+ // All pointer types are represented as unsigned integer encodings. We may
+ // nee to add a eEncodingPointer if we ever need to know the difference
case clang::Type::ObjCObjectPointer:
case clang::Type::BlockPointer:
case clang::Type::Pointer:
@@ -5060,7 +5087,22 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
return CompilerType(getASTContext(),
llvm::cast<clang::ParenType>(qual_type)->desugar())
.GetEncoding(count);
-
+ case clang::Type::TypeOfExpr:
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetEncoding(count);
+ case clang::Type::TypeOf:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetEncoding(count);
+ case clang::Type::Decltype:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetEncoding(count);
case clang::Type::DependentSizedArray:
case clang::Type::DependentSizedExtVector:
case clang::Type::UnresolvedUsing:
@@ -5074,9 +5116,6 @@ lldb::Encoding ClangASTContext::GetEncoding(lldb::opaque_compiler_type_t type,
case clang::Type::PackExpansion:
case clang::Type::ObjCObject:
- case clang::Type::TypeOfExpr:
- case clang::Type::TypeOf:
- case clang::Type::Decltype:
case clang::Type::TemplateSpecialization:
case clang::Type::DeducedTemplateSpecialization:
case clang::Type::Atomic:
@@ -5118,6 +5157,7 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
case clang::Type::ConstantArray:
return lldb::eFormatVoid; // no value
+ case clang::Type::DependentVector:
case clang::Type::ExtVector:
case clang::Type::Vector:
break;
@@ -5214,6 +5254,22 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
getASTContext(),
llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType())
.GetFormat();
+ case clang::Type::TypeOfExpr:
+ return CompilerType(getASTContext(),
+ llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType())
+ .GetFormat();
+ case clang::Type::TypeOf:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType())
+ .GetFormat();
+ case clang::Type::Decltype:
+ return CompilerType(
+ getASTContext(),
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType())
+ .GetFormat();
case clang::Type::DependentSizedArray:
case clang::Type::DependentSizedExtVector:
case clang::Type::UnresolvedUsing:
@@ -5227,9 +5283,6 @@ lldb::Format ClangASTContext::GetFormat(lldb::opaque_compiler_type_t type) {
case clang::Type::PackExpansion:
case clang::Type::ObjCObject:
- case clang::Type::TypeOfExpr:
- case clang::Type::TypeOf:
- case clang::Type::Decltype:
case clang::Type::TemplateSpecialization:
case clang::Type::DeducedTemplateSpecialization:
case clang::Type::Atomic:
@@ -5298,10 +5351,9 @@ uint32_t ClangASTContext::GetNumChildren(lldb::opaque_compiler_type_t type,
llvm::dyn_cast<clang::CXXRecordDecl>(record_decl);
if (cxx_record_decl) {
if (omit_empty_base_classes) {
- // Check each base classes to see if it or any of its
- // base classes contain any fields. This can help
- // limit the noise in variable views by not having to
- // show base classes that contain no members.
+ // Check each base classes to see if it or any of its base classes
+ // contain any fields. This can help limit the noise in variable
+ // views by not having to show base classes that contain no members.
clang::CXXRecordDecl::base_class_const_iterator base_class,
base_class_end;
for (base_class = cxx_record_decl->bases_begin(),
@@ -5394,8 +5446,8 @@ uint32_t ClangASTContext::GetNumChildren(lldb::opaque_compiler_type_t type,
CompilerType(getASTContext(), pointee_type)
.GetNumChildren(omit_empty_base_classes);
if (num_pointee_children == 0) {
- // We have a pointer to a pointee type that claims it has no children.
- // We will want to look at
+ // We have a pointer to a pointee type that claims it has no children. We
+ // will want to look at
num_children = GetNumPointeeChildren(pointee_type);
} else
num_children = num_pointee_children;
@@ -6264,11 +6316,15 @@ uint32_t ClangASTContext::GetNumPointeeChildren(clang::QualType type) {
return GetNumPointeeChildren(
llvm::cast<clang::ElaboratedType>(qual_type)->getNamedType());
case clang::Type::TypeOfExpr:
- return 0;
+ return GetNumPointeeChildren(llvm::cast<clang::TypeOfExprType>(qual_type)
+ ->getUnderlyingExpr()
+ ->getType());
case clang::Type::TypeOf:
- return 0;
+ return GetNumPointeeChildren(
+ llvm::cast<clang::TypeOfType>(qual_type)->getUnderlyingType());
case clang::Type::Decltype:
- return 0;
+ return GetNumPointeeChildren(
+ llvm::cast<clang::DecltypeType>(qual_type)->getUnderlyingType());
case clang::Type::Record:
return 0;
case clang::Type::Enum:
@@ -6585,15 +6641,12 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
child_byte_size = ivar_type_info.Width / 8;
// Figure out the field offset within the current
- // struct/union/class type
- // For ObjC objects, we can't trust the bit offset we get from
- // the Clang AST, since
- // that doesn't account for the space taken up by unbacked
- // properties, or from
- // the changing size of base classes that are newer than this
- // class.
- // So if we have a process around that we can ask about this
- // object, do so.
+ // struct/union/class type For ObjC objects, we can't trust the
+ // bit offset we get from the Clang AST, since that doesn't
+ // account for the space taken up by unbacked properties, or
+ // from the changing size of base classes that are newer than
+ // this class. So if we have a process around that we can ask
+ // about this object, do so.
child_byte_offset = LLDB_INVALID_IVAR_OFFSET;
Process *process = nullptr;
if (exe_ctx)
@@ -6621,9 +6674,8 @@ CompilerType ClangASTContext::GetChildCompilerTypeAtIndex(
}
// Note, the ObjC Ivar Byte offset is just that, it doesn't
- // account for the bit offset
- // of a bitfield within its containing object. So regardless of
- // where we get the byte
+ // account for the bit offset of a bitfield within its
+ // containing object. So regardless of where we get the byte
// offset from, we still need to get the bit offset for
// bitfields from the layout.
@@ -6895,8 +6947,8 @@ static uint32_t GetIndexForRecordChild(const clang::RecordDecl *record_decl,
}
// Look for a child member (doesn't include base classes, but it does include
-// their members) in the type hierarchy. Returns an index path into "clang_type"
-// on how to reach the appropriate member.
+// their members) in the type hierarchy. Returns an index path into
+// "clang_type" on how to reach the appropriate member.
//
// class A
// {
@@ -6919,16 +6971,13 @@ static uint32_t GetIndexForRecordChild(const clang::RecordDecl *record_decl,
// "m_b" in it:
//
// With omit_empty_base_classes == false we would get an integer array back
-// with:
-// { 1, 1 }
-// The first index 1 is the child index for "class A" within class C
-// The second index 1 is the child index for "m_b" within class A
+// with: { 1, 1 } The first index 1 is the child index for "class A" within
+// class C The second index 1 is the child index for "m_b" within class A
//
-// With omit_empty_base_classes == true we would get an integer array back with:
-// { 0, 1 }
-// The first index 0 is the child index for "class A" within class C (since
-// class B doesn't have any members it doesn't count)
-// The second index 1 is the child index for "m_b" within class A
+// With omit_empty_base_classes == true we would get an integer array back
+// with: { 0, 1 } The first index 0 is the child index for "class A" within
+// class C (since class B doesn't have any members it doesn't count) The second
+// index 1 is the child index for "m_b" within class A
size_t ClangASTContext::GetIndexOfChildMemberWithName(
lldb::opaque_compiler_type_t type, const char *name,
@@ -7063,9 +7112,9 @@ size_t ClangASTContext::GetIndexOfChildMemberWithName(
}
if (superclass_interface_decl) {
- // The super class index is always zero for ObjC classes,
- // so we push it onto the child indexes in case we find
- // an ivar in our superclass...
+ // The super class index is always zero for ObjC classes, so we
+ // push it onto the child indexes in case we find an ivar in our
+ // superclass...
child_indexes.push_back(0);
CompilerType superclass_clang_type(
@@ -7073,14 +7122,13 @@ size_t ClangASTContext::GetIndexOfChildMemberWithName(
superclass_interface_decl));
if (superclass_clang_type.GetIndexOfChildMemberWithName(
name, omit_empty_base_classes, child_indexes)) {
- // We did find an ivar in a superclass so just
- // return the results!
+ // We did find an ivar in a superclass so just return the
+ // results!
return child_indexes.size();
}
- // We didn't find an ivar matching "name" in our
- // superclass, pop the superclass zero index that
- // we pushed on above.
+ // We didn't find an ivar matching "name" in our superclass, pop
+ // the superclass zero index that we pushed on above.
child_indexes.pop_back();
}
}
@@ -7673,8 +7721,8 @@ clang::FieldDecl *ClangASTContext::AddFieldToRecordType(
clang::ICIS_NoInit); // HasInit
if (!name) {
- // Determine whether this field corresponds to an anonymous
- // struct or union.
+ // Determine whether this field corresponds to an anonymous struct or
+ // union.
if (const clang::TagType *TagT =
field->getType()->getAs<clang::TagType>()) {
if (clang::RecordDecl *Rec =
@@ -7818,8 +7866,8 @@ void ClangASTContext::BuildIndirectFields(const CompilerType &type) {
}
}
- // Check the last field to see if it has an incomplete array type as its
- // last member and if it does, the tell the record decl about it
+ // Check the last field to see if it has an incomplete array type as its last
+ // member and if it does, the tell the record decl about it
if (last_field_pos != field_end_pos) {
if (last_field_pos->getType()->isIncompleteArrayType())
record_decl->hasFlexibleArrayMember();
@@ -7885,7 +7933,7 @@ clang::VarDecl *ClangASTContext::AddVariableToRecordType(
}
clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
- lldb::opaque_compiler_type_t type, const char *name,
+ lldb::opaque_compiler_type_t type, const char *name, const char *mangled_name,
const CompilerType &method_clang_type, lldb::AccessType access,
bool is_virtual, bool is_static, bool is_inline, bool is_explicit,
bool is_attr_used, bool is_artificial) {
@@ -7953,11 +8001,10 @@ clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
if (IsOperator(name, op_kind)) {
if (op_kind != clang::NUM_OVERLOADED_OPERATORS) {
- // Check the number of operator parameters. Sometimes we have
- // seen bad DWARF that doesn't correctly describe operators and
- // if we try to create a method and add it to the class, clang
- // will assert and crash, so we need to make sure things are
- // acceptable.
+ // Check the number of operator parameters. Sometimes we have seen bad
+ // DWARF that doesn't correctly describe operators and if we try to
+ // create a method and add it to the class, clang will assert and
+ // crash, so we need to make sure things are acceptable.
const bool is_method = true;
if (!ClangASTContext::CheckOverloadedOperatorKindParameterCount(
is_method, op_kind, num_params))
@@ -8005,6 +8052,11 @@ clang::CXXMethodDecl *ClangASTContext::AddMethodToCXXRecordType(
if (is_attr_used)
cxx_method_decl->addAttr(clang::UsedAttr::CreateImplicit(*getASTContext()));
+ if (mangled_name != NULL) {
+ cxx_method_decl->addAttr(
+ clang::AsmLabelAttr::CreateImplicit(*getASTContext(), mangled_name));
+ }
+
// Populate the method decl with parameter decls
llvm::SmallVector<clang::ParmVarDecl *, 12> params;
@@ -8632,8 +8684,8 @@ bool ClangASTContext::CompleteTagDeclarationDefinition(
clang::QualType qual_type(ClangUtil::GetQualType(type));
if (!qual_type.isNull()) {
// Make sure we use the same methodology as
- // ClangASTContext::StartTagDeclarationDefinition()
- // as to how we start/end the definition. Previously we were calling
+ // ClangASTContext::StartTagDeclarationDefinition() as to how we start/end
+ // the definition. Previously we were calling
const clang::TagType *tag_type = qual_type->getAs<clang::TagType>();
if (tag_type) {
clang::TagDecl *tag_decl = tag_type->getDecl();
@@ -8903,9 +8955,8 @@ void ClangASTContext::DumpValue(
for (field = record_decl->field_begin(),
field_end = record_decl->field_end();
field != field_end; ++field, ++field_idx, ++child_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comma (for member 2 and beyond) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comma (for member 2 and beyond) for the struct/union/class member.
if (child_idx == 0)
s->PutChar('{');
else
@@ -8916,8 +8967,8 @@ void ClangASTContext::DumpValue(
clang::QualType field_type = field->getType();
// Print the member type if requested
- // Figure out the type byte size (field_type_info.first) and
- // alignment (field_type_info.second) from the AST context.
+ // Figure out the type byte size (field_type_info.first) and alignment
+ // (field_type_info.second) from the AST context.
clang::TypeInfo field_type_info =
getASTContext()->getTypeInfo(field_type);
assert(field_idx < record_layout.getFieldCount());
@@ -8988,8 +9039,8 @@ void ClangASTContext::DumpValue(
return;
}
}
- // If we have gotten here we didn't get find the enumerator in the
- // enum decl, so just print the integer.
+ // If we have gotten here we didn't get find the enumerator in the enum
+ // decl, so just print the integer.
s->Printf("%" PRIi64, enum_value);
}
return;
@@ -9027,9 +9078,8 @@ void ClangASTContext::DumpValue(
lldb::Format element_format = element_clang_type.GetFormat();
for (element_idx = 0; element_idx < element_count; ++element_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comman (for member 2 and beyong) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comman (for member 2 and beyong) for the struct/union/class member.
if (element_idx == 0)
s->PutChar('{');
else
@@ -9225,8 +9275,8 @@ bool ClangASTContext::DumpTypeValue(
} break;
case clang::Type::Enum:
- // If our format is enum or default, show the enumeration value as
- // its enumeration string value, else just display it as requested.
+ // If our format is enum or default, show the enumeration value as its
+ // enumeration string value, else just display it as requested.
if ((format == eFormatEnum || format == eFormatDefault) &&
GetCompleteType(type)) {
const clang::EnumType *enutype =
@@ -9518,9 +9568,9 @@ void ClangASTContext::DumpTypeName(const CompilerType &type) {
if (objc_class_type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
- // We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // 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)
printf("@class %s", class_interface_decl->getName().str().c_str());
}
@@ -9778,15 +9828,12 @@ std::vector<CompilerDecl> ClangASTContext::DeclContextFindDeclByName(
// Look for child_decl_ctx's lookup scope in frame_decl_ctx and its parents,
// and return the number of levels it took to find it, or
-// LLDB_INVALID_DECL_LEVEL
-// if not found. If the decl was imported via a using declaration, its name
-// and/or
-// type, if set, will be used to check that the decl found in the scope is a
-// match.
+// LLDB_INVALID_DECL_LEVEL if not found. If the decl was imported via a using
+// declaration, its name and/or type, if set, will be used to check that the
+// decl found in the scope is a match.
//
// The optional name is required by languages (like C++) to handle using
-// declarations
-// like:
+// declarations like:
//
// void poo();
// namespace ns {
@@ -9815,14 +9862,10 @@ std::vector<CompilerDecl> ClangASTContext::DeclContextFindDeclByName(
//
// NOTE: Because file statics are at the TranslationUnit along with globals, a
// function at file scope will return the same level as a function at global
-// scope.
-// Ideally we'd like to treat the file scope as an additional scope just below
-// the
-// global scope. More work needs to be done to recognise that, if the decl
-// we're
-// trying to look up is static, we should compare its source file with that of
-// the
-// current scope and return a lower number for it.
+// scope. Ideally we'd like to treat the file scope as an additional scope just
+// below the global scope. More work needs to be done to recognise that, if
+// the decl we're trying to look up is static, we should compare its source
+// file with that of the current scope and return a lower number for it.
uint32_t ClangASTContext::CountDeclLevels(clang::DeclContext *frame_decl_ctx,
clang::DeclContext *child_decl_ctx,
ConstString *child_name,
@@ -9851,10 +9894,8 @@ uint32_t ClangASTContext::CountDeclLevels(clang::DeclContext *frame_decl_ctx,
continue;
// Currently DWARF has one shared translation unit for all Decls at top
- // level, so this
- // would erroneously find using statements anywhere. So don't look at
- // the top-level
- // translation unit.
+ // level, so this would erroneously find using statements anywhere. So
+ // don't look at the top-level translation unit.
// TODO fix this and add a testcase that depends on it.
if (llvm::isa<clang::TranslationUnitDecl>(it->second))
@@ -10086,4 +10127,3 @@ ClangASTContextForExpressions::GetMergerUnchecked() {
lldbassert(m_scratch_ast_source_ap != nullptr);
return m_scratch_ast_source_ap->GetMergerUnchecked();
}
-
diff --git a/source/Symbol/ClangASTImporter.cpp b/source/Symbol/ClangASTImporter.cpp
index 72ccaed43eaa..ea3b141c9e74 100644
--- a/source/Symbol/ClangASTImporter.cpp
+++ b/source/Symbol/ClangASTImporter.cpp
@@ -354,8 +354,7 @@ bool ClangASTImporter::CanImport(const CompilerType &type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
return true;
@@ -431,8 +430,7 @@ bool ClangASTImporter::Import(const CompilerType &type) {
clang::ObjCInterfaceDecl *class_interface_decl =
objc_class_type->getInterface();
// We currently can't complete objective C types through the newly added
- // ASTContext
- // because it only supports TagDecl objects right now...
+ // ASTContext because it only supports TagDecl objects right now...
if (class_interface_decl) {
if (ResolveDeclOrigin(class_interface_decl, NULL, NULL))
return CompleteAndFetchChildren(qual_type);
@@ -896,9 +894,9 @@ void ClangASTImporter::Minion::ImportDefinitionTo(clang::Decl *to,
}
}
- // If we're dealing with an Objective-C class, ensure that the inheritance has
- // been set up correctly. The ASTImporter may not do this correctly if the
- // class was originally sourced from symbols.
+ // If we're dealing with an Objective-C class, ensure that the inheritance
+ // has been set up correctly. The ASTImporter may not do this correctly if
+ // the class was originally sourced from symbols.
if (ObjCInterfaceDecl *to_objc_interface = dyn_cast<ObjCInterfaceDecl>(to)) {
do {
diff --git a/source/Symbol/CompactUnwindInfo.cpp b/source/Symbol/CompactUnwindInfo.cpp
index df71b17c09d0..7dda877582cc 100644
--- a/source/Symbol/CompactUnwindInfo.cpp
+++ b/source/Symbol/CompactUnwindInfo.cpp
@@ -262,8 +262,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
if (m_unwindinfo_data_computed == false) {
if (m_section_sp->IsEncrypted()) {
// Can't get section contents of a protected/encrypted section until we
- // have a live
- // process and can read them out of memory.
+ // have a live process and can read them out of memory.
if (process_sp.get() == nullptr)
return;
m_section_contents_if_encrypted.reset(
@@ -329,11 +328,10 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
return;
}
- // Parse the basic information from the indexes
- // We wait to scan the second level page info until it's needed
+ // Parse the basic information from the indexes We wait to scan the second
+ // level page info until it's needed
- // struct unwind_info_section_header_index_entry
- // {
+ // struct unwind_info_section_header_index_entry {
// uint32_t functionOffset;
// uint32_t secondLevelPagesSectionOffset;
// uint32_t lsdaIndexArraySectionOffset;
@@ -388,8 +386,7 @@ void CompactUnwindInfo::ScanIndex(const ProcessSP &process_sp) {
uint32_t CompactUnwindInfo::GetLSDAForFunctionOffset(uint32_t lsda_offset,
uint32_t lsda_count,
uint32_t function_offset) {
- // struct unwind_info_section_header_lsda_index_entry
- // {
+ // struct unwind_info_section_header_lsda_index_entry {
// uint32_t functionOffset;
// uint32_t lsdaOffset;
// };
@@ -419,8 +416,7 @@ lldb::offset_t CompactUnwindInfo::BinarySearchRegularSecondPage(
uint32_t entry_page_offset, uint32_t entry_count, uint32_t function_offset,
uint32_t *entry_func_start_offset, uint32_t *entry_func_end_offset) {
// typedef uint32_t compact_unwind_encoding_t;
- // struct unwind_info_regular_second_level_entry
- // {
+ // struct unwind_info_regular_second_level_entry {
// uint32_t functionOffset;
// compact_unwind_encoding_t encoding;
@@ -539,9 +535,9 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
auto next_it = it + 1;
if (next_it != m_indexes.end()) {
- // initialize the function offset end range to be the start of the
- // next index offset. If we find an entry which is at the end of
- // the index table, this will establish the range end.
+ // initialize the function offset end range to be the start of the next
+ // index offset. If we find an entry which is at the end of the index
+ // table, this will establish the range end.
unwind_info.valid_range_offset_end = next_it->function_offset;
}
@@ -554,15 +550,13 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
&offset); // UNWIND_SECOND_LEVEL_REGULAR or UNWIND_SECOND_LEVEL_COMPRESSED
if (kind == UNWIND_SECOND_LEVEL_REGULAR) {
- // struct unwind_info_regular_second_level_page_header
- // {
+ // struct unwind_info_regular_second_level_page_header {
// uint32_t kind; // UNWIND_SECOND_LEVEL_REGULAR
// uint16_t entryPageOffset;
// uint16_t entryCount;
// typedef uint32_t compact_unwind_encoding_t;
- // struct unwind_info_regular_second_level_entry
- // {
+ // struct unwind_info_regular_second_level_entry {
// uint32_t functionOffset;
// compact_unwind_encoding_t encoding;
@@ -612,8 +606,7 @@ bool CompactUnwindInfo::GetCompactUnwindInfoForFunction(
}
return true;
} else if (kind == UNWIND_SECOND_LEVEL_COMPRESSED) {
- // struct unwind_info_compressed_second_level_page_header
- // {
+ // struct unwind_info_compressed_second_level_page_header {
// uint32_t kind; // UNWIND_SECOND_LEVEL_COMPRESSED
// uint16_t entryPageOffset; // offset from this 2nd lvl page
// idx to array of entries
@@ -721,8 +714,8 @@ enum x86_64_eh_regnum {
// enough
};
-// Convert the compact_unwind_info.h register numbering scheme
-// to eRegisterKindEHFrame (eh_frame) register numbering scheme.
+// Convert the compact_unwind_info.h register numbering scheme to
+// eRegisterKindEHFrame (eh_frame) register numbering scheme.
uint32_t translate_to_eh_frame_regnum_x86_64(uint32_t unwind_regno) {
switch (unwind_regno) {
case UNWIND_X86_64_REG_RBX:
@@ -802,9 +795,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
case UNWIND_X86_64_MODE_STACK_IND: {
// The clang in Xcode 6 is emitting incorrect compact unwind encodings for
- // this
- // style of unwind. It was fixed in llvm r217020.
- // The clang in Xcode 7 has this fixed.
+ // this style of unwind. It was fixed in llvm r217020. The clang in Xcode
+ // 7 has this fixed.
return false;
} break;
@@ -861,17 +853,17 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
if (register_count > 0) {
- // We need to include (up to) 6 registers in 10 bits.
- // That would be 18 bits if we just used 3 bits per reg to indicate
- // the order they're saved on the stack.
+ // We need to include (up to) 6 registers in 10 bits. That would be 18
+ // bits if we just used 3 bits per reg to indicate the order they're
+ // saved on the stack.
//
// This is done with Lehmer code permutation, e.g. see
- // http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
+ // http://stackoverflow.com/questions/1506078/fast-permutation-number-
+ // permutation-mapping-algorithms
int permunreg[6] = {0, 0, 0, 0, 0, 0};
- // This decodes the variable-base number in the 10 bits
- // and gives us the Lehmer code sequence which can then
- // be decoded.
+ // This decodes the variable-base number in the 10 bits and gives us the
+ // Lehmer code sequence which can then be decoded.
switch (register_count) {
case 6:
@@ -923,8 +915,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_x86_64(Target &target,
break;
}
- // Decode the Lehmer code for this permutation of
- // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
+ // Decode the Lehmer code for this permutation of the registers v.
+ // http://en.wikipedia.org/wiki/Lehmer_code
int registers[6] = {UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE,
UNWIND_X86_64_REG_NONE, UNWIND_X86_64_REG_NONE,
@@ -993,8 +985,8 @@ enum i386_eh_regnum {
// enough
};
-// Convert the compact_unwind_info.h register numbering scheme
-// to eRegisterKindEHFrame (eh_frame) register numbering scheme.
+// Convert the compact_unwind_info.h register numbering scheme to
+// eRegisterKindEHFrame (eh_frame) register numbering scheme.
uint32_t translate_to_eh_frame_regnum_i386(uint32_t unwind_regno) {
switch (unwind_regno) {
case UNWIND_X86_REG_EBX:
@@ -1123,17 +1115,17 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
if (register_count > 0) {
- // We need to include (up to) 6 registers in 10 bits.
- // That would be 18 bits if we just used 3 bits per reg to indicate
- // the order they're saved on the stack.
+ // We need to include (up to) 6 registers in 10 bits. That would be 18
+ // bits if we just used 3 bits per reg to indicate the order they're
+ // saved on the stack.
//
// This is done with Lehmer code permutation, e.g. see
- // http://stackoverflow.com/questions/1506078/fast-permutation-number-permutation-mapping-algorithms
+ // http://stackoverflow.com/questions/1506078/fast-permutation-number-
+ // permutation-mapping-algorithms
int permunreg[6] = {0, 0, 0, 0, 0, 0};
- // This decodes the variable-base number in the 10 bits
- // and gives us the Lehmer code sequence which can then
- // be decoded.
+ // This decodes the variable-base number in the 10 bits and gives us the
+ // Lehmer code sequence which can then be decoded.
switch (register_count) {
case 6:
@@ -1185,8 +1177,8 @@ bool CompactUnwindInfo::CreateUnwindPlan_i386(Target &target,
break;
}
- // Decode the Lehmer code for this permutation of
- // the registers v. http://en.wikipedia.org/wiki/Lehmer_code
+ // Decode the Lehmer code for this permutation of the registers v.
+ // http://en.wikipedia.org/wiki/Lehmer_code
int registers[6] = {UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE,
UNWIND_X86_REG_NONE, UNWIND_X86_REG_NONE,
@@ -1260,14 +1252,10 @@ enum arm64_eh_regnum {
pc = 32,
// Compact unwind encodes d8-d15 but we don't have eh_frame / dwarf reg #'s
- // for the 64-bit
- // fp regs. Normally in DWARF it's context sensitive - so it knows it is
- // fetching a
- // 32- or 64-bit quantity from reg v8 to indicate s0 or d0 - but the unwinder
- // is operating
- // at a lower level and we'd try to fetch 128 bits if we were told that v8
- // were stored on
- // the stack...
+ // for the 64-bit fp regs. Normally in DWARF it's context sensitive - so it
+ // knows it is fetching a 32- or 64-bit quantity from reg v8 to indicate s0
+ // or d0 - but the unwinder is operating at a lower level and we'd try to
+ // fetch 128 bits if we were told that v8 were stored on the stack...
v8 = 72,
v9 = 73,
v10 = 74,
diff --git a/source/Symbol/CompileUnit.cpp b/source/Symbol/CompileUnit.cpp
index 8ba83d438803..a4f0d4231e2f 100644
--- a/source/Symbol/CompileUnit.cpp
+++ b/source/Symbol/CompileUnit.cpp
@@ -67,10 +67,10 @@ void CompileUnit::GetDescription(Stream *s,
}
//----------------------------------------------------------------------
-// Dump the current contents of this object. No functions that cause on
-// demand parsing of functions, globals, statics are called, so this
-// is a good function to call to get an idea of the current contents of
-// the CompileUnit object.
+// Dump the current contents of this object. No functions that cause on demand
+// parsing of functions, globals, statics are called, so this is a good
+// function to call to get an idea of the current contents of the CompileUnit
+// object.
//----------------------------------------------------------------------
void CompileUnit::Dump(Stream *s, bool show_context) const {
const char *language = Language::GetNameForLanguageType(m_language);
@@ -118,28 +118,27 @@ FunctionSP CompileUnit::GetFunctionAtIndex(size_t idx) {
}
//----------------------------------------------------------------------
-// Find functions using the Mangled::Tokens token list. This
-// function currently implements an interactive approach designed to find
-// all instances of certain functions. It isn't designed to the
-// quickest way to lookup functions as it will need to iterate through
-// all functions and see if they match, though it does provide a powerful
-// and context sensitive way to search for all functions with a certain
-// name, all functions in a namespace, or all functions of a template
-// type. See Mangled::Tokens::Parse() comments for more information.
+// Find functions using the Mangled::Tokens token list. This function currently
+// implements an interactive approach designed to find all instances of certain
+// functions. It isn't designed to the quickest way to lookup functions as it
+// will need to iterate through all functions and see if they match, though it
+// does provide a powerful and context sensitive way to search for all
+// functions with a certain name, all functions in a namespace, or all
+// functions of a template type. See Mangled::Tokens::Parse() comments for more
+// information.
//
-// The function prototype will need to change to return a list of
-// results. It was originally used to help debug the Mangled class
-// and the Mangled::Tokens::MatchesQuery() function and it currently
-// will print out a list of matching results for the functions that
-// are currently in this compile unit.
+// The function prototype will need to change to return a list of results. It
+// was originally used to help debug the Mangled class and the
+// Mangled::Tokens::MatchesQuery() function and it currently will print out a
+// list of matching results for the functions that are currently in this
+// compile unit.
//
// A FindFunctions method should be called prior to this that takes
-// a regular function name (const char * or ConstString as a parameter)
-// before resorting to this slower but more complete function. The
-// other FindFunctions method should be able to take advantage of any
-// accelerator tables available in the debug information (which is
-// parsed by the SymbolFile parser plug-ins and registered with each
-// Module).
+// a regular function name (const char * or ConstString as a parameter) before
+// resorting to this slower but more complete function. The other FindFunctions
+// method should be able to take advantage of any accelerator tables available
+// in the debug information (which is parsed by the SymbolFile parser plug-ins
+// and registered with each Module).
//----------------------------------------------------------------------
// void
// CompileUnit::FindFunctions(const Mangled::Tokens& tokens)
@@ -283,13 +282,12 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
bool exact, uint32_t resolve_scope,
SymbolContextList &sc_list) {
// First find all of the file indexes that match our "file_spec". If
- // "file_spec" has an empty directory, then only compare the basenames
- // when finding file indexes
+ // "file_spec" has an empty directory, then only compare the basenames when
+ // finding file indexes
std::vector<uint32_t> file_indexes;
const bool full_match = (bool)file_spec.GetDirectory();
- const bool remove_backup_dots = true;
bool file_spec_matches_cu_file_spec =
- FileSpec::Equal(file_spec, *this, full_match, remove_backup_dots);
+ FileSpec::Equal(file_spec, *this, full_match);
// If we are not looking for inlined functions and our file spec doesn't
// match then we are done...
@@ -297,11 +295,10 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
uint32_t file_idx =
- GetSupportFiles().FindFileIndex(1, file_spec, true, remove_backup_dots);
+ GetSupportFiles().FindFileIndex(1, file_spec, true);
while (file_idx != UINT32_MAX) {
file_indexes.push_back(file_idx);
- file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true,
- remove_backup_dots);
+ file_idx = GetSupportFiles().FindFileIndex(file_idx + 1, file_spec, true);
}
const size_t num_file_indexes = file_indexes.size();
@@ -321,23 +318,23 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
uint32_t line_idx;
if (num_file_indexes == 1) {
- // We only have a single support file that matches, so use
- // the line table function that searches for a line entries
- // that match a single support file index
+ // We only have a single support file that matches, so use the line
+ // table function that searches for a line entries that match a single
+ // support file index
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex(
0, file_indexes.front(), line, exact, &line_entry);
- // If "exact == true", then "found_line" will be the same
- // as "line". If "exact == false", the "found_line" will be the
- // closest line entry with a line number greater than "line" and
- // we will use this for our subsequent line exact matches below.
+ // If "exact == true", then "found_line" will be the same as "line". If
+ // "exact == false", the "found_line" will be the closest line entry
+ // with a line number greater than "line" and we will use this for our
+ // subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX) {
- // If they only asked for the line entry, then we're done, we can just
- // copy that over.
- // But if they wanted more than just the line number, fill it in.
+ // If they only asked for the line entry, then we're done, we can
+ // just copy that over. But if they wanted more than just the line
+ // number, fill it in.
if (resolve_scope == eSymbolContextLineEntry) {
sc.line_entry = line_entry;
} else {
@@ -351,17 +348,17 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
&line_entry);
}
} else {
- // We found multiple support files that match "file_spec" so use
- // the line table function that searches for a line entries
- // that match a multiple support file indexes.
+ // We found multiple support files that match "file_spec" so use the
+ // line table function that searches for a line entries that match a
+ // multiple support file indexes.
LineEntry line_entry;
line_idx = line_table->FindLineEntryIndexByFileIndex(
0, file_indexes, line, exact, &line_entry);
- // If "exact == true", then "found_line" will be the same
- // as "line". If "exact == false", the "found_line" will be the
- // closest line entry with a line number greater than "line" and
- // we will use this for our subsequent line exact matches below.
+ // If "exact == true", then "found_line" will be the same as "line". If
+ // "exact == false", the "found_line" will be the closest line entry
+ // with a line number greater than "line" and we will use this for our
+ // subsequent line exact matches below.
found_line = line_entry.line;
while (line_idx != UINT32_MAX) {
@@ -379,8 +376,8 @@ uint32_t CompileUnit::ResolveSymbolContext(const FileSpec &file_spec,
}
}
} else if (file_spec_matches_cu_file_spec && !check_inlines) {
- // only append the context if we aren't looking for inline call sites
- // by file and line and if the file spec matches that of the compile unit
+ // only append the context if we aren't looking for inline call sites by
+ // file and line and if the file spec matches that of the compile unit
sc_list.Append(sc);
}
return sc_list.GetSize() - prev_size;
diff --git a/source/Symbol/CompilerType.cpp b/source/Symbol/CompilerType.cpp
index 5d845361b03c..2dd1d3ebd04b 100644
--- a/source/Symbol/CompilerType.cpp
+++ b/source/Symbol/CompilerType.cpp
@@ -638,8 +638,8 @@ CompilerType CompilerType::GetChildCompilerTypeAtIndex(
}
// Look for a child member (doesn't include base classes, but it does include
-// their members) in the type hierarchy. Returns an index path into "clang_type"
-// on how to reach the appropriate member.
+// their members) in the type hierarchy. Returns an index path into
+// "clang_type" on how to reach the appropriate member.
//
// class A
// {
@@ -662,16 +662,13 @@ CompilerType CompilerType::GetChildCompilerTypeAtIndex(
// "m_b" in it:
//
// With omit_empty_base_classes == false we would get an integer array back
-// with:
-// { 1, 1 }
-// The first index 1 is the child index for "class A" within class C
-// The second index 1 is the child index for "m_b" within class A
+// with: { 1, 1 } The first index 1 is the child index for "class A" within
+// class C The second index 1 is the child index for "m_b" within class A
//
-// With omit_empty_base_classes == true we would get an integer array back with:
-// { 0, 1 }
-// The first index 0 is the child index for "class A" within class C (since
-// class B doesn't have any members it doesn't count)
-// The second index 1 is the child index for "m_b" within class A
+// With omit_empty_base_classes == true we would get an integer array back
+// with: { 0, 1 } The first index 0 is the child index for "class A" within
+// class C (since class B doesn't have any members it doesn't count) The second
+// index 1 is the child index for "m_b" within class A
size_t CompilerType::GetIndexOfChildMemberWithName(
const char *name, bool omit_empty_base_classes,
@@ -987,8 +984,8 @@ bool CompilerType::ReadFromMemory(lldb_private::ExecutionContext *exe_ctx,
if (!IsValid())
return false;
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context (which
+ // Module it came from)
if (address_type == eAddressTypeFile)
return false;
@@ -1029,8 +1026,8 @@ bool CompilerType::WriteToMemory(lldb_private::ExecutionContext *exe_ctx,
if (!IsValid())
return false;
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context (which
+ // Module it came from)
if (address_type == eAddressTypeFile)
return false;
diff --git a/source/Symbol/DWARFCallFrameInfo.cpp b/source/Symbol/DWARFCallFrameInfo.cpp
index 572648d05f09..1bf9ff99e015 100644
--- a/source/Symbol/DWARFCallFrameInfo.cpp
+++ b/source/Symbol/DWARFCallFrameInfo.cpp
@@ -27,8 +27,8 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// GetDwarfEHPtr
//
-// Used for calls when the value type is specified by a DWARF EH Frame
-// pointer encoding.
+// Used for calls when the value type is specified by a DWARF EH Frame pointer
+// encoding.
//----------------------------------------------------------------------
static uint64_t
GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr,
@@ -83,8 +83,8 @@ GetGNUEHPointer(const DataExtractor &DE, offset_t *offset_ptr,
break;
case DW_EH_PE_aligned: {
- // SetPointerSize should be called prior to extracting these so the
- // pointer size is cached
+ // SetPointerSize should be called prior to extracting these so the pointer
+ // size is cached
assert(addr_size != 0);
if (addr_size) {
// Align to a address size boundary first
@@ -154,8 +154,8 @@ DWARFCallFrameInfo::DWARFCallFrameInfo(ObjectFile &objfile,
bool DWARFCallFrameInfo::GetUnwindPlan(Address addr, UnwindPlan &unwind_plan) {
FDEEntryMap::Entry fde_entry;
- // Make sure that the Address we're searching for is the same object file
- // as this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
+ // Make sure that the Address we're searching for is the same object file as
+ // this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
ModuleSP module_sp = addr.GetModule();
if (module_sp.get() == nullptr || module_sp->GetObjectFile() == nullptr ||
module_sp->GetObjectFile() != &m_objfile)
@@ -168,8 +168,8 @@ bool DWARFCallFrameInfo::GetUnwindPlan(Address addr, UnwindPlan &unwind_plan) {
bool DWARFCallFrameInfo::GetAddressRange(Address addr, AddressRange &range) {
- // Make sure that the Address we're searching for is the same object file
- // as this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
+ // Make sure that the Address we're searching for is the same object file as
+ // this DWARFCallFrameInfo, we only store File offsets in m_fde_index.
ModuleSP module_sp = addr.GetModule();
if (module_sp.get() == nullptr || module_sp->GetObjectFile() == nullptr ||
module_sp->GetObjectFile() != &m_objfile)
@@ -291,8 +291,8 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
return nullptr;
}
- // m_cfi_data uses address size from target architecture of the process
- // may ignore these fields?
+ // m_cfi_data uses address size from target architecture of the process may
+ // ignore these fields?
if (m_type == DWARF && cie_sp->version >= CFI_VERSION4) {
cie_sp->address_size = m_cfi_data.GetU8(&offset);
cie_sp->segment_size = m_cfi_data.GetU8(&offset);
@@ -307,15 +307,15 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
: m_cfi_data.GetU8(&offset);
if (cie_sp->augmentation[0]) {
- // Get the length of the eh_frame augmentation data
- // which starts with a ULEB128 length in bytes
+ // Get the length of the eh_frame augmentation data which starts with a
+ // ULEB128 length in bytes
const size_t aug_data_len = (size_t)m_cfi_data.GetULEB128(&offset);
const size_t aug_data_end = offset + aug_data_len;
const size_t aug_str_len = strlen(cie_sp->augmentation);
// A 'z' may be present as the first character of the string.
- // If present, the Augmentation Data field shall be present.
- // The contents of the Augmentation Data shall be interpreted
- // according to other characters in the Augmentation String.
+ // If present, the Augmentation Data field shall be present. The contents
+ // of the Augmentation Data shall be interpreted according to other
+ // characters in the Augmentation String.
if (cie_sp->augmentation[0] == 'z') {
// Extract the Augmentation Data
size_t aug_str_idx = 0;
@@ -323,31 +323,27 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
char aug = cie_sp->augmentation[aug_str_idx];
switch (aug) {
case 'L':
- // Indicates the presence of one argument in the
- // Augmentation Data of the CIE, and a corresponding
- // argument in the Augmentation Data of the FDE. The
- // argument in the Augmentation Data of the CIE is
- // 1-byte and represents the pointer encoding used
- // for the argument in the Augmentation Data of the
- // FDE, which is the address of a language-specific
- // data area (LSDA). The size of the LSDA pointer is
- // specified by the pointer encoding used.
+ // Indicates the presence of one argument in the Augmentation Data
+ // of the CIE, and a corresponding argument in the Augmentation
+ // Data of the FDE. The argument in the Augmentation Data of the
+ // CIE is 1-byte and represents the pointer encoding used for the
+ // argument in the Augmentation Data of the FDE, which is the
+ // address of a language-specific data area (LSDA). The size of the
+ // LSDA pointer is specified by the pointer encoding used.
cie_sp->lsda_addr_encoding = m_cfi_data.GetU8(&offset);
break;
case 'P':
- // Indicates the presence of two arguments in the
- // Augmentation Data of the CIE. The first argument
- // is 1-byte and represents the pointer encoding
- // used for the second argument, which is the
- // address of a personality routine handler. The
- // size of the personality routine pointer is
- // specified by the pointer encoding used.
+ // Indicates the presence of two arguments in the Augmentation Data
+ // of the CIE. The first argument is 1-byte and represents the
+ // pointer encoding used for the second argument, which is the
+ // address of a personality routine handler. The size of the
+ // personality routine pointer is specified by the pointer encoding
+ // used.
//
- // The address of the personality function will
- // be stored at this location. Pre-execution, it
- // will be all zero's so don't read it until we're
- // trying to do an unwind & the reloc has been
+ // The address of the personality function will be stored at this
+ // location. Pre-execution, it will be all zero's so don't read it
+ // until we're trying to do an unwind & the reloc has been
// resolved.
{
uint8_t arg_ptr_encoding = m_cfi_data.GetU8(&offset);
@@ -360,22 +356,21 @@ DWARFCallFrameInfo::ParseCIE(const dw_offset_t cie_offset) {
case 'R':
// A 'R' may be present at any position after the
- // first character of the string. The Augmentation
- // Data shall include a 1 byte argument that
- // represents the pointer encoding for the address
- // pointers used in the FDE.
- // Example: 0x1B == DW_EH_PE_pcrel | DW_EH_PE_sdata4
+ // first character of the string. The Augmentation Data shall
+ // include a 1 byte argument that represents the pointer encoding
+ // for the address pointers used in the FDE. Example: 0x1B ==
+ // DW_EH_PE_pcrel | DW_EH_PE_sdata4
cie_sp->ptr_encoding = m_cfi_data.GetU8(&offset);
break;
}
}
} else if (strcmp(cie_sp->augmentation, "eh") == 0) {
- // If the Augmentation string has the value "eh", then
- // the EH Data field shall be present
+ // If the Augmentation string has the value "eh", then the EH Data
+ // field shall be present
}
- // Set the offset to be the end of the augmentation data just in case
- // we didn't understand any of the data.
+ // Set the offset to be the end of the augmentation data just in case we
+ // didn't understand any of the data.
offset = (uint32_t)aug_data_end;
}
@@ -408,10 +403,8 @@ void DWARFCallFrameInfo::GetCFIData() {
}
}
// Scan through the eh_frame or debug_frame section looking for FDEs and noting
-// the start/end addresses
-// of the functions and a pointer back to the function's FDE for later
-// expansion.
-// Internalize CIEs as we come across them.
+// the start/end addresses of the functions and a pointer back to the
+// function's FDE for later expansion. Internalize CIEs as we come across them.
void DWARFCallFrameInfo::GetFDEIndex() {
if (m_section_sp.get() == nullptr || m_section_sp->IsEncrypted())
@@ -469,8 +462,8 @@ void DWARFCallFrameInfo::GetFDEIndex() {
}
// An FDE entry contains CIE_pointer in debug_frame in same place as cie_id
- // in eh_frame. CIE_pointer is an offset into the .debug_frame section.
- // So, variable cie_offset should be equal to cie_id for debug_frame.
+ // in eh_frame. CIE_pointer is an offset into the .debug_frame section. So,
+ // variable cie_offset should be equal to cie_id for debug_frame.
// FDE entries with cie_id == 0 shouldn't be ignored for it.
if ((cie_id == 0 && m_type == EH) || cie_id == UINT32_MAX || len == 0) {
auto cie_sp = ParseCIE(current_entry);
@@ -556,9 +549,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
// FDE entries with zeroth cie_offset may occur for debug_frame.
assert(!(m_type == EH && 0 == cie_offset) && cie_offset != UINT32_MAX);
- // Translate the CIE_id from the eh_frame format, which
- // is relative to the FDE offset, into a __eh_frame section
- // offset
+ // Translate the CIE_id from the eh_frame format, which is relative to the
+ // FDE offset, into a __eh_frame section offset
if (m_type == EH) {
unwind_plan.SetSourceName("eh_frame CFI");
cie_offset = current_entry + (is_64bit ? 12 : 4) - cie_offset;
@@ -652,10 +644,10 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_advance_loc: // (Row Creation Instruction)
{ // 0x40 - high 2 bits are 0x1, lower 6 bits are delta
// takes a single argument that represents a constant delta. The
- // required action is to create a new table row with a location
- // value that is computed by taking the current entry's location
- // value and adding (delta * code_align). All other
- // values in the new row are initially identical to the current row.
+ // required action is to create a new table row with a location value
+ // that is computed by taking the current entry's location value and
+ // adding (delta * code_align). All other values in the new row are
+ // initially identical to the current row.
unwind_plan.AppendRow(row);
UnwindPlan::Row *newrow = new UnwindPlan::Row;
*newrow = *row.get();
@@ -670,11 +662,10 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
// required action is to change the rule for the indicated register
// to the rule assigned it by the initial_instructions in the CIE.
uint32_t reg_num = extended_opcode;
- // We only keep enough register locations around to
- // unwind what is in our thread, and these are organized
- // by the register index in that state, so we need to convert our
- // eh_frame register number from the EH frame info, to a register
- // index
+ // We only keep enough register locations around to unwind what is in
+ // our thread, and these are organized by the register index in that
+ // state, so we need to convert our eh_frame register number from the
+ // EH frame info, to a register index
if (unwind_plan.IsValidRowIndex(0) &&
unwind_plan.GetRowAtIndex(0)->GetRegisterInfo(reg_num,
@@ -756,8 +747,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_remember_state: // 0xA
{
// These instructions define a stack of information. Encountering the
- // DW_CFA_remember_state instruction means to save the rules for every
- // register on the current row on the stack. Encountering the
+ // DW_CFA_remember_state instruction means to save the rules for
+ // every register on the current row on the stack. Encountering the
// DW_CFA_restore_state instruction means to pop the set of rules off
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
@@ -772,8 +763,8 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_restore_state: // 0xB
{
// These instructions define a stack of information. Encountering the
- // DW_CFA_remember_state instruction means to save the rules for every
- // register on the current row on the stack. Encountering the
+ // DW_CFA_remember_state instruction means to save the rules for
+ // every register on the current row on the stack. Encountering the
// DW_CFA_restore_state instruction means to pop the set of rules off
// the stack and place them in the current row. (This operation is
// useful for compilers that move epilogue code into the body of a
@@ -798,10 +789,9 @@ bool DWARFCallFrameInfo::FDEToUnwindPlan(dw_offset_t dwarf_offset,
case DW_CFA_GNU_args_size: // 0x2e
{
// The DW_CFA_GNU_args_size instruction takes an unsigned LEB128
- // operand
- // representing an argument size. This instruction specifies the total
- // of
- // the size of the arguments which have been pushed onto the stack.
+ // operand representing an argument size. This instruction specifies
+ // the total of the size of the arguments which have been pushed onto
+ // the stack.
// TODO: Figure out how we should handle this.
m_cfi_data.GetULEB128(&offset);
@@ -834,9 +824,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
// register
// takes two arguments: an unsigned LEB128 constant representing a
// factored offset and a register number. The required action is to
- // change the rule for the register indicated by the register number
- // to be an offset(N) rule with a value of
- // (N = factored offset * data_align).
+ // change the rule for the register indicated by the register number to
+ // be an offset(N) rule with a value of (N = factored offset *
+ // data_align).
uint8_t reg_num = extended_opcode;
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
reg_location.SetAtCFAPlusOffset(op_offset);
@@ -851,8 +841,8 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_offset_extended: // 0x5
{
- // takes two unsigned LEB128 arguments representing a register number
- // and a factored offset. This instruction is identical to DW_CFA_offset
+ // takes two unsigned LEB128 arguments representing a register number and
+ // a factored offset. This instruction is identical to DW_CFA_offset
// except for the encoding and size of the register argument.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset) * data_align;
@@ -888,9 +878,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_register: // 0x9
{
- // takes two unsigned LEB128 arguments representing register numbers.
- // The required action is to set the rule for the first register to be
- // the second register.
+ // takes two unsigned LEB128 arguments representing register numbers. The
+ // required action is to set the rule for the first register to be the
+ // second register.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
uint32_t other_reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
UnwindPlan::Row::RegisterLocation reg_location;
@@ -901,10 +891,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa: // 0xC (CFA Definition Instruction)
{
- // Takes two unsigned LEB128 operands representing a register
- // number and a (non-factored) offset. The required action
- // is to define the current CFA rule to use the provided
- // register and offset.
+ // Takes two unsigned LEB128 operands representing a register number and
+ // a (non-factored) offset. The required action is to define the current
+ // CFA rule to use the provided register and offset.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num, op_offset);
@@ -914,8 +903,8 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_register: // 0xD (CFA Definition Instruction)
{
// takes a single unsigned LEB128 argument representing a register
- // number. The required action is to define the current CFA rule to
- // use the provided register (but to keep the old offset).
+ // number. The required action is to define the current CFA rule to use
+ // the provided register (but to keep the old offset).
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num,
row.GetCFAValue().GetOffset());
@@ -924,10 +913,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_offset: // 0xE (CFA Definition Instruction)
{
- // Takes a single unsigned LEB128 operand representing a
- // (non-factored) offset. The required action is to define
- // the current CFA rule to use the provided offset (but
- // to keep the old register).
+ // Takes a single unsigned LEB128 operand representing a (non-factored)
+ // offset. The required action is to define the current CFA rule to use
+ // the provided offset (but to keep the old register).
int32_t op_offset = (int32_t)m_cfi_data.GetULEB128(&offset);
row.GetCFAValue().SetIsRegisterPlusOffset(
row.GetCFAValue().GetRegisterNumber(), op_offset);
@@ -945,14 +933,13 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_expression: // 0x10
{
- // Takes two operands: an unsigned LEB128 value representing
- // a register number, and a DW_FORM_block value representing a DWARF
- // expression. The required action is to change the rule for the
- // register indicated by the register number to be an expression(E)
- // rule where E is the DWARF expression. That is, the DWARF
- // expression computes the address. The value of the CFA is
- // pushed on the DWARF evaluation stack prior to execution of
- // the DWARF expression.
+ // Takes two operands: an unsigned LEB128 value representing a register
+ // number, and a DW_FORM_block value representing a DWARF expression. The
+ // required action is to change the rule for the register indicated by
+ // the register number to be an expression(E) rule where E is the DWARF
+ // expression. That is, the DWARF expression computes the address. The
+ // value of the CFA is pushed on the DWARF evaluation stack prior to
+ // execution of the DWARF expression.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
uint32_t block_len = (uint32_t)m_cfi_data.GetULEB128(&offset);
const uint8_t *block_data =
@@ -965,10 +952,10 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_offset_extended_sf: // 0x11
{
- // takes two operands: an unsigned LEB128 value representing a
- // register number and a signed LEB128 factored offset. This
- // instruction is identical to DW_CFA_offset_extended except
- // that the second operand is signed and factored.
+ // takes two operands: an unsigned LEB128 value representing a register
+ // number and a signed LEB128 factored offset. This instruction is
+ // identical to DW_CFA_offset_extended except that the second operand is
+ // signed and factored.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
UnwindPlan::Row::RegisterLocation reg_location;
@@ -979,10 +966,10 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_sf: // 0x12 (CFA Definition Instruction)
{
- // Takes two operands: an unsigned LEB128 value representing
- // a register number and a signed LEB128 factored offset.
- // This instruction is identical to DW_CFA_def_cfa except
- // that the second operand is signed and factored.
+ // Takes two operands: an unsigned LEB128 value representing a register
+ // number and a signed LEB128 factored offset. This instruction is
+ // identical to DW_CFA_def_cfa except that the second operand is signed
+ // and factored.
uint32_t reg_num = (uint32_t)m_cfi_data.GetULEB128(&offset);
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
row.GetCFAValue().SetIsRegisterPlusOffset(reg_num, op_offset);
@@ -991,9 +978,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_def_cfa_offset_sf: // 0x13 (CFA Definition Instruction)
{
- // takes a signed LEB128 operand representing a factored
- // offset. This instruction is identical to DW_CFA_def_cfa_offset
- // except that the operand is signed and factored.
+ // takes a signed LEB128 operand representing a factored offset. This
+ // instruction is identical to DW_CFA_def_cfa_offset except that the
+ // operand is signed and factored.
int32_t op_offset = (int32_t)m_cfi_data.GetSLEB128(&offset) * data_align;
uint32_t cfa_regnum = row.GetCFAValue().GetRegisterNumber();
row.GetCFAValue().SetIsRegisterPlusOffset(cfa_regnum, op_offset);
@@ -1003,9 +990,9 @@ bool DWARFCallFrameInfo::HandleCommonDwarfOpcode(uint8_t primary_opcode,
case DW_CFA_val_expression: // 0x16
{
// takes two operands: an unsigned LEB128 value representing a register
- // number, and a DW_FORM_block value representing a DWARF expression.
- // The required action is to change the rule for the register indicated
- // by the register number to be a val_expression(E) rule where E is the
+ // number, and a DW_FORM_block value representing a DWARF expression. The
+ // required action is to change the rule for the register indicated by
+ // the register number to be a val_expression(E) rule where E is the
// DWARF expression. That is, the DWARF expression computes the value of
// the given register. The value of the CFA is pushed on the DWARF
// evaluation stack prior to execution of the DWARF expression.
diff --git a/source/Symbol/Declaration.cpp b/source/Symbol/Declaration.cpp
index 7cee6c5a3ef3..83df578da2e3 100644
--- a/source/Symbol/Declaration.cpp
+++ b/source/Symbol/Declaration.cpp
@@ -91,7 +91,7 @@ bool lldb_private::operator==(const Declaration &lhs, const Declaration &rhs) {
return lhs.GetFile() == rhs.GetFile();
#else
if (lhs.GetLine() == rhs.GetLine())
- return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true, true);
+ return FileSpec::Equal(lhs.GetFile(), rhs.GetFile(), true);
#endif
return false;
}
diff --git a/source/Symbol/FuncUnwinders.cpp b/source/Symbol/FuncUnwinders.cpp
index b9f50cd1b12f..2384d35e3d36 100644
--- a/source/Symbol/FuncUnwinders.cpp
+++ b/source/Symbol/FuncUnwinders.cpp
@@ -174,10 +174,9 @@ UnwindPlanSP FuncUnwinders::GetEHFrameAugmentedUnwindPlan(Target &target,
m_tried_unwind_plan_eh_frame_augmented)
return m_unwind_plan_eh_frame_augmented_sp;
- // Only supported on x86 architectures where we get eh_frame from the compiler
- // that describes
- // the prologue instructions perfectly, and sometimes the epilogue
- // instructions too.
+ // Only supported on x86 architectures where we get eh_frame from the
+ // compiler that describes the prologue instructions perfectly, and sometimes
+ // the epilogue instructions too.
if (target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_32_i386 &&
target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_64_x86_64 &&
target.GetArchitecture().GetCore() != ArchSpec::eCore_x86_64_x86_64h) {
@@ -194,8 +193,7 @@ UnwindPlanSP FuncUnwinders::GetEHFrameAugmentedUnwindPlan(Target &target,
m_unwind_plan_eh_frame_augmented_sp.reset(new UnwindPlan(*eh_frame_plan));
// Augment the eh_frame instructions with epilogue descriptions if necessary
- // so the
- // UnwindPlan can be used at any instruction in the function.
+ // so the UnwindPlan can be used at any instruction in the function.
UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target));
if (assembly_profiler_sp) {
@@ -238,7 +236,8 @@ FuncUnwinders::GetDebugFrameAugmentedUnwindPlan(Target &target, Thread &thread,
new UnwindPlan(*debug_frame_plan));
// Augment the debug_frame instructions with epilogue descriptions if
- // necessary so the UnwindPlan can be used at any instruction in the function.
+ // necessary so the UnwindPlan can be used at any instruction in the
+ // function.
UnwindAssemblySP assembly_profiler_sp(GetUnwindAssemblyProfiler(target));
if (assembly_profiler_sp) {
@@ -275,8 +274,7 @@ UnwindPlanSP FuncUnwinders::GetAssemblyUnwindPlan(Target &target,
// This method compares the pc unwind rule in the first row of two UnwindPlans.
// If they have the same way of getting the pc value (e.g. "CFA - 8" + "CFA is
-// sp"),
-// then it will return LazyBoolTrue.
+// sp"), then it will return LazyBoolTrue.
LazyBool FuncUnwinders::CompareUnwindPlansForIdenticalInitialPCLocation(
Thread &thread, const UnwindPlanSP &a, const UnwindPlanSP &b) {
LazyBool plans_are_identical = eLazyBoolCalculate;
@@ -320,22 +318,22 @@ UnwindPlanSP FuncUnwinders::GetUnwindPlanAtNonCallSite(Target &target,
UnwindPlanSP assembly_sp =
GetAssemblyUnwindPlan(target, thread, current_offset);
- // This point of this code is to detect when a function is using a
- // non-standard ABI, and the eh_frame correctly describes that alternate ABI.
+ // This point of this code is to detect when a function is using a non-
+ // standard ABI, and the eh_frame correctly describes that alternate ABI.
// This is addressing a specific situation on x86_64 linux systems where one
// function in a library pushes a value on the stack and jumps to another
- // function. So using an assembly instruction based unwind will not work when
- // you're in the second function - the stack has been modified in a non-ABI
- // way. But we have eh_frame that correctly describes how to unwind from this
- // location. So we're looking to see if the initial pc register save location
- // from the eh_frame is different from the assembly unwind, the arch default
- // unwind, and the arch default at initial function entry.
+ // function. So using an assembly instruction based unwind will not work
+ // when you're in the second function - the stack has been modified in a non-
+ // ABI way. But we have eh_frame that correctly describes how to unwind from
+ // this location. So we're looking to see if the initial pc register save
+ // location from the eh_frame is different from the assembly unwind, the arch
+ // default unwind, and the arch default at initial function entry.
//
// We may have eh_frame that describes the entire function -- or we may have
// eh_frame that only describes the unwind after the prologue has executed --
// so we need to check both the arch default (once the prologue has executed)
- // and the arch default at initial function entry. And we may be running on a
- // target where we have only some of the assembly/arch default unwind plans
+ // and the arch default at initial function entry. And we may be running on
+ // a target where we have only some of the assembly/arch default unwind plans
// available.
if (CompareUnwindPlansForIdenticalInitialPCLocation(
diff --git a/source/Symbol/Function.cpp b/source/Symbol/Function.cpp
index 9464cef0bc73..f642c186a19f 100644
--- a/source/Symbol/Function.cpp
+++ b/source/Symbol/Function.cpp
@@ -24,9 +24,8 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// Basic function information is contained in the FunctionInfo class.
-// It is designed to contain the name, linkage name, and declaration
-// location.
+// Basic function information is contained in the FunctionInfo class. It is
+// designed to contain the name, linkage name, and declaration location.
//----------------------------------------------------------------------
FunctionInfo::FunctionInfo(const char *name, const Declaration *decl_ptr)
: m_name(name), m_declaration(decl_ptr) {}
@@ -188,8 +187,7 @@ void Function::GetEndLineSourceInfo(FileSpec &source_file, uint32_t &line_no) {
source_file.Clear();
// The -1 is kind of cheesy, but I want to get the last line entry for the
- // given function, not the
- // first entry of the next.
+ // given function, not the first entry of the next.
Address scratch_addr(GetAddressRange().GetBaseAddress());
scratch_addr.SetOffset(scratch_addr.GetOffset() +
GetAddressRange().GetByteSize() - 1);
@@ -331,9 +329,8 @@ size_t Function::MemorySize() const {
bool Function::GetIsOptimized() {
bool result = false;
- // Currently optimization is only indicted by the
- // vendor extension DW_AT_APPLE_optimized which
- // is set on a compile unit level.
+ // Currently optimization is only indicted by the vendor extension
+ // DW_AT_APPLE_optimized which is set on a compile unit level.
if (m_comp_unit) {
result = m_comp_unit->GetIsOptimized();
}
@@ -441,11 +438,11 @@ uint32_t Function::GetPrologueByteSize() {
}
}
- // If we didn't find the end of the prologue in the line tables,
- // then just use the end address of the first line table entry
+ // If we didn't find the end of the prologue in the line tables, then
+ // just use the end address of the first line table entry
if (prologue_end_file_addr == LLDB_INVALID_ADDRESS) {
- // Check the first few instructions and look for one that has
- // a line number that's different than the first entry.
+ // Check the first few instructions and look for one that has a line
+ // number that's different than the first entry.
uint32_t last_line_entry_idx = first_line_entry_idx + 6;
for (uint32_t idx = first_line_entry_idx + 1;
idx < last_line_entry_idx; ++idx) {
@@ -498,8 +495,8 @@ uint32_t Function::GetPrologueByteSize() {
}
}
- // Verify that this prologue end file address in the function's
- // address range just to be sure
+ // Verify that this prologue end file address in the function's address
+ // range just to be sure
if (func_start_file_addr < prologue_end_file_addr &&
prologue_end_file_addr < func_end_file_addr) {
m_prologue_byte_size = prologue_end_file_addr - func_start_file_addr;
diff --git a/source/Symbol/GoASTContext.cpp b/source/Symbol/GoASTContext.cpp
index 6761a605e46b..da5c82b2cb55 100644
--- a/source/Symbol/GoASTContext.cpp
+++ b/source/Symbol/GoASTContext.cpp
@@ -667,8 +667,7 @@ GoASTContext::GetFullyUnqualifiedType(lldb::opaque_compiler_type_t type) {
}
// Returns -1 if this isn't a function of if the function doesn't have a
-// prototype
-// Returns a value >= 0 if there is a prototype.
+// prototype Returns a value >= 0 if there is a prototype.
int GoASTContext::GetFunctionArgumentCount(lldb::opaque_compiler_type_t type) {
return GetNumberOfFunctionArguments(type);
}
@@ -1008,8 +1007,8 @@ CompilerType GoASTContext::GetChildCompilerTypeAtIndex(
return CompilerType();
}
-// Lookup a child given a name. This function will match base class names
-// and member member names in "clang_type" only, not descendants.
+// Lookup a child given a name. This function will match base class names and
+// member member names in "clang_type" only, not descendants.
uint32_t
GoASTContext::GetIndexOfChildWithName(lldb::opaque_compiler_type_t type,
const char *name,
@@ -1048,8 +1047,8 @@ size_t GoASTContext::GetIndexOfChildMemberWithName(
return 1;
}
-// Converts "s" to a floating point value and place resulting floating
-// point bytes in the "dst" buffer.
+// Converts "s" to a floating point value and place resulting floating point
+// bytes in the "dst" buffer.
size_t
GoASTContext::ConvertStringToFloatValue(lldb::opaque_compiler_type_t type,
const char *s, uint8_t *dst,
@@ -1080,9 +1079,8 @@ void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
uint32_t field_idx = 0;
for (auto *field = st->GetField(field_idx); field != nullptr;
field_idx++) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comma (for member 2 and beyond) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comma (for member 2 and beyond) for the struct/union/class member.
if (field_idx == 0)
s->PutChar('{');
else
@@ -1137,9 +1135,8 @@ void GoASTContext::DumpValue(lldb::opaque_compiler_type_t type,
uint64_t element_idx;
for (element_idx = 0; element_idx < a->GetLength(); ++element_idx) {
- // Print the starting squiggly bracket (if this is the
- // first member) or comman (for member 2 and beyong) for
- // the struct/union/class member.
+ // Print the starting squiggly bracket (if this is the first member) or
+ // comman (for member 2 and beyong) for the struct/union/class member.
if (element_idx == 0)
s->PutChar('{');
else
diff --git a/source/Symbol/LineEntry.cpp b/source/Symbol/LineEntry.cpp
index 691afdf5ed06..21aa2557518d 100644
--- a/source/Symbol/LineEntry.cpp
+++ b/source/Symbol/LineEntry.cpp
@@ -170,9 +170,9 @@ int LineEntry::Compare(const LineEntry &a, const LineEntry &b) {
if (a_byte_size > b_byte_size)
return +1;
- // Check for an end sequence entry mismatch after we have determined
- // that the address values are equal. If one of the items is an end
- // sequence, we don't care about the line, file, or column info.
+ // Check for an end sequence entry mismatch after we have determined that the
+ // address values are equal. If one of the items is an end sequence, we don't
+ // care about the line, file, or column info.
if (a.is_terminal_entry > b.is_terminal_entry)
return -1;
if (a.is_terminal_entry < b.is_terminal_entry)
@@ -192,8 +192,8 @@ int LineEntry::Compare(const LineEntry &a, const LineEntry &b) {
}
AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
- // Add each LineEntry's range to complete_line_range until we find
- // a different file / line number.
+ // Add each LineEntry's range to complete_line_range until we find a
+ // different file / line number.
AddressRange complete_line_range = range;
while (true) {
@@ -206,9 +206,8 @@ AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
if (next_line_sc.line_entry.IsValid() &&
next_line_sc.line_entry.range.GetByteSize() > 0 &&
original_file == next_line_sc.line_entry.original_file) {
- // Include any line 0 entries - they indicate that this is
- // compiler-generated code
- // that does not correspond to user source code.
+ // Include any line 0 entries - they indicate that this is compiler-
+ // generated code that does not correspond to user source code.
if (next_line_sc.line_entry.line == 0) {
complete_line_range.SetByteSize(
complete_line_range.GetByteSize() +
@@ -217,10 +216,9 @@ AddressRange LineEntry::GetSameLineContiguousAddressRange() const {
}
if (line == next_line_sc.line_entry.line) {
- // next_line_sc is the same file & line as this LineEntry, so extend our
- // AddressRange by its size and continue to see if there are more
- // LineEntries
- // that we can combine.
+ // next_line_sc is the same file & line as this LineEntry, so extend
+ // our AddressRange by its size and continue to see if there are more
+ // LineEntries that we can combine.
complete_line_range.SetByteSize(
complete_line_range.GetByteSize() +
next_line_sc.line_entry.range.GetByteSize());
diff --git a/source/Symbol/LineTable.cpp b/source/Symbol/LineTable.cpp
index 3cb305302927..06e30219f09a 100644
--- a/source/Symbol/LineTable.cpp
+++ b/source/Symbol/LineTable.cpp
@@ -73,30 +73,24 @@ void LineTable::AppendLineEntryToSequence(
is_terminal_entry);
entry_collection &entries = seq->m_entries;
// Replace the last entry if the address is the same, otherwise append it. If
- // we have multiple
- // line entries at the same address, this indicates illegal DWARF so this
- // "fixes" the line table
- // to be correct. If not fixed this can cause a line entry's address that when
- // resolved back to
- // a symbol context, could resolve to a different line entry. We really want a
+ // we have multiple line entries at the same address, this indicates illegal
+ // DWARF so this "fixes" the line table to be correct. If not fixed this can
+ // cause a line entry's address that when resolved back to a symbol context,
+ // could resolve to a different line entry. We really want a
// 1 to 1 mapping
- // here to avoid these kinds of inconsistencies. We will need tor revisit this
- // if the DWARF line
- // tables are updated to allow multiple entries at the same address legally.
+ // here to avoid these kinds of inconsistencies. We will need tor revisit
+ // this if the DWARF line tables are updated to allow multiple entries at the
+ // same address legally.
if (!entries.empty() && entries.back().file_addr == file_addr) {
// GCC don't use the is_prologue_end flag to mark the first instruction
// after the prologue.
// Instead of it it is issuing a line table entry for the first instruction
- // of the prologue
- // and one for the first instruction after the prologue. If the size of the
- // prologue is 0
- // instruction then the 2 line entry will have the same file address.
- // Removing it will remove
- // our ability to properly detect the location of the end of prologe so we
- // set the prologue_end
- // flag to preserve this information (setting the prologue_end flag for an
- // entry what is after
- // the prologue end don't have any effect)
+ // of the prologue and one for the first instruction after the prologue. If
+ // the size of the prologue is 0 instruction then the 2 line entry will
+ // have the same file address. Removing it will remove our ability to
+ // properly detect the location of the end of prologe so we set the
+ // prologue_end flag to preserve this information (setting the prologue_end
+ // flag for an entry what is after the prologue end don't have any effect)
entry.is_prologue_end = entry.file_idx == entries.back().file_idx;
entries.back() = entry;
} else
@@ -200,14 +194,13 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
if (pos->file_addr != search_entry.file_addr)
--pos;
else if (pos->file_addr == search_entry.file_addr) {
- // If this is a termination entry, it shouldn't match since
- // entries with the "is_terminal_entry" member set to true
- // are termination entries that define the range for the
- // previous entry.
+ // If this is a termination entry, it shouldn't match since entries
+ // with the "is_terminal_entry" member set to true are termination
+ // entries that define the range for the previous entry.
if (pos->is_terminal_entry) {
- // The matching entry is a terminal entry, so we skip
- // ahead to the next entry to see if there is another
- // entry following this one whose section/offset matches.
+ // The matching entry is a terminal entry, so we skip ahead to
+ // the next entry to see if there is another entry following this
+ // one whose section/offset matches.
++pos;
if (pos != end_pos) {
if (pos->file_addr != search_entry.file_addr)
@@ -216,9 +209,8 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
}
if (pos != end_pos) {
- // While in the same section/offset backup to find the first
- // line entry that matches the address in case there are
- // multiple
+ // While in the same section/offset backup to find the first line
+ // entry that matches the address in case there are multiple
while (pos != begin_pos) {
entry_collection::const_iterator prev_pos = pos - 1;
if (prev_pos->file_addr == search_entry.file_addr &&
@@ -232,16 +224,15 @@ bool LineTable::FindLineEntryByAddress(const Address &so_addr,
}
else
{
- // There might be code in the containing objfile before the first line
- // table entry. Make sure that does not get considered part of the first
- // line table entry.
+ // There might be code in the containing objfile before the first
+ // line table entry. Make sure that does not get considered part of
+ // the first line table entry.
if (pos->file_addr > so_addr.GetFileAddress())
return false;
}
// Make sure we have a valid match and that the match isn't a
- // terminating
- // entry for a previous line...
+ // terminating entry for a previous line...
if (pos != end_pos && pos->is_terminal_entry == false) {
uint32_t match_idx = std::distance(begin_pos, pos);
success = ConvertEntryAtIndexToLineEntry(match_idx, line_entry);
@@ -304,8 +295,7 @@ uint32_t LineTable::FindLineEntryIndexByFileIndex(
continue;
// Exact match always wins. Otherwise try to find the closest line > the
- // desired
- // line.
+ // desired line.
// FIXME: Maybe want to find the line closest before and the line closest
// after and
// if they're not in the same function, don't return a match.
@@ -349,8 +339,7 @@ uint32_t LineTable::FindLineEntryIndexByFileIndex(uint32_t start_idx,
continue;
// Exact match always wins. Otherwise try to find the closest line > the
- // desired
- // line.
+ // desired line.
// FIXME: Maybe want to find the line closest before and the line closest
// after and
// if they're not in the same function, don't return a match.
@@ -389,8 +378,8 @@ size_t LineTable::FineLineEntriesForFileIndex(uint32_t file_idx, bool append,
SymbolContext sc(m_comp_unit);
for (size_t idx = 0; idx < count; ++idx) {
- // Skip line table rows that terminate the previous row (is_terminal_entry
- // is non-zero)
+ // Skip line table rows that terminate the previous row
+ // (is_terminal_entry is non-zero)
if (m_entries[idx].is_terminal_entry)
continue;
@@ -497,10 +486,9 @@ LineTable *LineTable::LinkLineTable(const FileRangeMap &file_range_map) {
terminate_previous_entry = prev_entry_was_linked;
}
} else if (prev_entry_was_linked) {
- // This entry doesn't have a remapping and it needs to be removed.
- // Watch out in case we need to terminate a previous entry needs to
- // be terminated now that one line entry in a sequence is not longer
- // valid.
+ // This entry doesn't have a remapping and it needs to be removed. Watch
+ // out in case we need to terminate a previous entry needs to be
+ // terminated now that one line entry in a sequence is not longer valid.
if (!sequence.m_entries.empty() &&
!sequence.m_entries.back().is_terminal_entry) {
terminate_previous_entry = true;
diff --git a/source/Symbol/ObjectFile.cpp b/source/Symbol/ObjectFile.cpp
index 2129a4463cdd..59012b1f8261 100644
--- a/source/Symbol/ObjectFile.cpp
+++ b/source/Symbol/ObjectFile.cpp
@@ -8,7 +8,6 @@
//===----------------------------------------------------------------------===//
#include "lldb/Symbol/ObjectFile.h"
-#include "Plugins/ObjectContainer/BSD-Archive/ObjectContainerBSDArchive.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
@@ -16,7 +15,6 @@
#include "lldb/Symbol/ObjectContainer.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Target/Process.h"
-#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Utility/DataBuffer.h"
@@ -51,10 +49,9 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
const bool file_exists = file->Exists();
if (!data_sp) {
- // We have an object name which most likely means we have
- // a .o file in a static archive (.a file). Try and see if
- // we have a cached archive first without reading any data
- // first
+ // We have an object name which most likely means we have a .o file in
+ // a static archive (.a file). Try and see if we have a cached archive
+ // first without reading any data first
if (file_exists && module_sp->GetObjectName()) {
for (uint32_t idx = 0;
(create_object_container_callback =
@@ -73,10 +70,10 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
return object_file_sp;
}
}
- // Ok, we didn't find any containers that have a named object, now
- // lets read the first 512 bytes from the file so the object file
- // and object container plug-ins can use these bytes to see if they
- // can parse this file.
+ // Ok, we didn't find any containers that have a named object, now lets
+ // read the first 512 bytes from the file so the object file and object
+ // container plug-ins can use these bytes to see if they can parse this
+ // file.
if (file_size > 0) {
data_sp =
DataBufferLLVM::CreateSliceFromPath(file->GetPath(), 512, file_offset);
@@ -99,11 +96,12 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
file = &archive_file;
module_sp->SetFileSpecAndObjectName(archive_file, archive_object);
// Check if this is a object container by iterating through all
- // object
- // container plugin instances and then trying to get an object file
- // from the container plugins since we had a name. Also, don't read
+ // object container plugin instances and then trying to get an
+ // object file from the container plugins since we had a name.
+ // Also, don't read
// ANY data in case there is data cached in the container plug-ins
- // (like BSD archives caching the contained objects within an file).
+ // (like BSD archives caching the contained objects within an
+ // file).
for (uint32_t idx = 0;
(create_object_container_callback =
PluginManager::GetObjectContainerCreateCallbackAtIndex(
@@ -120,8 +118,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
if (object_file_sp.get())
return object_file_sp;
}
- // We failed to find any cached object files in the container
- // plug-ins, so lets read the first 512 bytes and try again below...
+ // We failed to find any cached object files in the container plug-
+ // ins, so lets read the first 512 bytes and try again below...
data_sp = DataBufferLLVM::CreateSliceFromPath(archive_file.GetPath(),
512, file_offset);
}
@@ -129,8 +127,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
}
if (data_sp && data_sp->GetByteSize() > 0) {
- // Check if this is a normal object file by iterating through
- // all object file plugin instances.
+ // Check if this is a normal object file by iterating through all
+ // object file plugin instances.
ObjectFileCreateInstance create_object_file_callback;
for (uint32_t idx = 0;
(create_object_file_callback =
@@ -143,9 +141,9 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
return object_file_sp;
}
- // Check if this is a object container by iterating through
- // all object container plugin instances and then trying to get
- // an object file from the container.
+ // Check if this is a object container by iterating through all object
+ // container plugin instances and then trying to get an object file
+ // from the container.
for (uint32_t idx = 0;
(create_object_container_callback =
PluginManager::GetObjectContainerCreateCallbackAtIndex(
@@ -164,8 +162,8 @@ ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp, const FileSpec *file,
}
}
}
- // We didn't find it, so clear our shared pointer in case it
- // contains anything and return an empty shared pointer
+ // We didn't find it, so clear our shared pointer in case it contains
+ // anything and return an empty shared pointer
object_file_sp.reset();
return object_file_sp;
}
@@ -186,8 +184,8 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
static_cast<void *>(process_sp.get()), header_addr);
uint32_t idx;
- // Check if this is a normal object file by iterating through
- // all object file plugin instances.
+ // Check if this is a normal object file by iterating through all object
+ // file plugin instances.
ObjectFileCreateMemoryInstance create_callback;
for (idx = 0;
(create_callback =
@@ -201,8 +199,8 @@ ObjectFileSP ObjectFile::FindPlugin(const lldb::ModuleSP &module_sp,
}
}
- // We didn't find it, so clear our shared pointer in case it
- // contains anything and return an empty shared pointer
+ // We didn't find it, so clear our shared pointer in case it contains
+ // anything and return an empty shared pointer
object_file_sp.reset();
return object_file_sp;
}
@@ -326,11 +324,11 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
const SectionType section_type = section_sp->GetType();
switch (section_type) {
case eSectionTypeInvalid:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeCode:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSectionTypeContainer:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeData:
case eSectionTypeDataCString:
case eSectionTypeDataCStringPointers:
@@ -343,7 +341,7 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDataObjCMessageRefs:
case eSectionTypeDataObjCCFStrings:
case eSectionTypeGoSymtab:
- return eAddressClassData;
+ return AddressClass::eData;
case eSectionTypeDebug:
case eSectionTypeDWARFDebugAbbrev:
case eSectionTypeDWARFDebugAddr:
@@ -355,33 +353,34 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
case eSectionTypeDWARFDebugLoc:
case eSectionTypeDWARFDebugMacInfo:
case eSectionTypeDWARFDebugMacro:
+ case eSectionTypeDWARFDebugNames:
case eSectionTypeDWARFDebugPubNames:
case eSectionTypeDWARFDebugPubTypes:
case eSectionTypeDWARFDebugRanges:
case eSectionTypeDWARFDebugStr:
case eSectionTypeDWARFDebugStrOffsets:
+ case eSectionTypeDWARFDebugTypes:
case eSectionTypeDWARFAppleNames:
case eSectionTypeDWARFAppleTypes:
case eSectionTypeDWARFAppleNamespaces:
case eSectionTypeDWARFAppleObjC:
- return eAddressClassDebug;
+ case eSectionTypeDWARFGNUDebugAltLink:
+ return AddressClass::eDebug;
case eSectionTypeEHFrame:
case eSectionTypeARMexidx:
case eSectionTypeARMextab:
case eSectionTypeCompactUnwind:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSectionTypeELFSymbolTable:
case eSectionTypeELFDynamicSymbols:
case eSectionTypeELFRelocationEntries:
case eSectionTypeELFDynamicLinkInfo:
case eSectionTypeOther:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSectionTypeAbsoluteAddress:
// In case of absolute sections decide the address class based on
- // the symbol
- // type because the section type isn't specify if it is a code or a
- // data
- // section.
+ // the symbol type because the section type isn't specify if it is
+ // a code or a data section.
break;
}
}
@@ -390,67 +389,67 @@ AddressClass ObjectFile::GetAddressClass(addr_t file_addr) {
const SymbolType symbol_type = symbol->GetType();
switch (symbol_type) {
case eSymbolTypeAny:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeAbsolute:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCode:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeTrampoline:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeResolver:
- return eAddressClassCode;
+ return AddressClass::eCode;
case eSymbolTypeData:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeRuntime:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeException:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeSourceFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeHeaderFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeObjectFile:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeCommonBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeBlock:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLocal:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeParam:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariable:
- return eAddressClassData;
+ return AddressClass::eData;
case eSymbolTypeVariableType:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineEntry:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeLineHeader:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeBegin:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeScopeEnd:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeAdditional:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeCompiler:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeInstrumentation:
- return eAddressClassDebug;
+ return AddressClass::eDebug;
case eSymbolTypeUndefined:
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
case eSymbolTypeObjCClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCMetaClass:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeObjCIVar:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
case eSymbolTypeReExported:
- return eAddressClassRuntime;
+ return AddressClass::eRuntime;
}
}
}
- return eAddressClassUnknown;
+ return AddressClass::eUnknown;
}
DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,
@@ -470,16 +469,14 @@ DataBufferSP ObjectFile::ReadMemory(const ProcessSP &process_sp,
size_t ObjectFile::GetData(lldb::offset_t offset, size_t length,
DataExtractor &data) const {
// The entire file has already been mmap'ed into m_data, so just copy from
- // there
- // as the back mmap buffer will be shared with shared pointers.
+ // there as the back mmap buffer will be shared with shared pointers.
return data.SetData(m_data, offset, length);
}
size_t ObjectFile::CopyData(lldb::offset_t offset, size_t length,
void *dst) const {
// The entire file has already been mmap'ed into m_data, so just copy from
- // there
- // Note that the data remains in target byte order.
+ // there Note that the data remains in target byte order.
return m_data.CopyData(offset, length, dst);
}
@@ -559,8 +556,8 @@ size_t ObjectFile::ReadSectionData(Section *section,
return GetData(section->GetFileOffset(), section->GetFileSize(),
section_data);
} else {
- // The object file now contains a full mmap'ed copy of the object file data,
- // so just use this
+ // The object file now contains a full mmap'ed copy of the object file
+ // data, so just use this
if (!section->IsRelocated())
RelocateSection(section);
@@ -581,7 +578,7 @@ bool ObjectFile::SplitArchivePathWithObject(const char *path_with_object,
std::string obj;
if (regex_match.GetMatchAtIndex(path_with_object, 1, path) &&
regex_match.GetMatchAtIndex(path_with_object, 2, obj)) {
- archive_file.SetFile(path, false);
+ archive_file.SetFile(path, false, FileSpec::Style::native);
archive_object.SetCString(obj.c_str());
if (must_exist && !archive_file.Exists())
return false;
@@ -648,41 +645,31 @@ ConstString ObjectFile::GetNextSyntheticSymbolName() {
return ConstString(ss.GetString());
}
-Status ObjectFile::LoadInMemory(Target &target, bool set_pc) {
- Status error;
- ProcessSP process = target.CalculateProcess();
- if (!process)
- return Status("No Process");
- if (set_pc && !GetEntryPointAddress().IsValid())
- return Status("No entry address in object file");
-
+std::vector<ObjectFile::LoadableData>
+ObjectFile::GetLoadableData(Target &target) {
+ std::vector<LoadableData> loadables;
SectionList *section_list = GetSectionList();
if (!section_list)
- return Status("No section in object file");
+ return loadables;
+ // Create a list of loadable data from loadable sections
size_t section_count = section_list->GetNumSections(0);
for (size_t i = 0; i < section_count; ++i) {
+ LoadableData loadable;
SectionSP section_sp = section_list->GetSectionAtIndex(i);
- addr_t addr = target.GetSectionLoadList().GetSectionLoadAddress(section_sp);
- if (addr != LLDB_INVALID_ADDRESS) {
- DataExtractor section_data;
- // We can skip sections like bss
- if (section_sp->GetFileSize() == 0)
- continue;
- section_sp->GetSectionData(section_data);
- lldb::offset_t written = process->WriteMemory(
- addr, section_data.GetDataStart(), section_data.GetByteSize(), error);
- if (written != section_data.GetByteSize())
- return error;
- }
- }
- if (set_pc) {
- ThreadList &thread_list = process->GetThreadList();
- ThreadSP curr_thread(thread_list.GetSelectedThread());
- RegisterContextSP reg_context(curr_thread->GetRegisterContext());
- Address file_entry = GetEntryPointAddress();
- reg_context->SetPC(file_entry.GetLoadAddress(&target));
+ loadable.Dest =
+ target.GetSectionLoadList().GetSectionLoadAddress(section_sp);
+ if (loadable.Dest == LLDB_INVALID_ADDRESS)
+ continue;
+ // We can skip sections like bss
+ if (section_sp->GetFileSize() == 0)
+ continue;
+ DataExtractor section_data;
+ section_sp->GetSectionData(section_data);
+ loadable.Contents = llvm::ArrayRef<uint8_t>(section_data.GetDataStart(),
+ section_data.GetByteSize());
+ loadables.push_back(loadable);
}
- return error;
+ return loadables;
}
void ObjectFile::RelocateSection(lldb_private::Section *section)
diff --git a/source/Symbol/Symbol.cpp b/source/Symbol/Symbol.cpp
index ab297ef330f2..69fd5424bd9a 100644
--- a/source/Symbol/Symbol.cpp
+++ b/source/Symbol/Symbol.cpp
@@ -122,9 +122,9 @@ ConstString Symbol::GetDisplayName() const {
ConstString Symbol::GetReExportedSymbolName() const {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address. We can
- // then make this back into a string that is the re-exported name.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address. We can then make this
+ // back into a string that is the re-exported name.
intptr_t str_ptr = m_addr_range.GetBaseAddress().GetOffset();
if (str_ptr != 0)
return ConstString((const char *)str_ptr);
@@ -136,9 +136,9 @@ ConstString Symbol::GetReExportedSymbolName() const {
FileSpec Symbol::GetReExportedSymbolSharedLibrary() const {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address. We can
- // then make this back into a string that is the re-exported name.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address. We can then make this
+ // back into a string that is the re-exported name.
intptr_t str_ptr = m_addr_range.GetByteSize();
if (str_ptr != 0)
return FileSpec((const char *)str_ptr, false);
@@ -148,15 +148,15 @@ FileSpec Symbol::GetReExportedSymbolSharedLibrary() const {
void Symbol::SetReExportedSymbolName(const ConstString &name) {
SetType(eSymbolTypeReExported);
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address.
m_addr_range.GetBaseAddress().SetOffset((uintptr_t)name.GetCString());
}
bool Symbol::SetReExportedSymbolSharedLibrary(const FileSpec &fspec) {
if (m_type == eSymbolTypeReExported) {
- // For eSymbolTypeReExported, the "const char *" from a ConstString
- // is used as the offset in the address range base address.
+ // For eSymbolTypeReExported, the "const char *" from a ConstString is used
+ // as the offset in the address range base address.
m_addr_range.SetByteSize(
(uintptr_t)ConstString(fspec.GetPath().c_str()).GetCString());
return true;
@@ -262,9 +262,8 @@ uint32_t Symbol::GetPrologueByteSize() {
Function *function = base_address.CalculateSymbolContextFunction();
if (function) {
// Functions have line entries which can also potentially have end of
- // prologue information.
- // So if this symbol points to a function, use the prologue information
- // from there.
+ // prologue information. So if this symbol points to a function, use
+ // the prologue information from there.
m_type_data = function->GetPrologueByteSize();
} else {
ModuleSP module_sp(base_address.GetModule());
@@ -280,10 +279,9 @@ uint32_t Symbol::GetPrologueByteSize() {
Address addr(base_address);
addr.Slide(m_type_data);
- // Check the first few instructions and look for one that has a line
- // number that is
- // different than the first entry. This is also done in
- // Function::GetPrologueByteSize().
+ // Check the first few instructions and look for one that has a
+ // line number that is different than the first entry. This is also
+ // done in Function::GetPrologueByteSize().
uint16_t total_offset = m_type_data;
for (int idx = 0; idx < 6; ++idx) {
SymbolContext sc_temp;
@@ -293,8 +291,8 @@ uint32_t Symbol::GetPrologueByteSize() {
if (!(resolved_flags & eSymbolContextLineEntry))
break;
- // If this line number is different than our first one, use it and
- // we're done.
+ // If this line number is different than our first one, use it
+ // and we're done.
if (sc_temp.line_entry.line != sc.line_entry.line) {
m_type_data = total_offset;
break;
@@ -309,12 +307,10 @@ uint32_t Symbol::GetPrologueByteSize() {
}
// Sanity check - this may be a function in the middle of code that
- // has debug information, but
- // not for this symbol. So the line entries surrounding us won't
- // lie inside our function.
- // In that case, the line entry will be bigger than we are, so we do
- // that quick check and
- // if that is true, we just return 0.
+ // has debug information, but not for this symbol. So the line
+ // entries surrounding us won't lie inside our function. In that
+ // case, the line entry will be bigger than we are, so we do that
+ // quick check and if that is true, we just return 0.
if (m_type_data >= m_addr_range.GetByteSize())
m_type_data = 0;
} else {
@@ -420,9 +416,9 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
// Try searching for the module file spec first using the full path
module_sp = target.GetImages().FindFirstModule(module_spec);
if (!module_sp) {
- // Next try and find the module by basename in case environment
- // variables or other runtime trickery causes shared libraries
- // to be loaded from alternate paths
+ // Next try and find the module by basename in case environment variables
+ // or other runtime trickery causes shared libraries to be loaded from
+ // alternate paths
module_spec.GetFileSpec().GetDirectory().Clear();
module_sp = target.GetImages().FindFirstModule(module_spec);
}
@@ -430,8 +426,7 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
if (module_sp) {
// There should not be cycles in the reexport list, but we don't want to
- // crash if there are so make sure
- // we haven't seen this before:
+ // crash if there are so make sure we haven't seen this before:
if (!seen_modules.AppendIfNeeded(module_sp))
return nullptr;
@@ -449,8 +444,8 @@ Symbol *Symbol::ResolveReExportedSymbolInModuleSpec(
}
}
// If we didn't find the symbol in this module, it may be because this
- // module re-exports some
- // whole other library. We have to search those as well:
+ // module re-exports some whole other library. We have to search those as
+ // well:
seen_modules.Append(module_sp);
FileSpecList reexported_libraries =
diff --git a/source/Symbol/SymbolContext.cpp b/source/Symbol/SymbolContext.cpp
index 4ac35010c74c..8716f50a384d 100644
--- a/source/Symbol/SymbolContext.cpp
+++ b/source/Symbol/SymbolContext.cpp
@@ -359,8 +359,7 @@ void SymbolContext::Dump(Stream *s, Target *target) const {
if (block != nullptr)
*s << " {0x" << block->GetID() << '}';
// Dump the block and pass it a negative depth to we print all the parent
- // blocks
- // if (block != NULL)
+ // blocks if (block != NULL)
// block->Dump(s, function->GetFileAddress(), INT_MIN);
s->EOL();
s->Indent();
@@ -468,27 +467,27 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc,
if (block) {
// const addr_t curr_frame_file_addr = curr_frame_pc.GetFileAddress();
- // In order to get the parent of an inlined function we first need to
- // see if we are in an inlined block as "this->block" could be an
- // inlined block, or a parent of "block" could be. So lets check if
- // this block or one of this blocks parents is an inlined function.
+ // In order to get the parent of an inlined function we first need to see
+ // if we are in an inlined block as "this->block" could be an inlined
+ // block, or a parent of "block" could be. So lets check if this block or
+ // one of this blocks parents is an inlined function.
Block *curr_inlined_block = block->GetContainingInlinedBlock();
if (curr_inlined_block) {
- // "this->block" is contained in an inline function block, so to
- // get the scope above the inlined block, we get the parent of the
- // inlined block itself
+ // "this->block" is contained in an inline function block, so to get the
+ // scope above the inlined block, we get the parent of the inlined block
+ // itself
Block *next_frame_block = curr_inlined_block->GetParent();
// Now calculate the symbol context of the containing block
next_frame_block->CalculateSymbolContext(&next_frame_sc);
// If we get here we weren't able to find the return line entry using the
- // nesting of the blocks and
- // the line table. So just use the call site info from our inlined block.
+ // nesting of the blocks and the line table. So just use the call site
+ // info from our inlined block.
AddressRange range;
if (curr_inlined_block->GetRangeContainingAddress(curr_frame_pc, range)) {
- // To see there this new frame block it, we need to look at the
- // call site information from
+ // To see there this new frame block it, we need to look at the call
+ // site information from
const InlineFunctionInfo *curr_inlined_block_inlined_info =
curr_inlined_block->GetInlinedFunctionInfo();
next_frame_pc = range.GetBaseAddress();
@@ -550,22 +549,22 @@ bool SymbolContext::GetParentOfInlinedScope(const Address &curr_frame_pc,
Block *SymbolContext::GetFunctionBlock() {
if (function) {
if (block) {
- // If this symbol context has a block, check to see if this block
- // is itself, or is contained within a block with inlined function
- // information. If so, then the inlined block is the block that
- // defines the function.
+ // If this symbol context has a block, check to see if this block is
+ // itself, or is contained within a block with inlined function
+ // information. If so, then the inlined block is the block that defines
+ // the function.
Block *inlined_block = block->GetContainingInlinedBlock();
if (inlined_block)
return inlined_block;
- // The block in this symbol context is not inside an inlined
- // block, so the block that defines the function is the function's
- // top level block, which is returned below.
+ // The block in this symbol context is not inside an inlined block, so
+ // the block that defines the function is the function's top level block,
+ // which is returned below.
}
- // There is no block information in this symbol context, so we must
- // assume that the block that is desired is the top level block of
- // the function itself.
+ // There is no block information in this symbol context, so we must assume
+ // that the block that is desired is the top level block of the function
+ // itself.
return &function->GetBlock(true);
}
return nullptr;
@@ -594,8 +593,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
isInlinedblock = true;
//----------------------------------------------------------------------
- // Find all types that match the current block if we have one and put
- // them first in the list. Keep iterating up through all blocks.
+ // Find all types that match the current block if we have one and put them
+ // first in the list. Keep iterating up through all blocks.
//----------------------------------------------------------------------
while (curr_block != nullptr && !isInlinedblock) {
type_map.ForEach(
@@ -606,8 +605,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
type_list.ForEach([&type_map](const lldb::TypeSP &type_sp) -> bool {
type_map.Remove(type_sp);
return true; // Keep iterating
@@ -615,8 +614,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
curr_block = curr_block->GetParent();
}
//----------------------------------------------------------------------
- // Find all types that match the current function, if we have onem, and
- // put them next in the list.
+ // Find all types that match the current function, if we have onem, and put
+ // them next in the list.
//----------------------------------------------------------------------
if (function != nullptr && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -627,8 +626,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -636,8 +635,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
}
}
//----------------------------------------------------------------------
- // Find all types that match the current compile unit, if we have one,
- // and put them next in the list.
+ // Find all types that match the current compile unit, if we have one, and
+ // put them next in the list.
//----------------------------------------------------------------------
if (comp_unit != nullptr && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -649,8 +648,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -658,8 +657,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
}
}
//----------------------------------------------------------------------
- // Find all types that match the current module, if we have one, and put
- // them next in the list.
+ // Find all types that match the current module, if we have one, and put them
+ // next in the list.
//----------------------------------------------------------------------
if (module_sp && !type_map.Empty()) {
const size_t old_type_list_size = type_list.GetSize();
@@ -669,8 +668,8 @@ void SymbolContext::SortTypeList(TypeMap &type_map, TypeList &type_list) const {
type_list.Insert(type_sp);
return true; // Keep iterating
});
- // Remove any entries that are now in "type_list" from "type_map"
- // since we can't remove from type_map while iterating
+ // Remove any entries that are now in "type_list" from "type_map" since we
+ // can't remove from type_map while iterating
const size_t new_type_list_size = type_list.GetSize();
if (new_type_list_size > old_type_list_size) {
for (size_t i = old_type_list_size; i < new_type_list_size; ++i)
@@ -831,9 +830,9 @@ SymbolContext::FindBestGlobalDataSymbol(const ConstString &name, Status &error)
case eSymbolTypeObjCMetaClass:
case eSymbolTypeObjCIVar:
if (symbol->GetDemangledNameIsSynthesized()) {
- // If the demangled name was synthesized, then don't use it
- // for expressions. Only let the symbol match if the mangled
- // named matches for these symbols.
+ // If the demangled name was synthesized, then don't use it for
+ // expressions. Only let the symbol match if the mangled named
+ // matches for these symbols.
if (symbol->GetMangled().GetMangledName() != name)
break;
}
@@ -861,8 +860,8 @@ SymbolContext::FindBestGlobalDataSymbol(const ConstString &name, Status &error)
target.GetImages().FindFirstModule(reexport_module_spec);
}
}
- // Don't allow us to try and resolve a re-exported symbol if it is
- // the same as the current symbol
+ // Don't allow us to try and resolve a re-exported symbol if it
+ // is the same as the current symbol
if (name == symbol->GetReExportedSymbolName() &&
module == reexport_module_sp.get())
return nullptr;
@@ -1012,9 +1011,8 @@ bool SymbolContextSpecifier::AddSpecification(const char *spec_string,
} break;
case eFileSpecified:
// CompUnits can't necessarily be resolved here, since an inlined function
- // might show up in
- // a number of CompUnits. Instead we just convert to a FileSpec and store
- // it away.
+ // might show up in a number of CompUnits. Instead we just convert to a
+ // FileSpec and store it away.
m_file_spec_ap.reset(new FileSpec(spec_string, false));
m_type |= eFileSpecified;
break;
diff --git a/source/Symbol/SymbolFile.cpp b/source/Symbol/SymbolFile.cpp
index eb20b80f4916..6b4da9c53009 100644
--- a/source/Symbol/SymbolFile.cpp
+++ b/source/Symbol/SymbolFile.cpp
@@ -30,8 +30,7 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
if (obj_file != nullptr) {
// We need to test the abilities of this section list. So create what it
- // would
- // be with this new obj_file.
+ // would be with this new obj_file.
lldb::ModuleSP module_sp(obj_file->GetModule());
if (module_sp) {
// Default to the main module section list.
@@ -60,16 +59,16 @@ SymbolFile *SymbolFile::FindPlugin(ObjectFile *obj_file) {
if (sym_file_abilities > best_symfile_abilities) {
best_symfile_abilities = sym_file_abilities;
best_symfile_ap.reset(curr_symfile_ap.release());
- // If any symbol file parser has all of the abilities, then
- // we should just stop looking.
+ // If any symbol file parser has all of the abilities, then we should
+ // just stop looking.
if ((kAllAbilities & sym_file_abilities) == kAllAbilities)
break;
}
}
}
if (best_symfile_ap.get()) {
- // Let the winning symbol file parser initialize itself more
- // completely now that it has been chosen
+ // Let the winning symbol file parser initialize itself more completely
+ // now that it has been chosen
best_symfile_ap->InitializeObject();
}
}
@@ -97,19 +96,16 @@ uint32_t SymbolFile::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
}
-uint32_t SymbolFile::FindGlobalVariables(
- const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, uint32_t max_matches, VariableList &variables) {
- if (!append)
- variables.Clear();
+uint32_t
+SymbolFile::FindGlobalVariables(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ uint32_t max_matches, VariableList &variables) {
return 0;
}
uint32_t SymbolFile::FindGlobalVariables(const RegularExpression &regex,
- bool append, uint32_t max_matches,
+ uint32_t max_matches,
VariableList &variables) {
- if (!append)
- variables.Clear();
return 0;
}
diff --git a/source/Symbol/SymbolVendor.cpp b/source/Symbol/SymbolVendor.cpp
index f5a08739f24d..245f7bbf8add 100644
--- a/source/Symbol/SymbolVendor.cpp
+++ b/source/Symbol/SymbolVendor.cpp
@@ -26,9 +26,9 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// FindPlugin
//
-// Platforms can register a callback to use when creating symbol
-// vendors to allow for complex debug information file setups, and to
-// also allow for finding separate debug information files.
+// Platforms can register a callback to use when creating symbol vendors to
+// allow for complex debug information file setups, and to also allow for
+// finding separate debug information files.
//----------------------------------------------------------------------
SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp,
lldb_private::Stream *feedback_strm) {
@@ -45,8 +45,8 @@ SymbolVendor *SymbolVendor::FindPlugin(const lldb::ModuleSP &module_sp,
return instance_ap.release();
}
}
- // The default implementation just tries to create debug information using the
- // file representation for the module.
+ // The default implementation just tries to create debug information using
+ // the file representation for the module.
instance_ap.reset(new SymbolVendor(module_sp));
if (instance_ap.get()) {
ObjectFile *objfile = module_sp->GetObjectFile();
@@ -88,11 +88,11 @@ bool SymbolVendor::SetCompileUnitAtIndex(size_t idx, const CompUnitSP &cu_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
const size_t num_compile_units = GetNumCompileUnits();
if (idx < num_compile_units) {
- // Fire off an assertion if this compile unit already exists for now.
- // The partial parsing should take care of only setting the compile
- // unit once, so if this assertion fails, we need to make sure that
- // we don't have a race condition, or have a second parse of the same
- // compile unit.
+ // Fire off an assertion if this compile unit already exists for now. The
+ // partial parsing should take care of only setting the compile unit
+ // once, so if this assertion fails, we need to make sure that we don't
+ // have a race condition, or have a second parse of the same compile
+ // unit.
assert(m_compile_units[idx].get() == nullptr);
m_compile_units[idx] = cu_sp;
return true;
@@ -111,10 +111,10 @@ size_t SymbolVendor::GetNumCompileUnits() {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_compile_units.empty()) {
if (m_sym_file_ap.get()) {
- // Resize our array of compile unit shared pointers -- which will
- // each remain NULL until someone asks for the actual compile unit
- // information. When this happens, the symbol file will be asked
- // to parse this compile unit information.
+ // Resize our array of compile unit shared pointers -- which will each
+ // remain NULL until someone asks for the actual compile unit
+ // information. When this happens, the symbol file will be asked to
+ // parse this compile unit information.
m_compile_units.resize(m_sym_file_ap->GetNumCompileUnits());
}
}
@@ -260,28 +260,28 @@ uint32_t SymbolVendor::ResolveSymbolContext(const FileSpec &file_spec,
return 0;
}
-size_t SymbolVendor::FindGlobalVariables(
- const ConstString &name, const CompilerDeclContext *parent_decl_ctx,
- bool append, size_t max_matches, VariableList &variables) {
+size_t
+SymbolVendor::FindGlobalVariables(const ConstString &name,
+ const CompilerDeclContext *parent_decl_ctx,
+ size_t max_matches, VariableList &variables) {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx, append,
+ return m_sym_file_ap->FindGlobalVariables(name, parent_decl_ctx,
max_matches, variables);
}
return 0;
}
size_t SymbolVendor::FindGlobalVariables(const RegularExpression &regex,
- bool append, size_t max_matches,
+ size_t max_matches,
VariableList &variables) {
ModuleSP module_sp(GetModule());
if (module_sp) {
std::lock_guard<std::recursive_mutex> guard(module_sp->GetMutex());
if (m_sym_file_ap.get())
- return m_sym_file_ap->FindGlobalVariables(regex, append, max_matches,
- variables);
+ return m_sym_file_ap->FindGlobalVariables(regex, max_matches, variables);
}
return 0;
}
@@ -392,6 +392,8 @@ void SymbolVendor::Dump(Stream *s) {
}
}
s->EOL();
+ if (m_sym_file_ap)
+ m_sym_file_ap->Dump(*s);
s->IndentMore();
m_type_list.Dump(s, show_context);
diff --git a/source/Symbol/Symtab.cpp b/source/Symbol/Symtab.cpp
index 4ac30649110f..c502b18555f0 100644
--- a/source/Symbol/Symtab.cpp
+++ b/source/Symbol/Symtab.cpp
@@ -100,9 +100,8 @@ void Symtab::Dump(Stream *s, Target *target, SortOrder sort_order) {
} break;
case eSortOrderByName: {
- // Although we maintain a lookup by exact name map, the table
- // isn't sorted by name. So we must make the ordered symbol list
- // up ourselves.
+ // Although we maintain a lookup by exact name map, the table isn't
+ // sorted by name. So we must make the ordered symbol list up ourselves.
s->PutCString(" (sorted by name):\n");
DumpSymbolHeader(s);
typedef std::multimap<const char *, const Symbol *,
@@ -228,8 +227,8 @@ void Symtab::InitNameIndexes() {
m_name_to_index.Reserve(num_symbols);
#else
// TODO: benchmark this to see if we save any memory. Otherwise we
- // will always keep the memory reserved in the vector unless we pull
- // some STL swap magic and then recopy...
+ // will always keep the memory reserved in the vector unless we pull some
+ // STL swap magic and then recopy...
uint32_t actual_count = 0;
for (const_iterator pos = m_symbols.begin(), end = m_symbols.end();
pos != end; ++pos) {
@@ -255,11 +254,10 @@ void Symtab::InitNameIndexes() {
for (entry.value = 0; entry.value < num_symbols; ++entry.value) {
const Symbol *symbol = &m_symbols[entry.value];
- // Don't let trampolines get into the lookup by name map
- // If we ever need the trampoline symbols to be searchable by name
- // we can remove this and then possibly add a new bool to any of the
- // Symtab functions that lookup symbols by name to indicate if they
- // want trampolines.
+ // Don't let trampolines get into the lookup by name map If we ever need
+ // the trampoline symbols to be searchable by name we can remove this and
+ // then possibly add a new bool to any of the Symtab functions that
+ // lookup symbols by name to indicate if they want trampolines.
if (symbol->IsTrampoline())
continue;
@@ -293,10 +291,9 @@ void Symtab::InitNameIndexes() {
mangled.GetDemangledName(lldb::eLanguageTypeC_plus_plus));
entry.cstring = ConstString(cxx_method.GetBasename());
if (entry.cstring) {
- // ConstString objects permanently store the string in the pool so
- // calling
- // GetCString() on the value gets us a const char * that will
- // never go away
+ // ConstString objects permanently store the string in the pool
+ // so calling GetCString() on the value gets us a const char *
+ // that will never go away
const char *const_context =
ConstString(cxx_method.GetContext()).GetCString();
@@ -312,25 +309,25 @@ void Symtab::InitNameIndexes() {
if (entry_ref[0] == '~' ||
!cxx_method.GetQualifiers().empty()) {
// The first character of the demangled basename is '~' which
- // means we have a class destructor. We can use this information
- // to help us know what is a class and what isn't.
+ // means we have a class destructor. We can use this
+ // information to help us know what is a class and what
+ // isn't.
if (class_contexts.find(const_context) == class_contexts.end())
class_contexts.insert(const_context);
m_method_to_index.Append(entry);
} else {
if (class_contexts.find(const_context) !=
class_contexts.end()) {
- // The current decl context is in our "class_contexts" which
- // means
- // this is a method on a class
+ // The current decl context is in our "class_contexts"
+ // which means this is a method on a class
m_method_to_index.Append(entry);
} else {
- // We don't know if this is a function basename or a method,
- // so put it into a temporary collection so once we are done
- // we can look in class_contexts to see if each entry is a
- // class
- // or just a function and will put any remaining items into
- // m_method_to_index or m_basename_to_index as needed
+ // We don't know if this is a function basename or a
+ // method, so put it into a temporary collection so once we
+ // are done we can look in class_contexts to see if each
+ // entry is a class or just a function and will put any
+ // remaining items into m_method_to_index or
+ // m_basename_to_index as needed
mangled_name_to_index.Append(entry);
symbol_contexts[entry.value] = const_context;
}
@@ -354,9 +351,8 @@ void Symtab::InitNameIndexes() {
}
}
- // If the demangled name turns out to be an ObjC name, and
- // is a category name, add the version without categories to the index
- // too.
+ // If the demangled name turns out to be an ObjC name, and is a category
+ // name, add the version without categories to the index too.
ObjCLanguage::MethodName objc_method(entry.cstring.GetStringRef(), true);
if (objc_method.IsValid(true)) {
entry.cstring = objc_method.GetSelector();
@@ -383,8 +379,7 @@ void Symtab::InitNameIndexes() {
m_method_to_index.Append(entry);
} else {
// If we got here, we have something that had a context (was inside
- // a namespace or class)
- // yet we don't know if the entry
+ // a namespace or class) yet we don't know if the entry
m_method_to_index.Append(entry);
m_basename_to_index.Append(entry);
}
@@ -520,20 +515,15 @@ struct SymbolIndexComparator {
std::vector<lldb::addr_t> &addr_cache;
// Getting from the symbol to the Address to the File Address involves some
- // work.
- // Since there are potentially many symbols here, and we're using this for
- // sorting so
- // we're going to be computing the address many times, cache that in
- // addr_cache.
- // The array passed in has to be the same size as the symbols array passed
- // into the
- // member variable symbols, and should be initialized with
- // LLDB_INVALID_ADDRESS.
+ // work. Since there are potentially many symbols here, and we're using this
+ // for sorting so we're going to be computing the address many times, cache
+ // that in addr_cache. The array passed in has to be the same size as the
+ // symbols array passed into the member variable symbols, and should be
+ // initialized with LLDB_INVALID_ADDRESS.
// NOTE: You have to make addr_cache externally and pass it in because
// std::stable_sort
// makes copies of the comparator it is initially passed in, and you end up
- // spending
- // huge amounts of time copying this array...
+ // spending huge amounts of time copying this array...
SymbolIndexComparator(const std::vector<Symbol> &s,
std::vector<lldb::addr_t> &a)
@@ -584,8 +574,7 @@ void Symtab::SortSymbolIndexesByValue(std::vector<uint32_t> &indexes,
// NOTE: The use of std::stable_sort instead of std::sort here is strictly for
// performance,
// not correctness. The indexes vector tends to be "close" to sorted, which
- // the
- // stable sort handles better.
+ // the stable sort handles better.
std::vector<lldb::addr_t> addr_cache(m_symbols.size(), LLDB_INVALID_ADDRESS);
@@ -752,14 +741,14 @@ Symtab::FindAllSymbolsWithNameAndType(const ConstString &name,
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
- // Initialize all of the lookup by name indexes before converting NAME
- // to a uniqued string NAME_STR below.
+ // Initialize all of the lookup by name indexes before converting NAME to a
+ // uniqued string NAME_STR below.
if (!m_name_indexes_computed)
InitNameIndexes();
if (name) {
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_indexes);
}
return symbol_indexes.size();
@@ -772,14 +761,14 @@ size_t Symtab::FindAllSymbolsWithNameAndType(
static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
Timer scoped_timer(func_cat, "%s", LLVM_PRETTY_FUNCTION);
- // Initialize all of the lookup by name indexes before converting NAME
- // to a uniqued string NAME_STR below.
+ // Initialize all of the lookup by name indexes before converting NAME to a
+ // uniqued string NAME_STR below.
if (!m_name_indexes_computed)
InitNameIndexes();
if (name) {
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_debug_type,
symbol_visibility, symbol_indexes);
}
@@ -810,8 +799,8 @@ Symbol *Symtab::FindFirstSymbolWithNameAndType(const ConstString &name,
if (name) {
std::vector<uint32_t> matching_indexes;
- // The string table did have a string that matched, but we need
- // to check the symbols and match the symbol_type if any was given.
+ // The string table did have a string that matched, but we need to check
+ // the symbols and match the symbol_type if any was given.
if (AppendSymbolIndexesWithNameAndType(name, symbol_type, symbol_debug_type,
symbol_visibility,
matching_indexes)) {
@@ -835,8 +824,8 @@ typedef struct {
addr_t match_offset;
} SymbolSearchInfo;
-// Add all the section file start address & size to the RangeVector,
-// recusively adding any children sections.
+// Add all the section file start address & size to the RangeVector, recusively
+// adding any children sections.
static void AddSectionsToRangeMap(SectionList *sectlist,
RangeVector<addr_t, addr_t> &section_ranges) {
const int num_sections = sectlist->GetNumSections(0);
@@ -885,9 +874,9 @@ void Symtab::InitAddressIndexes() {
// Create a RangeVector with the start & size of all the sections for
// this objfile. We'll need to check this for any FileRangeToIndexMap
- // entries with an uninitialized size, which could potentially be a
- // large number so reconstituting the weak pointer is busywork when it
- // is invariant information.
+ // entries with an uninitialized size, which could potentially be a large
+ // number so reconstituting the weak pointer is busywork when it is
+ // invariant information.
SectionList *sectlist = m_objfile->GetSectionList();
RangeVector<addr_t, addr_t> section_ranges;
if (sectlist) {
@@ -922,9 +911,8 @@ void Symtab::InitAddressIndexes() {
if (next_base_addr > curr_base_addr) {
addr_t size_to_next_symbol = next_base_addr - curr_base_addr;
- // Take the difference between this symbol and the next one as its
- // size,
- // if it is less than the size of the section.
+ // Take the difference between this symbol and the next one as
+ // its size, if it is less than the size of the section.
if (sym_size == 0 || size_to_next_symbol < sym_size) {
sym_size = size_to_next_symbol;
}
@@ -958,8 +946,7 @@ void Symtab::CalculateSymbolSizes() {
for (size_t i = 0; i < num_entries; ++i) {
// The entries in the m_file_addr_to_index have calculated the sizes
- // already
- // so we will use this size if we need to.
+ // already so we will use this size if we need to.
const FileRangeToIndexMap::Entry &entry =
m_file_addr_to_index.GetEntryRef(i);
@@ -1086,8 +1073,8 @@ size_t Symtab::FindFunctionSymbols(const ConstString &name,
}
if (name_type_mask & eFunctionNameTypeBase) {
- // From mangled names we can't tell what is a basename and what
- // is a method name, so we just treat them the same
+ // From mangled names we can't tell what is a basename and what is a method
+ // name, so we just treat them the same
if (!m_name_indexes_computed)
InitNameIndexes();
diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp
index 53bf3e850055..b62c55f76e2b 100644
--- a/source/Symbol/Type.cpp
+++ b/source/Symbol/Type.cpp
@@ -387,8 +387,8 @@ bool Type::DumpValueInMemory(ExecutionContext *exe_ctx, Stream *s,
bool Type::ReadFromMemory(ExecutionContext *exe_ctx, lldb::addr_t addr,
AddressType address_type, DataExtractor &data) {
if (address_type == eAddressTypeFile) {
- // Can't convert a file address to anything valid without more
- // context (which Module it came from)
+ // Can't convert a file address to anything valid without more context
+ // (which Module it came from)
return false;
}
@@ -533,10 +533,8 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
}
// When we have a EncodingUID, our "m_flags.compiler_type_resolve_state" is
- // set to eResolveStateUnresolved
- // so we need to update it to say that we now have a forward declaration
- // since that is what we created
- // above.
+ // set to eResolveStateUnresolved so we need to update it to say that we
+ // now have a forward declaration since that is what we created above.
if (m_compiler_type.IsValid())
m_flags.compiler_type_resolve_state = eResolveStateForward;
}
@@ -556,8 +554,8 @@ bool Type::ResolveClangType(ResolveState compiler_type_resolve_state) {
}
}
- // If we have an encoding type, then we need to make sure it is
- // resolved appropriately.
+ // If we have an encoding type, then we need to make sure it is resolved
+ // appropriately.
if (m_encoding_uid != LLDB_INVALID_UID) {
if (encoding_type == nullptr)
encoding_type = GetEncodingType();
@@ -847,35 +845,26 @@ TypeImpl &TypeImpl::operator=(const TypeImpl &rhs) {
}
bool TypeImpl::CheckModule(lldb::ModuleSP &module_sp) const {
- // Check if we have a module for this type. If we do and the shared pointer is
- // can be successfully initialized with m_module_wp, return true. Else return
- // false
- // if we didn't have a module, or if we had a module and it has been deleted.
- // Any
- // functions doing anything with a TypeSP in this TypeImpl class should call
- // this
- // function and only do anything with the ivars if this function returns true.
- // If
- // we have a module, the "module_sp" will be filled in with a strong reference
- // to the
- // module so that the module will at least stay around long enough for the
- // type
- // query to succeed.
+ // Check if we have a module for this type. If we do and the shared pointer
+ // is can be successfully initialized with m_module_wp, return true. Else
+ // return false if we didn't have a module, or if we had a module and it has
+ // been deleted. Any functions doing anything with a TypeSP in this TypeImpl
+ // class should call this function and only do anything with the ivars if
+ // this function returns true. If we have a module, the "module_sp" will be
+ // filled in with a strong reference to the module so that the module will at
+ // least stay around long enough for the type query to succeed.
module_sp = m_module_wp.lock();
if (!module_sp) {
lldb::ModuleWP empty_module_wp;
// If either call to "std::weak_ptr::owner_before(...) value returns true,
- // this
- // indicates that m_module_wp once contained (possibly still does) a
- // reference
- // to a valid shared pointer. This helps us know if we had a valid reference
- // to
- // a section which is now invalid because the module it was in was deleted
+ // this indicates that m_module_wp once contained (possibly still does) a
+ // reference to a valid shared pointer. This helps us know if we had a
+ // valid reference to a section which is now invalid because the module it
+ // was in was deleted
if (empty_module_wp.owner_before(m_module_wp) ||
m_module_wp.owner_before(empty_module_wp)) {
// m_module_wp had a valid reference to a module, but all strong
- // references
- // have been released and the module has been deleted
+ // references have been released and the module has been deleted
return false;
}
}
diff --git a/source/Symbol/TypeList.cpp b/source/Symbol/TypeList.cpp
index 4fcaff3daf90..4a0a06f3e8e3 100644
--- a/source/Symbol/TypeList.cpp
+++ b/source/Symbol/TypeList.cpp
@@ -32,7 +32,8 @@ TypeList::TypeList() : m_types() {}
TypeList::~TypeList() {}
void TypeList::Insert(const TypeSP &type_sp) {
- // Just push each type on the back for now. We will worry about uniquing later
+ // Just push each type on the back for now. We will worry about uniquing
+ // later
if (type_sp)
m_types.push_back(type_sp);
}
@@ -76,6 +77,7 @@ uint32_t TypeList::GetSize() const { return m_types.size(); }
TypeSP TypeList::GetTypeAtIndex(uint32_t idx) {
iterator pos, end;
uint32_t i = idx;
+ assert(i < GetSize() && "Accessing past the end of a TypeList");
for (pos = m_types.begin(), end = m_types.end(); pos != end; ++pos) {
if (i == 0)
return *pos;
@@ -123,10 +125,10 @@ void TypeList::RemoveMismatchedTypes(const char *qualified_typename,
void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
const std::string &type_basename,
TypeClass type_class, bool exact_match) {
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
@@ -161,19 +163,15 @@ void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
if (type_scope_pos == match_type_scope_size - type_scope_size) {
if (type_scope_pos >= 2) {
// Our match scope ends with the type scope we were looking
- // for,
- // but we need to make sure what comes before the matching
- // type scope is a namespace boundary in case we are trying to
- // match:
- // type_basename = "d"
- // type_scope = "b::c::"
+ // for, but we need to make sure what comes before the
+ // matching type scope is a namespace boundary in case we are
+ // trying to match: type_basename = "d" type_scope = "b::c::"
// We want to match:
// match_type_scope "a::b::c::"
// But not:
// match_type_scope "a::bb::c::"
// So below we make sure what comes before "b::c::" in
- // match_type_scope
- // is "::", or the namespace boundary
+ // match_type_scope is "::", or the namespace boundary
if (match_type_scope[type_scope_pos - 1] == ':' &&
match_type_scope[type_scope_pos - 2] == ':') {
keep_match = true;
@@ -184,9 +182,8 @@ void TypeList::RemoveMismatchedTypes(const std::string &type_scope,
}
}
} else {
- // The type we are currently looking at doesn't exists
- // in a namespace or class, so it only matches if there
- // is no type scope...
+ // The type we are currently looking at doesn't exists in a namespace
+ // or class, so it only matches if there is no type scope...
keep_match =
type_scope.empty() && type_basename.compare(match_type_name) == 0;
}
@@ -203,10 +200,10 @@ void TypeList::RemoveMismatchedTypes(TypeClass type_class) {
if (type_class == eTypeClassAny)
return;
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
diff --git a/source/Symbol/TypeMap.cpp b/source/Symbol/TypeMap.cpp
index 40c6558d5825..2838039ad603 100644
--- a/source/Symbol/TypeMap.cpp
+++ b/source/Symbol/TypeMap.cpp
@@ -45,7 +45,8 @@ TypeMap::TypeMap() : m_types() {}
TypeMap::~TypeMap() {}
void TypeMap::Insert(const TypeSP &type_sp) {
- // Just push each type on the back for now. We will worry about uniquing later
+ // Just push each type on the back for now. We will worry about uniquing
+ // later
if (type_sp)
m_types.insert(std::make_pair(type_sp->GetID(), type_sp));
}
@@ -167,10 +168,10 @@ void TypeMap::RemoveMismatchedTypes(const char *qualified_typename,
void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
const std::string &type_basename,
TypeClass type_class, bool exact_match) {
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
@@ -205,19 +206,15 @@ void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
if (type_scope_pos == match_type_scope_size - type_scope_size) {
if (type_scope_pos >= 2) {
// Our match scope ends with the type scope we were looking
- // for,
- // but we need to make sure what comes before the matching
- // type scope is a namespace boundary in case we are trying to
- // match:
- // type_basename = "d"
- // type_scope = "b::c::"
+ // for, but we need to make sure what comes before the
+ // matching type scope is a namespace boundary in case we are
+ // trying to match: type_basename = "d" type_scope = "b::c::"
// We want to match:
// match_type_scope "a::b::c::"
// But not:
// match_type_scope "a::bb::c::"
// So below we make sure what comes before "b::c::" in
- // match_type_scope
- // is "::", or the namespace boundary
+ // match_type_scope is "::", or the namespace boundary
if (match_type_scope[type_scope_pos - 1] == ':' &&
match_type_scope[type_scope_pos - 2] == ':') {
keep_match = true;
@@ -228,9 +225,8 @@ void TypeMap::RemoveMismatchedTypes(const std::string &type_scope,
}
}
} else {
- // The type we are currently looking at doesn't exists
- // in a namespace or class, so it only matches if there
- // is no type scope...
+ // The type we are currently looking at doesn't exists in a namespace
+ // or class, so it only matches if there is no type scope...
keep_match =
type_scope.empty() && type_basename.compare(match_type_name) == 0;
}
@@ -247,10 +243,10 @@ void TypeMap::RemoveMismatchedTypes(TypeClass type_class) {
if (type_class == eTypeClassAny)
return;
- // Our "collection" type currently is a std::map which doesn't
- // have any good way to iterate and remove items from the map
- // so we currently just make a new list and add all of the matching
- // types to it, and then swap it into m_types at the end
+ // Our "collection" type currently is a std::map which doesn't have any good
+ // way to iterate and remove items from the map so we currently just make a
+ // new list and add all of the matching types to it, and then swap it into
+ // m_types at the end
collection matching_types;
iterator pos, end = m_types.end();
diff --git a/source/Symbol/UnwindPlan.cpp b/source/Symbol/UnwindPlan.cpp
index 4c0014348c42..23ca1324ab06 100644
--- a/source/Symbol/UnwindPlan.cpp
+++ b/source/Symbol/UnwindPlan.cpp
@@ -46,8 +46,7 @@ operator==(const UnwindPlan::Row::RegisterLocation &rhs) const {
}
// This function doesn't copy the dwarf expression bytes; they must remain in
-// allocated
-// memory for the lifespan of this UnwindPlan object.
+// allocated memory for the lifespan of this UnwindPlan object.
void UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression(
const uint8_t *opcodes, uint32_t len) {
m_type = atDWARFExpression;
@@ -56,8 +55,7 @@ void UnwindPlan::Row::RegisterLocation::SetAtDWARFExpression(
}
// This function doesn't copy the dwarf expression bytes; they must remain in
-// allocated
-// memory for the lifespan of this UnwindPlan object.
+// allocated memory for the lifespan of this UnwindPlan object.
void UnwindPlan::Row::RegisterLocation::SetIsDWARFExpression(
const uint8_t *opcodes, uint32_t len) {
m_type = isDWARFExpression;
diff --git a/source/Symbol/UnwindTable.cpp b/source/Symbol/UnwindTable.cpp
index 405d57754ea5..7f98eaca2521 100644
--- a/source/Symbol/UnwindTable.cpp
+++ b/source/Symbol/UnwindTable.cpp
@@ -20,10 +20,9 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
-// There is one UnwindTable object per ObjectFile.
-// It contains a list of Unwind objects -- one per function, populated lazily --
-// for the ObjectFile.
-// Each Unwind object has multiple UnwindPlans for different scenarios.
+// There is one UnwindTable object per ObjectFile. It contains a list of Unwind
+// objects -- one per function, populated lazily -- for the ObjectFile. Each
+// Unwind object has multiple UnwindPlans for different scenarios.
using namespace lldb;
using namespace lldb_private;
@@ -33,8 +32,7 @@ UnwindTable::UnwindTable(ObjectFile &objfile)
m_eh_frame_up(), m_compact_unwind_up(), m_arm_unwind_up() {}
// We can't do some of this initialization when the ObjectFile is running its
-// ctor; delay doing it
-// until needed for something.
+// ctor; delay doing it until needed for something.
void UnwindTable::Initialize() {
if (m_initialized)
@@ -134,10 +132,9 @@ UnwindTable::GetFuncUnwindersContainingAddress(const Address &addr,
}
// Ignore any existing FuncUnwinders for this function, create a new one and
-// don't add it to the
-// UnwindTable. This is intended for use by target modules show-unwind where we
-// want to create
-// new UnwindPlans, not re-use existing ones.
+// don't add it to the UnwindTable. This is intended for use by target modules
+// show-unwind where we want to create new UnwindPlans, not re-use existing
+// ones.
FuncUnwindersSP
UnwindTable::GetUncachedFuncUnwindersContainingAddress(const Address &addr,
SymbolContext &sc) {
diff --git a/source/Symbol/Variable.cpp b/source/Symbol/Variable.cpp
index 1957bcef1f3a..7eafef1e8955 100644
--- a/source/Symbol/Variable.cpp
+++ b/source/Symbol/Variable.cpp
@@ -239,9 +239,8 @@ bool Variable::LocationIsValidForFrame(StackFrame *frame) {
target_sp.get());
if (loclist_base_load_addr == LLDB_INVALID_ADDRESS)
return false;
- // It is a location list. We just need to tell if the location
- // list contains the current address when converted to a load
- // address
+ // It is a location list. We just need to tell if the location list
+ // contains the current address when converted to a load address
return m_location.LocationListContainsAddress(
loclist_base_load_addr,
frame->GetFrameCodeAddress().GetLoadAddress(target_sp.get()));
@@ -251,8 +250,8 @@ bool Variable::LocationIsValidForFrame(StackFrame *frame) {
}
bool Variable::LocationIsValidForAddress(const Address &address) {
- // Be sure to resolve the address to section offset prior to
- // calling this function.
+ // Be sure to resolve the address to section offset prior to calling this
+ // function.
if (address.IsSectionOffset()) {
SymbolContext sc;
CalculateSymbolContext(&sc);
@@ -268,9 +267,8 @@ bool Variable::LocationIsValidForAddress(const Address &address) {
sc.function->GetAddressRange().GetBaseAddress().GetFileAddress();
if (loclist_base_file_addr == LLDB_INVALID_ADDRESS)
return false;
- // It is a location list. We just need to tell if the location
- // list contains the current address when converted to a load
- // address
+ // It is a location list. We just need to tell if the location list
+ // contains the current address when converted to a load address
return m_location.LocationListContainsAddress(loclist_base_file_addr,
address.GetFileAddress());
}
@@ -294,8 +292,8 @@ bool Variable::IsInScope(StackFrame *frame) {
case eValueTypeVariableArgument:
case eValueTypeVariableLocal:
if (frame) {
- // We don't have a location list, we just need to see if the block
- // that this variable was defined in is currently
+ // We don't have a location list, we just need to see if the block that
+ // this variable was defined in is currently
Block *deepest_frame_block =
frame->GetSymbolContext(eSymbolContextBlock).block;
if (deepest_frame_block) {
@@ -313,8 +311,7 @@ bool Variable::IsInScope(StackFrame *frame) {
return false;
// If no scope range is specified then it means that the scope is the
- // same as the
- // scope of the enclosing lexical block.
+ // same as the scope of the enclosing lexical block.
if (m_scope_range.IsEmpty())
return true;
@@ -455,8 +452,8 @@ Status Variable::GetValuesForVariableExpressionPath(
}
bool Variable::DumpLocationForAddress(Stream *s, const Address &address) {
- // Be sure to resolve the address to section offset prior to
- // calling this function.
+ // Be sure to resolve the address to section offset prior to calling this
+ // function.
if (address.IsSectionOffset()) {
SymbolContext sc;
CalculateSymbolContext(&sc);
@@ -759,13 +756,13 @@ static void PrivateAutoComplete(
}
size_t Variable::AutoComplete(const ExecutionContext &exe_ctx,
- llvm::StringRef partial_path, StringList &matches,
- bool &word_complete) {
- word_complete = false;
+ CompletionRequest &request) {
CompilerType compiler_type;
- PrivateAutoComplete(exe_ctx.GetFramePtr(), partial_path, "", compiler_type,
- matches, word_complete);
+ bool word_complete = false;
+ PrivateAutoComplete(exe_ctx.GetFramePtr(), request.GetCursorArgumentPrefix(),
+ "", compiler_type, request.GetMatches(), word_complete);
+ request.SetWordComplete(word_complete);
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
diff --git a/source/Target/ABI.cpp b/source/Target/ABI.cpp
index 72f58be5a3d4..8d4513ad6811 100644
--- a/source/Target/ABI.cpp
+++ b/source/Target/ABI.cpp
@@ -102,15 +102,18 @@ ValueObjectSP ABI::GetReturnValueObject(Thread &thread, CompilerType &ast_type,
// work.
if (persistent) {
+ Target &target = *thread.CalculateTarget();
PersistentExpressionState *persistent_expression_state =
- thread.CalculateTarget()->GetPersistentExpressionStateForLanguage(
+ target.GetPersistentExpressionStateForLanguage(
ast_type.GetMinimumLanguage());
if (!persistent_expression_state)
return ValueObjectSP();
- ConstString persistent_variable_name(
- persistent_expression_state->GetNextPersistentVariableName());
+ auto prefix = persistent_expression_state->GetPersistentVariablePrefix();
+ ConstString persistent_variable_name =
+ persistent_expression_state->GetNextPersistentVariableName(target,
+ prefix);
lldb::ValueObjectSP const_valobj_sp;
@@ -193,18 +196,18 @@ bool ABI::PrepareTrivialCall(Thread &thread, lldb::addr_t sp,
bool ABI::GetFallbackRegisterLocation(
const RegisterInfo *reg_info,
UnwindPlan::Row::RegisterLocation &unwind_regloc) {
- // Did the UnwindPlan fail to give us the caller's stack pointer?
- // The stack pointer is defined to be the same as THIS frame's CFA, so return
- // the CFA value as
- // the caller's stack pointer. This is true on x86-32/x86-64 at least.
+ // Did the UnwindPlan fail to give us the caller's stack pointer? The stack
+ // pointer is defined to be the same as THIS frame's CFA, so return the CFA
+ // value as the caller's stack pointer. This is true on x86-32/x86-64 at
+ // least.
if (reg_info->kinds[eRegisterKindGeneric] == LLDB_REGNUM_GENERIC_SP) {
unwind_regloc.SetIsCFAPlusOffset(0);
return true;
}
// If a volatile register is being requested, we don't want to forward the
- // next frame's register contents
- // up the stack -- the register is not retrievable at this frame.
+ // next frame's register contents up the stack -- the register is not
+ // retrievable at this frame.
if (RegisterIsVolatile(reg_info)) {
unwind_regloc.SetUndefined();
return true;
diff --git a/source/Target/CMakeLists.txt b/source/Target/CMakeLists.txt
index 1d858ae584d9..df137c314afa 100644
--- a/source/Target/CMakeLists.txt
+++ b/source/Target/CMakeLists.txt
@@ -1,5 +1,3 @@
-include_directories(../Plugins/Process/Utility)
-
add_lldb_library(lldbTarget
ABI.cpp
CPPLanguageRuntime.cpp
diff --git a/source/Target/ExecutionContext.cpp b/source/Target/ExecutionContext.cpp
index 3643c1590421..73c64916cf1f 100644
--- a/source/Target/ExecutionContext.cpp
+++ b/source/Target/ExecutionContext.cpp
@@ -369,15 +369,14 @@ ExecutionContext &ExecutionContext::operator=(const ExecutionContext &rhs) {
bool ExecutionContext::operator==(const ExecutionContext &rhs) const {
// Check that the frame shared pointers match, or both are valid and their
- // stack
- // IDs match since sometimes we get new objects that represent the same
+ // stack IDs match since sometimes we get new objects that represent the same
// frame within a thread.
if ((m_frame_sp == rhs.m_frame_sp) ||
(m_frame_sp && rhs.m_frame_sp &&
m_frame_sp->GetStackID() == rhs.m_frame_sp->GetStackID())) {
- // Check that the thread shared pointers match, or both are valid and
- // their thread IDs match since sometimes we get new objects that
- // represent the same thread within a process.
+ // Check that the thread shared pointers match, or both are valid and their
+ // thread IDs match since sometimes we get new objects that represent the
+ // same thread within a process.
if ((m_thread_sp == rhs.m_thread_sp) ||
(m_thread_sp && rhs.m_thread_sp &&
m_thread_sp->GetID() == rhs.m_thread_sp->GetID())) {
@@ -596,9 +595,9 @@ lldb::ThreadSP ExecutionContextRef::GetThreadSP() const {
lldb::ThreadSP thread_sp(m_thread_wp.lock());
if (m_tid != LLDB_INVALID_THREAD_ID) {
- // We check if the thread has been destroyed in cases where clients
- // might still have shared pointer to a thread, but the thread is
- // not valid anymore (not part of the process)
+ // We check if the thread has been destroyed in cases where clients might
+ // still have shared pointer to a thread, but the thread is not valid
+ // anymore (not part of the process)
if (!thread_sp || !thread_sp->IsValid()) {
lldb::ProcessSP process_sp(GetProcessSP());
if (process_sp && process_sp->IsValid()) {
@@ -608,9 +607,8 @@ lldb::ThreadSP ExecutionContextRef::GetThreadSP() const {
}
}
- // Check that we aren't about to return an invalid thread sp. We might return
- // a nullptr thread_sp,
- // but don't return an invalid one.
+ // Check that we aren't about to return an invalid thread sp. We might
+ // return a nullptr thread_sp, but don't return an invalid one.
if (thread_sp && !thread_sp->IsValid())
thread_sp.reset();
diff --git a/source/Target/Memory.cpp b/source/Target/Memory.cpp
index ced359418682..ad1b4093155d 100644
--- a/source/Target/Memory.cpp
+++ b/source/Target/Memory.cpp
@@ -133,12 +133,12 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len,
Status &error) {
size_t bytes_left = dst_len;
- // Check the L1 cache for a range that contain the entire memory read.
- // If we find a range in the L1 cache that does, we use it. Else we fall
- // back to reading memory in m_L2_cache_line_byte_size byte sized chunks.
- // The L1 cache contains chunks of memory that are not required to be
- // m_L2_cache_line_byte_size bytes in size, so we don't try anything
- // tricky when reading from them (no partial reads from the L1 cache).
+ // Check the L1 cache for a range that contain the entire memory read. If we
+ // find a range in the L1 cache that does, we use it. Else we fall back to
+ // reading memory in m_L2_cache_line_byte_size byte sized chunks. The L1
+ // cache contains chunks of memory that are not required to be
+ // m_L2_cache_line_byte_size bytes in size, so we don't try anything tricky
+ // when reading from them (no partial reads from the L1 cache).
std::lock_guard<std::recursive_mutex> guard(m_mutex);
if (!m_L1_cache.empty()) {
@@ -155,11 +155,11 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len,
}
}
- // If this memory read request is larger than the cache line size, then
- // we (1) try to read as much of it at once as possible, and (2) don't
- // add the data to the memory cache. We don't want to split a big read
- // up into more separate reads than necessary, and with a large memory read
- // request, it is unlikely that the caller function will ask for the next
+ // If this memory read request is larger than the cache line size, then we
+ // (1) try to read as much of it at once as possible, and (2) don't add the
+ // data to the memory cache. We don't want to split a big read up into more
+ // separate reads than necessary, and with a large memory read request, it is
+ // unlikely that the caller function will ask for the next
// 4 bytes after the large memory read - so there's little benefit to saving
// it in the cache.
if (dst && dst_len > m_L2_cache_line_byte_size) {
@@ -218,9 +218,9 @@ size_t MemoryCache::Read(addr_t addr, void *dst, size_t dst_len,
bytes_left -= curr_read_size;
curr_addr += curr_read_size;
- // We have a cache page that succeeded to read some bytes
- // but not an entire page. If this happens, we must cap
- // off how much data we are able to read...
+ // We have a cache page that succeeded to read some bytes but not
+ // an entire page. If this happens, we must cap off how much data
+ // we are able to read...
if (pos->second->GetByteSize() != cache_line_byte_size)
return dst_len - bytes_left;
}
@@ -277,8 +277,8 @@ lldb::addr_t AllocatedBlock::ReserveBlock(uint32_t size) {
if (range_size >= size)
{
// We found a free block that is big enough for our data. Figure out how
- // many chunks we will need and calculate the resulting block size we will
- // reserve.
+ // many chunks we will need and calculate the resulting block size we
+ // will reserve.
addr_t addr = free_block.GetRangeBase();
size_t num_chunks = CalculateChunksNeededForSize(size);
lldb::addr_t block_size = num_chunks * m_chunk_size;
@@ -296,8 +296,8 @@ lldb::addr_t AllocatedBlock::ReserveBlock(uint32_t size) {
// Make the new allocated range and add it to the allocated ranges.
Range<lldb::addr_t, uint32_t> reserved_block(free_block);
reserved_block.SetByteSize(block_size);
- // Insert the reserved range and don't combine it with other blocks
- // in the reserved blocks list.
+ // Insert the reserved range and don't combine it with other blocks in
+ // the reserved blocks list.
m_reserved_blocks.Insert(reserved_block, false);
// Adjust the free range in place since we won't change the sorted
// ordering of the m_free_blocks list.
diff --git a/source/Target/ModuleCache.cpp b/source/Target/ModuleCache.cpp
index 2b654772639a..19adfbabe277 100644
--- a/source/Target/ModuleCache.cpp
+++ b/source/Target/ModuleCache.cpp
@@ -312,9 +312,8 @@ Status ModuleCache::GetAndPut(const FileSpec &root_dir_spec,
llvm::FileRemover tmp_symfile_remover(tmp_download_sym_file_spec.GetPath());
if (error.Fail())
// Failed to download a symfile but fetching the module was successful. The
- // module might
- // contain the necessary symbols and the debugging is also possible without
- // a symfile.
+ // module might contain the necessary symbols and the debugging is also
+ // possible without a symfile.
return Status();
error = Put(root_dir_spec, escaped_hostname.c_str(), module_spec,
diff --git a/source/Target/ObjCLanguageRuntime.cpp b/source/Target/ObjCLanguageRuntime.cpp
index d3cc7c019dce..b1fcee6db63b 100644
--- a/source/Target/ObjCLanguageRuntime.cpp
+++ b/source/Target/ObjCLanguageRuntime.cpp
@@ -23,6 +23,7 @@
#include "lldb/Utility/Timer.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/DJB.h"
using namespace lldb;
using namespace lldb_private;
@@ -45,8 +46,7 @@ bool ObjCLanguageRuntime::AddClass(ObjCISA isa,
if (isa != 0) {
m_isa_to_descriptor[isa] = descriptor_sp;
// class_name is assumed to be valid
- m_hash_to_isa_map.insert(
- std::make_pair(MappedHash::HashStringUsingDJB(class_name), isa));
+ m_hash_to_isa_map.insert(std::make_pair(llvm::djbHash(class_name), isa));
return true;
}
return false;
@@ -170,8 +170,7 @@ ObjCLanguageRuntime::GetDescriptorIterator(const ConstString &name) {
UpdateISAToDescriptorMap();
if (m_hash_to_isa_map.empty()) {
// No name hashes were provided, we need to just linearly power through
- // the
- // names and find a match
+ // the names and find a match
for (ISAToDescriptorIterator pos = m_isa_to_descriptor.begin();
pos != end; ++pos) {
if (pos->second->GetClassName() == name)
@@ -180,8 +179,7 @@ ObjCLanguageRuntime::GetDescriptorIterator(const ConstString &name) {
} else {
// Name hashes were provided, so use them to efficiently lookup name to
// isa/descriptor
- const uint32_t name_hash =
- MappedHash::HashStringUsingDJB(name.GetCString());
+ const uint32_t name_hash = llvm::djbHash(name.GetStringRef());
std::pair<HashToISAIterator, HashToISAIterator> range =
m_hash_to_isa_map.equal_range(name_hash);
for (HashToISAIterator range_pos = range.first; range_pos != range.second;
@@ -240,9 +238,9 @@ ObjCLanguageRuntime::GetClassDescriptorFromClassName(
ObjCLanguageRuntime::ClassDescriptorSP
ObjCLanguageRuntime::GetClassDescriptor(ValueObject &valobj) {
ClassDescriptorSP objc_class_sp;
- // if we get an invalid VO (which might still happen when playing around
- // with pointers returned by the expression parser, don't consider this
- // a valid ObjC object)
+ // if we get an invalid VO (which might still happen when playing around with
+ // pointers returned by the expression parser, don't consider this a valid
+ // ObjC object)
if (valobj.GetCompilerType().IsValid()) {
addr_t isa_pointer = valobj.GetPointerValue();
if (isa_pointer != LLDB_INVALID_ADDRESS) {
diff --git a/source/Target/PathMappingList.cpp b/source/Target/PathMappingList.cpp
index 782c6e49623c..778728eebb09 100644
--- a/source/Target/PathMappingList.cpp
+++ b/source/Target/PathMappingList.cpp
@@ -14,6 +14,7 @@
// Other libraries and framework includes
// Project includes
+#include "lldb/lldb-private-enumerations.h"
#include "lldb/Host/PosixApi.h"
#include "lldb/Target/PathMappingList.h"
#include "lldb/Utility/FileSpec.h"
@@ -23,6 +24,22 @@
using namespace lldb;
using namespace lldb_private;
+namespace {
+ // We must normalize our path pairs that we store because if we don't then
+ // things won't always work. We found a case where if we did:
+ // (lldb) settings set target.source-map . /tmp
+ // We would store a path pairs of "." and "/tmp" as raw strings. If the debug
+ // info contains "./foo/bar.c", the path will get normalized to "foo/bar.c".
+ // When PathMappingList::RemapPath() is called, it expects the path to start
+ // with the raw path pair, which doesn't work anymore because the paths have
+ // been normalized when the debug info was loaded. So we need to store
+ // nomalized path pairs to ensure things match up.
+ ConstString NormalizePath(const ConstString &path) {
+ // If we use "path" to construct a FileSpec, it will normalize the path for
+ // us. We then grab the string and turn it back into a ConstString.
+ return ConstString(FileSpec(path.GetStringRef(), false).GetPath());
+ }
+}
//----------------------------------------------------------------------
// PathMappingList constructor
//----------------------------------------------------------------------
@@ -52,7 +69,7 @@ PathMappingList::~PathMappingList() = default;
void PathMappingList::Append(const ConstString &path,
const ConstString &replacement, bool notify) {
++m_mod_id;
- m_pairs.push_back(pair(path, replacement));
+ m_pairs.emplace_back(pair(NormalizePath(path), NormalizePath(replacement)));
if (notify && m_callback)
m_callback(*this, m_callback_baton);
}
@@ -77,7 +94,8 @@ void PathMappingList::Insert(const ConstString &path,
insert_iter = m_pairs.end();
else
insert_iter = m_pairs.begin() + index;
- m_pairs.insert(insert_iter, pair(path, replacement));
+ m_pairs.emplace(insert_iter, pair(NormalizePath(path),
+ NormalizePath(replacement)));
if (notify && m_callback)
m_callback(*this, m_callback_baton);
}
@@ -88,7 +106,7 @@ bool PathMappingList::Replace(const ConstString &path,
if (index >= m_pairs.size())
return false;
++m_mod_id;
- m_pairs[index] = pair(path, replacement);
+ m_pairs[index] = pair(NormalizePath(path), NormalizePath(replacement));
if (notify && m_callback)
m_callback(*this, m_callback_baton);
return true;
@@ -134,22 +152,10 @@ void PathMappingList::Clear(bool notify) {
bool PathMappingList::RemapPath(const ConstString &path,
ConstString &new_path) const {
- const char *path_cstr = path.GetCString();
- // CLEANUP: Convert this function to use StringRefs internally instead
- // of raw c-strings.
- if (!path_cstr)
- return false;
-
- const_iterator pos, end = m_pairs.end();
- for (pos = m_pairs.begin(); pos != end; ++pos) {
- const size_t prefixLen = pos->first.GetLength();
-
- if (::strncmp(pos->first.GetCString(), path_cstr, prefixLen) == 0) {
- std::string new_path_str(pos->second.GetCString());
- new_path_str.append(path.GetCString() + prefixLen);
- new_path.SetCString(new_path_str.c_str());
- return true;
- }
+ std::string remapped;
+ if (RemapPath(path.GetStringRef(), remapped)) {
+ new_path.SetString(remapped);
+ return true;
}
return false;
}
@@ -158,34 +164,41 @@ bool PathMappingList::RemapPath(llvm::StringRef path,
std::string &new_path) const {
if (m_pairs.empty() || path.empty())
return false;
-
- const_iterator pos, end = m_pairs.end();
- for (pos = m_pairs.begin(); pos != end; ++pos) {
- if (!path.consume_front(pos->first.GetStringRef()))
- continue;
-
- new_path = pos->second.GetStringRef();
- new_path.append(path);
+ LazyBool path_is_relative = eLazyBoolCalculate;
+ for (const auto &it : m_pairs) {
+ auto prefix = it.first.GetStringRef();
+ if (!path.consume_front(prefix)) {
+ // Relative paths won't have a leading "./" in them unless "." is the
+ // only thing in the relative path so we need to work around "."
+ // carefully.
+ if (prefix != ".")
+ continue;
+ // We need to figure out if the "path" argument is relative. If it is,
+ // then we should remap, else skip this entry.
+ if (path_is_relative == eLazyBoolCalculate) {
+ path_is_relative = FileSpec(path, false).IsRelative() ? eLazyBoolYes :
+ eLazyBoolNo;
+ }
+ if (!path_is_relative)
+ continue;
+ }
+ FileSpec remapped(it.second.GetStringRef(), false);
+ remapped.AppendPathComponent(path);
+ new_path = remapped.GetPath();
return true;
}
return false;
}
-bool PathMappingList::ReverseRemapPath(const ConstString &path,
- ConstString &new_path) const {
- const char *path_cstr = path.GetCString();
- if (!path_cstr)
- return false;
-
+bool PathMappingList::ReverseRemapPath(const FileSpec &file, FileSpec &fixed) const {
+ std::string path = file.GetPath();
+ llvm::StringRef path_ref(path);
for (const auto &it : m_pairs) {
- // FIXME: This should be using FileSpec API's to do the path appending.
- const size_t prefixLen = it.second.GetLength();
- if (::strncmp(it.second.GetCString(), path_cstr, prefixLen) == 0) {
- std::string new_path_str(it.first.GetCString());
- new_path_str.append(path.GetCString() + prefixLen);
- new_path.SetCString(new_path_str.c_str());
- return true;
- }
+ if (!path_ref.consume_front(it.second.GetStringRef()))
+ continue;
+ fixed.SetFile(it.first.GetStringRef(), false, FileSpec::Style::native);
+ fixed.AppendPathComponent(path_ref);
+ return true;
}
return false;
}
@@ -203,7 +216,8 @@ bool PathMappingList::FindFile(const FileSpec &orig_spec,
if (orig_path_len >= prefix_len) {
if (::strncmp(pos->first.GetCString(), orig_path, prefix_len) == 0) {
- new_spec.SetFile(pos->second.GetCString(), false);
+ new_spec.SetFile(pos->second.GetCString(), false,
+ FileSpec::Style::native);
new_spec.AppendPathComponent(orig_path + prefix_len);
if (new_spec.Exists())
return true;
@@ -277,7 +291,8 @@ bool PathMappingList::GetPathsAtIndex(uint32_t idx, ConstString &path,
return false;
}
-uint32_t PathMappingList::FindIndexForPath(const ConstString &path) const {
+uint32_t PathMappingList::FindIndexForPath(const ConstString &orig_path) const {
+ const ConstString path = NormalizePath(orig_path);
const_iterator pos;
const_iterator begin = m_pairs.begin();
const_iterator end = m_pairs.end();
diff --git a/source/Target/Platform.cpp b/source/Target/Platform.cpp
index 5d60bb791555..5ae556ecc02a 100644
--- a/source/Target/Platform.cpp
+++ b/source/Target/Platform.cpp
@@ -10,6 +10,7 @@
// C Includes
// C++ Includes
#include <algorithm>
+#include <csignal>
#include <fstream>
#include <vector>
@@ -45,8 +46,8 @@
#include "llvm/Support/FileSystem.h"
-// Define these constants from POSIX mman.h rather than include the file
-// so that they will be correct even when compiled on Linux.
+// Define these constants from POSIX mman.h rather than include the file so
+// that they will be correct even when compiled on Linux.
#define MAP_PRIVATE 2
#define MAP_ANON 0x1000
@@ -55,8 +56,8 @@ using namespace lldb_private;
static uint32_t g_initialize_count = 0;
-// Use a singleton function for g_local_platform_sp to avoid init
-// constructors since LLDB is often part of a shared library
+// Use a singleton function for g_local_platform_sp to avoid init constructors
+// since LLDB is often part of a shared library
static PlatformSP &GetHostPlatformSP() {
static PlatformSP g_platform_sp;
return g_platform_sp;
@@ -368,13 +369,11 @@ ArchSpec Platform::GetAugmentedArchSpec(Platform *platform, llvm::StringRef trip
Platform::Platform(bool is_host)
: m_is_host(is_host), m_os_version_set_while_connected(false),
m_system_arch_set_while_connected(false), m_sdk_sysroot(), m_sdk_build(),
- m_working_dir(), m_remote_url(), m_name(), m_major_os_version(UINT32_MAX),
- m_minor_os_version(UINT32_MAX), m_update_os_version(UINT32_MAX),
- m_system_arch(), m_mutex(), m_uid_map(), m_gid_map(),
- m_max_uid_name_len(0), m_max_gid_name_len(0), m_supports_rsync(false),
- m_rsync_opts(), m_rsync_prefix(), m_supports_ssh(false), m_ssh_opts(),
- m_ignores_remote_hostname(false), m_trap_handlers(),
- m_calculated_trap_handlers(false),
+ m_working_dir(), m_remote_url(), m_name(), m_system_arch(), m_mutex(),
+ m_uid_map(), m_gid_map(), m_max_uid_name_len(0), m_max_gid_name_len(0),
+ m_supports_rsync(false), m_rsync_opts(), m_rsync_prefix(),
+ m_supports_ssh(false), m_ssh_opts(), m_ignores_remote_hostname(false),
+ m_trap_handlers(), m_calculated_trap_handlers(false),
m_module_cache(llvm::make_unique<ModuleCache>()) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_OBJECT));
if (log)
@@ -394,9 +393,6 @@ Platform::~Platform() {
}
void Platform::GetStatus(Stream &strm) {
- uint32_t major = UINT32_MAX;
- uint32_t minor = UINT32_MAX;
- uint32_t update = UINT32_MAX;
std::string s;
strm.Printf(" Platform: %s\n", GetPluginName().GetCString());
@@ -409,12 +405,9 @@ void Platform::GetStatus(Stream &strm) {
}
}
- if (GetOSVersion(major, minor, update)) {
- strm.Printf("OS Version: %u", major);
- if (minor != UINT32_MAX)
- strm.Printf(".%u", minor);
- if (update != UINT32_MAX)
- strm.Printf(".%u", update);
+ llvm::VersionTuple os_version = GetOSVersion();
+ if (!os_version.empty()) {
+ strm.Format("OS Version: {0}", os_version.getAsString());
if (GetOSBuildString(s))
strm.Printf(" (%s)", s.c_str());
@@ -446,17 +439,14 @@ void Platform::GetStatus(Stream &strm) {
strm.Printf("Platform-specific connection: %s\n", specific_info.c_str());
}
-bool Platform::GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
- Process *process) {
+llvm::VersionTuple Platform::GetOSVersion(Process *process) {
std::lock_guard<std::mutex> guard(m_mutex);
- bool success = m_major_os_version != UINT32_MAX;
if (IsHost()) {
- if (!success) {
+ if (m_os_version.empty()) {
// We have a local host platform
- success = HostInfo::GetOSVersion(m_major_os_version, m_minor_os_version,
- m_update_os_version);
- m_os_version_set_while_connected = success;
+ m_os_version = HostInfo::GetOSVersion();
+ m_os_version_set_while_connected = !m_os_version.empty();
}
} else {
// We have a remote platform. We can only fetch the remote
@@ -466,11 +456,10 @@ bool Platform::GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
const bool is_connected = IsConnected();
bool fetch = false;
- if (success) {
- // We have valid OS version info, check to make sure it wasn't
- // manually set prior to connecting. If it was manually set prior
- // to connecting, then lets fetch the actual OS version info
- // if we are now connected.
+ if (!m_os_version.empty()) {
+ // We have valid OS version info, check to make sure it wasn't manually
+ // set prior to connecting. If it was manually set prior to connecting,
+ // then lets fetch the actual OS version info if we are now connected.
if (is_connected && !m_os_version_set_while_connected)
fetch = true;
} else {
@@ -478,22 +467,18 @@ bool Platform::GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update,
fetch = is_connected;
}
- if (fetch) {
- success = GetRemoteOSVersion();
- m_os_version_set_while_connected = success;
- }
+ if (fetch)
+ m_os_version_set_while_connected = GetRemoteOSVersion();
}
- if (success) {
- major = m_major_os_version;
- minor = m_minor_os_version;
- update = m_update_os_version;
- } else if (process) {
- // Check with the process in case it can answer the question if
- // a process was provided
- return process->GetHostOSVersion(major, minor, update);
+ if (!m_os_version.empty())
+ return m_os_version;
+ if (process) {
+ // Check with the process in case it can answer the question if a process
+ // was provided
+ return process->GetHostOSVersion();
}
- return success;
+ return llvm::VersionTuple();
}
bool Platform::GetOSBuildString(std::string &s) {
@@ -577,8 +562,8 @@ RecurseCopy_Callback(void *baton, llvm::sys::fs::file_type ft,
// now recurse
std::string src_dir_path(src.GetPath());
- // Make a filespec that only fills in the directory of a FileSpec so
- // when we enumerate we can quickly fill in the filename for dst copies
+ // Make a filespec that only fills in the directory of a FileSpec so when
+ // we enumerate we can quickly fill in the filename for dst copies
FileSpec recurse_dst;
recurse_dst.GetDirectory().SetCString(dst_dir.GetPath().c_str());
RecurseCopyBaton rc_baton2 = {recurse_dst, rc_baton->platform_ptr,
@@ -656,9 +641,9 @@ Status Platform::Install(const FileSpec &src, const FileSpec &dst) {
if (first_dst_dir_char == '/' || first_dst_dir_char == '\\') {
fixed_dst.GetDirectory() = dst.GetDirectory();
}
- // If the fixed destination file doesn't have a directory yet,
- // then we must have a relative path. We will resolve this relative
- // path against the platform's working directory
+ // If the fixed destination file doesn't have a directory yet, then we
+ // must have a relative path. We will resolve this relative path against
+ // the platform's working directory
if (!fixed_dst.GetDirectory()) {
FileSpec relative_spec;
std::string path;
@@ -859,26 +844,22 @@ const char *Platform::GetGroupName(uint32_t gid) {
return nullptr;
}
-bool Platform::SetOSVersion(uint32_t major, uint32_t minor, uint32_t update) {
+bool Platform::SetOSVersion(llvm::VersionTuple version) {
if (IsHost()) {
- // We don't need anyone setting the OS version for the host platform,
- // we should be able to figure it out by calling
- // HostInfo::GetOSVersion(...).
+ // We don't need anyone setting the OS version for the host platform, we
+ // should be able to figure it out by calling HostInfo::GetOSVersion(...).
return false;
} else {
- // We have a remote platform, allow setting the target OS version if
- // we aren't connected, since if we are connected, we should be able to
+ // We have a remote platform, allow setting the target OS version if we
+ // aren't connected, since if we are connected, we should be able to
// request the remote OS version from the connected platform.
if (IsConnected())
return false;
else {
- // We aren't connected and we might want to set the OS version
- // ahead of time before we connect so we can peruse files and
- // use a local SDK or PDK cache of support files to disassemble
- // or do other things.
- m_major_os_version = major;
- m_minor_os_version = minor;
- m_update_os_version = update;
+ // We aren't connected and we might want to set the OS version ahead of
+ // time before we connect so we can peruse files and use a local SDK or
+ // PDK cache of support files to disassemble or do other things.
+ m_os_version = version;
return true;
}
}
@@ -896,9 +877,9 @@ Platform::ResolveExecutable(const ModuleSpec &module_spec,
module_search_paths_ptr, nullptr,
nullptr);
} else {
- // No valid architecture was specified, ask the platform for
- // the architectures that we should be using (in the correct order)
- // and see if we can find a match that way
+ // No valid architecture was specified, ask the platform for the
+ // architectures that we should be using (in the correct order) and see
+ // if we can find a match that way
ModuleSpec arch_module_spec(module_spec);
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, arch_module_spec.GetArchitecture());
@@ -942,18 +923,17 @@ const ArchSpec &Platform::GetSystemArchitecture() {
m_system_arch_set_while_connected = m_system_arch.IsValid();
}
} else {
- // We have a remote platform. We can only fetch the remote
- // system architecture if we are connected, and we don't want to do it
- // more than once.
+ // We have a remote platform. We can only fetch the remote system
+ // architecture if we are connected, and we don't want to do it more than
+ // once.
const bool is_connected = IsConnected();
bool fetch = false;
if (m_system_arch.IsValid()) {
- // We have valid OS version info, check to make sure it wasn't
- // manually set prior to connecting. If it was manually set prior
- // to connecting, then lets fetch the actual OS version info
- // if we are now connected.
+ // We have valid OS version info, check to make sure it wasn't manually
+ // set prior to connecting. If it was manually set prior to connecting,
+ // then lets fetch the actual OS version info if we are now connected.
if (is_connected && !m_system_arch_set_while_connected)
fetch = true;
} else {
@@ -1025,8 +1005,8 @@ Status Platform::DisconnectRemote() {
bool Platform::GetProcessInfo(lldb::pid_t pid,
ProcessInstanceInfo &process_info) {
- // Take care of the host case so that each subclass can just
- // call this function to get the host functionality.
+ // Take care of the host case so that each subclass can just call this
+ // function to get the host functionality.
if (IsHost())
return Host::GetProcessInfo(pid, process_info);
return false;
@@ -1034,8 +1014,8 @@ bool Platform::GetProcessInfo(lldb::pid_t pid,
uint32_t Platform::FindProcesses(const ProcessInstanceInfoMatch &match_info,
ProcessInstanceInfoList &process_infos) {
- // Take care of the host case so that each subclass can just
- // call this function to get the host functionality.
+ // Take care of the host case so that each subclass can just call this
+ // function to get the host functionality.
uint32_t match_count = 0;
if (IsHost())
match_count = Host::FindProcesses(match_info, process_infos);
@@ -1048,8 +1028,8 @@ Status Platform::LaunchProcess(ProcessLaunchInfo &launch_info) {
if (log)
log->Printf("Platform::%s()", __FUNCTION__);
- // Take care of the host case so that each subclass can just
- // call this function to get the host functionality.
+ // Take care of the host case so that each subclass can just call this
+ // function to get the host functionality.
if (IsHost()) {
if (::getenv("LLDB_LAUNCH_FLAG_LAUNCH_IN_TTY"))
launch_info.GetFlags().Set(eLaunchFlagLaunchInTTY);
@@ -1106,8 +1086,7 @@ Status Platform::KillProcess(const lldb::pid_t pid) {
log->Printf("Platform::%s, pid %" PRIu64, __FUNCTION__, pid);
// Try to find a process plugin to handle this Kill request. If we can't,
- // fall back to
- // the default OS implementation.
+ // fall back to the default OS implementation.
size_t num_debuggers = Debugger::GetNumDebuggers();
for (size_t didx = 0; didx < num_debuggers; ++didx) {
DebuggerSP debugger = Debugger::GetDebuggerAtIndex(didx);
@@ -1142,23 +1121,22 @@ Platform::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
// Make sure we stop at the entry point
launch_info.GetFlags().Set(eLaunchFlagDebug);
// We always launch the process we are going to debug in a separate process
- // group, since then we can handle ^C interrupts ourselves w/o having to worry
- // about the target getting them as well.
+ // group, since then we can handle ^C interrupts ourselves w/o having to
+ // worry about the target getting them as well.
launch_info.SetLaunchInSeparateProcessGroup(true);
// Allow any StructuredData process-bound plugins to adjust the launch info
// if needed
size_t i = 0;
bool iteration_complete = false;
- // Note iteration can't simply go until a nullptr callback is returned, as
- // it is valid for a plugin to not supply a filter.
+ // Note iteration can't simply go until a nullptr callback is returned, as it
+ // is valid for a plugin to not supply a filter.
auto get_filter_func = PluginManager::GetStructuredDataFilterCallbackAtIndex;
for (auto filter_callback = get_filter_func(i, iteration_complete);
!iteration_complete;
filter_callback = get_filter_func(++i, iteration_complete)) {
if (filter_callback) {
- // Give this ProcessLaunchInfo filter a chance to adjust the launch
- // info.
+ // Give this ProcessLaunchInfo filter a chance to adjust the launch info.
error = (*filter_callback)(launch_info, target);
if (!error.Success()) {
if (log)
@@ -1191,10 +1169,10 @@ Platform::DebugProcess(ProcessLaunchInfo &launch_info, Debugger &debugger,
// process if this happens.
process_sp->SetShouldDetach(false);
- // If we didn't have any file actions, the pseudo terminal might
- // have been used where the slave side was given as the file to
- // open for stdin/out/err after we have already opened the master
- // so we can read/write stdin/out/err.
+ // If we didn't have any file actions, the pseudo terminal might have
+ // been used where the slave side was given as the file to open for
+ // stdin/out/err after we have already opened the master so we can
+ // read/write stdin/out/err.
int pty_fd = launch_info.GetPTY().ReleaseMasterFileDescriptor();
if (pty_fd != PseudoTerminal::invalid_fd) {
process_sp->SetSTDIOFileDescriptor(pty_fd);
@@ -1313,8 +1291,8 @@ Status Platform::PutFile(const FileSpec &source, const FileSpec &destination,
offset += bytes_written;
if (bytes_written != bytes_read) {
- // We didn't write the correct number of bytes, so adjust
- // the file position in the source file we are reading from...
+ // We didn't write the correct number of bytes, so adjust the file
+ // position in the source file we are reading from...
source_file.SeekFromStart(offset);
}
}
@@ -1373,12 +1351,10 @@ lldb_private::Status Platform::RunShellCommand(
// process to exit
std::string
*command_output, // Pass nullptr if you don't want the command output
- uint32_t
- timeout_sec) // Timeout in seconds to wait for shell program to finish
-{
+ const Timeout<std::micro> &timeout) {
if (IsHost())
return Host::RunShellCommand(command, working_dir, status_ptr, signo_ptr,
- command_output, timeout_sec);
+ command_output, timeout);
else
return Status("unimplemented");
}
@@ -1539,10 +1515,7 @@ lldb_private::Status OptionGroupPlatformCaching::SetOptionValue(
return error;
}
-size_t Platform::GetEnvironment(StringList &environment) {
- environment.Clear();
- return false;
-}
+Environment Platform::GetEnvironment() { return Environment(); }
const std::vector<ConstString> &Platform::GetTrapHandlerSymbolNames() {
if (!m_calculated_trap_handlers) {
@@ -1602,9 +1575,9 @@ Status Platform::GetRemoteSharedModule(const ModuleSpec &module_spec,
if (module_spec.GetArchitecture().IsValid() == false) {
Status error;
- // No valid architecture was specified, ask the platform for
- // the architectures that we should be using (in the correct order)
- // and see if we can find a match that way
+ // No valid architecture was specified, ask the platform for the
+ // architectures that we should be using (in the correct order) and see if
+ // we can find a match that way
ModuleSpec arch_module_spec(module_spec);
for (uint32_t idx = 0; GetSupportedArchitectureAtIndex(
idx, arch_module_spec.GetArchitecture());
@@ -1765,7 +1738,7 @@ uint32_t Platform::LoadImage(lldb_private::Process *process,
if (error.Fail())
return LLDB_INVALID_IMAGE_TOKEN;
}
- return DoLoadImage(process, remote_file, error);
+ return DoLoadImage(process, remote_file, nullptr, error);
}
if (local_file) {
@@ -1778,12 +1751,12 @@ uint32_t Platform::LoadImage(lldb_private::Process *process,
if (error.Fail())
return LLDB_INVALID_IMAGE_TOKEN;
}
- return DoLoadImage(process, target_file, error);
- }
+ return DoLoadImage(process, target_file, nullptr, error);
+ }
if (remote_file) {
// Only remote file was specified so we don't have to do any copying
- return DoLoadImage(process, remote_file, error);
+ return DoLoadImage(process, remote_file, nullptr, error);
}
error.SetErrorString("Neither local nor remote file was specified");
@@ -1792,11 +1765,30 @@ uint32_t Platform::LoadImage(lldb_private::Process *process,
uint32_t Platform::DoLoadImage(lldb_private::Process *process,
const lldb_private::FileSpec &remote_file,
- lldb_private::Status &error) {
+ const std::vector<std::string> *paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_image) {
error.SetErrorString("LoadImage is not supported on the current platform");
return LLDB_INVALID_IMAGE_TOKEN;
}
+uint32_t Platform::LoadImageUsingPaths(lldb_private::Process *process,
+ const lldb_private::FileSpec &remote_filename,
+ const std::vector<std::string> &paths,
+ lldb_private::Status &error,
+ lldb_private::FileSpec *loaded_path)
+{
+ FileSpec file_to_use;
+ if (remote_filename.IsAbsolute())
+ file_to_use = FileSpec(remote_filename.GetFilename().GetStringRef(),
+ false,
+ remote_filename.GetPathStyle());
+ else
+ file_to_use = remote_filename;
+
+ return DoLoadImage(process, file_to_use, &paths, error, loaded_path);
+}
+
Status Platform::UnloadImage(lldb_private::Process *process,
uint32_t image_token) {
return Status("UnloadImage is not supported on the current platform");
@@ -1855,22 +1847,22 @@ size_t Platform::GetSoftwareBreakpointTrapOpcode(Target &target,
// TODO: support big-endian arm and thumb trap codes.
case llvm::Triple::arm: {
- // The ARM reference recommends the use of 0xe7fddefe and 0xdefe
- // but the linux kernel does otherwise.
+ // The ARM reference recommends the use of 0xe7fddefe and 0xdefe but the
+ // linux kernel does otherwise.
static const uint8_t g_arm_breakpoint_opcode[] = {0xf0, 0x01, 0xf0, 0xe7};
static const uint8_t g_thumb_breakpoint_opcode[] = {0x01, 0xde};
lldb::BreakpointLocationSP bp_loc_sp(bp_site->GetOwnerAtIndex(0));
- AddressClass addr_class = eAddressClassUnknown;
+ AddressClass addr_class = AddressClass::eUnknown;
if (bp_loc_sp) {
addr_class = bp_loc_sp->GetAddress().GetAddressClass();
- if (addr_class == eAddressClassUnknown &&
+ if (addr_class == AddressClass::eUnknown &&
(bp_loc_sp->GetAddress().GetFileAddress() & 1))
- addr_class = eAddressClassCodeAlternateISA;
+ addr_class = AddressClass::eCodeAlternateISA;
}
- if (addr_class == eAddressClassCodeAlternateISA) {
+ if (addr_class == AddressClass::eCodeAlternateISA) {
trap_opcode = g_thumb_breakpoint_opcode;
trap_opcode_size = sizeof(g_thumb_breakpoint_opcode);
} else {
diff --git a/source/Target/Process.cpp b/source/Target/Process.cpp
index 8fb149fab063..c3d8abc9f78d 100644
--- a/source/Target/Process.cpp
+++ b/source/Target/Process.cpp
@@ -30,6 +30,7 @@
#include "lldb/Expression/DiagnosticManager.h"
#include "lldb/Expression/IRDynamicChecks.h"
#include "lldb/Expression/UserExpression.h"
+#include "lldb/Expression/UtilityFunction.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/Host.h"
@@ -39,6 +40,7 @@
#include "lldb/Host/Terminal.h"
#include "lldb/Host/ThreadLauncher.h"
#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionValueProperties.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
@@ -88,19 +90,18 @@ public:
ProcessOptionValueProperties(const ConstString &name)
: OptionValueProperties(name) {}
- // This constructor is used when creating ProcessOptionValueProperties when it
- // is part of a new lldb_private::Process instance. It will copy all current
- // global property values as needed
+ // This constructor is used when creating ProcessOptionValueProperties when
+ // it is part of a new lldb_private::Process instance. It will copy all
+ // current global property values as needed
ProcessOptionValueProperties(ProcessProperties *global_properties)
: OptionValueProperties(*global_properties->GetValueProperties()) {}
const Property *GetPropertyAtIndex(const ExecutionContext *exe_ctx,
bool will_modify,
uint32_t idx) const override {
- // When getting the value for a key from the process options, we will always
- // try and grab the setting from the current process if there is one. Else
- // we just
- // use the one from this instance.
+ // When getting the value for a key from the process options, we will
+ // always try and grab the setting from the current process if there is
+ // one. Else we just use the one from this instance.
if (exe_ctx) {
Process *process = exe_ctx->GetProcessPtr();
if (process) {
@@ -307,16 +308,7 @@ void ProcessInstanceInfo::Dump(Stream &s, Platform *platform) const {
}
}
- const uint32_t envc = m_environment.GetArgumentCount();
- if (envc > 0) {
- for (uint32_t i = 0; i < envc; i++) {
- const char *env = m_environment.GetArgumentAtIndex(i);
- if (i < 10)
- s.Printf(" env[%u] = %s\n", i, env);
- else
- s.Printf("env[%u] = %s\n", i, env);
- }
- }
+ s.Format("{0}", m_environment);
if (m_arch.IsValid()) {
s.Printf(" arch = ");
@@ -498,7 +490,7 @@ Status ProcessLaunchCommandOptions::SetOptionValue(
{
bool success;
const bool disable_aslr_arg =
- Args::StringToBoolean(option_arg, true, &success);
+ OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
disable_aslr = disable_aslr_arg ? eLazyBoolYes : eLazyBoolNo;
else
@@ -511,7 +503,8 @@ Status ProcessLaunchCommandOptions::SetOptionValue(
case 'X': // shell expand args.
{
bool success;
- const bool expand_args = Args::StringToBoolean(option_arg, true, &success);
+ const bool expand_args =
+ OptionArgParser::ToBoolean(option_arg, true, &success);
if (success)
launch_info.SetShellExpandArguments(expand_args);
else
@@ -529,7 +522,7 @@ Status ProcessLaunchCommandOptions::SetOptionValue(
break;
case 'v':
- launch_info.GetEnvironmentEntries().AppendArgument(option_arg);
+ launch_info.GetEnvironment().insert(option_arg);
break;
default:
@@ -732,7 +725,7 @@ Process::Process(lldb::TargetSP target_sp, ListenerSP listener_sp,
: ProcessProperties(this), UserID(LLDB_INVALID_PROCESS_ID),
Broadcaster((target_sp->GetDebugger().GetBroadcasterManager()),
Process::GetStaticBroadcasterClass().AsCString()),
- m_target_sp(target_sp), m_public_state(eStateUnloaded),
+ m_target_wp(target_sp), m_public_state(eStateUnloaded),
m_private_state(eStateUnloaded),
m_private_state_broadcaster(nullptr,
"lldb.process.internal_state_broadcaster"),
@@ -815,8 +808,8 @@ Process::~Process() {
StopPrivateStateThread();
// ThreadList::Clear() will try to acquire this process's mutex, so
- // explicitly clear the thread list here to ensure that the mutex
- // is not destroyed before the thread list.
+ // explicitly clear the thread list here to ensure that the mutex is not
+ // destroyed before the thread list.
m_thread_list.Clear();
}
@@ -854,13 +847,12 @@ void Process::Finalize() {
// Clear our broadcaster before we proceed with destroying
Broadcaster::Clear();
- // Do any cleanup needed prior to being destructed... Subclasses
- // that override this method should call this superclass method as well.
+ // Do any cleanup needed prior to being destructed... Subclasses that
+ // override this method should call this superclass method as well.
// We need to destroy the loader before the derived Process class gets
- // destroyed
- // since it is very likely that undoing the loader will require access to the
- // real process.
+ // destroyed since it is very likely that undoing the loader will require
+ // access to the real process.
m_dynamic_checkers_ap.reset();
m_abi_sp.reset();
m_os_ap.reset();
@@ -880,8 +872,8 @@ void Process::Finalize() {
m_language_runtimes.clear();
m_instrumentation_runtimes.clear();
m_next_event_action_ap.reset();
- // Clear the last natural stop ID since it has a strong
- // reference to this process
+ // Clear the last natural stop ID since it has a strong reference to this
+ // process
m_mod_id.SetStopEventForLastNaturalStopID(EventSP());
//#ifdef LLDB_CONFIGURATION_DEBUG
// StreamFile s(stdout, false);
@@ -937,14 +929,11 @@ void Process::SynchronouslyNotifyStateChanged(StateType state) {
// FIXME: We need to do some work on events before the general Listener sees
// them.
// For instance if we are continuing from a breakpoint, we need to ensure that
-// we do
-// the little "insert real insn, step & stop" trick. But we can't do that when
-// the
-// event is delivered by the broadcaster - since that is done on the thread that
-// is
-// waiting for new events, so if we needed more than one event for our handling,
-// we would
-// stall. So instead we do it when we fetch the event off of the queue.
+// we do the little "insert real insn, step & stop" trick. But we can't do
+// that when the event is delivered by the broadcaster - since that is done on
+// the thread that is waiting for new events, so if we needed more than one
+// event for our handling, we would stall. So instead we do it when we fetch
+// the event off of the queue.
//
StateType Process::GetNextEvent(EventSP &event_sp) {
@@ -958,21 +947,25 @@ StateType Process::GetNextEvent(EventSP &event_sp) {
return state;
}
-void Process::SyncIOHandler(uint32_t iohandler_id, uint64_t timeout_msec) {
+void Process::SyncIOHandler(uint32_t iohandler_id,
+ const Timeout<std::micro> &timeout) {
// don't sync (potentially context switch) in case where there is no process
// IO
if (!m_process_input_reader)
return;
- uint32_t new_iohandler_id = 0;
- m_iohandler_sync.WaitForValueNotEqualTo(
- iohandler_id, new_iohandler_id, std::chrono::milliseconds(timeout_msec));
+ auto Result = m_iohandler_sync.WaitForValueNotEqualTo(iohandler_id, timeout);
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
- if (log)
- log->Printf("Process::%s waited for m_iohandler_sync to change from %u, "
- "new value is %u",
- __FUNCTION__, iohandler_id, new_iohandler_id);
+ if (Result) {
+ LLDB_LOG(
+ log,
+ "waited from m_iohandler_sync to change from {0}. New value is {1}.",
+ iohandler_id, *Result);
+ } else {
+ LLDB_LOG(log, "timed out waiting for m_iohandler_sync to change from {0}.",
+ iohandler_id);
+ }
}
StateType Process::WaitForProcessToStop(const Timeout<std::micro> &timeout,
@@ -980,15 +973,13 @@ StateType Process::WaitForProcessToStop(const Timeout<std::micro> &timeout,
ListenerSP hijack_listener_sp,
Stream *stream, bool use_run_lock) {
// We can't just wait for a "stopped" event, because the stopped event may
- // have restarted the target.
- // We have to actually check each event, and in the case of a stopped event
- // check the restarted flag
- // on the event.
+ // have restarted the target. We have to actually check each event, and in
+ // the case of a stopped event check the restarted flag on the event.
if (event_sp_ptr)
event_sp_ptr->reset();
StateType state = GetState();
- // If we are exited or detached, we won't ever get back to any
- // other valid state...
+ // If we are exited or detached, we won't ever get back to any other valid
+ // state...
if (state == eStateDetached || state == eStateExited)
return state;
@@ -1154,10 +1145,8 @@ bool Process::HandleProcessStateChangedEvent(const EventSP &event_sp,
case eStopReasonSignal: {
// Don't select a signal thread if we weren't going to stop at
- // that
- // signal. We have to have had another reason for stopping here,
- // and
- // the user doesn't want to see this thread.
+ // that signal. We have to have had another reason for stopping
+ // here, and the user doesn't want to see this thread.
uint64_t signo = thread->GetStopInfo()->GetValue();
if (process_sp->GetUnixSignals()->GetShouldStop(signo)) {
if (!other_thread)
@@ -1197,10 +1186,9 @@ bool Process::HandleProcessStateChangedEvent(const EventSP &event_sp,
}
}
// Drop the ThreadList mutex by here, since GetThreadStatus below might
- // have to run code,
- // e.g. for Data formatters, and if we hold the ThreadList mutex, then the
- // process is going to
- // have a hard time restarting the process.
+ // have to run code, e.g. for Data formatters, and if we hold the
+ // ThreadList mutex, then the process is going to have a hard time
+ // restarting the process.
if (stream) {
Debugger &debugger = process_sp->GetTarget().GetDebugger();
if (debugger.GetTargetList().GetSelectedTarget().get() ==
@@ -1388,8 +1376,8 @@ bool Process::SetExitStatus(int status, const char *cstr) {
else
m_exit_string.clear();
- // Clear the last natural stop ID since it has a strong
- // reference to this process
+ // Clear the last natural stop ID since it has a strong reference to this
+ // process
m_mod_id.SetStopEventForLastNaturalStopID(EventSP());
SetPrivateState(eStateExited);
@@ -1416,9 +1404,9 @@ bool Process::IsAlive() {
}
}
-// This static callback can be used to watch for local child processes on
-// the current host. The child process exits, the process will be
-// found in the global target list (we want to be completely sure that the
+// This static callback can be used to watch for local child processes on the
+// current host. The child process exits, the process will be found in the
+// global target list (we want to be completely sure that the
// lldb_private::Process doesn't go away before we can deliver the signal.
bool Process::SetProcessExitStatus(
lldb::pid_t pid, bool exited,
@@ -1455,20 +1443,19 @@ void Process::UpdateThreadListIfNeeded() {
const StateType state = GetPrivateState();
if (StateIsStoppedState(state, true)) {
std::lock_guard<std::recursive_mutex> guard(m_thread_list.GetMutex());
- // m_thread_list does have its own mutex, but we need to
- // hold onto the mutex between the call to UpdateThreadList(...)
- // and the os->UpdateThreadList(...) so it doesn't change on us
+ // m_thread_list does have its own mutex, but we need to hold onto the
+ // mutex between the call to UpdateThreadList(...) and the
+ // os->UpdateThreadList(...) so it doesn't change on us
ThreadList &old_thread_list = m_thread_list;
ThreadList real_thread_list(this);
ThreadList new_thread_list(this);
- // Always update the thread list with the protocol specific
- // thread list, but only update if "true" is returned
+ // Always update the thread list with the protocol specific thread list,
+ // but only update if "true" is returned
if (UpdateThreadList(m_thread_list_real, real_thread_list)) {
// Don't call into the OperatingSystem to update the thread list if we
- // are shutting down, since
- // that may call back into the SBAPI's, requiring the API lock which is
- // already held by whoever is
- // shutting us down, causing a deadlock.
+ // are shutting down, since that may call back into the SBAPI's,
+ // requiring the API lock which is already held by whoever is shutting
+ // us down, causing a deadlock.
OperatingSystem *os = GetOperatingSystem();
if (os && !m_destroy_in_process) {
// Clear any old backing threads where memory threads might have been
@@ -1478,12 +1465,9 @@ void Process::UpdateThreadListIfNeeded() {
old_thread_list.GetThreadAtIndex(i, false)->ClearBackingThread();
// Turn off dynamic types to ensure we don't run any expressions.
- // Objective C
- // can run an expression to determine if a SBValue is a dynamic type
- // or not
- // and we need to avoid this. OperatingSystem plug-ins can't run
- // expressions
- // that require running code...
+ // Objective-C can run an expression to determine if a SBValue is a
+ // dynamic type or not and we need to avoid this. OperatingSystem
+ // plug-ins can't run expressions that require running code...
Target &target = GetTarget();
const lldb::DynamicValueType saved_prefer_dynamic =
@@ -1592,9 +1576,9 @@ void Process::SetPublicState(StateType new_state, bool restarted) {
const StateType old_state = m_public_state.GetValue();
m_public_state.SetValue(new_state);
- // On the transition from Run to Stopped, we unlock the writer end of the
- // run lock. The lock gets locked in Resume, which is the public API
- // to tell the program to run.
+ // On the transition from Run to Stopped, we unlock the writer end of the run
+ // lock. The lock gets locked in Resume, which is the public API to tell the
+ // program to run.
if (!StateChangedIsExternallyHijacked()) {
if (new_state == eStateDetached) {
if (log)
@@ -1707,17 +1691,16 @@ void Process::SetPrivateState(StateType new_state) {
new Event(eBroadcastBitStateChanged,
new ProcessEventData(shared_from_this(), new_state)));
if (StateIsStoppedState(new_state, false)) {
- // Note, this currently assumes that all threads in the list
- // stop when the process stops. In the future we will want to
- // support a debugging model where some threads continue to run
- // while others are stopped. When that happens we will either need
- // a way for the thread list to identify which threads are stopping
- // or create a special thread list containing only threads which
- // actually stopped.
+ // Note, this currently assumes that all threads in the list stop when
+ // the process stops. In the future we will want to support a debugging
+ // model where some threads continue to run while others are stopped.
+ // When that happens we will either need a way for the thread list to
+ // identify which threads are stopping or create a special thread list
+ // containing only threads which actually stopped.
//
- // The process plugin is responsible for managing the actual
- // behavior of the threads and should have stopped any threads
- // that are going to stop before we get here.
+ // The process plugin is responsible for managing the actual behavior of
+ // the threads and should have stopped any threads that are going to stop
+ // before we get here.
m_thread_list.DidStop();
m_mod_id.BumpStopID();
@@ -1890,8 +1873,8 @@ Process::CreateBreakpointSite(const BreakpointLocationSP &owner,
break;
}
- // Reset the IsIndirect flag here, in case the location changes from
- // pointing to a indirect symbol to a regular symbol.
+ // Reset the IsIndirect flag here, in case the location changes from pointing
+ // to a indirect symbol to a regular symbol.
owner->SetIsIndirect(false);
if (owner->ShouldResolveIndirectFunctions()) {
@@ -1921,8 +1904,7 @@ Process::CreateBreakpointSite(const BreakpointLocationSP &owner,
BreakpointSiteSP bp_site_sp;
// Look up this breakpoint site. If it exists, then add this new owner,
- // otherwise
- // create a new breakpoint site and add it.
+ // otherwise create a new breakpoint site and add it.
bp_site_sp = m_breakpoint_site_list.FindByAddress(load_addr);
@@ -2170,7 +2152,8 @@ Status Process::DisableSoftwareBreakpoint(BreakpointSite *bp_site) {
return error;
}
-// Uncomment to verify memory caching works after making changes to caching code
+// Uncomment to verify memory caching works after making changes to caching
+// code
//#define VERIFY_MEMORY_READS
size_t Process::ReadMemory(addr_t addr, void *buf, size_t size, Status &error) {
@@ -2224,8 +2207,8 @@ size_t Process::ReadCStringFromMemory(addr_t addr, std::string &out_str,
if (length == 0)
break;
out_str.append(buf, length);
- // If we got "length - 1" bytes, we didn't get the whole C string, we
- // need to read some more characters
+ // If we got "length - 1" bytes, we didn't get the whole C string, we need
+ // to read some more characters
if (length == sizeof(buf) - 1)
curr_addr += length;
else
@@ -2238,7 +2221,8 @@ size_t Process::ReadStringFromMemory(addr_t addr, char *dst, size_t max_bytes,
Status &error, size_t type_width) {
size_t total_bytes_read = 0;
if (dst && max_bytes && type_width && max_bytes >= type_width) {
- // Ensure a null terminator independent of the number of bytes that is read.
+ // Ensure a null terminator independent of the number of bytes that is
+ // read.
memset(dst, 0, max_bytes);
size_t bytes_left = max_bytes - type_width;
@@ -2285,8 +2269,7 @@ size_t Process::ReadStringFromMemory(addr_t addr, char *dst, size_t max_bytes,
}
// Deprecated in favor of ReadStringFromMemory which has wchar support and
-// correct code to find
-// null terminators.
+// correct code to find null terminators.
size_t Process::ReadCStringFromMemory(addr_t addr, char *dst,
size_t dst_max_len,
Status &result_error) {
@@ -2460,16 +2443,16 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
// Check for bytes before this breakpoint
const addr_t curr_addr = addr + bytes_written;
if (intersect_addr > curr_addr) {
- // There are some bytes before this breakpoint that we need to
- // just write to memory
+ // There are some bytes before this breakpoint that we need to just
+ // write to memory
size_t curr_size = intersect_addr - curr_addr;
size_t curr_bytes_written = WriteMemoryPrivate(
curr_addr, ubuf + bytes_written, curr_size, error);
bytes_written += curr_bytes_written;
if (curr_bytes_written != curr_size) {
- // We weren't able to write all of the requested bytes, we
- // are done looping and will return the number of bytes that
- // we have written so far.
+ // We weren't able to write all of the requested bytes, we are
+ // done looping and will return the number of bytes that we have
+ // written so far.
if (error.Success())
error.SetErrorToGenericError();
}
@@ -2542,11 +2525,24 @@ size_t Process::ReadScalarIntegerFromMemory(addr_t addr, uint32_t byte_size,
return 0;
}
+Status Process::WriteObjectFile(std::vector<ObjectFile::LoadableData> entries) {
+ Status error;
+ for (const auto &Entry : entries) {
+ WriteMemory(Entry.Dest, Entry.Contents.data(), Entry.Contents.size(),
+ error);
+ if (!error.Success())
+ break;
+ }
+ return error;
+}
+
#define USE_ALLOCATE_MEMORY_CACHE 1
addr_t Process::AllocateMemory(size_t size, uint32_t permissions,
Status &error) {
- if (GetPrivateState() != eStateStopped)
+ if (GetPrivateState() != eStateStopped) {
+ error.SetErrorToGenericError();
return LLDB_INVALID_ADDRESS;
+ }
#if defined(USE_ALLOCATE_MEMORY_CACHE)
return m_allocated_memory_cache.AllocateMemory(size, permissions, error);
@@ -2692,8 +2688,7 @@ StateType
Process::WaitForProcessStopPrivate(EventSP &event_sp,
const Timeout<std::micro> &timeout) {
StateType state;
- // Now wait for the process to launch and return control to us, and then
- // call DidLaunch:
+
while (true) {
event_sp.reset();
state = GetStateChangedEventsPrivate(event_sp, timeout);
@@ -2771,11 +2766,14 @@ Status Process::Launch(ProcessLaunchInfo &launch_info) {
}
} else {
EventSP event_sp;
+
+ // Now wait for the process to launch and return control to us, and then call
+ // DidLaunch:
StateType state = WaitForProcessStopPrivate(event_sp, seconds(10));
if (state == eStateInvalid || !event_sp) {
- // We were able to launch the process, but we failed to
- // catch the initial stop.
+ // We were able to launch the process, but we failed to catch the
+ // initial stop.
error.SetErrorString("failed to catch stop after launch");
SetExitStatus(0, "failed to catch stop after launch");
Destroy(false);
@@ -2795,18 +2793,15 @@ Status Process::Launch(ProcessLaunchInfo &launch_info) {
if (!m_os_ap)
LoadOperatingSystemPlugin(false);
- // We successfully launched the process and stopped,
- // now it the right time to set up signal filters before resuming.
+ // We successfully launched the process and stopped, now it the
+ // right time to set up signal filters before resuming.
UpdateAutomaticSignalFiltering();
// Note, the stop event was consumed above, but not handled. This
- // was done
- // to give DidLaunch a chance to run. The target is either stopped
- // or crashed.
- // Directly set the state. This is done to prevent a stop message
- // with a bunch
- // of spurious output on thread status, as well as not pop a
- // ProcessIOHandler.
+ // was done to give DidLaunch a chance to run. The target is either
+ // stopped or crashed. Directly set the state. This is done to
+ // prevent a stop message with a bunch of spurious output on thread
+ // status, as well as not pop a ProcessIOHandler.
SetPublicState(state, false);
if (PrivateStateThreadIsValid())
@@ -2815,15 +2810,13 @@ Status Process::Launch(ProcessLaunchInfo &launch_info) {
StartPrivateStateThread();
// Target was stopped at entry as was intended. Need to notify the
- // listeners
- // about it.
+ // listeners about it.
if (state == eStateStopped &&
launch_info.GetFlags().Test(eLaunchFlagStopAtEntry))
HandlePrivateEvent(event_sp);
} else if (state == eStateExited) {
// We exited while trying to launch somehow. Don't call DidLaunch
- // as that's
- // not likely to work, and return an invalid pid.
+ // as that's not likely to work, and return an invalid pid.
HandlePrivateEvent(event_sp);
}
}
@@ -2862,14 +2855,13 @@ Status Process::LoadCore() {
LoadOperatingSystemPlugin(false);
// We successfully loaded a core file, now pretend we stopped so we can
- // show all of the threads in the core file and explore the crashed
- // state.
+ // show all of the threads in the core file and explore the crashed state.
SetPrivateState(eStateStopped);
- // Wait indefinitely for a stopped event since we just posted one above...
+ // Wait for a stopped event since we just posted one above...
lldb::EventSP event_sp;
- listener_sp->GetEvent(event_sp, llvm::None);
- StateType state = ProcessEventData::GetStateFromEvent(event_sp.get());
+ StateType state =
+ WaitForProcessToStop(seconds(10), &event_sp, true, listener_sp);
if (!StateIsStoppedState(state, false)) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
@@ -2939,8 +2931,8 @@ Process::AttachCompletionHandler::PerformAction(lldb::EventSP &event_sp) {
// During attach, prior to sending the eStateStopped event,
// lldb_private::Process subclasses must set the new process ID.
assert(m_process->GetID() != LLDB_INVALID_PROCESS_ID);
- // We don't want these events to be reported, so go set the ShouldReportStop
- // here:
+ // We don't want these events to be reported, so go set the
+ // ShouldReportStop here:
m_process->GetThreadList().SetShouldReportStop(eVoteNo);
if (m_exec_count > 0) {
@@ -3134,8 +3126,8 @@ void Process::CompleteAttach() {
}
// We just attached. If we have a platform, ask it for the process
- // architecture, and if it isn't
- // the same as the one we've already set, switch architectures.
+ // architecture, and if it isn't the same as the one we've already set,
+ // switch architectures.
PlatformSP platform_sp(GetTarget().GetPlatform());
assert(platform_sp);
if (platform_sp) {
@@ -3272,21 +3264,20 @@ Status Process::PrivateResume() {
m_mod_id.GetStopID(), StateAsCString(m_public_state.GetValue()),
StateAsCString(m_private_state.GetValue()));
- // If signals handing status changed we might want to update
- // our signal filters before resuming.
+ // If signals handing status changed we might want to update our signal
+ // filters before resuming.
UpdateAutomaticSignalFiltering();
Status error(WillResume());
// Tell the process it is about to resume before the thread list
if (error.Success()) {
- // Now let the thread list know we are about to resume so it
- // can let all of our threads know that they are about to be
- // resumed. Threads will each be called with
- // Thread::WillResume(StateType) where StateType contains the state
- // that they are supposed to have when the process is resumed
- // (suspended/running/stepping). Threads should also check
- // their resume signal in lldb::Thread::GetResumeSignal()
- // to see if they are supposed to start back up with a signal.
+ // Now let the thread list know we are about to resume so it can let all of
+ // our threads know that they are about to be resumed. Threads will each be
+ // called with Thread::WillResume(StateType) where StateType contains the
+ // state that they are supposed to have when the process is resumed
+ // (suspended/running/stepping). Threads should also check their resume
+ // signal in lldb::Thread::GetResumeSignal() to see if they are supposed to
+ // start back up with a signal.
if (m_thread_list.WillResume()) {
// Last thing, do the PreResumeActions.
if (!RunPreResumeActions()) {
@@ -3303,11 +3294,10 @@ Status Process::PrivateResume() {
}
}
} else {
- // Somebody wanted to run without running (e.g. we were faking a step from
- // one frame of a set of inlined
- // frames that share the same PC to another.) So generate a continue & a
- // stopped event,
- // and let the world handle them.
+ // Somebody wanted to run without running (e.g. we were faking a step
+ // from one frame of a set of inlined frames that share the same PC to
+ // another.) So generate a continue & a stopped event, and let the world
+ // handle them.
if (log)
log->Printf(
"Process::PrivateResume() asked to simulate a start & stop.");
@@ -3325,9 +3315,8 @@ Status Process::Halt(bool clear_thread_plans, bool use_run_lock) {
if (!StateIsRunningState(m_public_state.GetValue()))
return Status("Process is not running.");
- // Don't clear the m_clear_thread_plans_on_stop, only set it to true if
- // in case it was already set and some thread plan logic calls halt on its
- // own.
+ // Don't clear the m_clear_thread_plans_on_stop, only set it to true if in
+ // case it was already set and some thread plan logic calls halt on its own.
m_clear_thread_plans_on_stop |= clear_thread_plans;
ListenerSP halt_listener_sp(
@@ -3339,8 +3328,8 @@ Status Process::Halt(bool clear_thread_plans, bool use_run_lock) {
SendAsyncInterrupt();
if (m_public_state.GetValue() == eStateAttaching) {
- // Don't hijack and eat the eStateExited as the code that was doing
- // the attach will be waiting for this event...
+ // Don't hijack and eat the eStateExited as the code that was doing the
+ // attach will be waiting for this event...
RestoreProcessEvents();
SetExitStatus(SIGKILL, "Cancelled async attach.");
Destroy(false);
@@ -3366,8 +3355,8 @@ Status Process::StopForDestroyOrDetach(lldb::EventSP &exit_event_sp) {
Status error;
// Check both the public & private states here. If we're hung evaluating an
- // expression, for instance, then
- // the public state will be stopped, but we still need to interrupt.
+ // expression, for instance, then the public state will be stopped, but we
+ // still need to interrupt.
if (m_public_state.GetValue() == eStateRunning ||
m_private_state.GetValue() == eStateRunning) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
@@ -3387,10 +3376,9 @@ Status Process::StopForDestroyOrDetach(lldb::EventSP &exit_event_sp) {
RestoreProcessEvents();
// If the process exited while we were waiting for it to stop, put the
- // exited event into
- // the shared pointer passed in and return. Our caller doesn't need to do
- // anything else, since
- // they don't have a process anymore...
+ // exited event into the shared pointer passed in and return. Our caller
+ // doesn't need to do anything else, since they don't have a process
+ // anymore...
if (state == eStateExited || m_private_state.GetValue() == eStateExited) {
if (log)
@@ -3405,9 +3393,8 @@ Status Process::StopForDestroyOrDetach(lldb::EventSP &exit_event_sp) {
log->Printf("Process::%s() failed to stop, state is: %s", __FUNCTION__,
StateAsCString(state));
// If we really couldn't stop the process then we should just error out
- // here, but if the
- // lower levels just bobbled sending the event and we really are stopped,
- // then continue on.
+ // here, but if the lower levels just bobbled sending the event and we
+ // really are stopped, then continue on.
StateType private_state = m_private_state.GetValue();
if (private_state != eStateStopped) {
return Status(
@@ -3455,20 +3442,18 @@ Status Process::Detach(bool keep_stopped) {
}
m_destroy_in_process = false;
- // If we exited when we were waiting for a process to stop, then
- // forward the event here so we don't lose the event
+ // If we exited when we were waiting for a process to stop, then forward the
+ // event here so we don't lose the event
if (exit_event_sp) {
- // Directly broadcast our exited event because we shut down our
- // private state thread above
+ // Directly broadcast our exited event because we shut down our private
+ // state thread above
BroadcastEvent(exit_event_sp);
}
// If we have been interrupted (to kill us) in the middle of running, we may
- // not end up propagating
- // the last events through the event system, in which case we might strand the
- // write lock. Unlock
- // it here so when we do to tear down the process we don't get an error
- // destroying the lock.
+ // not end up propagating the last events through the event system, in which
+ // case we might strand the write lock. Unlock it here so when we do to tear
+ // down the process we don't get an error destroying the lock.
m_public_run_lock.SetStopped();
return error;
@@ -3477,9 +3462,8 @@ Status Process::Detach(bool keep_stopped) {
Status Process::Destroy(bool force_kill) {
// Tell ourselves we are in the process of destroying the process, so that we
- // don't do any unnecessary work
- // that might hinder the destruction. Remember to set this back to false when
- // we are done. That way if the attempt
+ // don't do any unnecessary work that might hinder the destruction. Remember
+ // to set this back to false when we are done. That way if the attempt
// failed and the process stays around for some reason it won't be in a
// confused state.
@@ -3502,12 +3486,11 @@ Status Process::Destroy(bool force_kill) {
}
if (m_public_state.GetValue() != eStateRunning) {
- // Ditch all thread plans, and remove all our breakpoints: in case we have
- // to restart the target to
- // kill it, we don't want it hitting a breakpoint...
- // Only do this if we've stopped, however, since if we didn't manage to
- // halt it above, then
- // we're not going to have much luck doing this now.
+ // Ditch all thread plans, and remove all our breakpoints: in case we
+ // have to restart the target to kill it, we don't want it hitting a
+ // breakpoint... Only do this if we've stopped, however, since if we
+ // didn't manage to halt it above, then we're not going to have much luck
+ // doing this now.
m_thread_list.DiscardThreadPlans();
DisableAllBreakpointSites();
}
@@ -3527,20 +3510,18 @@ Status Process::Destroy(bool force_kill) {
m_process_input_reader.reset();
}
- // If we exited when we were waiting for a process to stop, then
- // forward the event here so we don't lose the event
+ // If we exited when we were waiting for a process to stop, then forward
+ // the event here so we don't lose the event
if (exit_event_sp) {
- // Directly broadcast our exited event because we shut down our
- // private state thread above
+ // Directly broadcast our exited event because we shut down our private
+ // state thread above
BroadcastEvent(exit_event_sp);
}
- // If we have been interrupted (to kill us) in the middle of running, we may
- // not end up propagating
- // the last events through the event system, in which case we might strand
- // the write lock. Unlock
- // it here so when we do to tear down the process we don't get an error
- // destroying the lock.
+ // If we have been interrupted (to kill us) in the middle of running, we
+ // may not end up propagating the last events through the event system, in
+ // which case we might strand the write lock. Unlock it here so when we do
+ // to tear down the process we don't get an error destroying the lock.
m_public_run_lock.SetStopped();
}
@@ -3607,11 +3588,11 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
break;
case eStateRunning:
case eStateStepping:
- // If we've started the target running, we handle the cases where we
- // are already running and where there is a transition from stopped to
- // running differently.
- // running -> running: Automatically suppress extra running events
- // stopped -> running: Report except when there is one or more no votes
+ // If we've started the target running, we handle the cases where we are
+ // already running and where there is a transition from stopped to running
+ // differently. running -> running: Automatically suppress extra running
+ // events stopped -> running: Report except when there is one or more no
+ // votes
// and no yes votes.
SynchronouslyNotifyStateChanged(state);
if (m_force_next_event_delivery)
@@ -3625,11 +3606,10 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
break;
default:
// TODO: make this work correctly. For now always report
- // run if we aren't running so we don't miss any running
- // events. If I run the lldb/test/thread/a.out file and
- // break at main.cpp:58, run and hit the breakpoints on
- // multiple threads, then somehow during the stepping over
- // of all breakpoints no run gets reported.
+ // run if we aren't running so we don't miss any running events. If I
+ // run the lldb/test/thread/a.out file and break at main.cpp:58, run
+ // and hit the breakpoints on multiple threads, then somehow during the
+ // stepping over of all breakpoints no run gets reported.
// This is a transition from stop to run.
switch (m_thread_list.ShouldReportRun(event_ptr)) {
@@ -3648,11 +3628,10 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
case eStateStopped:
case eStateCrashed:
case eStateSuspended:
- // We've stopped. First see if we're going to restart the target.
- // If we are going to stop, then we always broadcast the event.
- // If we aren't going to stop, let the thread plans decide if we're going to
- // report this event.
- // If no thread has an opinion, we don't report it.
+ // We've stopped. First see if we're going to restart the target. If we
+ // are going to stop, then we always broadcast the event. If we aren't
+ // going to stop, let the thread plans decide if we're going to report this
+ // event. If no thread has an opinion, we don't report it.
m_stdio_communication.SynchronizeWithReadThread();
RefreshStateAfterStop();
@@ -3662,8 +3641,7 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
"interrupt, state: %s",
static_cast<void *>(event_ptr), StateAsCString(state));
// Even though we know we are going to stop, we should let the threads
- // have a look at the stop,
- // so they can properly set their state.
+ // have a look at the stop, so they can properly set their state.
m_thread_list.ShouldStop(event_ptr);
return_value = true;
} else {
@@ -3671,10 +3649,8 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
bool should_resume = false;
// It makes no sense to ask "ShouldStop" if we've already been
- // restarted...
- // Asking the thread list is also not likely to go well, since we are
- // running again.
- // So in that case just report the event.
+ // restarted... Asking the thread list is also not likely to go well,
+ // since we are running again. So in that case just report the event.
if (!was_restarted)
should_resume = !m_thread_list.ShouldStop(event_ptr);
@@ -3717,16 +3693,13 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
m_force_next_event_delivery = false;
// We do some coalescing of events (for instance two consecutive running
- // events get coalesced.)
- // But we only coalesce against events we actually broadcast. So we use
- // m_last_broadcast_state
- // to track that. NB - you can't use "m_public_state.GetValue()" for that
- // purpose, as was originally done,
- // because the PublicState reflects the last event pulled off the queue, and
- // there may be several
- // events stacked up on the queue unserviced. So the PublicState may not
- // reflect the last broadcasted event
- // yet. m_last_broadcast_state gets updated here.
+ // events get coalesced.) But we only coalesce against events we actually
+ // broadcast. So we use m_last_broadcast_state to track that. NB - you
+ // can't use "m_public_state.GetValue()" for that purpose, as was originally
+ // done, because the PublicState reflects the last event pulled off the
+ // queue, and there may be several events stacked up on the queue unserviced.
+ // So the PublicState may not reflect the last broadcasted event yet.
+ // m_last_broadcast_state gets updated here.
if (return_value)
m_last_broadcast_state = state;
@@ -3752,8 +3725,8 @@ bool Process::StartPrivateStateThread(bool is_secondary_thread) {
if (!is_secondary_thread && already_running)
return true;
- // Create a thread that watches our internal state and controls which
- // events make it to clients (into the DCProcess event queue).
+ // Create a thread that watches our internal state and controls which events
+ // make it to clients (into the DCProcess event queue).
char thread_name[1024];
uint32_t max_len = llvm::get_max_thread_name_length();
if (max_len > 0 && max_len <= 30) {
@@ -3818,10 +3791,10 @@ void Process::ControlPrivateStateThread(uint32_t signal) {
// Signal the private state thread
if (m_private_state_thread.IsJoinable()) {
// Broadcast the event.
- // It is important to do this outside of the if below, because
- // it's possible that the thread state is invalid but that the
- // thread is waiting on a control event instead of simply being
- // on its way out (this should not happen, but it apparently can).
+ // It is important to do this outside of the if below, because it's
+ // possible that the thread state is invalid but that the thread is waiting
+ // on a control event instead of simply being on its way out (this should
+ // not happen, but it apparently can).
if (log)
log->Printf("Sending control event of type: %d.", signal);
std::shared_ptr<EventDataReceipt> event_receipt_sp(new EventDataReceipt());
@@ -3832,14 +3805,13 @@ void Process::ControlPrivateStateThread(uint32_t signal) {
bool receipt_received = false;
if (PrivateStateThreadIsValid()) {
while (!receipt_received) {
- bool timed_out = false;
- // Check for a receipt for 2 seconds and then check if the private state
- // thread is still around.
- receipt_received = event_receipt_sp->WaitForEventReceived(
- std::chrono::seconds(2), &timed_out);
+ // Check for a receipt for 2 seconds and then check if the private
+ // state thread is still around.
+ receipt_received =
+ event_receipt_sp->WaitForEventReceived(std::chrono::seconds(2));
if (!receipt_received) {
- // Check if the private state thread is still around. If it isn't then
- // we are done waiting
+ // Check if the private state thread is still around. If it isn't
+ // then we are done waiting
if (!PrivateStateThreadIsValid())
break; // Private state thread exited or is exiting, we are done
}
@@ -3889,9 +3861,9 @@ void Process::HandlePrivateEvent(EventSP &event_sp) {
break;
case NextEventAction::eEventActionExit:
- // Handle Exiting Here. If we already got an exited event,
- // we should just propagate it. Otherwise, swallow this event,
- // and set our state to exit so the next event will kill us.
+ // Handle Exiting Here. If we already got an exited event, we should
+ // just propagate it. Otherwise, swallow this event, and set our state
+ // to exit so the next event will kill us.
if (new_state != eStateExited) {
// FIXME: should cons up an exited event, and discard this one.
SetExitStatus(0, m_next_event_action_ap->GetExitString());
@@ -3917,9 +3889,9 @@ void Process::HandlePrivateEvent(EventSP &event_sp) {
}
Process::ProcessEventData::SetUpdateStateOnRemoval(event_sp.get());
if (StateIsRunningState(new_state)) {
- // Only push the input handler if we aren't fowarding events,
- // as this means the curses GUI is in use...
- // Or don't push it if we are launching since it will come up stopped.
+ // Only push the input handler if we aren't fowarding events, as this
+ // means the curses GUI is in use... Or don't push it if we are launching
+ // since it will come up stopped.
if (!GetTarget().GetDebugger().IsForwardingEvents() &&
new_state != eStateLaunching && new_state != eStateAttaching) {
PushProcessIOHandler();
@@ -3931,27 +3903,26 @@ void Process::HandlePrivateEvent(EventSP &event_sp) {
}
} else if (StateIsStoppedState(new_state, false)) {
if (!Process::ProcessEventData::GetRestartedFromEvent(event_sp.get())) {
- // If the lldb_private::Debugger is handling the events, we don't
- // want to pop the process IOHandler here, we want to do it when
- // we receive the stopped event so we can carefully control when
- // the process IOHandler is popped because when we stop we want to
- // display some text stating how and why we stopped, then maybe some
- // process/thread/frame info, and then we want the "(lldb) " prompt
- // to show up. If we pop the process IOHandler here, then we will
- // cause the command interpreter to become the top IOHandler after
- // the process pops off and it will update its prompt right away...
- // See the Debugger.cpp file where it calls the function as
+ // If the lldb_private::Debugger is handling the events, we don't want
+ // to pop the process IOHandler here, we want to do it when we receive
+ // the stopped event so we can carefully control when the process
+ // IOHandler is popped because when we stop we want to display some
+ // text stating how and why we stopped, then maybe some
+ // process/thread/frame info, and then we want the "(lldb) " prompt to
+ // show up. If we pop the process IOHandler here, then we will cause
+ // the command interpreter to become the top IOHandler after the
+ // process pops off and it will update its prompt right away... See the
+ // Debugger.cpp file where it calls the function as
// "process_sp->PopProcessIOHandler()" to see where I am talking about.
// Otherwise we end up getting overlapping "(lldb) " prompts and
// garbled output.
//
// If we aren't handling the events in the debugger (which is indicated
- // by "m_target.GetDebugger().IsHandlingEvents()" returning false) or we
- // are hijacked, then we always pop the process IO handler manually.
+ // by "m_target.GetDebugger().IsHandlingEvents()" returning false) or
+ // we are hijacked, then we always pop the process IO handler manually.
// Hijacking happens when the internal process state thread is running
- // thread plans, or when commands want to run in synchronous mode
- // and they call "process->WaitForProcessToStop()". An example of
- // something
+ // thread plans, or when commands want to run in synchronous mode and
+ // they call "process->WaitForProcessToStop()". An example of something
// that will hijack the events is a simple expression:
//
// (lldb) expr (int)puts("hello")
@@ -4054,23 +4025,19 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {
") failed to halt the process: %s",
__FUNCTION__, static_cast<void *>(this), GetID(),
error.AsCString());
- // Halt should generate a stopped event. Make a note of the fact that we
- // were
- // doing the interrupt, so we can set the interrupted flag after we
- // receive the
- // event. We deliberately set this to true even if HaltPrivate failed,
- // so that we
- // can interrupt on the next natural stop.
+ // Halt should generate a stopped event. Make a note of the fact that
+ // we were doing the interrupt, so we can set the interrupted flag
+ // after we receive the event. We deliberately set this to true even if
+ // HaltPrivate failed, so that we can interrupt on the next natural
+ // stop.
interrupt_requested = true;
} else {
// This can happen when someone (e.g. Process::Halt) sees that we are
- // running and
- // sends an interrupt request, but the process actually stops before we
- // receive
- // it. In that case, we can just ignore the request. We use
- // m_last_broadcast_state, because the Stopped event may not have been
- // popped of
- // the event queue yet, which is when the public state gets updated.
+ // running and sends an interrupt request, but the process actually
+ // stops before we receive it. In that case, we can just ignore the
+ // request. We use m_last_broadcast_state, because the Stopped event
+ // may not have been popped of the event queue yet, which is when the
+ // public state gets updated.
if (log)
log->Printf(
"Process::%s ignoring interrupt as we have already stopped.",
@@ -4092,8 +4059,7 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {
if (interrupt_requested) {
if (StateIsStoppedState(internal_state, true)) {
// We requested the interrupt, so mark this as such in the stop event
- // so
- // clients can tell an interrupted process from a natural stop
+ // so clients can tell an interrupted process from a natural stop
ProcessEventData::SetInterruptedInEvent(event_sp.get(), true);
interrupt_requested = false;
} else if (log) {
@@ -4124,10 +4090,8 @@ thread_result_t Process::RunPrivateStateThread(bool is_secondary_thread) {
__FUNCTION__, static_cast<void *>(this), GetID());
// If we are a secondary thread, then the primary thread we are working for
- // will have already
- // acquired the public_run_lock, and isn't done with what it was doing yet, so
- // don't
- // try to change it on the way out.
+ // will have already acquired the public_run_lock, and isn't done with what
+ // 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;
@@ -4167,14 +4131,12 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
return;
// This function gets called twice for each event, once when the event gets
- // pulled
- // off of the private process event queue, and then any number of times, first
- // when it gets pulled off of
- // the public event queue, then other times when we're pretending that this is
- // where we stopped at the
- // end of expression evaluation. m_update_state is used to distinguish these
- // three cases; it is 0 when we're just pulling it off for private handling,
- // and > 1 for expression evaluation, and we don't want to do the breakpoint
+ // pulled off of the private process event queue, and then any number of
+ // times, first when it gets pulled off of the public event queue, then other
+ // times when we're pretending that this is where we stopped at the end of
+ // expression evaluation. m_update_state is used to distinguish these three
+ // cases; it is 0 when we're just pulling it off for private handling, and >
+ // 1 for expression evaluation, and we don't want to do the breakpoint
// command handling then.
if (m_update_state != 1)
return;
@@ -4183,16 +4145,15 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
m_state, Process::ProcessEventData::GetRestartedFromEvent(event_ptr));
if (m_state == eStateStopped && !m_restarted) {
- // Let process subclasses know we are about to do a public stop and
- // do anything they might need to in order to speed up register and
- // memory accesses.
+ // Let process subclasses know we are about to do a public stop and do
+ // anything they might need to in order to speed up register and memory
+ // accesses.
process_sp->WillPublicStop();
}
// If this is a halt event, even if the halt stopped with some reason other
- // than a plain interrupt (e.g. we had
- // already stopped for a breakpoint when the halt request came through) don't
- // do the StopInfo actions, as they may
+ // than a plain interrupt (e.g. we had already stopped for a breakpoint when
+ // the halt request came through) don't do the StopInfo actions, as they may
// end up restarting the process.
if (m_interrupted)
return;
@@ -4204,37 +4165,32 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
uint32_t idx;
// The actions might change one of the thread's stop_info's opinions about
- // whether we should
- // stop the process, so we need to query that as we go.
+ // whether we should stop the process, so we need to query that as we go.
// One other complication here, is that we try to catch any case where the
- // target has run (except for expressions)
- // and immediately exit, but if we get that wrong (which is possible) then
- // the thread list might have changed, and
- // that would cause our iteration here to crash. We could make a copy of
- // the thread list, but we'd really like
- // to also know if it has changed at all, so we make up a vector of the
- // thread ID's and check what we get back
- // against this list & bag out if anything differs.
+ // target has run (except for expressions) and immediately exit, but if we
+ // get that wrong (which is possible) then the thread list might have
+ // changed, and that would cause our iteration here to crash. We could
+ // make a copy of the thread list, but we'd really like to also know if it
+ // has changed at all, so we make up a vector of the thread ID's and check
+ // what we get back against this list & bag out if anything differs.
std::vector<uint32_t> thread_index_array(num_threads);
for (idx = 0; idx < num_threads; ++idx)
thread_index_array[idx] =
curr_thread_list.GetThreadAtIndex(idx)->GetIndexID();
// Use this to track whether we should continue from here. We will only
- // continue the target running if
- // no thread says we should stop. Of course if some thread's PerformAction
- // actually sets the target running,
- // then it doesn't matter what the other threads say...
+ // continue the target running if no thread says we should stop. Of course
+ // if some thread's PerformAction actually sets the target running, then it
+ // doesn't matter what the other threads say...
bool still_should_stop = false;
// Sometimes - for instance if we have a bug in the stub we are talking to,
- // we stop but no thread has a
- // valid stop reason. In that case we should just stop, because we have no
- // way of telling what the right
- // thing to do is, and it's better to let the user decide than continue
- // behind their backs.
+ // we stop but no thread has a valid stop reason. In that case we should
+ // just stop, because we have no way of telling what the right thing to do
+ // is, and it's better to let the user decide than continue behind their
+ // backs.
bool does_anybody_have_an_opinion = false;
@@ -4271,13 +4227,11 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
stop_info_sp->GetOverriddenShouldStopValue();
} else {
stop_info_sp->PerformAction(event_ptr);
- // The stop action might restart the target. If it does, then we want
- // to mark that in the
- // event so that whoever is receiving it will know to wait for the
- // running event and reflect
- // that state appropriately.
- // We also need to stop processing actions, since they aren't
- // expecting the target to be running.
+ // The stop action might restart the target. If it does, then we
+ // want to mark that in the event so that whoever is receiving it
+ // will know to wait for the running event and reflect that state
+ // appropriately. We also need to stop processing actions, since they
+ // aren't expecting the target to be running.
// FIXME: we might have run.
if (stop_info_sp->HasTargetRunSinceMe()) {
@@ -4297,12 +4251,12 @@ void Process::ProcessEventData::DoOnRemoval(Event *event_ptr) {
if (!still_should_stop && does_anybody_have_an_opinion) {
// We've been asked to continue, so do that here.
SetRestarted(true);
- // Use the public resume method here, since this is just
- // extending a public resume.
+ // Use the public resume method here, since this is just extending a
+ // public resume.
process_sp->PrivateResume();
} else {
- // If we didn't restart, run the Stop Hooks here:
- // They might also restart the target, so watch for that.
+ // If we didn't restart, run the Stop Hooks here: They might also
+ // restart the target, so watch for that.
process_sp->GetTarget().RunStopHooks();
if (process_sp->GetPrivateState() == eStateRunning)
SetRestarted(true);
@@ -4423,7 +4377,7 @@ bool Process::ProcessEventData::SetUpdateStateOnRemoval(Event *event_ptr) {
return false;
}
-lldb::TargetSP Process::CalculateTarget() { return m_target_sp.lock(); }
+lldb::TargetSP Process::CalculateTarget() { return m_target_wp.lock(); }
void Process::CalculateExecutionContext(ExecutionContext &exe_ctx) {
exe_ctx.SetTargetPtr(&GetTarget());
@@ -4574,9 +4528,8 @@ public:
~IOHandlerProcessSTDIO() override = default;
- // Each IOHandler gets to run until it is done. It should read data
- // from the "in" and place output into "out" and "err and return
- // when done.
+ // Each IOHandler gets to run until it is done. It should read data from the
+ // "in" and place output into "out" and "err and return when done.
void Run() override {
if (!m_read_file.IsValid() || !m_write_file.IsValid() ||
!m_pipe.CanRead() || !m_pipe.CanWrite()) {
@@ -4640,9 +4593,8 @@ public:
void Cancel() override {
SetIsDone(true);
// Only write to our pipe to cancel if we are in
- // IOHandlerProcessSTDIO::Run().
- // We can end up with a python command that is being run from the command
- // interpreter:
+ // IOHandlerProcessSTDIO::Run(). We can end up with a python command that
+ // is being run from the command interpreter:
//
// (lldb) step_process_thousands_of_times
//
@@ -4659,12 +4611,11 @@ public:
}
bool Interrupt() override {
- // Do only things that are safe to do in an interrupt context (like in
- // a SIGINT handler), like write 1 byte to a file descriptor. This will
+ // Do only things that are safe to do in an interrupt context (like in a
+ // SIGINT handler), like write 1 byte to a file descriptor. This will
// interrupt the IOHandlerProcessSTDIO::Run() and we can look at the byte
// that was written to the pipe and then call
- // m_process->SendAsyncInterrupt()
- // from a much safer location in code.
+ // m_process->SendAsyncInterrupt() from a much safer location in code.
if (m_active) {
char ch = 'i'; // Send 'i' for interrupt
size_t bytes_written = 0;
@@ -4672,16 +4623,13 @@ public:
return result.Success();
} else {
// This IOHandler might be pushed on the stack, but not being run
- // currently
- // so do the right thing if we aren't actively watching for STDIN by
- // sending
- // the interrupt to the process. Otherwise the write to the pipe above
- // would
- // do nothing. This can happen when the command interpreter is running and
- // gets a "expression ...". It will be on the IOHandler thread and sending
- // the input is complete to the delegate which will cause the expression
- // to
- // run, which will push the process IO handler, but not run it.
+ // currently so do the right thing if we aren't actively watching for
+ // STDIN by sending the interrupt to the process. Otherwise the write to
+ // the pipe above would do nothing. This can happen when the command
+ // interpreter is running and gets a "expression ...". It will be on the
+ // IOHandler thread and sending the input is complete to the delegate
+ // which will cause the expression to run, which will push the process IO
+ // handler, but not run it.
if (StateIsRunningState(m_process->GetState())) {
m_process->SendAsyncInterrupt();
@@ -4756,12 +4704,10 @@ void Process::SettingsInitialize() { Thread::SettingsInitialize(); }
void Process::SettingsTerminate() { Thread::SettingsTerminate(); }
namespace {
-// RestorePlanState is used to record the "is private", "is master" and "okay to
-// discard" fields of
-// the plan we are running, and reset it on Clean or on destruction.
-// It will only reset the state once, so you can call Clean and then monkey with
-// the state and it
-// won't get reset on you again.
+// RestorePlanState is used to record the "is private", "is master" and "okay
+// to discard" fields of the plan we are running, and reset it on Clean or on
+// destruction. It will only reset the state once, so you can call Clean and
+// then monkey with the state and it won't get reset on you again.
class RestorePlanState {
public:
@@ -4817,8 +4763,8 @@ GetOneThreadExpressionTimeout(const EvaluateExpressionOptions &options) {
static Timeout<std::micro>
GetExpressionTimeout(const EvaluateExpressionOptions &options,
bool before_first_timeout) {
- // If we are going to run all threads the whole time, or if we are only
- // going to run one thread, we can just return the overall timeout.
+ // If we are going to run all threads the whole time, or if we are only going
+ // to run one thread, we can just return the overall timeout.
if (!options.GetStopOthers() || !options.GetTryAllThreads())
return options.GetTimeout();
@@ -4855,7 +4801,8 @@ HandleStoppedEvent(Thread &thread, const ThreadPlanSP &thread_plan_sp,
if (!options.DoesIgnoreBreakpoints()) {
// Restore the plan state and then force Private to false. We are going
// to stop because of this plan so we need it to become a public plan or
- // it won't report correctly when we continue to its termination later on.
+ // it won't report correctly when we continue to its termination later
+ // on.
restorer.Clean();
thread_plan_sp->SetPrivate(false);
event_to_broadcast_sp = event_sp;
@@ -4910,23 +4857,20 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
// We need to change some of the thread plan attributes for the thread plan
- // runner. This will restore them
- // when we are done:
+ // runner. This will restore them when we are done:
RestorePlanState thread_plan_restorer(thread_plan_sp);
- // We rely on the thread plan we are running returning "PlanCompleted" if when
- // it successfully completes.
- // For that to be true the plan can't be private - since private plans
- // suppress themselves in the
- // GetCompletedPlan call.
+ // We rely on the thread plan we are running returning "PlanCompleted" if
+ // when it successfully completes. For that to be true the plan can't be
+ // private - since private plans suppress themselves in the GetCompletedPlan
+ // call.
thread_plan_sp->SetPrivate(false);
// The plans run with RunThreadPlan also need to be terminal master plans or
- // when they are done we will end
- // up asking the plan above us whether we should stop, which may give the
- // wrong answer.
+ // when they are done we will end up asking the plan above us whether we
+ // should stop, which may give the wrong answer.
thread_plan_sp->SetIsMasterPlan(true);
thread_plan_sp->SetOkayToDiscard(false);
@@ -4953,8 +4897,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
}
- // Make sure the timeout values make sense. The one thread timeout needs to be
- // smaller than the overall timeout.
+ // Make sure the timeout values make sense. The one thread timeout needs to
+ // be smaller than the overall timeout.
if (options.GetOneThreadTimeout() && options.GetTimeout() &&
*options.GetTimeout() < *options.GetOneThreadTimeout()) {
diagnostic_manager.PutString(eDiagnosticSeverityError,
@@ -4966,8 +4910,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
StackID ctx_frame_id = selected_frame_sp->GetStackID();
// N.B. Running the target may unset the currently selected thread and frame.
- // We don't want to do that either,
- // so we should arrange to reset them as well.
+ // We don't want to do that either, so we should arrange to reset them as
+ // well.
lldb::ThreadSP selected_thread_sp = GetThreadList().GetSelectedThread();
@@ -4988,11 +4932,10 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
LIBLLDB_LOG_PROCESS));
if (m_private_state_thread.EqualsThread(Host::GetCurrentThread())) {
// Yikes, we are running on the private state thread! So we can't wait for
- // public events on this thread, since
- // we are the thread that is generating public events.
- // The simplest thing to do is to spin up a temporary thread to handle
- // private state thread events while
- // we are fielding public events here.
+ // public events on this thread, since we are the thread that is generating
+ // public events. The simplest thing to do is to spin up a temporary thread
+ // to handle private state thread events while we are fielding public
+ // events here.
if (log)
log->Printf("Running thread plan on private state thread, spinning up "
"another state thread to handle the events.");
@@ -5000,15 +4943,12 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
backup_private_state_thread = m_private_state_thread;
// One other bit of business: we want to run just this thread plan and
- // anything it pushes, and then stop,
- // returning control here.
- // But in the normal course of things, the plan above us on the stack would
- // be given a shot at the stop
- // event before deciding to stop, and we don't want that. So we insert a
- // "stopper" base plan on the stack
- // before the plan we want to run. Since base plans always stop and return
- // control to the user, that will
- // do just what we want.
+ // anything it pushes, and then stop, returning control here. But in the
+ // normal course of things, the plan above us on the stack would be given a
+ // shot at the stop event before deciding to stop, and we don't want that.
+ // So we insert a "stopper" base plan on the stack before the plan we want
+ // to run. Since base plans always stop and return control to the user,
+ // that will do just what we want.
stopper_base_plan_sp.reset(new ThreadPlanBase(*thread));
thread->QueueThreadPlan(stopper_base_plan_sp, false);
// Have to make sure our public state is stopped, since otherwise the
@@ -5024,15 +4964,13 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
thread_plan_sp, false); // This used to pass "true" does that make sense?
if (options.GetDebug()) {
- // In this case, we aren't actually going to run, we just want to stop right
- // away.
- // Flush this thread so we will refetch the stacks and show the correct
- // backtrace.
+ // In this case, we aren't actually going to run, we just want to stop
+ // right away. Flush this thread so we will refetch the stacks and show the
+ // correct backtrace.
// FIXME: To make this prettier we should invent some stop reason for this,
// but that
// is only cosmetic, and this functionality is only of use to lldb
- // developers who can
- // live with not pretty...
+ // developers who can live with not pretty...
thread->Flush();
return eExpressionStoppedForDebug;
}
@@ -5044,12 +4982,11 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
{
// This process event hijacker Hijacks the Public events and its destructor
- // makes sure that the process events get
- // restored on exit to the function.
+ // makes sure that the process events get restored on exit to the function.
//
// If the event needs to propagate beyond the hijacker (e.g., the process
- // exits during execution), then the event
- // is put into event_to_broadcast_sp for rebroadcasting.
+ // exits during execution), then the event is put into
+ // event_to_broadcast_sp for rebroadcasting.
ProcessEventHijacker run_thread_plan_hijacker(*this, listener_sp);
@@ -5084,10 +5021,10 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
options.GetStopOthers(), options.GetTryAllThreads(),
before_first_timeout);
- // This isn't going to work if there are unfetched events on the queue.
- // Are there cases where we might want to run the remaining events here, and
- // then try to
- // call the function? That's probably being too tricky for our own good.
+ // This isn't going to work if there are unfetched events on the queue. Are
+ // there cases where we might want to run the remaining events here, and
+ // then try to call the function? That's probably being too tricky for our
+ // own good.
Event *other_events = listener_sp->PeekAtNextEvent();
if (other_events != nullptr) {
@@ -5098,32 +5035,29 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
// We also need to make sure that the next event is delivered. We might be
- // calling a function as part of
- // a thread plan, in which case the last delivered event could be the
- // running event, and we don't want
- // event coalescing to cause us to lose OUR running event...
+ // calling a function as part of a thread plan, in which case the last
+ // delivered event could be the running event, and we don't want event
+ // coalescing to cause us to lose OUR running event...
ForceNextEventDelivery();
// This while loop must exit out the bottom, there's cleanup that we need to do
-// when we are done.
-// So don't call return anywhere within it.
+// when we are done. So don't call return anywhere within it.
#ifdef LLDB_RUN_THREAD_HALT_WITH_EVENT
- // It's pretty much impossible to write test cases for things like:
- // One thread timeout expires, I go to halt, but the process already stopped
- // on the function call stop breakpoint. Turning on this define will make
- // us not
- // fetch the first event till after the halt. So if you run a quick
- // function, it will have
- // completed, and the completion event will be waiting, when you interrupt
- // for halt.
- // The expression evaluation should still succeed.
+ // It's pretty much impossible to write test cases for things like: One
+ // thread timeout expires, I go to halt, but the process already stopped on
+ // the function call stop breakpoint. Turning on this define will make us
+ // not fetch the first event till after the halt. So if you run a quick
+ // function, it will have completed, and the completion event will be
+ // waiting, when you interrupt for halt. The expression evaluation should
+ // still succeed.
bool miss_first_event = true;
#endif
while (true) {
- // We usually want to resume the process if we get to the top of the loop.
- // The only exception is if we get two running events with no intervening
- // stop, which can happen, we will just wait for then next stop event.
+ // We usually want to resume the process if we get to the top of the
+ // loop. The only exception is if we get two running events with no
+ // intervening stop, which can happen, we will just wait for then next
+ // stop event.
if (log)
log->Printf("Top of while loop: do_resume: %i handle_running_event: %i "
"before_first_timeout: %i.",
@@ -5182,9 +5116,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
if (restarted) {
// This is probably an overabundance of caution, I don't think I
- // should ever get a stopped & restarted
- // event here. But if I do, the best thing is to Halt and then get
- // out of here.
+ // should ever get a stopped & restarted event here. But if I do,
+ // the best thing is to Halt and then get out of here.
const bool clear_thread_plans = false;
const bool use_run_lock = false;
Halt(clear_thread_plans, use_run_lock);
@@ -5200,14 +5133,11 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
if (log)
log->PutCString("Process::RunThreadPlan(): resuming succeeded.");
- // We need to call the function synchronously, so spin waiting for it to
- // return.
- // If we get interrupted while executing, we're going to lose our
- // context, and
- // won't be able to gather the result at this point.
- // We set the timeout AFTER the resume, since the resume takes some time
- // and we
- // don't want to charge that to the timeout.
+ // We need to call the function synchronously, so spin waiting for it
+ // to return. If we get interrupted while executing, we're going to
+ // lose our context, and won't be able to gather the result at this
+ // point. We set the timeout AFTER the resume, since the resume takes
+ // some time and we don't want to charge that to the timeout.
} else {
if (log)
log->PutCString("Process::RunThreadPlan(): waiting for next event.");
@@ -5299,9 +5229,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
case lldb::eStateRunning:
// This shouldn't really happen, but sometimes we do get two
- // running events without an
- // intervening stop, and in that case we should just go back to
- // waiting for the stop.
+ // running events without an intervening stop, and in that case
+ // we should just go back to waiting for the stop.
do_resume = false;
keep_going = true;
handle_running_event = false;
@@ -5336,10 +5265,10 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
break;
}
} else {
- // If we didn't get an event that means we've timed out...
- // We will interrupt the process here. Depending on what we were asked
- // to do we will
- // either exit, or try with all threads running for the same timeout.
+ // If we didn't get an event that means we've timed out... We will
+ // interrupt the process here. Depending on what we were asked to do
+ // we will either exit, or try with all threads running for the same
+ // timeout.
if (log) {
if (options.GetTryAllThreads()) {
@@ -5357,14 +5286,13 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
// It is possible that between the time we issued the Halt, and we get
- // around to calling Halt the target
- // could have stopped. That's fine, Halt will figure that out and send
- // the appropriate Stopped event.
+ // around to calling Halt the target could have stopped. That's fine,
+ // Halt will figure that out and send the appropriate Stopped event.
// BUT it is also possible that we stopped & restarted (e.g. hit a
// signal with "stop" set to false.) In
// that case, we'll get the stopped & restarted event, and we should go
- // back to waiting for the Halt's
- // stopped event. That's what this while loop does.
+ // back to waiting for the Halt's stopped event. That's what this
+ // while loop does.
bool back_to_top = true;
uint32_t try_halt_again = 0;
@@ -5413,8 +5341,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
// Between the time we initiated the Halt and the time we
- // delivered it, the process could have
- // already finished its job. Check that here:
+ // delivered it, the process could have already finished its
+ // job. Check that here:
const bool handle_interrupts = false;
if (auto result = HandleStoppedEvent(
*thread, thread_plan_sp, thread_plan_restorer, event_sp,
@@ -5477,8 +5405,8 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
} // END WAIT LOOP
- // If we had to start up a temporary private state thread to run this thread
- // plan, shut it down now.
+ // If we had to start up a temporary private state thread to run this
+ // thread plan, shut it down now.
if (backup_private_state_thread.IsJoinable()) {
StopPrivateStateThread();
Status error;
@@ -5498,11 +5426,9 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
log->PutString(s.GetString());
}
// Restore the thread state if we are going to discard the plan execution.
- // There are three cases where this
- // could happen:
- // 1) The execution successfully completed
- // 2) We hit a breakpoint, and ignore_breakpoints was true
- // 3) We got some other error, and discard_on_error was true
+ // There are three cases where this could happen: 1) The execution
+ // successfully completed 2) We hit a breakpoint, and ignore_breakpoints
+ // was true 3) We got some other error, and discard_on_error was true
bool should_unwind = (return_value == eExpressionInterrupted &&
options.DoesUnwindOnError()) ||
(return_value == eExpressionHitBreakpoint &&
@@ -5642,18 +5568,15 @@ Process::RunThreadPlan(ExecutionContext &exe_ctx,
}
// Thread we ran the function in may have gone away because we ran the
- // target
- // Check that it's still there, and if it is put it back in the context.
- // Also restore the
- // frame in the context if it is still present.
+ // target Check that it's still there, and if it is put it back in the
+ // context. Also restore the frame in the context if it is still present.
thread = GetThreadList().FindThreadByIndexID(thread_idx_id, true).get();
if (thread) {
exe_ctx.SetFrameSP(thread->GetFrameWithStackID(ctx_frame_id));
}
// Also restore the current process'es selected frame & thread, since this
- // function calling may
- // be done behind the user's back.
+ // function calling may be done behind the user's back.
if (selected_tid != LLDB_INVALID_THREAD_ID) {
if (GetThreadList().SetSelectedThreadByIndexID(selected_tid) &&
@@ -5744,10 +5667,9 @@ size_t Process::GetThreadStatus(Stream &strm,
size_t num_thread_infos_dumped = 0;
// You can't hold the thread list lock while calling Thread::GetStatus. That
- // very well might run code (e.g. if we need it
- // to get return values or arguments.) For that to work the process has to be
- // able to acquire it. So instead copy the thread
- // ID's, and look them up one by one:
+ // very well might run code (e.g. if we need it to get return values or
+ // arguments.) For that to work the process has to be able to acquire it.
+ // So instead copy the thread ID's, and look them up one by one:
uint32_t num_threads;
std::vector<lldb::tid_t> thread_id_array;
@@ -5860,12 +5782,12 @@ void Process::DidExec() {
DoDidExec();
CompleteAttach();
// Flush the process (threads and all stack frames) after running
- // CompleteAttach()
- // in case the dynamic loader loaded things in new locations.
+ // CompleteAttach() in case the dynamic loader loaded things in new
+ // locations.
Flush();
- // After we figure out what was loaded/unloaded in CompleteAttach,
- // we need to let the target know so it can do any cleanup it needs to.
+ // After we figure out what was loaded/unloaded in CompleteAttach, we need to
+ // let the target know so it can do any cleanup it needs to.
target.DidExec();
}
@@ -5916,17 +5838,17 @@ void Process::ModulesDidLoad(ModuleList &module_list) {
runtime->ModulesDidLoad(module_list);
}
- // Let any language runtimes we have already created know
- // about the modules that loaded.
+ // Let any language runtimes we have already created know about the modules
+ // that loaded.
- // Iterate over a copy of this language runtime list in case
- // the language runtime ModulesDidLoad somehow causes the language
- // riuntime to be unloaded.
+ // Iterate over a copy of this language runtime list in case the language
+ // runtime ModulesDidLoad somehow causes the language riuntime to be
+ // unloaded.
LanguageRuntimeCollection language_runtimes(m_language_runtimes);
for (const auto &pair : language_runtimes) {
- // We must check language_runtime_sp to make sure it is not
- // nullptr as we might cache the fact that we didn't have a
- // language runtime for a language.
+ // We must check language_runtime_sp to make sure it is not nullptr as we
+ // might cache the fact that we didn't have a language runtime for a
+ // language.
LanguageRuntimeSP language_runtime_sp = pair.second;
if (language_runtime_sp)
language_runtime_sp->ModulesDidLoad(module_list);
@@ -6126,9 +6048,9 @@ Process::GetMemoryRegions(std::vector<lldb::MemoryRegionInfoSP> &region_list) {
Status
Process::ConfigureStructuredData(const ConstString &type_name,
const StructuredData::ObjectSP &config_sp) {
- // If you get this, the Process-derived class needs to implement a method
- // to enable an already-reported asynchronous structured data feature.
- // See ProcessGDBRemote for an example implementation over gdb-remote.
+ // If you get this, the Process-derived class needs to implement a method to
+ // enable an already-reported asynchronous structured data feature. See
+ // ProcessGDBRemote for an example implementation over gdb-remote.
return Status("unimplemented");
}
@@ -6170,23 +6092,27 @@ void Process::MapSupportedStructuredDataPlugins(
return true;
});
- // For each StructuredDataPlugin, if the plugin handles any of the
- // types in the supported_type_names, map that type name to that plugin.
- uint32_t plugin_index = 0;
- for (auto create_instance =
+ // For each StructuredDataPlugin, if the plugin handles any of the types in
+ // the supported_type_names, map that type name to that plugin. Stop when
+ // we've consumed all the type names.
+ // FIXME: should we return an error if there are type names nobody
+ // supports?
+ for (uint32_t plugin_index = 0; !const_type_names.empty(); plugin_index++) {
+ auto create_instance =
PluginManager::GetStructuredDataPluginCreateCallbackAtIndex(
plugin_index);
- create_instance && !const_type_names.empty(); ++plugin_index) {
+ if (!create_instance)
+ break;
+
// Create the plugin.
StructuredDataPluginSP plugin_sp = (*create_instance)(*this);
if (!plugin_sp) {
- // This plugin doesn't think it can work with the process.
- // Move on to the next.
+ // This plugin doesn't think it can work with the process. Move on to the
+ // next.
continue;
}
- // For any of the remaining type names, map any that this plugin
- // supports.
+ // For any of the remaining type names, map any that this plugin supports.
std::vector<ConstString> names_to_remove;
for (auto &type_name : const_type_names) {
if (plugin_sp->SupportsStructuredDataType(type_name)) {
@@ -6213,8 +6139,8 @@ bool Process::RouteAsyncStructuredData(
if (!object_sp)
return false;
- // The contract is this must be a dictionary, so we can look up the
- // routing key via the top-level 'type' string value within the dictionary.
+ // The contract is this must be a dictionary, so we can look up the routing
+ // key via the top-level 'type' string value within the dictionary.
StructuredData::Dictionary *dictionary = object_sp->GetAsDictionary();
if (!dictionary)
return false;
@@ -6241,3 +6167,13 @@ Status Process::UpdateAutomaticSignalFiltering() {
// No automatic signal filtering to speak of.
return Status();
}
+
+UtilityFunction *Process::GetLoadImageUtilityFunction(
+ Platform *platform,
+ llvm::function_ref<std::unique_ptr<UtilityFunction>()> factory) {
+ if (platform != GetTarget().GetPlatform().get())
+ return nullptr;
+ std::call_once(m_dlopen_utility_func_flag_once,
+ [&] { m_dlopen_utility_func_up = factory(); });
+ return m_dlopen_utility_func_up.get();
+}
diff --git a/source/Target/ProcessInfo.cpp b/source/Target/ProcessInfo.cpp
index 0d986bc76914..ac0350686706 100644
--- a/source/Target/ProcessInfo.cpp
+++ b/source/Target/ProcessInfo.cpp
@@ -35,7 +35,7 @@ ProcessInfo::ProcessInfo(const char *name, const ArchSpec &arch,
void ProcessInfo::Clear() {
m_executable.Clear();
m_arguments.Clear();
- m_environment.Clear();
+ m_environment.clear();
m_uid = UINT32_MAX;
m_gid = UINT32_MAX;
m_arch.Clear();
@@ -59,8 +59,7 @@ void ProcessInfo::Dump(Stream &s, Platform *platform) const {
s << "Arguments:\n";
m_arguments.Dump(s);
- s << "Environment:\n";
- m_environment.Dump(s, "env");
+ s.Format("Environment:\n{0}", m_environment);
}
void ProcessInfo::SetExecutableFile(const FileSpec &exe_file,
@@ -94,11 +93,11 @@ void ProcessInfo::SetArguments(char const **argv,
if (first_arg_is_executable) {
const char *first_arg = m_arguments.GetArgumentAtIndex(0);
if (first_arg) {
- // Yes the first argument is an executable, set it as the executable
- // in the launch options. Don't resolve the file path as the path
- // could be a remote platform path
+ // Yes the first argument is an executable, set it as the executable in
+ // the launch options. Don't resolve the file path as the path could be a
+ // remote platform path
const bool resolve = false;
- m_executable.SetFile(first_arg, resolve);
+ m_executable.SetFile(first_arg, resolve, FileSpec::Style::native);
}
}
}
@@ -111,11 +110,11 @@ void ProcessInfo::SetArguments(const Args &args, bool first_arg_is_executable) {
if (first_arg_is_executable) {
const char *first_arg = m_arguments.GetArgumentAtIndex(0);
if (first_arg) {
- // Yes the first argument is an executable, set it as the executable
- // in the launch options. Don't resolve the file path as the path
- // could be a remote platform path
+ // Yes the first argument is an executable, set it as the executable in
+ // the launch options. Don't resolve the file path as the path could be a
+ // remote platform path
const bool resolve = false;
- m_executable.SetFile(first_arg, resolve);
+ m_executable.SetFile(first_arg, resolve, FileSpec::Style::native);
}
}
}
diff --git a/source/Target/ProcessLaunchInfo.cpp b/source/Target/ProcessLaunchInfo.cpp
index 284df9fd8b58..9569750bc5fd 100644
--- a/source/Target/ProcessLaunchInfo.cpp
+++ b/source/Target/ProcessLaunchInfo.cpp
@@ -189,6 +189,13 @@ void ProcessLaunchInfo::SetMonitorProcessCallback(
m_monitor_signals = monitor_signals;
}
+bool ProcessLaunchInfo::NoOpMonitorCallback(lldb::pid_t pid, bool exited, int signal, int status) {
+ Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS);
+ LLDB_LOG(log, "pid = {0}, exited = {1}, signal = {2}, status = {3}", pid,
+ exited, signal, status);
+ return true;
+}
+
bool ProcessLaunchInfo::MonitorProcess() const {
if (m_monitor_callback && ProcessIDIsValid()) {
Host::StartMonitoringChildProcess(m_monitor_callback, GetProcessID(),
@@ -210,8 +217,7 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_PROCESS));
// If nothing for stdin or stdout or stderr was specified, then check the
- // process for any default
- // settings that were set with "settings set"
+ // process for any default settings that were set with "settings set"
if (GetFileActionForFD(STDIN_FILENO) == nullptr ||
GetFileActionForFD(STDOUT_FILENO) == nullptr ||
GetFileActionForFD(STDERR_FILENO) == nullptr) {
@@ -221,8 +227,8 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
__FUNCTION__);
if (m_flags.Test(eLaunchFlagLaunchInTTY)) {
- // Do nothing, if we are launching in a remote terminal
- // no file actions should be done at all.
+ // Do nothing, if we are launching in a remote terminal no file actions
+ // should be done at all.
return;
}
@@ -235,16 +241,15 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
AppendSuppressFileAction(STDOUT_FILENO, false, true);
AppendSuppressFileAction(STDERR_FILENO, false, true);
} else {
- // Check for any values that might have gotten set with any of:
- // (lldb) settings set target.input-path
- // (lldb) settings set target.output-path
+ // Check for any values that might have gotten set with any of: (lldb)
+ // settings set target.input-path (lldb) settings set target.output-path
// (lldb) settings set target.error-path
FileSpec in_file_spec;
FileSpec out_file_spec;
FileSpec err_file_spec;
if (target) {
- // Only override with the target settings if we don't already have
- // an action for in, out or error
+ // Only override with the target settings if we don't already have an
+ // action for in, out or error
if (GetFileActionForFD(STDIN_FILENO) == nullptr)
in_file_spec = target->GetStandardInputPath();
if (GetFileActionForFD(STDOUT_FILENO) == nullptr)
@@ -295,9 +300,9 @@ void ProcessLaunchInfo::FinalizeFileActions(Target *target,
int open_flags = O_RDWR | O_NOCTTY;
#if !defined(_WIN32)
- // We really shouldn't be specifying platform specific flags
- // that are intended for a system call in generic code. But
- // this will have to do for now.
+ // We really shouldn't be specifying platform specific flags that are
+ // intended for a system call in generic code. But this will have to
+ // do for now.
open_flags |= O_CLOEXEC;
#endif
if (m_pty->OpenFirstAvailableMaster(open_flags, nullptr, 0)) {
@@ -351,14 +356,13 @@ bool ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(
StreamString shell_command;
if (will_debug) {
- // Add a modified PATH environment variable in case argv[0]
- // is a relative path.
+ // Add a modified PATH environment variable in case argv[0] is a
+ // relative path.
const char *argv0 = argv[0];
FileSpec arg_spec(argv0, false);
if (arg_spec.IsRelative()) {
- // We have a relative path to our executable which may not work if
- // we just try to run "a.out" (without it being converted to
- // "./a.out")
+ // We have a relative path to our executable which may not work if we
+ // just try to run "a.out" (without it being converted to "./a.out")
FileSpec working_dir = GetWorkingDirectory();
// Be sure to put quotes around PATH's value in case any paths have
// spaces...
@@ -410,8 +414,8 @@ bool ProcessLaunchInfo::ConvertArgumentsForLaunchingInShell(
}
if (first_arg_is_full_shell_command) {
- // There should only be one argument that is the shell command itself to
- // be used as is
+ // There should only be one argument that is the shell command itself
+ // to be used as is
if (argv[0] && !argv[1])
shell_command.Printf("%s", argv[0]);
else
diff --git a/source/Target/RegisterContext.cpp b/source/Target/RegisterContext.cpp
index 28beb7bcb5e8..eaec03d9b595 100644
--- a/source/Target/RegisterContext.cpp
+++ b/source/Target/RegisterContext.cpp
@@ -76,8 +76,7 @@ RegisterContext::UpdateDynamicRegisterSize(const lldb_private::ArchSpec &arch,
ExecutionContext exe_ctx(CalculateThread());
// In MIPS, the floating point registers size is depends on FR bit of SR
- // register.
- // if SR.FR == 1 then all floating point registers are 64 bits.
+ // register. if SR.FR == 1 then all floating point registers are 64 bits.
// else they are all 32 bits.
int expr_result;
@@ -136,7 +135,7 @@ uint64_t RegisterContext::GetPC(uint64_t fail_value) {
if (target_sp) {
Target *target = target_sp.get();
if (target)
- pc = target->GetOpcodeLoadAddress(pc, eAddressClassCode);
+ pc = target->GetOpcodeLoadAddress(pc, AddressClass::eCode);
}
}
@@ -262,8 +261,7 @@ bool RegisterContext::CopyFromRegisterContext(lldb::RegisterContextSP context) {
RegisterValue reg_value;
// If we can reconstruct the register from the frame we are copying from,
- // then do so, otherwise
- // use the value from frame 0.
+ // then do so, otherwise use the value from frame 0.
if (context->ReadRegister(reg_info, reg_value)) {
WriteRegister(reg_info, reg_value);
} else if (frame_zero_context->ReadRegister(reg_info, reg_value)) {
@@ -355,12 +353,11 @@ Status RegisterContext::ReadRegisterValueFromMemory(
return error;
}
- // We now have a memory buffer that contains the part or all of the register
- // value. Set the register value using this memory data.
+ // We now have a memory buffer that contains the part or all of the
+ // register value. Set the register value using this memory data.
// TODO: we might need to add a parameter to this function in case the byte
// order of the memory data doesn't match the process. For now we are
- // assuming
- // they are the same.
+ // assuming they are the same.
reg_value.SetFromMemoryData(reg_info, src, src_len,
process_sp->GetByteOrder(), error);
} else
@@ -381,8 +378,7 @@ Status RegisterContext::WriteRegisterValueToMemory(
// TODO: we might need to add a parameter to this function in case the byte
// order of the memory data doesn't match the process. For now we are
- // assuming
- // they are the same.
+ // assuming they are the same.
const uint32_t bytes_copied = reg_value.GetAsMemoryData(
reg_info, dst, dst_len, process_sp->GetByteOrder(), error);
@@ -431,9 +427,9 @@ ThreadSP RegisterContext::CalculateThread() {
}
StackFrameSP RegisterContext::CalculateStackFrame() {
- // Register contexts might belong to many frames if we have inlined
- // functions inside a frame since all inlined functions share the
- // same registers, so we can't definitively say which frame we come from...
+ // Register contexts might belong to many frames if we have inlined functions
+ // inside a frame since all inlined functions share the same registers, so we
+ // can't definitively say which frame we come from...
return StackFrameSP();
}
diff --git a/source/Target/SectionLoadHistory.cpp b/source/Target/SectionLoadHistory.cpp
index 740f48bc829c..5844da5d41e9 100644
--- a/source/Target/SectionLoadHistory.cpp
+++ b/source/Target/SectionLoadHistory.cpp
@@ -43,13 +43,12 @@ SectionLoadHistory::GetSectionLoadListForStopID(uint32_t stop_id,
if (!m_stop_id_to_section_load_list.empty()) {
if (read_only) {
// The section load list is for reading data only so we don't need to
- // create
- // a new SectionLoadList for the current stop ID, just return the section
- // load list for the stop ID that is equal to or less than the current
- // stop ID
+ // create a new SectionLoadList for the current stop ID, just return the
+ // section load list for the stop ID that is equal to or less than the
+ // current stop ID
if (stop_id == eStopIDNow) {
- // If we are asking for the latest and greatest value, it is always
- // at the end of our list because that will be the highest stop ID.
+ // If we are asking for the latest and greatest value, it is always at
+ // the end of our list because that will be the highest stop ID.
StopIDToSectionLoadList::reverse_iterator rpos =
m_stop_id_to_section_load_list.rbegin();
return rpos->second.get();
@@ -70,10 +69,8 @@ SectionLoadHistory::GetSectionLoadListForStopID(uint32_t stop_id,
assert(stop_id != eStopIDNow);
// We are updating the section load list (not read only), so if the stop
- // ID
- // passed in isn't the same as the last stop ID in our collection, then
- // create
- // a new node using the current stop ID
+ // ID passed in isn't the same as the last stop ID in our collection,
+ // then create a new node using the current stop ID
StopIDToSectionLoadList::iterator pos =
m_stop_id_to_section_load_list.lower_bound(stop_id);
if (pos != m_stop_id_to_section_load_list.end() &&
diff --git a/source/Target/SectionLoadList.cpp b/source/Target/SectionLoadList.cpp
index 31ccf17369db..6839aaccaa52 100644
--- a/source/Target/SectionLoadList.cpp
+++ b/source/Target/SectionLoadList.cpp
@@ -97,12 +97,12 @@ bool SectionLoadList::SetSectionLoadAddress(const lldb::SectionSP &section,
// we have multiple load addresses that correspond to a section, we will
// always attribute the section to the be last section that claims it
// exists at that address. Sometimes it is ok for more that one section
- // to be loaded at a specific load address, and other times it isn't.
- // The "warn_multiple" parameter tells us if we should warn in this case
- // or not. The DynamicLoader plug-in subclasses should know which
- // sections should warn and which shouldn't (darwin shared cache modules
- // all shared the same "__LINKEDIT" sections, so the dynamic loader can
- // pass false for "warn_multiple").
+ // to be loaded at a specific load address, and other times it isn't. The
+ // "warn_multiple" parameter tells us if we should warn in this case or
+ // not. The DynamicLoader plug-in subclasses should know which sections
+ // should warn and which shouldn't (darwin shared cache modules all
+ // shared the same "__LINKEDIT" sections, so the dynamic loader can pass
+ // false for "warn_multiple").
if (warn_multiple && section != ats_pos->second) {
ModuleSP module_sp(section->GetModule());
if (module_sp) {
@@ -228,8 +228,8 @@ bool SectionLoadList::ResolveLoadAddress(addr_t load_addr, Address &so_addr,
}
}
} else {
- // There are no entries that have an address that is >= load_addr,
- // so we need to check the last entry on our collection.
+ // There are no entries that have an address that is >= load_addr, so we
+ // need to check the last entry on our collection.
addr_to_sect_collection::const_reverse_iterator rpos =
m_addr_to_sect.rbegin();
if (load_addr >= rpos->first) {
diff --git a/source/Target/StackFrame.cpp b/source/Target/StackFrame.cpp
index dd44eac8e50c..2b9260f95f3f 100644
--- a/source/Target/StackFrame.cpp
+++ b/source/Target/StackFrame.cpp
@@ -60,8 +60,8 @@ StackFrame::StackFrame(const ThreadSP &thread_sp, user_id_t frame_idx,
m_is_history_frame(is_history_frame), m_variable_list_sp(),
m_variable_list_value_objects(), m_disassembly(), m_mutex() {
// If we don't have a CFA value, use the frame index for our StackID so that
- // recursive
- // functions properly aren't confused with one another on a history stack.
+ // recursive functions properly aren't confused with one another on a history
+ // stack.
if (m_is_history_frame && !m_cfa_is_valid) {
m_id.SetCFA(m_frame_index);
}
@@ -136,17 +136,17 @@ StackFrame::~StackFrame() = default;
StackID &StackFrame::GetStackID() {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
- // Make sure we have resolved the StackID object's symbol context scope if
- // we already haven't looked it up.
+ // Make sure we have resolved the StackID object's symbol context scope if we
+ // already haven't looked it up.
if (m_flags.IsClear(RESOLVED_FRAME_ID_SYMBOL_SCOPE)) {
if (m_id.GetSymbolContextScope()) {
- // We already have a symbol context scope, we just don't have our
- // flag bit set.
+ // We already have a symbol context scope, we just don't have our flag
+ // bit set.
m_flags.Set(RESOLVED_FRAME_ID_SYMBOL_SCOPE);
} else {
- // Calculate the frame block and use this for the stack ID symbol
- // context scope if we have one.
+ // Calculate the frame block and use this for the stack ID symbol context
+ // scope if we have one.
SymbolContextScope *scope = GetFrameBlock();
if (scope == nullptr) {
// We don't have a block, so use the symbol
@@ -194,7 +194,7 @@ const Address &StackFrame::GetFrameCodeAddress() {
const bool allow_section_end = true;
if (m_frame_code_addr.SetOpcodeLoadAddress(
m_frame_code_addr.GetOffset(), target_sp.get(),
- eAddressClassCode, allow_section_end)) {
+ AddressClass::eCode, allow_section_end)) {
ModuleSP module_sp(m_frame_code_addr.GetModule());
if (module_sp) {
m_sc.module_sp = module_sp;
@@ -247,13 +247,13 @@ Block *StackFrame::GetFrameBlock() {
if (m_sc.block) {
Block *inline_block = m_sc.block->GetContainingInlinedBlock();
if (inline_block) {
- // Use the block with the inlined function info
- // as the frame block we want this frame to have only the variables
- // for the inlined function and its non-inlined block child blocks.
+ // Use the block with the inlined function info as the frame block we
+ // want this frame to have only the variables for the inlined function
+ // and its non-inlined block child blocks.
return inline_block;
} else {
- // This block is not contained within any inlined function blocks
- // with so we want to use the top most function block.
+ // This block is not contained within any inlined function blocks with so
+ // we want to use the top most function block.
return &m_sc.function->GetBlock(false);
}
}
@@ -263,8 +263,8 @@ Block *StackFrame::GetFrameBlock() {
//----------------------------------------------------------------------
// Get the symbol context if we already haven't done so by resolving the
// PC address as much as possible. This way when we pass around a
-// StackFrame object, everyone will have as much information as
-// possible and no one will ever have to look things up manually.
+// StackFrame object, everyone will have as much information as possible and no
+// one will ever have to look things up manually.
//----------------------------------------------------------------------
const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
std::lock_guard<std::recursive_mutex> guard(m_mutex);
@@ -279,15 +279,15 @@ const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
resolved |= eSymbolContextTarget;
}
- // Resolve our PC to section offset if we haven't already done so
- // and if we don't have a module. The resolved address section will
- // contain the module to which it belongs
+ // Resolve our PC to section offset if we haven't already done so and if we
+ // don't have a module. The resolved address section will contain the
+ // module to which it belongs
if (!m_sc.module_sp && m_flags.IsClear(RESOLVED_FRAME_CODE_ADDR))
GetFrameCodeAddress();
- // If this is not frame zero, then we need to subtract 1 from the PC
- // value when doing address lookups since the PC will be on the
- // instruction following the function call instruction...
+ // If this is not frame zero, then we need to subtract 1 from the PC value
+ // when doing address lookups since the PC will be on the instruction
+ // following the function call instruction...
Address lookup_addr(GetFrameCodeAddress());
if (m_frame_index > 0 && lookup_addr.IsValid()) {
@@ -296,10 +296,9 @@ const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
lookup_addr.SetOffset(offset - 1);
} else {
- // lookup_addr is the start of a section. We need
- // do the math on the actual load address and re-compute
- // the section. We're working with a 'noreturn' function
- // at the end of a section.
+ // lookup_addr is the start of a section. We need do the math on the
+ // actual load address and re-compute the section. We're working with
+ // a 'noreturn' function at the end of a section.
ThreadSP thread_sp(GetThread());
if (thread_sp) {
TargetSP target_sp(thread_sp->CalculateTarget());
@@ -315,9 +314,9 @@ const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
}
if (m_sc.module_sp) {
- // We have something in our stack frame symbol context, lets check
- // if we haven't already tried to lookup one of those things. If we
- // haven't then we will do the query.
+ // We have something in our stack frame symbol context, lets check if we
+ // haven't already tried to lookup one of those things. If we haven't
+ // then we will do the query.
uint32_t actual_resolve_scope = 0;
@@ -367,17 +366,16 @@ const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
}
if (actual_resolve_scope) {
- // We might be resolving less information than what is already
- // in our current symbol context so resolve into a temporary
- // symbol context "sc" so we don't clear out data we have
- // already found in "m_sc"
+ // We might be resolving less information than what is already in our
+ // current symbol context so resolve into a temporary symbol context
+ // "sc" so we don't clear out data we have already found in "m_sc"
SymbolContext sc;
// Set flags that indicate what we have tried to resolve
resolved |= m_sc.module_sp->ResolveSymbolContextForAddress(
lookup_addr, actual_resolve_scope, sc);
- // Only replace what we didn't already have as we may have
- // information for an inlined function scope that won't match
- // what a standard lookup by address would match
+ // Only replace what we didn't already have as we may have information
+ // for an inlined function scope that won't match what a standard
+ // lookup by address would match
if ((resolved & eSymbolContextCompUnit) && m_sc.comp_unit == nullptr)
m_sc.comp_unit = sc.comp_unit;
if ((resolved & eSymbolContextFunction) && m_sc.function == nullptr)
@@ -404,9 +402,9 @@ const SymbolContext &StackFrame::GetSymbolContext(uint32_t resolve_scope) {
// Update our internal flags so we remember what we have tried to locate so
// we don't have to keep trying when more calls to this function are made.
- // We might have dug up more information that was requested (for example
- // if we were asked to only get the block, we will have gotten the
- // compile unit, and function) so set any additional bits that we resolved
+ // We might have dug up more information that was requested (for example if
+ // we were asked to only get the block, we will have gotten the compile
+ // unit, and function) so set any additional bits that we resolved
m_flags.Set(resolve_scope | resolved);
}
@@ -546,8 +544,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
}
if (!var_sp && (options & eExpressionPathOptionsAllowDirectIVarAccess)) {
- // Check for direct ivars access which helps us with implicit
- // access to ivars with the "this->" or "self->"
+ // Check for direct ivars access which helps us with implicit access to
+ // ivars with the "this->" or "self->"
GetSymbolContext(eSymbolContextFunction | eSymbolContextBlock);
lldb::LanguageType method_language = eLanguageTypeUnknown;
bool is_instance_method = false;
@@ -622,9 +620,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
valobj_sp->GetCompilerType().GetTypeInfo(nullptr);
if ((pointer_type_flags & eTypeIsObjC) &&
(pointer_type_flags & eTypeIsPointer)) {
- // This was an objective C object pointer and
- // it was requested we skip any fragile ivars
- // so return nothing here
+ // This was an objective C object pointer and it was requested we
+ // skip any fragile ivars so return nothing here
return ValueObjectSP();
}
}
@@ -659,15 +656,14 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
ConstString child_name(var_expr.substr(0, var_expr.find_first_of(".-[")));
if (check_ptr_vs_member) {
- // We either have a pointer type and need to verify
- // valobj_sp is a pointer, or we have a member of a
- // class/union/struct being accessed with the . syntax
- // and need to verify we don't have a pointer.
+ // We either have a pointer type and need to verify valobj_sp is a
+ // pointer, or we have a member of a class/union/struct being accessed
+ // with the . syntax and need to verify we don't have a pointer.
const bool actual_is_ptr = valobj_sp->IsPointerType();
if (actual_is_ptr != expr_is_ptr) {
- // Incorrect use of "." with a pointer, or "->" with
- // a class/union/struct instance or reference.
+ // Incorrect use of "." with a pointer, or "->" with a
+ // class/union/struct instance or reference.
valobj_sp->GetExpressionPath(var_expr_path_strm, false);
if (actual_is_ptr)
error.SetErrorStringWithFormat(
@@ -697,10 +693,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
// No child member with name "child_name"
if (synthetically_added_instance_object) {
// We added a "this->" or "self->" to the beginning of the
- // expression
- // and this is the first pointer ivar access, so just return
- // the normal
- // error
+ // expression and this is the first pointer ivar access, so just
+ // return the normal error
error.SetErrorStringWithFormat(
"no variable or instance variable named '%s' found in "
"this frame",
@@ -735,8 +729,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
} break;
case '[': {
- // Array member access, or treating pointer as an array
- // Need at least two brackets and a number
+ // Array member access, or treating pointer as an array Need at least two
+ // brackets and a number
if (var_expr.size() <= 2) {
error.SetErrorStringWithFormat(
"invalid square bracket encountered after \"%s\" in \"%s\"",
@@ -790,11 +784,10 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
deref = false;
} else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() &&
deref) {
- // what we have is *arr[low]. the most similar C++ syntax is
- // to get arr[0]
- // (an operation that is equivalent to deref-ing arr)
- // and extract bit low out of it. reading array item low
- // would be done by saying arr[low], without a deref * sign
+ // what we have is *arr[low]. the most similar C++ syntax is to get
+ // arr[0] (an operation that is equivalent to deref-ing arr) and
+ // extract bit low out of it. reading array item low would be done by
+ // saying arr[low], without a deref * sign
Status error;
ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));
if (error.Fail()) {
@@ -828,8 +821,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
return ValueObjectSP();
} else if (is_objc_pointer) {
- // dereferencing ObjC variables is not valid.. so let's try
- // and recur to synthetic children
+ // dereferencing ObjC variables is not valid.. so let's try and
+ // recur to synthetic children
ValueObjectSP synthetic = valobj_sp->GetSyntheticValue();
if (!synthetic /* no synthetic */
|| synthetic == valobj_sp) /* synthetic is the same as
@@ -874,9 +867,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
}
} else if (valobj_sp->GetCompilerType().IsArrayType(
nullptr, nullptr, &is_incomplete_array)) {
- // Pass false to dynamic_value here so we can tell the
- // difference between
- // no dynamic value and no member of this type...
+ // Pass false to dynamic_value here so we can tell the difference
+ // between no dynamic value and no member of this type...
child_valobj_sp = valobj_sp->GetChildAtIndex(child_index, true);
if (!child_valobj_sp && (is_incomplete_array || !no_synth_child))
child_valobj_sp =
@@ -976,8 +968,8 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
if (valobj_sp->GetCompilerType().IsPointerToScalarType() && deref) {
// what we have is *ptr[low-high]. the most similar C++ syntax is to
// deref ptr and extract bits low thru high out of it. reading array
- // items low thru high would be done by saying ptr[low-high], without
- // a deref * sign
+ // items low thru high would be done by saying ptr[low-high], without a
+ // deref * sign
Status error;
ValueObjectSP temp(valobj_sp->Dereference(error));
if (error.Fail()) {
@@ -991,10 +983,10 @@ ValueObjectSP StackFrame::GetValueForVariableExpressionPath(
valobj_sp = temp;
deref = false;
} else if (valobj_sp->GetCompilerType().IsArrayOfScalarType() && deref) {
- // what we have is *arr[low-high]. the most similar C++ syntax is to get
- // arr[0] (an operation that is equivalent to deref-ing arr) and extract
- // bits low thru high out of it. reading array items low thru high would
- // be done by saying arr[low-high], without a deref * sign
+ // what we have is *arr[low-high]. the most similar C++ syntax is to
+ // get arr[0] (an operation that is equivalent to deref-ing arr) and
+ // extract bits low thru high out of it. reading array items low thru
+ // high would be done by saying arr[low-high], without a deref * sign
Status error;
ValueObjectSP temp(valobj_sp->GetChildAtIndex(0, true));
if (error.Fail()) {
@@ -1091,8 +1083,8 @@ bool StackFrame::GetFrameBaseValue(Scalar &frame_base, Status *error_ptr) {
if (m_sc.function->GetFrameBaseExpression().Evaluate(
&exe_ctx, nullptr, loclist_base_addr, nullptr, nullptr,
expr_value, &m_frame_base_error) == false) {
- // We should really have an error if evaluate returns, but in case
- // we don't, lets set the error to something at least.
+ // We should really have an error if evaluate returns, but in case we
+ // don't, lets set the error to something at least.
if (m_frame_base_error.Success())
m_frame_base_error.SetErrorString(
"Evaluation of the frame base expression failed.");
@@ -1420,8 +1412,8 @@ ValueObjectSP GetValueForDereferincingOffset(StackFrame &frame,
ValueObjectSP &base,
int64_t offset) {
// base is a pointer to something
- // offset is the thing to add to the pointer
- // We return the most sensible ValueObject for the result of *(base+offset)
+ // offset is the thing to add to the pointer We return the most sensible
+ // ValueObject for the result of *(base+offset)
if (!base->IsPointerOrReferenceType()) {
return ValueObjectSP();
@@ -1486,8 +1478,8 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
//
// f, a pointer to a struct, is known to be at -0x8(%rbp).
//
- // DoGuessValueAt(frame, rdi, 4, dis, vars, 0x22) finds the instruction at +18
- // that assigns to rdi, and calls itself recursively for that dereference
+ // DoGuessValueAt(frame, rdi, 4, dis, vars, 0x22) finds the instruction at
+ // +18 that assigns to rdi, and calls itself recursively for that dereference
// DoGuessValueAt(frame, rdi, 8, dis, vars, 0x18) finds the instruction at
// +14 that assigns to rdi, and calls itself recursively for that
// derefernece
@@ -1533,9 +1525,9 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
for (uint32_t ii = current_inst - 1; ii != (uint32_t)-1; --ii) {
// This is not an exact algorithm, and it sacrifices accuracy for
- // generality. Recognizing "mov" and "ld" instructions –– and which are
- // their source and destination operands -- is something the disassembler
- // should do for us.
+ // generality. Recognizing "mov" and "ld" instructions –– and which
+ // are their source and destination operands -- is something the
+ // disassembler should do for us.
InstructionSP instruction_sp =
disassembler.GetInstructionList().GetInstructionAtIndex(ii);
diff --git a/source/Target/StackFrameList.cpp b/source/Target/StackFrameList.cpp
index be7fa8001212..2380a91df41d 100644
--- a/source/Target/StackFrameList.cpp
+++ b/source/Target/StackFrameList.cpp
@@ -51,8 +51,8 @@ StackFrameList::StackFrameList(Thread &thread,
}
StackFrameList::~StackFrameList() {
- // Call clear since this takes a lock and clears the stack frame list
- // in case another thread is currently using this stack frame list
+ // Call clear since this takes a lock and clears the stack frame list in case
+ // another thread is currently using this stack frame list
Clear();
}
@@ -95,13 +95,12 @@ void StackFrameList::ResetCurrentInlinedDepth() {
log->Printf(
"ResetCurrentInlinedDepth: Invalidating current inlined depth.\n");
} else {
- // We only need to do something special about inlined blocks when we
- // are at the beginning of an inlined function:
+ // We only need to do something special about inlined blocks when we are
+ // at the beginning of an inlined function:
// FIXME: We probably also have to do something special if the PC is at
// the END
// of an inlined function, which coincides with the end of either its
- // containing
- // function or another inlined function.
+ // containing function or another inlined function.
lldb::addr_t curr_pc = m_thread.GetRegisterContext()->GetPC();
Block *block_ptr = m_frames[0]->GetFrameBlock();
@@ -114,19 +113,15 @@ void StackFrameList::ResetCurrentInlinedDepth() {
containing_range)) {
if (pc_as_address == containing_range.GetBaseAddress()) {
// If we got here because of a breakpoint hit, then set the inlined
- // depth depending on where
- // the breakpoint was set.
- // If we got here because of a crash, then set the inlined depth to
- // the deepest most block.
- // Otherwise, we stopped here naturally as the result of a step, so
- // set ourselves in the
- // containing frame of the whole set of nested inlines, so the user
- // can then "virtually"
- // step into the frames one by one, or next over the whole mess.
- // Note: We don't have to handle being somewhere in the middle of
- // the stack here, since
- // ResetCurrentInlinedDepth doesn't get called if there is a valid
- // inlined depth set.
+ // depth depending on where the breakpoint was set. If we got here
+ // because of a crash, then set the inlined depth to the deepest
+ // most block. Otherwise, we stopped here naturally as the result
+ // of a step, so set ourselves in the containing frame of the whole
+ // set of nested inlines, so the user can then "virtually" step
+ // into the frames one by one, or next over the whole mess. Note:
+ // We don't have to handle being somewhere in the middle of the
+ // stack here, since ResetCurrentInlinedDepth doesn't get called if
+ // there is a valid inlined depth set.
StopInfoSP stop_info_sp = m_thread.GetStopInfo();
if (stop_info_sp) {
switch (stop_info_sp->GetStopReason()) {
@@ -134,7 +129,8 @@ void StackFrameList::ResetCurrentInlinedDepth() {
case eStopReasonException:
case eStopReasonExec:
case eStopReasonSignal:
- // In all these cases we want to stop in the deepest most frame.
+ // In all these cases we want to stop in the deepest most
+ // frame.
m_current_inlined_pc = curr_pc;
m_current_inlined_depth = 0;
break;
@@ -142,17 +138,14 @@ void StackFrameList::ResetCurrentInlinedDepth() {
// FIXME: Figure out what this break point is doing, and set the
// inline depth
// appropriately. Be careful to take into account breakpoints
- // that implement
- // step over prologue, since that should do the default
- // calculation.
- // For now, if the breakpoints corresponding to this hit are all
- // internal,
+ // that implement step over prologue, since that should do the
+ // default calculation. For now, if the breakpoints
+ // corresponding to this hit are all internal,
// I set the stop location to the top of the inlined stack,
// since that will make
- // things like stepping over prologues work right. But if there
- // are any non-internal
- // breakpoints I do to the bottom of the stack, since that was
- // the old behavior.
+ // things like stepping over prologues work right. But if
+ // there are any non-internal breakpoints I do to the bottom of
+ // the stack, since that was the old behavior.
uint32_t bp_site_id = stop_info_sp->GetValue();
BreakpointSiteSP bp_site_sp(
m_thread.GetProcess()->GetBreakpointSiteList().FindByID(
@@ -177,10 +170,9 @@ void StackFrameList::ResetCurrentInlinedDepth() {
LLVM_FALLTHROUGH;
default: {
// Otherwise, we should set ourselves at the container of the
- // inlining, so that the
- // user can descend into them.
- // So first we check whether we have more than one inlined block
- // sharing this PC:
+ // inlining, so that the user can descend into them. So first
+ // we check whether we have more than one inlined block sharing
+ // this PC:
int num_inlined_functions = 0;
for (Block *container_ptr = block_ptr->GetInlinedParent();
@@ -250,13 +242,11 @@ void StackFrameList::GetFramesUpTo(uint32_t end_idx) {
#if defined(DEBUG_STACK_FRAMES)
StreamFile s(stdout, false);
#endif
- // If we are hiding some frames from the outside world, we need to add those
- // onto the total count of
- // frames to fetch. However, we don't need to do that if end_idx is 0 since
- // in that case we always
- // get the first concrete frame and all the inlined frames below it... And
- // of course, if end_idx is
- // UINT32_MAX that means get all, so just do that...
+ // If we are hiding some frames from the outside world, we need to add
+ // those onto the total count of frames to fetch. However, we don't need
+ // to do that if end_idx is 0 since in that case we always get the first
+ // concrete frame and all the inlined frames below it... And of course, if
+ // end_idx is UINT32_MAX that means get all, so just do that...
uint32_t inlined_depth = 0;
if (end_idx > 0 && end_idx != UINT32_MAX) {
@@ -273,17 +263,17 @@ void StackFrameList::GetFramesUpTo(uint32_t end_idx) {
lldb::addr_t pc = LLDB_INVALID_ADDRESS;
lldb::addr_t cfa = LLDB_INVALID_ADDRESS;
if (idx == 0) {
- // We might have already created frame zero, only create it
- // if we need to
+ // We might have already created frame zero, only create it if we need
+ // to
if (m_frames.empty()) {
RegisterContextSP reg_ctx_sp(m_thread.GetRegisterContext());
if (reg_ctx_sp) {
const bool success =
unwinder && unwinder->GetFrameInfoAtIndex(idx, cfa, pc);
- // There shouldn't be any way not to get the frame info for frame 0.
- // But if the unwinder can't make one, lets make one by hand with
- // the
+ // There shouldn't be any way not to get the frame info for frame
+ // 0. But if the unwinder can't make one, lets make one by hand
+ // with the
// SP as the CFA and see if that gets any further.
if (!success) {
cfa = reg_ctx_sp->GetSP();
@@ -323,22 +313,20 @@ void StackFrameList::GetFramesUpTo(uint32_t end_idx) {
if (unwind_block) {
Address curr_frame_address(unwind_frame_sp->GetFrameCodeAddress());
TargetSP target_sp = m_thread.CalculateTarget();
- // Be sure to adjust the frame address to match the address
- // that was used to lookup the symbol context above. If we are
- // in the first concrete frame, then we lookup using the current
- // address, else we decrement the address by one to get the correct
- // location.
+ // Be sure to adjust the frame address to match the address that was
+ // used to lookup the symbol context above. If we are in the first
+ // concrete frame, then we lookup using the current address, else we
+ // decrement the address by one to get the correct location.
if (idx > 0) {
if (curr_frame_address.GetOffset() == 0) {
// If curr_frame_address points to the first address in a section
- // then after
- // adjustment it will point to an other section. In that case
- // resolve the
- // address again to the correct section plus offset form.
+ // then after adjustment it will point to an other section. In that
+ // case resolve the address again to the correct section plus
+ // offset form.
addr_t load_addr = curr_frame_address.GetOpcodeLoadAddress(
- target_sp.get(), eAddressClassCode);
+ target_sp.get(), AddressClass::eCode);
curr_frame_address.SetOpcodeLoadAddress(
- load_addr - 1, target_sp.get(), eAddressClassCode);
+ load_addr - 1, target_sp.get(), AddressClass::eCode);
} else {
curr_frame_address.Slide(-1);
}
@@ -414,8 +402,8 @@ void StackFrameList::GetFramesUpTo(uint32_t end_idx) {
break;
prev_frame->UpdatePreviousFrameFromCurrentFrame(*curr_frame);
- // Now copy the fixed up previous frame into the current frames
- // so the pointer doesn't change
+ // Now copy the fixed up previous frame into the current frames so the
+ // pointer doesn't change
m_frames[curr_frame_idx] = prev_frame_sp;
// curr_frame->UpdateCurrentFrameFromPreviousFrame (*prev_frame);
@@ -495,9 +483,8 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
if (frame_sp)
return frame_sp;
- // GetFramesUpTo will fill m_frames with as many frames as you asked for,
- // if there are that many. If there weren't then you asked for too many
- // frames.
+ // GetFramesUpTo will fill m_frames with as many frames as you asked for, if
+ // there are that many. If there weren't then you asked for too many frames.
GetFramesUpTo(idx);
if (idx < m_frames.size()) {
if (m_show_inlined_frames) {
@@ -519,8 +506,8 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
Function *function =
frame_sp->GetSymbolContext(eSymbolContextFunction).function;
if (function) {
- // When we aren't showing inline functions we always use
- // the top most function block as the scope.
+ // When we aren't showing inline functions we always use the top
+ // most function block as the scope.
frame_sp->SetSymbolContextScope(&function->GetBlock(false));
} else {
// Set the symbol scope from the symbol regardless if it is nullptr
@@ -534,9 +521,8 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
}
} else if (original_idx == 0) {
// There should ALWAYS be a frame at index 0. If something went wrong with
- // the CurrentInlinedDepth such that
- // there weren't as many frames as we thought taking that into account, then
- // reset the current inlined depth
+ // the CurrentInlinedDepth such that there weren't as many frames as we
+ // thought taking that into account, then reset the current inlined depth
// and return the real zeroth frame.
if (m_frames.empty()) {
// Why do we have a thread with zero frames, that should not ever
@@ -554,11 +540,11 @@ StackFrameSP StackFrameList::GetFrameAtIndex(uint32_t idx) {
StackFrameSP
StackFrameList::GetFrameWithConcreteFrameIndex(uint32_t unwind_idx) {
// First try assuming the unwind index is the same as the frame index. The
- // unwind index is always greater than or equal to the frame index, so it
- // is a good place to start. If we have inlined frames we might have 5
- // concrete frames (frame unwind indexes go from 0-4), but we might have 15
- // frames after we make all the inlined frames. Most of the time the unwind
- // frame index (or the concrete frame index) is the same as the frame index.
+ // unwind index is always greater than or equal to the frame index, so it is
+ // a good place to start. If we have inlined frames we might have 5 concrete
+ // frames (frame unwind indexes go from 0-4), but we might have 15 frames
+ // after we make all the inlined frames. Most of the time the unwind frame
+ // index (or the concrete frame index) is the same as the frame index.
uint32_t frame_idx = unwind_idx;
StackFrameSP frame_sp(GetFrameAtIndex(frame_idx));
while (frame_sp) {
@@ -719,9 +705,9 @@ void StackFrameList::Merge(std::unique_ptr<StackFrameList> &curr_ap,
#if defined(DEBUG_STACK_FRAMES)
s.PutCString("No previous frames, so use current frames...\n");
#endif
- // We either don't have any previous frames, or since we have more than
- // one current frames it means we have all the frames and can safely
- // replace our previous frames.
+ // We either don't have any previous frames, or since we have more than one
+ // current frames it means we have all the frames and can safely replace
+ // our previous frames.
prev_sp.reset(curr_ap.release());
return;
}
@@ -733,8 +719,8 @@ void StackFrameList::Merge(std::unique_ptr<StackFrameList> &curr_ap,
s.PutCString(
"We have more than one current frame, so use current frames...\n");
#endif
- // We have more than one current frames it means we have all the frames
- // and can safely replace our previous frames.
+ // We have more than one current frames it means we have all the frames and
+ // can safely replace our previous frames.
prev_sp.reset(curr_ap.release());
#if defined(DEBUG_STACK_FRAMES)
diff --git a/source/Target/StackID.cpp b/source/Target/StackID.cpp
index 889cf89b9be7..341c902af995 100644
--- a/source/Target/StackID.cpp
+++ b/source/Target/StackID.cpp
@@ -69,12 +69,11 @@ bool lldb_private::operator<(const StackID &lhs, const StackID &rhs) {
// FIXME: We are assuming that the stacks grow downward in memory. That's not
// necessary, but true on
// all the machines we care about at present. If this changes, we'll have to
- // deal with that. The ABI is the
- // agent who knows this ordering, but the StackID has no access to the ABI.
- // The most straightforward way
- // to handle this is to add a "m_grows_downward" bool to the StackID, and set
- // it in the constructor.
- // But I'm not going to waste a bool per StackID on this till we need it.
+ // deal with that. The ABI is the agent who knows this ordering, but the
+ // StackID has no access to the ABI. The most straightforward way to handle
+ // this is to add a "m_grows_downward" bool to the StackID, and set it in the
+ // constructor. But I'm not going to waste a bool per StackID on this till we
+ // need it.
if (lhs_cfa != rhs_cfa)
return lhs_cfa < rhs_cfa;
diff --git a/source/Target/StopInfo.cpp b/source/Target/StopInfo.cpp
index 652ad8a05445..f8b17dc10eca 100644
--- a/source/Target/StopInfo.cpp
+++ b/source/Target/StopInfo.cpp
@@ -63,12 +63,10 @@ bool StopInfo::HasTargetRunSinceMe() {
return true;
} else if (ret_type == eStateStopped) {
// This is a little tricky. We want to count "run and stopped again
- // before you could
- // ask this question as a "TRUE" answer to HasTargetRunSinceMe. But we
- // don't want to
- // include any running of the target done for expressions. So we track
- // both resumes,
- // and resumes caused by expressions, and check if there are any resumes
+ // before you could ask this question as a "TRUE" answer to
+ // HasTargetRunSinceMe. But we don't want to include any running of the
+ // target done for expressions. So we track both resumes, and resumes
+ // caused by expressions, and check if there are any resumes
// NOT caused
// by expressions.
@@ -199,8 +197,7 @@ public:
if (bp_site_sp) {
StreamString strm;
// If we have just hit an internal breakpoint, and it has a kind
- // description, print that instead of the
- // full breakpoint printing:
+ // description, print that instead of the full breakpoint printing:
if (bp_site_sp->IsInternal()) {
size_t num_owners = bp_site_sp->GetNumberOfOwners();
for (size_t idx = 0; idx < num_owners; idx++) {
@@ -258,9 +255,9 @@ public:
protected:
bool ShouldStop(Event *event_ptr) override {
- // This just reports the work done by PerformAction or the synchronous stop.
- // It should
- // only ever get called after they have had a chance to run.
+ // This just reports the work done by PerformAction or the synchronous
+ // stop. It should only ever get called after they have had a chance to
+ // run.
assert(m_should_stop_is_valid);
return m_should_stop;
}
@@ -293,54 +290,47 @@ protected:
if (bp_site_sp) {
// Let's copy the owners list out of the site and store them in a local
- // list. That way if
- // one of the breakpoint actions changes the site, then we won't be
- // operating on a bad list.
+ // list. That way if one of the breakpoint actions changes the site,
+ // then we won't be operating on a bad list.
BreakpointLocationCollection site_locations;
size_t num_owners = bp_site_sp->CopyOwnersList(site_locations);
if (num_owners == 0) {
m_should_stop = true;
} else {
- // We go through each location, and test first its precondition - this
- // overrides everything. Note,
- // we only do this once per breakpoint - not once per location...
- // Then check the condition. If the condition says to stop,
- // then we run the callback for that location. If that callback says
- // to stop as well, then
- // we set m_should_stop to true; we are going to stop.
- // But we still want to give all the breakpoints whose conditions say
- // we are going to stop a
- // chance to run their callbacks.
- // Of course if any callback restarts the target by putting "continue"
- // in the callback, then
+ // We go through each location, and test first its precondition -
+ // this overrides everything. Note, we only do this once per
+ // breakpoint - not once per location... Then check the condition.
+ // If the condition says to stop, then we run the callback for that
+ // location. If that callback says to stop as well, then we set
+ // m_should_stop to true; we are going to stop. But we still want to
+ // give all the breakpoints whose conditions say we are going to stop
+ // a chance to run their callbacks. Of course if any callback
+ // restarts the target by putting "continue" in the callback, then
// we're going to restart, without running the rest of the callbacks.
- // And in this case we will
- // end up not stopping even if another location said we should stop.
- // But that's better than not
- // running all the callbacks.
+ // And in this case we will end up not stopping even if another
+ // location said we should stop. But that's better than not running
+ // all the callbacks.
m_should_stop = false;
// We don't select threads as we go through them testing breakpoint
- // conditions and running commands.
- // So we need to set the thread for expression evaluation here:
+ // conditions and running commands. So we need to set the thread for
+ // expression evaluation here:
ThreadList::ExpressionExecutionThreadPusher thread_pusher(thread_sp);
ExecutionContext exe_ctx(thread_sp->GetStackFrameAtIndex(0));
Process *process = exe_ctx.GetProcessPtr();
if (process->GetModIDRef().IsLastResumeForUserExpression()) {
// If we are in the middle of evaluating an expression, don't run
- // asynchronous breakpoint commands or
- // expressions. That could lead to infinite recursion if the
- // command or condition re-calls the function
- // with this breakpoint.
+ // asynchronous breakpoint commands or expressions. That could
+ // lead to infinite recursion if the command or condition re-calls
+ // the function with this breakpoint.
// TODO: We can keep a list of the breakpoints we've seen while
// running expressions in the nested
// PerformAction calls that can arise when the action runs a
- // function that hits another breakpoint,
- // and only stop running commands when we see the same breakpoint
- // hit a second time.
+ // function that hits another breakpoint, and only stop running
+ // commands when we see the same breakpoint hit a second time.
m_should_stop_is_valid = true;
if (log)
@@ -377,12 +367,11 @@ protected:
StoppointCallbackContext context(event_ptr, exe_ctx, false);
// For safety's sake let's also grab an extra reference to the
- // breakpoint owners of the locations we're
- // going to examine, since the locations are going to have to get back
- // to their breakpoints, and the
- // locations don't keep their owners alive. I'm just sticking the
- // BreakpointSP's in a vector since
- // I'm only using it to locally increment their retain counts.
+ // breakpoint owners of the locations we're going to examine, since
+ // the locations are going to have to get back to their breakpoints,
+ // and the locations don't keep their owners alive. I'm just
+ // sticking the BreakpointSP's in a vector since I'm only using it to
+ // locally increment their retain counts.
std::vector<lldb::BreakpointSP> location_owners;
@@ -404,8 +393,8 @@ protected:
continue;
// The breakpoint site may have many locations associated with it,
- // not all of them valid for
- // this thread. Skip the ones that aren't:
+ // not all of them valid for this thread. Skip the ones that
+ // aren't:
if (!bp_loc_sp->ValidForThisThread(thread_sp.get())) {
if (log) {
log->Printf("Breakpoint %s hit on thread 0x%llx but it was not "
@@ -419,8 +408,7 @@ protected:
internal_breakpoint = bp_loc_sp->GetBreakpoint().IsInternal();
// First run the precondition, but since the precondition is per
- // breakpoint, only run it once
- // per breakpoint.
+ // breakpoint, only run it once per breakpoint.
std::pair<std::unordered_set<break_id_t>::iterator, bool> result =
precondition_breakpoints.insert(
bp_loc_sp->GetBreakpoint().GetID());
@@ -433,9 +421,8 @@ protected:
continue;
// Next run the condition for the breakpoint. If that says we
- // should stop, then we'll run
- // the callback for the breakpoint. If the callback says we
- // shouldn't stop that will win.
+ // should stop, then we'll run the callback for the breakpoint. If
+ // the callback says we shouldn't stop that will win.
if (bp_loc_sp->GetConditionText() != nullptr) {
Status condition_error;
@@ -470,9 +457,8 @@ protected:
}
if (!condition_says_stop) {
// We don't want to increment the hit count of breakpoints if
- // the condition fails.
- // We've already bumped it by the time we get here, so undo
- // the bump:
+ // the condition fails. We've already bumped it by the time
+ // we get here, so undo the bump:
bp_loc_sp->UndoBumpHitCount();
continue;
}
@@ -524,8 +510,8 @@ protected:
thread_sp->GetProcess()->GetTarget().RemoveBreakpointByID(
bp_loc_sp->GetBreakpoint().GetID());
}
- // Also make sure that the callback hasn't continued the target.
- // If it did, when we'll set m_should_start to false and get out of
+ // Also make sure that the callback hasn't continued the target. If
+ // it did, when we'll set m_should_start to false and get out of
// here.
if (HasTargetRunSinceMe()) {
m_should_stop = false;
@@ -551,13 +537,13 @@ protected:
if ((m_should_stop == false || internal_breakpoint)
&& thread_sp->CompletedPlanOverridesBreakpoint()) {
- // Override should_stop decision when we have
- // completed step plan additionally to the breakpoint
+ // Override should_stop decision when we have completed step plan
+ // additionally to the breakpoint
m_should_stop = true;
- // Here we clean the preset stop info so the next
- // GetStopInfo call will find the appropriate stop info,
- // which should be the stop info related to the completed plan
+ // Here we clean the preset stop info so the next GetStopInfo call will
+ // find the appropriate stop info, which should be the stop info
+ // related to the completed plan
thread_sp->ResetStopInfo();
}
@@ -652,8 +638,8 @@ public:
protected:
bool ShouldStopSynchronous(Event *event_ptr) override {
- // ShouldStop() method is idempotent and should not affect hit count.
- // See Process::RunPrivateStateThread()->Process()->HandlePrivateEvent()
+ // ShouldStop() method is idempotent and should not affect hit count. See
+ // Process::RunPrivateStateThread()->Process()->HandlePrivateEvent()
// -->Process()::ShouldBroadcastEvent()->ThreadList::ShouldStop()->
// Thread::ShouldStop()->ThreadPlanBase::ShouldStop()->
// StopInfoWatchpoint::ShouldStop() and
@@ -689,9 +675,9 @@ protected:
}
bool ShouldStop(Event *event_ptr) override {
- // This just reports the work done by PerformAction or the synchronous stop.
- // It should
- // only ever get called after they have had a chance to run.
+ // This just reports the work done by PerformAction or the synchronous
+ // stop. It should only ever get called after they have had a chance to
+ // run.
assert(m_should_stop_is_valid);
return m_should_stop;
}
@@ -699,8 +685,8 @@ protected:
void PerformAction(Event *event_ptr) override {
Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_WATCHPOINTS);
// We're going to calculate if we should stop or not in some way during the
- // course of
- // this code. Also by default we're going to stop, so set that here.
+ // course of this code. Also by default we're going to stop, so set that
+ // here.
m_should_stop = true;
@@ -716,10 +702,8 @@ protected:
{
// check if this process is running on an architecture where
- // watchpoints trigger
- // before the associated instruction runs. if so, disable the WP,
- // single-step and then
- // re-enable the watchpoint
+ // watchpoints trigger before the associated instruction runs. if so,
+ // disable the WP, single-step and then re-enable the watchpoint
if (process_sp) {
uint32_t num;
bool wp_triggers_after;
@@ -727,10 +711,9 @@ protected:
if (process_sp->GetWatchpointSupportInfo(num, wp_triggers_after)
.Success()) {
if (!wp_triggers_after) {
- // We need to preserve the watch_index before watchpoint
- // is disable. Since Watchpoint::SetEnabled will clear the
- // watch index.
- // This will fix TestWatchpointIter failure
+ // We need to preserve the watch_index before watchpoint is
+ // disable. Since Watchpoint::SetEnabled will clear the watch
+ // index. This will fix TestWatchpointIter failure
Watchpoint *wp = wp_sp.get();
uint32_t watch_index = wp->GetHardwareIndex();
process_sp->DisableWatchpoint(wp, false);
@@ -759,8 +742,8 @@ protected:
}
// This sentry object makes sure the current watchpoint is disabled
- // while performing watchpoint actions,
- // and it is then enabled after we are finished.
+ // while performing watchpoint actions, and it is then enabled after we
+ // are finished.
WatchpointSentry sentry(process_sp, wp_sp);
/*
@@ -789,16 +772,13 @@ protected:
// TODO: This condition should be checked in the synchronous part of the
// watchpoint code
// (Watchpoint::ShouldStop), so that we avoid pulling an event even if
- // the watchpoint fails
- // the ignore count condition. It is moved here temporarily, because for
- // archs with
- // watchpoint_exceptions_received=before, the code in the previous lines
- // takes care of moving
- // the inferior to next PC. We have to check the ignore count condition
- // after this is done,
- // otherwise we will hit same watchpoint multiple times until we pass
- // ignore condition, but we
- // won't actually be ignoring them.
+ // the watchpoint fails the ignore count condition. It is moved here
+ // temporarily, because for archs with
+ // watchpoint_exceptions_received=before, the code in the previous
+ // lines takes care of moving the inferior to next PC. We have to check
+ // the ignore count condition after this is done, otherwise we will hit
+ // same watchpoint multiple times until we pass ignore condition, but
+ // we won't actually be ignoring them.
if (wp_sp->GetHitCount() <= wp_sp->GetIgnoreCount())
m_should_stop = false;
@@ -824,9 +804,9 @@ protected:
if (result_value_sp->ResolveValue(scalar_value)) {
if (scalar_value.ULongLong(1) == 0) {
// We have been vetoed. This takes precedence over querying
- // the watchpoint whether it should stop (aka ignore count and
- // friends). See also StopInfoWatchpoint::ShouldStop() as
- // well as Process::ProcessEventData::DoOnRemoval().
+ // the watchpoint whether it should stop (aka ignore count
+ // and friends). See also StopInfoWatchpoint::ShouldStop()
+ // as well as Process::ProcessEventData::DoOnRemoval().
m_should_stop = false;
} else
m_should_stop = true;
@@ -877,9 +857,8 @@ protected:
debugger.SetAsyncExecution(old_async);
- // Also make sure that the callback hasn't continued the target.
- // If it did, when we'll set m_should_stop to false and get out of
- // here.
+ // Also make sure that the callback hasn't continued the target. If
+ // it did, when we'll set m_should_stop to false and get out of here.
if (HasTargetRunSinceMe())
m_should_stop = false;
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index fdc10cf48275..3f70741713fb 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -87,13 +87,14 @@ Target::Target(Debugger &debugger, const ArchSpec &target_arch,
Broadcaster(debugger.GetBroadcasterManager(),
Target::GetStaticBroadcasterClass().AsCString()),
ExecutionContextScope(), m_debugger(debugger), m_platform_sp(platform_sp),
- m_mutex(), m_arch(target_arch),
- m_images(this), m_section_load_history(), m_breakpoint_list(false),
- m_internal_breakpoint_list(true), m_watchpoint_list(), m_process_sp(),
- m_search_filter_sp(), m_image_search_paths(ImageSearchPathsChanged, this),
- m_ast_importer_sp(), m_source_manager_ap(), m_stop_hooks(),
- m_stop_hook_next_id(0), m_valid(true), m_suppress_stop_hooks(false),
- m_is_dummy_target(is_dummy_target)
+ m_mutex(), m_arch(target_arch), m_images(this), m_section_load_history(),
+ m_breakpoint_list(false), m_internal_breakpoint_list(true),
+ m_watchpoint_list(), m_process_sp(), m_search_filter_sp(),
+ m_image_search_paths(ImageSearchPathsChanged, this), m_ast_importer_sp(),
+ m_source_manager_ap(), m_stop_hooks(), m_stop_hook_next_id(0),
+ m_valid(true), m_suppress_stop_hooks(false),
+ m_is_dummy_target(is_dummy_target),
+ m_stats_storage(static_cast<int>(StatisticKind::StatisticMax))
{
SetEventName(eBroadcastBitBreakpointChanged, "breakpoint-changed");
@@ -327,11 +328,7 @@ BreakpointSP Target::CreateBreakpoint(const FileSpecList *containingModules,
bool hardware,
LazyBool move_to_nearest_code) {
FileSpec remapped_file;
- ConstString remapped_path;
- if (GetSourcePathMap().ReverseRemapPath(ConstString(file.GetPath().c_str()),
- remapped_path))
- remapped_file.SetFile(remapped_path.AsCString(), true);
- else
+ if (!GetSourcePathMap().ReverseRemapPath(file, remapped_file))
remapped_file = file;
if (check_inlines == eLazyBoolCalculate) {
@@ -381,8 +378,8 @@ BreakpointSP Target::CreateBreakpoint(lldb::addr_t addr, bool internal,
// Check for any reason we want to move this breakpoint to other address.
addr = GetBreakableLoadAddress(addr);
- // Attempt to resolve our load address if possible, though it is ok if
- // it doesn't resolve to section/offset.
+ // Attempt to resolve our load address if possible, though it is ok if it
+ // doesn't resolve to section/offset.
// Try and resolve as a load address if possible
GetSectionLoadList().ResolveLoadAddress(addr, so_addr);
@@ -536,8 +533,7 @@ SearchFilterSP Target::GetSearchFilterForModuleAndCUList(
SearchFilterSP filter_sp;
if (containingModules == nullptr) {
// We could make a special "CU List only SearchFilter". Better yet was if
- // these could be composable,
- // but that will take a little reworking.
+ // these could be composable, but that will take a little reworking.
filter_sp.reset(new SearchFilterByModuleListAndCU(
shared_from_this(), FileSpecList(), *containingSourceFiles));
@@ -743,8 +739,8 @@ static bool CheckIfWatchpointsExhausted(Target *target, Status &error) {
return true;
}
-// See also Watchpoint::SetWatchpointType(uint32_t type) and
-// the OptionGroupWatchpoint::WatchType enum type.
+// See also Watchpoint::SetWatchpointType(uint32_t type) and the
+// OptionGroupWatchpoint::WatchType enum type.
WatchpointSP Target::CreateWatchpoint(lldb::addr_t addr, size_t size,
const CompilerType *type, uint32_t kind,
Status &error) {
@@ -775,8 +771,8 @@ WatchpointSP Target::CreateWatchpoint(lldb::addr_t addr, size_t size,
if (!CheckIfWatchpointsExhausted(this, error))
return wp_sp;
- // Currently we only support one watchpoint per address, with total number
- // of watchpoints limited by the hardware which the inferior is running on.
+ // Currently we only support one watchpoint per address, with total number of
+ // watchpoints limited by the hardware which the inferior is running on.
// Grab the list mutex while doing operations.
const bool notify = false; // Don't notify about all the state changes we do
@@ -813,9 +809,8 @@ WatchpointSP Target::CreateWatchpoint(lldb::addr_t addr, size_t size,
wp_sp->GetID());
if (error.Fail()) {
- // Enabling the watchpoint on the device side failed.
- // Remove the said watchpoint from the list maintained by the target
- // instance.
+ // Enabling the watchpoint on the device side failed. Remove the said
+ // watchpoint from the list maintained by the target instance.
m_watchpoint_list.Remove(wp_sp->GetID(), true);
// See if we could provide more helpful error message.
if (!OptionGroupWatchpoint::IsWatchSizeSupported(size))
@@ -1027,8 +1022,7 @@ Status Target::SerializeBreakpointsToFile(const FileSpec &file,
Breakpoint *bp = GetBreakpointByID(bp_id).get();
StructuredData::ObjectSP bkpt_save_sp = bp->SerializeToStructuredData();
// If the user explicitly asked to serialize a breakpoint, and we
- // can't, then
- // raise an error:
+ // can't, then raise an error:
if (!bkpt_save_sp) {
error.SetErrorStringWithFormat("Unable to serialize breakpoint %d",
bp_id);
@@ -1141,8 +1135,8 @@ bool Target::RemoveAllWatchpoints(bool end_to_end) {
return true; // Success!
}
-// Assumption: Caller holds the list mutex lock for m_watchpoint_list for end to
-// end operations.
+// Assumption: Caller holds the list mutex lock for m_watchpoint_list for end
+// to end operations.
bool Target::DisableAllWatchpoints(bool end_to_end) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_WATCHPOINTS));
if (log)
@@ -1171,8 +1165,8 @@ bool Target::DisableAllWatchpoints(bool end_to_end) {
return true; // Success!
}
-// Assumption: Caller holds the list mutex lock for m_watchpoint_list for end to
-// end operations.
+// Assumption: Caller holds the list mutex lock for m_watchpoint_list for end
+// to end operations.
bool Target::EnableAllWatchpoints(bool end_to_end) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_WATCHPOINTS));
if (log)
@@ -1235,8 +1229,8 @@ bool Target::ClearAllWatchpointHistoricValues() {
return true; // Success!
}
-// Assumption: Caller holds the list mutex lock for m_watchpoint_list
-// during these operations.
+// Assumption: Caller holds the list mutex lock for m_watchpoint_list during
+// these operations.
bool Target::IgnoreAllWatchpoints(uint32_t ignore_count) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_WATCHPOINTS));
if (log)
@@ -1459,7 +1453,8 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec) {
if (compatible_local_arch || missing_local_arch) {
// If we haven't got a valid arch spec, or the architectures are compatible
- // update the architecture, unless the one we already have is more specified
+ // update the architecture, unless the one we already have is more
+ // specified
if (replace_local_arch)
m_arch = other;
LLDB_LOG(log, "set architecture to {0} ({1})",
@@ -1502,8 +1497,8 @@ bool Target::SetArchitecture(const ArchSpec &arch_spec) {
bool Target::MergeArchitecture(const ArchSpec &arch_spec) {
if (arch_spec.IsValid()) {
if (m_arch.GetSpec().IsCompatibleMatch(arch_spec)) {
- // The current target arch is compatible with "arch_spec", see if we
- // can improve our current architecture using bits from "arch_spec"
+ // The current target arch is compatible with "arch_spec", see if we can
+ // improve our current architecture using bits from "arch_spec"
// Merge bits from arch_spec into "merged_arch" and set our architecture
ArchSpec merged_arch(m_arch.GetSpec());
@@ -1662,8 +1657,8 @@ size_t Target::ReadMemory(const Address &addr, bool prefer_file_cache,
lldb::addr_t *load_addr_ptr) {
error.Clear();
- // if we end up reading this from process memory, we will fill this
- // with the actual load address
+ // if we end up reading this from process memory, we will fill this with the
+ // actual load address
if (load_addr_ptr)
*load_addr_ptr = LLDB_INVALID_ADDRESS;
@@ -1675,16 +1670,16 @@ size_t Target::ReadMemory(const Address &addr, bool prefer_file_cache,
if (!addr.IsSectionOffset()) {
SectionLoadList &section_load_list = GetSectionLoadList();
if (section_load_list.IsEmpty()) {
- // No sections are loaded, so we must assume we are not running
- // yet and anything we are given is a file address.
+ // No sections are loaded, so we must assume we are not running yet and
+ // anything we are given is a file address.
file_addr = addr.GetOffset(); // "addr" doesn't have a section, so its
// offset is the file address
m_images.ResolveFileAddress(file_addr, resolved_addr);
} else {
- // We have at least one section loaded. This can be because
- // we have manually loaded some sections with "target modules load ..."
- // or because we have have a live process that has sections loaded
- // through the dynamic loader
+ // We have at least one section loaded. This can be because we have
+ // manually loaded some sections with "target modules load ..." or
+ // because we have have a live process that has sections loaded through
+ // the dynamic loader
load_addr = addr.GetOffset(); // "addr" doesn't have a section, so its
// offset is the load address
section_load_list.ResolveLoadAddress(load_addr, resolved_addr);
@@ -1731,19 +1726,19 @@ size_t Target::ReadMemory(const Address &addr, bool prefer_file_cache,
*load_addr_ptr = load_addr;
return bytes_read;
}
- // If the address is not section offset we have an address that
- // doesn't resolve to any address in any currently loaded shared
- // libraries and we failed to read memory so there isn't anything
- // more we can do. If it is section offset, we might be able to
- // read cached memory from the object file.
+ // If the address is not section offset we have an address that doesn't
+ // resolve to any address in any currently loaded shared libraries and we
+ // failed to read memory so there isn't anything more we can do. If it is
+ // section offset, we might be able to read cached memory from the object
+ // file.
if (!resolved_addr.IsSectionOffset())
return 0;
}
}
if (!prefer_file_cache && resolved_addr.IsSectionOffset()) {
- // If we didn't already try and read from the object file cache, then
- // try it after failing to read from the process.
+ // If we didn't already try and read from the object file cache, then try
+ // it after failing to read from the process.
return ReadMemoryFromFileCache(resolved_addr, dst, dst_len, error);
}
return 0;
@@ -1760,8 +1755,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
if (length == 0)
break;
out_str.append(buf, length);
- // If we got "length - 1" bytes, we didn't get the whole C string, we
- // need to read some more characters
+ // If we got "length - 1" bytes, we didn't get the whole C string, we need
+ // to read some more characters
if (length == sizeof(buf) - 1)
curr_addr += length;
else
@@ -1782,9 +1777,9 @@ size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
addr_t curr_addr = addr.GetLoadAddress(this);
Address address(addr);
- // We could call m_process_sp->GetMemoryCacheLineSize() but I don't
- // think this really needs to be tied to the memory cache subsystem's
- // cache line size, so leave this as a fixed constant.
+ // We could call m_process_sp->GetMemoryCacheLineSize() but I don't think
+ // this really needs to be tied to the memory cache subsystem's cache line
+ // size, so leave this as a fixed constant.
const size_t cache_line_size = 512;
size_t bytes_left = dst_max_len - 1;
@@ -1875,18 +1870,18 @@ bool Target::ReadPointerFromMemory(const Address &addr, bool prefer_file_cache,
if (pointer_vm_addr != LLDB_INVALID_ADDRESS) {
SectionLoadList &section_load_list = GetSectionLoadList();
if (section_load_list.IsEmpty()) {
- // No sections are loaded, so we must assume we are not running
- // yet and anything we are given is a file address.
+ // No sections are loaded, so we must assume we are not running yet and
+ // anything we are given is a file address.
m_images.ResolveFileAddress(pointer_vm_addr, pointer_addr);
} else {
- // We have at least one section loaded. This can be because
- // we have manually loaded some sections with "target modules load ..."
- // or because we have have a live process that has sections loaded
- // through the dynamic loader
+ // We have at least one section loaded. This can be because we have
+ // manually loaded some sections with "target modules load ..." or
+ // because we have have a live process that has sections loaded through
+ // the dynamic loader
section_load_list.ResolveLoadAddress(pointer_vm_addr, pointer_addr);
}
- // We weren't able to resolve the pointer value, so just return
- // an address with no section
+ // We weren't able to resolve the pointer value, so just return an
+ // address with no section
if (!pointer_addr.IsValid())
pointer_addr.SetOffset(pointer_vm_addr);
return true;
@@ -1902,9 +1897,8 @@ ModuleSP Target::GetSharedModule(const ModuleSpec &module_spec,
Status error;
// First see if we already have this module in our module list. If we do,
- // then we're done, we don't need
- // to consult the shared modules list. But only do this if we are passed a
- // UUID.
+ // then we're done, we don't need to consult the shared modules list. But
+ // only do this if we are passed a UUID.
if (module_spec.GetUUID().IsValid())
module_sp = m_images.FindFirstModule(module_spec);
@@ -1959,8 +1953,8 @@ ModuleSP Target::GetSharedModule(const ModuleSpec &module_spec,
}
// We found a module that wasn't in our target list. Let's make sure that
- // there wasn't an equivalent
- // module in the list already, and if there was, let's remove it.
+ // there wasn't an equivalent module in the list already, and if there was,
+ // let's remove it.
if (module_sp) {
ObjectFile *objfile = module_sp->GetObjectFile();
if (objfile) {
@@ -1994,18 +1988,14 @@ ModuleSP Target::GetSharedModule(const ModuleSpec &module_spec,
return ModuleSP();
}
// GetSharedModule is not guaranteed to find the old shared module, for
- // instance
- // in the common case where you pass in the UUID, it is only going to
- // find the one
- // module matching the UUID. In fact, it has no good way to know what
- // the "old module"
- // relevant to this target is, since there might be many copies of a
- // module with this file spec
- // in various running debug sessions, but only one of them will belong
- // to this target.
- // So let's remove the UUID from the module list, and look in the
- // target's module list.
- // Only do this if there is SOMETHING else in the module spec...
+ // instance in the common case where you pass in the UUID, it is only
+ // going to find the one module matching the UUID. In fact, it has no
+ // good way to know what the "old module" relevant to this target is,
+ // since there might be many copies of a module with this file spec in
+ // various running debug sessions, but only one of them will belong to
+ // this target. So let's remove the UUID from the module list, and look
+ // in the target's module list. Only do this if there is SOMETHING else
+ // in the module spec...
if (!old_module_sp) {
if (module_spec.GetUUID().IsValid() &&
!module_spec.GetFileSpec().GetFilename().IsEmpty() &&
@@ -2285,8 +2275,8 @@ ExpressionResults Target::EvaluateExpression(
if (expr.empty())
return execution_results;
- // We shouldn't run stop hooks in expressions.
- // Be sure to reset this if you return anywhere within this function.
+ // We shouldn't run stop hooks in expressions. Be sure to reset this if you
+ // return anywhere within this function.
bool old_suppress_value = m_suppress_stop_hooks;
m_suppress_stop_hooks = true;
@@ -2300,8 +2290,8 @@ ExpressionResults Target::EvaluateExpression(
CalculateExecutionContext(exe_ctx);
}
- // Make sure we aren't just trying to see the value of a persistent
- // variable (something like "$0")
+ // Make sure we aren't just trying to see the value of a persistent variable
+ // (something like "$0")
lldb::ExpressionVariableSP persistent_var_sp;
// Only check for persistent variables the expression starts with a '$'
if (expr[0] == '$')
@@ -2368,16 +2358,16 @@ lldb::addr_t Target::GetCallableLoadAddress(lldb::addr_t load_addr,
case llvm::Triple::mips64:
case llvm::Triple::mips64el:
switch (addr_class) {
- case eAddressClassData:
- case eAddressClassDebug:
+ case AddressClass::eData:
+ case AddressClass::eDebug:
return LLDB_INVALID_ADDRESS;
- case eAddressClassUnknown:
- case eAddressClassInvalid:
- case eAddressClassCode:
- case eAddressClassCodeAlternateISA:
- case eAddressClassRuntime:
- if ((code_addr & 2ull) || (addr_class == eAddressClassCodeAlternateISA))
+ case AddressClass::eUnknown:
+ case AddressClass::eInvalid:
+ case AddressClass::eCode:
+ case AddressClass::eCodeAlternateISA:
+ case AddressClass::eRuntime:
+ if ((code_addr & 2ull) || (addr_class == AddressClass::eCodeAlternateISA))
code_addr |= 1ull;
break;
}
@@ -2386,25 +2376,24 @@ lldb::addr_t Target::GetCallableLoadAddress(lldb::addr_t load_addr,
case llvm::Triple::arm:
case llvm::Triple::thumb:
switch (addr_class) {
- case eAddressClassData:
- case eAddressClassDebug:
+ case AddressClass::eData:
+ case AddressClass::eDebug:
return LLDB_INVALID_ADDRESS;
- case eAddressClassUnknown:
- case eAddressClassInvalid:
- case eAddressClassCode:
- case eAddressClassCodeAlternateISA:
- case eAddressClassRuntime:
+ case AddressClass::eUnknown:
+ case AddressClass::eInvalid:
+ case AddressClass::eCode:
+ case AddressClass::eCodeAlternateISA:
+ case AddressClass::eRuntime:
// Check if bit zero it no set?
if ((code_addr & 1ull) == 0) {
// Bit zero isn't set, check if the address is a multiple of 2?
if (code_addr & 2ull) {
// The address is a multiple of 2 so it must be thumb, set bit zero
code_addr |= 1ull;
- } else if (addr_class == eAddressClassCodeAlternateISA) {
+ } else if (addr_class == AddressClass::eCodeAlternateISA) {
// We checked the address and the address claims to be the alternate
- // ISA
- // which means thumb, so set bit zero.
+ // ISA which means thumb, so set bit zero.
code_addr |= 1ull;
}
}
@@ -2429,15 +2418,15 @@ lldb::addr_t Target::GetOpcodeLoadAddress(lldb::addr_t load_addr,
case llvm::Triple::arm:
case llvm::Triple::thumb:
switch (addr_class) {
- case eAddressClassData:
- case eAddressClassDebug:
+ case AddressClass::eData:
+ case AddressClass::eDebug:
return LLDB_INVALID_ADDRESS;
- case eAddressClassInvalid:
- case eAddressClassUnknown:
- case eAddressClassCode:
- case eAddressClassCodeAlternateISA:
- case eAddressClassRuntime:
+ case AddressClass::eInvalid:
+ case AddressClass::eUnknown:
+ case AddressClass::eCode:
+ case AddressClass::eCodeAlternateISA:
+ case AddressClass::eRuntime:
opcode_addr &= ~(1ull);
break;
}
@@ -2470,8 +2459,8 @@ lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
SectionLoadList &section_load_list = GetSectionLoadList();
if (section_load_list.IsEmpty())
- // No sections are loaded, so we must assume we are not running yet
- // and need to operate only on file address.
+ // No sections are loaded, so we must assume we are not running yet and
+ // need to operate only on file address.
m_images.ResolveFileAddress(addr, resolved_addr);
else
section_load_list.ResolveLoadAddress(addr, resolved_addr);
@@ -2546,30 +2535,29 @@ lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
} else if (i == 2) {
// Here we may get one 4-byte instruction or two 2-byte instructions.
if (num_insns == 2) {
- // Looks like there are two 2-byte instructions above our breakpoint
- // target address.
- // Now the upper 2-byte instruction is either a valid 2-byte
- // instruction or could be a part of it's upper 4-byte instruction.
- // In both cases we don't care because in this case lower 2-byte
- // instruction is definitely a valid instruction
- // and whatever i=1 iteration has found out is true.
+ // Looks like there are two 2-byte instructions above our
+ // breakpoint target address. Now the upper 2-byte instruction is
+ // either a valid 2-byte instruction or could be a part of it's
+ // upper 4-byte instruction. In both cases we don't care because in
+ // this case lower 2-byte instruction is definitely a valid
+ // instruction and whatever i=1 iteration has found out is true.
inst_to_choose = 1;
break;
} else if (insn_size == 4) {
// This instruction claims its a valid 4-byte instruction. But it
- // could be a part of it's upper 4-byte instruction.
- // Lets try scanning upper 2 bytes to verify this.
+ // could be a part of it's upper 4-byte instruction. Lets try
+ // scanning upper 2 bytes to verify this.
instruction_list.Append(prev_insn);
inst_to_choose = 2;
}
} else if (i == 3) {
if (insn_size == 4)
// FIXME: We reached here that means instruction at [target - 4] has
- // already claimed to be a 4-byte instruction,
- // and now instruction at [target - 6] is also claiming that it's a
- // 4-byte instruction. This can not be true.
- // In this case we can not decide the valid previous instruction so
- // we let lldb set the breakpoint at the address given by user.
+ // already claimed to be a 4-byte instruction, and now instruction
+ // at [target - 6] is also claiming that it's a 4-byte instruction.
+ // This can not be true. In this case we can not decide the valid
+ // previous instruction so we let lldb set the breakpoint at the
+ // address given by user.
inst_to_choose = 0;
else
// This is straight-forward
@@ -2685,8 +2673,8 @@ void Target::RunStopHooks() {
return;
// <rdar://problem/12027563> make sure we check that we are not stopped
- // because of us running a user expression
- // since in that case we do not want to run the stop-hooks
+ // because of us running a user expression since in that case we do not want
+ // to run the stop-hooks
if (m_process_sp->GetModIDRef().IsLastResumeForUserExpression())
return;
@@ -2975,18 +2963,16 @@ Status Target::Launch(ProcessLaunchInfo &launch_info, Stream *stream) {
launch_info.GetFlags().Set(eLaunchFlagDebug);
// Get the value of synchronous execution here. If you wait till after you
- // have started to
- // run, then you could have hit a breakpoint, whose command might switch the
- // value, and
- // then you'll pick up that incorrect value.
+ // have started to run, then you could have hit a breakpoint, whose command
+ // might switch the value, and then you'll pick up that incorrect value.
Debugger &debugger = GetDebugger();
const bool synchronous_execution =
debugger.GetCommandInterpreter().GetSynchronous();
PlatformSP platform_sp(GetPlatform());
- // Finalize the file actions, and if none were given, default to opening
- // up a pseudo terminal
+ // Finalize the file actions, and if none were given, default to opening up a
+ // pseudo terminal
const bool default_to_use_pty = platform_sp ? platform_sp->IsHost() : false;
if (log)
log->Printf("Target::%s have platform=%s, platform_sp->IsHost()=%s, "
@@ -3025,10 +3011,10 @@ Status Target::Launch(ProcessLaunchInfo &launch_info, Stream *stream) {
GetPlatform()->DebugProcess(launch_info, debugger, this, error);
// Cleanup the old process since someone might still have a strong
- // reference to this process and we would like to allow it to cleanup
- // as much as it can without the object being destroyed. We try to
- // lock the shared pointer and if that works, then someone else still
- // has a strong reference to the process.
+ // reference to this process and we would like to allow it to cleanup as
+ // much as it can without the object being destroyed. We try to lock the
+ // shared pointer and if that works, then someone else still has a strong
+ // reference to the process.
ProcessSP old_process_sp(process_wp.lock());
if (old_process_sp)
@@ -3152,8 +3138,8 @@ Status Target::Attach(ProcessAttachInfo &attach_info, Stream *stream) {
const ModuleSP old_exec_module_sp = GetExecutableModule();
- // If no process info was specified, then use the target executable
- // name as the process to attach to by default
+ // If no process info was specified, then use the target executable name as
+ // the process to attach to by default
if (!attach_info.ProcessInfoSpecified()) {
if (old_exec_module_sp)
attach_info.GetExecutableFile().GetFilename() =
@@ -3580,9 +3566,8 @@ public:
bool will_modify,
uint32_t idx) const override {
// When getting the value for a key from the target options, we will always
- // try and grab the setting from the current target if there is one. Else we
- // just
- // use the one from this instance.
+ // try and grab the setting from the current target if there is one. Else
+ // we just use the one from this instance.
if (idx == ePropertyEnvVars)
GetHostEnvironmentIfNeeded();
@@ -3611,36 +3596,19 @@ protected:
nullptr, idx, g_properties[idx].default_uint_value != 0)) {
PlatformSP platform_sp(m_target->GetPlatform());
if (platform_sp) {
- StringList env;
- if (platform_sp->GetEnvironment(env)) {
- OptionValueDictionary *env_dict =
- GetPropertyAtIndexAsOptionValueDictionary(nullptr,
- ePropertyEnvVars);
- if (env_dict) {
- const bool can_replace = false;
- const size_t envc = env.GetSize();
- for (size_t idx = 0; idx < envc; idx++) {
- const char *env_entry = env.GetStringAtIndex(idx);
- if (env_entry) {
- const char *equal_pos = ::strchr(env_entry, '=');
- ConstString key;
- // It is ok to have environment variables with no values
- const char *value = nullptr;
- if (equal_pos) {
- key.SetCStringWithLength(env_entry,
- equal_pos - env_entry);
- if (equal_pos[1])
- value = equal_pos + 1;
- } else {
- key.SetCString(env_entry);
- }
- // Don't allow existing keys to be replaced with ones we get
- // from the platform environment
- env_dict->SetValueForKey(
- key, OptionValueSP(new OptionValueString(value)),
- can_replace);
- }
- }
+ Environment env = platform_sp->GetEnvironment();
+ OptionValueDictionary *env_dict =
+ GetPropertyAtIndexAsOptionValueDictionary(nullptr,
+ ePropertyEnvVars);
+ if (env_dict) {
+ const bool can_replace = false;
+ for (const auto &KV : env) {
+ // Don't allow existing keys to be replaced with ones we get
+ // from the platform environment
+ env_dict->SetValueForKey(
+ ConstString(KV.first()),
+ OptionValueSP(new OptionValueString(KV.second.c_str())),
+ can_replace);
}
}
}
@@ -3690,8 +3658,8 @@ TargetProperties::TargetProperties(Target *target)
m_collection_sp.reset(
new TargetOptionValueProperties(target, Target::GetGlobalProperties()));
- // Set callbacks to update launch_info whenever "settins set" updated any of
- // these properties
+ // Set callbacks to update launch_info whenever "settins set" updated any
+ // of these properties
m_collection_sp->SetValueChangedCallback(
ePropertyArg0, TargetProperties::Arg0ValueChangedCallback, this);
m_collection_sp->SetValueChangedCallback(
@@ -3906,15 +3874,19 @@ void TargetProperties::SetRunArguments(const Args &args) {
m_launch_info.GetArguments() = args;
}
-size_t TargetProperties::GetEnvironmentAsArgs(Args &env) const {
+Environment TargetProperties::GetEnvironment() const {
+ // TODO: Get rid of the Args intermediate step
+ Args env;
const uint32_t idx = ePropertyEnvVars;
- return m_collection_sp->GetPropertyAtIndexAsArgs(nullptr, idx, env);
+ m_collection_sp->GetPropertyAtIndexAsArgs(nullptr, idx, env);
+ return Environment(env);
}
-void TargetProperties::SetEnvironmentFromArgs(const Args &env) {
+void TargetProperties::SetEnvironment(Environment env) {
+ // TODO: Get rid of the Args intermediate step
const uint32_t idx = ePropertyEnvVars;
- m_collection_sp->SetPropertyAtIndexFromArgs(nullptr, idx, env);
- m_launch_info.GetEnvironmentEntries() = env;
+ m_collection_sp->SetPropertyAtIndexFromArgs(nullptr, idx, Args(env));
+ m_launch_info.GetEnvironment() = std::move(env);
}
bool TargetProperties::GetSkipPrologue() const {
@@ -4152,7 +4124,7 @@ void TargetProperties::SetProcessLaunchInfo(
m_launch_info = launch_info;
SetArg0(launch_info.GetArg0());
SetRunArguments(launch_info.GetArguments());
- SetEnvironmentFromArgs(launch_info.GetEnvironmentEntries());
+ SetEnvironment(launch_info.GetEnvironment());
const FileAction *input_file_action =
launch_info.GetFileActionForFD(STDIN_FILENO);
if (input_file_action) {
@@ -4193,9 +4165,7 @@ void TargetProperties::EnvVarsValueChangedCallback(void *target_property_ptr,
OptionValue *) {
TargetProperties *this_ =
reinterpret_cast<TargetProperties *>(target_property_ptr);
- Args args;
- if (this_->GetEnvironmentAsArgs(args))
- this_->m_launch_info.GetEnvironmentEntries() = args;
+ this_->m_launch_info.GetEnvironment() = this_->GetEnvironment();
}
void TargetProperties::InputPathValueChangedCallback(void *target_property_ptr,
diff --git a/source/Target/TargetList.cpp b/source/Target/TargetList.cpp
index 5c652aced39f..b9c852b414e2 100644
--- a/source/Target/TargetList.cpp
+++ b/source/Target/TargetList.cpp
@@ -84,9 +84,9 @@ Status TargetList::CreateTargetInternal(
Status error;
PlatformSP platform_sp;
- // This is purposely left empty unless it is specified by triple_cstr.
- // If not initialized via triple_cstr, then the currently selected platform
- // will set the architecture correctly.
+ // This is purposely left empty unless it is specified by triple_cstr. If not
+ // initialized via triple_cstr, then the currently selected platform will set
+ // the architecture correctly.
const ArchSpec arch(triple_str);
if (!triple_str.empty()) {
if (!arch.IsValid()) {
@@ -102,7 +102,7 @@ Status TargetList::CreateTargetInternal(
CommandInterpreter &interpreter = debugger.GetCommandInterpreter();
- // let's see if there is already an existing plaform before we go creating
+ // let's see if there is already an existing platform before we go creating
// another...
platform_sp = debugger.GetPlatformList().GetSelectedPlatform();
@@ -120,11 +120,11 @@ Status TargetList::CreateTargetInternal(
if (!user_exe_path.empty()) {
ModuleSpecList module_specs;
ModuleSpec module_spec;
- module_spec.GetFileSpec().SetFile(user_exe_path, true);
+ module_spec.GetFileSpec().SetFile(user_exe_path, true,
+ FileSpec::Style::native);
// Resolve the executable in case we are given a path to a application
- // bundle
- // like a .app bundle on MacOSX
+ // bundle like a .app bundle on MacOSX
Host::ResolveExecutableInBundle(module_spec.GetFileSpec());
lldb::offset_t file_offset = 0;
@@ -140,7 +140,8 @@ Status TargetList::CreateTargetInternal(
if (platform_arch.IsCompatibleMatch(
matching_module_spec.GetArchitecture())) {
// If the OS or vendor weren't specified, then adopt the module's
- // architecture so that the platform matching can be more accurate
+ // architecture so that the platform matching can be more
+ // accurate
if (!platform_arch.TripleOSWasSpecified() ||
!platform_arch.TripleVendorWasSpecified()) {
prefer_platform_arch = true;
@@ -194,7 +195,8 @@ Status TargetList::CreateTargetInternal(
}
}
- // Next check the host platform it if wasn't already checked above
+ // Next check the host platform it if wasn't already checked
+ // above
if (host_platform_sp &&
(!platform_sp ||
host_platform_sp->GetName() != platform_sp->GetName())) {
@@ -231,7 +233,7 @@ Status TargetList::CreateTargetInternal(
}
if (platform_ptr) {
- // All platforms for all modules in the exectuable match, so we can
+ // All platforms for all modules in the executable match, so we can
// select this platform
platform_sp = platforms.front();
} else if (more_than_one_platforms == false) {
@@ -275,8 +277,7 @@ Status TargetList::CreateTargetInternal(
}
} else if (platform_arch.IsValid()) {
// if "arch" isn't valid, yet "platform_arch" is, it means we have an
- // executable file with
- // a single architecture which should be used
+ // executable file with a single architecture which should be used
ArchSpec fixed_platform_arch;
if (!platform_sp->IsCompatibleArchitecture(platform_arch, false,
&fixed_platform_arch)) {
@@ -367,16 +368,12 @@ Status TargetList::CreateTargetInternal(Debugger &debugger,
user_exe_path_is_bundle = true;
if (file.IsRelative() && !user_exe_path.empty()) {
- // Ignore paths that start with "./" and "../"
- if (!user_exe_path.startswith("./") && !user_exe_path.startswith("../")) {
- llvm::SmallString<64> cwd;
- if (! llvm::sys::fs::current_path(cwd)) {
- cwd += '/';
- cwd += user_exe_path;
- FileSpec cwd_file(cwd, false);
- if (cwd_file.Exists())
- file = cwd_file;
- }
+ llvm::SmallString<64> cwd;
+ if (! llvm::sys::fs::current_path(cwd)) {
+ FileSpec cwd_file(cwd.c_str(), false);
+ cwd_file.AppendPathComponent(file);
+ if (cwd_file.Exists())
+ file = cwd_file;
}
}
@@ -410,8 +407,8 @@ Status TargetList::CreateTargetInternal(Debugger &debugger,
sizeof(resolved_bundle_exe_path));
}
} else {
- // No file was specified, just create an empty target with any arch
- // if a valid arch was specified
+ // No file was specified, just create an empty target with any arch if a
+ // valid arch was specified
target_sp.reset(new Target(debugger, arch, platform_sp, is_dummy_target));
}
diff --git a/source/Target/Thread.cpp b/source/Target/Thread.cpp
index 217cbccedf6e..5ac1de7ae01b 100644
--- a/source/Target/Thread.cpp
+++ b/source/Target/Thread.cpp
@@ -105,9 +105,8 @@ public:
bool will_modify,
uint32_t idx) const override {
// When getting the value for a key from the thread options, we will always
- // try and grab the setting from the current thread if there is one. Else we
- // just
- // use the one from this instance.
+ // try and grab the setting from the current thread if there is one. Else
+ // we just use the one from this instance.
if (exe_ctx) {
Thread *thread = exe_ctx->GetThreadPtr();
if (thread) {
@@ -275,8 +274,8 @@ Thread::~Thread() {
void Thread::DestroyThread() {
// Tell any plans on the plan stacks that the thread is being destroyed since
- // any plans that have a thread go away in the middle of might need
- // to do cleanup, or in some cases NOT do cleanup...
+ // any plans that have a thread go away in the middle of might need to do
+ // cleanup, or in some cases NOT do cleanup...
for (auto plan : m_plan_stack)
plan->ThreadDestroyed();
@@ -291,11 +290,10 @@ void Thread::DestroyThread() {
m_discarded_plan_stack.clear();
m_completed_plan_stack.clear();
- // Push a ThreadPlanNull on the plan stack. That way we can continue assuming
- // that the
- // plan stack is never empty, but if somebody errantly asks questions of a
- // destroyed thread
- // without checking first whether it is destroyed, they won't crash.
+ // Push a ThreadPlanNull on the plan stack. That way we can continue
+ // assuming that the plan stack is never empty, but if somebody errantly asks
+ // questions of a destroyed thread without checking first whether it is
+ // destroyed, they won't crash.
ThreadPlanSP null_plan_sp(new ThreadPlanNull(*this));
m_plan_stack.push_back(null_plan_sp);
@@ -385,11 +383,10 @@ lldb::StopInfoSP Thread::GetStopInfo() {
ProcessSP process_sp(GetProcess());
const uint32_t stop_id = process_sp ? process_sp->GetStopID() : UINT32_MAX;
- // Here we select the stop info according to priorirty:
- // - m_stop_info_sp (if not trace) - preset value
- // - completed plan stop info - new value with plan from completed plan stack
- // - m_stop_info_sp (trace stop reason is OK now)
- // - ask GetPrivateStopInfo to set stop info
+ // Here we select the stop info according to priorirty: - m_stop_info_sp (if
+ // not trace) - preset value - completed plan stop info - new value with plan
+ // from completed plan stack - m_stop_info_sp (trace stop reason is OK now) -
+ // ask GetPrivateStopInfo to set stop info
bool have_valid_stop_info = m_stop_info_sp &&
m_stop_info_sp ->IsValid() &&
@@ -432,17 +429,17 @@ lldb::StopInfoSP Thread::GetPrivateStopInfo() {
}
}
- // The stop info can be manually set by calling Thread::SetStopInfo()
- // prior to this function ever getting called, so we can't rely on
- // "m_stop_info_stop_id != process_stop_id" as the condition for
- // the if statement below, we must also check the stop info to see
- // if we need to override it. See the header documentation in
- // Process::GetStopInfoOverrideCallback() for more information on
- // the stop info override callback.
+ // The stop info can be manually set by calling Thread::SetStopInfo() prior
+ // to this function ever getting called, so we can't rely on
+ // "m_stop_info_stop_id != process_stop_id" as the condition for the if
+ // statement below, we must also check the stop info to see if we need to
+ // override it. See the header documentation in
+ // Process::GetStopInfoOverrideCallback() for more information on the stop
+ // info override callback.
if (m_stop_info_override_stop_id != process_stop_id) {
m_stop_info_override_stop_id = process_stop_id;
if (m_stop_info_sp) {
- if (Architecture *arch =
+ if (const Architecture *arch =
process_sp->GetTarget().GetArchitecturePlugin())
arch->OverrideStopInfo(*this);
}
@@ -509,9 +506,8 @@ void Thread::SetShouldReportStop(Vote vote) {
void Thread::SetStopInfoToNothing() {
// Note, we can't just NULL out the private reason, or the native thread
- // implementation will try to
- // go calculate it again. For now, just set it to a Unix Signal with an
- // invalid signal number.
+ // implementation will try to go calculate it again. For now, just set it to
+ // a Unix Signal with an invalid signal number.
SetStopInfo(
StopInfo::CreateStopReasonWithSignal(*this, LLDB_INVALID_SIGNAL_NUMBER));
}
@@ -604,10 +600,8 @@ void Thread::WillStop() {
void Thread::SetupForResume() {
if (GetResumeState() != eStateSuspended) {
// If we're at a breakpoint push the step-over breakpoint plan. Do this
- // before
- // telling the current plan it will resume, since we might change what the
- // current
- // plan is.
+ // before telling the current plan it will resume, since we might change
+ // what the current plan is.
lldb::RegisterContextSP reg_ctx_sp(GetRegisterContext());
if (reg_ctx_sp) {
@@ -615,9 +609,8 @@ void Thread::SetupForResume() {
BreakpointSiteSP bp_site_sp =
GetProcess()->GetBreakpointSiteList().FindByAddress(thread_pc);
if (bp_site_sp) {
- // Note, don't assume there's a ThreadPlanStepOverBreakpoint, the target
- // may not require anything
- // special to step over a breakpoint.
+ // Note, don't assume there's a ThreadPlanStepOverBreakpoint, the
+ // target may not require anything special to step over a breakpoint.
ThreadPlan *cur_plan = GetCurrentPlan();
@@ -669,11 +662,9 @@ bool Thread::ShouldResume(StateType resume_state) {
GetPrivateStopInfo();
// This is a little dubious, but we are trying to limit how often we actually
- // fetch stop info from
- // the target, 'cause that slows down single stepping. So assume that if we
- // got to the point where
- // we're about to resume, and we haven't yet had to fetch the stop reason,
- // then it doesn't need to know
+ // fetch stop info from the target, 'cause that slows down single stepping.
+ // So assume that if we got to the point where we're about to resume, and we
+ // haven't yet had to fetch the stop reason, then it doesn't need to know
// about the fact that we are resuming...
const uint32_t process_stop_id = GetProcess()->GetStopID();
if (m_stop_info_stop_id == process_stop_id &&
@@ -684,9 +675,9 @@ bool Thread::ShouldResume(StateType resume_state) {
}
// Tell all the plans that we are about to resume in case they need to clear
- // any state.
- // We distinguish between the plan on the top of the stack and the lower
- // plans in case a plan needs to do any special business before it runs.
+ // any state. We distinguish between the plan on the top of the stack and the
+ // lower plans in case a plan needs to do any special business before it
+ // runs.
bool need_to_resume = false;
ThreadPlan *plan_ptr = GetCurrentPlan();
@@ -698,8 +689,7 @@ bool Thread::ShouldResume(StateType resume_state) {
}
// If the WillResume for the plan says we are faking a resume, then it will
- // have set an appropriate stop info.
- // In that case, don't reset it here.
+ // have set an appropriate stop info. In that case, don't reset it here.
if (need_to_resume && resume_state != eStateSuspended) {
m_stop_info_sp.reset();
@@ -743,9 +733,8 @@ bool Thread::ShouldStop(Event *event_ptr) {
}
// Based on the current thread plan and process stop info, check if this
- // thread caused the process to stop. NOTE: this must take place before
- // the plan is moved from the current plan stack to the completed plan
- // stack.
+ // thread caused the process to stop. NOTE: this must take place before the
+ // plan is moved from the current plan stack to the completed plan stack.
if (!ThreadStoppedForAReason()) {
if (log)
log->Printf("Thread::%s for tid = 0x%4.4" PRIx64 " 0x%4.4" PRIx64
@@ -775,10 +764,9 @@ bool Thread::ShouldStop(Event *event_ptr) {
current_plan->DoTraceLog();
// First query the stop info's ShouldStopSynchronous. This handles
- // "synchronous" stop reasons, for example the breakpoint
- // command on internal breakpoints. If a synchronous stop reason says we
- // should not stop, then we don't have to
- // do any more work on this stop.
+ // "synchronous" stop reasons, for example the breakpoint command on internal
+ // breakpoints. If a synchronous stop reason says we should not stop, then
+ // we don't have to do any more work on this stop.
StopInfoSP private_stop_info(GetPrivateStopInfo());
if (private_stop_info &&
!private_stop_info->ShouldStopSynchronous(event_ptr)) {
@@ -788,8 +776,8 @@ bool Thread::ShouldStop(Event *event_ptr) {
return false;
}
- // If we've already been restarted, don't query the plans since the state they
- // would examine is not current.
+ // If we've already been restarted, don't query the plans since the state
+ // they would examine is not current.
if (Process::ProcessEventData::GetRestartedFromEvent(event_ptr))
return false;
@@ -798,12 +786,10 @@ bool Thread::ShouldStop(Event *event_ptr) {
GetStackFrameList()->CalculateCurrentInlinedDepth();
// If the base plan doesn't understand why we stopped, then we have to find a
- // plan that does.
- // If that plan is still working, then we don't need to do any more work. If
- // the plan that explains
- // the stop is done, then we should pop all the plans below it, and pop it,
- // and then let the plans above it decide
- // whether they still need to do more work.
+ // plan that does. If that plan is still working, then we don't need to do
+ // any more work. If the plan that explains the stop is done, then we should
+ // pop all the plans below it, and pop it, and then let the plans above it
+ // decide whether they still need to do more work.
bool done_processing_current_plan = false;
@@ -812,16 +798,16 @@ bool Thread::ShouldStop(Event *event_ptr) {
done_processing_current_plan = true;
should_stop = false;
} else {
- // If the current plan doesn't explain the stop, then find one that
- // does and let it handle the situation.
+ // If the current plan doesn't explain the stop, then find one that does
+ // and let it handle the situation.
ThreadPlan *plan_ptr = current_plan;
while ((plan_ptr = GetPreviousPlan(plan_ptr)) != nullptr) {
if (plan_ptr->PlanExplainsStop(event_ptr)) {
should_stop = plan_ptr->ShouldStop(event_ptr);
- // plan_ptr explains the stop, next check whether plan_ptr is done, if
- // so, then we should take it
- // and all the plans below it off the stack.
+ // plan_ptr explains the stop, next check whether plan_ptr is done,
+ // if so, then we should take it and all the plans below it off the
+ // stack.
if (plan_ptr->MischiefManaged()) {
// We're going to pop the plans up to and including the plan that
@@ -833,9 +819,9 @@ bool Thread::ShouldStop(Event *event_ptr) {
current_plan->WillStop();
PopPlan();
} while ((current_plan = GetCurrentPlan()) != prev_plan_ptr);
- // Now, if the responsible plan was not "Okay to discard" then we're
- // done,
- // otherwise we forward this to the next plan in the stack below.
+ // Now, if the responsible plan was not "Okay to discard" then
+ // we're done, otherwise we forward this to the next plan in the
+ // stack below.
done_processing_current_plan =
(plan_ptr->IsMasterPlan() && !plan_ptr->OkayToDiscard());
} else
@@ -860,9 +846,9 @@ bool Thread::ShouldStop(Event *event_ptr) {
if (log)
log->Printf("Base plan says should stop: %i.", should_stop);
} else {
- // Otherwise, don't let the base plan override what the other plans say to
- // do, since
- // presumably if there were other plans they would know what to do...
+ // Otherwise, don't let the base plan override what the other plans say
+ // to do, since presumably if there were other plans they would know what
+ // to do...
while (1) {
if (PlanIsBasePlan(current_plan))
break;
@@ -875,9 +861,8 @@ bool Thread::ShouldStop(Event *event_ptr) {
if (should_stop)
current_plan->WillStop();
- // If a Master Plan wants to stop, and wants to stick on the stack, we
- // let it.
- // Otherwise, see if the plan's parent wants to stop.
+ // If a Master Plan wants to stop, and wants to stick on the stack,
+ // we let it. Otherwise, see if the plan's parent wants to stop.
if (should_stop && current_plan->IsMasterPlan() &&
!current_plan->OkayToDiscard()) {
@@ -902,18 +887,16 @@ bool Thread::ShouldStop(Event *event_ptr) {
}
// One other potential problem is that we set up a master plan, then stop in
- // before it is complete - for instance
- // by hitting a breakpoint during a step-over - then do some step/finish/etc
- // operations that wind up
- // past the end point condition of the initial plan. We don't want to strand
- // the original plan on the stack,
- // This code clears stale plans off the stack.
+ // before it is complete - for instance by hitting a breakpoint during a
+ // step-over - then do some step/finish/etc operations that wind up past the
+ // end point condition of the initial plan. We don't want to strand the
+ // original plan on the stack, This code clears stale plans off the stack.
if (should_stop) {
ThreadPlan *plan_ptr = GetCurrentPlan();
- // Discard the stale plans and all plans below them in the stack,
- // plus move the completed plans to the completed plan stack
+ // Discard the stale plans and all plans below them in the stack, plus move
+ // the completed plans to the completed plan stack
while (!PlanIsBasePlan(plan_ptr)) {
bool stale = plan_ptr->IsPlanStale();
ThreadPlan *examined_plan = plan_ptr;
@@ -928,8 +911,9 @@ bool Thread::ShouldStop(Event *event_ptr) {
DiscardPlan();
}
if (examined_plan->IsPlanComplete()) {
- // plan is complete but does not explain the stop (example: step to a line
- // with breakpoint), let us move the plan to completed_plan_stack anyway
+ // plan is complete but does not explain the stop (example: step to a
+ // line with breakpoint), let us move the plan to
+ // completed_plan_stack anyway
PopPlan();
} else
DiscardPlan();
@@ -1097,8 +1081,8 @@ void Thread::DiscardPlan() {
}
ThreadPlan *Thread::GetCurrentPlan() {
- // There will always be at least the base plan. If somebody is mucking with a
- // thread with an empty plan stack, we should assert right away.
+ // There will always be at least the base plan. If somebody is mucking with
+ // a thread with an empty plan stack, we should assert right away.
return m_plan_stack.empty() ? nullptr : m_plan_stack.back().get();
}
@@ -1212,8 +1196,7 @@ void Thread::SetTracer(lldb::ThreadPlanTracerSP &tracer_sp) {
bool Thread::DiscardUserThreadPlansUpToIndex(uint32_t thread_index) {
// Count the user thread plans from the back end to get the number of the one
- // we want
- // to discard:
+ // we want to discard:
uint32_t idx = 0;
ThreadPlan *up_to_plan_ptr = nullptr;
@@ -1249,8 +1232,7 @@ void Thread::DiscardThreadPlansUpToPlan(ThreadPlan *up_to_plan_ptr) {
int stack_size = m_plan_stack.size();
// If the input plan is nullptr, discard all plans. Otherwise make sure this
- // plan is in the
- // stack, and if so discard up to and including it.
+ // plan is in the stack, and if so discard up to and including it.
if (up_to_plan_ptr == nullptr) {
for (int i = stack_size - 1; i > 0; i--)
@@ -1314,8 +1296,7 @@ void Thread::DiscardThreadPlans(bool force) {
// Now discard the master plan itself.
// The bottom-most plan never gets discarded. "OkayToDiscard" for it
- // means
- // discard it's dependent plans, but not it...
+ // means discard it's dependent plans, but not it...
if (master_plan_idx > 0) {
DiscardPlan();
}
@@ -1340,8 +1321,7 @@ Status Thread::UnwindInnermostExpression() {
int stack_size = m_plan_stack.size();
// If the input plan is nullptr, discard all plans. Otherwise make sure this
- // plan is in the
- // stack, and if so discard up to and including it.
+ // plan is in the stack, and if so discard up to and including it.
for (int i = stack_size - 1; i > 0; i--) {
if (m_plan_stack[i]->GetKind() == ThreadPlan::eKindCallFunction) {
@@ -1380,7 +1360,8 @@ ThreadPlanSP Thread::QueueThreadPlanForStepOverRange(
return thread_plan_sp;
}
-// Call the QueueThreadPlanForStepOverRange method which takes an address range.
+// Call the QueueThreadPlanForStepOverRange method which takes an address
+// range.
ThreadPlanSP Thread::QueueThreadPlanForStepOverRange(
bool abort_other_plans, const LineEntry &line_entry,
const SymbolContext &addr_context, lldb::RunMode stop_other_threads,
@@ -1500,11 +1481,9 @@ lldb::ThreadPlanSP Thread::QueueThreadPlanForStepScripted(
ThreadPlanSP thread_plan_sp(new ThreadPlanPython(*this, class_name));
QueueThreadPlan(thread_plan_sp, abort_other_plans);
// This seems a little funny, but I don't want to have to split up the
- // constructor and the
- // DidPush in the scripted plan, that seems annoying.
- // That means the constructor has to be in DidPush.
- // So I have to validate the plan AFTER pushing it, and then take it off
- // again...
+ // constructor and the DidPush in the scripted plan, that seems annoying.
+ // That means the constructor has to be in DidPush. So I have to validate the
+ // plan AFTER pushing it, and then take it off again...
if (!thread_plan_sp->ValidatePlan(nullptr)) {
DiscardThreadPlansUpToPlan(thread_plan_sp);
return ThreadPlanSP();
@@ -1701,10 +1680,9 @@ Status Thread::ReturnFromFrame(lldb::StackFrameSP frame_sp,
return return_error;
}
- // Now write the return registers for the chosen frame:
- // Note, we can't use ReadAllRegisterValues->WriteAllRegisterValues, since the
- // read & write
- // cook their data
+ // Now write the return registers for the chosen frame: Note, we can't use
+ // ReadAllRegisterValues->WriteAllRegisterValues, since the read & write cook
+ // their data
StackFrameSP youngest_frame_sp = thread->GetStackFrameAtIndex(0);
if (youngest_frame_sp) {
@@ -1754,13 +1732,11 @@ Status Thread::JumpToLine(const FileSpec &file, uint32_t line,
target->GetImages().FindAddressesForLine(target_sp, file, line, sc.function,
within_function, outside_function);
- // If possible, we try and stay within the current function.
- // Within a function, we accept multiple locations (optimized code may do
- // this,
- // there's no solution here so we do the best we can).
- // However if we're trying to leave the function, we don't know how to pick
- // the
- // right location, so if there's more than one then we bail.
+ // If possible, we try and stay within the current function. Within a
+ // function, we accept multiple locations (optimized code may do this,
+ // there's no solution here so we do the best we can). However if we're
+ // trying to leave the function, we don't know how to pick the right
+ // location, so if there's more than one then we bail.
if (!within_function.empty())
candidates = within_function;
else if (outside_function.size() == 1 && can_leave_function)
@@ -1836,8 +1812,8 @@ lldb::addr_t Thread::GetThreadPointer() { return LLDB_INVALID_ADDRESS; }
addr_t Thread::GetThreadLocalData(const ModuleSP module,
lldb::addr_t tls_file_addr) {
- // The default implementation is to ask the dynamic loader for it.
- // This can be overridden for specific platforms.
+ // The default implementation is to ask the dynamic loader for it. This can
+ // be overridden for specific platforms.
DynamicLoader *loader = GetProcess()->GetDynamicLoader();
if (loader)
return loader->GetThreadLocalData(module, shared_from_this(),
@@ -2096,10 +2072,8 @@ void Thread::Flush() {
bool Thread::IsStillAtLastBreakpointHit() {
// If we are currently stopped at a breakpoint, always return that stopinfo
- // and don't reset it.
- // This allows threads to maintain their breakpoint stopinfo, such as when
- // thread-stepping in
- // multithreaded programs.
+ // and don't reset it. This allows threads to maintain their breakpoint
+ // stopinfo, such as when thread-stepping in multithreaded programs.
if (m_stop_info_sp) {
StopReason stop_reason = m_stop_info_sp->GetStopReason();
if (stop_reason == lldb::eStopReasonBreakpoint) {
diff --git a/source/Target/ThreadList.cpp b/source/Target/ThreadList.cpp
index 4cf8f9061a89..ee57a401f742 100644
--- a/source/Target/ThreadList.cpp
+++ b/source/Target/ThreadList.cpp
@@ -40,8 +40,8 @@ ThreadList::ThreadList(const ThreadList &rhs)
const ThreadList &ThreadList::operator=(const ThreadList &rhs) {
if (this != &rhs) {
- // Lock both mutexes to make sure neither side changes anyone on us
- // while the assignment occurs
+ // Lock both mutexes to make sure neither side changes anyone on us while
+ // the assignment occurs
std::lock_guard<std::recursive_mutex> guard(GetMutex());
std::lock_guard<std::recursive_mutex> rhs_guard(rhs.GetMutex());
@@ -54,9 +54,8 @@ const ThreadList &ThreadList::operator=(const ThreadList &rhs) {
}
ThreadList::~ThreadList() {
- // Clear the thread list. Clear will take the mutex lock
- // which will ensure that if anyone is using the list
- // they won't get it removed while using it.
+ // Clear the thread list. Clear will take the mutex lock which will ensure
+ // that if anyone is using the list they won't get it removed while using it.
Clear();
}
@@ -195,6 +194,20 @@ ThreadSP ThreadList::GetThreadSPForThreadPtr(Thread *thread_ptr) {
return thread_sp;
}
+ThreadSP ThreadList::GetBackingThread(const ThreadSP &real_thread) {
+ std::lock_guard<std::recursive_mutex> guard(GetMutex());
+
+ ThreadSP thread_sp;
+ const uint32_t num_threads = m_threads.size();
+ for (uint32_t idx = 0; idx < num_threads; ++idx) {
+ if (m_threads[idx]->GetBackingThread() == real_thread) {
+ thread_sp = m_threads[idx];
+ break;
+ }
+ }
+ return thread_sp;
+}
+
ThreadSP ThreadList::FindThreadByIndexID(uint32_t index_id, bool can_update) {
std::lock_guard<std::recursive_mutex> guard(GetMutex());
@@ -217,13 +230,13 @@ bool ThreadList::ShouldStop(Event *event_ptr) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
- // The ShouldStop method of the threads can do a whole lot of work,
- // figuring out whether the thread plan conditions are met. So we don't want
- // to keep the ThreadList locked the whole time we are doing this.
+ // The ShouldStop method of the threads can do a whole lot of work, figuring
+ // out whether the thread plan conditions are met. So we don't want to keep
+ // the ThreadList locked the whole time we are doing this.
// FIXME: It is possible that running code could cause new threads
- // to be created. If that happens, we will miss asking them whether
- // they should stop. This is not a big deal since we haven't had
- // a chance to hang any interesting operations on those threads yet.
+ // to be created. If that happens, we will miss asking them whether they
+ // should stop. This is not a big deal since we haven't had a chance to hang
+ // any interesting operations on those threads yet.
collection threads_copy;
{
@@ -233,25 +246,21 @@ bool ThreadList::ShouldStop(Event *event_ptr) {
m_process->UpdateThreadListIfNeeded();
for (lldb::ThreadSP thread_sp : m_threads) {
// This is an optimization... If we didn't let a thread run in between
- // the previous stop and this
- // one, we shouldn't have to consult it for ShouldStop. So just leave it
- // off the list we are going to
- // inspect.
- // On Linux, if a thread-specific conditional breakpoint was hit, it won't
- // necessarily be the thread
- // that hit the breakpoint itself that evaluates the conditional
- // expression, so the thread that hit
- // the breakpoint could still be asked to stop, even though it hasn't been
- // allowed to run since the
- // previous stop.
+ // the previous stop and this one, we shouldn't have to consult it for
+ // ShouldStop. So just leave it off the list we are going to inspect. On
+ // Linux, if a thread-specific conditional breakpoint was hit, it won't
+ // necessarily be the thread that hit the breakpoint itself that
+ // evaluates the conditional expression, so the thread that hit the
+ // breakpoint could still be asked to stop, even though it hasn't been
+ // allowed to run since the previous stop.
if (thread_sp->GetTemporaryResumeState() != eStateSuspended ||
thread_sp->IsStillAtLastBreakpointHit())
threads_copy.push_back(thread_sp);
}
// It is possible the threads we were allowing to run all exited and then
- // maybe the user interrupted
- // or something, then fall back on looking at all threads:
+ // maybe the user interrupted or something, then fall back on looking at
+ // all threads:
if (threads_copy.size() == 0)
threads_copy = m_threads;
@@ -282,12 +291,11 @@ bool ThreadList::ShouldStop(Event *event_ptr) {
}
// Now we run through all the threads and get their stop info's. We want to
- // make sure to do this first before
- // we start running the ShouldStop, because one thread's ShouldStop could
- // destroy information (like deleting a
- // thread specific breakpoint another thread had stopped at) which could lead
- // us to compute the StopInfo incorrectly.
- // We don't need to use it here, we just want to make sure it gets computed.
+ // make sure to do this first before we start running the ShouldStop, because
+ // one thread's ShouldStop could destroy information (like deleting a thread
+ // specific breakpoint another thread had stopped at) which could lead us to
+ // compute the StopInfo incorrectly. We don't need to use it here, we just
+ // want to make sure it gets computed.
for (pos = threads_copy.begin(); pos != end; ++pos) {
ThreadSP thread_sp(*pos);
@@ -298,27 +306,24 @@ bool ThreadList::ShouldStop(Event *event_ptr) {
ThreadSP thread_sp(*pos);
// We should never get a stop for which no thread had a stop reason, but
- // sometimes we do see this -
- // for instance when we first connect to a remote stub. In that case we
- // should stop, since we can't figure out
- // the right thing to do and stopping gives the user control over what to do
- // in this instance.
+ // sometimes we do see this - for instance when we first connect to a
+ // remote stub. In that case we should stop, since we can't figure out the
+ // right thing to do and stopping gives the user control over what to do in
+ // this instance.
//
// Note, this causes a problem when you have a thread specific breakpoint,
- // and a bunch of threads hit the breakpoint,
- // but not the thread which we are waiting for. All the threads that are
- // not "supposed" to hit the breakpoint
- // are marked as having no stop reason, which is right, they should not show
- // a stop reason. But that triggers this
- // code and causes us to stop seemingly for no reason.
+ // and a bunch of threads hit the breakpoint, but not the thread which we
+ // are waiting for. All the threads that are not "supposed" to hit the
+ // breakpoint are marked as having no stop reason, which is right, they
+ // should not show a stop reason. But that triggers this code and causes
+ // us to stop seemingly for no reason.
//
// Since the only way we ever saw this error was on first attach, I'm only
- // going to trigger set did_anybody_stop_for_a_reason
- // to true unless this is the first stop.
+ // going to trigger set did_anybody_stop_for_a_reason to true unless this
+ // is the first stop.
//
// If this becomes a problem, we'll have to have another StopReason like
- // "StopInfoHidden" which will look invalid
- // everywhere but at this check.
+ // "StopInfoHidden" which will look invalid everywhere but at this check.
if (thread_sp->GetProcess()->GetStopID() > 1)
did_anybody_stop_for_a_reason = true;
@@ -365,8 +370,8 @@ Vote ThreadList::ShouldReportStop(Event *event_ptr) {
log->Printf("ThreadList::%s %" PRIu64 " threads", __FUNCTION__,
(uint64_t)m_threads.size());
- // Run through the threads and ask whether we should report this event.
- // For stopping, a YES vote wins over everything. A NO vote wins over NO
+ // Run through the threads and ask whether we should report this event. For
+ // stopping, a YES vote wins over everything. A NO vote wins over NO
// opinion.
for (pos = m_threads.begin(); pos != end; ++pos) {
ThreadSP thread_sp(*pos);
@@ -413,8 +418,8 @@ Vote ThreadList::ShouldReportRun(Event *event_ptr) {
m_process->UpdateThreadListIfNeeded();
collection::iterator pos, end = m_threads.end();
- // Run through the threads and ask whether we should report this event.
- // The rule is NO vote wins over everything, a YES vote wins over no opinion.
+ // Run through the threads and ask whether we should report this event. The
+ // rule is NO vote wins over everything, a YES vote wins over no opinion.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
@@ -471,8 +476,8 @@ void ThreadList::RefreshStateAfterStop() {
}
void ThreadList::DiscardThreadPlans() {
- // You don't need to update the thread list here, because only threads
- // that you currently know about have any thread plans.
+ // You don't need to update the thread list here, because only threads that
+ // you currently know about have any thread plans.
std::lock_guard<std::recursive_mutex> guard(GetMutex());
collection::iterator pos, end = m_threads.end();
@@ -481,9 +486,9 @@ void ThreadList::DiscardThreadPlans() {
}
bool ThreadList::WillResume() {
- // Run through the threads and perform their momentary actions.
- // But we only do this for threads that are running, user suspended
- // threads stay where they are.
+ // Run through the threads and perform their momentary actions. But we only
+ // do this for threads that are running, user suspended threads stay where
+ // they are.
std::lock_guard<std::recursive_mutex> guard(GetMutex());
m_process->UpdateThreadListIfNeeded();
@@ -491,14 +496,11 @@ bool ThreadList::WillResume() {
collection::iterator pos, end = m_threads.end();
// See if any thread wants to run stopping others. If it does, then we won't
- // setup the other threads for resume, since they aren't going to get a chance
- // to run. This is necessary because the SetupForResume might add
- // "StopOthers"
- // plans which would then get to be part of the who-gets-to-run negotiation,
- // but
- // they're coming in after the fact, and the threads that are already set up
- // should
- // take priority.
+ // setup the other threads for resume, since they aren't going to get a
+ // chance to run. This is necessary because the SetupForResume might add
+ // "StopOthers" plans which would then get to be part of the who-gets-to-run
+ // negotiation, but they're coming in after the fact, and the threads that
+ // are already set up should take priority.
bool wants_solo_run = false;
@@ -530,11 +532,9 @@ bool ThreadList::WillResume() {
}
// Give all the threads that are likely to run a last chance to set up their
- // state before we
- // negotiate who is actually going to get a chance to run...
+ // state before we negotiate who is actually going to get a chance to run...
// Don't set to resume suspended threads, and if any thread wanted to stop
- // others, only
- // call setup on the threads that request StopOthers...
+ // others, only call setup on the threads that request StopOthers...
for (pos = m_threads.begin(); pos != end; ++pos) {
if ((*pos)->GetResumeState() != eStateSuspended &&
@@ -636,13 +636,12 @@ void ThreadList::DidStop() {
std::lock_guard<std::recursive_mutex> guard(GetMutex());
collection::iterator pos, end = m_threads.end();
for (pos = m_threads.begin(); pos != end; ++pos) {
- // Notify threads that the process just stopped.
- // Note, this currently assumes that all threads in the list
- // stop when the process stops. In the future we will want to support
- // a debugging model where some threads continue to run while others
- // are stopped. We either need to handle that somehow here or
- // create a special thread list containing only threads which will
- // stop in the code that calls this method (currently
+ // Notify threads that the process just stopped. Note, this currently
+ // assumes that all threads in the list stop when the process stops. In
+ // the future we will want to support a debugging model where some threads
+ // continue to run while others are stopped. We either need to handle that
+ // somehow here or create a special thread list containing only threads
+ // which will stop in the code that calls this method (currently
// Process::SetPrivateState).
ThreadSP thread_sp(*pos);
if (StateIsRunningState(thread_sp->GetState()))
@@ -703,8 +702,8 @@ void ThreadList::NotifySelectedThreadChanged(lldb::tid_t tid) {
void ThreadList::Update(ThreadList &rhs) {
if (this != &rhs) {
- // Lock both mutexes to make sure neither side changes anyone on us
- // while the assignment occurs
+ // Lock both mutexes to make sure neither side changes anyone on us while
+ // the assignment occurs
std::lock_guard<std::recursive_mutex> guard(GetMutex());
m_process = rhs.m_process;
@@ -712,13 +711,12 @@ void ThreadList::Update(ThreadList &rhs) {
m_threads.swap(rhs.m_threads);
m_selected_tid = rhs.m_selected_tid;
- // Now we look for threads that we are done with and
- // make sure to clear them up as much as possible so
- // anyone with a shared pointer will still have a reference,
- // but the thread won't be of much use. Using std::weak_ptr
- // for all backward references (such as a thread to a process)
- // will eventually solve this issue for us, but for now, we
- // need to work around the issue
+ // Now we look for threads that we are done with and make sure to clear
+ // them up as much as possible so anyone with a shared pointer will still
+ // have a reference, but the thread won't be of much use. Using
+ // std::weak_ptr for all backward references (such as a thread to a
+ // process) will eventually solve this issue for us, but for now, we need
+ // to work around the issue
collection::iterator rhs_pos, rhs_end = rhs.m_threads.end();
for (rhs_pos = rhs.m_threads.begin(); rhs_pos != rhs_end; ++rhs_pos) {
const lldb::tid_t tid = (*rhs_pos)->GetID();
diff --git a/source/Target/ThreadPlan.cpp b/source/Target/ThreadPlan.cpp
index 27c9e2aa9c00..31ee1e922494 100644
--- a/source/Target/ThreadPlan.cpp
+++ b/source/Target/ThreadPlan.cpp
@@ -100,8 +100,8 @@ bool ThreadPlan::StopOthers() {
}
void ThreadPlan::SetStopOthers(bool new_value) {
- // SetStopOthers doesn't work up the hierarchy. You have to set the
- // explicit ThreadPlan you want to affect.
+ // SetStopOthers doesn't work up the hierarchy. You have to set the explicit
+ // ThreadPlan you want to affect.
}
bool ThreadPlan::WillResume(StateType resume_state, bool current_plan) {
diff --git a/source/Target/ThreadPlanBase.cpp b/source/Target/ThreadPlanBase.cpp
index d1c2f6dd1206..65b114584177 100644
--- a/source/Target/ThreadPlanBase.cpp
+++ b/source/Target/ThreadPlanBase.cpp
@@ -28,8 +28,8 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// ThreadPlanBase: This one always stops, and never has anything particular
-// to do.
+// ThreadPlanBase: This one always stops, and never has anything particular to
+// do.
// FIXME: The "signal handling" policies should probably go here.
//----------------------------------------------------------------------
@@ -59,8 +59,8 @@ void ThreadPlanBase::GetDescription(Stream *s, lldb::DescriptionLevel level) {
bool ThreadPlanBase::ValidatePlan(Stream *error) { return true; }
bool ThreadPlanBase::DoPlanExplainsStop(Event *event_ptr) {
- // The base plan should defer to its tracer, since by default it
- // always handles the stop.
+ // The base plan should defer to its tracer, since by default it always
+ // handles the stop.
if (TracerExplainsStop())
return false;
else
@@ -99,10 +99,9 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
case eStopReasonBreakpoint:
case eStopReasonWatchpoint:
if (stop_info_sp->ShouldStopSynchronous(event_ptr)) {
- // If we are going to stop for a breakpoint, then unship the other plans
- // at this point. Don't force the discard, however, so Master plans can
- // stay
- // in place if they want to.
+ // If we are going to stop for a breakpoint, then unship the other
+ // plans at this point. Don't force the discard, however, so Master
+ // plans can stay in place if they want to.
if (log)
log->Printf(
"Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64
@@ -112,9 +111,8 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
return true;
}
// If we aren't going to stop at this breakpoint, and it is internal,
- // don't report this stop or the subsequent running event.
- // Otherwise we will post the stopped & running, but the stopped event
- // will get marked
+ // don't report this stop or the subsequent running event. Otherwise we
+ // will post the stopped & running, but the stopped event will get marked
// with "restarted" so the UI will know to wait and expect the consequent
// "running".
if (stop_info_sp->ShouldNotify(event_ptr)) {
@@ -131,10 +129,9 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
break;
case eStopReasonException:
- // If we crashed, discard thread plans and stop. Don't force the discard,
- // however,
- // since on rerun the target may clean up this exception and continue
- // normally from there.
+ // If we crashed, discard thread plans and stop. Don't force the
+ // discard, however, since on rerun the target may clean up this
+ // exception and continue normally from there.
if (log)
log->Printf(
"Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64
@@ -144,10 +141,9 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
return true;
case eStopReasonExec:
- // If we crashed, discard thread plans and stop. Don't force the discard,
- // however,
- // since on rerun the target may clean up this exception and continue
- // normally from there.
+ // If we crashed, discard thread plans and stop. Don't force the
+ // discard, however, since on rerun the target may clean up this
+ // exception and continue normally from there.
if (log)
log->Printf(
"Base plan discarding thread plans for thread tid = 0x%4.4" PRIx64
@@ -198,8 +194,7 @@ bool ThreadPlanBase::WillStop() { return true; }
bool ThreadPlanBase::DoWillResume(lldb::StateType resume_state,
bool current_plan) {
// Reset these to the default values so we don't set them wrong, then not get
- // asked
- // for a while, then return the wrong answer.
+ // asked for a while, then return the wrong answer.
m_run_vote = eVoteNoOpinion;
m_stop_vote = eVoteNo;
return true;
diff --git a/source/Target/ThreadPlanCallFunction.cpp b/source/Target/ThreadPlanCallFunction.cpp
index e3b9ae15dc95..18beda42fb64 100644
--- a/source/Target/ThreadPlanCallFunction.cpp
+++ b/source/Target/ThreadPlanCallFunction.cpp
@@ -15,6 +15,7 @@
#include "lldb/Breakpoint/Breakpoint.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Address.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Target/ABI.h"
@@ -56,8 +57,7 @@ bool ThreadPlanCallFunction::ConstructorSetup(
m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
// If we can't read memory at the point of the process where we are planning
- // to put our function, we're
- // not going to get any further...
+ // to put our function, we're not going to get any further...
Status error;
process_sp->ReadUnsignedIntegerFromMemory(m_function_sp, 4, 0, error);
if (!error.Success()) {
@@ -187,7 +187,8 @@ void ThreadPlanCallFunction::ReportRegisterState(const char *message) {
reg_idx < num_registers; ++reg_idx) {
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex(reg_idx);
if (reg_ctx->ReadRegister(reg_info, reg_value)) {
- reg_value.Dump(&strm, reg_info, true, false, eFormatDefault);
+ DumpRegisterValue(reg_value, &strm, reg_info, true, false,
+ eFormatDefault);
strm.EOL();
}
}
@@ -278,9 +279,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
LIBLLDB_LOG_PROCESS));
m_real_stop_info_sp = GetPrivateStopInfo();
- // If our subplan knows why we stopped, even if it's done (which would forward
- // the question to us)
- // we answer yes.
+ // If our subplan knows why we stopped, even if it's done (which would
+ // forward the question to us) we answer yes.
if (m_subplan_sp && m_subplan_sp->PlanExplainsStop(event_ptr)) {
SetPlanComplete();
return true;
@@ -302,8 +302,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
return true;
// One more quirk here. If this event was from Halt interrupting the target,
- // then we should not consider
- // ourselves complete. Return true to acknowledge the stop.
+ // then we should not consider ourselves complete. Return true to
+ // acknowledge the stop.
if (Process::ProcessEventData::GetInterruptedFromEvent(event_ptr)) {
if (log)
log->Printf("ThreadPlanCallFunction::PlanExplainsStop: The event is an "
@@ -312,8 +312,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
}
// We control breakpoints separately from other "stop reasons." So first,
// check the case where we stopped for an internal breakpoint, in that case,
- // continue on.
- // If it is not an internal breakpoint, consult m_ignore_breakpoints.
+ // continue on. If it is not an internal breakpoint, consult
+ // m_ignore_breakpoints.
if (stop_reason == eStopReasonBreakpoint) {
ProcessSP process_sp(m_thread.CalculateProcess());
@@ -364,15 +364,13 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
// should be propagated up the stack.
return false;
} else {
- // If the subplan is running, any crashes are attributable to us.
- // If we want to discard the plan, then we say we explain the stop
- // but if we are going to be discarded, let whoever is above us
- // explain the stop.
- // But don't discard the plan if the stop would restart itself (for instance
- // if it is a
- // signal that is set not to stop. Check that here first. We just say we
- // explain the stop
- // but aren't done and everything will continue on from there.
+ // If the subplan is running, any crashes are attributable to us. If we
+ // want to discard the plan, then we say we explain the stop but if we are
+ // going to be discarded, let whoever is above us explain the stop. But
+ // don't discard the plan if the stop would restart itself (for instance if
+ // it is a signal that is set not to stop. Check that here first. We just
+ // say we explain the stop but aren't done and everything will continue on
+ // from there.
if (m_real_stop_info_sp &&
m_real_stop_info_sp->ShouldStopSynchronous(event_ptr)) {
@@ -385,8 +383,8 @@ bool ThreadPlanCallFunction::DoPlanExplainsStop(Event *event_ptr) {
bool ThreadPlanCallFunction::ShouldStop(Event *event_ptr) {
// We do some computation in DoPlanExplainsStop that may or may not set the
- // plan as complete.
- // We need to do that here to make sure our state is correct.
+ // plan as complete. We need to do that here to make sure our state is
+ // correct.
DoPlanExplainsStop(event_ptr);
if (IsPlanComplete()) {
@@ -405,9 +403,8 @@ void ThreadPlanCallFunction::DidPush() {
//#define SINGLE_STEP_EXPRESSIONS
// Now set the thread state to "no reason" so we don't run with whatever
- // signal was outstanding...
- // Wait till the plan is pushed so we aren't changing the stop info till we're
- // about to run.
+ // signal was outstanding... Wait till the plan is pushed so we aren't
+ // changing the stop info till we're about to run.
GetThread().SetStopInfoToNothing();
@@ -483,10 +480,9 @@ bool ThreadPlanCallFunction::BreakpointsExplainStop() {
SetPlanComplete(false);
- // If the user has set the ObjC language breakpoint, it would normally get
- // priority over our internal
- // catcher breakpoint, but in this case we can't let that happen, so force
- // the ShouldStop here.
+ // If the user has set the ObjC language breakpoint, it would normally
+ // get priority over our internal catcher breakpoint, but in this case we
+ // can't let that happen, so force the ShouldStop here.
stop_info_sp->OverrideShouldStop(true);
return true;
}
diff --git a/source/Target/ThreadPlanCallOnFunctionExit.cpp b/source/Target/ThreadPlanCallOnFunctionExit.cpp
index 0dae98f03ef5..e8ea73f3c6a0 100644
--- a/source/Target/ThreadPlanCallOnFunctionExit.cpp
+++ b/source/Target/ThreadPlanCallOnFunctionExit.cpp
@@ -23,8 +23,8 @@ ThreadPlanCallOnFunctionExit::ThreadPlanCallOnFunctionExit(
}
void ThreadPlanCallOnFunctionExit::DidPush() {
- // We now want to queue the "step out" thread plan so it executes
- // and completes.
+ // We now want to queue the "step out" thread plan so it executes and
+ // completes.
// Set stop vote to eVoteNo.
m_step_out_threadplan_sp = GetThread().QueueThreadPlanForStepOut(
@@ -59,9 +59,9 @@ bool ThreadPlanCallOnFunctionExit::ValidatePlan(Stream *error) {
}
bool ThreadPlanCallOnFunctionExit::ShouldStop(Event *event_ptr) {
- // If this is where we find out that an internal stop came in, then:
- // Check if the step-out plan completed. If it did, then we want to
- // run the callback here (our reason for living...)
+ // If this is where we find out that an internal stop came in, then: Check if
+ // the step-out plan completed. If it did, then we want to run the callback
+ // here (our reason for living...)
if (m_step_out_threadplan_sp && m_step_out_threadplan_sp->IsPlanComplete()) {
m_callback();
@@ -71,8 +71,8 @@ bool ThreadPlanCallOnFunctionExit::ShouldStop(Event *event_ptr) {
// Indicate that this plan is done and can be discarded.
SetPlanComplete();
- // We're done now, but we want to return false so that we
- // don't cause the thread to really stop.
+ // We're done now, but we want to return false so that we don't cause the
+ // thread to really stop.
}
return false;
@@ -80,21 +80,20 @@ bool ThreadPlanCallOnFunctionExit::ShouldStop(Event *event_ptr) {
bool ThreadPlanCallOnFunctionExit::WillStop() {
// The code looks like the return value is ignored via ThreadList::
- // ShouldStop().
- // This is called when we really are going to stop. We don't care
- // and don't need to do anything here.
+ // ShouldStop(). This is called when we really are going to stop. We don't
+ // care and don't need to do anything here.
return false;
}
bool ThreadPlanCallOnFunctionExit::DoPlanExplainsStop(Event *event_ptr) {
- // We don't ever explain a stop. The only stop that is relevant
- // to us directly is the step_out plan we added to do the heavy lifting
- // of getting us past the current method.
+ // We don't ever explain a stop. The only stop that is relevant to us
+ // directly is the step_out plan we added to do the heavy lifting of getting
+ // us past the current method.
return false;
}
lldb::StateType ThreadPlanCallOnFunctionExit::GetPlanRunState() {
- // This value doesn't matter - we'll never be the top thread plan, so
- // nobody will ask us this question.
+ // This value doesn't matter - we'll never be the top thread plan, so nobody
+ // will ask us this question.
return eStateRunning;
}
diff --git a/source/Target/ThreadPlanCallUserExpression.cpp b/source/Target/ThreadPlanCallUserExpression.cpp
index 15cbd0baa9a6..7bf0dd39993e 100644
--- a/source/Target/ThreadPlanCallUserExpression.cpp
+++ b/source/Target/ThreadPlanCallUserExpression.cpp
@@ -44,8 +44,8 @@ ThreadPlanCallUserExpression::ThreadPlanCallUserExpression(
lldb::UserExpressionSP &user_expression_sp)
: ThreadPlanCallFunction(thread, function, CompilerType(), args, options),
m_user_expression_sp(user_expression_sp) {
- // User expressions are generally "User generated" so we should set them up to
- // stop when done.
+ // User expressions are generally "User generated" so we should set them up
+ // to stop when done.
SetIsMasterPlan(true);
SetOkayToDiscard(false);
}
diff --git a/source/Target/ThreadPlanPython.cpp b/source/Target/ThreadPlanPython.cpp
index af5c76518382..7796b8a0ab20 100644
--- a/source/Target/ThreadPlanPython.cpp
+++ b/source/Target/ThreadPlanPython.cpp
@@ -59,8 +59,7 @@ bool ThreadPlanPython::ValidatePlan(Stream *error) {
void ThreadPlanPython::DidPush() {
// We set up the script side in DidPush, so that it can push other plans in
- // the constructor,
- // and doesn't have to care about the details of DidPush.
+ // the constructor, and doesn't have to care about the details of DidPush.
if (!m_class_name.empty()) {
ScriptInterpreter *script_interp = m_thread.GetProcess()
diff --git a/source/Target/ThreadPlanRunToAddress.cpp b/source/Target/ThreadPlanRunToAddress.cpp
index 44de724b608c..6d1a8b5c27ff 100644
--- a/source/Target/ThreadPlanRunToAddress.cpp
+++ b/source/Target/ThreadPlanRunToAddress.cpp
@@ -133,8 +133,7 @@ void ThreadPlanRunToAddress::GetDescription(Stream *s,
}
bool ThreadPlanRunToAddress::ValidatePlan(Stream *error) {
- // If we couldn't set the breakpoint for some reason, then this won't
- // work.
+ // If we couldn't set the breakpoint for some reason, then this won't work.
bool all_bps_good = true;
size_t num_break_ids = m_break_ids.size();
diff --git a/source/Target/ThreadPlanShouldStopHere.cpp b/source/Target/ThreadPlanShouldStopHere.cpp
index 42aaa4227cf9..c7afe0d9a8a7 100644
--- a/source/Target/ThreadPlanShouldStopHere.cpp
+++ b/source/Target/ThreadPlanShouldStopHere.cpp
@@ -86,8 +86,8 @@ bool ThreadPlanShouldStopHere::DefaultShouldStopHereCallback(
// Always avoid code with line number 0.
// FIXME: At present the ShouldStop and the StepFromHere calculate this
// independently. If this ever
- // becomes expensive (this one isn't) we can try to have this set a state that
- // the StepFromHere can use.
+ // becomes expensive (this one isn't) we can try to have this set a state
+ // that the StepFromHere can use.
if (frame) {
SymbolContext sc;
sc = frame->GetSymbolContext(eSymbolContextLineEntry);
@@ -104,9 +104,8 @@ ThreadPlanSP ThreadPlanShouldStopHere::DefaultStepFromHereCallback(
const bool stop_others = false;
const size_t frame_index = 0;
ThreadPlanSP return_plan_sp;
- // If we are stepping through code at line number 0, then we need to step over
- // this range. Otherwise
- // we will step out.
+ // If we are stepping through code at line number 0, then we need to step
+ // over this range. Otherwise we will step out.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
StackFrame *frame = current_plan->GetThread().GetStackFrameAtIndex(0).get();
@@ -119,8 +118,7 @@ ThreadPlanSP ThreadPlanShouldStopHere::DefaultStepFromHereCallback(
AddressRange range = sc.line_entry.range;
// If the whole function is marked line 0 just step out, that's easier &
- // faster than continuing
- // to step through it.
+ // faster than continuing to step through it.
bool just_step_out = false;
if (sc.symbol && sc.symbol->ValueIsAddress()) {
Address symbol_end = sc.symbol->GetAddress();
diff --git a/source/Target/ThreadPlanStepInRange.cpp b/source/Target/ThreadPlanStepInRange.cpp
index 6c5a9954f23f..6405c135a33e 100644
--- a/source/Target/ThreadPlanStepInRange.cpp
+++ b/source/Target/ThreadPlanStepInRange.cpp
@@ -12,11 +12,13 @@
// Other libraries and framework includes
// Project includes
#include "lldb/Target/ThreadPlanStepInRange.h"
+#include "lldb/Core/Architecture.h"
#include "lldb/Core/Module.h"
#include "lldb/Symbol/Function.h"
#include "lldb/Symbol/Symbol.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
+#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlanStepOut.h"
@@ -33,8 +35,7 @@ uint32_t ThreadPlanStepInRange::s_default_flag_values =
//----------------------------------------------------------------------
// ThreadPlanStepInRange: Step through a stack range, either stepping over or
-// into
-// based on the value of \a type.
+// into based on the value of \a type.
//----------------------------------------------------------------------
ThreadPlanStepInRange::ThreadPlanStepInRange(
@@ -162,15 +163,14 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
if (m_virtual_step) {
// If we've just completed a virtual step, all we need to do is check for a
- // ShouldStopHere plan, and otherwise
- // we're done.
+ // ShouldStopHere plan, and otherwise we're done.
// FIXME - This can be both a step in and a step out. Probably should
// record which in the m_virtual_step.
m_sub_plan_sp = CheckShouldStopHereAndQueueStepOut(eFrameCompareYounger);
} else {
// Stepping through should be done running other threads in general, since
- // we're setting a breakpoint and
- // continuing. So only stop others if we are explicitly told to do so.
+ // we're setting a breakpoint and continuing. So only stop others if we
+ // are explicitly told to do so.
bool stop_others = (m_stop_others == lldb::eOnlyThisThread);
@@ -183,9 +183,8 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
// A caveat to this is if we think the frame is older but we're actually
// in a trampoline.
// I'm going to make the assumption that you wouldn't RETURN to a
- // trampoline. So if we are
- // in a trampoline we think the frame is older because the trampoline
- // confused the backtracer.
+ // trampoline. So if we are in a trampoline we think the frame is older
+ // because the trampoline confused the backtracer.
m_sub_plan_sp = m_thread.QueueThreadPlanForStepThrough(m_stack_id, false,
stop_others);
if (!m_sub_plan_sp) {
@@ -202,19 +201,15 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
"Thought I stepped out, but in fact arrived at a trampoline.");
}
} else if (frame_order == eFrameCompareEqual && InSymbol()) {
- // If we are not in a place we should step through, we're done.
- // One tricky bit here is that some stubs don't push a frame, so we have
- // to check
- // both the case of a frame that is younger, or the same as this frame.
- // However, if the frame is the same, and we are still in the symbol we
- // started
- // in, the we don't need to do this. This first check isn't strictly
- // necessary,
- // but it is more efficient.
+ // If we are not in a place we should step through, we're done. One
+ // tricky bit here is that some stubs don't push a frame, so we have to
+ // check both the case of a frame that is younger, or the same as this
+ // frame. However, if the frame is the same, and we are still in the
+ // symbol we started in, the we don't need to do this. This first check
+ // isn't strictly necessary, but it is more efficient.
// If we're still in the range, keep going, either by running to the next
- // branch breakpoint, or by
- // stepping.
+ // branch breakpoint, or by stepping.
if (InRange()) {
SetNextBranchBreakpoint();
return false;
@@ -242,15 +237,13 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
log->Printf("No step through plan found.");
}
- // If not, give the "should_stop" callback a chance to push a plan to get us
- // out of here.
- // But only do that if we actually have stepped in.
+ // If not, give the "should_stop" callback a chance to push a plan to get
+ // us out of here. But only do that if we actually have stepped in.
if (!m_sub_plan_sp && frame_order == eFrameCompareYounger)
m_sub_plan_sp = CheckShouldStopHereAndQueueStepOut(frame_order);
// If we've stepped in and we are going to stop here, check to see if we
- // were asked to
- // run past the prologue, and if so do that.
+ // were asked to run past the prologue, and if so do that.
if (!m_sub_plan_sp && frame_order == eFrameCompareYounger &&
m_step_past_prologue) {
@@ -277,6 +270,17 @@ bool ThreadPlanStepInRange::ShouldStop(Event *event_ptr) {
bytes_to_skip = sc.symbol->GetPrologueByteSize();
}
+ if (bytes_to_skip == 0 && sc.symbol) {
+ TargetSP target = m_thread.CalculateTarget();
+ const Architecture *arch = target->GetArchitecturePlugin();
+ if (arch) {
+ Address curr_sec_addr;
+ target->GetSectionLoadList().ResolveLoadAddress(curr_addr,
+ curr_sec_addr);
+ bytes_to_skip = arch->GetBytesToSkip(*sc.symbol, curr_sec_addr);
+ }
+ }
+
if (bytes_to_skip != 0) {
func_start_address.Slide(bytes_to_skip);
log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP);
@@ -400,8 +404,8 @@ bool ThreadPlanStepInRange::DefaultShouldStopHereCallback(
SymbolContext sc = frame->GetSymbolContext(
eSymbolContextFunction | eSymbolContextBlock | eSymbolContextSymbol);
if (sc.symbol != nullptr) {
- // First try an exact match, since that's cheap with ConstStrings. Then
- // do a strstr compare.
+ // First try an exact match, since that's cheap with ConstStrings.
+ // Then do a strstr compare.
if (step_in_range_plan->m_step_into_target == sc.GetFunctionName()) {
should_stop_here = true;
} else {
@@ -436,25 +440,19 @@ bool ThreadPlanStepInRange::DefaultShouldStopHereCallback(
bool ThreadPlanStepInRange::DoPlanExplainsStop(Event *event_ptr) {
// We always explain a stop. Either we've just done a single step, in which
- // case we'll do our ordinary processing, or we stopped for some
- // reason that isn't handled by our sub-plans, in which case we want to just
- // stop right
- // away.
- // In general, we don't want to mark the plan as complete for unexplained
- // stops.
- // For instance, if you step in to some code with no debug info, so you step
- // out
- // and in the course of that hit a breakpoint, then you want to stop & show
- // the user
- // the breakpoint, but not unship the step in plan, since you still may want
- // to complete that
- // plan when you continue. This is particularly true when doing "step in to
- // target function."
+ // case we'll do our ordinary processing, or we stopped for some reason that
+ // isn't handled by our sub-plans, in which case we want to just stop right
+ // away. In general, we don't want to mark the plan as complete for
+ // unexplained stops. For instance, if you step in to some code with no debug
+ // info, so you step out and in the course of that hit a breakpoint, then you
+ // want to stop & show the user the breakpoint, but not unship the step in
+ // plan, since you still may want to complete that plan when you continue.
+ // This is particularly true when doing "step in to target function."
// stepping.
//
- // The only variation is that if we are doing "step by running to next branch"
- // in which case
- // if we hit our branch breakpoint we don't set the plan to complete.
+ // The only variation is that if we are doing "step by running to next
+ // branch" in which case if we hit our branch breakpoint we don't set the
+ // plan to complete.
bool return_value = false;
diff --git a/source/Target/ThreadPlanStepInstruction.cpp b/source/Target/ThreadPlanStepInstruction.cpp
index ca45960e1ed5..dd8f129a935b 100644
--- a/source/Target/ThreadPlanStepInstruction.cpp
+++ b/source/Target/ThreadPlanStepInstruction.cpp
@@ -76,8 +76,8 @@ void ThreadPlanStepInstruction::GetDescription(Stream *s,
}
bool ThreadPlanStepInstruction::ValidatePlan(Stream *error) {
- // Since we read the instruction we're stepping over from the thread,
- // this plan will always work.
+ // Since we read the instruction we're stepping over from the thread, this
+ // plan will always work.
return true;
}
@@ -106,8 +106,8 @@ bool ThreadPlanStepInstruction::IsPlanStale() {
return (m_thread.GetRegisterContext()->GetPC(0) != m_instruction_addr);
} else if (cur_frame_id < m_stack_id) {
// If the current frame is younger than the start frame and we are stepping
- // over, then we need to continue,
- // but if we are doing just one step, we're done.
+ // over, then we need to continue, but if we are doing just one step, we're
+ // done.
return !m_step_over;
} else {
if (log) {
@@ -140,8 +140,7 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
return true;
} else {
// We are still stepping, reset the start pc, and in case we've
- // stepped out,
- // reset the current stack id.
+ // stepped out, reset the current stack id.
SetUpState();
return false;
}
@@ -154,9 +153,8 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
if (return_frame->GetStackID() != m_parent_frame_id ||
m_start_has_symbol) {
// next-instruction shouldn't step out of inlined functions. But we
- // may have stepped into a
- // real function that starts with an inlined function, and we do want
- // to step out of that...
+ // may have stepped into a real function that starts with an inlined
+ // function, and we do want to step out of that...
if (cur_frame_sp->IsInlined()) {
StackFrameSP parent_frame_sp =
@@ -190,9 +188,8 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
log->Printf("%s.", s.GetData());
}
- // StepInstruction should probably have the tri-state RunMode, but for
- // now it is safer to
- // run others.
+ // StepInstruction should probably have the tri-state RunMode, but
+ // for now it is safer to run others.
const bool stop_others = false;
m_thread.QueueThreadPlanForStepOutNoShouldStop(
false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion, 0);
@@ -222,8 +219,7 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
return true;
} else {
// We are still stepping, reset the start pc, and in case we've stepped
- // in or out,
- // reset the current stack id.
+ // in or out, reset the current stack id.
SetUpState();
return false;
}
diff --git a/source/Target/ThreadPlanStepOut.cpp b/source/Target/ThreadPlanStepOut.cpp
index 6b6ed06e9b37..f2db6e4b6f42 100644
--- a/source/Target/ThreadPlanStepOut.cpp
+++ b/source/Target/ThreadPlanStepOut.cpp
@@ -63,17 +63,14 @@ ThreadPlanStepOut::ThreadPlanStepOut(
m_step_out_to_id = return_frame_sp->GetStackID();
m_immediate_step_from_id = immediate_return_from_sp->GetStackID();
- // If the frame directly below the one we are returning to is inlined, we have
- // to be
- // a little more careful. It is non-trivial to determine the real "return
- // code address" for
- // an inlined frame, so we have to work our way to that frame and then step
- // out.
+ // If the frame directly below the one we are returning to is inlined, we
+ // have to be a little more careful. It is non-trivial to determine the real
+ // "return code address" for an inlined frame, so we have to work our way to
+ // that frame and then step out.
if (immediate_return_from_sp && immediate_return_from_sp->IsInlined()) {
if (frame_idx > 0) {
// First queue a plan that gets us to this inlined frame, and when we get
- // there we'll queue a second
- // plan that walks us out of this frame.
+ // there we'll queue a second plan that walks us out of this frame.
m_step_out_to_inline_plan_sp.reset(new ThreadPlanStepOut(
m_thread, nullptr, false, stop_others, eVoteNoOpinion, eVoteNoOpinion,
frame_idx - 1, eLazyBoolNo, continue_to_next_branch));
@@ -81,8 +78,8 @@ ThreadPlanStepOut::ThreadPlanStepOut(
->SetShouldStopHereCallbacks(nullptr, nullptr);
m_step_out_to_inline_plan_sp->SetPrivate(true);
} else {
- // If we're already at the inlined frame we're stepping through, then just
- // do that now.
+ // If we're already at the inlined frame we're stepping through, then
+ // just do that now.
QueueInlinedStepPlan(false);
}
} else if (return_frame_sp) {
@@ -217,8 +214,8 @@ bool ThreadPlanStepOut::ValidatePlan(Stream *error) {
}
bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
- // If the step out plan is done, then we just need to step through the inlined
- // frame.
+ // If the step out plan is done, then we just need to step through the
+ // inlined frame.
if (m_step_out_to_inline_plan_sp) {
return m_step_out_to_inline_plan_sp->MischiefManaged();
} else if (m_step_through_inline_plan_sp) {
@@ -233,15 +230,14 @@ bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
}
// We don't explain signals or breakpoints (breakpoints that handle stepping
- // in or
- // out will be handled by a child plan.
+ // in or out will be handled by a child plan.
StopInfoSP stop_info_sp = GetPrivateStopInfo();
if (stop_info_sp) {
StopReason reason = stop_info_sp->GetStopReason();
if (reason == eStopReasonBreakpoint) {
- // If this is OUR breakpoint, we're fine, otherwise we don't know why this
- // happened...
+ // If this is OUR breakpoint, we're fine, otherwise we don't know why
+ // this happened...
BreakpointSiteSP site_sp(
m_thread.GetProcess()->GetBreakpointSiteList().FindByID(
stop_info_sp->GetValue()));
@@ -268,11 +264,10 @@ bool ThreadPlanStepOut::DoPlanExplainsStop(Event *event_ptr) {
}
// If there was only one owner, then we're done. But if we also hit
- // some
- // user breakpoint on our way out, we should mark ourselves as done, but
- // also not claim to explain the stop, since it is more important to
- // report
- // the user breakpoint than the step out completion.
+ // some user breakpoint on our way out, we should mark ourselves as
+ // done, but also not claim to explain the stop, since it is more
+ // important to report the user breakpoint than the step out
+ // completion.
if (site_sp->GetNumberOfOwners() == 1)
return true;
@@ -320,9 +315,8 @@ bool ThreadPlanStepOut::ShouldStop(Event *event_ptr) {
done = !(frame_zero_id < m_step_out_to_id);
}
- // The normal step out computations think we are done, so all we need to do is
- // consult the ShouldStopHere,
- // and we are done.
+ // The normal step out computations think we are done, so all we need to do
+ // is consult the ShouldStopHere, and we are done.
if (done) {
if (InvokeShouldStopHereCallback(eFrameCompareOlder)) {
@@ -377,8 +371,7 @@ bool ThreadPlanStepOut::MischiefManaged() {
// I also check the stack depth, since if we've blown past the breakpoint
// for some
// reason and we're now stopping for some other reason altogether, then
- // we're done
- // with this step out operation.
+ // we're done with this step out operation.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
if (log)
@@ -397,10 +390,8 @@ bool ThreadPlanStepOut::MischiefManaged() {
bool ThreadPlanStepOut::QueueInlinedStepPlan(bool queue_now) {
// Now figure out the range of this inlined block, and set up a "step through
- // range"
- // plan for that. If we've been provided with a context, then use the block
- // in that
- // context.
+ // range" plan for that. If we've been provided with a context, then use the
+ // block in that context.
StackFrameSP immediate_return_from_sp(m_thread.GetStackFrameAtIndex(0));
if (!immediate_return_from_sp)
return false;
@@ -477,8 +468,8 @@ void ThreadPlanStepOut::CalculateReturnValue() {
}
bool ThreadPlanStepOut::IsPlanStale() {
- // If we are still lower on the stack than the frame we are returning to, then
- // there's something for us to do. Otherwise, we're stale.
+ // If we are still lower on the stack than the frame we are returning to,
+ // then there's something for us to do. Otherwise, we're stale.
StackID frame_zero_id = m_thread.GetStackFrameAtIndex(0)->GetStackID();
return !(frame_zero_id < m_step_out_to_id);
diff --git a/source/Target/ThreadPlanStepOverBreakpoint.cpp b/source/Target/ThreadPlanStepOverBreakpoint.cpp
index 3896a0b24714..7497dbff1729 100644
--- a/source/Target/ThreadPlanStepOverBreakpoint.cpp
+++ b/source/Target/ThreadPlanStepOverBreakpoint.cpp
@@ -31,8 +31,8 @@ ThreadPlanStepOverBreakpoint::ThreadPlanStepOverBreakpoint(Thread &thread)
ThreadPlan::eKindStepOverBreakpoint, "Step over breakpoint trap",
thread, eVoteNo,
eVoteNoOpinion), // We need to report the run since this happens
- // first in the thread plan stack when stepping
- // over a breakpoint
+ // first in the thread plan stack when stepping over
+ // a breakpoint
m_breakpoint_addr(LLDB_INVALID_ADDRESS),
m_auto_continue(false), m_reenabled_breakpoint_site(false)
@@ -57,42 +57,58 @@ bool ThreadPlanStepOverBreakpoint::DoPlanExplainsStop(Event *event_ptr) {
StopInfoSP stop_info_sp = GetPrivateStopInfo();
if (stop_info_sp) {
// It's a little surprising that we stop here for a breakpoint hit.
- // However, when you single step ONTO a breakpoint
- // we still want to call that a breakpoint hit, and trigger the actions,
- // etc. Otherwise you would see the
+ // However, when you single step ONTO a breakpoint we still want to call
+ // that a breakpoint hit, and trigger the actions, etc. Otherwise you
+ // would see the
// PC at the breakpoint without having triggered the actions, then you'd
// continue, the PC wouldn't change,
- // and you'd see the breakpoint hit, which would be odd.
- // So the lower levels fake "step onto breakpoint address" and return that
- // as a breakpoint. So our trace
- // step COULD appear as a breakpoint hit if the next instruction also
- // contained a breakpoint.
+ // and you'd see the breakpoint hit, which would be odd. So the lower
+ // levels fake "step onto breakpoint address" and return that as a
+ // breakpoint. So our trace step COULD appear as a breakpoint hit if the
+ // next instruction also contained a breakpoint.
StopReason reason = stop_info_sp->GetStopReason();
+ Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
+
+ if (log)
+ log->Printf("Step over breakpoint stopped for reason: %s.",
+ Thread::StopReasonAsCString(reason));
+
switch (reason) {
- case eStopReasonTrace:
- case eStopReasonNone:
- return true;
- case eStopReasonBreakpoint:
- // It's a little surprising that we stop here for a breakpoint hit.
- // However, when you single step ONTO a
- // breakpoint we still want to call that a breakpoint hit, and trigger the
- // actions, etc. Otherwise you
- // would see the PC at the breakpoint without having triggered the
- // actions, then you'd continue, the PC
- // wouldn't change, and you'd see the breakpoint hit, which would be odd.
- // So the lower levels fake "step onto breakpoint address" and return that
- // as a breakpoint hit. So our trace
- // step COULD appear as a breakpoint hit if the next instruction also
- // contained a breakpoint. We don't want
- // to handle that, since we really don't know what to do with breakpoint
- // hits. But make sure we don't set
- // ourselves to auto-continue or we'll wrench control away from the plans
- // that can deal with this.
- SetAutoContinue(false);
- return false;
- default:
- return false;
+ case eStopReasonTrace:
+ case eStopReasonNone:
+ return true;
+ case eStopReasonBreakpoint:
+ {
+ // It's a little surprising that we stop here for a breakpoint hit.
+ // However, when you single step ONTO a breakpoint we still want to call
+ // that a breakpoint hit, and trigger the actions, etc. Otherwise you
+ // would see the PC at the breakpoint without having triggered the
+ // actions, then you'd continue, the PC wouldn't change, and you'd see
+ // the breakpoint hit, which would be odd. So the lower levels fake
+ // "step onto breakpoint address" and return that as a breakpoint hit.
+ // So our trace step COULD appear as a breakpoint hit if the next
+ // instruction also contained a breakpoint. We don't want to handle
+ // that, since we really don't know what to do with breakpoint hits.
+ // But make sure we don't set ourselves to auto-continue or we'll wrench
+ // control away from the plans that can deal with this.
+ // Be careful, however, as we may have "seen a breakpoint under the PC
+ // because we stopped without changing the PC, in which case we do want
+ // to re-claim this stop so we'll try again.
+ lldb::addr_t pc_addr = m_thread.GetRegisterContext()->GetPC();
+
+ if (pc_addr == m_breakpoint_addr) {
+ if (log)
+ log->Printf("Got breakpoint stop reason but pc: 0x%" PRIx64
+ "hasn't changed.", pc_addr);
+ return true;
+ }
+
+ SetAutoContinue(false);
+ return false;
+ }
+ default:
+ return false;
}
}
return false;
@@ -114,8 +130,10 @@ bool ThreadPlanStepOverBreakpoint::DoWillResume(StateType resume_state,
BreakpointSiteSP bp_site_sp(
m_thread.GetProcess()->GetBreakpointSiteList().FindByAddress(
m_breakpoint_addr));
- if (bp_site_sp && bp_site_sp->IsEnabled())
+ if (bp_site_sp && bp_site_sp->IsEnabled()) {
m_thread.GetProcess()->DisableBreakpointSite(bp_site_sp.get());
+ m_reenabled_breakpoint_site = false;
+ }
}
return true;
}
@@ -125,13 +143,16 @@ bool ThreadPlanStepOverBreakpoint::WillStop() {
return true;
}
+void ThreadPlanStepOverBreakpoint::WillPop() {
+ ReenableBreakpointSite();
+}
+
bool ThreadPlanStepOverBreakpoint::MischiefManaged() {
lldb::addr_t pc_addr = m_thread.GetRegisterContext()->GetPC();
if (pc_addr == m_breakpoint_addr) {
// If we are still at the PC of our breakpoint, then for some reason we
- // didn't
- // get a chance to run.
+ // didn't get a chance to run.
return false;
} else {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
diff --git a/source/Target/ThreadPlanStepOverRange.cpp b/source/Target/ThreadPlanStepOverRange.cpp
index d5778fb5e8d7..b88d25b707eb 100644
--- a/source/Target/ThreadPlanStepOverRange.cpp
+++ b/source/Target/ThreadPlanStepOverRange.cpp
@@ -32,8 +32,7 @@ uint32_t ThreadPlanStepOverRange::s_default_flag_values = 0;
//----------------------------------------------------------------------
// ThreadPlanStepOverRange: Step through a stack range, either stepping over or
-// into
-// based on the value of \a type.
+// into based on the value of \a type.
//----------------------------------------------------------------------
ThreadPlanStepOverRange::ThreadPlanStepOverRange(
@@ -91,21 +90,17 @@ void ThreadPlanStepOverRange::SetupAvoidNoDebug(
else
GetFlags().Clear(ThreadPlanShouldStopHere::eStepOutAvoidNoDebug);
// Step Over plans should always avoid no-debug on step in. Seems like you
- // shouldn't
- // have to say this, but a tail call looks more like a step in that a step
- // out, so
- // we want to catch this case.
+ // shouldn't have to say this, but a tail call looks more like a step in that
+ // a step out, so we want to catch this case.
GetFlags().Set(ThreadPlanShouldStopHere::eStepInAvoidNoDebug);
}
bool ThreadPlanStepOverRange::IsEquivalentContext(
const SymbolContext &context) {
- // Match as much as is specified in the m_addr_context:
- // This is a fairly loose sanity check. Note, sometimes the target doesn't
- // get filled
- // in so I left out the target check. And sometimes the module comes in as
- // the .o file from the
- // inlined range, so I left that out too...
+ // Match as much as is specified in the m_addr_context: This is a fairly
+ // loose sanity check. Note, sometimes the target doesn't get filled in so I
+ // left out the target check. And sometimes the module comes in as the .o
+ // file from the inlined range, so I left that out too...
if (m_addr_context.comp_unit) {
if (m_addr_context.comp_unit != context.comp_unit)
return false;
@@ -113,8 +108,8 @@ bool ThreadPlanStepOverRange::IsEquivalentContext(
if (m_addr_context.function != context.function)
return false;
// It is okay to return to a different block of a straight function, we
- // only have to
- // be more careful if returning from one inlined block to another.
+ // only have to be more careful if returning from one inlined block to
+ // another.
if (m_addr_context.block->GetInlinedFunctionInfo() == nullptr &&
context.block->GetInlinedFunctionInfo() == nullptr)
return true;
@@ -140,8 +135,8 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
}
// If we're out of the range but in the same frame or in our caller's frame
- // then we should stop.
- // When stepping out we only stop others if we are forcing running one thread.
+ // then we should stop. When stepping out we only stop others if we are
+ // forcing running one thread.
bool stop_others = (m_stop_others == lldb::eOnlyThisThread);
ThreadPlanSP new_plan_sp;
FrameComparison frame_order = CompareCurrentFrameToStartFrame();
@@ -152,11 +147,9 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
// A caveat to this is if we think the frame is older but we're actually in
// a trampoline.
// I'm going to make the assumption that you wouldn't RETURN to a
- // trampoline. So if we are
- // in a trampoline we think the frame is older because the trampoline
- // confused the backtracer.
- // As below, we step through first, and then try to figure out how to get
- // back out again.
+ // trampoline. So if we are in a trampoline we think the frame is older
+ // because the trampoline confused the backtracer. As below, we step
+ // through first, and then try to figure out how to get back out again.
new_plan_sp =
m_thread.QueueThreadPlanForStepThrough(m_stack_id, false, stop_others);
@@ -166,8 +159,7 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
"Thought I stepped out, but in fact arrived at a trampoline.");
} else if (frame_order == eFrameCompareYounger) {
// Make sure we really are in a new frame. Do that by unwinding and seeing
- // if the
- // start function really is our start function...
+ // if the start function really is our start function...
for (uint32_t i = 1;; ++i) {
StackFrameSP older_frame_sp = m_thread.GetStackFrameAtIndex(i);
if (!older_frame_sp) {
@@ -200,28 +192,23 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
if (!InSymbol()) {
// This one is a little tricky. Sometimes we may be in a stub or
- // something similar,
- // in which case we need to get out of there. But if we are in a stub
- // then it's
- // likely going to be hard to get out from here. It is probably easiest
- // to step into the
- // stub, and then it will be straight-forward to step out.
+ // something similar, in which case we need to get out of there. But if
+ // we are in a stub then it's likely going to be hard to get out from
+ // here. It is probably easiest to step into the stub, and then it will
+ // be straight-forward to step out.
new_plan_sp = m_thread.QueueThreadPlanForStepThrough(m_stack_id, false,
stop_others);
} else {
- // The current clang (at least through 424) doesn't always get the address
- // range for the
- // DW_TAG_inlined_subroutines right, so that when you leave the inlined
- // range the line table says
- // you are still in the source file of the inlining function. This is
- // bad, because now you are missing
- // the stack frame for the function containing the inlining, and if you
- // sensibly do "finish" to get
- // out of this function you will instead exit the containing function.
- // To work around this, we check whether we are still in the source file
- // we started in, and if not assume
- // it is an error, and push a plan to get us out of this line and back to
- // the containing file.
+ // The current clang (at least through 424) doesn't always get the
+ // address range for the DW_TAG_inlined_subroutines right, so that when
+ // you leave the inlined range the line table says you are still in the
+ // source file of the inlining function. This is bad, because now you
+ // are missing the stack frame for the function containing the inlining,
+ // and if you sensibly do "finish" to get out of this function you will
+ // instead exit the containing function. To work around this, we check
+ // whether we are still in the source file we started in, and if not
+ // assume it is an error, and push a plan to get us out of this line and
+ // back to the containing file.
if (m_addr_context.line_entry.IsValid()) {
SymbolContext sc;
@@ -244,14 +231,11 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
bool step_past_remaining_inline = false;
if (entry_idx > 0) {
// We require the previous line entry and the current line
- // entry come
- // from the same file.
- // The other requirement is that the previous line table entry
- // be part of an
- // inlined block, we don't want to step past cases where
- // people have inlined
- // some code fragment by using #include <source-fragment.c>
- // directly.
+ // entry come from the same file. The other requirement is
+ // that the previous line table entry be part of an inlined
+ // block, we don't want to step past cases where people have
+ // inlined some code fragment by using #include <source-
+ // fragment.c> directly.
LineEntry prev_line_entry;
if (line_table->GetLineEntryAtIndex(entry_idx - 1,
prev_line_entry) &&
@@ -338,8 +322,7 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
if (!new_plan_sp) {
// For efficiencies sake, we know we're done here so we don't have to do
- // this
- // calculation again in MischiefManaged.
+ // this calculation again in MischiefManaged.
SetPlanComplete();
return true;
} else
@@ -347,16 +330,12 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
}
bool ThreadPlanStepOverRange::DoPlanExplainsStop(Event *event_ptr) {
- // For crashes, breakpoint hits, signals, etc, let the base plan (or some plan
- // above us)
- // handle the stop. That way the user can see the stop, step around, and then
- // when they
- // are done, continue and have their step complete. The exception is if we've
- // hit our
- // "run to next branch" breakpoint.
- // Note, unlike the step in range plan, we don't mark ourselves complete if we
- // hit an
- // unexplained breakpoint/crash.
+ // For crashes, breakpoint hits, signals, etc, let the base plan (or some
+ // plan above us) handle the stop. That way the user can see the stop, step
+ // around, and then when they are done, continue and have their step
+ // complete. The exception is if we've hit our "run to next branch"
+ // breakpoint. Note, unlike the step in range plan, we don't mark ourselves
+ // complete if we hit an unexplained breakpoint/crash.
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
StopInfoSP stop_info_sp = GetPrivateStopInfo();
@@ -387,8 +366,8 @@ bool ThreadPlanStepOverRange::DoWillResume(lldb::StateType resume_state,
m_first_resume = false;
if (resume_state == eStateStepping && current_plan) {
// See if we are about to step over an inlined call in the middle of the
- // inlined stack, if so figure
- // out its extents and reset our range to step over that.
+ // inlined stack, if so figure out its extents and reset our range to
+ // step over that.
bool in_inlined_stack = m_thread.DecrementCurrentInlinedDepth();
if (in_inlined_stack) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
diff --git a/source/Target/ThreadPlanStepRange.cpp b/source/Target/ThreadPlanStepRange.cpp
index 09e606f490a6..5a71119015eb 100644
--- a/source/Target/ThreadPlanStepRange.cpp
+++ b/source/Target/ThreadPlanStepRange.cpp
@@ -31,8 +31,8 @@ using namespace lldb;
using namespace lldb_private;
//----------------------------------------------------------------------
-// ThreadPlanStepRange: Step through a stack range, either stepping over or into
-// based on the value of \a type.
+// ThreadPlanStepRange: Step through a stack range, either stepping over or
+// into based on the value of \a type.
//----------------------------------------------------------------------
ThreadPlanStepRange::ThreadPlanStepRange(ThreadPlanKind kind, const char *name,
@@ -74,15 +74,14 @@ Vote ThreadPlanStepRange::ShouldReportStop(Event *event_ptr) {
}
void ThreadPlanStepRange::AddRange(const AddressRange &new_range) {
- // For now I'm just adding the ranges. At some point we may want to
- // condense the ranges if they overlap, though I don't think it is likely
- // to be very important.
+ // For now I'm just adding the ranges. At some point we may want to condense
+ // the ranges if they overlap, though I don't think it is likely to be very
+ // important.
m_address_ranges.push_back(new_range);
// Fill the slot for this address range with an empty DisassemblerSP in the
- // instruction ranges. I want the
- // indices to match, but I don't want to do the work to disassemble this range
- // if I don't step into it.
+ // instruction ranges. I want the indices to match, but I don't want to do
+ // the work to disassemble this range if I don't step into it.
m_instruction_ranges.push_back(DisassemblerSP());
}
@@ -158,12 +157,11 @@ bool ThreadPlanStepRange::InRange() {
} else if (new_context.line_entry.range.GetBaseAddress().GetLoadAddress(
m_thread.CalculateTarget().get()) != pc_load_addr) {
// Another thing that sometimes happens here is that we step out of
- // one line into the MIDDLE of another
- // line. So far I mostly see this due to bugs in the debug
- // information.
- // But we probably don't want to be in the middle of a line range, so
- // in that case reset the stepping
- // range to the line we've stepped into the middle of and continue.
+ // one line into the MIDDLE of another line. So far I mostly see
+ // this due to bugs in the debug information. But we probably don't
+ // want to be in the middle of a line range, so in that case reset
+ // the stepping range to the line we've stepped into the middle of
+ // and continue.
m_addr_context = new_context;
m_address_ranges.clear();
AddRange(m_addr_context.line_entry.range);
@@ -260,9 +258,8 @@ InstructionList *ThreadPlanStepRange::GetInstructionsForAddress(
return nullptr;
else {
// Find where we are in the instruction list as well. If we aren't at
- // an instruction,
- // return nullptr. In this case, we're probably lost, and shouldn't try
- // to do anything fancy.
+ // an instruction, return nullptr. In this case, we're probably lost,
+ // and shouldn't try to do anything fancy.
insn_offset =
m_instruction_ranges[i]
@@ -297,8 +294,7 @@ bool ThreadPlanStepRange::SetNextBranchBreakpoint() {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
// Stepping through ranges using breakpoints doesn't work yet, but with this
- // off we fall back to instruction
- // single stepping.
+ // off we fall back to instruction single stepping.
if (!m_use_fast_step)
return false;
@@ -383,9 +379,8 @@ bool ThreadPlanStepRange::NextRangeBreakpointExplainsStop(
size_t num_owners = bp_site_sp->GetNumberOfOwners();
bool explains_stop = true;
// If all the owners are internal, then we are probably just stepping over
- // this range from multiple threads,
- // or multiple frames, so we want to continue. If one is not internal, then
- // we should not explain the stop,
+ // this range from multiple threads, or multiple frames, so we want to
+ // continue. If one is not internal, then we should not explain the stop,
// and let the user breakpoint handle the stop.
for (size_t i = 0; i < num_owners; i++) {
if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal()) {
@@ -418,8 +413,8 @@ bool ThreadPlanStepRange::MischiefManaged() {
// I do this check first because we might have stepped somewhere that will
// fool InRange into
// thinking it needs to step past the end of that line. This happens, for
- // instance, when stepping
- // over inlined code that is in the middle of the current line.
+ // instance, when stepping over inlined code that is in the middle of the
+ // current line.
if (!m_no_more_plans)
return false;
@@ -457,8 +452,8 @@ bool ThreadPlanStepRange::IsPlanStale() {
}
return true;
} else if (frame_order == eFrameCompareEqual && InSymbol()) {
- // If we are not in a place we should step through, we've gotten stale.
- // One tricky bit here is that some stubs don't push a frame, so we should.
+ // If we are not in a place we should step through, we've gotten stale. One
+ // tricky bit here is that some stubs don't push a frame, so we should.
// check that we are in the same symbol.
if (!InRange()) {
// Set plan Complete when we reach next instruction just after the range
diff --git a/source/Target/ThreadPlanStepThrough.cpp b/source/Target/ThreadPlanStepThrough.cpp
index 46aadb00f2ab..c039a32f5515 100644
--- a/source/Target/ThreadPlanStepThrough.cpp
+++ b/source/Target/ThreadPlanStepThrough.cpp
@@ -26,9 +26,8 @@ using namespace lldb_private;
//----------------------------------------------------------------------
// ThreadPlanStepThrough: If the current instruction is a trampoline, step
-// through it
-// If it is the beginning of the prologue of a function, step through that as
-// well.
+// through it If it is the beginning of the prologue of a function, step
+// through that as well.
// FIXME: At present only handles DYLD trampolines.
//----------------------------------------------------------------------
@@ -49,9 +48,8 @@ ThreadPlanStepThrough::ThreadPlanStepThrough(Thread &thread,
m_start_address = GetThread().GetRegisterContext()->GetPC(0);
// We are going to return back to the concrete frame 1, we might pass by
- // some inlined code that we're in
- // the middle of by doing this, but it's easier than trying to figure out
- // where the inlined code might return to.
+ // some inlined code that we're in the middle of by doing this, but it's
+ // easier than trying to figure out where the inlined code might return to.
StackFrameSP return_frame_sp = m_thread.GetFrameWithStackID(m_stack_id);
@@ -136,10 +134,8 @@ bool ThreadPlanStepThrough::ValidatePlan(Stream *error) {
bool ThreadPlanStepThrough::DoPlanExplainsStop(Event *event_ptr) {
// If we have a sub-plan, it will have been asked first if we explain the
- // stop, and
- // we won't get asked. The only time we would be the one directly asked this
- // question
- // is if we hit our backstop breakpoint.
+ // stop, and we won't get asked. The only time we would be the one directly
+ // asked this question is if we hit our backstop breakpoint.
return HitOurBackstopBreakpoint();
}
@@ -156,8 +152,7 @@ bool ThreadPlanStepThrough::ShouldStop(Event *event_ptr) {
}
// If we don't have a sub-plan, then we're also done (can't see how we would
- // ever get here
- // without a plan, but just in case.
+ // ever get here without a plan, but just in case.
if (!m_sub_plan_sp) {
SetPlanComplete();
@@ -165,15 +160,13 @@ bool ThreadPlanStepThrough::ShouldStop(Event *event_ptr) {
}
// If the current sub plan is not done, we don't want to stop. Actually, we
- // probably won't
- // ever get here in this state, since we generally won't get asked any
- // questions if out
- // current sub-plan is not done...
+ // probably won't ever get here in this state, since we generally won't get
+ // asked any questions if out current sub-plan is not done...
if (!m_sub_plan_sp->IsPlanComplete())
return false;
- // If our current sub plan failed, then let's just run to our backstop. If we
- // can't do that then just stop.
+ // If our current sub plan failed, then let's just run to our backstop. If
+ // we can't do that then just stop.
if (!m_sub_plan_sp->PlanSucceeded()) {
if (m_backstop_bkpt_id != LLDB_INVALID_BREAK_ID) {
m_sub_plan_sp.reset();
@@ -185,8 +178,7 @@ bool ThreadPlanStepThrough::ShouldStop(Event *event_ptr) {
}
// Next see if there is a specific step through plan at our current pc (these
- // might
- // chain, for instance stepping through a dylib trampoline to the objc
+ // might chain, for instance stepping through a dylib trampoline to the objc
// dispatch function...)
LookForPlanToStepThroughFromCurrentPC();
if (m_sub_plan_sp) {
diff --git a/source/Target/ThreadPlanStepUntil.cpp b/source/Target/ThreadPlanStepUntil.cpp
index 01f5f948a28c..9984ee925c86 100644
--- a/source/Target/ThreadPlanStepUntil.cpp
+++ b/source/Target/ThreadPlanStepUntil.cpp
@@ -151,8 +151,8 @@ void ThreadPlanStepUntil::AnalyzeStop() {
StopReason reason = stop_info_sp->GetStopReason();
if (reason == eStopReasonBreakpoint) {
- // If this is OUR breakpoint, we're fine, otherwise we don't know why this
- // happened...
+ // If this is OUR breakpoint, we're fine, otherwise we don't know why
+ // this happened...
BreakpointSiteSP this_site =
m_thread.GetProcess()->GetBreakpointSiteList().FindByID(
stop_info_sp->GetValue());
@@ -163,18 +163,13 @@ void ThreadPlanStepUntil::AnalyzeStop() {
if (this_site->IsBreakpointAtThisSite(m_return_bp_id)) {
// If we are at our "step out" breakpoint, and the stack depth has
- // shrunk, then
- // this is indeed our stop.
- // If the stack depth has grown, then we've hit our step out breakpoint
- // recursively.
- // If we are the only breakpoint at that location, then we do explain
- // the stop, and
- // we'll just continue.
- // If there was another breakpoint here, then we don't explain the stop,
- // but we won't
- // mark ourselves Completed, because maybe that breakpoint will
- // continue, and then
- // we'll finish the "until".
+ // shrunk, then this is indeed our stop. If the stack depth has grown,
+ // then we've hit our step out breakpoint recursively. If we are the
+ // only breakpoint at that location, then we do explain the stop, and
+ // we'll just continue. If there was another breakpoint here, then we
+ // don't explain the stop, but we won't mark ourselves Completed,
+ // because maybe that breakpoint will continue, and then we'll finish
+ // the "until".
bool done;
StackID cur_frame_zero_id;
@@ -209,8 +204,8 @@ void ThreadPlanStepUntil::AnalyzeStop() {
else {
StackFrameSP older_frame_sp = m_thread.GetStackFrameAtIndex(1);
- // But if we can't even unwind one frame we should just get out of
- // here & stop...
+ // But if we can't even unwind one frame we should just get out
+ // of here & stop...
if (older_frame_sp) {
const SymbolContext &older_context =
older_frame_sp->GetSymbolContext(eSymbolContextEverything);
@@ -230,8 +225,8 @@ void ThreadPlanStepUntil::AnalyzeStop() {
// Otherwise we've hit this breakpoint recursively. If we're the
// only breakpoint here, then we do explain the stop, and we'll
- // continue.
- // If not then we should let higher plans handle this stop.
+ // continue. If not then we should let higher plans handle this
+ // stop.
if (this_site->GetNumberOfOwners() == 1)
m_explains_stop = true;
else {
@@ -242,8 +237,8 @@ void ThreadPlanStepUntil::AnalyzeStop() {
}
}
}
- // If we get here we haven't hit any of our breakpoints, so let the higher
- // plans take care of the stop.
+ // If we get here we haven't hit any of our breakpoints, so let the
+ // higher plans take care of the stop.
m_explains_stop = false;
return;
} else if (IsUsuallyUnexplainedStopReason(reason)) {
@@ -256,16 +251,15 @@ void ThreadPlanStepUntil::AnalyzeStop() {
bool ThreadPlanStepUntil::DoPlanExplainsStop(Event *event_ptr) {
// We don't explain signals or breakpoints (breakpoints that handle stepping
- // in or
- // out will be handled by a child plan.
+ // in or out will be handled by a child plan.
AnalyzeStop();
return m_explains_stop;
}
bool ThreadPlanStepUntil::ShouldStop(Event *event_ptr) {
- // If we've told our self in ExplainsStop that we plan to continue, then
- // do so here. Otherwise, as long as this thread has stopped for a reason,
- // we will stop.
+ // If we've told our self in ExplainsStop that we plan to continue, then do
+ // so here. Otherwise, as long as this thread has stopped for a reason, we
+ // will stop.
StopInfoSP stop_info_sp = GetPrivateStopInfo();
if (!stop_info_sp || stop_info_sp->GetStopReason() == eStopReasonNone)
diff --git a/source/Target/ThreadPlanTracer.cpp b/source/Target/ThreadPlanTracer.cpp
index 5057ca0a711b..acbbd4d8bcc2 100644
--- a/source/Target/ThreadPlanTracer.cpp
+++ b/source/Target/ThreadPlanTracer.cpp
@@ -13,6 +13,7 @@
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
+#include "lldb/Core/DumpRegisterValue.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/State.h"
#include "lldb/Core/StreamFile.h"
@@ -217,7 +218,8 @@ void ThreadPlanAssemblyTracer::Log() {
reg_value != m_register_values[reg_num]) {
if (reg_value.GetType() != RegisterValue::eTypeInvalid) {
stream->PutCString("\n\t");
- reg_value.Dump(stream, reg_info, true, false, eFormatDefault);
+ DumpRegisterValue(reg_value, stream, reg_info, true, false,
+ eFormatDefault);
}
}
m_register_values[reg_num] = reg_value;
diff --git a/source/Target/UnixSignals.cpp b/source/Target/UnixSignals.cpp
index 150c6619859f..9cfb1b74adee 100644
--- a/source/Target/UnixSignals.cpp
+++ b/source/Target/UnixSignals.cpp
@@ -66,9 +66,8 @@ UnixSignals::~UnixSignals() = default;
void UnixSignals::Reset() {
// This builds one standard set of Unix Signals. If yours aren't quite in
- // this
- // order, you can either subclass this class, and use Add & Remove to change
- // them
+ // this order, you can either subclass this class, and use Add & Remove to
+ // change them
// or you can subclass and build them afresh in your constructor;
//
// Note: the signals below are the Darwin signals. Do not change these!
@@ -306,8 +305,8 @@ UnixSignals::GetFilteredSignals(llvm::Optional<bool> should_suppress,
bool signal_notify = false;
GetSignalInfo(signo, signal_suppress, signal_stop, signal_notify);
- // If any of filtering conditions are not met,
- // we move on to the next signal.
+ // If any of filtering conditions are not met, we move on to the next
+ // signal.
if (should_suppress.hasValue() &&
signal_suppress != should_suppress.getValue())
continue;
diff --git a/source/Utility/ArchSpec.cpp b/source/Utility/ArchSpec.cpp
index a10fe78260bb..320f2d9d1144 100644
--- a/source/Utility/ArchSpec.cpp
+++ b/source/Utility/ArchSpec.cpp
@@ -9,6 +9,7 @@
#include "lldb/Utility/ArchSpec.h"
+#include "lldb/Utility/Log.h"
#include "lldb/Utility/NameMatches.h"
#include "lldb/Utility/Stream.h" // for Stream
#include "lldb/Utility/StringList.h"
@@ -223,8 +224,8 @@ static const CoreDefinition g_core_definitions[] = {
"kalimba5"}};
// Ensure that we have an entry in the g_core_definitions for each core. If you
-// comment out an entry above,
-// you will need to comment out the corresponding ArchSpec::Core enumeration.
+// comment out an entry above, you will need to comment out the corresponding
+// ArchSpec::Core enumeration.
static_assert(sizeof(g_core_definitions) / sizeof(CoreDefinition) ==
ArchSpec::kNumCores,
"make sure we have one core definition for each core");
@@ -244,17 +245,22 @@ struct ArchDefinition {
const char *name;
};
-size_t ArchSpec::AutoComplete(llvm::StringRef name, StringList &matches) {
- if (!name.empty()) {
+void ArchSpec::ListSupportedArchNames(StringList &list) {
+ for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i)
+ list.AppendString(g_core_definitions[i].name);
+}
+
+size_t ArchSpec::AutoComplete(CompletionRequest &request) {
+ if (!request.GetCursorArgumentPrefix().empty()) {
for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i) {
- if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith, name))
- matches.AppendString(g_core_definitions[i].name);
+ if (NameMatches(g_core_definitions[i].name, NameMatch::StartsWith,
+ request.GetCursorArgumentPrefix()))
+ request.GetMatches().AppendString(g_core_definitions[i].name);
}
} else {
- for (uint32_t i = 0; i < llvm::array_lengthof(g_core_definitions); ++i)
- matches.AppendString(g_core_definitions[i].name);
+ ListSupportedArchNames(request.GetMatches());
}
- return matches.GetSize();
+ return request.GetMatches().GetSize();
}
#define CPU_ANY (UINT32_MAX)
@@ -890,7 +896,12 @@ void ArchSpec::MergeFrom(const ArchSpec &other) {
GetTriple().setOS(other.GetTriple().getOS());
if (GetTriple().getArch() == llvm::Triple::UnknownArch) {
GetTriple().setArch(other.GetTriple().getArch());
- UpdateCore();
+
+ // MachO unknown64 isn't really invalid as the debugger can still obtain
+ // information from the binary, e.g. line tables. As such, we don't update
+ // the core here.
+ if (other.GetCore() != eCore_uknownMach64)
+ UpdateCore();
}
if (GetTriple().getEnvironment() == llvm::Triple::UnknownEnvironment &&
!TripleVendorWasSpecified()) {
@@ -898,9 +909,8 @@ void ArchSpec::MergeFrom(const ArchSpec &other) {
GetTriple().setEnvironment(other.GetTriple().getEnvironment());
}
// If this and other are both arm ArchSpecs and this ArchSpec is a generic
- // "some kind of arm"
- // spec but the other ArchSpec is a specific arm core, adopt the specific arm
- // core.
+ // "some kind of arm" spec but the other ArchSpec is a specific arm core,
+ // adopt the specific arm core.
if (GetTriple().getArch() == llvm::Triple::arm &&
other.GetTriple().getArch() == llvm::Triple::arm &&
IsCompatibleMatch(other) && GetCore() == ArchSpec::eCore_arm_generic &&
@@ -926,24 +936,21 @@ bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
if (core_def) {
m_core = core_def->core;
update_triple = false;
- // Always use the architecture name because it might be more descriptive
- // than the architecture enum ("armv7" -> llvm::Triple::arm).
+ // Always use the architecture name because it might be more
+ // descriptive than the architecture enum ("armv7" ->
+ // llvm::Triple::arm).
m_triple.setArchName(llvm::StringRef(core_def->name));
if (arch_type == eArchTypeMachO) {
m_triple.setVendor(llvm::Triple::Apple);
// Don't set the OS. It could be simulator, macosx, ios, watchos,
- // tvos. We could
- // get close with the cpu type - but we can't get it right all of the
- // time. Better
- // to leave this unset so other sections of code will set it when they
- // have more
- // information.
+ // tvos. We could get close with the cpu type - but we can't get it
+ // right all of the time. Better to leave this unset so other
+ // sections of code will set it when they have more information.
// NB: don't call m_triple.setOS (llvm::Triple::UnknownOS). That sets
// the OSName to
// "unknown" and the ArchSpec::TripleVendorWasSpecified() method says
- // that any
- // OSName setting means it was specified.
+ // that any OSName setting means it was specified.
} else if (arch_type == eArchTypeELF) {
switch (os) {
case llvm::ELF::ELFOSABI_AIX:
@@ -972,10 +979,15 @@ bool ArchSpec::SetArchitecture(ArchitectureType arch_type, uint32_t cpu,
m_triple.setVendor(llvm::Triple::UnknownVendor);
m_triple.setOS(llvm::Triple::UnknownOS);
}
- // Fall back onto setting the machine type if the arch by name failed...
+ // Fall back onto setting the machine type if the arch by name
+ // failed...
if (m_triple.getArch() == llvm::Triple::UnknownArch)
m_triple.setArch(core_def->machine);
}
+ } else {
+ Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_TARGET | LIBLLDB_LOG_PROCESS | LIBLLDB_LOG_PLATFORM));
+ if (log)
+ log->Printf("Unable to find a core definition for cpu 0x%" PRIx32 " sub %" PRId32, cpu, sub);
}
}
CoreUpdated(update_triple);
@@ -1015,10 +1027,9 @@ static bool isCompatibleEnvironment(llvm::Triple::EnvironmentType lhs,
return true;
// If one of the environment is Android and the other one is EABI then they
- // are considered to
- // be compatible. This is required as a workaround for shared libraries
- // compiled for Android
- // without the NOTE section indicating that they are using the Android ABI.
+ // are considered to be compatible. This is required as a workaround for
+ // shared libraries compiled for Android without the NOTE section indicating
+ // that they are using the Android ABI.
if ((lhs == llvm::Triple::Android && rhs == llvm::Triple::EABI) ||
(rhs == llvm::Triple::Android && lhs == llvm::Triple::EABI) ||
(lhs == llvm::Triple::GNUEABI && rhs == llvm::Triple::EABI) ||
@@ -1050,8 +1061,8 @@ bool ArchSpec::IsEqualTo(const ArchSpec &rhs, bool exact_match) const {
if (lhs_triple_vendor != rhs_triple_vendor) {
const bool rhs_vendor_specified = rhs.TripleVendorWasSpecified();
const bool lhs_vendor_specified = TripleVendorWasSpecified();
- // Both architectures had the vendor specified, so if they aren't
- // equal then we return false
+ // Both architectures had the vendor specified, so if they aren't equal
+ // then we return false
if (rhs_vendor_specified && lhs_vendor_specified)
return false;
@@ -1066,8 +1077,8 @@ bool ArchSpec::IsEqualTo(const ArchSpec &rhs, bool exact_match) const {
if (lhs_triple_os != rhs_triple_os) {
const bool rhs_os_specified = rhs.TripleOSWasSpecified();
const bool lhs_os_specified = TripleOSWasSpecified();
- // Both architectures had the OS specified, so if they aren't
- // equal then we return false
+ // Both architectures had the OS specified, so if they aren't equal then
+ // we return false
if (rhs_os_specified && lhs_os_specified)
return false;
@@ -1094,9 +1105,9 @@ void ArchSpec::UpdateCore() {
const CoreDefinition *core_def = FindCoreDefinition(arch_name);
if (core_def) {
m_core = core_def->core;
- // Set the byte order to the default byte order for an architecture.
- // This can be modified if needed for cases when cores handle both
- // big and little endian
+ // Set the byte order to the default byte order for an architecture. This
+ // can be modified if needed for cases when cores handle both big and
+ // little endian
m_byte_order = core_def->default_byte_order;
} else {
Clear();
@@ -1193,9 +1204,8 @@ static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2,
break;
// v. https://en.wikipedia.org/wiki/ARM_Cortex-M#Silicon_customization
- // Cortex-M0 - ARMv6-M - armv6m
- // Cortex-M3 - ARMv7-M - armv7m
- // Cortex-M4 - ARMv7E-M - armv7em
+ // Cortex-M0 - ARMv6-M - armv6m Cortex-M3 - ARMv7-M - armv7m Cortex-M4 -
+ // ARMv7E-M - armv7em
case ArchSpec::eCore_arm_armv7em:
if (!enforce_exact_match) {
if (core2 == ArchSpec::eCore_arm_generic)
@@ -1211,9 +1221,8 @@ static bool cores_match(const ArchSpec::Core core1, const ArchSpec::Core core2,
break;
// v. https://en.wikipedia.org/wiki/ARM_Cortex-M#Silicon_customization
- // Cortex-M0 - ARMv6-M - armv6m
- // Cortex-M3 - ARMv7-M - armv7m
- // Cortex-M4 - ARMv7E-M - armv7em
+ // Cortex-M0 - ARMv6-M - armv6m Cortex-M3 - ARMv7-M - armv7m Cortex-M4 -
+ // ARMv7E-M - armv7em
case ArchSpec::eCore_arm_armv7m:
if (!enforce_exact_match) {
if (core2 == ArchSpec::eCore_arm_generic)
@@ -1411,6 +1420,11 @@ bool lldb_private::operator<(const ArchSpec &lhs, const ArchSpec &rhs) {
return lhs_core < rhs_core;
}
+
+bool lldb_private::operator==(const ArchSpec &lhs, const ArchSpec &rhs) {
+ return lhs.GetCore() == rhs.GetCore();
+}
+
bool ArchSpec::IsFullySpecifiedTriple() const {
const auto &user_specified_triple = GetTriple();
@@ -1456,9 +1470,8 @@ bool ArchSpec::IsAlwaysThumbInstructions() const {
// Cortex-M0 through Cortex-M7 are ARM processor cores which can only
// execute thumb instructions. We map the cores to arch names like this:
//
- // Cortex-M0, Cortex-M0+, Cortex-M1: armv6m
- // Cortex-M3: armv7m
- // Cortex-M4, Cortex-M7: armv7em
+ // Cortex-M0, Cortex-M0+, Cortex-M1: armv6m Cortex-M3: armv7m Cortex-M4,
+ // Cortex-M7: armv7em
if (GetCore() == ArchSpec::Core::eCore_arm_armv7m ||
GetCore() == ArchSpec::Core::eCore_arm_armv7em ||
diff --git a/source/Utility/Args.cpp b/source/Utility/Args.cpp
new file mode 100644
index 000000000000..3b5cf1715fb3
--- /dev/null
+++ b/source/Utility/Args.cpp
@@ -0,0 +1,726 @@
+//===-- Args.cpp ------------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/ConstString.h"
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StringList.h"
+#include "llvm/ADT/StringSwitch.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+// A helper function for argument parsing.
+// Parses the initial part of the first argument using normal double quote
+// rules: backslash escapes the double quote and itself. The parsed string is
+// appended to the second argument. The function returns the unparsed portion
+// of the string, starting at the closing quote.
+static llvm::StringRef ParseDoubleQuotes(llvm::StringRef quoted,
+ std::string &result) {
+ // Inside double quotes, '\' and '"' are special.
+ static const char *k_escapable_characters = "\"\\";
+ while (true) {
+ // Skip over over regular characters and append them.
+ size_t regular = quoted.find_first_of(k_escapable_characters);
+ result += quoted.substr(0, regular);
+ quoted = quoted.substr(regular);
+
+ // If we have reached the end of string or the closing quote, we're done.
+ if (quoted.empty() || quoted.front() == '"')
+ break;
+
+ // We have found a backslash.
+ quoted = quoted.drop_front();
+
+ if (quoted.empty()) {
+ // A lone backslash at the end of string, let's just append it.
+ result += '\\';
+ break;
+ }
+
+ // If the character after the backslash is not a whitelisted escapable
+ // character, we leave the character sequence untouched.
+ if (strchr(k_escapable_characters, quoted.front()) == nullptr)
+ result += '\\';
+
+ result += quoted.front();
+ quoted = quoted.drop_front();
+ }
+
+ return quoted;
+}
+
+static size_t ArgvToArgc(const char **argv) {
+ if (!argv)
+ return 0;
+ size_t count = 0;
+ while (*argv++)
+ ++count;
+ return count;
+}
+
+// Trims all whitespace that can separate command line arguments from the left
+// side of the string.
+static llvm::StringRef ltrimForArgs(llvm::StringRef str) {
+ static const char *k_space_separators = " \t";
+ return str.ltrim(k_space_separators);
+}
+
+// A helper function for SetCommandString. Parses a single argument from the
+// command string, processing quotes and backslashes in a shell-like manner.
+// The function returns a tuple consisting of the parsed argument, the quote
+// char used, and the unparsed portion of the string starting at the first
+// unqouted, unescaped whitespace character.
+static std::tuple<std::string, char, llvm::StringRef>
+ParseSingleArgument(llvm::StringRef command) {
+ // Argument can be split into multiple discontiguous pieces, for example:
+ // "Hello ""World"
+ // this would result in a single argument "Hello World" (without the quotes)
+ // since the quotes would be removed and there is not space between the
+ // strings.
+ std::string arg;
+
+ // Since we can have multiple quotes that form a single command in a command
+ // like: "Hello "world'!' (which will make a single argument "Hello world!")
+ // we remember the first quote character we encounter and use that for the
+ // quote character.
+ char first_quote_char = '\0';
+
+ bool arg_complete = false;
+ do {
+ // Skip over over regular characters and append them.
+ size_t regular = command.find_first_of(" \t\"'`\\");
+ arg += command.substr(0, regular);
+ command = command.substr(regular);
+
+ if (command.empty())
+ break;
+
+ char special = command.front();
+ command = command.drop_front();
+ switch (special) {
+ case '\\':
+ if (command.empty()) {
+ arg += '\\';
+ break;
+ }
+
+ // If the character after the backslash is not a whitelisted escapable
+ // character, we leave the character sequence untouched.
+ if (strchr(" \t\\'\"`", command.front()) == nullptr)
+ arg += '\\';
+
+ arg += command.front();
+ command = command.drop_front();
+
+ break;
+
+ case ' ':
+ case '\t':
+ // We are not inside any quotes, we just found a space after an argument.
+ // We are done.
+ arg_complete = true;
+ break;
+
+ case '"':
+ case '\'':
+ case '`':
+ // We found the start of a quote scope.
+ if (first_quote_char == '\0')
+ first_quote_char = special;
+
+ if (special == '"')
+ command = ParseDoubleQuotes(command, arg);
+ else {
+ // For single quotes, we simply skip ahead to the matching quote
+ // character (or the end of the string).
+ size_t quoted = command.find(special);
+ arg += command.substr(0, quoted);
+ command = command.substr(quoted);
+ }
+
+ // If we found a closing quote, skip it.
+ if (!command.empty())
+ command = command.drop_front();
+
+ break;
+ }
+ } while (!arg_complete);
+
+ return std::make_tuple(arg, first_quote_char, command);
+}
+
+Args::ArgEntry::ArgEntry(llvm::StringRef str, char quote) : quote(quote) {
+ size_t size = str.size();
+ ptr.reset(new char[size + 1]);
+
+ ::memcpy(data(), str.data() ? str.data() : "", size);
+ ptr[size] = 0;
+ ref = llvm::StringRef(c_str(), size);
+}
+
+//----------------------------------------------------------------------
+// Args constructor
+//----------------------------------------------------------------------
+Args::Args(llvm::StringRef command) { SetCommandString(command); }
+
+Args::Args(const Args &rhs) { *this = rhs; }
+
+Args::Args(const StringList &list) : Args() {
+ for (size_t i = 0; i < list.GetSize(); ++i)
+ AppendArgument(list[i]);
+}
+
+Args &Args::operator=(const Args &rhs) {
+ Clear();
+
+ m_argv.clear();
+ m_entries.clear();
+ for (auto &entry : rhs.m_entries) {
+ m_entries.emplace_back(entry.ref, entry.quote);
+ m_argv.push_back(m_entries.back().data());
+ }
+ m_argv.push_back(nullptr);
+ return *this;
+}
+
+//----------------------------------------------------------------------
+// Destructor
+//----------------------------------------------------------------------
+Args::~Args() {}
+
+void Args::Dump(Stream &s, const char *label_name) const {
+ if (!label_name)
+ return;
+
+ int i = 0;
+ for (auto &entry : m_entries) {
+ s.Indent();
+ s.Format("{0}[{1}]=\"{2}\"\n", label_name, i++, entry.ref);
+ }
+ s.Format("{0}[{1}]=NULL\n", label_name, i);
+ s.EOL();
+}
+
+bool Args::GetCommandString(std::string &command) const {
+ command.clear();
+
+ for (size_t i = 0; i < m_entries.size(); ++i) {
+ if (i > 0)
+ command += ' ';
+ command += m_entries[i].ref;
+ }
+
+ return !m_entries.empty();
+}
+
+bool Args::GetQuotedCommandString(std::string &command) const {
+ command.clear();
+
+ for (size_t i = 0; i < m_entries.size(); ++i) {
+ if (i > 0)
+ command += ' ';
+
+ if (m_entries[i].quote) {
+ command += m_entries[i].quote;
+ command += m_entries[i].ref;
+ command += m_entries[i].quote;
+ } else {
+ command += m_entries[i].ref;
+ }
+ }
+
+ return !m_entries.empty();
+}
+
+void Args::SetCommandString(llvm::StringRef command) {
+ Clear();
+ m_argv.clear();
+
+ command = ltrimForArgs(command);
+ std::string arg;
+ char quote;
+ while (!command.empty()) {
+ std::tie(arg, quote, command) = ParseSingleArgument(command);
+ m_entries.emplace_back(arg, quote);
+ m_argv.push_back(m_entries.back().data());
+ command = ltrimForArgs(command);
+ }
+ m_argv.push_back(nullptr);
+}
+
+size_t Args::GetArgumentCount() const { return m_entries.size(); }
+
+const char *Args::GetArgumentAtIndex(size_t idx) const {
+ if (idx < m_argv.size())
+ return m_argv[idx];
+ return nullptr;
+}
+
+char Args::GetArgumentQuoteCharAtIndex(size_t idx) const {
+ if (idx < m_entries.size())
+ return m_entries[idx].quote;
+ return '\0';
+}
+
+char **Args::GetArgumentVector() {
+ assert(!m_argv.empty());
+ // TODO: functions like execve and posix_spawnp exhibit undefined behavior
+ // when argv or envp is null. So the code below is actually wrong. However,
+ // other code in LLDB depends on it being null. The code has been acting
+ // this way for some time, so it makes sense to leave it this way until
+ // someone has the time to come along and fix it.
+ return (m_argv.size() > 1) ? m_argv.data() : nullptr;
+}
+
+const char **Args::GetConstArgumentVector() const {
+ assert(!m_argv.empty());
+ return (m_argv.size() > 1) ? const_cast<const char **>(m_argv.data())
+ : nullptr;
+}
+
+void Args::Shift() {
+ // Don't pop the last NULL terminator from the argv array
+ if (m_entries.empty())
+ return;
+ m_argv.erase(m_argv.begin());
+ m_entries.erase(m_entries.begin());
+}
+
+void Args::Unshift(llvm::StringRef arg_str, char quote_char) {
+ InsertArgumentAtIndex(0, arg_str, quote_char);
+}
+
+void Args::AppendArguments(const Args &rhs) {
+ assert(m_argv.size() == m_entries.size() + 1);
+ assert(m_argv.back() == nullptr);
+ m_argv.pop_back();
+ for (auto &entry : rhs.m_entries) {
+ m_entries.emplace_back(entry.ref, entry.quote);
+ m_argv.push_back(m_entries.back().data());
+ }
+ m_argv.push_back(nullptr);
+}
+
+void Args::AppendArguments(const char **argv) {
+ size_t argc = ArgvToArgc(argv);
+
+ assert(m_argv.size() == m_entries.size() + 1);
+ assert(m_argv.back() == nullptr);
+ m_argv.pop_back();
+ for (auto arg : llvm::makeArrayRef(argv, argc)) {
+ m_entries.emplace_back(arg, '\0');
+ m_argv.push_back(m_entries.back().data());
+ }
+
+ m_argv.push_back(nullptr);
+}
+
+void Args::AppendArgument(llvm::StringRef arg_str, char quote_char) {
+ InsertArgumentAtIndex(GetArgumentCount(), arg_str, quote_char);
+}
+
+void Args::InsertArgumentAtIndex(size_t idx, llvm::StringRef arg_str,
+ char quote_char) {
+ assert(m_argv.size() == m_entries.size() + 1);
+ assert(m_argv.back() == nullptr);
+
+ if (idx > m_entries.size())
+ return;
+ m_entries.emplace(m_entries.begin() + idx, arg_str, quote_char);
+ m_argv.insert(m_argv.begin() + idx, m_entries[idx].data());
+}
+
+void Args::ReplaceArgumentAtIndex(size_t idx, llvm::StringRef arg_str,
+ char quote_char) {
+ assert(m_argv.size() == m_entries.size() + 1);
+ assert(m_argv.back() == nullptr);
+
+ if (idx >= m_entries.size())
+ return;
+
+ if (arg_str.size() > m_entries[idx].ref.size()) {
+ m_entries[idx] = ArgEntry(arg_str, quote_char);
+ m_argv[idx] = m_entries[idx].data();
+ } else {
+ const char *src_data = arg_str.data() ? arg_str.data() : "";
+ ::memcpy(m_entries[idx].data(), src_data, arg_str.size());
+ m_entries[idx].ptr[arg_str.size()] = 0;
+ m_entries[idx].ref = m_entries[idx].ref.take_front(arg_str.size());
+ }
+}
+
+void Args::DeleteArgumentAtIndex(size_t idx) {
+ if (idx >= m_entries.size())
+ return;
+
+ m_argv.erase(m_argv.begin() + idx);
+ m_entries.erase(m_entries.begin() + idx);
+}
+
+void Args::SetArguments(size_t argc, const char **argv) {
+ Clear();
+
+ auto args = llvm::makeArrayRef(argv, argc);
+ m_entries.resize(argc);
+ m_argv.resize(argc + 1);
+ for (size_t i = 0; i < args.size(); ++i) {
+ char quote =
+ ((args[i][0] == '\'') || (args[i][0] == '"') || (args[i][0] == '`'))
+ ? args[i][0]
+ : '\0';
+
+ m_entries[i] = ArgEntry(args[i], quote);
+ m_argv[i] = m_entries[i].data();
+ }
+}
+
+void Args::SetArguments(const char **argv) {
+ SetArguments(ArgvToArgc(argv), argv);
+}
+
+void Args::Clear() {
+ m_entries.clear();
+ m_argv.clear();
+ m_argv.push_back(nullptr);
+}
+
+const char *Args::StripSpaces(std::string &s, bool leading, bool trailing,
+ bool return_null_if_empty) {
+ static const char *k_white_space = " \t\v";
+ if (!s.empty()) {
+ if (leading) {
+ size_t pos = s.find_first_not_of(k_white_space);
+ if (pos == std::string::npos)
+ s.clear();
+ else if (pos > 0)
+ s.erase(0, pos);
+ }
+
+ if (trailing) {
+ size_t rpos = s.find_last_not_of(k_white_space);
+ if (rpos != std::string::npos && rpos + 1 < s.size())
+ s.erase(rpos + 1);
+ }
+ }
+ if (return_null_if_empty && s.empty())
+ return nullptr;
+ return s.c_str();
+}
+
+const char *Args::GetShellSafeArgument(const FileSpec &shell,
+ const char *unsafe_arg,
+ std::string &safe_arg) {
+ struct ShellDescriptor {
+ ConstString m_basename;
+ const char *m_escapables;
+ };
+
+ static ShellDescriptor g_Shells[] = {{ConstString("bash"), " '\"<>()&"},
+ {ConstString("tcsh"), " '\"<>()&$"},
+ {ConstString("sh"), " '\"<>()&"}};
+
+ // safe minimal set
+ const char *escapables = " '\"";
+
+ if (auto basename = shell.GetFilename()) {
+ for (const auto &Shell : g_Shells) {
+ if (Shell.m_basename == basename) {
+ escapables = Shell.m_escapables;
+ break;
+ }
+ }
+ }
+
+ safe_arg.assign(unsafe_arg);
+ size_t prev_pos = 0;
+ while (prev_pos < safe_arg.size()) {
+ // Escape spaces and quotes
+ size_t pos = safe_arg.find_first_of(escapables, prev_pos);
+ if (pos != std::string::npos) {
+ safe_arg.insert(pos, 1, '\\');
+ prev_pos = pos + 2;
+ } else
+ break;
+ }
+ return safe_arg.c_str();
+}
+
+lldb::Encoding Args::StringToEncoding(llvm::StringRef s,
+ lldb::Encoding fail_value) {
+ return llvm::StringSwitch<lldb::Encoding>(s)
+ .Case("uint", eEncodingUint)
+ .Case("sint", eEncodingSint)
+ .Case("ieee754", eEncodingIEEE754)
+ .Case("vector", eEncodingVector)
+ .Default(fail_value);
+}
+
+uint32_t Args::StringToGenericRegister(llvm::StringRef s) {
+ if (s.empty())
+ return LLDB_INVALID_REGNUM;
+ uint32_t result = llvm::StringSwitch<uint32_t>(s)
+ .Case("pc", LLDB_REGNUM_GENERIC_PC)
+ .Case("sp", LLDB_REGNUM_GENERIC_SP)
+ .Case("fp", LLDB_REGNUM_GENERIC_FP)
+ .Cases("ra", "lr", LLDB_REGNUM_GENERIC_RA)
+ .Case("flags", LLDB_REGNUM_GENERIC_FLAGS)
+ .Case("arg1", LLDB_REGNUM_GENERIC_ARG1)
+ .Case("arg2", LLDB_REGNUM_GENERIC_ARG2)
+ .Case("arg3", LLDB_REGNUM_GENERIC_ARG3)
+ .Case("arg4", LLDB_REGNUM_GENERIC_ARG4)
+ .Case("arg5", LLDB_REGNUM_GENERIC_ARG5)
+ .Case("arg6", LLDB_REGNUM_GENERIC_ARG6)
+ .Case("arg7", LLDB_REGNUM_GENERIC_ARG7)
+ .Case("arg8", LLDB_REGNUM_GENERIC_ARG8)
+ .Default(LLDB_INVALID_REGNUM);
+ return result;
+}
+
+void Args::EncodeEscapeSequences(const char *src, std::string &dst) {
+ dst.clear();
+ if (src) {
+ for (const char *p = src; *p != '\0'; ++p) {
+ size_t non_special_chars = ::strcspn(p, "\\");
+ if (non_special_chars > 0) {
+ dst.append(p, non_special_chars);
+ p += non_special_chars;
+ if (*p == '\0')
+ break;
+ }
+
+ if (*p == '\\') {
+ ++p; // skip the slash
+ switch (*p) {
+ case 'a':
+ dst.append(1, '\a');
+ break;
+ case 'b':
+ dst.append(1, '\b');
+ break;
+ case 'f':
+ dst.append(1, '\f');
+ break;
+ case 'n':
+ dst.append(1, '\n');
+ break;
+ case 'r':
+ dst.append(1, '\r');
+ break;
+ case 't':
+ dst.append(1, '\t');
+ break;
+ case 'v':
+ dst.append(1, '\v');
+ break;
+ case '\\':
+ dst.append(1, '\\');
+ break;
+ case '\'':
+ dst.append(1, '\'');
+ break;
+ case '"':
+ dst.append(1, '"');
+ break;
+ case '0':
+ // 1 to 3 octal chars
+ {
+ // Make a string that can hold onto the initial zero char, up to 3
+ // octal digits, and a terminating NULL.
+ char oct_str[5] = {'\0', '\0', '\0', '\0', '\0'};
+
+ int i;
+ for (i = 0; (p[i] >= '0' && p[i] <= '7') && i < 4; ++i)
+ oct_str[i] = p[i];
+
+ // We don't want to consume the last octal character since the main
+ // for loop will do this for us, so we advance p by one less than i
+ // (even if i is zero)
+ p += i - 1;
+ unsigned long octal_value = ::strtoul(oct_str, nullptr, 8);
+ if (octal_value <= UINT8_MAX) {
+ dst.append(1, (char)octal_value);
+ }
+ }
+ break;
+
+ case 'x':
+ // hex number in the format
+ if (isxdigit(p[1])) {
+ ++p; // Skip the 'x'
+
+ // Make a string that can hold onto two hex chars plus a
+ // NULL terminator
+ char hex_str[3] = {*p, '\0', '\0'};
+ if (isxdigit(p[1])) {
+ ++p; // Skip the first of the two hex chars
+ hex_str[1] = *p;
+ }
+
+ unsigned long hex_value = strtoul(hex_str, nullptr, 16);
+ if (hex_value <= UINT8_MAX)
+ dst.append(1, (char)hex_value);
+ } else {
+ dst.append(1, 'x');
+ }
+ break;
+
+ default:
+ // Just desensitize any other character by just printing what came
+ // after the '\'
+ dst.append(1, *p);
+ break;
+ }
+ }
+ }
+ }
+}
+
+void Args::ExpandEscapedCharacters(const char *src, std::string &dst) {
+ dst.clear();
+ if (src) {
+ for (const char *p = src; *p != '\0'; ++p) {
+ if (isprint(*p))
+ dst.append(1, *p);
+ else {
+ switch (*p) {
+ case '\a':
+ dst.append("\\a");
+ break;
+ case '\b':
+ dst.append("\\b");
+ break;
+ case '\f':
+ dst.append("\\f");
+ break;
+ case '\n':
+ dst.append("\\n");
+ break;
+ case '\r':
+ dst.append("\\r");
+ break;
+ case '\t':
+ dst.append("\\t");
+ break;
+ case '\v':
+ dst.append("\\v");
+ break;
+ case '\'':
+ dst.append("\\'");
+ break;
+ case '"':
+ dst.append("\\\"");
+ break;
+ case '\\':
+ dst.append("\\\\");
+ break;
+ default: {
+ // Just encode as octal
+ dst.append("\\0");
+ char octal_str[32];
+ snprintf(octal_str, sizeof(octal_str), "%o", *p);
+ dst.append(octal_str);
+ } break;
+ }
+ }
+ }
+ }
+}
+
+std::string Args::EscapeLLDBCommandArgument(const std::string &arg,
+ char quote_char) {
+ const char *chars_to_escape = nullptr;
+ switch (quote_char) {
+ case '\0':
+ chars_to_escape = " \t\\'\"`";
+ break;
+ case '\'':
+ chars_to_escape = "";
+ break;
+ case '"':
+ chars_to_escape = "$\"`\\";
+ break;
+ default:
+ assert(false && "Unhandled quote character");
+ }
+
+ std::string res;
+ res.reserve(arg.size());
+ for (char c : arg) {
+ if (::strchr(chars_to_escape, c))
+ res.push_back('\\');
+ res.push_back(c);
+ }
+ return res;
+}
+
+OptionsWithRaw::OptionsWithRaw(llvm::StringRef arg_string) {
+ SetFromString(arg_string);
+}
+
+void OptionsWithRaw::SetFromString(llvm::StringRef arg_string) {
+ const llvm::StringRef original_args = arg_string;
+
+ arg_string = ltrimForArgs(arg_string);
+ std::string arg;
+ char quote;
+
+ // If the string doesn't start with a dash, we just have no options and just
+ // a raw part.
+ if (!arg_string.startswith("-")) {
+ m_suffix = original_args;
+ return;
+ }
+
+ bool found_suffix = false;
+
+ while (!arg_string.empty()) {
+ // The length of the prefix before parsing.
+ std::size_t prev_prefix_length = original_args.size() - arg_string.size();
+
+ // Parse the next argument from the remaining string.
+ std::tie(arg, quote, arg_string) = ParseSingleArgument(arg_string);
+
+ // If we get an unquoted '--' argument, then we reached the suffix part
+ // of the command.
+ Args::ArgEntry entry(arg, quote);
+ if (!entry.IsQuoted() && arg == "--") {
+ // The remaining line is the raw suffix, and the line we parsed so far
+ // needs to be interpreted as arguments.
+ m_has_args = true;
+ m_suffix = arg_string;
+ found_suffix = true;
+
+ // The length of the prefix after parsing.
+ std::size_t prefix_length = original_args.size() - arg_string.size();
+
+ // Take the string we know contains all the arguments and actually parse
+ // it as proper arguments.
+ llvm::StringRef prefix = original_args.take_front(prev_prefix_length);
+ m_args = Args(prefix);
+ m_arg_string = prefix;
+
+ // We also record the part of the string that contains the arguments plus
+ // the delimiter.
+ m_arg_string_with_delimiter = original_args.take_front(prefix_length);
+
+ // As the rest of the string became the raw suffix, we are done here.
+ break;
+ }
+
+ arg_string = ltrimForArgs(arg_string);
+ }
+
+ // If we didn't find a suffix delimiter, the whole string is the raw suffix.
+ if (!found_suffix) {
+ found_suffix = true;
+ m_suffix = original_args;
+ }
+}
diff --git a/source/Utility/CMakeLists.txt b/source/Utility/CMakeLists.txt
index 1a0fb6f86c57..91f3c8773731 100644
--- a/source/Utility/CMakeLists.txt
+++ b/source/Utility/CMakeLists.txt
@@ -41,16 +41,18 @@ endif()
add_lldb_library(lldbUtility
ArchSpec.cpp
+ Args.cpp
Baton.cpp
Connection.cpp
ConstString.cpp
+ CompletionRequest.cpp
DataBufferHeap.cpp
DataBufferLLVM.cpp
DataEncoder.cpp
DataExtractor.cpp
+ Environment.cpp
FastDemangle.cpp
FileSpec.cpp
- History.cpp
IOObject.cpp
JSON.cpp
LLDBAssert.cpp
diff --git a/source/Utility/CompletionRequest.cpp b/source/Utility/CompletionRequest.cpp
new file mode 100644
index 000000000000..1b7697a35860
--- /dev/null
+++ b/source/Utility/CompletionRequest.cpp
@@ -0,0 +1,59 @@
+//===-- CompletionRequest.cpp -----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/CompletionRequest.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+CompletionRequest::CompletionRequest(llvm::StringRef command_line,
+ unsigned raw_cursor_pos,
+ int match_start_point,
+ int max_return_elements,
+ StringList &matches)
+ : m_command(command_line), m_raw_cursor_pos(raw_cursor_pos),
+ m_match_start_point(match_start_point),
+ m_max_return_elements(max_return_elements), m_matches(&matches) {
+
+ // We parse the argument up to the cursor, so the last argument in
+ // parsed_line is the one containing the cursor, and the cursor is after the
+ // last character.
+ m_parsed_line = Args(command_line);
+ m_partial_parsed_line = Args(command_line.substr(0, raw_cursor_pos));
+
+ m_cursor_index = m_partial_parsed_line.GetArgumentCount() - 1;
+
+ if (m_cursor_index == -1)
+ m_cursor_char_position = 0;
+ else
+ m_cursor_char_position =
+ strlen(m_partial_parsed_line.GetArgumentAtIndex(m_cursor_index));
+
+ matches.Clear();
+
+ const char *cursor = command_line.data() + raw_cursor_pos;
+ if (raw_cursor_pos > 0 && cursor[-1] == ' ') {
+ // We are just after a space. If we are in an argument, then we will
+ // continue parsing, but if we are between arguments, then we have to
+ // complete whatever the next element would be. We can distinguish the two
+ // cases because if we are in an argument (e.g. because the space is
+ // protected by a quote) then the space will also be in the parsed
+ // argument...
+
+ const char *current_elem =
+ m_partial_parsed_line.GetArgumentAtIndex(m_cursor_index);
+ if (m_cursor_char_position == 0 ||
+ current_elem[m_cursor_char_position - 1] != ' ') {
+ m_parsed_line.InsertArgumentAtIndex(m_cursor_index + 1, llvm::StringRef(),
+ '\0');
+ m_cursor_index++;
+ m_cursor_char_position = 0;
+ }
+ }
+}
diff --git a/source/Utility/ConstString.cpp b/source/Utility/ConstString.cpp
index 49cf8a6d864d..5ef4b2faa3b8 100644
--- a/source/Utility/ConstString.cpp
+++ b/source/Utility/ConstString.cpp
@@ -11,10 +11,10 @@
#include "lldb/Utility/Stream.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/iterator.h" // for iterator_facade_base
#include "llvm/Support/Allocator.h" // for BumpPtrAllocator
+#include "llvm/Support/DJB.h" // for djbHash
#include "llvm/Support/FormatProviders.h" // for format_provider
#include "llvm/Support/RWMutex.h"
#include "llvm/Support/Threading.h"
@@ -43,8 +43,8 @@ public:
static size_t GetConstCStringLength(const char *ccstr) {
if (ccstr != nullptr) {
- // Since the entry is read only, and we derive the entry entirely from the
- // pointer, we don't need the lock.
+ // Since the entry is read only, and we derive the entry entirely from
+ // the pointer, we don't need the lock.
const StringPoolEntryType &entry = GetStringMapEntryFromKeyData(ccstr);
return entry.getKey().size();
}
@@ -155,9 +155,8 @@ public:
}
//------------------------------------------------------------------
- // Return the size in bytes that this object and any items in its
- // collection of uniqued strings + data count values takes in
- // memory.
+ // Return the size in bytes that this object and any items in its collection
+ // of uniqued strings + data count values takes in memory.
//------------------------------------------------------------------
size_t MemorySize() const {
size_t mem_size = sizeof(Pool);
@@ -171,7 +170,7 @@ public:
protected:
uint8_t hash(const llvm::StringRef &s) const {
- uint32_t h = llvm::HashString(s);
+ uint32_t h = llvm::djbHash(s);
return ((h >> 24) ^ (h >> 16) ^ (h >> 8) ^ h) & 0xff;
}
@@ -184,15 +183,14 @@ protected:
};
//----------------------------------------------------------------------
-// Frameworks and dylibs aren't supposed to have global C++
-// initializers so we hide the string pool in a static function so
-// that it will get initialized on the first call to this static
-// function.
+// Frameworks and dylibs aren't supposed to have global C++ initializers so we
+// hide the string pool in a static function so that it will get initialized on
+// the first call to this static function.
//
-// Note, for now we make the string pool a pointer to the pool, because
-// we can't guarantee that some objects won't get destroyed after the
-// global destructor chain is run, and trying to make sure no destructors
-// touch ConstStrings is difficult. So we leak the pool instead.
+// Note, for now we make the string pool a pointer to the pool, because we
+// can't guarantee that some objects won't get destroyed after the global
+// destructor chain is run, and trying to make sure no destructors touch
+// ConstStrings is difficult. So we leak the pool instead.
//----------------------------------------------------------------------
static Pool &StringPool() {
static llvm::once_flag g_pool_initialization_flag;
@@ -246,8 +244,8 @@ bool ConstString::Equals(const ConstString &lhs, const ConstString &rhs,
return true;
// Since the pointers weren't equal, and identical ConstStrings always have
- // identical pointers,
- // the result must be false for case sensitive equality test.
+ // identical pointers, the result must be false for case sensitive equality
+ // test.
if (case_sensitive)
return false;
diff --git a/source/Utility/DataBufferHeap.cpp b/source/Utility/DataBufferHeap.cpp
index aa1c3d37ae62..e686ee8d35e5 100644
--- a/source/Utility/DataBufferHeap.cpp
+++ b/source/Utility/DataBufferHeap.cpp
@@ -22,8 +22,7 @@ using namespace lldb_private;
DataBufferHeap::DataBufferHeap() : m_data() {}
//----------------------------------------------------------------------
-// Initialize this class with "n" characters and fill the buffer
-// with "ch".
+// Initialize this class with "n" characters and fill the buffer with "ch".
//----------------------------------------------------------------------
DataBufferHeap::DataBufferHeap(lldb::offset_t n, uint8_t ch) : m_data() {
if (n < m_data.max_size())
@@ -31,8 +30,7 @@ DataBufferHeap::DataBufferHeap(lldb::offset_t n, uint8_t ch) : m_data() {
}
//----------------------------------------------------------------------
-// Initialize this class with a copy of the "n" bytes from the "bytes"
-// buffer.
+// Initialize this class with a copy of the "n" bytes from the "bytes" buffer.
//----------------------------------------------------------------------
DataBufferHeap::DataBufferHeap(const void *src, lldb::offset_t src_len)
: m_data() {
@@ -40,22 +38,21 @@ DataBufferHeap::DataBufferHeap(const void *src, lldb::offset_t src_len)
}
//----------------------------------------------------------------------
-// Virtual destructor since this class inherits from a pure virtual
-// base class.
+// Virtual destructor since this class inherits from a pure virtual base class.
//----------------------------------------------------------------------
DataBufferHeap::~DataBufferHeap() = default;
//----------------------------------------------------------------------
-// Return a pointer to the bytes owned by this object, or nullptr if
-// the object contains no bytes.
+// Return a pointer to the bytes owned by this object, or nullptr if the object
+// contains no bytes.
//----------------------------------------------------------------------
uint8_t *DataBufferHeap::GetBytes() {
return (m_data.empty() ? nullptr : m_data.data());
}
//----------------------------------------------------------------------
-// Return a const pointer to the bytes owned by this object, or nullptr
-// if the object contains no bytes.
+// Return a const pointer to the bytes owned by this object, or nullptr if the
+// object contains no bytes.
//----------------------------------------------------------------------
const uint8_t *DataBufferHeap::GetBytes() const {
return (m_data.empty() ? nullptr : m_data.data());
@@ -67,8 +64,8 @@ const uint8_t *DataBufferHeap::GetBytes() const {
uint64_t DataBufferHeap::GetByteSize() const { return m_data.size(); }
//----------------------------------------------------------------------
-// Sets the number of bytes that this object should be able to
-// contain. This can be used prior to copying data into the buffer.
+// Sets the number of bytes that this object should be able to contain. This
+// can be used prior to copying data into the buffer.
//----------------------------------------------------------------------
uint64_t DataBufferHeap::SetByteSize(uint64_t new_size) {
m_data.resize(new_size);
diff --git a/source/Utility/DataEncoder.cpp b/source/Utility/DataEncoder.cpp
index 433a15bc9523..7edee3c2f279 100644
--- a/source/Utility/DataEncoder.cpp
+++ b/source/Utility/DataEncoder.cpp
@@ -34,8 +34,8 @@ DataEncoder::DataEncoder()
m_data_sp() {}
//----------------------------------------------------------------------
-// This constructor allows us to use data that is owned by someone else.
-// The data must stay around as long as this object is valid.
+// This constructor allows us to use data that is owned by someone else. The
+// data must stay around as long as this object is valid.
//----------------------------------------------------------------------
DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian,
uint8_t addr_size)
@@ -43,11 +43,10 @@ DataEncoder::DataEncoder(void *data, uint32_t length, ByteOrder endian,
m_byte_order(endian), m_addr_size(addr_size), m_data_sp() {}
//----------------------------------------------------------------------
-// Make a shared pointer reference to the shared data in "data_sp" and
-// set the endian swapping setting to "swap", and the address size to
-// "addr_size". The shared data reference will ensure the data lives
-// as long as any DataEncoder objects exist that have a reference to
-// this data.
+// Make a shared pointer reference to the shared data in "data_sp" and set the
+// endian swapping setting to "swap", and the address size to "addr_size". The
+// shared data reference will ensure the data lives as long as any DataEncoder
+// objects exist that have a reference to this data.
//----------------------------------------------------------------------
DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian,
uint8_t addr_size)
@@ -59,9 +58,8 @@ DataEncoder::DataEncoder(const DataBufferSP &data_sp, ByteOrder endian,
DataEncoder::~DataEncoder() = default;
//------------------------------------------------------------------
-// Clears the object contents back to a default invalid state, and
-// release any references to shared data that this object may
-// contain.
+// Clears the object contents back to a default invalid state, and release any
+// references to shared data that this object may contain.
//------------------------------------------------------------------
void DataEncoder::Clear() {
m_start = nullptr;
@@ -72,8 +70,8 @@ void DataEncoder::Clear() {
}
//------------------------------------------------------------------
-// If this object contains shared data, this function returns the
-// offset into that shared data. Else zero is returned.
+// If this object contains shared data, this function returns the offset into
+// that shared data. Else zero is returned.
//------------------------------------------------------------------
size_t DataEncoder::GetSharedDataOffset() const {
if (m_start != nullptr) {
@@ -90,13 +88,12 @@ size_t DataEncoder::GetSharedDataOffset() const {
}
//----------------------------------------------------------------------
-// Set the data with which this object will extract from to data
-// starting at BYTES and set the length of the data to LENGTH bytes
-// long. The data is externally owned must be around at least as
-// long as this object points to the data. No copy of the data is
-// made, this object just refers to this data and can extract from
-// it. If this object refers to any shared data upon entry, the
-// reference to that data will be released. Is SWAP is set to true,
+// Set the data with which this object will extract from to data starting at
+// BYTES and set the length of the data to LENGTH bytes long. The data is
+// externally owned must be around at least as long as this object points to
+// the data. No copy of the data is made, this object just refers to this data
+// and can extract from it. If this object refers to any shared data upon
+// entry, the reference to that data will be released. Is SWAP is set to true,
// any data extracted will be endian swapped.
//----------------------------------------------------------------------
uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) {
@@ -113,18 +110,17 @@ uint32_t DataEncoder::SetData(void *bytes, uint32_t length, ByteOrder endian) {
}
//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange of the shared
-// data in "data_sp" starting "data_offset" bytes into "data_sp"
-// and ending "data_length" bytes later. If "data_offset" is not
-// a valid offset into "data_sp", then this object will contain no
-// bytes. If "data_offset" is within "data_sp" yet "data_length" is
-// too large, the length will be capped at the number of bytes
-// remaining in "data_sp". A ref counted pointer to the data in
-// "data_sp" will be made in this object IF the number of bytes this
-// object refers to in greater than zero (if at least one byte was
-// available starting at "data_offset") to ensure the data stays
-// around as long as it is needed. The address size and endian swap
-// settings will remain unchanged from their current settings.
+// Assign the data for this object to be a subrange of the shared data in
+// "data_sp" starting "data_offset" bytes into "data_sp" and ending
+// "data_length" bytes later. If "data_offset" is not a valid offset into
+// "data_sp", then this object will contain no bytes. If "data_offset" is
+// within "data_sp" yet "data_length" is too large, the length will be capped
+// at the number of bytes remaining in "data_sp". A ref counted pointer to the
+// data in "data_sp" will be made in this object IF the number of bytes this
+// object refers to in greater than zero (if at least one byte was available
+// starting at "data_offset") to ensure the data stays around as long as it is
+// needed. The address size and endian swap settings will remain unchanged from
+// their current settings.
//----------------------------------------------------------------------
uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset,
uint32_t data_length) {
@@ -149,8 +145,8 @@ uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset,
uint32_t new_size = GetByteSize();
- // Don't hold a shared pointer to the data buffer if we don't share
- // any valid bytes in the shared buffer.
+ // Don't hold a shared pointer to the data buffer if we don't share any valid
+ // bytes in the shared buffer.
if (new_size == 0)
m_data_sp.reset();
@@ -158,8 +154,8 @@ uint32_t DataEncoder::SetData(const DataBufferSP &data_sp, uint32_t data_offset,
}
//----------------------------------------------------------------------
-// Extract a single unsigned char from the binary data and update
-// the offset pointed to by "offset_ptr".
+// Extract a single unsigned char from the binary data and update the offset
+// pointed to by "offset_ptr".
//
// RETURNS the byte that was extracted, or zero on failure.
//----------------------------------------------------------------------
@@ -208,12 +204,12 @@ uint32_t DataEncoder::PutU64(uint32_t offset, uint64_t value) {
}
//----------------------------------------------------------------------
-// Extract a single integer value from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted integer
-// is specified by the "byte_size" argument. "byte_size" should have
-// a value >= 1 and <= 8 since the return value is only 64 bits
-// wide. Any "byte_size" values less than 1 or greater than 8 will
-// result in nothing being extracted, and zero being returned.
+// Extract a single integer value from the data and update the offset pointed
+// to by "offset_ptr". The size of the extracted integer is specified by the
+// "byte_size" argument. "byte_size" should have a value >= 1 and <= 8 since
+// the return value is only 64 bits wide. Any "byte_size" values less than 1 or
+// greater than 8 will result in nothing being extracted, and zero being
+// returned.
//
// RETURNS the integer value that was extracted, or zero on failure.
//----------------------------------------------------------------------
diff --git a/source/Utility/DataExtractor.cpp b/source/Utility/DataExtractor.cpp
index 84c5f8191521..947232943aa7 100644
--- a/source/Utility/DataExtractor.cpp
+++ b/source/Utility/DataExtractor.cpp
@@ -126,8 +126,8 @@ DataExtractor::DataExtractor()
m_data_sp(), m_target_byte_size(1) {}
//----------------------------------------------------------------------
-// This constructor allows us to use data that is owned by someone else.
-// The data must stay around as long as this object is valid.
+// This constructor allows us to use data that is owned by someone else. The
+// data must stay around as long as this object is valid.
//----------------------------------------------------------------------
DataExtractor::DataExtractor(const void *data, offset_t length,
ByteOrder endian, uint32_t addr_size,
@@ -143,11 +143,10 @@ DataExtractor::DataExtractor(const void *data, offset_t length,
}
//----------------------------------------------------------------------
-// Make a shared pointer reference to the shared data in "data_sp" and
-// set the endian swapping setting to "swap", and the address size to
-// "addr_size". The shared data reference will ensure the data lives
-// as long as any DataExtractor objects exist that have a reference to
-// this data.
+// Make a shared pointer reference to the shared data in "data_sp" and set the
+// endian swapping setting to "swap", and the address size to "addr_size". The
+// shared data reference will ensure the data lives as long as any
+// DataExtractor objects exist that have a reference to this data.
//----------------------------------------------------------------------
DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
uint32_t addr_size,
@@ -162,11 +161,11 @@ DataExtractor::DataExtractor(const DataBufferSP &data_sp, ByteOrder endian,
}
//----------------------------------------------------------------------
-// Initialize this object with a subset of the data bytes in "data".
-// If "data" contains shared data, then a reference to this shared
-// data will added and the shared data will stay around as long
-// as any object contains a reference to that data. The endian
-// swap and address size settings are copied from "data".
+// Initialize this object with a subset of the data bytes in "data". If "data"
+// contains shared data, then a reference to this shared data will added and
+// the shared data will stay around as long as any object contains a reference
+// to that data. The endian swap and address size settings are copied from
+// "data".
//----------------------------------------------------------------------
DataExtractor::DataExtractor(const DataExtractor &data, offset_t offset,
offset_t length, uint32_t target_byte_size /*=1*/)
@@ -210,9 +209,8 @@ const DataExtractor &DataExtractor::operator=(const DataExtractor &rhs) {
DataExtractor::~DataExtractor() = default;
//------------------------------------------------------------------
-// Clears the object contents back to a default invalid state, and
-// release any references to shared data that this object may
-// contain.
+// Clears the object contents back to a default invalid state, and release any
+// references to shared data that this object may contain.
//------------------------------------------------------------------
void DataExtractor::Clear() {
m_start = nullptr;
@@ -223,8 +221,8 @@ void DataExtractor::Clear() {
}
//------------------------------------------------------------------
-// If this object contains shared data, this function returns the
-// offset into that shared data. Else zero is returned.
+// If this object contains shared data, this function returns the offset into
+// that shared data. Else zero is returned.
//------------------------------------------------------------------
size_t DataExtractor::GetSharedDataOffset() const {
if (m_start != nullptr) {
@@ -241,13 +239,12 @@ size_t DataExtractor::GetSharedDataOffset() const {
}
//----------------------------------------------------------------------
-// Set the data with which this object will extract from to data
-// starting at BYTES and set the length of the data to LENGTH bytes
-// long. The data is externally owned must be around at least as
-// long as this object points to the data. No copy of the data is
-// made, this object just refers to this data and can extract from
-// it. If this object refers to any shared data upon entry, the
-// reference to that data will be released. Is SWAP is set to true,
+// Set the data with which this object will extract from to data starting at
+// BYTES and set the length of the data to LENGTH bytes long. The data is
+// externally owned must be around at least as long as this object points to
+// the data. No copy of the data is made, this object just refers to this data
+// and can extract from it. If this object refers to any shared data upon
+// entry, the reference to that data will be released. Is SWAP is set to true,
// any data extracted will be endian swapped.
//----------------------------------------------------------------------
lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length,
@@ -265,18 +262,16 @@ lldb::offset_t DataExtractor::SetData(const void *bytes, offset_t length,
}
//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange in "data"
-// starting "data_offset" bytes into "data" and ending "data_length"
-// bytes later. If "data_offset" is not a valid offset into "data",
-// then this object will contain no bytes. If "data_offset" is
-// within "data" yet "data_length" is too large, the length will be
-// capped at the number of bytes remaining in "data". If "data"
-// contains a shared pointer to other data, then a ref counted
-// pointer to that data will be made in this object. If "data"
-// doesn't contain a shared pointer to data, then the bytes referred
-// to in "data" will need to exist at least as long as this object
-// refers to those bytes. The address size and endian swap settings
-// are copied from the current values in "data".
+// Assign the data for this object to be a subrange in "data" starting
+// "data_offset" bytes into "data" and ending "data_length" bytes later. If
+// "data_offset" is not a valid offset into "data", then this object will
+// contain no bytes. If "data_offset" is within "data" yet "data_length" is too
+// large, the length will be capped at the number of bytes remaining in "data".
+// If "data" contains a shared pointer to other data, then a ref counted
+// pointer to that data will be made in this object. If "data" doesn't contain
+// a shared pointer to data, then the bytes referred to in "data" will need to
+// exist at least as long as this object refers to those bytes. The address
+// size and endian swap settings are copied from the current values in "data".
//----------------------------------------------------------------------
lldb::offset_t DataExtractor::SetData(const DataExtractor &data,
offset_t data_offset,
@@ -303,18 +298,17 @@ lldb::offset_t DataExtractor::SetData(const DataExtractor &data,
}
//----------------------------------------------------------------------
-// Assign the data for this object to be a subrange of the shared
-// data in "data_sp" starting "data_offset" bytes into "data_sp"
-// and ending "data_length" bytes later. If "data_offset" is not
-// a valid offset into "data_sp", then this object will contain no
-// bytes. If "data_offset" is within "data_sp" yet "data_length" is
-// too large, the length will be capped at the number of bytes
-// remaining in "data_sp". A ref counted pointer to the data in
-// "data_sp" will be made in this object IF the number of bytes this
-// object refers to in greater than zero (if at least one byte was
-// available starting at "data_offset") to ensure the data stays
-// around as long as it is needed. The address size and endian swap
-// settings will remain unchanged from their current settings.
+// Assign the data for this object to be a subrange of the shared data in
+// "data_sp" starting "data_offset" bytes into "data_sp" and ending
+// "data_length" bytes later. If "data_offset" is not a valid offset into
+// "data_sp", then this object will contain no bytes. If "data_offset" is
+// within "data_sp" yet "data_length" is too large, the length will be capped
+// at the number of bytes remaining in "data_sp". A ref counted pointer to the
+// data in "data_sp" will be made in this object IF the number of bytes this
+// object refers to in greater than zero (if at least one byte was available
+// starting at "data_offset") to ensure the data stays around as long as it is
+// needed. The address size and endian swap settings will remain unchanged from
+// their current settings.
//----------------------------------------------------------------------
lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp,
offset_t data_offset,
@@ -340,8 +334,8 @@ lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp,
size_t new_size = GetByteSize();
- // Don't hold a shared pointer to the data buffer if we don't share
- // any valid bytes in the shared buffer.
+ // Don't hold a shared pointer to the data buffer if we don't share any valid
+ // bytes in the shared buffer.
if (new_size == 0)
m_data_sp.reset();
@@ -349,8 +343,8 @@ lldb::offset_t DataExtractor::SetData(const DataBufferSP &data_sp,
}
//----------------------------------------------------------------------
-// Extract a single unsigned char from the binary data and update
-// the offset pointed to by "offset_ptr".
+// Extract a single unsigned char from the binary data and update the offset
+// pointed to by "offset_ptr".
//
// RETURNS the byte that was extracted, or zero on failure.
//----------------------------------------------------------------------
@@ -362,13 +356,12 @@ uint8_t DataExtractor::GetU8(offset_t *offset_ptr) const {
}
//----------------------------------------------------------------------
-// Extract "count" unsigned chars from the binary data and update the
-// offset pointed to by "offset_ptr". The extracted data is copied into
-// "dst".
+// Extract "count" unsigned chars from the binary data and update the offset
+// pointed to by "offset_ptr". The extracted data is copied into "dst".
//
// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available in
-// the buffer due to being out of bounds, or insufficient data.
+// all the requested bytes, or nullptr when the data is not available in the
+// buffer due to being out of bounds, or insufficient data.
//----------------------------------------------------------------------
void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst,
uint32_t count) const {
@@ -384,8 +377,8 @@ void *DataExtractor::GetU8(offset_t *offset_ptr, void *dst,
}
//----------------------------------------------------------------------
-// Extract a single uint16_t from the data and update the offset
-// pointed to by "offset_ptr".
+// Extract a single uint16_t from the data and update the offset pointed to by
+// "offset_ptr".
//
// RETURNS the uint16_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
@@ -432,13 +425,12 @@ uint64_t DataExtractor::GetU64_unchecked(offset_t *offset_ptr) const {
}
//----------------------------------------------------------------------
-// Extract "count" uint16_t values from the binary data and update
-// the offset pointed to by "offset_ptr". The extracted data is
-// copied into "dst".
+// Extract "count" uint16_t values from the binary data and update the offset
+// pointed to by "offset_ptr". The extracted data is copied into "dst".
//
// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available
-// in the buffer due to being out of bounds, or insufficient data.
+// all the requested bytes, or nullptr when the data is not available in the
+// buffer due to being out of bounds, or insufficient data.
//----------------------------------------------------------------------
void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst,
uint32_t count) const {
@@ -465,8 +457,8 @@ void *DataExtractor::GetU16(offset_t *offset_ptr, void *void_dst,
}
//----------------------------------------------------------------------
-// Extract a single uint32_t from the data and update the offset
-// pointed to by "offset_ptr".
+// Extract a single uint32_t from the data and update the offset pointed to by
+// "offset_ptr".
//
// RETURNS the uint32_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
@@ -484,13 +476,12 @@ uint32_t DataExtractor::GetU32(offset_t *offset_ptr) const {
}
//----------------------------------------------------------------------
-// Extract "count" uint32_t values from the binary data and update
-// the offset pointed to by "offset_ptr". The extracted data is
-// copied into "dst".
+// Extract "count" uint32_t values from the binary data and update the offset
+// pointed to by "offset_ptr". The extracted data is copied into "dst".
//
// RETURNS the non-nullptr buffer pointer upon successful extraction of
-// all the requested bytes, or nullptr when the data is not available
-// in the buffer due to being out of bounds, or insufficient data.
+// all the requested bytes, or nullptr when the data is not available in the
+// buffer due to being out of bounds, or insufficient data.
//----------------------------------------------------------------------
void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst,
uint32_t count) const {
@@ -517,8 +508,8 @@ void *DataExtractor::GetU32(offset_t *offset_ptr, void *void_dst,
}
//----------------------------------------------------------------------
-// Extract a single uint64_t from the data and update the offset
-// pointed to by "offset_ptr".
+// Extract a single uint64_t from the data and update the offset pointed to by
+// "offset_ptr".
//
// RETURNS the uint64_t that was extracted, or zero on failure.
//----------------------------------------------------------------------
@@ -538,9 +529,9 @@ uint64_t DataExtractor::GetU64(offset_t *offset_ptr) const {
//----------------------------------------------------------------------
// GetU64
//
-// Get multiple consecutive 64 bit values. Return true if the entire
-// read succeeds and increment the offset pointed to by offset_ptr, else
-// return false and leave the offset pointed to by offset_ptr unchanged.
+// Get multiple consecutive 64 bit values. Return true if the entire read
+// succeeds and increment the offset pointed to by offset_ptr, else return
+// false and leave the offset pointed to by offset_ptr unchanged.
//----------------------------------------------------------------------
void *DataExtractor::GetU64(offset_t *offset_ptr, void *void_dst,
uint32_t count) const {
@@ -708,10 +699,10 @@ long double DataExtractor::GetLongDouble(offset_t *offset_ptr) const {
}
//------------------------------------------------------------------
-// Extract a single address from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted address
-// comes from the "this->m_addr_size" member variable and should be
-// set correctly prior to extracting any address values.
+// Extract a single address from the data and update the offset pointed to by
+// "offset_ptr". The size of the extracted address comes from the
+// "this->m_addr_size" member variable and should be set correctly prior to
+// extracting any address values.
//
// RETURNS the address that was extracted, or zero on failure.
//------------------------------------------------------------------
@@ -730,10 +721,10 @@ uint64_t DataExtractor::GetAddress_unchecked(offset_t *offset_ptr) const {
}
//------------------------------------------------------------------
-// Extract a single pointer from the data and update the offset
-// pointed to by "offset_ptr". The size of the extracted pointer
-// comes from the "this->m_addr_size" member variable and should be
-// set correctly prior to extracting any pointer values.
+// Extract a single pointer from the data and update the offset pointed to by
+// "offset_ptr". The size of the extracted pointer comes from the
+// "this->m_addr_size" member variable and should be set correctly prior to
+// extracting any pointer values.
//
// RETURNS the pointer that was extracted, or zero on failure.
//------------------------------------------------------------------
@@ -804,9 +795,9 @@ DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len,
const uint8_t *src = (const uint8_t *)PeekData(src_offset, src_len);
if (src) {
if (dst_len >= src_len) {
- // We are copying the entire value from src into dst.
- // Calculate how many, if any, zeroes we need for the most
- // significant bytes if "dst_len" is greater than "src_len"...
+ // We are copying the entire value from src into dst. Calculate how many,
+ // if any, zeroes we need for the most significant bytes if "dst_len" is
+ // greater than "src_len"...
const size_t num_zeroes = dst_len - src_len;
if (dst_byte_order == eByteOrderBig) {
// Big endian, so we lead with zeroes...
@@ -863,15 +854,13 @@ DataExtractor::CopyByteOrderedData(offset_t src_offset, offset_t src_len,
}
//----------------------------------------------------------------------
-// Extracts a variable length NULL terminated C string from
-// the data at the offset pointed to by "offset_ptr". The
-// "offset_ptr" will be updated with the offset of the byte that
-// follows the NULL terminator byte.
+// Extracts a variable length NULL terminated C string from the data at the
+// offset pointed to by "offset_ptr". The "offset_ptr" will be updated with
+// the offset of the byte that follows the NULL terminator byte.
//
-// If the offset pointed to by "offset_ptr" is out of bounds, or if
-// "length" is non-zero and there aren't enough available
-// bytes, nullptr will be returned and "offset_ptr" will not be
-// updated.
+// If the offset pointed to by "offset_ptr" is out of bounds, or if "length" is
+// non-zero and there aren't enough available bytes, nullptr will be returned
+// and "offset_ptr" will not be updated.
//----------------------------------------------------------------------
const char *DataExtractor::GetCStr(offset_t *offset_ptr) const {
const char *cstr = (const char *)PeekData(*offset_ptr, 1);
@@ -890,23 +879,21 @@ const char *DataExtractor::GetCStr(offset_t *offset_ptr) const {
}
// We reached the end of the data without finding a NULL C string
- // terminator. Fall through and return nullptr otherwise anyone that
- // would have used the result as a C string can wander into
- // unknown memory...
+ // terminator. Fall through and return nullptr otherwise anyone that would
+ // have used the result as a C string can wander into unknown memory...
}
return nullptr;
}
//----------------------------------------------------------------------
-// Extracts a NULL terminated C string from the fixed length field of
-// length "len" at the offset pointed to by "offset_ptr".
-// The "offset_ptr" will be updated with the offset of the byte that
-// follows the fixed length field.
+// Extracts a NULL terminated C string from the fixed length field of length
+// "len" at the offset pointed to by "offset_ptr". The "offset_ptr" will be
+// updated with the offset of the byte that follows the fixed length field.
//
-// If the offset pointed to by "offset_ptr" is out of bounds, or if
-// the offset plus the length of the field is out of bounds, or if the
-// field does not contain a NULL terminator byte, nullptr will be returned
-// and "offset_ptr" will not be updated.
+// If the offset pointed to by "offset_ptr" is out of bounds, or if the offset
+// plus the length of the field is out of bounds, or if the field does not
+// contain a NULL terminator byte, nullptr will be returned and "offset_ptr"
+// will not be updated.
//----------------------------------------------------------------------
const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const {
const char *cstr = (const char *)PeekData(*offset_ptr, len);
@@ -921,22 +908,22 @@ const char *DataExtractor::GetCStr(offset_t *offset_ptr, offset_t len) const {
}
//------------------------------------------------------------------
-// Peeks at a string in the contained data. No verification is done
-// to make sure the entire string lies within the bounds of this
-// object's data, only "offset" is verified to be a valid offset.
+// Peeks at a string in the contained data. No verification is done to make
+// sure the entire string lies within the bounds of this object's data, only
+// "offset" is verified to be a valid offset.
//
-// Returns a valid C string pointer if "offset" is a valid offset in
-// this object's data, else nullptr is returned.
+// Returns a valid C string pointer if "offset" is a valid offset in this
+// object's data, else nullptr is returned.
//------------------------------------------------------------------
const char *DataExtractor::PeekCStr(offset_t offset) const {
return (const char *)PeekData(offset, 1);
}
//----------------------------------------------------------------------
-// Extracts an unsigned LEB128 number from this object's data
-// starting at the offset pointed to by "offset_ptr". The offset
-// pointed to by "offset_ptr" will be updated with the offset of the
-// byte following the last extracted byte.
+// Extracts an unsigned LEB128 number from this object's data starting at the
+// offset pointed to by "offset_ptr". The offset pointed to by "offset_ptr"
+// will be updated with the offset of the byte following the last extracted
+// byte.
//
// Returned the extracted integer value.
//----------------------------------------------------------------------
@@ -968,10 +955,10 @@ uint64_t DataExtractor::GetULEB128(offset_t *offset_ptr) const {
}
//----------------------------------------------------------------------
-// Extracts an signed LEB128 number from this object's data
-// starting at the offset pointed to by "offset_ptr". The offset
-// pointed to by "offset_ptr" will be updated with the offset of the
-// byte following the last extracted byte.
+// Extracts an signed LEB128 number from this object's data starting at the
+// offset pointed to by "offset_ptr". The offset pointed to by "offset_ptr"
+// will be updated with the offset of the byte following the last extracted
+// byte.
//
// Returned the extracted integer value.
//----------------------------------------------------------------------
@@ -1010,10 +997,10 @@ int64_t DataExtractor::GetSLEB128(offset_t *offset_ptr) const {
}
//----------------------------------------------------------------------
-// Skips a ULEB128 number (signed or unsigned) from this object's
-// data starting at the offset pointed to by "offset_ptr". The
-// offset pointed to by "offset_ptr" will be updated with the offset
-// of the byte following the last extracted byte.
+// Skips a ULEB128 number (signed or unsigned) from this object's data starting
+// at the offset pointed to by "offset_ptr". The offset pointed to by
+// "offset_ptr" will be updated with the offset of the byte following the last
+// extracted byte.
//
// Returns the number of bytes consumed during the extraction.
//----------------------------------------------------------------------
@@ -1036,15 +1023,14 @@ uint32_t DataExtractor::Skip_LEB128(offset_t *offset_ptr) const {
//----------------------------------------------------------------------
// Dumps bytes from this object's data to the stream "s" starting
-// "start_offset" bytes into this data, and ending with the byte
-// before "end_offset". "base_addr" will be added to the offset
-// into the dumped data when showing the offset into the data in the
-// output information. "num_per_line" objects of type "type" will
-// be dumped with the option to override the format for each object
-// with "type_format". "type_format" is a printf style formatting
-// string. If "type_format" is nullptr, then an appropriate format
-// string will be used for the supplied "type". If the stream "s"
-// is nullptr, then the output will be send to Log().
+// "start_offset" bytes into this data, and ending with the byte before
+// "end_offset". "base_addr" will be added to the offset into the dumped data
+// when showing the offset into the data in the output information.
+// "num_per_line" objects of type "type" will be dumped with the option to
+// override the format for each object with "type_format". "type_format" is a
+// printf style formatting string. If "type_format" is nullptr, then an
+// appropriate format string will be used for the supplied "type". If the
+// stream "s" is nullptr, then the output will be send to Log().
//----------------------------------------------------------------------
lldb::offset_t DataExtractor::PutToLog(Log *log, offset_t start_offset,
offset_t length, uint64_t base_addr,
@@ -1107,24 +1093,6 @@ lldb::offset_t DataExtractor::PutToLog(Log *log, offset_t start_offset,
return offset; // Return the offset at which we ended up
}
-//----------------------------------------------------------------------
-// DumpUUID
-//
-// Dump out a UUID starting at 'offset' bytes into the buffer
-//----------------------------------------------------------------------
-void DataExtractor::DumpUUID(Stream *s, offset_t offset) const {
- if (s) {
- const uint8_t *uuid_data = PeekData(offset, 16);
- if (uuid_data) {
- lldb_private::UUID uuid(uuid_data, 16);
- uuid.Dump(s);
- } else {
- s->Printf("<not enough data for UUID at offset 0x%8.8" PRIx64 ">",
- offset);
- }
- }
-}
-
size_t DataExtractor::Copy(DataExtractor &dest_data) const {
if (m_data_sp) {
// we can pass along the SP to the data
diff --git a/source/Utility/Environment.cpp b/source/Utility/Environment.cpp
new file mode 100644
index 000000000000..ea20267a2362
--- /dev/null
+++ b/source/Utility/Environment.cpp
@@ -0,0 +1,50 @@
+//===-- Environment.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/Environment.h"
+
+using namespace lldb_private;
+
+char *Environment::Envp::make_entry(llvm::StringRef Key,
+ llvm::StringRef Value) {
+ const size_t size = Key.size() + 1 /*=*/ + Value.size() + 1 /*\0*/;
+ char *Result = reinterpret_cast<char *>(
+ Allocator.Allocate(sizeof(char) * size, alignof(char)));
+ char *Next = Result;
+
+ Next = std::copy(Key.begin(), Key.end(), Next);
+ *Next++ = '=';
+ Next = std::copy(Value.begin(), Value.end(), Next);
+ *Next++ = '\0';
+
+ return Result;
+}
+
+Environment::Envp::Envp(const Environment &Env) {
+ Data = reinterpret_cast<char **>(
+ Allocator.Allocate(sizeof(char *) * (Env.size() + 1), alignof(char *)));
+ char **Next = Data;
+ for (const auto &KV : Env)
+ *Next++ = make_entry(KV.first(), KV.second);
+ *Next++ = nullptr;
+}
+
+Environment::Environment(const char *const *Env) {
+ if (!Env)
+ return;
+ while (*Env)
+ insert(*Env++);
+}
+
+void Environment::insert(const_iterator first, const_iterator last) {
+ while (first != last) {
+ try_emplace(first->first(), first->second);
+ ++first;
+ }
+}
diff --git a/source/Utility/FastDemangle.cpp b/source/Utility/FastDemangle.cpp
index 90326c5f15c3..d92670a9199b 100644
--- a/source/Utility/FastDemangle.cpp
+++ b/source/Utility/FastDemangle.cpp
@@ -25,7 +25,7 @@
namespace {
-/// @brief Represents the collection of qualifiers on a type
+/// Represents the collection of qualifiers on a type
enum Qualifiers {
QualifierNone = 0,
@@ -37,7 +37,7 @@ enum Qualifiers {
QualifierPointer = 32
};
-/// @brief Categorizes the recognized operators
+/// Categorizes the recognized operators
enum class OperatorKind {
Unary,
@@ -50,23 +50,23 @@ enum class OperatorKind {
NoMatch
};
-/// @brief Represents one of the recognized two-character operator
-/// abbreviations used when parsing operators as names and expressions
+/// Represents one of the recognized two-character operator abbreviations used
+/// when parsing operators as names and expressions
struct Operator {
const char *name;
OperatorKind kind;
};
-/// @brief Represents a range of characters in the output buffer, typically for
-/// use with RewriteRange()
+/// Represents a range of characters in the output buffer, typically for use
+/// with RewriteRange()
struct BufferRange {
int offset;
int length;
};
-/// @brief Transient state required while parsing a name
+/// Transient state required while parsing a name
struct NameState {
bool parse_function_params;
@@ -75,12 +75,13 @@ struct NameState {
BufferRange last_name_range;
};
-/// @brief LLDB's fast C++ demangler
+/// LLDB's fast C++ demangler
///
/// This is an incomplete implementation designed to speed up the demangling
/// process that is often a bottleneck when LLDB stops a process for the first
/// time. Where the implementation doesn't know how to demangle a symbol it
-/// fails gracefully to allow the caller to fall back to the existing demangler.
+/// fails gracefully to allow the caller to fall back to the existing
+/// demangler.
///
/// Over time the full mangling spec should be supported without compromising
/// performance for the most common cases.
@@ -91,7 +92,7 @@ public:
// Public API
//----------------------------------------------------
- /// @brief Create a SymbolDemangler
+ /// Create a SymbolDemangler
///
/// The newly created demangler allocates and owns scratch memory sufficient
/// for demangling typical symbols. Additional memory will be allocated if
@@ -107,18 +108,18 @@ public:
m_owns_m_rewrite_ranges = true;
}
- /// @brief Create a SymbolDemangler that uses provided scratch memory
+ /// Create a SymbolDemangler that uses provided scratch memory
///
/// The provided memory is not owned by the demangler. It will be
- /// overwritten during calls to GetDemangledCopy() but can be used for
- /// other purposes between calls. The provided memory will not be freed
- /// when this instance is destroyed.
+ /// overwritten during calls to GetDemangledCopy() but can be used for other
+ /// purposes between calls. The provided memory will not be freed when this
+ /// instance is destroyed.
///
/// If demangling a symbol requires additional space it will be allocated
/// and managed by the demangler instance.
///
- /// @param storage_ptr Valid pointer to at least storage_size bytes of
- /// space that the SymbolDemangler can use during demangling
+ /// @param storage_ptr Valid pointer to at least storage_size bytes of space
+ /// that the SymbolDemangler can use during demangling
///
/// @param storage_size Number of bytes of space available scratch memory
/// referenced by storage_ptr
@@ -138,8 +139,8 @@ public:
m_owns_buffer = false;
}
- /// @brief Destroys the SymbolDemangler and deallocates any scratch
- /// memory that it owns
+ /// Destroys the SymbolDemangler and deallocates any scratch memory that it
+ /// owns
~SymbolDemangler() {
if (m_owns_buffer)
@@ -153,11 +154,11 @@ public:
int highwater_buffer = 0;
#endif
- /// @brief Parses the provided mangled name and returns a newly allocated
+ /// Parses the provided mangled name and returns a newly allocated
/// demangling
///
- /// @param mangled_name Valid null-terminated C++ mangled name following
- /// the Itanium C++ ABI mangling specification as implemented by Clang
+ /// @param mangled_name Valid null-terminated C++ mangled name following the
+ /// Itanium C++ ABI mangling specification as implemented by Clang
///
/// @result Newly allocated null-terminated demangled name when demangling
/// is successful, and nullptr when demangling fails. The caller is
@@ -200,8 +201,7 @@ private:
if (growth > 1 << 20)
growth = 1 << 20;
- // ... but never grow by less than requested,
- // or 1K, whichever is greater
+ // ... but never grow by less than requested, or 1K, whichever is greater
if (min_growth < 1024)
min_growth = 1024;
if (growth < min_growth)
@@ -282,9 +282,8 @@ private:
if (index == m_rewrite_ranges_size)
break;
- // Affected ranges are either shuffled forward when after the
- // insertion but before the source, or backward when inside the
- // source
+ // Affected ranges are either shuffled forward when after the insertion
+ // but before the source, or backward when inside the source
int candidate_offset = m_rewrite_ranges[index].offset;
if (candidate_offset >= insertion_point_cookie) {
if (candidate_offset < source_range.offset) {
@@ -402,8 +401,7 @@ private:
//----------------------------------------------------
// Rewrite methods
//
- // Write another copy of content already present
- // earlier in the output buffer
+ // Write another copy of content already present earlier in the output buffer
//----------------------------------------------------
void RewriteRange(BufferRange range) {
@@ -436,11 +434,11 @@ private:
//----------------------------------------------------
// TryParse methods
//
- // Provide information with return values instead of
- // writing to the output buffer
+ // Provide information with return values instead of writing to the output
+ // buffer
//
- // Values indicating failure guarantee that the pre-
- // call m_read_ptr is unchanged
+ // Values indicating failure guarantee that the pre- call m_read_ptr is
+ // unchanged
//----------------------------------------------------
int TryParseNumber() {
@@ -820,8 +818,8 @@ private:
}
// <CV-qualifiers> ::= [r] [V] [K]
- // <ref-qualifier> ::= R # & ref-qualifier
- // <ref-qualifier> ::= O # && ref-qualifier
+ // <ref-qualifier> ::= R # & ref-qualifier <ref-qualifier>
+ // ::= O # && ref-qualifier
int TryParseQualifiers(bool allow_cv, bool allow_ro) {
int qualifiers = QualifierNone;
@@ -890,11 +888,10 @@ private:
//----------------------------------------------------
// Parse methods
//
- // Consume input starting from m_read_ptr and produce
- // buffered output at m_write_ptr
+ // Consume input starting from m_read_ptr and produce buffered output at
+ // m_write_ptr
//
- // Failures return false and may leave m_read_ptr in an
- // indeterminate state
+ // Failures return false and may leave m_read_ptr in an indeterminate state
//----------------------------------------------------
bool Parse(char character) {
@@ -932,17 +929,14 @@ private:
// <substitution> ::= S <seq-id> _
// ::= S_
- // <substitution> ::= Sa # ::std::allocator
- // <substitution> ::= Sb # ::std::basic_string
- // <substitution> ::= Ss # ::std::basic_string < char,
+ // <substitution> ::= Sa # ::std::allocator <substitution> ::= Sb #
+ // ::std::basic_string <substitution> ::= Ss # ::std::basic_string < char,
// ::std::char_traits<char>,
// ::std::allocator<char> >
// <substitution> ::= Si # ::std::basic_istream<char, std::char_traits<char>
- // >
- // <substitution> ::= So # ::std::basic_ostream<char, std::char_traits<char>
- // >
- // <substitution> ::= Sd # ::std::basic_iostream<char, std::char_traits<char>
- // >
+ // > <substitution> ::= So # ::std::basic_ostream<char,
+ // std::char_traits<char> > <substitution> ::= Sd #
+ // ::std::basic_iostream<char, std::char_traits<char> >
bool ParseSubstitution() {
const char *substitution;
@@ -967,7 +961,8 @@ private:
break;
default:
// A failed attempt to parse a number will return -1 which turns out to be
- // perfect here as S_ is the first substitution, S0_ the next and so forth
+ // perfect here as S_ is the first substitution, S0_ the next and so
+ // forth
int substitution_index = TryParseBase36Number();
if (*m_read_ptr++ != '_') {
#ifdef DEBUG_FAILURES
@@ -984,17 +979,17 @@ private:
// <function-type> ::= F [Y] <bare-function-type> [<ref-qualifier>] E
//
- // <bare-function-type> ::= <signature type>+ # types are possible return
- // type, then parameter types
+ // <bare-function-type> ::= <signature type>+ # types are possible
+ // return type, then parameter types
bool ParseFunctionType(int inner_qualifiers = QualifierNone) {
#ifdef DEBUG_FAILURES
printf("*** Function types not supported\n");
#endif
// TODO: first steps toward an implementation follow, but they're far
- // from complete. Function types tend to bracket other types eg:
- // int (*)() when used as the type for "name" becomes int (*name)().
- // This makes substitution et al ... interesting.
+ // from complete. Function types tend to bracket other types eg: int (*)()
+ // when used as the type for "name" becomes int (*name)(). This makes
+ // substitution et al ... interesting.
return false;
#if 0 // TODO
@@ -1154,8 +1149,8 @@ private:
if (!Parse('_'))
return false;
- // When no number is present we get -1, which is convenient since
- // T_ is the zeroth element T0_ is element 1, and so on
+ // When no number is present we get -1, which is convenient since T_ is the
+ // zeroth element T0_ is element 1, and so on
return RewriteTemplateArg(count + 1);
}
@@ -1193,13 +1188,13 @@ private:
// ::= G <type> # imaginary (C 2000)
// ::= Dp <type> # pack expansion (C++0x)
// ::= U <source-name> <type> # vendor extended type qualifier
- // extension := U <objc-name> <objc-type> # objc-type<identifier>
- // extension := <vector-type> # <vector-type> starts with Dv
+ // extension := U <objc-name> <objc-type> # objc-type<identifier> extension
+ // := <vector-type> # <vector-type> starts with Dv
// <objc-name> ::= <k0 number> objcproto <k1 number> <identifier> # k0 = 9 +
- // <number of digits in k1> + k1
- // <objc-type> := <source-name> # PU<11+>objcproto 11objc_object<source-name>
- // 11objc_object -> id<source-name>
+ // <number of digits in k1> + k1 <objc-type> := <source-name> #
+ // PU<11+>objcproto 11objc_object<source-name> 11objc_object -> id<source-
+ // name>
bool ParseType() {
#ifdef DEBUG_FAILURES
@@ -1476,8 +1471,8 @@ private:
// ::= <unnamed-type-name>
bool ParseUnqualifiedName(NameState &name_state) {
- // Note that these are detected directly in ParseNestedName for
- // performance rather than switching on the same options twice
+ // Note that these are detected directly in ParseNestedName for performance
+ // rather than switching on the same options twice
char next = *m_read_ptr;
switch (next) {
case 'C':
@@ -1943,7 +1938,8 @@ private:
break;
}
- // Record a substitution candidate for all prefixes, but not the full name
+ // Record a substitution candidate for all prefixes, but not the full
+ // name
if (suppress_substitution)
suppress_substitution = false;
else
@@ -2247,9 +2243,9 @@ private:
if (next == 'E' || next == '\0' || next == '.')
return true;
- // Clang has a bad habit of making unique manglings by just sticking numbers
- // on the end of a symbol,
- // which is ambiguous with malformed source name manglings
+ // Clang has a bad habit of making unique manglings by just sticking
+ // numbers on the end of a symbol, which is ambiguous with malformed source
+ // name manglings
const char *before_clang_uniquing_test = m_read_ptr;
if (TryParseNumber()) {
if (*m_read_ptr == '\0')
diff --git a/source/Utility/FileSpec.cpp b/source/Utility/FileSpec.cpp
index 72f86917b813..b6952f7e3eb0 100644
--- a/source/Utility/FileSpec.cpp
+++ b/source/Utility/FileSpec.cpp
@@ -12,17 +12,15 @@
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/TildeExpressionResolver.h"
-#include "llvm/ADT/SmallString.h" // for SmallString
-#include "llvm/ADT/SmallVector.h" // for SmallVectorTemplat...
+#include "llvm/ADT/SmallString.h"
+#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/Triple.h" // for Triple
-#include "llvm/ADT/Twine.h" // for Twine
-#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
-#include "llvm/Support/ErrorOr.h" // for ErrorOr
+#include "llvm/ADT/Triple.h"
+#include "llvm/ADT/Twine.h"
+#include "llvm/Support/ErrorOr.h"
#include "llvm/Support/FileSystem.h"
-#include "llvm/Support/Path.h"
#include "llvm/Support/Program.h"
-#include "llvm/Support/raw_ostream.h" // for raw_ostream, fs
+#include "llvm/Support/raw_ostream.h"
#include <algorithm> // for replace, min, unique
#include <system_error> // for error_code
@@ -37,113 +35,35 @@ using namespace lldb_private;
namespace {
-static constexpr FileSpec::PathSyntax GetNativeSyntax() {
-#if defined(LLVM_ON_WIN32)
- return FileSpec::ePathSyntaxWindows;
+static constexpr FileSpec::Style GetNativeStyle() {
+#if defined(_WIN32)
+ return FileSpec::Style::windows;
#else
- return FileSpec::ePathSyntaxPosix;
+ return FileSpec::Style::posix;
#endif
}
-bool PathSyntaxIsPosix(FileSpec::PathSyntax syntax) {
- return (syntax == FileSpec::ePathSyntaxPosix ||
- (syntax == FileSpec::ePathSyntaxHostNative &&
- GetNativeSyntax() == FileSpec::ePathSyntaxPosix));
+bool PathStyleIsPosix(FileSpec::Style style) {
+ return (style == FileSpec::Style::posix ||
+ (style == FileSpec::Style::native &&
+ GetNativeStyle() == FileSpec::Style::posix));
}
-const char *GetPathSeparators(FileSpec::PathSyntax syntax) {
- return PathSyntaxIsPosix(syntax) ? "/" : "\\/";
+const char *GetPathSeparators(FileSpec::Style style) {
+ return llvm::sys::path::get_separator(style).data();
}
-char GetPreferredPathSeparator(FileSpec::PathSyntax syntax) {
- return GetPathSeparators(syntax)[0];
+char GetPreferredPathSeparator(FileSpec::Style style) {
+ return GetPathSeparators(style)[0];
}
-bool IsPathSeparator(char value, FileSpec::PathSyntax syntax) {
- return value == '/' || (!PathSyntaxIsPosix(syntax) && value == '\\');
-}
-
-void Normalize(llvm::SmallVectorImpl<char> &path, FileSpec::PathSyntax syntax) {
- if (PathSyntaxIsPosix(syntax))
- return;
-
- std::replace(path.begin(), path.end(), '\\', '/');
- // Windows path can have \\ slashes which can be changed by replace
- // call above to //. Here we remove the duplicate.
- auto iter = std::unique(path.begin(), path.end(), [](char &c1, char &c2) {
- return (c1 == '/' && c2 == '/');
- });
- path.erase(iter, path.end());
-}
-
-void Denormalize(llvm::SmallVectorImpl<char> &path,
- FileSpec::PathSyntax syntax) {
- if (PathSyntaxIsPosix(syntax))
+void Denormalize(llvm::SmallVectorImpl<char> &path, FileSpec::Style style) {
+ if (PathStyleIsPosix(style))
return;
std::replace(path.begin(), path.end(), '/', '\\');
}
-size_t FilenamePos(llvm::StringRef str, FileSpec::PathSyntax syntax) {
- if (str.size() == 2 && IsPathSeparator(str[0], syntax) && str[0] == str[1])
- return 0;
-
- if (str.size() > 0 && IsPathSeparator(str.back(), syntax))
- return str.size() - 1;
-
- size_t pos = str.find_last_of(GetPathSeparators(syntax), str.size() - 1);
-
- if (!PathSyntaxIsPosix(syntax) && pos == llvm::StringRef::npos)
- pos = str.find_last_of(':', str.size() - 2);
-
- if (pos == llvm::StringRef::npos ||
- (pos == 1 && IsPathSeparator(str[0], syntax)))
- return 0;
-
- return pos + 1;
-}
-
-size_t RootDirStart(llvm::StringRef str, FileSpec::PathSyntax syntax) {
- // case "c:/"
- if (!PathSyntaxIsPosix(syntax) &&
- (str.size() > 2 && str[1] == ':' && IsPathSeparator(str[2], syntax)))
- return 2;
-
- // case "//"
- if (str.size() == 2 && IsPathSeparator(str[0], syntax) && str[0] == str[1])
- return llvm::StringRef::npos;
-
- // case "//net"
- if (str.size() > 3 && IsPathSeparator(str[0], syntax) && str[0] == str[1] &&
- !IsPathSeparator(str[2], syntax))
- return str.find_first_of(GetPathSeparators(syntax), 2);
-
- // case "/"
- if (str.size() > 0 && IsPathSeparator(str[0], syntax))
- return 0;
-
- return llvm::StringRef::npos;
-}
-
-size_t ParentPathEnd(llvm::StringRef path, FileSpec::PathSyntax syntax) {
- size_t end_pos = FilenamePos(path, syntax);
-
- bool filename_was_sep =
- path.size() > 0 && IsPathSeparator(path[end_pos], syntax);
-
- // Skip separators except for root dir.
- size_t root_dir_pos = RootDirStart(path.substr(0, end_pos), syntax);
-
- while (end_pos > 0 && (end_pos - 1) != root_dir_pos &&
- IsPathSeparator(path[end_pos - 1], syntax))
- --end_pos;
-
- if (end_pos == 1 && root_dir_pos == 0 && filename_was_sep)
- return llvm::StringRef::npos;
-
- return end_pos;
-}
-
} // end anonymous namespace
void FileSpec::Resolve(llvm::SmallVectorImpl<char> &path) {
@@ -164,28 +84,27 @@ void FileSpec::Resolve(llvm::SmallVectorImpl<char> &path) {
}
}
-FileSpec::FileSpec() : m_syntax(GetNativeSyntax()) {}
+FileSpec::FileSpec() : m_style(GetNativeStyle()) {}
//------------------------------------------------------------------
-// Default constructor that can take an optional full path to a
-// file on disk.
+// Default constructor that can take an optional full path to a file on disk.
//------------------------------------------------------------------
-FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, PathSyntax syntax)
- : m_syntax(syntax) {
- SetFile(path, resolve_path, syntax);
+FileSpec::FileSpec(llvm::StringRef path, bool resolve_path, Style style)
+ : m_style(style) {
+ SetFile(path, resolve_path, style);
}
FileSpec::FileSpec(llvm::StringRef path, bool resolve_path,
const llvm::Triple &Triple)
: FileSpec{path, resolve_path,
- Triple.isOSWindows() ? ePathSyntaxWindows : ePathSyntaxPosix} {}
+ Triple.isOSWindows() ? Style::windows : Style::posix} {}
//------------------------------------------------------------------
// Copy constructor
//------------------------------------------------------------------
FileSpec::FileSpec(const FileSpec &rhs)
: m_directory(rhs.m_directory), m_filename(rhs.m_filename),
- m_is_resolved(rhs.m_is_resolved), m_syntax(rhs.m_syntax) {}
+ m_is_resolved(rhs.m_is_resolved), m_style(rhs.m_style) {}
//------------------------------------------------------------------
// Copy constructor
@@ -200,6 +119,100 @@ FileSpec::FileSpec(const FileSpec *rhs) : m_directory(), m_filename() {
//------------------------------------------------------------------
FileSpec::~FileSpec() {}
+namespace {
+//------------------------------------------------------------------
+/// Safely get a character at the specified index.
+///
+/// @param[in] path
+/// A full, partial, or relative path to a file.
+///
+/// @param[in] i
+/// An index into path which may or may not be valid.
+///
+/// @return
+/// The character at index \a i if the index is valid, or 0 if
+/// the index is not valid.
+//------------------------------------------------------------------
+inline char safeCharAtIndex(const llvm::StringRef &path, size_t i) {
+ if (i < path.size())
+ return path[i];
+ return 0;
+}
+
+//------------------------------------------------------------------
+/// Check if a path needs to be normalized.
+///
+/// Check if a path needs to be normalized. We currently consider a
+/// path to need normalization if any of the following are true
+/// - path contains "/./"
+/// - path contains "/../"
+/// - path contains "//"
+/// - path ends with "/"
+/// Paths that start with "./" or with "../" are not considered to
+/// need normalization since we aren't trying to resolve the path,
+/// we are just trying to remove redundant things from the path.
+///
+/// @param[in] path
+/// A full, partial, or relative path to a file.
+///
+/// @return
+/// Returns \b true if the path needs to be normalized.
+//------------------------------------------------------------------
+bool needsNormalization(const llvm::StringRef &path) {
+ if (path.empty())
+ return false;
+ // We strip off leading "." values so these paths need to be normalized
+ if (path[0] == '.')
+ return true;
+ for (auto i = path.find_first_of("\\/"); i != llvm::StringRef::npos;
+ i = path.find_first_of("\\/", i + 1)) {
+ const auto next = safeCharAtIndex(path, i+1);
+ switch (next) {
+ case 0:
+ // path separator char at the end of the string which should be
+ // stripped unless it is the one and only character
+ return i > 0;
+ case '/':
+ case '\\':
+ // two path separator chars in the middle of a path needs to be
+ // normalized
+ if (i > 0)
+ return true;
+ ++i;
+ break;
+
+ case '.': {
+ const auto next_next = safeCharAtIndex(path, i+2);
+ switch (next_next) {
+ default: break;
+ case 0: return true; // ends with "/."
+ case '/':
+ case '\\':
+ return true; // contains "/./"
+ case '.': {
+ const auto next_next_next = safeCharAtIndex(path, i+3);
+ switch (next_next_next) {
+ default: break;
+ case 0: return true; // ends with "/.."
+ case '/':
+ case '\\':
+ return true; // contains "/../"
+ }
+ break;
+ }
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+ return false;
+}
+
+
+}
//------------------------------------------------------------------
// Assignment operator.
//------------------------------------------------------------------
@@ -208,26 +221,25 @@ const FileSpec &FileSpec::operator=(const FileSpec &rhs) {
m_directory = rhs.m_directory;
m_filename = rhs.m_filename;
m_is_resolved = rhs.m_is_resolved;
- m_syntax = rhs.m_syntax;
+ m_style = rhs.m_style;
}
return *this;
}
+void FileSpec::SetFile(llvm::StringRef pathname, bool resolve) {
+ SetFile(pathname, resolve, m_style);
+}
+
//------------------------------------------------------------------
-// Update the contents of this object with a new path. The path will
-// be split up into a directory and filename and stored as uniqued
-// string values for quick comparison and efficient memory usage.
+// Update the contents of this object with a new path. The path will be split
+// up into a directory and filename and stored as uniqued string values for
+// quick comparison and efficient memory usage.
//------------------------------------------------------------------
-void FileSpec::SetFile(llvm::StringRef pathname, bool resolve,
- PathSyntax syntax) {
- // CLEANUP: Use StringRef for string handling. This function is kind of a
- // mess and the unclear semantics of RootDirStart and ParentPathEnd make
- // it very difficult to understand this function. There's no reason this
- // function should be particularly complicated or difficult to understand.
+void FileSpec::SetFile(llvm::StringRef pathname, bool resolve, Style style) {
m_filename.Clear();
m_directory.Clear();
m_is_resolved = false;
- m_syntax = (syntax == ePathSyntaxHostNative) ? GetNativeSyntax() : syntax;
+ m_style = (style == Style::native) ? GetNativeStyle() : style;
if (pathname.empty())
return;
@@ -239,39 +251,41 @@ void FileSpec::SetFile(llvm::StringRef pathname, bool resolve,
m_is_resolved = true;
}
- Normalize(resolved, m_syntax);
+ // Normalize the path by removing ".", ".." and other redundant components.
+ if (needsNormalization(resolved))
+ llvm::sys::path::remove_dots(resolved, true, m_style);
- llvm::StringRef resolve_path_ref(resolved.c_str());
- size_t dir_end = ParentPathEnd(resolve_path_ref, m_syntax);
- if (dir_end == 0) {
- m_filename.SetString(resolve_path_ref);
+ // Normalize back slashes to forward slashes
+ if (m_style == Style::windows)
+ std::replace(resolved.begin(), resolved.end(), '\\', '/');
+
+ if (resolved.empty()) {
+ // If we have no path after normalization set the path to the current
+ // directory. This matches what python does and also a few other path
+ // utilities.
+ m_filename.SetString(".");
return;
}
- m_directory.SetString(resolve_path_ref.substr(0, dir_end));
-
- size_t filename_begin = dir_end;
- size_t root_dir_start = RootDirStart(resolve_path_ref, m_syntax);
- while (filename_begin != llvm::StringRef::npos &&
- filename_begin < resolve_path_ref.size() &&
- filename_begin != root_dir_start &&
- IsPathSeparator(resolve_path_ref[filename_begin], m_syntax))
- ++filename_begin;
- m_filename.SetString((filename_begin == llvm::StringRef::npos ||
- filename_begin >= resolve_path_ref.size())
- ? "."
- : resolve_path_ref.substr(filename_begin));
+ // Split path into filename and directory. We rely on the underlying char
+ // pointer to be nullptr when the components are empty.
+ llvm::StringRef filename = llvm::sys::path::filename(resolved, m_style);
+ if(!filename.empty())
+ m_filename.SetString(filename);
+ llvm::StringRef directory = llvm::sys::path::parent_path(resolved, m_style);
+ if(!directory.empty())
+ m_directory.SetString(directory);
}
void FileSpec::SetFile(llvm::StringRef path, bool resolve,
const llvm::Triple &Triple) {
return SetFile(path, resolve,
- Triple.isOSWindows() ? ePathSyntaxWindows : ePathSyntaxPosix);
+ Triple.isOSWindows() ? Style::windows : Style::posix);
}
//----------------------------------------------------------------------
-// Convert to pointer operator. This allows code to check any FileSpec
-// objects to see if they contain anything valid using code such as:
+// Convert to pointer operator. This allows code to check any FileSpec objects
+// to see if they contain anything valid using code such as:
//
// if (file_spec)
// {}
@@ -279,8 +293,8 @@ void FileSpec::SetFile(llvm::StringRef path, bool resolve,
FileSpec::operator bool() const { return m_filename || m_directory; }
//----------------------------------------------------------------------
-// Logical NOT operator. This allows code to check any FileSpec
-// objects to see if they are invalid using code such as:
+// Logical NOT operator. This allows code to check any FileSpec objects to see
+// if they are invalid using code such as:
//
// if (!file_spec)
// {}
@@ -307,12 +321,10 @@ bool FileSpec::operator==(const FileSpec &rhs) const {
return true;
// TODO: determine if we want to keep this code in here.
- // The code below was added to handle a case where we were
- // trying to set a file and line breakpoint and one path
- // was resolved, and the other not and the directory was
- // in a mount point that resolved to a more complete path:
- // "/tmp/a.c" == "/private/tmp/a.c". I might end up pulling
- // this out...
+ // The code below was added to handle a case where we were trying to set a
+ // file and line breakpoint and one path was resolved, and the other not and
+ // the directory was in a mount point that resolved to a more complete path:
+ // "/tmp/a.c" == "/private/tmp/a.c". I might end up pulling this out...
if (IsResolved() && rhs.IsResolved()) {
// Both paths are resolved, no need to look further...
return false;
@@ -324,8 +336,8 @@ bool FileSpec::operator==(const FileSpec &rhs) const {
if (!IsResolved()) {
if (resolved_lhs.ResolvePath()) {
// This path wasn't resolved but now it is. Check if the resolved
- // directory is the same as our unresolved directory, and if so,
- // we can mark this object as resolved to avoid more future resolves
+ // directory is the same as our unresolved directory, and if so, we can
+ // mark this object as resolved to avoid more future resolves
m_is_resolved = (m_directory == resolved_lhs.m_directory);
} else
return false;
@@ -335,16 +347,16 @@ bool FileSpec::operator==(const FileSpec &rhs) const {
if (!rhs.IsResolved()) {
if (resolved_rhs.ResolvePath()) {
// rhs's path wasn't resolved but now it is. Check if the resolved
- // directory is the same as rhs's unresolved directory, and if so,
- // we can mark this object as resolved to avoid more future resolves
+ // directory is the same as rhs's unresolved directory, and if so, we can
+ // mark this object as resolved to avoid more future resolves
rhs.m_is_resolved = (rhs.m_directory == resolved_rhs.m_directory);
} else
return false;
}
- // If we reach this point in the code we were able to resolve both paths
- // and since we only resolve the paths if the basenames are equal, then
- // we can just check if both directories are equal...
+ // If we reach this point in the code we were able to resolve both paths and
+ // since we only resolve the paths if the basenames are equal, then we can
+ // just check if both directories are equal...
return DirectoryEquals(rhs);
}
@@ -369,8 +381,8 @@ Stream &lldb_private::operator<<(Stream &s, const FileSpec &f) {
}
//------------------------------------------------------------------
-// Clear this object by releasing both the directory and filename
-// string values and making them both the empty string.
+// Clear this object by releasing both the directory and filename string values
+// and making them both the empty string.
//------------------------------------------------------------------
void FileSpec::Clear() {
m_directory.Clear();
@@ -378,15 +390,14 @@ void FileSpec::Clear() {
}
//------------------------------------------------------------------
-// Compare two FileSpec objects. If "full" is true, then both
-// the directory and the filename must match. If "full" is false,
-// then the directory names for "a" and "b" are only compared if
-// they are both non-empty. This allows a FileSpec object to only
-// contain a filename and it can match FileSpec objects that have
-// matching filenames with different paths.
+// Compare two FileSpec objects. If "full" is true, then both the directory and
+// the filename must match. If "full" is false, then the directory names for
+// "a" and "b" are only compared if they are both non-empty. This allows a
+// FileSpec object to only contain a filename and it can match FileSpec objects
+// that have matching filenames with different paths.
//
-// Return -1 if the "a" is less than "b", 0 if "a" is equal to "b"
-// and "1" if "a" is greater than "b".
+// Return -1 if the "a" is less than "b", 0 if "a" is equal to "b" and "1" if
+// "a" is greater than "b".
//------------------------------------------------------------------
int FileSpec::Compare(const FileSpec &a, const FileSpec &b, bool full) {
int result = 0;
@@ -396,10 +407,10 @@ int FileSpec::Compare(const FileSpec &a, const FileSpec &b, bool full) {
// If full is true, then we must compare both the directory and filename.
- // If full is false, then if either directory is empty, then we match on
- // the basename only, and if both directories have valid values, we still
- // do a full compare. This allows for matching when we just have a filename
- // in one of the FileSpec objects.
+ // If full is false, then if either directory is empty, then we match on the
+ // basename only, and if both directories have valid values, we still do a
+ // full compare. This allows for matching when we just have a filename in one
+ // of the FileSpec objects.
if (full || (a.m_directory && b.m_directory)) {
result = ConstString::Compare(a.m_directory, b.m_directory, case_sensitive);
@@ -409,118 +420,33 @@ int FileSpec::Compare(const FileSpec &a, const FileSpec &b, bool full) {
return ConstString::Compare(a.m_filename, b.m_filename, case_sensitive);
}
-bool FileSpec::Equal(const FileSpec &a, const FileSpec &b, bool full,
- bool remove_backups) {
- static ConstString g_dot_string(".");
- static ConstString g_dot_dot_string("..");
-
+bool FileSpec::Equal(const FileSpec &a, const FileSpec &b, bool full) {
// case sensitivity of equality test
const bool case_sensitive = a.IsCaseSensitive() || b.IsCaseSensitive();
-
- bool filenames_equal = ConstString::Equals(a.m_filename,
- b.m_filename,
- case_sensitive);
-
- // The only way two FileSpecs can be equal if their filenames are
- // unequal is if we are removing backups and one or the other filename
- // is a backup string:
- if (!filenames_equal && !remove_backups)
- return false;
+ const bool filenames_equal = ConstString::Equals(a.m_filename,
+ b.m_filename,
+ case_sensitive);
- bool last_component_is_dot = ConstString::Equals(a.m_filename, g_dot_string)
- || ConstString::Equals(a.m_filename,
- g_dot_dot_string)
- || ConstString::Equals(b.m_filename,
- g_dot_string)
- || ConstString::Equals(b.m_filename,
- g_dot_dot_string);
-
- if (!filenames_equal && !last_component_is_dot)
+ if (!filenames_equal)
return false;
if (!full && (a.GetDirectory().IsEmpty() || b.GetDirectory().IsEmpty()))
return filenames_equal;
- if (remove_backups == false)
- return a == b;
-
- if (a == b)
- return true;
-
- return Equal(a.GetNormalizedPath(), b.GetNormalizedPath(), full, false);
-}
-
-FileSpec FileSpec::GetNormalizedPath() const {
- // Fast path. Do nothing if the path is not interesting.
- if (!m_directory.GetStringRef().contains(".") &&
- !m_directory.GetStringRef().contains("//") &&
- m_filename.GetStringRef() != ".." && m_filename.GetStringRef() != ".")
- return *this;
-
- llvm::SmallString<64> path, result;
- const bool normalize = false;
- GetPath(path, normalize);
- llvm::StringRef rest(path);
-
- // We will not go below root dir.
- size_t root_dir_start = RootDirStart(path, m_syntax);
- const bool absolute = root_dir_start != llvm::StringRef::npos;
- if (absolute) {
- result += rest.take_front(root_dir_start + 1);
- rest = rest.drop_front(root_dir_start + 1);
- } else {
- if (m_syntax == ePathSyntaxWindows && path.size() > 2 && path[1] == ':') {
- result += rest.take_front(2);
- rest = rest.drop_front(2);
- }
- }
-
- bool anything_added = false;
- llvm::SmallVector<llvm::StringRef, 0> components, processed;
- rest.split(components, '/', -1, false);
- processed.reserve(components.size());
- for (auto component : components) {
- if (component == ".")
- continue; // Skip these.
- if (component != "..") {
- processed.push_back(component);
- continue; // Regular file name.
- }
- if (!processed.empty()) {
- processed.pop_back();
- continue; // Dots. Go one level up if we can.
- }
- if (absolute)
- continue; // We're at the top level. Cannot go higher than that. Skip.
-
- result += component; // We're a relative path. We need to keep these.
- result += '/';
- anything_added = true;
- }
- for (auto component : processed) {
- result += component;
- result += '/';
- anything_added = true;
- }
- if (anything_added)
- result.pop_back(); // Pop last '/'.
- else if (result.empty())
- result = ".";
-
- return FileSpec(result, false, m_syntax);
+ return a == b;
}
//------------------------------------------------------------------
-// Dump the object to the supplied stream. If the object contains
-// a valid directory name, it will be displayed followed by a
-// directory delimiter, and the filename.
+// Dump the object to the supplied stream. If the object contains a valid
+// directory name, it will be displayed followed by a directory delimiter, and
+// the filename.
//------------------------------------------------------------------
void FileSpec::Dump(Stream *s) const {
if (s) {
std::string path{GetPath(true)};
s->PutCString(path);
- char path_separator = GetPreferredPathSeparator(m_syntax);
+ char path_separator = GetPreferredPathSeparator(m_style);
if (!m_filename && !path.empty() && path.back() != path_separator)
s->PutChar(path_separator);
}
@@ -557,8 +483,7 @@ bool FileSpec::ResolveExecutableLocation() {
return true;
else {
// If FindProgramByName found the file, it returns the directory +
- // filename in its return results.
- // We need to separate them.
+ // filename in its return results. We need to separate them.
FileSpec tmp_file(dir_ref.data(), false);
if (tmp_file.Exists()) {
m_directory = tmp_file.m_directory;
@@ -588,7 +513,7 @@ uint64_t FileSpec::GetByteSize() const {
return Size;
}
-FileSpec::PathSyntax FileSpec::GetPathSyntax() const { return m_syntax; }
+FileSpec::Style FileSpec::GetPathStyle() const { return m_style; }
uint32_t FileSpec::GetPermissions() const {
namespace fs = llvm::sys::fs;
@@ -620,9 +545,8 @@ ConstString &FileSpec::GetFilename() { return m_filename; }
const ConstString &FileSpec::GetFilename() const { return m_filename; }
//------------------------------------------------------------------
-// Extract the directory and path into a fixed buffer. This is
-// needed as the directory and path are stored in separate string
-// values.
+// Extract the directory and path into a fixed buffer. This is needed as the
+// directory and path are stored in separate string values.
//------------------------------------------------------------------
size_t FileSpec::GetPath(char *path, size_t path_max_len,
bool denormalize) const {
@@ -648,42 +572,30 @@ void FileSpec::GetPath(llvm::SmallVectorImpl<char> &path,
bool denormalize) const {
path.append(m_directory.GetStringRef().begin(),
m_directory.GetStringRef().end());
- if (m_directory && m_filename &&
- !IsPathSeparator(m_directory.GetStringRef().back(), m_syntax))
- path.insert(path.end(), GetPreferredPathSeparator(m_syntax));
+ // Since the path was normalized and all paths use '/' when stored in these
+ // objects, we don't need to look for the actual syntax specific path
+ // separator, we just look for and insert '/'.
+ if (m_directory && m_filename && m_directory.GetStringRef().back() != '/' &&
+ m_filename.GetStringRef().back() != '/')
+ path.insert(path.end(), '/');
path.append(m_filename.GetStringRef().begin(),
m_filename.GetStringRef().end());
- Normalize(path, m_syntax);
if (denormalize && !path.empty())
- Denormalize(path, m_syntax);
+ Denormalize(path, m_style);
}
ConstString FileSpec::GetFileNameExtension() const {
- if (m_filename) {
- const char *filename = m_filename.GetCString();
- const char *dot_pos = strrchr(filename, '.');
- if (dot_pos && dot_pos[1] != '\0')
- return ConstString(dot_pos + 1);
- }
- return ConstString();
+ return ConstString(
+ llvm::sys::path::extension(m_filename.GetStringRef(), m_style));
}
ConstString FileSpec::GetFileNameStrippingExtension() const {
- const char *filename = m_filename.GetCString();
- if (filename == NULL)
- return ConstString();
-
- const char *dot_pos = strrchr(filename, '.');
- if (dot_pos == NULL)
- return m_filename;
-
- return ConstString(filename, dot_pos - filename);
+ return ConstString(llvm::sys::path::stem(m_filename.GetStringRef(), m_style));
}
//------------------------------------------------------------------
-// Return the size in bytes that this object takes in memory. This
-// returns the size in bytes of this object, not any shared string
-// values it may refer to.
+// Return the size in bytes that this object takes in memory. This returns the
+// size in bytes of this object, not any shared string values it may refer to.
//------------------------------------------------------------------
size_t FileSpec::MemorySize() const {
return m_filename.MemorySize() + m_directory.MemorySize();
@@ -730,91 +642,28 @@ FileSpec::CopyByAppendingPathComponent(llvm::StringRef component) const {
}
FileSpec FileSpec::CopyByRemovingLastPathComponent() const {
- // CLEANUP: Use StringRef for string handling.
- const bool resolve = false;
- if (m_filename.IsEmpty() && m_directory.IsEmpty())
- return FileSpec("", resolve);
- if (m_directory.IsEmpty())
- return FileSpec("", resolve);
- if (m_filename.IsEmpty()) {
- const char *dir_cstr = m_directory.GetCString();
- const char *last_slash_ptr = ::strrchr(dir_cstr, '/');
-
- // check for obvious cases before doing the full thing
- if (!last_slash_ptr)
- return FileSpec("", resolve);
- if (last_slash_ptr == dir_cstr)
- return FileSpec("/", resolve);
-
- size_t last_slash_pos = last_slash_ptr - dir_cstr + 1;
- ConstString new_path(dir_cstr, last_slash_pos);
- return FileSpec(new_path.GetCString(), resolve);
- } else
- return FileSpec(m_directory.GetCString(), resolve);
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+ if (llvm::sys::path::has_parent_path(current_path, m_style))
+ return FileSpec(llvm::sys::path::parent_path(current_path, m_style), false,
+ m_style);
+ return *this;
}
ConstString FileSpec::GetLastPathComponent() const {
- // CLEANUP: Use StringRef for string handling.
- if (m_filename)
- return m_filename;
- if (m_directory) {
- const char *dir_cstr = m_directory.GetCString();
- const char *last_slash_ptr = ::strrchr(dir_cstr, '/');
- if (last_slash_ptr == NULL)
- return m_directory;
- if (last_slash_ptr == dir_cstr) {
- if (last_slash_ptr[1] == 0)
- return ConstString(last_slash_ptr);
- else
- return ConstString(last_slash_ptr + 1);
- }
- if (last_slash_ptr[1] != 0)
- return ConstString(last_slash_ptr + 1);
- const char *penultimate_slash_ptr = last_slash_ptr;
- while (*penultimate_slash_ptr) {
- --penultimate_slash_ptr;
- if (penultimate_slash_ptr == dir_cstr)
- break;
- if (*penultimate_slash_ptr == '/')
- break;
- }
- ConstString result(penultimate_slash_ptr + 1,
- last_slash_ptr - penultimate_slash_ptr);
- return result;
- }
- return ConstString();
-}
-
-static std::string
-join_path_components(FileSpec::PathSyntax syntax,
- const std::vector<llvm::StringRef> components) {
- std::string result;
- for (size_t i = 0; i < components.size(); ++i) {
- if (components[i].empty())
- continue;
- result += components[i];
- if (i != components.size() - 1 &&
- !IsPathSeparator(components[i].back(), syntax))
- result += GetPreferredPathSeparator(syntax);
- }
-
- return result;
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+ return ConstString(llvm::sys::path::filename(current_path, m_style));
}
void FileSpec::PrependPathComponent(llvm::StringRef component) {
- if (component.empty())
- return;
-
- const bool resolve = false;
- if (m_filename.IsEmpty() && m_directory.IsEmpty()) {
- SetFile(component, resolve);
- return;
- }
-
- std::string result =
- join_path_components(m_syntax, {component, m_directory.GetStringRef(),
- m_filename.GetStringRef()});
- SetFile(result, resolve, m_syntax);
+ llvm::SmallString<64> new_path(component);
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+ llvm::sys::path::append(new_path,
+ llvm::sys::path::begin(current_path, m_style),
+ llvm::sys::path::end(current_path), m_style);
+ SetFile(new_path, false, m_style);
}
void FileSpec::PrependPathComponent(const FileSpec &new_path) {
@@ -822,53 +671,24 @@ void FileSpec::PrependPathComponent(const FileSpec &new_path) {
}
void FileSpec::AppendPathComponent(llvm::StringRef component) {
- if (component.empty())
- return;
-
- component = component.drop_while(
- [this](char c) { return IsPathSeparator(c, m_syntax); });
-
- std::string result =
- join_path_components(m_syntax, {m_directory.GetStringRef(),
- m_filename.GetStringRef(), component});
-
- SetFile(result, false, m_syntax);
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+ llvm::sys::path::append(current_path, m_style, component);
+ SetFile(current_path, false, m_style);
}
void FileSpec::AppendPathComponent(const FileSpec &new_path) {
return AppendPathComponent(new_path.GetPath(false));
}
-void FileSpec::RemoveLastPathComponent() {
- // CLEANUP: Use StringRef for string handling.
-
- const bool resolve = false;
- if (m_filename.IsEmpty() && m_directory.IsEmpty()) {
- SetFile("", resolve);
- return;
- }
- if (m_directory.IsEmpty()) {
- SetFile("", resolve);
- return;
+bool FileSpec::RemoveLastPathComponent() {
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+ if (llvm::sys::path::has_parent_path(current_path, m_style)) {
+ SetFile(llvm::sys::path::parent_path(current_path, m_style), false);
+ return true;
}
- if (m_filename.IsEmpty()) {
- const char *dir_cstr = m_directory.GetCString();
- const char *last_slash_ptr = ::strrchr(dir_cstr, '/');
-
- // check for obvious cases before doing the full thing
- if (!last_slash_ptr) {
- SetFile("", resolve);
- return;
- }
- if (last_slash_ptr == dir_cstr) {
- SetFile("/", resolve);
- return;
- }
- size_t last_slash_pos = last_slash_ptr - dir_cstr + 1;
- ConstString new_path(dir_cstr, last_slash_pos);
- SetFile(new_path.GetCString(), resolve);
- } else
- SetFile(m_directory.GetCString(), resolve);
+ return false;
}
//------------------------------------------------------------------
/// Returns true if the filespec represents an implementation source
@@ -885,7 +705,7 @@ bool FileSpec::IsSourceImplementationFile() const {
return false;
static RegularExpression g_source_file_regex(llvm::StringRef(
- "^([cC]|[mM]|[mM][mM]|[cC][pP][pP]|[cC]\\+\\+|[cC][xX][xX]|[cC][cC]|["
+ "^.([cC]|[mM]|[mM][mM]|[cC][pP][pP]|[cC]\\+\\+|[cC][xX][xX]|[cC][cC]|["
"cC][pP]|[sS]|[aA][sS][mM]|[fF]|[fF]77|[fF]90|[fF]95|[fF]03|[fF][oO]["
"rR]|[fF][tT][nN]|[fF][pP][pP]|[aA][dD][aA]|[aA][dD][bB]|[aA][dD][sS])"
"$"));
@@ -893,34 +713,23 @@ bool FileSpec::IsSourceImplementationFile() const {
}
bool FileSpec::IsRelative() const {
- const char *dir = m_directory.GetCString();
- llvm::StringRef directory(dir ? dir : "");
+ return !IsAbsolute();
+}
- if (directory.size() > 0) {
- if (PathSyntaxIsPosix(m_syntax)) {
- // If the path doesn't start with '/' or '~', return true
- switch (directory[0]) {
- case '/':
- case '~':
- return false;
- default:
- return true;
- }
- } else {
- if (directory.size() >= 2 && directory[1] == ':')
- return false;
- if (directory[0] == '/')
- return false;
- return true;
- }
- } else if (m_filename) {
- // No directory, just a basename, return true
+bool FileSpec::IsAbsolute() const {
+ llvm::SmallString<64> current_path;
+ GetPath(current_path, false);
+
+ // Early return if the path is empty.
+ if (current_path.empty())
+ return false;
+
+ // We consider paths starting with ~ to be absolute.
+ if (current_path[0] == '~')
return true;
- }
- return false;
-}
-bool FileSpec::IsAbsolute() const { return !FileSpec::IsRelative(); }
+ return llvm::sys::path::is_absolute(current_path, m_style);
+}
void llvm::format_provider<FileSpec>::format(const FileSpec &F,
raw_ostream &Stream,
@@ -944,14 +753,13 @@ void llvm::format_provider<FileSpec>::format(const FileSpec &F,
// Style is either D or empty, either way we need to print the directory.
if (!dir.empty()) {
- // Directory is stored in normalized form, which might be different
- // than preferred form. In order to handle this, we need to cut off
- // the filename, then denormalize, then write the entire denorm'ed
- // directory.
+ // Directory is stored in normalized form, which might be different than
+ // preferred form. In order to handle this, we need to cut off the
+ // filename, then denormalize, then write the entire denorm'ed directory.
llvm::SmallString<64> denormalized_dir = dir;
- Denormalize(denormalized_dir, F.GetPathSyntax());
+ Denormalize(denormalized_dir, F.GetPathStyle());
Stream << denormalized_dir;
- Stream << GetPreferredPathSeparator(F.GetPathSyntax());
+ Stream << GetPreferredPathSeparator(F.GetPathStyle());
}
if (Style.equals_lower("D")) {
diff --git a/source/Utility/History.cpp b/source/Utility/History.cpp
deleted file mode 100644
index 10344b67c635..000000000000
--- a/source/Utility/History.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-//===-- History.cpp ---------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "lldb/Utility/History.h"
-
-// C Includes
-#include <inttypes.h>
-// C++ Includes
-// Other libraries and framework includes
-// Project includes
-#include "lldb/Utility/Stream.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-void HistorySourceUInt::DumpHistoryEvent(Stream &strm, HistoryEvent event) {
- strm.Printf("%s %" PRIu64, m_name.c_str(), (uint64_t)((uintptr_t)event));
-}
diff --git a/source/Utility/JSON.cpp b/source/Utility/JSON.cpp
index 9049f596ab9a..7d70034ccabd 100644
--- a/source/Utility/JSON.cpp
+++ b/source/Utility/JSON.cpp
@@ -449,8 +449,7 @@ int JSONParser::GetEscapedChar(bool &was_escaped) {
JSONValue::SP JSONParser::ParseJSONObject() {
// The "JSONParser::Token::ObjectStart" token should have already been
- // consumed
- // by the time this function is called
+ // consumed by the time this function is called
std::unique_ptr<JSONObject> dict_up(new JSONObject());
std::string value;
@@ -481,8 +480,7 @@ JSONValue::SP JSONParser::ParseJSONObject() {
JSONValue::SP JSONParser::ParseJSONArray() {
// The "JSONParser::Token::ObjectStart" token should have already been
- // consumed
- // by the time this function is called
+ // consumed by the time this function is called
std::unique_ptr<JSONArray> array_up(new JSONArray());
std::string value;
diff --git a/source/Utility/Log.cpp b/source/Utility/Log.cpp
index f247124f8d63..eb026fb04752 100644
--- a/source/Utility/Log.cpp
+++ b/source/Utility/Log.cpp
@@ -28,7 +28,7 @@
#include <utility> // for pair
#include <assert.h> // for assert
-#if defined(LLVM_ON_WIN32)
+#if defined(_WIN32)
#include <process.h> // for getpid
#else
#include <unistd.h>
@@ -121,9 +121,9 @@ void Log::Printf(const char *format, ...) {
}
//----------------------------------------------------------------------
-// All logging eventually boils down to this function call. If we have
-// a callback registered, then we call the logging callback. If we have
-// a valid file handle, we also log to the file.
+// All logging eventually boils down to this function call. If we have a
+// callback registered, then we call the logging callback. If we have a valid
+// file handle, we also log to the file.
//----------------------------------------------------------------------
void Log::VAPrintf(const char *format, va_list args) {
llvm::SmallString<64> FinalMessage;
@@ -156,8 +156,7 @@ void Log::VAError(const char *format, va_list args) {
}
//----------------------------------------------------------------------
-// Printing of warnings that are not fatal only if verbose mode is
-// enabled.
+// Printing of warnings that are not fatal only if verbose mode is enabled.
//----------------------------------------------------------------------
void Log::Verbose(const char *format, ...) {
if (!GetVerbose())
@@ -287,7 +286,11 @@ void Log::WriteHeader(llvm::raw_ostream &OS, llvm::StringRef file,
if (options.Test(LLDB_LOG_OPTION_PREPEND_THREAD_NAME)) {
llvm::SmallString<32> thread_name;
llvm::get_thread_name(thread_name);
- OS << llvm::formatv("{0,-16} ", thread_name);
+
+ llvm::SmallString<12> format_str;
+ llvm::raw_svector_ostream format_os(format_str);
+ format_os << "{0,-" << llvm::alignTo<16>(thread_name.size()) << "} ";
+ OS << llvm::formatv(format_str.c_str(), thread_name);
}
if (options.Test(LLDB_LOG_OPTION_BACKTRACE))
@@ -302,8 +305,8 @@ void Log::WriteHeader(llvm::raw_ostream &OS, llvm::StringRef file,
}
void Log::WriteMessage(const std::string &message) {
- // Make a copy of our stream shared pointer in case someone disables our
- // log while we are logging and releases the stream
+ // Make a copy of our stream shared pointer in case someone disables our log
+ // while we are logging and releases the stream
auto stream_sp = GetStream();
if (!stream_sp)
return;
diff --git a/source/Utility/PPC64_DWARF_Registers.h b/source/Utility/PPC64_DWARF_Registers.h
new file mode 100644
index 000000000000..7e3619e0da4d
--- /dev/null
+++ b/source/Utility/PPC64_DWARF_Registers.h
@@ -0,0 +1,127 @@
+//===-- PPC64_DWARF_Registers.h ---------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef utility_PPC64_DWARF_Registers_h_
+#define utility_PPC64_DWARF_Registers_h_
+
+#include "lldb/lldb-private.h"
+
+namespace ppc64_dwarf {
+
+enum {
+ dwarf_r0_ppc64 = 0,
+ dwarf_r1_ppc64,
+ dwarf_r2_ppc64,
+ dwarf_r3_ppc64,
+ dwarf_r4_ppc64,
+ dwarf_r5_ppc64,
+ dwarf_r6_ppc64,
+ dwarf_r7_ppc64,
+ dwarf_r8_ppc64,
+ dwarf_r9_ppc64,
+ dwarf_r10_ppc64,
+ dwarf_r11_ppc64,
+ dwarf_r12_ppc64,
+ dwarf_r13_ppc64,
+ dwarf_r14_ppc64,
+ dwarf_r15_ppc64,
+ dwarf_r16_ppc64,
+ dwarf_r17_ppc64,
+ dwarf_r18_ppc64,
+ dwarf_r19_ppc64,
+ dwarf_r20_ppc64,
+ dwarf_r21_ppc64,
+ dwarf_r22_ppc64,
+ dwarf_r23_ppc64,
+ dwarf_r24_ppc64,
+ dwarf_r25_ppc64,
+ dwarf_r26_ppc64,
+ dwarf_r27_ppc64,
+ dwarf_r28_ppc64,
+ dwarf_r29_ppc64,
+ dwarf_r30_ppc64,
+ dwarf_r31_ppc64,
+ dwarf_f0_ppc64,
+ dwarf_f1_ppc64,
+ dwarf_f2_ppc64,
+ dwarf_f3_ppc64,
+ dwarf_f4_ppc64,
+ dwarf_f5_ppc64,
+ dwarf_f6_ppc64,
+ dwarf_f7_ppc64,
+ dwarf_f8_ppc64,
+ dwarf_f9_ppc64,
+ dwarf_f10_ppc64,
+ dwarf_f11_ppc64,
+ dwarf_f12_ppc64,
+ dwarf_f13_ppc64,
+ dwarf_f14_ppc64,
+ dwarf_f15_ppc64,
+ dwarf_f16_ppc64,
+ dwarf_f17_ppc64,
+ dwarf_f18_ppc64,
+ dwarf_f19_ppc64,
+ dwarf_f20_ppc64,
+ dwarf_f21_ppc64,
+ dwarf_f22_ppc64,
+ dwarf_f23_ppc64,
+ dwarf_f24_ppc64,
+ dwarf_f25_ppc64,
+ dwarf_f26_ppc64,
+ dwarf_f27_ppc64,
+ dwarf_f28_ppc64,
+ dwarf_f29_ppc64,
+ dwarf_f30_ppc64,
+ dwarf_f31_ppc64,
+ dwarf_cr_ppc64 = 64,
+ dwarf_fpscr_ppc64,
+ dwarf_msr_ppc64,
+ dwarf_xer_ppc64 = 100,
+ dwarf_lr_ppc64 = 108,
+ dwarf_ctr_ppc64,
+ dwarf_vscr_ppc64,
+ dwarf_vrsave_ppc64 = 356,
+ dwarf_pc_ppc64,
+ dwarf_vr0_ppc64 = 1124,
+ dwarf_vr1_ppc64,
+ dwarf_vr2_ppc64,
+ dwarf_vr3_ppc64,
+ dwarf_vr4_ppc64,
+ dwarf_vr5_ppc64,
+ dwarf_vr6_ppc64,
+ dwarf_vr7_ppc64,
+ dwarf_vr8_ppc64,
+ dwarf_vr9_ppc64,
+ dwarf_vr10_ppc64,
+ dwarf_vr11_ppc64,
+ dwarf_vr12_ppc64,
+ dwarf_vr13_ppc64,
+ dwarf_vr14_ppc64,
+ dwarf_vr15_ppc64,
+ dwarf_vr16_ppc64,
+ dwarf_vr17_ppc64,
+ dwarf_vr18_ppc64,
+ dwarf_vr19_ppc64,
+ dwarf_vr20_ppc64,
+ dwarf_vr21_ppc64,
+ dwarf_vr22_ppc64,
+ dwarf_vr23_ppc64,
+ dwarf_vr24_ppc64,
+ dwarf_vr25_ppc64,
+ dwarf_vr26_ppc64,
+ dwarf_vr27_ppc64,
+ dwarf_vr28_ppc64,
+ dwarf_vr29_ppc64,
+ dwarf_vr30_ppc64,
+ dwarf_vr31_ppc64,
+};
+
+} // namespace ppc64_dwarf
+
+#endif // utility_PPC64_DWARF_Registers_h_
diff --git a/source/Utility/RegularExpression.cpp b/source/Utility/RegularExpression.cpp
index d58b315d0d1d..54f773365d99 100644
--- a/source/Utility/RegularExpression.cpp
+++ b/source/Utility/RegularExpression.cpp
@@ -14,9 +14,8 @@
#include <string>
//----------------------------------------------------------------------
-// Enable enhanced mode if it is available. This allows for things like
-// \d for digit, \s for space, and many more, but it isn't available
-// everywhere.
+// Enable enhanced mode if it is available. This allows for things like \d for
+// digit, \s for space, and many more, but it isn't available everywhere.
//----------------------------------------------------------------------
#if defined(REG_ENHANCED)
#define DEFAULT_COMPILE_FLAGS (REG_ENHANCED | REG_EXTENDED)
@@ -31,8 +30,8 @@ RegularExpression::RegularExpression() : m_re(), m_comp_err(1), m_preg() {
}
//----------------------------------------------------------------------
-// Constructor that compiles "re" using "flags" and stores the
-// resulting compiled regular expression into this object.
+// Constructor that compiles "re" using "flags" and stores the resulting
+// compiled regular expression into this object.
//----------------------------------------------------------------------
RegularExpression::RegularExpression(llvm::StringRef str)
: m_re(), m_comp_err(1), m_preg() {
@@ -55,17 +54,16 @@ operator=(const RegularExpression &rhs) {
//----------------------------------------------------------------------
// Destructor
//
-// Any previously compiled regular expression contained in this
-// object will be freed.
+// Any previously compiled regular expression contained in this object will be
+// freed.
//----------------------------------------------------------------------
RegularExpression::~RegularExpression() { Free(); }
//----------------------------------------------------------------------
-// Compile a regular expression using the supplied regular
-// expression text and flags. The compiled regular expression lives
-// in this object so that it can be readily used for regular
-// expression matches. Execute() can be called after the regular
-// expression is compiled. Any previously compiled regular
+// Compile a regular expression using the supplied regular expression text and
+// flags. The compiled regular expression lives in this object so that it can
+// be readily used for regular expression matches. Execute() can be called
+// after the regular expression is compiled. Any previously compiled regular
// expression contained in this object will be freed.
//
// RETURNS
@@ -75,20 +73,19 @@ RegularExpression::~RegularExpression() { Free(); }
bool RegularExpression::Compile(llvm::StringRef str) {
Free();
- // regcomp() on darwin does not recognize "" as a valid regular expression, so
- // we substitute it with an equivalent non-empty one.
+ // regcomp() on darwin does not recognize "" as a valid regular expression,
+ // so we substitute it with an equivalent non-empty one.
m_re = str.empty() ? "()" : str;
m_comp_err = ::regcomp(&m_preg, m_re.c_str(), DEFAULT_COMPILE_FLAGS);
return m_comp_err == 0;
}
//----------------------------------------------------------------------
-// Execute a regular expression match using the compiled regular
-// expression that is already in this object against the match
-// string "s". If any parens are used for regular expression
-// matches "match_count" should indicate the number of regmatch_t
-// values that are present in "match_ptr". The regular expression
-// will be executed using the "execute_flags".
+// Execute a regular expression match using the compiled regular expression
+// that is already in this object against the match string "s". If any parens
+// are used for regular expression matches "match_count" should indicate the
+// number of regmatch_t values that are present in "match_ptr". The regular
+// expression will be executed using the "execute_flags".
//---------------------------------------------------------------------
bool RegularExpression::Execute(llvm::StringRef str, Match *match) const {
int err = 1;
@@ -159,14 +156,12 @@ bool RegularExpression::Match::GetMatchSpanningIndices(
}
//----------------------------------------------------------------------
-// Returns true if the regular expression compiled and is ready
-// for execution.
+// Returns true if the regular expression compiled and is ready for execution.
//----------------------------------------------------------------------
bool RegularExpression::IsValid() const { return m_comp_err == 0; }
//----------------------------------------------------------------------
-// Returns the text that was used to compile the current regular
-// expression.
+// Returns the text that was used to compile the current regular expression.
//----------------------------------------------------------------------
llvm::StringRef RegularExpression::GetText() const { return m_re; }
diff --git a/source/Utility/SelectHelper.cpp b/source/Utility/SelectHelper.cpp
index 200b2ae42759..0f6a96309504 100644
--- a/source/Utility/SelectHelper.cpp
+++ b/source/Utility/SelectHelper.cpp
@@ -109,8 +109,8 @@ lldb_private::Status SelectHelper::Select() {
pair.second.PrepareForSelect();
const lldb::socket_t fd = pair.first;
#if !defined(__APPLE__) && !defined(_MSC_VER)
- lldbassert(fd < FD_SETSIZE);
- if (fd >= FD_SETSIZE) {
+ lldbassert(fd < static_cast<int>(FD_SETSIZE));
+ if (fd >= static_cast<int>(FD_SETSIZE)) {
error.SetErrorStringWithFormat("%i is too large for select()", fd);
return error;
}
@@ -236,8 +236,9 @@ lldb_private::Status SelectHelper::Select() {
error.SetErrorString("timed out");
return error;
} else {
- // One or more descriptors were set, update the FDInfo::select_is_set mask
- // so users can ask the SelectHelper class so clients can call one of:
+ // One or more descriptors were set, update the FDInfo::select_is_set
+ // mask so users can ask the SelectHelper class so clients can call one
+ // of:
for (auto &pair : m_fd_map) {
const int fd = pair.first;
diff --git a/source/Utility/SharingPtr.cpp b/source/Utility/SharingPtr.cpp
index cf32b21f24a6..bdaedfb9b049 100644
--- a/source/Utility/SharingPtr.cpp
+++ b/source/Utility/SharingPtr.cpp
@@ -11,8 +11,8 @@
#if defined(ENABLE_SP_LOGGING)
-// If ENABLE_SP_LOGGING is defined, then log all shared pointer assignments
-// and allow them to be queried using a pointer by a call to:
+// If ENABLE_SP_LOGGING is defined, then log all shared pointer assignments and
+// allow them to be queried using a pointer by a call to:
#include <assert.h>
#include <execinfo.h>
@@ -96,8 +96,8 @@ extern "C" void track_sp(void *sp_this, void *ptr, long use_count) {
namespace lldb {
void dump_sp_refs(void *ptr) {
- // Use a specially crafted call to "track_sp" which will
- // dump info on all live shared pointers that reference "ptr"
+ // Use a specially crafted call to "track_sp" which will dump info on all
+ // live shared pointers that reference "ptr"
track_sp(NULL, ptr, 0);
}
}
diff --git a/source/Utility/Status.cpp b/source/Utility/Status.cpp
index a6a889a71e54..f6dc228391b3 100644
--- a/source/Utility/Status.cpp
+++ b/source/Utility/Status.cpp
@@ -107,9 +107,9 @@ const Status &Status::operator=(const Status &rhs) {
Status::~Status() = default;
//----------------------------------------------------------------------
-// Get the error value as a NULL C string. The error string will be
-// fetched and cached on demand. The cached error string value will
-// remain until the error value is changed or cleared.
+// Get the error value as a NULL C string. The error string will be fetched and
+// cached on demand. The cached error string value will remain until the error
+// value is changed or cleared.
//----------------------------------------------------------------------
const char *Status::AsCString(const char *default_error_str) const {
if (Success())
@@ -161,13 +161,13 @@ Status::ValueType Status::GetError() const { return m_code; }
ErrorType Status::GetType() const { return m_type; }
//----------------------------------------------------------------------
-// Returns true if this object contains a value that describes an
-// error or otherwise non-success result.
+// Returns true if this object contains a value that describes an error or
+// otherwise non-success result.
//----------------------------------------------------------------------
bool Status::Fail() const { return m_code != 0; }
//----------------------------------------------------------------------
-// Set accesssor for the error value to "err" and the type to
+// Set accessor for the error value to "err" and the type to
// "eErrorTypeMachKernel"
//----------------------------------------------------------------------
void Status::SetMachError(uint32_t err) {
@@ -201,7 +201,7 @@ int Status::SetExpressionErrorWithFormat(lldb::ExpressionResults result,
}
//----------------------------------------------------------------------
-// Set accesssor for the error value and type.
+// Set accessor for the error value and type.
//----------------------------------------------------------------------
void Status::SetError(ValueType err, ErrorType type) {
m_code = err;
@@ -210,8 +210,7 @@ void Status::SetError(ValueType err, ErrorType type) {
}
//----------------------------------------------------------------------
-// Update the error value to be "errno" and update the type to
-// be "POSIX".
+// Update the error value to be "errno" and update the type to be "POSIX".
//----------------------------------------------------------------------
void Status::SetErrorToErrno() {
m_code = errno;
@@ -220,8 +219,8 @@ void Status::SetErrorToErrno() {
}
//----------------------------------------------------------------------
-// Update the error value to be LLDB_GENERIC_ERROR and update the type
-// to be "Generic".
+// Update the error value to be LLDB_GENERIC_ERROR and update the type to be
+// "Generic".
//----------------------------------------------------------------------
void Status::SetErrorToGenericError() {
m_code = LLDB_GENERIC_ERROR;
@@ -230,15 +229,15 @@ void Status::SetErrorToGenericError() {
}
//----------------------------------------------------------------------
-// Set accessor for the error string value for a specific error.
-// This allows any string to be supplied as an error explanation.
-// The error string value will remain until the error value is
-// cleared or a new error value/type is assigned.
+// Set accessor for the error string value for a specific error. This allows
+// any string to be supplied as an error explanation. The error string value
+// will remain until the error value is cleared or a new error value/type is
+// assigned.
//----------------------------------------------------------------------
void Status::SetErrorString(llvm::StringRef err_str) {
if (!err_str.empty()) {
- // If we have an error string, we should always at least have an error
- // set to a generic value.
+ // If we have an error string, we should always at least have an error set
+ // to a generic value.
if (Success())
SetErrorToGenericError();
}
@@ -266,8 +265,8 @@ int Status::SetErrorStringWithFormat(const char *format, ...) {
int Status::SetErrorStringWithVarArg(const char *format, va_list args) {
if (format != nullptr && format[0]) {
- // If we have an error string, we should always at least have
- // an error set to a generic value.
+ // If we have an error string, we should always at least have an error set
+ // to a generic value.
if (Success())
SetErrorToGenericError();
@@ -282,8 +281,8 @@ int Status::SetErrorStringWithVarArg(const char *format, va_list args) {
}
//----------------------------------------------------------------------
-// Returns true if the error code in this object is considered a
-// successful return value.
+// Returns true if the error code in this object is considered a successful
+// return value.
//----------------------------------------------------------------------
bool Status::Success() const { return m_code == 0; }
diff --git a/source/Utility/Stream.cpp b/source/Utility/Stream.cpp
index 04edc25b2b09..647a0c0beb5c 100644
--- a/source/Utility/Stream.cpp
+++ b/source/Utility/Stream.cpp
@@ -41,14 +41,12 @@ ByteOrder Stream::SetByteOrder(ByteOrder byte_order) {
}
//------------------------------------------------------------------
-// Put an offset "uval" out to the stream using the printf format
-// in "format".
+// Put an offset "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
void Stream::Offset(uint32_t uval, const char *format) { Printf(format, uval); }
//------------------------------------------------------------------
-// Put an SLEB128 "uval" out to the stream using the printf format
-// in "format".
+// Put an SLEB128 "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
size_t Stream::PutSLEB128(int64_t sval) {
size_t bytes_written = 0;
@@ -73,8 +71,7 @@ size_t Stream::PutSLEB128(int64_t sval) {
}
//------------------------------------------------------------------
-// Put an ULEB128 "uval" out to the stream using the printf format
-// in "format".
+// Put an ULEB128 "uval" out to the stream using the printf format in "format".
//------------------------------------------------------------------
size_t Stream::PutULEB128(uint64_t uval) {
size_t bytes_written = 0;
@@ -109,16 +106,16 @@ size_t Stream::PutCString(llvm::StringRef str) {
}
//------------------------------------------------------------------
-// Print a double quoted NULL terminated C string to the stream
-// using the printf format in "format".
+// Print a double quoted NULL terminated C string to the stream using the
+// printf format in "format".
//------------------------------------------------------------------
void Stream::QuotedCString(const char *cstr, const char *format) {
Printf(format, cstr);
}
//------------------------------------------------------------------
-// Put an address "addr" out to the stream with optional prefix
-// and suffix strings.
+// Put an address "addr" out to the stream with optional prefix and suffix
+// strings.
//------------------------------------------------------------------
void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
const char *suffix) {
@@ -132,8 +129,8 @@ void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
}
//------------------------------------------------------------------
-// Put an address range out to the stream with optional prefix
-// and suffix strings.
+// Put an address range out to the stream with optional prefix and suffix
+// strings.
//------------------------------------------------------------------
void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr,
uint32_t addr_size, const char *prefix,
@@ -179,8 +176,8 @@ size_t Stream::PrintfVarArg(const char *format, va_list args) {
size_t Stream::EOL() { return PutChar('\n'); }
//------------------------------------------------------------------
-// Indent the current line using the current indentation level and
-// print an optional string following the indentation spaces.
+// Indent the current line using the current indentation level and print an
+// optional string following the indentation spaces.
//------------------------------------------------------------------
size_t Stream::Indent(const char *s) {
return Printf("%*.*s%s", m_indent_level, m_indent_level, "", s ? s : "");
diff --git a/source/Utility/StringExtractor.cpp b/source/Utility/StringExtractor.cpp
index cf5c7e227448..7528350cf759 100644
--- a/source/Utility/StringExtractor.cpp
+++ b/source/Utility/StringExtractor.cpp
@@ -74,9 +74,8 @@ char StringExtractor::GetChar(char fail_value) {
}
//----------------------------------------------------------------------
-// If a pair of valid hex digits exist at the head of the
-// StringExtractor they are decoded into an unsigned byte and returned
-// by this function
+// If a pair of valid hex digits exist at the head of the StringExtractor they
+// are decoded into an unsigned byte and returned by this function
//
// If there is not a pair of valid hex digits at the head of the
// StringExtractor, it is left unchanged and -1 is returned
@@ -96,12 +95,12 @@ int StringExtractor::DecodeHexU8() {
}
//----------------------------------------------------------------------
-// Extract an unsigned character from two hex ASCII chars in the packet
-// string, or return fail_value on failure
+// Extract an unsigned character from two hex ASCII chars in the packet string,
+// or return fail_value on failure
//----------------------------------------------------------------------
uint8_t StringExtractor::GetHexU8(uint8_t fail_value, bool set_eof_on_fail) {
- // On success, fail_value will be overwritten with the next
- // character in the stream
+ // On success, fail_value will be overwritten with the next character in the
+ // stream
GetHexU8Ex(fail_value, set_eof_on_fail);
return fail_value;
}
@@ -307,8 +306,8 @@ size_t StringExtractor::GetHexBytes(llvm::MutableArrayRef<uint8_t> dest,
}
//----------------------------------------------------------------------
-// Decodes all valid hex encoded bytes at the head of the
-// StringExtractor, limited by dst_len.
+// Decodes all valid hex encoded bytes at the head of the StringExtractor,
+// limited by dst_len.
//
// Returns the number of bytes successfully decoded
//----------------------------------------------------------------------
@@ -390,9 +389,9 @@ size_t StringExtractor::GetHexByteStringTerminatedBy(std::string &str,
bool StringExtractor::GetNameColonValue(llvm::StringRef &name,
llvm::StringRef &value) {
- // Read something in the form of NNNN:VVVV; where NNNN is any character
- // that is not a colon, followed by a ':' character, then a value (one or
- // more ';' chars), followed by a ';'
+ // Read something in the form of NNNN:VVVV; where NNNN is any character that
+ // is not a colon, followed by a ':' character, then a value (one or more ';'
+ // chars), followed by a ';'
if (m_index >= m_packet.size())
return fail();
diff --git a/source/Utility/StringExtractorGDBRemote.cpp b/source/Utility/StringExtractorGDBRemote.cpp
index 818347a42a2c..3cae06df3b1e 100644
--- a/source/Utility/StringExtractorGDBRemote.cpp
+++ b/source/Utility/StringExtractorGDBRemote.cpp
@@ -7,7 +7,7 @@
//
//===----------------------------------------------------------------------===//
-#include "Utility/StringExtractorGDBRemote.h"
+#include "lldb/Utility/StringExtractorGDBRemote.h"
#include <ctype.h> // for isxdigit
#include <string.h>
@@ -482,10 +482,9 @@ lldb_private::Status StringExtractorGDBRemote::GetStatus() {
size_t StringExtractorGDBRemote::GetEscapedBinaryData(std::string &str) {
// Just get the data bytes in the string as
- // GDBRemoteCommunication::CheckForPacket()
- // already removes any 0x7d escaped characters. If any 0x7d characters are
- // left in
- // the packet, then they are supposed to be there...
+ // GDBRemoteCommunication::CheckForPacket() already removes any 0x7d escaped
+ // characters. If any 0x7d characters are left in the packet, then they are
+ // supposed to be there...
str.clear();
const size_t bytes_left = GetBytesLeft();
if (bytes_left > 0) {
@@ -526,9 +525,9 @@ static bool JSONResponseValidator(void *,
case StringExtractorGDBRemote::eResponse:
// JSON that is returned in from JSON query packets is currently always
- // either a dictionary which starts with a '{', or an array which
- // starts with a '['. This is a quick validator to just make sure the
- // response could be valid JSON without having to validate all of the
+ // either a dictionary which starts with a '{', or an array which starts
+ // with a '['. This is a quick validator to just make sure the response
+ // could be valid JSON without having to validate all of the
// JSON content.
switch (response.GetStringRef()[0]) {
case '{':
diff --git a/source/Utility/StructuredData.cpp b/source/Utility/StructuredData.cpp
index 492fc585ad07..55f003f245bf 100644
--- a/source/Utility/StructuredData.cpp
+++ b/source/Utility/StructuredData.cpp
@@ -85,8 +85,7 @@ static StructuredData::ObjectSP ParseJSONObject(JSONParser &json_parser) {
static StructuredData::ObjectSP ParseJSONArray(JSONParser &json_parser) {
// The "JSONParser::Token::ObjectStart" token should have already been
- // consumed
- // by the time this function is called
+ // consumed by the time this function is called
auto array_up = llvm::make_unique<StructuredData::Array>();
std::string value;
@@ -162,8 +161,8 @@ StructuredData::Object::GetObjectForDotSeparatedPath(llvm::StringRef path) {
std::string key = match.first.str();
ObjectSP value = this->GetAsDictionary()->GetValueForKey(key);
if (value.get()) {
- // Do we have additional words to descend? If not, return the
- // value we're at right now.
+ // Do we have additional words to descend? If not, return the value
+ // we're at right now.
if (match.second.empty()) {
return value;
} else {
diff --git a/source/Utility/TildeExpressionResolver.cpp b/source/Utility/TildeExpressionResolver.cpp
index 64a771118d6e..ae947059d8b9 100644
--- a/source/Utility/TildeExpressionResolver.cpp
+++ b/source/Utility/TildeExpressionResolver.cpp
@@ -14,12 +14,11 @@
#include "llvm/ADT/STLExtras.h" // for any_of
#include "llvm/ADT/SmallVector.h" // for SmallVectorImpl
-#include "llvm/Config/llvm-config.h" // for LLVM_ON_WIN32
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h" // for fs
-#if !defined(LLVM_ON_WIN32)
+#if !defined(_WIN32)
#include <pwd.h>
#endif
@@ -49,7 +48,7 @@ bool StandardTildeExpressionResolver::ResolvePartial(StringRef Expr,
assert(Expr.empty() || Expr[0] == '~');
Output.clear();
-#if defined(LLVM_ON_WIN32) || defined(__ANDROID__)
+#if defined(_WIN32) || defined(__ANDROID__)
return false;
#else
if (Expr.empty())
diff --git a/source/Utility/UUID.cpp b/source/Utility/UUID.cpp
index 98d4c30cc7f1..623ad69ddc76 100644
--- a/source/Utility/UUID.cpp
+++ b/source/Utility/UUID.cpp
@@ -13,62 +13,44 @@
// Project includes
#include "lldb/Utility/Stream.h"
#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/Format.h"
// C Includes
#include <ctype.h>
#include <stdio.h>
#include <string.h>
-namespace lldb_private {
-
-UUID::UUID() { Clear(); }
-
-UUID::UUID(const UUID &rhs) {
- SetBytes(rhs.m_uuid, rhs.m_num_uuid_bytes);
-}
-
-UUID::UUID(const void *uuid_bytes, uint32_t num_uuid_bytes) {
- SetBytes(uuid_bytes, num_uuid_bytes);
-}
-
-const UUID &UUID::operator=(const UUID &rhs) {
- if (this != &rhs) {
- m_num_uuid_bytes = rhs.m_num_uuid_bytes;
- ::memcpy(m_uuid, rhs.m_uuid, sizeof(m_uuid));
+using namespace lldb_private;
+
+// Whether to put a separator after count uuid bytes.
+// For the first 16 bytes we follow the traditional UUID format. After that, we
+// simply put a dash after every 6 bytes.
+static inline bool separate(size_t count) {
+ if (count >= 10)
+ return (count - 10) % 6 == 0;
+
+ switch (count) {
+ case 4:
+ case 6:
+ case 8:
+ return true;
+ default:
+ return false;
}
- return *this;
}
-UUID::~UUID() {}
-
-void UUID::Clear() {
- m_num_uuid_bytes = 16;
- ::memset(m_uuid, 0, sizeof(m_uuid));
-}
+std::string UUID::GetAsString(llvm::StringRef separator) const {
+ std::string result;
+ llvm::raw_string_ostream os(result);
-const void *UUID::GetBytes() const { return m_uuid; }
+ for (auto B : llvm::enumerate(GetBytes())) {
+ if (separate(B.index()))
+ os << separator;
-std::string UUID::GetAsString(const char *separator) const {
- std::string result;
- char buf[256];
- if (!separator)
- separator = "-";
- const uint8_t *u = (const uint8_t *)GetBytes();
- if (sizeof(buf) >
- (size_t)snprintf(buf, sizeof(buf), "%2.2X%2.2X%2.2X%2.2X%s%2.2X%2.2X%s%2."
- "2X%2.2X%s%2.2X%2.2X%s%2.2X%2.2X%2.2X%"
- "2.2X%2.2X%2.2X",
- u[0], u[1], u[2], u[3], separator, u[4], u[5], separator,
- u[6], u[7], separator, u[8], u[9], separator, u[10],
- u[11], u[12], u[13], u[14], u[15])) {
- result.append(buf);
- if (m_num_uuid_bytes == 20) {
- if (sizeof(buf) > (size_t)snprintf(buf, sizeof(buf),
- "%s%2.2X%2.2X%2.2X%2.2X", separator,
- u[16], u[17], u[18], u[19]))
- result.append(buf);
- }
+ os << llvm::format_hex_no_prefix(B.value(), 2, true);
}
+ os.flush();
+
return result;
}
@@ -76,40 +58,6 @@ void UUID::Dump(Stream *s) const {
s->PutCString(GetAsString().c_str());
}
-bool UUID::SetBytes(const void *uuid_bytes, uint32_t num_uuid_bytes) {
- if (uuid_bytes) {
- switch (num_uuid_bytes) {
- case 20:
- m_num_uuid_bytes = 20;
- break;
- case 16:
- m_num_uuid_bytes = 16;
- m_uuid[16] = m_uuid[17] = m_uuid[18] = m_uuid[19] = 0;
- break;
- default:
- // Unsupported UUID byte size
- m_num_uuid_bytes = 0;
- break;
- }
-
- if (m_num_uuid_bytes > 0) {
- ::memcpy(m_uuid, uuid_bytes, m_num_uuid_bytes);
- return true;
- }
- }
- ::memset(m_uuid, 0, sizeof(m_uuid));
- return false;
-}
-
-size_t UUID::GetByteSize() const { return m_num_uuid_bytes; }
-
-bool UUID::IsValid() const {
- return m_uuid[0] || m_uuid[1] || m_uuid[2] || m_uuid[3] || m_uuid[4] ||
- m_uuid[5] || m_uuid[6] || m_uuid[7] || m_uuid[8] || m_uuid[9] ||
- m_uuid[10] || m_uuid[11] || m_uuid[12] || m_uuid[13] || m_uuid[14] ||
- m_uuid[15] || m_uuid[16] || m_uuid[17] || m_uuid[18] || m_uuid[19];
-}
-
static inline int xdigit_to_int(char ch) {
ch = tolower(ch);
if (ch >= 'a' && ch <= 'f')
@@ -117,25 +65,24 @@ static inline int xdigit_to_int(char ch) {
return ch - '0';
}
-llvm::StringRef UUID::DecodeUUIDBytesFromString(llvm::StringRef p,
- ValueType &uuid_bytes,
- uint32_t &bytes_decoded,
- uint32_t num_uuid_bytes) {
- ::memset(uuid_bytes, 0, sizeof(uuid_bytes));
- size_t uuid_byte_idx = 0;
+llvm::StringRef
+UUID::DecodeUUIDBytesFromString(llvm::StringRef p,
+ llvm::SmallVectorImpl<uint8_t> &uuid_bytes,
+ uint32_t num_uuid_bytes) {
+ uuid_bytes.clear();
while (!p.empty()) {
if (isxdigit(p[0]) && isxdigit(p[1])) {
int hi_nibble = xdigit_to_int(p[0]);
int lo_nibble = xdigit_to_int(p[1]);
// Translate the two hex nibble characters into a byte
- uuid_bytes[uuid_byte_idx] = (hi_nibble << 4) + lo_nibble;
+ uuid_bytes.push_back((hi_nibble << 4) + lo_nibble);
// Skip both hex digits
p = p.drop_front(2);
- // Increment the byte that we are decoding within the UUID value
- // and break out if we are done
- if (++uuid_byte_idx == num_uuid_bytes)
+ // Increment the byte that we are decoding within the UUID value and
+ // break out if we are done
+ if (uuid_bytes.size() == num_uuid_bytes)
break;
} else if (p.front() == '-') {
// Skip dashes
@@ -145,11 +92,6 @@ llvm::StringRef UUID::DecodeUUIDBytesFromString(llvm::StringRef p,
break;
}
}
-
- // Clear trailing bytes to 0.
- for (uint32_t i = uuid_byte_idx; i < sizeof(ValueType); i++)
- uuid_bytes[i] = 0;
- bytes_decoded = uuid_byte_idx;
return p;
}
@@ -159,57 +101,17 @@ size_t UUID::SetFromStringRef(llvm::StringRef str, uint32_t num_uuid_bytes) {
// Skip leading whitespace characters
p = p.ltrim();
- uint32_t bytes_decoded = 0;
+ llvm::SmallVector<uint8_t, 20> bytes;
llvm::StringRef rest =
- UUID::DecodeUUIDBytesFromString(p, m_uuid, bytes_decoded, num_uuid_bytes);
+ UUID::DecodeUUIDBytesFromString(p, bytes, num_uuid_bytes);
// If we successfully decoded a UUID, return the amount of characters that
// were consumed
- if (bytes_decoded == num_uuid_bytes) {
- m_num_uuid_bytes = num_uuid_bytes;
+ if (bytes.size() == num_uuid_bytes) {
+ *this = fromData(bytes);
return str.size() - rest.size();
}
// Else return zero to indicate we were not able to parse a UUID value
return 0;
}
-
-size_t UUID::SetFromCString(const char *cstr, uint32_t num_uuid_bytes) {
- if (cstr == NULL)
- return 0;
-
- return SetFromStringRef(cstr, num_uuid_bytes);
-}
-}
-
-bool lldb_private::operator==(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
- sizeof(lldb_private::UUID::ValueType)) == 0;
-}
-
-bool lldb_private::operator!=(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return !(lhs == rhs);
-}
-
-bool lldb_private::operator<(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return ::memcmp(lhs.GetBytes(), rhs.GetBytes(),
- sizeof(lldb_private::UUID::ValueType)) < 0;
-}
-
-bool lldb_private::operator<=(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return !(lhs > rhs);
-}
-
-bool lldb_private::operator>(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return rhs < lhs;
-}
-
-bool lldb_private::operator>=(const lldb_private::UUID &lhs,
- const lldb_private::UUID &rhs) {
- return !(lhs < rhs);
-}
diff --git a/source/Utility/VASprintf.cpp b/source/Utility/VASprintf.cpp
index e950fb75cfa0..900d9754a9b4 100644
--- a/source/Utility/VASprintf.cpp
+++ b/source/Utility/VASprintf.cpp
@@ -36,8 +36,8 @@ bool lldb_private::VASprintf(llvm::SmallVectorImpl<char> &buf, const char *fmt,
}
if (size_t(length) >= buf.size()) {
- // The error formatted string didn't fit into our buffer, resize it
- // to the exact needed size, and retry
+ // The error formatted string didn't fit into our buffer, resize it to the
+ // exact needed size, and retry
buf.resize(length + 1);
length = ::vsnprintf(buf.data(), buf.size(), fmt, copy_args);
if (length < 0) {
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 9826de38c3c7..de548f03069e 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -13,25 +13,6 @@ function(add_python_test_target name test_script args comment)
)
endfunction()
-set(LLDB_TEST_DEPS lldb)
-
-# darwin-debug is an hard dependency for the testsuite.
-if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- list(APPEND LLDB_TEST_DEPS darwin-debug)
-endif()
-
-if(TARGET lldb-server)
- list(APPEND LLDB_TEST_DEPS lldb-server)
-endif()
-
-if(TARGET debugserver)
- list(APPEND LLDB_TEST_DEPS debugserver)
-endif()
-
-if(TARGET lldb-mi)
- list(APPEND LLDB_TEST_DEPS lldb-mi)
-endif()
-
# The default architecture with which to compile test executables is the default LLVM target
# architecture, which itself defaults to the host architecture.
string(TOLOWER "${LLVM_TARGET_ARCH}" LLDB_DEFAULT_TEST_ARCH)
@@ -41,29 +22,40 @@ endif ()
# Allow the user to override the default by setting LLDB_TEST_ARCH
set(LLDB_TEST_ARCH
- ${LLDB_DEFAULT_TEST_ARCH}
- CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64")
+ ${LLDB_DEFAULT_TEST_ARCH}
+ CACHE STRING "Specify the architecture to run LLDB tests as (x86|x64). Determines whether tests are compiled with -m32 or -m64")
# Users can override LLDB_TEST_USER_ARGS to specify arbitrary arguments to pass to the script
set(LLDB_TEST_USER_ARGS
""
CACHE STRING "Specify additional arguments to pass to test runner. For example: '-C gcc -C clang -A i386 -A x86_64'")
+# The .nodindex suffix is a marker for Spotlight to never index the
+# build directory. LLDB queries Spotlight to locate .dSYM bundles
+# based on the UUID embedded in a binary, and because the UUID is a
+# hash of filename and .text section, there *will* be conflicts inside
+# the build directory.
set(LLDB_TEST_COMMON_ARGS
--arch=${LLDB_TEST_ARCH}
- --executable $<TARGET_FILE:lldb>
-s
${CMAKE_BINARY_DIR}/lldb-test-traces
+ --build-dir
+ ${CMAKE_BINARY_DIR}/lldb-test-build.noindex
-S nm
-u CXXFLAGS
-u CFLAGS
+ )
+
+list(APPEND LLDB_TEST_COMMON_ARGS
+ --executable ${LLDB_TEST_EXECUTABLE}
+ --dsymutil ${LLDB_TEST_DSYMUTIL}
-C ${LLDB_TEST_C_COMPILER}
)
if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
# All tests are currently flaky on Windows, so rerun them all once when they fail.
set(LLDB_TEST_COMMON_ARGS ${LLDB_TEST_COMMON_ARGS} --rerun-all-issues)
-
+
set(LLDB_TEST_DEBUG_TEST_CRASHES
0
CACHE BOOL "(Windows only) Enables debugging of tests in the test suite by showing the crash dialog when lldb crashes")
@@ -86,7 +78,7 @@ if(LLDB_CODESIGN_IDENTITY)
endif()
if(LLDB_BUILD_FRAMEWORK)
- list(APPEND LLDB_TEST_COMMON_ARGS --framework $<TARGET_FILE_DIR:liblldb>)
+ list(APPEND LLDB_TEST_COMMON_ARGS --framework ${LLDB_FRAMEWORK_DIR}/LLDB.framework)
endif()
if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin")
@@ -95,10 +87,15 @@ if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Windows|Darwin")
endif()
if(CMAKE_HOST_APPLE)
- list(APPEND LLDB_TEST_COMMON_ARGS --server $<TARGET_FILE:debugserver>)
+ list(APPEND LLDB_TEST_COMMON_ARGS --server ${DEBUGSERVER_PATH})
+endif()
+
+if(SKIP_DEBUGSERVER)
+ list(APPEND LLDB_TEST_COMMON_ARGS --out-of-tree-debugserver)
endif()
set(LLDB_DOTEST_ARGS ${LLDB_TEST_COMMON_ARGS};${LLDB_TEST_USER_ARGS})
+set_property(GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY ${LLDB_DOTEST_ARGS})
add_python_test_target(check-lldb-single
${LLDB_SOURCE_DIR}/test/dotest.py
@@ -108,11 +105,7 @@ add_python_test_target(check-lldb-single
# If tests crash cause LLDB to crash, or things are otherwise unstable, or if machine-parsable
# output is desired (i.e. in continuous integration contexts) check-lldb-single is a better target.
-add_python_test_target(check-lldb
- ${LLDB_SOURCE_DIR}/test/dotest.py
- "-q;${LLDB_DOTEST_ARGS}"
- "Testing LLDB (parallel execution, with a separate subprocess per test)"
- )
+add_custom_target(check-lldb)
# If we're building with an in-tree clang, then list clang as a dependency
# to run tests.
@@ -129,6 +122,9 @@ if (CMAKE_SYSTEM_NAME MATCHES "Windows")
endif ()
endif ()
+# Run the lit-style tests and the unittests as part of the check-lldb target.
+add_dependencies(check-lldb check-lldb-lit)
+
add_custom_target(lldb-test-depends DEPENDS ${LLDB_TEST_DEPENDS})
# This will add LLDB's test dependencies to the depenednecies for check-all and
# include them in the test-depends target.
diff --git a/tools/argdumper/CMakeLists.txt b/tools/argdumper/CMakeLists.txt
index 9b22103bc8af..a59a4e7a8514 100644
--- a/tools/argdumper/CMakeLists.txt
+++ b/tools/argdumper/CMakeLists.txt
@@ -1,4 +1,4 @@
-add_lldb_tool(lldb-argdumper INCLUDE_IN_FRAMEWORK
+add_lldb_tool(lldb-argdumper INCLUDE_IN_SUITE
argdumper.cpp
LINK_LIBS
diff --git a/tools/darwin-debug/CMakeLists.txt b/tools/darwin-debug/CMakeLists.txt
index 2f28eab3a58f..c2b5cb486483 100644
--- a/tools/darwin-debug/CMakeLists.txt
+++ b/tools/darwin-debug/CMakeLists.txt
@@ -1,3 +1,3 @@
-add_lldb_tool(darwin-debug INCLUDE_IN_FRAMEWORK
+add_lldb_tool(darwin-debug INCLUDE_IN_SUITE
darwin-debug.cpp
)
diff --git a/tools/darwin-threads/examine-threads.c b/tools/darwin-threads/examine-threads.c
index 5d965140cf8b..51f35b6b0cc6 100644
--- a/tools/darwin-threads/examine-threads.c
+++ b/tools/darwin-threads/examine-threads.c
@@ -403,7 +403,7 @@ int main(int argc, char **argv) {
int wordsize;
uint64_t pc = get_current_pc(thread_list[i], &wordsize);
- printf("thread #%d, system-wide-unique-tid %lld, suspend count is %d, ",
+ printf("thread #%d, system-wide-unique-tid 0x%llx, suspend count is %d, ",
i, identifier_info.thread_id, basic_info->suspend_count);
if (wordsize == 8)
printf("pc 0x%016llx, ", pc);
diff --git a/tools/debugserver/debugserver.xcodeproj/project.pbxproj b/tools/debugserver/debugserver.xcodeproj/project.pbxproj
index 6a919cfef5de..92b41b1873ab 100644
--- a/tools/debugserver/debugserver.xcodeproj/project.pbxproj
+++ b/tools/debugserver/debugserver.xcodeproj/project.pbxproj
@@ -7,166 +7,131 @@
objects = {
/* Begin PBXBuildFile section */
- 23043C9D1D35DBEC00FC25CA /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
- 23043C9E1D35DBFA00FC25CA /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */; };
- 2307CCCB1D4A5D630016ABC0 /* LogFilterExactMatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */; };
- 233B4EA71D2DB54300E98261 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
- 233B4EA91D2DB96A00E98261 /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */; };
- 23562ED21D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */; };
- 23562ED31D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */; };
23562ED61D342A5A00AB2BD4 /* ActivityStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED51D342A5A00AB2BD4 /* ActivityStore.cpp */; };
23562ED71D342A5A00AB2BD4 /* ActivityStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED51D342A5A00AB2BD4 /* ActivityStore.cpp */; };
- 23562ED91D342B0000AB2BD4 /* LogMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */; };
- 23562EDA1D342B0000AB2BD4 /* LogMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */; };
- 237821B01D4917D20028B7A1 /* LogFilterExactMatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */; };
+ 26CE05C5115C36590022F371 /* CFBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
+ 456F67641AD46CE9002850C2 /* CFBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
+ 26CE05C3115C36580022F371 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
+ 456F67621AD46CE9002850C2 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
+ 26CE05CF115C36F70022F371 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+ 456F676B1AD46CE9002850C2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+ 26CE05B7115C363B0022F371 /* DNB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
+ 456F67551AD46CE9002850C2 /* DNB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
+ 264D5D581293835600ED4C01 /* DNBArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
+ 456F67671AD46CE9002850C2 /* DNBArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
+ 26CE05C1115C36510022F371 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */; };
+ 26CE05C2115C36550022F371 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */; };
+ 456F67601AD46CE9002850C2 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */; };
+ 456F67611AD46CE9002850C2 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */; };
+ 266B5ED11460A68200E43F0A /* DNBArchImplARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */; };
+ 456F67691AD46CE9002850C2 /* DNBArchImplARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */; };
+ 26CE05C0115C364F0022F371 /* DNBArchImplI386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */; };
+ 456F675F1AD46CE9002850C2 /* DNBArchImplI386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */; };
+ 26CE05BF115C364D0022F371 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
+ 456F675E1AD46CE9002850C2 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
+ 26CE05B8115C363C0022F371 /* DNBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D90C71334A0024798E /* DNBBreakpoint.cpp */; };
+ 456F67571AD46CE9002850C2 /* DNBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D90C71334A0024798E /* DNBBreakpoint.cpp */; };
+ 26CE05B9115C363D0022F371 /* DNBDataRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DB0C71334A0024798E /* DNBDataRef.cpp */; };
+ 456F67581AD46CE9002850C2 /* DNBDataRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DB0C71334A0024798E /* DNBDataRef.cpp */; };
+ 26CE05A7115C360D0022F371 /* DNBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DE0C71334A0024798E /* DNBError.cpp */; };
+ 456F67461AD46CE9002850C2 /* DNBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DE0C71334A0024798E /* DNBError.cpp */; };
+ 26CE05BA115C363E0022F371 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
+ 456F67591AD46CE9002850C2 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
+ 26CE05BB115C363F0022F371 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
+ 456F675A1AD46CE9002850C2 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
+ 26CE05A8115C36170022F371 /* DNBThreadResumeActions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */; };
+ 456F67471AD46CE9002850C2 /* DNBThreadResumeActions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */; };
+ 23AE72E41D25DECF00945BCE /* DarwinLogCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */; };
+ 23AE72E51D25DEE100945BCE /* DarwinLogCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */; };
+ 49D404621E39260F00570CDC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; };
+ AFA3FCA11E39984900218D5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; };
+ 456F67561AD46CE9002850C2 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; };
+ AFEC3364194A8B0B00FF05C6 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; };
+ 23043C9D1D35DBEC00FC25CA /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
+ 233B4EA71D2DB54300E98261 /* JSON.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA51D2DB54300E98261 /* JSON.cpp */; };
23AC04C61D2F41A00072351D /* LogFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04C41D2F41A00072351D /* LogFilter.cpp */; };
23AC04C71D2F41A00072351D /* LogFilter.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04C41D2F41A00072351D /* LogFilter.cpp */; };
23AC04CA1D2F42250072351D /* LogFilterChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04C81D2F42250072351D /* LogFilterChain.cpp */; };
23AC04CB1D2F42250072351D /* LogFilterChain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04C81D2F42250072351D /* LogFilterChain.cpp */; };
+ 2307CCCB1D4A5D630016ABC0 /* LogFilterExactMatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */; };
+ 237821B01D4917D20028B7A1 /* LogFilterExactMatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */; };
23AC04CF1D2F58AF0072351D /* LogFilterRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04CD1D2F58AF0072351D /* LogFilterRegex.cpp */; };
23AC04D01D2F58AF0072351D /* LogFilterRegex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AC04CD1D2F58AF0072351D /* LogFilterRegex.cpp */; };
- 23AE72E41D25DECF00945BCE /* DarwinLogCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */; };
- 23AE72E51D25DEE100945BCE /* DarwinLogCollector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */; };
- 23D1B0291D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
- 23D1B02A1D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
- 264D5D581293835600ED4C01 /* DNBArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
- 266B5ED11460A68200E43F0A /* DNBArchImplARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */; };
- 26CE05A7115C360D0022F371 /* DNBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DE0C71334A0024798E /* DNBError.cpp */; };
- 26CE05A8115C36170022F371 /* DNBThreadResumeActions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */; };
- 26CE05A9115C36250022F371 /* debugserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A02918114AB9240029C479 /* debugserver.cpp */; };
- 26CE05AA115C36260022F371 /* RNBContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68F7E0D104EC800665A9E /* RNBContext.cpp */; };
- 26CE05AB115C36270022F371 /* RNBServices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EF8878A00D9C797C001831DA /* RNBServices.cpp */; };
- 26CE05AC115C36280022F371 /* RNBSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FB00D1054DA00665A9E /* RNBSocket.cpp */; };
- 26CE05AD115C36280022F371 /* RNBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FD60D10574500665A9E /* RNBRemote.cpp */; };
- 26CE05AE115C36320022F371 /* dbgnub-mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E80C71334A0024798E /* dbgnub-mig.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; };
+ 23562ED91D342B0000AB2BD4 /* LogMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */; };
+ 23562EDA1D342B0000AB2BD4 /* LogMessage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */; };
+ 23562ED21D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */; };
+ 23562ED31D3424DF00AB2BD4 /* LogMessageOsLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */; };
26CE05B0115C36340022F371 /* MachException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EE0C71334A0024798E /* MachException.cpp */; };
+ 456F674E1AD46CE9002850C2 /* MachException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EE0C71334A0024798E /* MachException.cpp */; };
26CE05B1115C36350022F371 /* MachProcess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F00C71334A0024798E /* MachProcess.mm */; };
+ 456F674F1AD46CE9002850C2 /* MachProcess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F00C71334A0024798E /* MachProcess.mm */; };
+ 26CE05B6115C36390022F371 /* MachTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */; };
+ 456F67541AD46CE9002850C2 /* MachTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */; };
26CE05B2115C36360022F371 /* MachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F20C71334A0024798E /* MachThread.cpp */; };
+ 456F67501AD46CE9002850C2 /* MachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F20C71334A0024798E /* MachThread.cpp */; };
26CE05B3115C36370022F371 /* MachThreadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F40C71334A0024798E /* MachThreadList.cpp */; };
+ 456F67511AD46CE9002850C2 /* MachThreadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F40C71334A0024798E /* MachThreadList.cpp */; };
26CE05B4115C36380022F371 /* MachVMMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F60C71334A0024798E /* MachVMMemory.cpp */; };
+ 456F67521AD46CE9002850C2 /* MachVMMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F60C71334A0024798E /* MachVMMemory.cpp */; };
26CE05B5115C36380022F371 /* MachVMRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F80C71334A0024798E /* MachVMRegion.cpp */; };
- 26CE05B6115C36390022F371 /* MachTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */; };
- 26CE05B7115C363B0022F371 /* DNB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
- 26CE05B8115C363C0022F371 /* DNBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D90C71334A0024798E /* DNBBreakpoint.cpp */; };
- 26CE05B9115C363D0022F371 /* DNBDataRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DB0C71334A0024798E /* DNBDataRef.cpp */; };
- 26CE05BA115C363E0022F371 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
- 26CE05BB115C363F0022F371 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
+ 456F67531AD46CE9002850C2 /* MachVMRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F80C71334A0024798E /* MachVMRegion.cpp */; };
+ 23D1B0291D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
+ 23D1B02A1D497E8B00FF831B /* OsLogger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 23D1B0271D497E8B00FF831B /* OsLogger.cpp */; };
26CE05BC115C36420022F371 /* PThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FE0C71334A0024798E /* PThreadEvent.cpp */; };
+ 456F675B1AD46CE9002850C2 /* PThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FE0C71334A0024798E /* PThreadEvent.cpp */; };
26CE05BD115C36430022F371 /* PThreadMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */; };
- 26CE05BE115C36440022F371 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
- 26CE05BF115C364D0022F371 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
- 26CE05C0115C364F0022F371 /* DNBArchImplI386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */; };
- 26CE05C1115C36510022F371 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */; };
- 26CE05C2115C36550022F371 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */; };
- 26CE05C3115C36580022F371 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
- 26CE05C5115C36590022F371 /* CFBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
- 26CE05CF115C36F70022F371 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
+ 456F675C1AD46CE9002850C2 /* PThreadMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */; };
26CE05F1115C387C0022F371 /* PseudoTerminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */; };
- 456F67461AD46CE9002850C2 /* DNBError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DE0C71334A0024798E /* DNBError.cpp */; };
- 456F67471AD46CE9002850C2 /* DNBThreadResumeActions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */; };
- 456F67481AD46CE9002850C2 /* debugserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A02918114AB9240029C479 /* debugserver.cpp */; };
+ 456F67651AD46CE9002850C2 /* PseudoTerminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */; };
+ 26CE05AA115C36260022F371 /* RNBContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68F7E0D104EC800665A9E /* RNBContext.cpp */; };
456F67491AD46CE9002850C2 /* RNBContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68F7E0D104EC800665A9E /* RNBContext.cpp */; };
+ 26CE05AD115C36280022F371 /* RNBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FD60D10574500665A9E /* RNBRemote.cpp */; };
+ 456F674C1AD46CE9002850C2 /* RNBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FD60D10574500665A9E /* RNBRemote.cpp */; };
+ 26CE05AB115C36270022F371 /* RNBServices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EF8878A00D9C797C001831DA /* RNBServices.cpp */; };
456F674A1AD46CE9002850C2 /* RNBServices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EF8878A00D9C797C001831DA /* RNBServices.cpp */; };
+ 26CE05AC115C36280022F371 /* RNBSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FB00D1054DA00665A9E /* RNBSocket.cpp */; };
456F674B1AD46CE9002850C2 /* RNBSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FB00D1054DA00665A9E /* RNBSocket.cpp */; };
- 456F674C1AD46CE9002850C2 /* RNBRemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A68FD60D10574500665A9E /* RNBRemote.cpp */; };
- 456F674D1AD46CE9002850C2 /* dbgnub-mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E80C71334A0024798E /* dbgnub-mig.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; };
- 456F674E1AD46CE9002850C2 /* MachException.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EE0C71334A0024798E /* MachException.cpp */; };
- 456F674F1AD46CE9002850C2 /* MachProcess.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F00C71334A0024798E /* MachProcess.mm */; };
- 456F67501AD46CE9002850C2 /* MachThread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F20C71334A0024798E /* MachThread.cpp */; };
- 456F67511AD46CE9002850C2 /* MachThreadList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F40C71334A0024798E /* MachThreadList.cpp */; };
- 456F67521AD46CE9002850C2 /* MachVMMemory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F60C71334A0024798E /* MachVMMemory.cpp */; };
- 456F67531AD46CE9002850C2 /* MachVMRegion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637F80C71334A0024798E /* MachVMRegion.cpp */; };
- 456F67541AD46CE9002850C2 /* MachTask.mm in Sources */ = {isa = PBXBuildFile; fileRef = 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */; };
- 456F67551AD46CE9002850C2 /* DNB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D60C71334A0024798E /* DNB.cpp */; };
- 456F67561AD46CE9002850C2 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; };
- 456F67571AD46CE9002850C2 /* DNBBreakpoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637D90C71334A0024798E /* DNBBreakpoint.cpp */; };
- 456F67581AD46CE9002850C2 /* DNBDataRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637DB0C71334A0024798E /* DNBDataRef.cpp */; };
- 456F67591AD46CE9002850C2 /* DNBLog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E00C71334A0024798E /* DNBLog.cpp */; };
- 456F675A1AD46CE9002850C2 /* DNBRegisterInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */; };
- 456F675B1AD46CE9002850C2 /* PThreadEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FE0C71334A0024798E /* PThreadEvent.cpp */; };
- 456F675C1AD46CE9002850C2 /* PThreadMutex.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */; };
- 456F675D1AD46CE9002850C2 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
- 456F675E1AD46CE9002850C2 /* DNBArchImplX86_64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */; };
- 456F675F1AD46CE9002850C2 /* DNBArchImplI386.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */; };
- 456F67601AD46CE9002850C2 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */; };
- 456F67611AD46CE9002850C2 /* DNBArchImpl.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */; };
- 456F67621AD46CE9002850C2 /* CFString.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD9B0D3EC160007E4CA2 /* CFString.cpp */; };
- 456F67641AD46CE9002850C2 /* CFBundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */; };
- 456F67651AD46CE9002850C2 /* PseudoTerminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */; };
- 456F67671AD46CE9002850C2 /* DNBArch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 264D5D571293835600ED4C01 /* DNBArch.cpp */; };
- 456F67691AD46CE9002850C2 /* DNBArchImplARM64.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */; };
- 456F676B1AD46CE9002850C2 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 26ACA3340D3E956300A2120B /* CoreFoundation.framework */; settings = {ATTRIBUTES = (Required, ); }; };
- 49D404621E39260F00570CDC /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; };
+ AF588449206077BD00A0CB5A /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */; };
+ D6631CA91E848FE9006A7B11 /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */; };
AF48558C1D75126800D19C07 /* StdStringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */; };
AF48558D1D75127500D19C07 /* StdStringExtractor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */; };
- AFA3FCA11E39984900218D5E /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 49D404611E39260F00570CDC /* Foundation.framework */; };
- AFEC3364194A8B0B00FF05C6 /* Genealogy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */; };
- D6631CA91E848FE9006A7B11 /* SocketAddress.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */; };
+ 23043C9E1D35DBFA00FC25CA /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */; };
+ 233B4EA91D2DB96A00E98261 /* StringConvert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */; };
+ 26CE05BE115C36440022F371 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
+ 456F675D1AD46CE9002850C2 /* SysSignal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26C638010C71334A0024798E /* SysSignal.cpp */; };
+ 26CE05AE115C36320022F371 /* dbgnub-mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E80C71334A0024798E /* dbgnub-mig.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; };
+ 456F674D1AD46CE9002850C2 /* dbgnub-mig.defs in Sources */ = {isa = PBXBuildFile; fileRef = 26C637E80C71334A0024798E /* dbgnub-mig.defs */; settings = {ATTRIBUTES = (Client, Server, ); }; };
+ 26CE05A9115C36250022F371 /* debugserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A02918114AB9240029C479 /* debugserver.cpp */; };
+ 456F67481AD46CE9002850C2 /* debugserver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 26A02918114AB9240029C479 /* debugserver.cpp */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
- 2307CCCC1D4A5DAE0016ABC0 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 233B4EA51D2DB54300E98261 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSON.cpp; sourceTree = "<group>"; };
- 233B4EA61D2DB54300E98261 /* JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSON.h; sourceTree = "<group>"; };
- 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringConvert.cpp; path = ../../../source/Host/common/StringConvert.cpp; sourceTree = "<group>"; };
- 23562ECF1D34110D00AB2BD4 /* DarwinLogTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogTypes.h; sourceTree = "<group>"; };
- 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogMessageOsLog.cpp; sourceTree = "<group>"; };
- 23562ED11D3424DF00AB2BD4 /* LogMessageOsLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogMessageOsLog.h; sourceTree = "<group>"; };
- 23562ED41D3426DD00AB2BD4 /* ActivityStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActivityStore.h; sourceTree = "<group>"; };
23562ED51D342A5A00AB2BD4 /* ActivityStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ActivityStore.cpp; sourceTree = "<group>"; };
- 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogMessage.cpp; sourceTree = "<group>"; };
- 237821AD1D4917D20028B7A1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
- 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterExactMatch.cpp; sourceTree = "<group>"; };
- 237821AF1D4917D20028B7A1 /* LogFilterExactMatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterExactMatch.h; sourceTree = "<group>"; };
- 23AC04C41D2F41A00072351D /* LogFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilter.cpp; sourceTree = "<group>"; };
- 23AC04C51D2F41A00072351D /* LogFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilter.h; sourceTree = "<group>"; };
- 23AC04C81D2F42250072351D /* LogFilterChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterChain.cpp; sourceTree = "<group>"; };
- 23AC04C91D2F42250072351D /* LogFilterChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterChain.h; sourceTree = "<group>"; };
- 23AC04CC1D2F42F10072351D /* DarwinLogInterfaces.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogInterfaces.h; sourceTree = "<group>"; };
- 23AC04CD1D2F58AF0072351D /* LogFilterRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterRegex.cpp; sourceTree = "<group>"; };
- 23AC04CE1D2F58AF0072351D /* LogFilterRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterRegex.h; sourceTree = "<group>"; };
- 23AC04D11D2F60130072351D /* LogMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogMessage.h; sourceTree = "<group>"; };
- 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DarwinLogCollector.cpp; sourceTree = "<group>"; };
- 23AE72E31D25DECF00945BCE /* DarwinLogCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DarwinLogCollector.h; sourceTree = "<group>"; };
+ 23562ED41D3426DD00AB2BD4 /* ActivityStore.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActivityStore.h; sourceTree = "<group>"; };
23AE72E61D25DEFB00945BCE /* ActivityStreamSPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ActivityStreamSPI.h; sourceTree = "<group>"; };
- 23CF6F5E1D28A3760088ADC9 /* DarwinLogEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogEvent.h; sourceTree = "<group>"; };
- 23D1B0271D497E8B00FF831B /* OsLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OsLogger.cpp; sourceTree = "<group>"; };
- 23D1B0281D497E8B00FF831B /* OsLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OsLogger.h; sourceTree = "<group>"; };
- 260828DE0CBAF7F400F95054 /* DNBRuntimeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBRuntimeAction.h; sourceTree = "<group>"; };
- 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBThreadResumeActions.cpp; sourceTree = "<group>"; };
- 260E7332114BFFE600D1DFB3 /* DNBThreadResumeActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBThreadResumeActions.h; sourceTree = "<group>"; };
- 260FC7320E5B290400043FC9 /* debugnub-exports */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "debugnub-exports"; sourceTree = SOURCE_ROOT; };
- 26203D1C1641EFB200A662F7 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
- 26203D1D1641EFB200A662F7 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
- 26242C390DDBD33C0054A4CC /* debugserver-entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "debugserver-entitlements.plist"; sourceTree = "<group>"; };
- 264D5D571293835600ED4C01 /* DNBArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArch.cpp; sourceTree = "<group>"; };
- 264F679A1B2F9EB200140093 /* JSONGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONGenerator.h; sourceTree = "<group>"; };
- 26593A060D4931CC001C9FE3 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };
- 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplARM64.cpp; sourceTree = "<group>"; };
- 266B5ED01460A68200E43F0A /* DNBArchImplARM64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplARM64.h; sourceTree = "<group>"; };
- 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PThreadMutex.cpp; sourceTree = "<group>"; };
- 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DNBArchImpl.cpp; path = arm/DNBArchImpl.cpp; sourceTree = "<group>"; };
- 2675D4230CCEB705000F49AF /* DNBArchImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DNBArchImpl.h; path = arm/DNBArchImpl.h; sourceTree = "<group>"; };
2695DD910D3EBFF6007E4CA2 /* CFBundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFBundle.cpp; sourceTree = "<group>"; };
2695DD920D3EBFF6007E4CA2 /* CFBundle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFBundle.h; sourceTree = "<group>"; };
- 2695DD9A0D3EC160007E4CA2 /* CFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFString.h; sourceTree = "<group>"; };
2695DD9B0D3EC160007E4CA2 /* CFString.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CFString.cpp; sourceTree = "<group>"; };
- 269E8DF8164B2ED200AD65F6 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
- 26A02918114AB9240029C479 /* debugserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debugserver.cpp; sourceTree = "<group>"; };
- 26A4BAED0D498B7D00A9BEAB /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.plist; sourceTree = "<group>"; };
- 26A68F7D0D104EC800665A9E /* RNBContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBContext.h; sourceTree = "<group>"; };
- 26A68F7E0D104EC800665A9E /* RNBContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBContext.cpp; sourceTree = "<group>"; };
- 26A68FAF0D1054DA00665A9E /* RNBSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBSocket.h; sourceTree = "<group>"; };
- 26A68FB00D1054DA00665A9E /* RNBSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBSocket.cpp; sourceTree = "<group>"; };
- 26A68FD50D10574500665A9E /* RNBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBRemote.h; sourceTree = "<group>"; };
- 26A68FD60D10574500665A9E /* RNBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBRemote.cpp; sourceTree = "<group>"; };
- 26A8FE1E0D11A77B00203048 /* DNBTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBTimer.h; sourceTree = "<group>"; };
+ 2695DD9A0D3EC160007E4CA2 /* CFString.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CFString.h; sourceTree = "<group>"; };
+ 26C637E70C71334A0024798E /* CFUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CFUtils.h; sourceTree = "<group>"; };
+ 2307CCCC1D4A5DAE0016ABC0 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
+ 237821AD1D4917D20028B7A1 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
+ 26593A060D4931CC001C9FE3 /* ChangeLog */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ChangeLog; sourceTree = "<group>"; };
26ACA3340D3E956300A2120B /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
- 26B67DE00EE9BC30006C8BC0 /* MachTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachTask.h; sourceTree = "<group>"; };
- 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MachTask.mm; sourceTree = "<group>"; };
26C637D60C71334A0024798E /* DNB.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNB.cpp; sourceTree = "<group>"; };
26C637D70C71334A0024798E /* DNB.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNB.h; sourceTree = "<group>"; };
+ 264D5D571293835600ED4C01 /* DNBArch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArch.cpp; sourceTree = "<group>"; };
26C637D80C71334A0024798E /* DNBArch.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBArch.h; sourceTree = "<group>"; };
+ 2675D4220CCEB705000F49AF /* DNBArchImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = DNBArchImpl.cpp; path = arm/DNBArchImpl.cpp; sourceTree = "<group>"; };
+ 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImpl.cpp; sourceTree = "<group>"; };
+ 2675D4230CCEB705000F49AF /* DNBArchImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = DNBArchImpl.h; path = arm/DNBArchImpl.h; sourceTree = "<group>"; };
+ 26C637FC0C71334A0024798E /* DNBArchImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBArchImpl.h; sourceTree = "<group>"; };
+ 266B5ECF1460A68200E43F0A /* DNBArchImplARM64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplARM64.cpp; sourceTree = "<group>"; };
+ 266B5ED01460A68200E43F0A /* DNBArchImplARM64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplARM64.h; sourceTree = "<group>"; };
+ 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplI386.cpp; sourceTree = "<group>"; };
+ 26C637EB0C71334A0024798E /* DNBArchImplI386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBArchImplI386.h; sourceTree = "<group>"; };
+ 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplX86_64.cpp; sourceTree = "<group>"; };
+ 26CF99A31142EB7400011AAB /* DNBArchImplX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplX86_64.h; sourceTree = "<group>"; };
26C637D90C71334A0024798E /* DNBBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBBreakpoint.cpp; sourceTree = "<group>"; };
26C637DA0C71334A0024798E /* DNBBreakpoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBBreakpoint.h; sourceTree = "<group>"; };
26C637DB0C71334A0024798E /* DNBDataRef.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBDataRef.cpp; sourceTree = "<group>"; };
@@ -178,14 +143,42 @@
26C637E10C71334A0024798E /* DNBLog.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBLog.h; sourceTree = "<group>"; };
26C637E20C71334A0024798E /* DNBRegisterInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBRegisterInfo.cpp; sourceTree = "<group>"; };
26C637E30C71334A0024798E /* DNBRegisterInfo.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBRegisterInfo.h; sourceTree = "<group>"; };
- 26C637E70C71334A0024798E /* CFUtils.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CFUtils.h; sourceTree = "<group>"; };
- 26C637E80C71334A0024798E /* dbgnub-mig.defs */ = {isa = PBXFileReference; explicitFileType = sourcecode.mig; fileEncoding = 30; path = "dbgnub-mig.defs"; sourceTree = "<group>"; };
- 26C637EA0C71334A0024798E /* DNBArchImplI386.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplI386.cpp; sourceTree = "<group>"; };
- 26C637EB0C71334A0024798E /* DNBArchImplI386.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBArchImplI386.h; sourceTree = "<group>"; };
+ 260828DE0CBAF7F400F95054 /* DNBRuntimeAction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBRuntimeAction.h; sourceTree = "<group>"; };
+ 260E7331114BFFE600D1DFB3 /* DNBThreadResumeActions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBThreadResumeActions.cpp; sourceTree = "<group>"; };
+ 260E7332114BFFE600D1DFB3 /* DNBThreadResumeActions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBThreadResumeActions.h; sourceTree = "<group>"; };
+ 26A8FE1E0D11A77B00203048 /* DNBTimer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBTimer.h; sourceTree = "<group>"; };
+ 23AE72E21D25DECF00945BCE /* DarwinLogCollector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DarwinLogCollector.cpp; sourceTree = "<group>"; };
+ 23AE72E31D25DECF00945BCE /* DarwinLogCollector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DarwinLogCollector.h; sourceTree = "<group>"; };
+ 23CF6F5E1D28A3760088ADC9 /* DarwinLogEvent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogEvent.h; sourceTree = "<group>"; };
+ 23AC04CC1D2F42F10072351D /* DarwinLogInterfaces.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogInterfaces.h; sourceTree = "<group>"; };
+ 23562ECF1D34110D00AB2BD4 /* DarwinLogTypes.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DarwinLogTypes.h; sourceTree = "<group>"; };
+ 49D404611E39260F00570CDC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Genealogy.cpp; sourceTree = "<group>"; };
+ AF0934BA18E12B92005A11FD /* Genealogy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Genealogy.h; sourceTree = "<group>"; };
+ AF0934BB18E12B92005A11FD /* GenealogySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenealogySPI.h; sourceTree = "<group>"; };
+ 233B4EA51D2DB54300E98261 /* JSON.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSON.cpp; sourceTree = "<group>"; };
+ 233B4EA61D2DB54300E98261 /* JSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSON.h; sourceTree = "<group>"; };
+ 264F679A1B2F9EB200140093 /* JSONGenerator.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = JSONGenerator.h; sourceTree = "<group>"; };
+ 23AC04C41D2F41A00072351D /* LogFilter.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilter.cpp; sourceTree = "<group>"; };
+ 23AC04C51D2F41A00072351D /* LogFilter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilter.h; sourceTree = "<group>"; };
+ 23AC04C81D2F42250072351D /* LogFilterChain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterChain.cpp; sourceTree = "<group>"; };
+ 23AC04C91D2F42250072351D /* LogFilterChain.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterChain.h; sourceTree = "<group>"; };
+ 237821AE1D4917D20028B7A1 /* LogFilterExactMatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterExactMatch.cpp; sourceTree = "<group>"; };
+ 237821AF1D4917D20028B7A1 /* LogFilterExactMatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterExactMatch.h; sourceTree = "<group>"; };
+ 23AC04CD1D2F58AF0072351D /* LogFilterRegex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogFilterRegex.cpp; sourceTree = "<group>"; };
+ 23AC04CE1D2F58AF0072351D /* LogFilterRegex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogFilterRegex.h; sourceTree = "<group>"; };
+ 23562ED81D342B0000AB2BD4 /* LogMessage.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogMessage.cpp; sourceTree = "<group>"; };
+ 23AC04D11D2F60130072351D /* LogMessage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LogMessage.h; sourceTree = "<group>"; };
+ 23562ED01D3424DF00AB2BD4 /* LogMessageOsLog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LogMessageOsLog.cpp; sourceTree = "<group>"; };
+ 23562ED11D3424DF00AB2BD4 /* LogMessageOsLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogMessageOsLog.h; sourceTree = "<group>"; };
26C637EE0C71334A0024798E /* MachException.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachException.cpp; sourceTree = "<group>"; };
26C637EF0C71334A0024798E /* MachException.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachException.h; sourceTree = "<group>"; };
- 26C637F00C71334A0024798E /* MachProcess.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MachProcess.mm; sourceTree = "<group>"; };
26C637F10C71334A0024798E /* MachProcess.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachProcess.h; sourceTree = "<group>"; };
+ 26C637F00C71334A0024798E /* MachProcess.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = MachProcess.mm; sourceTree = "<group>"; };
+ 49F530111331519C008956F6 /* MachRegisterStatesI386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesI386.h; sourceTree = "<group>"; };
+ 49F5301213316D7F008956F6 /* MachRegisterStatesX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesX86_64.h; sourceTree = "<group>"; };
+ 26B67DE00EE9BC30006C8BC0 /* MachTask.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachTask.h; sourceTree = "<group>"; };
+ 26B67DE10EE9BC30006C8BC0 /* MachTask.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = MachTask.mm; sourceTree = "<group>"; };
26C637F20C71334A0024798E /* MachThread.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachThread.cpp; sourceTree = "<group>"; };
26C637F30C71334A0024798E /* MachThread.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachThread.h; sourceTree = "<group>"; };
26C637F40C71334A0024798E /* MachThreadList.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachThreadList.cpp; sourceTree = "<group>"; };
@@ -194,38 +187,45 @@
26C637F70C71334A0024798E /* MachVMMemory.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachVMMemory.h; sourceTree = "<group>"; };
26C637F80C71334A0024798E /* MachVMRegion.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MachVMRegion.cpp; sourceTree = "<group>"; };
26C637F90C71334A0024798E /* MachVMRegion.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = MachVMRegion.h; sourceTree = "<group>"; };
- 26C637FB0C71334A0024798E /* DNBArchImpl.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImpl.cpp; sourceTree = "<group>"; };
- 26C637FC0C71334A0024798E /* DNBArchImpl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DNBArchImpl.h; sourceTree = "<group>"; };
+ 23D1B0271D497E8B00FF831B /* OsLogger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = OsLogger.cpp; sourceTree = "<group>"; };
+ 23D1B0281D497E8B00FF831B /* OsLogger.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OsLogger.h; sourceTree = "<group>"; };
26C637FD0C71334A0024798E /* PThreadCondition.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadCondition.h; sourceTree = "<group>"; };
26C637FE0C71334A0024798E /* PThreadEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = PThreadEvent.cpp; sourceTree = "<group>"; };
26C637FF0C71334A0024798E /* PThreadEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadEvent.h; sourceTree = "<group>"; };
+ 2672DBEE0EEF446700E92059 /* PThreadMutex.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PThreadMutex.cpp; sourceTree = "<group>"; };
26C638000C71334A0024798E /* PThreadMutex.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = PThreadMutex.h; sourceTree = "<group>"; };
+ AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoTerminal.cpp; sourceTree = "<group>"; };
+ AF67AC000D34604D0022D128 /* PseudoTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoTerminal.h; sourceTree = "<group>"; };
+ 26A68F7E0D104EC800665A9E /* RNBContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBContext.cpp; sourceTree = "<group>"; };
+ 26A68F7D0D104EC800665A9E /* RNBContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBContext.h; sourceTree = "<group>"; };
+ 26E6B9DA0D1329010037ECDD /* RNBDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBDefs.h; sourceTree = "<group>"; };
+ 26A68FD60D10574500665A9E /* RNBRemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBRemote.cpp; sourceTree = "<group>"; };
+ 26A68FD50D10574500665A9E /* RNBRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBRemote.h; sourceTree = "<group>"; };
+ EF8878A00D9C797C001831DA /* RNBServices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBServices.cpp; sourceTree = "<group>"; };
+ EF88789F0D9C797C001831DA /* RNBServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBServices.h; sourceTree = "<group>"; };
+ 26A68FB00D1054DA00665A9E /* RNBSocket.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBSocket.cpp; sourceTree = "<group>"; };
+ 26A68FAF0D1054DA00665A9E /* RNBSocket.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBSocket.h; sourceTree = "<group>"; };
+ D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = ../../source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
+ AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StdStringExtractor.cpp; sourceTree = "<group>"; };
+ 233B4EA81D2DB96A00E98261 /* StringConvert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = StringConvert.cpp; path = ../../../source/Host/common/StringConvert.cpp; sourceTree = "<group>"; };
26C638010C71334A0024798E /* SysSignal.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = SysSignal.cpp; sourceTree = "<group>"; };
26C638020C71334A0024798E /* SysSignal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = SysSignal.h; sourceTree = "<group>"; };
26C638050C71334A0024798E /* TTYState.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = TTYState.cpp; sourceTree = "<group>"; };
26C638060C71334A0024798E /* TTYState.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TTYState.h; sourceTree = "<group>"; };
+ 26203D1C1641EFB200A662F7 /* com.apple.debugserver.applist.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.applist.internal.plist; sourceTree = "<group>"; };
+ EF88788B0D9C7558001831DA /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
+ 26203D1D1641EFB200A662F7 /* com.apple.debugserver.internal.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.internal.plist; sourceTree = "<group>"; };
+ 26A4BAED0D498B7D00A9BEAB /* com.apple.debugserver.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.plist; sourceTree = "<group>"; };
+ 269E8DF8164B2ED200AD65F6 /* com.apple.debugserver.posix.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.posix.plist; sourceTree = "<group>"; };
+ AF949ED620605DC2002A91F9 /* com.apple.internal.xpc.remote.debugserver.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = com.apple.internal.xpc.remote.debugserver.plist; sourceTree = "<group>"; };
+ 26C637E80C71334A0024798E /* dbgnub-mig.defs */ = {isa = PBXFileReference; explicitFileType = sourcecode.mig; fileEncoding = 30; path = "dbgnub-mig.defs"; sourceTree = "<group>"; };
+ 260FC7320E5B290400043FC9 /* debugnub-exports */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "debugnub-exports"; sourceTree = SOURCE_ROOT; };
26CE0594115C31C20022F371 /* debugserver */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = debugserver; sourceTree = BUILT_PRODUCTS_DIR; };
- 26CF99A21142EB7400011AAB /* DNBArchImplX86_64.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DNBArchImplX86_64.cpp; sourceTree = "<group>"; };
- 26CF99A31142EB7400011AAB /* DNBArchImplX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DNBArchImplX86_64.h; sourceTree = "<group>"; };
- 26E6B9DA0D1329010037ECDD /* RNBDefs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBDefs.h; sourceTree = "<group>"; };
+ 26242C390DDBD33C0054A4CC /* debugserver-entitlements.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "debugserver-entitlements.plist"; sourceTree = "<group>"; };
+ AF61C60418F75ABC00B48D9D /* debugserver-macosx-entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "debugserver-macosx-entitlements.plist"; sourceTree = "<group>"; };
456F67721AD46CE9002850C2 /* debugserver-nonui */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "debugserver-nonui"; sourceTree = BUILT_PRODUCTS_DIR; };
- 49D404611E39260F00570CDC /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
- 49F530111331519C008956F6 /* MachRegisterStatesI386.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesI386.h; sourceTree = "<group>"; };
- 49F5301213316D7F008956F6 /* MachRegisterStatesX86_64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachRegisterStatesX86_64.h; sourceTree = "<group>"; };
+ 26A02918114AB9240029C479 /* debugserver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = debugserver.cpp; sourceTree = "<group>"; };
9457ECF61419864100DFE7D8 /* stack_logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = stack_logging.h; sourceTree = "<group>"; };
- AF0934BA18E12B92005A11FD /* Genealogy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Genealogy.h; sourceTree = "<group>"; };
- AF0934BB18E12B92005A11FD /* GenealogySPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GenealogySPI.h; sourceTree = "<group>"; };
- AF48558B1D75126800D19C07 /* StdStringExtractor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StdStringExtractor.cpp; sourceTree = "<group>"; };
- AF61C60418F75ABC00B48D9D /* debugserver-macosx-entitlements.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "debugserver-macosx-entitlements.plist"; sourceTree = "<group>"; };
- AF67ABFF0D34604D0022D128 /* PseudoTerminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PseudoTerminal.cpp; sourceTree = "<group>"; };
- AF67AC000D34604D0022D128 /* PseudoTerminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PseudoTerminal.h; sourceTree = "<group>"; };
- AFEC3363194A8B0B00FF05C6 /* Genealogy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Genealogy.cpp; sourceTree = "<group>"; };
- D6631CA81E848FE9006A7B11 /* SocketAddress.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = SocketAddress.cpp; path = ../../source/Host/common/SocketAddress.cpp; sourceTree = "<group>"; };
- ED128B7918E1F163003F6A7B /* libpmenergy.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmenergy.dylib; path = usr/lib/libpmenergy.dylib; sourceTree = SDKROOT; };
- ED128B7A18E1F163003F6A7B /* libpmsample.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libpmsample.dylib; path = usr/lib/libpmsample.dylib; sourceTree = SDKROOT; };
- EF88788B0D9C7558001831DA /* com.apple.debugserver.applist.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = com.apple.debugserver.applist.plist; sourceTree = "<group>"; };
- EF88789F0D9C797C001831DA /* RNBServices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RNBServices.h; sourceTree = "<group>"; };
- EF8878A00D9C797C001831DA /* RNBServices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RNBServices.cpp; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -320,14 +320,15 @@
26A028FE114AB6A60029C479 /* Resources */ = {
isa = PBXGroup;
children = (
+ 26A4BAED0D498B7D00A9BEAB /* com.apple.debugserver.plist */,
+ EF88788B0D9C7558001831DA /* com.apple.debugserver.applist.plist */,
269E8DF8164B2ED200AD65F6 /* com.apple.debugserver.posix.plist */,
26203D1C1641EFB200A662F7 /* com.apple.debugserver.applist.internal.plist */,
26203D1D1641EFB200A662F7 /* com.apple.debugserver.internal.plist */,
+ AF949ED620605DC2002A91F9 /* com.apple.internal.xpc.remote.debugserver.plist */,
260FC7320E5B290400043FC9 /* debugnub-exports */,
26242C390DDBD33C0054A4CC /* debugserver-entitlements.plist */,
AF61C60418F75ABC00B48D9D /* debugserver-macosx-entitlements.plist */,
- 26A4BAED0D498B7D00A9BEAB /* com.apple.debugserver.plist */,
- EF88788B0D9C7558001831DA /* com.apple.debugserver.applist.plist */,
);
name = Resources;
sourceTree = "<group>";
@@ -377,8 +378,6 @@
26ACA3330D3E94F200A2120B /* Framework */ = {
isa = PBXGroup;
children = (
- ED128B7918E1F163003F6A7B /* libpmenergy.dylib */,
- ED128B7A18E1F163003F6A7B /* libpmsample.dylib */,
26ACA3340D3E956300A2120B /* CoreFoundation.framework */,
);
name = Framework;
@@ -571,7 +570,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = "/bin/sh -x";
- shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\n if [ -n \"${DEBUGSERVER_USE_FROM_SYSTEM}\" ]\n then\n\t\tditto \"${DEVELOPER_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver\" \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n elif [ \"${DEBUGSERVER_DISABLE_CODESIGN}\" == \"\" ]\n then\n codesign -f -s lldb_codesign \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n fi\nfi\n";
+ shellScript = "if [ \"${CONFIGURATION}\" != BuildAndIntegration ]\nthen\n if [ -n \"${DEBUGSERVER_USE_FROM_SYSTEM}\" ]\n then\n\t\tditto \"${DEVELOPER_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver\" \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n elif [ \"${DEBUGSERVER_DISABLE_CODESIGN}\" == \"\" ]\n then\n codesign -f -s lldb_codesign --entitlements ${SRCROOT}/../../resources/debugserver-macosx-entitlements.plist \"${TARGET_BUILD_DIR}/${TARGET_NAME}\"\n fi\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
@@ -670,6 +669,7 @@
23AC04C71D2F41A00072351D /* LogFilter.cpp in Sources */,
23043C9E1D35DBFA00FC25CA /* StringConvert.cpp in Sources */,
456F67611AD46CE9002850C2 /* DNBArchImpl.cpp in Sources */,
+ AF588449206077BD00A0CB5A /* SocketAddress.cpp in Sources */,
456F67621AD46CE9002850C2 /* CFString.cpp in Sources */,
23AC04CB1D2F42250072351D /* LogFilterChain.cpp in Sources */,
AF48558D1D75127500D19C07 /* StdStringExtractor.cpp in Sources */,
@@ -687,10 +687,8 @@
1DEB914F08733D8E0010E9CD /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- arm64,
- armv7,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -712,15 +710,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIP_INSTALLED_PRODUCT = NO;
@@ -732,10 +727,8 @@
1DEB915008733D8E0010E9CD /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- armv7,
- armv7s,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -756,15 +749,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
@@ -777,6 +768,7 @@
262419A11198A93E00067686 /* BuildAndIntegration */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
"ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
@@ -798,15 +790,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 1;
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.10;
OTHER_CFLAGS = "";
STRIPFLAGS = "-x";
STRIP_STYLE = debugging;
@@ -839,26 +828,14 @@
HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders;
INSTALL_PATH = /usr/bin;
"INSTALL_PATH[sdk=iphoneos*]" = /Developer/usr/bin/;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=appletvos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=iphoneos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11internal]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=watchos*]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=appletvos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=iphoneos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11internal]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=watchos*]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx*]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
@@ -873,9 +850,12 @@
"-DWITH_FBS",
"-DWITH_BKS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
@@ -889,6 +869,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -897,16 +878,13 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = debugserver;
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
"SKIP_INSTALL[sdk=iphoneos*]" = NO;
STRIP_INSTALLED_PRODUCT = YES;
@@ -938,30 +916,18 @@
GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/bin;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=appletvos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=iphoneos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11internal]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=watchos*]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=appletvos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=iphoneos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11internal]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=watchos*]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
- "$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
@@ -972,9 +938,12 @@
"-DWITH_BKS",
"-DWITH_FBS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
@@ -988,6 +957,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -996,7 +966,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
);
@@ -1005,9 +975,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1036,30 +1003,18 @@
GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_RELEASE;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/bin;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=appletvos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=iphoneos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11internal]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=watchos*]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=appletvos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=iphoneos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11internal]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=watchos*]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
- "$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
@@ -1070,9 +1025,12 @@
"-DWITH_FBS",
"-DWITH_BKS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
@@ -1086,6 +1044,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1094,7 +1053,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1103,9 +1062,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1151,47 +1107,52 @@
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = /usr/local/bin;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
ONLY_ACTIVE_ARCH = YES;
- OTHER_CFLAGS = "";
+ OTHER_CFLAGS = (
+ "-Wparentheses",
+ "-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
+ "$(LLDB_COMPRESSION_CFLAGS)",
+ "$(LLDB_ZLIB_CFLAGS)",
+ "$(LLDB_OS_LOG_CFLAGS)",
+ );
"OTHER_CFLAGS[sdk=iphoneos*][arch=*]" = (
"-Wparentheses",
"-DOS_OBJECT_USE_OBJC=0",
"-DDEBUGSERVER_PROGRAM_SYMBOL=debugserver_nonui",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "$(LLDB_COMPRESSION_CFLAGS)",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
Foundation,
+ "$(LLDB_ENERGY_LDFLAGS)",
+ "$(LLDB_COMPRESSION_LDFLAGS)",
);
"OTHER_LDFLAGS[sdk=macosx*]" = (
"-sectcreate",
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
+ "$(LLDB_COMPRESSION_LDFLAGS)",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = "debugserver-nonui";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
SKIP_INSTALL = YES;
STRIP_INSTALLED_PRODUCT = NO;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
@@ -1226,11 +1187,10 @@
INSTALL_PATH = /usr/local/bin;
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
OTHER_CFLAGS = (
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
);
@@ -1245,6 +1205,7 @@
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
Foundation,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
);
"OTHER_LDFLAGS[sdk=macosx*]" = (
@@ -1252,7 +1213,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1260,10 +1221,7 @@
PRODUCT_NAME = "debugserver-nonui";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1293,13 +1251,14 @@
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
HEADER_SEARCH_PATHS = /System/Library/Frameworks/System.framework/PrivateHeaders;
INSTALL_PATH = /usr/local/bin;
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
OTHER_CFLAGS = (
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"-DDEBUGSERVER_PROGRAM_SYMBOL=debugserver_nonui",
@@ -1309,6 +1268,8 @@
"-Wparentheses",
"-DOS_OBJECT_USE_OBJC=0",
"-DDEBUGSERVER_PROGRAM_SYMBOL=debugserver_nonui",
+ "$(LLDB_ENERGY_CFLAGS)",
+ "$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
@@ -1316,6 +1277,7 @@
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
"-framework",
Foundation,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1324,7 +1286,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1332,10 +1294,7 @@
PRODUCT_NAME = "debugserver-nonui";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1368,10 +1327,8 @@
"INSTALL_PATH[sdk=iphoneos*]" = /usr/local/bin;
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx*]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx*]" = "-weak-lpmenergy -weak-lpmsample";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
@@ -1395,11 +1352,11 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = "debugserver-nonui";
- SDKROOT = macosx.internal;
+ SDKROOT = macosx;
SKIP_INSTALL = YES;
"SKIP_INSTALL[sdk=iphoneos*]" = NO;
STRIP_INSTALLED_PRODUCT = YES;
@@ -1411,10 +1368,8 @@
4968B7A916657FAE00741ABB /* DebugClang */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- arm64,
- armv7,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -1436,14 +1391,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_BUILDER = "$(USER)";
@@ -1473,30 +1426,18 @@
GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/bin;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=appletvos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=iphoneos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11internal]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=watchos*]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=appletvos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=iphoneos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11internal]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=watchos*]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
- "$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
@@ -1507,9 +1448,12 @@
"-DWITH_FBS",
"-DWITH_BKS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
@@ -1522,6 +1466,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1530,7 +1475,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1539,9 +1484,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1551,10 +1493,8 @@
940AD5251B1FE3B10051E88F /* DebugPresubmission */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- arm64,
- armv7,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -1576,14 +1516,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_BUILDER = "$(USER)";
@@ -1613,26 +1551,14 @@
GCC_PREPROCESSOR_DEFINITIONS = LLDB_DEBUGSERVER_DEBUG;
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
INSTALL_PATH = /usr/bin;
- LLDB_COMPRESSION_CFLAGS = "";
- "LLDB_COMPRESSION_CFLAGS[sdk=appletvos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=iphoneos*]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=macosx10.11internal]" = "-DHAVE_LIBCOMPRESSION=1";
- "LLDB_COMPRESSION_CFLAGS[sdk=watchos*]" = "-DHAVE_LIBCOMPRESSION=1";
- LLDB_COMPRESSION_LDFLAGS = "";
- "LLDB_COMPRESSION_LDFLAGS[sdk=appletvos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=iphoneos*]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=macosx10.11internal]" = "-weak-lcompression";
- "LLDB_COMPRESSION_LDFLAGS[sdk=watchos*]" = "-weak-lcompression";
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
@@ -1646,9 +1572,12 @@
"-DWITH_FBS",
"-DWITH_BKS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
@@ -1661,6 +1590,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1669,7 +1599,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1678,9 +1608,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1712,10 +1639,8 @@
INSTALL_PATH = /usr/local/bin;
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
OTHER_CFLAGS = (
"-Wparentheses",
"$(LLDB_ENERGY_CFLAGS)",
@@ -1738,16 +1663,13 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
);
OTHER_MIGFLAGS = "-I$(DERIVED_FILE_DIR)";
PRODUCT_NAME = "debugserver-nonui";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1771,10 +1693,8 @@
94D72C871ADF10AA00A3F718 /* CustomSwift-Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- arm64,
- armv7,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -1796,14 +1716,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
STRIP_INSTALLED_PRODUCT = NO;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_BUILDER = "$(USER)";
@@ -1837,16 +1755,14 @@
LLDB_COMPRESSION_LDFLAGS = "";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
- "$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
@@ -1857,9 +1773,12 @@
"-DWITH_BKS",
"-DWITH_FBS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
OTHER_LDFLAGS = "";
@@ -1873,6 +1792,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1881,7 +1801,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -1890,9 +1810,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
@@ -1902,10 +1819,8 @@
94D72C891ADF10B000A3F718 /* CustomSwift-Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
- "ARCHS[sdk=iphoneos*]" = (
- armv7,
- armv7s,
- );
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ "ARCHS[sdk=iphoneos*]" = arm64;
"ARCHS[sdk=macosx*]" = "$(ARCHS_STANDARD_64_BIT)";
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
@@ -1926,14 +1841,12 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
+ LLDB_COMPRESSION_CFLAGS = "-DHAVE_LIBCOMPRESSION=1";
+ LLDB_COMPRESSION_LDFLAGS = "-lcompression";
LLDB_OS_LOG_CFLAGS = "-DLLDB_USE_OS_LOG=$(LLDB_USE_OS_LOG)";
LLDB_USE_OS_LOG = 0;
- MACOSX_DEPLOYMENT_TARGET = 10.10;
ONLY_ACTIVE_ARCH = YES;
- SDKROOT = macosx.internal;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
+ SDKROOT = macosx;
STRIPFLAGS = "-x";
STRIP_STYLE = debugging;
VERSIONING_SYSTEM = "apple-generic";
@@ -1968,16 +1881,14 @@
LLDB_COMPRESSION_LDFLAGS = "";
LLDB_DEBUGSERVER = 1;
LLDB_ENERGY_CFLAGS = "";
- "LLDB_ENERGY_CFLAGS[sdk=macosx.internal]" = "-DLLDB_ENERGY";
- LLDB_ENERGY_LFLAGS = "";
- "LLDB_ENERGY_LFLAGS[sdk=macosx.internal]" = "-weak-lpmenergy -weak-lpmsample";
+ "LLDB_ENERGY_CFLAGS[sdk=*.internal]" = "-DLLDB_ENERGY";
+ LLDB_ENERGY_LDFLAGS = "-lpmenergy -lpmsample";
LLDB_ZLIB_CFLAGS = "-DHAVE_LIBZ=1";
LLDB_ZLIB_LDFLAGS = "-lz";
- MACOSX_DEPLOYMENT_TARGET = 10.9;
OTHER_CFLAGS = (
"-Wparentheses",
- "$(LLDB_ENERGY_CFLAGS)",
"-DDT_VARIANT_$(DT_VARIANT)",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
@@ -1988,9 +1899,12 @@
"-DWITH_FBS",
"-DWITH_BKS",
"-DOS_OBJECT_USE_OBJC=0",
+ "$(LLDB_ENERGY_CFLAGS)",
"$(LLDB_COMPRESSION_CFLAGS)",
"$(LLDB_ZLIB_CFLAGS)",
"$(LLDB_OS_LOG_CFLAGS)",
+ "-isystem",
+ "$(SDKROOT)/System/Library/Frameworks/System.framework/PrivateHeaders",
);
"OTHER_CPLUSPLUSFLAGS[sdk=iphoneos*][arch=*]" = "$(OTHER_CFLAGS)";
"OTHER_LDFLAGS[sdk=iphoneos*][arch=*]" = (
@@ -2003,6 +1917,7 @@
FrontBoardServices,
"-framework",
MobileCoreServices,
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -2011,7 +1926,7 @@
__TEXT,
__info_plist,
"$(PROJECT_DIR)/resources/lldb-debugserver-Info.plist",
- "$(LLDB_ENERGY_LFLAGS)",
+ "$(LLDB_ENERGY_LDFLAGS)",
"$(LLDB_COMPRESSION_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
);
@@ -2020,9 +1935,6 @@
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
"PROVISIONING_PROFILE[sdk=macosx*]" = "";
SDKROOT = macosx;
- "SDKROOT[arch=i386]" = macosx;
- "SDKROOT[arch=x86_64]" = macosx;
- "SDKROOT[arch=x86_64h]" = macosx;
SKIP_INSTALL = YES;
USER_HEADER_SEARCH_PATHS = "./source ../../source $(DERIVED_SOURCES_DIR) ../../include";
ZERO_LINK = NO;
diff --git a/tools/debugserver/source/CMakeLists.txt b/tools/debugserver/source/CMakeLists.txt
index d99880cd97f3..ec136039d349 100644
--- a/tools/debugserver/source/CMakeLists.txt
+++ b/tools/debugserver/source/CMakeLists.txt
@@ -77,7 +77,7 @@ set(lldbDebugserverCommonSources
RNBSocket.cpp
SysSignal.cpp
TTYState.cpp
-
+
MacOSX/CFBundle.cpp
MacOSX/CFString.cpp
MacOSX/Genealogy.cpp
@@ -95,6 +95,30 @@ set(lldbDebugserverCommonSources
add_library(lldbDebugserverCommon ${lldbDebugserverCommonSources})
+set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
+ CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
+
+if(NOT LLDB_CODESIGN_IDENTITY STREQUAL "")
+ set(DEBUGSERVER_PATH ${LLVM_RUNTIME_OUTPUT_INTDIR}/debugserver${CMAKE_EXECUTABLE_SUFFIX} CACHE PATH "Path to debugserver.")
+ set(SKIP_DEBUGSERVER OFF CACHE BOOL "Skip building the in-tree debug server")
+else()
+ execute_process(
+ COMMAND xcode-select -p
+ OUTPUT_VARIABLE XCODE_DEV_DIR)
+ string(STRIP ${XCODE_DEV_DIR} XCODE_DEV_DIR)
+ if(EXISTS "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/")
+ set(DEBUGSERVER_PATH
+ "${XCODE_DEV_DIR}/../SharedFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.")
+ elseif(EXISTS "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/")
+ set(DEBUGSERVER_PATH
+ "${XCODE_DEV_DIR}/Library/PrivateFrameworks/LLDB.framework/Resources/debugserver" CACHE PATH "Path to debugserver.")
+ else()
+ message(SEND_ERROR "Cannot find debugserver on system.")
+ endif()
+ set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server")
+endif()
+message(STATUS "Path to the lldb debugserver: ${DEBUGSERVER_PATH}")
+
if (APPLE)
if(IOS)
find_library(BACKBOARD_LIBRARY BackBoardServices
@@ -108,7 +132,7 @@ if (APPLE)
find_library(LOCKDOWN_LIBRARY lockdown)
if(NOT BACKBOARD_LIBRARY)
- set(SKIP_DEBUGSERVER True)
+ set(SKIP_DEBUGSERVER ON CACHE BOOL "Skip building the in-tree debug server" FORCE)
endif()
else()
find_library(COCOA_LIBRARY Cocoa)
@@ -137,7 +161,7 @@ if(NOT SKIP_DEBUGSERVER)
COMPILE_DEFINITIONS HAVE_LIBCOMPRESSION)
endif()
set(LLVM_OPTIONAL_SOURCES ${lldbDebugserverCommonSources})
- add_lldb_tool(debugserver INCLUDE_IN_FRAMEWORK
+ add_lldb_tool(debugserver INCLUDE_IN_SUITE
debugserver.cpp
LINK_LIBS
@@ -185,17 +209,22 @@ endif()
set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-macosx-entitlements.plist)
if(IOS)
set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/debugserver-entitlements.plist)
+else()
+ set(entitlements_xml ${CMAKE_CURRENT_SOURCE_DIR}/../../../resources/debugserver-macosx-entitlements.plist)
endif()
-set(LLDB_CODESIGN_IDENTITY "lldb_codesign"
- CACHE STRING "Identity used for code signing. Set to empty string to skip the signing step.")
set(LLDB_USE_ENTITLEMENTS_Default On)
-if("${LLDB_CODESIGN_IDENTITY}" STREQUAL "lldb_codesign")
- set(LLDB_USE_ENTITLEMENTS_Default Off)
-endif()
option(LLDB_USE_ENTITLEMENTS "Use entitlements when codesigning (Defaults Off when using lldb_codesign identity, otherwise On)" ${LLDB_USE_ENTITLEMENTS_Default})
-if (NOT ("${LLDB_CODESIGN_IDENTITY}" STREQUAL ""))
+if (SKIP_DEBUGSERVER)
+ if (CMAKE_HOST_APPLE)
+ # If we haven't built a signed debugserver, copy the one from the system.
+ add_custom_target(debugserver
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different ${DEBUGSERVER_PATH} ${CMAKE_BINARY_DIR}/bin
+ VERBATIM
+ COMMENT "Copying the system debugserver to LLDB's binaries directory.")
+ endif()
+else()
if(LLDB_USE_ENTITLEMENTS)
set(entitlements_flags --entitlements ${entitlements_xml})
endif()
diff --git a/tools/debugserver/source/DNB.cpp b/tools/debugserver/source/DNB.cpp
index 1168f1fc0a1e..4f212a73d64e 100644
--- a/tools/debugserver/source/DNB.cpp
+++ b/tools/debugserver/source/DNB.cpp
@@ -1426,6 +1426,21 @@ nub_bool_t DNBProcessSharedLibrariesUpdated(nub_process_t pid) {
return false;
}
+const char *DNBGetDeploymentInfo(nub_process_t pid,
+ const struct load_command& lc,
+ uint64_t load_command_address,
+ uint32_t& major_version,
+ uint32_t& minor_version,
+ uint32_t& patch_version) {
+ MachProcessSP procSP;
+ if (GetProcessSP(pid, procSP))
+ return procSP->GetDeploymentInfo(lc, load_command_address,
+ major_version, minor_version,
+ patch_version);
+ return nullptr;
+}
+
+
//----------------------------------------------------------------------
// Get the current shared library information for a process. Only return
// the shared libraries that have changed since the last shared library
diff --git a/tools/debugserver/source/DNB.h b/tools/debugserver/source/DNB.h
index 7acbd42810cc..bce2c6abafd1 100644
--- a/tools/debugserver/source/DNB.h
+++ b/tools/debugserver/source/DNB.h
@@ -127,6 +127,12 @@ nub_bool_t DNBProcessSharedLibrariesUpdated(nub_process_t pid) DNB_EXPORT;
nub_size_t
DNBProcessGetSharedLibraryInfo(nub_process_t pid, nub_bool_t only_changed,
DNBExecutableImageInfo **image_infos) DNB_EXPORT;
+const char *DNBGetDeploymentInfo(nub_process_t pid,
+ const struct load_command& lc,
+ uint64_t load_command_address,
+ uint32_t& major_version,
+ uint32_t& minor_version,
+ uint32_t& patch_version);
nub_bool_t DNBProcessSetNameToAddressCallback(nub_process_t pid,
DNBCallbackNameToAddress callback,
void *baton) DNB_EXPORT;
diff --git a/tools/debugserver/source/DNBDefs.h b/tools/debugserver/source/DNBDefs.h
index 5762bd16e2b7..46476490aa69 100644
--- a/tools/debugserver/source/DNBDefs.h
+++ b/tools/debugserver/source/DNBDefs.h
@@ -290,16 +290,16 @@ struct DNBRegisterValue {
uint64_t uint64;
float float32;
double float64;
- int8_t v_sint8[32];
- int16_t v_sint16[16];
- int32_t v_sint32[8];
- int64_t v_sint64[4];
- uint8_t v_uint8[32];
- uint16_t v_uint16[16];
- uint32_t v_uint32[8];
- uint64_t v_uint64[4];
- float v_float32[8];
- double v_float64[4];
+ int8_t v_sint8[64];
+ int16_t v_sint16[32];
+ int32_t v_sint32[16];
+ int64_t v_sint64[8];
+ uint8_t v_uint8[64];
+ uint16_t v_uint16[32];
+ uint32_t v_uint32[16];
+ uint64_t v_uint64[8];
+ float v_float32[16];
+ double v_float64[8];
void *pointer;
char *c_str;
} value;
@@ -347,14 +347,14 @@ enum DNBProfileDataScanType {
eProfileHostMemory = (1 << 5),
- eProfileMemory = (1 << 6), // By default, excludes eProfileMemoryDirtyPage.
- eProfileMemoryDirtyPage =
- (1 << 7), // Assume eProfileMemory, get Dirty Page size as well.
+ eProfileMemory = (1 << 6),
eProfileMemoryAnonymous =
(1 << 8), // Assume eProfileMemory, get Anonymous memory as well.
eProfileEnergy = (1 << 9),
+ eProfileMemoryCap = (1 << 15),
+
eProfileAll = 0xffffffff
};
diff --git a/tools/debugserver/source/JSONGenerator.h b/tools/debugserver/source/JSONGenerator.h
index a85dcb6e8608..7af6ae60c5f7 100644
--- a/tools/debugserver/source/JSONGenerator.h
+++ b/tools/debugserver/source/JSONGenerator.h
@@ -21,7 +21,7 @@
//----------------------------------------------------------------------
/// @class JSONGenerator JSONGenerator.h
-/// @brief A class which can construct structured data for the sole purpose
+/// A class which can construct structured data for the sole purpose
/// of printing it in JSON format.
///
/// A stripped down version of lldb's StructuredData objects which are much
diff --git a/tools/debugserver/source/MacOSX/MachException.cpp b/tools/debugserver/source/MacOSX/MachException.cpp
index cc309e47d86b..da2b2fe92980 100644
--- a/tools/debugserver/source/MacOSX/MachException.cpp
+++ b/tools/debugserver/source/MacOSX/MachException.cpp
@@ -86,8 +86,6 @@ extern "C" kern_return_t catch_mach_exception_raise_state_identity(
(uint64_t)(exc_data_count > 0 ? exc_data[0] : 0xBADDBADD),
(uint64_t)(exc_data_count > 1 ? exc_data[1] : 0xBADDBADD));
}
- mach_port_deallocate(mach_task_self(), task_port);
- mach_port_deallocate(mach_task_self(), thread_port);
return KERN_FAILURE;
}
diff --git a/tools/debugserver/source/MacOSX/MachProcess.h b/tools/debugserver/source/MacOSX/MachProcess.h
index 9ab06bcda9c6..2fb4dc5dbb6e 100644
--- a/tools/debugserver/source/MacOSX/MachProcess.h
+++ b/tools/debugserver/source/MacOSX/MachProcess.h
@@ -246,7 +246,10 @@ public:
uint64_t plo_pthread_tsd_base_address_offset,
uint64_t plo_pthread_tsd_base_offset,
uint64_t plo_pthread_tsd_entry_size);
-
+ const char *
+ GetDeploymentInfo(const struct load_command&, uint64_t load_command_address,
+ uint32_t& major_version, uint32_t& minor_version,
+ uint32_t& patch_version);
bool GetMachOInformationFromMemory(nub_addr_t mach_o_header_addr,
int wordsize,
struct mach_o_information &inf);
diff --git a/tools/debugserver/source/MacOSX/MachProcess.mm b/tools/debugserver/source/MacOSX/MachProcess.mm
index d4dff223bde0..4ddc5f8b10dc 100644
--- a/tools/debugserver/source/MacOSX/MachProcess.mm
+++ b/tools/debugserver/source/MacOSX/MachProcess.mm
@@ -572,6 +572,76 @@ nub_addr_t MachProcess::GetTSDAddressForThread(
plo_pthread_tsd_entry_size);
}
+
+const char *MachProcess::GetDeploymentInfo(const struct load_command& lc,
+ uint64_t load_command_address,
+ uint32_t& major_version,
+ uint32_t& minor_version,
+ uint32_t& patch_version) {
+ uint32_t cmd = lc.cmd & ~LC_REQ_DYLD;
+ bool lc_cmd_known =
+ cmd == LC_VERSION_MIN_IPHONEOS || cmd == LC_VERSION_MIN_MACOSX ||
+ cmd == LC_VERSION_MIN_TVOS || cmd == LC_VERSION_MIN_WATCHOS;
+
+ if (lc_cmd_known) {
+ struct version_min_command vers_cmd;
+ if (ReadMemory(load_command_address, sizeof(struct version_min_command),
+ &vers_cmd) != sizeof(struct version_min_command)) {
+ return nullptr;
+ }
+ major_version = vers_cmd.sdk >> 16;
+ minor_version = (vers_cmd.sdk >> 8) & 0xffu;
+ patch_version = vers_cmd.sdk & 0xffu;
+
+ switch (cmd) {
+ case LC_VERSION_MIN_IPHONEOS:
+ return "ios";
+ case LC_VERSION_MIN_MACOSX:
+ return "macosx";
+ case LC_VERSION_MIN_TVOS:
+ return "tvos";
+ case LC_VERSION_MIN_WATCHOS:
+ return "watchos";
+ default:
+ return nullptr;
+ }
+ }
+#if defined (LC_BUILD_VERSION)
+#ifndef PLATFORM_IOSSIMULATOR
+#define PLATFORM_IOSSIMULATOR 7
+#define PLATFORM_TVOSSIMULATOR 8
+#define PLATFORM_WATCHOSSIMULATOR 9
+#endif
+ if (cmd == LC_BUILD_VERSION) {
+ struct build_version_command build_vers;
+ if (ReadMemory(load_command_address, sizeof(struct build_version_command),
+ &build_vers) != sizeof(struct build_version_command)) {
+ return nullptr;
+ }
+ major_version = build_vers.sdk >> 16;;
+ minor_version = (build_vers.sdk >> 8) & 0xffu;
+ patch_version = build_vers.sdk & 0xffu;
+
+ switch (build_vers.platform) {
+ case PLATFORM_MACOS:
+ return "macosx";
+ case PLATFORM_IOS:
+ case PLATFORM_IOSSIMULATOR:
+ return "ios";
+ case PLATFORM_TVOS:
+ case PLATFORM_TVOSSIMULATOR:
+ return "tvos";
+ case PLATFORM_WATCHOS:
+ case PLATFORM_WATCHOSSIMULATOR:
+ return "watchos";
+ case PLATFORM_BRIDGEOS:
+ return "bridgeos";
+ }
+ }
+#endif
+ return nullptr;
+}
+
// Given an address, read the mach-o header and load commands out of memory to
// fill in
// the mach_o_information "inf" object.
@@ -670,52 +740,22 @@ bool MachProcess::GetMachOInformationFromMemory(
sizeof(struct uuid_command))
uuid_copy(inf.uuid, uuidcmd.uuid);
}
- bool lc_cmd_known =
- lc.cmd == LC_VERSION_MIN_IPHONEOS || lc.cmd == LC_VERSION_MIN_MACOSX;
-#if defined(LC_VERSION_MIN_TVOS)
- lc_cmd_known |= lc.cmd == LC_VERSION_MIN_TVOS;
-#endif
-#if defined(LC_VERSION_MIN_WATCHOS)
- lc_cmd_known |= lc.cmd == LC_VERSION_MIN_WATCHOS;
-#endif
- if (lc_cmd_known) {
- struct version_min_command vers_cmd;
- if (ReadMemory(load_cmds_p, sizeof(struct version_min_command),
- &vers_cmd) != sizeof(struct version_min_command)) {
- return false;
- }
- switch (lc.cmd) {
- case LC_VERSION_MIN_IPHONEOS:
- inf.min_version_os_name = "iphoneos";
- break;
- case LC_VERSION_MIN_MACOSX:
- inf.min_version_os_name = "macosx";
- break;
-#if defined(LC_VERSION_MIN_TVOS)
- case LC_VERSION_MIN_TVOS:
- inf.min_version_os_name = "tvos";
- break;
-#endif
-#if defined(LC_VERSION_MIN_WATCHOS)
- case LC_VERSION_MIN_WATCHOS:
- inf.min_version_os_name = "watchos";
- break;
-#endif
- default:
- return false;
- }
- uint32_t xxxx = vers_cmd.sdk >> 16;
- uint32_t yy = (vers_cmd.sdk >> 8) & 0xffu;
- uint32_t zz = vers_cmd.sdk & 0xffu;
+
+ uint32_t major_version, minor_version, patch_version;
+ if (const char *platform = GetDeploymentInfo(lc, load_cmds_p,
+ major_version, minor_version,
+ patch_version)) {
+ inf.min_version_os_name = platform;
inf.min_version_os_version = "";
- inf.min_version_os_version += std::to_string(xxxx);
+ inf.min_version_os_version += std::to_string(major_version);
inf.min_version_os_version += ".";
- inf.min_version_os_version += std::to_string(yy);
- if (zz != 0) {
+ inf.min_version_os_version += std::to_string(minor_version);
+ if (patch_version != 0) {
inf.min_version_os_version += ".";
- inf.min_version_os_version += std::to_string(zz);
+ inf.min_version_os_version += std::to_string(patch_version);
}
}
+
load_cmds_p += lc.cmdsize;
}
return true;
@@ -1454,7 +1494,7 @@ bool MachProcess::Detach() {
// Resume our task
m_task.Resume();
- // NULL our task out as we have already retored all exception ports
+ // NULL our task out as we have already restored all exception ports
m_task.Clear();
// Clear out any notion of the process we once were
@@ -1765,7 +1805,7 @@ bool MachProcess::DisableBreakpoint(nub_addr_t addr, bool remove) {
break_op_size) {
bool verify = false;
if (bp->IsEnabled()) {
- // Make sure we have the a breakpoint opcode exists at this address
+ // Make sure a breakpoint opcode exists at this address
if (memcmp(curr_break_op, break_op, break_op_size) == 0) {
break_op_found = true;
// We found a valid breakpoint opcode at this address, now restore
diff --git a/tools/debugserver/source/MacOSX/MachTask.mm b/tools/debugserver/source/MacOSX/MachTask.mm
index 1d177bd53cb7..d05f50029f16 100644
--- a/tools/debugserver/source/MacOSX/MachTask.mm
+++ b/tools/debugserver/source/MacOSX/MachTask.mm
@@ -348,23 +348,15 @@ std::string MachTask::GetProfileData(DNBProfileDataScanType scanType) {
threads_used_usec);
}
-#if defined(HOST_VM_INFO64_COUNT)
vm_statistics64_data_t vminfo;
-#else
- struct vm_statistics vminfo;
-#endif
- uint64_t physical_memory;
- mach_vm_size_t rprvt = 0;
- mach_vm_size_t rsize = 0;
- mach_vm_size_t vprvt = 0;
- mach_vm_size_t vsize = 0;
- mach_vm_size_t dirty_size = 0;
- mach_vm_size_t purgeable = 0;
- mach_vm_size_t anonymous = 0;
+ uint64_t physical_memory = 0;
+ uint64_t anonymous = 0;
+ uint64_t phys_footprint = 0;
+ uint64_t memory_cap = 0;
if (m_vm_memory.GetMemoryProfile(scanType, task, task_info,
m_process->GetCPUType(), pid, vminfo,
- physical_memory, rprvt, rsize, vprvt, vsize,
- dirty_size, purgeable, anonymous)) {
+ physical_memory, anonymous,
+ phys_footprint, memory_cap)) {
std::ostringstream profile_data_stream;
if (scanType & eProfileHostCPU) {
@@ -413,57 +405,28 @@ std::string MachTask::GetProfileData(DNBProfileDataScanType scanType) {
profile_data_stream << "total:" << physical_memory << ';';
if (scanType & eProfileMemory) {
-#if defined(HOST_VM_INFO64_COUNT) && defined(_VM_PAGE_SIZE_H_)
static vm_size_t pagesize = vm_kernel_page_size;
-#else
- static vm_size_t pagesize;
- static bool calculated = false;
- if (!calculated) {
- calculated = true;
- pagesize = PageSize();
- }
-#endif
-/* Unused values. Optimized out for transfer performance.
-profile_data_stream << "wired:" << vminfo.wire_count * pagesize << ';';
-profile_data_stream << "active:" << vminfo.active_count * pagesize << ';';
-profile_data_stream << "inactive:" << vminfo.inactive_count * pagesize << ';';
- */
-#if defined(HOST_VM_INFO64_COUNT)
// This mimicks Activity Monitor.
uint64_t total_used_count =
(physical_memory / pagesize) -
(vminfo.free_count - vminfo.speculative_count) -
vminfo.external_page_count - vminfo.purgeable_count;
-#else
- uint64_t total_used_count =
- vminfo.wire_count + vminfo.inactive_count + vminfo.active_count;
-#endif
profile_data_stream << "used:" << total_used_count * pagesize << ';';
- /* Unused values. Optimized out for transfer performance.
- profile_data_stream << "free:" << vminfo.free_count * pagesize << ';';
- */
-
- profile_data_stream << "rprvt:" << rprvt << ';';
- /* Unused values. Optimized out for transfer performance.
- profile_data_stream << "rsize:" << rsize << ';';
- profile_data_stream << "vprvt:" << vprvt << ';';
- profile_data_stream << "vsize:" << vsize << ';';
- */
-
- if (scanType & eProfileMemoryDirtyPage)
- profile_data_stream << "dirty:" << dirty_size << ';';
if (scanType & eProfileMemoryAnonymous) {
- profile_data_stream << "purgeable:" << purgeable << ';';
profile_data_stream << "anonymous:" << anonymous << ';';
}
+
+ profile_data_stream << "phys_footprint:" << phys_footprint << ';';
}
-
-// proc_pid_rusage pm_sample_task_and_pid pm_energy_impact needs to be tested
-// for weakness in Cab
+
+ if (scanType & eProfileMemoryCap) {
+ profile_data_stream << "mem_cap:" << memory_cap << ';';
+ }
+
#ifdef LLDB_ENERGY
- if ((scanType & eProfileEnergy) && (pm_sample_task_and_pid != NULL)) {
+ if (scanType & eProfileEnergy) {
struct rusage_info_v2 info;
int rc = proc_pid_rusage(pid, RUSAGE_INFO_V2, (rusage_info_t *)&info);
if (rc == 0) {
@@ -993,8 +956,6 @@ nub_bool_t MachTask::DeallocateMemory(nub_addr_t addr) {
return false;
}
-nub_size_t MachTask::PageSize() { return m_vm_memory.PageSize(m_task); }
-
void MachTask::TaskPortChanged(task_t task)
{
m_task = task;
diff --git a/tools/debugserver/source/MacOSX/MachVMMemory.cpp b/tools/debugserver/source/MacOSX/MachVMMemory.cpp
index 12f16ccb9f53..754fb82dba3e 100644
--- a/tools/debugserver/source/MacOSX/MachVMMemory.cpp
+++ b/tools/debugserver/source/MacOSX/MachVMMemory.cpp
@@ -19,6 +19,12 @@
#include <mach/shared_region.h>
#include <sys/sysctl.h>
+#if defined(WITH_FBS) || defined(WITH_BKS)
+extern "C" {
+#import <sys/kern_memorystatus.h>
+}
+#endif
+
static const vm_size_t kInvalidPageSize = ~0;
MachVMMemory::MachVMMemory() : m_page_size(kInvalidPageSize), m_err(0) {}
@@ -99,99 +105,6 @@ nub_bool_t MachVMMemory::GetMemoryRegionInfo(task_t task, nub_addr_t address,
return true;
}
-// For integrated graphics chip, this makes the accounting info for 'wired'
-// memory more like top.
-uint64_t MachVMMemory::GetStolenPages(task_t task) {
- static uint64_t stolenPages = 0;
- static bool calculated = false;
- if (calculated)
- return stolenPages;
-
- static int mib_reserved[CTL_MAXNAME];
- static int mib_unusable[CTL_MAXNAME];
- static int mib_other[CTL_MAXNAME];
- static size_t mib_reserved_len = 0;
- static size_t mib_unusable_len = 0;
- static size_t mib_other_len = 0;
- int r;
-
- /* This can be used for testing: */
- // tsamp->pages_stolen = (256 * 1024 * 1024ULL) / tsamp->pagesize;
-
- if (0 == mib_reserved_len) {
- mib_reserved_len = CTL_MAXNAME;
-
- r = sysctlnametomib("machdep.memmap.Reserved", mib_reserved,
- &mib_reserved_len);
-
- if (-1 == r) {
- mib_reserved_len = 0;
- return 0;
- }
-
- mib_unusable_len = CTL_MAXNAME;
-
- r = sysctlnametomib("machdep.memmap.Unusable", mib_unusable,
- &mib_unusable_len);
-
- if (-1 == r) {
- mib_reserved_len = 0;
- return 0;
- }
-
- mib_other_len = CTL_MAXNAME;
-
- r = sysctlnametomib("machdep.memmap.Other", mib_other, &mib_other_len);
-
- if (-1 == r) {
- mib_reserved_len = 0;
- return 0;
- }
- }
-
- if (mib_reserved_len > 0 && mib_unusable_len > 0 && mib_other_len > 0) {
- uint64_t reserved = 0, unusable = 0, other = 0;
- size_t reserved_len;
- size_t unusable_len;
- size_t other_len;
-
- reserved_len = sizeof(reserved);
- unusable_len = sizeof(unusable);
- other_len = sizeof(other);
-
- /* These are all declared as QUAD/uint64_t sysctls in the kernel. */
-
- if (sysctl(mib_reserved, static_cast<u_int>(mib_reserved_len), &reserved,
- &reserved_len, NULL, 0)) {
- return 0;
- }
-
- if (sysctl(mib_unusable, static_cast<u_int>(mib_unusable_len), &unusable,
- &unusable_len, NULL, 0)) {
- return 0;
- }
-
- if (sysctl(mib_other, static_cast<u_int>(mib_other_len), &other, &other_len,
- NULL, 0)) {
- return 0;
- }
-
- if (reserved_len == sizeof(reserved) && unusable_len == sizeof(unusable) &&
- other_len == sizeof(other)) {
- uint64_t stolen = reserved + unusable + other;
- uint64_t mb128 = 128 * 1024 * 1024ULL;
-
- if (stolen >= mb128) {
- stolen = (stolen & ~((128 * 1024 * 1024ULL) - 1)); // rounding down
- stolenPages = stolen / PageSize(task);
- }
- }
- }
-
- calculated = true;
- return stolenPages;
-}
-
static uint64_t GetPhysicalMemory() {
// This doesn't change often at all. No need to poll each time.
static uint64_t physical_memory = 0;
@@ -206,231 +119,45 @@ static uint64_t GetPhysicalMemory() {
return physical_memory;
}
-// rsize and dirty_size is not adjusted for dyld shared cache and multiple
-// __LINKEDIT segment, as in vmmap. In practice, dirty_size doesn't differ much
-// but rsize may. There is performance penalty for the adjustment. Right now,
-// only use the dirty_size.
-void MachVMMemory::GetRegionSizes(task_t task, mach_vm_size_t &rsize,
- mach_vm_size_t &dirty_size) {
-#if defined(TASK_VM_INFO) && TASK_VM_INFO >= 22
-
- task_vm_info_data_t vm_info;
- mach_msg_type_number_t info_count;
- kern_return_t kr;
-
- info_count = TASK_VM_INFO_COUNT;
- kr = task_info(task, TASK_VM_INFO_PURGEABLE, (task_info_t)&vm_info,
- &info_count);
- if (kr == KERN_SUCCESS)
- dirty_size = vm_info.internal;
-#endif
-}
-
-// Test whether the virtual address is within the architecture's shared region.
-static bool InSharedRegion(mach_vm_address_t addr, cpu_type_t type) {
- mach_vm_address_t base = 0, size = 0;
-
- switch (type) {
-#if defined(CPU_TYPE_ARM64) && defined(SHARED_REGION_BASE_ARM64)
- case CPU_TYPE_ARM64:
- base = SHARED_REGION_BASE_ARM64;
- size = SHARED_REGION_SIZE_ARM64;
- break;
-#endif
-
- case CPU_TYPE_ARM:
- base = SHARED_REGION_BASE_ARM;
- size = SHARED_REGION_SIZE_ARM;
- break;
-
- case CPU_TYPE_X86_64:
- base = SHARED_REGION_BASE_X86_64;
- size = SHARED_REGION_SIZE_X86_64;
- break;
-
- case CPU_TYPE_I386:
- base = SHARED_REGION_BASE_I386;
- size = SHARED_REGION_SIZE_I386;
- break;
-
- default: {
- // Log error abut unknown CPU type
- break;
- }
- }
-
- return (addr >= base && addr < (base + size));
-}
-
-void MachVMMemory::GetMemorySizes(task_t task, cpu_type_t cputype,
- nub_process_t pid, mach_vm_size_t &rprvt,
- mach_vm_size_t &vprvt) {
- // Collecting some other info cheaply but not reporting for now.
- mach_vm_size_t empty = 0;
- mach_vm_size_t fw_private = 0;
-
- mach_vm_size_t aliased = 0;
- bool global_shared_text_data_mapped = false;
- vm_size_t pagesize = PageSize(task);
-
- for (mach_vm_address_t addr = 0, size = 0;; addr += size) {
- vm_region_top_info_data_t info;
- mach_msg_type_number_t count = VM_REGION_TOP_INFO_COUNT;
- mach_port_t object_name;
-
- kern_return_t kr =
- mach_vm_region(task, &addr, &size, VM_REGION_TOP_INFO,
- (vm_region_info_t)&info, &count, &object_name);
- if (kr != KERN_SUCCESS)
- break;
-
- if (InSharedRegion(addr, cputype)) {
- // Private Shared
- fw_private += info.private_pages_resident * pagesize;
-
- // Check if this process has the globally shared text and data regions
- // mapped in. If so, set global_shared_text_data_mapped to TRUE and avoid
- // checking again.
- if (global_shared_text_data_mapped == FALSE &&
- info.share_mode == SM_EMPTY) {
- vm_region_basic_info_data_64_t b_info;
- mach_vm_address_t b_addr = addr;
- mach_vm_size_t b_size = size;
- count = VM_REGION_BASIC_INFO_COUNT_64;
-
- kr = mach_vm_region(task, &b_addr, &b_size, VM_REGION_BASIC_INFO,
- (vm_region_info_t)&b_info, &count, &object_name);
- if (kr != KERN_SUCCESS)
- break;
-
- if (b_info.reserved) {
- global_shared_text_data_mapped = TRUE;
- }
- }
-
- // Short circuit the loop if this isn't a shared private region, since
- // that's the only region type we care about within the current address
- // range.
- if (info.share_mode != SM_PRIVATE) {
- continue;
- }
- }
-
- // Update counters according to the region type.
- if (info.share_mode == SM_COW && info.ref_count == 1) {
- // Treat single reference SM_COW as SM_PRIVATE
- info.share_mode = SM_PRIVATE;
- }
-
- switch (info.share_mode) {
- case SM_LARGE_PAGE:
- // Treat SM_LARGE_PAGE the same as SM_PRIVATE
- // since they are not shareable and are wired.
- case SM_PRIVATE:
- rprvt += info.private_pages_resident * pagesize;
- rprvt += info.shared_pages_resident * pagesize;
- vprvt += size;
- break;
-
- case SM_EMPTY:
- empty += size;
- break;
-
- case SM_COW:
- case SM_SHARED: {
- if (pid == 0) {
- // Treat kernel_task specially
- if (info.share_mode == SM_COW) {
- rprvt += info.private_pages_resident * pagesize;
- vprvt += size;
- }
- break;
- }
-
- if (info.share_mode == SM_COW) {
- rprvt += info.private_pages_resident * pagesize;
- vprvt += info.private_pages_resident * pagesize;
- }
- break;
- }
- default:
- // log that something is really bad.
- break;
- }
- }
-
- rprvt += aliased;
-}
-
-static void GetPurgeableAndAnonymous(task_t task, uint64_t &purgeable,
- uint64_t &anonymous) {
-#if defined(TASK_VM_INFO) && TASK_VM_INFO >= 22
-
- kern_return_t kr;
- mach_msg_type_number_t info_count;
- task_vm_info_data_t vm_info;
-
- info_count = TASK_VM_INFO_COUNT;
- kr = task_info(task, TASK_VM_INFO_PURGEABLE, (task_info_t)&vm_info,
- &info_count);
- if (kr == KERN_SUCCESS) {
- purgeable = vm_info.purgeable_volatile_resident;
- anonymous =
- vm_info.internal + vm_info.compressed - vm_info.purgeable_volatile_pmap;
- }
-
-#endif
-}
-
-#if defined(HOST_VM_INFO64_COUNT)
nub_bool_t MachVMMemory::GetMemoryProfile(
DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti,
cpu_type_t cputype, nub_process_t pid, vm_statistics64_data_t &vminfo,
- uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize,
- mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size,
- mach_vm_size_t &purgeable, mach_vm_size_t &anonymous)
-#else
-nub_bool_t MachVMMemory::GetMemoryProfile(
- DNBProfileDataScanType scanType, task_t task, struct task_basic_info ti,
- cpu_type_t cputype, nub_process_t pid, vm_statistics_data_t &vminfo,
- uint64_t &physical_memory, mach_vm_size_t &rprvt, mach_vm_size_t &rsize,
- mach_vm_size_t &vprvt, mach_vm_size_t &vsize, mach_vm_size_t &dirty_size,
- mach_vm_size_t &purgeable, mach_vm_size_t &anonymous)
-#endif
+ uint64_t &physical_memory, uint64_t &anonymous,
+ uint64_t &phys_footprint, uint64_t &memory_cap)
{
if (scanType & eProfileHostMemory)
physical_memory = GetPhysicalMemory();
if (scanType & eProfileMemory) {
static mach_port_t localHost = mach_host_self();
-#if defined(HOST_VM_INFO64_COUNT)
mach_msg_type_number_t count = HOST_VM_INFO64_COUNT;
host_statistics64(localHost, HOST_VM_INFO64, (host_info64_t)&vminfo,
&count);
-#else
- mach_msg_type_number_t count = HOST_VM_INFO_COUNT;
- host_statistics(localHost, HOST_VM_INFO, (host_info_t)&vminfo, &count);
- vminfo.wire_count += GetStolenPages(task);
-#endif
+
+ kern_return_t kr;
+ mach_msg_type_number_t info_count;
+ task_vm_info_data_t vm_info;
+
+ info_count = TASK_VM_INFO_COUNT;
+ kr = task_info(task, TASK_VM_INFO_PURGEABLE, (task_info_t)&vm_info, &info_count);
+ if (kr == KERN_SUCCESS) {
+ if (scanType & eProfileMemoryAnonymous) {
+ anonymous = vm_info.internal + vm_info.compressed - vm_info.purgeable_volatile_pmap;
+ }
- /* We are no longer reporting these. Let's not waste time.
- GetMemorySizes(task, cputype, pid, rprvt, vprvt);
- rsize = ti.resident_size;
- vsize = ti.virtual_size;
-
- if (scanType & eProfileMemoryDirtyPage)
- {
- // This uses vmmap strategy. We don't use the returned rsize for now. We
- prefer to match top's version since that's what we do for the rest of the
- metrics.
- GetRegionSizes(task, rsize, dirty_size);
+ phys_footprint = vm_info.phys_footprint;
}
- */
+ }
- if (scanType & eProfileMemoryAnonymous) {
- GetPurgeableAndAnonymous(task, purgeable, anonymous);
+#if defined(WITH_FBS) || defined(WITH_BKS)
+ if (scanType & eProfileMemoryCap) {
+ memorystatus_memlimit_properties_t memlimit_properties;
+ memset(&memlimit_properties, 0, sizeof(memlimit_properties));
+ if (memorystatus_control(MEMORYSTATUS_CMD_GET_MEMLIMIT_PROPERTIES, pid, 0, &memlimit_properties, sizeof(memlimit_properties)) == 0) {
+ memory_cap = memlimit_properties.memlimit_active;
}
}
+#endif
return true;
}
diff --git a/tools/debugserver/source/MacOSX/MachVMMemory.h b/tools/debugserver/source/MacOSX/MachVMMemory.h
index c4d3f5331374..513b69ee709f 100644
--- a/tools/debugserver/source/MacOSX/MachVMMemory.h
+++ b/tools/debugserver/source/MacOSX/MachVMMemory.h
@@ -29,35 +29,15 @@ public:
nub_size_t PageSize(task_t task);
nub_bool_t GetMemoryRegionInfo(task_t task, nub_addr_t address,
DNBRegionInfo *region_info);
-#if defined(HOST_VM_INFO64_COUNT)
nub_bool_t GetMemoryProfile(DNBProfileDataScanType scanType, task_t task,
struct task_basic_info ti, cpu_type_t cputype,
nub_process_t pid, vm_statistics64_data_t &vminfo,
- uint64_t &physical_memory, mach_vm_size_t &rprvt,
- mach_vm_size_t &rsize, mach_vm_size_t &vprvt,
- mach_vm_size_t &vsize, mach_vm_size_t &dirty_size,
- mach_vm_size_t &purgeable,
- mach_vm_size_t &anonymous);
-#else
- nub_bool_t GetMemoryProfile(DNBProfileDataScanType scanType, task_t task,
- struct task_basic_info ti, cpu_type_t cputype,
- nub_process_t pid, vm_statistics_data_t &vminfo,
- uint64_t &physical_memory, mach_vm_size_t &rprvt,
- mach_vm_size_t &rsize, mach_vm_size_t &vprvt,
- mach_vm_size_t &vsize, mach_vm_size_t &dirty_size,
- mach_vm_size_t &purgeable,
- mach_vm_size_t &anonymous);
-#endif
+ uint64_t &physical_memory, uint64_t &anonymous,
+ uint64_t &phys_footprint, uint64_t &memory_cap);
protected:
nub_size_t MaxBytesLeftInPage(task_t task, nub_addr_t addr, nub_size_t count);
- uint64_t GetStolenPages(task_t task);
- void GetRegionSizes(task_t task, mach_vm_size_t &rsize,
- mach_vm_size_t &dirty_size);
- void GetMemorySizes(task_t task, cpu_type_t cputype, nub_process_t pid,
- mach_vm_size_t &rprvt, mach_vm_size_t &vprvt);
-
nub_size_t WriteRegion(task_t task, const nub_addr_t address,
const void *data, const nub_size_t data_count);
diff --git a/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp b/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
index e0e8e27a1c2d..adcd65002191 100644
--- a/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
+++ b/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.cpp
@@ -21,7 +21,7 @@
#include "MachThread.h"
extern "C" bool CPUHasAVX(); // Defined over in DNBArchImplX86_64.cpp
-
+extern "C" bool CPUHasAVX512f(); // Defined over in DNBArchImplX86_64.cpp
#if defined(LLDB_DEBUGSERVER_RELEASE) || defined(LLDB_DEBUGSERVER_DEBUG)
enum debugState { debugStateUnknown, debugStateOff, debugStateOn };
@@ -132,6 +132,22 @@ enum {
fpu_ymm5,
fpu_ymm6,
fpu_ymm7,
+ fpu_k0,
+ fpu_k1,
+ fpu_k2,
+ fpu_k3,
+ fpu_k4,
+ fpu_k5,
+ fpu_k6,
+ fpu_k7,
+ fpu_zmm0,
+ fpu_zmm1,
+ fpu_zmm2,
+ fpu_zmm3,
+ fpu_zmm4,
+ fpu_zmm5,
+ fpu_zmm6,
+ fpu_zmm7,
k_num_fpu_regs,
// Aliases
@@ -205,6 +221,22 @@ enum {
dwarf_ymm5 = dwarf_xmm5,
dwarf_ymm6 = dwarf_xmm6,
dwarf_ymm7 = dwarf_xmm7,
+ dwarf_zmm0 = dwarf_xmm0,
+ dwarf_zmm1 = dwarf_xmm1,
+ dwarf_zmm2 = dwarf_xmm2,
+ dwarf_zmm3 = dwarf_xmm3,
+ dwarf_zmm4 = dwarf_xmm4,
+ dwarf_zmm5 = dwarf_xmm5,
+ dwarf_zmm6 = dwarf_xmm6,
+ dwarf_zmm7 = dwarf_xmm7,
+ dwarf_k0 = 118,
+ dwarf_k1,
+ dwarf_k2,
+ dwarf_k3,
+ dwarf_k4,
+ dwarf_k5,
+ dwarf_k6,
+ dwarf_k7,
};
enum {
@@ -271,7 +303,23 @@ enum {
debugserver_ymm4 = debugserver_xmm4,
debugserver_ymm5 = debugserver_xmm5,
debugserver_ymm6 = debugserver_xmm6,
- debugserver_ymm7 = debugserver_xmm7
+ debugserver_ymm7 = debugserver_xmm7,
+ debugserver_zmm0 = debugserver_xmm0,
+ debugserver_zmm1 = debugserver_xmm1,
+ debugserver_zmm2 = debugserver_xmm2,
+ debugserver_zmm3 = debugserver_xmm3,
+ debugserver_zmm4 = debugserver_xmm4,
+ debugserver_zmm5 = debugserver_xmm5,
+ debugserver_zmm6 = debugserver_xmm6,
+ debugserver_zmm7 = debugserver_xmm7,
+ debugserver_k0 = 118,
+ debugserver_k1 = 119,
+ debugserver_k2 = 120,
+ debugserver_k3 = 121,
+ debugserver_k4 = 122,
+ debugserver_k5 = 123,
+ debugserver_k6 = 124,
+ debugserver_k7 = 125,
};
uint64_t DNBArchImplI386::GetPC(uint64_t failValue) {
@@ -390,7 +438,8 @@ kern_return_t DNBArchImplI386::GetFPUState(bool force) {
m_state.context.fpu.no_avx.__fpu_reserved1 = -1;
if (CPUHasAVX() || FORCE_AVX_REGS) {
- for (int i = 0; i < sizeof(m_state.context.fpu.avx.__avx_reserved1); ++i)
+ for (int i = 0; i < sizeof(m_state.context.fpu.avx.__avx_reserved1);
+ ++i)
m_state.context.fpu.avx.__avx_reserved1[i] = INT8_MIN;
for (int i = 0; i < 16; ++i) {
@@ -404,12 +453,54 @@ kern_return_t DNBArchImplI386::GetFPUState(bool force) {
m_state.context.fpu.avx.__fpu_ymmh7.__xmm_reg[i] = '7';
}
}
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (int i = 0; i < 8; ++i) {
+ m_state.context.fpu.avx512f.__fpu_k0.__opmask_reg[i] = '0';
+ m_state.context.fpu.avx512f.__fpu_k1.__opmask_reg[i] = '1';
+ m_state.context.fpu.avx512f.__fpu_k2.__opmask_reg[i] = '2';
+ m_state.context.fpu.avx512f.__fpu_k3.__opmask_reg[i] = '3';
+ m_state.context.fpu.avx512f.__fpu_k4.__opmask_reg[i] = '4';
+ m_state.context.fpu.avx512f.__fpu_k5.__opmask_reg[i] = '5';
+ m_state.context.fpu.avx512f.__fpu_k6.__opmask_reg[i] = '6';
+ m_state.context.fpu.avx512f.__fpu_k7.__opmask_reg[i] = '7';
+ }
+
+ for (int i = 0; i < 32; ++i) {
+ m_state.context.fpu.avx512f.__fpu_zmmh0.__ymm_reg[i] = '0';
+ m_state.context.fpu.avx512f.__fpu_zmmh1.__ymm_reg[i] = '1';
+ m_state.context.fpu.avx512f.__fpu_zmmh2.__ymm_reg[i] = '2';
+ m_state.context.fpu.avx512f.__fpu_zmmh3.__ymm_reg[i] = '3';
+ m_state.context.fpu.avx512f.__fpu_zmmh4.__ymm_reg[i] = '4';
+ m_state.context.fpu.avx512f.__fpu_zmmh5.__ymm_reg[i] = '5';
+ m_state.context.fpu.avx512f.__fpu_zmmh6.__ymm_reg[i] = '6';
+ m_state.context.fpu.avx512f.__fpu_zmmh7.__ymm_reg[i] = '7';
+ }
+ }
m_state.SetError(e_regSetFPU, Read, 0);
} else {
mach_msg_type_number_t count = e_regSetWordSizeFPU;
int flavor = __i386_FLOAT_STATE;
- if (CPUHasAVX() || FORCE_AVX_REGS) {
+ // On a machine with the AVX512 register set, a process only gets a
+ // full AVX512 register context after it uses the AVX512 registers;
+ // if the process has not yet triggered this change, trying to fetch
+ // the AVX512 registers will fail. Fall through to fetching the AVX
+ // registers.
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ count = e_regSetWordSizeAVX512f;
+ flavor = __i386_AVX512F_STATE;
+ m_state.SetError(e_regSetFPU, Read,
+ ::thread_get_state(m_thread->MachPortNumber(), flavor,
+ (thread_state_t)&m_state.context.fpu,
+ &count));
+ DNBLogThreadedIf(LOG_THREAD,
+ "::thread_get_state (0x%4.4x, %u, &fpu, %u => 0x%8.8x",
+ m_thread->MachPortNumber(), flavor, (uint32_t)count,
+ m_state.GetError(e_regSetFPU, Read));
+ if (m_state.GetError(e_regSetFPU, Read) == KERN_SUCCESS)
+ return m_state.GetError(e_regSetFPU, Read);
+ }
+ if (CPUHasAVX()) {
count = e_regSetWordSizeAVX;
flavor = __i386_AVX_STATE;
}
@@ -457,18 +548,21 @@ kern_return_t DNBArchImplI386::SetFPUState() {
m_state.SetError(e_regSetFPU, Write, 0);
return m_state.GetError(e_regSetFPU, Write);
} else {
- if (CPUHasAVX() || FORCE_AVX_REGS)
- m_state.SetError(
- e_regSetFPU, Write,
- ::thread_set_state(m_thread->MachPortNumber(), __i386_AVX_STATE,
- (thread_state_t)&m_state.context.fpu.avx,
- e_regSetWordSizeAVX));
- else
- m_state.SetError(
- e_regSetFPU, Write,
- ::thread_set_state(m_thread->MachPortNumber(), __i386_FLOAT_STATE,
- (thread_state_t)&m_state.context.fpu.no_avx,
- e_regSetWordSizeFPU));
+ int flavor = __i386_FLOAT_STATE;
+ mach_msg_type_number_t count = e_regSetWordSizeFPU;
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ flavor = __i386_AVX512F_STATE;
+ count = e_regSetWordSizeAVX512f;
+ } else
+ if (CPUHasAVX()) {
+ flavor = __i386_AVX_STATE;
+ count = e_regSetWordSizeAVX;
+ }
+
+ m_state.SetError(e_regSetFPU, Write,
+ ::thread_set_state(m_thread->MachPortNumber(), flavor,
+ (thread_state_t)&m_state.context.fpu,
+ count));
return m_state.GetError(e_regSetFPU, Write);
}
}
@@ -965,6 +1059,9 @@ kern_return_t DNBArchImplI386::EnableHardwareSingleStep(bool enable) {
#define AVX_OFFSET(reg) \
(offsetof(DNBArchImplI386::AVX, __fpu_##reg) + \
offsetof(DNBArchImplI386::Context, fpu.avx))
+#define AVX512F_OFFSET(reg) \
+ (offsetof(DNBArchImplI386::AVX512F, __fpu_##reg) + \
+ offsetof(DNBArchImplI386::Context, fpu.avx512f))
#define EXC_OFFSET(reg) \
(offsetof(DNBArchImplI386::EXC, __##reg) + \
offsetof(DNBArchImplI386::Context, exc))
@@ -976,6 +1073,7 @@ kern_return_t DNBArchImplI386::EnableHardwareSingleStep(bool enable) {
#define FPU_SIZE_XMM(reg) \
(sizeof(((DNBArchImplI386::FPU *)NULL)->__fpu_##reg.__xmm_reg))
#define FPU_SIZE_YMM(reg) (32)
+#define FPU_SIZE_ZMM(reg) (64)
#define EXC_SIZE(reg) (sizeof(((DNBArchImplI386::EXC *)NULL)->__##reg))
// This does not accurately identify the location of ymm0...7 in
@@ -985,6 +1083,9 @@ kern_return_t DNBArchImplI386::EnableHardwareSingleStep(bool enable) {
// -- not to interpret the thread_get_state info.
#define AVX_OFFSET_YMM(n) (AVX_OFFSET(xmm7) + FPU_SIZE_XMM(xmm7) + (32 * n))
+// TODO: Test this and come back.
+#define AVX512F_OFFSET_ZMM(n) (AVX_OFFSET_YMM(7) + FPU_SIZE_XMM(xmm7) + (64 * n))
+
// These macros will auto define the register name, alt name, register size,
// register offset, encoding, format and native register. This ensures that
// the register state structures are defined correctly and have the correct
@@ -1279,6 +1380,141 @@ const DNBRegisterInfo DNBArchImplI386::g_fpu_registers_avx[] = {
};
+
+#define STR(s) #s
+
+#define ZMM_REG_DEF(reg) \
+ { \
+ e_regSetFPU, fpu_zmm##reg, STR(zmm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_ZMM(zmm##reg), AVX512F_OFFSET_ZMM(reg), INVALID_NUB_REGNUM, \
+ dwarf_zmm##reg, INVALID_NUB_REGNUM, debugserver_zmm##reg, NULL, NULL \
+ }
+
+#define YMM_REG_ALIAS(reg) \
+ { \
+ e_regSetFPU, fpu_ymm##reg, STR(ymm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_YMM(ymm##reg), 0, INVALID_NUB_REGNUM, dwarf_ymm##reg, \
+ INVALID_NUB_REGNUM, debugserver_ymm##reg, g_contained_zmm##reg, NULL \
+ }
+
+#define XMM_REG_ALIAS(reg) \
+ { \
+ e_regSetFPU, fpu_xmm##reg, STR(xmm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_XMM(xmm##reg), 0, INVALID_NUB_REGNUM, dwarf_xmm##reg, \
+ INVALID_NUB_REGNUM, debugserver_xmm##reg, g_contained_zmm##reg, NULL \
+ }
+
+#define AVX512_K_REG_DEF(reg) \
+ { \
+ e_regSetFPU, fpu_k##reg, STR(k##reg), NULL, Vector, VectorOfUInt8, 8, \
+ AVX512F_OFFSET(k##reg), dwarf_k##reg, dwarf_k##reg, -1U, \
+ debugserver_k##reg, NULL, NULL \
+ }
+
+static const char *g_contained_zmm0[] = {"zmm0", NULL};
+static const char *g_contained_zmm1[] = {"zmm1", NULL};
+static const char *g_contained_zmm2[] = {"zmm2", NULL};
+static const char *g_contained_zmm3[] = {"zmm3", NULL};
+static const char *g_contained_zmm4[] = {"zmm4", NULL};
+static const char *g_contained_zmm5[] = {"zmm5", NULL};
+static const char *g_contained_zmm6[] = {"zmm6", NULL};
+static const char *g_contained_zmm7[] = {"zmm7", NULL};
+
+const DNBRegisterInfo DNBArchImplI386::g_fpu_registers_avx512f[] = {
+ {e_regSetFPU, fpu_fcw, "fctrl", NULL, Uint, Hex, FPU_SIZE_UINT(fcw),
+ AVX_OFFSET(fcw), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_fsw, "fstat", NULL, Uint, Hex, FPU_SIZE_UINT(fsw),
+ AVX_OFFSET(fsw), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_ftw, "ftag", NULL, Uint, Hex, 2 /* sizeof __fpu_ftw + sizeof __fpu_rsrv1 */,
+ FPU_OFFSET(ftw), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_fop, "fop", NULL, Uint, Hex, FPU_SIZE_UINT(fop),
+ AVX_OFFSET(fop), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_ip, "fioff", NULL, Uint, Hex, FPU_SIZE_UINT(ip),
+ AVX_OFFSET(ip), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_cs, "fiseg", NULL, Uint, Hex, FPU_SIZE_UINT(cs),
+ AVX_OFFSET(cs), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_dp, "fooff", NULL, Uint, Hex, FPU_SIZE_UINT(dp),
+ AVX_OFFSET(dp), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_ds, "foseg", NULL, Uint, Hex, FPU_SIZE_UINT(ds),
+ AVX_OFFSET(ds), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_mxcsr, "mxcsr", NULL, Uint, Hex, FPU_SIZE_UINT(mxcsr),
+ AVX_OFFSET(mxcsr), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+ {e_regSetFPU, fpu_mxcsrmask, "mxcsrmask", NULL, Uint, Hex,
+ FPU_SIZE_UINT(mxcsrmask), AVX_OFFSET(mxcsrmask), INVALID_NUB_REGNUM,
+ INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, INVALID_NUB_REGNUM, NULL, NULL},
+
+ {e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm0), AVX_OFFSET(stmm0), INVALID_NUB_REGNUM, dwarf_stmm0,
+ INVALID_NUB_REGNUM, debugserver_stmm0, NULL, NULL},
+ {e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm1), AVX_OFFSET(stmm1), INVALID_NUB_REGNUM, dwarf_stmm1,
+ INVALID_NUB_REGNUM, debugserver_stmm1, NULL, NULL},
+ {e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm2), AVX_OFFSET(stmm2), INVALID_NUB_REGNUM, dwarf_stmm2,
+ INVALID_NUB_REGNUM, debugserver_stmm2, NULL, NULL},
+ {e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm3), AVX_OFFSET(stmm3), INVALID_NUB_REGNUM, dwarf_stmm3,
+ INVALID_NUB_REGNUM, debugserver_stmm3, NULL, NULL},
+ {e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm4), AVX_OFFSET(stmm4), INVALID_NUB_REGNUM, dwarf_stmm4,
+ INVALID_NUB_REGNUM, debugserver_stmm4, NULL, NULL},
+ {e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm5), AVX_OFFSET(stmm5), INVALID_NUB_REGNUM, dwarf_stmm5,
+ INVALID_NUB_REGNUM, debugserver_stmm5, NULL, NULL},
+ {e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm6), AVX_OFFSET(stmm6), INVALID_NUB_REGNUM, dwarf_stmm6,
+ INVALID_NUB_REGNUM, debugserver_stmm6, NULL, NULL},
+ {e_regSetFPU, fpu_stmm7, "stmm7", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm7), AVX_OFFSET(stmm7), INVALID_NUB_REGNUM, dwarf_stmm7,
+ INVALID_NUB_REGNUM, debugserver_stmm7, NULL, NULL},
+
+ AVX512_K_REG_DEF(0),
+ AVX512_K_REG_DEF(1),
+ AVX512_K_REG_DEF(2),
+ AVX512_K_REG_DEF(3),
+ AVX512_K_REG_DEF(4),
+ AVX512_K_REG_DEF(5),
+ AVX512_K_REG_DEF(6),
+ AVX512_K_REG_DEF(7),
+
+ ZMM_REG_DEF(0),
+ ZMM_REG_DEF(1),
+ ZMM_REG_DEF(2),
+ ZMM_REG_DEF(3),
+ ZMM_REG_DEF(4),
+ ZMM_REG_DEF(5),
+ ZMM_REG_DEF(6),
+ ZMM_REG_DEF(7),
+
+ YMM_REG_ALIAS(0),
+ YMM_REG_ALIAS(1),
+ YMM_REG_ALIAS(2),
+ YMM_REG_ALIAS(3),
+ YMM_REG_ALIAS(4),
+ YMM_REG_ALIAS(5),
+ YMM_REG_ALIAS(6),
+ YMM_REG_ALIAS(7),
+
+ XMM_REG_ALIAS(0),
+ XMM_REG_ALIAS(1),
+ XMM_REG_ALIAS(2),
+ XMM_REG_ALIAS(3),
+ XMM_REG_ALIAS(4),
+ XMM_REG_ALIAS(5),
+ XMM_REG_ALIAS(6),
+ XMM_REG_ALIAS(7)
+
+};
+
const DNBRegisterInfo DNBArchImplI386::g_exc_registers[] = {
{e_regSetEXC, exc_trapno, "trapno", NULL, Uint, Hex, EXC_SIZE(trapno),
EXC_OFFSET(trapno), INVALID_NUB_REGNUM, INVALID_NUB_REGNUM,
@@ -1297,12 +1533,16 @@ const size_t DNBArchImplI386::k_num_fpu_registers_no_avx =
sizeof(g_fpu_registers_no_avx) / sizeof(DNBRegisterInfo);
const size_t DNBArchImplI386::k_num_fpu_registers_avx =
sizeof(g_fpu_registers_avx) / sizeof(DNBRegisterInfo);
+const size_t DNBArchImplI386::k_num_fpu_registers_avx512f =
+ sizeof(g_fpu_registers_avx512f) / sizeof(DNBRegisterInfo);
const size_t DNBArchImplI386::k_num_exc_registers =
sizeof(g_exc_registers) / sizeof(DNBRegisterInfo);
const size_t DNBArchImplI386::k_num_all_registers_no_avx =
k_num_gpr_registers + k_num_fpu_registers_no_avx + k_num_exc_registers;
const size_t DNBArchImplI386::k_num_all_registers_avx =
k_num_gpr_registers + k_num_fpu_registers_avx + k_num_exc_registers;
+const size_t DNBArchImplI386::k_num_all_registers_avx512f =
+ k_num_gpr_registers + k_num_fpu_registers_avx512f + k_num_exc_registers;
//----------------------------------------------------------------------
// Register set definitions. The first definitions at register set index
@@ -1322,9 +1562,16 @@ const DNBRegisterSetInfo DNBArchImplI386::g_reg_sets_avx[] = {
{"Floating Point Registers", g_fpu_registers_avx, k_num_fpu_registers_avx},
{"Exception State Registers", g_exc_registers, k_num_exc_registers}};
+const DNBRegisterSetInfo DNBArchImplI386::g_reg_sets_avx512f[] = {
+ {"i386 Registers", NULL, k_num_all_registers_avx512f},
+ {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers},
+ {"Floating Point Registers", g_fpu_registers_avx512f,
+ k_num_fpu_registers_avx512f},
+ {"Exception State Registers", g_exc_registers, k_num_exc_registers}};
+
// Total number of register sets for this architecture
const size_t DNBArchImplI386::k_num_register_sets =
- sizeof(g_reg_sets_no_avx) / sizeof(DNBRegisterSetInfo);
+ sizeof(g_reg_sets_avx) / sizeof(DNBRegisterSetInfo);
DNBArchProtocol *DNBArchImplI386::Create(MachThread *thread) {
DNBArchImplI386 *obj = new DNBArchImplI386(thread);
@@ -1341,7 +1588,9 @@ const uint8_t *DNBArchImplI386::SoftwareBreakpointOpcode(nub_size_t byte_size) {
const DNBRegisterSetInfo *
DNBArchImplI386::GetRegisterSetInfo(nub_size_t *num_reg_sets) {
*num_reg_sets = k_num_register_sets;
- if (CPUHasAVX() || FORCE_AVX_REGS)
+ if (CPUHasAVX512f() || FORCE_AVX_REGS)
+ return g_reg_sets_avx512f;
+ if (CPUHasAVX())
return g_reg_sets_avx;
else
return g_reg_sets_no_avx;
@@ -1404,6 +1653,8 @@ bool DNBArchImplI386::GetRegisterValue(uint32_t set, uint32_t reg,
case e_regSetFPU:
if (reg > fpu_xmm7 && !(CPUHasAVX() || FORCE_AVX_REGS))
return false;
+ if (reg > fpu_ymm7 && !(CPUHasAVX512f() || FORCE_AVX_REGS))
+ return false;
switch (reg) {
case fpu_fcw:
value->value.uint16 =
@@ -1534,6 +1785,33 @@ bool DNBArchImplI386::GetRegisterValue(uint32_t set, uint32_t reg,
MEMCPY_YMM(7);
return true;
#undef MEMCPY_YMM
+
+ case fpu_k0:
+ case fpu_k1:
+ case fpu_k2:
+ case fpu_k3:
+ case fpu_k4:
+ case fpu_k5:
+ case fpu_k6:
+ case fpu_k7:
+ memcpy((&value->value.uint8),
+ &m_state.context.fpu.avx512f.__fpu_k0 + (reg - fpu_k0), 8);
+ return true;
+ case fpu_zmm0:
+ case fpu_zmm1:
+ case fpu_zmm2:
+ case fpu_zmm3:
+ case fpu_zmm4:
+ case fpu_zmm5:
+ case fpu_zmm6:
+ case fpu_zmm7:
+ memcpy(&value->value.uint8,
+ &m_state.context.fpu.avx512f.__fpu_xmm0 + (reg - fpu_zmm0), 16);
+ memcpy(&value->value.uint8 + 16,
+ &m_state.context.fpu.avx512f.__fpu_ymmh0 + (reg - fpu_zmm0), 16);
+ memcpy(&value->value.uint8 + 32,
+ &m_state.context.fpu.avx512f.__fpu_zmmh0 + (reg - fpu_zmm0), 32);
+ return true;
}
break;
@@ -1595,6 +1873,8 @@ bool DNBArchImplI386::SetRegisterValue(uint32_t set, uint32_t reg,
case e_regSetFPU:
if (reg > fpu_xmm7 && !(CPUHasAVX() || FORCE_AVX_REGS))
return false;
+ if (reg > fpu_ymm7 && !(CPUHasAVX512f() || FORCE_AVX_REGS))
+ return false;
switch (reg) {
case fpu_fcw:
*((uint16_t *)(&m_state.context.fpu.no_avx.__fpu_fcw)) =
@@ -1751,6 +2031,33 @@ bool DNBArchImplI386::SetRegisterValue(uint32_t set, uint32_t reg,
MEMCPY_YMM(7);
return true;
#undef MEMCPY_YMM
+
+ case fpu_k0:
+ case fpu_k1:
+ case fpu_k2:
+ case fpu_k3:
+ case fpu_k4:
+ case fpu_k5:
+ case fpu_k6:
+ case fpu_k7:
+ memcpy(&m_state.context.fpu.avx512f.__fpu_k0 + (reg - fpu_k0),
+ &value->value.uint8, 8);
+ return true;
+ case fpu_zmm0:
+ case fpu_zmm1:
+ case fpu_zmm2:
+ case fpu_zmm3:
+ case fpu_zmm4:
+ case fpu_zmm5:
+ case fpu_zmm6:
+ case fpu_zmm7:
+ memcpy(&m_state.context.fpu.avx512f.__fpu_xmm0 + (reg - fpu_zmm0),
+ &value->value.uint8, 16);
+ memcpy(&m_state.context.fpu.avx512f.__fpu_ymmh0 + (reg - fpu_zmm0),
+ &value->value.uint8 + 16, 16);
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmmh0 + (reg - fpu_zmm0),
+ &value->value.uint8 + 32, 32);
+ return true;
}
break;
@@ -1771,7 +2078,13 @@ bool DNBArchImplI386::SetRegisterValue(uint32_t set, uint32_t reg,
uint32_t DNBArchImplI386::GetRegisterContextSize() {
static uint32_t g_cached_size = 0;
if (g_cached_size == 0) {
- if (CPUHasAVX() || FORCE_AVX_REGS) {
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < k_num_fpu_registers_avx512f; ++i) {
+ if (g_fpu_registers_avx512f[i].value_regs == NULL)
+ g_cached_size += g_fpu_registers_avx512f[i].size;
+ }
+ } else
+ if (CPUHasAVX()) {
for (size_t i = 0; i < k_num_fpu_registers_avx; ++i) {
if (g_fpu_registers_avx[i].value_regs == NULL)
g_cached_size += g_fpu_registers_avx[i].size;
@@ -1844,6 +2157,13 @@ nub_size_t DNBArchImplI386::GetRegisterContext(void *buf, nub_size_t buf_len) {
p += 10;
}
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(p, &m_state.context.fpu.avx512f.__fpu_k0 + i, 8);
+ p += 8;
+ }
+ }
+
if (CPUHasAVX() || FORCE_AVX_REGS) {
// Interleave the XMM and YMMH registers to make the YMM registers
for (size_t i = 0; i < 8; ++i) {
@@ -1852,6 +2172,12 @@ nub_size_t DNBArchImplI386::GetRegisterContext(void *buf, nub_size_t buf_len) {
memcpy(p, &m_state.context.fpu.avx.__fpu_ymmh0 + i, 16);
p += 16;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(p, &m_state.context.fpu.avx512f.__fpu_zmmh0 + i, 32);
+ p += 32;
+ }
+ }
} else {
// Copy the XMM registers in a single block
memcpy(p, &m_state.context.fpu.no_avx.__fpu_xmm0, 8 * 16);
@@ -1908,6 +2234,13 @@ nub_size_t DNBArchImplI386::SetRegisterContext(const void *buf,
p += 10;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(&m_state.context.fpu.avx512f.__fpu_k0 + i, p, 8);
+ p += 8;
+ }
+ }
+
if (CPUHasAVX() || FORCE_AVX_REGS) {
// Interleave the XMM and YMMH registers to make the YMM registers
for (size_t i = 0; i < 8; ++i) {
@@ -1916,6 +2249,13 @@ nub_size_t DNBArchImplI386::SetRegisterContext(const void *buf,
memcpy(&m_state.context.fpu.avx.__fpu_ymmh0 + i, p, 16);
p += 16;
}
+
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmmh0 + i, p, 32);
+ p += 32;
+ }
+ }
} else {
// Copy the XMM registers in a single block
memcpy(&m_state.context.fpu.no_avx.__fpu_xmm0, p, 8 * 16);
diff --git a/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h b/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
index 2e9542b051c6..ce56a540e092 100644
--- a/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
+++ b/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
@@ -83,6 +83,12 @@ protected:
static const size_t k_num_all_registers_avx;
static const size_t k_num_register_sets;
+ typedef __i386_avx512f_state_t AVX512F;
+ static const DNBRegisterInfo g_fpu_registers_avx512f[];
+ static const DNBRegisterSetInfo g_reg_sets_avx512f[];
+ static const size_t k_num_fpu_registers_avx512f;
+ static const size_t k_num_all_registers_avx512f;
+
typedef enum RegisterSetTag {
e_regSetALL = REGISTER_SET_ALL,
e_regSetGPR,
@@ -97,6 +103,7 @@ protected:
e_regSetWordSizeFPU = sizeof(FPU) / sizeof(int),
e_regSetWordSizeEXC = sizeof(EXC) / sizeof(int),
e_regSetWordSizeAVX = sizeof(AVX) / sizeof(int),
+ e_regSetWordSizeAVX512f = sizeof(AVX512F) / sizeof(int),
e_regSetWordSizeDBG = sizeof(DBG) / sizeof(int)
} RegisterSetWordSize;
@@ -107,6 +114,7 @@ protected:
union {
FPU no_avx;
AVX avx;
+ AVX512F avx512f;
} fpu;
EXC exc;
DBG dbg;
diff --git a/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h b/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h
index 900aa15a75d3..e51ecfd24bef 100644
--- a/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h
+++ b/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h
@@ -21,6 +21,7 @@
#define __i386_EXCEPTION_STATE 3
#define __i386_DEBUG_STATE 10
#define __i386_AVX_STATE 16
+#define __i386_AVX512F_STATE 19
typedef struct {
uint32_t __eax;
@@ -158,6 +159,69 @@ typedef struct {
__i386_xmm_reg __fpu_ymmh7;
} __i386_avx_state_t;
+typedef struct { uint8_t __ymm_reg[32]; } __i386_ymm_reg;
+typedef struct { uint8_t __opmask_reg[8]; } __i386_opmask_reg;
+
+typedef struct {
+ uint32_t __fpu_reserved[2];
+ __i386_fp_control_t __fpu_fcw;
+ __i386_fp_status_t __fpu_fsw;
+ uint8_t __fpu_ftw;
+ uint8_t __fpu_rsrv1;
+ uint16_t __fpu_fop;
+ uint32_t __fpu_ip;
+ uint16_t __fpu_cs;
+ uint16_t __fpu_rsrv2;
+ uint32_t __fpu_dp;
+ uint16_t __fpu_ds;
+ uint16_t __fpu_rsrv3;
+ uint32_t __fpu_mxcsr;
+ uint32_t __fpu_mxcsrmask;
+ __i386_mmst_reg __fpu_stmm0;
+ __i386_mmst_reg __fpu_stmm1;
+ __i386_mmst_reg __fpu_stmm2;
+ __i386_mmst_reg __fpu_stmm3;
+ __i386_mmst_reg __fpu_stmm4;
+ __i386_mmst_reg __fpu_stmm5;
+ __i386_mmst_reg __fpu_stmm6;
+ __i386_mmst_reg __fpu_stmm7;
+ __i386_xmm_reg __fpu_xmm0;
+ __i386_xmm_reg __fpu_xmm1;
+ __i386_xmm_reg __fpu_xmm2;
+ __i386_xmm_reg __fpu_xmm3;
+ __i386_xmm_reg __fpu_xmm4;
+ __i386_xmm_reg __fpu_xmm5;
+ __i386_xmm_reg __fpu_xmm6;
+ __i386_xmm_reg __fpu_xmm7;
+ uint8_t __fpu_rsrv4[14 * 16];
+ uint32_t __fpu_reserved1;
+ uint8_t __avx_reserved1[64];
+ __i386_xmm_reg __fpu_ymmh0;
+ __i386_xmm_reg __fpu_ymmh1;
+ __i386_xmm_reg __fpu_ymmh2;
+ __i386_xmm_reg __fpu_ymmh3;
+ __i386_xmm_reg __fpu_ymmh4;
+ __i386_xmm_reg __fpu_ymmh5;
+ __i386_xmm_reg __fpu_ymmh6;
+ __i386_xmm_reg __fpu_ymmh7;
+ __i386_opmask_reg __fpu_k0;
+ __i386_opmask_reg __fpu_k1;
+ __i386_opmask_reg __fpu_k2;
+ __i386_opmask_reg __fpu_k3;
+ __i386_opmask_reg __fpu_k4;
+ __i386_opmask_reg __fpu_k5;
+ __i386_opmask_reg __fpu_k6;
+ __i386_opmask_reg __fpu_k7;
+ __i386_ymm_reg __fpu_zmmh0;
+ __i386_ymm_reg __fpu_zmmh1;
+ __i386_ymm_reg __fpu_zmmh2;
+ __i386_ymm_reg __fpu_zmmh3;
+ __i386_ymm_reg __fpu_zmmh4;
+ __i386_ymm_reg __fpu_zmmh5;
+ __i386_ymm_reg __fpu_zmmh6;
+ __i386_ymm_reg __fpu_zmmh7;
+} __i386_avx512f_state_t;
+
typedef struct {
uint32_t __trapno;
uint32_t __err;
diff --git a/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp b/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
index 86843fd97c06..f0a3d2b001b2 100644
--- a/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
+++ b/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
@@ -119,6 +119,17 @@ extern "C" bool CPUHasAVX() {
return LogAVXAndReturn(g_has_avx, err, buffer);
}
+extern "C" bool CPUHasAVX512f() {
+ static AVXPresence g_has_avx512f = eAVXUnknown;
+ if (g_has_avx512f != eAVXUnknown)
+ return g_has_avx512f == eAVXPresent;
+
+ g_has_avx512f = DetectHardwareFeature("hw.optional.avx512f") ? eAVXPresent
+ : eAVXNotPresent;
+
+ return (g_has_avx512f == eAVXPresent);
+}
+
uint64_t DNBArchImplX86_64::GetPC(uint64_t failValue) {
// Get program counter
if (GetGPRState(false) == KERN_SUCCESS)
@@ -338,10 +349,82 @@ kern_return_t DNBArchImplX86_64::GetFPUState(bool force) {
for (int i = 0; i < sizeof(m_state.context.fpu.avx.__avx_reserved1); ++i)
m_state.context.fpu.avx.__avx_reserved1[i] = INT8_MIN;
}
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (int i = 0; i < 8; ++i) {
+ m_state.context.fpu.avx512f.__fpu_k0.__opmask_reg[i] = '0';
+ m_state.context.fpu.avx512f.__fpu_k1.__opmask_reg[i] = '1';
+ m_state.context.fpu.avx512f.__fpu_k2.__opmask_reg[i] = '2';
+ m_state.context.fpu.avx512f.__fpu_k3.__opmask_reg[i] = '3';
+ m_state.context.fpu.avx512f.__fpu_k4.__opmask_reg[i] = '4';
+ m_state.context.fpu.avx512f.__fpu_k5.__opmask_reg[i] = '5';
+ m_state.context.fpu.avx512f.__fpu_k6.__opmask_reg[i] = '6';
+ m_state.context.fpu.avx512f.__fpu_k7.__opmask_reg[i] = '7';
+ }
+
+ for (int i = 0; i < 32; ++i) {
+ m_state.context.fpu.avx512f.__fpu_zmmh0.__ymm_reg[i] = '0';
+ m_state.context.fpu.avx512f.__fpu_zmmh1.__ymm_reg[i] = '1';
+ m_state.context.fpu.avx512f.__fpu_zmmh2.__ymm_reg[i] = '2';
+ m_state.context.fpu.avx512f.__fpu_zmmh3.__ymm_reg[i] = '3';
+ m_state.context.fpu.avx512f.__fpu_zmmh4.__ymm_reg[i] = '4';
+ m_state.context.fpu.avx512f.__fpu_zmmh5.__ymm_reg[i] = '5';
+ m_state.context.fpu.avx512f.__fpu_zmmh6.__ymm_reg[i] = '6';
+ m_state.context.fpu.avx512f.__fpu_zmmh7.__ymm_reg[i] = '7';
+ m_state.context.fpu.avx512f.__fpu_zmmh8.__ymm_reg[i] = '8';
+ m_state.context.fpu.avx512f.__fpu_zmmh9.__ymm_reg[i] = '9';
+ m_state.context.fpu.avx512f.__fpu_zmmh10.__ymm_reg[i] = 'A';
+ m_state.context.fpu.avx512f.__fpu_zmmh11.__ymm_reg[i] = 'B';
+ m_state.context.fpu.avx512f.__fpu_zmmh12.__ymm_reg[i] = 'C';
+ m_state.context.fpu.avx512f.__fpu_zmmh13.__ymm_reg[i] = 'D';
+ m_state.context.fpu.avx512f.__fpu_zmmh14.__ymm_reg[i] = 'E';
+ m_state.context.fpu.avx512f.__fpu_zmmh15.__ymm_reg[i] = 'F';
+ }
+ for (int i = 0; i < 64; ++i) {
+ m_state.context.fpu.avx512f.__fpu_zmm16.__zmm_reg[i] = 'G';
+ m_state.context.fpu.avx512f.__fpu_zmm17.__zmm_reg[i] = 'H';
+ m_state.context.fpu.avx512f.__fpu_zmm18.__zmm_reg[i] = 'I';
+ m_state.context.fpu.avx512f.__fpu_zmm19.__zmm_reg[i] = 'J';
+ m_state.context.fpu.avx512f.__fpu_zmm20.__zmm_reg[i] = 'K';
+ m_state.context.fpu.avx512f.__fpu_zmm21.__zmm_reg[i] = 'L';
+ m_state.context.fpu.avx512f.__fpu_zmm22.__zmm_reg[i] = 'M';
+ m_state.context.fpu.avx512f.__fpu_zmm23.__zmm_reg[i] = 'N';
+ m_state.context.fpu.avx512f.__fpu_zmm24.__zmm_reg[i] = 'O';
+ m_state.context.fpu.avx512f.__fpu_zmm25.__zmm_reg[i] = 'P';
+ m_state.context.fpu.avx512f.__fpu_zmm26.__zmm_reg[i] = 'Q';
+ m_state.context.fpu.avx512f.__fpu_zmm27.__zmm_reg[i] = 'R';
+ m_state.context.fpu.avx512f.__fpu_zmm28.__zmm_reg[i] = 'S';
+ m_state.context.fpu.avx512f.__fpu_zmm29.__zmm_reg[i] = 'T';
+ m_state.context.fpu.avx512f.__fpu_zmm30.__zmm_reg[i] = 'U';
+ m_state.context.fpu.avx512f.__fpu_zmm31.__zmm_reg[i] = 'V';
+ }
+ }
m_state.SetError(e_regSetFPU, Read, 0);
} else {
mach_msg_type_number_t count = e_regSetWordSizeFPU;
int flavor = __x86_64_FLOAT_STATE;
+ // On a machine with the AVX512 register set, a process only gets a
+ // full AVX512 register context after it uses the AVX512 registers;
+ // if the process has not yet triggered this change, trying to fetch
+ // the AVX512 registers will fail. Fall through to fetching the AVX
+ // registers.
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ count = e_regSetWordSizeAVX512f;
+ flavor = __x86_64_AVX512F_STATE;
+ m_state.SetError(e_regSetFPU, Read,
+ ::thread_get_state(m_thread->MachPortNumber(), flavor,
+ (thread_state_t)&m_state.context.fpu,
+ &count));
+ DNBLogThreadedIf(LOG_THREAD,
+ "::thread_get_state (0x%4.4x, %u, &fpu, %u => 0x%8.8x",
+ m_thread->MachPortNumber(), flavor, (uint32_t)count,
+ m_state.GetError(e_regSetFPU, Read));
+
+ if (m_state.GetError(e_regSetFPU, Read) == KERN_SUCCESS)
+ return m_state.GetError(e_regSetFPU, Read);
+ else
+ DNBLogThreadedIf(LOG_THREAD,
+ "::thread_get_state attempted fetch of avx512 fpu regctx failed, will try fetching avx");
+ }
if (CPUHasAVX() || FORCE_AVX_REGS) {
count = e_regSetWordSizeAVX;
flavor = __x86_64_AVX_STATE;
@@ -413,6 +496,20 @@ kern_return_t DNBArchImplX86_64::SetFPUState() {
} else {
int flavor = __x86_64_FLOAT_STATE;
mach_msg_type_number_t count = e_regSetWordSizeFPU;
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ count = e_regSetWordSizeAVX512f;
+ flavor = __x86_64_AVX512F_STATE;
+ m_state.SetError(
+ e_regSetFPU, Write,
+ ::thread_set_state(m_thread->MachPortNumber(), flavor,
+ (thread_state_t)&m_state.context.fpu, count));
+ if (m_state.GetError(e_regSetFPU, Write) == KERN_SUCCESS)
+ return m_state.GetError(e_regSetFPU, Write);
+ else
+ DNBLogThreadedIf(LOG_THREAD,
+ "::thread_get_state attempted save of avx512 fpu regctx failed, will try saving avx regctx");
+ }
+
if (CPUHasAVX() || FORCE_AVX_REGS) {
flavor = __x86_64_AVX_STATE;
count = e_regSetWordSizeAVX;
@@ -1019,6 +1116,46 @@ enum {
fpu_ymm13,
fpu_ymm14,
fpu_ymm15,
+ fpu_k0,
+ fpu_k1,
+ fpu_k2,
+ fpu_k3,
+ fpu_k4,
+ fpu_k5,
+ fpu_k6,
+ fpu_k7,
+ fpu_zmm0,
+ fpu_zmm1,
+ fpu_zmm2,
+ fpu_zmm3,
+ fpu_zmm4,
+ fpu_zmm5,
+ fpu_zmm6,
+ fpu_zmm7,
+ fpu_zmm8,
+ fpu_zmm9,
+ fpu_zmm10,
+ fpu_zmm11,
+ fpu_zmm12,
+ fpu_zmm13,
+ fpu_zmm14,
+ fpu_zmm15,
+ fpu_zmm16,
+ fpu_zmm17,
+ fpu_zmm18,
+ fpu_zmm19,
+ fpu_zmm20,
+ fpu_zmm21,
+ fpu_zmm22,
+ fpu_zmm23,
+ fpu_zmm24,
+ fpu_zmm25,
+ fpu_zmm26,
+ fpu_zmm27,
+ fpu_zmm28,
+ fpu_zmm29,
+ fpu_zmm30,
+ fpu_zmm31,
k_num_fpu_regs,
// Aliases
@@ -1095,7 +1232,47 @@ enum ehframe_dwarf_regnums {
ehframe_dwarf_ymm12 = ehframe_dwarf_xmm12,
ehframe_dwarf_ymm13 = ehframe_dwarf_xmm13,
ehframe_dwarf_ymm14 = ehframe_dwarf_xmm14,
- ehframe_dwarf_ymm15 = ehframe_dwarf_xmm15
+ ehframe_dwarf_ymm15 = ehframe_dwarf_xmm15,
+ ehframe_dwarf_zmm0 = ehframe_dwarf_xmm0,
+ ehframe_dwarf_zmm1 = ehframe_dwarf_xmm1,
+ ehframe_dwarf_zmm2 = ehframe_dwarf_xmm2,
+ ehframe_dwarf_zmm3 = ehframe_dwarf_xmm3,
+ ehframe_dwarf_zmm4 = ehframe_dwarf_xmm4,
+ ehframe_dwarf_zmm5 = ehframe_dwarf_xmm5,
+ ehframe_dwarf_zmm6 = ehframe_dwarf_xmm6,
+ ehframe_dwarf_zmm7 = ehframe_dwarf_xmm7,
+ ehframe_dwarf_zmm8 = ehframe_dwarf_xmm8,
+ ehframe_dwarf_zmm9 = ehframe_dwarf_xmm9,
+ ehframe_dwarf_zmm10 = ehframe_dwarf_xmm10,
+ ehframe_dwarf_zmm11 = ehframe_dwarf_xmm11,
+ ehframe_dwarf_zmm12 = ehframe_dwarf_xmm12,
+ ehframe_dwarf_zmm13 = ehframe_dwarf_xmm13,
+ ehframe_dwarf_zmm14 = ehframe_dwarf_xmm14,
+ ehframe_dwarf_zmm15 = ehframe_dwarf_xmm15,
+ ehframe_dwarf_zmm16 = 67,
+ ehframe_dwarf_zmm17,
+ ehframe_dwarf_zmm18,
+ ehframe_dwarf_zmm19,
+ ehframe_dwarf_zmm20,
+ ehframe_dwarf_zmm21,
+ ehframe_dwarf_zmm22,
+ ehframe_dwarf_zmm23,
+ ehframe_dwarf_zmm24,
+ ehframe_dwarf_zmm25,
+ ehframe_dwarf_zmm26,
+ ehframe_dwarf_zmm27,
+ ehframe_dwarf_zmm28,
+ ehframe_dwarf_zmm29,
+ ehframe_dwarf_zmm30,
+ ehframe_dwarf_zmm31,
+ ehframe_dwarf_k0 = 118,
+ ehframe_dwarf_k1,
+ ehframe_dwarf_k2,
+ ehframe_dwarf_k3,
+ ehframe_dwarf_k4,
+ ehframe_dwarf_k5,
+ ehframe_dwarf_k6,
+ ehframe_dwarf_k7,
};
enum debugserver_regnums {
@@ -1178,7 +1355,47 @@ enum debugserver_regnums {
debugserver_ymm12 = debugserver_xmm12,
debugserver_ymm13 = debugserver_xmm13,
debugserver_ymm14 = debugserver_xmm14,
- debugserver_ymm15 = debugserver_xmm15
+ debugserver_ymm15 = debugserver_xmm15,
+ debugserver_zmm0 = debugserver_xmm0,
+ debugserver_zmm1 = debugserver_xmm1,
+ debugserver_zmm2 = debugserver_xmm2,
+ debugserver_zmm3 = debugserver_xmm3,
+ debugserver_zmm4 = debugserver_xmm4,
+ debugserver_zmm5 = debugserver_xmm5,
+ debugserver_zmm6 = debugserver_xmm6,
+ debugserver_zmm7 = debugserver_xmm7,
+ debugserver_zmm8 = debugserver_xmm8,
+ debugserver_zmm9 = debugserver_xmm9,
+ debugserver_zmm10 = debugserver_xmm10,
+ debugserver_zmm11 = debugserver_xmm11,
+ debugserver_zmm12 = debugserver_xmm12,
+ debugserver_zmm13 = debugserver_xmm13,
+ debugserver_zmm14 = debugserver_xmm14,
+ debugserver_zmm15 = debugserver_xmm15,
+ debugserver_zmm16 = 67,
+ debugserver_zmm17 = 68,
+ debugserver_zmm18 = 69,
+ debugserver_zmm19 = 70,
+ debugserver_zmm20 = 71,
+ debugserver_zmm21 = 72,
+ debugserver_zmm22 = 73,
+ debugserver_zmm23 = 74,
+ debugserver_zmm24 = 75,
+ debugserver_zmm25 = 76,
+ debugserver_zmm26 = 77,
+ debugserver_zmm27 = 78,
+ debugserver_zmm28 = 79,
+ debugserver_zmm29 = 80,
+ debugserver_zmm30 = 81,
+ debugserver_zmm31 = 82,
+ debugserver_k0 = 118,
+ debugserver_k1 = 119,
+ debugserver_k2 = 120,
+ debugserver_k3 = 121,
+ debugserver_k4 = 122,
+ debugserver_k5 = 123,
+ debugserver_k6 = 124,
+ debugserver_k7 = 125,
};
#define GPR_OFFSET(reg) (offsetof(DNBArchImplX86_64::GPR, __##reg))
@@ -1188,10 +1405,14 @@ enum debugserver_regnums {
#define AVX_OFFSET(reg) \
(offsetof(DNBArchImplX86_64::AVX, __fpu_##reg) + \
offsetof(DNBArchImplX86_64::Context, fpu.avx))
+#define AVX512F_OFFSET(reg) \
+ (offsetof(DNBArchImplX86_64::AVX512F, __fpu_##reg) + \
+ offsetof(DNBArchImplX86_64::Context, fpu.avx512f))
#define EXC_OFFSET(reg) \
(offsetof(DNBArchImplX86_64::EXC, __##reg) + \
offsetof(DNBArchImplX86_64::Context, exc))
#define AVX_OFFSET_YMM(n) (AVX_OFFSET(ymmh0) + (32 * n))
+#define AVX512F_OFFSET_ZMM(n) (AVX512F_OFFSET(zmmh0) + (64 * n))
#define GPR_SIZE(reg) (sizeof(((DNBArchImplX86_64::GPR *)NULL)->__##reg))
#define FPU_SIZE_UINT(reg) \
@@ -1201,6 +1422,7 @@ enum debugserver_regnums {
#define FPU_SIZE_XMM(reg) \
(sizeof(((DNBArchImplX86_64::FPU *)NULL)->__fpu_##reg.__xmm_reg))
#define FPU_SIZE_YMM(reg) (32)
+#define FPU_SIZE_ZMM(reg) (64)
#define EXC_SIZE(reg) (sizeof(((DNBArchImplX86_64::EXC *)NULL)->__##reg))
// These macros will auto define the register name, alt name, register size,
@@ -1638,6 +1860,183 @@ const DNBRegisterInfo DNBArchImplX86_64::g_fpu_registers_avx[] = {
};
+static const char *g_contained_zmm0[] = {"zmm0", NULL};
+static const char *g_contained_zmm1[] = {"zmm1", NULL};
+static const char *g_contained_zmm2[] = {"zmm2", NULL};
+static const char *g_contained_zmm3[] = {"zmm3", NULL};
+static const char *g_contained_zmm4[] = {"zmm4", NULL};
+static const char *g_contained_zmm5[] = {"zmm5", NULL};
+static const char *g_contained_zmm6[] = {"zmm6", NULL};
+static const char *g_contained_zmm7[] = {"zmm7", NULL};
+static const char *g_contained_zmm8[] = {"zmm8", NULL};
+static const char *g_contained_zmm9[] = {"zmm9", NULL};
+static const char *g_contained_zmm10[] = {"zmm10", NULL};
+static const char *g_contained_zmm11[] = {"zmm11", NULL};
+static const char *g_contained_zmm12[] = {"zmm12", NULL};
+static const char *g_contained_zmm13[] = {"zmm13", NULL};
+static const char *g_contained_zmm14[] = {"zmm14", NULL};
+static const char *g_contained_zmm15[] = {"zmm15", NULL};
+
+#define STR(s) #s
+
+#define ZMM_REG_DEF(reg) \
+ { \
+ e_regSetFPU, fpu_zmm##reg, STR(zmm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_ZMM(zmm##reg), AVX512F_OFFSET_ZMM(reg), \
+ ehframe_dwarf_zmm##reg, ehframe_dwarf_zmm##reg, -1U, \
+ debugserver_zmm##reg, NULL, NULL \
+ }
+
+#define YMM_REG_ALIAS(reg) \
+ { \
+ e_regSetFPU, fpu_ymm##reg, STR(ymm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_YMM(ymm##reg), 0, ehframe_dwarf_ymm##reg, \
+ ehframe_dwarf_ymm##reg, -1U, debugserver_ymm##reg, \
+ g_contained_zmm##reg, NULL \
+ }
+
+#define XMM_REG_ALIAS(reg) \
+ { \
+ e_regSetFPU, fpu_xmm##reg, STR(xmm##reg), NULL, Vector, VectorOfUInt8, \
+ FPU_SIZE_XMM(xmm##reg), 0, ehframe_dwarf_xmm##reg, \
+ ehframe_dwarf_xmm##reg, -1U, debugserver_xmm##reg, \
+ g_contained_zmm##reg, NULL \
+ }
+
+#define AVX512_K_REG_DEF(reg) \
+ { \
+ e_regSetFPU, fpu_k##reg, STR(k##reg), NULL, Vector, VectorOfUInt8, 8, \
+ AVX512F_OFFSET(k##reg), ehframe_dwarf_k##reg, ehframe_dwarf_k##reg, \
+ -1U, debugserver_k##reg, NULL, NULL \
+ }
+
+const DNBRegisterInfo DNBArchImplX86_64::g_fpu_registers_avx512f[] = {
+ {e_regSetFPU, fpu_fcw, "fctrl", NULL, Uint, Hex, FPU_SIZE_UINT(fcw),
+ AVX_OFFSET(fcw), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_fsw, "fstat", NULL, Uint, Hex, FPU_SIZE_UINT(fsw),
+ AVX_OFFSET(fsw), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_ftw, "ftag", NULL, Uint, Hex, 2 /* sizeof __fpu_ftw + sizeof __fpu_rsrv1 */,
+ AVX_OFFSET(ftw), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_fop, "fop", NULL, Uint, Hex, FPU_SIZE_UINT(fop),
+ AVX_OFFSET(fop), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_ip, "fioff", NULL, Uint, Hex, FPU_SIZE_UINT(ip),
+ AVX_OFFSET(ip), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_cs, "fiseg", NULL, Uint, Hex, FPU_SIZE_UINT(cs),
+ AVX_OFFSET(cs), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_dp, "fooff", NULL, Uint, Hex, FPU_SIZE_UINT(dp),
+ AVX_OFFSET(dp), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_ds, "foseg", NULL, Uint, Hex, FPU_SIZE_UINT(ds),
+ AVX_OFFSET(ds), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_mxcsr, "mxcsr", NULL, Uint, Hex, FPU_SIZE_UINT(mxcsr),
+ AVX_OFFSET(mxcsr), -1U, -1U, -1U, -1U, NULL, NULL},
+ {e_regSetFPU, fpu_mxcsrmask, "mxcsrmask", NULL, Uint, Hex,
+ FPU_SIZE_UINT(mxcsrmask), AVX_OFFSET(mxcsrmask), -1U, -1U, -1U, -1U, NULL,
+ NULL},
+
+ {e_regSetFPU, fpu_stmm0, "stmm0", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm0), AVX_OFFSET(stmm0), ehframe_dwarf_stmm0,
+ ehframe_dwarf_stmm0, -1U, debugserver_stmm0, NULL, NULL},
+ {e_regSetFPU, fpu_stmm1, "stmm1", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm1), AVX_OFFSET(stmm1), ehframe_dwarf_stmm1,
+ ehframe_dwarf_stmm1, -1U, debugserver_stmm1, NULL, NULL},
+ {e_regSetFPU, fpu_stmm2, "stmm2", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm2), AVX_OFFSET(stmm2), ehframe_dwarf_stmm2,
+ ehframe_dwarf_stmm2, -1U, debugserver_stmm2, NULL, NULL},
+ {e_regSetFPU, fpu_stmm3, "stmm3", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm3), AVX_OFFSET(stmm3), ehframe_dwarf_stmm3,
+ ehframe_dwarf_stmm3, -1U, debugserver_stmm3, NULL, NULL},
+ {e_regSetFPU, fpu_stmm4, "stmm4", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm4), AVX_OFFSET(stmm4), ehframe_dwarf_stmm4,
+ ehframe_dwarf_stmm4, -1U, debugserver_stmm4, NULL, NULL},
+ {e_regSetFPU, fpu_stmm5, "stmm5", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm5), AVX_OFFSET(stmm5), ehframe_dwarf_stmm5,
+ ehframe_dwarf_stmm5, -1U, debugserver_stmm5, NULL, NULL},
+ {e_regSetFPU, fpu_stmm6, "stmm6", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm6), AVX_OFFSET(stmm6), ehframe_dwarf_stmm6,
+ ehframe_dwarf_stmm6, -1U, debugserver_stmm6, NULL, NULL},
+ {e_regSetFPU, fpu_stmm7, "stmm7", NULL, Vector, VectorOfUInt8,
+ FPU_SIZE_MMST(stmm7), AVX_OFFSET(stmm7), ehframe_dwarf_stmm7,
+ ehframe_dwarf_stmm7, -1U, debugserver_stmm7, NULL, NULL},
+
+ AVX512_K_REG_DEF(0),
+ AVX512_K_REG_DEF(1),
+ AVX512_K_REG_DEF(2),
+ AVX512_K_REG_DEF(3),
+ AVX512_K_REG_DEF(4),
+ AVX512_K_REG_DEF(5),
+ AVX512_K_REG_DEF(6),
+ AVX512_K_REG_DEF(7),
+
+ ZMM_REG_DEF(0),
+ ZMM_REG_DEF(1),
+ ZMM_REG_DEF(2),
+ ZMM_REG_DEF(3),
+ ZMM_REG_DEF(4),
+ ZMM_REG_DEF(5),
+ ZMM_REG_DEF(6),
+ ZMM_REG_DEF(7),
+ ZMM_REG_DEF(8),
+ ZMM_REG_DEF(9),
+ ZMM_REG_DEF(10),
+ ZMM_REG_DEF(11),
+ ZMM_REG_DEF(12),
+ ZMM_REG_DEF(13),
+ ZMM_REG_DEF(14),
+ ZMM_REG_DEF(15),
+ ZMM_REG_DEF(16),
+ ZMM_REG_DEF(17),
+ ZMM_REG_DEF(18),
+ ZMM_REG_DEF(19),
+ ZMM_REG_DEF(20),
+ ZMM_REG_DEF(21),
+ ZMM_REG_DEF(22),
+ ZMM_REG_DEF(23),
+ ZMM_REG_DEF(24),
+ ZMM_REG_DEF(25),
+ ZMM_REG_DEF(26),
+ ZMM_REG_DEF(27),
+ ZMM_REG_DEF(28),
+ ZMM_REG_DEF(29),
+ ZMM_REG_DEF(30),
+ ZMM_REG_DEF(31),
+
+ YMM_REG_ALIAS(0),
+ YMM_REG_ALIAS(1),
+ YMM_REG_ALIAS(2),
+ YMM_REG_ALIAS(3),
+ YMM_REG_ALIAS(4),
+ YMM_REG_ALIAS(5),
+ YMM_REG_ALIAS(6),
+ YMM_REG_ALIAS(7),
+ YMM_REG_ALIAS(8),
+ YMM_REG_ALIAS(9),
+ YMM_REG_ALIAS(10),
+ YMM_REG_ALIAS(11),
+ YMM_REG_ALIAS(12),
+ YMM_REG_ALIAS(13),
+ YMM_REG_ALIAS(14),
+ YMM_REG_ALIAS(15),
+
+ XMM_REG_ALIAS(0),
+ XMM_REG_ALIAS(1),
+ XMM_REG_ALIAS(2),
+ XMM_REG_ALIAS(3),
+ XMM_REG_ALIAS(4),
+ XMM_REG_ALIAS(5),
+ XMM_REG_ALIAS(6),
+ XMM_REG_ALIAS(7),
+ XMM_REG_ALIAS(8),
+ XMM_REG_ALIAS(9),
+ XMM_REG_ALIAS(10),
+ XMM_REG_ALIAS(11),
+ XMM_REG_ALIAS(12),
+ XMM_REG_ALIAS(13),
+ XMM_REG_ALIAS(14),
+ XMM_REG_ALIAS(15),
+
+};
+
+
// Exception registers
const DNBRegisterInfo DNBArchImplX86_64::g_exc_registers[] = {
@@ -1662,6 +2061,10 @@ const size_t DNBArchImplX86_64::k_num_all_registers_no_avx =
k_num_gpr_registers + k_num_fpu_registers_no_avx + k_num_exc_registers;
const size_t DNBArchImplX86_64::k_num_all_registers_avx =
k_num_gpr_registers + k_num_fpu_registers_avx + k_num_exc_registers;
+const size_t DNBArchImplX86_64::k_num_fpu_registers_avx512f =
+ sizeof(g_fpu_registers_avx512f) / sizeof(DNBRegisterInfo);
+const size_t DNBArchImplX86_64::k_num_all_registers_avx512f =
+ k_num_gpr_registers + k_num_fpu_registers_avx512f + k_num_exc_registers;
//----------------------------------------------------------------------
// Register set definitions. The first definitions at register set index
@@ -1681,6 +2084,13 @@ const DNBRegisterSetInfo DNBArchImplX86_64::g_reg_sets_avx[] = {
{"Floating Point Registers", g_fpu_registers_avx, k_num_fpu_registers_avx},
{"Exception State Registers", g_exc_registers, k_num_exc_registers}};
+const DNBRegisterSetInfo DNBArchImplX86_64::g_reg_sets_avx512f[] = {
+ {"x86_64 Registers", NULL, k_num_all_registers_avx},
+ {"General Purpose Registers", g_gpr_registers, k_num_gpr_registers},
+ {"Floating Point Registers", g_fpu_registers_avx512f,
+ k_num_fpu_registers_avx512f},
+ {"Exception State Registers", g_exc_registers, k_num_exc_registers}};
+
// Total number of register sets for this architecture
const size_t DNBArchImplX86_64::k_num_register_sets =
sizeof(g_reg_sets_avx) / sizeof(DNBRegisterSetInfo);
@@ -1702,6 +2112,8 @@ const DNBRegisterSetInfo *
DNBArchImplX86_64::GetRegisterSetInfo(nub_size_t *num_reg_sets) {
*num_reg_sets = k_num_register_sets;
+ if (CPUHasAVX512f() || FORCE_AVX_REGS)
+ return g_reg_sets_avx512f;
if (CPUHasAVX() || FORCE_AVX_REGS)
return g_reg_sets_avx;
else
@@ -1765,6 +2177,8 @@ bool DNBArchImplX86_64::GetRegisterValue(uint32_t set, uint32_t reg,
case e_regSetFPU:
if (reg > fpu_xmm15 && !(CPUHasAVX() || FORCE_AVX_REGS))
return false;
+ if (reg > fpu_ymm15 && !(CPUHasAVX512f() || FORCE_AVX_REGS))
+ return false;
switch (reg) {
case fpu_fcw:
@@ -1853,6 +2267,59 @@ bool DNBArchImplX86_64::GetRegisterValue(uint32_t set, uint32_t reg,
memcpy((&value->value.uint8) + 16,
&m_state.context.fpu.avx.__fpu_ymmh0 + (reg - fpu_ymm0), 16);
return true;
+ case fpu_k0:
+ case fpu_k1:
+ case fpu_k2:
+ case fpu_k3:
+ case fpu_k4:
+ case fpu_k5:
+ case fpu_k6:
+ case fpu_k7:
+ memcpy((&value->value.uint8),
+ &m_state.context.fpu.avx512f.__fpu_k0 + (reg - fpu_k0), 8);
+ return true;
+ case fpu_zmm0:
+ case fpu_zmm1:
+ case fpu_zmm2:
+ case fpu_zmm3:
+ case fpu_zmm4:
+ case fpu_zmm5:
+ case fpu_zmm6:
+ case fpu_zmm7:
+ case fpu_zmm8:
+ case fpu_zmm9:
+ case fpu_zmm10:
+ case fpu_zmm11:
+ case fpu_zmm12:
+ case fpu_zmm13:
+ case fpu_zmm14:
+ case fpu_zmm15:
+ memcpy(&value->value.uint8,
+ &m_state.context.fpu.avx512f.__fpu_xmm0 + (reg - fpu_zmm0), 16);
+ memcpy((&value->value.uint8) + 16,
+ &m_state.context.fpu.avx512f.__fpu_ymmh0 + (reg - fpu_zmm0), 16);
+ memcpy((&value->value.uint8) + 32,
+ &m_state.context.fpu.avx512f.__fpu_zmmh0 + (reg - fpu_zmm0), 32);
+ return true;
+ case fpu_zmm16:
+ case fpu_zmm17:
+ case fpu_zmm18:
+ case fpu_zmm19:
+ case fpu_zmm20:
+ case fpu_zmm21:
+ case fpu_zmm22:
+ case fpu_zmm23:
+ case fpu_zmm24:
+ case fpu_zmm25:
+ case fpu_zmm26:
+ case fpu_zmm27:
+ case fpu_zmm28:
+ case fpu_zmm29:
+ case fpu_zmm30:
+ case fpu_zmm31:
+ memcpy(&value->value.uint8,
+ &m_state.context.fpu.avx512f.__fpu_zmm16 + (reg - fpu_zmm16), 64);
+ return true;
}
break;
@@ -1919,6 +2386,8 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
break;
if (reg > fpu_xmm15 && !(CPUHasAVX() || FORCE_AVX_REGS))
return false;
+ if (reg > fpu_ymm15 && !(CPUHasAVX512f() || FORCE_AVX_REGS))
+ return false;
case e_regSetFPU:
switch (reg) {
case fpu_fcw:
@@ -2019,6 +2488,59 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
memcpy(&m_state.context.fpu.avx.__fpu_ymmh0 + (reg - fpu_ymm0),
(&value->value.uint8) + 16, 16);
return true;
+ case fpu_k0:
+ case fpu_k1:
+ case fpu_k2:
+ case fpu_k3:
+ case fpu_k4:
+ case fpu_k5:
+ case fpu_k6:
+ case fpu_k7:
+ memcpy(&m_state.context.fpu.avx512f.__fpu_k0 + (reg - fpu_k0),
+ &value->value.uint8, 8);
+ return true;
+ case fpu_zmm0:
+ case fpu_zmm1:
+ case fpu_zmm2:
+ case fpu_zmm3:
+ case fpu_zmm4:
+ case fpu_zmm5:
+ case fpu_zmm6:
+ case fpu_zmm7:
+ case fpu_zmm8:
+ case fpu_zmm9:
+ case fpu_zmm10:
+ case fpu_zmm11:
+ case fpu_zmm12:
+ case fpu_zmm13:
+ case fpu_zmm14:
+ case fpu_zmm15:
+ memcpy(&m_state.context.fpu.avx512f.__fpu_xmm0 + (reg - fpu_zmm0),
+ &value->value.uint8, 16);
+ memcpy(&m_state.context.fpu.avx512f.__fpu_ymmh0 + (reg - fpu_zmm0),
+ &value->value.uint8 + 16, 16);
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmmh0 + (reg - fpu_zmm0),
+ &value->value.uint8 + 32, 32);
+ return true;
+ case fpu_zmm16:
+ case fpu_zmm17:
+ case fpu_zmm18:
+ case fpu_zmm19:
+ case fpu_zmm20:
+ case fpu_zmm21:
+ case fpu_zmm22:
+ case fpu_zmm23:
+ case fpu_zmm24:
+ case fpu_zmm25:
+ case fpu_zmm26:
+ case fpu_zmm27:
+ case fpu_zmm28:
+ case fpu_zmm29:
+ case fpu_zmm30:
+ case fpu_zmm31:
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmm16 + (reg - fpu_zmm16),
+ &value->value.uint8, 64);
+ return true;
}
break;
@@ -2049,7 +2571,12 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
uint32_t DNBArchImplX86_64::GetRegisterContextSize() {
static uint32_t g_cached_size = 0;
if (g_cached_size == 0) {
- if (CPUHasAVX() || FORCE_AVX_REGS) {
+ if (CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < k_num_fpu_registers_avx512f; ++i) {
+ if (g_fpu_registers_avx512f[i].value_regs == NULL)
+ g_cached_size += g_fpu_registers_avx512f[i].size;
+ }
+ } else if (CPUHasAVX() || FORCE_AVX_REGS) {
for (size_t i = 0; i < k_num_fpu_registers_avx; ++i) {
if (g_fpu_registers_avx[i].value_regs == NULL)
g_cached_size += g_fpu_registers_avx[i].size;
@@ -2106,7 +2633,9 @@ nub_size_t DNBArchImplX86_64::GetRegisterContext(void *buf,
// Walk around the gaps in the FPU regs
memcpy(p, &m_state.context.fpu.no_avx.__fpu_fcw, 5);
- p += 5;
+ // We read 5 bytes, but we skip 6 to account for __fpu_rsrv1
+ // to match the g_fpu_registers_* tables.
+ p += 6;
memcpy(p, &m_state.context.fpu.no_avx.__fpu_fop, 8);
p += 8;
memcpy(p, &m_state.context.fpu.no_avx.__fpu_dp, 6);
@@ -2121,6 +2650,13 @@ nub_size_t DNBArchImplX86_64::GetRegisterContext(void *buf,
p += 10;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(p, &m_state.context.fpu.avx512f.__fpu_k0 + i, 8);
+ p += 8;
+ }
+ }
+
if (CPUHasAVX() || FORCE_AVX_REGS) {
// Interleave the XMM and YMMH registers to make the YMM registers
for (size_t i = 0; i < 16; ++i) {
@@ -2129,6 +2665,16 @@ nub_size_t DNBArchImplX86_64::GetRegisterContext(void *buf,
memcpy(p, &m_state.context.fpu.avx.__fpu_ymmh0 + i, 16);
p += 16;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 16; ++i) {
+ memcpy(p, &m_state.context.fpu.avx512f.__fpu_zmmh0 + i, 32);
+ p += 32;
+ }
+ for (size_t i = 0; i < 16; ++i) {
+ memcpy(p, &m_state.context.fpu.avx512f.__fpu_zmm16 + i, 64);
+ p += 64;
+ }
+ }
} else {
// Copy the XMM registers in a single block
memcpy(p, &m_state.context.fpu.no_avx.__fpu_xmm0, 16 * 16);
@@ -2171,7 +2717,9 @@ nub_size_t DNBArchImplX86_64::SetRegisterContext(const void *buf,
// Copy fcw through mxcsrmask as there is no padding
memcpy(&m_state.context.fpu.no_avx.__fpu_fcw, p, 5);
- p += 5;
+ // We wrote 5 bytes, but we skip 6 to account for __fpu_rsrv1
+ // to match the g_fpu_registers_* tables.
+ p += 6;
memcpy(&m_state.context.fpu.no_avx.__fpu_fop, p, 8);
p += 8;
memcpy(&m_state.context.fpu.no_avx.__fpu_dp, p, 6);
@@ -2186,6 +2734,13 @@ nub_size_t DNBArchImplX86_64::SetRegisterContext(const void *buf,
p += 10;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 8; ++i) {
+ memcpy(&m_state.context.fpu.avx512f.__fpu_k0 + i, p, 8);
+ p += 8;
+ }
+ }
+
if (CPUHasAVX() || FORCE_AVX_REGS) {
// Interleave the XMM and YMMH registers to make the YMM registers
for (size_t i = 0; i < 16; ++i) {
@@ -2194,6 +2749,16 @@ nub_size_t DNBArchImplX86_64::SetRegisterContext(const void *buf,
memcpy(&m_state.context.fpu.avx.__fpu_ymmh0 + i, p, 16);
p += 16;
}
+ if(CPUHasAVX512f() || FORCE_AVX_REGS) {
+ for (size_t i = 0; i < 16; ++i) {
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmmh0 + i, p, 32);
+ p += 32;
+ }
+ for (size_t i = 0; i < 16; ++i) {
+ memcpy(&m_state.context.fpu.avx512f.__fpu_zmm16 + i, p, 64);
+ p += 64;
+ }
+ }
} else {
// Copy the XMM registers in a single block
memcpy(&m_state.context.fpu.no_avx.__fpu_xmm0, p, 16 * 16);
diff --git a/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h b/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
index 1b8a3c7da4b5..ef2ba1ee09a6 100644
--- a/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
+++ b/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.h
@@ -82,6 +82,12 @@ protected:
static const size_t k_num_all_registers_avx;
static const size_t k_num_register_sets;
+ typedef __x86_64_avx512f_state_t AVX512F;
+ static const DNBRegisterInfo g_fpu_registers_avx512f[];
+ static const DNBRegisterSetInfo g_reg_sets_avx512f[];
+ static const size_t k_num_fpu_registers_avx512f;
+ static const size_t k_num_all_registers_avx512f;
+
typedef enum RegisterSetTag {
e_regSetALL = REGISTER_SET_ALL,
e_regSetGPR,
@@ -96,6 +102,7 @@ protected:
e_regSetWordSizeFPU = sizeof(FPU) / sizeof(int),
e_regSetWordSizeEXC = sizeof(EXC) / sizeof(int),
e_regSetWordSizeAVX = sizeof(AVX) / sizeof(int),
+ e_regSetWordSizeAVX512f = sizeof(AVX512F) / sizeof(int),
e_regSetWordSizeDBG = sizeof(DBG) / sizeof(int)
} RegisterSetWordSize;
@@ -106,6 +113,7 @@ protected:
union {
FPU no_avx;
AVX avx;
+ AVX512F avx512f;
} fpu;
EXC exc;
DBG dbg;
diff --git a/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h b/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h
index 60e61262ab69..fcb648dac59e 100644
--- a/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h
+++ b/tools/debugserver/source/MacOSX/x86_64/MachRegisterStatesX86_64.h
@@ -22,6 +22,7 @@
#define __x86_64_EXCEPTION_STATE 6
#define __x86_64_DEBUG_STATE 11
#define __x86_64_AVX_STATE 17
+#define __x86_64_AVX512F_STATE 20
typedef struct {
uint64_t __rax;
@@ -188,6 +189,111 @@ typedef struct {
__x86_64_xmm_reg __fpu_ymmh15;
} __x86_64_avx_state_t;
+typedef struct { uint8_t __ymm_reg[32]; } __x86_64_ymm_reg;
+typedef struct { uint8_t __zmm_reg[64]; } __x86_64_zmm_reg;
+typedef struct { uint8_t __opmask_reg[8]; } __x86_64_opmask_reg;
+
+typedef struct {
+ uint32_t __fpu_reserved[2];
+ __x86_64_fp_control_t __fpu_fcw;
+ __x86_64_fp_status_t __fpu_fsw;
+ uint8_t __fpu_ftw;
+ uint8_t __fpu_rsrv1;
+ uint16_t __fpu_fop;
+ uint32_t __fpu_ip;
+ uint16_t __fpu_cs;
+ uint16_t __fpu_rsrv2;
+ uint32_t __fpu_dp;
+ uint16_t __fpu_ds;
+ uint16_t __fpu_rsrv3;
+ uint32_t __fpu_mxcsr;
+ uint32_t __fpu_mxcsrmask;
+ __x86_64_mmst_reg __fpu_stmm0;
+ __x86_64_mmst_reg __fpu_stmm1;
+ __x86_64_mmst_reg __fpu_stmm2;
+ __x86_64_mmst_reg __fpu_stmm3;
+ __x86_64_mmst_reg __fpu_stmm4;
+ __x86_64_mmst_reg __fpu_stmm5;
+ __x86_64_mmst_reg __fpu_stmm6;
+ __x86_64_mmst_reg __fpu_stmm7;
+ __x86_64_xmm_reg __fpu_xmm0;
+ __x86_64_xmm_reg __fpu_xmm1;
+ __x86_64_xmm_reg __fpu_xmm2;
+ __x86_64_xmm_reg __fpu_xmm3;
+ __x86_64_xmm_reg __fpu_xmm4;
+ __x86_64_xmm_reg __fpu_xmm5;
+ __x86_64_xmm_reg __fpu_xmm6;
+ __x86_64_xmm_reg __fpu_xmm7;
+ __x86_64_xmm_reg __fpu_xmm8;
+ __x86_64_xmm_reg __fpu_xmm9;
+ __x86_64_xmm_reg __fpu_xmm10;
+ __x86_64_xmm_reg __fpu_xmm11;
+ __x86_64_xmm_reg __fpu_xmm12;
+ __x86_64_xmm_reg __fpu_xmm13;
+ __x86_64_xmm_reg __fpu_xmm14;
+ __x86_64_xmm_reg __fpu_xmm15;
+ uint8_t __fpu_rsrv4[6 * 16];
+ uint32_t __fpu_reserved1;
+ uint8_t __avx_reserved1[64];
+ __x86_64_xmm_reg __fpu_ymmh0;
+ __x86_64_xmm_reg __fpu_ymmh1;
+ __x86_64_xmm_reg __fpu_ymmh2;
+ __x86_64_xmm_reg __fpu_ymmh3;
+ __x86_64_xmm_reg __fpu_ymmh4;
+ __x86_64_xmm_reg __fpu_ymmh5;
+ __x86_64_xmm_reg __fpu_ymmh6;
+ __x86_64_xmm_reg __fpu_ymmh7;
+ __x86_64_xmm_reg __fpu_ymmh8;
+ __x86_64_xmm_reg __fpu_ymmh9;
+ __x86_64_xmm_reg __fpu_ymmh10;
+ __x86_64_xmm_reg __fpu_ymmh11;
+ __x86_64_xmm_reg __fpu_ymmh12;
+ __x86_64_xmm_reg __fpu_ymmh13;
+ __x86_64_xmm_reg __fpu_ymmh14;
+ __x86_64_xmm_reg __fpu_ymmh15;
+ __x86_64_opmask_reg __fpu_k0;
+ __x86_64_opmask_reg __fpu_k1;
+ __x86_64_opmask_reg __fpu_k2;
+ __x86_64_opmask_reg __fpu_k3;
+ __x86_64_opmask_reg __fpu_k4;
+ __x86_64_opmask_reg __fpu_k5;
+ __x86_64_opmask_reg __fpu_k6;
+ __x86_64_opmask_reg __fpu_k7;
+ __x86_64_ymm_reg __fpu_zmmh0;
+ __x86_64_ymm_reg __fpu_zmmh1;
+ __x86_64_ymm_reg __fpu_zmmh2;
+ __x86_64_ymm_reg __fpu_zmmh3;
+ __x86_64_ymm_reg __fpu_zmmh4;
+ __x86_64_ymm_reg __fpu_zmmh5;
+ __x86_64_ymm_reg __fpu_zmmh6;
+ __x86_64_ymm_reg __fpu_zmmh7;
+ __x86_64_ymm_reg __fpu_zmmh8;
+ __x86_64_ymm_reg __fpu_zmmh9;
+ __x86_64_ymm_reg __fpu_zmmh10;
+ __x86_64_ymm_reg __fpu_zmmh11;
+ __x86_64_ymm_reg __fpu_zmmh12;
+ __x86_64_ymm_reg __fpu_zmmh13;
+ __x86_64_ymm_reg __fpu_zmmh14;
+ __x86_64_ymm_reg __fpu_zmmh15;
+ __x86_64_zmm_reg __fpu_zmm16;
+ __x86_64_zmm_reg __fpu_zmm17;
+ __x86_64_zmm_reg __fpu_zmm18;
+ __x86_64_zmm_reg __fpu_zmm19;
+ __x86_64_zmm_reg __fpu_zmm20;
+ __x86_64_zmm_reg __fpu_zmm21;
+ __x86_64_zmm_reg __fpu_zmm22;
+ __x86_64_zmm_reg __fpu_zmm23;
+ __x86_64_zmm_reg __fpu_zmm24;
+ __x86_64_zmm_reg __fpu_zmm25;
+ __x86_64_zmm_reg __fpu_zmm26;
+ __x86_64_zmm_reg __fpu_zmm27;
+ __x86_64_zmm_reg __fpu_zmm28;
+ __x86_64_zmm_reg __fpu_zmm29;
+ __x86_64_zmm_reg __fpu_zmm30;
+ __x86_64_zmm_reg __fpu_zmm31;
+
+} __x86_64_avx512f_state_t;
+
typedef struct {
uint32_t __trapno;
uint32_t __err;
diff --git a/tools/debugserver/source/RNBRemote.cpp b/tools/debugserver/source/RNBRemote.cpp
index 0a2eef3feacd..8ba06be1d6ad 100644
--- a/tools/debugserver/source/RNBRemote.cpp
+++ b/tools/debugserver/source/RNBRemote.cpp
@@ -4651,6 +4651,8 @@ rnb_err_t RNBRemote::HandlePacket_qHostInfo(const char *p) {
strm << "ostype:tvos;";
#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
strm << "ostype:watchos;";
+#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
+ strm << "ostype:bridgeos;";
#else
strm << "ostype:ios;";
#endif
@@ -4981,6 +4983,13 @@ void UpdateTargetXML() {
s << g_target_xml_header << std::endl;
// Set the architecture
+ //
+ // On raw targets (no OS, vendor info), I've seen replies like
+ // <architecture>i386:x86-64</architecture> (for x86_64 systems - from vmware)
+ // <architecture>arm</architecture> (for an unspecified arm device - from a Segger JLink)
+ // For good interop, I'm not sure what's expected here. e.g. will anyone understand
+ // <architecture>x86_64</architecture> ? Or is i386:x86_64 the expected phrasing?
+ //
// s << "<architecture>" << arch "</architecture>" << std::endl;
// Set the OSABI
@@ -5437,11 +5446,6 @@ rnb_err_t RNBRemote::HandlePacket_jThreadExtendedInfo(const char *p) {
p);
uint64_t dti_qos_class_index =
get_integer_value_for_key_name_from_json("dti_qos_class_index", p);
- // Commented out the two variables below as they are not being used
- // uint64_t dti_queue_index =
- // get_integer_value_for_key_name_from_json ("dti_queue_index", p);
- // uint64_t dti_voucher_index =
- // get_integer_value_for_key_name_from_json ("dti_voucher_index", p);
if (tid != INVALID_NUB_ADDRESS) {
nub_addr_t pthread_t_value = DNBGetPThreadT(pid, tid);
@@ -6082,49 +6086,21 @@ rnb_err_t RNBRemote::HandlePacket_qProcessInfo(const char *p) {
for (uint32_t i = 0; i < mh.ncmds && !os_handled; ++i) {
const nub_size_t bytes_read =
DNBProcessMemoryRead(pid, load_command_addr, sizeof(lc), &lc);
- uint32_t raw_cmd = lc.cmd & ~LC_REQ_DYLD;
- if (bytes_read != sizeof(lc))
- break;
- switch (raw_cmd) {
- case LC_VERSION_MIN_IPHONEOS:
- os_handled = true;
- rep << "ostype:ios;";
- DNBLogThreadedIf(LOG_RNB_PROC,
- "LC_VERSION_MIN_IPHONEOS -> 'ostype:ios;'");
- break;
+ (void)bytes_read;
- case LC_VERSION_MIN_MACOSX:
+ uint32_t major_version, minor_version, patch_version;
+ auto *platform = DNBGetDeploymentInfo(pid, lc, load_command_addr,
+ major_version, minor_version,
+ patch_version);
+ if (platform) {
os_handled = true;
- rep << "ostype:macosx;";
- DNBLogThreadedIf(LOG_RNB_PROC,
- "LC_VERSION_MIN_MACOSX -> 'ostype:macosx;'");
- break;
-
-#if defined(LC_VERSION_MIN_TVOS)
- case LC_VERSION_MIN_TVOS:
- os_handled = true;
- rep << "ostype:tvos;";
- DNBLogThreadedIf(LOG_RNB_PROC,
- "LC_VERSION_MIN_TVOS -> 'ostype:tvos;'");
- break;
-#endif
-
-#if defined(LC_VERSION_MIN_WATCHOS)
- case LC_VERSION_MIN_WATCHOS:
- os_handled = true;
- rep << "ostype:watchos;";
- DNBLogThreadedIf(LOG_RNB_PROC,
- "LC_VERSION_MIN_WATCHOS -> 'ostype:watchos;'");
- break;
-#endif
-
- default:
+ rep << "ostype:" << platform << ";";
break;
}
load_command_addr = load_command_addr + lc.cmdsize;
}
}
-#endif
+#endif // when compiling this on x86 targets
}
// If we weren't able to find the OS in a LC_VERSION_MIN load command, try
@@ -6138,6 +6114,8 @@ rnb_err_t RNBRemote::HandlePacket_qProcessInfo(const char *p) {
rep << "ostype:tvos;";
#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
rep << "ostype:watchos;";
+#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
+ rep << "ostype:bridgeos;";
#else
rep << "ostype:ios;";
#endif
@@ -6189,6 +6167,8 @@ rnb_err_t RNBRemote::HandlePacket_qProcessInfo(const char *p) {
rep << "ostype:tvos;";
#elif defined(TARGET_OS_WATCH) && TARGET_OS_WATCH == 1
rep << "ostype:watchos;";
+#elif defined(TARGET_OS_BRIDGE) && TARGET_OS_BRIDGE == 1
+ rep << "ostype:bridgeos;";
#else
rep << "ostype:ios;";
#endif
diff --git a/tools/debugserver/source/RNBServices.cpp b/tools/debugserver/source/RNBServices.cpp
index 9f90f349f3af..b2f4910f8855 100644
--- a/tools/debugserver/source/RNBServices.cpp
+++ b/tools/debugserver/source/RNBServices.cpp
@@ -80,7 +80,7 @@ int GetProcesses(CFMutableArrayRef plistMutableArray, bool all_users) {
::CFDictionarySetValue(appInfoDict.get(), DTSERVICES_APP_PID_KEY,
pidCFNumber.get());
- // Set the a boolean to indicate if this is the front most
+ // Set a boolean to indicate if this is the front most
::CFDictionarySetValue(appInfoDict.get(), DTSERVICES_APP_FRONTMOST_KEY,
kCFBooleanFalse);
@@ -169,7 +169,7 @@ int ListApplications(std::string &plist, bool opt_runningApps,
pidCFNumber.get());
}
- // Set the a boolean to indicate if this is the front most
+ // Set a boolean to indicate if this is the front most
if (sbsFrontAppID.get() && displayIdentifier &&
(::CFStringCompare(sbsFrontAppID.get(), displayIdentifier, 0) ==
kCFCompareEqualTo))
diff --git a/tools/debugserver/source/com.apple.internal.xpc.remote.debugserver.plist b/tools/debugserver/source/com.apple.internal.xpc.remote.debugserver.plist
new file mode 100644
index 000000000000..837ebe7b59ad
--- /dev/null
+++ b/tools/debugserver/source/com.apple.internal.xpc.remote.debugserver.plist
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>Label</key>
+ <string>com.apple.internal.xpc.remote.debugserver</string>
+ <key>RemoteServices</key>
+ <dict>
+ <key>com.apple.internal.debugserver</key>
+ <dict>
+ <key>RequireEntitlement</key>
+ <string>AppleInternal</string>
+ <key>ExposedToUntrustedDevices</key>
+ <true/>
+ </dict>
+ </dict>
+ <key>ProgramArguments</key>
+ <array>
+ <string>/usr/libexec/remotectl</string>
+ <string>trampoline</string>
+ <string>-2</string>
+ <string>42</string>
+ <string>com.apple.internal.debugserver</string>
+ <string>/usr/local/bin/debugserver-nonui</string>
+ <string>--fd</string>
+ <string>42</string>
+ </array>
+ <key>POSIXSpawnType</key>
+ <string>Interactive</string>
+ <key>EnableTransactions</key>
+ <true/>
+ <key>EnablePressuredExit</key>
+ <true/>
+</dict>
+</plist>
diff --git a/tools/debugserver/source/debugserver-entitlements.plist b/tools/debugserver/source/debugserver-entitlements.plist
index 4134ee958613..7f1ae4615019 100644
--- a/tools/debugserver/source/debugserver-entitlements.plist
+++ b/tools/debugserver/source/debugserver-entitlements.plist
@@ -24,5 +24,9 @@
<true/>
<key>com.apple.security.network.client</key>
<true/>
+ <key>com.apple.private.memorystatus</key>
+ <true/>
+ <key>com.apple.private.cs.debugger</key>
+ <true/>
</dict>
</plist>
diff --git a/tools/debugserver/source/debugserver-macosx-entitlements.plist b/tools/debugserver/source/debugserver-macosx-entitlements.plist
index eddbaa0063ef..92a0d13fc781 100644
--- a/tools/debugserver/source/debugserver-macosx-entitlements.plist
+++ b/tools/debugserver/source/debugserver-macosx-entitlements.plist
@@ -4,5 +4,7 @@
<dict>
<key>com.apple.diagnosticd.diagnostic</key>
<true/>
+ <key>com.apple.private.cs.debugger</key>
+ <true/>
</dict>
</plist>
diff --git a/tools/driver/CMakeLists.txt b/tools/driver/CMakeLists.txt
index 1fac2e5d1687..9e01a6b67ea2 100644
--- a/tools/driver/CMakeLists.txt
+++ b/tools/driver/CMakeLists.txt
@@ -24,12 +24,4 @@ if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
add_definitions( -DIMPORT_LIBLLDB )
endif()
-# Add lldb dependency on lldb-server if we can use it.
-if ( LLDB_CAN_USE_LLDB_SERVER )
- add_dependencies(lldb lldb-server)
-endif()
-
-# Add lldb dependency on debugserver if we can use it.
-if ( LLDB_CAN_USE_DEBUGSERVER )
- add_dependencies(lldb debugserver)
-endif()
+add_dependencies(lldb ${LLDB_SUITE_TARGET})
diff --git a/tools/driver/Driver.cpp b/tools/driver/Driver.cpp
index 7e1dec7a34fa..f3391a55e0d1 100644
--- a/tools/driver/Driver.cpp
+++ b/tools/driver/Driver.cpp
@@ -41,7 +41,10 @@
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBTarget.h"
#include "lldb/API/SBThread.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ConvertUTF.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
#include <thread>
#if !defined(__APPLE__)
@@ -866,7 +869,6 @@ SBError Driver::ParseArgs(int argc, const char *argv[], FILE *out_fh,
} else {
// Skip any options we consumed with getopt_long_only
argc -= optind;
- // argv += optind; // Commented out to keep static analyzer happy
if (argc > 0)
::fprintf(out_fh,
@@ -963,7 +965,7 @@ std::string EscapeString(std::string arg) {
return '"' + arg + '"';
}
-void Driver::MainLoop() {
+int Driver::MainLoop() {
if (::tcgetattr(STDIN_FILENO, &g_old_stdin_termios) == 0) {
g_old_stdin_termios_is_valid = true;
atexit(reset_stdin_termios);
@@ -1002,6 +1004,10 @@ void Driver::MainLoop() {
result.PutOutput(m_debugger.GetOutputFileHandle());
}
+ // We allow the user to specify an exit code when calling quit which we will
+ // return when exiting.
+ m_debugger.GetCommandInterpreter().AllowExitCodeOnQuit(true);
+
// Now we handle options we got from the command line
SBStream commands_stream;
@@ -1160,7 +1166,9 @@ void Driver::MainLoop() {
reset_stdin_termios();
fclose(stdin);
+ int exit_code = sb_interpreter.GetQuitStatus();
SBDebugger::Destroy(m_debugger);
+ return exit_code;
}
void Driver::ResizeWindow(unsigned short col) {
@@ -1226,6 +1234,10 @@ main(int argc, char const *argv[])
const char **argv = argvPointers.data();
#endif
+ llvm::StringRef ToolName = argv[0];
+ llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
+ llvm::PrettyStackTraceProgram X(argc, argv);
+
SBDebugger::Initialize();
SBHostOS::ThreadCreated("<lldb.driver.main-thread>");
@@ -1238,6 +1250,7 @@ main(int argc, char const *argv[])
signal(SIGCONT, sigcont_handler);
#endif
+ int exit_code = 0;
// Create a scope for driver so that the driver object will destroy itself
// before SBDebugger::Terminate() is called.
{
@@ -1246,14 +1259,15 @@ main(int argc, char const *argv[])
bool exiting = false;
SBError error(driver.ParseArgs(argc, argv, stdout, exiting));
if (error.Fail()) {
+ exit_code = 1;
const char *error_cstr = error.GetCString();
if (error_cstr)
::fprintf(stderr, "error: %s\n", error_cstr);
} else if (!exiting) {
- driver.MainLoop();
+ exit_code = driver.MainLoop();
}
}
SBDebugger::Terminate();
- return 0;
+ return exit_code;
}
diff --git a/tools/driver/Driver.h b/tools/driver/Driver.h
index 2be697ccc44c..34746a239999 100644
--- a/tools/driver/Driver.h
+++ b/tools/driver/Driver.h
@@ -37,7 +37,10 @@ public:
virtual ~Driver();
- void MainLoop();
+ /// Runs the main loop.
+ ///
+ /// @return The exit code that the process should return.
+ int MainLoop();
lldb::SBError ParseArgs(int argc, const char *argv[], FILE *out_fh,
bool &do_exit);
diff --git a/tools/intel-features/intel-pt/Decoder.h b/tools/intel-features/intel-pt/Decoder.h
index dc2794ac3bc3..3762196058fd 100644
--- a/tools/intel-features/intel-pt/Decoder.h
+++ b/tools/intel-features/intel-pt/Decoder.h
@@ -33,7 +33,7 @@
namespace ptdecoder_private {
//----------------------------------------------------------------------
/// @class Instruction
-/// @brief Represents an assembly instruction containing raw
+/// Represents an assembly instruction containing raw
/// instruction bytes, instruction address along with information
/// regarding execution flow context and Intel(R) Processor Trace
/// context.
@@ -83,7 +83,7 @@ private:
//---------------------------------------------------------------------------
/// @class InstructionList
-/// @brief Represents a list of assembly instructions. Each instruction is of
+/// Represents a list of assembly instructions. Each instruction is of
/// type Instruction.
//---------------------------------------------------------------------------
class InstructionList {
@@ -113,7 +113,7 @@ private:
//----------------------------------------------------------------------
/// @class TraceOptions
-/// @brief Provides Intel(R) Processor Trace specific configuration options and
+/// Provides Intel(R) Processor Trace specific configuration options and
/// other information obtained by decoding and post-processing the trace
/// data. Currently, this information comprises of the total number of
/// assembly instructions executed for an inferior.
@@ -147,7 +147,7 @@ private:
//----------------------------------------------------------------------
/// @class Decoder
-/// @brief This class makes use of Intel(R) Processor Trace hardware feature
+/// This class makes use of Intel(R) Processor Trace hardware feature
/// (implememted inside LLDB) to gather trace data for an inferior (being
/// debugged with LLDB) to provide meaningful information out of it.
///
diff --git a/tools/intel-features/intel-pt/PTDecoder.h b/tools/intel-features/intel-pt/PTDecoder.h
index 9eb92745a863..8af8c8672b18 100644
--- a/tools/intel-features/intel-pt/PTDecoder.h
+++ b/tools/intel-features/intel-pt/PTDecoder.h
@@ -33,7 +33,7 @@ namespace ptdecoder {
//----------------------------------------------------------------------
/// @class PTInstruction
-/// @brief Represents an assembly instruction containing raw
+/// Represents an assembly instruction containing raw
/// instruction bytes, instruction address along with information
/// regarding execution flow context and Intel(R) Processor Trace
/// context.
@@ -85,7 +85,7 @@ private:
//---------------------------------------------------------------------------
/// @class PTInstructionList
-/// @brief Represents a list of assembly instructions. Each instruction is of
+/// Represents a list of assembly instructions. Each instruction is of
/// type PTInstruction.
//---------------------------------------------------------------------------
class PTInstructionList {
@@ -114,7 +114,7 @@ private:
//----------------------------------------------------------------------
/// @class PTTraceOptions
-/// @brief Provides configuration options like trace type, trace buffer size,
+/// Provides configuration options like trace type, trace buffer size,
/// meta data buffer size along with other Intel(R) Processor Trace
/// specific options.
//----------------------------------------------------------------------
@@ -134,9 +134,9 @@ public:
//------------------------------------------------------------------
/// Get Intel(R) Processor Trace specific configuration options (apart from
- /// trace buffer size, meta data buffer size and TraceType) formatted as json
- /// text i.e. {"Name":Value,"Name":Value} pairs, where "Value" is a 64-bit
- /// unsigned integer in hex format. For "Name", please refer to
+ /// trace buffer size, meta data buffer size and TraceType) formatted as
+ /// json text i.e. {"Name":Value,"Name":Value} pairs, where "Value" is a
+ /// 64-bit unsigned integer in hex format. For "Name", please refer to
/// SBProcess::StartTrace API description for setting SBTraceOptions.
///
/// @return
@@ -154,7 +154,7 @@ private:
//----------------------------------------------------------------------
/// @class PTDecoder
-/// @brief This class makes use of Intel(R) Processor Trace hardware feature
+/// This class makes use of Intel(R) Processor Trace hardware feature
/// (implememted inside LLDB) to gather trace data for an inferior (being
/// debugged with LLDB) to provide meaningful information out of it.
///
diff --git a/tools/lldb-mi/MICmdBase.cpp b/tools/lldb-mi/MICmdBase.cpp
index cd5bf27c73fe..613f005cf754 100644
--- a/tools/lldb-mi/MICmdBase.cpp
+++ b/tools/lldb-mi/MICmdBase.cpp
@@ -214,6 +214,64 @@ void CMICmdBase::SetError(const CMIUtilString &rErrMsg) {
//++
//------------------------------------------------------------------------------------
+// Details: Short cut function to check MI command's execute status and
+// set an error in case of failure.
+// Type: Method.
+// Args: error - (R) Error description object.
+// successHandler - (R) function describing actions to execute
+// in case of success state of passed SBError object.
+// errorHandler - (R) function describing actions to execute
+// in case of fail status of passed SBError object.
+// Return: bool.
+// Throws: None.
+//--
+bool CMICmdBase::HandleSBError(const lldb::SBError &error,
+ const std::function<bool()> &successHandler,
+ const std::function<void()> &errorHandler) {
+ if (error.Success())
+ return successHandler();
+
+ SetError(error.GetCString());
+ errorHandler();
+ return MIstatus::failure;
+}
+
+//++
+//------------------------------------------------------------------------------------
+// Details: Short cut function to check MI command's execute status and
+// call specified handler function for success case.
+// Type: Method.
+// Args: error - (R) Error description object.
+// successHandler - (R) function describing actions to execute
+// in case of success state of passed SBError object.
+// Return: bool.
+// Throws: None.
+//--
+bool CMICmdBase::HandleSBErrorWithSuccess(
+ const lldb::SBError &error,
+ const std::function<bool()> &successHandler) {
+ return HandleSBError(error, successHandler);
+}
+
+//++
+//------------------------------------------------------------------------------------
+// Details: Short cut function to check MI command's execute status and
+// call specified handler function for error case.
+// Type: Method.
+// Args: error - (R) Error description object.
+// errorHandler - (R) function describing actions to execute
+// in case of fail status of passed SBError object.
+// Return: bool.
+// Throws: None.
+//--
+bool CMICmdBase::HandleSBErrorWithFailure(
+ const lldb::SBError &error,
+ const std::function<void()> &errorHandler) {
+ return HandleSBError(error, [] { return MIstatus::success; }, errorHandler);
+}
+
+//++
+//------------------------------------------------------------------------------------
// Details: Ask a command to provide its unique identifier.
// Type: Method.
// Args: A unique identifier for this command class.
diff --git a/tools/lldb-mi/MICmdBase.h b/tools/lldb-mi/MICmdBase.h
index 66f9fa6ee5d7..cb44504a1613 100644
--- a/tools/lldb-mi/MICmdBase.h
+++ b/tools/lldb-mi/MICmdBase.h
@@ -11,7 +11,11 @@
// C Includes
// C++ Includes
+#include <functional> // for function
+
// Other libraries and framework includes
+#include "lldb/API/SBError.h"
+
// Project includes
#include "MICmdArgSet.h"
#include "MICmdData.h"
@@ -80,6 +84,14 @@ public:
// Methods:
protected:
void SetError(const CMIUtilString &rErrMsg);
+ bool HandleSBError(const lldb::SBError &error,
+ const std::function<bool()> &successHandler =
+ [] { return MIstatus::success; },
+ const std::function<void()> &errorHandler = [] {});
+ bool HandleSBErrorWithSuccess(const lldb::SBError &error,
+ const std::function<bool()> &successHandler);
+ bool HandleSBErrorWithFailure(const lldb::SBError &error,
+ const std::function<void()> &errorHandler);
template <class T> T *GetOption(const CMIUtilString &vStrOptionName);
bool ParseValidateCmdOptions();
diff --git a/tools/lldb-mi/MICmdCmdBreak.cpp b/tools/lldb-mi/MICmdCmdBreak.cpp
index 020ac982d11a..caad9192366f 100644
--- a/tools/lldb-mi/MICmdCmdBreak.cpp
+++ b/tools/lldb-mi/MICmdCmdBreak.cpp
@@ -148,6 +148,11 @@ bool CMICmdCmdBreakInsert::Execute() {
CMICMDBASE_GETOPTION(pArgRestrictBrkPtToThreadId, OptionShort,
m_constStrArgNamedRestrictBrkPtToThreadId);
+ // Ask LLDB for the target to check if we have valid or dummy one.
+ CMICmnLLDBDebugSessionInfo &rSessionInfo(
+ CMICmnLLDBDebugSessionInfo::Instance());
+ lldb::SBTarget sbTarget = rSessionInfo.GetTarget();
+
m_bBrkPtEnabled = !pArgDisableBrkPt->GetFound();
m_bBrkPtIsTemp = pArgTempBrkPt->GetFound();
m_bHaveArgOptionThreadGrp = pArgThreadGroup->GetFound();
@@ -157,7 +162,12 @@ bool CMICmdCmdBreakInsert::Execute() {
nThreadGrp);
m_strArgOptionThreadGrp = CMIUtilString::Format("i%d", nThreadGrp);
}
- m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
+
+ if (sbTarget == rSessionInfo.GetDebugger().GetDummyTarget())
+ m_bBrkPtIsPending = true;
+ else
+ m_bBrkPtIsPending = pArgPendingBrkPt->GetFound();
+
if (pArgLocation->GetFound())
m_brkName = pArgLocation->GetValue();
else if (m_bBrkPtIsPending) {
@@ -225,9 +235,6 @@ bool CMICmdCmdBreakInsert::Execute() {
// Ask LLDB to create a breakpoint
bool bOk = MIstatus::success;
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBTarget sbTarget = rSessionInfo.GetTarget();
switch (eBrkPtType) {
case eBreakPoint_ByAddress:
m_brkPt = sbTarget.BreakpointCreateByAddress(nAddress);
diff --git a/tools/lldb-mi/MICmdCmdData.cpp b/tools/lldb-mi/MICmdCmdData.cpp
index 729ab3970cf1..53c2d7e621a7 100644
--- a/tools/lldb-mi/MICmdCmdData.cpp
+++ b/tools/lldb-mi/MICmdCmdData.cpp
@@ -19,15 +19,14 @@
// CMICmdCmdDataInfoLine implementation.
// Third Party Headers:
-#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBInstruction.h"
#include "lldb/API/SBInstructionList.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBThread.h"
-#include "llvm/ADT/SmallVector.h"
+#include "llvm/ADT/Twine.h"
#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Regex.h"
#include <inttypes.h> // For PRIx64
+#include <string>
// In-house headers:
#include "MICmdArgValConsume.h"
@@ -45,6 +44,13 @@
#include "MICmnLLDBUtilSBValue.h"
#include "MICmnMIResultRecord.h"
#include "MICmnMIValueConst.h"
+#include "Platform.h"
+
+namespace {
+CMIUtilString IntToHexAddrStr(uint32_t number) {
+ return CMIUtilString("0x" + llvm::Twine::utohexstr(number).str());
+}
+} // namespace
//++
//------------------------------------------------------------------------------------
@@ -1588,7 +1594,9 @@ CMICmdBase *CMICmdCmdDataWriteMemory::CreateSelf() {
// Throws: None.
//--
CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine()
- : m_constStrArgLocation("location") {
+ : m_constStrArgLocation("location"),
+ m_resultRecord(m_cmdData.strMiCmdToken,
+ CMICmnMIResultRecord::eResultClass_Done) {
// Command factory matches this name with that received from the stdin stream
m_strMiCmd = "data-info-line";
@@ -1604,7 +1612,7 @@ CMICmdCmdDataInfoLine::CMICmdCmdDataInfoLine()
// Return: None.
// Throws: None.
//--
-CMICmdCmdDataInfoLine::~CMICmdCmdDataInfoLine() {}
+CMICmdCmdDataInfoLine::~CMICmdCmdDataInfoLine() = default;
//++
//------------------------------------------------------------------------------------
@@ -1637,98 +1645,84 @@ bool CMICmdCmdDataInfoLine::ParseArgs() {
bool CMICmdCmdDataInfoLine::Execute() {
CMICMDBASE_GETOPTION(pArgLocation, String, m_constStrArgLocation);
+ lldb::SBLineEntry line;
+ bool found_line = false;
const CMIUtilString &strLocation(pArgLocation->GetValue());
- CMIUtilString strCmdOptionsLocation;
+ lldb::SBTarget target = CMICmnLLDBDebugSessionInfo::Instance().GetTarget();
+
if (strLocation.at(0) == '*') {
// Parse argument:
// *0x12345
- // ^^^^^^^ -- address
- const CMIUtilString strAddress(strLocation.substr(1));
- strCmdOptionsLocation =
- CMIUtilString::Format("--address %s", strAddress.c_str());
+ // ^^^^^^^^^ -- address
+ lldb::addr_t address = 0x0;
+ if (llvm::StringRef(strLocation.substr(1)).getAsInteger(0, address)) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SOME_ERROR),
+ m_cmdData.strMiCmd.c_str(),
+ "Failed to parse address."));
+ return MIstatus::failure;
+ }
+ line = target.ResolveFileAddress(address).GetLineEntry();
+ // Check that found line is valid.
+ if (line.GetLine())
+ found_line = true;
} else {
const size_t nLineStartPos = strLocation.rfind(':');
if ((nLineStartPos == std::string::npos) || (nLineStartPos == 0) ||
(nLineStartPos == strLocation.length() - 1)) {
- SetError(
- CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_LOCATION_FORMAT),
- m_cmdData.strMiCmd.c_str(), strLocation.c_str())
- .c_str());
+ SetError(CMIUtilString::Format(
+ MIRSRC(IDS_CMD_ERR_INVALID_LOCATION_FORMAT),
+ m_cmdData.strMiCmd.c_str(), strLocation.c_str()));
return MIstatus::failure;
}
// Parse argument:
// hello.cpp:5
// ^^^^^^^^^ -- file
// ^ -- line
- const CMIUtilString strFile(strLocation.substr(0, nLineStartPos));
- const CMIUtilString strLine(strLocation.substr(nLineStartPos + 1));
- strCmdOptionsLocation =
- CMIUtilString::Format("--file \"%s\" --line %s",
- strFile.AddSlashes().c_str(), strLine.c_str());
+ const CMIUtilString &strFile(strLocation.substr(0, nLineStartPos));
+ uint32_t numLine = 0;
+ llvm::StringRef(strLocation.substr(nLineStartPos + 1))
+ .getAsInteger(0, numLine);
+ lldb::SBSymbolContextList sc_cu_list =
+ target.FindCompileUnits(lldb::SBFileSpec(strFile.c_str(), false));
+ for (uint32_t i = 0, e = sc_cu_list.GetSize(); i < e; ++i) {
+ const lldb::SBCompileUnit &cu =
+ sc_cu_list.GetContextAtIndex(i).GetCompileUnit();
+ // Break if we have already found requested line.
+ if (found_line)
+ break;
+ for (uint32_t j = 0, e = cu.GetNumLineEntries(); j < e; ++j) {
+ const lldb::SBLineEntry &curLine = cu.GetLineEntryAtIndex(j);
+ if (curLine.GetLine() == numLine) {
+ line = curLine;
+ found_line = true;
+ break;
+ }
+ }
+ }
}
- const CMIUtilString strCmd(CMIUtilString::Format(
- "target modules lookup -v %s", strCmdOptionsLocation.c_str()));
-
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- const lldb::ReturnStatus rtn =
- rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(
- strCmd.c_str(), m_lldbResult);
- MIunused(rtn);
-
- return MIstatus::success;
-}
-
-//++
-//------------------------------------------------------------------------------------
-// Details: Helper function for parsing a line entry returned from lldb for the
-// command:
-// target modules lookup -v <location>
-// where the line entry is of the format:
-// LineEntry: \[0x0000000100000f37-0x0000000100000f45\):
-// /path/file:3[:1]
-// start end file
-// line column(opt)
-// Args: input - (R) Input string to parse.
-// start - (W) String representing the start address.
-// end - (W) String representing the end address.
-// file - (W) String representing the file.
-// line - (W) String representing the line.
-// Return: bool - True = input was parsed successfully, false = input could not
-// be parsed.
-// Throws: None.
-//--
-static bool ParseLLDBLineEntry(const char *input, CMIUtilString &start,
- CMIUtilString &end, CMIUtilString &file,
- CMIUtilString &line) {
- // Note: Ambiguities arise because the column is optional, and
- // because : can appear in filenames or as a byte in a multibyte
- // UTF8 character. We keep those cases to a minimum by using regex
- // to work on the string from both the left and right, so that what
- // is remains is assumed to be the filename.
-
- // Match LineEntry using regex.
- static llvm::Regex g_lineentry_nocol_regex(llvm::StringRef(
- "^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"));
- static llvm::Regex g_lineentry_col_regex(
- llvm::StringRef("^ *LineEntry: \\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): "
- "(.+):([0-9]+):[0-9]+$"));
- // ^1=start ^2=end ^3=f
- // ^4=line ^5=:col(opt)
-
- llvm::SmallVector<llvm::StringRef, 6> match;
-
- // First try matching the LineEntry with the column,
- // then try without the column.
- const bool ok = g_lineentry_col_regex.match(input, &match) ||
- g_lineentry_nocol_regex.match(input, &match);
- if (ok) {
- start = match[1];
- end = match[2];
- file = match[3];
- line = match[4];
+ if (!found_line) {
+ SetError(CMIUtilString::Format(
+ MIRSRC(IDS_CMD_ERR_SOME_ERROR), m_cmdData.strMiCmd.c_str(),
+ "The LineEntry is absent or has an unknown format."));
+ return MIstatus::failure;
}
- return ok;
+ // Start address.
+ m_resultRecord.Add(CMICmnMIValueResult(
+ "start", CMICmnMIValueConst(IntToHexAddrStr(
+ line.GetStartAddress().GetFileAddress()))));
+ // End address.
+ m_resultRecord.Add(CMICmnMIValueResult(
+ "end", CMICmnMIValueConst(IntToHexAddrStr(
+ line.GetEndAddress().GetFileAddress()))));
+ // File.
+ std::unique_ptr<char[]> upPath(new char[PATH_MAX]);
+ line.GetFileSpec().GetPath(upPath.get(), PATH_MAX);
+ m_resultRecord.Add(CMICmnMIValueResult(
+ "file", CMICmnMIValueConst(CMIUtilString(upPath.get()))));
+ // Line.
+ m_resultRecord.Add(CMICmnMIValueResult(
+ "line", CMICmnMIValueConst(std::to_string(line.GetLine()))));
+ return MIstatus::success;
}
//++
@@ -1743,66 +1737,7 @@ static bool ParseLLDBLineEntry(const char *input, CMIUtilString &start,
// Throws: None.
//--
bool CMICmdCmdDataInfoLine::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("msg", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- return MIstatus::success;
- } else if (m_lldbResult.GetOutputSize() > 0) {
- CMIUtilString::VecString_t vecLines;
- const CMIUtilString strLldbMsg(m_lldbResult.GetOutput());
- const MIuint nLines(strLldbMsg.SplitLines(vecLines));
-
- for (MIuint i = 0; i < nLines; ++i) {
- // String looks like:
- // LineEntry: \[0x0000000100000f37-0x0000000100000f45\):
- // /path/to/file:3[:1]
- const CMIUtilString &rLine(vecLines[i]);
- CMIUtilString strStart;
- CMIUtilString strEnd;
- CMIUtilString strFile;
- CMIUtilString strLine;
-
- if (!ParseLLDBLineEntry(rLine.c_str(), strStart, strEnd, strFile,
- strLine))
- continue;
-
- const CMICmnMIValueConst miValueConst(strStart);
- const CMICmnMIValueResult miValueResult("start", miValueConst);
- CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done,
- miValueResult);
- const CMICmnMIValueConst miValueConst2(strEnd);
- const CMICmnMIValueResult miValueResult2("end", miValueConst2);
- miRecordResult.Add(miValueResult2);
- const CMICmnMIValueConst miValueConst3(strFile);
- const CMICmnMIValueResult miValueResult3("file", miValueConst3);
- miRecordResult.Add(miValueResult3);
- const CMICmnMIValueConst miValueConst4(strLine);
- const CMICmnMIValueResult miValueResult4("line", miValueConst4);
- miRecordResult.Add(miValueResult4);
-
- // MI print "%s^done,start=\"%d\",end=\"%d\"",file=\"%s\",line=\"%d\"
- m_miResultRecord = miRecordResult;
-
- return MIstatus::success;
- }
- }
-
- // MI print "%s^error,msg=\"Command '-data-info-line'. Error: The LineEntry is
- // absent or has an unknown format.\""
- const CMICmnMIValueConst miValueConst(CMIUtilString::Format(
- MIRSRC(IDS_CMD_ERR_SOME_ERROR), m_cmdData.strMiCmd.c_str(),
- "The LineEntry is absent or has an unknown format."));
- const CMICmnMIValueResult miValueResult("msg", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
-
+ m_miResultRecord = m_resultRecord;
return MIstatus::success;
}
diff --git a/tools/lldb-mi/MICmdCmdData.h b/tools/lldb-mi/MICmdCmdData.h
index ab8d6ba5cd19..0317db11a535 100644
--- a/tools/lldb-mi/MICmdCmdData.h
+++ b/tools/lldb-mi/MICmdCmdData.h
@@ -34,7 +34,6 @@
#pragma once
// Third party headers:
-#include "lldb/API/SBCommandReturnObject.h"
#include "lldb/API/SBError.h"
// In-house headers:
@@ -42,6 +41,7 @@
#include "MICmnLLDBDebugSessionInfoVarObj.h"
#include "MICmnMIValueList.h"
#include "MICmnMIValueTuple.h"
+#include "MICmnMIResultRecord.h"
//++
//============================================================================
@@ -377,6 +377,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgLocation;
+ CMICmnMIResultRecord m_resultRecord;
};
diff --git a/tools/lldb-mi/MICmdCmdExec.cpp b/tools/lldb-mi/MICmdCmdExec.cpp
index 8fa63f4d98e6..1102b952407e 100644
--- a/tools/lldb-mi/MICmdCmdExec.cpp
+++ b/tools/lldb-mi/MICmdCmdExec.cpp
@@ -22,6 +22,7 @@
#include "lldb/API/SBCommandInterpreter.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBStream.h"
+#include "lldb/API/SBThread.h"
#include "lldb/lldb-enumerations.h"
// In-house headers:
@@ -99,6 +100,19 @@ bool CMICmdCmdExecRun::ParseArgs() {
bool CMICmdCmdExecRun::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
+
+ {
+ // Check we have a valid target.
+ // Note: target created via 'file-exec-and-symbols' command.
+ lldb::SBTarget sbTarget = rSessionInfo.GetTarget();
+ if (!sbTarget.IsValid() ||
+ sbTarget == rSessionInfo.GetDebugger().GetDummyTarget()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT),
+ m_cmdData.strMiCmd.c_str()));
+ return MIstatus::failure;
+ }
+ }
+
lldb::SBError error;
lldb::SBStream errMsg;
lldb::SBLaunchInfo launchInfo = rSessionInfo.GetTarget().GetLaunchInfo();
@@ -112,21 +126,25 @@ bool CMICmdCmdExecRun::Execute() {
}
lldb::SBProcess process = rSessionInfo.GetTarget().Launch(launchInfo, error);
- if ((!process.IsValid()) || (error.Fail())) {
+ if (!process.IsValid()) {
SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_PROCESS),
m_cmdData.strMiCmd.c_str(),
errMsg.GetData()));
return MIstatus::failure;
}
- if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) {
- const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
- SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
- m_cmdData.strMiCmd.c_str(),
- rErrMsg.c_str()));
- return MIstatus::failure;
- }
- return MIstatus::success;
+ const auto successHandler = [this] {
+ if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) {
+ const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
+ SetError(CMIUtilString::Format(
+ MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
+ m_cmdData.strMiCmd.c_str(), rErrMsg.c_str()));
+ return MIstatus::failure;
+ }
+ return MIstatus::success;
+ };
+
+ return HandleSBErrorWithSuccess(error, successHandler);
}
//++
@@ -142,9 +160,8 @@ bool CMICmdCmdExecRun::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecRun::Acknowledge() {
- const CMICmnMIResultRecord miRecordResult(
+ m_miResultRecord = CMICmnMIResultRecord(
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
@@ -219,35 +236,21 @@ CMICmdCmdExecContinue::~CMICmdCmdExecContinue() {}
// Throws: None.
//--
bool CMICmdCmdExecContinue::Execute() {
- const char *pCmd = "continue";
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- const lldb::ReturnStatus rtn =
- rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(
- pCmd, m_lldbResult);
- MIunused(rtn);
-
- if (m_lldbResult.GetErrorSize() == 0) {
+ const auto successHandler = [this] {
// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
if (!CMIDriver::Instance().SetDriverStateRunningDebugging()) {
const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
- SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
- m_cmdData.strMiCmd.c_str(),
- rErrMsg.c_str()));
+ SetError(CMIUtilString::Format(
+ MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
+ m_cmdData.strMiCmd.c_str(), rErrMsg.c_str()));
return MIstatus::failure;
}
- } else {
- // ToDo: Re-evaluate if this is required when application near finished as
- // this is parsing LLDB error message
- // which seems a hack and is code brittle
- const char *pLldbErr = m_lldbResult.GetError();
- const CMIUtilString strLldbMsg(CMIUtilString(pLldbErr).StripCREndOfLine());
- if (strLldbMsg == "error: Process must be launched.") {
- CMIDriver::Instance().SetExitApplicationFlag(true);
- }
- }
+ return MIstatus::success;
+ };
- return MIstatus::success;
+ return HandleSBErrorWithSuccess(
+ CMICmnLLDBDebugSessionInfo::Instance().GetProcess().Continue(),
+ successHandler);
}
//++
@@ -262,19 +265,8 @@ bool CMICmdCmdExecContinue::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecContinue::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -365,14 +357,22 @@ bool CMICmdCmdExecNext::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-over");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
- return MIstatus::success;
+ lldb::SBError error;
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread = rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepOver(lldb::eOnlyDuringStepping, error);
+ } else
+ rSessionInfo.GetProcess().GetSelectedThread().StepOver(
+ lldb::eOnlyDuringStepping, error);
+
+ return HandleSBError(error);
}
//++
@@ -387,21 +387,8 @@ bool CMICmdCmdExecNext::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecNext::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- MIunused(pLldbErr);
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -490,14 +477,23 @@ bool CMICmdCmdExecStep::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-in");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
- return MIstatus::success;
+ lldb::SBError error;
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread =
+ rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepInto(nullptr, LLDB_INVALID_LINE_NUMBER, error);
+ } else
+ rSessionInfo.GetProcess().GetSelectedThread().StepInto(
+ nullptr, LLDB_INVALID_LINE_NUMBER, error);
+
+ return HandleSBError(error);
}
//++
@@ -512,21 +508,8 @@ bool CMICmdCmdExecStep::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecStep::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- MIunused(pLldbErr);
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -616,14 +599,23 @@ bool CMICmdCmdExecNextInstruction::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-inst-over");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
- return MIstatus::success;
+ lldb::SBError error;
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread =
+ rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepInstruction(true, error);
+ } else
+ rSessionInfo.GetProcess().GetSelectedThread().StepInstruction(
+ true, error);
+
+ return HandleSBError(error);
}
//++
@@ -638,21 +630,8 @@ bool CMICmdCmdExecNextInstruction::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecNextInstruction::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- MIunused(pLldbErr);
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -744,14 +723,23 @@ bool CMICmdCmdExecStepInstruction::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-inst");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
- return MIstatus::success;
+ lldb::SBError error;
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread =
+ rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepInstruction(false, error);
+ } else
+ rSessionInfo.GetProcess().GetSelectedThread().StepInstruction(
+ false, error);
+
+ return HandleSBError(error);
}
//++
@@ -766,21 +754,8 @@ bool CMICmdCmdExecStepInstruction::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecStepInstruction::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- MIunused(pLldbErr);
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -868,14 +843,22 @@ bool CMICmdCmdExecFinish::Execute() {
CMICmnLLDBDebugSessionInfo &rSessionInfo(
CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("thread step-out");
- if (nThreadId != UINT64_MAX)
- strCmd += CMIUtilString::Format(" %llu", nThreadId);
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(), m_lldbResult,
- false);
- return MIstatus::success;
+ lldb::SBError error;
+ if (nThreadId != UINT64_MAX) {
+ lldb::SBThread sbThread =
+ rSessionInfo.GetProcess().GetThreadByIndexID(nThreadId);
+ if (!sbThread.IsValid()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_THREAD_INVALID),
+ m_cmdData.strMiCmd.c_str(),
+ m_constStrArgThread.c_str()));
+ return MIstatus::failure;
+ }
+ sbThread.StepOut(error);
+ } else
+ rSessionInfo.GetProcess().GetSelectedThread().StepOut(error);
+
+ return HandleSBError(error);
}
//++
@@ -890,21 +873,8 @@ bool CMICmdCmdExecFinish::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecFinish::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- MIunused(pLldbErr);
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Running);
return MIstatus::success;
}
@@ -965,25 +935,22 @@ CMICmdCmdExecInterrupt::~CMICmdCmdExecInterrupt() {}
// Throws: None.
//--
bool CMICmdCmdExecInterrupt::Execute() {
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- lldb::SBDebugger &rDebugger = rSessionInfo.GetDebugger();
- CMIUtilString strCmd("process interrupt");
- const lldb::ReturnStatus status =
- rDebugger.GetCommandInterpreter().HandleCommand(strCmd.c_str(),
- m_lldbResult, false);
- MIunused(status);
-
- // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
- if (!CMIDriver::Instance().SetDriverStateRunningNotDebugging()) {
- const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
- SetErrorDescription(
- CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
- strCmd.c_str(), rErrMsg.c_str()));
- return MIstatus::failure;
- }
+ const auto successHandler = [this] {
+ // CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
+ if (!CMIDriver::Instance().SetDriverStateRunningNotDebugging()) {
+ const CMIUtilString &rErrMsg(CMIDriver::Instance().GetErrorDescription());
+ SetErrorDescription(CMIUtilString::Format(
+ MIRSRC(IDS_CMD_ERR_SET_NEW_DRIVER_STATE),
+ m_cmdData.strMiCmd.c_str(),
+ rErrMsg.c_str()));
+ return MIstatus::failure;
+ }
+ return MIstatus::success;
+ };
- return MIstatus::success;
+ return HandleSBErrorWithSuccess(
+ CMICmnLLDBDebugSessionInfo::Instance().GetProcess().Stop(),
+ successHandler);
}
//++
@@ -998,19 +965,8 @@ bool CMICmdCmdExecInterrupt::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecInterrupt::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const CMICmnMIValueConst miValueConst(m_lldbResult.GetError());
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
- m_miResultRecord = miRecordResult;
- }
-
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
return MIstatus::success;
}
@@ -1130,10 +1086,8 @@ bool CMICmdCmdExecArguments::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecArguments::Acknowledge() {
- const CMICmnMIResultRecord miRecordResult(
+ m_miResultRecord = CMICmnMIResultRecord(
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
- m_miResultRecord = miRecordResult;
-
return MIstatus::success;
}
@@ -1226,9 +1180,8 @@ bool CMICmdCmdExecAbort::Execute() {
// Throws: None.
//--
bool CMICmdCmdExecAbort::Acknowledge() {
- const CMICmnMIResultRecord miRecordResult(
+ m_miResultRecord = CMICmnMIResultRecord(
m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done);
- m_miResultRecord = miRecordResult;
return MIstatus::success;
}
diff --git a/tools/lldb-mi/MICmdCmdExec.h b/tools/lldb-mi/MICmdCmdExec.h
index 46e7783c91ef..451d25e29eb1 100644
--- a/tools/lldb-mi/MICmdCmdExec.h
+++ b/tools/lldb-mi/MICmdCmdExec.h
@@ -33,8 +33,6 @@
#pragma once
// Third party headers:
-#include "lldb/API/SBCommandReturnObject.h"
-
// In-house headers:
#include "MICmdBase.h"
@@ -66,7 +64,6 @@ public:
private:
const CMIUtilString m_constStrArgStart; // StopAtEntry - run to first
// instruction or main() if specified
- lldb::SBCommandReturnObject m_lldbResult;
};
//++
@@ -91,10 +88,6 @@ public:
bool Acknowledge() override;
// From CMICmnBase
/* dtor */ ~CMICmdCmdExecContinue() override;
-
- // Attributes:
-private:
- lldb::SBCommandReturnObject m_lldbResult;
};
//++
@@ -123,7 +116,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
// Eclipse gives this option
};
@@ -154,7 +146,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
// Eclipse gives this option
};
@@ -185,7 +176,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
// Eclipse gives this option
};
@@ -216,7 +206,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
const CMIUtilString m_constStrArgNumber; // Not specified in MI spec but
// Eclipse gives this option
};
@@ -244,10 +233,6 @@ public:
bool ParseArgs() override;
// From CMICmnBase
/* dtor */ ~CMICmdCmdExecFinish() override;
-
- // Attributes:
-private:
- lldb::SBCommandReturnObject m_lldbResult;
};
// CODETAG_DEBUG_SESSION_RUNNING_PROG_RECEIVED_SIGINT_PAUSE_PROGRAM
@@ -276,10 +261,6 @@ public:
bool Acknowledge() override;
// From CMICmnBase
/* dtor */ ~CMICmdCmdExecInterrupt() override;
-
- // Attributes:
-private:
- lldb::SBCommandReturnObject m_lldbResult;
};
//++
diff --git a/tools/lldb-mi/MICmdCmdSymbol.cpp b/tools/lldb-mi/MICmdCmdSymbol.cpp
index 7b302b12b607..008e98d02e74 100644
--- a/tools/lldb-mi/MICmdCmdSymbol.cpp
+++ b/tools/lldb-mi/MICmdCmdSymbol.cpp
@@ -10,18 +10,36 @@
// Overview: CMICmdCmdSymbolListLines implementation.
// Third Party Headers:
-#include "lldb/API/SBCommandInterpreter.h"
-#include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/StringRef.h"
-#include "llvm/Support/Regex.h"
+#include "llvm/ADT/Twine.h"
+#include "lldb/API/SBAddress.h"
+#include "lldb/API/SBLineEntry.h"
+#include "lldb/API/SBFileSpec.h"
+#include "lldb/API/SBCompileUnit.h"
+#include "lldb/API/SBSymbolContext.h"
+#include "lldb/API/SBSymbolContextList.h"
// In-house headers:
#include "MICmdArgValFile.h"
#include "MICmdCmdSymbol.h"
#include "MICmnLLDBDebugSessionInfo.h"
#include "MICmnMIResultRecord.h"
-#include "MICmnMIValueList.h"
#include "MICmnMIValueTuple.h"
+#include "MICmnMIValueResult.h"
+
+namespace {
+const CMICmnMIValueTuple
+CreateMITuplePCLine(const uint32_t addr, const uint32_t line_number) {
+ const CMICmnMIValueConst miValueConstAddr("0x" + llvm::Twine::utohexstr(addr).str());
+ const CMICmnMIValueConst miValueConstLine(llvm::Twine(line_number).str());
+ const CMICmnMIValueResult miValueResultAddr("pc", miValueConstAddr);
+ const CMICmnMIValueResult miValueResultLine("line", miValueConstLine);
+ CMICmnMIValueTuple miValueTuple(miValueResultAddr);
+ miValueTuple.Add(miValueResultLine);
+ return miValueTuple;
+}
+} // namespace
+
+using namespace lldb; // For operator==(const SBAddress &, const SBAddress &).
//++
//------------------------------------------------------------------------------------
@@ -32,7 +50,7 @@
// Throws: None.
//--
CMICmdCmdSymbolListLines::CMICmdCmdSymbolListLines()
- : m_constStrArgNameFile("file") {
+ : m_resultList(false), m_constStrArgNameFile("file") {
// Command factory matches this name with that received from the stdin stream
m_strMiCmd = "symbol-list-lines";
@@ -84,93 +102,51 @@ bool CMICmdCmdSymbolListLines::ParseArgs() {
bool CMICmdCmdSymbolListLines::Execute() {
CMICMDBASE_GETOPTION(pArgFile, File, m_constStrArgNameFile);
- const CMIUtilString &strFilePath(pArgFile->GetValue());
- const CMIUtilString strCmd(CMIUtilString::Format(
- "source info --file \"%s\"", strFilePath.AddSlashes().c_str()));
-
- CMICmnLLDBDebugSessionInfo &rSessionInfo(
- CMICmnLLDBDebugSessionInfo::Instance());
- const lldb::ReturnStatus rtn =
- rSessionInfo.GetDebugger().GetCommandInterpreter().HandleCommand(
- strCmd.c_str(), m_lldbResult);
- MIunused(rtn);
-
- return MIstatus::success;
-}
-
-//++
-//------------------------------------------------------------------------------------
-// Details: Helper function for parsing the header returned from lldb for the
-// command:
-// target modules dump line-table <file>
-// where the header is of the format:
-// Line table for /path/to/file in `/path/to/module
-// Args: input - (R) Input string to parse.
-// file - (W) String representing the file.
-// Return: bool - True = input was parsed successfully, false = input could not
-// be parsed.
-// Throws: None.
-//--
-static bool ParseLLDBLineAddressHeader(const char *input, CMIUtilString &file) {
- // Match LineEntry using regex.
- static llvm::Regex g_lineentry_header_regex(llvm::StringRef(
- "^ *Lines found for file (.+) in compilation unit (.+) in `(.+)$"));
- // ^1=file ^2=cu
- // ^3=module
-
- llvm::SmallVector<llvm::StringRef, 4> match;
-
- const bool ok = g_lineentry_header_regex.match(input, &match);
- if (ok)
- file = match[1];
- return ok;
-}
-
-//++
-//------------------------------------------------------------------------------------
-// Details: Helper function for parsing a line entry returned from lldb for the
-// command:
-// target modules dump line-table <file>
-// where the line entry is of the format:
-// 0x0000000100000e70: /path/to/file:3002[:4]
-// addr file line column(opt)
-// Args: input - (R) Input string to parse.
-// addr - (W) String representing the pc address.
-// file - (W) String representing the file.
-// line - (W) String representing the line.
-// Return: bool - True = input was parsed successfully, false = input could not
-// be parsed.
-// Throws: None.
-//--
-static bool ParseLLDBLineAddressEntry(const char *input, CMIUtilString &addr,
- CMIUtilString &file,
- CMIUtilString &line) {
- // Note: Ambiguities arise because the column is optional, and
- // because : can appear in filenames or as a byte in a multibyte
- // UTF8 character. We keep those cases to a minimum by using regex
- // to work on the string from both the left and right, so that what
- // is remains is assumed to be the filename.
-
- // Match LineEntry using regex.
- static llvm::Regex g_lineentry_nocol_regex(llvm::StringRef(
- "^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+)$"));
- static llvm::Regex g_lineentry_col_regex(llvm::StringRef(
- "^ *\\[(0x[0-9a-fA-F]+)-(0x[0-9a-fA-F]+)\\): (.+):([0-9]+):[0-9]+$"));
- // ^1=start ^2=end ^3=f ^4=line
- // ^5=:col(opt)
-
- llvm::SmallVector<llvm::StringRef, 6> match;
+ const auto &rSessionInfo(CMICmnLLDBDebugSessionInfo::Instance());
+ if (rSessionInfo.GetTarget() == rSessionInfo.GetDebugger().GetDummyTarget()) {
+ SetError(CMIUtilString::Format(MIRSRC(IDS_CMD_ERR_INVALID_TARGET_CURRENT),
+ m_cmdData.strMiCmd.c_str()));
+ return MIstatus::failure;
+ }
- // First try matching the LineEntry with the column,
- // then try without the column.
- const bool ok = g_lineentry_col_regex.match(input, &match) ||
- g_lineentry_nocol_regex.match(input, &match);
- if (ok) {
- addr = match[1];
- file = match[3];
- line = match[4];
+ const lldb::SBFileSpec source_file_spec(pArgFile->GetValue().c_str(), true);
+ const char *source_file_name = source_file_spec.GetFilename();
+ const char *source_file_directory = source_file_spec.GetDirectory();
+ const bool has_path = source_file_directory;
+
+ lldb::SBSymbolContextList sc_cu_list =
+ CMICmnLLDBDebugSessionInfo::Instance().GetTarget().FindCompileUnits(
+ source_file_spec);
+
+ bool found_something = false;
+ for (uint32_t i = 0, e = sc_cu_list.GetSize(); i < e; ++i) {
+ const lldb::SBCompileUnit cu =
+ sc_cu_list.GetContextAtIndex(i).GetCompileUnit();
+ for (uint32_t j = 0, e = cu.GetNumLineEntries(); j < e; ++j) {
+ const lldb::SBLineEntry line = cu.GetLineEntryAtIndex(j);
+ const lldb::SBFileSpec line_spec = line.GetFileSpec();
+ if (line_spec.GetFilename() == source_file_name) {
+ if (has_path && (line_spec.GetDirectory() != source_file_directory))
+ continue;
+ // We don't need a line with start address equals to end one,
+ // so just skip it.
+ const lldb::SBAddress line_start_address = line.GetStartAddress();
+ const lldb::SBAddress line_end_address = line.GetEndAddress();
+ if (line_start_address == line_end_address)
+ continue;
+ // We have a matching line.
+ found_something = true;
+ m_resultList.Add(CreateMITuplePCLine(
+ line_start_address.GetFileAddress(),
+ line.GetLine()));
+ }
+ }
+ }
+ if (!found_something) {
+ SetError(MIRSRC(IDS_UTIL_FILE_ERR_INVALID_PATHNAME));
+ return MIstatus::failure;
}
- return ok;
+ return MIstatus::success;
}
//++
@@ -185,71 +161,11 @@ static bool ParseLLDBLineAddressEntry(const char *input, CMIUtilString &addr,
// Throws: None.
//--
bool CMICmdCmdSymbolListLines::Acknowledge() {
- if (m_lldbResult.GetErrorSize() > 0) {
- const char *pLldbErr = m_lldbResult.GetError();
- const CMIUtilString strMsg(CMIUtilString(pLldbErr).StripCRAll());
- const CMICmnMIValueConst miValueConst(strMsg);
- const CMICmnMIValueResult miValueResult("message", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
- } else {
- CMIUtilString::VecString_t vecLines;
- const CMIUtilString strLldbMsg(m_lldbResult.GetOutput());
- const MIuint nLines(strLldbMsg.SplitLines(vecLines));
-
- // Parse the file from the header.
- const CMIUtilString &rWantFile(vecLines[0]);
- CMIUtilString strWantFile;
- if (!ParseLLDBLineAddressHeader(rWantFile.c_str(), strWantFile)) {
- // Unexpected error - parsing failed.
- // MI print "%s^error,msg=\"Command '-symbol-list-lines'. Error: Line
- // address header is absent or has an unknown format.\""
- const CMICmnMIValueConst miValueConst(CMIUtilString::Format(
- MIRSRC(IDS_CMD_ERR_SOME_ERROR), m_cmdData.strMiCmd.c_str(),
- "Line address header is absent or has an unknown format."));
- const CMICmnMIValueResult miValueResult("msg", miValueConst);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Error,
- miValueResult);
- m_miResultRecord = miRecordResult;
-
- return MIstatus::success;
- }
-
- // Parse the line address entries.
- CMICmnMIValueList miValueList(true);
- for (MIuint i = 1; i < nLines; ++i) {
- // String looks like:
- // 0x0000000100000e70: /path/to/file:3[:4]
- const CMIUtilString &rLine(vecLines[i]);
- CMIUtilString strAddr;
- CMIUtilString strFile;
- CMIUtilString strLine;
-
- if (!ParseLLDBLineAddressEntry(rLine.c_str(), strAddr, strFile, strLine))
- continue;
-
- const CMICmnMIValueConst miValueConst(strAddr);
- const CMICmnMIValueResult miValueResult("pc", miValueConst);
- CMICmnMIValueTuple miValueTuple(miValueResult);
-
- const CMICmnMIValueConst miValueConst2(strLine);
- const CMICmnMIValueResult miValueResult2("line", miValueConst2);
- miValueTuple.Add(miValueResult2);
-
- miValueList.Add(miValueTuple);
- }
-
- // MI print "%s^done,lines=[{pc=\"%d\",line=\"%d\"}...]"
- const CMICmnMIValueResult miValueResult("lines", miValueList);
- const CMICmnMIResultRecord miRecordResult(
- m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done,
- miValueResult);
- m_miResultRecord = miRecordResult;
- }
-
+ // MI print "%s^done,lines=[{pc=\"%d\",line=\"%d\"}...]"
+ const CMICmnMIValueResult miValueResult("lines", m_resultList);
+ m_miResultRecord = CMICmnMIResultRecord(
+ m_cmdData.strMiCmdToken, CMICmnMIResultRecord::eResultClass_Done,
+ miValueResult);
return MIstatus::success;
}
diff --git a/tools/lldb-mi/MICmdCmdSymbol.h b/tools/lldb-mi/MICmdCmdSymbol.h
index 56685df07d94..bd545345cf1b 100644
--- a/tools/lldb-mi/MICmdCmdSymbol.h
+++ b/tools/lldb-mi/MICmdCmdSymbol.h
@@ -24,10 +24,10 @@
#pragma once
// Third party headers:
-#include "lldb/API/SBCommandReturnObject.h"
// In-house headers:
#include "MICmdBase.h"
+#include "MICmnMIValueList.h"
//++
//============================================================================
@@ -55,6 +55,6 @@ public:
// Attributes:
private:
- lldb::SBCommandReturnObject m_lldbResult;
+ CMICmnMIValueList m_resultList;
const CMIUtilString m_constStrArgNameFile;
};
diff --git a/tools/lldb-mi/MICmdCmdTarget.cpp b/tools/lldb-mi/MICmdCmdTarget.cpp
index e5bd4c4d2bc7..a82bd682de81 100644
--- a/tools/lldb-mi/MICmdCmdTarget.cpp
+++ b/tools/lldb-mi/MICmdCmdTarget.cpp
@@ -115,7 +115,7 @@ bool CMICmdCmdTargetSelect::Execute() {
const CMIUtilString strUrl =
CMIUtilString::Format("connect://%s", pArgParameters->GetValue().c_str());
- // Ask LLDB to collect to the target port
+ // Ask LLDB to connect to the target port
const char *pPlugin("gdb-remote");
lldb::SBError error;
lldb::SBProcess process = rSessionInfo.GetTarget().ConnectRemote(
diff --git a/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp b/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
index 6e76c23036f1..9a173d1007e2 100644
--- a/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
+++ b/tools/lldb-mi/MICmnLLDBDebugSessionInfo.cpp
@@ -871,7 +871,10 @@ lldb::SBListener &CMICmnLLDBDebugSessionInfo::GetListener() const {
// Throws: None.
//--
lldb::SBTarget CMICmnLLDBDebugSessionInfo::GetTarget() const {
- return GetDebugger().GetSelectedTarget();
+ auto target = GetDebugger().GetSelectedTarget();
+ if (target.IsValid())
+ return target;
+ return GetDebugger().GetDummyTarget();
}
//++
diff --git a/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h b/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
index f4773053c28d..55764511a6a9 100644
--- a/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
+++ b/tools/lldb-mi/MICmnLLDBDebuggerHandleEvents.h
@@ -14,6 +14,7 @@
#include "MICmnMIValueList.h"
#include "MICmnMIValueTuple.h"
#include "MIUtilSingletonBase.h"
+#include "lldb/API/SBEvent.h"
// Declarations:
class CMICmnLLDBDebugSessionInfo;
diff --git a/tools/lldb-mi/MICmnResources.cpp b/tools/lldb-mi/MICmnResources.cpp
index f96f01b65f0e..e32a816fc9f1 100644
--- a/tools/lldb-mi/MICmnResources.cpp
+++ b/tools/lldb-mi/MICmnResources.cpp
@@ -110,6 +110,8 @@ const CMICmnResources::SRsrcTextData
{IDE_MI_APP_ARG_EXECUTABLE, "executable (NOT IMPLEMENTED)\n\tThe file "
"path to the executable i.e. '\"C:\\My "
"Dev\\foo.exe\"'."},
+ {IDE_MI_APP_ARG_SYNCHRONOUS, "--synchronous\n\tBlock until each command "
+ "has finished executing.\n\tUsed for testing only."},
{IDS_STDIN_ERR_INVALID_PROMPT,
"Stdin. Invalid prompt description '%s'"},
{IDS_STDIN_ERR_THREAD_CREATION_FAILED,
@@ -449,7 +451,7 @@ const CMICmnResources::SRsrcTextData
"'print' error. The option '%s' not found"},
{IDS_CMD_ERR_EXPR_INVALID, "Failed to evaluate expression: %s"},
{IDS_CMD_ERR_ATTACH_FAILED,
- "Command '%s'. Attach to processs failed: %s"},
+ "Command '%s'. Attach to process failed: %s"},
{IDS_CMD_ERR_ATTACH_BAD_ARGS,
"Command '%s'. Must specify either a PID or a Name"}};
diff --git a/tools/lldb-mi/MICmnResources.h b/tools/lldb-mi/MICmnResources.h
index e9ebe7928101..8912a2b8463e 100644
--- a/tools/lldb-mi/MICmnResources.h
+++ b/tools/lldb-mi/MICmnResources.h
@@ -77,6 +77,7 @@ enum {
IDE_MI_APP_ARG_APP_LOG_DIR,
IDE_MI_APP_ARG_EXAMPLE,
IDE_MI_APP_ARG_EXECUTABLE,
+ IDE_MI_APP_ARG_SYNCHRONOUS,
IDS_STDIN_ERR_INVALID_PROMPT,
IDS_STDIN_ERR_THREAD_CREATION_FAILED,
diff --git a/tools/lldb-mi/MIDriver.cpp b/tools/lldb-mi/MIDriver.cpp
index 7bd6b7b2e166..23039110b428 100644
--- a/tools/lldb-mi/MIDriver.cpp
+++ b/tools/lldb-mi/MIDriver.cpp
@@ -382,6 +382,7 @@ lldb::SBError CMIDriver::DoParseArgs(const int argc, const char *argv[],
// that are only handled by *this driver:
// --executable <file>
// --source <file> or -s <file>
+// --synchronous
// The application's options --interpreter and --executable in code act
// very similar.
// The --executable is necessary to differentiate whether the MI Driver
@@ -397,6 +398,7 @@ lldb::SBError CMIDriver::DoParseArgs(const int argc, const char *argv[],
// argument for a debug session. Using --interpreter on the command
// line does not
// issue additional commands to initialise a debug session.
+// Option --synchronous disables an asynchronous mode in the lldb-mi driver.
// Type: Overridden.
// Args: argc - (R) An integer that contains the count of arguments
// that follow in
@@ -469,6 +471,8 @@ lldb::SBError CMIDriver::ParseArgs(const int argc, const char *argv[],
// command line
{ // See fn description.
bHaveExecutableLongOption = true;
+ } else if (strArg.compare("--synchronous") == 0) {
+ CMICmnLLDBDebugSessionInfo::Instance().GetDebugger().SetAsync(false);
}
}
}
diff --git a/tools/lldb-mi/MIDriverMain.cpp b/tools/lldb-mi/MIDriverMain.cpp
index eda67782ad67..1b3521e8f03f 100644
--- a/tools/lldb-mi/MIDriverMain.cpp
+++ b/tools/lldb-mi/MIDriverMain.cpp
@@ -26,13 +26,11 @@
// MICmdBase.h / .cpp
// MICmdCmd.h / .cpp
-#if defined(_MSC_VER)
-#define _INC_SIGNAL // Stop window's signal.h being included -
- // CODETAG_IOR_SIGNALS
-#endif // _MSC_VER
-
// Third party headers:
#include "lldb/API/SBHostOS.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
#include <atomic>
#include <csignal>
#include <stdio.h>
@@ -174,6 +172,10 @@ int main(int argc, char const *argv[]) {
#endif // _WIN32
#endif // MICONFIG_DEBUG_SHOW_ATTACH_DBG_DLG
+ llvm::StringRef ToolName = argv[0];
+ llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
+ llvm::PrettyStackTraceProgram X(argc, argv);
+
// *** Order is important here ***
bool bOk = DriverSystemInit();
if (!bOk) {
diff --git a/tools/lldb-mi/MIDriverMgr.cpp b/tools/lldb-mi/MIDriverMgr.cpp
index 1ce7febc1b39..6b39832d736e 100644
--- a/tools/lldb-mi/MIDriverMgr.cpp
+++ b/tools/lldb-mi/MIDriverMgr.cpp
@@ -640,6 +640,7 @@ CMIUtilString CMIDriverMgr::GetHelpOnCmdLineArgOptions() const {
MIRSRC(IDE_MI_APP_ARG_VERSION), MIRSRC(IDE_MI_APP_ARG_VERSION_LONG),
MIRSRC(IDE_MI_APP_ARG_INTERPRETER), MIRSRC(IDE_MI_APP_ARG_SOURCE),
MIRSRC(IDE_MI_APP_ARG_EXECUTEABLE),
+ MIRSRC(IDE_MI_APP_ARG_SYNCHRONOUS),
CMIUtilString::Format(
MIRSRC(IDE_MI_APP_ARG_APP_LOG),
CMICmnLogMediumFile::Instance().GetFileName().c_str()),
diff --git a/tools/lldb-mi/MIReadMe.txt b/tools/lldb-mi/MIReadMe.txt
index bc3d4a8d5e5c..51316ed879c5 100644
--- a/tools/lldb-mi/MIReadMe.txt
+++ b/tools/lldb-mi/MIReadMe.txt
@@ -9,7 +9,7 @@ For help information on using the MI driver type at the command line:
lldb-mi --interpreter --help
-A blog about the MI Driver is available on CodePlay's website. ALthough it may not be
+A blog about the MI Driver is available on CodePlay's website. Although it may not be
completely accurate after the recent changes in lldb-mi.
http://www.codeplay.com/portal/lldb-mi-driver---part-1-introduction
@@ -19,7 +19,7 @@ used to aid the debugging of the MI Driver. It also gives warnings about
command's which do not support certain argument or options.
Note any command or text sent to the MI Driver in MI mode that is not a command
-registered in the MI Driver's Command Factory will be rejected and an error messsage
+registered in the MI Driver's Command Factory will be rejected and an error message
will be generated.
All the files prefix with MI are specifically for the MI driver code only.
@@ -29,8 +29,8 @@ File MIDriverMain.cpp contains the executables main() function.
Current limitations:
1. Not all commands and their options have been implemented. Please see
the source code for details.
-2. LLDB-MI may have additinal arguments not used in GDB MI. Please see
-MIExtesnsions.txt
+2. LLDB-MI may have additional arguments not used in GDB MI. Please see
+MIExtensions.txt
=========================================================================
The MI Driver build configuration:
diff --git a/tools/lldb-mi/MIUtilSingletonHelper.h b/tools/lldb-mi/MIUtilSingletonHelper.h
index 82bed558a7d9..831c60aecfef 100644
--- a/tools/lldb-mi/MIUtilSingletonHelper.h
+++ b/tools/lldb-mi/MIUtilSingletonHelper.h
@@ -9,12 +9,12 @@
#pragma once
-namespace MI {
-
// In house headers:
#include "MICmnResources.h"
#include "MIUtilString.h"
+namespace MI {
+
//++
//============================================================================
// Details: Short cut helper function to simplify repeated initialisation of
diff --git a/tools/lldb-mi/module.modulemap b/tools/lldb-mi/module.modulemap
new file mode 100644
index 000000000000..01f6a2b79508
--- /dev/null
+++ b/tools/lldb-mi/module.modulemap
@@ -0,0 +1,79 @@
+module lldb_mi {
+ module MICmdArgContext { header "MICmdArgContext.h" export * }
+ module MICmdArgSet { header "MICmdArgSet.h" export * }
+ module MICmdArgValBase { header "MICmdArgValBase.h" export * }
+ module MICmdArgValConsume { header "MICmdArgValConsume.h" export * }
+ module MICmdArgValFile { header "MICmdArgValFile.h" export * }
+ module MICmdArgValListBase { header "MICmdArgValListBase.h" export * }
+ module MICmdArgValListOfN { header "MICmdArgValListOfN.h" export * }
+ module MICmdArgValNumber { header "MICmdArgValNumber.h" export * }
+ module MICmdArgValOptionLong { header "MICmdArgValOptionLong.h" export * }
+ module MICmdArgValOptionShort { header "MICmdArgValOptionShort.h" export * }
+ module MICmdArgValPrintValues { header "MICmdArgValPrintValues.h" export * }
+ module MICmdArgValString { header "MICmdArgValString.h" export * }
+ module MICmdArgValThreadGrp { header "MICmdArgValThreadGrp.h" export * }
+ module MICmdBase { header "MICmdBase.h" export * }
+ module MICmdCmdBreak { header "MICmdCmdBreak.h" export * }
+ module MICmdCmdData { header "MICmdCmdData.h" export * }
+ module MICmdCmdEnviro { header "MICmdCmdEnviro.h" export * }
+ module MICmdCmdExec { header "MICmdCmdExec.h" export * }
+ module MICmdCmdFile { header "MICmdCmdFile.h" export * }
+ module MICmdCmdGdbInfo { header "MICmdCmdGdbInfo.h" export * }
+ module MICmdCmdGdbSet { header "MICmdCmdGdbSet.h" export * }
+ module MICmdCmdGdbShow { header "MICmdCmdGdbShow.h" export * }
+ module MICmdCmdGdbThread { header "MICmdCmdGdbThread.h" export * }
+ module MICmdCmd { header "MICmdCmd.h" export * }
+ module MICmdCmdMiscellanous { header "MICmdCmdMiscellanous.h" export * }
+ module MICmdCmdStack { header "MICmdCmdStack.h" export * }
+ module MICmdCmdSupportInfo { header "MICmdCmdSupportInfo.h" export * }
+ module MICmdCmdSupportList { header "MICmdCmdSupportList.h" export * }
+ module MICmdCmdSymbol { header "MICmdCmdSymbol.h" export * }
+ module MICmdCmdTarget { header "MICmdCmdTarget.h" export * }
+ module MICmdCmdThread { header "MICmdCmdThread.h" export * }
+ module MICmdCmdTrace { header "MICmdCmdTrace.h" export * }
+ module MICmdCmdVar { header "MICmdCmdVar.h" export * }
+ module MICmdCommands { header "MICmdCommands.h" export * }
+ module MICmdData { header "MICmdData.h" export * }
+ module MICmdFactory { header "MICmdFactory.h" export * }
+ module MICmdInterpreter { header "MICmdInterpreter.h" export * }
+ module MICmdInvoker { header "MICmdInvoker.h" export * }
+ module MICmdMgr { header "MICmdMgr.h" export * }
+ module MICmdMgrSetCmdDeleteCallback { header "MICmdMgrSetCmdDeleteCallback.h" export * }
+ module MICmnBase { header "MICmnBase.h" export * }
+ module MICmnConfig { header "MICmnConfig.h" export * }
+ module MICmnLLDBBroadcaster { header "MICmnLLDBBroadcaster.h" export * }
+ module MICmnLLDBDebugger { header "MICmnLLDBDebugger.h" export * }
+ module MICmnLLDBDebuggerHandleEvents { header "MICmnLLDBDebuggerHandleEvents.h" export * }
+ module MICmnLLDBDebugSessionInfo { header "MICmnLLDBDebugSessionInfo.h" export * }
+ module MICmnLLDBDebugSessionInfoVarObj { header "MICmnLLDBDebugSessionInfoVarObj.h" export * }
+ module MICmnLLDBProxySBValue { header "MICmnLLDBProxySBValue.h" export * }
+ module MICmnLLDBUtilSBValue { header "MICmnLLDBUtilSBValue.h" export * }
+ module MICmnLog { header "MICmnLog.h" export * }
+ module MICmnLogMediumFile { header "MICmnLogMediumFile.h" export * }
+ module MICmnMIOutOfBandRecord { header "MICmnMIOutOfBandRecord.h" export * }
+ module MICmnMIResultRecord { header "MICmnMIResultRecord.h" export * }
+ module MICmnMIValueConst { header "MICmnMIValueConst.h" export * }
+ module MICmnMIValue { header "MICmnMIValue.h" export * }
+ module MICmnMIValueList { header "MICmnMIValueList.h" export * }
+ module MICmnMIValueResult { header "MICmnMIValueResult.h" export * }
+ module MICmnMIValueTuple { header "MICmnMIValueTuple.h" export * }
+ module MICmnResources { header "MICmnResources.h" export * }
+ module MICmnStreamStderr { header "MICmnStreamStderr.h" export * }
+ module MICmnStreamStdin { header "MICmnStreamStdin.h" export * }
+ module MICmnStreamStdout { header "MICmnStreamStdout.h" export * }
+ module MICmnThreadMgrStd { header "MICmnThreadMgrStd.h" export * }
+ module MIDataTypes { header "MIDataTypes.h" export * }
+ module MIDriverBase { header "MIDriverBase.h" export * }
+ module MIDriver { header "MIDriver.h" export * }
+ module MIDriverMgr { header "MIDriverMgr.h" export * }
+ module MIUtilDateTimeStd { header "MIUtilDateTimeStd.h" export * }
+ module MIUtilDebug { header "MIUtilDebug.h" export * }
+ module MIUtilFileStd { header "MIUtilFileStd.h" export * }
+ module MIUtilMapIdToVariant { header "MIUtilMapIdToVariant.h" export * }
+ module MIUtilSingletonBase { header "MIUtilSingletonBase.h" export * }
+ module MIUtilSingletonHelper { header "MIUtilSingletonHelper.h" export * }
+ module MIUtilString { header "MIUtilString.h" export * }
+ module MIUtilThreadBaseStd { header "MIUtilThreadBaseStd.h" export * }
+ module MIUtilVariant { header "MIUtilVariant.h" export * }
+ module Platform { header "Platform.h" export * }
+}
diff --git a/tools/lldb-server/CMakeLists.txt b/tools/lldb-server/CMakeLists.txt
index b226adb2b570..c74f553e9659 100644
--- a/tools/lldb-server/CMakeLists.txt
+++ b/tools/lldb-server/CMakeLists.txt
@@ -34,12 +34,21 @@ if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
list(APPEND LLDB_PLUGINS lldbPluginProcessNetBSD)
endif()
-add_lldb_tool(lldb-server INCLUDE_IN_FRAMEWORK
+if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
+ list(APPEND LLDB_PLUGINS lldbPluginObjectFileMachO)
+elseif(CMAKE_SYSTEM_NAME MATCHES "Windows")
+ list(APPEND LLDB_PLUGINS lldbPluginObjectFilePECOFF)
+else()
+ list(APPEND LLDB_PLUGINS lldbPluginObjectFileELF)
+endif()
+
+add_lldb_tool(lldb-server INCLUDE_IN_SUITE
Acceptor.cpp
lldb-gdbserver.cpp
lldb-platform.cpp
lldb-server.cpp
LLDBServerUtilities.cpp
+ SystemInitializerLLGS.cpp
LINK_LIBS
lldbBase
diff --git a/tools/lldb-server/LLDBServerUtilities.cpp b/tools/lldb-server/LLDBServerUtilities.cpp
index e784a3a82684..7d41b3b4c745 100644
--- a/tools/lldb-server/LLDBServerUtilities.cpp
+++ b/tools/lldb-server/LLDBServerUtilities.cpp
@@ -10,7 +10,7 @@
#include "LLDBServerUtilities.h"
#include "lldb/Core/StreamFile.h"
-#include "lldb/Interpreter/Args.h"
+#include "lldb/Utility/Args.h"
#include "lldb/Utility/Log.h"
#include "lldb/Utility/StreamString.h"
diff --git a/tools/lldb-server/SystemInitializerLLGS.cpp b/tools/lldb-server/SystemInitializerLLGS.cpp
new file mode 100644
index 000000000000..aeaf382a1dd8
--- /dev/null
+++ b/tools/lldb-server/SystemInitializerLLGS.cpp
@@ -0,0 +1,33 @@
+//===-- SystemInitializerLLGS.cpp -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "SystemInitializerLLGS.h"
+
+#if defined(__APPLE__)
+#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
+using HostObjectFile = ObjectFileMachO;
+#elif defined(_WIN32)
+#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
+using HostObjectFile = ObjectFilePECOFF;
+#else
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+using HostObjectFile = ObjectFileELF;
+#endif
+
+using namespace lldb_private;
+
+void SystemInitializerLLGS::Initialize() {
+ SystemInitializerCommon::Initialize();
+ HostObjectFile::Initialize();
+}
+
+void SystemInitializerLLGS::Terminate() {
+ HostObjectFile::Terminate();
+ SystemInitializerCommon::Terminate();
+}
diff --git a/tools/lldb-server/SystemInitializerLLGS.h b/tools/lldb-server/SystemInitializerLLGS.h
new file mode 100644
index 000000000000..e6460a2cdd39
--- /dev/null
+++ b/tools/lldb-server/SystemInitializerLLGS.h
@@ -0,0 +1,21 @@
+//===-- SystemInitializerLLGS.h ---------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLDB_SYSTEMINITIALIZERLLGS_H
+#define LLDB_SYSTEMINITIALIZERLLGS_H
+
+#include "lldb/Initialization/SystemInitializerCommon.h"
+
+class SystemInitializerLLGS : public lldb_private::SystemInitializerCommon {
+public:
+ void Initialize() override;
+ void Terminate() override;
+};
+
+#endif // LLDB_SYSTEMINITIALIZERLLGS_H
diff --git a/tools/lldb-server/lldb-gdbserver.cpp b/tools/lldb-server/lldb-gdbserver.cpp
index 810cb92e4ffc..c91a8a89e46a 100644
--- a/tools/lldb-server/lldb-gdbserver.cpp
+++ b/tools/lldb-server/lldb-gdbserver.cpp
@@ -188,10 +188,7 @@ void handle_launch(GDBRemoteCommunicationServerLLGS &gdb_server, int argc,
exit(1);
}
info.SetWorkingDirectory(FileSpec(cwd, true));
-
- StringList env;
- Host::GetEnvironment(env);
- info.GetEnvironmentEntries() = Args(env);
+ info.GetEnvironment() = Host::GetEnvironment();
gdb_server.SetLaunchInfo(info);
diff --git a/tools/lldb-server/lldb-platform.cpp b/tools/lldb-server/lldb-platform.cpp
index ec5b781dac48..cfaf5550d096 100644
--- a/tools/lldb-server/lldb-platform.cpp
+++ b/tools/lldb-server/lldb-platform.cpp
@@ -193,7 +193,7 @@ int main_platform(int argc, char *argv[]) {
case 'f': // Socket file
if (optarg && optarg[0])
- socket_file.SetFile(optarg, false);
+ socket_file.SetFile(optarg, false, FileSpec::Style::native);
break;
case 'p': {
diff --git a/tools/lldb-server/lldb-server.cpp b/tools/lldb-server/lldb-server.cpp
index 06ef0498749a..f05c96cfaa95 100644
--- a/tools/lldb-server/lldb-server.cpp
+++ b/tools/lldb-server/lldb-server.cpp
@@ -7,12 +7,15 @@
//
//===----------------------------------------------------------------------===//
-#include "lldb/Initialization/SystemInitializerCommon.h"
+#include "SystemInitializerLLGS.h"
#include "lldb/Initialization/SystemLifetimeManager.h"
#include "lldb/lldb-private.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/PrettyStackTrace.h"
+#include "llvm/Support/Signals.h"
#include <stdio.h>
#include <stdlib.h>
@@ -35,8 +38,8 @@ int main_gdbserver(int argc, char *argv[]);
int main_platform(int argc, char *argv[]);
static void initialize() {
- g_debugger_lifetime->Initialize(
- llvm::make_unique<lldb_private::SystemInitializerCommon>(), nullptr);
+ g_debugger_lifetime->Initialize(llvm::make_unique<SystemInitializerLLGS>(),
+ nullptr);
}
static void terminate() { g_debugger_lifetime->Terminate(); }
@@ -45,6 +48,10 @@ static void terminate() { g_debugger_lifetime->Terminate(); }
// main
//----------------------------------------------------------------------
int main(int argc, char *argv[]) {
+ llvm::StringRef ToolName = argv[0];
+ llvm::sys::PrintStackTraceOnErrorSignal(ToolName);
+ llvm::PrettyStackTraceProgram X(argc, argv);
+
int option_error = 0;
const char *progname = argv[0];
if (argc < 2) {
diff --git a/tools/lldb-test/SystemInitializerTest.cpp b/tools/lldb-test/SystemInitializerTest.cpp
index cae395e133ee..2c190ecfc745 100644
--- a/tools/lldb-test/SystemInitializerTest.cpp
+++ b/tools/lldb-test/SystemInitializerTest.cpp
@@ -33,6 +33,7 @@
#include "Plugins/ABI/SysV-s390x/ABISysV_s390x.h"
#include "Plugins/ABI/SysV-x86_64/ABISysV_x86_64.h"
#include "Plugins/Architecture/Arm/ArchitectureArm.h"
+#include "Plugins/Architecture/PPC64/ArchitecturePPC64.h"
#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h"
#include "Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h"
@@ -40,6 +41,7 @@
#include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
#include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
#include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
+#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
#include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
#include "Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
#include "Plugins/InstrumentationRuntime/TSan/TSanRuntime.h"
@@ -58,6 +60,9 @@
#include "Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h"
#include "Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.h"
#include "Plugins/MemoryHistory/asan/MemoryHistoryASan.h"
+#include "Plugins/ObjectFile/ELF/ObjectFileELF.h"
+#include "Plugins/ObjectFile/Mach-O/ObjectFileMachO.h"
+#include "Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h"
#include "Plugins/OperatingSystem/Go/OperatingSystemGo.h"
#include "Plugins/Platform/Android/PlatformAndroid.h"
#include "Plugins/Platform/FreeBSD/PlatformFreeBSD.h"
@@ -117,6 +122,11 @@ SystemInitializerTest::~SystemInitializerTest() {}
void SystemInitializerTest::Initialize() {
SystemInitializerCommon::Initialize();
+
+ ObjectFileELF::Initialize();
+ ObjectFileMachO::Initialize();
+ ObjectFilePECOFF::Initialize();
+
ScriptInterpreterNone::Initialize();
OperatingSystemGo::Initialize();
@@ -161,6 +171,7 @@ void SystemInitializerTest::Initialize() {
ABISysV_s390x::Initialize();
ArchitectureArm::Initialize();
+ ArchitecturePPC64::Initialize();
DisassemblerLLVMC::Initialize();
@@ -180,6 +191,7 @@ void SystemInitializerTest::Initialize() {
UnwindAssemblyInstEmulation::Initialize();
UnwindAssembly_x86::Initialize();
EmulateInstructionARM64::Initialize();
+ EmulateInstructionPPC64::Initialize();
SymbolFileDWARFDebugMap::Initialize();
ItaniumABILanguageRuntime::Initialize();
AppleObjCRuntimeV2::Initialize();
@@ -283,6 +295,7 @@ void SystemInitializerTest::Terminate() {
UnwindAssembly_x86::Terminate();
UnwindAssemblyInstEmulation::Terminate();
EmulateInstructionARM64::Terminate();
+ EmulateInstructionPPC64::Terminate();
SymbolFileDWARFDebugMap::Terminate();
ItaniumABILanguageRuntime::Terminate();
AppleObjCRuntimeV2::Terminate();
@@ -340,6 +353,10 @@ void SystemInitializerTest::Terminate() {
PlatformDarwinKernel::Terminate();
#endif
+ ObjectFileELF::Terminate();
+ ObjectFileMachO::Terminate();
+ ObjectFilePECOFF::Terminate();
+
// Now shutdown the common parts, in reverse order.
SystemInitializerCommon::Terminate();
}
diff --git a/tools/lldb-test/lldb-test.cpp b/tools/lldb-test/lldb-test.cpp
index 1fe2f5b63859..c9225f63d303 100644
--- a/tools/lldb-test/lldb-test.cpp
+++ b/tools/lldb-test/lldb-test.cpp
@@ -11,20 +11,37 @@
#include "SystemInitializerTest.h"
#include "Plugins/SymbolFile/DWARF/SymbolFileDWARF.h"
+#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/Section.h"
+#include "lldb/Expression/IRMemoryMap.h"
#include "lldb/Initialization/SystemLifetimeManager.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ClangASTImporter.h"
+#include "lldb/Symbol/CompileUnit.h"
+#include "lldb/Symbol/LineTable.h"
+#include "lldb/Symbol/SymbolVendor.h"
+#include "lldb/Symbol/TypeList.h"
+#include "lldb/Symbol/VariableList.h"
+#include "lldb/Target/Process.h"
+#include "lldb/Target/Target.h"
+#include "lldb/Utility/CleanUp.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/StreamString.h"
+#include "llvm/ADT/IntervalMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/ManagedStatic.h"
+#include "llvm/Support/MathExtras.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Signals.h"
+#include "llvm/Support/WithColor.h"
+#include <cstdio>
#include <thread>
using namespace lldb;
@@ -32,55 +49,597 @@ using namespace lldb_private;
using namespace llvm;
namespace opts {
-cl::SubCommand ModuleSubcommand("module-sections",
- "Display LLDB Module Information");
+static cl::SubCommand BreakpointSubcommand("breakpoints",
+ "Test breakpoint resolution");
+cl::SubCommand ObjectFileSubcommand("object-file",
+ "Display LLDB object file information");
cl::SubCommand SymbolsSubcommand("symbols", "Dump symbols for an object file");
+cl::SubCommand IRMemoryMapSubcommand("ir-memory-map", "Test IRMemoryMap");
-namespace module {
+cl::opt<std::string> Log("log", cl::desc("Path to a log file"), cl::init(""),
+ cl::sub(BreakpointSubcommand),
+ cl::sub(ObjectFileSubcommand),
+ cl::sub(SymbolsSubcommand),
+ cl::sub(IRMemoryMapSubcommand));
+
+/// Create a target using the file pointed to by \p Filename, or abort.
+TargetSP createTarget(Debugger &Dbg, const std::string &Filename);
+
+/// Read \p Filename into a null-terminated buffer, or abort.
+std::unique_ptr<MemoryBuffer> openFile(const std::string &Filename);
+
+namespace breakpoint {
+static cl::opt<std::string> Target(cl::Positional, cl::desc("<target>"),
+ cl::Required, cl::sub(BreakpointSubcommand));
+static cl::opt<std::string> CommandFile(cl::Positional,
+ cl::desc("<command-file>"),
+ cl::init("-"),
+ cl::sub(BreakpointSubcommand));
+static cl::opt<bool> Persistent(
+ "persistent",
+ cl::desc("Don't automatically remove all breakpoints before each command"),
+ cl::sub(BreakpointSubcommand));
+
+static llvm::StringRef plural(uintmax_t value) { return value == 1 ? "" : "s"; }
+static void dumpState(const BreakpointList &List, LinePrinter &P);
+static std::string substitute(StringRef Cmd);
+static int evaluateBreakpoints(Debugger &Dbg);
+} // namespace breakpoint
+
+namespace object {
cl::opt<bool> SectionContents("contents",
cl::desc("Dump each section's contents"),
- cl::sub(ModuleSubcommand));
+ cl::sub(ObjectFileSubcommand));
cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input files>"),
- cl::OneOrMore, cl::sub(ModuleSubcommand));
-} // namespace module
+ cl::OneOrMore,
+ cl::sub(ObjectFileSubcommand));
+} // namespace object
namespace symbols {
-cl::list<std::string> InputFilenames(cl::Positional, cl::desc("<input files>"),
- cl::OneOrMore, cl::sub(SymbolsSubcommand));
+static cl::list<std::string> InputFilenames(cl::Positional,
+ cl::desc("<input files>"),
+ cl::OneOrMore,
+ cl::sub(SymbolsSubcommand));
+enum class FindType {
+ None,
+ Function,
+ Namespace,
+ Type,
+ Variable,
+};
+static cl::opt<FindType> Find(
+ "find", cl::desc("Choose search type:"),
+ cl::values(
+ clEnumValN(FindType::None, "none", "No search, just dump the module."),
+ clEnumValN(FindType::Function, "function", "Find functions."),
+ clEnumValN(FindType::Namespace, "namespace", "Find namespaces."),
+ clEnumValN(FindType::Type, "type", "Find types."),
+ clEnumValN(FindType::Variable, "variable", "Find global variables.")),
+ cl::sub(SymbolsSubcommand));
+
+static cl::opt<std::string> Name("name", cl::desc("Name to find."),
+ cl::sub(SymbolsSubcommand));
+static cl::opt<bool>
+ Regex("regex",
+ cl::desc("Search using regular expressions (avaliable for variables "
+ "and functions only)."),
+ cl::sub(SymbolsSubcommand));
+static cl::opt<std::string>
+ Context("context",
+ cl::desc("Restrict search to the context of the given variable."),
+ cl::value_desc("variable"), cl::sub(SymbolsSubcommand));
+
+static cl::list<FunctionNameType> FunctionNameFlags(
+ "function-flags", cl::desc("Function search flags:"),
+ cl::values(clEnumValN(eFunctionNameTypeAuto, "auto",
+ "Automatically deduce flags based on name."),
+ clEnumValN(eFunctionNameTypeFull, "full", "Full function name."),
+ clEnumValN(eFunctionNameTypeBase, "base", "Base name."),
+ clEnumValN(eFunctionNameTypeMethod, "method", "Method name."),
+ clEnumValN(eFunctionNameTypeSelector, "selector",
+ "Selector name.")),
+ cl::sub(SymbolsSubcommand));
+static FunctionNameType getFunctionNameFlags() {
+ FunctionNameType Result = FunctionNameType(0);
+ for (FunctionNameType Flag : FunctionNameFlags)
+ Result = FunctionNameType(Result | Flag);
+ return Result;
}
+
+static cl::opt<bool> Verify("verify", cl::desc("Verify symbol information."),
+ cl::sub(SymbolsSubcommand));
+
+static cl::opt<std::string> File("file",
+ cl::desc("File (compile unit) to search."),
+ cl::sub(SymbolsSubcommand));
+static cl::opt<int> Line("line", cl::desc("Line to search."),
+ cl::sub(SymbolsSubcommand));
+
+static Expected<CompilerDeclContext> getDeclContext(SymbolVendor &Vendor);
+
+static Error findFunctions(lldb_private::Module &Module);
+static Error findNamespaces(lldb_private::Module &Module);
+static Error findTypes(lldb_private::Module &Module);
+static Error findVariables(lldb_private::Module &Module);
+static Error dumpModule(lldb_private::Module &Module);
+static Error verify(lldb_private::Module &Module);
+
+static Expected<Error (*)(lldb_private::Module &)> getAction();
+static int dumpSymbols(Debugger &Dbg);
+} // namespace symbols
+
+namespace irmemorymap {
+static cl::opt<std::string> Target(cl::Positional, cl::desc("<target>"),
+ cl::Required,
+ cl::sub(IRMemoryMapSubcommand));
+static cl::opt<std::string> CommandFile(cl::Positional,
+ cl::desc("<command-file>"),
+ cl::init("-"),
+ cl::sub(IRMemoryMapSubcommand));
+static cl::opt<bool> UseHostOnlyAllocationPolicy(
+ "host-only", cl::desc("Use the host-only allocation policy"),
+ cl::init(false), cl::sub(IRMemoryMapSubcommand));
+
+using AllocationT = std::pair<addr_t, addr_t>;
+using AddrIntervalMap =
+ IntervalMap<addr_t, unsigned, 8, IntervalMapHalfOpenInfo<addr_t>>;
+
+struct IRMemoryMapTestState {
+ TargetSP Target;
+ IRMemoryMap Map;
+
+ AddrIntervalMap::Allocator IntervalMapAllocator;
+ AddrIntervalMap Allocations;
+
+ StringMap<addr_t> Label2AddrMap;
+
+ IRMemoryMapTestState(TargetSP Target)
+ : Target(Target), Map(Target), Allocations(IntervalMapAllocator) {}
+};
+
+bool areAllocationsOverlapping(const AllocationT &L, const AllocationT &R);
+bool evalMalloc(StringRef Line, IRMemoryMapTestState &State);
+bool evalFree(StringRef Line, IRMemoryMapTestState &State);
+int evaluateMemoryMapCommands(Debugger &Dbg);
+} // namespace irmemorymap
+
} // namespace opts
-static llvm::ManagedStatic<SystemLifetimeManager> DebuggerLifetime;
+template <typename... Args>
+static Error make_string_error(const char *Format, Args &&... args) {
+ return llvm::make_error<llvm::StringError>(
+ llvm::formatv(Format, std::forward<Args>(args)...).str(),
+ llvm::inconvertibleErrorCode());
+}
+
+TargetSP opts::createTarget(Debugger &Dbg, const std::string &Filename) {
+ TargetSP Target;
+ Status ST =
+ Dbg.GetTargetList().CreateTarget(Dbg, Filename, /*triple*/ "",
+ /*get_dependent_modules*/ false,
+ /*platform_options*/ nullptr, Target);
+ if (ST.Fail()) {
+ errs() << formatv("Failed to create target '{0}: {1}\n", Filename, ST);
+ exit(1);
+ }
+ return Target;
+}
+
+std::unique_ptr<MemoryBuffer> opts::openFile(const std::string &Filename) {
+ auto MB = MemoryBuffer::getFileOrSTDIN(Filename);
+ if (!MB) {
+ errs() << formatv("Could not open file '{0}: {1}\n", Filename,
+ MB.getError().message());
+ exit(1);
+ }
+ return std::move(*MB);
+}
+
+void opts::breakpoint::dumpState(const BreakpointList &List, LinePrinter &P) {
+ P.formatLine("{0} breakpoint{1}", List.GetSize(), plural(List.GetSize()));
+ if (List.GetSize() > 0)
+ P.formatLine("At least one breakpoint.");
+ for (size_t i = 0, e = List.GetSize(); i < e; ++i) {
+ BreakpointSP BP = List.GetBreakpointAtIndex(i);
+ P.formatLine("Breakpoint ID {0}:", BP->GetID());
+ AutoIndent Indent(P, 2);
+ P.formatLine("{0} location{1}.", BP->GetNumLocations(),
+ plural(BP->GetNumLocations()));
+ if (BP->GetNumLocations() > 0)
+ P.formatLine("At least one location.");
+ P.formatLine("{0} resolved location{1}.", BP->GetNumResolvedLocations(),
+ plural(BP->GetNumResolvedLocations()));
+ if (BP->GetNumResolvedLocations() > 0)
+ P.formatLine("At least one resolved location.");
+ for (size_t l = 0, le = BP->GetNumLocations(); l < le; ++l) {
+ BreakpointLocationSP Loc = BP->GetLocationAtIndex(l);
+ P.formatLine("Location ID {0}:", Loc->GetID());
+ AutoIndent Indent(P, 2);
+ P.formatLine("Enabled: {0}", Loc->IsEnabled());
+ P.formatLine("Resolved: {0}", Loc->IsResolved());
+ SymbolContext sc;
+ Loc->GetAddress().CalculateSymbolContext(&sc);
+ lldb_private::StreamString S;
+ sc.DumpStopContext(&S, BP->GetTarget().GetProcessSP().get(),
+ Loc->GetAddress(), false, true, false, true, true);
+ P.formatLine("Address: {0}", S.GetString());
+ }
+ }
+ P.NewLine();
+}
+
+std::string opts::breakpoint::substitute(StringRef Cmd) {
+ std::string Result;
+ raw_string_ostream OS(Result);
+ while (!Cmd.empty()) {
+ switch (Cmd[0]) {
+ case '%':
+ if (Cmd.consume_front("%p") && (Cmd.empty() || !isalnum(Cmd[0]))) {
+ OS << sys::path::parent_path(breakpoint::CommandFile);
+ break;
+ }
+ // fall through
+ default:
+ size_t pos = Cmd.find('%');
+ OS << Cmd.substr(0, pos);
+ Cmd = Cmd.substr(pos);
+ break;
+ }
+ }
+ return std::move(OS.str());
+}
+
+int opts::breakpoint::evaluateBreakpoints(Debugger &Dbg) {
+ TargetSP Target = opts::createTarget(Dbg, breakpoint::Target);
+ std::unique_ptr<MemoryBuffer> MB = opts::openFile(breakpoint::CommandFile);
+
+ LinePrinter P(4, outs());
+ StringRef Rest = MB->getBuffer();
+ int HadErrors = 0;
+ while (!Rest.empty()) {
+ StringRef Line;
+ std::tie(Line, Rest) = Rest.split('\n');
+ Line = Line.ltrim();
+ if (Line.empty() || Line[0] == '#')
+ continue;
+
+ if (!Persistent)
+ Target->RemoveAllBreakpoints(/*internal_also*/ true);
+
+ std::string Command = substitute(Line);
+ P.formatLine("Command: {0}", Command);
+ CommandReturnObject Result;
+ if (!Dbg.GetCommandInterpreter().HandleCommand(
+ Command.c_str(), /*add_to_history*/ eLazyBoolNo, Result)) {
+ P.formatLine("Failed: {0}", Result.GetErrorData());
+ HadErrors = 1;
+ continue;
+ }
+
+ dumpState(Target->GetBreakpointList(/*internal*/ false), P);
+ }
+ return HadErrors;
+}
+
+Expected<CompilerDeclContext>
+opts::symbols::getDeclContext(SymbolVendor &Vendor) {
+ if (Context.empty())
+ return CompilerDeclContext();
+ VariableList List;
+ Vendor.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
+ if (List.Empty())
+ return make_string_error("Context search didn't find a match.");
+ if (List.GetSize() > 1)
+ return make_string_error("Context search found multiple matches.");
+ return List.GetVariableAtIndex(0)->GetDeclContext();
+}
+
+Error opts::symbols::findFunctions(lldb_private::Module &Module) {
+ SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ SymbolContextList List;
+ if (!File.empty()) {
+ assert(Line != 0);
+
+ FileSpec src_file(File, false);
+ size_t cu_count = Module.GetNumCompileUnits();
+ for (size_t i = 0; i < cu_count; i++) {
+ lldb::CompUnitSP cu_sp = Module.GetCompileUnitAtIndex(i);
+ if (!cu_sp)
+ continue;
+
+ LineEntry le;
+ cu_sp->FindLineEntry(0, Line, &src_file, false, &le);
+ if (!le.IsValid())
+ continue;
+
+ auto addr = le.GetSameLineContiguousAddressRange().GetBaseAddress();
+ if (!addr.IsValid())
+ continue;
+
+ SymbolContext sc;
+ uint32_t resolved =
+ addr.CalculateSymbolContext(&sc, eSymbolContextFunction);
+ if (resolved & eSymbolContextFunction)
+ List.Append(sc);
+ }
+ } else if (Regex) {
+ RegularExpression RE(Name);
+ assert(RE.IsValid());
+ Vendor.FindFunctions(RE, true, false, List);
+ } else {
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ if (!ContextOr)
+ return ContextOr.takeError();
+ CompilerDeclContext *ContextPtr =
+ ContextOr->IsValid() ? &*ContextOr : nullptr;
+
+ Vendor.FindFunctions(ConstString(Name), ContextPtr, getFunctionNameFlags(),
+ true, false, List);
+ }
+ outs() << formatv("Found {0} functions:\n", List.GetSize());
+ StreamString Stream;
+ List.Dump(&Stream, nullptr);
+ outs() << Stream.GetData() << "\n";
+ return Error::success();
+}
+
+Error opts::symbols::findNamespaces(lldb_private::Module &Module) {
+ SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ if (!ContextOr)
+ return ContextOr.takeError();
+ CompilerDeclContext *ContextPtr =
+ ContextOr->IsValid() ? &*ContextOr : nullptr;
+
+ SymbolContext SC;
+ CompilerDeclContext Result =
+ Vendor.FindNamespace(SC, ConstString(Name), ContextPtr);
+ if (Result)
+ outs() << "Found namespace: "
+ << Result.GetScopeQualifiedName().GetStringRef() << "\n";
+ else
+ outs() << "Namespace not found.\n";
+ return Error::success();
+}
+
+Error opts::symbols::findTypes(lldb_private::Module &Module) {
+ SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ if (!ContextOr)
+ return ContextOr.takeError();
+ CompilerDeclContext *ContextPtr =
+ ContextOr->IsValid() ? &*ContextOr : nullptr;
+
+ SymbolContext SC;
+ DenseSet<SymbolFile *> SearchedFiles;
+ TypeMap Map;
+ Vendor.FindTypes(SC, ConstString(Name), ContextPtr, true, UINT32_MAX,
+ SearchedFiles, Map);
+
+ outs() << formatv("Found {0} types:\n", Map.GetSize());
+ StreamString Stream;
+ Map.Dump(&Stream, false);
+ outs() << Stream.GetData() << "\n";
+ return Error::success();
+}
+
+Error opts::symbols::findVariables(lldb_private::Module &Module) {
+ SymbolVendor &Vendor = *Module.GetSymbolVendor();
+ VariableList List;
+ if (Regex) {
+ RegularExpression RE(Name);
+ assert(RE.IsValid());
+ Vendor.FindGlobalVariables(RE, UINT32_MAX, List);
+ } else if (!File.empty()) {
+ CompUnitSP CU;
+ for (size_t Ind = 0; !CU && Ind < Module.GetNumCompileUnits(); ++Ind) {
+ CompUnitSP Candidate = Module.GetCompileUnitAtIndex(Ind);
+ if (!Candidate || Candidate->GetFilename().GetStringRef() != File)
+ continue;
+ if (CU)
+ return make_string_error("Multiple compile units for file `{0}` found.",
+ File);
+ CU = std::move(Candidate);
+ }
+
+ if (!CU)
+ return make_string_error("Compile unit `{0}` not found.", File);
+
+ List.AddVariables(CU->GetVariableList(true).get());
+ } else {
+ Expected<CompilerDeclContext> ContextOr = getDeclContext(Vendor);
+ if (!ContextOr)
+ return ContextOr.takeError();
+ CompilerDeclContext *ContextPtr =
+ ContextOr->IsValid() ? &*ContextOr : nullptr;
+
+ Vendor.FindGlobalVariables(ConstString(Name), ContextPtr, UINT32_MAX, List);
+ }
+ outs() << formatv("Found {0} variables:\n", List.GetSize());
+ StreamString Stream;
+ List.Dump(&Stream, false);
+ outs() << Stream.GetData() << "\n";
+ return Error::success();
+}
+
+Error opts::symbols::dumpModule(lldb_private::Module &Module) {
+ StreamString Stream;
+ Module.ParseAllDebugSymbols();
+ Module.Dump(&Stream);
+ outs() << Stream.GetData() << "\n";
+ return Error::success();
+}
+
+Error opts::symbols::verify(lldb_private::Module &Module) {
+ SymbolVendor &plugin = *Module.GetSymbolVendor();
+
+ SymbolFile *symfile = plugin.GetSymbolFile();
+ if (!symfile)
+ return make_string_error("Module has no symbol file.");
+
+ uint32_t comp_units_count = symfile->GetNumCompileUnits();
+
+ outs() << "Found " << comp_units_count << " compile units.\n";
+
+ for (uint32_t i = 0; i < comp_units_count; i++) {
+ lldb::CompUnitSP comp_unit = symfile->ParseCompileUnitAtIndex(i);
+ if (!comp_unit)
+ return make_string_error("Connot parse compile unit {0}.", i);
+
+ outs() << "Processing '" << comp_unit->GetFilename().AsCString()
+ << "' compile unit.\n";
-static void dumpSymbols(Debugger &Dbg) {
- for (const auto &File : opts::symbols::InputFilenames) {
+ LineTable *lt = comp_unit->GetLineTable();
+ if (!lt)
+ return make_string_error("Can't get a line table of a compile unit.");
+
+ uint32_t count = lt->GetSize();
+
+ outs() << "The line table contains " << count << " entries.\n";
+
+ if (count == 0)
+ continue;
+
+ LineEntry le;
+ if (!lt->GetLineEntryAtIndex(0, le))
+ return make_string_error("Can't get a line entry of a compile unit.");
+
+ for (uint32_t i = 1; i < count; i++) {
+ lldb::addr_t curr_end =
+ le.range.GetBaseAddress().GetFileAddress() + le.range.GetByteSize();
+
+ if (!lt->GetLineEntryAtIndex(i, le))
+ return make_string_error("Can't get a line entry of a compile unit");
+
+ if (curr_end > le.range.GetBaseAddress().GetFileAddress())
+ return make_string_error(
+ "Line table of a compile unit is inconsistent.");
+ }
+ }
+
+ outs() << "The symbol information is verified.\n";
+
+ return Error::success();
+}
+
+Expected<Error (*)(lldb_private::Module &)> opts::symbols::getAction() {
+ if (Verify) {
+ if (Find != FindType::None)
+ return make_string_error(
+ "Cannot both search and verify symbol information.");
+ if (Regex || !Context.empty() || !Name.empty() || !File.empty() ||
+ Line != 0)
+ return make_string_error(
+ "-regex, -context, -name, -file and -line options are not "
+ "applicable for symbol verification.");
+ return verify;
+ }
+
+ if (Regex && !Context.empty())
+ return make_string_error(
+ "Cannot search using both regular expressions and context.");
+
+ if (Regex && !RegularExpression(Name).IsValid())
+ return make_string_error("`{0}` is not a valid regular expression.", Name);
+
+ if (Regex + !Context.empty() + !File.empty() >= 2)
+ return make_string_error(
+ "Only one of -regex, -context and -file may be used simultaneously.");
+ if (Regex && Name.empty())
+ return make_string_error("-regex used without a -name");
+
+ switch (Find) {
+ case FindType::None:
+ if (!Context.empty() || !Name.empty() || !File.empty() || Line != 0)
+ return make_string_error(
+ "Specify search type (-find) to use search options.");
+ return dumpModule;
+
+ case FindType::Function:
+ if (!File.empty() + (Line != 0) == 1)
+ return make_string_error("Both file name and line number must be "
+ "specified when searching a function "
+ "by file position.");
+ if (Regex + (getFunctionNameFlags() != 0) + !File.empty() >= 2)
+ return make_string_error("Only one of regular expression, function-flags "
+ "and file position may be used simultaneously "
+ "when searching a function.");
+ return findFunctions;
+
+ case FindType::Namespace:
+ if (Regex || !File.empty() || Line != 0)
+ return make_string_error("Cannot search for namespaces using regular "
+ "expressions, file names or line numbers.");
+ return findNamespaces;
+
+ case FindType::Type:
+ if (Regex || !File.empty() || Line != 0)
+ return make_string_error("Cannot search for types using regular "
+ "expressions, file names or line numbers.");
+ return findTypes;
+
+ case FindType::Variable:
+ if (Line != 0)
+ return make_string_error("Cannot search for variables "
+ "using line numbers.");
+ return findVariables;
+ }
+}
+
+int opts::symbols::dumpSymbols(Debugger &Dbg) {
+ auto ActionOr = getAction();
+ if (!ActionOr) {
+ logAllUnhandledErrors(ActionOr.takeError(), WithColor::error(), "");
+ return 1;
+ }
+ auto Action = *ActionOr;
+
+ int HadErrors = 0;
+ for (const auto &File : InputFilenames) {
+ outs() << "Module: " << File << "\n";
ModuleSpec Spec{FileSpec(File, false)};
- Spec.GetSymbolFileSpec().SetFile(File, false);
+ Spec.GetSymbolFileSpec().SetFile(File, false, FileSpec::Style::native);
auto ModulePtr = std::make_shared<lldb_private::Module>(Spec);
+ SymbolVendor *Vendor = ModulePtr->GetSymbolVendor();
+ if (!Vendor) {
+ WithColor::error() << "Module has no symbol vendor.\n";
+ HadErrors = 1;
+ continue;
+ }
- StreamString Stream;
- ModulePtr->ParseAllDebugSymbols();
- ModulePtr->Dump(&Stream);
- llvm::outs() << Stream.GetData() << "\n";
- llvm::outs().flush();
+ if (Error E = Action(*ModulePtr)) {
+ WithColor::error() << toString(std::move(E)) << "\n";
+ HadErrors = 1;
+ }
+
+ outs().flush();
}
+ return HadErrors;
}
-static void dumpModules(Debugger &Dbg) {
+static int dumpObjectFiles(Debugger &Dbg) {
LinePrinter Printer(4, llvm::outs());
- for (const auto &File : opts::module::InputFilenames) {
+ int HadErrors = 0;
+ for (const auto &File : opts::object::InputFilenames) {
ModuleSpec Spec{FileSpec(File, false)};
- Spec.GetSymbolFileSpec().SetFile(File, false);
auto ModulePtr = std::make_shared<lldb_private::Module>(Spec);
+ // Fetch symbol vendor before we get the section list to give the symbol
+ // vendor a chance to populate it.
+ ModulePtr->GetSymbolVendor();
SectionList *Sections = ModulePtr->GetSectionList();
if (!Sections) {
llvm::errs() << "Could not load sections for module " << File << "\n";
+ HadErrors = 1;
continue;
}
+ Printer.formatLine("Architecture: {0}",
+ ModulePtr->GetArchitecture().GetTriple().getTriple());
+ Printer.formatLine("UUID: {0}", ModulePtr->GetUUID().GetAsString());
+
size_t Count = Sections->GetNumSections(0);
Printer.formatLine("Showing {0} sections", Count);
for (size_t I = 0; I < Count; ++I) {
@@ -89,10 +648,11 @@ static void dumpModules(Debugger &Dbg) {
assert(S);
Printer.formatLine("Index: {0}", I);
Printer.formatLine("Name: {0}", S->GetName().GetStringRef());
+ Printer.formatLine("Type: {0}", S->GetTypeAsCString());
Printer.formatLine("VM size: {0}", S->GetByteSize());
Printer.formatLine("File size: {0}", S->GetFileSize());
- if (opts::module::SectionContents) {
+ if (opts::object::SectionContents) {
DataExtractor Data;
S->GetSectionData(Data);
ArrayRef<uint8_t> Bytes = {Data.GetDataStart(), Data.GetDataEnd()};
@@ -101,6 +661,170 @@ static void dumpModules(Debugger &Dbg) {
Printer.NewLine();
}
}
+ return HadErrors;
+}
+
+/// Check if two half-open intervals intersect:
+/// http://world.std.com/~swmcd/steven/tech/interval.html
+bool opts::irmemorymap::areAllocationsOverlapping(const AllocationT &L,
+ const AllocationT &R) {
+ return R.first < L.second && L.first < R.second;
+}
+
+bool opts::irmemorymap::evalMalloc(StringRef Line,
+ IRMemoryMapTestState &State) {
+ // ::= <label> = malloc <size> <alignment>
+ StringRef Label;
+ std::tie(Label, Line) = Line.split('=');
+ if (Line.empty())
+ return false;
+ Label = Label.trim();
+ Line = Line.trim();
+ size_t Size;
+ uint8_t Alignment;
+ int Matches = sscanf(Line.data(), "malloc %zu %hhu", &Size, &Alignment);
+ if (Matches != 2)
+ return false;
+
+ outs() << formatv("Command: {0} = malloc(size={1}, alignment={2})\n", Label,
+ Size, Alignment);
+ if (!isPowerOf2_32(Alignment)) {
+ outs() << "Malloc error: alignment is not a power of 2\n";
+ exit(1);
+ }
+
+ IRMemoryMap::AllocationPolicy AP =
+ UseHostOnlyAllocationPolicy ? IRMemoryMap::eAllocationPolicyHostOnly
+ : IRMemoryMap::eAllocationPolicyProcessOnly;
+
+ // Issue the malloc in the target process with "-rw" permissions.
+ const uint32_t Permissions = 0x3;
+ const bool ZeroMemory = false;
+ Status ST;
+ addr_t Addr =
+ State.Map.Malloc(Size, Alignment, Permissions, AP, ZeroMemory, ST);
+ if (ST.Fail()) {
+ outs() << formatv("Malloc error: {0}\n", ST);
+ return true;
+ }
+
+ // Print the result of the allocation before checking its validity.
+ outs() << formatv("Malloc: address = {0:x}\n", Addr);
+
+ // Check that the allocation is aligned.
+ if (!Addr || Addr % Alignment != 0) {
+ outs() << "Malloc error: zero or unaligned allocation detected\n";
+ exit(1);
+ }
+
+ // Check that the allocation does not overlap another allocation. Do so by
+ // testing each allocation which may cover the interval [Addr, EndOfRegion).
+ addr_t EndOfRegion = Addr + Size;
+ auto Probe = State.Allocations.begin();
+ Probe.advanceTo(Addr); //< First interval s.t stop >= Addr.
+ AllocationT NewAllocation = {Addr, EndOfRegion};
+ while (Probe != State.Allocations.end() && Probe.start() < EndOfRegion) {
+ AllocationT ProbeAllocation = {Probe.start(), Probe.stop()};
+ if (areAllocationsOverlapping(ProbeAllocation, NewAllocation)) {
+ outs() << "Malloc error: overlapping allocation detected"
+ << formatv(", previous allocation at [{0:x}, {1:x})\n",
+ Probe.start(), Probe.stop());
+ exit(1);
+ }
+ ++Probe;
+ }
+
+ // Insert the new allocation into the interval map. Use unique allocation IDs
+ // to inhibit interval coalescing.
+ static unsigned AllocationID = 0;
+ if (Size)
+ State.Allocations.insert(Addr, EndOfRegion, AllocationID++);
+
+ // Store the label -> address mapping.
+ State.Label2AddrMap[Label] = Addr;
+
+ return true;
+}
+
+bool opts::irmemorymap::evalFree(StringRef Line, IRMemoryMapTestState &State) {
+ // ::= free <label>
+ if (!Line.consume_front("free"))
+ return false;
+ StringRef Label = Line.trim();
+
+ outs() << formatv("Command: free({0})\n", Label);
+ auto LabelIt = State.Label2AddrMap.find(Label);
+ if (LabelIt == State.Label2AddrMap.end()) {
+ outs() << "Free error: Invalid allocation label\n";
+ exit(1);
+ }
+
+ Status ST;
+ addr_t Addr = LabelIt->getValue();
+ State.Map.Free(Addr, ST);
+ if (ST.Fail()) {
+ outs() << formatv("Free error: {0}\n", ST);
+ exit(1);
+ }
+
+ // Erase the allocation from the live interval map.
+ auto Interval = State.Allocations.find(Addr);
+ if (Interval != State.Allocations.end()) {
+ outs() << formatv("Free: [{0:x}, {1:x})\n", Interval.start(),
+ Interval.stop());
+ Interval.erase();
+ }
+
+ return true;
+}
+
+int opts::irmemorymap::evaluateMemoryMapCommands(Debugger &Dbg) {
+ // Set up a Target.
+ TargetSP Target = opts::createTarget(Dbg, irmemorymap::Target);
+
+ // Set up a Process. In order to allocate memory within a target, this
+ // process must be alive and must support JIT'ing.
+ CommandReturnObject Result;
+ Dbg.SetAsyncExecution(false);
+ CommandInterpreter &CI = Dbg.GetCommandInterpreter();
+ auto IssueCmd = [&](const char *Cmd) -> bool {
+ return CI.HandleCommand(Cmd, eLazyBoolNo, Result);
+ };
+ if (!IssueCmd("b main") || !IssueCmd("run")) {
+ outs() << formatv("Failed: {0}\n", Result.GetErrorData());
+ exit(1);
+ }
+
+ ProcessSP Process = Target->GetProcessSP();
+ if (!Process || !Process->IsAlive() || !Process->CanJIT()) {
+ outs() << "Cannot use process to test IRMemoryMap\n";
+ exit(1);
+ }
+
+ // Set up an IRMemoryMap and associated testing state.
+ IRMemoryMapTestState State(Target);
+
+ // Parse and apply commands from the command file.
+ std::unique_ptr<MemoryBuffer> MB = opts::openFile(irmemorymap::CommandFile);
+ StringRef Rest = MB->getBuffer();
+ while (!Rest.empty()) {
+ StringRef Line;
+ std::tie(Line, Rest) = Rest.split('\n');
+ Line = Line.ltrim();
+
+ if (Line.empty() || Line[0] == '#')
+ continue;
+
+ if (evalMalloc(Line, State))
+ continue;
+
+ if (evalFree(Line, State))
+ continue;
+
+ errs() << "Could not parse line: " << Line << "\n";
+ exit(1);
+ }
+ return 0;
}
int main(int argc, const char *argv[]) {
@@ -111,16 +835,25 @@ int main(int argc, const char *argv[]) {
cl::ParseCommandLineOptions(argc, argv, "LLDB Testing Utility\n");
- DebuggerLifetime->Initialize(llvm::make_unique<SystemInitializerTest>(),
- nullptr);
+ SystemLifetimeManager DebuggerLifetime;
+ DebuggerLifetime.Initialize(llvm::make_unique<SystemInitializerTest>(),
+ nullptr);
+ CleanUp TerminateDebugger([&] { DebuggerLifetime.Terminate(); });
auto Dbg = lldb_private::Debugger::CreateInstance();
- if (opts::ModuleSubcommand)
- dumpModules(*Dbg);
- else if (opts::SymbolsSubcommand)
- dumpSymbols(*Dbg);
+ if (!opts::Log.empty())
+ Dbg->EnableLog("lldb", {"all"}, opts::Log, 0, errs());
- DebuggerLifetime->Terminate();
- return 0;
+ if (opts::BreakpointSubcommand)
+ return opts::breakpoint::evaluateBreakpoints(*Dbg);
+ if (opts::ObjectFileSubcommand)
+ return dumpObjectFiles(*Dbg);
+ if (opts::SymbolsSubcommand)
+ return opts::symbols::dumpSymbols(*Dbg);
+ if (opts::IRMemoryMapSubcommand)
+ return opts::irmemorymap::evaluateMemoryMapCommands(*Dbg);
+
+ WithColor::error() << "No command specified.\n";
+ return 1;
}
diff --git a/unittests/CMakeLists.txt b/unittests/CMakeLists.txt
index 7b8bc678e554..0cb6fdb527ca 100644
--- a/unittests/CMakeLists.txt
+++ b/unittests/CMakeLists.txt
@@ -42,7 +42,7 @@ function(add_lldb_unittest test_name)
add_custom_command(
TARGET ${test_name}
POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/Inputs)
+ COMMAND "${CMAKE_COMMAND}" -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/Inputs)
target_link_libraries(${test_name} PRIVATE ${ARG_LINK_LIBS})
endfunction()
@@ -52,7 +52,7 @@ function(add_unittest_inputs test_name inputs)
add_custom_command(
TARGET ${test_name}
POST_BUILD
- COMMAND "${CMAKE_COMMAND}" -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Inputs/${INPUT} ${CMAKE_CURRENT_BINARY_DIR}/Inputs
+ COMMAND "${CMAKE_COMMAND}" -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Inputs/${INPUT} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/Inputs
COMMENT "Copying ${INPUT} to binary directory.")
endforeach()
endfunction()
diff --git a/unittests/Core/CMakeLists.txt b/unittests/Core/CMakeLists.txt
index 41ace5bcaece..4affb8cabca9 100644
--- a/unittests/Core/CMakeLists.txt
+++ b/unittests/Core/CMakeLists.txt
@@ -1,7 +1,9 @@
add_lldb_unittest(LLDBCoreTests
BroadcasterTest.cpp
DataExtractorTest.cpp
+ EventTest.cpp
ListenerTest.cpp
+ MangledTest.cpp
ScalarTest.cpp
StateTest.cpp
StreamCallbackTest.cpp
@@ -9,6 +11,7 @@ add_lldb_unittest(LLDBCoreTests
LINK_LIBS
lldbCore
lldbHost
+ LLVMTestingSupport
LINK_COMPONENTS
Support
)
diff --git a/unittests/Core/EventTest.cpp b/unittests/Core/EventTest.cpp
new file mode 100644
index 000000000000..32c6f4b1ce4a
--- /dev/null
+++ b/unittests/Core/EventTest.cpp
@@ -0,0 +1,25 @@
+//===-- EventTest.cpp -------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Core/Event.h"
+#include "lldb/Utility/StreamString.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+static std::string to_string(const EventDataBytes &E) {
+ StreamString S;
+ E.Dump(&S);
+ return S.GetString();
+}
+
+TEST(EventTest, DumpEventDataBytes) {
+ EXPECT_EQ(R"("foo")", to_string(EventDataBytes("foo")));
+ EXPECT_EQ("01 02 03", to_string(EventDataBytes("\x01\x02\x03")));
+}
diff --git a/unittests/Core/MangledTest.cpp b/unittests/Core/MangledTest.cpp
new file mode 100644
index 000000000000..7deb901f5601
--- /dev/null
+++ b/unittests/Core/MangledTest.cpp
@@ -0,0 +1,38 @@
+//===-- MangledTest.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Core/Mangled.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+TEST(MangledTest, ResultForValidName) {
+ ConstString MangledName("_ZN1a1b1cIiiiEEvm");
+ bool IsMangled = true;
+
+ Mangled TheMangled(MangledName, IsMangled);
+ const ConstString &TheDemangled =
+ TheMangled.GetDemangledName(eLanguageTypeC_plus_plus);
+
+ ConstString ExpectedResult("void a::b::c<int, int, int>(unsigned long)");
+ EXPECT_STREQ(ExpectedResult.GetCString(), TheDemangled.GetCString());
+}
+
+TEST(MangledTest, EmptyForInvalidName) {
+ ConstString MangledName("_ZN1a1b1cmxktpEEvm");
+ bool IsMangled = true;
+
+ Mangled TheMangled(MangledName, IsMangled);
+ const ConstString &TheDemangled =
+ TheMangled.GetDemangledName(eLanguageTypeC_plus_plus);
+
+ EXPECT_STREQ("", TheDemangled.GetCString());
+}
diff --git a/unittests/Core/ScalarTest.cpp b/unittests/Core/ScalarTest.cpp
index 692aa8aaf119..9c241c26e66c 100644
--- a/unittests/Core/ScalarTest.cpp
+++ b/unittests/Core/ScalarTest.cpp
@@ -14,8 +14,10 @@
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/Status.h"
#include "lldb/Utility/StreamString.h"
+#include "llvm/Testing/Support/Error.h"
using namespace lldb_private;
+using namespace llvm;
TEST(ScalarTest, RightShiftOperator) {
int a = 0x00001000;
@@ -31,7 +33,7 @@ TEST(ScalarTest, RightShiftOperator) {
TEST(ScalarTest, GetBytes) {
int a = 0x01020304;
long long b = 0x0102030405060708LL;
- float c = 1234567.89e42;
+ float c = 1234567.89e32f;
double d = 1234567.89e42;
char e[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
char f[32] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
@@ -73,6 +75,12 @@ TEST(ScalarTest, CastOperations) {
ASSERT_EQ((unsigned long)a, a_scalar.ULong());
ASSERT_EQ((signed long long)a, a_scalar.SLongLong());
ASSERT_EQ((unsigned long long)a, a_scalar.ULongLong());
+
+ int a2 = 23;
+ Scalar a2_scalar(a2);
+ ASSERT_EQ((float)a2, a2_scalar.Float());
+ ASSERT_EQ((double)a2, a2_scalar.Double());
+ ASSERT_EQ((long double)a2, a2_scalar.LongDouble());
}
TEST(ScalarTest, ExtractBitfield) {
@@ -132,3 +140,81 @@ TEST(ScalarTest, GetValue) {
EXPECT_EQ(std::to_string(std::numeric_limits<unsigned long long>::max()),
ScalarGetValue(std::numeric_limits<unsigned long long>::max()));
}
+
+TEST(ScalarTest, Division) {
+ Scalar lhs(5.0);
+ Scalar rhs(2.0);
+ Scalar r = lhs / rhs;
+ EXPECT_TRUE(r.IsValid());
+ EXPECT_EQ(r, Scalar(2.5));
+}
+
+TEST(ScalarTest, Promotion) {
+ static Scalar::Type int_types[] = {
+ Scalar::e_sint, Scalar::e_uint, Scalar::e_slong,
+ Scalar::e_ulong, Scalar::e_slonglong, Scalar::e_ulonglong,
+ Scalar::e_sint128, Scalar::e_uint128, Scalar::e_sint256,
+ Scalar::e_uint256,
+ Scalar::e_void // sentinel
+ };
+
+ static Scalar::Type float_types[] = {
+ Scalar::e_float, Scalar::e_double, Scalar::e_long_double,
+ Scalar::e_void // sentinel
+ };
+
+ for (int i = 0; int_types[i] != Scalar::e_void; ++i) {
+ for (int j = 0; float_types[j] != Scalar::e_void; ++j) {
+ Scalar lhs(2);
+ EXPECT_TRUE(lhs.Promote(int_types[i])) << "int promotion #" << i;
+ Scalar rhs(0.5f);
+ EXPECT_TRUE(rhs.Promote(float_types[j])) << "float promotion #" << j;
+ Scalar x(2.5f);
+ EXPECT_TRUE(x.Promote(float_types[j]));
+ EXPECT_EQ(lhs + rhs, x);
+ }
+ }
+
+ for (int i = 0; float_types[i] != Scalar::e_void; ++i) {
+ for (int j = 0; float_types[j] != Scalar::e_void; ++j) {
+ Scalar lhs(2);
+ EXPECT_TRUE(lhs.Promote(float_types[i])) << "float promotion #" << i;
+ Scalar rhs(0.5f);
+ EXPECT_TRUE(rhs.Promote(float_types[j])) << "float promotion #" << j;
+ Scalar x(2.5f);
+ EXPECT_TRUE(x.Promote(float_types[j]));
+ EXPECT_EQ(lhs + rhs, x);
+ }
+ }
+}
+
+TEST(ScalarTest, SetValueFromCString) {
+ Scalar a;
+
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("1234567890123", lldb::eEncodingUint, 8).ToError(),
+ Succeeded());
+ EXPECT_EQ(1234567890123ull, a);
+
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("-1234567890123", lldb::eEncodingSint, 8).ToError(),
+ Succeeded());
+ EXPECT_EQ(-1234567890123ll, a);
+
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("asdf", lldb::eEncodingSint, 8).ToError(),
+ Failed());
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("asdf", lldb::eEncodingUint, 8).ToError(),
+ Failed());
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("1234567890123", lldb::eEncodingUint, 4).ToError(),
+ Failed());
+ EXPECT_THAT_ERROR(a.SetValueFromCString("123456789012345678901234567890",
+ lldb::eEncodingUint, 8)
+ .ToError(),
+ Failed());
+ EXPECT_THAT_ERROR(
+ a.SetValueFromCString("-123", lldb::eEncodingUint, 8).ToError(),
+ Failed());
+}
diff --git a/unittests/Expression/CMakeLists.txt b/unittests/Expression/CMakeLists.txt
index c0a701da4f3d..9b1d32fbdae0 100644
--- a/unittests/Expression/CMakeLists.txt
+++ b/unittests/Expression/CMakeLists.txt
@@ -1,7 +1,11 @@
add_lldb_unittest(ExpressionTests
+ ClangParserTest.cpp
GoParserTest.cpp
LINK_LIBS
lldbCore
+ lldbPluginExpressionParserClang
lldbPluginExpressionParserGo
+ lldbUtility
+ lldbUtilityHelpers
)
diff --git a/unittests/Expression/ClangParserTest.cpp b/unittests/Expression/ClangParserTest.cpp
new file mode 100644
index 000000000000..c776e48c9529
--- /dev/null
+++ b/unittests/Expression/ClangParserTest.cpp
@@ -0,0 +1,73 @@
+//===-- ClangParserTest.cpp --------------------------------------*- C++-*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "Plugins/ExpressionParser/Clang/ClangHost.h"
+#include "TestingSupport/TestUtilities.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Utility/FileSpec.h"
+#include "lldb/lldb-defines.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+namespace {
+struct ClangHostTest : public testing::Test {
+ static void SetUpTestCase() { HostInfo::Initialize(); }
+ static void TearDownTestCase() { HostInfo::Terminate(); }
+};
+} // namespace
+
+#ifdef __APPLE__
+static std::string ComputeClangDir(std::string lldb_shlib_path,
+ bool verify = false) {
+ FileSpec clang_dir;
+ FileSpec lldb_shlib_spec(lldb_shlib_path, false);
+ ComputeClangDirectory(lldb_shlib_spec, clang_dir, verify);
+ return clang_dir.GetPath();
+}
+
+TEST_F(ClangHostTest, MacOSX) {
+ // This returns whatever the POSIX fallback returns.
+ std::string posix = "/usr/lib/liblldb.dylib";
+ EXPECT_FALSE(ComputeClangDir(posix).empty());
+
+ std::string build =
+ "/lldb-macosx-x86_64/Library/Frameworks/LLDB.framework/Versions/A";
+ std::string build_clang =
+ "/lldb-macosx-x86_64/Library/Frameworks/LLDB.framework/Resources/Clang";
+ EXPECT_EQ(ComputeClangDir(build), build_clang);
+
+ std::string xcode = "/Applications/Xcode.app/Contents/SharedFrameworks/"
+ "LLDB.framework/Versions/A";
+ std::string xcode_clang =
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/"
+ "XcodeDefault.xctoolchain/usr/lib/swift/clang";
+ EXPECT_EQ(ComputeClangDir(xcode), xcode_clang);
+
+ std::string toolchain =
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/"
+ "Swift-4.1-development-snapshot.xctoolchain/System/Library/"
+ "PrivateFrameworks/LLDB.framework";
+ std::string toolchain_clang =
+ "/Applications/Xcode.app/Contents/Developer/Toolchains/"
+ "Swift-4.1-development-snapshot.xctoolchain/usr/lib/swift/clang";
+ EXPECT_EQ(ComputeClangDir(toolchain), toolchain_clang);
+
+ std::string cltools = "/Library/Developer/CommandLineTools/Library/"
+ "PrivateFrameworks/LLDB.framework";
+ std::string cltools_clang =
+ "/Library/Developer/CommandLineTools/Library/PrivateFrameworks/"
+ "LLDB.framework/Resources/Clang";
+ EXPECT_EQ(ComputeClangDir(cltools), cltools_clang);
+
+ // Test that a bogus path is detected.
+ EXPECT_NE(ComputeClangDir(GetInputFilePath(xcode), true),
+ ComputeClangDir(GetInputFilePath(xcode)));
+}
+#endif
diff --git a/unittests/Host/CMakeLists.txt b/unittests/Host/CMakeLists.txt
index 238026b64c4d..f1768537ed86 100644
--- a/unittests/Host/CMakeLists.txt
+++ b/unittests/Host/CMakeLists.txt
@@ -1,9 +1,9 @@
set (FILES
- FileSpecTest.cpp
FileSystemTest.cpp
HostInfoTest.cpp
HostTest.cpp
MainLoopTest.cpp
+ PredicateTest.cpp
SocketAddressTest.cpp
SocketTest.cpp
SymbolsTest.cpp
@@ -22,4 +22,5 @@ add_lldb_unittest(HostTests
LINK_LIBS
lldbCore
lldbHost
+ lldbUtilityHelpers
)
diff --git a/unittests/Host/HostInfoTest.cpp b/unittests/Host/HostInfoTest.cpp
index 75b8c770bbeb..3870673d0f47 100644
--- a/unittests/Host/HostInfoTest.cpp
+++ b/unittests/Host/HostInfoTest.cpp
@@ -9,6 +9,7 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/lldb-defines.h"
+#include "TestingSupport/TestUtilities.h"
#include "gtest/gtest.h"
using namespace lldb_private;
@@ -42,4 +43,4 @@ TEST_F(HostInfoTest, GetAugmentedArchSpec) {
// Test LLDB_ARCH_DEFAULT
EXPECT_EQ(HostInfo::GetAugmentedArchSpec(LLDB_ARCH_DEFAULT).GetTriple(),
HostInfo::GetArchitecture(HostInfo::eArchKindDefault).GetTriple());
-}
+} \ No newline at end of file
diff --git a/unittests/Host/HostTest.cpp b/unittests/Host/HostTest.cpp
index 14a459ebf257..4fa874d33a05 100644
--- a/unittests/Host/HostTest.cpp
+++ b/unittests/Host/HostTest.cpp
@@ -20,3 +20,9 @@ TEST(Host, WaitStatusFormat) {
EXPECT_EQ("Exited with status 4",
formatv("{0}", WaitStatus{WaitStatus::Exit, 4}).str());
}
+
+TEST(Host, GetEnvironment) {
+ putenv(const_cast<char *>("LLDB_TEST_ENVIRONMENT_VAR=Host::GetEnvironment"));
+ ASSERT_EQ("Host::GetEnvironment",
+ Host::GetEnvironment().lookup("LLDB_TEST_ENVIRONMENT_VAR"));
+}
diff --git a/unittests/Host/PredicateTest.cpp b/unittests/Host/PredicateTest.cpp
new file mode 100644
index 000000000000..88ee6b6fc106
--- /dev/null
+++ b/unittests/Host/PredicateTest.cpp
@@ -0,0 +1,34 @@
+//===-- PredicateTest.cpp ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Host/Predicate.h"
+#include "gtest/gtest.h"
+#include <thread>
+
+using namespace lldb_private;
+
+TEST(Predicate, WaitForValueEqualTo) {
+ Predicate<int> P(0);
+ EXPECT_TRUE(P.WaitForValueEqualTo(0));
+ EXPECT_FALSE(P.WaitForValueEqualTo(1, std::chrono::milliseconds(10)));
+
+ std::thread Setter([&P] {
+ std::this_thread::sleep_for(std::chrono::milliseconds(100));
+ P.SetValue(1, eBroadcastAlways);
+ });
+ EXPECT_TRUE(P.WaitForValueEqualTo(1));
+ Setter.join();
+}
+
+TEST(Predicate, WaitForValueNotEqualTo) {
+ Predicate<int> P(0);
+ EXPECT_EQ(0, P.WaitForValueNotEqualTo(1));
+ EXPECT_EQ(llvm::None,
+ P.WaitForValueNotEqualTo(0, std::chrono::milliseconds(10)));
+}
diff --git a/unittests/Host/SymbolsTest.cpp b/unittests/Host/SymbolsTest.cpp
index d3073310e3e7..253ce39e31b5 100644
--- a/unittests/Host/SymbolsTest.cpp
+++ b/unittests/Host/SymbolsTest.cpp
@@ -26,7 +26,8 @@ TEST(SymbolsTest,
ModuleSpec module_spec;
// using a GUID here because the symbol file shouldn't actually exist on disk
module_spec.GetSymbolFileSpec().SetFile(
- "4A524676-B24B-4F4E-968A-551D465EBAF1.so", false);
+ "4A524676-B24B-4F4E-968A-551D465EBAF1.so", false,
+ FileSpec::Style::native);
FileSpec symbol_file_spec = Symbols::LocateExecutableSymbolFile(module_spec);
EXPECT_TRUE(symbol_file_spec.GetFilename().IsEmpty());
}
diff --git a/unittests/Host/linux/HostTest.cpp b/unittests/Host/linux/HostTest.cpp
index 36d3fd206dac..7ea702d8b18a 100644
--- a/unittests/Host/linux/HostTest.cpp
+++ b/unittests/Host/linux/HostTest.cpp
@@ -45,4 +45,8 @@ TEST_F(HostTest, GetProcessInfo) {
ASSERT_TRUE(Info.GroupIDIsValid());
EXPECT_EQ(getegid(), Info.GetGroupID());
+
+ EXPECT_TRUE(Info.GetArchitecture().IsValid());
+ EXPECT_EQ(HostInfo::GetArchitecture(HostInfo::eArchKindDefault),
+ Info.GetArchitecture());
}
diff --git a/unittests/Interpreter/CMakeLists.txt b/unittests/Interpreter/CMakeLists.txt
index 40fc45d4d640..b654ee12dc07 100644
--- a/unittests/Interpreter/CMakeLists.txt
+++ b/unittests/Interpreter/CMakeLists.txt
@@ -1,6 +1,6 @@
add_lldb_unittest(InterpreterTests
- TestArgs.cpp
TestCompletion.cpp
+ TestOptionArgParser.cpp
LINK_LIBS
lldbInterpreter
diff --git a/unittests/Interpreter/TestArgs.cpp b/unittests/Interpreter/TestArgs.cpp
deleted file mode 100644
index 2aaaab84e211..000000000000
--- a/unittests/Interpreter/TestArgs.cpp
+++ /dev/null
@@ -1,362 +0,0 @@
-//===-- ArgsTest.cpp --------------------------------------------*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "gtest/gtest.h"
-
-#include "lldb/Interpreter/Args.h"
-#include "lldb/Utility/StringList.h"
-
-#include <limits>
-#include <sstream>
-
-using namespace lldb_private;
-
-TEST(ArgsTest, TestSingleArg) {
- Args args;
- args.SetCommandString("arg");
- EXPECT_EQ(1u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg");
-}
-
-TEST(ArgsTest, TestSingleQuotedArgWithSpace) {
- Args args;
- args.SetCommandString("\"arg with space\"");
- EXPECT_EQ(1u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg with space");
-}
-
-TEST(ArgsTest, TestSingleArgWithQuotedSpace) {
- Args args;
- args.SetCommandString("arg\\ with\\ space");
- EXPECT_EQ(1u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg with space");
-}
-
-TEST(ArgsTest, TestMultipleArgs) {
- Args args;
- args.SetCommandString("this has multiple args");
- EXPECT_EQ(4u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "this");
- EXPECT_STREQ(args.GetArgumentAtIndex(1), "has");
- EXPECT_STREQ(args.GetArgumentAtIndex(2), "multiple");
- EXPECT_STREQ(args.GetArgumentAtIndex(3), "args");
-}
-
-TEST(ArgsTest, TestOverwriteArgs) {
- Args args;
- args.SetCommandString("this has multiple args");
- EXPECT_EQ(4u, args.GetArgumentCount());
- args.SetCommandString("arg");
- EXPECT_EQ(1u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg");
-}
-
-TEST(ArgsTest, TestAppendArg) {
- Args args;
- args.SetCommandString("first_arg");
- EXPECT_EQ(1u, args.GetArgumentCount());
- args.AppendArgument(llvm::StringRef("second_arg"));
- EXPECT_EQ(2u, args.GetArgumentCount());
- EXPECT_STREQ(args.GetArgumentAtIndex(0), "first_arg");
- EXPECT_STREQ(args.GetArgumentAtIndex(1), "second_arg");
-}
-
-TEST(ArgsTest, TestInsertArg) {
- Args args;
- args.AppendArgument("1");
- args.AppendArgument("2");
- args.AppendArgument("3");
- args.InsertArgumentAtIndex(1, "1.5");
- args.InsertArgumentAtIndex(4, "3.5");
-
- ASSERT_EQ(5u, args.GetArgumentCount());
- EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
- EXPECT_STREQ("1.5", args.GetArgumentAtIndex(1));
- EXPECT_STREQ("2", args.GetArgumentAtIndex(2));
- EXPECT_STREQ("3", args.GetArgumentAtIndex(3));
- EXPECT_STREQ("3.5", args.GetArgumentAtIndex(4));
-}
-
-TEST(ArgsTest, TestArgv) {
- Args args;
- EXPECT_EQ(nullptr, args.GetArgumentVector());
-
- args.AppendArgument("1");
- EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[1]);
-
- args.AppendArgument("2");
- EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
-
- args.AppendArgument("3");
- EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[3]);
-
- args.InsertArgumentAtIndex(1, "1.5");
- EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
-
- args.InsertArgumentAtIndex(4, "3.5");
- EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
- EXPECT_NE(nullptr, args.GetArgumentVector()[4]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[5]);
-}
-
-TEST(ArgsTest, StringListConstructor) {
- StringList list;
- list << "foo" << "bar" << "baz";
- Args args(list);
- ASSERT_EQ(3u, args.GetArgumentCount());
- EXPECT_EQ("foo", args[0].ref);
- EXPECT_EQ("bar", args[1].ref);
- EXPECT_EQ("baz", args[2].ref);
-}
-
-TEST(ArgsTest, GetQuotedCommandString) {
- Args args;
- const char *str = "process launch -o stdout.txt -- \"a b c\"";
- args.SetCommandString(str);
-
- std::string stdstr;
- ASSERT_TRUE(args.GetQuotedCommandString(stdstr));
- EXPECT_EQ(str, stdstr);
-}
-
-TEST(ArgsTest, BareSingleQuote) {
- Args args;
- args.SetCommandString("a\\'b");
- EXPECT_EQ(1u, args.GetArgumentCount());
-
- EXPECT_STREQ("a'b", args.GetArgumentAtIndex(0));
-}
-
-TEST(ArgsTest, DoubleQuotedItem) {
- Args args;
- args.SetCommandString("\"a b c\"");
- EXPECT_EQ(1u, args.GetArgumentCount());
-
- EXPECT_STREQ("a b c", args.GetArgumentAtIndex(0));
-}
-
-TEST(ArgsTest, AppendArguments) {
- Args args;
- const char *argv[] = {"1", "2", nullptr};
- const char *argv2[] = {"3", "4", nullptr};
-
- args.AppendArguments(argv);
- ASSERT_EQ(2u, args.GetArgumentCount());
- EXPECT_STREQ("1", args.GetArgumentVector()[0]);
- EXPECT_STREQ("2", args.GetArgumentVector()[1]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
- EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
- EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
-
- args.AppendArguments(argv2);
- ASSERT_EQ(4u, args.GetArgumentCount());
- EXPECT_STREQ("1", args.GetArgumentVector()[0]);
- EXPECT_STREQ("2", args.GetArgumentVector()[1]);
- EXPECT_STREQ("3", args.GetArgumentVector()[2]);
- EXPECT_STREQ("4", args.GetArgumentVector()[3]);
- EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
- EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
- EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
- EXPECT_STREQ("3", args.GetArgumentAtIndex(2));
- EXPECT_STREQ("4", args.GetArgumentAtIndex(3));
-}
-
-TEST(ArgsTest, GetArgumentArrayRef) {
- Args args("foo bar");
- auto ref = args.GetArgumentArrayRef();
- ASSERT_EQ(2u, ref.size());
- EXPECT_STREQ("foo", ref[0]);
- EXPECT_STREQ("bar", ref[1]);
-}
-
-TEST(ArgsTest, StringToBoolean) {
- bool success = false;
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("true"), false, nullptr));
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("on"), false, nullptr));
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("yes"), false, nullptr));
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("1"), false, nullptr));
-
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("true"), false, &success));
- EXPECT_TRUE(success);
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("on"), false, &success));
- EXPECT_TRUE(success);
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("yes"), false, &success));
- EXPECT_TRUE(success);
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("1"), false, &success));
- EXPECT_TRUE(success);
-
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("false"), true, nullptr));
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("off"), true, nullptr));
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("no"), true, nullptr));
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("0"), true, nullptr));
-
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("false"), true, &success));
- EXPECT_TRUE(success);
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("off"), true, &success));
- EXPECT_TRUE(success);
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("no"), true, &success));
- EXPECT_TRUE(success);
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("0"), true, &success));
- EXPECT_TRUE(success);
-
- EXPECT_FALSE(Args::StringToBoolean(llvm::StringRef("10"), false, &success));
- EXPECT_FALSE(success);
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef("10"), true, &success));
- EXPECT_FALSE(success);
- EXPECT_TRUE(Args::StringToBoolean(llvm::StringRef(""), true, &success));
- EXPECT_FALSE(success);
-}
-
-TEST(ArgsTest, StringToChar) {
- bool success = false;
-
- EXPECT_EQ('A', Args::StringToChar("A", 'B', nullptr));
- EXPECT_EQ('B', Args::StringToChar("B", 'A', nullptr));
-
- EXPECT_EQ('A', Args::StringToChar("A", 'B', &success));
- EXPECT_TRUE(success);
- EXPECT_EQ('B', Args::StringToChar("B", 'A', &success));
- EXPECT_TRUE(success);
-
- EXPECT_EQ('A', Args::StringToChar("", 'A', &success));
- EXPECT_FALSE(success);
- EXPECT_EQ('A', Args::StringToChar("ABC", 'A', &success));
- EXPECT_FALSE(success);
-}
-
-TEST(ArgsTest, StringToScriptLanguage) {
- bool success = false;
-
- EXPECT_EQ(lldb::eScriptLanguageDefault,
- Args::StringToScriptLanguage(llvm::StringRef("default"),
- lldb::eScriptLanguageNone, nullptr));
- EXPECT_EQ(lldb::eScriptLanguagePython,
- Args::StringToScriptLanguage(llvm::StringRef("python"),
- lldb::eScriptLanguageNone, nullptr));
- EXPECT_EQ(lldb::eScriptLanguageNone,
- Args::StringToScriptLanguage(llvm::StringRef("none"),
- lldb::eScriptLanguagePython, nullptr));
-
- EXPECT_EQ(lldb::eScriptLanguageDefault,
- Args::StringToScriptLanguage(llvm::StringRef("default"),
- lldb::eScriptLanguageNone, &success));
- EXPECT_TRUE(success);
- EXPECT_EQ(lldb::eScriptLanguagePython,
- Args::StringToScriptLanguage(llvm::StringRef("python"),
- lldb::eScriptLanguageNone, &success));
- EXPECT_TRUE(success);
- EXPECT_EQ(lldb::eScriptLanguageNone,
- Args::StringToScriptLanguage(llvm::StringRef("none"),
- lldb::eScriptLanguagePython,
- &success));
- EXPECT_TRUE(success);
-
- EXPECT_EQ(lldb::eScriptLanguagePython,
- Args::StringToScriptLanguage(llvm::StringRef("invalid"),
- lldb::eScriptLanguagePython,
- &success));
- EXPECT_FALSE(success);
-}
-
-TEST(ArgsTest, StringToVersion) {}
-
-// Environment Variable Tests
-
-class EnvVarFixture: public ::testing::Test {
-protected:
-
- void SetUp() {
- args.AppendArgument(llvm::StringRef("Arg1=foo"));
- args.AppendArgument(llvm::StringRef("Arg2"));
- args.AppendArgument(llvm::StringRef("Arg3=bar"));
- }
-
- size_t GetIndexForEnvVar(llvm::StringRef envvar_name) {
- size_t argument_index = std::numeric_limits<size_t>::max();
- EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name,
- &argument_index));
- EXPECT_LT(argument_index, args.GetArgumentCount());
- return argument_index;
- }
-
- Args args;
-};
-
-
-TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNoValue) {
- EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg2")));
-}
-
-TEST_F(EnvVarFixture, TestContainsEnvironmentVariableWithValue) {
- EXPECT_TRUE(args.ContainsEnvironmentVariable(llvm::StringRef("Arg3")));
-}
-
-TEST_F(EnvVarFixture, TestContainsEnvironmentVariableNonExistentVariable) {
- auto nonexistent_envvar = llvm::StringRef("ThisEnvVarShouldNotExist");
- EXPECT_FALSE(args.ContainsEnvironmentVariable(nonexistent_envvar));
-}
-
-TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialNoValueWithNoValue) {
- auto envvar_name = llvm::StringRef("Arg2");
- auto argument_index = GetIndexForEnvVar(envvar_name);
-
- args.AddOrReplaceEnvironmentVariable(envvar_name, llvm::StringRef(""));
- EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
- EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
-}
-
-TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialNoValueWithValue) {
- auto envvar_name = llvm::StringRef("Arg2");
- auto argument_index = GetIndexForEnvVar(envvar_name);
-
- auto new_value = llvm::StringRef("NewValue");
- args.AddOrReplaceEnvironmentVariable(envvar_name, new_value);
- EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
-
- std::stringstream stream;
- stream << envvar_name.str() << '=' << new_value.str();
- EXPECT_EQ(llvm::StringRef(stream.str()),
- args.GetArgumentAtIndex(argument_index));
-}
-
-TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialValueWithNoValue) {
- auto envvar_name = llvm::StringRef("Arg1");
- auto argument_index = GetIndexForEnvVar(envvar_name);
-
- args.AddOrReplaceEnvironmentVariable(envvar_name, llvm::StringRef(""));
- EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
- EXPECT_EQ(envvar_name, args.GetArgumentAtIndex(argument_index));
-}
-
-TEST_F(EnvVarFixture, TestReplaceEnvironmentVariableInitialValueWithValue) {
- auto envvar_name = llvm::StringRef("Arg1");
- auto argument_index = GetIndexForEnvVar(envvar_name);
-
- auto new_value = llvm::StringRef("NewValue");
- args.AddOrReplaceEnvironmentVariable(envvar_name, new_value);
- EXPECT_TRUE(args.ContainsEnvironmentVariable(envvar_name));
-
- std::stringstream stream;
- stream << envvar_name.str() << '=' << new_value.str();
- EXPECT_EQ(llvm::StringRef(stream.str()),
- args.GetArgumentAtIndex(argument_index));
-}
diff --git a/unittests/Interpreter/TestCompletion.cpp b/unittests/Interpreter/TestCompletion.cpp
index 5db7f83db0f9..196cca8ce7bd 100644
--- a/unittests/Interpreter/TestCompletion.cpp
+++ b/unittests/Interpreter/TestCompletion.cpp
@@ -7,10 +7,11 @@
//
//===----------------------------------------------------------------------===//
-#include "gtest/gtest.h"
#include "lldb/Interpreter/CommandCompletions.h"
#include "lldb/Utility/StringList.h"
#include "lldb/Utility/TildeExpressionResolver.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
#include "TestingSupport/MockTildeExpressionResolver.h"
#include "llvm/ADT/SmallString.h"
@@ -51,6 +52,7 @@ protected:
static SmallString<128> DirBar;
static SmallString<128> DirBaz;
static SmallString<128> DirTestFolder;
+ static SmallString<128> DirNested;
static SmallString<128> FileAA;
static SmallString<128> FileAB;
@@ -65,17 +67,17 @@ protected:
llvm::sys::fs::current_path(OriginalWorkingDir);
ASSERT_NO_ERROR(fs::createUniqueDirectory("FsCompletion", BaseDir));
- const char *DirNames[] = {"foo", "fooa", "foob", "fooc",
- "bar", "baz", "test_folder"};
+ const char *DirNames[] = {"foo", "fooa", "foob", "fooc",
+ "bar", "baz", "test_folder", "foo/nested"};
const char *FileNames[] = {"aa1234.tmp", "ab1234.tmp", "ac1234.tmp",
"foo1234.tmp", "bar1234.tmp", "baz1234.tmp"};
- SmallString<128> *Dirs[] = {&DirFoo, &DirFooA, &DirFooB, &DirFooC,
- &DirBar, &DirBaz, &DirTestFolder};
+ SmallString<128> *Dirs[] = {&DirFoo, &DirFooA, &DirFooB, &DirFooC,
+ &DirBar, &DirBaz, &DirTestFolder, &DirNested};
for (auto Dir : llvm::zip(DirNames, Dirs)) {
auto &Path = *std::get<1>(Dir);
Path = BaseDir;
path::append(Path, std::get<0>(Dir));
- ASSERT_NO_ERROR(fs::create_directory(Path));
+ ASSERT_NO_ERROR(fs::create_directories(Path));
}
SmallString<128> *Files[] = {&FileAA, &FileAB, &FileAC,
@@ -102,16 +104,6 @@ protected:
return false;
}
- static bool ContainsExactString(const Twine &Str, const StringList &Paths) {
- SmallString<16> Storage;
- StringRef Rendered = Str.toStringRef(Storage);
- for (size_t I = 0; I < Paths.GetSize(); ++I) {
- if (Paths[I] == Rendered)
- return true;
- }
- return false;
- }
-
void DoDirCompletions(const Twine &Prefix,
StandardTildeExpressionResolver &Resolver,
StringList &Results) {
@@ -146,6 +138,7 @@ SmallString<128> CompletionTest::DirFooC;
SmallString<128> CompletionTest::DirBar;
SmallString<128> CompletionTest::DirBaz;
SmallString<128> CompletionTest::DirTestFolder;
+SmallString<128> CompletionTest::DirNested;
SmallString<128> CompletionTest::FileAA;
SmallString<128> CompletionTest::FileAB;
@@ -155,6 +148,14 @@ SmallString<128> CompletionTest::FileBar;
SmallString<128> CompletionTest::FileBaz;
}
+static std::vector<std::string> toVector(const StringList &SL) {
+ std::vector<std::string> Result;
+ for (size_t Idx = 0; Idx < SL.GetSize(); ++Idx)
+ Result.push_back(SL[Idx]);
+ return Result;
+}
+using testing::UnorderedElementsAre;
+
TEST_F(CompletionTest, DirCompletionAbsolute) {
// All calls to DiskDirectories() return only directories, even when
// there are files which also match. The tests below all check this
@@ -252,55 +253,47 @@ TEST_F(CompletionTest, DirCompletionUsername) {
Resolver.AddKnownUser("Lars", DirFooC);
Resolver.AddKnownUser("Jason", DirFoo);
Resolver.AddKnownUser("Larry", DirFooA);
+ std::string sep = path::get_separator();
// Just resolving current user's home directory by itself should return the
// directory.
StringList Results;
size_t Count = CommandCompletions::DiskDirectories("~", Results, Resolver);
- ASSERT_EQ(1u, Count);
- ASSERT_EQ(Count, Results.GetSize());
- EXPECT_TRUE(ContainsExactString(Twine("~") + path::get_separator(), Results));
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results), UnorderedElementsAre("~" + sep));
// With a slash appended, it should return all items in the directory.
Count = CommandCompletions::DiskDirectories("~/", Results, Resolver);
- ASSERT_EQ(7u, Count);
- ASSERT_EQ(Count, Results.GetSize());
- EXPECT_TRUE(
- ContainsExactString(Twine("~/foo") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~/fooa") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~/foob") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~/fooc") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~/bar") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~/baz") + path::get_separator(), Results));
- EXPECT_TRUE(ContainsExactString(
- Twine("~/test_folder") + path::get_separator(), Results));
+ EXPECT_THAT(toVector(Results),
+ UnorderedElementsAre(
+ "~/foo" + sep, "~/fooa" + sep, "~/foob" + sep, "~/fooc" + sep,
+ "~/bar" + sep, "~/baz" + sep, "~/test_folder" + sep));
+ EXPECT_EQ(Count, Results.GetSize());
+
+ // Check that we can complete directories in nested paths
+ Count = CommandCompletions::DiskDirectories("~/foo/", Results, Resolver);
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results), UnorderedElementsAre("~/foo/nested" + sep));
+
+ Count = CommandCompletions::DiskDirectories("~/foo/nes", Results, Resolver);
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results), UnorderedElementsAre("~/foo/nested" + sep));
// With ~username syntax it should return one match if there is an exact
- // match.
- // It shouldn't translate to the actual directory, it should keep the form the
- // user typed.
+ // match. It shouldn't translate to the actual directory, it should keep the
+ // form the user typed.
Count = CommandCompletions::DiskDirectories("~Lars", Results, Resolver);
- ASSERT_EQ(1u, Count);
- ASSERT_EQ(Count, Results.GetSize());
- EXPECT_TRUE(
- ContainsExactString(Twine("~Lars") + path::get_separator(), Results));
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results), UnorderedElementsAre("~Lars" + sep));
// But with a username that is not found, no results are returned.
Count = CommandCompletions::DiskDirectories("~Dave", Results, Resolver);
- ASSERT_EQ(0u, Count);
- ASSERT_EQ(Count, Results.GetSize());
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results), UnorderedElementsAre());
// And if there are multiple matches, it should return all of them.
Count = CommandCompletions::DiskDirectories("~La", Results, Resolver);
- ASSERT_EQ(2u, Count);
- ASSERT_EQ(Count, Results.GetSize());
- EXPECT_TRUE(
- ContainsExactString(Twine("~Lars") + path::get_separator(), Results));
- EXPECT_TRUE(
- ContainsExactString(Twine("~Larry") + path::get_separator(), Results));
+ EXPECT_EQ(Count, Results.GetSize());
+ EXPECT_THAT(toVector(Results),
+ UnorderedElementsAre("~Lars" + sep, "~Larry" + sep));
}
diff --git a/unittests/Interpreter/TestOptionArgParser.cpp b/unittests/Interpreter/TestOptionArgParser.cpp
new file mode 100644
index 000000000000..d0431b02a715
--- /dev/null
+++ b/unittests/Interpreter/TestOptionArgParser.cpp
@@ -0,0 +1,121 @@
+//===-- ArgsTest.cpp --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+#include "lldb/Interpreter/OptionArgParser.h"
+
+using namespace lldb_private;
+
+TEST(OptionArgParserTest, toBoolean) {
+ bool success = false;
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("true"), false, nullptr));
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("on"), false, nullptr));
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("yes"), false, nullptr));
+ EXPECT_TRUE(OptionArgParser::ToBoolean(llvm::StringRef("1"), false, nullptr));
+
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("true"), false, &success));
+ EXPECT_TRUE(success);
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("on"), false, &success));
+ EXPECT_TRUE(success);
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("yes"), false, &success));
+ EXPECT_TRUE(success);
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("1"), false, &success));
+ EXPECT_TRUE(success);
+
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("false"), true, nullptr));
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("off"), true, nullptr));
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("no"), true, nullptr));
+ EXPECT_FALSE(OptionArgParser::ToBoolean(llvm::StringRef("0"), true, nullptr));
+
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("false"), true, &success));
+ EXPECT_TRUE(success);
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("off"), true, &success));
+ EXPECT_TRUE(success);
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("no"), true, &success));
+ EXPECT_TRUE(success);
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("0"), true, &success));
+ EXPECT_TRUE(success);
+
+ EXPECT_FALSE(
+ OptionArgParser::ToBoolean(llvm::StringRef("10"), false, &success));
+ EXPECT_FALSE(success);
+ EXPECT_TRUE(
+ OptionArgParser::ToBoolean(llvm::StringRef("10"), true, &success));
+ EXPECT_FALSE(success);
+ EXPECT_TRUE(OptionArgParser::ToBoolean(llvm::StringRef(""), true, &success));
+ EXPECT_FALSE(success);
+}
+
+TEST(OptionArgParserTest, toChar) {
+ bool success = false;
+
+ EXPECT_EQ('A', OptionArgParser::ToChar("A", 'B', nullptr));
+ EXPECT_EQ('B', OptionArgParser::ToChar("B", 'A', nullptr));
+
+ EXPECT_EQ('A', OptionArgParser::ToChar("A", 'B', &success));
+ EXPECT_TRUE(success);
+ EXPECT_EQ('B', OptionArgParser::ToChar("B", 'A', &success));
+ EXPECT_TRUE(success);
+
+ EXPECT_EQ('A', OptionArgParser::ToChar("", 'A', &success));
+ EXPECT_FALSE(success);
+ EXPECT_EQ('A', OptionArgParser::ToChar("ABC", 'A', &success));
+ EXPECT_FALSE(success);
+}
+
+TEST(OptionArgParserTest, toScriptLanguage) {
+ bool success = false;
+
+ EXPECT_EQ(lldb::eScriptLanguageDefault,
+ OptionArgParser::ToScriptLanguage(llvm::StringRef("default"),
+ lldb::eScriptLanguageNone,
+ nullptr));
+ EXPECT_EQ(lldb::eScriptLanguagePython,
+ OptionArgParser::ToScriptLanguage(
+ llvm::StringRef("python"), lldb::eScriptLanguageNone, nullptr));
+ EXPECT_EQ(lldb::eScriptLanguageNone,
+ OptionArgParser::ToScriptLanguage(
+ llvm::StringRef("none"), lldb::eScriptLanguagePython, nullptr));
+
+ EXPECT_EQ(lldb::eScriptLanguageDefault,
+ OptionArgParser::ToScriptLanguage(llvm::StringRef("default"),
+ lldb::eScriptLanguageNone,
+ &success));
+ EXPECT_TRUE(success);
+ EXPECT_EQ(lldb::eScriptLanguagePython,
+ OptionArgParser::ToScriptLanguage(llvm::StringRef("python"),
+ lldb::eScriptLanguageNone,
+ &success));
+ EXPECT_TRUE(success);
+ EXPECT_EQ(lldb::eScriptLanguageNone,
+ OptionArgParser::ToScriptLanguage(llvm::StringRef("none"),
+ lldb::eScriptLanguagePython,
+ &success));
+ EXPECT_TRUE(success);
+
+ EXPECT_EQ(lldb::eScriptLanguagePython,
+ OptionArgParser::ToScriptLanguage(llvm::StringRef("invalid"),
+ lldb::eScriptLanguagePython,
+ &success));
+ EXPECT_FALSE(success);
+}
diff --git a/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp b/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
index 1e7dd77c4dee..7a81b878f633 100644
--- a/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+++ b/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
@@ -6,9 +6,9 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#include "gtest/gtest.h"
-
#include "Plugins/Language/CPlusPlus/CPlusPlusLanguage.h"
+#include "gmock/gmock.h"
+#include "gtest/gtest.h"
using namespace lldb_private;
@@ -160,4 +160,27 @@ TEST(CPlusPlusLanguage, ExtractContextAndIdentifier) {
"selector:otherField:", context, basename));
EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
"abc::", context, basename));
+ EXPECT_FALSE(CPlusPlusLanguage::ExtractContextAndIdentifier(
+ "f<A<B><C>>", context, basename));
+}
+
+static std::set<std::string> FindAlternate(llvm::StringRef Name) {
+ std::set<ConstString> Results;
+ uint32_t Count = CPlusPlusLanguage::FindAlternateFunctionManglings(
+ ConstString(Name), Results);
+ EXPECT_EQ(Count, Results.size());
+ std::set<std::string> Strings;
+ for (ConstString Str : Results)
+ Strings.insert(Str.GetStringRef());
+ return Strings;
+}
+
+TEST(CPlusPlusLanguage, FindAlternateFunctionManglings) {
+ using namespace testing;
+
+ EXPECT_THAT(FindAlternate("_ZN1A1fEv"),
+ UnorderedElementsAre("_ZNK1A1fEv", "_ZLN1A1fEv"));
+ EXPECT_THAT(FindAlternate("_ZN1A1fEa"), Contains("_ZN1A1fEc"));
+ EXPECT_THAT(FindAlternate("_ZN1A1fEx"), Contains("_ZN1A1fEl"));
+ EXPECT_THAT(FindAlternate("_ZN1A1fEy"), Contains("_ZN1A1fEm"));
}
diff --git a/unittests/ObjectFile/ELF/CMakeLists.txt b/unittests/ObjectFile/ELF/CMakeLists.txt
index 652c221a6d84..cfdacdcbbb88 100644
--- a/unittests/ObjectFile/ELF/CMakeLists.txt
+++ b/unittests/ObjectFile/ELF/CMakeLists.txt
@@ -1,5 +1,4 @@
add_lldb_unittest(ObjectFileELFTests
- TestELFHeader.cpp
TestObjectFileELF.cpp
LINK_LIBS
@@ -13,6 +12,7 @@ add_dependencies(ObjectFileELFTests yaml2obj)
add_definitions(-DYAML2OBJ="$<TARGET_FILE:yaml2obj>")
set(test_inputs
+ early-section-headers.so
sections-resolve-consistently.yaml
)
add_unittest_inputs(ObjectFileELFTests "${test_inputs}")
diff --git a/unittests/ObjectFile/ELF/Inputs/early-section-headers.so b/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
new file mode 100644
index 000000000000..b4c4b2f9a4a7
--- /dev/null
+++ b/unittests/ObjectFile/ELF/Inputs/early-section-headers.so
Binary files differ
diff --git a/unittests/ObjectFile/ELF/TestELFHeader.cpp b/unittests/ObjectFile/ELF/TestELFHeader.cpp
deleted file mode 100644
index 979011f66a27..000000000000
--- a/unittests/ObjectFile/ELF/TestELFHeader.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-//===-- TestELFHeader.cpp ---------------------------------------*- C++ -*-===//
-//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
-#include "Plugins/ObjectFile/ELF/ELFHeader.h"
-#include "lldb/Utility/DataExtractor.h"
-#include "gtest/gtest.h"
-
-using namespace lldb;
-using namespace lldb_private;
-
-
-TEST(ELFHeader, ParseHeaderExtension) {
- uint8_t data[] = {
- // e_ident
- 0x7f, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- // e_type, e_machine, e_version, e_entry
- 0x03, 0x00, 0x3e, 0x00, 0x01, 0x00, 0x00, 0x00, 0x90, 0x48, 0x40, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- // e_phoff, e_shoff
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- // e_flags, e_ehsize, e_phentsize, e_phnum, e_shentsize, e_shnum,
- // e_shstrndx
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x38, 0x00, 0xff, 0xff, 0x40, 0x00,
- 0x00, 0x00, 0xff, 0xff,
-
- // sh_name, sh_type, sh_flags
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- // sh_addr, sh_offset
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
-
- // sh_size, sh_link, sh_info
- 0x23, 0x45, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x56, 0x78, 0x00,
- 0x12, 0x34, 0x56, 0x00,
-
- // sh_addralign, sh_entsize
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00,
- };
-
- DataExtractor extractor(data, sizeof data, eByteOrderLittle, 8);
- elf::ELFHeader header;
- offset_t offset = 0;
- ASSERT_TRUE(header.Parse(extractor, &offset));
- EXPECT_EQ(0x563412u, header.e_phnum);
- EXPECT_EQ(0x785634u, header.e_shstrndx);
- EXPECT_EQ(0x674523u, header.e_shnum);
-}
diff --git a/unittests/ObjectFile/ELF/TestObjectFileELF.cpp b/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
index 056799ee9191..cf8d7042cb01 100644
--- a/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
+++ b/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
@@ -61,17 +61,18 @@ TEST_F(ObjectFileELFTest, SectionsResolveConsistently) {
"sections-resolve-consistently-%%%%%%", "obj", obj));
llvm::FileRemover remover(obj);
- const char *args[] = {YAML2OBJ, yaml.c_str(), nullptr};
+ llvm::StringRef args[] = {YAML2OBJ, yaml};
llvm::StringRef obj_ref = obj;
const llvm::Optional<llvm::StringRef> redirects[] = {llvm::None, obj_ref,
llvm::None};
- ASSERT_EQ(0, llvm::sys::ExecuteAndWait(YAML2OBJ, args, nullptr, redirects));
+ ASSERT_EQ(0,
+ llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects));
uint64_t size;
ASSERT_NO_ERROR(llvm::sys::fs::file_size(obj, size));
ASSERT_GT(size, 0u);
ModuleSpec spec{FileSpec(obj, false)};
- spec.GetSymbolFileSpec().SetFile(obj, false);
+ spec.GetSymbolFileSpec().SetFile(obj, false, FileSpec::Style::native);
auto module_sp = std::make_shared<Module>(spec);
SectionList *list = module_sp->GetSectionList();
ASSERT_NE(nullptr, list);
@@ -98,3 +99,42 @@ TEST_F(ObjectFileELFTest, SectionsResolveConsistently) {
ASSERT_NE(nullptr, start);
EXPECT_EQ(text_sp, start->GetAddress().GetSection());
}
+
+// Test that GetModuleSpecifications works on an "atypical" object file which
+// has section headers right after the ELF header (instead of the more common
+// layout where the section headers are at the very end of the object file).
+//
+// Test file generated with yaml2obj (@svn rev 324254) from the following input:
+/*
+--- !ELF
+FileHeader:
+ Class: ELFCLASS64
+ Data: ELFDATA2LSB
+ Type: ET_EXEC
+ Machine: EM_X86_64
+ Entry: 0x00000000004003D0
+Sections:
+ - Name: .note.gnu.build-id
+ Type: SHT_NOTE
+ Flags: [ SHF_ALLOC ]
+ Address: 0x0000000000400274
+ AddressAlign: 0x0000000000000004
+ Content: 040000001400000003000000474E55001B8A73AC238390E32A7FF4AC8EBE4D6A41ECF5C9
+ - Name: .text
+ Type: SHT_PROGBITS
+ Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
+ Address: 0x00000000004003D0
+ AddressAlign: 0x0000000000000010
+ Content: DEADBEEFBAADF00D
+...
+*/
+TEST_F(ObjectFileELFTest, GetModuleSpecifications_EarlySectionHeaders) {
+ std::string SO = GetInputFilePath("early-section-headers.so");
+ ModuleSpecList Specs;
+ ASSERT_EQ(1u, ObjectFile::GetModuleSpecifications(FileSpec(SO, false), 0, 0, Specs));
+ ModuleSpec Spec;
+ ASSERT_TRUE(Specs.GetModuleSpecAtIndex(0, Spec)) ;
+ UUID Uuid;
+ Uuid.SetFromStringRef("1b8a73ac238390e32a7ff4ac8ebe4d6a41ecf5c9", 20);
+ EXPECT_EQ(Spec.GetUUID(), Uuid);
+}
diff --git a/unittests/Platform/PlatformDarwinTest.cpp b/unittests/Platform/PlatformDarwinTest.cpp
index a16e2d99ede6..18cd1b76997e 100644
--- a/unittests/Platform/PlatformDarwinTest.cpp
+++ b/unittests/Platform/PlatformDarwinTest.cpp
@@ -19,38 +19,29 @@ using namespace lldb;
using namespace lldb_private;
TEST(PlatformDarwinTest, TestParseVersionBuildDir) {
- uint32_t A, B, C;
+ llvm::VersionTuple V;
llvm::StringRef D;
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("1.2.3 (test1)");
- EXPECT_EQ(1u, A);
- EXPECT_EQ(2u, B);
- EXPECT_EQ(3u, C);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("1.2.3 (test1)");
+ EXPECT_EQ(llvm::VersionTuple(1, 2, 3), V);
EXPECT_EQ("test1", D);
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("2.3 (test2)");
- EXPECT_EQ(2u, A);
- EXPECT_EQ(3u, B);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("2.3 (test2)");
+ EXPECT_EQ(llvm::VersionTuple(2, 3), V);
EXPECT_EQ("test2", D);
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("3 (test3)");
- EXPECT_EQ(3u, A);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("3 (test3)");
+ EXPECT_EQ(llvm::VersionTuple(3), V);
EXPECT_EQ("test3", D);
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("1.2.3 (test");
- EXPECT_EQ(1u, A);
- EXPECT_EQ(2u, B);
- EXPECT_EQ(3u, C);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("1.2.3 (test");
+ EXPECT_EQ(llvm::VersionTuple(1, 2, 3), V);
EXPECT_EQ("test", D);
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("2.3.4 test");
- EXPECT_EQ(2u, A);
- EXPECT_EQ(3u, B);
- EXPECT_EQ(4u, C);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("2.3.4 test");
+ EXPECT_EQ(llvm::VersionTuple(2, 3, 4), V);
EXPECT_EQ("", D);
- std::tie(A, B, C, D) = PlatformDarwin::ParseVersionBuildDir("3.4.5");
- EXPECT_EQ(3u, A);
- EXPECT_EQ(4u, B);
- EXPECT_EQ(5u, C);
+ std::tie(V, D) = PlatformDarwin::ParseVersionBuildDir("3.4.5");
+ EXPECT_EQ(llvm::VersionTuple(3, 4, 5), V);
}
diff --git a/unittests/Process/gdb-remote/CMakeLists.txt b/unittests/Process/gdb-remote/CMakeLists.txt
index 0ec5554a3d8d..a9951abb37f1 100644
--- a/unittests/Process/gdb-remote/CMakeLists.txt
+++ b/unittests/Process/gdb-remote/CMakeLists.txt
@@ -1,6 +1,7 @@
add_lldb_unittest(ProcessGdbRemoteTests
GDBRemoteClientBaseTest.cpp
GDBRemoteCommunicationClientTest.cpp
+ GDBRemoteCommunicationTest.cpp
GDBRemoteTestUtils.cpp
LINK_LIBS
diff --git a/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp b/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
index 22b7148af5ba..8ab0afdb9bea 100644
--- a/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ b/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -339,3 +339,23 @@ TEST_F(GDBRemoteClientBaseTest, InterruptNoResponse) {
ASSERT_TRUE(async_result.get());
ASSERT_EQ(eStateInvalid, continue_state.get());
}
+
+TEST_F(GDBRemoteClientBaseTest, SendPacketAndReceiveResponseWithOutputSupport) {
+ StringExtractorGDBRemote response;
+ StreamString command_output;
+
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("O"));
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("O48656c6c6f2c"));
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("O20"));
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("O"));
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("O776f726c64"));
+ ASSERT_EQ(PacketResult::Success, server.SendPacket("OK"));
+
+ PacketResult result = client.SendPacketAndReceiveResponseWithOutputSupport(
+ "qRcmd,test", response, true,
+ [&command_output](llvm::StringRef output) { command_output << output; });
+
+ ASSERT_EQ(PacketResult::Success, result);
+ ASSERT_EQ("OK", response.GetStringRef());
+ ASSERT_EQ("Hello, world", command_output.GetString().str());
+}
diff --git a/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index 1d7632a67a30..41ca091c8f10 100644
--- a/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -6,12 +6,10 @@
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-#include <future>
-
-#include "GDBRemoteTestUtils.h"
-
#include "Plugins/Process/gdb-remote/GDBRemoteCommunicationClient.h"
+#include "GDBRemoteTestUtils.h"
#include "lldb/Core/ModuleSpec.h"
+#include "lldb/Host/XML.h"
#include "lldb/Target/MemoryRegionInfo.h"
#include "lldb/Utility/DataBuffer.h"
#include "lldb/Utility/StructuredData.h"
@@ -19,6 +17,8 @@
#include "lldb/lldb-enumerations.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/Testing/Support/Error.h"
+#include "gmock/gmock.h"
+#include <future>
using namespace lldb_private::process_gdb_remote;
using namespace lldb_private;
@@ -43,10 +43,12 @@ void Handle_QThreadSuffixSupported(MockServer &server, bool supported) {
ASSERT_EQ(PacketResult::Success, server.SendUnimplementedResponse(nullptr));
}
-void HandlePacket(MockServer &server, StringRef expected, StringRef response) {
+void HandlePacket(MockServer &server,
+ const testing::Matcher<const std::string &> &expected,
+ StringRef response) {
StringExtractorGDBRemote request;
ASSERT_EQ(PacketResult::Success, server.GetPacket(request));
- ASSERT_EQ(expected, request.GetStringRef());
+ ASSERT_THAT(request.GetStringRef(), expected);
ASSERT_EQ(PacketResult::Success, server.SendPacket(response));
}
@@ -167,14 +169,14 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
llvm::Triple triple("i386-pc-linux");
FileSpec file_specs[] = {
- FileSpec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix),
- FileSpec("/foo/baz.so", false, FileSpec::ePathSyntaxPosix),
+ FileSpec("/foo/bar.so", false, FileSpec::Style::posix),
+ FileSpec("/foo/baz.so", false, FileSpec::Style::posix),
// This is a bit dodgy but we currently depend on GetModulesInfo not
// performing denormalization. It can go away once the users
// (DynamicLoaderPOSIXDYLD, at least) correctly set the path syntax for
// the FileSpecs they create.
- FileSpec("/foo/baw.so", false, FileSpec::ePathSyntaxWindows),
+ FileSpec("/foo/baw.so", false, FileSpec::Style::windows),
};
std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
std::async(std::launch::async,
@@ -192,7 +194,8 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
ASSERT_EQ(1u, result->size());
EXPECT_EQ("/foo/bar.so", result.getValue()[0].GetFileSpec().GetPath());
EXPECT_EQ(triple, result.getValue()[0].GetArchitecture().GetTriple());
- EXPECT_EQ(UUID("@ABCDEFGHIJKLMNO", 16), result.getValue()[0].GetUUID());
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNO", 16),
+ result.getValue()[0].GetUUID());
EXPECT_EQ(0u, result.getValue()[0].GetObjectOffset());
EXPECT_EQ(1234u, result.getValue()[0].GetObjectSize());
}
@@ -200,7 +203,7 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
llvm::Triple triple("i386-pc-linux");
- FileSpec file_spec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix);
+ FileSpec file_spec("/foo/bar.so", false, FileSpec::Style::posix);
std::future<llvm::Optional<std::vector<ModuleSpec>>> async_result =
std::async(std::launch::async,
[&] { return client.GetModulesInfo(file_spec, triple); });
@@ -216,14 +219,15 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
ASSERT_EQ(1u, result->size());
EXPECT_EQ("/foo/bar.so", result.getValue()[0].GetFileSpec().GetPath());
EXPECT_EQ(triple, result.getValue()[0].GetArchitecture().GetTriple());
- EXPECT_EQ(UUID("@ABCDEFGHIJKLMNOPQRS", 20), result.getValue()[0].GetUUID());
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNOPQRS", 20),
+ result.getValue()[0].GetUUID());
EXPECT_EQ(0u, result.getValue()[0].GetObjectOffset());
EXPECT_EQ(1234u, result.getValue()[0].GetObjectSize());
}
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfoInvalidResponse) {
llvm::Triple triple("i386-pc-linux");
- FileSpec file_spec("/foo/bar.so", false, FileSpec::ePathSyntaxPosix);
+ FileSpec file_spec("/foo/bar.so", false, FileSpec::Style::posix);
const char *invalid_responses[] = {
// no UUID
@@ -323,12 +327,22 @@ TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfo) {
return client.GetMemoryRegionInfo(addr, region_info);
});
- // name is: /foo/bar.so
HandlePacket(server,
"qMemoryRegionInfo:a000",
"start:a000;size:2000;permissions:rx;name:2f666f6f2f6261722e736f;");
+ if (XMLDocument::XMLEnabled()) {
+ // In case we have XML support, this will also do a "qXfer:memory-map".
+ // Preceeded by a query for supported extensions. Pretend we don't support
+ // that.
+ HandlePacket(server, testing::StartsWith("qSupported:"), "");
+ }
EXPECT_TRUE(result.get().Success());
-
+ EXPECT_EQ(addr, region_info.GetRange().GetRangeBase());
+ EXPECT_EQ(0x2000u, region_info.GetRange().GetByteSize());
+ EXPECT_EQ(MemoryRegionInfo::eYes, region_info.GetReadable());
+ EXPECT_EQ(MemoryRegionInfo::eNo, region_info.GetWritable());
+ EXPECT_EQ(MemoryRegionInfo::eYes, region_info.GetExecutable());
+ EXPECT_EQ("/foo/bar.so", region_info.GetName().GetStringRef());
}
TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfoInvalidResponse) {
@@ -339,6 +353,12 @@ TEST_F(GDBRemoteCommunicationClientTest, GetMemoryRegionInfoInvalidResponse) {
});
HandlePacket(server, "qMemoryRegionInfo:4000", "start:4000;size:0000;");
+ if (XMLDocument::XMLEnabled()) {
+ // In case we have XML support, this will also do a "qXfer:memory-map".
+ // Preceeded by a query for supported extensions. Pretend we don't support
+ // that.
+ HandlePacket(server, testing::StartsWith("qSupported:"), "");
+ }
EXPECT_FALSE(result.get().Success());
}
diff --git a/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp b/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp
new file mode 100644
index 000000000000..5ae8e700757c
--- /dev/null
+++ b/unittests/Process/gdb-remote/GDBRemoteCommunicationTest.cpp
@@ -0,0 +1,67 @@
+//===-- GDBRemoteCommunicationTest.cpp --------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+#include "GDBRemoteTestUtils.h"
+#include "llvm/Testing/Support/Error.h"
+
+using namespace lldb_private::process_gdb_remote;
+using namespace lldb_private;
+using namespace lldb;
+typedef GDBRemoteCommunication::PacketResult PacketResult;
+
+namespace {
+
+class TestClient : public GDBRemoteCommunication {
+public:
+ TestClient()
+ : GDBRemoteCommunication("test.client", "test.client.listener") {}
+
+ PacketResult ReadPacket(StringExtractorGDBRemote &response) {
+ return GDBRemoteCommunication::ReadPacket(response, std::chrono::seconds(1),
+ /*sync_on_timeout*/ false);
+ }
+};
+
+class GDBRemoteCommunicationTest : public GDBRemoteTest {
+public:
+ void SetUp() override {
+ ASSERT_THAT_ERROR(Connect(client, server), llvm::Succeeded());
+ }
+
+protected:
+ TestClient client;
+ MockServer server;
+
+ bool Write(llvm::StringRef packet) {
+ ConnectionStatus status;
+ return server.Write(packet.data(), packet.size(), status, nullptr) ==
+ packet.size();
+ }
+};
+} // end anonymous namespace
+
+TEST_F(GDBRemoteCommunicationTest, ReadPacket_checksum) {
+ struct TestCase {
+ llvm::StringLiteral Packet;
+ llvm::StringLiteral Payload;
+ };
+ static constexpr TestCase Tests[] = {
+ {{"$#00"}, {""}},
+ {{"$foobar#79"}, {"foobar"}},
+ {{"$}}#fa"}, {"]"}},
+ {{"$x*%#c7"}, {"xxxxxxxxx"}},
+ };
+ for (const auto &Test : Tests) {
+ SCOPED_TRACE(Test.Packet + " -> " + Test.Payload);
+ StringExtractorGDBRemote response;
+ ASSERT_TRUE(Write(Test.Packet));
+ ASSERT_EQ(PacketResult::Success, client.ReadPacket(response));
+ ASSERT_EQ(Test.Payload, response.GetStringRef());
+ ASSERT_EQ(PacketResult::Success, server.GetAck());
+ }
+}
diff --git a/unittests/Process/minidump/CMakeLists.txt b/unittests/Process/minidump/CMakeLists.txt
index e1b8154e1c31..a4ebb074b957 100644
--- a/unittests/Process/minidump/CMakeLists.txt
+++ b/unittests/Process/minidump/CMakeLists.txt
@@ -17,6 +17,14 @@ set(test_inputs
linux-x86_64.dmp
linux-x86_64_not_crashed.dmp
fizzbuzz_no_heap.dmp
- fizzbuzz_wow64.dmp)
+ fizzbuzz_wow64.dmp
+ bad_duplicate_streams.dmp
+ bad_overlapping_streams.dmp
+ thread-list-padded.dmp
+ thread-list-not-padded.dmp
+ module-list-padded.dmp
+ module-list-not-padded.dmp
+ memory-list-padded.dmp
+ memory-list-not-padded.dmp)
add_unittest_inputs(LLDBMinidumpTests "${test_inputs}")
diff --git a/unittests/Process/minidump/Inputs/bad_duplicate_streams.dmp b/unittests/Process/minidump/Inputs/bad_duplicate_streams.dmp
new file mode 100644
index 000000000000..d9be8e285713
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/bad_duplicate_streams.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/bad_overlapping_streams.dmp b/unittests/Process/minidump/Inputs/bad_overlapping_streams.dmp
new file mode 100644
index 000000000000..f131ae7d105b
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/bad_overlapping_streams.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp b/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp
new file mode 100644
index 000000000000..cb7b5fb7ee83
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/memory-list-not-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/memory-list-padded.dmp b/unittests/Process/minidump/Inputs/memory-list-padded.dmp
new file mode 100644
index 000000000000..8b7e837e39dd
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/memory-list-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/module-list-not-padded.dmp b/unittests/Process/minidump/Inputs/module-list-not-padded.dmp
new file mode 100644
index 000000000000..b37e251ce21d
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/module-list-not-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/module-list-padded.dmp b/unittests/Process/minidump/Inputs/module-list-padded.dmp
new file mode 100644
index 000000000000..431c7c025b23
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/module-list-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp b/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp
new file mode 100644
index 000000000000..34ba5cc34c8e
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/Inputs/thread-list-padded.dmp b/unittests/Process/minidump/Inputs/thread-list-padded.dmp
new file mode 100644
index 000000000000..838a4dfb51fe
--- /dev/null
+++ b/unittests/Process/minidump/Inputs/thread-list-padded.dmp
Binary files differ
diff --git a/unittests/Process/minidump/MinidumpParserTest.cpp b/unittests/Process/minidump/MinidumpParserTest.cpp
index 7aceb0e16dcf..cf4873fbc4fc 100644
--- a/unittests/Process/minidump/MinidumpParserTest.cpp
+++ b/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -38,16 +38,32 @@ using namespace minidump;
class MinidumpParserTest : public testing::Test {
public:
- void SetUpData(const char *minidump_filename,
- uint64_t load_size = UINT64_MAX) {
+ void SetUpData(const char *minidump_filename) {
std::string filename = GetInputFilePath(minidump_filename);
- auto BufferPtr = DataBufferLLVM::CreateSliceFromPath(filename, load_size, 0);
+ auto BufferPtr = DataBufferLLVM::CreateSliceFromPath(filename, -1, 0);
+ ASSERT_NE(BufferPtr, nullptr);
+ llvm::Optional<MinidumpParser> optional_parser =
+ MinidumpParser::Create(BufferPtr);
+ ASSERT_TRUE(optional_parser.hasValue());
+ parser.reset(new MinidumpParser(optional_parser.getValue()));
+ ASSERT_GT(parser->GetData().size(), 0UL);
+ auto result = parser->Initialize();
+ ASSERT_TRUE(result.Success()) << result.AsCString();
+ }
+
+ void InvalidMinidump(const char *minidump_filename, uint64_t load_size) {
+ std::string filename = GetInputFilePath(minidump_filename);
+ auto BufferPtr =
+ DataBufferLLVM::CreateSliceFromPath(filename, load_size, 0);
+ ASSERT_NE(BufferPtr, nullptr);
llvm::Optional<MinidumpParser> optional_parser =
MinidumpParser::Create(BufferPtr);
ASSERT_TRUE(optional_parser.hasValue());
parser.reset(new MinidumpParser(optional_parser.getValue()));
ASSERT_GT(parser->GetData().size(), 0UL);
+ auto result = parser->Initialize();
+ ASSERT_TRUE(result.Fail());
}
std::unique_ptr<MinidumpParser> parser;
@@ -68,12 +84,85 @@ TEST_F(MinidumpParserTest, GetThreadsAndGetThreadContext) {
EXPECT_EQ(1232UL, context.size());
}
-TEST_F(MinidumpParserTest, GetThreadsTruncatedFile) {
- SetUpData("linux-x86_64.dmp", 200);
+TEST_F(MinidumpParserTest, GetThreadListNotPadded) {
+ // Verify that we can load a thread list that doesn't have 4 bytes of padding
+ // after the thread count.
+ SetUpData("thread-list-not-padded.dmp");
llvm::ArrayRef<MinidumpThread> thread_list;
-
+
thread_list = parser->GetThreads();
- ASSERT_EQ(0UL, thread_list.size());
+ ASSERT_EQ(2UL, thread_list.size());
+ EXPECT_EQ(0x11223344UL, thread_list[0].thread_id);
+ EXPECT_EQ(0x55667788UL, thread_list[1].thread_id);
+}
+
+TEST_F(MinidumpParserTest, GetThreadListPadded) {
+ // Verify that we can load a thread list that has 4 bytes of padding
+ // after the thread count as found in breakpad minidump files.
+ SetUpData("thread-list-padded.dmp");
+ auto thread_list = parser->GetThreads();
+ ASSERT_EQ(2UL, thread_list.size());
+ EXPECT_EQ(0x11223344UL, thread_list[0].thread_id);
+ EXPECT_EQ(0x55667788UL, thread_list[1].thread_id);
+}
+
+TEST_F(MinidumpParserTest, GetModuleListNotPadded) {
+ // Verify that we can load a module list that doesn't have 4 bytes of padding
+ // after the module count.
+ SetUpData("module-list-not-padded.dmp");
+ auto module_list = parser->GetModuleList();
+ ASSERT_EQ(2UL, module_list.size());
+ EXPECT_EQ(0x1000UL, module_list[0].base_of_image);
+ EXPECT_EQ(0x2000UL, module_list[0].size_of_image);
+ EXPECT_EQ(0x5000UL, module_list[1].base_of_image);
+ EXPECT_EQ(0x3000UL, module_list[1].size_of_image);
+}
+
+TEST_F(MinidumpParserTest, GetModuleListPadded) {
+ // Verify that we can load a module list that has 4 bytes of padding
+ // after the module count as found in breakpad minidump files.
+ SetUpData("module-list-padded.dmp");
+ auto module_list = parser->GetModuleList();
+ ASSERT_EQ(2UL, module_list.size());
+ EXPECT_EQ(0x1000UL, module_list[0].base_of_image);
+ EXPECT_EQ(0x2000UL, module_list[0].size_of_image);
+ EXPECT_EQ(0x5000UL, module_list[1].base_of_image);
+ EXPECT_EQ(0x3000UL, module_list[1].size_of_image);
+}
+
+TEST_F(MinidumpParserTest, GetMemoryListNotPadded) {
+ // Verify that we can load a memory list that doesn't have 4 bytes of padding
+ // after the memory range count.
+ SetUpData("memory-list-not-padded.dmp");
+ auto mem = parser->FindMemoryRange(0x8000);
+ ASSERT_TRUE(mem.hasValue());
+ EXPECT_EQ((lldb::addr_t)0x8000, mem->start);
+ mem = parser->FindMemoryRange(0x8010);
+ ASSERT_TRUE(mem.hasValue());
+ EXPECT_EQ((lldb::addr_t)0x8010, mem->start);
+}
+
+TEST_F(MinidumpParserTest, GetMemoryListPadded) {
+ // Verify that we can load a memory list that has 4 bytes of padding
+ // after the memory range count as found in breakpad minidump files.
+ SetUpData("memory-list-padded.dmp");
+ auto mem = parser->FindMemoryRange(0x8000);
+ ASSERT_TRUE(mem.hasValue());
+ EXPECT_EQ((lldb::addr_t)0x8000, mem->start);
+ mem = parser->FindMemoryRange(0x8010);
+ ASSERT_TRUE(mem.hasValue());
+ EXPECT_EQ((lldb::addr_t)0x8010, mem->start);
+}
+
+TEST_F(MinidumpParserTest, TruncatedMinidumps) {
+ InvalidMinidump("linux-x86_64.dmp", 32);
+ InvalidMinidump("linux-x86_64.dmp", 100);
+ InvalidMinidump("linux-x86_64.dmp", 20 * 1024);
+}
+
+TEST_F(MinidumpParserTest, IllFormedMinidumps) {
+ InvalidMinidump("bad_duplicate_streams.dmp", -1);
+ InvalidMinidump("bad_overlapping_streams.dmp", -1);
}
TEST_F(MinidumpParserTest, GetArchitecture) {
@@ -315,9 +404,9 @@ TEST_F(MinidumpParserTest, ConvertMinidumpContext_x86_32) {
llvm::ArrayRef<uint8_t> registers(parser->GetThreadContext(thread));
ArchSpec arch = parser->GetArchitecture();
- RegisterInfoInterface *reg_interface = new RegisterContextLinux_i386(arch);
+ auto reg_interface = llvm::make_unique<RegisterContextLinux_i386>(arch);
lldb::DataBufferSP buf =
- ConvertMinidumpContext_x86_32(registers, reg_interface);
+ ConvertMinidumpContext_x86_32(registers, reg_interface.get());
ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
@@ -357,9 +446,9 @@ TEST_F(MinidumpParserTest, ConvertMinidumpContext_x86_64) {
llvm::ArrayRef<uint8_t> registers(parser->GetThreadContext(thread));
ArchSpec arch = parser->GetArchitecture();
- RegisterInfoInterface *reg_interface = new RegisterContextLinux_x86_64(arch);
+ auto reg_interface = llvm::make_unique<RegisterContextLinux_x86_64>(arch);
lldb::DataBufferSP buf =
- ConvertMinidumpContext_x86_64(registers, reg_interface);
+ ConvertMinidumpContext_x86_64(registers, reg_interface.get());
ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
@@ -407,9 +496,9 @@ TEST_F(MinidumpParserTest, ConvertMinidumpContext_x86_32_wow64) {
llvm::ArrayRef<uint8_t> registers(parser->GetThreadContextWow64(thread));
ArchSpec arch = parser->GetArchitecture();
- RegisterInfoInterface *reg_interface = new RegisterContextLinux_i386(arch);
+ auto reg_interface = llvm::make_unique<RegisterContextLinux_i386>(arch);
lldb::DataBufferSP buf =
- ConvertMinidumpContext_x86_32(registers, reg_interface);
+ ConvertMinidumpContext_x86_32(registers, reg_interface.get());
ASSERT_EQ(reg_interface->GetGPRSize(), buf->GetByteSize());
const RegisterInfo *reg_info = reg_interface->GetRegisterInfo();
diff --git a/unittests/Symbol/CMakeLists.txt b/unittests/Symbol/CMakeLists.txt
index 2d042648c4b3..8a2033e6fa9e 100644
--- a/unittests/Symbol/CMakeLists.txt
+++ b/unittests/Symbol/CMakeLists.txt
@@ -7,6 +7,7 @@ add_lldb_unittest(SymbolTests
lldbHost
lldbSymbol
lldbUtilityHelpers
+ lldbPluginObjectFileELF
)
add_dependencies(SymbolTests yaml2obj)
diff --git a/unittests/Symbol/TestClangASTContext.cpp b/unittests/Symbol/TestClangASTContext.cpp
index 9fe804708378..c9737fab4727 100644
--- a/unittests/Symbol/TestClangASTContext.cpp
+++ b/unittests/Symbol/TestClangASTContext.cpp
@@ -11,6 +11,8 @@
#include "gtest/gtest.h"
+#include "clang/AST/DeclCXX.h"
+
#include "lldb/Host/HostInfo.h"
#include "lldb/Symbol/ClangASTContext.h"
#include "lldb/Symbol/ClangUtil.h"
@@ -375,6 +377,9 @@ TEST_F(TestClangASTContext, TestRecordHasFields) {
empty_derived_non_empty_vbase_cxx_decl, false));
EXPECT_TRUE(
ClangASTContext::RecordHasFields(empty_derived_non_empty_vbase_decl));
+
+ delete non_empty_base_spec;
+ delete non_empty_vbase_spec;
}
TEST_F(TestClangASTContext, TemplateArguments) {
diff --git a/unittests/Symbol/TestDWARFCallFrameInfo.cpp b/unittests/Symbol/TestDWARFCallFrameInfo.cpp
index 85cb4a72b95c..c8d560f03ded 100644
--- a/unittests/Symbol/TestDWARFCallFrameInfo.cpp
+++ b/unittests/Symbol/TestDWARFCallFrameInfo.cpp
@@ -96,11 +96,12 @@ void DWARFCallFrameInfoTest::TestBasic(DWARFCallFrameInfo::Type type,
"basic-call-frame-info-%%%%%%", "obj", obj));
llvm::FileRemover obj_remover(obj);
- const char *args[] = {YAML2OBJ, yaml.c_str(), nullptr};
+ llvm::StringRef args[] = {YAML2OBJ, yaml};
llvm::StringRef obj_ref = obj;
const llvm::Optional<llvm::StringRef> redirects[] = {llvm::None, obj_ref,
llvm::None};
- ASSERT_EQ(0, llvm::sys::ExecuteAndWait(YAML2OBJ, args, nullptr, redirects));
+ ASSERT_EQ(0,
+ llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects));
uint64_t size;
ASSERT_NO_ERROR(llvm::sys::fs::file_size(obj, size));
diff --git a/unittests/Symbol/TestType.cpp b/unittests/Symbol/TestType.cpp
index 68128b89329c..bf06541134e3 100644
--- a/unittests/Symbol/TestType.cpp
+++ b/unittests/Symbol/TestType.cpp
@@ -30,7 +30,7 @@ void TestGetTypeScopeAndBasenameHelper(const char *full_type,
EXPECT_EQ(name, expected_name);
}
}
-};
+}
TEST(Type, GetTypeScopeAndBasename) {
TestGetTypeScopeAndBasenameHelper("int", false, "", "");
diff --git a/unittests/Target/CMakeLists.txt b/unittests/Target/CMakeLists.txt
index ec8f2db2c39f..bd73d708cb8b 100644
--- a/unittests/Target/CMakeLists.txt
+++ b/unittests/Target/CMakeLists.txt
@@ -1,6 +1,7 @@
add_lldb_unittest(TargetTests
MemoryRegionInfoTest.cpp
ModuleCacheTest.cpp
+ PathMappingListTest.cpp
LINK_LIBS
lldbCore
diff --git a/unittests/Target/ModuleCacheTest.cpp b/unittests/Target/ModuleCacheTest.cpp
index de07648ae00b..0b9e02df7817 100644
--- a/unittests/Target/ModuleCacheTest.cpp
+++ b/unittests/Target/ModuleCacheTest.cpp
@@ -44,7 +44,7 @@ static const uint32_t uuid_bytes = 20;
static const size_t module_size = 5602;
static FileSpec GetDummyRemotePath() {
- FileSpec fs("/", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs("/", false, FileSpec::Style::posix);
fs.AppendPathComponent(dummy_remote_dir);
fs.AppendPathComponent(module_name);
return fs;
@@ -68,8 +68,7 @@ void ModuleCacheTest::SetUpTestCase() {
HostInfo::Initialize();
ObjectFileELF::Initialize();
- FileSpec tmpdir_spec;
- HostInfo::GetLLDBPath(lldb::ePathTypeLLDBTempSystemDir, s_cache_dir);
+ s_cache_dir = HostInfo::GetProcessTempDir();
s_test_executable = GetInputFilePath(module_name);
}
@@ -94,7 +93,7 @@ void ModuleCacheTest::TryGetAndPut(const FileSpec &cache_dir,
ModuleCache mc;
ModuleSpec module_spec;
module_spec.GetFileSpec() = GetDummyRemotePath();
- module_spec.GetUUID().SetFromCString(module_uuid, uuid_bytes);
+ module_spec.GetUUID().SetFromStringRef(module_uuid, uuid_bytes);
module_spec.SetObjectSize(module_size);
ModuleSP module_sp;
bool did_create;
@@ -102,8 +101,8 @@ void ModuleCacheTest::TryGetAndPut(const FileSpec &cache_dir,
Status error = mc.GetAndPut(
cache_dir, hostname, module_spec,
- [this, &download_called](const ModuleSpec &module_spec,
- const FileSpec &tmp_download_file_spec) {
+ [&download_called](const ModuleSpec &module_spec,
+ const FileSpec &tmp_download_file_spec) {
download_called = true;
EXPECT_STREQ(GetDummyRemotePath().GetCString(),
module_spec.GetFileSpec().GetCString());
diff --git a/unittests/Target/PathMappingListTest.cpp b/unittests/Target/PathMappingListTest.cpp
new file mode 100644
index 000000000000..cb807d0ca20d
--- /dev/null
+++ b/unittests/Target/PathMappingListTest.cpp
@@ -0,0 +1,116 @@
+//===-- PathMappingListTest.cpp ---------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/ArrayRef.h"
+#include "lldb/Target/PathMappingList.h"
+#include "lldb/Utility/FileSpec.h"
+#include "gtest/gtest.h"
+#include <utility>
+
+using namespace lldb_private;
+
+namespace {
+struct Matches {
+ FileSpec original;
+ FileSpec remapped;
+ Matches(const char *o, const char *r)
+ : original(o, false), remapped(r, false) {}
+};
+} // namespace
+
+static void TestPathMappings(const PathMappingList &map,
+ llvm::ArrayRef<Matches> matches,
+ llvm::ArrayRef<ConstString> fails) {
+ ConstString actual_remapped;
+ for (const auto &fail : fails) {
+ SCOPED_TRACE(fail.GetCString());
+ EXPECT_FALSE(map.RemapPath(fail, actual_remapped))
+ << "actual_remapped: " << actual_remapped.GetCString();
+ }
+ for (const auto &match : matches) {
+ SCOPED_TRACE(match.original.GetPath() + " -> " + match.remapped.GetPath());
+ std::string orig_normalized = match.original.GetPath();
+ EXPECT_TRUE(
+ map.RemapPath(ConstString(match.original.GetPath()), actual_remapped));
+ EXPECT_EQ(FileSpec(actual_remapped.GetStringRef(), false), match.remapped);
+ FileSpec unmapped_spec;
+ EXPECT_TRUE(map.ReverseRemapPath(match.remapped, unmapped_spec));
+ std::string unmapped_path = unmapped_spec.GetPath();
+ EXPECT_EQ(unmapped_path, orig_normalized);
+ }
+}
+
+TEST(PathMappingListTest, RelativeTests) {
+ Matches matches[] = {
+ {".", "/tmp"},
+ {"./", "/tmp"},
+ {"./////", "/tmp"},
+ {"./foo.c", "/tmp/foo.c"},
+ {"foo.c", "/tmp/foo.c"},
+ {"./bar/foo.c", "/tmp/bar/foo.c"},
+ {"bar/foo.c", "/tmp/bar/foo.c"},
+ };
+ ConstString fails[] = {
+#ifdef _WIN32
+ ConstString("C:\\"),
+ ConstString("C:\\a"),
+#else
+ ConstString("/a"),
+ ConstString("/"),
+#endif
+ };
+ PathMappingList map;
+ map.Append(ConstString("."), ConstString("/tmp"), false);
+ TestPathMappings(map, matches, fails);
+ PathMappingList map2;
+ map2.Append(ConstString(""), ConstString("/tmp"), false);
+ TestPathMappings(map, matches, fails);
+}
+
+TEST(PathMappingListTest, AbsoluteTests) {
+ PathMappingList map;
+ map.Append(ConstString("/old"), ConstString("/new"), false);
+ Matches matches[] = {
+ {"/old", "/new"},
+ {"/old/", "/new"},
+ {"/old/foo/.", "/new/foo"},
+ {"/old/foo.c", "/new/foo.c"},
+ {"/old/foo.c/.", "/new/foo.c"},
+ {"/old/./foo.c", "/new/foo.c"},
+ };
+ ConstString fails[] = {
+ ConstString("/foo"),
+ ConstString("/"),
+ ConstString("foo.c"),
+ ConstString("./foo.c"),
+ ConstString("../foo.c"),
+ ConstString("../bar/foo.c"),
+ };
+ TestPathMappings(map, matches, fails);
+}
+
+TEST(PathMappingListTest, RemapRoot) {
+ PathMappingList map;
+ map.Append(ConstString("/"), ConstString("/new"), false);
+ Matches matches[] = {
+ {"/old", "/new/old"},
+ {"/old/", "/new/old"},
+ {"/old/foo/.", "/new/old/foo"},
+ {"/old/foo.c", "/new/old/foo.c"},
+ {"/old/foo.c/.", "/new/old/foo.c"},
+ {"/old/./foo.c", "/new/old/foo.c"},
+ };
+ ConstString fails[] = {
+ ConstString("foo.c"),
+ ConstString("./foo.c"),
+ ConstString("../foo.c"),
+ ConstString("../bar/foo.c"),
+ };
+ TestPathMappings(map, matches, fails);
+}
diff --git a/unittests/UnwindAssembly/ARM64/CMakeLists.txt b/unittests/UnwindAssembly/ARM64/CMakeLists.txt
new file mode 100644
index 000000000000..77924792fe5c
--- /dev/null
+++ b/unittests/UnwindAssembly/ARM64/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_lldb_unittest(Arm64InstEmulationTests
+ TestArm64InstEmulation.cpp
+ LINK_LIBS
+ lldbCore
+ lldbSymbol
+ lldbTarget
+ lldbPluginUnwindAssemblyInstEmulation
+ lldbPluginDisassemblerLLVM
+ lldbPluginInstructionARM64
+ lldbPluginProcessUtility
+ LINK_COMPONENTS
+ Support
+ ${LLVM_TARGETS_TO_BUILD})
diff --git a/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp b/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp
index ab28cb637d8d..7831a6534fd6 100644
--- a/unittests/UnwindAssembly/InstEmulation/TestArm64InstEmulation.cpp
+++ b/unittests/UnwindAssembly/ARM64/TestArm64InstEmulation.cpp
@@ -56,9 +56,9 @@ void TestArm64InstEmulation::TearDownTestCase() {
TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
ArchSpec arch("arm64-apple-ios10");
- UnwindAssemblyInstEmulation *engine =
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
static_cast<UnwindAssemblyInstEmulation *>(
- UnwindAssemblyInstEmulation::CreateInstance(arch));
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
ASSERT_NE(nullptr, engine);
UnwindPlan::RowSP row_sp;
@@ -152,9 +152,9 @@ TEST_F(TestArm64InstEmulation, TestSimpleDarwinFunction) {
TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
ArchSpec arch("arm64-apple-ios10");
- UnwindAssemblyInstEmulation *engine =
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
static_cast<UnwindAssemblyInstEmulation *>(
- UnwindAssemblyInstEmulation::CreateInstance(arch));
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
ASSERT_NE(nullptr, engine);
UnwindPlan::RowSP row_sp;
@@ -314,9 +314,9 @@ TEST_F(TestArm64InstEmulation, TestMediumDarwinFunction) {
TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) {
ArchSpec arch("arm64-apple-ios10");
- UnwindAssemblyInstEmulation *engine =
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
static_cast<UnwindAssemblyInstEmulation *>(
- UnwindAssemblyInstEmulation::CreateInstance(arch));
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
ASSERT_NE(nullptr, engine);
UnwindPlan::RowSP row_sp;
@@ -409,9 +409,9 @@ TEST_F(TestArm64InstEmulation, TestFramelessThreeEpilogueFunction) {
TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) {
ArchSpec arch("arm64-apple-ios10");
- UnwindAssemblyInstEmulation *engine =
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
static_cast<UnwindAssemblyInstEmulation *>(
- UnwindAssemblyInstEmulation::CreateInstance(arch));
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
ASSERT_NE(nullptr, engine);
UnwindPlan::RowSP row_sp;
@@ -511,9 +511,9 @@ TEST_F(TestArm64InstEmulation, TestRegisterSavedTwice) {
TEST_F(TestArm64InstEmulation, TestRegisterDoubleSpills) {
ArchSpec arch("arm64-apple-ios10");
- UnwindAssemblyInstEmulation *engine =
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
static_cast<UnwindAssemblyInstEmulation *>(
- UnwindAssemblyInstEmulation::CreateInstance(arch));
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
ASSERT_NE(nullptr, engine);
UnwindPlan::RowSP row_sp;
diff --git a/unittests/UnwindAssembly/CMakeLists.txt b/unittests/UnwindAssembly/CMakeLists.txt
index 0326011fda84..136fcd9ae979 100644
--- a/unittests/UnwindAssembly/CMakeLists.txt
+++ b/unittests/UnwindAssembly/CMakeLists.txt
@@ -1,5 +1,11 @@
+if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
+ add_subdirectory(ARM64)
+endif()
+
+if ("PowerPC" IN_LIST LLVM_TARGETS_TO_BUILD)
+ add_subdirectory(PPC64)
+endif()
+
if ("X86" IN_LIST LLVM_TARGETS_TO_BUILD)
add_subdirectory(x86)
endif()
-
-add_subdirectory(InstEmulation)
diff --git a/unittests/UnwindAssembly/InstEmulation/CMakeLists.txt b/unittests/UnwindAssembly/InstEmulation/CMakeLists.txt
deleted file mode 100644
index 7cc0befa386b..000000000000
--- a/unittests/UnwindAssembly/InstEmulation/CMakeLists.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-if ("AArch64" IN_LIST LLVM_TARGETS_TO_BUILD)
- add_lldb_unittest(InstEmulationTests
- TestArm64InstEmulation.cpp
- LINK_LIBS
- lldbCore
- lldbSymbol
- lldbTarget
- lldbPluginUnwindAssemblyInstEmulation
- lldbPluginDisassemblerLLVM
- lldbPluginInstructionARM64
- lldbPluginProcessUtility
- LINK_COMPONENTS
- Support
- ${LLVM_TARGETS_TO_BUILD})
-endif()
diff --git a/unittests/UnwindAssembly/PPC64/CMakeLists.txt b/unittests/UnwindAssembly/PPC64/CMakeLists.txt
new file mode 100644
index 000000000000..d803f4593636
--- /dev/null
+++ b/unittests/UnwindAssembly/PPC64/CMakeLists.txt
@@ -0,0 +1,13 @@
+add_lldb_unittest(PPC64InstEmulationTests
+ TestPPC64InstEmulation.cpp
+ LINK_LIBS
+ lldbCore
+ lldbSymbol
+ lldbTarget
+ lldbPluginUnwindAssemblyInstEmulation
+ lldbPluginDisassemblerLLVM
+ lldbPluginInstructionPPC64
+ lldbPluginProcessUtility
+ LINK_COMPONENTS
+ Support
+ ${LLVM_TARGETS_TO_BUILD})
diff --git a/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp b/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp
new file mode 100644
index 000000000000..2318540870ff
--- /dev/null
+++ b/unittests/UnwindAssembly/PPC64/TestPPC64InstEmulation.cpp
@@ -0,0 +1,259 @@
+//===-- TestPPC64InstEmulation.cpp ------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include <vector>
+
+#include "Plugins/UnwindAssembly/InstEmulation/UnwindAssemblyInstEmulation.h"
+
+#include "lldb/Core/Address.h"
+#include "lldb/Core/AddressRange.h"
+#include "lldb/Symbol/UnwindPlan.h"
+#include "lldb/Target/UnwindAssembly.h"
+#include "lldb/Utility/ArchSpec.h"
+
+#include "Plugins/Disassembler/llvm/DisassemblerLLVMC.h"
+#include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
+#include "Plugins/Process/Utility/lldb-ppc64le-register-enums.h"
+#include "llvm/Support/TargetSelect.h"
+
+using namespace lldb;
+using namespace lldb_private;
+
+class TestPPC64InstEmulation : public testing::Test {
+public:
+ static void SetUpTestCase();
+ static void TearDownTestCase();
+
+ // virtual void SetUp() override { }
+ // virtual void TearDown() override { }
+
+protected:
+};
+
+void TestPPC64InstEmulation::SetUpTestCase() {
+ llvm::InitializeAllTargets();
+ llvm::InitializeAllAsmPrinters();
+ llvm::InitializeAllTargetMCs();
+ llvm::InitializeAllDisassemblers();
+ DisassemblerLLVMC::Initialize();
+ EmulateInstructionPPC64::Initialize();
+}
+
+void TestPPC64InstEmulation::TearDownTestCase() {
+ DisassemblerLLVMC::Terminate();
+ EmulateInstructionPPC64::Terminate();
+}
+
+TEST_F(TestPPC64InstEmulation, TestSimpleFunction) {
+ ArchSpec arch("powerpc64le-linux-gnu");
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
+ static_cast<UnwindAssemblyInstEmulation *>(
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
+ ASSERT_NE(nullptr, engine);
+
+ UnwindPlan::RowSP row_sp;
+ AddressRange sample_range;
+ UnwindPlan unwind_plan(eRegisterKindLLDB);
+ UnwindPlan::Row::RegisterLocation regloc;
+
+ // prologue and epilogue of:
+ // int main() {
+ // int i = test();
+ // return i;
+ // }
+ //
+ // compiled with clang -O0 -g
+ uint8_t data[] = {
+ // prologue
+ 0x02, 0x10, 0x40, 0x3c, // 0: lis r2, 4098
+ 0x00, 0x7f, 0x42, 0x38, // 4: addi r2, r2, 32512
+ 0xa6, 0x02, 0x08, 0x7c, // 8: mflr r0
+ 0xf8, 0xff, 0xe1, 0xfb, // 12: std r31, -8(r1)
+ 0x10, 0x00, 0x01, 0xf8, // 16: std r0, 16(r1)
+ 0x91, 0xff, 0x21, 0xf8, // 20: stdu r1, -112(r1)
+ 0x78, 0x0b, 0x3f, 0x7c, // 24: mr r31, r1
+ 0x00, 0x00, 0x60, 0x38, // 28: li r3, 0
+ 0x64, 0x00, 0x7f, 0x90, // 32: stw r3, 100(r31)
+
+ // epilogue
+ 0x70, 0x00, 0x21, 0x38, // 36: addi r1, r1, 112
+ 0x10, 0x00, 0x01, 0xe8, // 40: ld r0, 16(r1)
+ 0xf8, 0xff, 0xe1, 0xeb, // 44: ld r31, -8(r1)
+ 0xa6, 0x03, 0x08, 0x7c, // 48: mtlr r0
+ 0x20, 0x00, 0x80, 0x4e // 52: blr
+ };
+
+ sample_range = AddressRange(0x1000, sizeof(data));
+
+ EXPECT_TRUE(engine->GetNonCallSiteUnwindPlanFromAssembly(
+ sample_range, data, sizeof(data), unwind_plan));
+
+ // 0: CFA=sp+0
+ row_sp = unwind_plan.GetRowForFunctionOffset(0);
+ EXPECT_EQ(0ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ // 1: CFA=sp+0 => fp=[CFA-8]
+ row_sp = unwind_plan.GetRowForFunctionOffset(16);
+ EXPECT_EQ(16ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_r31_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(-8, regloc.GetOffset());
+
+ // 2: CFA=sp+0 => fp=[CFA-8] lr=[CFA+16]
+ row_sp = unwind_plan.GetRowForFunctionOffset(20);
+ EXPECT_EQ(20ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_lr_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(16, regloc.GetOffset());
+
+ // 3: CFA=sp+112 => fp=[CFA-8] lr=[CFA+16]
+ row_sp = unwind_plan.GetRowForFunctionOffset(24);
+ EXPECT_EQ(24ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(112, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_r31_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(-8, regloc.GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_lr_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(16, regloc.GetOffset());
+
+ // 4: CFA=r31+112 => fp=[CFA-8] lr=[CFA+16]
+ row_sp = unwind_plan.GetRowForFunctionOffset(28);
+ EXPECT_EQ(28ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r31_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(112, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_r31_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(-8, regloc.GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_lr_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(16, regloc.GetOffset());
+
+ // 5: CFA=sp+0 => fp=[CFA-8] lr=[CFA+16]
+ row_sp = unwind_plan.GetRowForFunctionOffset(40);
+ EXPECT_EQ(40ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_r31_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(-8, regloc.GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_lr_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(16, regloc.GetOffset());
+}
+
+TEST_F(TestPPC64InstEmulation, TestMediumFunction) {
+ ArchSpec arch("powerpc64le-linux-gnu");
+ std::unique_ptr<UnwindAssemblyInstEmulation> engine(
+ static_cast<UnwindAssemblyInstEmulation *>(
+ UnwindAssemblyInstEmulation::CreateInstance(arch)));
+ ASSERT_NE(nullptr, engine);
+
+ UnwindPlan::RowSP row_sp;
+ AddressRange sample_range;
+ UnwindPlan unwind_plan(eRegisterKindLLDB);
+ UnwindPlan::Row::RegisterLocation regloc;
+
+ // prologue and epilogue of main() (call-func.c),
+ // with several calls and stack variables.
+ //
+ // compiled with clang -O0 -g
+ uint8_t data[] = {
+ // prologue
+ 0xa6, 0x02, 0x08, 0x7c, // 0: mflr r0
+ 0xf8, 0xff, 0xe1, 0xfb, // 4: std r31, -8(r1)
+ 0x10, 0x00, 0x01, 0xf8, // 8: std r0, 16(r1)
+ 0x78, 0x0b, 0x3e, 0x7c, // 12: mr r30, r1
+ 0xe0, 0x06, 0x20, 0x78, // 16: clrldi r0, r1, 59
+ 0xa0, 0xfa, 0x00, 0x20, // 20: subfic r0, r0, -1376
+ 0x6a, 0x01, 0x21, 0x7c, // 24: stdux r1, r1, r0
+ 0x78, 0x0b, 0x3f, 0x7c, // 28: mr r31, r1
+
+ // epilogue
+ 0x00, 0x00, 0x21, 0xe8, // 32: ld r1, 0(r1)
+ 0x20, 0x00, 0x80, 0x4e // 36: blr
+ };
+
+ sample_range = AddressRange(0x1000, sizeof(data));
+
+ EXPECT_TRUE(engine->GetNonCallSiteUnwindPlanFromAssembly(
+ sample_range, data, sizeof(data), unwind_plan));
+
+ // 0: CFA=sp+0
+ row_sp = unwind_plan.GetRowForFunctionOffset(0);
+ EXPECT_EQ(0ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ // 1: CFA=sp+0 => fp=[CFA-8]
+ row_sp = unwind_plan.GetRowForFunctionOffset(8);
+ EXPECT_EQ(8ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_r31_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(-8, regloc.GetOffset());
+
+ // 2: CFA=sp+0 => fp=[CFA-8] lr=[CFA+16]
+ row_sp = unwind_plan.GetRowForFunctionOffset(12);
+ EXPECT_EQ(12ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ EXPECT_TRUE(row_sp->GetRegisterInfo(gpr_lr_ppc64le, regloc));
+ EXPECT_TRUE(regloc.IsAtCFAPlusOffset());
+ EXPECT_EQ(16, regloc.GetOffset());
+
+ // 3: CFA=r30
+ row_sp = unwind_plan.GetRowForFunctionOffset(16);
+ EXPECT_EQ(16ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r30_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ row_sp = unwind_plan.GetRowForFunctionOffset(32);
+ EXPECT_EQ(16ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r30_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+
+ // 4: CFA=sp+0
+ row_sp = unwind_plan.GetRowForFunctionOffset(36);
+ EXPECT_EQ(36ull, row_sp->GetOffset());
+ EXPECT_TRUE(row_sp->GetCFAValue().GetRegisterNumber() == gpr_r1_ppc64le);
+ EXPECT_TRUE(row_sp->GetCFAValue().IsRegisterPlusOffset() == true);
+ EXPECT_EQ(0, row_sp->GetCFAValue().GetOffset());
+}
diff --git a/unittests/Utility/AnsiTerminalTest.cpp b/unittests/Utility/AnsiTerminalTest.cpp
new file mode 100644
index 000000000000..f2d755db1beb
--- /dev/null
+++ b/unittests/Utility/AnsiTerminalTest.cpp
@@ -0,0 +1,55 @@
+//===-- AnsiTerminalTest.cpp ------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/AnsiTerminal.h"
+
+using namespace lldb_utility;
+
+TEST(AnsiTerminal, Empty) { EXPECT_EQ("", ansi::FormatAnsiTerminalCodes("")); }
+
+TEST(AnsiTerminal, WhiteSpace) {
+ EXPECT_EQ(" ", ansi::FormatAnsiTerminalCodes(" "));
+}
+
+TEST(AnsiTerminal, AtEnd) {
+ EXPECT_EQ("abc\x1B[30m",
+ ansi::FormatAnsiTerminalCodes("abc${ansi.fg.black}"));
+}
+
+TEST(AnsiTerminal, AtStart) {
+ EXPECT_EQ("\x1B[30mabc",
+ ansi::FormatAnsiTerminalCodes("${ansi.fg.black}abc"));
+}
+
+TEST(AnsiTerminal, KnownPrefix) {
+ EXPECT_EQ("${ansi.fg.redish}abc",
+ ansi::FormatAnsiTerminalCodes("${ansi.fg.redish}abc"));
+}
+
+TEST(AnsiTerminal, Unknown) {
+ EXPECT_EQ("${ansi.fg.foo}abc",
+ ansi::FormatAnsiTerminalCodes("${ansi.fg.foo}abc"));
+}
+
+TEST(AnsiTerminal, Incomplete) {
+ EXPECT_EQ("abc${ansi.", ansi::FormatAnsiTerminalCodes("abc${ansi."));
+}
+
+TEST(AnsiTerminal, Twice) {
+ EXPECT_EQ("\x1B[30m\x1B[31mabc",
+ ansi::FormatAnsiTerminalCodes("${ansi.fg.black}${ansi.fg.red}abc"));
+}
+
+TEST(AnsiTerminal, Basic) {
+ EXPECT_EQ(
+ "abc\x1B[31mabc\x1B[0mabc",
+ ansi::FormatAnsiTerminalCodes("abc${ansi.fg.red}abc${ansi.normal}abc"));
+}
diff --git a/unittests/Utility/ArchSpecTest.cpp b/unittests/Utility/ArchSpecTest.cpp
index a45e28e658b8..d7397cbec531 100644
--- a/unittests/Utility/ArchSpecTest.cpp
+++ b/unittests/Utility/ArchSpecTest.cpp
@@ -152,3 +152,22 @@ TEST(ArchSpecTest, MergeFrom) {
EXPECT_EQ(llvm::Triple::OSType::Linux, A.GetTriple().getOS());
EXPECT_EQ(ArchSpec::eCore_x86_64_x86_64, A.GetCore());
}
+
+TEST(ArchSpecTest, MergeFromMachOUnknown) {
+ class MyArchSpec : public ArchSpec {
+ public:
+ MyArchSpec() {
+ this->SetTriple("unknown-mach-64");
+ this->m_core = ArchSpec::eCore_uknownMach64;
+ this->m_byte_order = eByteOrderLittle;
+ this->m_flags = 0;
+ }
+ };
+
+ MyArchSpec A;
+ ASSERT_TRUE(A.IsValid());
+ MyArchSpec B;
+ ASSERT_TRUE(B.IsValid());
+ A.MergeFrom(B);
+ ASSERT_EQ(A.GetCore(), ArchSpec::eCore_uknownMach64);
+}
diff --git a/unittests/Utility/ArgsTest.cpp b/unittests/Utility/ArgsTest.cpp
new file mode 100644
index 000000000000..586bbfdf128e
--- /dev/null
+++ b/unittests/Utility/ArgsTest.cpp
@@ -0,0 +1,191 @@
+//===-- ArgsTest.cpp --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/StringList.h"
+
+#include <limits>
+#include <sstream>
+
+using namespace lldb_private;
+
+TEST(ArgsTest, TestSingleArg) {
+ Args args;
+ args.SetCommandString("arg");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg");
+}
+
+TEST(ArgsTest, TestSingleQuotedArgWithSpace) {
+ Args args;
+ args.SetCommandString("\"arg with space\"");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg with space");
+}
+
+TEST(ArgsTest, TestSingleArgWithQuotedSpace) {
+ Args args;
+ args.SetCommandString("arg\\ with\\ space");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg with space");
+}
+
+TEST(ArgsTest, TestMultipleArgs) {
+ Args args;
+ args.SetCommandString("this has multiple args");
+ EXPECT_EQ(4u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "this");
+ EXPECT_STREQ(args.GetArgumentAtIndex(1), "has");
+ EXPECT_STREQ(args.GetArgumentAtIndex(2), "multiple");
+ EXPECT_STREQ(args.GetArgumentAtIndex(3), "args");
+}
+
+TEST(ArgsTest, TestOverwriteArgs) {
+ Args args;
+ args.SetCommandString("this has multiple args");
+ EXPECT_EQ(4u, args.GetArgumentCount());
+ args.SetCommandString("arg");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "arg");
+}
+
+TEST(ArgsTest, TestAppendArg) {
+ Args args;
+ args.SetCommandString("first_arg");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+ args.AppendArgument(llvm::StringRef("second_arg"));
+ EXPECT_EQ(2u, args.GetArgumentCount());
+ EXPECT_STREQ(args.GetArgumentAtIndex(0), "first_arg");
+ EXPECT_STREQ(args.GetArgumentAtIndex(1), "second_arg");
+}
+
+TEST(ArgsTest, TestInsertArg) {
+ Args args;
+ args.AppendArgument("1");
+ args.AppendArgument("2");
+ args.AppendArgument("3");
+ args.InsertArgumentAtIndex(1, "1.5");
+ args.InsertArgumentAtIndex(4, "3.5");
+
+ ASSERT_EQ(5u, args.GetArgumentCount());
+ EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+ EXPECT_STREQ("1.5", args.GetArgumentAtIndex(1));
+ EXPECT_STREQ("2", args.GetArgumentAtIndex(2));
+ EXPECT_STREQ("3", args.GetArgumentAtIndex(3));
+ EXPECT_STREQ("3.5", args.GetArgumentAtIndex(4));
+}
+
+TEST(ArgsTest, TestArgv) {
+ Args args;
+ EXPECT_EQ(nullptr, args.GetArgumentVector());
+
+ args.AppendArgument("1");
+ EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[1]);
+
+ args.AppendArgument("2");
+ EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
+
+ args.AppendArgument("3");
+ EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[3]);
+
+ args.InsertArgumentAtIndex(1, "1.5");
+ EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
+
+ args.InsertArgumentAtIndex(4, "3.5");
+ EXPECT_NE(nullptr, args.GetArgumentVector()[0]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[1]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[2]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[3]);
+ EXPECT_NE(nullptr, args.GetArgumentVector()[4]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[5]);
+}
+
+TEST(ArgsTest, StringListConstructor) {
+ StringList list;
+ list << "foo"
+ << "bar"
+ << "baz";
+ Args args(list);
+ ASSERT_EQ(3u, args.GetArgumentCount());
+ EXPECT_EQ("foo", args[0].ref);
+ EXPECT_EQ("bar", args[1].ref);
+ EXPECT_EQ("baz", args[2].ref);
+}
+
+TEST(ArgsTest, GetQuotedCommandString) {
+ Args args;
+ const char *str = "process launch -o stdout.txt -- \"a b c\"";
+ args.SetCommandString(str);
+
+ std::string stdstr;
+ ASSERT_TRUE(args.GetQuotedCommandString(stdstr));
+ EXPECT_EQ(str, stdstr);
+}
+
+TEST(ArgsTest, BareSingleQuote) {
+ Args args;
+ args.SetCommandString("a\\'b");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+
+ EXPECT_STREQ("a'b", args.GetArgumentAtIndex(0));
+}
+
+TEST(ArgsTest, DoubleQuotedItem) {
+ Args args;
+ args.SetCommandString("\"a b c\"");
+ EXPECT_EQ(1u, args.GetArgumentCount());
+
+ EXPECT_STREQ("a b c", args.GetArgumentAtIndex(0));
+}
+
+TEST(ArgsTest, AppendArguments) {
+ Args args;
+ const char *argv[] = {"1", "2", nullptr};
+ const char *argv2[] = {"3", "4", nullptr};
+
+ args.AppendArguments(argv);
+ ASSERT_EQ(2u, args.GetArgumentCount());
+ EXPECT_STREQ("1", args.GetArgumentVector()[0]);
+ EXPECT_STREQ("2", args.GetArgumentVector()[1]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[2]);
+ EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+ EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
+
+ args.AppendArguments(argv2);
+ ASSERT_EQ(4u, args.GetArgumentCount());
+ EXPECT_STREQ("1", args.GetArgumentVector()[0]);
+ EXPECT_STREQ("2", args.GetArgumentVector()[1]);
+ EXPECT_STREQ("3", args.GetArgumentVector()[2]);
+ EXPECT_STREQ("4", args.GetArgumentVector()[3]);
+ EXPECT_EQ(nullptr, args.GetArgumentVector()[4]);
+ EXPECT_STREQ("1", args.GetArgumentAtIndex(0));
+ EXPECT_STREQ("2", args.GetArgumentAtIndex(1));
+ EXPECT_STREQ("3", args.GetArgumentAtIndex(2));
+ EXPECT_STREQ("4", args.GetArgumentAtIndex(3));
+}
+
+TEST(ArgsTest, GetArgumentArrayRef) {
+ Args args("foo bar");
+ auto ref = args.GetArgumentArrayRef();
+ ASSERT_EQ(2u, ref.size());
+ EXPECT_STREQ("foo", ref[0]);
+ EXPECT_STREQ("bar", ref[1]);
+}
diff --git a/unittests/Utility/CMakeLists.txt b/unittests/Utility/CMakeLists.txt
index 13f840af2bb9..6d9d7a4d0069 100644
--- a/unittests/Utility/CMakeLists.txt
+++ b/unittests/Utility/CMakeLists.txt
@@ -1,17 +1,28 @@
add_lldb_unittest(UtilityTests
+ AnsiTerminalTest.cpp
+ ArgsTest.cpp
+ OptionsWithRawTest.cpp
ArchSpecTest.cpp
+ CleanUpTest.cpp
ConstStringTest.cpp
+ CompletionRequestTest.cpp
+ EnvironmentTest.cpp
+ FileSpecTest.cpp
+ FlagsTest.cpp
JSONTest.cpp
LogTest.cpp
NameMatchesTest.cpp
StatusTest.cpp
+ StreamTeeTest.cpp
StringExtractorTest.cpp
StructuredDataTest.cpp
TildeExpressionResolverTest.cpp
TimeoutTest.cpp
TimerTest.cpp
UriParserTest.cpp
+ UUIDTest.cpp
VASprintfTest.cpp
+ VMRangeTest.cpp
LINK_LIBS
lldbUtility
diff --git a/unittests/Utility/CleanUpTest.cpp b/unittests/Utility/CleanUpTest.cpp
new file mode 100644
index 000000000000..164dc32f7314
--- /dev/null
+++ b/unittests/Utility/CleanUpTest.cpp
@@ -0,0 +1,47 @@
+//===-- CleanUpTest.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/CleanUp.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+TEST(CleanUpTest, no_args) {
+ bool f = false;
+ {
+ CleanUp cleanup([&] { f = true; });
+ }
+ ASSERT_TRUE(f);
+}
+
+TEST(CleanUpTest, multiple_args) {
+ bool f1 = false;
+ bool f2 = false;
+ bool f3 = false;
+ {
+ CleanUp cleanup(
+ [](bool arg1, bool *arg2, bool &arg3) {
+ ASSERT_FALSE(arg1);
+ *arg2 = true;
+ arg3 = true;
+ },
+ f1, &f2, f3);
+ }
+ ASSERT_TRUE(f2);
+ ASSERT_FALSE(f3);
+}
+
+TEST(CleanUpTest, disable) {
+ bool f = false;
+ {
+ CleanUp cleanup([&] { f = true; });
+ cleanup.disable();
+ }
+ ASSERT_FALSE(f);
+}
diff --git a/unittests/Utility/CompletionRequestTest.cpp b/unittests/Utility/CompletionRequestTest.cpp
new file mode 100644
index 000000000000..134bf517f854
--- /dev/null
+++ b/unittests/Utility/CompletionRequestTest.cpp
@@ -0,0 +1,40 @@
+//===-- CompletionRequestTest.cpp -------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/CompletionRequest.h"
+using namespace lldb_private;
+
+TEST(CompletionRequest, Constructor) {
+ std::string command = "a bad c";
+ const unsigned cursor_pos = 3;
+ const int arg_index = 1;
+ const int arg_cursor_pos = 1;
+ const int match_start = 2345;
+ const int match_max_return = 12345;
+ StringList matches;
+
+ CompletionRequest request(command, cursor_pos, match_start, match_max_return,
+ matches);
+
+ EXPECT_STREQ(request.GetRawLine().str().c_str(), command.c_str());
+ EXPECT_EQ(request.GetRawCursorPos(), cursor_pos);
+ EXPECT_EQ(request.GetCursorIndex(), arg_index);
+ EXPECT_EQ(request.GetCursorCharPosition(), arg_cursor_pos);
+ EXPECT_EQ(request.GetMatchStartPoint(), match_start);
+ EXPECT_EQ(request.GetMaxReturnElements(), match_max_return);
+ EXPECT_EQ(request.GetWordComplete(), false);
+
+ EXPECT_EQ(request.GetPartialParsedLine().GetArgumentCount(), 2u);
+ EXPECT_STREQ(request.GetPartialParsedLine().GetArgumentAtIndex(1), "b");
+
+ // This is the generated matches should be equal to our passed string list.
+ EXPECT_EQ(&request.GetMatches(), &matches);
+}
diff --git a/unittests/Utility/EnvironmentTest.cpp b/unittests/Utility/EnvironmentTest.cpp
new file mode 100644
index 000000000000..549154170338
--- /dev/null
+++ b/unittests/Utility/EnvironmentTest.cpp
@@ -0,0 +1,49 @@
+//===-- EnvironmentTest.cpp -------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/Environment.h"
+
+using namespace lldb_private;
+
+TEST(EnvironmentTest, EnvpConstruction) {
+ const char **Envp1 = nullptr;
+ EXPECT_EQ(0u, Environment(Envp1).size());
+
+ const char *Envp2[] = {"FOO=BAR", nullptr};
+ EXPECT_EQ("BAR", Environment(Envp2).lookup("FOO"));
+
+ const char *Envp3[] = {"FOO=BAR", "FOO=BAZ", nullptr};
+ EXPECT_EQ("BAR", Environment(Envp3).lookup("FOO"));
+
+ const char *Envp4[] = {"FOO=", "BAR", nullptr};
+ Environment Env4(Envp4);
+ ASSERT_EQ(2u, Env4.size());
+ EXPECT_EQ("", Environment(Envp4).find("FOO")->second);
+ EXPECT_EQ("", Environment(Envp4).find("BAR")->second);
+
+ const char *Envp5[] = {"FOO=BAR=BAZ", nullptr};
+ EXPECT_EQ("BAR=BAZ", Environment(Envp5).lookup("FOO"));
+}
+
+TEST(EnvironmentTest, EnvpConversion) {
+ std::string FOO_EQ_BAR("FOO=BAR");
+ std::string BAR_EQ_BAZ("BAR=BAZ");
+
+ Environment Env;
+ Env.insert(FOO_EQ_BAR);
+ Env.insert(BAR_EQ_BAZ);
+ Environment::Envp Envp = Env.getEnvp();
+ const char *const *Envp_ = Envp;
+
+ EXPECT_TRUE(FOO_EQ_BAR == Envp_[0] || FOO_EQ_BAR == Envp_[1]);
+ EXPECT_TRUE(BAR_EQ_BAZ == Envp_[0] || BAR_EQ_BAZ == Envp_[1]);
+ EXPECT_EQ(nullptr, Envp_[2]);
+}
diff --git a/unittests/Host/FileSpecTest.cpp b/unittests/Utility/FileSpecTest.cpp
index cb6877e7b622..a271229b2e03 100644
--- a/unittests/Host/FileSpecTest.cpp
+++ b/unittests/Utility/FileSpecTest.cpp
@@ -14,86 +14,92 @@
using namespace lldb_private;
TEST(FileSpecTest, FileAndDirectoryComponents) {
- FileSpec fs_posix("/foo/bar", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix("/foo/bar", false, FileSpec::Style::posix);
EXPECT_STREQ("/foo/bar", fs_posix.GetCString());
EXPECT_STREQ("/foo", fs_posix.GetDirectory().GetCString());
EXPECT_STREQ("bar", fs_posix.GetFilename().GetCString());
- FileSpec fs_windows("F:\\bar", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows("F:\\bar", false, FileSpec::Style::windows);
EXPECT_STREQ("F:\\bar", fs_windows.GetCString());
// EXPECT_STREQ("F:\\", fs_windows.GetDirectory().GetCString()); // It returns
// "F:/"
EXPECT_STREQ("bar", fs_windows.GetFilename().GetCString());
- FileSpec fs_posix_root("/", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_root("/", false, FileSpec::Style::posix);
EXPECT_STREQ("/", fs_posix_root.GetCString());
EXPECT_EQ(nullptr, fs_posix_root.GetDirectory().GetCString());
EXPECT_STREQ("/", fs_posix_root.GetFilename().GetCString());
- FileSpec fs_windows_drive("F:", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_net_drive("//net", false, FileSpec::Style::posix);
+ EXPECT_STREQ("//net", fs_net_drive.GetCString());
+ EXPECT_EQ(nullptr, fs_net_drive.GetDirectory().GetCString());
+ EXPECT_STREQ("//net", fs_net_drive.GetFilename().GetCString());
+
+ FileSpec fs_net_root("//net/", false, FileSpec::Style::posix);
+ EXPECT_STREQ("//net/", fs_net_root.GetCString());
+ EXPECT_STREQ("//net", fs_net_root.GetDirectory().GetCString());
+ EXPECT_STREQ("/", fs_net_root.GetFilename().GetCString());
+
+ FileSpec fs_windows_drive("F:", false, FileSpec::Style::windows);
EXPECT_STREQ("F:", fs_windows_drive.GetCString());
EXPECT_EQ(nullptr, fs_windows_drive.GetDirectory().GetCString());
EXPECT_STREQ("F:", fs_windows_drive.GetFilename().GetCString());
- FileSpec fs_windows_root("F:\\", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows_root("F:\\", false, FileSpec::Style::windows);
EXPECT_STREQ("F:\\", fs_windows_root.GetCString());
EXPECT_STREQ("F:", fs_windows_root.GetDirectory().GetCString());
// EXPECT_STREQ("\\", fs_windows_root.GetFilename().GetCString()); // It
// returns "/"
- FileSpec fs_posix_long("/foo/bar/baz", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_long("/foo/bar/baz", false, FileSpec::Style::posix);
EXPECT_STREQ("/foo/bar/baz", fs_posix_long.GetCString());
EXPECT_STREQ("/foo/bar", fs_posix_long.GetDirectory().GetCString());
EXPECT_STREQ("baz", fs_posix_long.GetFilename().GetCString());
- FileSpec fs_windows_long("F:\\bar\\baz", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows_long("F:\\bar\\baz", false, FileSpec::Style::windows);
EXPECT_STREQ("F:\\bar\\baz", fs_windows_long.GetCString());
// EXPECT_STREQ("F:\\bar", fs_windows_long.GetDirectory().GetCString()); // It
// returns "F:/bar"
EXPECT_STREQ("baz", fs_windows_long.GetFilename().GetCString());
- FileSpec fs_posix_trailing_slash("/foo/bar/", false,
- FileSpec::ePathSyntaxPosix);
- EXPECT_STREQ("/foo/bar/.", fs_posix_trailing_slash.GetCString());
- EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetDirectory().GetCString());
- EXPECT_STREQ(".", fs_posix_trailing_slash.GetFilename().GetCString());
+ FileSpec fs_posix_trailing_slash("/foo/bar/", false, FileSpec::Style::posix);
+ EXPECT_STREQ("/foo/bar", fs_posix_trailing_slash.GetCString());
+ EXPECT_STREQ("/foo", fs_posix_trailing_slash.GetDirectory().GetCString());
+ EXPECT_STREQ("bar", fs_posix_trailing_slash.GetFilename().GetCString());
FileSpec fs_windows_trailing_slash("F:\\bar\\", false,
- FileSpec::ePathSyntaxWindows);
- EXPECT_STREQ("F:\\bar\\.", fs_windows_trailing_slash.GetCString());
- // EXPECT_STREQ("F:\\bar",
- // fs_windows_trailing_slash.GetDirectory().GetCString()); // It returns
- // "F:/bar"
- EXPECT_STREQ(".", fs_windows_trailing_slash.GetFilename().GetCString());
+ FileSpec::Style::windows);
+ EXPECT_STREQ("F:\\bar", fs_windows_trailing_slash.GetCString());
+ EXPECT_STREQ("bar", fs_windows_trailing_slash.GetFilename().GetCString());
}
TEST(FileSpecTest, AppendPathComponent) {
- FileSpec fs_posix("/foo", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix("/foo", false, FileSpec::Style::posix);
fs_posix.AppendPathComponent("bar");
EXPECT_STREQ("/foo/bar", fs_posix.GetCString());
EXPECT_STREQ("/foo", fs_posix.GetDirectory().GetCString());
EXPECT_STREQ("bar", fs_posix.GetFilename().GetCString());
- FileSpec fs_posix_2("/foo", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_2("/foo", false, FileSpec::Style::posix);
fs_posix_2.AppendPathComponent("//bar/baz");
EXPECT_STREQ("/foo/bar/baz", fs_posix_2.GetCString());
EXPECT_STREQ("/foo/bar", fs_posix_2.GetDirectory().GetCString());
EXPECT_STREQ("baz", fs_posix_2.GetFilename().GetCString());
- FileSpec fs_windows("F:\\bar", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows("F:\\bar", false, FileSpec::Style::windows);
fs_windows.AppendPathComponent("baz");
EXPECT_STREQ("F:\\bar\\baz", fs_windows.GetCString());
// EXPECT_STREQ("F:\\bar", fs_windows.GetDirectory().GetCString()); // It
// returns "F:/bar"
EXPECT_STREQ("baz", fs_windows.GetFilename().GetCString());
- FileSpec fs_posix_root("/", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_root("/", false, FileSpec::Style::posix);
fs_posix_root.AppendPathComponent("bar");
EXPECT_STREQ("/bar", fs_posix_root.GetCString());
EXPECT_STREQ("/", fs_posix_root.GetDirectory().GetCString());
EXPECT_STREQ("bar", fs_posix_root.GetFilename().GetCString());
- FileSpec fs_windows_root("F:\\", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows_root("F:\\", false, FileSpec::Style::windows);
fs_windows_root.AppendPathComponent("bar");
EXPECT_STREQ("F:\\bar", fs_windows_root.GetCString());
// EXPECT_STREQ("F:\\", fs_windows_root.GetDirectory().GetCString()); // It
@@ -102,7 +108,7 @@ TEST(FileSpecTest, AppendPathComponent) {
}
TEST(FileSpecTest, CopyByAppendingPathComponent) {
- FileSpec fs = FileSpec("/foo", false, FileSpec::ePathSyntaxPosix)
+ FileSpec fs = FileSpec("/foo", false, FileSpec::Style::posix)
.CopyByAppendingPathComponent("bar");
EXPECT_STREQ("/foo/bar", fs.GetCString());
EXPECT_STREQ("/foo", fs.GetDirectory().GetCString());
@@ -110,53 +116,34 @@ TEST(FileSpecTest, CopyByAppendingPathComponent) {
}
TEST(FileSpecTest, PrependPathComponent) {
- FileSpec fs_posix("foo", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix("foo", false, FileSpec::Style::posix);
fs_posix.PrependPathComponent("/bar");
EXPECT_STREQ("/bar/foo", fs_posix.GetCString());
- FileSpec fs_posix_2("foo/bar", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_2("foo/bar", false, FileSpec::Style::posix);
fs_posix_2.PrependPathComponent("/baz");
EXPECT_STREQ("/baz/foo/bar", fs_posix_2.GetCString());
- FileSpec fs_windows("baz", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows("baz", false, FileSpec::Style::windows);
fs_windows.PrependPathComponent("F:\\bar");
EXPECT_STREQ("F:\\bar\\baz", fs_windows.GetCString());
- FileSpec fs_posix_root("bar", false, FileSpec::ePathSyntaxPosix);
+ FileSpec fs_posix_root("bar", false, FileSpec::Style::posix);
fs_posix_root.PrependPathComponent("/");
EXPECT_STREQ("/bar", fs_posix_root.GetCString());
- FileSpec fs_windows_root("bar", false, FileSpec::ePathSyntaxWindows);
+ FileSpec fs_windows_root("bar", false, FileSpec::Style::windows);
fs_windows_root.PrependPathComponent("F:\\");
EXPECT_STREQ("F:\\bar", fs_windows_root.GetCString());
}
-static void Compare(const FileSpec &one, const FileSpec &two, bool full_match,
- bool remove_backup_dots, bool result) {
- EXPECT_EQ(result, FileSpec::Equal(one, two, full_match, remove_backup_dots))
- << "File one: " << one.GetCString() << "\nFile two: " << two.GetCString()
- << "\nFull match: " << full_match
- << "\nRemove backup dots: " << remove_backup_dots;
-}
-
TEST(FileSpecTest, EqualSeparator) {
- FileSpec backward("C:\\foo\\bar", false, FileSpec::ePathSyntaxWindows);
- FileSpec forward("C:/foo/bar", false, FileSpec::ePathSyntaxWindows);
+ FileSpec backward("C:\\foo\\bar", false, FileSpec::Style::windows);
+ FileSpec forward("C:/foo/bar", false, FileSpec::Style::windows);
EXPECT_EQ(forward, backward);
-
- const bool full_match = true;
- const bool remove_backup_dots = true;
- const bool match = true;
- Compare(forward, backward, full_match, remove_backup_dots, match);
- Compare(forward, backward, full_match, !remove_backup_dots, match);
- Compare(forward, backward, !full_match, remove_backup_dots, match);
- Compare(forward, backward, !full_match, !remove_backup_dots, match);
}
TEST(FileSpecTest, EqualDotsWindows) {
- const bool full_match = true;
- const bool remove_backup_dots = true;
- const bool match = true;
std::pair<const char *, const char *> tests[] = {
{R"(C:\foo\bar\baz)", R"(C:\foo\foo\..\bar\baz)"},
{R"(C:\bar\baz)", R"(C:\foo\..\bar\baz)"},
@@ -167,22 +154,14 @@ TEST(FileSpecTest, EqualDotsWindows) {
{R"(C:\foo\bar)", R"(C:\foo\bar\.)"},
};
- for(const auto &test: tests) {
- FileSpec one(test.first, false, FileSpec::ePathSyntaxWindows);
- FileSpec two(test.second, false, FileSpec::ePathSyntaxWindows);
- EXPECT_NE(one, two);
- Compare(one, two, full_match, remove_backup_dots, match);
- Compare(one, two, full_match, !remove_backup_dots, !match);
- Compare(one, two, !full_match, remove_backup_dots, match);
- Compare(one, two, !full_match, !remove_backup_dots, !match);
+ for (const auto &test : tests) {
+ FileSpec one(test.first, false, FileSpec::Style::windows);
+ FileSpec two(test.second, false, FileSpec::Style::windows);
+ EXPECT_EQ(one, two);
}
-
}
TEST(FileSpecTest, EqualDotsPosix) {
- const bool full_match = true;
- const bool remove_backup_dots = true;
- const bool match = true;
std::pair<const char *, const char *> tests[] = {
{R"(/foo/bar/baz)", R"(/foo/foo/../bar/baz)"},
{R"(/bar/baz)", R"(/foo/../bar/baz)"},
@@ -191,34 +170,24 @@ TEST(FileSpecTest, EqualDotsPosix) {
{R"(/foo/bar)", R"(/foo/bar/.)"},
};
- for(const auto &test: tests) {
- FileSpec one(test.first, false, FileSpec::ePathSyntaxPosix);
- FileSpec two(test.second, false, FileSpec::ePathSyntaxPosix);
- EXPECT_NE(one, two);
- Compare(one, two, full_match, remove_backup_dots, match);
- Compare(one, two, full_match, !remove_backup_dots, !match);
- Compare(one, two, !full_match, remove_backup_dots, match);
- Compare(one, two, !full_match, !remove_backup_dots, !match);
+ for (const auto &test : tests) {
+ FileSpec one(test.first, false, FileSpec::Style::posix);
+ FileSpec two(test.second, false, FileSpec::Style::posix);
+ EXPECT_EQ(one, two);
}
-
}
TEST(FileSpecTest, EqualDotsPosixRoot) {
- const bool full_match = true;
- const bool remove_backup_dots = true;
- const bool match = true;
std::pair<const char *, const char *> tests[] = {
- {R"(/)", R"(/..)"}, {R"(/)", R"(/.)"}, {R"(/)", R"(/foo/..)"},
+ {R"(/)", R"(/..)"},
+ {R"(/)", R"(/.)"},
+ {R"(/)", R"(/foo/..)"},
};
- for(const auto &test: tests) {
- FileSpec one(test.first, false, FileSpec::ePathSyntaxPosix);
- FileSpec two(test.second, false, FileSpec::ePathSyntaxPosix);
- EXPECT_NE(one, two);
- Compare(one, two, full_match, remove_backup_dots, match);
- Compare(one, two, full_match, !remove_backup_dots, !match);
- Compare(one, two, !full_match, remove_backup_dots, !match);
- Compare(one, two, !full_match, !remove_backup_dots, !match);
+ for (const auto &test : tests) {
+ FileSpec one(test.first, false, FileSpec::Style::posix);
+ FileSpec two(test.second, false, FileSpec::Style::posix);
+ EXPECT_EQ(one, two);
}
}
@@ -235,7 +204,7 @@ TEST(FileSpecTest, GetNormalizedPath) {
{"/foo//bar/./baz", "/foo/bar/baz"},
{"/./foo", "/foo"},
{"/", "/"},
- {"//", "//"},
+ {"//", "/"},
{"//net", "//net"},
{"/..", "/"},
{"/.", "/"},
@@ -246,12 +215,14 @@ TEST(FileSpecTest, GetNormalizedPath) {
{"foo/../bar", "bar"},
{"../foo/..", ".."},
{"./foo", "foo"},
+ {"././foo", "foo"},
+ {"../foo", "../foo"},
+ {"../../foo", "../../foo"},
};
for (auto test : posix_tests) {
+ SCOPED_TRACE(llvm::Twine("test.first = ") + test.first);
EXPECT_EQ(test.second,
- FileSpec(test.first, false, FileSpec::ePathSyntaxPosix)
- .GetNormalizedPath()
- .GetPath());
+ FileSpec(test.first, false, FileSpec::Style::posix).GetPath());
}
std::pair<const char *, const char *> windows_tests[] = {
@@ -261,32 +232,35 @@ TEST(FileSpecTest, GetNormalizedPath) {
{R"(c:\bar\.)", R"(c:\bar)"},
{R"(c:\.\bar)", R"(c:\bar)"},
{R"(\)", R"(\)"},
- // {R"(\\)", R"(\\)"},
- // {R"(\\net)", R"(\\net)"},
+ {R"(\\)", R"(\)"},
+ {R"(\\net)", R"(\\net)"},
{R"(c:\..)", R"(c:\)"},
{R"(c:\.)", R"(c:\)"},
- {R"(\..)", R"(\)"},
+ // TODO: fix llvm::sys::path::remove_dots() to return "\" below.
+ {R"(\..)", R"(\..)"},
// {R"(c:..)", R"(c:..)"},
{R"(..)", R"(..)"},
{R"(.)", R"(.)"},
- {R"(c:..\..)", R"(c:..\..)"},
+ // TODO: fix llvm::sys::path::remove_dots() to return "c:\" below.
+ {R"(c:..\..)", R"(c:\..\..)"},
{R"(..\..)", R"(..\..)"},
{R"(foo\..)", R"(.)"},
{R"(foo\..\bar)", R"(bar)"},
{R"(..\foo\..)", R"(..)"},
{R"(.\foo)", R"(foo)"},
+ {R"(.\.\foo)", R"(foo)"},
+ {R"(..\foo)", R"(..\foo)"},
+ {R"(..\..\foo)", R"(..\..\foo)"},
};
for (auto test : windows_tests) {
EXPECT_EQ(test.second,
- FileSpec(test.first, false, FileSpec::ePathSyntaxWindows)
- .GetNormalizedPath()
- .GetPath())
+ FileSpec(test.first, false, FileSpec::Style::windows).GetPath())
<< "Original path: " << test.first;
}
}
TEST(FileSpecTest, FormatFileSpec) {
- auto win = FileSpec::ePathSyntaxWindows;
+ auto win = FileSpec::Style::windows;
FileSpec F;
EXPECT_EQ("(empty)", llvm::formatv("{0}", F).str());
@@ -308,3 +282,91 @@ TEST(FileSpecTest, FormatFileSpec) {
EXPECT_EQ("foo", llvm::formatv("{0:F}", F).str());
EXPECT_EQ("(empty)", llvm::formatv("{0:D}", F).str());
}
+
+TEST(FileSpecTest, IsRelative) {
+ llvm::StringRef not_relative[] = {
+ "/",
+ "/a",
+ "/a/",
+ "/a/b",
+ "/a/b/",
+ "//",
+ "//a/",
+ "//a/b",
+ "//a/b/",
+ "~",
+ "~/",
+ "~/a",
+ "~/a/",
+ "~/a/b"
+ "~/a/b/",
+ "/foo/.",
+ "/foo/..",
+ "/foo/../",
+ "/foo/../.",
+ };
+ for (const auto &path: not_relative) {
+ FileSpec spec(path, false, FileSpec::Style::posix);
+ EXPECT_FALSE(spec.IsRelative());
+ }
+ llvm::StringRef is_relative[] = {
+ ".",
+ "./",
+ ".///",
+ "a",
+ "./a",
+ "./a/",
+ "./a/",
+ "./a/b",
+ "./a/b/",
+ "../foo",
+ "foo/bar.c",
+ "./foo/bar.c"
+ };
+ for (const auto &path: is_relative) {
+ FileSpec spec(path, false, FileSpec::Style::posix);
+ EXPECT_TRUE(spec.IsRelative());
+ }
+}
+
+TEST(FileSpecTest, RemoveLastPathComponent) {
+ FileSpec fs_posix("/foo/bar/baz", false, FileSpec::Style::posix);
+ EXPECT_STREQ("/foo/bar/baz", fs_posix.GetCString());
+ EXPECT_TRUE(fs_posix.RemoveLastPathComponent());
+ EXPECT_STREQ("/foo/bar", fs_posix.GetCString());
+ EXPECT_TRUE(fs_posix.RemoveLastPathComponent());
+ EXPECT_STREQ("/foo", fs_posix.GetCString());
+ EXPECT_TRUE(fs_posix.RemoveLastPathComponent());
+ EXPECT_STREQ("/", fs_posix.GetCString());
+ EXPECT_FALSE(fs_posix.RemoveLastPathComponent());
+ EXPECT_STREQ("/", fs_posix.GetCString());
+
+ FileSpec fs_posix_relative("./foo/bar/baz", false, FileSpec::Style::posix);
+ EXPECT_STREQ("foo/bar/baz", fs_posix_relative.GetCString());
+ EXPECT_TRUE(fs_posix_relative.RemoveLastPathComponent());
+ EXPECT_STREQ("foo/bar", fs_posix_relative.GetCString());
+ EXPECT_TRUE(fs_posix_relative.RemoveLastPathComponent());
+ EXPECT_STREQ("foo", fs_posix_relative.GetCString());
+ EXPECT_FALSE(fs_posix_relative.RemoveLastPathComponent());
+ EXPECT_STREQ("foo", fs_posix_relative.GetCString());
+
+ FileSpec fs_posix_relative2("./", false, FileSpec::Style::posix);
+ EXPECT_STREQ(".", fs_posix_relative2.GetCString());
+ EXPECT_FALSE(fs_posix_relative2.RemoveLastPathComponent());
+ EXPECT_STREQ(".", fs_posix_relative2.GetCString());
+ EXPECT_FALSE(fs_posix_relative.RemoveLastPathComponent());
+ EXPECT_STREQ(".", fs_posix_relative2.GetCString());
+
+ FileSpec fs_windows("C:\\foo\\bar\\baz", false, FileSpec::Style::windows);
+ EXPECT_STREQ("C:\\foo\\bar\\baz", fs_windows.GetCString());
+ EXPECT_TRUE(fs_windows.RemoveLastPathComponent());
+ EXPECT_STREQ("C:\\foo\\bar", fs_windows.GetCString());
+ EXPECT_TRUE(fs_windows.RemoveLastPathComponent());
+ EXPECT_STREQ("C:\\foo", fs_windows.GetCString());
+ EXPECT_TRUE(fs_windows.RemoveLastPathComponent());
+ EXPECT_STREQ("C:\\", fs_windows.GetCString());
+ EXPECT_TRUE(fs_windows.RemoveLastPathComponent());
+ EXPECT_STREQ("C:", fs_windows.GetCString());
+ EXPECT_FALSE(fs_windows.RemoveLastPathComponent());
+ EXPECT_STREQ("C:", fs_windows.GetCString());
+}
diff --git a/unittests/Utility/FlagsTest.cpp b/unittests/Utility/FlagsTest.cpp
new file mode 100644
index 000000000000..ebe3cf463e34
--- /dev/null
+++ b/unittests/Utility/FlagsTest.cpp
@@ -0,0 +1,199 @@
+//===-- FlagsTest.cpp -------------------===---------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/Flags.h"
+
+using namespace lldb_private;
+
+enum DummyFlags {
+ eFlag0 = 1 << 0,
+ eFlag1 = 1 << 1,
+ eFlag2 = 1 << 2,
+ eAllFlags = (eFlag0 | eFlag1 | eFlag2)
+};
+
+TEST(Flags, GetBitSize) {
+ Flags f;
+ // Methods like ClearCount depend on this specific value, so we test
+ // against it here.
+ EXPECT_EQ(32U, f.GetBitSize());
+}
+
+TEST(Flags, Reset) {
+ Flags f;
+ f.Reset(0x3);
+ EXPECT_EQ(0x3U, f.Get());
+ EXPECT_EQ(2U, f.SetCount());
+}
+
+TEST(Flags, Clear) {
+ Flags f;
+ f.Reset(0x3);
+ EXPECT_EQ(2U, f.SetCount());
+
+ f.Clear(0x5);
+ EXPECT_EQ(1U, f.SetCount());
+
+ f.Clear();
+ EXPECT_EQ(0U, f.SetCount());
+}
+
+TEST(Flags, AllSet) {
+ Flags f;
+
+ EXPECT_FALSE(f.AllSet(eFlag0 | eFlag1));
+
+ f.Set(eFlag0);
+ EXPECT_FALSE(f.AllSet(eFlag0 | eFlag1));
+
+ f.Set(eFlag1);
+ EXPECT_TRUE(f.AllSet(eFlag0 | eFlag1));
+
+ f.Clear(eFlag1);
+ EXPECT_FALSE(f.AllSet(eFlag0 | eFlag1));
+
+ f.Clear(eFlag0);
+ EXPECT_FALSE(f.AllSet(eFlag0 | eFlag1));
+}
+
+TEST(Flags, AnySet) {
+ Flags f;
+
+ EXPECT_FALSE(f.AnySet(eFlag0 | eFlag1));
+
+ f.Set(eFlag0);
+ EXPECT_TRUE(f.AnySet(eFlag0 | eFlag1));
+
+ f.Set(eFlag1);
+ EXPECT_TRUE(f.AnySet(eFlag0 | eFlag1));
+
+ f.Clear(eFlag1);
+ EXPECT_TRUE(f.AnySet(eFlag0 | eFlag1));
+
+ f.Clear(eFlag0);
+ EXPECT_FALSE(f.AnySet(eFlag0 | eFlag1));
+}
+
+TEST(Flags, Test) {
+ Flags f;
+
+ EXPECT_FALSE(f.Test(eFlag0));
+ EXPECT_FALSE(f.Test(eFlag1));
+ EXPECT_FALSE(f.Test(eFlag2));
+
+ f.Set(eFlag0);
+ EXPECT_TRUE(f.Test(eFlag0));
+ EXPECT_FALSE(f.Test(eFlag1));
+ EXPECT_FALSE(f.Test(eFlag2));
+
+ f.Set(eFlag1);
+ EXPECT_TRUE(f.Test(eFlag0));
+ EXPECT_TRUE(f.Test(eFlag1));
+ EXPECT_FALSE(f.Test(eFlag2));
+
+ f.Clear(eFlag0);
+ EXPECT_FALSE(f.Test(eFlag0));
+ EXPECT_TRUE(f.Test(eFlag1));
+ EXPECT_FALSE(f.Test(eFlag2));
+
+ // FIXME: Should Flags assert on Test(eFlag0 | eFlag1) (more than one bit)?
+}
+
+TEST(Flags, AllClear) {
+ Flags f;
+
+ EXPECT_TRUE(f.AllClear(eFlag0 | eFlag1));
+
+ f.Set(eFlag0);
+ EXPECT_FALSE(f.AllClear(eFlag0 | eFlag1));
+
+ f.Set(eFlag1);
+ f.Clear(eFlag0);
+ EXPECT_FALSE(f.AllClear(eFlag0 | eFlag1));
+
+ f.Clear(eFlag1);
+ EXPECT_TRUE(f.AnyClear(eFlag0 | eFlag1));
+}
+
+TEST(Flags, AnyClear) {
+ Flags f;
+ EXPECT_TRUE(f.AnyClear(eFlag0 | eFlag1));
+
+ f.Set(eFlag0);
+ EXPECT_TRUE(f.AnyClear(eFlag0 | eFlag1));
+
+ f.Set(eFlag1);
+ f.Set(eFlag0);
+ EXPECT_FALSE(f.AnyClear(eFlag0 | eFlag1));
+
+ f.Clear(eFlag1);
+ EXPECT_TRUE(f.AnyClear(eFlag0 | eFlag1));
+
+ f.Clear(eFlag0);
+ EXPECT_TRUE(f.AnyClear(eFlag0 | eFlag1));
+}
+
+TEST(Flags, IsClear) {
+ Flags f;
+
+ EXPECT_TRUE(f.IsClear(eFlag0));
+ EXPECT_TRUE(f.IsClear(eFlag1));
+
+ f.Set(eFlag0);
+ EXPECT_FALSE(f.IsClear(eFlag0));
+ EXPECT_TRUE(f.IsClear(eFlag1));
+
+ f.Set(eFlag1);
+ EXPECT_FALSE(f.IsClear(eFlag0));
+ EXPECT_FALSE(f.IsClear(eFlag1));
+
+ f.Clear(eFlag0);
+ EXPECT_TRUE(f.IsClear(eFlag0));
+ EXPECT_FALSE(f.IsClear(eFlag1));
+
+ f.Clear(eFlag1);
+ EXPECT_TRUE(f.IsClear(eFlag0));
+ EXPECT_TRUE(f.IsClear(eFlag1));
+}
+
+TEST(Flags, ClearCount) {
+ Flags f;
+ EXPECT_EQ(32U, f.ClearCount());
+
+ f.Set(eFlag0);
+ EXPECT_EQ(31U, f.ClearCount());
+
+ f.Set(eFlag0);
+ EXPECT_EQ(31U, f.ClearCount());
+
+ f.Set(eFlag1);
+ EXPECT_EQ(30U, f.ClearCount());
+
+ f.Set(eAllFlags);
+ EXPECT_EQ(29U, f.ClearCount());
+}
+
+TEST(Flags, SetCount) {
+ Flags f;
+ EXPECT_EQ(0U, f.SetCount());
+
+ f.Set(eFlag0);
+ EXPECT_EQ(1U, f.SetCount());
+
+ f.Set(eFlag0);
+ EXPECT_EQ(1U, f.SetCount());
+
+ f.Set(eFlag1);
+ EXPECT_EQ(2U, f.SetCount());
+
+ f.Set(eAllFlags);
+ EXPECT_EQ(3U, f.SetCount());
+}
diff --git a/unittests/Utility/LogTest.cpp b/unittests/Utility/LogTest.cpp
index 61fb6b5e4a5b..e4e5002a7f8b 100644
--- a/unittests/Utility/LogTest.cpp
+++ b/unittests/Utility/LogTest.cpp
@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
+#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "lldb/Utility/Log.h"
@@ -26,19 +27,6 @@ static constexpr uint32_t default_flags = FOO;
static Log::Channel test_channel(test_categories, default_flags);
-struct LogChannelTest : public ::testing::Test {
- void TearDown() override { Log::DisableAllLogChannels(); }
-
- static void SetUpTestCase() {
- Log::Register("chan", test_channel);
- }
-
- static void TearDownTestCase() {
- Log::Unregister("chan");
- llvm::llvm_shutdown();
- }
-};
-
// Wrap enable, disable and list functions to make them easier to test.
static bool EnableChannel(std::shared_ptr<llvm::raw_ostream> stream_sp,
uint32_t log_options, llvm::StringRef channel,
@@ -64,6 +52,63 @@ static bool ListCategories(llvm::StringRef channel, std::string &result) {
return Log::ListChannelCategories(channel, result_stream);
}
+namespace {
+// A test fixture which provides tests with a pre-registered channel.
+struct LogChannelTest : public ::testing::Test {
+ void TearDown() override { Log::DisableAllLogChannels(); }
+
+ static void SetUpTestCase() {
+ Log::Register("chan", test_channel);
+ }
+
+ static void TearDownTestCase() {
+ Log::Unregister("chan");
+ llvm::llvm_shutdown();
+ }
+};
+
+// A test fixture which provides tests with a pre-registered and pre-enabled
+// channel. Additionally, the messages written to that channel are captured and
+// made available via getMessage().
+class LogChannelEnabledTest : public LogChannelTest {
+ llvm::SmallString<0> m_messages;
+ std::shared_ptr<llvm::raw_svector_ostream> m_stream_sp =
+ std::make_shared<llvm::raw_svector_ostream>(m_messages);
+ Log *m_log;
+ size_t m_consumed_bytes = 0;
+
+protected:
+ std::shared_ptr<llvm::raw_ostream> getStream() { return m_stream_sp; }
+ Log *getLog() { return m_log; }
+ llvm::StringRef takeOutput();
+ llvm::StringRef logAndTakeOutput(llvm::StringRef Message);
+
+public:
+ void SetUp() override;
+};
+} // end anonymous namespace
+
+void LogChannelEnabledTest::SetUp() {
+ LogChannelTest::SetUp();
+
+ std::string error;
+ ASSERT_TRUE(EnableChannel(m_stream_sp, 0, "chan", {}, error));
+
+ m_log = test_channel.GetLogIfAll(FOO);
+ ASSERT_NE(nullptr, m_log);
+}
+
+llvm::StringRef LogChannelEnabledTest::takeOutput() {
+ llvm::StringRef result = m_stream_sp->str().drop_front(m_consumed_bytes);
+ m_consumed_bytes+= result.size();
+ return result;
+}
+
+llvm::StringRef LogChannelEnabledTest::logAndTakeOutput(llvm::StringRef Message) {
+ LLDB_LOG(m_log, "{0}", Message);
+ return takeOutput();
+}
+
TEST(LogTest, LLDB_LOG_nullptr) {
Log *log = nullptr;
LLDB_LOG(log, "{0}", 0); // Shouldn't crash
@@ -165,116 +210,105 @@ TEST_F(LogChannelTest, List) {
EXPECT_EQ("Invalid log channel 'chanchan'.\n", list);
}
-static std::string GetLogString(uint32_t log_options, const char *format,
- int arg) {
- std::string message;
- std::shared_ptr<llvm::raw_string_ostream> stream_sp(
- new llvm::raw_string_ostream(message));
- std::string error;
- llvm::raw_string_ostream error_stream(error);
- EXPECT_TRUE(
- Log::EnableLogChannel(stream_sp, log_options, "chan", {}, error_stream));
-
- Log *log = test_channel.GetLogIfAll(FOO);
- EXPECT_NE(nullptr, log);
-
- LLDB_LOG(log, format, arg);
- EXPECT_TRUE(Log::DisableLogChannel("chan", {}, error_stream));
-
- return stream_sp->str();
-}
-
-TEST_F(LogChannelTest, log_options) {
- EXPECT_EQ("Hello World 47\n", GetLogString(0, "Hello World {0}", 47));
- EXPECT_EQ("Hello World 47\n",
- GetLogString(LLDB_LOG_OPTION_THREADSAFE, "Hello World {0}", 47));
+TEST_F(LogChannelEnabledTest, log_options) {
+ std::string Err;
+ EXPECT_EQ("Hello World\n", logAndTakeOutput("Hello World"));
+ EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_THREADSAFE, "chan", {},
+ Err));
+ EXPECT_EQ("Hello World\n", logAndTakeOutput("Hello World"));
{
- std::string msg =
- GetLogString(LLDB_LOG_OPTION_PREPEND_SEQUENCE, "Hello World {0}", 47);
+ EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_SEQUENCE,
+ "chan", {}, Err));
+ llvm::StringRef Msg = logAndTakeOutput("Hello World");
int seq_no;
- EXPECT_EQ(1, sscanf(msg.c_str(), "%d Hello World 47", &seq_no));
+ EXPECT_EQ(1, sscanf(Msg.str().c_str(), "%d Hello World", &seq_no));
}
- EXPECT_EQ(
- "LogTest.cpp:GetLogString Hello "
- "World 47\n",
- GetLogString(LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION, "Hello World {0}", 47));
+ {
+ EXPECT_TRUE(EnableChannel(getStream(), LLDB_LOG_OPTION_PREPEND_FILE_FUNCTION,
+ "chan", {}, Err));
+ llvm::StringRef Msg = logAndTakeOutput("Hello World");
+ char File[12];
+ char Function[17];
+
+ sscanf(Msg.str().c_str(), "%[^:]:%s Hello World", File, Function);
+ EXPECT_STRCASEEQ("LogTest.cpp", File);
+ EXPECT_STREQ("logAndTakeOutput", Function);
+ }
- EXPECT_EQ(llvm::formatv("[{0,0+4}/{1,0+4}] Hello World 47\n", ::getpid(),
+ EXPECT_TRUE(EnableChannel(
+ getStream(), LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD, "chan", {}, Err));
+ EXPECT_EQ(llvm::formatv("[{0,0+4}/{1,0+4}] Hello World\n", ::getpid(),
llvm::get_threadid())
.str(),
- GetLogString(LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD,
- "Hello World {0}", 47));
+ logAndTakeOutput("Hello World"));
+}
+
+TEST_F(LogChannelEnabledTest, LLDB_LOG_ERROR) {
+ LLDB_LOG_ERROR(getLog(), llvm::Error::success(), "Foo failed: {0}");
+ ASSERT_EQ("", takeOutput());
+
+ LLDB_LOG_ERROR(getLog(),
+ llvm::make_error<llvm::StringError>(
+ "My Error", llvm::inconvertibleErrorCode()),
+ "Foo failed: {0}");
+ ASSERT_EQ("Foo failed: My Error\n", takeOutput());
+
+ // Doesn't log, but doesn't assert either
+ LLDB_LOG_ERROR(nullptr,
+ llvm::make_error<llvm::StringError>(
+ "My Error", llvm::inconvertibleErrorCode()),
+ "Foo failed: {0}");
}
-TEST_F(LogChannelTest, LogThread) {
+TEST_F(LogChannelEnabledTest, LogThread) {
// Test that we are able to concurrently write to a log channel and disable
// it.
- std::string message;
- std::shared_ptr<llvm::raw_string_ostream> stream_sp(
- new llvm::raw_string_ostream(message));
std::string err;
- EXPECT_TRUE(EnableChannel(stream_sp, 0, "chan", {}, err));
-
- Log *log = test_channel.GetLogIfAll(FOO);
// Start logging on one thread. Concurrently, try disabling the log channel.
- std::thread log_thread([log] { LLDB_LOG(log, "Hello World"); });
+ std::thread log_thread([this] { LLDB_LOG(getLog(), "Hello World"); });
EXPECT_TRUE(DisableChannel("chan", {}, err));
log_thread.join();
// The log thread either managed to write to the log in time, or it didn't. In
// either case, we should not trip any undefined behavior (run the test under
// TSAN to verify this).
- EXPECT_TRUE(stream_sp->str() == "" || stream_sp->str() == "Hello World\n")
- << "str(): " << stream_sp->str();
+ EXPECT_THAT(takeOutput(), testing::AnyOf("", "Hello World\n"));
}
-TEST_F(LogChannelTest, LogVerboseThread) {
+TEST_F(LogChannelEnabledTest, LogVerboseThread) {
// Test that we are able to concurrently check the verbose flag of a log
// channel and enable it.
- std::string message;
- std::shared_ptr<llvm::raw_string_ostream> stream_sp(
- new llvm::raw_string_ostream(message));
std::string err;
- EXPECT_TRUE(EnableChannel(stream_sp, 0, "chan", {}, err));
-
- Log *log = test_channel.GetLogIfAll(FOO);
// Start logging on one thread. Concurrently, try enabling the log channel
// (with different log options).
- std::thread log_thread([log] { LLDB_LOGV(log, "Hello World"); });
- EXPECT_TRUE(EnableChannel(stream_sp, LLDB_LOG_OPTION_VERBOSE, "chan",
- {}, err));
+ std::thread log_thread([this] { LLDB_LOGV(getLog(), "Hello World"); });
+ EXPECT_TRUE(
+ EnableChannel(getStream(), LLDB_LOG_OPTION_VERBOSE, "chan", {}, err));
log_thread.join();
- EXPECT_TRUE(DisableChannel("chan", {}, err));
// The log thread either managed to write to the log, or it didn't. In either
// case, we should not trip any undefined behavior (run the test under TSAN to
// verify this).
- EXPECT_TRUE(stream_sp->str() == "" || stream_sp->str() == "Hello World\n")
- << "str(): " << stream_sp->str();
+ EXPECT_THAT(takeOutput(), testing::AnyOf("", "Hello World\n"));
}
-TEST_F(LogChannelTest, LogGetLogThread) {
+TEST_F(LogChannelEnabledTest, LogGetLogThread) {
// Test that we are able to concurrently get mask of a Log object and disable
// it.
- std::string message;
- std::shared_ptr<llvm::raw_string_ostream> stream_sp(
- new llvm::raw_string_ostream(message));
std::string err;
- EXPECT_TRUE(EnableChannel(stream_sp, 0, "chan", {}, err));
- Log *log = test_channel.GetLogIfAll(FOO);
- // Try fetching the log on one thread. Concurrently, try disabling the log
- // channel.
+ // Try fetching the log mask on one thread. Concurrently, try disabling the
+ // log channel.
uint32_t mask;
- std::thread log_thread([log, &mask] { mask = log->GetMask().Get(); });
+ std::thread log_thread([this, &mask] { mask = getLog()->GetMask().Get(); });
EXPECT_TRUE(DisableChannel("chan", {}, err));
log_thread.join();
// The mask should be either zero of "FOO". In either case, we should not trip
// any undefined behavior (run the test under TSAN to verify this).
- EXPECT_TRUE(mask == 0 || mask == FOO) << "mask: " << mask;
+ EXPECT_THAT(mask, testing::AnyOf(0, FOO));
}
diff --git a/unittests/Utility/OptionsWithRawTest.cpp b/unittests/Utility/OptionsWithRawTest.cpp
new file mode 100644
index 000000000000..0d84fef1059c
--- /dev/null
+++ b/unittests/Utility/OptionsWithRawTest.cpp
@@ -0,0 +1,183 @@
+//===-- OptionsWithRawTest.cpp ----------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/StringList.h"
+
+using namespace lldb_private;
+
+TEST(OptionsWithRawTest, EmptyInput) {
+ // An empty string is just an empty suffix without any arguments.
+ OptionsWithRaw args("");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), "");
+}
+
+TEST(OptionsWithRawTest, SingleWhitespaceInput) {
+ // Only whitespace is just a suffix.
+ OptionsWithRaw args(" ");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), " ");
+}
+
+TEST(OptionsWithRawTest, WhitespaceInput) {
+ // Only whitespace is just a suffix.
+ OptionsWithRaw args(" ");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), " ");
+}
+
+TEST(OptionsWithRawTest, ArgsButNoDelimiter) {
+ // This counts as a suffix because there is no -- at the end.
+ OptionsWithRaw args("-foo bar");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), "-foo bar");
+}
+
+TEST(OptionsWithRawTest, ArgsButNoLeadingDash) {
+ // No leading dash means we have no arguments.
+ OptionsWithRaw args("foo bar --");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), "foo bar --");
+}
+
+TEST(OptionsWithRawTest, QuotedSuffix) {
+ // We need to have a way to escape the -- to make it usable as an argument.
+ OptionsWithRaw args("-foo \"--\" bar");
+ ASSERT_FALSE(args.HasArgs());
+ ASSERT_STREQ(args.GetRawPart().c_str(), "-foo \"--\" bar");
+}
+
+TEST(OptionsWithRawTest, EmptySuffix) {
+ // An empty suffix with arguments.
+ OptionsWithRaw args("-foo --");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo --");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "");
+}
+
+TEST(OptionsWithRawTest, EmptySuffixSingleWhitespace) {
+ // A single whitespace also countas as an empty suffix (because that usually
+ // separates the suffix from the double dash.
+ OptionsWithRaw args("-foo -- ");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "");
+}
+
+TEST(OptionsWithRawTest, WhitespaceSuffix) {
+ // A single whtiespace character as a suffix.
+ OptionsWithRaw args("-foo -- ");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), " ");
+}
+
+TEST(OptionsWithRawTest, LeadingSpaceArgs) {
+ // Whitespace before the first dash needs to be ignored.
+ OptionsWithRaw args(" -foo -- bar");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), " -foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), " -foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar");
+}
+
+TEST(OptionsWithRawTest, SingleWordSuffix) {
+ // A single word as a suffix.
+ OptionsWithRaw args("-foo -- bar");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar");
+}
+
+TEST(OptionsWithRawTest, MultiWordSuffix) {
+ // Multiple words as a suffix.
+ OptionsWithRaw args("-foo -- bar baz");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar baz");
+}
+
+TEST(OptionsWithRawTest, UnterminatedQuote) {
+ // A quote character in the suffix shouldn't influence the parsing.
+ OptionsWithRaw args("-foo -- bar \" ");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar \" ");
+}
+
+TEST(OptionsWithRawTest, TerminatedQuote) {
+ // A part of the suffix is quoted, which shouldn't influence the parsing.
+ OptionsWithRaw args("-foo -- bar \"a\" ");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "-foo ");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-foo -- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(1u, ref.size());
+ EXPECT_STREQ("-foo", ref[0]);
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar \"a\" ");
+}
+
+TEST(OptionsWithRawTest, EmptyArgsOnlySuffix) {
+ // Empty argument list, but we have a suffix.
+ OptionsWithRaw args("-- bar");
+ ASSERT_TRUE(args.HasArgs());
+ ASSERT_EQ(args.GetArgString(), "");
+ ASSERT_EQ(args.GetArgStringWithDelimiter(), "-- ");
+
+ auto ref = args.GetArgs().GetArgumentArrayRef();
+ ASSERT_EQ(0u, ref.size());
+
+ ASSERT_STREQ(args.GetRawPart().c_str(), "bar");
+}
diff --git a/unittests/Utility/StreamTeeTest.cpp b/unittests/Utility/StreamTeeTest.cpp
new file mode 100644
index 000000000000..150a8a5b1206
--- /dev/null
+++ b/unittests/Utility/StreamTeeTest.cpp
@@ -0,0 +1,197 @@
+//===-- StreamTeeTest.cpp ---------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Utility/StreamTee.h"
+#include "lldb/Utility/StreamString.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+
+TEST(StreamTeeTest, DefaultConstructor) {
+ // Test the default constructor.
+ StreamTee tee;
+ ASSERT_EQ(0U, tee.GetNumStreams());
+}
+
+TEST(StreamTeeTest, Constructor1Stream) {
+ // Test the constructor for a single stream.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ StreamTee tee(s1);
+
+ ASSERT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+}
+
+TEST(StreamTeeTest, Constructor2Streams) {
+ // Test the constructor for two streams.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ lldb::StreamSP s2(std::make_shared<StreamString>());
+ StreamTee tee(s1, s2);
+
+ ASSERT_EQ(2U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(s2, tee.GetStreamAtIndex(1U));
+}
+
+TEST(StreamTeeTest, CopyConstructor) {
+ // Test the copy constructor.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ lldb::StreamSP s2(std::make_shared<StreamString>());
+ StreamTee tee1(s1, s2);
+ StreamTee tee2(tee1);
+
+ ASSERT_EQ(2U, tee2.GetNumStreams());
+ EXPECT_EQ(s1, tee2.GetStreamAtIndex(0U));
+ EXPECT_EQ(s2, tee2.GetStreamAtIndex(1U));
+}
+
+TEST(StreamTeeTest, Assignment) {
+ // Test the assignment of StreamTee.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ lldb::StreamSP s2(std::make_shared<StreamString>());
+ StreamTee tee1(s1, s2);
+ StreamTee tee2 = tee1;
+
+ ASSERT_EQ(2U, tee2.GetNumStreams());
+ EXPECT_EQ(s1, tee2.GetStreamAtIndex(0U));
+ EXPECT_EQ(s2, tee2.GetStreamAtIndex(1U));
+}
+
+TEST(StreamTeeTest, Write) {
+ // Test that write is sent out to all children.
+ auto ss1 = new StreamString();
+ auto ss2 = new StreamString();
+ lldb::StreamSP s1(ss1);
+ lldb::StreamSP s2(ss2);
+ StreamTee tee(s1, s2);
+
+ tee << "foo";
+ tee.Flush();
+
+ ASSERT_EQ(2U, tee.GetNumStreams());
+ EXPECT_EQ("foo", ss1->GetString().str());
+ EXPECT_EQ("foo", ss2->GetString().str());
+
+ tee << "bar";
+ tee.Flush();
+ EXPECT_EQ("foobar", ss1->GetString().str());
+ EXPECT_EQ("foobar", ss2->GetString().str());
+}
+
+namespace {
+ struct FlushTestStream : public Stream {
+ unsigned m_flush_count = false;
+ void Flush() override {
+ ++m_flush_count;
+ }
+ size_t Write(const void *src, size_t src_len) override { return src_len; }
+ };
+}
+
+TEST(StreamTeeTest, Flush) {
+ // Check that Flush is distributed to all streams.
+ auto fs1 = new FlushTestStream();
+ auto fs2 = new FlushTestStream();
+ lldb::StreamSP s1(fs1);
+ lldb::StreamSP s2(fs2);
+ StreamTee tee(s1, s2);
+
+ tee << "foo";
+ tee.Flush();
+
+ ASSERT_EQ(2U, tee.GetNumStreams());
+ EXPECT_EQ(1U, fs1->m_flush_count);
+ EXPECT_EQ(1U, fs2->m_flush_count);
+
+ tee << "bar";
+ tee.Flush();
+ EXPECT_EQ(2U, fs1->m_flush_count);
+ EXPECT_EQ(2U, fs2->m_flush_count);
+}
+
+TEST(StreamTeeTest, AppendStream) {
+ // Append new streams to our StreamTee.
+ auto ss1 = new StreamString();
+ auto ss2 = new StreamString();
+ lldb::StreamSP s1(ss1);
+ lldb::StreamSP s2(ss2);
+
+ StreamTee tee;
+
+ ASSERT_EQ(0U, tee.GetNumStreams());
+
+ tee.AppendStream(s1);
+ ASSERT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+
+ tee.AppendStream(s2);
+ ASSERT_EQ(2U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(s2, tee.GetStreamAtIndex(1U));
+}
+
+TEST(StreamTeeTest, GetStreamAtIndexOutOfBounds) {
+ // The index we check for is not in the bounds of the StreamTee.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ StreamTee tee(s1);
+
+ ASSERT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1));
+}
+
+TEST(StreamTeeTest, GetStreamAtIndexOutOfBoundsEmpty) {
+ // Same as above, but with an empty StreamTee.
+ StreamTee tee;
+ ASSERT_EQ(0U, tee.GetNumStreams());
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1U));
+}
+
+TEST(StreamTeeTest, SetStreamAtIndexOverwrite) {
+ // We overwrite an existing stream at a given index.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ StreamTee tee(s1);
+
+ ASSERT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1U));
+
+ lldb::StreamSP s2(std::make_shared<StreamString>());
+ tee.SetStreamAtIndex(0U, s2);
+ EXPECT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(s2, tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1));
+}
+
+TEST(StreamTeeTest, SetStreamAtIndexOutOfBounds) {
+ // We place a new stream out of the bounds of the current StreamTee.
+ lldb::StreamSP s1(std::make_shared<StreamString>());
+ StreamTee tee(s1);
+
+ ASSERT_EQ(1U, tee.GetNumStreams());
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1U));
+
+ // Place a new stream out of bounds of the current array. The StreamTee should
+ // resize itself until it can contain this index.
+ lldb::StreamSP s2(std::make_shared<StreamString>());
+ tee.SetStreamAtIndex(4U, s2);
+ // Check that the vector has been resized.
+ EXPECT_EQ(5U, tee.GetNumStreams());
+ // Is our stream at the right place?
+ EXPECT_EQ(s2, tee.GetStreamAtIndex(4U));
+
+ // Existing stream should still be there.
+ EXPECT_EQ(s1, tee.GetStreamAtIndex(0U));
+ // Other elements are all invalid StreamSPs.
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(1U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(2U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(3U));
+ EXPECT_EQ(lldb::StreamSP(), tee.GetStreamAtIndex(5U));
+}
diff --git a/unittests/Utility/UUIDTest.cpp b/unittests/Utility/UUIDTest.cpp
new file mode 100644
index 000000000000..e84844116678
--- /dev/null
+++ b/unittests/Utility/UUIDTest.cpp
@@ -0,0 +1,84 @@
+//===-- UUIDTest.cpp --------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include "lldb/Utility/UUID.h"
+
+using namespace lldb_private;
+
+TEST(UUIDTest, RelationalOperators) {
+ UUID empty;
+ UUID a16 = UUID::fromData("1234567890123456", 16);
+ UUID b16 = UUID::fromData("1234567890123457", 16);
+ UUID a20 = UUID::fromData("12345678901234567890", 20);
+ UUID b20 = UUID::fromData("12345678900987654321", 20);
+
+ EXPECT_EQ(empty, empty);
+ EXPECT_EQ(a16, a16);
+ EXPECT_EQ(a20, a20);
+
+ EXPECT_NE(a16, b16);
+ EXPECT_NE(a20, b20);
+ EXPECT_NE(a16, a20);
+ EXPECT_NE(empty, a16);
+
+ EXPECT_LT(empty, a16);
+ EXPECT_LT(a16, a20);
+ EXPECT_LT(a16, b16);
+ EXPECT_GT(a20, b20);
+}
+
+TEST(UUIDTest, Validity) {
+ UUID empty;
+ std::vector<uint8_t> zeroes(20, 0);
+ UUID a16 = UUID::fromData(zeroes.data(), 16);
+ UUID a20 = UUID::fromData(zeroes.data(), 20);
+ UUID a16_0 = UUID::fromOptionalData(zeroes.data(), 16);
+ UUID a20_0 = UUID::fromOptionalData(zeroes.data(), 20);
+ EXPECT_FALSE(empty);
+ EXPECT_TRUE(a16);
+ EXPECT_TRUE(a20);
+ EXPECT_FALSE(a16_0);
+ EXPECT_FALSE(a20_0);
+}
+
+TEST(UUIDTest, SetFromStringRef) {
+ UUID u;
+ EXPECT_EQ(32u, u.SetFromStringRef("404142434445464748494a4b4c4d4e4f"));
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNO", 16), u);
+
+ EXPECT_EQ(36u, u.SetFromStringRef("40-41-42-43-4445464748494a4b4c4d4e4f"));
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNO", 16), u);
+
+ EXPECT_EQ(45u, u.SetFromStringRef(
+ "40-41-42-43-4445464748494a4b4c4d4e4f-50515253", 20));
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNOPQRS", 20), u);
+
+ EXPECT_EQ(0u, u.SetFromStringRef("40-41-42-43-4445464748494a4b4c4d4e4f", 20));
+ EXPECT_EQ(0u, u.SetFromStringRef("40xxxxx"));
+ EXPECT_EQ(0u, u.SetFromStringRef(""));
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNOPQRS", 20), u)
+ << "uuid was changed by failed parse calls";
+
+ EXPECT_EQ(
+ 32u, u.SetFromStringRef("404142434445464748494a4b4c4d4e4f-50515253", 16));
+ EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNO", 16), u);
+}
+
+TEST(UUIDTest, StringConverion) {
+ EXPECT_EQ("40414243", UUID::fromData("@ABC", 4).GetAsString());
+ EXPECT_EQ("40414243-4445-4647", UUID::fromData("@ABCDEFG", 8).GetAsString());
+ EXPECT_EQ("40414243-4445-4647-4849-4A4B",
+ UUID::fromData("@ABCDEFGHIJK", 12).GetAsString());
+ EXPECT_EQ("40414243-4445-4647-4849-4A4B4C4D4E4F",
+ UUID::fromData("@ABCDEFGHIJKLMNO", 16).GetAsString());
+ EXPECT_EQ("40414243-4445-4647-4849-4A4B4C4D4E4F-50515253",
+ UUID::fromData("@ABCDEFGHIJKLMNOPQRS", 20).GetAsString());
+}
diff --git a/unittests/Utility/VMRangeTest.cpp b/unittests/Utility/VMRangeTest.cpp
new file mode 100644
index 000000000000..db35c73c7499
--- /dev/null
+++ b/unittests/Utility/VMRangeTest.cpp
@@ -0,0 +1,152 @@
+//===-- VMRangeTest.cpp -----------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "gtest/gtest.h"
+
+#include <limits>
+
+#include "lldb/Utility/VMRange.h"
+
+using namespace lldb_private;
+
+namespace lldb_private {
+void PrintTo(const VMRange &v, std::ostream *os) {
+ (*os) << "VMRange(" << v.GetBaseAddress() << ", " << v.GetEndAddress() << ")";
+}
+} // namespace lldb_private
+
+TEST(VMRange, IsValid) {
+ VMRange range;
+ EXPECT_FALSE(range.IsValid());
+
+ range.Reset(0x1, 0x100);
+ EXPECT_TRUE(range.IsValid());
+
+ range.Reset(0x1, 0x1);
+ EXPECT_FALSE(range.IsValid());
+}
+
+TEST(VMRange, Clear) {
+ VMRange range(0x100, 0x200);
+ EXPECT_NE(VMRange(), range);
+ range.Clear();
+ EXPECT_EQ(VMRange(), range);
+}
+
+TEST(VMRange, Comparison) {
+ VMRange range1(0x100, 0x200);
+ VMRange range2(0x100, 0x200);
+ EXPECT_EQ(range1, range2);
+
+ EXPECT_NE(VMRange(0x100, 0x1ff), range1);
+ EXPECT_NE(VMRange(0x100, 0x201), range1);
+ EXPECT_NE(VMRange(0x0ff, 0x200), range1);
+ EXPECT_NE(VMRange(0x101, 0x200), range1);
+
+ range2.Clear();
+ EXPECT_NE(range1, range2);
+}
+
+TEST(VMRange, Reset) {
+ VMRange range(0x100, 0x200);
+ EXPECT_FALSE(VMRange(0x200, 0x200) == range);
+ range.Reset(0x200, 0x200);
+ EXPECT_TRUE(VMRange(0x200, 0x200) == range);
+}
+
+TEST(VMRange, SetEndAddress) {
+ VMRange range(0x100, 0x200);
+
+ range.SetEndAddress(0xFF);
+ EXPECT_EQ(0U, range.GetByteSize());
+ EXPECT_FALSE(range.IsValid());
+
+ range.SetEndAddress(0x101);
+ EXPECT_EQ(1U, range.GetByteSize());
+ EXPECT_TRUE(range.IsValid());
+}
+
+TEST(VMRange, ContainsAddr) {
+ VMRange range(0x100, 0x200);
+
+ EXPECT_FALSE(range.Contains(0x00));
+ EXPECT_FALSE(range.Contains(0xFF));
+ EXPECT_TRUE(range.Contains(0x100));
+ EXPECT_TRUE(range.Contains(0x101));
+ EXPECT_TRUE(range.Contains(0x1FF));
+ EXPECT_FALSE(range.Contains(0x200));
+ EXPECT_FALSE(range.Contains(0x201));
+ EXPECT_FALSE(range.Contains(0xFFF));
+ EXPECT_FALSE(range.Contains(std::numeric_limits<lldb::addr_t>::max()));
+}
+
+TEST(VMRange, ContainsRange) {
+ VMRange range(0x100, 0x200);
+
+ EXPECT_FALSE(range.Contains(VMRange(0x0, 0x0)));
+
+ EXPECT_FALSE(range.Contains(VMRange(0x0, 0x100)));
+ EXPECT_FALSE(range.Contains(VMRange(0x0, 0x101)));
+ EXPECT_TRUE(range.Contains(VMRange(0x100, 0x105)));
+ EXPECT_TRUE(range.Contains(VMRange(0x101, 0x105)));
+ EXPECT_TRUE(range.Contains(VMRange(0x100, 0x1FF)));
+ EXPECT_TRUE(range.Contains(VMRange(0x105, 0x200)));
+ EXPECT_FALSE(range.Contains(VMRange(0x105, 0x201)));
+ EXPECT_FALSE(range.Contains(VMRange(0x200, 0x201)));
+ EXPECT_TRUE(range.Contains(VMRange(0x100, 0x200)));
+ EXPECT_FALSE(
+ range.Contains(VMRange(0x105, std::numeric_limits<lldb::addr_t>::max())));
+
+ // Empty range.
+ EXPECT_TRUE(range.Contains(VMRange(0x100, 0x100)));
+
+ range.Clear();
+ EXPECT_FALSE(range.Contains(VMRange(0x0, 0x0)));
+}
+
+TEST(VMRange, Ordering) {
+ VMRange range1(0x44, 0x200);
+ VMRange range2(0x100, 0x1FF);
+ VMRange range3(0x100, 0x200);
+
+ EXPECT_LE(range1, range1);
+ EXPECT_GE(range1, range1);
+
+ EXPECT_LT(range1, range2);
+ EXPECT_LT(range2, range3);
+
+ EXPECT_GT(range2, range1);
+ EXPECT_GT(range3, range2);
+
+ // Ensure that < and > are always false when comparing ranges with themselves.
+ EXPECT_FALSE(range1 < range1);
+ EXPECT_FALSE(range2 < range2);
+ EXPECT_FALSE(range3 < range3);
+
+ EXPECT_FALSE(range1 > range1);
+ EXPECT_FALSE(range2 > range2);
+ EXPECT_FALSE(range3 > range3);
+}
+
+TEST(VMRange, CollectionContains) {
+ VMRange::collection collection = {VMRange(0x100, 0x105),
+ VMRange(0x108, 0x110)};
+
+ EXPECT_FALSE(VMRange::ContainsValue(collection, 0xFF));
+ EXPECT_TRUE(VMRange::ContainsValue(collection, 0x100));
+ EXPECT_FALSE(VMRange::ContainsValue(collection, 0x105));
+ EXPECT_TRUE(VMRange::ContainsValue(collection, 0x109));
+
+ EXPECT_TRUE(VMRange::ContainsRange(collection, VMRange(0x100, 0x104)));
+ EXPECT_TRUE(VMRange::ContainsRange(collection, VMRange(0x108, 0x100)));
+ EXPECT_FALSE(VMRange::ContainsRange(collection, VMRange(0xFF, 0x100)));
+
+ // TODO: Implement and test ContainsRange with values that span multiple
+ // ranges in the collection.
+}
diff --git a/unittests/tools/CMakeLists.txt b/unittests/tools/CMakeLists.txt
index e3816217bb4b..e4fc3e62c087 100644
--- a/unittests/tools/CMakeLists.txt
+++ b/unittests/tools/CMakeLists.txt
@@ -1,3 +1,8 @@
if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
- add_subdirectory(lldb-server)
+ if (CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_DEBUGSERVER)
+ # These tests are meant to test lldb-server/debugserver in isolation, and
+ # don't provide any value if run against a server copied from somewhere.
+ else()
+ add_subdirectory(lldb-server)
+ endif()
endif()
diff --git a/unittests/tools/lldb-server/CMakeLists.txt b/unittests/tools/lldb-server/CMakeLists.txt
index 14df6e64b2ac..dcbd9bed529f 100644
--- a/unittests/tools/lldb-server/CMakeLists.txt
+++ b/unittests/tools/lldb-server/CMakeLists.txt
@@ -13,7 +13,7 @@ add_lldb_test_executable(thread_inferior inferior/thread_inferior.cpp)
add_lldb_test_executable(environment_check inferior/environment_check.cpp)
if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
- add_definitions(-DLLDB_SERVER="$<TARGET_FILE:debugserver>" -DLLDB_SERVER_IS_DEBUGSERVER=1)
+ add_definitions(-DLLDB_SERVER="${DEBUGSERVER_PATH}" -DLLDB_SERVER_IS_DEBUGSERVER=1)
else()
add_definitions(-DLLDB_SERVER="$<TARGET_FILE:lldb-server>" -DLLDB_SERVER_IS_DEBUGSERVER=0)
endif()
diff --git a/unittests/tools/lldb-server/tests/LLGSTest.cpp b/unittests/tools/lldb-server/tests/LLGSTest.cpp
index 8733adefa389..fab84f7dd6b5 100644
--- a/unittests/tools/lldb-server/tests/LLGSTest.cpp
+++ b/unittests/tools/lldb-server/tests/LLGSTest.cpp
@@ -46,3 +46,25 @@ TEST_F(TestBase, DS_TEST(DebugserverEnv)) {
HasValue(testing::Property(&StopReply::getKind,
WaitStatus{WaitStatus::Exit, 0})));
}
+
+TEST_F(TestBase, LLGS_TEST(vAttachRichError)) {
+ auto ClientOr = TestClient::launch(getLogFileName(),
+ {getInferiorPath("environment_check")});
+ ASSERT_THAT_EXPECTED(ClientOr, Succeeded());
+ auto &Client = **ClientOr;
+
+ // Until we enable error strings we should just get the error code.
+ ASSERT_THAT_ERROR(Client.SendMessage("vAttach;1"),
+ Failed<ErrorInfoBase>(testing::Property(
+ &ErrorInfoBase::message, "Error 255")));
+
+ ASSERT_THAT_ERROR(Client.SendMessage("QEnableErrorStrings"), Succeeded());
+
+ // Now, we expect the full error message.
+ ASSERT_THAT_ERROR(
+ Client.SendMessage("vAttach;1"),
+ Failed<ErrorInfoBase>(testing::Property(
+ &ErrorInfoBase::message,
+ testing::StartsWith(
+ "cannot attach to process 1 when another process with pid"))));
+}
diff --git a/unittests/tools/lldb-server/tests/MessageObjects.cpp b/unittests/tools/lldb-server/tests/MessageObjects.cpp
index e5927d037f98..27fd78ec4bde 100644
--- a/unittests/tools/lldb-server/tests/MessageObjects.cpp
+++ b/unittests/tools/lldb-server/tests/MessageObjects.cpp
@@ -8,16 +8,17 @@
//===----------------------------------------------------------------------===//
#include "MessageObjects.h"
-#include "lldb/Utility/StructuredData.h"
+#include "lldb/Utility/Args.h"
+#include "lldb/Utility/StringExtractor.h"
#include "llvm/ADT/StringExtras.h"
#include "gtest/gtest.h"
using namespace lldb_private;
+using namespace lldb;
using namespace llvm;
-using namespace llvm::support;
namespace llgs_tests {
-Expected<ProcessInfo> ProcessInfo::Create(StringRef response) {
+Expected<ProcessInfo> ProcessInfo::create(StringRef response) {
ProcessInfo process_info;
auto elements_or_error = SplitUniquePairList("ProcessInfo", response);
if (!elements_or_error)
@@ -53,36 +54,50 @@ Expected<ProcessInfo> ProcessInfo::Create(StringRef response) {
lldb::pid_t ProcessInfo::GetPid() const { return m_pid; }
-endianness ProcessInfo::GetEndian() const { return m_endian; }
+support::endianness ProcessInfo::GetEndian() const { return m_endian; }
//====== ThreadInfo ============================================================
-ThreadInfo::ThreadInfo(StringRef name, StringRef reason,
- const RegisterMap &registers, unsigned int signal)
- : m_name(name.str()), m_reason(reason.str()), m_registers(registers),
- m_signal(signal) {}
-
-StringRef ThreadInfo::ReadRegister(unsigned int register_id) const {
- return m_registers.lookup(register_id);
+ThreadInfo::ThreadInfo(StringRef name, StringRef reason, RegisterMap registers,
+ unsigned int)
+ : m_name(name.str()), m_reason(reason.str()),
+ m_registers(std::move(registers)) {}
+
+const RegisterValue *ThreadInfo::ReadRegister(unsigned int Id) const {
+ auto Iter = m_registers.find(Id);
+ return Iter == m_registers.end() ? nullptr : &Iter->getSecond();
}
-Expected<uint64_t>
-ThreadInfo::ReadRegisterAsUint64(unsigned int register_id) const {
- uint64_t value;
- std::string value_str(m_registers.lookup(register_id));
- if (!llvm::to_integer(value_str, value, 16))
- return make_parsing_error("ThreadInfo value for register {0}: {1}",
- register_id, value_str);
+//====== JThreadsInfo ==========================================================
- sys::swapByteOrder(value);
- return value;
+Expected<RegisterMap>
+JThreadsInfo::parseRegisters(const StructuredData::Dictionary &Dict,
+ ArrayRef<RegisterInfo> RegInfos) {
+ RegisterMap Result;
+
+ auto KeysObj = Dict.GetKeys();
+ auto Keys = KeysObj->GetAsArray();
+ for (size_t i = 0; i < Keys->GetSize(); i++) {
+ StringRef KeyStr, ValueStr;
+ Keys->GetItemAtIndexAsString(i, KeyStr);
+ Dict.GetValueForKeyAsString(KeyStr, ValueStr);
+ unsigned int Register;
+ if (!llvm::to_integer(KeyStr, Register, 10))
+ return make_parsing_error("JThreadsInfo: register key[{0}]", i);
+
+ auto RegValOr =
+ parseRegisterValue(RegInfos[Register], ValueStr, support::big);
+ if (!RegValOr)
+ return RegValOr.takeError();
+ Result[Register] = std::move(*RegValOr);
+ }
+ return std::move(Result);
}
-//====== JThreadsInfo ==========================================================
-Expected<JThreadsInfo> JThreadsInfo::Create(StringRef response,
- endianness endian) {
+Expected<JThreadsInfo> JThreadsInfo::create(StringRef Response,
+ ArrayRef<RegisterInfo> RegInfos) {
JThreadsInfo jthreads_info;
- StructuredData::ObjectSP json = StructuredData::ParseJSON(response);
+ StructuredData::ObjectSP json = StructuredData::ParseJSON(Response);
StructuredData::Array *array = json->GetAsArray();
if (!array)
return make_parsing_error("JThreadsInfo: JSON array");
@@ -106,23 +121,11 @@ Expected<JThreadsInfo> JThreadsInfo::Create(StringRef response,
if (!register_dict)
return make_parsing_error("JThreadsInfo: registers JSON obj");
- RegisterMap registers;
-
- auto keys_obj = register_dict->GetKeys();
- auto keys = keys_obj->GetAsArray();
- for (size_t i = 0; i < keys->GetSize(); i++) {
- StringRef key_str, value_str;
- keys->GetItemAtIndexAsString(i, key_str);
- register_dict->GetValueForKeyAsString(key_str, value_str);
- unsigned int register_id;
- if (key_str.getAsInteger(10, register_id))
- return make_parsing_error("JThreadsInfo: register key[{0}]", i);
-
- registers[register_id] = value_str.str();
- }
-
+ auto RegsOr = parseRegisters(*register_dict, RegInfos);
+ if (!RegsOr)
+ return RegsOr.takeError();
jthreads_info.m_thread_infos[tid] =
- ThreadInfo(name, reason, registers, signal);
+ ThreadInfo(name, reason, std::move(*RegsOr), signal);
}
return jthreads_info;
@@ -132,20 +135,138 @@ const ThreadInfoMap &JThreadsInfo::GetThreadInfos() const {
return m_thread_infos;
}
+Expected<RegisterInfo> RegisterInfoParser::create(StringRef Response) {
+ auto ElementsOr = SplitUniquePairList("RegisterInfoParser", Response);
+ if (!ElementsOr)
+ return ElementsOr.takeError();
+ auto &Elements = *ElementsOr;
+
+ RegisterInfo Info = {
+ nullptr, // Name
+ nullptr, // Alt name
+ 0, // byte size
+ 0, // offset
+ eEncodingUint, // encoding
+ eFormatHex, // format
+ {
+ LLDB_INVALID_REGNUM, // eh_frame reg num
+ LLDB_INVALID_REGNUM, // DWARF reg num
+ LLDB_INVALID_REGNUM, // generic reg num
+ 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
+ };
+ Info.name = ConstString(Elements["name"]).GetCString();
+ if (!Info.name)
+ return make_parsing_error("qRegisterInfo: name");
+
+ Info.alt_name = ConstString(Elements["alt-name"]).GetCString();
+
+ if (!to_integer(Elements["bitsize"], Info.byte_size, 10))
+ return make_parsing_error("qRegisterInfo: bit-size");
+ Info.byte_size /= CHAR_BIT;
+
+ if (!to_integer(Elements["offset"], Info.byte_offset, 10))
+ return make_parsing_error("qRegisterInfo: offset");
+
+ Info.encoding = Args::StringToEncoding(Elements["encoding"]);
+ if (Info.encoding == eEncodingInvalid)
+ return make_parsing_error("qRegisterInfo: encoding");
+
+ Info.format = StringSwitch<Format>(Elements["format"])
+ .Case("binary", eFormatBinary)
+ .Case("decimal", eFormatDecimal)
+ .Case("hex", eFormatHex)
+ .Case("float", eFormatFloat)
+ .Case("vector-sint8", eFormatVectorOfSInt8)
+ .Case("vector-uint8", eFormatVectorOfUInt8)
+ .Case("vector-sint16", eFormatVectorOfSInt16)
+ .Case("vector-uint16", eFormatVectorOfUInt16)
+ .Case("vector-sint32", eFormatVectorOfSInt32)
+ .Case("vector-uint32", eFormatVectorOfUInt32)
+ .Case("vector-float32", eFormatVectorOfFloat32)
+ .Case("vector-uint64", eFormatVectorOfUInt64)
+ .Case("vector-uint128", eFormatVectorOfUInt128)
+ .Default(eFormatInvalid);
+ if (Info.format == eFormatInvalid)
+ return make_parsing_error("qRegisterInfo: format");
+
+ Info.kinds[eRegisterKindGeneric] =
+ Args::StringToGenericRegister(Elements["generic"]);
+
+ return std::move(Info);
+}
+
+Expected<RegisterValue> parseRegisterValue(const RegisterInfo &Info,
+ StringRef HexValue,
+ llvm::support::endianness Endian,
+ bool ZeroPad) {
+ SmallString<128> Storage;
+ if (ZeroPad && HexValue.size() < Info.byte_size * 2) {
+ Storage.insert(Storage.begin(), Info.byte_size * 2 - HexValue.size(), '0');
+ Storage += HexValue;
+ HexValue = Storage;
+ }
+
+ SmallVector<uint8_t, 64> Bytes(HexValue.size() / 2);
+ StringExtractor(HexValue).GetHexBytes(Bytes, '\xcc');
+ RegisterValue Value;
+ Status ST;
+ Value.SetFromMemoryData(
+ &Info, Bytes.data(), Bytes.size(),
+ Endian == support::little ? eByteOrderLittle : eByteOrderBig, ST);
+ if (ST.Fail())
+ return ST.ToError();
+ return Value;
+}
+
//====== StopReply =============================================================
Expected<std::unique_ptr<StopReply>>
-StopReply::create(StringRef Response, llvm::support::endianness Endian) {
+StopReply::create(StringRef Response, llvm::support::endianness Endian,
+ ArrayRef<RegisterInfo> RegInfos) {
if (Response.size() < 3)
return make_parsing_error("StopReply: Invalid packet");
if (Response.consume_front("T"))
- return StopReplyStop::create(Response, Endian);
+ return StopReplyStop::create(Response, Endian, RegInfos);
if (Response.consume_front("W"))
return StopReplyExit::create(Response);
return make_parsing_error("StopReply: Invalid packet");
}
+Expected<RegisterMap> StopReplyStop::parseRegisters(
+ const StringMap<SmallVector<StringRef, 2>> &Elements,
+ support::endianness Endian, ArrayRef<lldb_private::RegisterInfo> RegInfos) {
+
+ RegisterMap Result;
+ for (const auto &E : Elements) {
+ StringRef Key = E.getKey();
+ const auto &Val = E.getValue();
+ if (Key.size() != 2)
+ continue;
+
+ unsigned int Reg;
+ if (!to_integer(Key, Reg, 16))
+ continue;
+
+ if (Val.size() != 1)
+ return make_parsing_error(
+ "StopReplyStop: multiple entries for register field [{0:x}]", Reg);
+
+ auto RegValOr = parseRegisterValue(RegInfos[Reg], Val[0], Endian);
+ if (!RegValOr)
+ return RegValOr.takeError();
+ Result[Reg] = std::move(*RegValOr);
+ }
+ return std::move(Result);
+}
+
Expected<std::unique_ptr<StopReplyStop>>
-StopReplyStop::create(StringRef Response, llvm::support::endianness Endian) {
+StopReplyStop::create(StringRef Response, support::endianness Endian,
+ ArrayRef<RegisterInfo> RegInfos) {
unsigned int Signal;
StringRef SignalStr = Response.take_front(2);
Response = Response.drop_front(2);
@@ -176,40 +297,32 @@ StopReplyStop::create(StringRef Response, llvm::support::endianness Endian) {
if (Threads.size() != Pcs.size())
return make_parsing_error("StopReply: thread/PC count mismatch");
- U64Map ThreadPcs;
+ RegisterMap ThreadPcs;
+ const RegisterInfo *PcInfo = find_if(RegInfos, [](const RegisterInfo &Info) {
+ return Info.kinds[eRegisterKindGeneric] == LLDB_REGNUM_GENERIC_PC;
+ });
+ assert(PcInfo);
+
for (auto ThreadPc : zip(Threads, Pcs)) {
lldb::tid_t Id;
- uint64_t Pc;
if (!to_integer(std::get<0>(ThreadPc), Id, 16))
return make_parsing_error("StopReply: Thread id '{0}'",
std::get<0>(ThreadPc));
- if (!to_integer(std::get<1>(ThreadPc), Pc, 16))
- return make_parsing_error("StopReply Thread Pc '{0}'",
- std::get<1>(ThreadPc));
- ThreadPcs[Id] = Pc;
+ auto PcOr = parseRegisterValue(*PcInfo, std::get<1>(ThreadPc), Endian,
+ /*ZeroPad*/ true);
+ if (!PcOr)
+ return PcOr.takeError();
+ ThreadPcs[Id] = std::move(*PcOr);
}
- RegisterMap Registers;
- for (const auto &E : Elements) {
- StringRef Key = E.getKey();
- const auto &Val = E.getValue();
- if (Key.size() != 2)
- continue;
+ auto RegistersOr = parseRegisters(Elements, Endian, RegInfos);
+ if (!RegistersOr)
+ return RegistersOr.takeError();
- unsigned int Reg;
- if (!to_integer(Key, Reg, 16))
- continue;
-
- if (Val.size() != 1)
- return make_parsing_error(
- "StopReply: multiple entries for register field [{0:x}]", Reg);
-
- Registers[Reg] = Val[0].str();
- }
-
- return llvm::make_unique<StopReplyStop>(Signal, Thread, Name, ThreadPcs,
- Registers, Reason);
+ return llvm::make_unique<StopReplyStop>(Signal, Thread, Name,
+ std::move(ThreadPcs),
+ std::move(*RegistersOr), Reason);
}
Expected<std::unique_ptr<StopReplyExit>>
@@ -251,3 +364,12 @@ StringMap<SmallVector<StringRef, 2>> SplitPairList(StringRef str) {
return pairs;
}
} // namespace llgs_tests
+
+std::ostream &lldb_private::operator<<(std::ostream &OS,
+ const RegisterValue &RegVal) {
+ ArrayRef<uint8_t> Bytes(static_cast<const uint8_t *>(RegVal.GetBytes()),
+ RegVal.GetByteSize());
+ return OS << formatv("RegisterValue[{0}]: {1:@[x-2]}", RegVal.GetByteSize(),
+ make_range(Bytes.begin(), Bytes.end()))
+ .str();
+}
diff --git a/unittests/tools/lldb-server/tests/MessageObjects.h b/unittests/tools/lldb-server/tests/MessageObjects.h
index bbb7f75bafd5..ac090c6d7f32 100644
--- a/unittests/tools/lldb-server/tests/MessageObjects.h
+++ b/unittests/tools/lldb-server/tests/MessageObjects.h
@@ -10,7 +10,9 @@
#ifndef LLDB_SERVER_TESTS_MESSAGEOBJECTS_H
#define LLDB_SERVER_TESTS_MESSAGEOBJECTS_H
+#include "lldb/Core/RegisterValue.h"
#include "lldb/Host/Host.h"
+#include "lldb/Utility/StructuredData.h"
#include "lldb/lldb-types.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/SmallString.h"
@@ -22,12 +24,13 @@
namespace llgs_tests {
class ThreadInfo;
typedef llvm::DenseMap<uint64_t, ThreadInfo> ThreadInfoMap;
-typedef llvm::DenseMap<uint64_t, uint64_t> U64Map;
-typedef llvm::DenseMap<unsigned int, std::string> RegisterMap;
+typedef llvm::DenseMap<unsigned int, lldb_private::RegisterValue> RegisterMap;
-class ProcessInfo {
+template <typename T> struct Parser { using result_type = T; };
+
+class ProcessInfo : public Parser<ProcessInfo> {
public:
- static llvm::Expected<ProcessInfo> Create(llvm::StringRef response);
+ static llvm::Expected<ProcessInfo> create(llvm::StringRef response);
lldb::pid_t GetPid() const;
llvm::support::endianness GetEndian() const;
@@ -49,37 +52,51 @@ class ThreadInfo {
public:
ThreadInfo() = default;
ThreadInfo(llvm::StringRef name, llvm::StringRef reason,
- const RegisterMap &registers, unsigned int signal);
+ RegisterMap registers, unsigned int signal);
- llvm::StringRef ReadRegister(unsigned int register_id) const;
- llvm::Expected<uint64_t> ReadRegisterAsUint64(unsigned int register_id) const;
+ const lldb_private::RegisterValue *ReadRegister(unsigned int Id) const;
private:
std::string m_name;
std::string m_reason;
RegisterMap m_registers;
- unsigned int m_signal;
};
-class JThreadsInfo {
+class JThreadsInfo : public Parser<JThreadsInfo> {
public:
- static llvm::Expected<JThreadsInfo> Create(llvm::StringRef response,
- llvm::support::endianness endian);
+ static llvm::Expected<JThreadsInfo>
+ create(llvm::StringRef Response,
+ llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
const ThreadInfoMap &GetThreadInfos() const;
private:
+ static llvm::Expected<RegisterMap>
+ parseRegisters(const lldb_private::StructuredData::Dictionary &Dict,
+ llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
+
JThreadsInfo() = default;
ThreadInfoMap m_thread_infos;
};
-class StopReply {
+struct RegisterInfoParser : public Parser<lldb_private::RegisterInfo> {
+ static llvm::Expected<lldb_private::RegisterInfo>
+ create(llvm::StringRef Response);
+};
+
+llvm::Expected<lldb_private::RegisterValue>
+parseRegisterValue(const lldb_private::RegisterInfo &Info,
+ llvm::StringRef HexValue, llvm::support::endianness Endian,
+ bool ZeroPad = false);
+
+class StopReply : public Parser<std::unique_ptr<StopReply>> {
public:
StopReply() = default;
virtual ~StopReply() = default;
static llvm::Expected<std::unique_ptr<StopReply>>
- create(llvm::StringRef response, llvm::support::endianness endian);
+ create(llvm::StringRef Response, llvm::support::endianness Endian,
+ llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
// for llvm::cast<>
virtual lldb_private::WaitStatus getKind() const = 0;
@@ -91,15 +108,17 @@ public:
class StopReplyStop : public StopReply {
public:
StopReplyStop(uint8_t Signal, lldb::tid_t ThreadId, llvm::StringRef Name,
- U64Map ThreadPcs, RegisterMap Registers, llvm::StringRef Reason)
+ RegisterMap ThreadPcs, RegisterMap Registers,
+ llvm::StringRef Reason)
: Signal(Signal), ThreadId(ThreadId), Name(Name),
ThreadPcs(std::move(ThreadPcs)), Registers(std::move(Registers)),
Reason(Reason) {}
static llvm::Expected<std::unique_ptr<StopReplyStop>>
- create(llvm::StringRef response, llvm::support::endianness endian);
+ create(llvm::StringRef Response, llvm::support::endianness Endian,
+ llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
- const U64Map &getThreadPcs() const { return ThreadPcs; }
+ const RegisterMap &getThreadPcs() const { return ThreadPcs; }
lldb::tid_t getThreadId() const { return ThreadId; }
// for llvm::cast<>
@@ -111,10 +130,15 @@ public:
}
private:
+ static llvm::Expected<RegisterMap> parseRegisters(
+ const llvm::StringMap<llvm::SmallVector<llvm::StringRef, 2>> &Elements,
+ llvm::support::endianness Endian,
+ llvm::ArrayRef<lldb_private::RegisterInfo> RegInfos);
+
uint8_t Signal;
lldb::tid_t ThreadId;
std::string Name;
- U64Map ThreadPcs;
+ RegisterMap ThreadPcs;
RegisterMap Registers;
std::string Reason;
};
@@ -156,4 +180,8 @@ llvm::Error make_parsing_error(llvm::StringRef format, Args &&... args) {
} // namespace llgs_tests
+namespace lldb_private {
+std::ostream &operator<<(std::ostream &OS, const RegisterValue &RegVal);
+}
+
#endif // LLDB_SERVER_TESTS_MESSAGEOBJECTS_H
diff --git a/unittests/tools/lldb-server/tests/TestClient.cpp b/unittests/tools/lldb-server/tests/TestClient.cpp
index 4653c2df1ce9..3dd5be2c6e8e 100644
--- a/unittests/tools/lldb-server/tests/TestClient.cpp
+++ b/unittests/tools/lldb-server/tests/TestClient.cpp
@@ -11,8 +11,8 @@
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/common/TCPSocket.h"
#include "lldb/Host/posix/ConnectionFileDescriptorPosix.h"
-#include "lldb/Interpreter/Args.h"
#include "lldb/Target/ProcessLaunchInfo.h"
+#include "lldb/Utility/Args.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/Path.h"
#include "llvm/Testing/Support/Error.h"
@@ -25,25 +25,30 @@
using namespace lldb;
using namespace lldb_private;
using namespace llvm;
-
-namespace llgs_tests {
+using namespace llgs_tests;
TestClient::TestClient(std::unique_ptr<Connection> Conn) {
SetConnection(Conn.release());
-
- SendAck(); // Send this as a handshake.
+ SetPacketTimeout(std::chrono::seconds(10));
}
TestClient::~TestClient() {
if (!IsConnected())
return;
- std::string response;
- // Debugserver (non-conformingly?) sends a reply to the k packet instead of
- // simply closing the connection.
- PacketResult result =
- IsDebugServer() ? PacketResult::Success : PacketResult::ErrorDisconnected;
- EXPECT_THAT_ERROR(SendMessage("k", response, result), Succeeded());
+ EXPECT_THAT_ERROR(SendMessage("k"), Succeeded());
+}
+
+Error TestClient::initializeConnection() {
+ if (SendAck() == 0)
+ return make_error<StringError>("Sending initial ACK failed.",
+ inconvertibleErrorCode());
+
+ if (Error E = SendMessage("QStartNoAckMode"))
+ return E;
+
+ m_send_acks = false;
+ return Error::success();
}
Expected<std::unique_ptr<TestClient>> TestClient::launch(StringRef Log) {
@@ -91,10 +96,12 @@ Expected<std::unique_ptr<TestClient>> TestClient::launchCustom(StringRef Log, Ar
ProcessLaunchInfo Info;
Info.SetArchitecture(arch_spec);
Info.SetArguments(args, true);
-
- StringList Env;
- Host::GetEnvironment(Env);
- Info.GetEnvironmentEntries() = Args(Env);
+ Info.GetEnvironment() = Host::GetEnvironment();
+ // TODO: Use this callback to detect botched launches. If lldb-server does not
+ // start, we can print a nice error message here instead of hanging in
+ // Accept().
+ Info.SetMonitorProcessCallback(&ProcessLaunchInfo::NoOpMonitorCallback,
+ false);
status = Host::LaunchProcess(Info);
if (status.Fail())
@@ -105,8 +112,11 @@ Expected<std::unique_ptr<TestClient>> TestClient::launchCustom(StringRef Log, Ar
auto Conn = llvm::make_unique<ConnectionFileDescriptor>(accept_socket);
auto Client = std::unique_ptr<TestClient>(new TestClient(std::move(Conn)));
+ if (Error E = Client->initializeConnection())
+ return std::move(E);
+
if (!InferiorArgs.empty()) {
- if (Error E = Client->QueryProcessInfo())
+ if (Error E = Client->queryProcess())
return std::move(E);
}
@@ -114,14 +124,9 @@ Expected<std::unique_ptr<TestClient>> TestClient::launchCustom(StringRef Log, Ar
}
Error TestClient::SetInferior(llvm::ArrayRef<std::string> inferior_args) {
- StringList env;
- Host::GetEnvironment(env);
- for (size_t i = 0; i < env.GetSize(); ++i) {
- if (SendEnvironmentPacket(env[i].c_str()) != 0) {
- return make_error<StringError>(
- formatv("Failed to set environment variable: {0}", env[i]).str(),
- inconvertibleErrorCode());
- }
+ if (SendEnvironment(Host::GetEnvironment()) != 0) {
+ return make_error<StringError>("Failed to set launch environment",
+ inconvertibleErrorCode());
}
std::stringstream command;
command << "A";
@@ -136,7 +141,7 @@ Error TestClient::SetInferior(llvm::ArrayRef<std::string> inferior_args) {
return E;
if (Error E = SendMessage("qLaunchSuccess"))
return E;
- if (Error E = QueryProcessInfo())
+ if (Error E = queryProcess())
return E;
return Error::success();
}
@@ -155,19 +160,12 @@ Error TestClient::ContinueThread(unsigned long thread_id) {
return Continue(formatv("vCont;c:{0:x-}", thread_id).str());
}
-const ProcessInfo &TestClient::GetProcessInfo() { return *m_process_info; }
-
-Optional<JThreadsInfo> TestClient::GetJThreadsInfo() {
- std::string response;
- if (SendMessage("jThreadsInfo", response))
- return llvm::None;
- auto creation = JThreadsInfo::Create(response, m_process_info->GetEndian());
- if (auto create_error = creation.takeError()) {
- GTEST_LOG_(ERROR) << toString(std::move(create_error));
- return llvm::None;
- }
+const llgs_tests::ProcessInfo &TestClient::GetProcessInfo() {
+ return *m_process_info;
+}
- return std::move(*creation);
+Expected<JThreadsInfo> TestClient::GetJThreadsInfo() {
+ return SendMessage<JThreadsInfo>("jThreadsInfo", m_register_infos);
}
const StopReply &TestClient::GetLatestStopReply() {
@@ -183,13 +181,9 @@ Error TestClient::SendMessage(StringRef message) {
Error TestClient::SendMessage(StringRef message, std::string &response_string) {
if (Error E = SendMessage(message, response_string, PacketResult::Success))
return E;
- if (response_string[0] == 'E') {
- return make_error<StringError>(
- formatv("Error `{0}` while sending message: {1}", response_string,
- message)
- .str(),
- inconvertibleErrorCode());
- }
+ StringExtractorGDBRemote Extractor(response_string);
+ if (Extractor.IsErrorResponse())
+ return Extractor.GetStatus().ToError();
return Error::success();
}
@@ -209,69 +203,65 @@ Error TestClient::SendMessage(StringRef message, std::string &response_string,
}
unsigned int TestClient::GetPcRegisterId() {
- if (m_pc_register != UINT_MAX)
- return m_pc_register;
-
- for (unsigned int register_id = 0;; register_id++) {
- std::string message = formatv("qRegisterInfo{0:x-}", register_id).str();
- std::string response;
- if (SendMessage(message, response)) {
- GTEST_LOG_(ERROR) << "Unable to query register ID for PC register.";
- return UINT_MAX;
- }
+ assert(m_pc_register != LLDB_INVALID_REGNUM);
+ return m_pc_register;
+}
- auto elements_or_error = SplitUniquePairList("GetPcRegisterId", response);
- if (auto split_error = elements_or_error.takeError()) {
- GTEST_LOG_(ERROR) << "GetPcRegisterId: Error splitting response: "
- << response;
- return UINT_MAX;
- }
+Error TestClient::qProcessInfo() {
+ m_process_info = None;
+ auto InfoOr = SendMessage<ProcessInfo>("qProcessInfo");
+ if (!InfoOr)
+ return InfoOr.takeError();
+ m_process_info = std::move(*InfoOr);
+ return Error::success();
+}
- auto elements = *elements_or_error;
- if (elements["alt-name"] == "pc" || elements["generic"] == "pc") {
- m_pc_register = register_id;
+Error TestClient::qRegisterInfos() {
+ for (unsigned int Reg = 0;; ++Reg) {
+ std::string Message = formatv("qRegisterInfo{0:x-}", Reg).str();
+ Expected<RegisterInfo> InfoOr = SendMessage<RegisterInfoParser>(Message);
+ if (!InfoOr) {
+ consumeError(InfoOr.takeError());
break;
}
+ m_register_infos.emplace_back(std::move(*InfoOr));
+ if (m_register_infos[Reg].kinds[eRegisterKindGeneric] ==
+ LLDB_REGNUM_GENERIC_PC)
+ m_pc_register = Reg;
}
-
- return m_pc_register;
+ if (m_pc_register == LLDB_INVALID_REGNUM)
+ return make_parsing_error("qRegisterInfo: generic");
+ return Error::success();
}
-llvm::Error TestClient::QueryProcessInfo() {
- std::string response;
- if (Error E = SendMessage("qProcessInfo", response))
+Error TestClient::queryProcess() {
+ if (Error E = qProcessInfo())
+ return E;
+ if (Error E = qRegisterInfos())
return E;
- auto create_or_error = ProcessInfo::Create(response);
- if (!create_or_error)
- return create_or_error.takeError();
- m_process_info = *create_or_error;
return Error::success();
}
Error TestClient::Continue(StringRef message) {
assert(m_process_info.hasValue());
- std::string response;
- if (Error E = SendMessage(message, response))
- return E;
- auto creation = StopReply::create(response, m_process_info->GetEndian());
- if (Error E = creation.takeError())
- return E;
+ auto StopReplyOr = SendMessage<StopReply>(
+ message, m_process_info->GetEndian(), m_register_infos);
+ if (!StopReplyOr)
+ return StopReplyOr.takeError();
- m_stop_reply = std::move(*creation);
+ m_stop_reply = std::move(*StopReplyOr);
if (!isa<StopReplyStop>(m_stop_reply)) {
StringExtractorGDBRemote R;
PacketResult result = ReadPacket(R, GetPacketTimeout(), false);
if (result != PacketResult::ErrorDisconnected) {
return make_error<StringError>(
- formatv("Expected connection close after receiving {0}. Got {1}/{2} "
+ formatv("Expected connection close after sending {0}. Got {1}/{2} "
"instead.",
- response, result, R.GetStringRef())
+ message, result, R.GetStringRef())
.str(),
inconvertibleErrorCode());
}
}
return Error::success();
}
-
-} // namespace llgs_tests
diff --git a/unittests/tools/lldb-server/tests/TestClient.h b/unittests/tools/lldb-server/tests/TestClient.h
index b5195307876d..286c871f4735 100644
--- a/unittests/tools/lldb-server/tests/TestClient.h
+++ b/unittests/tools/lldb-server/tests/TestClient.h
@@ -59,7 +59,7 @@ public:
llvm::Error ContinueAll();
llvm::Error ContinueThread(unsigned long thread_id);
const ProcessInfo &GetProcessInfo();
- llvm::Optional<JThreadsInfo> GetJThreadsInfo();
+ llvm::Expected<JThreadsInfo> GetJThreadsInfo();
const StopReply &GetLatestStopReply();
template <typename T> llvm::Expected<const T &> GetLatestStopReplyAs() {
assert(m_stop_reply);
@@ -74,12 +74,19 @@ public:
std::string &response_string);
llvm::Error SendMessage(llvm::StringRef message, std::string &response_string,
PacketResult expected_result);
+
+ template <typename P, typename... CreateArgs>
+ llvm::Expected<typename P::result_type> SendMessage(llvm::StringRef Message,
+ CreateArgs &&... Args);
unsigned int GetPcRegisterId();
private:
TestClient(std::unique_ptr<lldb_private::Connection> Conn);
- llvm::Error QueryProcessInfo();
+ llvm::Error initializeConnection();
+ llvm::Error qProcessInfo();
+ llvm::Error qRegisterInfos();
+ llvm::Error queryProcess();
llvm::Error Continue(llvm::StringRef message);
std::string FormatFailedResult(
const std::string &message,
@@ -88,9 +95,19 @@ private:
llvm::Optional<ProcessInfo> m_process_info;
std::unique_ptr<StopReply> m_stop_reply;
- unsigned int m_pc_register = UINT_MAX;
+ std::vector<lldb_private::RegisterInfo> m_register_infos;
+ unsigned int m_pc_register = LLDB_INVALID_REGNUM;
};
+template <typename P, typename... CreateArgs>
+llvm::Expected<typename P::result_type>
+TestClient::SendMessage(llvm::StringRef Message, CreateArgs &&... Args) {
+ std::string ResponseText;
+ if (llvm::Error E = SendMessage(Message, ResponseText))
+ return std::move(E);
+ return P::create(ResponseText, std::forward<CreateArgs>(Args)...);
+}
+
} // namespace llgs_tests
#endif // LLDB_SERVER_TESTS_TESTCLIENT_H
diff --git a/unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp b/unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp
index 6ff777bd17ab..efc9517bc4b4 100644
--- a/unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp
+++ b/unittests/tools/lldb-server/tests/ThreadIdsInJstopinfoTest.cpp
@@ -9,13 +9,19 @@
#include "TestBase.h"
#include "TestClient.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Path.h"
#include "llvm/Testing/Support/Error.h"
+#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include <string>
using namespace llgs_tests;
+using namespace lldb_private;
using namespace llvm;
+using namespace lldb;
+using namespace testing;
TEST_F(StandardStartupTest, TestStopReplyContainsThreadPcs) {
// This inferior spawns 4 threads, then forces a break.
@@ -29,7 +35,7 @@ TEST_F(StandardStartupTest, TestStopReplyContainsThreadPcs) {
ASSERT_NE(pc_reg, UINT_MAX);
auto jthreads_info = Client->GetJThreadsInfo();
- ASSERT_TRUE(jthreads_info);
+ ASSERT_THAT_EXPECTED(jthreads_info, Succeeded());
auto stop_reply = Client->GetLatestStopReplyAs<StopReplyStop>();
ASSERT_THAT_EXPECTED(stop_reply, Succeeded());
@@ -42,9 +48,7 @@ TEST_F(StandardStartupTest, TestStopReplyContainsThreadPcs) {
unsigned long tid = stop_reply_pc.first;
ASSERT_TRUE(thread_infos.find(tid) != thread_infos.end())
<< "Thread ID: " << tid << " not in JThreadsInfo.";
- auto pc_value = thread_infos[tid].ReadRegisterAsUint64(pc_reg);
- ASSERT_THAT_EXPECTED(pc_value, Succeeded());
- ASSERT_EQ(stop_reply_pcs[tid], *pc_value)
- << "Mismatched PC for thread: " << tid;
+ EXPECT_THAT(thread_infos[tid].ReadRegister(pc_reg),
+ Pointee(Eq(stop_reply_pc.second)));
}
}
diff --git a/utils/lldb-dotest/CMakeLists.txt b/utils/lldb-dotest/CMakeLists.txt
new file mode 100644
index 000000000000..f1d85a4a6c81
--- /dev/null
+++ b/utils/lldb-dotest/CMakeLists.txt
@@ -0,0 +1,22 @@
+# Make lldb-dotest a custom target.
+add_custom_target(lldb-dotest)
+add_dependencies(lldb-dotest ${LLDB_TEST_DEPS})
+
+get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
+
+# Generate wrapper for each build mode.
+if(NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".")
+ foreach(LLVM_BUILD_MODE ${CMAKE_CONFIGURATION_TYPES})
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+ string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} LLDB_DOTEST_ARGS "${LLDB_DOTEST_ARGS}")
+ configure_file(
+ lldb-dotest.in
+ ${LLDB_DOTEST_DIR}/lldb-dotest
+ )
+ endforeach()
+else()
+ configure_file(
+ lldb-dotest.in
+ ${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb-dotest
+ )
+endif()
diff --git a/utils/lldb-dotest/lldb-dotest.in b/utils/lldb-dotest/lldb-dotest.in
new file mode 100755
index 000000000000..c6cd8cbe746c
--- /dev/null
+++ b/utils/lldb-dotest/lldb-dotest.in
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+import subprocess
+import sys
+
+dotest_path = '@LLDB_SOURCE_DIR@/test/dotest.py'
+dotest_args_str = '@LLDB_DOTEST_ARGS@'
+
+if __name__ == '__main__':
+ wrapper_args = sys.argv[1:]
+ dotest_args = dotest_args_str.split(';')
+ # Build dotest.py command.
+ cmd = [dotest_path, '-q']
+ cmd.extend(dotest_args)
+ cmd.extend(wrapper_args)
+ # Invoke dotest.py and return exit code.
+ sys.exit(subprocess.call(cmd))
diff --git a/www/architecture/index.html b/www/architecture/index.html
index 312476fe6edf..e4fe32175c36 100755
--- a/www/architecture/index.html
+++ b/www/architecture/index.html
@@ -130,7 +130,6 @@
<ul>
<li>Address (section offset addressing)</li>
<li>AddressRange</li>
- <li>Architecture specification</li>
<li>Broadcaster / Event / Listener </li>
<li>Communication classes that use Connection objects</li>
<li>Mangled names</li>
@@ -276,6 +275,7 @@
</p>
<ul>
<li>Abstract path manipulation (FileSpec)</li>
+ <li>Architecture specification</li>
<li>Data buffers (DataBuffer, DataEncoder, DataExtractor)</li>
<li>Logging</li>
<li>Structured data manipulation (JSON)</li>
diff --git a/www/build.html b/www/build.html
index c5d050c4d4e1..fd35b5116ba6 100755
--- a/www/build.html
+++ b/www/build.html
@@ -116,14 +116,15 @@
the PYTHONHOME environment variable if it is specified).
</li>
<li>
- <b>LLDB_TEST_COMPILER</b>: The test suite needs to be able to find a copy of clang.exe that it can use to compile
- inferior programs. Note that MSVC is not supported here, it <strong>must</strong> be a path to a clang executable.
- Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster.
- This can be a path to any recent clang.exe, including one you built yourself.
+ <b>LLDB_TEST_C_COMPILER</b> or <b>LLDB_TEST_CXX_COMPILER</b>: The test suite needs to be able to find a copy of clang.exe
+ that it can use to compile inferior programs. Note that MSVC is not supported here, it <strong>must</strong> be a path to a
+ clang executable. Note that using a release clang.exe is strongly recommended here, as it will make the test suite run much faster.
+ This can be a path to any recent clang.exe, including one you built yourself. These variables are ignored unless the respective
+ <strong>LLDB_TEST_USE_CUSTOM_C_COMPILER</strong> and <strong>LLDB_TEST_USE_CUSTOM_CXX_COMPILER</strong> are set to ON.
</li>
</ul>
Sample command line:<br/>
- <code>cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm</code>
+ <code>cmake -G Ninja -DLLDB_TEST_DEBUG_TEST_CRASHES=1 -DPYTHON_HOME=C:\Python35 -DLLDB_TEST_USE_CUSTOM_C_COMPILER=ON -DLLDB_TEST_C_COMPILER=d:\src\llvmbuild\ninja_release\bin\clang.exe ..\..\llvm</code>
<h2>Working with both Ninja and MSVC</h2>
<p>
Compiling with <code>ninja</code> is both faster and simpler than compiling with MSVC, but chances are you still want
diff --git a/www/features.html b/www/features.html
index 92431a3d2e24..790772318def 100755
--- a/www/features.html
+++ b/www/features.html
@@ -38,7 +38,7 @@
for an executable object.</li>
<li>Disassembly plug-ins for each architecture. Support currently includes
an LLVM disassembler for <a href="http://blog.llvm.org/2010/01/x86-disassembler.html">i386, x86-64</a>
- , &amp; ARM/Thumb.</li>
+ , ARM/Thumb, and PPC64le</li>
<li>Debugger plug-ins implement the host and target specific functions
required to debug.</li>
</ul>
@@ -57,4 +57,4 @@
</div>
</div>
</body>
-</html> \ No newline at end of file
+</html>
diff --git a/www/index.html b/www/index.html
index 83849954aac9..bc8b01ae70a0 100755
--- a/www/index.html
+++ b/www/index.html
@@ -52,14 +52,14 @@
<div class="postcontent">
<p>LLDB currently converts debug information into clang types so that
it can leverage the clang compiler infrastructure.
- This allows LLDB to support the latest C, C++, Objective C and Objective C++
+ This allows LLDB to support the latest C, C++, Objective-C and Objective-C++
language features and runtimes in expressions without having to reimplement <b>any</b>
of this functionality. It also leverages the compiler to take care of all ABI
details when making functions calls for expressions, when disassembling
instructions and extracting instruction details, and much more.
<p>The major benefits include:</p>
<ul>
- <li>Up to date language support for C, C++, Objective C</li>
+ <li>Up to date language support for C, C++, Objective-C</li>
<li>Multi-line expressions that can declare local variables and types</li>
<li>Utilize the JIT for expressions when supported</li>
<li>Evaluate expression Intermediate Representation (IR) when JIT can't be used</li>
@@ -92,7 +92,7 @@
<li>Mac OS X desktop user space debugging for i386 and x86-64</li>
<li>iOS simulator debugging on i386</li>
<li>iOS device debugging on ARM</li>
- <li>Linux local user-space debugging for i386 and x86-64</li>
+ <li>Linux local user-space debugging for i386, x86-64 and PPC64le</li>
<li>FreeBSD local user-space debugging for i386 and x86-64</li>
<li>Windows local user-space debugging for i386 (*)</li>
</ul>
diff --git a/www/lldb-gdb.html b/www/lldb-gdb.html
index 69179bd8c07c..8cd387d10d66 100755
--- a/www/lldb-gdb.html
+++ b/www/lldb-gdb.html
@@ -380,7 +380,7 @@
</td>
</tr>
- <tr><td class="header" colspan="2">Set a breakpoint at all Objective C methods whose selector is <b>count</b>.</td></tr>
+ <tr><td class="header" colspan="2">Set a breakpoint at all Objective-C methods whose selector is <b>count</b>.</td></tr>
<tr>
<td class="content">
<b>(gdb)</b> break count<br>
diff --git a/www/projects.html b/www/projects.html
index ff571998add5..ca4fa1a5d1d8 100755
--- a/www/projects.html
+++ b/www/projects.html
@@ -403,6 +403,20 @@
</li>
<li>
+ Convert the dotest style tests to use lldbutil.run_to_source_breakpoint.
+
+ <p>
+ run_to_source_breakpoint & run_to_name_breakpoint provide a compact API that
+ does in one line what the first 10 or 20 lines of most of the old tests now do by
+ hand. Using these functions makes tests much more readable, and by centralizing
+ common functionality will make maintaining the testsuites easier in the future.
+ This is more of a finger exercise, and perhaps best implemented by a rule like:
+ &quotIf you touch a test case, and it isn't using run_to_source_breakpoint, please
+ make it do so&quot.
+ </p>
+ </li>
+
+ <li>
Unify Watchpoint's & Breakpoints.
<p>
Option handling isn't shared, and more importantly the PerformAction's have a lot
diff --git a/www/remote.html b/www/remote.html
index 1d0dc7b4b0f0..bfd0b63e566c 100644
--- a/www/remote.html
+++ b/www/remote.html
@@ -133,7 +133,7 @@
"<code>remote-</code>". For example, to debug a remote Linux application:
<br>
<code>
- <br>(lldb) <b>patform select remote-linux</b>
+ <br>(lldb) <b>platform select remote-linux</b>
</code>
<p>
@@ -215,7 +215,7 @@
<h4>Install and run by specifying a remote install path</h4>
<p>
If you want the "a.out" executable to be installed into
- "/bin/a.out" instead of the platorm's current working directory,
+ "/bin/a.out" instead of the platform's current working directory,
we can set the platform file specification using python:
<br>
<code>
@@ -225,7 +225,7 @@
</code>
<p>
Now when you run your program, the program will be uploaded to
- "/bin/a.out" instead of the the platform current working directory.
+ "/bin/a.out" instead of the platform current working directory.
Only the main executable is uploaded to the remote system by
default when launching the application. If you have shared
libraries that should also be uploaded, then you can add the
diff --git a/www/status.html b/www/status.html
index 6fc71421c7c7..09dff8cf28b3 100755
--- a/www/status.html
+++ b/www/status.html
@@ -21,7 +21,7 @@
<div class="postcontent">
<p>LLDB has matured a lot in the last year and can be used for
- C, C++ and Objective C development for x86_64, i386 and ARM debugging.
+ C, C++ and Objective-C development for x86_64, i386 and ARM debugging.
The entire public API is exposed though a framework on Mac OS X which
is used by Xcode, the lldb command line tool, and can also be used by
Python. The entire public API is exposed through script bridging which
@@ -60,7 +60,7 @@
<tr>
<th>Feature</th>
<th>FreeBSD<br>(x86_64)</th>
- <th>Linux<br>(x86_64)</th>
+ <th>Linux<br>(x86_64 and PPC64le)</th>
<th>Mac OS X (i386/x86_64 and ARM/Thumb)</th>
<th>Windows (i386)</th>
</tr>
diff --git a/www/test.html b/www/test.html
index 8208f1f223b8..5a771fd179d9 100644
--- a/www/test.html
+++ b/www/test.html
@@ -39,8 +39,10 @@
The easiest way to run the LLDB test suite is to use the <tt>check-lldb</tt> build
target. By default, the <tt>check-lldb</tt> target builds the test programs with
the same compiler that was used to build LLDB. To build the tests with a different
- compiler, you can set the <strong>LLDB_TEST_COMPILER</strong> CMake variable. It is possible to
- customize the architecture of the test binaries and compiler used by appending -A
+ compiler, you can set the <strong>LLDB_TEST_C_COMPILER</strong> or the <strong>LLDB_TEST_CXX_COMPILER</strong> CMake variables.
+ These variables are ignored unless the respective <strong>LLDB_TEST_USE_CUSTOM_C_COMPILER</strong> and
+ <strong>LLDB_TEST_USE_CUSTOM_CXX_COMPILER</strong> are set to ON.
+ It is possible to customize the architecture of the test binaries and compiler used by appending -A
and -C options respectively to the CMake variable <strong>LLDB_TEST_USER_ARGS</strong>. For
example, to test LLDB against 32-bit binaries
built with a custom version of clang, do:
diff --git a/www/tutorial.html b/www/tutorial.html
index 217ea17aac63..c351635f63f7 100755
--- a/www/tutorial.html
+++ b/www/tutorial.html
@@ -94,7 +94,7 @@
</code>
<p>You can use the --name option multiple times to make a breakpoint on a set of functions as well. This is convenient
- since it allows you to set commmon conditions or commands without having to specify them multiple times:</p>
+ since it allows you to set common conditions or commands without having to specify them multiple times:</p>
<code>
(lldb) breakpoint set --name foo --name bar
@@ -109,7 +109,7 @@
<br>(lldb) breakpoint set -M foo
</code>
- <p>To set a breakpoint Objective C selectors named <code>alignLeftEdges:</code> you can enter either of:</p>
+ <p>To set a breakpoint Objective-C selectors named <code>alignLeftEdges:</code> you can enter either of:</p>
<code>
(lldb) breakpoint set --selector alignLeftEdges: